Sha256: 523defe691ff1b28cfda1a2f265863553bc5e4a5f052f7022c21a3b93c902db9

Contents?: true

Size: 1.4 KB

Versions: 14

Compression:

Stored size: 1.4 KB

Contents

# frozen_string_literal: true

xml = builder

xml.Treatment do
  xml.EncounterNumber session.uuid
  xml.comment! "TODO: EncounterType TBC"
  xml.EncounterType "R"
  xml.FromTime session.start_datetime&.to_datetime
  xml.ToTime session.stop_datetime&.to_datetime

  xml.HealthCareFacility do
    xml.CodingStandard "ODS"
    xml.Code session.hospital_unit_renal_registry_code
    xml.Description session.hospital_unit_name
  end

  xml.AdmitReason do
    xml.comment! "AdmitReason 1 == Haemodialysis - TBC - may need to capture/derive"
    xml.CodingStandard "CF_RR7_TREATMENT"
    xml.Code "1"
  end

  xml.EnteredAt do
    xml.Code session.hospital_unit.renal_registry_code
  end

  xml.Attributes do
    xml.HDP01 session.patient&.hd_profile&.schedule_definition&.days_per_week
    xml.HDP02 session.duration
    xml.HDP03 session.document.dialysis.flow_rate
    xml.HDP04 session&.dialysate&.sodium_content
    xml.QBL05 session.access_type
    xml.comment! "QBL06 HD Shared Care - including as XSD requires it, but not implemented yet"
    xml.QBL06 ""
    xml.comment! "QBL07 HD Shared Care - including as XSD requires it, but not implemented yet"
    xml.QBL07 ""
    xml.comment! "ERF61 - defaulting to 5 if not present, as element is required"
    xml.ERF61 patient.current_registration_status_rr_code || "5" # 5= not assessed
    xml.PAT35 patient.first_seen_on
  end

  # xml.UpdatedOn
  # xml.ActionCode
  # xml.ExternalId
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
renalware-core-2.0.52 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.51 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.50 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.48 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.47 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.46 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.45 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.44 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.43 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.42 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.41 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.40 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.39 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder
renalware-core-2.0.38 app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder