Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions app/controllers/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const activityController = {
items: [
auditEvent({
name: activity.patient.archived({
archiveReason: ArchiveRecordReason.Other
archiveReason: ArchiveRecordReason.Duplicate
}),
note: 'A brief note about why child record was archived.',
createdBy_uid
Expand Down Expand Up @@ -260,15 +260,13 @@ export const activityController = {
name: activity.vaccination.recorded(vaccinationGiven),
note: 'A brief note about the vaccination session.',
createdBy_uid,
programme_ids: [vaccinationGiven.programme_id],
vaccination_uuid: vaccinationGiven.uuid
programme_ids: [vaccinationGiven.programme_id]
}),
auditEvent({
name: activity.vaccination.recorded(vaccinationNotGiven),
note: 'A brief note about the vaccination session.',
createdBy_uid,
programme_ids: [vaccinationNotGiven.programme_id],
vaccination_uuid: vaccinationNotGiven.uuid
programme_ids: [vaccinationNotGiven.programme_id]
}),
auditEvent({
name: activity.vaccination.added,
Expand Down
23 changes: 12 additions & 11 deletions app/datasets/activity.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ScreenOutcome } from '../enums.js'
import { InstructionOutcome, PatientStatus, ScreenOutcome } from '../enums.js'
import { lowerCaseFirst } from '../utils/string.js'

export default {
Expand Down Expand Up @@ -29,11 +29,11 @@ export default {
invite: (parent) =>
`Consent request sent to ${parent.fullNameAndRelationship}`,
'invite-reminder': (parent) =>
`Reminder to give or refuse consent sent to ${parent.fullNameAndRelationship}`,
`Consent reminder sent to ${parent.fullNameAndRelationship}`,
'invite-clinic': (parent) =>
`Invitation to book a clinic appointment sent to ${parent.fullNameAndRelationship}`,
`Clinic invitation sent to ${parent.fullNameAndRelationship}`,
'invite-clinic-reminder': (parent) =>
`Reminder to book a clinic appointment sent to ${parent.fullNameAndRelationship}`,
`Clinic invitation reminder sent to ${parent.fullNameAndRelationship}`,
'consent-given': (parent) =>
`Confirmation of consent given sent to ${parent.fullNameAndRelationship}`,
'consent-given-changed-school': (parent) =>
Expand All @@ -57,16 +57,17 @@ export default {
'vaccination-reminder': (parent) =>
`Session reminder sent to ${parent.fullNameAndRelationship}`,
'vaccination-given': (parent) =>
`Confirmation of vaccination sent to ${parent.fullNameAndRelationship}`,
`Confirmation the vaccination was given sent to ${parent.fullNameAndRelationship}`,
'vaccination-not-administered': (parent) =>
`Confirmation of vaccination not given sent to ${parent.fullNameAndRelationship}`,
`Confirmation the vaccination was not given sent to ${parent.fullNameAndRelationship}`,
'vaccination-already-had': (parent) =>
`Confirmation of vaccination discovered since consent sent to ${parent.fullNameAndRelationship}`,
`Confirmation previous vaccination discovered since consent sent to ${parent.fullNameAndRelationship}`,
'vaccination-deleted': (parent) =>
`Apology for sending an incorrect message sent to ${parent.fullNameAndRelationship}`
`Apology for incorrect message sent to ${parent.fullNameAndRelationship}`
},
patient: {
archived: (archive) => `Record archived: ${archive.archiveReason}`,
archived: (archive) =>
`Record archived: ${lowerCaseFirst(archive.archiveReason)}`,
expired:
'Consent, health information, triage outcome and PSD status expired',
merged: (mergedPatient, patient) =>
Expand All @@ -77,7 +78,7 @@ export default {
created: 'Completed pre-screening checks'
},
psd: {
added: 'PSD added',
added: InstructionOutcome.Given,
invalidated: 'PSD invalidated'
},
session: {
Expand All @@ -95,7 +96,7 @@ export default {
recorded: (vaccination) =>
vaccination.given
? `Vaccinated with ${vaccination.vaccine.brand}`
: `Could not vaccinate: ${lowerCaseFirst(vaccination.outcome)}`,
: `${PatientStatus.Deferred}: ${lowerCaseFirst(vaccination.outcome)}`,
uploaded: 'Vaccination record uploaded'
}
}
3 changes: 1 addition & 2 deletions app/models/patient.js
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,7 @@ export class Patient extends Child {
createdAt: removeDays(vaccination.createdAt, 7),
patient_uuid: this.uuid,
programme_ids: [vaccination.programme_id],
session_id: vaccination.session.id,
vaccination_uuid: vaccination.uuid
session_id: vaccination.session.id
})

this.addEvent({
Expand Down
Loading