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
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
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.
+
+
+
+
+
+

Bedside

+ Weight-based pediatric reference. Always verify against institutional protocols. +
+
+
+ + + + + + + + + + + + + + + +
+ + +
+

Neonatal Assessment

+

GA classification, birth weight assessment (AGA/SGA/LGA), and prematurity category. Fenton 2013 / WHO.

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+ NRP Resuscitation Pathway +

AHA Neonatal Resuscitation Program 2020. Static visual pathway — enter weight to calculate drug 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.

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
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 @@ - - -
-
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.
-
-
-
@@ -696,487 +651,6 @@
- -