Skip to content

Commit fd78d18

Browse files
Merge pull request #6018 from nhsuk/mike/empty-careplus-ethnicity-value
Return an empty value for patient ethnicity in the CarePlus export
2 parents 2cc738c + 02569b9 commit fd78d18

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

app/lib/reports/careplus_exporter.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ def rows(patient:, vaccination_records:)
134134
patient.date_of_birth.strftime("%d/%m/%Y"),
135135
patient.restricted? ? "" : patient.address_line_1,
136136
consents[patient.id]&.name || "",
137-
99, # Ethnicity, 99 is "Not known"
137+
# We use an empty value for ethnicity, rather than the official unknown value of 99,
138+
# to prevent overwriting existing values in CarePlus
139+
"",
138140
date.strftime("%d/%m/%Y"),
139141
records.first.performed_at.strftime("%H:%M"),
140142
session.location.school? ? "SC" : "CL", # Venue Type

spec/lib/reports/careplus_exporter_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
staff_code_index = headers.index("Staff Code")
108108
venue_type_index = headers.index("Venue Type")
109109
venue_code_index = headers.index("Venue Code")
110+
ethnicity_index = headers.index("Ethnicity")
110111

111112
row = data_rows.first
112113

@@ -122,6 +123,7 @@
122123
expect(row[staff_code_index]).to eq("ABCD")
123124
expect(row[venue_type_index]).to eq("SC")
124125
expect(row[venue_code_index]).to eq("123456")
126+
expect(row[ethnicity_index]).to be_blank
125127
end
126128

127129
context "with multiple vaccination records for the same session on different dates" do

0 commit comments

Comments
 (0)