Sha256: 88e10b4f121d207ff938d3ee5ba7cce6108b6e8bc2283125d2d80f428ab1cfa6

Contents?: true

Size: 1.1 KB

Versions: 11

Compression:

Stored size: 1.1 KB

Contents

module HealthDataStandards
  module Import
    module GreenC32
      class EncounterImporter < SectionImporter
        include Singleton
        
        def initialize
          super
        end
        
        def import(encounter_xml)
          encounter = Encounter.new
          encounter_xml.root.add_namespace_definition('gc32', "urn:hl7-org:greencda:c32")
          encounter_element = encounter_xml.xpath("/gc32:encounter")
          extract_entry(encounter_element, encounter)
          extract_code(encounter_element, encounter, "./gc32:dischargeDisposition", :discharge_disposition)
          extract_code(encounter_element, encounter, "./gc32:admissionType", :admit_type)
          extract_code(encounter_element, encounter, "./gc32:reasonForVisit", :reason)
          extract_code(encounter_element, encounter)
          
          facility_element = encounter_element.at_xpath("./gc32:facility")
          if facility_element
            facility = extract_facility(facility_element)
            encounter.facility = facility
          end

          encounter
        end
        
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
health-data-standards-3.5.3 lib/health-data-standards/import/green_c32/encounter_importer.rb
health-data-standards-3.5.2 lib/health-data-standards/import/green_c32/encounter_importer.rb
health-data-standards-3.5.1 lib/health-data-standards/import/green_c32/encounter_importer.rb
health-data-standards-3.5.0 lib/health-data-standards/import/green_c32/encounter_importer.rb
health-data-standards-3.4.6 lib/health-data-standards/import/green_c32/encounter_importer.rb
health-data-standards-3.4.5 lib/health-data-standards/import/green_c32/encounter_importer.rb
health-data-standards-3.4.4 lib/health-data-standards/import/green_c32/encounter_importer.rb
health-data-standards-3.4.3 lib/health-data-standards/import/green_c32/encounter_importer.rb
health-data-standards-3.4.2 lib/health-data-standards/import/green_c32/encounter_importer.rb
health-data-standards-3.4.1 lib/health-data-standards/import/green_c32/encounter_importer.rb
health-data-standards-3.4.0 lib/health-data-standards/import/green_c32/encounter_importer.rb