# chaudharysajid007/hospital-lims architecture

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

- Interactive diagram: https://gitdiagram.com/chaudharysajid007/hospital-lims
- Repository: https://github.com/chaudharysajid007/hospital-lims

## Overview

Hospital LIMS is a demo laboratory information system that tracks diagnostic orders through specimen receipt, testing, result finalization, report review, and approved PDF access. Its main workflow spans receptionist order entry, technician receiving and result work, and super-admin report decisions; rejection reopens tests for correction. The graph preserves major documented screens and capabilities. Some page-to-endpoint and unsampled controller behavior is documented only at workflow level, so those links cite the README rather than implying inspected implementation details.

Main entry points: [`client/src/App.jsx`](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/App.jsx) (Page routing), [`server/src/app.js`](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/app.js) (API application), [`client/src/api/axios.js`](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/api/axios.js) (API client), [`server/src/controllers/reportController.js`](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/reportController.js) (Report decisions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Page routing<br/>[App.jsx]"]
  node_api["API client<br/>[axios.js]"]
end

subgraph group_intake["Order intake"]
  node_neworder["Order entry<br/>[NewOrder.jsx]"]
  node_tracking["Order tracking<br/>[TrackOrder.jsx]"]
  node_orderctl["Order handling<br/>[orderController.js]"]
end

subgraph group_lab["Laboratory workflow"]
  node_receiving["Batch receiving<br/>[BatchReceiving.jsx]"]
  node_workqueue["Work queue<br/>[WorkQueue.jsx]"]
  node_workspace["Result workspace"]
  node_processed["Processed tests<br/>[TodayProcessed.jsx]"]
  node_receivectl["Specimen receiving"]
  node_queuectl["Queue handling<br/>[queueController.js]"]
  node_resultctl["Result handling"]
end

subgraph group_reporting["Report review"]
  node_reportsui["Report screens<br/>[Reports.jsx]"]
  node_reportctl["Report decisions"]
  node_reportservice["Report submission<br/>[reportService.js]"]
  node_pdf["PDF generation<br/>[pdfService.js]"]
end

subgraph group_identity["Identity and data"]
  node_auth["Auth context<br/>[AuthContext.jsx]"]
  node_usersui["User management<br/>[Users.jsx]"]
  node_server["API application<br/>[app.js]"]
  node_ordertest[("Test lifecycle<br/>[OrderTest.js]")]
  node_resultmodel[("Result records<br/>[Result.js]")]
  node_reportmodel[("Report records<br/>[Report.js]")]
  node_userctl["User administration<br/>[userController.js]"]
end

node_receptionist(("Receptionist"))
node_technician(("Technician"))
node_admin(("Super admin"))

node_app -->|"reads identity"| node_auth
node_app -->|"routes to"| node_neworder
node_app -->|"routes to"| node_tracking
node_app -->|"routes to"| node_receiving
node_app -->|"routes to"| node_workqueue
node_app -->|"routes to"| node_workspace
node_app -->|"routes to"| node_processed
node_app -->|"routes to"| node_reportsui
node_app -->|"routes to"| node_usersui
node_auth -->|"sends login"| node_api
node_neworder -->|"calls API"| node_api
node_tracking -->|"calls API"| node_api
node_receiving -->|"calls API"| node_api
node_workspace -->|"calls API"| node_api
node_reportsui -->|"calls API"| node_api
node_usersui -->|"calls API"| node_api
node_receptionist -->|"enters orders"| node_neworder
node_receptionist -->|"tracks orders"| node_tracking
node_technician -->|"receives specimens"| node_receiving
node_technician -->|"processes tests"| node_workqueue
node_technician -->|"enters results"| node_workspace
node_admin -->|"reviews reports"| node_reportsui
node_api -->|"sends requests"| node_server
node_server -->|"mounts order routes"| node_orderctl
node_server -->|"mounts receiving routes"| node_receivectl
node_server -->|"mounts queue routes"| node_queuectl
node_server -->|"mounts result routes"| node_resultctl
node_server -->|"mounts report routes"| node_reportctl
node_server -->|"mounts user routes"| node_userctl
node_orderctl -->|"creates tests"| node_ordertest
node_receivectl -->|"updates receipt"| node_ordertest
node_queuectl -->|"reads queue"| node_ordertest
node_resultctl -->|"updates status"| node_ordertest
node_resultctl -->|"saves results"| node_resultmodel
node_resultctl -->|"submits report"| node_reportservice
node_reportservice -->|"creates versions"| node_reportmodel
node_reportctl -->|"records decisions"| node_reportmodel
node_reportctl -->|"generates PDF"| node_pdf
node_reportctl -->|"reopens tests"| node_ordertest
node_reportctl -->|"reopens results"| node_resultmodel
node_userctl -.->|"serves user API"| node_server
node_receptionist -->|"downloads approved"| node_reportsui

click node_app "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/App.jsx"
click node_api "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/api/axios.js"
click node_auth "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/context/AuthContext.jsx"
click node_neworder "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/NewOrder.jsx"
click node_tracking "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/TrackOrder.jsx"
click node_receiving "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/BatchReceiving.jsx"
click node_workqueue "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/WorkQueue.jsx"
click node_workspace "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/ResultWorkspace.jsx"
click node_processed "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/TodayProcessed.jsx"
click node_reportsui "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/Reports.jsx"
click node_usersui "https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/Users.jsx"
click node_server "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/app.js"
click node_orderctl "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/orderController.js"
click node_receivectl "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/receivingController.js"
click node_queuectl "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/queueController.js"
click node_resultctl "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/resultController.js"
click node_reportctl "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/reportController.js"
click node_reportservice "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/services/reportService.js"
click node_pdf "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/services/pdfService.js"
click node_ordertest "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/models/OrderTest.js"
click node_resultmodel "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/models/Result.js"
click node_reportmodel "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/models/Report.js"
click node_userctl "https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/userController.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_app,node_api toneBlue
class node_neworder,node_tracking,node_orderctl toneAmber
class node_receiving,node_workqueue,node_workspace,node_processed,node_receivectl,node_queuectl,node_resultctl toneMint
class node_reportsui,node_reportctl,node_reportservice,node_pdf toneRose
class node_auth,node_usersui,node_server,node_ordertest,node_resultmodel,node_reportmodel,node_userctl,node_receptionist,node_technician,node_admin toneIndigo
```

## Components

### React client

- [Page routing](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [API client](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/api/axios.js): `client/src/api/axios.js`

### Order intake

- [Order entry](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/NewOrder.jsx): `client/src/pages/NewOrder.jsx`
- [Order tracking](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/TrackOrder.jsx): `client/src/pages/TrackOrder.jsx`
- [Order handling](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/orderController.js): `server/src/controllers/orderController.js`

### Laboratory workflow

- [Batch receiving](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/BatchReceiving.jsx): `client/src/pages/BatchReceiving.jsx`
- [Work queue](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/WorkQueue.jsx): `client/src/pages/WorkQueue.jsx`
- [Result workspace](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/ResultWorkspace.jsx): `client/src/pages/ResultWorkspace.jsx`
- [Processed tests](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/TodayProcessed.jsx): `client/src/pages/TodayProcessed.jsx`
- [Specimen receiving](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/receivingController.js): `server/src/controllers/receivingController.js`
- [Queue handling](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/queueController.js): `server/src/controllers/queueController.js`
- [Result handling](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/resultController.js): `server/src/controllers/resultController.js`

### Report review

- [Report screens](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/Reports.jsx): `client/src/pages/Reports.jsx`
- [Report decisions](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/reportController.js): `server/src/controllers/reportController.js`
- [Report submission](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/services/reportService.js): `server/src/services/reportService.js`
- [PDF generation](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/services/pdfService.js): `server/src/services/pdfService.js`

### Identity and data

- [Auth context](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [User management](https://github.com/chaudharysajid007/hospital-lims/blob/main/client/src/pages/Users.jsx): `client/src/pages/Users.jsx`
- [API application](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/app.js): `server/src/app.js`
- [Test lifecycle](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/models/OrderTest.js): `server/src/models/OrderTest.js`
- [Result records](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/models/Result.js): `server/src/models/Result.js`
- [Report records](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/models/Report.js): `server/src/models/Report.js`
- [User administration](https://github.com/chaudharysajid007/hospital-lims/blob/main/server/src/controllers/userController.js): `server/src/controllers/userController.js`

### Other components

- **Receptionist**
- **Technician**
- **Super admin**

## Connections

- Page routing → Auth context: reads identity (evidence: `client/src/App.jsx`)
- Page routing → Order entry: routes to (evidence: `client/src/App.jsx`)
- Page routing → Order tracking: routes to (evidence: `client/src/App.jsx`)
- Page routing → Batch receiving: routes to (evidence: `client/src/App.jsx`)
- Page routing → Work queue: routes to (evidence: `client/src/App.jsx`)
- Page routing → Result workspace: routes to (evidence: `client/src/App.jsx`)
- Page routing → Processed tests: routes to (evidence: `client/src/App.jsx`)
- Page routing → Report screens: routes to (evidence: `client/src/App.jsx`)
- Page routing → User management: routes to (evidence: `client/src/App.jsx`)
- Auth context → API client: sends login (evidence: `client/src/context/AuthContext.jsx`)
- Order entry → API client: calls API (evidence: `client/src/pages/NewOrder.jsx`)
- Order tracking → API client: calls API (evidence: `client/src/pages/TrackOrder.jsx`)
- Batch receiving → API client: calls API (evidence: `client/src/pages/BatchReceiving.jsx`)
- Result workspace → API client: calls API (evidence: `client/src/pages/ResultWorkspace.jsx`)
- Report screens → API client: calls API (evidence: `client/src/pages/Reports.jsx`)
- User management → API client: calls API (evidence: `client/src/pages/Users.jsx`)
- Receptionist → Order entry: enters orders (evidence: `README.md`)
- Receptionist → Order tracking: tracks orders (evidence: `README.md`)
- Technician → Batch receiving: receives specimens (evidence: `README.md`)
- Technician → Work queue: processes tests (evidence: `README.md`)
- Technician → Result workspace: enters results (evidence: `README.md`)
- Super admin → Report screens: reviews reports (evidence: `README.md`)
- API client → API application: sends requests (evidence: `README.md`)
- API application → Order handling: mounts order routes (evidence: `server/src/app.js`)
- API application → Specimen receiving: mounts receiving routes (evidence: `server/src/app.js`)
- API application → Queue handling: mounts queue routes (evidence: `server/src/app.js`)
- API application → Result handling: mounts result routes (evidence: `server/src/app.js`)
- API application → Report decisions: mounts report routes (evidence: `server/src/app.js`)
- API application → User administration: mounts user routes (evidence: `server/src/app.js`)
- Order handling → Test lifecycle: creates tests (evidence: `server/src/controllers/orderController.js`)
- Specimen receiving → Test lifecycle: updates receipt (evidence: `server/src/controllers/receivingController.js`)
- Queue handling → Test lifecycle: reads queue (evidence: `server/src/controllers/queueController.js`)
- Result handling → Test lifecycle: updates status (evidence: `server/src/controllers/resultController.js`)
- Result handling → Result records: saves results (evidence: `server/src/controllers/resultController.js`)
- Result handling → Report submission: submits report (evidence: `server/src/controllers/resultController.js`)
- Report submission → Report records: creates versions (evidence: `server/src/services/reportService.js`)
- Report decisions → Report records: records decisions (evidence: `server/src/controllers/reportController.js`)
- Report decisions → PDF generation: generates PDF (evidence: `server/src/controllers/reportController.js`)
- Report decisions → Test lifecycle: reopens tests (evidence: `server/src/controllers/reportController.js`)
- Report decisions → Result records: reopens results (evidence: `server/src/controllers/reportController.js`)
- User administration → API application: serves user API
- Receptionist → Report screens: downloads approved (evidence: `README.md`)
