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.

ER diagram of the Hospital Management System Database Schema schema, showing 38 tables and their relationships
FIG. 1: entity relationship diagram, 38 tables
Tables
38
Columns
272
Relationships
67
Enums
22

Tables (38)

Tables in the Hospital Management System Database Schema schema
TableColumnsDescription
departments5Cardiology, Radiology, Emergency and so on. Rooms and staff both belong to one.
staff11One table for every employee. Doctors, nurses, technicians and admin staff differ by role, not by table.
specialties3
doctor_specialties3A clinician may hold several specialties.
doctor_schedules8Recurring availability, not individual slots. weekday is 0-6. valid_to null means still in force.
patients11The MRN is the identifier humans use. The uuid is what foreign keys use, so an MRN reissue never breaks history.
patient_addresses9
emergency_contacts6
insurance_providers5
patient_insurance_policies8priority 1 is the primary payer, 2 is secondary. Claims bill down that order.
allergens3A shared catalog so that penicillin means the same thing on every chart.
patient_allergies7Read by the pharmacy module before any prescription is written.
rooms5
beds4status is a cached convenience. The authoritative occupancy answer is an open row in bed_assignments.
appointments9An appointment is an intention. It becomes an encounter only when the patient actually arrives.
encounters9The spine of the clinical record. appointment_id is null for walk-ins and emergencies.
admissions8Only inpatient encounters get an admission row, which is why this is a one-to-one against encounters.
bed_assignments5A patient can be moved between beds. released_at null means currently occupying.
vital_signs12One row per observation event, so a chart can plot the trend across a stay.
clinical_notes7An unsigned note is a draft. Amendments are new rows referencing the same encounter, never edits.
referrals8referred_to_staff_id may be null when the referral names a specialty rather than a named clinician.
diagnosis_codes4ICD-10 and friends. Never invent local codes here, claims are rejected on them.
encounter_diagnoses7Exactly one primary diagnosis per encounter is enforced by a partial unique index.
procedure_codes5
encounter_procedures6What was actually done. This is what billing turns into invoice lines.
medications7The formulary. is_controlled drives the extra sign-off path in medication_administrations.
prescriptions6The order document. The drugs themselves are the line items.
prescription_items10
medication_administrations9The MAR. witnessed_by_staff_id is required for controlled substances and null otherwise.
lab_tests7The catalog of orderable tests, with the normal range results are judged against.
lab_orders7
lab_order_items3One panel order can cover several tests, each of which resolves separately.
lab_results8A correction is a new row pointing at the one it replaces. Results are never overwritten.
imaging_studies11accession_number is what ties this row to the image itself in the PACS. Pixels never live in this database.
invoices11Totals are snapshotted at issue. A later price list change must never rewrite an issued invoice.
invoice_lines8description and code are copied from the catalog at issue time, not joined live.
insurance_claims9One claim per payer per invoice, so a secondary payer gets its own row after the primary adjudicates.
payments8claim_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.

More published database schemas