Skip to content

Commit a9c68e7

Browse files
Allow teams to opt-in to MMR(V) outbreak comms
1 parent 3e63382 commit a9c68e7

7 files changed

Lines changed: 62 additions & 11 deletions

File tree

app/controllers/session.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -541,16 +541,7 @@ export const sessionController = {
541541
const journey = {
542542
[`/`]: {},
543543
[`/${session_id}/${type}/type`]: {},
544-
[`/${session_id}/${type}/programmes`]: {
545-
[`/${session_id}/${type}/school`]: {
546-
data: 'session.type',
547-
value: SessionType.School
548-
},
549-
[`/${session_id}/${type}/clinic`]: {
550-
data: 'session.type',
551-
value: SessionType.Clinic
552-
}
553-
},
544+
[`/${session_id}/${type}/programmes`]: {},
554545
...(session.type === SessionType.School
555546
? {
556547
[`/${session_id}/${type}/school`]: {},
@@ -562,6 +553,11 @@ export const sessionController = {
562553
[`/${session_id}/${type}/date`]: {}
563554
}),
564555
[`/${session_id}/${type}/date-check`]: {},
556+
...(session.presetNames?.includes(SessionPresetName.MMR)
557+
? {
558+
[`/${session_id}/${type}/mmr-consent`]: {}
559+
}
560+
: {}),
565561
[`/${session_id}/${type}/check-answers`]: {},
566562
[`/${session_id}`]: {}
567563
}

app/enums.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,16 @@ export const SessionPresetName = {
406406
Flu: 'Flu',
407407
HPV: 'HPV',
408408
Doubles: 'Doubles',
409-
MMR: 'MMR'
409+
MMR: 'MMR(V)'
410+
}
411+
412+
/**
413+
* @readonly
414+
* @enum {string}
415+
*/
416+
export const SessionMMRConsent = {
417+
Standard: 'Standard request',
418+
Outbreak: 'Outbreak request'
410419
}
411420

412421
/**

app/locales/en.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,6 +1726,19 @@ export const en = {
17261726
consentWindow: {
17271727
label: 'Consent period'
17281728
},
1729+
mmrConsent: {
1730+
title:
1731+
'What type of MMR(V) consent request do you want to send to parents?',
1732+
label: 'Type of MMR(V) consent request',
1733+
standard: {
1734+
label: 'Standard request',
1735+
hint: 'This is for standard catch-up sessions'
1736+
},
1737+
outbreak: {
1738+
label: 'Outbreak request ',
1739+
hint: 'This is urgent in tone, and should be used in an outbreak scenario'
1740+
}
1741+
},
17291742
schedule: {
17301743
title: 'Schedule sessions',
17311744
description: 'Add dates for this school.'

app/models/session.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import {
5858
* @property {object} [date_] - Dates (from `dateInput`s)
5959
* @property {number} [academicYear] - Programme year
6060
* @property {Array<SessionPresetName>} [presetNames] - Session preset names
61+
* @property {string<SessionMMRConsent>} [mmrConsent] - Does session use MMR outbreak comms?
6162
* @property {boolean} [registration] - Does session have registration?
6263
*
6364
* Clinics only
@@ -104,6 +105,9 @@ export class Session {
104105
this.closed = options?.closed || false
105106
this.reminderWeeks =
106107
options?.reminderWeeks || TeamDefaults.SessionReminderWeeks
108+
this.mmrConsent = this.presetNames?.includes(SessionPresetName.MMR)
109+
? options?.mmrConsent
110+
: undefined
107111
this.registration = stringToBoolean(options?.registration)
108112
this.register = options?.register || {}
109113
this.psdProtocol = stringToBoolean(options?.psdProtocol) || false

app/views/session/edit.njk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
reminderWeeks: {
4343
href: session.uri + "/edit/reminders"
4444
},
45+
mmrConsent: {
46+
href: session.uri + "/new/mmr-consent"
47+
},
4548
registration: {
4649
href: session.uri + "/edit/registration"
4750
},

app/views/session/form/check-answers.njk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
reminderWeeks: {
3939
href: session.uri + "/new/reminders"
4040
},
41+
mmrConsent: {
42+
href: session.uri + "/new/mmr-consent"
43+
},
4144
registration: {
4245
href: session.uri + "/new/registration"
4346
},
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% extends "_layouts/form.njk" %}
2+
3+
{% set title = __("session.mmrConsent.title") %}
4+
5+
{% block form %}
6+
{{ radios({
7+
fieldset: {
8+
legend: {
9+
isPageHeading: true,
10+
text: title,
11+
size: "l"
12+
}
13+
},
14+
items: [{
15+
text: SessionMMRConsent.Standard,
16+
hint: { text: __("session.mmrConsent.standard.hint") }
17+
}, {
18+
text: SessionMMRConsent.Outbreak,
19+
hint: { text: __("session.mmrConsent.outbreak.hint") }
20+
}],
21+
decorate: "session.mmrConsent"
22+
}) }}
23+
{% endblock %}

0 commit comments

Comments
 (0)