Sha256: 5eff8b99198358bfacb1130d042e9f2e8b16234e9ff3c63ce4494be43165b84a

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

module HealthDataStandards
  module Import
    module GreenC32
      class ImmunizationImporter < SectionImporter
        include Singleton
        
        def import(immunization_xml)
          immunization_xml.root.add_namespace_definition('gc32', "urn:hl7-org:greencda:c32")
          immunization_element = immunization_xml.at_xpath("./gc32:immunization")
          immunization = Immunization.new
          extract_entry(immunization_element, immunization)
          extract_time(immunization_element, immunization, "./gc32:effectiveTime")
          extract_code(immunization_element, immunization, "./gc32:refusalReason")
          series_number = extract_node_text(immunization_element.at_xpath("./gc32:seriesNumber"))
          immunization.series_number = series_number.to_i if series_number
          immunization.refusalInd = extract_node_attribute(immunization_element, :refused, true)
          immunization
        end
        
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
health-data-standards-1.0.1 lib/health-data-standards/import/green_c32/immunization_importer.rb
health-data-standards-1.0.0 lib/health-data-standards/import/green_c32/immunization_importer.rb