// ============================================================
// bedside/sepsis.js
// SEPSIS — Phoenix criteria, febrile-infant rules, first-hour bundle.
// ============================================================
import { S } from './shared.js';
function showSepsis() {
var wt = parseFloat(document.getElementById('sepsis-weight').value);
var age = document.getElementById('sepsis-age').value;
var el = document.getElementById('sepsis-result');
var html = '';
var ageLbl = { neonate: 'Neonate (0-28 d)', infant: 'Young infant (29 d - 3 mo)', child: 'Older child / adolescent' }[age];
html += '
Sepsis approach — ' + ageLbl + (wt ? ', ' + wt + ' kg' : '') + '
';
// Definition (Phoenix 2024)
html += 'Definition — Phoenix Sepsis Criteria (JAMA 2024)
';
html += '';
html += 'Sepsis = suspected or confirmed infection + Phoenix Score ≥2 (organ dysfunction across respiratory, cardiovascular, coagulation, neurological).
';
html += 'Septic shock = sepsis + cardiovascular dysfunction (vasoactive support, or ↑lactate ≥5, or ↓MAP for age).
';
html += 'Previous SIRS-based criteria (Goldstein 2005) are now superseded. Still useful for quick clinical screening.';
html += '
';
// Quick red flags
html += 'Red flags (recognize early)
';
html += 'Abnormal behavior / mentation • Fever + ill-appearance • Tachycardia out of proportion to fever • Prolonged cap refill (>3 s) • Cold/mottled extremities • Weak pulses or wide pulse pressure ("warm shock") • Hypotension is a LATE sign in children • Any immune compromise / indwelling line.
';
// Age-specific approach
html += 'Evaluation & empiric therapy — ' + ageLbl + '
';
if (age === 'neonate') {
html += '';
html += 'Workup (full sepsis eval): CBC + diff, CRP, blood culture, UA + urine culture (cath), lumbar puncture (CSF + HSV PCR), CXR if respiratory sx. Consider procalcitonin. Rapid viral panel if available.
';
html += 'Early-onset (<72 h): GBS, E. coli, Listeria. Late-onset (>72 h): coag-neg staph, S. aureus, gram-negs, Candida.
';
html += S.drugTable(
S.drugRow('Ampicillin', wt ? S.dStr(wt, 100, 2000) : '50-100 mg/kg/dose', 'IV', 'q8-12h depending on age/weight. Covers GBS, Listeria, Enterococcus.') +
S.drugRow('Gentamicin', wt ? S.dStr(wt, 4, 120) : '4-5 mg/kg/dose', 'IV', 'q24-48h. Monitor levels. Peak 5-12, trough <1.') +
S.drugRow('Cefotaxime (add)', wt ? S.dStr(wt, 50, 2000) : '50 mg/kg/dose', 'IV', 'If meningitis suspected or gram-neg concern. Ceftriaxone avoided in hyperbilirubinemia.') +
S.drugRow('Acyclovir', wt ? S.dStr(wt, 20, 1200) : '20 mg/kg/dose', 'IV q8h', 'If HSV risk: maternal genital lesions, vesicles, seizures, CSF pleocytosis, hypothermia, hepatitis.')
);
} else if (age === 'infant') {
html += '';
html += 'Workup: Use validated rules — PECARN, Aronson, Rochester, Step-by-Step (see below). Most warrant CBC + ANC, procalcitonin and/or CRP, blood culture, UA + urine culture. Many warrant LP + admission + empiric abx.
';
html += 'Coverage: GBS, E. coli, Listeria (up to ~6 wk), S. pneumoniae, N. meningitidis, H. influenzae, Salmonella.
';
// Febrile-infant rules — collapsible details
html += ' Validated febrile-infant rules (click to expand)
';
html += '';
// PECARN 2019
html += '
';
html += '
PECARN febrile infant rule (Kuppermann et al., JAMA Pediatrics 2019)
';
html += '
Age: 29-60 days, well-appearing, febrile.
Low-risk if ALL:';
html += ' • Normal UA (no LE, no nitrite, <5 WBC/hpf)
';
html += ' • ANC ≤4,090 /μL
';
html += ' • Procalcitonin ≤0.5 ng/mL (if procal unavailable: use CRP ≤20 mg/L as proxy)
';
html += '
Low-risk → may defer LP/abx, observe, close follow-up.
Not low-risk → full workup + empiric abx.';
html += '
';
// Aronson 2019
html += '
';
html += '
Aronson rule (Aronson et al., PEDIATRICS 2019)
';
html += '
Age: 8-60 days, febrile ≥38°C. Point-based score for invasive bacterial infection (IBI):
';
html += ' • Age 22-28 days:
+1';
html += ' • Max temperature ≥38.5°C:
+2';
html += ' • ANC ≥5,185 /μL:
+2';
html += ' • Abnormal UA:
+3';
html += '
Score 0-1 → low risk.
≥2 → consider full workup + abx. Higher scores → higher IBI risk.';
html += '
';
// Rochester
html += '
';
html += '
Rochester criteria (Jaskiewicz et al., Pediatrics 1994)
';
html += '
Age: 0-60 days, febrile.
Low-risk if ALL:';
html += ' • Previously healthy (term, no perinatal complications, no prior abx/hospitalization)
';
html += ' • Well-appearing, no focal infection (not skin/bone/joint/soft tissue)
';
html += ' • WBC 5,000-15,000 /μL and absolute band count ≤1,500 /μL
';
html += ' • UA ≤10 WBC/hpf
';
html += ' • If diarrhea: stool ≤5 WBC/hpf
';
html += '
Low-risk → observation without abx possible (NPV >98%). Does not include procal.';
html += '
';
// Step-by-Step
html += '
';
html += '
Step-by-Step (Gomez et al., Pediatrics 2016 — European)
';
html += '
Age: ≤90 days, febrile. Sequential triage; stop at first positive:
';
html += '
1. Ill-appearing? →
high risk';
html += '
2. Age ≤21 days? →
high risk';
html += '
3. Leukocyturia (UA abnormal)? →
high risk';
html += '
4. Procalcitonin ≥0.5 ng/mL? →
high risk';
html += '
5. CRP >20 mg/L AND/OR ANC >10,000 /μL? →
intermediate';
html += '
6. Otherwise →
low risk';
html += '
Highest sensitivity for IBI among these rules when procal available.
';
html += '
';
html += '
Practical note: AAP 2021 Clinical Practice Guideline on the well-appearing febrile infant 8-60 days synthesizes these — ages 8-21 d full workup regardless, 22-28 d inflammatory markers guide LP, 29-60 d UA + markers guide LP/abx. Defer to your local institutional pathway if available.
';
html += '
';
html += S.drugTable(
S.drugRow('Ceftriaxone', wt ? S.dStr(wt, 75, 2000) : '50-75 mg/kg/dose', 'IV / IM', 'q24h (or 100 mg/kg/day divided q12h for meningitis). Avoid <28 days if hyperbilirubinemia.') +
S.drugRow('Ampicillin', wt ? S.dStr(wt, 100, 2000) : '50-100 mg/kg/dose', 'IV', 'If <6 wks: add for Listeria coverage.') +
S.drugRow('Vancomycin', wt ? S.dStr(wt, 15, 1000) : '15 mg/kg/dose', 'IV', 'If severe / MRSA risk / meningitis. Target trough 15-20.') +
S.drugRow('Acyclovir', wt ? S.dStr(wt, 20, 1200) : '20 mg/kg/dose', 'IV q8h', '<6 weeks with suspicion of HSV.')
);
} else {
html += '';
html += 'Recognition: Phoenix score or clinical concern + suspected infection. Workup: CBC, CRP, procalcitonin, blood cx (+ site-specific cx), lactate, blood gas, glucose, electrolytes, coags, LP if CNS concern. Source-directed imaging.
';
html += 'Common sources: respiratory, UTI, CNS, skin/soft tissue, intra-abdominal, bone/joint, indwelling device.
';
html += S.drugTable(
S.drugRow('Ceftriaxone', wt ? S.dStr(wt, 50, 2000) : '50 mg/kg/dose', 'IV', 'q24h (or 100 mg/kg/day divided for meningitis).') +
S.drugRow('Vancomycin', wt ? S.dStr(wt, 15, 1000) : '15 mg/kg/dose', 'IV', 'q6h. If severe, indwelling line, or MRSA prevalence >10%.') +
S.drugRow('Piperacillin-tazobactam', wt ? S.dStr(wt, 100, 4500) : '80-100 mg/kg/dose', 'IV', 'If intra-abdominal / neutropenic.') +
S.drugRow('Clindamycin', wt ? S.dStr(wt, 10, 900) : '10-13 mg/kg/dose', 'IV', 'Adjunct for toxic shock syndrome (toxin suppression).') +
S.drugRow('Acyclovir', wt ? S.dStr(wt, 20, 1200) : '10-20 mg/kg/dose', 'IV q8h', 'If HSV CNS concern.')
);
}
// First-hour bundle
html += 'First-hour bundle (SSC Peds 2020)
';
html += S.stepBox('#3b82f6', '0-5 min — Recognize', 'Screen for sepsis; sepsis huddle / activation. Assess ABCs. O2 to SpO2 >94%. Warm patient.');
html += S.stepBox('#8b5cf6', '5-15 min — Access & labs', 'Two IVs or IO. Draw: blood cx (ideally before abx), lactate, CBC, CMP, coags, blood gas, glucose. UA + culture. Source-specific cultures.');
html += S.stepBox('#f59e0b', '15-30 min — Fluids', (wt ? 'NS or LR ' + S.d(wt, 20) + ' mL bolus over 5-10 min (20 mL/kg). ' : 'NS/LR 10-20 mL/kg bolus over 5-10 min. ') + 'Reassess after each bolus: HR, perfusion, lung sounds, liver size. Repeat up to 40-60 mL/kg; stop if crackles or hepatomegaly.');
html += S.stepBox('#10b981', '30-60 min — Antibiotics + reassess', 'Broad-spectrum empiric abx within 1 hour (ideally 3 hr in sepsis, ≤1 hr in septic shock). Recheck lactate, perfusion.');
html += S.stepBox('#ef4444', '>60 min — Fluid-refractory shock', 'Start vasoactive (epinephrine 0.05-0.3 mcg/kg/min for cold shock or norepinephrine 0.05-0.3 mcg/kg/min for warm shock). Consider central/IO access. Stress-dose hydrocortisone ' + (wt ? '' + S.d(wt, 2, 100) + ' mg IV (2 mg/kg, max 100 mg)' : '2 mg/kg IV (max 100 mg)') + ' if catecholamine-resistant. Consider ICU transfer.');
// Key targets
html += 'Resuscitation targets
';
html += 'Normal mentation • Cap refill ≤2 s • Warm extremities • Strong peripheral pulses • UOP ≥1 mL/kg/hr • MAP ≥5th %ile for age (>65 mmHg adolescent) • SpO2 ≥94% • Lactate trending down.
';
html += S.ref('Phoenix Sepsis Criteria (Schlapbach et al., JAMA 2024). Surviving Sepsis Campaign Pediatric 2020. AAP pediatric sepsis guidance.');
el.innerHTML = html;
}
export function init() {
document.addEventListener('click', function(e) {
if (e.target.id === 'btn-sepsis-show' || e.target.closest('#btn-sepsis-show')) showSepsis();
});
}