Skip to content

Commit ba2a63f

Browse files
Fix session notes
1 parent 6e927c1 commit ba2a63f

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

app/models/patient-session.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ import {
1818
VaccinationOutcome,
1919
ProgrammeType
2020
} from '../enums.js'
21-
import { Gillick, Instruction, Patient, Programme, Session } from '../models.js'
21+
import {
22+
AuditEvent,
23+
Gillick,
24+
Instruction,
25+
Patient,
26+
Programme,
27+
Session
28+
} from '../models.js'
2229
import { getDateValueDifference, getYearGroup, today } from '../utils/date.js'
2330
import {
2431
getInstructionOutcome,
@@ -136,9 +143,11 @@ export class PatientSession {
136143
* @returns {Array<import('./audit-event.js').AuditEvent>} Audit events
137144
*/
138145
get auditEvents() {
139-
return this.patient.auditEvents.filter(({ programme_ids }) =>
140-
programme_ids?.some((id) => this.session.programme_ids.includes(id))
141-
)
146+
return this.patient.events
147+
.map((auditEvent) => new AuditEvent(auditEvent, this.context))
148+
.filter(({ programme_ids }) =>
149+
programme_ids?.some((id) => this.session.programme_ids.includes(id))
150+
)
142151
}
143152

144153
/**

0 commit comments

Comments
 (0)