
🏥 Healthcare · Database ERD
A core relational schema for a hospital: patients, doctors, departments, appointments, admissions, beds, prescriptions and bills.
Drawing diagram…
ERD for a hospital system: Department has Doctors; Patient books Appointments with a Doctor; Patient has Admissions assigned to a Bed in a Ward; Appointments produce Prescriptions with PrescriptionItems referencing Medicines; each Admission has one Bill with BillItems.
erDiagram
DEPARTMENT ||--o{ DOCTOR : employs
PATIENT ||--o{ APPOINTMENT : books
DOCTOR ||--o{ APPOINTMENT : attends
APPOINTMENT ||--o| PRESCRIPTION : produces
PRESCRIPTION ||--|{ PRESCRIPTION_ITEM : lists
MEDICINE ||--o{ PRESCRIPTION_ITEM : "prescribed in"
PATIENT ||--o{ ADMISSION : has
WARD ||--|{ BED : contains
BED ||--o{ ADMISSION : "assigned to"
ADMISSION ||--|| BILL : generates
BILL ||--|{ BILL_ITEM : contains
PATIENT {
int id PK
string mrn
string name
date dob
}
DOCTOR {
int id PK
int department_id FK
string name
string specialty
}
APPOINTMENT {
int id PK
int patient_id FK
int doctor_id FK
datetime slot
}
ADMISSION {
int id PK
int patient_id FK
int bed_id FK
datetime admitted_at
}
BILL {
int id PK
int admission_id FK
decimal total
}A container-level view of a hospital management system: patient and staff apps, the core services behind them, and the external systems a hospital depends on, such as insurers and labs.
How a patient books a doctor's appointment online: checking free slots, holding one, paying the consultation fee and getting a confirmation.
How a hospital's EHR exchanges data with labs, radiology and insurers through an integration engine, translating between HL7 v2 and FHIR.
An online doctor consultation from booking to e-prescription: payment, a secure video room, consultation notes and the prescription sent to the patient.
How a cashless health insurance claim works at a hospital: pre-authorisation with the TPA, treatment, and final bill settlement directly with the insurer.
The lifecycle of a lab test in a hospital, from the doctor's order to the result in the patient's record, including recollection and critical values.