Sha256: a16c595dbd1b54b47b79f50d12cc3a9a98122f0a59c62c8a1b884836997144c2

Contents?: true

Size: 706 Bytes

Versions: 6

Compression:

Stored size: 706 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/hd"

module Renalware
  module HD
    class Patient < ActiveType::Record[Renalware::Patient]
      has_one :hd_profile, class_name: "Profile"
      has_one :hd_preference_set, class_name: "PreferenceSet"
      has_many :hd_sessions, class_name: "Session"
      scope :with_profile, -> { includes(:hd_profile) }

      def treated?
        modality_descriptions.exists?(type: "Renalware::HD::ModalityDescription")
      end

      def has_ever_been_on_hd?
        @has_ever_been_on_hd ||=
          modality_descriptions.exists?(type: "Renalware::HD::ModalityDescription")
      end

      def __getobj__
        self
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
renalware-core-2.0.15 app/models/renalware/hd/patient.rb
renalware-core-2.0.14 app/models/renalware/hd/patient.rb
renalware-core-2.0.13 app/models/renalware/hd/patient.rb
renalware-core-2.0.12 app/models/renalware/hd/patient.rb
renalware-core-2.0.11 app/models/renalware/hd/patient.rb
renalware-core-2.0.9 app/models/renalware/hd/patient.rb