Skip to content

Commit fab29bc

Browse files
Fix data generated for follow-up consent responses
1 parent ffe4752 commit fab29bc

4 files changed

Lines changed: 16 additions & 11 deletions

File tree

app/generators/consent.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export function generateConsent(
130130
ReplyDecision.OnlyMenACWY,
131131
ReplyDecision.OnlyTdIPV
132132
].includes(decision) && { healthAnswers, triageNote }),
133-
...(decision === ReplyDecision.Refused && {
133+
...([ReplyDecision.Declined, ReplyDecision.Refused].includes(decision) && {
134134
refusalReason,
135135
...(refusalReason === ReplyRefusal.AlreadyVaccinated && {
136136
refusalReasonDetails: 'My child had the vaccination at our GP surgery.'
@@ -143,6 +143,10 @@ export function generateConsent(
143143
refusalReasonDetails:
144144
'My child has recently had chemotherapy and her immune system needs time to recover.'
145145
}),
146+
...(refusalReason === ReplyRefusal.OutsideSchool && {
147+
refusalReasonDetails:
148+
'My child gets anxious in situations where there are a lot of people.'
149+
}),
146150
...(refusalReason === ReplyRefusal.Other && {
147151
refusalReasonOther: 'My family rejects vaccinations on principle.'
148152
}),

app/models/reply.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export class Reply {
129129

130130
if (
131131
[
132+
ReplyDecision.Declined,
132133
ReplyDecision.Refused,
133134
ReplyDecision.OnlyMenACWY,
134135
ReplyDecision.OnlyTdIPV

app/utils/reply.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,13 @@ export const getRefusalReason = (type, decision) => {
324324

325325
// You cannot decline on the basis of already having had the vaccine
326326
if (decision === ReplyDecision.Declined) {
327-
refusalReasons = refusalReasons.filter((value) =>
328-
[ReplyRefusal.AlreadyVaccinated, ReplyRefusal.GettingElsewhere].includes(
329-
value
330-
)
327+
refusalReasons = refusalReasons.filter(
328+
(value) =>
329+
![
330+
ReplyRefusal.AlreadyVaccinated,
331+
ReplyRefusal.AlreadyVaccinatedMMR,
332+
ReplyRefusal.GettingElsewhere
333+
].includes(value)
331334
)
332335
}
333336

app/views/reply/form/follow-up.njk

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,18 @@
1717
},
1818
email: {
1919
label: __("parent.email.label"),
20-
value: reply.parent.email,
21-
href: reply.uri + "/edit/parent"
20+
value: reply.parent.email
2221
},
2322
tel: {
2423
label: __("parent.tel.label"),
25-
value: reply.parent.tel,
26-
href: reply.uri + "/edit/parent"
24+
value: reply.parent.tel
2725
},
2826
contactPreference: {
2927
label: __("parent.contactPreference.label"),
3028
value: reply.parent.contactPreference
3129
},
3230
refusalReason: {},
33-
refusalReasonDetails: {},
34-
note: {}
31+
refusalReasonDetails: {}
3532
})
3633
})
3734
}) }}

0 commit comments

Comments
 (0)