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

Version Path
health-data-standards-3.5.3 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.5.2 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.5.1 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.5.0 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.4.6 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.4.5 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.4.4 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.4.3 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.4.2 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.4.1 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.4.0 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.2.12 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.3.0 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.2.11 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.2.10 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.2.8 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.2.7 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.2.6 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.2.5 lib/health-data-standards/import/green_c32/result_importer.rb
health-data-standards-3.2.4 lib/health-data-standards/import/green_c32/result_importer.rb