Class: Renalware::HD::ModalityDescription::AugmentedModalityName
- Inherits:
-
Object
- Object
- Renalware::HD::ModalityDescription::AugmentedModalityName
- Defined in:
- app/models/renalware/hd/modality_description.rb
Overview
This class might be better as a presenter but leaving here for now. #to_s returns e.g. “HD (HOSPCODE)” if patient’s HD profile indicates they dialyse at HOSPCODE, otherwise returns “HD”.
Instance Method Summary collapse
-
#initialize(default_name, patient) ⇒ AugmentedModalityName
constructor
A new instance of AugmentedModalityName.
- #to_s ⇒ Object
Constructor Details
#initialize(default_name, patient) ⇒ AugmentedModalityName
Returns a new instance of AugmentedModalityName.
24 25 26 27 |
# File 'app/models/renalware/hd/modality_description.rb', line 24 def initialize(default_name, patient) @patient = HD.cast_patient(patient) @default_name = default_name end |
Instance Method Details
#to_s ⇒ Object
29 30 31 32 33 |
# File 'app/models/renalware/hd/modality_description.rb', line 29 def to_s return default_name if patient.blank? || unit_code.blank? "#{default_name} (#{unit_code})" end |