Sha256: b8dcfd56770d4f1ceb78c7adf3531d1207e87c4b88edda8603f8db29ad9abf56

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

module QRDA
  module Cat1
    class AdverseEventImporter < SectionImporter
      def initialize(entry_finder = QRDA::Cat1::EntryFinder.new("./cda:entry/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.146']"))
        super(entry_finder)
        @id_xpath = './cda:id'
        @code_xpath = './cda:entryRelationship/cda:observation/cda:value'
        @author_datetime_xpath = './cda:author/cda:time'
        @relevant_period_xpath = './cda:effectiveTime'
        @severity_xpath = "./cda:entryRelationship/cda:observation[cda:templateId/@root = '2.16.840.1.113883.10.20.22.4.8']/cda:value"
        @facility_xpath = "./cda:participant[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.100']"
        @entry_class = QDM::AdverseEvent
      end

      def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
        adverse_event = super
        adverse_event.severity = code_if_present(entry_element.at_xpath(@severity_xpath))
        extract_facility(entry_element, adverse_event)
        adverse_event
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cqm-parsers-0.2.4 lib/qrda-import/data-element-importers/adverse_event_importer.rb
cqm-parsers-0.2.3 lib/qrda-import/data-element-importers/adverse_event_importer.rb
cqm-parsers-0.2.2 lib/qrda-import/data-element-importers/adverse_event_importer.rb