Skip to main content

Enumerations

Ten enumerations are persisted, alongside the sixteen entities. Each is defined in apps/api/prisma/schema.prisma and mirrored in packages/shared/src/enums.ts, which is what the web app is allowed to know about them.

Every value below is reproduced from the schema. The meanings are the ones the code enforces, not expansions of the names.

Role​

Which kind of account this is. Assigned at registration, never changed afterwards.

ValueMeaning
PATIENTBooks and attends consultations; reads their own record.
DOCTORApplies for approval; runs consultations; writes notes and prescriptions.
ADMINPre-provisioned. Reviews doctors, moderates accounts, reads the audit log.

AccountStatus​

Whether the account may be used at all. Checked by the authentication guard on every request, which is why suspending an account takes effect immediately rather than when its token expires.

ValueMeaning
ACTIVEThe account works normally.
SUSPENDEDSign-in refused with a message naming the administrator. Reversible.
DEACTIVATEDSign-in refused. The terminal state of the three.

ApprovalState​

A doctor's standing in the directory. Patients and administrators do not have one.

ValueMeaning
PENDINGRegistered, awaiting review. Not listed, not bookable.
APPROVEDListed publicly and bookable.
REJECTEDNot listed. rejectionReason tells the doctor why.

AppointmentState​

The stored lifecycle of an appointment.

ValueMeaning
SCHEDULEDBooked and upcoming, or in progress.
COMPLETEDThe consultation finished.
CANCELLEDCancelled by a participant or an administrator.

MISSED is deliberately absent. An appointment whose join window closed without completion is derived at read time, not written — nothing has to sweep the table on a schedule, and there is no stored flag that can disagree with the clock.

SessionState​

The consultation's own lifecycle, tracked on ConsultationSession separately from the appointment's state.

ValueMeaning
SCHEDULEDThe window is not open yet.
JOINEDOne participant has arrived.
IN_PROGRESSBoth have arrived.
COMPLETEDThe doctor completed it.

CancelledBy​

Who cancelled. Recorded with the reason so the other party can be told.

ValueMeaning
PATIENTThe patient cancelled.
DOCTORThe doctor cancelled.
ADMINAn administrator intervened.

Specialization​

The application-defined list of specialties. A doctor chooses from it rather than naming their own, and an administrator can correct it after approval; there is no route that lets a doctor invent a value.

ValueDisplay label
GENERAL_PRACTICEGeneral Practice
CARDIOLOGYCardiology
DERMATOLOGYDermatology
PEDIATRICSPediatrics
PSYCHIATRYPsychiatry
ORTHOPEDICSOrthopedics
NEUROLOGYNeurology
GASTROENTEROLOGYGastroenterology
OBSTETRICS_GYNECOLOGYObstetrics & Gynecology
ENDOCRINOLOGYEndocrinology
OPHTHALMOLOGYOphthalmology
PULMONOLOGYPulmonology
ENTEar, Nose & Throat

This is also the enumeration the matching rules score against: a SymptomRule maps a symptom to one of these values with a weight.

MedicalHistoryKind​

What kind of self-reported history entry this is. The four kinds are what the consultation workspace groups the patient's context into.

ValueMeaning
ALLERGYSomething the patient reacts to.
MEDICATIONSomething the patient currently takes.
CONDITIONAn ongoing diagnosis.
NOTEAnything else the patient wants a doctor to know.

NotificationType​

What a notification is about. Notifications are stored rows, not computed messages, so this enumeration describes the events the system actually raises.

ValueMeaning
APPOINTMENT_BOOKEDA new booking, to the other party.
APPOINTMENT_RESCHEDULEDAn appointment moved.
APPOINTMENT_CANCELLEDAn appointment cancelled, either side.
APPOINTMENT_REMINDERAn upcoming appointment.
RECORDS_AVAILABLEA note and its prescriptions are readable.
DOCTOR_APPROVEDAn application was approved.
DOCTOR_REJECTEDAn application was rejected, with the reason.
ACCOUNT_STATUS_CHANGEDAn administrator changed the account's status.

AuditAction​

The administrator and generation actions the audit log records. See admin for which operations write one and which deliberately do not.

ValueMeaning
ACCOUNT_ACTIVATEDAn account was activated.
ACCOUNT_SUSPENDEDAn account was suspended, with a reason.
ACCOUNT_DEACTIVATEDAn account was deactivated, with a reason.
DOCTOR_APPROVEDA doctor application was approved.
DOCTOR_REJECTEDA doctor application was rejected, with a reason.
DOCTOR_SPECIALIZATION_UPDATEDAn administrator corrected a doctor's specialties.
APPOINTMENT_CANCELLEDAn administrator cancelled an appointment.
NOTE_DRAFT_GENERATEDA note draft was generated by the model.
RECORD_SUMMARY_GENERATEDA record summary was generated by the model.

One enumeration is not persisted​

Severity — MILD, MODERATE, SEVERE — exists in packages/shared/src/enums.ts and has no Prisma counterpart. It is an input to matching, carried on the intake request, and it is not stored: the match result is returned to the caller rather than kept. It is listed here so that a reader who finds it in the shared enums file knows why the schema does not have it.