Skip to content

Commit fbfbd2a

Browse files
Add follow-up activity items to activity log examples
1 parent bea976b commit fbfbd2a

4 files changed

Lines changed: 33 additions & 1 deletion

File tree

app/controllers/activity.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import activity from '../datasets/activity.js'
2-
import { ArchiveRecordReason, AuditEventType, ScreenOutcome } from '../enums.js'
2+
import {
3+
ArchiveRecordReason,
4+
AuditEventType,
5+
ReplyDecision,
6+
ScreenOutcome
7+
} from '../enums.js'
38
import { generateParent } from '../generators/parent.js'
49
import {
510
AuditEvent,
@@ -40,6 +45,11 @@ export const activityController = {
4045
const reply = Reply.findAll(data).find(
4146
(reply) => !reply.selfConsent && reply.given
4247
)
48+
const replyRefusal = {
49+
...reply,
50+
decision: ReplyDecision.Refused,
51+
confirmed: true
52+
}
4353
const session = Session.findOne(Object.values(data.sessions)[0].id, data)
4454
const vaccinationGiven = Vaccination.findAll(data).find(
4555
(vaccination) => vaccination.given
@@ -84,6 +94,11 @@ export const activityController = {
8494
createdBy_uid,
8595
programme_ids: ['flu']
8696
}),
97+
auditEvent({
98+
name: activity.consent.followedUp(replyRefusal),
99+
createdBy_uid,
100+
programme_ids: ['flu']
101+
}),
87102
auditEvent({
88103
name: activity.consent.matched(reply),
89104
createdBy_uid,
@@ -157,6 +172,7 @@ export const activityController = {
157172
'consent-given-changed-school',
158173
'consent-needs-triage',
159174
'consent-refused',
175+
'consent-followed-up',
160176
'consent-unknown-contact',
161177
'triage-delay-vaccination',
162178
'triage-do-not-vaccinate',

app/datasets/activity.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export default {
1111
`${decision} by ${parent.fullNameAndRelationship}`,
1212
updated: ({ decision, parent }) =>
1313
`${decision} in updated response from ${parent.fullNameAndRelationship}`,
14+
followedUp: ({ confirmed, decision, parent }) =>
15+
`${confirmed ? 'Refusal confirmed' : decision} in followed-up response from ${parent.fullNameAndRelationship}`,
1416
matched: ({ parent }) =>
1517
`Consent response from ${parent.fullNameAndRelationship} manually matched with child record`,
1618
invalid: ({ parent }) =>
@@ -42,6 +44,8 @@ export default {
4244
`Confirmation of consent given (triage needed) sent to ${parent.fullNameAndRelationship}`,
4345
'consent-refused': (parent) =>
4446
`Confirmation of consent refused sent to ${parent.fullNameAndRelationship}`,
47+
'consent-followed-up': (parent) =>
48+
`Confirmation of follow-up decision to confirm refusal sent to ${parent.fullNameAndRelationship}`,
4549
'consent-unknown-contact': (parent) =>
4650
`Unknown parent contact details warning sent to ${parent.fullNameAndRelationship}`,
4751
'triage-delay-vaccination': (parent) =>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% include "emails/consent/consent-refused.njk" %}

app/locales/en.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,11 @@ export const en = {
804804
label: 'Consent refused',
805805
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{consent.child.firstName}}'
806806
},
807+
'consent-followed-up': {
808+
// Reuses same confirmation as that for consent refused (or given)
809+
label: 'Consent refusal confirmed',
810+
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{consent.child.firstName}}'
811+
},
807812
'consent-needs-triage': {
808813
label: 'Consent needs triage',
809814
name: '{{session.vaccinationNames.titleCase}} on {{session.formatted.nextDate}} for {{consent.child.firstName}}'
@@ -2016,6 +2021,12 @@ export const en = {
20162021
name: 'Confirmation that consent has been refused',
20172022
text: 'You’ve refused to give consent for {{child.fullName}} to have their {{session.vaccinationNames.sentenceCase}}.\n\nYou can give feedback about the ‘Give or refuse consent’ service by completing our short survey:\n\n<https://feedback.digital.nhs.uk/jfe/form/SV_3fICo6frMvUZX1k>\n\nYour feedback will help us improve the service.'
20182023
},
2024+
'consent-followed-up': {
2025+
// Reuses same confirmation as that for consent refused (or given)
2026+
label: 'Consent refusal confirmed',
2027+
name: 'Confirmation that consent has been refused',
2028+
text: 'You’ve refused to give consent for {{child.fullName}} to have their {{session.vaccinationNames.sentenceCase}}.\n\nYou can give feedback about the ‘Give or refuse consent’ service by completing our short survey:\n\n<https://feedback.digital.nhs.uk/jfe/form/SV_3fICo6frMvUZX1k>\n\nYour feedback will help us improve the service.'
2029+
},
20192030
'vaccination-reminder': {
20202031
label: 'Session reminder',
20212032
name: 'Reminder (to go out the day before the vaccination)',

0 commit comments

Comments
 (0)