Hospital Management System Database Schema database schema
The Hospital Management System Database Schema database schema by Colton Bristow has 38 tables (departments, staff, specialties, doctor_specialties and 34 more), 272 columns and 67 relationships, documented column by column.
- Tables
- 38
- Columns
- 272
- Relationships
- 67
- Enums
- 22
Tables (38)
| Table | Columns | Description |
|---|---|---|
| departments | 5 | Cardiology, Radiology, Emergency and so on. Rooms and staff both belong to one. |
| staff | 11 | One table for every employee. Doctors, nurses, technicians and admin staff differ by role, not by table. |
| specialties | 3 | |
| doctor_specialties | 3 | A clinician may hold several specialties. |
| doctor_schedules | 8 | Recurring availability, not individual slots. weekday is 0-6. valid_to null means still in force. |
| patients | 11 | The MRN is the identifier humans use. The uuid is what foreign keys use, so an MRN reissue never breaks history. |
| patient_addresses | 9 | |
| emergency_contacts | 6 | |
| insurance_providers | 5 | |
| patient_insurance_policies | 8 | priority 1 is the primary payer, 2 is secondary. Claims bill down that order. |
| allergens | 3 | A shared catalog so that penicillin means the same thing on every chart. |
| patient_allergies | 7 | Read by the pharmacy module before any prescription is written. |
| rooms | 5 | |
| beds | 4 | status is a cached convenience. The authoritative occupancy answer is an open row in bed_assignments. |
| appointments | 9 | An appointment is an intention. It becomes an encounter only when the patient actually arrives. |
| encounters | 9 | The spine of the clinical record. appointment_id is null for walk-ins and emergencies. |
| admissions | 8 | Only inpatient encounters get an admission row, which is why this is a one-to-one against encounters. |
| bed_assignments | 5 | A patient can be moved between beds. released_at null means currently occupying. |
| vital_signs | 12 | One row per observation event, so a chart can plot the trend across a stay. |
| clinical_notes | 7 | An unsigned note is a draft. Amendments are new rows referencing the same encounter, never edits. |
| referrals | 8 | referred_to_staff_id may be null when the referral names a specialty rather than a named clinician. |
| diagnosis_codes | 4 | ICD-10 and friends. Never invent local codes here, claims are rejected on them. |
| encounter_diagnoses | 7 | Exactly one primary diagnosis per encounter is enforced by a partial unique index. |
| procedure_codes | 5 | |
| encounter_procedures | 6 | What was actually done. This is what billing turns into invoice lines. |
| medications | 7 | The formulary. is_controlled drives the extra sign-off path in medication_administrations. |
| prescriptions | 6 | The order document. The drugs themselves are the line items. |
| prescription_items | 10 | |
| medication_administrations | 9 | The MAR. witnessed_by_staff_id is required for controlled substances and null otherwise. |
| lab_tests | 7 | The catalog of orderable tests, with the normal range results are judged against. |
| lab_orders | 7 | |
| lab_order_items | 3 | One panel order can cover several tests, each of which resolves separately. |
| lab_results | 8 | A correction is a new row pointing at the one it replaces. Results are never overwritten. |
| imaging_studies | 11 | accession_number is what ties this row to the image itself in the PACS. Pixels never live in this database. |
| invoices | 11 | Totals are snapshotted at issue. A later price list change must never rewrite an issued invoice. |
| invoice_lines | 8 | description and code are copied from the catalog at issue time, not joined live. |
| insurance_claims | 9 | One claim per payer per invoice, so a secondary payer gets its own row after the primary adjudicates. |
| payments | 8 | claim_id set means the money came from an insurer. Null means the patient paid it directly. |
Enums (22)
- staff_role
- doctor, nurse, technician, pharmacist, receptionist, administrator
- employment_status
- active, on_leave, terminated
- sex_at_birth
- male, female, intersex, unknown
- allergen_category
- drug, food, environmental, other
- severity
- mild, moderate, severe, life_threatening
- room_type
- general_ward, private, icu, operating_theatre, emergency
- bed_status
- available, occupied, cleaning, out_of_service
- appointment_status
- scheduled, confirmed, checked_in, completed, cancelled, no_show
- encounter_type
- outpatient, inpatient, emergency, telehealth
- admission_status
- admitted, discharged, transferred, deceased
- note_type
- progress, admission, discharge_summary, operative, consultation
- referral_status
- pending, accepted, declined, completed
- code_system
- icd10, icd11, cpt, snomed
- medication_form
- tablet, capsule, liquid, injection, topical, inhaler
- medication_route
- oral, intravenous, intramuscular, subcutaneous, topical, inhalation
- prescription_status
- active, completed, cancelled, expired
- lab_order_status
- ordered, collected, in_progress, resulted, cancelled
- order_priority
- routine, urgent, stat
- imaging_modality
- xray, ct, mri, ultrasound, pet
- invoice_status
- draft, issued, partially_paid, paid, written_off
- claim_status
- draft, submitted, approved, partially_approved, denied, appealed
- payment_method_type
- cash, card, bank_transfer, insurance, cheque
Document your own schema
This page is published from DB Planner, a collaborative ER diagram tool. Write the schema in the DBML editor or import it from SQL, then publish docs like these from the project's sharing settings.