Class: QRDA::Cat1::FamilyHistoryImporter
- Inherits:
-
SectionImporter
- Object
- SectionImporter
- QRDA::Cat1::FamilyHistoryImporter
- Defined in:
- lib/qrda-import/data-element-importers/family_history_importer.rb
Instance Attribute Summary
Attributes inherited from SectionImporter
#check_for_usable, #code_xpath, #codes, #codes_modifiers, #status_xpath, #warnings
Instance Method Summary collapse
- #create_entry(entry_element, nrh = NarrativeReferenceHandler.new) ⇒ Object
-
#initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:organizer[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.12']")) ⇒ FamilyHistoryImporter
constructor
A new instance of FamilyHistoryImporter.
Methods inherited from SectionImporter
#create_entries, #usable_entry?
Constructor Details
#initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:organizer[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.12']")) ⇒ FamilyHistoryImporter
Returns a new instance of FamilyHistoryImporter.
4 5 6 7 8 9 10 11 |
# File 'lib/qrda-import/data-element-importers/family_history_importer.rb', line 4 def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:organizer[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.12']")) super(entry_finder) @id_xpath = './cda:id' @code_xpath = "./cda:component/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.112']/cda:value" @author_datetime_xpath = "./cda:component/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.112']/cda:author[cda:templateId/@root='2.16.840.1.113883.10.20.24.3.155']/cda:time" @relationship_xpath = './cda:subject/cda:relatedSubject/cda:code' @entry_class = QDM::FamilyHistory end |
Instance Method Details
#create_entry(entry_element, nrh = NarrativeReferenceHandler.new) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/qrda-import/data-element-importers/family_history_importer.rb', line 13 def create_entry(entry_element, nrh = NarrativeReferenceHandler.new) family_history = super family_history.relationship = code_if_present(entry_element.at_xpath(@relationship_xpath)) entity = extract_entity(entry_element, "./cda:component/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.112']//cda:participant[@typeCode='PRF']") family_history.recorder.concat(entity) if entity family_history end |