Sha256: 1a040f34e3c6a463af7b1f434ae77a217a2bb47cdcd4488f6393155f7c3adbfa

Contents?: true

Size: 1.05 KB

Versions: 40

Compression:

Stored size: 1.05 KB

Contents

module HealthDataStandards
  module Import
    module GreenC32
      class ConditionImporter < SectionImporter
        include Singleton
        
        def initialize
          super
        end
        
        def import(condition_xml)
          condition_xml.root.add_namespace_definition('gc32', "urn:hl7-org:greencda:c32")
          condition_element = condition_xml.xpath("./gc32:condition")
          
          condition = Condition.new

          extract_entry(condition_element, condition)
          extract_cause_of_death(condition_element, condition)
          extract_type(condition_element, condition)
          
          condition
        end
        
        private
        
        def extract_type(condition_xml, condition)
          type = condition_xml.xpath("./gc32:type").first
          condition.type = extract_node_text(type)
        end
        
        def extract_cause_of_death(condition_xml, condition)
          condition.cause_of_death = extract_node_attribute(condition_xml, "causeOfDeath")
        end
        
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
health-data-standards-3.2.3 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-3.2.2 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-3.2.1 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-3.2.0 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-3.1.1 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-3.1.0 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-3.0.6 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-3.0.5 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-3.0.4 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-3.0.3 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-2.2.1 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-2.2.0 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-2.1.4 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-2.1.3 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-2.1.2 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-2.1.1 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-2.1.0 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-2.0.0 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-1.0.1 lib/health-data-standards/import/green_c32/condition_importer.rb
health-data-standards-1.0.0 lib/health-data-standards/import/green_c32/condition_importer.rb