Class: Renalware::HD::MDMPresenter
Constant Summary
collapse
- NullObject =
Naught.build do |config|
config.black_hole
config.define_explicit_conversions
config.singleton
config.predicates_return false
end
Instance Attribute Summary
Attributes inherited from MDMPresenter
#patient, #view_context
Instance Method Summary
collapse
#clinic_visits, #clinic_visits_having_measurements, #current_immunosuppressant_prescriptions, #current_prescriptions, #current_problems, #esa_prescriptions, #events_of_type, #historical_immunosuppressant_prescriptions, #historical_prescriptions, #initialize, #letters, #pathology, #pathology_for_codes
Instance Method Details
#access ⇒ Object
35
36
37
38
39
40
41
42
43
44
|
# File 'app/presenters/renalware/hd/mdm_presenter.rb', line 35
def access
@access ||= begin
access_profile = Renalware::Accesses.cast_patient(patient).current_profile
if access_profile.present?
Accesses::ProfilePresenter.new(access_profile)
else
NullObject.instance
end
end
end
|
#audits ⇒ Object
50
51
52
|
# File 'app/presenters/renalware/hd/mdm_presenter.rb', line 50
def audits
@audits ||= PatientStatistics.for_patient(patient).limit(6).ordered
end
|
#hd_profile ⇒ Object
24
25
26
27
28
29
30
31
32
33
|
# File 'app/presenters/renalware/hd/mdm_presenter.rb', line 24
def hd_profile
@hd_profile ||= begin
profile = HD::Profile.for_patient(patient).first
if profile.present?
HD::ProfilePresenter.new(profile)
else
NullObject.instance
end
end
end
|
#preference_set ⇒ Object
46
47
48
|
# File 'app/presenters/renalware/hd/mdm_presenter.rb', line 46
def preference_set
@preference_set ||= PreferenceSet.for_patient(patient).first || NullObject.instance
end
|
#sessions ⇒ Object
15
16
17
18
19
20
21
22
|
# File 'app/presenters/renalware/hd/mdm_presenter.rb', line 15
def sessions
@sessions ||= begin
sessions = Sessions::LatestPatientSessionsQuery
.new(patient: patient)
.call(max_sessions: 6).includes(:patient, :hospital_unit)
CollectionPresenter.new(sessions, SessionPresenter, view_context)
end
end
|