Sha256: 76553744423ebe6a39e9b1a31222464f6ee846b91ff89e32757049340ff4eb99

Contents?: true

Size: 973 Bytes

Versions: 2

Compression:

Stored size: 973 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:administeredDate")
          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-0.8.1 lib/health-data-standards/import/green_c32/immunization_importer.rb
health-data-standards-0.8.0 lib/health-data-standards/import/green_c32/immunization_importer.rb