# rizwan-ahmed-92/hospital-management-system architecture

> Architecture diagram of the GitHub repository rizwan-ahmed-92/hospital-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rizwan-ahmed-92/hospital-management-system
- Repository: https://github.com/rizwan-ahmed-92/hospital-management-system

## Overview

This repository is a PostgreSQL hospital-management database. Its documented domain spans patient and doctor records, appointments, admissions and beds, medical records, and billing; views support simplified querying, while indexes and triggers enforce or automate selected rules. The README documents the domain relationships and database capabilities, but no SQL excerpts were provided, so the graph omits unverified table-level calls and data flow.

Main entry points: [`database/schema.sql`](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql) (Admissions and beds), [`database/indexes.sql`](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/indexes.sql) (Integrity indexes), [`views`](https://github.com/rizwan-ahmed-92/hospital-management-system/tree/main/views) (Query views), [`database/triggers.sql`](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/triggers.sql) (Bed automation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_care["Care Operations"]
  node_staff["Patients and doctors<br/>[schema.sql]"]
  node_appointments["Appointments<br/>[schema.sql]"]
  node_admissions["Admissions and beds<br/>[schema.sql]"]
  node_specializations["Doctor specializations<br/>[schema.sql]"]
end

subgraph group_clinical["Clinical and Finance"]
  node_medical["Prescriptions and labs<br/>[schema.sql]"]
  node_billing["Billing and insurance<br/>[schema.sql]"]
end

subgraph group_database["Database Support"]
  node_views["Query views"]
  node_indexes["Integrity indexes<br/>[indexes.sql]"]
  node_triggers["Bed automation<br/>[triggers.sql]"]
end

node_user(("Hospital user"))

node_staff -->|"relates to"| node_appointments
node_staff -->|"has admissions"| node_admissions
node_staff -->|"doctor mapping"| node_specializations
node_admissions -->|"doctor scheduling"| node_appointments
node_user -->|"queries"| node_views
node_admissions -->|"releases beds"| node_triggers
node_appointments -->|"prevents conflicts"| node_indexes
node_admissions -->|"limits active beds"| node_indexes

click node_staff "https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql"
click node_appointments "https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql"
click node_admissions "https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql"
click node_specializations "https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql"
click node_medical "https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql"
click node_billing "https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql"
click node_views "https://github.com/rizwan-ahmed-92/hospital-management-system/tree/main/views"
click node_indexes "https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/indexes.sql"
click node_triggers "https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/triggers.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_staff,node_appointments,node_admissions,node_specializations,node_user toneBlue
class node_medical,node_billing toneAmber
class node_views,node_indexes,node_triggers toneMint
```

## Components

### Care Operations

- [Patients and doctors](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql): `database/schema.sql`
- [Appointments](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql): `database/schema.sql`
- [Admissions and beds](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql): `database/schema.sql`
- [Doctor specializations](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql): `database/schema.sql`

### Clinical and Finance

- [Prescriptions and labs](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql): `database/schema.sql`
- [Billing and insurance](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/schema.sql): `database/schema.sql`

### Database Support

- [Query views](https://github.com/rizwan-ahmed-92/hospital-management-system/tree/main/views): `views`
- [Integrity indexes](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/indexes.sql): `database/indexes.sql`
- [Bed automation](https://github.com/rizwan-ahmed-92/hospital-management-system/blob/main/database/triggers.sql): `database/triggers.sql`

### Other components

- **Hospital user**

## Connections

- Patients and doctors → Appointments: relates to (evidence: `README.md`)
- Patients and doctors → Admissions and beds: has admissions (evidence: `README.md`)
- Patients and doctors → Doctor specializations: doctor mapping (evidence: `README.md`)
- Admissions and beds → Appointments: doctor scheduling (evidence: `README.md`)
- Hospital user → Query views: queries (evidence: `README.md`)
- Admissions and beds → Bed automation: releases beds (evidence: `README.md`)
- Appointments → Integrity indexes: prevents conflicts (evidence: `README.md`)
- Admissions and beds → Integrity indexes: limits active beds (evidence: `README.md`)
