Skip to content

Commit 41243ce

Browse files
Merge pull request #6020 from nhsuk/mike/fix-nr-records-count
Fix record count for national reporting uploads with blank lines
2 parents 5b8a419 + 6937d34 commit 41243ce

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

app/components/app_import_statistics_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class AppImportStatisticsComponent < ViewComponent::Base
44
erb_template <<-ERB
5-
<p><strong>Out of <%= pluralize(@import.rows_count, "record") %> found in the file:</strong></p>
5+
<p><strong>Out of <%= pluralize(@import.records_count, "record") %> found in the file:</strong></p>
66
<ul>
77
<li><%= pluralize(@import.new_record_count, "new record") %> imported</li>
88
<li><%= pluralize(@import.exact_duplicate_record_count, "duplicate") %> not imported</li>

app/models/immunisation_import.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ def show_cancelled_reviewer?
5757
end
5858

5959
def records_count
60-
vaccination_records.count
60+
if national_reporting?
61+
vaccination_records.count + (ignored_record_count || 0)
62+
else
63+
vaccination_records.count
64+
end
6165
end
6266

6367
private

spec/fixtures/immunisation_import/national_reporting/valid_mixed_flu_hpv.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
RYG,100000,Hogwarts,9449308357,Harry,Potter,20010101,male,AA11 1AA,Y,20251109,AstraZeneca Fluenz LAIV,ABC123,20251030,Left Upper Arm,Albus,Dumbledore,,,Parental Consent,1234,ABCD,
33
RYG,100000,,9999075320,Ron,Weasley,20010102,not knOWn,S1 1AA,,20251109,Gardasil,ABC123,20251030,nasal,,,,1,,1235,ABCE,community setting
44
RYG,100000,,9990000018,Hermione,Granger,20010103,Female,S2 1AA,N,20251109,"","","","",,,,"",,1235,ABCE,""
5+
,,,,,,,,,,,,,,,,,,,,,,

0 commit comments

Comments
 (0)