Skip to content

Commit 1b57946

Browse files
Update message shown on programme card on patient session page
1 parent 34e9439 commit 1b57946

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

app/models/patient-session.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,26 @@ export class PatientSession {
700700
}
701701
}
702702

703+
/**
704+
* Get expanded description about deferred status
705+
*
706+
* @returns {string|undefined} Deferred description
707+
*/
708+
get deferredDescription() {
709+
switch (this.patientDeferred) {
710+
case PatientDeferredStatus.ChildAbsent:
711+
case PatientDeferredStatus.ChildRefused:
712+
case PatientDeferredStatus.ChildUnwell:
713+
return `${this.patientDeferred} on ${this.lastVaccinationOutcome?.formatted.createdAt}.`
714+
case PatientDeferredStatus.InviteToClinic:
715+
case PatientDeferredStatus.DelayVaccination:
716+
case PatientDeferredStatus.DoNotVaccinate:
717+
return this.screenDescription
718+
default:
719+
return this.patientDeferred
720+
}
721+
}
722+
703723
/**
704724
* Get instruction outcome
705725
*
@@ -777,14 +797,12 @@ export class PatientSession {
777797
? `${this.patient?.firstName} is ready to vaccinate (${this.vaccineCriteria.toLowerCase()}).`
778798
: `${this.patient?.firstName} is ready to vaccinate.`
779799
case PatientStatus.Deferred:
780-
return this.lastVaccinationOutcome
781-
? `${this.patientDeferred} on ${this.lastVaccinationOutcome.formatted.createdAt}.`
782-
: `${this.patientDeferred}.`
800+
return this.deferredDescription
783801
case PatientStatus.Triage:
784802
return this.screenDescription
785803
case PatientStatus.Refused:
786-
return `${this.patientRefused}.`
787804
case PatientStatus.Consent:
805+
// Don’t show full consent description as it’s shown directly below
788806
return `${this.patientConsent}.`
789807
}
790808
}

0 commit comments

Comments
 (0)