Sha256: d7e948f9f958a8b0763d23b9e11b45afa659defb41ee9381a7d8d1f2d912e6ff
Contents?: true
Size: 1.36 KB
Versions: 42
Compression:
Stored size: 1.36 KB
Contents
module HealthDataStandards module Import module GreenC32 class ResultImporter < SectionImporter include Singleton #------------------------------------------------------------------------------- def initialize super @range = "./gc32:referenceRange" @interpretation = "./gc32:interpretation" @klass = LabResult @base_xpath = "./gc32:result" end #------------------------------------------------------------------------------- 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 #------------------------------------------------------------------------------- private #------------------------------------------------------------------------------- def extract_result(result_element, lab_result) extract_entry(result_element, lab_result) extract_code(result_element, lab_result, @interpretation, :interpretation) end end end end end
Version data entries
42 entries across 42 versions & 1 rubygems