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.
11 12 13 14 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 11 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
27 28 29 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 27 def alcohol_history history.alcohol || NullObject.instance end |
#body_compositions ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 45 def body_compositions @body_compositions ||= begin BodyComposition .for_patient(patient) .includes([:modality_description, :assessor]) .ordered end end |
#dry_weights ⇒ Object
41 42 43 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 41 def dry_weights @dry_weights ||= DryWeight.for_patient(patient).ordered end |
#history ⇒ Object
31 32 33 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 31 def history document.history || NullObject.instance end |
#smoking_history ⇒ Object
23 24 25 |
# File 'app/presenters/renalware/clinical/profile_presenter.rb', line 23 def smoking_history history.smoking || NullObject.instance end |