Sha256: 670bb146b7a3b24a42cd2f1f0e6c95cfd6f85d5363baa892a9b27cbb19499353

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

module HealthDataStandards
  module Import
    module Cat1
      class DiagnosisActiveImporter < CDA::ConditionImporter

        def initialize
          super(CDA::EntryFinder.new("./cda:entry/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.11']"))
          @status_xpath = nil # We'll hardcode this to active in create entry because this is from the 
                              # diagnosis active template
          @severity_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.22.4.8']/cda:value"                    
        end

        def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
          condition = super(entry_element,nrh)
          extract_severity(entry_element,condition)
          condition
        end

        def extract_severity(entry_element,condition)
          severity = entry_element.at_xpath(@severity_xpath)
          if(severity)
            condition.severity = {CodeSystemHelper.code_system_for(severity['codeSystem']) => [severity['code']]}
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
health-data-standards-3.6.1 lib/health-data-standards/import/cat1/diagnosis_active_importer.rb
health-data-standards-3.5.3 lib/health-data-standards/import/cat1/diagnosis_active_importer.rb
health-data-standards-3.5.2 lib/health-data-standards/import/cat1/diagnosis_active_importer.rb
health-data-standards-3.5.1 lib/health-data-standards/import/cat1/diagnosis_active_importer.rb
health-data-standards-3.5.0 lib/health-data-standards/import/cat1/diagnosis_active_importer.rb
health-data-standards-3.4.6 lib/health-data-standards/import/cat1/diagnosis_active_importer.rb
health-data-standards-3.4.5 lib/health-data-standards/import/cat1/diagnosis_active_importer.rb