Class: HealthDataStandards::Import::CDA::ConditionImporter
- Inherits:
-
SectionImporter
- Object
- SectionImporter
- HealthDataStandards::Import::CDA::ConditionImporter
- Defined in:
- lib/health-data-standards/import/cda/condition_importer.rb
Direct Known Subclasses
HealthDataStandards::Import::C32::ConditionImporter, HealthDataStandards::Import::Cat1::DiagnosisActiveImporter, HealthDataStandards::Import::Cat1::DiagnosisInactiveImporter
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
-
#initialize(entry_finder = EntryFinder.new("//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.103']/cda:entry/cda:act/cda:entryRelationship/cda:observation")) ⇒ ConditionImporter
constructor
A new instance of ConditionImporter.
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.103']/cda:entry/cda:act/cda:entryRelationship/cda:observation")) ⇒ ConditionImporter
Returns a new instance of ConditionImporter.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/health-data-standards/import/cda/condition_importer.rb', line 6 def initialize(entry_finder=EntryFinder.new("//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.103']/cda:entry/cda:act/cda:entryRelationship/cda:observation")) @entry_finder = entry_finder @code_xpath = "./cda:value" @id_xpath = "./cda:id" @status_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.1.50']/cda:value" @ordinality_xpath = "./cda:priorityCode" @description_xpath = "./cda:text/cda:reference[@value]" @provider_xpath = "./cda:act[cda:templateId/@root='2.16.840.1.113883.10.20.1.27']/cda:performer" @priority_xpath = "../cda:sequenceNumber" @entry_class = Condition @value_xpath = nil end |
Instance Method Details
#create_entry(entry_element, nrh = NarrativeReferenceHandler.new) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/health-data-standards/import/cda/condition_importer.rb', line 19 def create_entry(entry_element, nrh = NarrativeReferenceHandler.new) condition = super extract_ordinality(entry_element, condition) extract_negation(entry_element, condition) extract_priority(entry_element, condition) if @provider_xpath entry_element.xpath(@provider_xpath).each do |provider_element| condition.treating_provider << import_actor(provider_element) end end condition end |