Skip to content

Commit cb3797c

Browse files
authored
Merge pull request #4581 from nhsuk/add-registration-to-offline-spreadsheet
Add registration to the offline spreadsheet process
2 parents b60ea9d + e44b458 commit cb3797c

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

app/lib/reports/offline_session_exporter.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def columns
9393
care_setting
9494
person_dob
9595
year_group
96+
registration
9697
person_gender_code
9798
person_address_line_1
9899
person_postcode
@@ -268,6 +269,7 @@ def add_patient_cells(row, patient:, programme:)
268269
row[:person_surname] = patient.family_name
269270
row[:person_dob] = patient.date_of_birth
270271
row[:year_group] = patient.year_group(academic_year:)
272+
row[:registration] = patient.registration
271273
row[:person_gender_code] = Cell.new(
272274
patient.gender_code.humanize,
273275
allowed_values: Patient.gender_codes.keys

spec/lib/reports/offline_session_exporter_spec.rb

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def validation_formula(worksheet:, column_name:, row: 1)
7171
CARE_SETTING
7272
PERSON_DOB
7373
YEAR_GROUP
74+
REGISTRATION
7475
PERSON_GENDER_CODE
7576
PERSON_ADDRESS_LINE_1
7677
PERSON_POSTCODE
@@ -169,7 +170,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
169170
"VACCINATED" => "",
170171
"VACCINE_GIVEN" => "",
171172
"UUID" => "",
172-
"YEAR_GROUP" => patient.year_group(academic_year:)
173+
"YEAR_GROUP" => patient.year_group(academic_year:),
174+
"REGISTRATION" => patient.registration
173175
}
174176
)
175177
expect(rows.first["PERSON_DOB"].to_date).to eq(
@@ -284,7 +286,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
284286
"VACCINATED" => "Y",
285287
"VACCINE_GIVEN" => vaccination_record.vaccine.nivs_name,
286288
"UUID" => vaccination_record.uuid,
287-
"YEAR_GROUP" => patient.year_group(academic_year:)
289+
"YEAR_GROUP" => patient.year_group(academic_year:),
290+
"REGISTRATION" => patient.registration
288291
}
289292
)
290293
expect(rows.first["BATCH_EXPIRY_DATE"].to_date).to eq(batch.expiry)
@@ -399,7 +402,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
399402
"VACCINATED" => "Y",
400403
"VACCINE_GIVEN" => nil,
401404
"UUID" => vaccination_record.uuid,
402-
"YEAR_GROUP" => patient.year_group(academic_year:)
405+
"YEAR_GROUP" => patient.year_group(academic_year:),
406+
"REGISTRATION" => patient.registration
403407
}
404408
)
405409
expect(rows.first["BATCH_EXPIRY_DATE"].to_date).to eq(batch.expiry)
@@ -478,7 +482,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
478482
"VACCINATED" => "Y",
479483
"VACCINE_GIVEN" => vaccination_record.vaccine.nivs_name,
480484
"UUID" => vaccination_record.uuid,
481-
"YEAR_GROUP" => patient.year_group(academic_year:)
485+
"YEAR_GROUP" => patient.year_group(academic_year:),
486+
"REGISTRATION" => patient.registration
482487
}
483488
)
484489
expect(rows.first["BATCH_EXPIRY_DATE"].to_date).to eq(batch.expiry)
@@ -548,7 +553,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
548553
"VACCINATED" => "",
549554
"VACCINE_GIVEN" => "",
550555
"UUID" => "",
551-
"YEAR_GROUP" => patient.year_group(academic_year:)
556+
"YEAR_GROUP" => patient.year_group(academic_year:),
557+
"REGISTRATION" => patient.registration
552558
}
553559
)
554560
expect(rows.first["PERSON_DOB"].to_date).to eq(
@@ -614,7 +620,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
614620
"VACCINATED" => "N",
615621
"VACCINE_GIVEN" => nil,
616622
"UUID" => vaccination_record.uuid,
617-
"YEAR_GROUP" => patient.year_group(academic_year:)
623+
"YEAR_GROUP" => patient.year_group(academic_year:),
624+
"REGISTRATION" => patient.registration
618625
}
619626
)
620627
expect(rows.first["DATE_OF_VACCINATION"].to_date).to eq(
@@ -753,6 +760,7 @@ def validation_formula(worksheet:, column_name:, row: 1)
753760
CARE_SETTING
754761
PERSON_DOB
755762
YEAR_GROUP
763+
REGISTRATION
756764
PERSON_GENDER_CODE
757765
PERSON_ADDRESS_LINE_1
758766
PERSON_POSTCODE
@@ -836,7 +844,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
836844
"VACCINATED" => "",
837845
"VACCINE_GIVEN" => "",
838846
"UUID" => "",
839-
"YEAR_GROUP" => patient.year_group(academic_year:)
847+
"YEAR_GROUP" => patient.year_group(academic_year:),
848+
"REGISTRATION" => patient.registration
840849
}
841850
)
842851
expect(rows.first["PERSON_DOB"].to_date).to eq(
@@ -921,7 +930,8 @@ def validation_formula(worksheet:, column_name:, row: 1)
921930
"VACCINATED" => "Y",
922931
"VACCINE_GIVEN" => vaccination_record.vaccine.nivs_name,
923932
"UUID" => vaccination_record.uuid,
924-
"YEAR_GROUP" => patient.year_group(academic_year:)
933+
"YEAR_GROUP" => patient.year_group(academic_year:),
934+
"REGISTRATION" => patient.registration
925935
}
926936
)
927937
expect(rows.first["BATCH_EXPIRY_DATE"].to_date).to eq(batch.expiry)

0 commit comments

Comments
 (0)