Class: SectionDecorator

Inherits:
FHIR::Composition::Section
  • Object
show all
Defined in:
lib/au_ps_inferno/utils/section_decorator.rb

Overview

Decorator for FHIR::Composition::Section

Instance Method Summary collapse

Instance Method Details

#code_display_strObject



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_strObject



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_referencesObject



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