Skip to content

Commit b753f26

Browse files
Ignore other unused columns in national reporting upload
There were some further column headers which aren't on the national reporting spec, which should be ignored Jira-Issue: MAV-2952
1 parent 717415d commit b753f26

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

app/models/immunisation_import_row.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ def care_setting = poc? ? @data[:care_setting] : nil
207207
def clinic_name =
208208
poc? ? @data[:clinic_name].presence || @data[:event_done_at] : nil
209209

210-
def combined_vaccination_and_dose_sequence = @data[:vaccination_type]
210+
def combined_vaccination_and_dose_sequence =
211+
poc? ? @data[:vaccination_type] : nil
211212

212213
def date_of_vaccination =
213214
@data[:date_of_vaccination].presence || @data[:event_date]
@@ -216,7 +217,7 @@ def delivery_site = @data[:anatomical_site]
216217

217218
def dose_sequence = @data[:dose_sequence]
218219

219-
def location_type = @data[:event_location_type]
220+
def location_type = poc? ? @data[:event_location_type] : nil
220221

221222
def notes = poc? ? @data[:notes] : nil
222223

@@ -258,7 +259,7 @@ def school_urn = @data[:school_urn].presence || @data[:school_code]
258259

259260
def session_id = poc? ? @data[:session_id] : nil
260261

261-
def supplied_by_email = @data[:supplier_email]
262+
def supplied_by_email = poc? ? @data[:supplier_email] : nil
262263

263264
def time_of_vaccination =
264265
@data[:time_of_vaccination].presence || @data[:event_time]

spec/models/immunisation_import_row_spec.rb

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,10 @@
10301030
"CLINIC_NAME" => "The Hog's Head",
10311031
"SESSION_ID" => 1,
10321032
"UUID" => "ABCD1234-26cc-44e4-b886-c3cc90ba01b6",
1033-
"REASON_NOT_VACCINATED" => "Unwell"
1033+
"REASON_NOT_VACCINATED" => "Unwell",
1034+
"Vaccination type" => "HPV 1",
1035+
"EVENT_LOCATION_TYPE" => "school",
1036+
"SUPPLIER_EMAIL" => "abc@example.com"
10341037
}
10351038
)
10361039
end
@@ -2337,7 +2340,10 @@
23372340
"CLINIC_NAME" => "The Hog's Head",
23382341
"SESSION_ID" => session.id,
23392342
"UUID" => "ABCD1234-26cc-44e4-b886-c3cc90ba01b6",
2340-
"REASON_NOT_VACCINATED" => "Unwell"
2343+
"REASON_NOT_VACCINATED" => "Unwell",
2344+
"Vaccination type" => "HPV 1",
2345+
"EVENT_LOCATION_TYPE" => "school",
2346+
"SUPPLIER_EMAIL" => "abc@example.com"
23412347
}
23422348
)
23432349
end
@@ -2357,10 +2363,13 @@
23572363
its(:notes) { should be_nil }
23582364

23592365
its(:location) { should eq location }
2366+
its(:location_name) { should be_nil }
23602367

23612368
its(:session) { should be_nil }
23622369

23632370
its(:uuid) { should_not eq "ABCD1234-26cc-44e4-b886-c3cc90ba01b6" }
2371+
2372+
its(:supplied_by) { should be_nil }
23642373
end
23652374

23662375
include_examples "accepts a VACCINE_GIVEN code",
@@ -2442,7 +2451,11 @@
24422451
"CARE_SETTING" => 2,
24432452
"CLINIC_NAME" => "The Hog's Head",
24442453
"SESSION_ID" => session.id,
2445-
"UUID" => "ABCD1234-26cc-44e4-b886-c3cc90ba01b6"
2454+
"UUID" => "ABCD1234-26cc-44e4-b886-c3cc90ba01b6",
2455+
"REASON_NOT_VACCINATED" => "Unwell",
2456+
"Vaccination type" => "flu 1",
2457+
"EVENT_LOCATION_TYPE" => "school",
2458+
"SUPPLIER_EMAIL" => "abc@example.com"
24462459
}
24472460
)
24482461
end

0 commit comments

Comments
 (0)