From 2a2787c26dfc9533d7bc65d8ca4d1232129e7a54 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 20 Apr 2026 02:49:22 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Bedside=20clinical=20reference=20module?= =?UTF-8?q?=20+=20age=E2=86=92weight=20estimator=20+=20dose-math=20unit=20?= =?UTF-8?q?tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calculators: - Bedside tab consolidating emergency protocols (Neonatal+Apgar+NRP, Airway/RSI, Cardiac Arrest/PALS, Respiratory, O2 & Ventilation, Status Epilepticus, Sepsis & Fever with PECARN/Aronson/Rochester/Step-by-Step, Anaphylaxis, Procedural Sedation, Agitation, Antiemetics, Antimicrobials, Burns with Lund-Browder body-parts TBSA + Parkland, Toxicology, Trauma). - Global age→weight estimator at top of Calculators tab (APLS + Best Guess). - Pressure-time waveform SVG teaching graphic for Ventilation. - Algorithm image lightbox (fullscreen, Esc/tap-to-close). - Every weight-based dose shows mg/kg inline for clinician verification. - Drug tables wrapped in overflow-x:auto for mobile. Infrastructure: - Pure dose math extracted to public/js/calc-math.js (dual-export Node+browser). - 36 unit tests in test/calc-math.test.js via node:test (zero new deps). - "npm test" added to package.json. --- package.json | 1 + public/components/calculators.html | 553 ++++++++- public/css/styles.css | 1 + public/img/epilepsy_eiic_pathway.png | Bin 0 -> 333325 bytes public/img/nrp_pathway.png | Bin 0 -> 147969 bytes public/index.html | 1 + public/js/calc-math.js | 206 ++++ public/js/calculators.js | 1551 ++++++++++++++++++++++++++ test/calc-math.test.js | 167 +++ 9 files changed, 2454 insertions(+), 26 deletions(-) create mode 100644 public/img/epilepsy_eiic_pathway.png create mode 100644 public/img/nrp_pathway.png create mode 100644 public/js/calc-math.js create mode 100644 test/calc-math.test.js diff --git a/package.json b/package.json index 90ec3fe..727a5bf 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "server.js", "scripts": { "start": "node server.js", + "test": "node --test test/", "maint:check": "node scripts/maintenance.js check", "maint:reindex": "node scripts/maintenance.js reindex", "migrate": "node-pg-migrate", diff --git a/public/components/calculators.html b/public/components/calculators.html index 8823e4b..1537e7c 100644 --- a/public/components/calculators.html +++ b/public/components/calculators.html @@ -15,7 +15,52 @@ - + + + + +
+
Age → Weight estimator
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
Estimator only — copy the weight into whichever calculator you need.
+ + +
+ Weight-estimation formulas +
+
APLS (Luscombe & Owens 2007 / APLS-UK 2016)
+
+ • 0-12 months: (0.5 × age in months) + 4
+ • 1-5 years: (2 × age in years) + 8
+ • 6-12 years: (3 × age in years) + 7 +
+
Best Guess (Tinning & Acworth 2007)
+
+ • 1-11 months: (age in months + 9) / 2
+ • 1-4 years: 2 × (age in years + 5)
+ • 5-14 years: 4 × age in years +
+
Broselow tape (length-based) is most accurate when available.
+
+
@@ -638,38 +683,494 @@ - -