Skip to content

Commit 717415d

Browse files
Ignore REASON_NOT_VACCINATED in national reporting uploads
This was missed in a previous commit which ignored extra Mavis colmuns Jira-Issue: MAV-2952
1 parent d0c89dc commit 717415d

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

app/models/immunisation_import_row.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def performed_ods_code = @data[:organisation_code]
246246

247247
def programme_name = poc? ? @data[:programme] : nil
248248

249-
def reason_not_administered = @data[:reason_not_vaccinated]
249+
def reason_not_administered = poc? ? @data[:reason_not_vaccinated] : nil
250250

251251
def school_name =
252252
if poc?

spec/models/immunisation_import_row_spec.rb

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,27 @@
10191019
end
10201020
end
10211021

1022+
shared_examples "when Mavis columns are present, which the bulk upload should ignore" do
1023+
let(:data) do
1024+
valid_bulk_flu_data.merge(
1025+
{
1026+
"PROGRAMME" => "HPV",
1027+
"PERFORMING_PROFESSIONAL_EMAIL" => "abc123@example.com",
1028+
"NOTES" => "Here are some notes",
1029+
"CARE_SETTING" => 2,
1030+
"CLINIC_NAME" => "The Hog's Head",
1031+
"SESSION_ID" => 1,
1032+
"UUID" => "ABCD1234-26cc-44e4-b886-c3cc90ba01b6",
1033+
"REASON_NOT_VACCINATED" => "Unwell"
1034+
}
1035+
)
1036+
end
1037+
1038+
it "ignores the Mavis columns" do
1039+
expect(immunisation_import_row).to be_valid
1040+
end
1041+
end
1042+
10221043
context "of unknown type (no VACCINE_GIVEN)" do
10231044
context "with an empty row" do
10241045
let(:data) { {} }
@@ -1096,6 +1117,8 @@
10961117
end
10971118

10981119
include_examples "when `VACCINATED` is `N`"
1120+
1121+
include_examples "when Mavis columns are present, which the bulk upload should ignore"
10991122
end
11001123

11011124
context "of type hpv" do
@@ -1127,6 +1150,8 @@
11271150
end
11281151

11291152
include_examples "when `VACCINATED` is `N`"
1153+
1154+
include_examples "when Mavis columns are present, which the bulk upload should ignore"
11301155
end
11311156
end
11321157
end
@@ -2311,7 +2336,8 @@
23112336
"CARE_SETTING" => 2,
23122337
"CLINIC_NAME" => "The Hog's Head",
23132338
"SESSION_ID" => session.id,
2314-
"UUID" => "ABCD1234-26cc-44e4-b886-c3cc90ba01b6"
2339+
"UUID" => "ABCD1234-26cc-44e4-b886-c3cc90ba01b6",
2340+
"REASON_NOT_VACCINATED" => "Unwell"
23152341
}
23162342
)
23172343
end

0 commit comments

Comments
 (0)