# istiaqahmedtamim/hospital architecture

> Architecture diagram of the GitHub repository istiaqahmedtamim/hospital, 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/istiaqahmedtamim/hospital
- Repository: https://github.com/istiaqahmedtamim/hospital

## Overview

This is a PHP hospital-management application covering public doctor discovery and appointment booking, staff operations, patient records, clinical care, billing, pharmacy, and reporting. The visible entry flow is a visitor reaching the public landing page and following its appointment link; subsequent booking steps are represented by the appointment modules, but their runtime handoffs were not sampled. The graph preserves documented product areas and sampled shared layers. Relationships for unsampled modules are omitted or marked unverified rather than inferred from filenames; database wiring is not fully visible in the supplied excerpts.

Main entry points: [`includes/auth.php`](https://github.com/istiaqahmedtamim/hospital/blob/main/includes/auth.php) (Session and roles), [`index.php`](https://github.com/istiaqahmedtamim/hospital/blob/main/index.php) (Hospital landing), [`appointment/status.php`](https://github.com/istiaqahmedtamim/hospital/blob/main/appointment/status.php) (Appointment management), [`inpatient`](https://github.com/istiaqahmedtamim/hospital/tree/main/inpatient) (Admissions and discharge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_landing["Hospital landing<br/>[index.php]"]
  node_login["Authentication<br/>[login.php]"]
  node_dashboard["Role dashboards"]
end

subgraph group_care["Patient and clinical care"]
  node_doctors["Doctor directory<br/>[view_doctor.php]"]
  node_booking["Appointment booking<br/>[book.php]"]
  node_appointment_ops["Appointment management<br/>[status.php]"]
  node_schedule["Doctor schedules<br/>[schedule.php]"]
  node_patients["Patient records"]
  node_history["Medical history"]
  node_vitals["Patient vitals"]
  node_inpatient["Admissions and discharge"]
  node_nursing["Medication administration<br/>[mar.php]"]
  node_prescriptions["Prescriptions"]
  node_documents["Patient documents"]
end

subgraph group_operations["Hospital operations"]
  node_pharmacy["Medicine and purchasing"]
  node_test_admin["Test type administration"]
  node_reminders["Appointment reminders"]
end

subgraph group_finance["Billing and reporting"]
  node_billing["Bills and payments"]
  node_service_fees["Service fee management"]
  node_reports["Operational reports"]
end

subgraph group_shared["Shared services"]
  node_auth["Session and roles<br/>[auth.php]"]
  node_billing_helpers["Billing schema and fees<br/>[billing_schema.php]"]
  node_audit["Audit logging<br/>[audit.php]"]
  node_schedule_helpers["Schedule helpers"]
  node_appointment_helpers["Appointment helpers"]
  node_database[("Application database")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_landing
node_landing -->|"links to"| node_doctors
node_landing -->|"links to"| node_booking
node_login -->|"uses"| node_auth
node_auth -->|"records activity"| node_audit
node_auth -->|"routes roles"| node_dashboard
node_appointment_ops -->|"checks access"| node_auth
node_appointment_ops -->|"uses schema"| node_billing_helpers
node_appointment_ops -->|"uses helpers"| node_appointment_helpers
node_appointment_helpers -->|"uses helpers"| node_schedule_helpers
node_schedule -->|"uses helpers"| node_schedule_helpers
node_inpatient -->|"uses schema"| node_billing_helpers
node_nursing -->|"checks access"| node_auth
node_billing -->|"uses schema"| node_billing_helpers
node_service_fees -->|"checks access"| node_auth
node_service_fees -->|"reads and writes"| node_database
node_reports -->|"checks access"| node_auth
node_landing -->|"initializes"| node_auth
node_booking -.->|"hands off"| node_appointment_ops
node_patients -.->|"clinical record"| node_history
node_patients -.->|"care episode"| node_inpatient
node_prescriptions -.->|"dispensing link"| node_pharmacy
node_inpatient -.->|"care records"| node_nursing
node_billing -.->|"reads and writes"| node_database
node_reports -.->|"queries summaries"| node_database

click node_landing "https://github.com/istiaqahmedtamim/hospital/blob/main/index.php"
click node_login "https://github.com/istiaqahmedtamim/hospital/blob/main/auth/login.php"
click node_auth "https://github.com/istiaqahmedtamim/hospital/blob/main/includes/auth.php"
click node_dashboard "https://github.com/istiaqahmedtamim/hospital/tree/main/dashboard"
click node_doctors "https://github.com/istiaqahmedtamim/hospital/blob/main/doctor/view_doctor.php"
click node_booking "https://github.com/istiaqahmedtamim/hospital/blob/main/appointment/book.php"
click node_appointment_ops "https://github.com/istiaqahmedtamim/hospital/blob/main/appointment/status.php"
click node_schedule "https://github.com/istiaqahmedtamim/hospital/blob/main/doctor/schedule.php"
click node_patients "https://github.com/istiaqahmedtamim/hospital/tree/main/patient"
click node_history "https://github.com/istiaqahmedtamim/hospital/tree/main/medical_history"
click node_vitals "https://github.com/istiaqahmedtamim/hospital/tree/main/vitals"
click node_inpatient "https://github.com/istiaqahmedtamim/hospital/tree/main/inpatient"
click node_nursing "https://github.com/istiaqahmedtamim/hospital/blob/main/nurse/mar.php"
click node_prescriptions "https://github.com/istiaqahmedtamim/hospital/tree/main/prescription"
click node_documents "https://github.com/istiaqahmedtamim/hospital/blob/main/documents/patient_documents.php"
click node_pharmacy "https://github.com/istiaqahmedtamim/hospital/tree/main/medicine"
click node_test_admin "https://github.com/istiaqahmedtamim/hospital/blob/main/admin/manage_test_types.php"
click node_billing "https://github.com/istiaqahmedtamim/hospital/tree/main/billing"
click node_service_fees "https://github.com/istiaqahmedtamim/hospital/blob/main/admin/manage_service_fees.php"
click node_billing_helpers "https://github.com/istiaqahmedtamim/hospital/blob/main/includes/billing_schema.php"
click node_reports "https://github.com/istiaqahmedtamim/hospital/tree/main/reports"
click node_reminders "https://github.com/istiaqahmedtamim/hospital/tree/main/reminders"
click node_audit "https://github.com/istiaqahmedtamim/hospital/blob/main/includes/audit.php"
click node_schedule_helpers "https://github.com/istiaqahmedtamim/hospital/blob/main/includes/doctor_schedule_helpers.php"
click node_appointment_helpers "https://github.com/istiaqahmedtamim/hospital/blob/main/includes/appointment_helpers.php"

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_landing,node_login,node_dashboard toneBlue
class node_doctors,node_booking,node_appointment_ops,node_schedule,node_patients,node_history,node_vitals,node_inpatient,node_nursing,node_prescriptions,node_documents toneAmber
class node_pharmacy,node_test_admin,node_reminders toneMint
class node_billing,node_service_fees,node_reports toneRose
class node_auth,node_billing_helpers,node_audit,node_schedule_helpers,node_appointment_helpers,node_database,node_visitor toneIndigo
```

## Components

### Access and navigation

- [Hospital landing](https://github.com/istiaqahmedtamim/hospital/blob/main/index.php): `index.php`
- [Authentication](https://github.com/istiaqahmedtamim/hospital/blob/main/auth/login.php): `auth/login.php`
- [Role dashboards](https://github.com/istiaqahmedtamim/hospital/tree/main/dashboard): `dashboard`

### Patient and clinical care

- [Doctor directory](https://github.com/istiaqahmedtamim/hospital/blob/main/doctor/view_doctor.php): `doctor/view_doctor.php`
- [Appointment booking](https://github.com/istiaqahmedtamim/hospital/blob/main/appointment/book.php): `appointment/book.php`
- [Appointment management](https://github.com/istiaqahmedtamim/hospital/blob/main/appointment/status.php): `appointment/status.php`
- [Doctor schedules](https://github.com/istiaqahmedtamim/hospital/blob/main/doctor/schedule.php): `doctor/schedule.php`
- [Patient records](https://github.com/istiaqahmedtamim/hospital/tree/main/patient): `patient`
- [Medical history](https://github.com/istiaqahmedtamim/hospital/tree/main/medical_history): `medical_history`
- [Patient vitals](https://github.com/istiaqahmedtamim/hospital/tree/main/vitals): `vitals`
- [Admissions and discharge](https://github.com/istiaqahmedtamim/hospital/tree/main/inpatient): `inpatient`
- [Medication administration](https://github.com/istiaqahmedtamim/hospital/blob/main/nurse/mar.php): `nurse/mar.php`
- [Prescriptions](https://github.com/istiaqahmedtamim/hospital/tree/main/prescription): `prescription`
- [Patient documents](https://github.com/istiaqahmedtamim/hospital/blob/main/documents/patient_documents.php): `documents/patient_documents.php`

### Hospital operations

- [Medicine and purchasing](https://github.com/istiaqahmedtamim/hospital/tree/main/medicine): `medicine`
- [Test type administration](https://github.com/istiaqahmedtamim/hospital/blob/main/admin/manage_test_types.php): `admin/manage_test_types.php`
- [Appointment reminders](https://github.com/istiaqahmedtamim/hospital/tree/main/reminders): `reminders`

### Billing and reporting

- [Bills and payments](https://github.com/istiaqahmedtamim/hospital/tree/main/billing): `billing`
- [Service fee management](https://github.com/istiaqahmedtamim/hospital/blob/main/admin/manage_service_fees.php): `admin/manage_service_fees.php`
- [Operational reports](https://github.com/istiaqahmedtamim/hospital/tree/main/reports): `reports`

### Shared services

- [Session and roles](https://github.com/istiaqahmedtamim/hospital/blob/main/includes/auth.php): `includes/auth.php`
- [Billing schema and fees](https://github.com/istiaqahmedtamim/hospital/blob/main/includes/billing_schema.php): `includes/billing_schema.php`
- [Audit logging](https://github.com/istiaqahmedtamim/hospital/blob/main/includes/audit.php): `includes/audit.php`
- [Schedule helpers](https://github.com/istiaqahmedtamim/hospital/blob/main/includes/doctor_schedule_helpers.php): `includes/doctor_schedule_helpers.php`
- [Appointment helpers](https://github.com/istiaqahmedtamim/hospital/blob/main/includes/appointment_helpers.php): `includes/appointment_helpers.php`
- **Application database**

### Other components

- **Visitor**

## Connections

- Visitor → Hospital landing: opens (evidence: `index.php`)
- Hospital landing → Doctor directory: links to (evidence: `index.php`)
- Hospital landing → Appointment booking: links to (evidence: `index.php`)
- Authentication → Session and roles: uses (evidence: `auth/login.php`)
- Session and roles → Audit logging: records activity (evidence: `includes/auth.php`)
- Session and roles → Role dashboards: routes roles (evidence: `includes/auth.php`)
- Appointment management → Session and roles: checks access (evidence: `appointment/status.php`)
- Appointment management → Billing schema and fees: uses schema (evidence: `appointment/status.php`)
- Appointment management → Appointment helpers: uses helpers (evidence: `appointment/status.php`)
- Appointment helpers → Schedule helpers: uses helpers (evidence: `includes/appointment_helpers.php`)
- Doctor schedules → Schedule helpers: uses helpers (evidence: `doctor/schedule.php`)
- Admissions and discharge → Billing schema and fees: uses schema (evidence: `inpatient/discharge.php`)
- Medication administration → Session and roles: checks access (evidence: `nurse/mar.php`)
- Bills and payments → Billing schema and fees: uses schema (evidence: `billing/view_bill.php`)
- Service fee management → Session and roles: checks access (evidence: `admin/manage_service_fees.php`)
- Service fee management → Application database: reads and writes (evidence: `admin/manage_service_fees.php`)
- Operational reports → Session and roles: checks access (evidence: `reports/index.php`)
- Hospital landing → Session and roles: initializes (evidence: `index.php`)
- Appointment booking → Appointment management: hands off
- Patient records → Medical history: clinical record
- Patient records → Admissions and discharge: care episode
- Prescriptions → Medicine and purchasing: dispensing link
- Admissions and discharge → Medication administration: care records
- Bills and payments → Application database: reads and writes
- Operational reports → Application database: queries summaries
