Class: Renalware::Medications::PrescriptionPresenter

Inherits:
DumbDelegator
  • Object
show all
Defined in:
app/presenters/renalware/medications/prescription_presenter.rb

Instance Method Summary collapse

Methods inherited from DumbDelegator

#inspect, #public_send, #send, #try, #try!

Instance Method Details

#administer_on_hd?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'app/presenters/renalware/medications/prescription_presenter.rb', line 36

def administer_on_hd?
  administer_on_hd ? "Yes" : "No"
end

#doseObject



32
33
34
# File 'app/presenters/renalware/medications/prescription_presenter.rb', line 32

def dose
  "#{dose_amount} #{translated_dose_unit}"
end

#drug_type_namesObject



24
25
26
# File 'app/presenters/renalware/medications/prescription_presenter.rb', line 24

def drug_type_names
  drug_types.map(&:name).join(", ")
end

#patient_current_modality_nameObject



15
16
17
18
# File 'app/presenters/renalware/medications/prescription_presenter.rb', line 15

def patient_current_modality_name
  return unless patient_current_modality
  patient_current_modality.description.to_s
end

#patient_nameObject



11
12
13
# File 'app/presenters/renalware/medications/prescription_presenter.rb', line 11

def patient_name
  patient.to_s
end

#providerObject



28
29
30
# File 'app/presenters/renalware/medications/prescription_presenter.rb', line 28

def provider
  ::I18n.t(super, scope: "enums.provider")
end

#route_codeObject



20
21
22
# File 'app/presenters/renalware/medications/prescription_presenter.rb', line 20

def route_code
  medication_route.other? ? route_description : medication_route.code
end