Hospital Management System Database Schema database schema
The Hospital Management System Database Schema database schema is a DB Planner template with 38 tables, 272 columns and 67 relationships, free to use. Core tables include admissions, allergens, appointments, bed_assignments. It can be opened as an interactive diagram or exported as PostgreSQL, MySQL, or MSSQL DDL.
- Tables
- 38
- Columns
- 272
- Relationships
- 67
- Category
- Healthcare
- Exports
- DBML, SQL, C#
- Price
- Free
What this schema models
A complete hospital management system database design, built the way real clinical systems are built rather than the way textbook diagrams are drawn. 38 tables, 22 enums and 67 relationships spanning departments and staff, patient records, insurance policies, allergies, wards and beds, appointment scheduling, admissions and discharges, vital signs, clinical notes, ICD and CPT coding, pharmacy and medication administration, lab and imaging orders, and the full billing and insurance-claims chain. THE FOUR DESIGN RULES 1. The ENCOUNTER is the spine. Almost every clinical fact — vitals, notes, diagnoses, procedures, prescriptions, lab orders, imaging — hangs off an encounter, so any record can always be traced back to when and why the patient was seen. Appointments are intentions; an encounter is created only when the patient actually arrives, which is why walk-ins and emergencies have a null appointment_id. 2. Clinical records are append-only. A corrected lab result is a NEW row pointing at the one it supersedes, never an UPDATE over the original. An unsigned clinical note is a draft; amendments are new rows. Regulators ask for the old value. 3. Coded concepts live in catalog tables. diagnosis_codes and procedure_codes hold ICD-10 and CPT entries; free text is for humans, codes are for reporting and claims. 4. Money is stored in minor units as integers. Invoice totals are snapshotted at issue so a later price-list change cannot rewrite an issued invoice. DETAILS WORTH STEALING - One staff table for everyone. Doctors, nurses, technicians and pharmacists differ by role, not by table. - The MRN is what humans quote; the uuid is what foreign keys use, so reissuing a medical record number never breaks history. - beds.status is a cached convenience — the authoritative occupancy answer is an open row in bed_assignments, which also lets a patient move between beds mid-stay. - Insurance policies carry a priority, so claims bill the primary payer first and the secondary gets its own claim row after adjudication. - medication_administrations is a proper MAR, with a witness column required for controlled substances. - Imaging stores an accession_number that ties the row to the PACS. Pixels never live in this database. WHAT YOU GET Clean DBML that imports directly into DB Planner, plus a laid-out board with cards colour-coded by zone — staff, patients, insurance, facilities, encounter spine, clinical record, coding, pharmacy, diagnostics and billing — and sticky notes explaining the reasoning behind each group. Every table carries a Note. Postgres-flavoured types that port cleanly to MySQL or SQL Server. Useful for developers building an HMS or EHR, students who need a realistic hospital database ER diagram for a DBMS project, and health-tech teams looking for a reference model before their first migration. This is a schema design reference, not a certified clinical system — validate against your own regulatory requirements before production use.
Tables (38)
| Table | Columns |
|---|---|
| admissions | 8 |
| allergens | 3 |
| appointments | 9 |
| bed_assignments | 5 |
| beds | 4 |
| clinical_notes | 7 |
| departments | 5 |
| diagnosis_codes | 4 |
| doctor_schedules | 8 |
| doctor_specialties | 3 |
| emergency_contacts | 6 |
| encounter_diagnoses | 7 |
| encounter_procedures | 6 |
| encounters | 9 |
| imaging_studies | 11 |
| insurance_claims | 9 |
| insurance_providers | 5 |
| invoice_lines | 8 |
| invoices | 11 |
| lab_order_items | 3 |
| lab_orders | 7 |
| lab_results | 8 |
| lab_tests | 7 |
| medication_administrations | 9 |
| medications | 7 |
| patient_addresses | 9 |
| patient_allergies | 7 |
| patient_insurance_policies | 8 |
| patients | 11 |
| payments | 8 |
| prescription_items | 10 |
| prescriptions | 6 |
| procedure_codes | 5 |
| referrals | 8 |
| rooms | 5 |
| specialties | 3 |
| staff | 11 |
| vital_signs | 12 |
Relationships (67)
admissions.admitting_staff_id references staff.idmany to oneadmissions.encounter_id references encounters.idmany to oneadmissions.patient_id references patients.idmany to oneappointments.department_id references departments.idmany to oneappointments.patient_id references patients.idmany to oneappointments.staff_id references staff.idmany to onebed_assignments.admission_id references admissions.idmany to onebed_assignments.bed_id references beds.idmany to onebeds.room_id references rooms.idmany to oneclinical_notes.author_staff_id references staff.idmany to oneclinical_notes.encounter_id references encounters.idmany to onedoctor_schedules.department_id references departments.idmany to onedoctor_schedules.staff_id references staff.idmany to onedoctor_specialties.specialty_id references specialties.idmany to onedoctor_specialties.staff_id references staff.idmany to oneemergency_contacts.patient_id references patients.idmany to oneencounter_diagnoses.diagnosed_by_staff_id references staff.idmany to oneencounter_diagnoses.diagnosis_code_id references diagnosis_codes.idmany to oneencounter_diagnoses.encounter_id references encounters.idmany to oneencounter_procedures.encounter_id references encounters.idmany to oneencounter_procedures.performed_by_staff_id references staff.idmany to oneencounter_procedures.procedure_code_id references procedure_codes.idmany to oneencounters.appointment_id references appointments.idmany to oneencounters.attending_staff_id references staff.idmany to oneencounters.department_id references departments.idmany to oneencounters.patient_id references patients.idmany to oneimaging_studies.encounter_id references encounters.idmany to oneimaging_studies.ordered_by_staff_id references staff.idmany to oneimaging_studies.performed_by_staff_id references staff.idmany to oneinsurance_claims.invoice_id references invoices.idmany to oneinsurance_claims.policy_id references patient_insurance_policies.idmany to oneinvoice_lines.encounter_procedure_id references encounter_procedures.idmany to oneinvoice_lines.invoice_id references invoices.idmany to oneinvoices.encounter_id references encounters.idmany to oneinvoices.patient_id references patients.idmany to onelab_order_items.lab_order_id references lab_orders.idmany to onelab_order_items.lab_test_id references lab_tests.idmany to onelab_orders.encounter_id references encounters.idmany to onelab_orders.ordered_by_staff_id references staff.idmany to onelab_results.lab_order_item_id references lab_order_items.idmany to onelab_results.supersedes_result_id references lab_results.idmany to onelab_results.verified_by_staff_id references staff.idmany to onemedication_administrations.administered_by_staff_id references staff.idmany to onemedication_administrations.admission_id references admissions.idmany to onemedication_administrations.prescription_item_id references prescription_items.idmany to onemedication_administrations.witnessed_by_staff_id references staff.idmany to onepatient_addresses.patient_id references patients.idmany to onepatient_allergies.allergen_id references allergens.idmany to onepatient_allergies.patient_id references patients.idmany to onepatient_allergies.recorded_by_staff_id references staff.idmany to onepatient_insurance_policies.patient_id references patients.idmany to onepatient_insurance_policies.provider_id references insurance_providers.idmany to onepayments.claim_id references insurance_claims.idmany to onepayments.invoice_id references invoices.idmany to oneprescription_items.medication_id references medications.idmany to oneprescription_items.prescription_id references prescriptions.idmany to oneprescriptions.encounter_id references encounters.idmany to oneprescriptions.patient_id references patients.idmany to oneprescriptions.prescriber_staff_id references staff.idmany to onereferrals.encounter_id references encounters.idmany to onereferrals.referred_to_staff_id references staff.idmany to onereferrals.referring_staff_id references staff.idmany to onereferrals.specialty_id references specialties.idmany to onerooms.department_id references departments.idmany to onestaff.department_id references departments.idmany to onevital_signs.encounter_id references encounters.idmany to onevital_signs.recorded_by_staff_id references staff.idmany to one
How to use this template
- Open the diagram to see the tables and how they relate.
- Copy it into your workspace. You get your own editable copy.
- Export it as PostgreSQL, MySQL, or MSSQL DDL, or as C# models.
Frequently asked questions
- What is in the Hospital Management System Database Schema schema?
- 38 tables and 67 relationships, across 272 columns. The table names and the full relationship list are shown on this page.
- Can I export it to PostgreSQL or MySQL?
- Yes. Every DB Planner template exports as DBML, PostgreSQL, MySQL, or MSSQL DDL, and as C# models.
- Is this template free?
- Yes. You can open it in the browser without an account, and copy it into your own workspace with a free DB Planner account.
- Can I change it after copying it?
- Yes. A copy is yours: you can rename tables, add columns, and export it. Changes the author makes later do not affect your copy.