<- projects/
PERSONAL PROJECT · CLINICAL SIMULATION

Medical Vital Signs Simulator

A high-fidelity, web-based critical care simulator for training junior doctors — real-time waveform generation, dynamic vital signs, drug library, ABG interpreter, and scenario timelines in a professional ICU monitor interface.

Architecture

Static Frontend (HTML5 + Canvas)
ICU Monitor UI · View Modes (ECG / SpO₂ / BP / Records) · Alarm System
Simulation Engines
Waveform generator · Vital signs with physiological drift · Scenario timeline
Clinical Logic
Drug library (15) + interactions · ABG interpreter (Winter's formula) · MEWS / qSOFA / NEWS2 scoring
Data Layer
data.json (pre-built scenarios) · Optional Node.js/Express backend

Key Features

  • ECG (12-lead equiv.), plethysmography, capnography & arterial waveforms on Canvas.
  • Vital signs with natural physiological drift: HR, SpO₂, NIBP, Temp, RR, EtCO₂, GCS, pain.
  • 15 drugs with dose-response and drug-drug interaction warnings.
  • ABG interpreter: acid-base classification, hypoxemia, lactate.
  • Pre-built scenarios (Sepsis, STEMI, Anaphylaxis, Cardiac Arrest...) with time-triggered changes.
  • Quiz mode + multi-level alarms + scoring (MEWS / qSOFA / NEWS2).

Clinical Intelligence

ABG Interpreter

Acid-base status via Winter's formula (expected compensation vs actual pCO₂), full hypoxemia grading (PaO₂ / SpO₂ / A-a gradient), and lactate interpretation — every derangement flagged with the responsible physiological mechanism.

15-Drug Formulary

Dose-response curves per drug (adrenaline, amiodarone, salbutamol, etc.) with interactions detected between co-administered agents — push a drug in a scenario and watch HR/BP/SpO₂ respond realistically.

Early Warning Scores

MEWS, qSOFA, and NEWS2 computed live from vitals. qSOFA captures the "does this patient have sepsis?" moment; NEWS2 drives the escalating alarm ladder for deterioration.

Scenario Engine

Timeline-driven states in data.json — physiological drift, time-triggered deterioration, and drug-response logic compose into scripted teaching cases.

Codebase Layout

├── docs/                 # Static single-page app (GitHub Pages)
│   ├── index.html        # ICU monitor shell
│   ├── script.js         # Simulation engines · clinical logic · UI (~175 KB)
│   ├── data.json         # Pre-built scenarios + 15-drug library (~121 KB)
│   ├── style.css         # Monitor styling & waveform views
│   └── site.webmanifest
├── server.js             # Optional Node.js + Express backend
├── render.yaml           # Render.com deploy blueprint
├── package.json
└── .github/workflows/deploy.yml   # Auto-deploy to GitHub Pages

Tech Stack

HTML5 CSS3 (Flexbox / Grid) Vanilla JS (ES6+) Canvas API Node.js + Express (optional) GitHub Pages
navigate open