Sha256: fe09a4a49c74748bf6edd24504d130df9aa642a3024d8b5637847b8eddd5773c

Contents?: true

Size: 787 Bytes

Versions: 3

Compression:

Stored size: 787 Bytes

Contents

module QRDA
  module Cat1
    class MedicationImporter < SectionImporter
  
      def initialize(entry_finder = nil)
        super(entry_finder)
        @id_xpath = './cda:id'
        @code_xpath = "./cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code"
        @relevant_period_xpath = "./cda:effectiveTime"
        @author_datetime_xpath = "./cda:author/cda:time"
        @dosage_xpath = "./cda:doseQuantity"
        @route_xpath = "./cda:routeCode"
      end

      def create_entry(entry_element, nrh = NarrativeReferenceHandler.new)
        medication = super
        medication.dosage = extract_scalar(entry_element, @dosage_xpath)
        medication.route = code_if_present(entry_element.at_xpath(@route_xpath))
        medication
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cqm-parsers-0.2.4 lib/qrda-import/base-importers/medication_importer.rb
cqm-parsers-0.2.3 lib/qrda-import/base-importers/medication_importer.rb
cqm-parsers-0.2.2 lib/qrda-import/base-importers/medication_importer.rb