Sha256: a9d5bea45c5b5f6430ff3f9bc8abf91d777e19a1b137b2c1195c6c0040721b6b

Contents?: true

Size: 1.31 KB

Versions: 10

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

xml = builder

xml.Medications do
  patient.prescriptions_with_numeric_dose_amount.each do |prescription|
    xml.Medication do
      xml.FromTime prescription.prescribed_on.to_datetime
      if prescription.terminated_or_marked_for_termination?
        xml.ToTime prescription.terminated_on&.to_datetime
      end
      xml.Route do
        xml.CodingStandard "RR22"
        xml.Code prescription.medication_route&.rr_code
        xml.Description prescription.medication_route&.name
      end
      xml.DrugProduct do
        xml.Generic prescription.drug
        # xml.Id do
        #   xml.CodingStandard "DM+D"
        #   xml.Code "dm + d code for the drug - coming soon"
        #   xml.Description prescription.drug
        # end
      end
      xml.Frequency prescription.frequency
      xml.Comments [prescription.dose_amount,
                    prescription.dose_unit&.text,
                    prescription.frequency].compact.join(" ")
      xml.DoseQuantity prescription.dose_amount&.strip

      if prescription.dose_unit.present?
        xml.DoseUoM do
          prescription.dose_unit
          xml.CodingStandard "LOCAL"
          xml.Code prescription.dose_unit&.text
          xml.Description prescription.dose_unit
        end
      end

      xml.ExternalId prescription.id
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
renalware-core-2.0.100 app/views/renalware/api/ukrdc/patients/_medications.xml.builder
renalware-core-2.0.99 app/views/renalware/api/ukrdc/patients/_medications.xml.builder
renalware-core-2.0.98 app/views/renalware/api/ukrdc/patients/_medications.xml.builder
renalware-core-2.0.97 app/views/renalware/api/ukrdc/patients/_medications.xml.builder
renalware-core-2.0.96 app/views/renalware/api/ukrdc/patients/_medications.xml.builder
renalware-core-2.0.95 app/views/renalware/api/ukrdc/patients/_medications.xml.builder
renalware-core-2.0.94 app/views/renalware/api/ukrdc/patients/_medications.xml.builder
renalware-core-2.0.93 app/views/renalware/api/ukrdc/patients/_medications.xml.builder
renalware-core-2.0.92 app/views/renalware/api/ukrdc/patients/_medications.xml.builder
renalware-core-2.0.91 app/views/renalware/api/ukrdc/patients/_medications.xml.builder