Class: HealthDataStandards::Import::CDA::OrganizationImporter

Inherits:
SectionImporter
  • Object
show all
Includes:
Singleton
Defined in:
lib/health-data-standards/import/cda/organization_importer.rb

Instance Attribute Summary

Attributes inherited from SectionImporter

#check_for_usable, #code_xpath, #status_xpath

Instance Method Summary collapse

Methods inherited from SectionImporter

#create_entries, #create_entry

Methods included from LocatableImportUtils

#import_address, #import_telecom

Constructor Details

#initializeOrganizationImporter

Returns a new instance of OrganizationImporter.



7
8
9
# File 'lib/health-data-standards/import/cda/organization_importer.rb', line 7

def initialize
  
end

Instance Method Details

#extract_organization(org_element) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/health-data-standards/import/cda/organization_importer.rb', line 11

def extract_organization(org_element)
  return unless org_element
  org = Organization.new
  org.name = org_element.at_xpath("./cda:name | ./cda:representedOrganization/cda:name").try(:text)
  org.addresses = org_element.xpath("./cda:addr").map { |addr| import_address(addr) }
  org.telecoms = org_element.xpath("./cda:telecom").map { |tele| import_telecom(tele) }
  org
end