Class: Renalware::Virology::Vaccination::Document
- Inherits:
-
Document::Embedded
- Object
- Document::Embedded
- Renalware::Virology::Vaccination::Document
- Defined in:
- app/models/renalware/virology/vaccination.rb
Instance Method Summary collapse
- #to_s ⇒ Object
-
#type_name ⇒ Object
Try and find the proper name for the vaccination type - we only store the vaccination type code in the jsonb document.
Instance Method Details
#to_s ⇒ Object
24 25 26 |
# File 'app/models/renalware/virology/vaccination.rb', line 24 def to_s [type_name, drug].reject(&:blank?).join(" - ") end |
#type_name ⇒ Object
Try and find the proper name for the vaccination type - we only store the vaccination type code in the jsonb document. If no match found just display the code eg ‘hbv_booster’. The Type mighjt have been deleted (has a deleted_at date) but we still want to display the actual name depite this, we include deleted rows when searching.
32 33 34 |
# File 'app/models/renalware/virology/vaccination.rb', line 32 def type_name VaccinationType.with_deleted.find_by(code: type)&.name || type end |