diff --git a/e2e/tests/bedside-smoke.spec.js b/e2e/tests/bedside-smoke.spec.js
index 2793e43..3d20e3a 100644
--- a/e2e/tests/bedside-smoke.spec.js
+++ b/e2e/tests/bedside-smoke.spec.js
@@ -1,21 +1,22 @@
// Bedside module smoke tests.
-// Each test navigates to the Calculators tab, opens Bedside, clicks the target
-// sub-pill, and asserts a known string is rendered. Catches "button doesn't
-// fire / section goes blank" regressions.
+// The harness renders the Calculators + Bedside components side-by-side, so
+// each test selects the target sub-pill (if any) and asserts a known string
+// is rendered. Bedside was promoted to a top-level tab, so there is no longer
+// a calc-nav-pill[data-calc="bedside"] — the panel is always visible in the
+// harness and always the full tab in the live app.
const { test, expect } = require('@playwright/test');
-// Helper — open Calculators tab + Bedside panel + (optionally) a sub-pill
async function openCalculators(page) {
await page.goto('/e2e-harness.html');
await page.waitForFunction(() => window.__harnessReady === true);
- // Give the async innerHTML injection + JS init one more microtask tick
- await page.waitForSelector('button.calc-nav-pill[data-calc="bedside"]');
+ // Wait for the bedside component to finish injecting — #bedside-age is the
+ // first input in the shared age→weight estimator at the top of the tab.
+ await page.waitForSelector('#bedside-age');
}
async function openBedside(page, subPill) {
await openCalculators(page);
- await page.click('button.calc-nav-pill[data-calc="bedside"]');
if (subPill) {
await page.click(`button.calc-pill[data-em="${subPill}"]`);
}
diff --git a/public/components/bedside.html b/public/components/bedside.html
new file mode 100644
index 0000000..c2c936b
--- /dev/null
+++ b/public/components/bedside.html
@@ -0,0 +1,523 @@
+
+
+
+
Age → Weight estimator
+
+
+ Age (e.g. 3y, 6 mo, 15d)
+
+
+
+ Formula
+
+ APLS (Luscombe 2007)
+ Best Guess (Tinning 2007)
+
+
+
+ Weight (kg)
+
+
+
Clear
+
+
+
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.
+
+
+
+
+
+
+
+ Neonatal
+ Airway/RSI
+ Cardiac Arrest
+ Respiratory
+ O2 & Ventilation
+ Seizures
+ Sepsis & Fever
+ Anaphylaxis
+ Sedation
+ Agitation
+ Antiemetics
+ Antimicrobials
+ Burns
+ Toxicology
+ Trauma
+
+
+
+
+
Neonatal Assessment
+
GA classification, birth weight assessment (AGA/SGA/LGA), and prematurity category. Fenton 2013 / WHO.
+
+
+ GA (weeks)
+
+
+
+ GA (days)
+
+
+
+ Birth Weight (g)
+
+
+
+ Sex
+
+ Male
+ Female
+
+
+
+
Assess
+
+
+
+ NRP Resuscitation Pathway
+ AHA Neonatal Resuscitation Program 2020. Static visual pathway — enter weight to calculate drug doses.
+
+ View pathway image
+
+
+
+
+ Current Weight (kg)
+
+
+
Calculate NRP Doses
+
+
+
+
+
+
+
Apgar Score
+
Assess at 1 and 5 minutes . If <7 at 5 min, repeat every 5 min up to 20 min. Apgar is a description — never delay resuscitation waiting for a score.
+
+
+ A ppearance (color)
+
+ 0 — Blue / pale all over
+ 1 — Body pink, extremities blue
+ 2 — All pink
+
+
+
+ P ulse (HR)
+
+ 0 — Absent
+ 1 — <100
+ 2 — ≥100
+
+
+
+ G rimace (reflex)
+
+ 0 — No response
+ 1 — Grimace / weak cry
+ 2 — Cry / active withdrawal
+
+
+
+ A ctivity (tone)
+
+ 0 — Limp
+ 1 — Some flexion
+ 2 — Active motion
+
+
+
+ R espiration
+
+ 0 — Absent
+ 1 — Slow / irregular
+ 2 — Strong cry
+
+
+
+
Calculate Apgar
+
+
+
+
+
+
+
Airway Management / RSI
+
RSI drugs + equipment sizing + initial ventilator settings.
+
+
Calculate
+
+
+
+
+
+
Cardiac Arrest / PALS
+
PALS algorithm medications for arrest and peri-arrest rhythms.
+
+ Weight (kg)
+
+
+
+ General Doses
+ Asystole / PEA
+ Bradycardia
+ SVT
+ VF / Pulseless VT
+ Stable VT
+
+
+
+
+
+
+
Respiratory Management
+
Asthma, croup, bronchiolitis — scores, stepwise management, weight-based drug dosing.
+
+ Weight (kg)
+
+
+
+ Asthma
+ Croup
+ Bronchiolitis
+
+
+
+
Select severity to see stepwise management with weight-based dosing.
+
+ Mild
+ Moderate
+ Severe
+
+
+
+
PRAM Score (Pediatric Respiratory Assessment Measure)
+
+
+ O2 Saturation
+ ≥95% 92-94% <92%
+
+
+ Suprasternal Retractions
+ Absent Present
+
+
+ Scalene Contraction
+ Absent Present
+
+
+ Air Entry
+ Normal Decreased at bases Widespread decrease Absent/minimal
+
+
+ Wheezing
+ Absent Expiratory only Insp & exp Audible / silent chest
+
+
+
Calculate PRAM
+
+
+
+
+
+
Westley Croup Score → severity-based treatment.
+
+
+ Consciousness
+ Normal Disoriented
+
+
+ Cyanosis
+ None With agitation At rest
+
+
+ Stridor
+ None With agitation At rest
+
+
+ Air Entry
+ Normal Decreased Markedly decreased
+
+
+ Retractions
+ None Mild Moderate Severe
+
+
+
Calculate Westley Score
+
+
+
+
+
Bronchiolitis management per AAP 2014/2023 — primarily supportive.
+
+
+ Age
+ <12 weeks 12 wks - 12 mo >12 months
+
+
+ O2 Saturation
+ ≥90% <90%
+
+
+ Hydration
+ Adequate Poor / dehydrated
+
+
+ Resp Distress
+ Mild Moderate Severe / apnea
+
+
+
Assess
+
+
+
+
+
+
+
Oxygen & Ventilation
+
+
Show Reference
+
+
+
+
+
+
Status Epilepticus
+
Time-based pathway — stabilize → 1st benzo → 2nd benzo → 2nd-line AED → refractory.
+
+ Weight (kg)
+
+
+
+ Show Pathway
+ View pathway image
+
+
+
+
+
+
+
Sepsis & Fever Workup
+
Phoenix Sepsis Criteria (2024), age-based approach, first-hour bundle, and validated febrile-infant rules (PECARN / Aronson / Rochester / Step-by-Step).
+
+
+ Weight (kg)
+
+
+
+ Age group
+
+ Neonate (0-28 days)
+ Young infant (29 d - 3 mo)
+ Older child / adolescent (>3 mo)
+
+
+
+
Show Approach
+
+
+
+
+
+
Anaphylaxis
+
Stepwise management with weight-based dosing.
+
+
+ Weight (kg)
+
+
+
+ Age Group
+ <1 year 1-12 years >12 years
+
+
+
Calculate Doses
+
+
+
+
+
+
Procedural Sedation
+
Sedation agents + reversal drugs.
+
+ Weight (kg)
+
+
+
Calculate Doses
+
+
+
+
+
+
Acute Agitation
+
Stepwise: verbal de-escalation → oral → IM/IV.
+
+ Weight (kg)
+
+
+
Calculate Doses
+
+
+
+
+
+
Antiemetics
+
Common pediatric antiemetic dosing with max doses and key cautions.
+
+ Weight (kg)
+
+
+
Calculate Doses
+
+
+
+
+
+
Empiric Antimicrobials
+
Empiric regimens by age and infection type. Always tailor to local resistance, cultures, and severity.
+
+
+ Age
+
+ Neonate (0-28 days)
+ Infant (1-3 months)
+ Child (>3 months)
+
+
+
+ Infection
+
+ Sepsis / bacteremia
+ Meningitis
+ Community-acquired pneumonia
+ UTI / pyelonephritis
+ Skin / soft tissue
+ AOM / sinusitis / pharyngitis
+ Febrile neutropenia
+ Intra-abdominal
+ Osteomyelitis / septic arthritis
+
+
+
+
Look Up Regimen
+
+
+
+
+
+
Burn Management
+
TBSA body-parts calculator (Lund-Browder age-adjusted) + Parkland fluid resuscitation. Count only 2nd-degree or deeper.
+
+
+ Weight (kg)
+
+
+
+ Age group
+
+ Infant (<1 yr)
+ 1-5 years
+ 5-10 years
+ 10-15 years
+ >15 / adult
+
+
+
+ Override TBSA %
+
+
+
+
+
+ Calculate Parkland
+ Reset body parts
+
+
+
+
+
+
+
+
Toxicology
+
Approach, decontamination, common ingestions with antidotes, dialyzable drugs reference.
+
+
+ Weight (kg)
+
+
+
+ Topic
+
+ General approach + decontamination
+ Acetaminophen
+ Opioids
+ Iron
+ TCAs
+ β-blocker / CCB
+ Benzodiazepines
+ Organophosphates / carbamates
+ Salicylates
+ Toxic alcohols
+ Dialyzable drugs (ISTUMBLE)
+
+
+
+
Look Up
+
+
+
+
+
+
Trauma
+
Primary / secondary survey, c-spine, massive transfusion, TXA.
+
+ Weight (kg)
+
+
+
Show Reference
+
+
+
+
+
diff --git a/public/components/calculators.html b/public/components/calculators.html
index be0c320..41f5f15 100644
--- a/public/components/calculators.html
+++ b/public/components/calculators.html
@@ -15,53 +15,8 @@
Resus Meds
GCS
Equipment
- Bedside
-
-
-
Age → Weight estimator
-
-
- Age (e.g. 3y, 6 mo, 15d)
-
-
-
- Formula
-
- APLS (Luscombe 2007)
- Best Guess (Tinning 2007)
-
-
-
- Weight (kg)
-
-
-
Clear
-
-
-
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.
-
-
-
@@ -696,487 +651,6 @@
-
-
-
-
-
-
- Neonatal
- Airway/RSI
- Cardiac Arrest
- Respiratory
- O2 & Ventilation
- Seizures
- Sepsis & Fever
- Anaphylaxis
- Sedation
- Agitation
- Antiemetics
- Antimicrobials
- Burns
- Toxicology
- Trauma
-
-
-
-
-
Neonatal Assessment
-
GA classification, birth weight assessment (AGA/SGA/LGA), and prematurity category. Fenton 2013 / WHO.
-
-
- GA (weeks)
-
-
-
- GA (days)
-
-
-
- Birth Weight (g)
-
-
-
- Sex
-
- Male
- Female
-
-
-
-
Assess
-
-
-
- NRP Resuscitation Pathway
- AHA Neonatal Resuscitation Program 2020. Static visual pathway — enter weight to calculate drug doses.
-
- View pathway image
-
-
-
-
- Current Weight (kg)
-
-
-
Calculate NRP Doses
-
-
-
-
-
-
-
Apgar Score
-
Assess at 1 and 5 minutes . If <7 at 5 min, repeat every 5 min up to 20 min. Apgar is a description — never delay resuscitation waiting for a score.
-
-
- A ppearance (color)
-
- 0 — Blue / pale all over
- 1 — Body pink, extremities blue
- 2 — All pink
-
-
-
- P ulse (HR)
-
- 0 — Absent
- 1 — <100
- 2 — ≥100
-
-
-
- G rimace (reflex)
-
- 0 — No response
- 1 — Grimace / weak cry
- 2 — Cry / active withdrawal
-
-
-
- A ctivity (tone)
-
- 0 — Limp
- 1 — Some flexion
- 2 — Active motion
-
-
-
- R espiration
-
- 0 — Absent
- 1 — Slow / irregular
- 2 — Strong cry
-
-
-
-
Calculate Apgar
-
-
-
-
-
-
-
Airway Management / RSI
-
RSI drugs + equipment sizing + initial ventilator settings.
-
-
Calculate
-
-
-
-
-
-
Cardiac Arrest / PALS
-
PALS algorithm medications for arrest and peri-arrest rhythms.
-
- Weight (kg)
-
-
-
- General Doses
- Asystole / PEA
- Bradycardia
- SVT
- VF / Pulseless VT
- Stable VT
-
-
-
-
-
-
-
Respiratory Management
-
Asthma, croup, bronchiolitis — scores, stepwise management, weight-based drug dosing.
-
- Weight (kg)
-
-
-
- Asthma
- Croup
- Bronchiolitis
-
-
-
-
Select severity to see stepwise management with weight-based dosing.
-
- Mild
- Moderate
- Severe
-
-
-
-
PRAM Score (Pediatric Respiratory Assessment Measure)
-
-
- O2 Saturation
- ≥95% 92-94% <92%
-
-
- Suprasternal Retractions
- Absent Present
-
-
- Scalene Contraction
- Absent Present
-
-
- Air Entry
- Normal Decreased at bases Widespread decrease Absent/minimal
-
-
- Wheezing
- Absent Expiratory only Insp & exp Audible / silent chest
-
-
-
Calculate PRAM
-
-
-
-
-
-
Westley Croup Score → severity-based treatment.
-
-
- Consciousness
- Normal Disoriented
-
-
- Cyanosis
- None With agitation At rest
-
-
- Stridor
- None With agitation At rest
-
-
- Air Entry
- Normal Decreased Markedly decreased
-
-
- Retractions
- None Mild Moderate Severe
-
-
-
Calculate Westley Score
-
-
-
-
-
Bronchiolitis management per AAP 2014/2023 — primarily supportive.
-
-
- Age
- <12 weeks 12 wks - 12 mo >12 months
-
-
- O2 Saturation
- ≥90% <90%
-
-
- Hydration
- Adequate Poor / dehydrated
-
-
- Resp Distress
- Mild Moderate Severe / apnea
-
-
-
Assess
-
-
-
-
-
-
-
Oxygen & Ventilation
-
-
Show Reference
-
-
-
-
-
-
Status Epilepticus
-
Time-based pathway — stabilize → 1st benzo → 2nd benzo → 2nd-line AED → refractory.
-
- Weight (kg)
-
-
-
- Show Pathway
- View pathway image
-
-
-
-
-
-
-
Sepsis & Fever Workup
-
Phoenix Sepsis Criteria (2024), age-based approach, first-hour bundle, and validated febrile-infant rules (PECARN / Aronson / Rochester / Step-by-Step).
-
-
- Weight (kg)
-
-
-
- Age group
-
- Neonate (0-28 days)
- Young infant (29 d - 3 mo)
- Older child / adolescent (>3 mo)
-
-
-
-
Show Approach
-
-
-
-
-
-
Anaphylaxis
-
Stepwise management with weight-based dosing.
-
-
- Weight (kg)
-
-
-
- Age Group
- <1 year 1-12 years >12 years
-
-
-
Calculate Doses
-
-
-
-
-
-
Procedural Sedation
-
Sedation agents + reversal drugs.
-
- Weight (kg)
-
-
-
Calculate Doses
-
-
-
-
-
-
Acute Agitation
-
Stepwise: verbal de-escalation → oral → IM/IV.
-
- Weight (kg)
-
-
-
Calculate Doses
-
-
-
-
-
-
Antiemetics
-
Common pediatric antiemetic dosing with max doses and key cautions.
-
- Weight (kg)
-
-
-
Calculate Doses
-
-
-
-
-
-
Empiric Antimicrobials
-
Empiric regimens by age and infection type. Always tailor to local resistance, cultures, and severity.
-
-
- Age
-
- Neonate (0-28 days)
- Infant (1-3 months)
- Child (>3 months)
-
-
-
- Infection
-
- Sepsis / bacteremia
- Meningitis
- Community-acquired pneumonia
- UTI / pyelonephritis
- Skin / soft tissue
- AOM / sinusitis / pharyngitis
- Febrile neutropenia
- Intra-abdominal
- Osteomyelitis / septic arthritis
-
-
-
-
Look Up Regimen
-
-
-
-
-
-
Burn Management
-
TBSA body-parts calculator (Lund-Browder age-adjusted) + Parkland fluid resuscitation. Count only 2nd-degree or deeper.
-
-
- Weight (kg)
-
-
-
- Age group
-
- Infant (<1 yr)
- 1-5 years
- 5-10 years
- 10-15 years
- >15 / adult
-
-
-
- Override TBSA %
-
-
-
-
-
- Calculate Parkland
- Reset body parts
-
-
-
-
-
-
-
-
Toxicology
-
Approach, decontamination, common ingestions with antidotes, dialyzable drugs reference.
-
-
- Weight (kg)
-
-
-
- Topic
-
- General approach + decontamination
- Acetaminophen
- Opioids
- Iron
- TCAs
- β-blocker / CCB
- Benzodiazepines
- Organophosphates / carbamates
- Salicylates
- Toxic alcohols
- Dialyzable drugs (ISTUMBLE)
-
-
-
-
Look Up
-
-
-
-
-
-
Trauma
-
Primary / secondary survey, c-spine, massive transfusion, TXA.
-
- Weight (kg)
-
-
-
Show Reference
-
-
-
-
-
-
diff --git a/public/e2e-harness.html b/public/e2e-harness.html
index 63e9d1c..fdd695b 100644
--- a/public/e2e-harness.html
+++ b/public/e2e-harness.html
@@ -14,6 +14,11 @@
+
+
diff --git a/public/index.html b/public/index.html
index fa46a96..3ede480 100644
--- a/public/index.html
+++ b/public/index.html
@@ -215,7 +215,6 @@
SOAP Note
-
Well Visit
@@ -224,6 +223,7 @@
Sick Visit
+
Vaccine Schedule
@@ -236,14 +236,18 @@
Physical Exam Guide
-
-
- Pagers & Extensions
+
+
+ Bedside
Calculators
+
+
+ Pagers & Extensions
+
Learning Hub
@@ -294,8 +298,9 @@
-
+
+
diff --git a/public/js/e2e-bootstrap.js b/public/js/e2e-bootstrap.js
index b118d76..c3cfda1 100644
--- a/public/js/e2e-bootstrap.js
+++ b/public/js/e2e-bootstrap.js
@@ -3,10 +3,18 @@
// is in document order once parsing completes).
(async function bootstrap() {
try {
- const host = document.getElementById('calculators-tab');
- const html = await fetch('/components/calculators.html').then(r => r.text());
- host.innerHTML = html;
+ // Cache-bust so stale playwright browser caches never serve an outdated
+ // component HTML between reorg deploys.
+ const cb = '?cb=' + Date.now();
+ const [calcHtml, bedsideHtml] = await Promise.all([
+ fetch('/components/calculators.html' + cb).then(r => r.text()),
+ fetch('/components/bedside.html' + cb).then(r => r.text()),
+ ]);
+ document.getElementById('calculators-tab').innerHTML = calcHtml;
+ document.getElementById('bedside-tab').innerHTML = bedsideHtml;
+ // Fire tabChanged for both so per-tab initialisers run.
document.dispatchEvent(new CustomEvent('tabChanged', { detail: { tab: 'calculators' } }));
+ document.dispatchEvent(new CustomEvent('tabChanged', { detail: { tab: 'bedside' } }));
window.__harnessReady = true;
} catch (e) {
console.error('[e2e-harness] bootstrap failed:', e);