Class: Renalware::HD::PatientPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Renalware::HD::PatientPresenter
- Defined in:
- app/presenters/renalware/hd/patient_presenter.rb
Instance Method Summary collapse
- #current_observation_set ⇒ Object
- #finished_hd_sessions ⇒ Object
-
#initialize(patient) ⇒ PatientPresenter
constructor
A new instance of PatientPresenter.
Constructor Details
#initialize(patient) ⇒ PatientPresenter
Returns a new instance of PatientPresenter.
19 20 21 |
# File 'app/presenters/renalware/hd/patient_presenter.rb', line 19 def initialize(patient) super(HD.cast_patient(patient.__getobj__)) end |
Instance Method Details
#current_observation_set ⇒ Object
28 29 30 31 32 |
# File 'app/presenters/renalware/hd/patient_presenter.rb', line 28 def current_observation_set @current_observation_set ||= begin Renalware::Pathology::ObservationSetPresenter.new(__getobj__.current_observation_set) end end |
#finished_hd_sessions ⇒ Object
23 24 25 26 |
# File 'app/presenters/renalware/hd/patient_presenter.rb', line 23 def finished_hd_sessions # TODO: standardise on a way to get closed sessions - a scope on patient maybe? hd_sessions.eager_load(:hospital_unit).where(type: "Renalware::HD::Session::Closed") end |