Class: HealthDataStandards::Import::CDA::MedicalEquipmentImporter
- Inherits:
-
SectionImporter
- Object
- SectionImporter
- HealthDataStandards::Import::CDA::MedicalEquipmentImporter
- Defined in:
- lib/health-data-standards/import/cda/medical_equipment_importer.rb
Direct Known Subclasses
HealthDataStandards::Import::CCDA::MedicalEquipmentImporter, HealthDataStandards::Import::Cat1::DeviceOrderImporter
Instance Attribute Summary
Attributes inherited from SectionImporter
#check_for_usable, #code_xpath, #status_xpath
Instance Method Summary collapse
- #create_entry(entry_element, nrh = NarrativeReferenceHandler.new) ⇒ Object
- #extract_anatomical_structure(entry_element, entry) ⇒ Object
- #extract_manufacturer(entry_element, entry) ⇒ Object
- #extract_removal_time(entry_element, entry) ⇒ Object
-
#initialize(entry_finder = EntryFinder.new("//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.128']/cda:entry/cda:supply")) ⇒ MedicalEquipmentImporter
constructor
A new instance of MedicalEquipmentImporter.
Methods inherited from SectionImporter
Methods included from LocatableImportUtils
#import_address, #import_telecom
Constructor Details
#initialize(entry_finder = EntryFinder.new("//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.128']/cda:entry/cda:supply")) ⇒ MedicalEquipmentImporter
Returns a new instance of MedicalEquipmentImporter.
5 6 7 8 9 10 |
# File 'lib/health-data-standards/import/cda/medical_equipment_importer.rb', line 5 def initialize(entry_finder=EntryFinder.new("//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.128']/cda:entry/cda:supply")) super(entry_finder) @code_xpath = "./cda:participant/cda:participantRole/cda:playingDevice/cda:code" @anatomical_xpath = "./cda:targetSiteCode" @entry_class = MedicalEquipment end |
Instance Method Details
#create_entry(entry_element, nrh = NarrativeReferenceHandler.new) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/health-data-standards/import/cda/medical_equipment_importer.rb', line 12 def create_entry(entry_element, nrh = NarrativeReferenceHandler.new) medical_equipment = super extract_manufacturer(entry_element, medical_equipment) extract_anatomical_structure(entry_element, medical_equipment) extract_removal_time(entry_element, medical_equipment) extract_reason_or_negation(entry_element, medical_equipment) medical_equipment end |
#extract_anatomical_structure(entry_element, entry) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/health-data-standards/import/cda/medical_equipment_importer.rb', line 32 def extract_anatomical_structure(entry_element, entry) site = entry_element.at_xpath(@anatomical_xpath) if site entry.anatomical_structure = {"code" => site['code'], "code_system" => CodeSystemHelper.code_system_for(site['codeSystem']), "codeSystemName" => CodeSystemHelper.code_system_for(site['codeSystem']), CodeSystemHelper.code_system_for(site['codeSystem']) => [site['code']]} end end |
#extract_manufacturer(entry_element, entry) ⇒ Object
21 22 23 24 |
# File 'lib/health-data-standards/import/cda/medical_equipment_importer.rb', line 21 def extract_manufacturer(entry_element, entry) manufacturer = entry_element.at_xpath("./cda:participant/cda:participantRole/cda:scopingEntity/cda:desc").try(:inner_text) entry.manufacturer = manufacturer.strip if manufacturer end |
#extract_removal_time(entry_element, entry) ⇒ Object
26 27 28 29 30 |
# File 'lib/health-data-standards/import/cda/medical_equipment_importer.rb', line 26 def extract_removal_time(entry_element, entry) if entry_element.at_xpath("cda:effectiveTime/cda:high") entry.removal_time = HL7Helper.(entry_element.at_xpath("cda:effectiveTime/cda:high")['value']) end end |