appointments table
The appointments table in the Hospital Management System Database Schema schema has 9 columns, keyed by id, with 3 foreign keys to patients, staff and departments. 1 column in encounters references it.
An appointment is an intention. It becomes an encounter only when the patient actually arrives.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| patient_id | uuid | not null, references patients.id | |
| staff_id | uuid | not null, references staff.id | |
| department_id | uuid | references departments.id | |
| scheduled_start | timestamptz | not null | |
| scheduled_end | timestamptz | not null | |
| status | appointment_status | not null | |
| reason | varchar(255) | ||
| created_at | timestamptz | not null |
Indexes (3)
(staff_id, scheduled_start)(patient_id, scheduled_start)(status, scheduled_start)
Relationships
appointments.patient_idreferencespatients.idappointments.staff_idreferencesstaff.idappointments.department_idreferencesdepartments.idencounters.appointment_idreferencesappointments