pediatric-ai-scribe-v3/public/e2e-harness.html
Daniel ad90b88734 feat: B — extract drug data to public/data/drugs.json (schema v1.0)
Moved 43 weight-based drug entries out of calculators.js string literals
into a structured JSON reference. Renderers now iterate JSON → S.drugRow.

Sections extracted (43 drugs):
- anaphylaxis (7), sedation (11), agitation (11), antiemetics (7), seizure (7)

Out of scope: seizure refractory drips (compound strings), NRP, antimicrobial
empiric regimens (already structured), airway/cardiac/tox/trauma/respiratory
/sepsis/burns sections (fine as-is or no drugs).

New:
- public/data/drugs.json — { version, last_reviewed, sections.<key>.drugs[] }
- public/js/drugs-loader.js — fetches JSON on boot, exposes window._DRUGS +
  window._DRUGS_READY Promise. Non-fatal: each calc function has a matching
  *_FALLBACK constant so a 404 on drugs.json doesn't break anything.

Schema:
- dose_mg_per_kg | dose_mg_per_kg_low/high (for ranges) | max_mg | unit |
  route | notes | source | optional special-cases (weight bands, age-dep text)

Added one unit test asserting drugs.json loads + has all 5 sections with
non-empty drugs arrays. 37/37 unit tests + 26/26 Playwright e2e tests pass.
2026-04-20 04:23:24 +02:00

23 lines
846 B
HTML

<!DOCTYPE html>
<!-- E2E test harness — loads the calculators component + JS in isolation
(no auth wall). Playwright points here instead of the full SPA.
All scripts are external because the app's CSP blocks inline scripts. -->
<html lang="en">
<head>
<meta charset="UTF-8">
<title>E2E harness — calculators</title>
<link rel="stylesheet" href="/css/styles.css">
<style>
body { margin: 0; padding: 16px; background: #f9fafb; }
#calculators-tab { max-width: 1100px; margin: 0 auto; }
</style>
</head>
<body>
<section id="calculators-tab" class="tab-content active" data-component="calculators"></section>
<script defer src="/js/calc-math.js"></script>
<script defer src="/js/drugs-loader.js"></script>
<script defer src="/js/calculators.js"></script>
<script defer src="/js/e2e-bootstrap.js"></script>
</body>
</html>