Class: SectionDecorator
- Inherits:
-
FHIR::Composition::Section
- Object
- FHIR::Composition::Section
- SectionDecorator
- Defined in:
- lib/au_ps_inferno/utils/section_decorator.rb
Overview
Decorator for FHIR::Composition::Section
Instance Method Summary collapse
- #code_display_str ⇒ Object
- #empty_reason_str ⇒ Object
- #entry_references ⇒ Object
- #get_entry_index_by_reference(reference) ⇒ Object
Instance Method Details
#code_display_str ⇒ Object
20 21 22 |
# File 'lib/au_ps_inferno/utils/section_decorator.rb', line 20 def code_display_str "#{code.coding.first.display || title} (#{code.coding.first.code})" end |
#empty_reason_str ⇒ Object
13 14 15 16 17 18 |
# File 'lib/au_ps_inferno/utils/section_decorator.rb', line 13 def empty_reason_str er_coding = emptyReason&.coding&.first return unless er_coding.present? "#{er_coding.display} (#{er_coding.code})" end |
#entry_references ⇒ Object
9 10 11 |
# File 'lib/au_ps_inferno/utils/section_decorator.rb', line 9 def entry_references entry&.map(&:reference) || [] end |
#get_entry_index_by_reference(reference) ⇒ Object
5 6 7 |
# File 'lib/au_ps_inferno/utils/section_decorator.rb', line 5 def get_entry_index_by_reference(reference) entry&.index { |entr| entr.reference == reference } end |