# frozen_string_literal: true

xml = builder

xml.CauseOfDeath do
  xml.DiagnosisType "final"
  xml.Diagnosis do
    xml.CodingStandard "EDTA"
    xml.Code cause.code
  end
  xml.EnteredOn cause.created_at.to_datetime
end

# frozen_string_literal: true

xml = builder

# temp hack until XSD updated to include missing code 34
cause_code = cause.code
cause_code = 99 if cause_code == 34

xml.CauseOfDeath do
  xml.DiagnosisType "final"
  xml.Diagnosis do
    xml.CodingStandard "EDTA"
    xml.Code cause_code
  end
  xml.EnteredOn cause.created_at.to_datetime
end

Use death cause 99 if 34
Use death cause 99 if 34

Until UKRDC update schema to include 34
