@@ -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
525506end
0 commit comments