Class: Renalware::HD::PatientPresenter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/presenters/renalware/hd/patient_presenter.rb

Instance Method Summary collapse

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_setObject



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_sessionsObject



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