Skip to content

Commit 4389c56

Browse files
committed
Fix session outcome showing latest vaccination across all sessions
PatientSession.vaccinationOutcomes filtered only by programme_id, so lastVaccinationOutcome returned the patient's most recent vaccination across every session in the programme. Every session row on the patient programme page then reported that same outcome. Filter by patientSession_uuid too, so each session reports what actually happened at that session. Surfaced by the seeded Bilal Begum MMR case, where four 'not given' sessions between two valid doses were all displaying as 'Vaccinated'.
1 parent c764ae5 commit 4389c56

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/models/patient-session.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,9 @@ export class PatientSession {
440440
try {
441441
if (this.patient?.vaccinations && this.programme_id) {
442442
return this.patient.vaccinations.filter(
443-
({ programme }) => programme?.id === this.programme_id
443+
(vaccination) =>
444+
vaccination.programme?.id === this.programme_id &&
445+
vaccination.patientSession_uuid === this.uuid
444446
)
445447
}
446448
} catch (error) {

0 commit comments

Comments
 (0)