' +
+ '• Lower gas density → less turbulence → reduced work of breathing through narrowed airways. ' +
+ '• Consider in: severe asthma not responding to max therapy (bridge), upper airway obstruction (croup, post-extubation stridor, FB partial). ' +
+ '• Typical mix: 70:30 He:O2 (or 80:20). Delivered via tight non-rebreather or in-line with neb. ' +
+ '• Limitation: requires FiO2 ≤ 30-40%. If patient needs higher FiO2, heliox can\'t help. ' +
+ '• Evidence in asthma is mixed — use as adjunct, not substitute.' +
+ '
';
+
+ html += '
';
+ }
+ html += '
NAEPP/GINA guidelines. Always use clinical judgment. Verify doses against institutional protocols.
';
+ resultDiv.innerHTML = html;
+ }
+
+ function calcPRAM() {
+ var total = ['pram-spo2','pram-retractions','pram-scalene','pram-air','pram-wheeze'].reduce(function(s, id) {
+ return s + parseInt(document.getElementById(id).value);
+ }, 0);
+ var severity = total <= 3 ? 'Mild' : total <= 7 ? 'Moderate' : 'Severe';
+ var color = total <= 3 ? '#10b981' : total <= 7 ? '#f59e0b' : '#ef4444';
+ document.getElementById('pram-result').innerHTML = '
';
+ }
+
+ function calcCroup() {
+ var wt = parseFloat(document.getElementById('resp-weight').value) || 10;
+ var total = ['croup-conscious','croup-cyanosis','croup-stridor','croup-air','croup-retractions'].reduce(function(s, id) {
+ return s + parseInt(document.getElementById(id).value);
+ }, 0);
+ var severity, color, treatment;
+ if (total <= 2) { severity = 'Mild'; color = '#10b981'; treatment = drugTable(drugRow('Dexamethasone', doseStr(wt, 0.6, 16), 'PO (single dose)', 'Preferred corticosteroid') + drugRow('Supportive care', 'Cool mist, comfort measures', '', 'Discharge if tolerating PO')); }
+ else if (total <= 5) { severity = 'Moderate'; color = '#f59e0b'; treatment = drugTable(drugRow('Dexamethasone', doseStr(wt, 0.6, 16), 'PO/IM', 'Single dose') + drugRow('Racemic epinephrine', '0.5 mL of 2.25% solution', 'Nebulized', 'Observe 2-4 hrs after for rebound') + drugRow('Nebulized epinephrine', '0.5 mL/kg of 1:1000 (max 5 mL)', 'Nebulized', 'Alternative to racemic')); }
+ else if (total <= 11) { severity = 'Severe'; color = '#ef4444'; treatment = drugTable(drugRow('Dexamethasone', doseStr(wt, 0.6, 16), 'IV/IM', 'Immediate') + drugRow('Racemic epinephrine', '0.5 mL of 2.25% solution', 'Nebulized', 'May repeat q15-20min, observe 2-4 hrs') + drugRow('Nebulized epinephrine', '0.5 mL/kg of 1:1000 (max 5 mL)', 'Nebulized', 'Alternative') + drugRow('Heliox', '70:30 or 80:20', 'Face mask', 'Consider if not responding') + drugRow('O2 supplemental', 'Target SpO2 ≥94%', 'Blow-by preferred', 'Minimize agitation')); }
+ else { severity = 'Impending Respiratory Failure'; color = '#dc2626'; treatment = '
Immediate airway management. Prepare for intubation (use ETT 0.5-1 size smaller than predicted). Call anesthesia/ENT. Continue nebulized epinephrine and dexamethasone IV.
Westley WJ et al. Nebulized racemic epinephrine by IPPB for the treatment of croup. Am J Dis Child 1978. Mild ≤2, Moderate 3-5, Severe 6-11, Impending failure ≥12.
';
+ }
+
+ function calcBronchiolitis() {
+ var wt = parseFloat(document.getElementById('resp-weight').value) || 5;
+ var age = document.getElementById('bronch-age').value;
+ var spo2 = document.getElementById('bronch-spo2').value;
+ var hydration = document.getElementById('bronch-hydration').value;
+ var distress = document.getElementById('bronch-distress').value;
+
+ var html = '
Bronchiolitis Management
';
+ var admit = distress === 'severe' || spo2 === 'low' || hydration === 'poor' || age === '<12w';
+
+ if (admit) {
+ html += severityBadge('Admit / Observe', '#ef4444');
+ html += '
';
+ if (age === '<12w') html += '
⚠ Age <12 weeks — high risk for apnea. Monitor closely.
';
+ html += '
';
+ } else {
+ html += severityBadge('Likely Safe for Discharge', '#10b981');
+ }
+
+ html += '
Supportive Care (evidence-based):
';
+ html += drugTable(
+ drugRow('Nasal suctioning', 'Bulb suction or NasalClear', 'Nasal', 'Before feeds and as needed') +
+ drugRow('O2 supplemental', 'Target SpO2 ≥90%', 'NC / high flow', spo2 === 'low' ? 'Required' : 'If needed') +
+ drugRow('Hypertonic saline 3%', '4 mL nebulized', 'Nebulized', 'Consider in inpatients (AAP weak recommendation)') +
+ (hydration === 'poor' ? drugRow('IV fluids', 'NS/LR bolus ' + doseStr(wt, 20, null, ' mL'), 'IV', 'Then maintenance D5 0.45NS') + drugRow('NG feeds', 'If unable to feed orally', 'NG tube', 'Preferred over IV if gut functional') : '')
+ );
+
+ html += '
NOT recommended (AAP 2014/2023): Albuterol/salbutamol (no benefit in bronchiolitis), epinephrine (no evidence of benefit), systemic corticosteroids (no benefit), antibiotics (unless secondary bacterial infection), chest physiotherapy.
';
+ html += '
AAP Clinical Practice Guideline: Management of Bronchiolitis in Infants and Children (2014, reaffirmed 2023). RSV is the most common cause (50-80%).
May repeat every 5-15 minutes if symptoms persist. No contraindications in anaphylaxis.
';
+ html += '
';
+
+ html += '
Step
Drug
Dose
Route
Notes
';
+
+ html += '
STEP 2
Position
Supine + legs elevated
—
If dyspneic: sitting position. If vomiting: recovery position
';
+ html += '
STEP 3
O2
High flow 10-15 L/min
Face mask
100% O2. Prepare for airway management
';
+ html += '
STEP 4
IV fluids
NS ' + S.dStr(wt, 20, null, ' mL') + ' bolus
IV/IO
Repeat up to 60 mL/kg for hypotension
';
+ html += '
STEP 5
Diphenhydramine
' + S.dStr(wt, 1.25, 50) + '
IV/IM/PO
H1 blocker. NOT first-line — adjunct only
';
+ html += '
Ranitidine
' + S.dStr(wt, 1, 50) + '
IV over 5 min
H2 blocker. Optional adjunct
';
+ html += '
STEP 6
Dexamethasone
' + S.dStr(wt, 0.6, 16) + '
IV/IM/PO
Prevents biphasic reaction (4-6 hrs later)
';
+ html += '
Methylprednisolone
' + S.dStr(wt, 2, 125) + '
IV
Alternative steroid
';
+
+ html += '
IF REFRACTORY
Epinephrine gtt
0.1-1 mcg/kg/min
IV infusion
For persistent hypotension despite fluids + IM epi
';
+ html += '
Glucagon
' + S.dStr(wt, 0.02, 1) + '
IV/IM
For patients on beta-blockers not responding to epi
';
+
+ html += '
';
+ html += '
Observe minimum 4-6 hours after last dose of epinephrine (biphasic reactions occur in 5-20% of cases). Discharge with EpiPen prescription and anaphylaxis action plan. Refer to allergist.
';
+ html += '
ASCIA Anaphylaxis Guidelines 2021. WAO Anaphylaxis Guidance 2020. AAP/ACAAI Practice Parameters.
';
+ resultDiv.innerHTML = html;
+ }
+})();
+
+// ============================================================
+// PROCEDURAL SEDATION
+// ============================================================
+(function() {
+ document.addEventListener('click', function(e) {
+ if (e.target.id === 'btn-sed-calc' || e.target.closest('#btn-sed-calc')) calcSedation();
+ });
+
+ function d(wt, mgPerKg, max) { var v = Math.round(wt * mgPerKg * 100) / 100; return max ? Math.min(v, max) : v; }
+
+ function calcSedation() {
+ var wt = parseFloat(document.getElementById('sed-weight').value);
+ var resultDiv = document.getElementById('sed-result');
+ if (!wt) { resultDiv.innerHTML = '
Enter weight (kg).
'; return; }
+
+ var html = '
Procedural Sedation — ' + wt + ' kg patient
';
+
+ // Sedation agents
+ html += '
Sedation Agents
';
+ html += '
Drug
Dose
Route
Onset
Duration
Notes
';
+
+ // Small helper: display dose ranges with per-kg footer consistently.
+ var perKg = function(lo, hi, unit) {
+ unit = unit || 'mg';
+ return ' (' + lo + (hi != null ? '-' + hi : '') + ' ' + unit + '/kg)';
+ };
+ html += '
Max 0.2 mg single dose. Repeat q1 min to max 1 mg total. Risk of seizures — use cautiously.
';
+ html += '
';
+
+ html += '
Pre-sedation checklist: NPO status (2h clear liquids, 6h solids), consent, monitoring equipment (pulse ox, capnography, BP), resuscitation equipment at bedside, suction ready, IV access. Minimum monitoring: continuous SpO2, HR, capnography. Provider capable of managing airway must be present.
';
+ html += '
AAP Guidelines for Monitoring and Management of Pediatric Patients Before, During, and After Sedation. ASA Practice Guidelines for Sedation and Analgesia by Non-Anesthesiologists.
';
+ resultDiv.innerHTML = html;
+ }
+})();
+
+// ============================================================
+// IMAGE LIGHTBOX — any element with data-img-src opens fullscreen
+// ============================================================
+(function() {
+ document.addEventListener('click', function(e) {
+ var opener = e.target.closest && e.target.closest('[data-img-src]');
+ if (opener) {
+ e.preventDefault();
+ var lb = document.getElementById('img-lightbox');
+ if (!lb) return;
+ var src = opener.dataset.imgSrc;
+ var title = opener.dataset.imgTitle || '';
+ document.getElementById('img-lightbox-img').src = src;
+ document.getElementById('img-lightbox-img').alt = title;
+ document.getElementById('img-lightbox-title').textContent = title;
+ document.getElementById('img-lightbox-open').href = src;
+ lb.style.display = 'flex';
+ return;
+ }
+ // Close on close button, on backdrop click (not on image), and on Escape (below)
+ var closeBtn = e.target.closest && e.target.closest('#img-lightbox-close');
+ var lb2 = document.getElementById('img-lightbox');
+ if (!lb2 || lb2.style.display !== 'flex') return;
+ if (closeBtn || e.target === lb2) {
+ lb2.style.display = 'none';
+ document.getElementById('img-lightbox-img').src = '';
+ }
+ });
+ document.addEventListener('keydown', function(e) {
+ if (e.key === 'Escape') {
+ var lb = document.getElementById('img-lightbox');
+ if (lb && lb.style.display === 'flex') {
+ lb.style.display = 'none';
+ document.getElementById('img-lightbox-img').src = '';
+ }
+ }
+ });
+})();
+
+// ============================================================
+// EMERGENCIES SUB-NAV + SHARED HELPERS
+// ============================================================
+(function() {
+ document.addEventListener('click', function(e) {
+ var pill = e.target.closest('[data-em]');
+ if (!pill) return;
+ document.querySelectorAll('[data-em]').forEach(function(p) { p.classList.remove('active'); });
+ pill.classList.add('active');
+ var sections = ['neonatal','airway','cardiac','respiratory','ventilation','seizure','sepsis','anaphylaxis','sedation','agitation','antiemetics','antimicrobials','burns','toxicology','trauma'];
+ sections.forEach(function(s) {
+ var el = document.getElementById('em-' + s);
+ if (el) el.style.display = pill.dataset.em === s ? '' : 'none';
+ });
+ });
+})();
+
+// Shared helpers (attached to window for reuse across sections)
+window._EM = {
+ d: function(wt, perKg, max) { var v = Math.round(wt * perKg * 100) / 100; return max ? Math.min(v, max) : v; },
+ // Dose string — always shows the per-kg used (and max when capped), so the
+ // prescriber can verify the math without opening a drug ref.
+ // S.dStr(30, 0.1, 4) → "3 mg (0.1 mg/kg, max 4 mg)"
+ // S.dStr(60, 0.1, 4) → "4 mg (0.1 mg/kg, max 4 mg · capped)"
+ // S.dStr(20, 2, 150, ' mcg') → "40 mcg (2 mcg/kg, max 150 mcg)"
+ dStr: function(wt, perKg, max, unit) {
+ unit = unit || ' mg';
+ var uTrim = unit.trim() || 'mg';
+ var raw = wt * perKg;
+ var v = Math.round(raw * 100) / 100;
+ var capped = max != null && v > max;
+ var val = capped ? max : v;
+ var perKgStr = '(' + perKg + ' ' + uTrim + '/kg';
+ if (max != null) perKgStr += ', max ' + max + ' ' + uTrim;
+ if (capped) perKgStr += ' · capped';
+ perKgStr += ')';
+ return val + unit + ' ' + perKgStr + '';
+ },
+ drugTable: function(rows) {
+ return '
';
+ 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 += '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.
';
+ } else if (kind === 'brady') {
+ html += S.stepBox('#f59e0b', 'Bradycardia with poor perfusion (HR < 60)', 'Start CPR if HR < 60 with poor perfusion despite oxygenation and ventilation.');
+ html += S.arrow;
+ html += S.drugTable(
+ S.drugRow('Epinephrine', S.dStr(wt, 0.01, 1, ' mg'), 'IV / IO', 'First-line. Q3-5 min.') +
+ S.drugRow('Atropine', S.dStr(wt, 0.02, 0.5, ' mg') + ' (min 0.1 mg)', 'IV / IO', 'If ↑ vagal tone or AV block. Max 1 mg child / 0.5 mg infant.') +
+ S.drugRow('Transcutaneous pacing', '—', 'Pad', 'For refractory bradycardia not responsive to drugs.') +
+ S.drugRow('Consider', '—', '—', 'Hypoxia, tension pneumothorax, ↑ICP, toxic ingestion (organo, CCB, BB), heart block')
+ );
+ } else if (kind === 'svt') {
+ html += S.stepBox('#3b82f6', 'SVT — narrow complex, rate usually >220 infant / >180 child', 'Differentiate from sinus tach: abrupt onset/offset, no P waves or abnormal P axis, HR minimally variable.');
+ html += S.arrow;
+ html += '
If STABLE
';
+ html += S.drugTable(
+ S.drugRow('Vagal maneuvers', 'Ice to face, blow into syringe, Valsalva', '—', 'Try first in stable patient') +
+ S.drugRow('Adenosine (1st)', S.dStr(wt, 0.1, 6, ' mg'), 'IV push (proximal) + flush', 'Rapid push, 3-way stopcock with NS flush') +
+ S.drugRow('Adenosine (2nd)', S.dStr(wt, 0.2, 12, ' mg'), 'IV push + flush', 'If first dose unsuccessful') +
+ S.drugRow('Procainamide', '15 mg/kg over 30-60 min', 'IV', 'Expert consult. Avoid with amiodarone.') +
+ S.drugRow('Amiodarone', '5 mg/kg over 20-60 min', 'IV', 'Expert consult.')
+ );
+ html += '
If UNSTABLE
';
+ html += S.drugTable(S.drugRow('Synchronized cardioversion', '0.5-1 J/kg → 2 J/kg', 'Pad', 'Sedate if possible. Pre-treat with adenosine if IV available.'));
+ } else if (kind === 'vfib') {
+ html += S.stepBox('#dc2626', 'VF / Pulseless VT', 'High-quality CPR + defibrillation are key. Minimize interruptions.');
+ html += S.arrow;
+ html += S.drugTable(
+ S.drugRow('Defibrillation (1st)', '2 J/kg', 'Pad', 'Resume CPR immediately after shock.') +
+ S.drugRow('Defibrillation (2nd)', '4 J/kg', 'Pad', 'After 2 min CPR.') +
+ S.drugRow('Defibrillation (3rd+)', '≥4 J/kg (max 10 J/kg or adult dose)', 'Pad', '') +
+ S.drugRow('Epinephrine', S.dStr(wt, 0.01, 1, ' mg'), 'IV / IO', 'After 2nd shock. Q3-5 min.') +
+ S.drugRow('Amiodarone', S.dStr(wt, 5, 300, ' mg'), 'IV / IO bolus', 'Refractory VF/VT. Max 15 mg/kg/day.') +
+ S.drugRow('Lidocaine', S.dStr(wt, 1, 100, ' mg'), 'IV / IO', 'Alternative to amiodarone. Then 20-50 mcg/kg/min gtt.') +
+ S.drugRow('Mg sulfate', S.dStr(wt, 50, 2000, ' mg'), 'IV over 1-2 min', 'For torsades or hypoMg.')
+ );
+ } else if (kind === 'vt') {
+ html += S.stepBox('#f59e0b', 'Stable monomorphic VT', 'Expert consult. Avoid combining QT-prolonging agents.');
+ html += S.arrow;
+ html += S.drugTable(
+ S.drugRow('Amiodarone', '5 mg/kg over 20-60 min', 'IV', '= ' + S.d(wt, 5, 300) + ' mg over 20-60 min') +
+ S.drugRow('Procainamide', '15 mg/kg over 30-60 min', 'IV', 'Do not combine with amiodarone') +
+ S.drugRow('Sync cardioversion', '0.5-1 → 2 J/kg', 'Pad', 'If becomes unstable. Sedate.')
+ );
+ }
+ html += S.ref('AHA PALS Guidelines 2020. Always verify against institutional protocols.');
+ el.innerHTML = html;
+ }
+
+ function title(k) {
+ return { general: 'PALS General Doses', asystole: 'Asystole / PEA', brady: 'Bradycardia', svt: 'SVT', vfib: 'VF / Pulseless VT', vt: 'Stable VT' }[k] || k;
+ }
+})();
+
+// ============================================================
+// AGITATION
+// ============================================================
+(function() {
+ document.addEventListener('click', function(e) {
+ if (e.target.id === 'btn-agit-calc' || e.target.closest('#btn-agit-calc')) calcAgit();
+ });
+
+ function calcAgit() {
+ var wt = parseFloat(document.getElementById('agit-weight').value);
+ var el = document.getElementById('agit-result');
+ if (!wt) { el.innerHTML = '
Enter weight (kg).
'; return; }
+ var S = window._EM;
+ var html = '
Agitation management — ' + wt + ' kg
';
+ html += S.stepBox('#10b981', 'Step 1 — Non-pharmacologic', 'Dim lights, quiet room, familiar caregiver present, reduce stimulation. Rule out hypoglycemia, hypoxia, pain, ↑ICP, toxic ingestion, infection.');
+ html += S.stepBox('#3b82f6', 'Step 2 — Oral / intranasal (cooperative)', 'First-line for moderate agitation if the patient will accept PO/IN.');
+ html += S.drugTable(
+ S.drugRow('Lorazepam', S.dStr(wt, 0.05, 2, ' mg'), 'PO', '0.05 mg/kg. May repeat in 30 min.') +
+ S.drugRow('Midazolam', S.dStr(wt, 0.5, 10, ' mg'), 'PO', '0.5 mg/kg (max 10 mg)') +
+ S.drugRow('Midazolam', S.dStr(wt, 0.3, 10, ' mg'), 'IN (5 mg/mL)', '0.3 mg/kg split between nares (max 10 mg)') +
+ S.drugRow('Olanzapine (ODT)', wt < 30 ? '2.5-5 mg' : '5-10 mg', 'PO / ODT', 'Age ≥6 yr. Avoid IM + benzo combo (risk of resp depression).') +
+ S.drugRow('Diphenhydramine', S.dStr(wt, 1, 50, ' mg'), 'PO', '1 mg/kg. Adjunct only; sedating.')
+ );
+ html += S.stepBox('#f59e0b', 'Step 3 — IM / IV (severe, uncooperative, or safety risk)', 'Require continuous monitoring. Consider restraints only as last resort.');
+ html += S.drugTable(
+ S.drugRow('Midazolam', S.dStr(wt, 0.1, 5, ' mg'), 'IV / IM', '0.05-0.1 mg/kg IV, 0.1-0.15 mg/kg IM (max 10 mg)') +
+ S.drugRow('Lorazepam', S.dStr(wt, 0.1, 4, ' mg'), 'IV / IM', '0.05-0.1 mg/kg (max 4 mg). May cause resp depression.') +
+ S.drugRow('Haloperidol', wt < 40 ? '0.025-0.075 mg/kg = ' + S.d(wt, 0.05) + ' mg' : '2.5-5 mg', 'IM / IV', 'Avoid <3 yr. Risk: QT, EPS, NMS. ECG if repeated.') +
+ S.drugRow('Olanzapine', wt < 40 ? '2.5-5 mg' : '5-10 mg', 'IM', 'Avoid benzo co-administration (resp depression, hypotension)') +
+ S.drugRow('Ketamine', S.dStr(wt, 4, 500, ' mg'), 'IM', '4-5 mg/kg IM (rescue for severe excited delirium). Monitor airway.') +
+ S.drugRow('Droperidol', '0.03-0.07 mg/kg = ' + S.d(wt, 0.05) + ' mg', 'IM / IV', 'Effective but QT concern — get ECG.')
+ );
+ html += '
Monitoring: Continuous SpO2 + HR after parenteral sedation. Have airway equipment, flumazenil, naloxone, and IV access ready.
';
+ html += S.ref('AAP Clinical Report on Pediatric Agitation. ACEP Guidelines for Acute Agitation.');
+ el.innerHTML = html;
+ }
+})();
+
+// ============================================================
+// ANTIEMETICS
+// ============================================================
+(function() {
+ document.addEventListener('click', function(e) {
+ if (e.target.id === 'btn-emet-calc' || e.target.closest('#btn-emet-calc')) calcEmet();
+ });
+
+ function calcEmet() {
+ var wt = parseFloat(document.getElementById('emet-weight').value);
+ var el = document.getElementById('emet-result');
+ if (!wt) { el.innerHTML = '
Enter weight (kg).
'; return; }
+ var S = window._EM;
+ // Ondansetron weight bands
+ var ondWt = wt < 15 ? '2 mg' : wt < 30 ? '4 mg' : '8 mg';
+ var html = '
Antiemetic doses — ' + wt + ' kg
';
+ html += S.drugTable(
+ S.drugRow('Ondansetron', ondWt + ' (weight band) OR ' + S.dStr(wt, 0.15, 8, ' mg') + ' (0.15 mg/kg)', 'PO / ODT / IV', 'First-line. Max single 8 mg. Repeat q8h. QT prolongation — avoid with other QT drugs. <6 mo: limited data.') +
+ S.drugRow('Metoclopramide', S.dStr(wt, 0.15, 10, ' mg'), 'IV / IM / PO', '0.1-0.15 mg/kg (max 10 mg). Give with diphenhydramine to prevent EPS / dystonia.') +
+ S.drugRow('Dimenhydrinate', S.dStr(wt, 1.25, 50, ' mg'), 'PO / IV / IM / PR', '1.25 mg/kg (max 50 mg) q6h. ≥2 yr.') +
+ S.drugRow('Diphenhydramine', S.dStr(wt, 1, 50, ' mg'), 'PO / IV / IM', '1 mg/kg (max 50 mg) q6h. Adjunct, sedating.') +
+ S.drugRow('Promethazine', S.dStr(wt, 0.25, 25, ' mg'), 'PO / IV / IM', '0.25-1 mg/kg. CONTRAINDICATED <2 yr (resp depression). Tissue injury if IV extrav.') +
+ S.drugRow('Dexamethasone', S.dStr(wt, 0.15, 10, ' mg'), 'IV / PO', 'Adjunct, esp. chemo-induced. 0.15 mg/kg (max 10 mg).') +
+ S.drugRow('Scopolamine patch', '1.5 mg patch', 'Transdermal', '≥12 yr. Motion sickness. Apply 4h before exposure.')
+ );
+ html += '
Pearls: Ondansetron is first-line in ED for acute gastroenteritis vomiting — single PO/ODT dose increases oral rehydration success. Avoid anticholinergics + opioid combinations. Check QTc if stacking ondansetron + other QT drugs.
';
+ html += S.ref('AAP gastroenteritis guidance; WHO essential medicines; Lexicomp.');
+ el.innerHTML = html;
+ }
+})();
+
+// ============================================================
+// ANTIMICROBIALS (empiric, by age + infection type)
+// ============================================================
+(function() {
+ document.addEventListener('click', function(e) {
+ if (e.target.id === 'btn-abx-lookup' || e.target.closest('#btn-abx-lookup')) lookupAbx();
+ });
+
+ var REG = {
+ neonate: {
+ sepsis: { first: 'Ampicillin + gentamicin', alt: 'Add cefotaxime if meningitis suspected or gram-neg concern', duration: '7-10 days; 21 days if confirmed meningitis', notes: 'Cover GBS, E. coli, Listeria. Add acyclovir if HSV risk (maternal lesions, vesicles, seizures).' },
+ meningitis: { first: 'Ampicillin + cefotaxime (or gentamicin) + acyclovir', alt: 'Add vancomycin if gram-positive cocci', duration: '14-21 days depending on organism', notes: 'HSV coverage essential. LP + HSV PCR.' },
+ pna: { first: 'Ampicillin + gentamicin', alt: 'Add cefotaxime for gram-neg', duration: '7-10 days', notes: 'Same as sepsis coverage.' },
+ uti: { first: 'Ampicillin + gentamicin', alt: 'Cefotaxime if sensitivities known', duration: '10-14 days', notes: 'Evaluate for sepsis. Renal US and VCUG workup.' },
+ skin: { first: 'Ampicillin + gentamicin', alt: 'Add vancomycin if MRSA risk', duration: '7-10 days', notes: 'Omphalitis, mastitis — broad coverage.' },
+ ent: { first: 'Discuss with infectious diseases', alt: '—', duration: '—', notes: 'Rare in neonates. Any ear/throat infection warrants sepsis eval.' },
+ neutropenic: { first: 'Cefepime or piperacillin-tazobactam', alt: 'Add vancomycin if indwelling line, severe mucositis, or MRSA', duration: 'Until ANC recovery + afebrile ≥48h', notes: 'Oncology/ID consult.' },
+ ic: { first: 'Ampicillin + gentamicin + metronidazole', alt: 'Or piperacillin-tazobactam', duration: '7-14 days', notes: 'NEC: add metronidazole/clindamycin for anaerobes.' },
+ bone: { first: 'Ampicillin + gentamicin', alt: 'Vancomycin if MRSA risk', duration: '3-6 weeks (IV then PO)', notes: 'Usually hematogenous. S. aureus, GBS, E. coli.' }
+ },
+ infant: {
+ sepsis: { first: 'Ampicillin + ceftriaxone (or gentamicin)', alt: '+ vancomycin if MRSA / severe', duration: '7-10 days', notes: 'Add acyclovir if HSV suspected (<6 wks). Fever in <90 days requires workup.' },
+ meningitis: { first: 'Ceftriaxone + vancomycin (± ampicillin if <6 wks for Listeria)', alt: '+ acyclovir if HSV', duration: '10-14 days (longer for Listeria/gram-neg)', notes: 'Dexamethasone if H. influenzae suspected.' },
+ pna: { first: 'Ampicillin (or ceftriaxone)', alt: 'Add azithromycin if atypical', duration: '7-10 days', notes: 'S. pneumoniae most common. RSV/viral often primary.' },
+ uti: { first: 'Ceftriaxone or cefotaxime', alt: 'Ampicillin + gentamicin', duration: '10-14 days', notes: 'US kidney/bladder if first febrile UTI.' },
+ skin: { first: 'Cefazolin or clindamycin', alt: 'Vancomycin if MRSA risk', duration: '7-10 days', notes: 'Consider MRSA if purulent or local resistance >10%.' },
+ ent: { first: 'Amoxicillin (90 mg/kg/day) for AOM', alt: 'Amox-clav if recent abx/treatment failure', duration: 'AOM 10 days <2 yr; 7 days ≥2 yr', notes: 'Observe mild AOM if >6 mo and no severe features.' },
+ neutropenic: { first: 'Cefepime or piperacillin-tazobactam', alt: '+ vancomycin for severe/mucositis/line', duration: 'Until ANC recovery + afebrile', notes: 'Oncology/ID consult.' },
+ ic: { first: 'Ceftriaxone + metronidazole', alt: 'Piperacillin-tazobactam', duration: '5-7 days (uncomplicated), longer for complicated', notes: 'Appendicitis — surgical consult.' },
+ bone: { first: 'Cefazolin ± vancomycin', alt: 'Clindamycin', duration: '3-4 weeks (IV then PO transition)', notes: 'S. aureus most common. Kingella in <4 yr.' }
+ },
+ child: {
+ sepsis: { first: 'Ceftriaxone + vancomycin', alt: 'Piperacillin-tazobactam if intra-abdominal', duration: '7-14 days', notes: 'Expand if specific source. Add antifungal if prolonged neutropenia.' },
+ meningitis: { first: 'Ceftriaxone + vancomycin', alt: '+ dexamethasone (Hib coverage)', duration: '10-14 days', notes: 'Lumbar puncture. Dexamethasone 0.15 mg/kg q6h x 4 days.' },
+ pna: { first: 'Ampicillin OR amoxicillin (high dose)', alt: 'Ceftriaxone if hospitalized; add azithromycin for atypical', duration: '5-7 days (uncomplicated)', notes: 'Mycoplasma if >5 yr. Consider viral causes.' },
+ uti: { first: 'Cephalexin or TMP-SMX (PO)', alt: 'Ceftriaxone if ill', duration: '7-10 days (10-14 if pyelo)', notes: 'Culture-guided de-escalation.' },
+ skin: { first: 'Cephalexin or clindamycin', alt: 'TMP-SMX or doxycycline if MRSA', duration: '5-10 days', notes: 'Abscess — incision & drainage primary tx.' },
+ ent: { first: 'Amoxicillin 90 mg/kg/day (AOM); Penicillin V for strep pharyngitis', alt: 'Amox-clav; cephalexin if non-anaphylactic PCN allergy', duration: 'AOM 5-10 days; strep 10 days', notes: 'Strep pharyngitis dose: PCN V 250 mg BID-TID (<27 kg) or 500 mg BID (≥27 kg).' },
+ neutropenic: { first: 'Cefepime OR piperacillin-tazobactam', alt: '+ vancomycin', duration: 'Until ANC recovery + afebrile', notes: 'Add empiric antifungal if fever >4-7 days.' },
+ ic: { first: 'Ceftriaxone + metronidazole', alt: 'Piperacillin-tazobactam', duration: '5-7 days (uncomplicated appendicitis)', notes: 'Surgical consult.' },
+ bone: { first: 'Cefazolin ± vancomycin', alt: 'Clindamycin', duration: '3-4 weeks total', notes: 'S. aureus, group A strep. Consider MRSA if severe.' }
+ }
+ };
+
+ function lookupAbx() {
+ var age = document.getElementById('abx-age').value;
+ var inf = document.getElementById('abx-infection').value;
+ var el = document.getElementById('abx-result');
+ var r = REG[age] && REG[age][inf];
+ if (!r) { el.innerHTML = '
No regimen found.
'; return; }
+ var S = window._EM;
+ var ageLbl = { neonate: 'Neonate (0-28 d)', infant: 'Infant (1-3 mo)', child: 'Child (>3 mo)' }[age];
+ var infLbl = document.querySelector('#abx-infection option[value="' + inf + '"]').textContent;
+ var html = '
' + ageLbl + ' — ' + infLbl + '
';
+ html += '
First-line: ' + r.first + '
';
+ html += '
Alternative / add: ' + r.alt + '
';
+ html += '
Duration: ' + r.duration + '
';
+ html += '
Notes: ' + r.notes + '
';
+ html += S.ref('AAP Red Book, IDSA guidelines, Harriet Lane. Always tailor to local resistance patterns and culture results.');
+ el.innerHTML = html;
+ }
+})();
+
+// ============================================================
+// BURNS — Lund-Browder body parts + Parkland
+// ============================================================
+(function() {
+ // Lund-Browder age-adjusted region percentages. Regions marked "*" change with age.
+ // Column order: infant, young (1-5), child (5-10), adol (10-15), adult (>15).
+ var LB = {
+ head: { label: 'Head', vals: [18, 13, 11, 9, 7], ageSensitive: true },
+ neck: { label: 'Neck', vals: [2, 2, 2, 2, 2] },
+ ant_trunk: { label: 'Anterior trunk', vals: [13, 13, 13, 13, 13] },
+ post_trunk:{ label: 'Posterior trunk', vals: [13, 13, 13, 13, 13] },
+ r_buttock: { label: 'Right buttock', vals: [2.5, 2.5, 2.5, 2.5, 2.5] },
+ l_buttock: { label: 'Left buttock', vals: [2.5, 2.5, 2.5, 2.5, 2.5] },
+ genital: { label: 'Genitalia', vals: [1, 1, 1, 1, 1] },
+ r_uparm: { label: 'R upper arm', vals: [4, 4, 4, 4, 4] },
+ l_uparm: { label: 'L upper arm', vals: [4, 4, 4, 4, 4] },
+ r_forearm: { label: 'R forearm', vals: [3, 3, 3, 3, 3] },
+ l_forearm: { label: 'L forearm', vals: [3, 3, 3, 3, 3] },
+ r_hand: { label: 'R hand', vals: [2.5, 2.5, 2.5, 2.5, 2.5] },
+ l_hand: { label: 'L hand', vals: [2.5, 2.5, 2.5, 2.5, 2.5] },
+ r_thigh: { label: 'R thigh', vals: [5.5, 8, 8.5, 9, 9.5], ageSensitive: true },
+ l_thigh: { label: 'L thigh', vals: [5.5, 8, 8.5, 9, 9.5], ageSensitive: true },
+ r_leg: { label: 'R lower leg', vals: [5, 5.5, 6, 6.5, 7], ageSensitive: true },
+ l_leg: { label: 'L lower leg', vals: [5, 5.5, 6, 6.5, 7], ageSensitive: true },
+ r_foot: { label: 'R foot', vals: [3.5, 3.5, 3.5, 3.5, 3.5] },
+ l_foot: { label: 'L foot', vals: [3.5, 3.5, 3.5, 3.5, 3.5] }
+ };
+ var AGE_KEYS = ['infant','young','child','adol','adult'];
+
+ document.addEventListener('click', function(e) {
+ if (e.target.id === 'btn-burn-calc' || e.target.closest('#btn-burn-calc')) calcBurn();
+ if (e.target.id === 'btn-burn-reset' || e.target.closest('#btn-burn-reset')) resetParts();
+ // Render body-parts table the first (or any) time the Burns sub-pill is activated
+ var bp = e.target.closest && e.target.closest('[data-em="burns"]');
+ if (bp) setTimeout(renderBodyParts, 0);
+ // Also render if the top-level Bedside tab is clicked (ensures table ready before user navigates)
+ var nav = e.target.closest && e.target.closest('[data-calc="bedside"]');
+ if (nav) setTimeout(renderBodyParts, 50);
+ });
+ document.addEventListener('change', function(e) {
+ if (e.target && e.target.id === 'burn-age') renderBodyParts();
+ });
+ document.addEventListener('input', function(e) {
+ if (e.target && e.target.dataset && e.target.dataset.burnRegion) updateLive();
+ });
+ // Also attempt render on these events in case component mounts later
+ document.addEventListener('DOMContentLoaded', renderBodyParts);
+ document.addEventListener('tabChanged', function() { setTimeout(renderBodyParts, 100); });
+ if (document.readyState !== 'loading') setTimeout(renderBodyParts, 0);
+
+ function ageIdx() { return Math.max(0, AGE_KEYS.indexOf(document.getElementById('burn-age').value)); }
+
+ function renderBodyParts() {
+ var wrap = document.getElementById('burn-bodyparts-wrapper');
+ if (!wrap) return;
+ var idx = ageIdx();
+ var html = '
';
+ html += '
For each involved body region, enter % of that region burned (2° or deeper). Leave 0 if uninvolved. TBSA = sum of (region size × % involvement).
';
+ html += '
';
+ Object.keys(LB).forEach(function(key) {
+ var r = LB[key];
+ var max = r.vals[idx];
+ var isAgeDep = r.ageSensitive;
+ html += '
' +
+ '' +
+ ' %' +
+ '
';
+ });
+ html += '
';
+ wrap.innerHTML = html;
+ updateLive();
+ }
+
+ function resetParts() {
+ var inputs = document.querySelectorAll('[data-burn-region]');
+ inputs.forEach(function(i) { i.value = 0; });
+ document.getElementById('burn-tbsa').value = '';
+ updateLive();
+ }
+
+ function computeTbsa() {
+ var idx = ageIdx();
+ var total = 0;
+ Object.keys(LB).forEach(function(key) {
+ var el = document.querySelector('[data-burn-region="' + key + '"]');
+ if (!el) return;
+ var pct = parseFloat(el.value) || 0;
+ if (pct < 0) pct = 0; if (pct > 100) pct = 100;
+ total += LB[key].vals[idx] * (pct / 100);
+ });
+ return Math.round(total * 10) / 10;
+ }
+
+ function updateLive() {
+ var t = computeTbsa();
+ var live = document.getElementById('burn-tbsa-live');
+ if (live) live.textContent = t > 0 ? 'Computed TBSA: ' + t + '%' : '';
+ }
+
+ function calcBurn() {
+ var wt = parseFloat(document.getElementById('burn-weight').value);
+ var override = document.getElementById('burn-tbsa').value;
+ var tbsa = override !== '' ? parseFloat(override) : computeTbsa();
+ var el = document.getElementById('burn-result');
+ if (!wt) { el.innerHTML = '
Parkland formula: 4 mL × kg × %TBSA = ' + total + ' mL LR over 24 hours' +
+ ' First 8 h (from time of burn): ' + first8 + ' mL (~' + rateFirst + ' mL/hr)' +
+ ' Next 16 h: ' + next16 + ' mL (~' + rateNext + ' mL/hr)
';
+ html += '
Plus maintenance fluids (4-2-1): ' + maint + ' mL/hr (D5 1/2NS ± 20 mEq KCl/L once UOP established). Consider dextrose in children <30 kg.
';
+ }
+ });
+ if (breakdown) {
+ html += 'Region breakdown
' + breakdown + '
';
+ }
+
+ html += '
Other pearls
';
+ html += '
';
+ html += 'Rule of palm: Patient\'s palm + fingers ≈ 1% TBSA — good for scattered burns. ';
+ html += 'First-degree burns DO NOT count toward TBSA or Parkland. ';
+ html += 'Analgesia: Morphine 0.05-0.1 mg/kg IV q2h, or fentanyl 1-2 mcg/kg IV q30-60 min. ';
+ html += 'Tetanus prophylaxis if indicated. Tdap/Td ± tetanus immunoglobulin.';
+ html += '
';
+
+ html += '
Burn center referral (ABA)
';
+ html += '
Partial-thickness >10% TBSA; any full-thickness; face/hands/feet/genital/perineum/major joints; electrical/chemical/inhalation; associated trauma; significant comorbidities; pediatric burns in non-pediatric center.
';
+ html += S.ref('ABA Advanced Burn Life Support (ABLS) 2018. Parkland formula: Baxter 1968. Lund-Browder 1944 chart (age-adjusted regions).');
+ el.innerHTML = html;
+ }
+})();
+
+// ============================================================
+// TOXICOLOGY
+// ============================================================
+(function() {
+ document.addEventListener('click', function(e) {
+ if (e.target.id === 'btn-tox-lookup' || e.target.closest('#btn-tox-lookup')) lookupTox();
+ });
+
+ function lookupTox() {
+ var wt = parseFloat(document.getElementById('tox-weight').value);
+ var topic = document.getElementById('tox-topic').value;
+ var el = document.getElementById('tox-result');
+ var S = window._EM;
+ var html = '';
+
+ if (topic === 'approach') {
+ html += S.stepBox('#3b82f6', '1. Stabilize (ABCDE)', 'Airway, breathing, circulation, disability (glucose, pupils, GCS), exposure. Naloxone if depressed LOC + resp depression. Dextrose if hypoglycemic. Thiamine in select cases.');
+ html += S.stepBox('#8b5cf6', '2. Identify toxidrome', 'Sympathomimetic: HTN, tachy, mydriasis, diaphoresis (cocaine, meth). Anticholinergic: hot/dry, mydriasis, tachy, delirium (antihistamines, TCAs). Cholinergic: SLUDGE-M, miosis (organophosphates). Opioid: miosis, resp depression, ↓LOC. Sedative-hypnotic: ↓LOC, normal/low vitals.');
+ html += S.stepBox('#f59e0b', '3. Decontamination', 'Activated charcoal 1 g/kg PO (max 50 g): within 1h of ingestion, intact airway, ingestion adsorbed (not Li, metals, alcohols). Avoid caustics/hydrocarbons. Whole bowel irrigation: PEG for metals/iron/lithium/sustained release. Gastric lavage: rarely indicated. Ipecac: no longer recommended.');
+ html += S.stepBox('#10b981', '4. Enhance elimination', 'Urinary alkalinization (salicylates, phenobarbital). Hemodialysis (see ISTUMBLE). Lipid emulsion for lipid-soluble drug toxicity (LA, CCB, TCA).');
+ html += S.stepBox('#ef4444', '5. Antidotes', 'See topic list. Contact Poison Center (US: 1-800-222-1222) early for any significant exposure.');
+ } else if (topic === 'acetaminophen') {
+ html += '
Acetaminophen overdose
';
+ html += '
Acute toxic dose: >150 mg/kg (or 7.5 g total) single ingestion. Hepatotoxic after 24h; AST/ALT peak day 3-4.
';
+ html += '
Diagnosis: Draw level at 4h post-ingestion (or on arrival if >4h). Plot on Rumack-Matthew nomogram (treatment line at 150 mcg/mL at 4h).
';
+ html += S.drugTable(
+ S.drugRow('N-acetylcysteine (NAC) — IV', '150 mg/kg over 1h → 50 mg/kg over 4h → 100 mg/kg over 16h (21h total)', 'IV', 'Total 300 mg/kg. Most effective if started <8h post-ingestion.') +
+ S.drugRow('N-acetylcysteine — PO', '140 mg/kg load, then 70 mg/kg q4h × 17 doses', 'PO', 'Alternative to IV. Unpleasant taste — often with juice.') +
+ S.drugRow('Activated charcoal', '1 g/kg (max 50 g)', 'PO', 'If within 1-2h of ingestion and airway protected.')
+ );
+ if (wt) html += '
For ' + wt + ' kg: IV loading = ' + S.d(wt, 150) + ' mg over 1h (150 mg/kg); 2nd bag = ' + S.d(wt, 50) + ' mg over 4h (50 mg/kg); 3rd bag = ' + S.d(wt, 100) + ' mg over 16h (100 mg/kg). Total 300 mg/kg.
';
+ } else if (topic === 'opioids') {
+ html += '
';
+ html += S.drugTable(
+ S.drugRow('Flumazenil', '0.01 mg/kg (max 0.2 mg) IV, may repeat q1 min to max 1 mg', 'IV', 'Only for iatrogenic reversal in a benzo-naive patient with no TCAs, seizure disorder, or chronic benzo use. Can precipitate seizures.')
+ );
+ html += '
In real-world ingestion, supportive care (airway, monitoring) is usually safer than flumazenil.
Poor candidates for HD: Large Vd (TCAs, digoxin, BBs), highly protein-bound (benzos, CCBs), lipid-soluble (opioids, phenothiazines). EXTRIP recommendations are evidence-based — consult toxicology.
';
+ }
+ html += S.ref('Call Poison Control early: 1-800-222-1222 (US). Refs: Goldfrank\'s Toxicologic Emergencies, EXTRIP workgroup.');
+ el.innerHTML = html;
+ }
+})();
+
+// ============================================================
+// TRAUMA
+// ============================================================
+(function() {
+ document.addEventListener('click', function(e) {
+ if (e.target.id === 'btn-trauma-show' || e.target.closest('#btn-trauma-show')) showTrauma();
+ });
+
+ function showTrauma() {
+ var wt = parseFloat(document.getElementById('trauma-weight').value);
+ var el = document.getElementById('trauma-result');
+ var S = window._EM;
+ var html = '';
+
+ html += '
Primary Survey — ABCDE
';
+ html += S.stepBox('#ef4444', 'A — Airway + c-spine', 'Maintain airway (jaw thrust, suction). Manual inline stabilization; apply collar. Intubate if GCS ≤8, inadequate airway, or impending compromise. Avoid succinylcholine if burn/crush/prolonged immobilization.');
+ html += S.stepBox('#f59e0b', 'B — Breathing', 'SpO2, bilateral breath sounds, chest wall integrity. Identify tension PTX (needle decompression), open PTX (3-sided dressing), flail chest, massive hemothorax.');
+ html += S.stepBox('#10b981', 'C — Circulation', 'Two large-bore IVs / IO. Control hemorrhage (direct pressure, tourniquet, pelvic binder). ' + (wt ? 'NS or LR 20 mL/kg = ' + S.d(wt, 20) + ' mL bolus.' : 'NS/LR 20 mL/kg bolus.') + ' Consider blood after 40-60 mL/kg crystalloid or in Class III shock.');
+ html += S.stepBox('#3b82f6', 'D — Disability', 'GCS, pupils, glucose, gross motor. Consider ↑ICP (head up 30°, mannitol 0.5-1 g/kg or hypertonic saline 3% 3-5 mL/kg).');
+ html += S.stepBox('#8b5cf6', 'E — Exposure + environment', 'Fully expose; prevent hypothermia (warm blankets, fluids).');
+
+ html += '
Massive Transfusion Protocol (MTP)
';
+ html += S.drugTable(
+ S.drugRow('Ratio', '1:1:1 (pRBC : FFP : platelets)', '—', 'Activate early if ≥40 mL/kg transfused or ongoing hemorrhage. Avoid excessive crystalloid.') +
+ S.drugRow('Tranexamic acid (TXA)', '15 mg/kg IV (max 1 g) over 10 min → 2 mg/kg/hr × 8h', 'IV', 'Within 3 hr of injury. CRASH-2 / MATIC.') +
+ S.drugRow('Calcium', '20 mg/kg CaCl or 60 mg/kg Ca-gluconate IV per unit citrated blood', 'IV', 'Citrated blood chelates calcium.')
+ );
+
+ html += '
C-spine clearance (NEXUS / CCR)
';
+ html += '
Pediatric c-spine decision tools are imperfect. Imaging if any: focal neurologic deficit, altered mental status, neck pain / tenderness, torticollis, substantial torso injury, high-risk mechanism (diving, MVC >55 mph, fall >10 ft). Plain films + CT if positive or equivocal.
';
+
+ html += '
Pediatric shock — signs
';
+ html += '
Children compensate well — hypotension is a late finding. Early signs: tachycardia, cool extremities, weak peripheral pulses, prolonged cap refill (>3 sec), narrowed pulse pressure, altered mentation. Minimum SBP = 70 + (2 × age in years) for ages 1-10.
';
+
+ html += '
Secondary survey — AMPLE + head-to-toe
';
+ html += '
AMPLE: Allergies, Medications, Past history, Last meal, Events of injury. Head-to-toe exam; log-roll for back; digital rectal; neurovascular checks of all extremities.
';
+
+ html += S.ref('ATLS 10th ed; PALS 2020; PECARN c-spine rule; CRASH-2 trial (TXA).');
+ el.innerHTML = html;
+ }
+})();
+
+// ============================================================
+// APGAR SCORE (inside Neonatal)
+// ============================================================
+(function() {
+ document.addEventListener('click', function(e) {
+ if (e.target.id === 'btn-apgar-calc' || e.target.closest('#btn-apgar-calc')) calcApgar();
+ });
+ function calcApgar() {
+ var keys = ['appearance','pulse','grimace','activity','respiration'];
+ var total = keys.reduce(function(s, k) {
+ return s + (parseInt(document.getElementById('apgar-' + k).value) || 0);
+ }, 0);
+ var el = document.getElementById('apgar-result');
+ var color, severity, guidance;
+ if (total >= 7) {
+ color = '#10b981'; severity = 'Reassuring';
+ guidance = 'Routine newborn care. Continue reassessment. Repeat at 5 min.';
+ } else if (total >= 4) {
+ color = '#f59e0b'; severity = 'Moderately depressed';
+ guidance = 'Stimulate, clear airway, warm. Give O2 if cyanotic. Ventilate with PPV if HR <100 or apneic/gasping. Reassess q30 sec.';
+ } else {
+ color = '#ef4444'; severity = 'Severely depressed';
+ guidance = 'Full NRP pathway — PPV immediately. Intubate if PPV ineffective. Chest compressions if HR <60. Epinephrine and volume per NRP.';
+ }
+ var html = '
';
+ html += 'Apgar: ' + total + '/10 — ' + severity + '';
+ html += '
' + guidance + '
';
+ html += '
Apgar is a description of status — never delay resuscitation while scoring. Follow NRP algorithm based on HR and breathing. Apgar <7 at 5 min: repeat q5 min up to 20 min.
';
+ el.innerHTML = html;
+ }
+})();
+
+// ============================================================
+// O2 & VENTILATION (teaching reference)
+// ============================================================
+(function() {
+ document.addEventListener('click', function(e) {
+ if (e.target.id === 'btn-vent-show' || e.target.closest('#btn-vent-show')) showVent();
+ });
+
+ function showVent() {
+ var wt = parseFloat(document.getElementById('vent-weight').value);
+ var age = parseFloat(document.getElementById('vent-age').value);
+ var el = document.getElementById('vent-result');
+ var S = window._EM;
+ var html = '';
+
+ // ── Target SpO2 quick reference ──
+ html += '
Target SpO2
';
+ html += '
';
+ html += '
Patient
Target
Notes
';
+ html += '
Most children
94-98%
Normal
';
+ html += '
Bronchiolitis (AAP 2014/2023)
≥90%
Don\'t chase higher saturations
';
+ html += '
Chronic lung disease / CF
90-94%
Avoid hyperoxia in CO2 retainers
';
+ html += '
Preterm neonate
90-95%
Minimize ROP risk
';
+ html += '
Term neonate (min of life)
Per NRP ladder
1 min 60-65%, 10 min 85-95%
';
+ html += '
';
+
+ // ── Escalation ladder ──
+ html += '
Escalation ladder (step up when target not reached / work of breathing)
';
+ html += S.stepBox('#10b981',
+ '1. Nasal cannula (low-flow)',
+ '0.5-6 L/min · FiO2 ~24-40% (rough: room air 21% + 4% per L/min) · comfortable, no humidification needed. Good for mild hypoxia or baseline support.');
+ html += S.stepBox('#3b82f6',
+ '2. Simple face mask',
+ '6-10 L/min · FiO2 35-60%. Must keep flow >6 L/min to flush CO2. Tolerated less well than NC.');
+ html += S.stepBox('#8b5cf6',
+ '3. Non-rebreather mask',
+ '10-15 L/min · FiO2 60-90%. Reservoir bag must stay inflated. For severe hypoxia with intact breathing.');
+ html += S.stepBox('#f59e0b',
+ '4. High-flow nasal cannula (HFNC)',
+ '' + (wt ? '1-2 L/kg/min = ' + S.d(wt, 1) + '-' + S.d(wt, 2) + ' L/min' : '1-2 L/kg/min') + ' (max ~50-60 L/min adults) · heated + humidified · FiO2 30-100% titratable · generates ~2-5 cmH2O PEEP · works for bronchiolitis, early resp failure. Reassess at 1-2 h — no improvement → step up.');
+ html += S.stepBox('#ef4444',
+ '5. Non-invasive ventilation (CPAP / BiPAP)',
+ 'CPAP 5-10 cmH2O (pure PEEP) · BiPAP IPAP 10-14 / EPAP 5 (adds pressure support) · FiO2 as needed. Needs cooperative patient, intact airway reflexes, no copious secretions. Contraindicated: coma, apnea, unstable hemodynamics, facial trauma.');
+ html += S.stepBox('#dc2626',
+ '6. Intubate + mechanical ventilation',
+ 'When NIV fails, airway compromised, apnea, or GCS ≤8. See RSI under the Airway tab for drugs.');
+
+ // ── BVM how-to ──
+ html += '
Bag-Valve-Mask (BVM)
';
+ html += '
';
+ html += 'When: apnea, bradycardia (HR <60 in neonate; inadequate breathing at any age), during resuscitation. ';
+ html += 'Rate: Newborn 40-60 /min · Infant-child 20-30 /min · Adolescent 10-12 /min (1 breath q5-6 sec). ';
+ html += 'Tidal volume: 6-8 mL/kg — only enough to see gentle chest rise. Avoid over-ventilation (gastric distension, ↓venous return, lung injury). ';
+ html += 'Technique: head tilt / jaw thrust, proper mask seal (E-C grip or 2-thumb), squeeze 1 sec, release fully before next breath. Attach O2 at 10-15 L/min + reservoir. ';
+ html += 'If not ventilating: MR SOPA — Mask reseal, Reposition airway, Suction mouth+nose, Open mouth, Pressure ↑, Alternative airway (LMA or ETT).';
+ html += '