Class: HealthDataStandards::Import::CDA::ProviderImporter
- Inherits:
-
SectionImporter
- Object
- SectionImporter
- HealthDataStandards::Import::CDA::ProviderImporter
- Includes:
- ProviderImportUtils, Singleton
- Defined in:
- lib/health-data-standards/import/cda/provider_importer.rb
Instance Attribute Summary
Attributes inherited from SectionImporter
#check_for_usable, #code_xpath, #status_xpath
Instance Method Summary collapse
-
#extract_providers(doc) ⇒ Array
Extract Healthcare Providers from C32.
-
#initialize ⇒ ProviderImporter
constructor
A new instance of ProviderImporter.
Methods included from ProviderImportUtils
#extract_provider, #find_or_create_provider
Methods inherited from SectionImporter
#create_entries, #create_entry
Methods included from LocatableImportUtils
#import_address, #import_telecom
Constructor Details
#initialize ⇒ ProviderImporter
Returns a new instance of ProviderImporter.
10 11 12 |
# File 'lib/health-data-standards/import/cda/provider_importer.rb', line 10 def initialize end |
Instance Method Details
#extract_providers(doc) ⇒ Array
Extract Healthcare Providers from C32
21 22 23 24 25 26 27 |
# File 'lib/health-data-standards/import/cda/provider_importer.rb', line 21 def extract_providers(doc) performers = doc.xpath("//cda:documentationOf/cda:serviceEvent/cda:performer") performers.map do |performer| provider_perf = extract_provider_data(performer, true) ProviderPerformance.new(start_date: provider_perf.delete(:start), end_date: provider_perf.delete(:end), provider: find_or_create_provider(provider_perf)) end end |