Class: Renalware::Patients::PatientDrop

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
app/drops/renalware/patients/patient_drop.rb

Instance Method Summary collapse

Constructor Details

#initialize(patient) ⇒ PatientDrop

Returns a new instance of PatientDrop.



16
17
18
# File 'app/drops/renalware/patients/patient_drop.rb', line 16

def initialize(patient)
  @patient = patient
end

Instance Method Details

#born_onObject



20
21
22
# File 'app/drops/renalware/patients/patient_drop.rb', line 20

def born_on
  I18n.l(patient.born_on)
end

#current_modalityObject



32
33
34
# File 'app/drops/renalware/patients/patient_drop.rb', line 32

def current_modality
  patient.current_modality&.to_s
end

#diabeticObject



36
37
38
# File 'app/drops/renalware/patients/patient_drop.rb', line 36

def diabetic
  patient.diabetic? ? "Yes" : "No"
end

#hospital_identifierObject



24
25
26
# File 'app/drops/renalware/patients/patient_drop.rb', line 24

def hospital_identifier
  patient.hospital_identifier&.to_s
end

#nameObject



28
29
30
# File 'app/drops/renalware/patients/patient_drop.rb', line 28

def name
  patient.to_s(:default)
end