@@ -68,7 +68,7 @@ def immunisation_import_columns
68
68
{
69
69
name : "ORGANISATION_CODE" ,
70
70
notes :
71
- "Optional, must be a valid #{ link_to ( "ODS code" , "https://odsportal.digital.nhs.uk/" ) } "
71
+ "Optional, must be a valid #{ link_to ( "ODS code" , "https://odsportal.digital.nhs.uk/" ) } . "
72
72
} ,
73
73
{
74
74
name : "SCHOOL_URN" ,
@@ -79,80 +79,47 @@ def immunisation_import_columns
79
79
} ,
80
80
{
81
81
name : "SCHOOL_NAME" ,
82
- notes : "Required if #{ tag . i ( "SCHOOL_URN" ) } is #{ tag . i ( "888888" ) } "
82
+ notes : "Required if #{ tag . code ( "SCHOOL_URN" ) } is #{ tag . i ( "888888" ) } . "
83
83
} ,
84
- { name : "NHS_NUMBER" , notes : "Optional, must be 10 digits and numeric" } ,
84
+ { name : "NHS_NUMBER" , notes : "Optional, must be 10 digits and numeric. " } ,
85
85
{ name : "PERSON_FORENAME" , notes : tag . strong ( "Required" ) } ,
86
86
{ name : "PERSON_SURNAME" , notes : tag . strong ( "Required" ) } ,
87
87
{
88
88
name : "PERSON_DOB" ,
89
89
notes :
90
90
"#{ tag . strong ( "Required" ) } , must use either #{ tag . i ( "YYYYMMDD" ) } or " \
91
- "#{ tag . i ( "DD/MM/YYYY" ) } format"
91
+ "#{ tag . i ( "DD/MM/YYYY" ) } format. "
92
92
} ,
93
93
{
94
94
name : "PERSON_GENDER_CODE" ,
95
95
notes :
96
96
"#{ tag . strong ( "Required" ) } , must be #{ tag . i ( "Not known" ) } , " \
97
- "#{ tag . i ( "Male" ) } , #{ tag . i ( "Female" ) } , #{ tag . i ( "Not specified" ) } "
97
+ "#{ tag . i ( "Male" ) } , #{ tag . i ( "Female" ) } , #{ tag . i ( "Not specified" ) } . "
98
98
} ,
99
99
{
100
100
name : "PERSON_POSTCODE" ,
101
101
notes :
102
- "#{ tag . strong ( "Required" ) } , must be formatted as a valid postcode"
102
+ "#{ tag . strong ( "Required" ) } , must be formatted as a valid postcode. "
103
103
} ,
104
104
{
105
105
name : "DATE_OF_VACCINATION" ,
106
106
notes :
107
107
"#{ tag . strong ( "Required" ) } , must use either #{ tag . i ( "YYYYMMDD" ) } or " \
108
- "#{ tag . i ( "DD/MM/YYYY" ) } format"
108
+ "#{ tag . i ( "DD/MM/YYYY" ) } format. "
109
109
} ,
110
110
{
111
111
name : "TIME_OF_VACCINATION" ,
112
- notes : "Optional, must use #{ tag . i ( "HH:MM:SS" ) } format"
113
- } ,
114
- {
115
- name : "PROGRAMME" ,
116
- notes :
117
- "#{ tag . strong ( "Required" ) } , must be " +
118
- organisation
119
- . programmes
120
- . flat_map ( &:import_names )
121
- . map { tag . i ( it ) }
122
- . to_sentence (
123
- last_word_connector : ", or " ,
124
- two_words_connector : " or "
125
- )
126
- } ,
127
- {
128
- name : "VACCINE_GIVEN" ,
129
- notes :
130
- "Optional, must be #{
131
- organisation
132
- . vaccines
133
- . pluck ( :nivs_name )
134
- . map { tag . i ( it ) }
135
- . to_sentence (
136
- last_word_connector : ", or " ,
137
- two_words_connector : " or "
138
- )
139
- } "
140
- } ,
141
- { name : "BATCH_NUMBER" , notes : "Optional" } ,
142
- {
143
- name : "BATCH_EXPIRY_DATE" ,
144
- notes :
145
- "Optional, must use " \
146
- "either #{ tag . i ( "YYYYMMDD" ) } or #{ tag . i ( "DD/MM/YYYY" ) } format"
112
+ notes : "Optional, must use #{ tag . i ( "HH:MM:SS" ) } format."
147
113
} ,
148
114
{
149
115
name : "VACCINATED" ,
150
116
notes :
151
- "Optional , must be #{ tag . i ( "Y" ) } or #{ tag . i ( "N" ) } . If omitted, " \
152
- "#{ tag . i ( "Y ") } is assumed ."
117
+ "Required , must be #{ tag . i ( "Y" ) } or #{ tag . i ( "N" ) } . " \
118
+ "Can be omitted if #{ tag . code ( "VACCINE_GIVEN ") } is provided ."
153
119
}
154
- ] + anatomical_site + reason_not_vaccinated_and_notes + dose_sequence +
155
- care_setting + performing_professional
120
+ ] + vaccine_and_batch + programme + anatomical_site +
121
+ reason_not_vaccinated_and_notes + dose_sequence + care_setting +
122
+ performing_professional
156
123
end
157
124
158
125
def child_columns
@@ -164,7 +131,7 @@ def child_columns
164
131
{
165
132
name : "CHILD_DATE_OF_BIRTH" ,
166
133
notes :
167
- "#{ tag . strong ( "Required" ) } , must use #{ tag . i ( "DD/MM/YYYY" ) } or #{ tag . i ( "YYYY-MM-DD" ) } format"
134
+ "#{ tag . strong ( "Required" ) } , must use #{ tag . i ( "DD/MM/YYYY" ) } or #{ tag . i ( "YYYY-MM-DD" ) } format. "
168
135
} ,
169
136
{
170
137
name : "CHILD_YEAR_GROUP" ,
@@ -176,17 +143,17 @@ def child_columns
176
143
{
177
144
name : "CHILD_REGISTRATION" ,
178
145
notes :
179
- "Optional, the child’s registration group, for example #{ tag . i ( "8T5" ) } "
146
+ "Optional, the child’s registration group, for example #{ tag . i ( "8T5" ) } . "
180
147
} ,
181
148
{
182
149
name : "CHILD_NHS_NUMBER" ,
183
- notes : "Optional, must be 10 digits and numeric"
150
+ notes : "Optional, must be 10 digits and numeric. "
184
151
} ,
185
152
{
186
153
name : "CHILD_GENDER" ,
187
154
notes :
188
155
"Optional, must be one of: #{ tag . i ( "Male" ) } , #{ tag . i ( "Female" ) } , " \
189
- "#{ tag . i ( "Not known" ) } or #{ tag . i ( "Not specified" ) } "
156
+ "#{ tag . i ( "Not known" ) } or #{ tag . i ( "Not specified" ) } . "
190
157
} ,
191
158
{ name : "CHILD_ADDRESS_LINE_1" , notes : "Optional" } ,
192
159
{ name : "CHILD_ADDRESS_LINE_2" , notes : "Optional" } ,
@@ -202,7 +169,7 @@ def parent_columns
202
169
name : "#{ prefix } _RELATIONSHIP" ,
203
170
notes :
204
171
"Optional, must be one of: #{ tag . i ( "Mum" ) } , #{ tag . i ( "Dad" ) } or " \
205
- "#{ tag . i ( "Guardian" ) } "
172
+ "#{ tag . i ( "Guardian" ) } . "
206
173
} ,
207
174
{
208
175
name : "#{ prefix } _EMAIL" ,
@@ -216,21 +183,48 @@ def parent_columns
216
183
end
217
184
end
218
185
219
- def reason_not_vaccinated_and_notes
220
- reasons = ImmunisationImportRow ::REASONS . keys . sort . map { tag . i ( _1 ) }
221
- reasons_sentence =
222
- reasons . to_sentence (
223
- last_word_connector : " or " ,
186
+ def programme
187
+ programmes =
188
+ organisation . programmes . flat_map ( &:import_names ) . map { tag . i ( it ) }
189
+
190
+ programmes_sentence =
191
+ programmes . to_sentence (
192
+ last_word_connector : ", or " ,
224
193
two_words_connector : " or "
225
194
)
226
195
227
196
[
228
197
{
229
- name : "REASON_NOT_VACCINATED" ,
230
- notes :
231
- "Required if #{ tag . code ( "VACCINATED" ) } is #{ tag . i ( "N" ) } , must be #{ reasons_sentence } "
198
+ name : "PROGRAMME" ,
199
+ notes : "#{ tag . strong ( "Required" ) } , must be #{ programmes_sentence } ."
200
+ }
201
+ ]
202
+ end
203
+
204
+ def vaccine_and_batch
205
+ vaccines = organisation . vaccines . pluck ( :nivs_name ) . map { tag . i ( it ) }
206
+
207
+ vaccines_sentence =
208
+ vaccines . to_sentence (
209
+ last_word_connector : ", or " ,
210
+ two_words_connector : " or "
211
+ )
212
+
213
+ [
214
+ {
215
+ name : "VACCINE_GIVEN" ,
216
+ notes : "Optional, must be #{ vaccines_sentence } ."
232
217
} ,
233
- { name : "NOTES" , notes : "Optional" }
218
+ {
219
+ name : "BATCH_NUMBER" ,
220
+ notes : "Required if #{ tag . code ( "BATCH_EXPIRY_DATE" ) } is provided."
221
+ } ,
222
+ {
223
+ name : "BATCH_EXPIRY_DATE" ,
224
+ notes :
225
+ "Required if #{ tag . code ( "BATCH_NUMBER" ) } is provided, must use " \
226
+ "either #{ tag . i ( "YYYYMMDD" ) } or #{ tag . i ( "DD/MM/YYYY" ) } format."
227
+ }
234
228
]
235
229
end
236
230
@@ -247,13 +241,30 @@ def anatomical_site
247
241
{
248
242
name : "ANATOMICAL_SITE" ,
249
243
notes :
250
- "Required if #{ tag . code ( "VACCINATED" ) } is #{ tag . i ( "Y" ) } . It must be " \
251
- "appropriate for the vaccine delivery method and be one of: " \
252
- "#{ site_sentence } "
244
+ "Optional, if provided must be appropriate for the vaccine delivery method " \
245
+ "and be one of: #{ site_sentence } ."
253
246
}
254
247
]
255
248
end
256
249
250
+ def reason_not_vaccinated_and_notes
251
+ reasons = ImmunisationImportRow ::REASONS . keys . sort . map { tag . i ( _1 ) }
252
+ reasons_sentence =
253
+ reasons . to_sentence (
254
+ last_word_connector : " or " ,
255
+ two_words_connector : " or "
256
+ )
257
+
258
+ [
259
+ {
260
+ name : "REASON_NOT_VACCINATED" ,
261
+ notes :
262
+ "Required if #{ tag . code ( "VACCINATED" ) } is #{ tag . i ( "N" ) } , must be #{ reasons_sentence } ."
263
+ } ,
264
+ { name : "NOTES" , notes : "Optional" }
265
+ ]
266
+ end
267
+
257
268
def dose_sequence
258
269
special_values =
259
270
ImmunisationImportRow ::DOSE_SEQUENCES
@@ -272,7 +283,7 @@ def dose_sequence
272
283
[
273
284
{
274
285
name : "DOSE_SEQUENCE" ,
275
- notes : "Optional, must be a number or #{ special_values_sentence } "
286
+ notes : "Optional, must be a number or #{ special_values_sentence } . "
276
287
}
277
288
]
278
289
end
@@ -282,32 +293,25 @@ def care_setting
282
293
{
283
294
name : "CARE_SETTING" ,
284
295
notes :
285
- "Optional, must be #{ tag . i ( "1" ) } (school) or #{ tag . i ( "2" ) } (clinic)"
296
+ "Optional, must be #{ tag . i ( "1" ) } (school) or #{ tag . i ( "2" ) } (clinic). "
286
297
} ,
287
298
{
288
299
name : "CLINIC_NAME" ,
289
300
notes :
290
301
"Required if #{ tag . code ( "CARE_SETTING" ) } is #{ tag . i ( "2" ) } , must be " \
291
- "the name of a community clinic location"
302
+ "the name of a community clinic location. "
292
303
}
293
304
]
294
305
end
295
306
296
307
def performing_professional
297
308
[
298
- { name : "PERFORMING_PROFESSIONAL_EMAIL" , notes : tag . strong ( "Required" ) } ,
299
309
{
300
- name : "PERFORMING_PROFESSIONAL_FORENAME" ,
301
- notes :
302
- "Required for uploading historical vaccination records unless " \
303
- "#{ tag . code ( "PERFORMING_PROFESSIONAL_EMAIL" ) } is provided"
310
+ name : "PERFORMING_PROFESSIONAL_EMAIL" ,
311
+ notes : "Required if uploading offline vaccination records."
304
312
} ,
305
- {
306
- name : "PERFORMING_PROFESSIONAL_SURNAME" ,
307
- notes :
308
- "Required for uploading historical vaccination records unless " \
309
- "#{ tag . code ( "PERFORMING_PROFESSIONAL_EMAIL" ) } is provided"
310
- }
313
+ { name : "PERFORMING_PROFESSIONAL_FORENAME" , notes : "Optional" } ,
314
+ { name : "PERFORMING_PROFESSIONAL_SURNAME" , notes : "Optional" }
311
315
]
312
316
end
313
317
end
0 commit comments