Skip to content

Commit 70d9dfd

Browse files
Change order of questions (#525)
This moves the pages where the user searches for a patient and sees their vaccination history to the beginning of the new Record vaccinations journey. This is because: * some users like to use the patient history to assess eligibility for the vaccine (for instance if the patient cannot remember) * some users have a cohort of patients (for example in care homes) and want to check if they are missing any vaccinations * expectations from other systems are that the patient is found first The original justification for having other questions first would be that they support 'setting up' a clinic, answering the questions which will apply to all vaccinations in that clinic first (such as location, vaccinator and vaccine type). However there are enough ad-hoc vaccinations and mixed clinic sessions that we now believe the benefits of re-ordering the question outweigh this. The repeat journey (same vax different patient, another vaccination for a different patient) have also been changed a bit, putting the patient finding first. The co-admin journey is largely unchanged.
1 parent eeb8bf7 commit 70d9dfd

File tree

10 files changed

+203
-109
lines changed

10 files changed

+203
-109
lines changed

README.md

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

33
This contains prototype interfaces for the NHS Record a vaccination service.
44

5-
It uses the <a href="http://nhsuk-prototype-kit.azurewebsites.net/docs">NHS.UK prototype kit</a>.
5+
It uses the <a href="https://prototype-kit.service-manual.nhs.uk">NHS.UK prototype kit</a>.
66

77
## Running the prototypes locally
88

app/routes/record-vaccinations.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -570,21 +570,18 @@ module.exports = router => {
570570
const data = req.session.data
571571
const eligibility = data.eligibility
572572

573+
573574
let nextPage;
574575

575576
if (!eligibility || eligibility === "" || eligibility == []) {
576577

577578
nextPage = "/record-vaccinations/eligibility?showErrors=yes"
578579

579-
} else if (data.firstName && data.firstName != "" && data.repeatPatient === "yes") {
580+
} else if (eligibility === "Pregnant" && data.vaccine === "RSV") {
580581

581-
if (data.vaccine === "Pertussis" || ((data.vaccine == "RSV") && (eligibility === "Pregnant"))) {
582-
nextPage = "/record-vaccinations/patient-estimated-due-date"
583-
} else {
584-
nextPage = "/record-vaccinations/patient-history"
585-
}
582+
nextPage = "/record-vaccinations/patient-estimated-due-date"
586583

587-
} else if (data.vaccine == "flu" && data.eligibility === "Health or social care worker" && (!data.healthcareWorker || data.healthcareWorker === "")) {
584+
} else if (data.vaccine == "flu" && data.eligibility === "Health or social care worker") {
588585

589586
nextPage = "/record-vaccinations/healthcare-worker"
590587

@@ -598,7 +595,7 @@ module.exports = router => {
598595

599596
} else {
600597

601-
nextPage = "/record-vaccinations/patient"
598+
nextPage = "/record-vaccinations/consent"
602599

603600
}
604601

@@ -647,6 +644,8 @@ module.exports = router => {
647644
editable: true
648645
})
649646

647+
data.lastAddedVaccinationId = generatedId
648+
650649
res.redirect('/record-vaccinations/done')
651650
})
652651

@@ -656,6 +655,8 @@ module.exports = router => {
656655
let errors = []
657656
let error
658657

658+
const lastAddedVaccination = data.vaccinationsRecorded.find((record) => record.id === data.lastAddedVaccinationId)
659+
659660
if (req.query.showErrors === 'yes') {
660661
if (!data.nextStep) {
661662
error = {
@@ -667,6 +668,7 @@ module.exports = router => {
667668
}
668669

669670
res.render('record-vaccinations/done', {
671+
lastAddedVaccination,
670672
errors,
671673
error
672674
})
@@ -706,7 +708,7 @@ module.exports = router => {
706708
} else if (data.repeatVaccination === "yes") {
707709
nextPage = '/record-vaccinations/review-previous'
708710
} else {
709-
nextPage = '/record-vaccinations/location'
711+
nextPage = '/record-vaccinations/consent'
710712
}
711713

712714
res.redirect(nextPage)
@@ -754,7 +756,7 @@ module.exports = router => {
754756
req.session.data.vaccineBatch = ""
755757
req.session.data.eligibility = ""
756758

757-
res.redirect('/record-vaccinations/vaccine?repeatPatient=yes&repeatVaccination=no')
759+
res.redirect('/record-vaccinations/patient-history?repeatPatient=yes&repeatVaccination=no')
758760

759761
} else if (answer === 'different-vaccination-another-patient') {
760762

@@ -765,7 +767,7 @@ module.exports = router => {
765767
req.session.data.nhsNumber = ""
766768
req.session.data.healthcareWorker = ""
767769

768-
res.redirect('/record-vaccinations/vaccine?repeatPatient=no&repeatVaccination=no')
770+
res.redirect('/record-vaccinations/?repeatPatient=no&repeatVaccination=no')
769771
} else {
770772
res.redirect('/record-vaccinations/done?showErrors=yes')
771773
}
@@ -836,7 +838,7 @@ module.exports = router => {
836838
if (!data.locationType) {
837839
redirectPath = "/record-vaccinations/location?showErrors=yes"
838840
} else {
839-
redirectPath = "/record-vaccinations/patient"
841+
redirectPath = "/record-vaccinations/consent"
840842
}
841843

842844
res.redirect(redirectPath)
@@ -853,21 +855,19 @@ module.exports = router => {
853855
})
854856
if (!vaccineOptions) { res.redirect('/record-vaccinations'); return }
855857

856-
857858
let redirectPath
858859

859860
if (vaccineBatch === "add-new") {
860861
redirectPath = "/record-vaccinations/add-batch"
861862
} else if (!vaccineBatch) {
862863
redirectPath = "/record-vaccinations/batch?showError=yes"
863864
} else if (["COVID-19", "flu", "flu (London service)", "RSV", "pneumococcal"].includes(data.vaccine)) {
864-
865865
redirectPath = "/record-vaccinations/eligibility"
866-
867-
} else if (data.repeatPatient === "yes") {
866+
} else if (data.vaccine === "pertussis") {
868867
redirectPath = "/record-vaccinations/patient-estimated-due-date"
869868
} else {
870-
redirectPath = "/record-vaccinations/patient"
869+
// MMR
870+
redirectPath = "/record-vaccinations/consent"
871871
}
872872
res.redirect(redirectPath)
873873
})

app/views/record-vaccinations/check.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -197,89 +197,89 @@ <h2 class="nhsuk-heading-m">Vaccination</h2>
197197
},
198198
{
199199
key: {
200-
text: "Vaccine"
200+
text: "Vaccinator"
201201
},
202202
value: {
203-
html: (data.vaccine | capitaliseFirstLetter) + "<br>" + data.vaccineProduct
203+
text: vaccinator.firstName + " " + vaccinator.lastName
204204
},
205205
actions: {
206206
items: [
207207
{
208-
href: "/record-vaccinations/vaccine",
208+
href: "/record-vaccinations/vaccinator",
209209
text: "Change",
210-
visuallyHiddenText: "vaccine"
210+
visuallyHiddenText: "contact information"
211211
}
212212
]
213213
}
214214
},
215215
{
216216
key: {
217-
text: "Batch"
217+
text: "Vaccine"
218218
},
219219
value: {
220-
html: batchHtml
220+
html: (data.vaccine | capitaliseFirstLetter) + "<br>" + data.vaccineProduct
221221
},
222222
actions: {
223223
items: [
224224
{
225-
href: ("/record-vaccinations/add-batch" if data.vaccineBatch == "add-new" else "/record-vaccinations/batch"),
225+
href: "/record-vaccinations/vaccine",
226226
text: "Change",
227-
visuallyHiddenText: "vaccine batch"
227+
visuallyHiddenText: "vaccine"
228228
}
229229
]
230230
}
231231
},
232232
{
233233
key: {
234-
text: "Vaccinator"
234+
text: "Batch"
235235
},
236236
value: {
237-
text: vaccinator.firstName + " " + vaccinator.lastName
237+
html: batchHtml
238238
},
239239
actions: {
240240
items: [
241241
{
242-
href: "/record-vaccinations/vaccinator",
242+
href: ("/record-vaccinations/add-batch" if data.vaccineBatch == "add-new" else "/record-vaccinations/batch"),
243243
text: "Change",
244-
visuallyHiddenText: "contact information"
244+
visuallyHiddenText: "vaccine batch"
245245
}
246246
]
247247
}
248248
},
249249
{
250250
key: {
251-
text: "Location"
251+
text: "Eligibility"
252252
},
253253
value: {
254-
html: locationHtml
254+
html: ((data.eligibility | join("<br>")) if (data.eligibility | isArray) else data.eligibility)
255255
},
256256
actions: {
257257
items: [
258258
{
259-
href: "/record-vaccinations/location",
259+
href: "/record-vaccinations/eligibility",
260260
text: "Change",
261-
visuallyHiddenText: "contact information"
261+
visuallyHiddenText: "eligibility"
262262
}
263263
]
264264
}
265-
} if (data.vaccine === "Flu" or data.vaccine == "COVID-19"),
265+
} if (data.vaccine != "pertussis"),
266266
{
267267
key: {
268-
text: "Eligibility"
268+
text: "Location"
269269
},
270270
value: {
271-
html: ((data.eligibility | join("<br>")) if (data.eligibility | isArray) else data.eligibility)
271+
html: locationHtml
272272
},
273273
actions: {
274274
items: [
275275
{
276-
href: "/record-vaccinations/eligibility",
276+
href: "/record-vaccinations/location",
277277
text: "Change",
278-
visuallyHiddenText: "eligibility"
278+
visuallyHiddenText: "contact information"
279279
}
280280
]
281281
}
282-
} if (data.vaccine != "Pertussis"),
282+
} if (data.vaccine === "Flu" or data.vaccine == "COVID-19"),
283283
{
284284
key: {
285285
text: "Role"
@@ -313,7 +313,7 @@ <h2 class="nhsuk-heading-m">Vaccination</h2>
313313
}
314314
]
315315
}
316-
} if ((data.vaccine == "Pertussis") or ((data.eligibility | arrayOrStringIncludes("Pregnant"))) and (data.vaccine == "RSV")),
316+
} if ((data.vaccine == "pertussis") or ((data.eligibility | arrayOrStringIncludes("Pregnant"))) and (data.vaccine == "RSV")),
317317
{
318318
key: {
319319
text: "Consent given by"

app/views/record-vaccinations/delivery-team.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{% set organisationSetting = currentUser.organisations | findById(data.currentOrganisationId) %}
77

88
{% block beforeContent %}
9-
{{ backLink({ href: "/record-vaccinations/" }) }}
9+
{{ backLink({ href: "/record-vaccinations/vaccination-date" }) }}
1010
{% endblock %}
1111

1212
{% block content %}

app/views/record-vaccinations/done.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{% endif %}
1717

1818
{% set panelHtml %}
19-
<a href="#" class="nhsuk-link--reverse">{{ data.firstName }} {{ data.lastName }}’s {{ data.vaccine }} record</a> will be sent to their GP.
19+
<a href="/records/records/{{ lastAddedVaccination.id }}" class="nhsuk-link--reverse">{{ lastAddedVaccination.patient.name }}’s {{ lastAddedVaccination.vaccine }} record</a> will be sent to their GP.
2020
{% endset %}
2121

2222
{{ panel({
@@ -27,13 +27,13 @@
2727
<form action="/record-vaccinations/what-next" method="post" novalidate>
2828

2929
{% set lowercaseVaccineName %}
30-
{% if (data.vaccine == "RSV") %}
30+
{% if (lastAddedVaccination.vaccine == "RSV") %}
3131
An RSV
32-
{% elseif (data.vaccine == "COVID-19") %}
32+
{% elseif (lastAddedVaccination.vaccine == "COVID-19") %}
3333
A COVID-19
34-
{% elseif (data.vaccine == "flu") %}
34+
{% elseif (lastAddedVaccination.vaccine == "flu") %}
3535
A flu
36-
{% elseif (data.vaccine == "pertussis") %}
36+
{% elseif (lastAddedVaccination.vaccine == "pertussis") %}
3737
A pertussis
3838
{% else %}
3939
A COVID-19
@@ -43,7 +43,7 @@
4343
{% set items = [] %}
4444
{% set items = (items.push({
4545
value: "same-patient-another-vaccination",
46-
text: (data.firstName + " " + data.lastName + "’s next vaccination")
46+
text: (lastAddedVaccination.patient.name + "’s next vaccination")
4747
}), items) %}
4848

4949
{% set items = (items.push({

0 commit comments

Comments
 (0)