Skip to content

Commit 67e6b4e

Browse files
Merge pull request #6578 from NHSDigital/alistair/imports-help-text-content-tweak
Improve content on vaccination record upload page
2 parents ab76dfa + 9f54d22 commit 67e6b4e

8 files changed

Lines changed: 72 additions & 133 deletions

app/components/app_import_format_details_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%= govuk_details(summary_text:) do %>
1+
<%= govuk_details(summary_text: "What your CSV file must include") do %>
22
<p>Make sure the CSV you upload uses the following columns:</p>
33

44
<%= govuk_table(classes: "app-table--csv app-table--small") do |table|

app/components/app_import_format_details_component.rb

Lines changed: 64 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,6 @@ def initialize(import:)
1010
delegate :team, to: :@import
1111
delegate :govuk_details, :govuk_table, to: :helpers
1212

13-
def summary_text
14-
case @import
15-
when ClassImport
16-
"How to format your Mavis CSV file for class lists"
17-
when CohortImport
18-
"How to format your Mavis CSV file for child records"
19-
when ImmunisationImport
20-
if team.has_national_reporting_access?
21-
"How to format your CSV file for vaccination records"
22-
else
23-
"How to format your Mavis CSV file for vaccination records"
24-
end
25-
else
26-
raise ArgumentError, "Unsupported import type: #{@import.class}"
27-
end
28-
end
29-
3013
def columns
3114
case @import
3215
when ClassImport
@@ -44,7 +27,7 @@ def class_import_columns
4427
{
4528
name: "CHILD_POSTCODE",
4629
notes:
47-
"Optional, must be formatted as a valid postcode, for example #{tag.i("SW1A 1AA")}."
30+
"Optional, must be a full postcode, for example #{tag.i("SW1A 1AA")}"
4831
}
4932
] + parent_columns
5033
end
@@ -55,7 +38,7 @@ def cohort_import_columns
5538
{
5639
name: "CHILD_POSTCODE",
5740
notes:
58-
"#{tag.strong("Required")}, must be formatted as a valid postcode, for example #{tag.i("SW1A 1AA")}."
41+
"#{tag.strong("Required")}, must be a full postcode, for example #{tag.i("SW1A 1AA")}"
5942
},
6043
{
6144
name: "CHILD_SCHOOL_URN",
@@ -77,33 +60,26 @@ def immunisation_import_columns
7760

7861
def point_of_care_immunisation_import_columns
7962
organisation_code(optionality: "Optional") +
80-
school_urn(optionality: "Optional") + school_name +
81-
nhs_number(optionality: "Optional") +
82-
patient_demographics(optionality: "Required") +
83-
date_and_time_of_vaccination(date_optionality: "Required") +
63+
school_urn(optionality: "Optional") + school_name + nhs_number +
64+
patient_demographics + date_and_time_of_vaccination +
8465
vaccinated(
85-
optionality: "Required",
86-
extra_notes:
87-
"Can be omitted if #{tag.code("VACCINE_GIVEN")} is provided."
66+
notes:
67+
"Enter #{tag.i("Y")} or #{tag.i("N")}. Mavis will assume #{tag.i("Y")} if " \
68+
"#{tag.code(" VACCINE_GIVEN ")} is provided."
8869
) + vaccine_and_batch + programme + anatomical_site +
8970
reason_not_vaccinated_and_notes + dose_sequence + care_setting +
9071
performing_professional
9172
end
9273

9374
def national_reporting_immunisation_import_columns
94-
organisation_code(optionality: "Mandatory") +
95-
school_urn(optionality: "Mandatory") +
96-
nhs_number(optionality: "Required") +
97-
patient_demographics(
98-
optionality: "Mandatory",
99-
gender_field_name: "PERSON_GENDER"
100-
) +
75+
organisation_code(optionality: "Required") +
76+
school_urn(optionality: "Required") + nhs_number +
77+
patient_demographics(gender_field_name: "PERSON_GENDER") +
10178
vaccinated(
102-
optionality: "Optional",
103-
extra_notes:
104-
"Rows with the value #{tag.i("N")} will not be validated and will not be imported."
105-
) + date_and_time_of_vaccination(date_optionality: "Mandatory") +
106-
national_reporting_vaccine_and_batch +
79+
notes:
80+
"Optional, enter #{tag.i("Y")} or #{tag.i("N")}. If you enter nothing, Mavis will assume " \
81+
"#{tag.i("Y")}. If you enter #{tag.i("N")}, the row will not be uploaded."
82+
) + date_and_time_of_vaccination + national_reporting_vaccine_and_batch +
10783
national_reporting_anatomical_site + national_reporting_dose_sequence +
10884
national_reporting_performing_professional_names + local_patient_id
10985
end
@@ -157,7 +133,7 @@ def child_columns
157133
},
158134
{
159135
name: "CHILD_NHS_NUMBER",
160-
notes: "Optional, must be 10 digits and numeric."
136+
notes: "You must enter a valid NHS number if available."
161137
},
162138
{
163139
name: "CHILD_GENDER",
@@ -181,12 +157,17 @@ def organisation_code(optionality:)
181157
]
182158
end
183159

184-
def nhs_number(optionality:)
160+
def nhs_number
185161
[
186162
{
187163
name: "NHS_NUMBER",
188164
notes:
189-
"#{tag.strong(optionality)}, must be a valid #{link_to("NHS number", "https://www.datadictionary.nhs.uk/attributes/nhs_number.html")}."
165+
"You must enter a valid #{
166+
link_to(
167+
"NHS number",
168+
"https://www.datadictionary.nhs.uk/attributes/nhs_number.html"
169+
)
170+
} if available."
190171
}
191172
]
192173
end
@@ -212,60 +193,56 @@ def school_name
212193
]
213194
end
214195

215-
def patient_demographics(
216-
optionality:,
217-
gender_field_name: "PERSON_GENDER_CODE"
218-
)
196+
def patient_demographics(gender_field_name: "PERSON_GENDER_CODE")
219197
[
220-
{ name: "PERSON_FORENAME", notes: tag.strong(optionality) },
221-
{ name: "PERSON_SURNAME", notes: tag.strong(optionality) },
198+
{
199+
name: "PERSON_FORENAME",
200+
notes:
201+
"#{tag.strong("Required")}, must use alphabetical characters " \
202+
"(you can include accents like Chloë, hyphens like Anne-Marie or apostrophes like D'Arcy " \
203+
"but no other special characters)."
204+
},
205+
{
206+
name: "PERSON_SURNAME",
207+
notes:
208+
"#{tag.strong("Required")}, must use alphabetical characters " \
209+
"(you can include accents like Jiménez, hyphens like Burne-Jones or apostrophes like O'Hare " \
210+
"but no other special characters)."
211+
},
222212
{
223213
name: "PERSON_DOB",
224214
notes:
225-
"#{tag.strong(optionality)}, must use either #{tag.i("YYYYMMDD")} or " \
215+
"#{tag.strong("Required")}, you must use either #{tag.i("YYYYMMDD")} or " \
226216
"#{tag.i("DD/MM/YYYY")} format."
227217
},
228218
{
229219
name: gender_field_name,
230220
notes:
231-
"#{tag.strong(optionality)}, must be one of: #{tag.i("female")}, " \
221+
"#{tag.strong("Required")}, must be one of: #{tag.i("female")}, " \
232222
"#{tag.i("male")}, #{tag.i("not known")} or #{tag.i("not specified")}."
233223
},
234224
{
235225
name: "PERSON_POSTCODE",
236226
notes:
237-
"#{tag.strong(optionality)}, must be formatted as a valid postcode, for example #{tag.i("SW1A 1AA")}."
227+
"#{tag.strong("Required")}, must be a full postcode, for example #{tag.i("SW1A 1AA")}"
238228
}
239229
]
240230
end
241231

242-
def vaccinated(optionality:, extra_notes: "")
243-
optionality_html =
244-
if %w[Mandatory Required].include?(optionality)
245-
tag.strong(optionality)
246-
else
247-
optionality
248-
end
249-
250-
[
251-
{
252-
name: "VACCINATED",
253-
notes:
254-
"#{optionality_html}, must be #{tag.i("Y")} or #{tag.i("N")}. #{extra_notes}"
255-
}
256-
]
232+
def vaccinated(notes:)
233+
[{ name: "VACCINATED", notes: }]
257234
end
258235

259-
def date_and_time_of_vaccination(date_optionality:)
236+
def date_and_time_of_vaccination
260237
[
261238
{
262239
name: "DATE_OF_VACCINATION",
263240
notes:
264-
"#{tag.strong(date_optionality)}, must use either #{tag.i("YYYYMMDD")} or #{tag.i("DD/MM/YYYY")} format."
241+
"#{tag.strong("Required")}, you must use either #{tag.i("YYYYMMDD")} or #{tag.i("DD/MM/YYYY")} format."
265242
},
266243
{
267244
name: "TIME_OF_VACCINATION",
268-
notes: "Optional, must use #{tag.i("HH:MM:SS")} format."
245+
notes: "Optional, use #{tag.i("HH:MM:SS")} format."
269246
}
270247
]
271248
end
@@ -331,15 +308,11 @@ def vaccine_and_batch
331308
name: "VACCINE_GIVEN",
332309
notes: "Optional, must be one of: #{vaccines_sentence}."
333310
},
334-
{
335-
name: "BATCH_NUMBER",
336-
notes: "Required if #{tag.code("BATCH_EXPIRY_DATE")} is provided."
337-
},
311+
{ name: "BATCH_NUMBER", notes: "Optional" },
338312
{
339313
name: "BATCH_EXPIRY_DATE",
340314
notes:
341-
"Required if #{tag.code("BATCH_NUMBER")} is provided, must use " \
342-
"either #{tag.i("YYYYMMDD")} or #{tag.i("DD/MM/YYYY")} format."
315+
"Optional, use either #{tag.i("YYYYMMDD")} or #{tag.i("DD/MM/YYYY")} format."
343316
}
344317
]
345318
end
@@ -357,17 +330,17 @@ def national_reporting_vaccine_and_batch
357330
{
358331
name: "VACCINE_GIVEN",
359332
notes:
360-
"#{tag.strong("Mandatory")}" \
333+
"#{tag.strong("Required")}" \
361334
"#{tag.br}#{tag.br}" \
362335
"For HPV records, must be one of: #{hpv_vaccines_sentence}." \
363336
"#{tag.br}#{tag.br}" \
364337
"For flu records, must be one of: #{flu_vaccines_sentence}."
365338
},
366-
{ name: "BATCH_NUMBER", notes: tag.strong("Mandatory") },
339+
{ name: "BATCH_NUMBER", notes: tag.strong("Required") },
367340
{
368341
name: "BATCH_EXPIRY_DATE",
369342
notes:
370-
"#{tag.strong("Mandatory")}, must use #{tag.i("YYYYMMDD")} format."
343+
"#{tag.strong("Required")}, must use #{tag.i("YYYYMMDD")} format."
371344
}
372345
]
373346
end
@@ -466,11 +439,11 @@ def national_reporting_performing_professional_names
466439
[
467440
{
468441
name: "PERFORMING_PROFESSIONAL_FORENAME",
469-
notes: "Mandatory for flu records, optional for HPV records."
442+
notes: "Required for flu records, optional for HPV records."
470443
},
471444
{
472445
name: "PERFORMING_PROFESSIONAL_SURNAME",
473-
notes: "Mandatory for flu records, optional for HPV records."
446+
notes: "Required for flu records, optional for HPV records."
474447
}
475448
]
476449
end
@@ -496,7 +469,7 @@ def national_reporting_anatomical_site
496469
[
497470
{
498471
name: "ANATOMICAL_SITE",
499-
notes: "#{tag.strong("Mandatory")}, must be one of: #{site_sentence}."
472+
notes: "#{tag.strong("Required")}, must be one of: #{site_sentence}."
500473
}
501474
]
502475
end
@@ -509,7 +482,7 @@ def national_reporting_dose_sequence
509482
{
510483
name: "DOSE_SEQUENCE",
511484
notes:
512-
"Mandatory for HPV records, optional for flu records." \
485+
"Required for HPV records, optional for flu records." \
513486
"#{tag.br} #{tag.br}" \
514487
"Must be a number between 1 and #{hpv_max} for HPV records and between 1 and #{flu_max} for flu records."
515488
}
@@ -518,8 +491,16 @@ def national_reporting_dose_sequence
518491

519492
def local_patient_id
520493
[
521-
{ name: "LOCAL_PATIENT_ID", notes: tag.strong("Mandatory") },
522-
{ name: "LOCAL_PATIENT_ID_URI", notes: tag.strong("Mandatory") }
494+
{
495+
name: "LOCAL_PATIENT_ID",
496+
notes:
497+
"#{tag.strong("Required")}, supplied automatically by your vaccination recording system."
498+
},
499+
{
500+
name: "LOCAL_PATIENT_ID_URI",
501+
notes:
502+
"#{tag.strong("Required")}, supplied automatically by your vaccination recording system."
503+
}
523504
]
524505
end
525506
end

app/views/imports/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<% end %>
2626

2727
<p class="nhsuk-u-reading-width">
28-
Correct the issues listed, save the changes and upload the file again.
28+
Refer to <u>What your CSV file must include</u> to correct the issues listed below, save the changes and upload the file again.
2929

3030
<% if import.changesets_are_invalid? %>
3131
This may include errors identified after Mavis added a missing NHS number or replaced an incorrect NHS number.

spec/components/app_import_format_details_component_spec.rb

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,10 @@
44
let(:programme) { Programme.hpv }
55
let(:team) { create(:team, programmes: [programme]) }
66

7-
it "renders the correct summary text for ClassImport" do
7+
it "renders the correct summary text" do
88
import = ClassImport.new(team:)
99
render_inline(described_class.new(import:))
10-
expect(page).to have_content(
11-
"How to format your Mavis CSV file for class lists"
12-
)
13-
end
14-
15-
it "renders the correct summary text for CohortImport" do
16-
import = CohortImport.new(team:)
17-
render_inline(described_class.new(import:))
18-
expect(page).to have_content(
19-
"How to format your Mavis CSV file for child records"
20-
)
21-
end
22-
23-
it "renders the correct summary text for ImmunisationImport" do
24-
import = ImmunisationImport.new(team:)
25-
render_inline(described_class.new(import:))
26-
expect(page).to have_content(
27-
"How to format your Mavis CSV file for vaccination records"
28-
)
29-
end
30-
31-
it "raises an error for unsupported import types" do
32-
import = Object.new
33-
expect { render_inline(described_class.new(import:)) }.to raise_error(
34-
ArgumentError,
35-
"Unsupported import type: Object"
36-
)
10+
expect(page).to have_content("What your CSV file must include")
3711
end
3812

3913
it "renders the correct columns for ClassImport" do
@@ -83,14 +57,6 @@
8357
context "with a national reporting team" do
8458
let(:team) { create(:team, :national_reporting, programmes: [programme]) }
8559

86-
it "renders the correct summary text for ImmunisationImport" do
87-
import = ImmunisationImport.new(team:)
88-
render_inline(described_class.new(import:))
89-
expect(page).to have_content(
90-
"How to format your CSV file for vaccination records"
91-
)
92-
end
93-
9460
it "renders the correct columns for ImmunisationImport" do
9561
import = ImmunisationImport.new(team:)
9662
render_inline(described_class.new(import:))

spec/features/import_child_records_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,7 @@ def when_i_upload_a_file_with_invalid_fields
239239
end
240240

241241
def then_i_should_the_errors_page_with_invalid_fields
242-
expect(page).to have_content(
243-
"How to format your Mavis CSV file for child records"
244-
)
242+
expect(page).to have_content("What your CSV file must include")
245243
expect(page).to have_content("Row 2")
246244
end
247245

spec/features/import_class_lists_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,7 @@ def when_i_upload_a_file_with_invalid_fields
219219
end
220220

221221
def then_i_should_the_errors_page_with_invalid_fields
222-
expect(page).to have_content(
223-
"How to format your Mavis CSV file for class lists"
224-
)
222+
expect(page).to have_content("What your CSV file must include")
225223
expect(page).to have_content("Row 1")
226224
end
227225

spec/features/import_vaccination_records_national_reporting_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,7 @@ def when_i_upload_an_invalid_file
218218
end
219219

220220
def then_i_should_see_the_errors_page
221-
expect(page).to have_content(
222-
"How to format your CSV file for vaccination records"
223-
)
221+
expect(page).to have_content("What your CSV file must include")
224222
expect(page).to have_content("Row 2")
225223
expect(page).to have_content("ANATOMICAL_SITE:")
226224
expect(page).to have_content("SCHOOL_URN:")

0 commit comments

Comments
 (0)