Class: HealthDataStandards::Import::GreenC32::ResultImporter

Inherits:
SectionImporter
  • Object
show all
Includes:
Singleton
Defined in:
lib/health-data-standards/import/green_c32/result_importer.rb

Direct Known Subclasses

VitalSignImporter

Instance Method Summary collapse

Methods inherited from SectionImporter

#extract_address, #extract_code, #extract_description, #extract_effective_time, #extract_entry, #extract_facility, #extract_free_text, #extract_interval, #extract_name, #extract_organization, #extract_quantity, #extract_status, #extract_telecom, #extract_time, #extract_value, #generic_import

Constructor Details

#initializeResultImporter




10
11
12
13
14
15
16
# File 'lib/health-data-standards/import/green_c32/result_importer.rb', line 10

def initialize
  super
  @range = "./gc32:referenceRange"
  @interpretation = "./gc32:interpretation"
  @klass = LabResult
  @base_xpath = "./gc32:result"
end

Instance Method Details

#import(result_xml) ⇒ Object




20
21
22
23
24
25
26
27
28
29
# File 'lib/health-data-standards/import/green_c32/result_importer.rb', line 20

def import(result_xml)
  result_xml.root.add_namespace_definition('gc32', "urn:hl7-org:greencda:c32")
  
  result_element = result_xml.xpath(@base_xpath)
  lab_result = @klass.new(reference_range: extract_node_text(result_element.xpath(@range)))
  
  extract_result(result_element, lab_result)
      
  lab_result
end