Skip to content

Commit 9e2d8d0

Browse files
PPV and MMR (#396)
This adds the MMR and pneumococcal vaccines to the prototype, along with a new set of eligibility questions for pneumococcal, and warning messages for the 2 new vaccines. --------- Co-authored-by: Frankie Roberto <[email protected]> Co-authored-by: Frankie Roberto <[email protected]>
1 parent c3ae0cd commit 9e2d8d0

File tree

12 files changed

+336
-17
lines changed

12 files changed

+336
-17
lines changed

app/data/vaccines.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ module.exports = [
5353
}
5454
]
5555
},
56+
{
57+
name: "MMR",
58+
products: [
59+
{
60+
name: "MMRVaXPro"
61+
},
62+
{
63+
name: "Priorix"
64+
}
65+
]
66+
},
67+
{
68+
name: "pneumococcal",
69+
products: [
70+
{
71+
name: "Pneumovax"
72+
}
73+
]
74+
},
5675
{
5776
name: "RSV",
5877
products: [

app/routes/record-vaccinations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ module.exports = router => {
769769
redirectPath = "/record-vaccinations/add-batch"
770770
} else if (!vaccineBatch) {
771771
redirectPath = "/record-vaccinations/batch?showError=yes"
772-
} else if (["COVID-19", "flu", "RSV"].includes(data.vaccine)) {
772+
} else if (["COVID-19", "flu", "RSV", "pneumococcal"].includes(data.vaccine)) {
773773
redirectPath = "/record-vaccinations/eligibility"
774774
} else if (data.repeatPatient === "yes") {
775775
redirectPath = "/record-vaccinations/patient-estimated-due-date"
@@ -815,7 +815,7 @@ module.exports = router => {
815815

816816
if (data.newBatchNumber === '' || data.newBatchExpiryDate?.day === '' || data.newBatchExpiryDate?.month === '' || data.newBatchExpiryDate?.year === '') {
817817
nextPage = "/record-vaccinations/add-batch?showErrors=yes"
818-
} else if (data.vaccine === "pertussis") {
818+
} else if ((data.vaccine === "pertussis") || (data.vaccine === "MMR")) {
819819
nextPage = "/record-vaccinations/patient"
820820
} else {
821821
nextPage = "/record-vaccinations/eligibility"

app/routes/vaccines.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,17 @@ module.exports = (router) => {
4747
router.get('/vaccines/choose-vaccine', (req, res) => {
4848
const data = req.session.data
4949

50-
const vaccinesEnabledNames = res.locals.currentOrganisation.vaccines
51-
.filter((vaccine) => vaccine.status === "enabled")
52-
.map((vaccine) => vaccine.name)
50+
const organisationVaccines = res.locals.currentOrganisation.vaccines || []
5351

54-
const vaccinesEnabled = data.vaccines.filter((vaccine) => vaccinesEnabledNames.includes(vaccine.name))
52+
const vaccinesEnabled = organisationVaccines
53+
.filter((vaccine) => vaccine.status === "enabled")
5554

56-
const vaccinesDisabledNames = res.locals.currentOrganisation.vaccines
57-
.filter((vaccine) => vaccine.status === "disabled")
58-
.map((vaccine) => vaccine.name)
55+
const vaccinesEnabledNames = vaccinesEnabled
56+
.map((vaccine) => vaccine.name)
5957

58+
const allVaccines = data.vaccines
6059

61-
const vaccinesDisabled = data.vaccines.filter((vaccine) => vaccinesDisabledNames.includes(vaccine.name))
60+
const vaccinesDisabled = allVaccines.filter((vaccine) => !vaccinesEnabledNames.includes(vaccine.name))
6261

6362
res.render('vaccines/choose-vaccine', {
6463
vaccinesEnabled,

app/views/index.html

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,57 @@ <h2>Error pages</h2>
7171

7272
<h2>Messaging</h2>
7373

74-
<ul>
74+
<ul>
7575
<li><a href="/reports/notification">Notification (Reports)</a></li>
7676
<li><a href="/alerts/notification">Notification (Vaccines)</a></li>
7777
<li><a href="/record-vaccinations/done">Feedback</a></li>
7878
</ul>
7979

80+
81+
<h2>Warning messages</h2>
82+
83+
<h3>COVID-19</h3>
84+
<ul>
85+
<li><a href="/record-vaccinations/warning">Interval</a></li>
86+
<li><a href="/record-vaccinations/warning-wrong-age-for-product">Wrong age for product</a></li>
87+
</ul>
88+
89+
<h3>Flu</h3>
90+
<ul>
91+
<li><a href="/record-vaccinations/warning-wrong-age-for-product">Wrong age for product</a></li>
92+
</ul>
93+
94+
<h3>RSV</h3>
95+
<ul>
96+
<li><a href="/record-vaccinations/patient-estimated-due-date-rsv-warning">Not yet 28 weeks pregnant</a></li>
97+
</ul>
98+
99+
<h3>Pertussis</h3>
100+
<ul>
101+
<li><a href="/record-vaccinations/patient-estimated-due-date-pertussis-warning">Not yet 16 weeks pregnant</a></li>
102+
</ul>
103+
104+
105+
<h3>Pneumococcal (London service)</h3>
106+
<ul>
107+
<li><a href="/record-vaccinations/ppv/warning">Already had vaccine</a></li>
108+
<li><a href="/record-vaccinations/ppv/warning-age-young">Too young</a></li>
109+
</ul>
110+
111+
112+
<h3>MMR (London service)</h3>
113+
<ul>
114+
<li><a href="/record-vaccinations/mmr/warning">Interval less than 1 month</a></li>
115+
116+
<li><a href="/record-vaccinations/mmr/warning-dose">Already had 2 doses</a></li>
117+
118+
<li><a href="/record-vaccinations/mmr/warning-age-young">Too young</a></li>
119+
120+
<li><a href="/record-vaccinations/mmr/warning-age-old">Too old</a></li>
121+
</ul>
122+
123+
124+
80125
</div>
81126
</div>
82127
{% endblock %}

app/views/record-vaccinations/check.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ <h2 class="nhsuk-heading-m">Vaccination</h2>
186186
text: "Vaccine"
187187
},
188188
value: {
189-
html: data.vaccine + "<br>" + data.vaccineProduct
189+
html: (data.vaccine | capitaliseFirstLetter) + "<br>" + data.vaccineProduct
190190
},
191191
actions: {
192192
items: [

app/views/record-vaccinations/eligibility.html

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@
4444
"Healthcare worker not covered by national criteria"
4545
] %}
4646

47+
{% set pneumococcalOver65Options = [
48+
"Aged 65 and over"
49+
] %}
50+
51+
{% set pneumococcalUnder65Options = [
52+
"Heart disease",
53+
"Kidney disease",
54+
"Liver disease",
55+
"Respiratory disease",
56+
"Immunosuppressed",
57+
"Cochlear implants",
58+
"Diabetes"
59+
] %}
60+
61+
4762
{% block content %}
4863
<div class="nhsuk-grid-row">
4964
<div class="nhsuk-grid-column-two-thirds">
@@ -63,6 +78,8 @@
6378
{% set eligibilityOptions = NationalFluEligibilityOptions %}
6479
{% elif data.vaccine == "RSV" %}
6580
{% set eligibilityOptions = RSVEligibilityOptions %}
81+
{% elif data.vaccine == "pneumococcal" %}
82+
{% set eligibilityOptions = pneumococcalOver65Options %}
6683
{% else %}
6784
{% set eligibilityOptions = [] %}
6885
{% endif %}
@@ -71,8 +88,7 @@
7188
{% for option in eligibilityOptions %}
7289
{% set items = (items.push({
7390
text: option,
74-
value: option,
75-
checked: (data.eligibility | arrayOrStringIncludes(option))
91+
value: option
7692
}), items) %}
7793
{% endfor %}
7894

@@ -90,16 +106,16 @@
90106
{% for option in londonFluEligibilityOptions %}
91107
{% set londonFluItems = (londonFluItems.push({
92108
text: option,
93-
value: option,
94-
checked: (data.eligibility | arrayOrStringIncludes(option))
109+
value: option
95110
}), londonFluItems) %}
96111
{% endfor %}
97112

98113
{% set londonFluHtml %}
99114
{{ radios({
100115
idPrefix: "eligibility-2",
101116
name: "eligibility",
102-
items: londonFluItems
117+
items: londonFluItems,
118+
value: data.eligibility
103119
}) }}
104120
{% endset %}
105121

@@ -117,12 +133,36 @@
117133

118134
{% endif %}
119135

136+
{% if data.vaccine == "pneumococcal" %}
137+
<h2 class="nhsuk-u-font-size-19 nhsuk-u-margin-bottom-2 nhsuk-u-margin-top-3 nhsuk-u-font-weight-normal">Aged 65 and over</h2>
138+
{% endif %}
139+
120140
{{ radios({
121141
idPrefix: "eligibility",
122142
name: "eligibility",
143+
value: data.eligibility,
123144
items: items
124145
}) }}
125146

147+
{% if data.vaccine == "pneumococcal" %}
148+
<h2 class="nhsuk-u-font-size-19 nhsuk-u-margin-bottom-2 nhsuk-u-margin-top-3 nhsuk-u-font-weight-normal">Aged 18 to 64 and in a clinical risk group</h2>
149+
150+
{% set pneumococcalUnder64Items = [] %}
151+
{% for option in pneumococcalUnder65Options %}
152+
{% set pneumococcalUnder64Items = (pneumococcalUnder64Items.push({
153+
text: option,
154+
value: option
155+
}), pneumococcalUnder64Items) %}
156+
{% endfor %}
157+
158+
{{ radios({
159+
idPrefix: "eligibility2",
160+
name: "eligibility",
161+
value: data.eligibility,
162+
items: pneumococcalUnder64Items
163+
}) }}
164+
{% endif %}
165+
126166
{% endcall %}
127167

128168
{{ button({
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{% extends 'layout.html' %}
2+
3+
{% set pageName = "COVID-19 vaccine interval warning" %}
4+
5+
{% set currentSection = "vaccinate" %}
6+
7+
{% block beforeContent %}
8+
{{ backLink({ href: "/record-vaccinations/patient-history" }) }}
9+
{% endblock %}
10+
11+
{% block content %}
12+
<div class="nhsuk-grid-row">
13+
<div class="nhsuk-grid-column-two-thirds">
14+
15+
<h1 class="nhsuk-heading-l">Jodie Brown is too old for the London MMR service</h1>
16+
17+
<p>
18+
Jodie Brown is 20 years and 4 days old.
19+
</p>
20+
21+
<p>
22+
To be eligible for this service, you have to be under the age of 20. Refer this patient to their GP for a vaccination.
23+
</p>
24+
25+
<p>
26+
Your organisation may not be paid for this vaccination.
27+
</p>
28+
29+
</div>
30+
</div>
31+
32+
{{ button({
33+
"text": "Continue anyway",
34+
"href": "/record-vaccinations/consent"
35+
}) }}
36+
37+
{% endblock %}
38+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{% extends 'layout.html' %}
2+
3+
{% set pageName = "COVID-19 vaccine interval warning" %}
4+
5+
{% set currentSection = "vaccinate" %}
6+
7+
{% block beforeContent %}
8+
{{ backLink({ href: "/record-vaccinations/patient-history" }) }}
9+
{% endblock %}
10+
11+
{% block content %}
12+
<div class="nhsuk-grid-row">
13+
<div class="nhsuk-grid-column-two-thirds">
14+
15+
<h1 class="nhsuk-heading-l">Jodie Brown is too young for the London MMR service</h1>
16+
17+
<p>
18+
Jodie Brown is 4 years and 364 days old.
19+
</p>
20+
21+
<p>
22+
To be eligible for this service, you have to be aged 5 or older. Refer this patient to their GP for a vaccination.
23+
</p>
24+
25+
<p>
26+
Your organisation may not be paid for this vaccination.
27+
</p>
28+
29+
</div>
30+
</div>
31+
32+
{{ button({
33+
"text": "Continue anyway",
34+
"href": "/record-vaccinations/consent"
35+
}) }}
36+
37+
{% endblock %}
38+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{% extends 'layout.html' %}
2+
3+
{% set pageName = "COVID-19 vaccine interval warning" %}
4+
5+
{% set currentSection = "vaccinate" %}
6+
7+
{% block beforeContent %}
8+
{{ backLink({ href: "/record-vaccinations/patient-history" }) }}
9+
{% endblock %}
10+
11+
{% block content %}
12+
<div class="nhsuk-grid-row">
13+
<div class="nhsuk-grid-column-two-thirds">
14+
15+
<h1 class="nhsuk-heading-l">Jodie Brown has already had 2 doses of MMR</h1>
16+
17+
<p>
18+
Jodie Brown had a second MMR vaccine on 10 July 2025.
19+
</p>
20+
21+
<p>
22+
Most people only need 2 doses of the MMR vaccine.
23+
</p>
24+
25+
</div>
26+
</div>
27+
28+
{{ button({
29+
"text": "Continue anyway",
30+
"href": "/record-vaccinations/consent"
31+
}) }}
32+
33+
{% endblock %}
34+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{% extends 'layout.html' %}
2+
3+
{% set pageName = "COVID-19 vaccine interval warning" %}
4+
5+
{% set currentSection = "vaccinate" %}
6+
7+
{% block beforeContent %}
8+
{{ backLink({ href: "/record-vaccinations/patient-history" }) }}
9+
{% endblock %}
10+
11+
{% block content %}
12+
<div class="nhsuk-grid-row">
13+
<div class="nhsuk-grid-column-two-thirds">
14+
15+
<h1 class="nhsuk-heading-l">Jodie Brown had an MMR vaccine less than 1 month ago</h1>
16+
17+
<p>
18+
Jodie Brown had an MMR vaccine on 10 July 2025.
19+
</p>
20+
21+
<p>
22+
The minimum recommended gap between MMR doses is 1 month.
23+
</p>
24+
25+
</div>
26+
</div>
27+
28+
{{ button({
29+
"text": "Continue anyway",
30+
"href": "/record-vaccinations/consent"
31+
}) }}
32+
33+
{% endblock %}
34+

0 commit comments

Comments
 (0)