# shammill/hospital-data-system architecture

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

- Interactive diagram: https://gitdiagram.com/shammill/hospital-data-system
- Repository: https://github.com/shammill/hospital-data-system

## Overview

This is a PHP/MySQL hospital-management application. Staff use the dashboard to reach patient records, create reports, manage staff assignments and permissions, schedule resource bookings, and handle invoices. The excerpts show patient-profile and invoice flows, resource booking, role and user permission updates, and PDF report generation. The README documents broader staff assignment and scheduling capabilities; where their implementation was not sampled, links are marked unverified rather than inferred as direct calls.

Main entry points: [`patient`](https://github.com/shammill/hospital-data-system/tree/master/patient) (Patient records), [`index.php`](https://github.com/shammill/hospital-data-system/blob/master/index.php) (Dashboard), [`resources/book.php`](https://github.com/shammill/hospital-data-system/blob/master/resources/book.php) (Resource booking), [`patient/invoices`](https://github.com/shammill/hospital-data-system/tree/master/patient/invoices) (Patient invoices)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient records"]
  node_patient_pages["Patient records"]
  node_patient_model["Patient model<br/>[patient.class.php]"]
  node_notes["Patient notes<br/>[insert-notes.php]"]
end

subgraph group_admin["Staff and access"]
  node_assignments["Doctor-nurse assignments"]
  node_staff_pages["Staff management<br/>[create.php]"]
  node_access_pages["Permission management"]
  node_acl["Access control<br/>[acl.class.php]"]
end

subgraph group_schedule["Scheduling and resources"]
  node_resource_pages["Resource management"]
  node_booking["Resource booking<br/>[book.php]"]
  node_calendar["Calendar<br/>[cal.php]"]
  node_calendar_events["Calendar events<br/>[events.php]"]
end

subgraph group_finance["Billing and reports"]
  node_billables["Billable items"]
  node_invoice_pages["Patient invoices"]
  node_invoice_model["Invoice model<br/>[invoice.class.php]"]
  node_patient_report["Patient report<br/>[patient-report.php]"]
  node_pdf["HTML to PDF<br/>[html2pdf.class.php]"]
end

subgraph group_shared["Shared application"]
  node_dashboard["Dashboard<br/>[index.php]"]
  node_database[("MySQL database<br/>[database.class.php]")]
  node_search["Search<br/>[search.php]"]
  node_api["Patient edit API<br/>[api.js]"]
end

node_staff_user(("Staff user"))

node_staff_user -->|"opens"| node_dashboard
node_dashboard -->|"links to"| node_patient_pages
node_dashboard -->|"links to"| node_staff_pages
node_dashboard -->|"links to"| node_resource_pages
node_dashboard -->|"links to"| node_access_pages
node_dashboard -->|"links to"| node_billables
node_patient_pages -->|"loads patient"| node_patient_model
node_patient_pages -->|"links to"| node_notes
node_patient_pages -->|"links to"| node_invoice_pages
node_patient_pages -->|"links to"| node_patient_report
node_patient_report -->|"loads patient"| node_patient_model
node_patient_report -->|"converts HTML"| node_pdf
node_access_pages -->|"updates permissions"| node_acl
node_booking -->|"loads resource"| node_resource_pages
node_booking -->|"loads patients"| node_patient_model
node_booking -->|"includes calendar"| node_calendar
node_booking -->|"configures events"| node_calendar_events
node_invoice_pages -->|"loads patient"| node_patient_model
node_invoice_pages -->|"loads billables"| node_billables
node_invoice_pages -->|"creates invoice"| node_invoice_model
node_search -->|"queries"| node_database
node_patient_pages -.->|"reads and updates"| node_database
node_staff_user -.->|"manages assignments"| node_assignments
node_patient_pages -.->|"edits fields through"| node_api

click node_dashboard "https://github.com/shammill/hospital-data-system/blob/master/index.php"
click node_patient_pages "https://github.com/shammill/hospital-data-system/tree/master/patient"
click node_patient_model "https://github.com/shammill/hospital-data-system/blob/master/.class/patient.class.php"
click node_notes "https://github.com/shammill/hospital-data-system/blob/master/patient/insert-notes.php"
click node_assignments "https://github.com/shammill/hospital-data-system/blob/master/doctor-nurse-insert.php"
click node_staff_pages "https://github.com/shammill/hospital-data-system/blob/master/create.php"
click node_access_pages "https://github.com/shammill/hospital-data-system/tree/master/permissions"
click node_acl "https://github.com/shammill/hospital-data-system/blob/master/.class/acl.class.php"
click node_resource_pages "https://github.com/shammill/hospital-data-system/tree/master/resources"
click node_booking "https://github.com/shammill/hospital-data-system/blob/master/resources/book.php"
click node_calendar "https://github.com/shammill/hospital-data-system/blob/master/calendar/cal.php"
click node_calendar_events "https://github.com/shammill/hospital-data-system/blob/master/calendar/events.php"
click node_billables "https://github.com/shammill/hospital-data-system/tree/master/billable"
click node_invoice_pages "https://github.com/shammill/hospital-data-system/tree/master/patient/invoices"
click node_invoice_model "https://github.com/shammill/hospital-data-system/blob/master/.class/invoice.class.php"
click node_patient_report "https://github.com/shammill/hospital-data-system/blob/master/patient/patient-report.php"
click node_pdf "https://github.com/shammill/hospital-data-system/blob/master/pdf/html2pdf.class.php"
click node_database "https://github.com/shammill/hospital-data-system/blob/master/.class/database.class.php"
click node_search "https://github.com/shammill/hospital-data-system/blob/master/search.php"
click node_api "https://github.com/shammill/hospital-data-system/blob/master/api/api.js"

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_patient_pages,node_patient_model,node_notes,node_staff_user toneBlue
class node_assignments,node_staff_pages,node_access_pages,node_acl toneAmber
class node_resource_pages,node_booking,node_calendar,node_calendar_events toneMint
class node_billables,node_invoice_pages,node_invoice_model,node_patient_report,node_pdf toneRose
class node_dashboard,node_database,node_search,node_api toneIndigo
```

## Components

### Patient records

- [Patient records](https://github.com/shammill/hospital-data-system/tree/master/patient): `patient`
- [Patient model](https://github.com/shammill/hospital-data-system/blob/master/.class/patient.class.php): `.class/patient.class.php`
- [Patient notes](https://github.com/shammill/hospital-data-system/blob/master/patient/insert-notes.php): `patient/insert-notes.php`

### Staff and access

- [Doctor-nurse assignments](https://github.com/shammill/hospital-data-system/blob/master/doctor-nurse-insert.php): `doctor-nurse-insert.php`
- [Staff management](https://github.com/shammill/hospital-data-system/blob/master/create.php): `create.php`
- [Permission management](https://github.com/shammill/hospital-data-system/tree/master/permissions): `permissions`
- [Access control](https://github.com/shammill/hospital-data-system/blob/master/.class/acl.class.php): `.class/acl.class.php`

### Scheduling and resources

- [Resource management](https://github.com/shammill/hospital-data-system/tree/master/resources): `resources`
- [Resource booking](https://github.com/shammill/hospital-data-system/blob/master/resources/book.php): `resources/book.php`
- [Calendar](https://github.com/shammill/hospital-data-system/blob/master/calendar/cal.php): `calendar/cal.php`
- [Calendar events](https://github.com/shammill/hospital-data-system/blob/master/calendar/events.php): `calendar/events.php`

### Billing and reports

- [Billable items](https://github.com/shammill/hospital-data-system/tree/master/billable): `billable`
- [Patient invoices](https://github.com/shammill/hospital-data-system/tree/master/patient/invoices): `patient/invoices`
- [Invoice model](https://github.com/shammill/hospital-data-system/blob/master/.class/invoice.class.php): `.class/invoice.class.php`
- [Patient report](https://github.com/shammill/hospital-data-system/blob/master/patient/patient-report.php): `patient/patient-report.php`
- [HTML to PDF](https://github.com/shammill/hospital-data-system/blob/master/pdf/html2pdf.class.php): `pdf/html2pdf.class.php`

### Shared application

- [Dashboard](https://github.com/shammill/hospital-data-system/blob/master/index.php): `index.php`
- [MySQL database](https://github.com/shammill/hospital-data-system/blob/master/.class/database.class.php): `.class/database.class.php`
- [Search](https://github.com/shammill/hospital-data-system/blob/master/search.php): `search.php`
- [Patient edit API](https://github.com/shammill/hospital-data-system/blob/master/api/api.js): `api/api.js`

### Other components

- **Staff user**

## Connections

- Staff user → Dashboard: opens (evidence: `index.php`)
- Dashboard → Patient records: links to (evidence: `index.php`)
- Dashboard → Staff management: links to (evidence: `index.php`)
- Dashboard → Resource management: links to (evidence: `index.php`)
- Dashboard → Permission management: links to (evidence: `index.php`)
- Dashboard → Billable items: links to (evidence: `index.php`)
- Patient records → Patient model: loads patient (evidence: `patient/patient-profile.php`)
- Patient records → Patient notes: links to (evidence: `patient/patient-profile.php`)
- Patient records → Patient invoices: links to (evidence: `patient/patient-profile.php`)
- Patient records → Patient report: links to (evidence: `patient/patient-profile.php`)
- Patient report → Patient model: loads patient (evidence: `patient/patient-report.php`)
- Patient report → HTML to PDF: converts HTML (evidence: `patient/patient-report.php`)
- Permission management → Access control: updates permissions (evidence: `permissions/user.php`)
- Resource booking → Resource management: loads resource (evidence: `resources/book.php`)
- Resource booking → Patient model: loads patients (evidence: `resources/book.php`)
- Resource booking → Calendar: includes calendar (evidence: `resources/book.php`)
- Resource booking → Calendar events: configures events (evidence: `resources/book.php`)
- Patient invoices → Patient model: loads patient (evidence: `patient/invoices/create.php`)
- Patient invoices → Billable items: loads billables (evidence: `patient/invoices/create.php`)
- Patient invoices → Invoice model: creates invoice (evidence: `patient/invoices/create.php`)
- Search → MySQL database: queries (evidence: `search.php`)
- Patient records → MySQL database: reads and updates
- Staff user → Doctor-nurse assignments: manages assignments
- Patient records → Patient edit API: edits fields through
