diff --git a/app/controllers/activity.js b/app/controllers/activity.js index 965c7380c..c3cba03ad 100644 --- a/app/controllers/activity.js +++ b/app/controllers/activity.js @@ -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 @@ -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, diff --git a/app/datasets/activity.js b/app/datasets/activity.js index ce71890f3..7cc3600a8 100644 --- a/app/datasets/activity.js +++ b/app/datasets/activity.js @@ -1,4 +1,4 @@ -import { ScreenOutcome } from '../enums.js' +import { InstructionOutcome, PatientStatus, ScreenOutcome } from '../enums.js' import { lowerCaseFirst } from '../utils/string.js' export default { @@ -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) => @@ -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) => @@ -77,7 +78,7 @@ export default { created: 'Completed pre-screening checks' }, psd: { - added: 'PSD added', + added: InstructionOutcome.Given, invalidated: 'PSD invalidated' }, session: { @@ -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' } } diff --git a/app/models/patient.js b/app/models/patient.js index 2a2a0b93c..19aeb099a 100644 --- a/app/models/patient.js +++ b/app/models/patient.js @@ -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({