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)


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

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

#doseObject



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

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

#drug_type_namesObject



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

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

#patient_current_modality_nameObject



15
16
17
18
19
# 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



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

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

#route_codeObject



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

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