Sha256: c10453ef21dcaca6811eebfc9273656498b2197828feea9bb6d183c2d33906a2

Contents?: true

Size: 852 Bytes

Versions: 8

Compression:

Stored size: 852 Bytes

Contents

# frozen_string_literal: true

xml = builder

xml.Treatment do
  xml.EncounterNumber [treatment.modality_id, treatment.hd_profile_id].compact.join("-")
  xml.EncounterType "N"
  xml.FromTime treatment.started_on&.iso8601
  xml.ToTime(treatment.ended_on&.iso8601) if treatment.ended_on.present?

  if treatment.hospital_unit.present?
    xml.HealthCareFacility do
      xml.CodingStandard "ODS"
      xml.Code treatment.hospital_unit.renal_registry_code
    end
  end

  xml.AdmitReason do
    xml.CodingStandard "CF_RR7_TREATMENT"
    xml.Code treatment.modality_code.txt_code
  end

  render(
    "renalware/api/ukrdc/patients/treatments/discharge_reason",
    treatment: treatment,
    builder: builder
  )

  # HD
  rr8 = treatment.hospital_unit&.unit_type_rr8
  if rr8.present?
    xml.Attributes do
      xml.QBL05 rr8 # eg HOME
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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