Sha256: d13782cefa14f310c7f8b96da15cadf897b47846b1f74203052e157f6e33b488

Contents?: true

Size: 1.37 KB

Versions: 8

Compression:

Stored size: 1.37 KB

Contents

module HealthDataStandards
  module Import
    module C32
      class CareGoalImporter < SectionImporter

        def initialize
          @entry_xpath = "//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.124']/cda:entry/cda:*[cda:templateId/@root='2.16.840.1.113883.10.20.1.25']"
        end
        
        def create_entries(doc, id_map = {})
          goal_list = []
          goal_elements = doc.xpath(@entry_xpath)
          goal_elements.each do |goal_element|
            
            importer = case goal_element.name
                       when "observation" then ResultImporter.new
                       when "supply" then MedicalEquipment.new
                       when "substanceAdministration" then MedicationImporter.new
                       when "encounter" then EncounterImporter.new
                       when "procedure" then ProcedureImporter.new
                       else SectionImporter.new(nil) #don't need entry xpath, since we already have the entry
                       end
            
            entry = importer.create_entry(goal_element, id_map={})
            extract_negation(goal_element, entry)

            
            
            if @check_for_usable
              goal_list << entry if entry.usable?
            else
              goal_list << entry
            end
          end
          goal_list
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
health-data-standards-2.2.1 lib/health-data-standards/import/c32/care_goal_importer.rb
health-data-standards-2.2.0 lib/health-data-standards/import/c32/care_goal_importer.rb
health-data-standards-2.1.4 lib/health-data-standards/import/c32/care_goal_importer.rb
health-data-standards-2.1.3 lib/health-data-standards/import/c32/care_goal_importer.rb
health-data-standards-2.1.2 lib/health-data-standards/import/c32/care_goal_importer.rb
health-data-standards-2.1.1 lib/health-data-standards/import/c32/care_goal_importer.rb
health-data-standards-2.1.0 lib/health-data-standards/import/c32/care_goal_importer.rb
health-data-standards-2.0.0 lib/health-data-standards/import/c32/care_goal_importer.rb