Sha256: 9a938ffb1ee3d7964e7a3eb671c50ae76ca6b24acb5d4ab6f0a179b2a5c6a5c5
Contents?: true
Size: 998 Bytes
Versions: 45
Compression:
Stored size: 998 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, lambda { includes(hd_profile: :hospital_unit) .joins(<<-SQL) LEFT OUTER JOIN hd_profiles ON hd_profiles.patient_id = patients.id LEFT OUTER JOIN hospital_units ON hd_profiles.hospital_unit_id = hospital_units.id SQL .where("hd_profiles.deactivated_at is NULL") } 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
45 entries across 45 versions & 1 rubygems