ER diagram

Clinic appointment system ER diagram template

A clinic appointment system ER diagram with six entities: patient, department, doctor, schedule, appointment and visit, with slots held on the schedule. Adapt it to any booking system, then export PNG, SVG, Word or PowerPoint free.

has

works

fills

books

becomes

conducts

DEPARTMENT

string

department_id

PK

string

name

string

location

DOCTOR

string

doctor_id

PK

string

name

string

specialty

string

department_id

FK

SCHEDULE

string

schedule_id

PK

string

doctor_id

FK

date

work_date

string

time_block

int

total_slots

int

open_slots

APPOINTMENT

string

appointment_id

PK

string

patient_id

FK

string

schedule_id

FK

string

status

datetime

booked_at

PATIENT

string

patient_id

PK

string

name

string

phone

date

birth_date

VISIT

string

visit_id

PK

string

appointment_id

FK

string

doctor_id

FK

datetime

seen_at

Previewed in the “Light” theme; you can switch themes in the editor

When to use it

Use it for a software engineering or database course project, a capstone clinic booking system, or to model any appointment-based business. The schedule table is the key: it holds the doctor, date, time block and number of slots, and an appointment points to a schedule, not straight to a doctor.

Make it yours

  • For billing, tests or prescriptions, add entities and connect them to the visit.
  • Salons, driving schools and meeting rooms share the structure; replace departments and doctors with locations and staff.
  • The example lists few fields. A real system holds personal health information, so design access control and masking.

Mermaid code

hospital-registration-er.mmd
erDiagram
    DEPARTMENT ||--o{ DOCTOR : has
    DOCTOR ||--o{ SCHEDULE : works
    SCHEDULE ||--o{ APPOINTMENT : fills
    PATIENT ||--o{ APPOINTMENT : books
    APPOINTMENT ||--o| VISIT : becomes
    DOCTOR ||--o{ VISIT : conducts
    PATIENT {
        string patient_id PK
        string name
        string phone
        date birth_date
    }
    DEPARTMENT {
        string department_id PK
        string name
        string location
    }
    DOCTOR {
        string doctor_id PK
        string name
        string specialty
        string department_id FK
    }
    SCHEDULE {
        string schedule_id PK
        string doctor_id FK
        date work_date
        string time_block
        int total_slots
        int open_slots
    }
    APPOINTMENT {
        string appointment_id PK
        string patient_id FK
        string schedule_id FK
        string status
        datetime booked_at
    }
    VISIT {
        string visit_id PK
        string appointment_id FK
        string doctor_id FK
        datetime seen_at
    }

Ask an AI for one with this structure

Send the prompt below to ChatGPT or Claude, then paste the whole reply into the editor; the code inside is detected automatically.

prompt.txt
Draw a clinic appointment system ER diagram with Mermaid erDiagram syntax. Entities are PATIENT, DEPARTMENT, DOCTOR, SCHEDULE, APPOINTMENT and VISIT. Department to doctor, doctor to schedule, schedule to appointment, patient to appointment and doctor to visit are one to many; appointment to visit is one to zero or one. The schedule has a work date, time block, total slots and open slots. List three to six fields per entity and mark PK and FK. Output only the mermaid code block.

FAQ

Why is appointment to visit one to zero or one?

A booked appointment may be cancelled or missed. ||--o| means an appointment has at most one visit.

How do I show slots being taken?

An ER diagram shows data structure only. Decrementing open slots is logic, which a sequence diagram or flowchart shows better.

Can I use real patient data as sample data?

No. Use made-up data for coursework; real patient information is protected by law.

More in this category

All templates

Updated 2026-11-11