# tsruban/hhims architecture

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

- Interactive diagram: https://gitdiagram.com/tsruban/hhims
- Repository: https://github.com/tsruban/hhims

## Overview

HHIMS is a web-based hospital health information management system. The intended user workflow spans patient registration and lookup, outpatient or clinic care, admission and ward care, laboratory and pharmacy activity, and reporting; the tree documents additional appointments, questionnaires, notifications, and chat. The README confirms browser access and MySQL configuration. Several product modules are represented from the tree only, so their workflow links are dashed and unverified; framework startup and routing links reflect the supplied excerpts.

Main entry points: [`system/core/CodeIgniter.php`](https://github.com/tsruban/hhims/blob/master/system/core/CodeIgniter.php) (Framework bootstrap), [`application/modules/patient/controllers/patient.php`](https://github.com/tsruban/hhims/blob/master/application/modules/patient/controllers/patient.php) (Patient records), [`application/models`](https://github.com/tsruban/hhims/tree/master/application/models) (Domain models), [`application/modules/opd/controllers/opd.php`](https://github.com/tsruban/hhims/blob/master/application/modules/opd/controllers/opd.php) (Outpatient care)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_front["Web entry point<br/>[index.php]"]
  node_routing["Request routing<br/>[routes.php]"]
  node_hhims["HHIMS home<br/>[hhims.php]"]
  node_login["Authentication<br/>[login.php]"]
end

subgraph group_care["Patient care"]
  node_patient["Patient records<br/>[patient.php]"]
  node_opd["Outpatient care<br/>[opd.php]"]
  node_clinic["Clinic care<br/>[clinic.php]"]
  node_admission["Admissions<br/>[admission.php]"]
  node_ward["Ward care<br/>[ward.php]"]
  node_appointments["Appointments<br/>[appointment.php]"]
end

subgraph group_operations["Clinical operations"]
  node_laboratory["Laboratory orders<br/>[laboratory.php]"]
  node_pharmacy["Pharmacy<br/>[pharmacy.php]"]
  node_drugstock["Drug stock<br/>[drug_stock.php]"]
  node_reports["Reports and PDF<br/>[report.php]"]
end

subgraph group_services["Supporting services"]
  node_questionnaires["Questionnaires<br/>[questionnaire.php]"]
  node_notifications["Notifications<br/>[notification.php]"]
  node_chat["Chat<br/>[chat.php]"]
end

subgraph group_platform["Data and framework"]
  node_models["Domain models"]
  node_database[("MySQL database<br/>[database.php]")]
  node_ci_boot["Framework bootstrap<br/>[CodeIgniter.php]"]
  node_ci_common["Framework common<br/>[Common.php]"]
  node_ci_hooks["Framework hooks<br/>[Hooks.php]"]
  node_ci_input["Request input<br/>[Input.php]"]
  node_ci_output["Response output<br/>[Output.php]"]
  node_ci_security["Request security<br/>[Security.php]"]
  node_ci_utf8["UTF-8 handling<br/>[Utf8.php]"]
end

node_user(("Hospital user"))

node_user -.->|"opens in browser"| node_front
node_front -->|"starts framework"| node_ci_boot
node_ci_boot -->|"loads"| node_ci_common
node_ci_boot -->|"loads"| node_ci_hooks
node_ci_boot -->|"loads"| node_ci_input
node_ci_boot -->|"loads"| node_ci_output
node_ci_boot -->|"loads"| node_ci_security
node_ci_boot -->|"loads"| node_ci_utf8
node_routing -->|"sets default"| node_hhims
node_user -.->|"authenticates"| node_login
node_login -.->|"accesses records"| node_patient
node_patient -.->|"opens encounter"| node_opd
node_patient -.->|"opens encounter"| node_clinic
node_patient -.->|"starts admission"| node_admission
node_admission -.->|"continues inpatient care"| node_ward
node_opd -.->|"orders tests"| node_laboratory
node_clinic -.->|"orders tests"| node_laboratory
node_opd -.->|"prescribes medicines"| node_pharmacy
node_clinic -.->|"prescribes medicines"| node_pharmacy
node_pharmacy -.->|"uses stock"| node_drugstock
node_appointments -.->|"schedules visits"| node_patient
node_reports -.->|"reports clinical data"| node_database
node_questionnaires -.->|"records responses"| node_patient
node_notifications -.->|"sends updates"| node_user
node_chat -.->|"supports messaging"| node_user
node_patient -.->|"uses domain data"| node_models
node_opd -.->|"uses domain data"| node_models
node_clinic -.->|"uses domain data"| node_models
node_admission -.->|"uses domain data"| node_models
node_models -.->|"persists data"| node_database

click node_front "https://github.com/tsruban/hhims/blob/master/index.php"
click node_routing "https://github.com/tsruban/hhims/blob/master/application/config/routes.php"
click node_hhims "https://github.com/tsruban/hhims/blob/master/application/modules/hhims/controllers/hhims.php"
click node_login "https://github.com/tsruban/hhims/blob/master/application/modules/login/controllers/login.php"
click node_patient "https://github.com/tsruban/hhims/blob/master/application/modules/patient/controllers/patient.php"
click node_opd "https://github.com/tsruban/hhims/blob/master/application/modules/opd/controllers/opd.php"
click node_clinic "https://github.com/tsruban/hhims/blob/master/application/modules/clinic/controllers/clinic.php"
click node_admission "https://github.com/tsruban/hhims/blob/master/application/modules/admission/controllers/admission.php"
click node_ward "https://github.com/tsruban/hhims/blob/master/application/modules/ward/controllers/ward.php"
click node_appointments "https://github.com/tsruban/hhims/blob/master/application/modules/appointment/controllers/appointment.php"
click node_laboratory "https://github.com/tsruban/hhims/blob/master/application/modules/laboratory/controllers/laboratory.php"
click node_pharmacy "https://github.com/tsruban/hhims/blob/master/application/modules/pharmacy/controllers/pharmacy.php"
click node_drugstock "https://github.com/tsruban/hhims/blob/master/application/modules/drug_stock/controllers/drug_stock.php"
click node_reports "https://github.com/tsruban/hhims/blob/master/application/modules/report/controllers/report.php"
click node_questionnaires "https://github.com/tsruban/hhims/blob/master/application/modules/questionnaire/controllers/questionnaire.php"
click node_notifications "https://github.com/tsruban/hhims/blob/master/application/modules/notification/controllers/notification.php"
click node_chat "https://github.com/tsruban/hhims/blob/master/application/modules/chat/controllers/chat.php"
click node_models "https://github.com/tsruban/hhims/tree/master/application/models"
click node_database "https://github.com/tsruban/hhims/blob/master/application/config/database.php"
click node_ci_boot "https://github.com/tsruban/hhims/blob/master/system/core/CodeIgniter.php"
click node_ci_common "https://github.com/tsruban/hhims/blob/master/system/core/Common.php"
click node_ci_hooks "https://github.com/tsruban/hhims/blob/master/system/core/Hooks.php"
click node_ci_input "https://github.com/tsruban/hhims/blob/master/system/core/Input.php"
click node_ci_output "https://github.com/tsruban/hhims/blob/master/system/core/Output.php"
click node_ci_security "https://github.com/tsruban/hhims/blob/master/system/core/Security.php"
click node_ci_utf8 "https://github.com/tsruban/hhims/blob/master/system/core/Utf8.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_front,node_routing,node_hhims,node_login,node_user toneBlue
class node_patient,node_opd,node_clinic,node_admission,node_ward,node_appointments toneAmber
class node_laboratory,node_pharmacy,node_drugstock,node_reports toneMint
class node_questionnaires,node_notifications,node_chat toneRose
class node_models,node_database,node_ci_boot,node_ci_common,node_ci_hooks,node_ci_input,node_ci_output,node_ci_security,node_ci_utf8 toneIndigo
```

## Components

### Web entry

- [Web entry point](https://github.com/tsruban/hhims/blob/master/index.php): `index.php`
- [Request routing](https://github.com/tsruban/hhims/blob/master/application/config/routes.php): `application/config/routes.php`
- [HHIMS home](https://github.com/tsruban/hhims/blob/master/application/modules/hhims/controllers/hhims.php): `application/modules/hhims/controllers/hhims.php`
- [Authentication](https://github.com/tsruban/hhims/blob/master/application/modules/login/controllers/login.php): `application/modules/login/controllers/login.php`

### Patient care

- [Patient records](https://github.com/tsruban/hhims/blob/master/application/modules/patient/controllers/patient.php): `application/modules/patient/controllers/patient.php`
- [Outpatient care](https://github.com/tsruban/hhims/blob/master/application/modules/opd/controllers/opd.php): `application/modules/opd/controllers/opd.php`
- [Clinic care](https://github.com/tsruban/hhims/blob/master/application/modules/clinic/controllers/clinic.php): `application/modules/clinic/controllers/clinic.php`
- [Admissions](https://github.com/tsruban/hhims/blob/master/application/modules/admission/controllers/admission.php): `application/modules/admission/controllers/admission.php`
- [Ward care](https://github.com/tsruban/hhims/blob/master/application/modules/ward/controllers/ward.php): `application/modules/ward/controllers/ward.php`
- [Appointments](https://github.com/tsruban/hhims/blob/master/application/modules/appointment/controllers/appointment.php): `application/modules/appointment/controllers/appointment.php`

### Clinical operations

- [Laboratory orders](https://github.com/tsruban/hhims/blob/master/application/modules/laboratory/controllers/laboratory.php): `application/modules/laboratory/controllers/laboratory.php`
- [Pharmacy](https://github.com/tsruban/hhims/blob/master/application/modules/pharmacy/controllers/pharmacy.php): `application/modules/pharmacy/controllers/pharmacy.php`
- [Drug stock](https://github.com/tsruban/hhims/blob/master/application/modules/drug_stock/controllers/drug_stock.php): `application/modules/drug_stock/controllers/drug_stock.php`
- [Reports and PDF](https://github.com/tsruban/hhims/blob/master/application/modules/report/controllers/report.php): `application/modules/report/controllers/report.php`

### Supporting services

- [Questionnaires](https://github.com/tsruban/hhims/blob/master/application/modules/questionnaire/controllers/questionnaire.php): `application/modules/questionnaire/controllers/questionnaire.php`
- [Notifications](https://github.com/tsruban/hhims/blob/master/application/modules/notification/controllers/notification.php): `application/modules/notification/controllers/notification.php`
- [Chat](https://github.com/tsruban/hhims/blob/master/application/modules/chat/controllers/chat.php): `application/modules/chat/controllers/chat.php`

### Data and framework

- [Domain models](https://github.com/tsruban/hhims/tree/master/application/models): `application/models`
- [MySQL database](https://github.com/tsruban/hhims/blob/master/application/config/database.php): `application/config/database.php`
- [Framework bootstrap](https://github.com/tsruban/hhims/blob/master/system/core/CodeIgniter.php): `system/core/CodeIgniter.php`
- [Framework common](https://github.com/tsruban/hhims/blob/master/system/core/Common.php): `system/core/Common.php`
- [Framework hooks](https://github.com/tsruban/hhims/blob/master/system/core/Hooks.php): `system/core/Hooks.php`
- [Request input](https://github.com/tsruban/hhims/blob/master/system/core/Input.php): `system/core/Input.php`
- [Response output](https://github.com/tsruban/hhims/blob/master/system/core/Output.php): `system/core/Output.php`
- [Request security](https://github.com/tsruban/hhims/blob/master/system/core/Security.php): `system/core/Security.php`
- [UTF-8 handling](https://github.com/tsruban/hhims/blob/master/system/core/Utf8.php): `system/core/Utf8.php`

### Other components

- **Hospital user**

## Connections

- Hospital user → Web entry point: opens in browser
- Web entry point → Framework bootstrap: starts framework (evidence: `index.php`)
- Framework bootstrap → Framework common: loads (evidence: `system/core/CodeIgniter.php`)
- Framework bootstrap → Framework hooks: loads (evidence: `system/core/CodeIgniter.php`)
- Framework bootstrap → Request input: loads (evidence: `system/core/CodeIgniter.php`)
- Framework bootstrap → Response output: loads (evidence: `system/core/CodeIgniter.php`)
- Framework bootstrap → Request security: loads (evidence: `system/core/CodeIgniter.php`)
- Framework bootstrap → UTF-8 handling: loads (evidence: `system/core/CodeIgniter.php`)
- Request routing → HHIMS home: sets default (evidence: `application/config/routes.php`)
- Hospital user → Authentication: authenticates
- Authentication → Patient records: accesses records
- Patient records → Outpatient care: opens encounter
- Patient records → Clinic care: opens encounter
- Patient records → Admissions: starts admission
- Admissions → Ward care: continues inpatient care
- Outpatient care → Laboratory orders: orders tests
- Clinic care → Laboratory orders: orders tests
- Outpatient care → Pharmacy: prescribes medicines
- Clinic care → Pharmacy: prescribes medicines
- Pharmacy → Drug stock: uses stock
- Appointments → Patient records: schedules visits
- Reports and PDF → MySQL database: reports clinical data
- Questionnaires → Patient records: records responses
- Notifications → Hospital user: sends updates
- Chat → Hospital user: supports messaging
- Patient records → Domain models: uses domain data
- Outpatient care → Domain models: uses domain data
- Clinic care → Domain models: uses domain data
- Admissions → Domain models: uses domain data
- Domain models → MySQL database: persists data
