# sekhar28march-png/hms architecture

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

- Interactive diagram: https://gitdiagram.com/sekhar28march-png/hms
- Repository: https://github.com/sekhar28march-png/hms

## Overview

This is a hospital management SPA for patient admission, clinical and procurement expenses, inventory, payments, documents, and inpatient billing. The principal workflow is staff entering patient and charge records, tracking payments, then reviewing and printing a bill. It runs locally with browser storage or can use a Google Apps Script API backed by Google Sheets. README documents the major capabilities; the app.js excerpt is partial, so internal links are limited to documented behavior rather than inferred calls.

Main entry points: [`app.js`](https://github.com/sekhar28march-png/hms/blob/main/app.js) (Application controller), [`backend/Code.gs`](https://github.com/sekhar28march-png/hms/blob/main/backend/Code.gs) (Apps Script API), [`Index.html`](https://github.com/sekhar28march-png/hms/blob/main/Index.html) (Web interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Application interface"]
  node_spa["Web interface<br/>[Index.html]"]
  node_controller["Application controller<br/>[app.js]"]
  node_print["Print documents<br/>[app.js]"]
end

subgraph group_care["Patient and clinical operations"]
  node_registration["Patient registration<br/>[app.js]"]
  node_documents["Document checklist<br/>[app.js]"]
  node_clinical["Clinical expenses<br/>[app.js]"]
end

subgraph group_finance["Finance and procurement"]
  node_billing["Inpatient billing<br/>[app.js]"]
  node_payments["Payment receipts<br/>[app.js]"]
  node_procurement["Procurement<br/>[app.js]"]
  node_inventory["Inventory stock<br/>[app.js]"]
end

subgraph group_platform["Persistence and services"]
  node_local[("Browser storage<br/>[app.js]")]
  node_api["Apps Script API<br/>[Code.gs]"]
  node_sheets[("Google Sheets")]
  node_drive[("Google Drive")]
end

node_staff(("Hospital staff"))

node_staff -->|"uses"| node_spa
node_spa -->|"runs"| node_controller
node_controller -->|"supports"| node_registration
node_controller -->|"supports"| node_documents
node_controller -->|"tracks"| node_clinical
node_controller -->|"supports"| node_procurement
node_controller -->|"manages"| node_inventory
node_controller -->|"records"| node_payments
node_controller -->|"calculates"| node_billing
node_controller -->|"prints"| node_print
node_controller -->|"stores locally"| node_local
node_controller -->|"sends API requests"| node_api
node_api -->|"reads and writes"| node_sheets
node_api -->|"exports PDFs"| node_drive

click node_spa "https://github.com/sekhar28march-png/hms/blob/main/Index.html"
click node_controller "https://github.com/sekhar28march-png/hms/blob/main/app.js"
click node_registration "https://github.com/sekhar28march-png/hms/blob/main/app.js"
click node_documents "https://github.com/sekhar28march-png/hms/blob/main/app.js"
click node_clinical "https://github.com/sekhar28march-png/hms/blob/main/app.js"
click node_billing "https://github.com/sekhar28march-png/hms/blob/main/app.js"
click node_payments "https://github.com/sekhar28march-png/hms/blob/main/app.js"
click node_procurement "https://github.com/sekhar28march-png/hms/blob/main/app.js"
click node_inventory "https://github.com/sekhar28march-png/hms/blob/main/app.js"
click node_print "https://github.com/sekhar28march-png/hms/blob/main/app.js"
click node_local "https://github.com/sekhar28march-png/hms/blob/main/app.js"
click node_api "https://github.com/sekhar28march-png/hms/blob/main/backend/Code.gs"

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_spa,node_controller,node_print toneBlue
class node_registration,node_documents,node_clinical toneAmber
class node_billing,node_payments,node_procurement,node_inventory toneMint
class node_local,node_api,node_sheets,node_drive toneRose
class node_staff toneIndigo
```

## Components

### Application interface

- [Web interface](https://github.com/sekhar28march-png/hms/blob/main/Index.html): `Index.html`
- [Application controller](https://github.com/sekhar28march-png/hms/blob/main/app.js): `app.js`
- [Print documents](https://github.com/sekhar28march-png/hms/blob/main/app.js): `app.js`

### Patient and clinical operations

- [Patient registration](https://github.com/sekhar28march-png/hms/blob/main/app.js): `app.js`
- [Document checklist](https://github.com/sekhar28march-png/hms/blob/main/app.js): `app.js`
- [Clinical expenses](https://github.com/sekhar28march-png/hms/blob/main/app.js): `app.js`

### Finance and procurement

- [Inpatient billing](https://github.com/sekhar28march-png/hms/blob/main/app.js): `app.js`
- [Payment receipts](https://github.com/sekhar28march-png/hms/blob/main/app.js): `app.js`
- [Procurement](https://github.com/sekhar28march-png/hms/blob/main/app.js): `app.js`
- [Inventory stock](https://github.com/sekhar28march-png/hms/blob/main/app.js): `app.js`

### Persistence and services

- [Browser storage](https://github.com/sekhar28march-png/hms/blob/main/app.js): `app.js`
- [Apps Script API](https://github.com/sekhar28march-png/hms/blob/main/backend/Code.gs): `backend/Code.gs`
- **Google Sheets**
- **Google Drive**

### Other components

- **Hospital staff**

## Connections

- Hospital staff → Web interface: uses (evidence: `README.md`)
- Web interface → Application controller: runs (evidence: `README.md`)
- Application controller → Patient registration: supports (evidence: `README.md`)
- Application controller → Document checklist: supports (evidence: `README.md`)
- Application controller → Clinical expenses: tracks (evidence: `README.md`)
- Application controller → Procurement: supports (evidence: `README.md`)
- Application controller → Inventory stock: manages (evidence: `README.md`)
- Application controller → Payment receipts: records (evidence: `README.md`)
- Application controller → Inpatient billing: calculates (evidence: `README.md`)
- Application controller → Print documents: prints (evidence: `README.md`)
- Application controller → Browser storage: stores locally (evidence: `README.md`)
- Application controller → Apps Script API: sends API requests (evidence: `README.md`)
- Apps Script API → Google Sheets: reads and writes (evidence: `README.md`)
- Apps Script API → Google Drive: exports PDFs (evidence: `README.md`)
