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)

Columns of the appointments table
ColumnTypeConstraintsDescription
iduuidprimary key
patient_iduuidnot null, references patients.id
staff_iduuidnot null, references staff.id
department_iduuidreferences departments.id
scheduled_starttimestamptznot null
scheduled_endtimestamptznot null
statusappointment_statusnot null
reasonvarchar(255)
created_attimestamptznot null

Indexes (3)

  • (staff_id, scheduled_start)
  • (patient_id, scheduled_start)
  • (status, scheduled_start)

Relationships