Class: HealthDataStandards::Import::GreenC32::CareGoalImporter

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/health-data-standards/import/green_c32/care_goal_importer.rb

Instance Method Summary collapse

Constructor Details

#initializeCareGoalImporter

Returns a new instance of CareGoalImporter.



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

def initialize
end

Instance Method Details

#import(care_goal_xml) ⇒ Object



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

def import(care_goal_xml)
  importer = case care_goal_xml.at_xpath("/*").try(:name)
             when "medication" then MedicationImporter.instance
             when "immunization" then ImmunizationImporter.instance
             when "procedure" then ProcedureImporter.instance
             when "encounter" then EncounterImporter.instance
             when "medicalEquipment" then MedicalEquipmentImporter.instance
             else SectionImporter.new
             end
        
  return importer.import(care_goal_xml)
end