Class: HealthDataStandards::Import::CDA::SectionImporter
- Inherits:
-
Object
- Object
- HealthDataStandards::Import::CDA::SectionImporter
- Includes:
- LocatableImportUtils, Util
- Defined in:
- lib/health-data-standards/import/cda/section_importer.rb
Direct Known Subclasses
HealthDataStandards::Import::C32::CareGoalImporter, HealthDataStandards::Import::C32::ImmunizationImporter, HealthDataStandards::Import::C32::InsuranceProviderImporter, AllergyImporter, CommunicationImporter, ConditionImporter, EncounterImporter, MedicalEquipmentImporter, MedicationImporter, OrganizationImporter, ProcedureImporter, ProviderImporter, ResultImporter, HealthDataStandards::Import::Cat1::AdverseEventImporter, HealthDataStandards::Import::Cat1::AllergyIntoleranceImporter, HealthDataStandards::Import::Cat1::DiagnosticStudyOrderImporter, HealthDataStandards::Import::Cat1::EcogStatusImporter, HealthDataStandards::Import::Cat1::GestationalAgeImporter, HealthDataStandards::Import::Cat1::InsuranceProviderImporter, HealthDataStandards::Import::Cat1::LabOrderImporter, HealthDataStandards::Import::Cat1::LabResultImporter, HealthDataStandards::Import::Cat1::MedicationDispensedImporter, HealthDataStandards::Import::Cat1::ProcedureIntoleranceImporter, HealthDataStandards::Import::Cat1::ProcedureOrderImporter, HealthDataStandards::Import::Cat1::SymptomActiveImporter, HealthDataStandards::Import::Cat1::TobaccoUseImporter
Instance Attribute Summary collapse
-
#check_for_usable ⇒ Object
Returns the value of attribute check_for_usable.
-
#code_xpath ⇒ Object
Returns the value of attribute code_xpath.
-
#status_xpath ⇒ Object
Returns the value of attribute status_xpath.
Instance Method Summary collapse
-
#create_entries(doc, nrh = NarrativeReferenceHandler.new) ⇒ Array
Traverses an HL7 CDA document passed in and creates an Array of Entry objects based on what it finds.
- #create_entry(entry_element, nrh = NarrativeReferenceHandler.new) ⇒ Object
-
#initialize(entry_finder) ⇒ SectionImporter
constructor
A new instance of SectionImporter.
Methods included from LocatableImportUtils
#import_address, #import_telecom
Constructor Details
#initialize(entry_finder) ⇒ SectionImporter
Returns a new instance of SectionImporter.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/health-data-standards/import/cda/section_importer.rb', line 10 def initialize(entry_finder) @entry_finder = entry_finder @code_xpath = "./cda:code" @id_xpath = "./cda:id" @status_xpath = nil @priority_xpath = nil @description_xpath = "./cda:code/cda:originalText/cda:reference[@value] | ./cda:text/cda:reference[@value]" @check_for_usable = true @entry_class = Entry @value_xpath = 'cda:value' end |
Instance Attribute Details
#check_for_usable ⇒ Object
Returns the value of attribute check_for_usable.
5 6 7 |
# File 'lib/health-data-standards/import/cda/section_importer.rb', line 5 def check_for_usable @check_for_usable end |
#code_xpath ⇒ Object
Returns the value of attribute code_xpath.
5 6 7 |
# File 'lib/health-data-standards/import/cda/section_importer.rb', line 5 def code_xpath @code_xpath end |
#status_xpath ⇒ Object
Returns the value of attribute status_xpath.
5 6 7 |
# File 'lib/health-data-standards/import/cda/section_importer.rb', line 5 def status_xpath @status_xpath end |
Instance Method Details
#create_entries(doc, nrh = NarrativeReferenceHandler.new) ⇒ Array
Traverses an HL7 CDA document passed in and creates an Array of Entry objects based on what it finds
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/health-data-standards/import/cda/section_importer.rb', line 28 def create_entries(doc, nrh = NarrativeReferenceHandler.new) entry_list = [] entry_elements = @entry_finder.entries(doc) entry_elements.each do |entry_element| entry = create_entry(entry_element, nrh) if @check_for_usable entry_list << entry if entry.usable? else entry_list << entry end end entry_list end |
#create_entry(entry_element, nrh = NarrativeReferenceHandler.new) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/health-data-standards/import/cda/section_importer.rb', line 42 def create_entry(entry_element, nrh = NarrativeReferenceHandler.new) entry = @entry_class.new extract_id(entry_element, entry) extract_codes(entry_element, entry) extract_dates(entry_element, entry) if @value_xpath extract_values(entry_element, entry) end extract_description(entry_element, entry, nrh) if @status_xpath extract_status(entry_element, entry) end entry end |