Class: HealthDataStandards::Import::C32::CareGoalImporter

Inherits:
HealthDataStandards::Import::CDA::SectionImporter show all
Defined in:
lib/health-data-standards/import/c32/care_goal_importer.rb

Instance Attribute Summary

Attributes inherited from HealthDataStandards::Import::CDA::SectionImporter

#check_for_usable, #code_xpath, #status_xpath

Instance Method Summary collapse

Methods inherited from HealthDataStandards::Import::CDA::SectionImporter

#create_entries

Methods included from HealthDataStandards::Import::CDA::LocatableImportUtils

#import_address, #import_telecom

Constructor Details

#initialize(entry_finder = CDA::EntryFinder.new("//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']")) ⇒ CareGoalImporter

Returns a new instance of CareGoalImporter.



6
7
8
# File 'lib/health-data-standards/import/c32/care_goal_importer.rb', line 6

def initialize(entry_finder=CDA::EntryFinder.new("//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']"))
  super(entry_finder)
end

Instance Method Details

#create_entry(goal_element, nrh = CDA::NarrativeReferenceHandler.new) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/health-data-standards/import/c32/care_goal_importer.rb', line 10

def create_entry(goal_element, nrh = CDA::NarrativeReferenceHandler.new)
  importer = case goal_element.name
               when "observation" then CDA::ResultImporter.new
               when "supply" then CDA::MedicalEquipment.new
               when "substanceAdministration" then CDA::MedicationImporter.new
               when "encounter" then CDA::EncounterImporter.new
               when "procedure" then CDA::ProcedureImporter.new
               else CDA::SectionImporter.new(nil) #don't need entry xpath, since we already have the entry
               end
    
  entry = importer.create_entry(goal_element, nrh)
  extract_reason_or_negation(goal_element, entry)

  entry
end