Skip to content

Commit 032a588

Browse files
Remove legal mechanism from Record and Records flows (#520)
Taking this back out again for now, ahead of some user research on another topic.
1 parent 8d316f6 commit 032a588

File tree

11 files changed

+7
-128
lines changed

11 files changed

+7
-128
lines changed

app/routes/helpers.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ module.exports = router => {
66
const data = req.session.data
77
const currentOrganisation = res.locals.currentOrganisation
88

9-
const allLegalMechanisms = data.legalMechanisms.map((legalMechaism) => legalMechaism.value)
10-
119
let vaccineStock = data.vaccineStock
1210

1311
const organisationVaccines = currentOrganisation.vaccines
@@ -57,7 +55,6 @@ module.exports = router => {
5755
id: generatedVaccineId,
5856
vaccine: vaccine.name,
5957
vaccineProduct: vaccineProduct.name,
60-
legalMechanisms: allLegalMechanisms,
6158
siteId: siteId,
6259
batches: batches
6360
})
@@ -116,8 +113,6 @@ module.exports = router => {
116113
const randomVaccineProduct = randomItem(vaccineProductsInStock)
117114
const randombatchNumber = randomItem(randomVaccineProduct.batches)
118115

119-
const randomLegalMechanism = randomItem(data.legalMechanisms).value
120-
121116
const vaccinator = randomItem(vaccinators)
122117

123118
const randomName = randomItem(listOfFirstNames) + " " + randomItem(listOfLastNames)
@@ -142,7 +137,6 @@ module.exports = router => {
142137
batchNumber: randombatchNumber.batchNumber,
143138
batchExpiryDate: "2025-01-05",
144139
vaccinatorId: vaccinator.id,
145-
legalMechanism: randomLegalMechanism,
146140
eligibility: ["Pregnant"],
147141
pregnancyDueDate: {
148142
day: "04",

app/routes/record-vaccinations.js

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,7 @@ module.exports = router => {
418418

419419
const allLegalMechanisms = data.legalMechanisms
420420

421-
const legalMechanisms = allLegalMechanisms.filter((legalMechanism) => {
422-
return vaccine.legalMechanisms.includes(legalMechanism.value)
423-
})
421+
const legalMechanisms = allLegalMechanisms
424422

425423
res.render('record-vaccinations/legal-mechanism', {
426424
legalMechanisms
@@ -640,7 +638,6 @@ module.exports = router => {
640638
organisationId: currentOrganisation.id,
641639
siteId: data.siteId,
642640
vaccinatorId: data.vaccinatorId,
643-
legalMechanism: data.legalMechanism,
644641
eligibility: data.eligibility,
645642
pregnancyDueDate: data.pregnancyDueDate,
646643
consent: data.consent,
@@ -755,7 +752,6 @@ module.exports = router => {
755752
req.session.data.vaccineProduct = ""
756753
req.session.data.vaccineBatch = ""
757754
req.session.data.eligibility = ""
758-
req.session.data.legalMechanism = ""
759755

760756
res.redirect('/record-vaccinations/vaccine?repeatPatient=yes&repeatVaccination=no')
761757

@@ -766,7 +762,6 @@ module.exports = router => {
766762
req.session.data.vaccineBatch = ""
767763
req.session.data.eligibility = ""
768764
req.session.data.nhsNumber = ""
769-
req.session.data.legalMechanism = ""
770765
req.session.data.healthcareWorker = ""
771766

772767
res.redirect('/record-vaccinations/vaccine?repeatPatient=no&repeatVaccination=no')
@@ -856,11 +851,6 @@ module.exports = router => {
856851
})
857852
if (!vaccineOptions) { res.redirect('/record-vaccinations'); return }
858853

859-
const allLegalMechanisms = data.legalMechanisms
860-
861-
const legalMechanisms = allLegalMechanisms.filter((legalMechanism) => {
862-
return vaccineOptions.legalMechanisms.includes(legalMechanism['value'])
863-
})
864854

865855
let redirectPath
866856

@@ -870,14 +860,7 @@ module.exports = router => {
870860
redirectPath = "/record-vaccinations/batch?showError=yes"
871861
} else if (["COVID-19", "flu", "flu (London service)", "RSV", "pneumococcal"].includes(data.vaccine)) {
872862

873-
if (legalMechanisms.length > 1) {
874-
redirectPath = "/record-vaccinations/legal-mechanism"
875-
} else {
876-
// Set legal mechanism to the only option available and skip
877-
// the question
878-
data.legalMechanism = legalMechanisms[0].value
879-
redirectPath = "/record-vaccinations/eligibility"
880-
}
863+
redirectPath = "/record-vaccinations/eligibility"
881864

882865
} else if (data.repeatPatient === "yes") {
883866
redirectPath = "/record-vaccinations/patient-estimated-due-date"
@@ -923,10 +906,10 @@ module.exports = router => {
923906

924907
if (data.newBatchNumber === '' || data.newBatchExpiryDate?.day === '' || data.newBatchExpiryDate?.month === '' || data.newBatchExpiryDate?.year === '') {
925908
nextPage = "/record-vaccinations/add-batch?showErrors=yes"
926-
} else if ((data.vaccine === "pertussis") || (data.vaccine === "MMR")) {
927-
nextPage = "/record-vaccinations/patient"
909+
} else if (["COVID-19", "flu", "flu (London service)", "RSV", "pneumococcal"].includes(data.vaccine)) {
910+
nextPage = "/record-vaccinations/eligibility"
928911
} else {
929-
nextPage = "/record-vaccinations/legal-mechanism"
912+
nextPage = "/record-vaccinations/patient"
930913
}
931914

932915
res.redirect(nextPage)

app/routes/records.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,6 @@ module.exports = router => {
136136
vaccination.batchNumber = data.batchNumber
137137
}
138138

139-
if (data.legalMechanism) {
140-
vaccination.legalMechanism = data.legalMechanism
141-
}
142-
143139
if (data.notes) {
144140
vaccination.notes = data.notes
145141
}

app/routes/vaccines.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ module.exports = (router) => {
1414
vaccine: data.vaccine,
1515
vaccineProduct: data.vaccineProduct,
1616
siteId: data.siteId,
17-
legalMechanisms: data.vaccineLegalMechanisms,
1817
batches: [
1918
{
2019
id: Math.floor(Math.random() * 10000000).toString(),
@@ -34,7 +33,6 @@ module.exports = (router) => {
3433
req.session.data.batchExpiryDate.day = ''
3534
req.session.data.batchExpiryDate.month = ''
3635
req.session.data.batchExpiryDate.year = ''
37-
req.session.data.vaccineLegalMechanisms = ''
3836

3937
res.redirect('/vaccines/' + generatedId)
4038
})
@@ -109,12 +107,6 @@ module.exports = (router) => {
109107
res.render('vaccines/add-batch')
110108
})
111109

112-
// Viewing legal mechanisms page
113-
router.get('/vaccines/legal-mechanisms', (req, res) => {
114-
115-
res.render('vaccines/legal-mechanisms')
116-
})
117-
118110
// Viewing check answers page
119111
router.get('/vaccines/check', (req, res) => {
120112

@@ -153,7 +145,6 @@ module.exports = (router) => {
153145
req.session.data.batchExpiryDate.day = ''
154146
req.session.data.batchExpiryDate.month = ''
155147
req.session.data.batchExpiryDate.year = ''
156-
req.session.data.vaccineLegalMechanisms = ''
157148

158149
res.redirect('/vaccines/' + vaccine.id)
159150
})

app/views/record-vaccinations/check.html

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -236,23 +236,6 @@ <h2 class="nhsuk-heading-m">Vaccination</h2>
236236
]
237237
}
238238
},
239-
{
240-
key: {
241-
text: "Legal mechanism"
242-
},
243-
value: {
244-
text: data.legalMechanism
245-
},
246-
actions: {
247-
items: [
248-
{
249-
href: "/record-vaccinations/legal-mechanism",
250-
text: "Change",
251-
visuallyHiddenText: "legal mechanism"
252-
}
253-
]
254-
}
255-
},
256239
{
257240
key: {
258241
text: "Vaccinator"

app/views/record-vaccinations/eligibility.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% set currentSection = "vaccinate" %}
66

77
{% block beforeContent %}
8-
{% set backHref = from if from else "/record-vaccinations/legal-mechanism" %}
8+
{% set backHref = from if from else "/record-vaccinations/batch" %}
99

1010
{{ backLink({ href: backHref }) }}
1111
{% endblock %}

app/views/record-vaccinations/review-previous.html

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,6 @@ <h1 class="nhsuk-heading-l">{{ pageName }}</h1>
101101
]
102102
}
103103
},
104-
{
105-
key: {
106-
text: "Legal mechanism"
107-
},
108-
value: {
109-
text: data.legalMechanism
110-
},
111-
actions: {
112-
items: [
113-
{
114-
href: "/record-vaccinations/legal-mechanism",
115-
text: "Change",
116-
visuallyHiddenText: "legal mechanism"
117-
}
118-
]
119-
}
120-
},
121104
{
122105
key: {
123106
text: "Eligibility"

app/views/records/check.html

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,23 +136,6 @@ <h1 class="nhsuk-heading-l">{{ vaccination.patient.name }}’s {{vaccination.vac
136136
]
137137
}
138138
},
139-
{
140-
key: {
141-
text: "Legal mechanism"
142-
},
143-
value: {
144-
text: vaccination.legalMechanism
145-
},
146-
actions: {
147-
items: [
148-
{
149-
href: "/records/records/" + vaccination.id + "/legal-mechanism",
150-
text: "Change",
151-
visuallyHiddenText: "legal mechanism"
152-
}
153-
]
154-
}
155-
},
156139
{
157140
key: {
158141
text: "Vaccinator"

app/views/vaccines/add-batch.html

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

1818
<h1 class="nhsuk-heading-l">Add batch</h1>
1919

20-
<form action="/vaccines/legal-mechanisms" method="post" novalidate="true">
20+
<form action="/vaccines/check" method="post" novalidate="true">
2121

2222
{{ input({
2323
"label": {

app/views/vaccines/check.html

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,6 @@ <h1 class="nhsuk-heading-xl">{{ pageName }}</h1>
106106
}
107107
]
108108
}
109-
},
110-
{
111-
key: {
112-
text: "Legal mechanism"
113-
},
114-
value: {
115-
html: (data.vaccineLegalMechanisms | join("<br>") if data.vaccineLegalMechanisms)
116-
},
117-
actions: {
118-
items: [
119-
{
120-
href: "/vaccines/legal-mechanisms",
121-
text: "Change",
122-
visuallyHiddenText: "legal mechanism"
123-
}
124-
]
125-
}
126109
}
127110
]
128111
}) }}

0 commit comments

Comments
 (0)