encounters table
The encounters table in the Hospital Management System Database Schema schema has 9 columns, keyed by id, with 4 foreign keys to patients, appointments, staff and departments. 10 columns in admissions, vital_signs, clinical_notes, referrals and 6 more reference it.
The spine of the clinical record. appointment_id is null for walk-ins and emergencies.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| patient_id | uuid | not null, references patients.id | |
| appointment_id | uuid | references appointments.id | |
| attending_staff_id | uuid | not null, references staff.id | |
| department_id | uuid | references departments.id | |
| type | encounter_type | not null | |
| started_at | timestamptz | not null | |
| ended_at | timestamptz | ||
| chief_complaint | varchar(255) |
Indexes (2)
(patient_id, started_at)(attending_staff_id, started_at)
Relationships
encounters.patient_idreferencespatients.idencounters.appointment_idreferencesappointments.idencounters.attending_staff_idreferencesstaff.idencounters.department_idreferencesdepartments.idadmissions.encounter_idreferencesencountersvital_signs.encounter_idreferencesencountersclinical_notes.encounter_idreferencesencountersreferrals.encounter_idreferencesencountersencounter_diagnoses.encounter_idreferencesencountersencounter_procedures.encounter_idreferencesencountersprescriptions.encounter_idreferencesencounterslab_orders.encounter_idreferencesencountersimaging_studies.encounter_idreferencesencountersinvoices.encounter_idreferencesencounters