Skip to content

Commit 7bef7b0

Browse files
Update activity log items
1 parent 6b82a3c commit 7bef7b0

3 files changed

Lines changed: 16 additions & 18 deletions

File tree

app/controllers/activity.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export const activityController = {
184184
items: [
185185
auditEvent({
186186
name: activity.patient.archived({
187-
archiveReason: ArchiveRecordReason.Other
187+
archiveReason: ArchiveRecordReason.Duplicate
188188
}),
189189
note: 'A brief note about why child record was archived.',
190190
createdBy_uid
@@ -260,15 +260,13 @@ export const activityController = {
260260
name: activity.vaccination.recorded(vaccinationGiven),
261261
note: 'A brief note about the vaccination session.',
262262
createdBy_uid,
263-
programme_ids: [vaccinationGiven.programme_id],
264-
vaccination_uuid: vaccinationGiven.uuid
263+
programme_ids: [vaccinationGiven.programme_id]
265264
}),
266265
auditEvent({
267266
name: activity.vaccination.recorded(vaccinationNotGiven),
268267
note: 'A brief note about the vaccination session.',
269268
createdBy_uid,
270-
programme_ids: [vaccinationNotGiven.programme_id],
271-
vaccination_uuid: vaccinationNotGiven.uuid
269+
programme_ids: [vaccinationNotGiven.programme_id]
272270
}),
273271
auditEvent({
274272
name: activity.vaccination.added,

app/datasets/activity.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ScreenOutcome } from '../enums.js'
1+
import { InstructionOutcome, PatientStatus, ScreenOutcome } from '../enums.js'
22
import { lowerCaseFirst } from '../utils/string.js'
33

44
export default {
@@ -29,11 +29,11 @@ export default {
2929
invite: (parent) =>
3030
`Consent request sent to ${parent.fullNameAndRelationship}`,
3131
'invite-reminder': (parent) =>
32-
`Reminder to give or refuse consent sent to ${parent.fullNameAndRelationship}`,
32+
`Consent reminder sent to ${parent.fullNameAndRelationship}`,
3333
'invite-clinic': (parent) =>
34-
`Invitation to book a clinic appointment sent to ${parent.fullNameAndRelationship}`,
34+
`Clinic invitation sent to ${parent.fullNameAndRelationship}`,
3535
'invite-clinic-reminder': (parent) =>
36-
`Reminder to book a clinic appointment sent to ${parent.fullNameAndRelationship}`,
36+
`Clinic invitation reminder sent to ${parent.fullNameAndRelationship}`,
3737
'consent-given': (parent) =>
3838
`Confirmation of consent given sent to ${parent.fullNameAndRelationship}`,
3939
'consent-given-changed-school': (parent) =>
@@ -57,16 +57,17 @@ export default {
5757
'vaccination-reminder': (parent) =>
5858
`Session reminder sent to ${parent.fullNameAndRelationship}`,
5959
'vaccination-given': (parent) =>
60-
`Confirmation of vaccination sent to ${parent.fullNameAndRelationship}`,
60+
`Confirmation the vaccination was given sent to ${parent.fullNameAndRelationship}`,
6161
'vaccination-not-administered': (parent) =>
62-
`Confirmation of vaccination not given sent to ${parent.fullNameAndRelationship}`,
62+
`Confirmation the vaccination was not given sent to ${parent.fullNameAndRelationship}`,
6363
'vaccination-already-had': (parent) =>
64-
`Confirmation of vaccination discovered since consent sent to ${parent.fullNameAndRelationship}`,
64+
`Confirmation previous vaccination discovered since consent sent to ${parent.fullNameAndRelationship}`,
6565
'vaccination-deleted': (parent) =>
66-
`Apology for sending an incorrect message sent to ${parent.fullNameAndRelationship}`
66+
`Apology for incorrect message sent to ${parent.fullNameAndRelationship}`
6767
},
6868
patient: {
69-
archived: (archive) => `Record archived: ${archive.archiveReason}`,
69+
archived: (archive) =>
70+
`Record archived: ${lowerCaseFirst(archive.archiveReason)}`,
7071
expired:
7172
'Consent, health information, triage outcome and PSD status expired',
7273
merged: (mergedPatient, patient) =>
@@ -77,7 +78,7 @@ export default {
7778
created: 'Completed pre-screening checks'
7879
},
7980
psd: {
80-
added: 'PSD added',
81+
added: InstructionOutcome.Given,
8182
invalidated: 'PSD invalidated'
8283
},
8384
session: {
@@ -95,7 +96,7 @@ export default {
9596
recorded: (vaccination) =>
9697
vaccination.given
9798
? `Vaccinated with ${vaccination.vaccine.brand}`
98-
: `Could not vaccinate: ${lowerCaseFirst(vaccination.outcome)}`,
99+
: `${PatientStatus.Deferred}: ${lowerCaseFirst(vaccination.outcome)}`,
99100
uploaded: 'Vaccination record uploaded'
100101
}
101102
}

app/models/patient.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,7 @@ export class Patient extends Child {
734734
createdAt: removeDays(vaccination.createdAt, 7),
735735
patient_uuid: this.uuid,
736736
programme_ids: [vaccination.programme_id],
737-
session_id: vaccination.session.id,
738-
vaccination_uuid: vaccination.uuid
737+
session_id: vaccination.session.id
739738
})
740739

741740
this.addEvent({

0 commit comments

Comments
 (0)