Sha256: 76fd8bc3d953b644da31a7e9fa0d0cfb0d91355cf57c464edd4489b4525f177f

Contents?: true

Size: 1.33 KB

Versions: 2

Compression:

Stored size: 1.33 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={})
            
            
            
            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

2 entries across 2 versions & 1 rubygems

Version Path
health-data-standards-1.0.1 lib/health-data-standards/import/c32/care_goal_importer.rb
health-data-standards-1.0.0 lib/health-data-standards/import/c32/care_goal_importer.rb