Class: Renalware::Clinical::ProfilePresenter
- Inherits:
-
Object
- Object
- Renalware::Clinical::ProfilePresenter
- Defined in:
- app/presenters/renalware/clinical/profile_presenter.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#patient ⇒ Object
readonly
Returns the value of attribute patient.
Instance Method Summary collapse
- #alcohol_history ⇒ Object
- #body_compositions ⇒ Object
- #dry_weights ⇒ Object
- #history ⇒ Object
-
#initialize(patient:, params:) ⇒ ProfilePresenter
constructor
A new instance of ProfilePresenter.
- #smoking_history ⇒ Object
- #swabs ⇒ Object
Constructor Details
#initialize(patient:, params:) ⇒ ProfilePresenter
Returns a new instance of ProfilePresenter.
12 13 14 15 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 12 def initialize(patient:, params:) @params = params @patient = Clinical.cast_patient(patient) end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
8 9 10 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 8 def params @params end |
#patient ⇒ Object (readonly)
Returns the value of attribute patient.
8 9 10 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 8 def patient @patient end |
Instance Method Details
#alcohol_history ⇒ Object
28 29 30 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 28 def alcohol_history history.alcohol || NullObject.instance end |
#body_compositions ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 46 def body_compositions @body_compositions ||= begin BodyComposition .for_patient(patient) .includes([:modality_description, :assessor]) .ordered .limit(5) end end |
#dry_weights ⇒ Object
42 43 44 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 42 def dry_weights @dry_weights ||= DryWeight.for_patient(patient).ordered.limit(5) end |
#history ⇒ Object
32 33 34 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 32 def history document.history || NullObject.instance end |
#smoking_history ⇒ Object
24 25 26 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 24 def smoking_history history.smoking || NullObject.instance end |