diff --git a/public/data/calculators/vitals.json b/public/data/calculators/vitals.json new file mode 100644 index 0000000..530d0db --- /dev/null +++ b/public/data/calculators/vitals.json @@ -0,0 +1,141 @@ +{ + "version": "1.0", + "source": "Harriet Lane Handbook 23rd Edition reference values", + "ageGroups": { + "premie": { + "label": "Premie", + "hr": { "awake": "120-170", "sleeping": "100-150" }, + "rr": "40-70", + "sbp": "55-75", + "dbp": "35-45", + "temp": "36.5-37.5", + "weight": "0.5-2.5 kg", + "spo2": "88-95% (target)", + "notes": [ + "HR and RR are highly variable and depend on gestational age", + "BP increases with gestational age and postnatal age", + "Target SpO2 88-95% to reduce retinopathy of prematurity risk", + "Temperature instability is common - use servo-controlled warmers", + "Bradycardia (<100 bpm) and apnea are common in premature infants" + ] + }, + "0-3mo": { + "label": "0-3 Months", + "hr": { "awake": "100-150", "sleeping": "85-135" }, + "rr": "35-55", + "sbp": "65-85", + "dbp": "45-55", + "temp": "36.5-37.5", + "weight": "2.5-6 kg", + "spo2": ">95%", + "notes": [ + "HR normally increases with crying (up to 180-190 bpm) - this is physiologic", + "Periodic breathing (pauses <10 sec) is normal in neonates", + "Acrocyanosis (blue hands/feet) is normal; central cyanosis is not", + "BP is best measured in the right arm (pre-ductal) in neonates", + "Normal weight loss of 5-7% in first 3-5 days; regain by 10-14 days" + ] + }, + "3-6mo": { + "label": "3-6 Months", + "hr": { "awake": "90-120", "sleeping": "75-110" }, + "rr": "30-45", + "sbp": "70-90", + "dbp": "50-65", + "temp": "36.5-37.5", + "weight": "5-8 kg", + "spo2": ">95%", + "notes": [ + "Expected weight gain: 20-30 g/day (150-200 g/week)", + "HR gradually decreases as vagal tone matures", + "RR >60 at rest may indicate lower respiratory tract disease", + "BP should be measured with appropriate cuff size (width 40% of arm circumference)" + ] + }, + "6-12mo": { + "label": "6-12 Months", + "hr": { "awake": "80-120", "sleeping": "70-110" }, + "rr": "25-40", + "sbp": "80-100", + "dbp": "55-65", + "temp": "36.0-37.5", + "weight": "8-10 kg", + "spo2": ">95%", + "notes": [ + "Expected weight: triple birth weight by 12 months (~10 kg average)", + "Weight gain slows to ~10-15 g/day", + "Sinus arrhythmia (HR varies with breathing) is normal", + "Febrile tachycardia: HR increases ~10 bpm per 1 degree C above 37" + ] + }, + "1-3yr": { + "label": "1-3 Years", + "hr": { "awake": "70-110", "sleeping": "60-100" }, + "rr": "20-30", + "sbp": "90-105", + "dbp": "55-70", + "temp": "36.0-37.5", + "weight": "10-15 kg", + "spo2": ">95%", + "notes": [ + "Expected weight gain: ~200-250 g/month (2-2.5 kg/year)", + "Tachycardia: HR >110 at rest warrants evaluation", + "Tachypnea: RR >30 at rest may indicate respiratory distress", + "BP screening begins at age 3 per AAP 2017 guidelines", + "Estimated weight: 2 x (age in years) + 8" + ] + }, + "3-6yr": { + "label": "3-6 Years", + "hr": { "awake": "65-110", "sleeping": "55-100" }, + "rr": "20-25", + "sbp": "95-110", + "dbp": "60-75", + "temp": "36.0-37.5", + "weight": "14-20 kg", + "spo2": ">95%", + "notes": [ + "Annual BP screening recommended from age 3", + "Normal BP <90th percentile for age, sex, and height", + "Elevated BP: 90th to <95th percentile (or 120/80 if lower)", + "Estimated weight: 2 x (age in years) + 8", + "ETT size (uncuffed): (age/4) + 4" + ] + }, + "6-12yr": { + "label": "6-12 Years", + "hr": { "awake": "60-95", "sleeping": "50-85" }, + "rr": "14-22", + "sbp": "100-120", + "dbp": "60-75", + "temp": "36.0-37.5", + "weight": "20-40 kg", + "spo2": ">95%", + "notes": [ + "Resting HR >95 or <60 warrants evaluation", + "BP should be measured at every clinical encounter", + "Stage 1 HTN: >=95th percentile on 3 separate occasions", + "Estimated weight: 3 x (age in years) + 7", + "ETT size (cuffed): (age/4) + 3.5" + ] + }, + ">12yr": { + "label": ">12 Years", + "hr": { "awake": "55-85", "sleeping": "45-75" }, + "rr": "12-18", + "sbp": "110-135", + "dbp": "65-85", + "temp": "36.0-37.5", + "weight": "40-80 kg", + "spo2": ">95%", + "notes": [ + "Vital signs approach adult values", + "From age 13: use adult BP thresholds (AAP 2017)", + "Normal: <120/<80 mmHg; Elevated: 120-129/<80 mmHg", + "Stage 1 HTN: 130-139/80-89 mmHg; Stage 2 HTN: >=140/>=90 mmHg", + "Orthostatic vitals: measure lying, sitting, standing if dizzy", + "Athletic bradycardia (HR 45-60) may be normal in trained adolescents" + ] + } + } +} diff --git a/public/js/calculators.js b/public/js/calculators.js index 7af2296..93d140c 100644 --- a/public/js/calculators.js +++ b/public/js/calculators.js @@ -1,5 +1,6 @@ import { parseAgeMonths, formatParsedAge } from './calculators/age.js'; import { initImageLightbox } from './calculators/lightbox.js'; +import { loadVitalsData, renderVitalsResult } from './calculators/vitals.js'; // ============================================================ // CALCULATORS.JS — Pediatric clinical calculators @@ -1662,135 +1663,10 @@ initImageLightbox(); // Harriet Lane Handbook 23rd Edition reference values // ═══════════════════════════════════════════════════════════ - var VITALS_DATA = { - premie: { - label: 'Premie', - hr: { awake: '120-170', sleeping: '100-150' }, - rr: '40-70', - sbp: '55-75', dbp: '35-45', - temp: '36.5-37.5', - weight: '0.5-2.5 kg', - spo2: '88-95% (target)', - notes: [ - 'HR and RR are highly variable and depend on gestational age', - 'BP increases with gestational age and postnatal age', - 'Target SpO2 88-95% to reduce retinopathy of prematurity risk', - 'Temperature instability is common — use servo-controlled warmers', - 'Bradycardia (<100 bpm) and apnea are common in premature infants' - ] - }, - '0-3mo': { - label: '0-3 Months', - hr: { awake: '100-150', sleeping: '85-135' }, - rr: '35-55', - sbp: '65-85', dbp: '45-55', - temp: '36.5-37.5', - weight: '2.5-6 kg', - spo2: '>95%', - notes: [ - 'HR normally increases with crying (up to 180-190 bpm) — this is physiologic', - 'Periodic breathing (pauses <10 sec) is normal in neonates', - 'Acrocyanosis (blue hands/feet) is normal; central cyanosis is not', - 'BP is best measured in the right arm (pre-ductal) in neonates', - 'Normal weight loss of 5-7% in first 3-5 days; regain by 10-14 days' - ] - }, - '3-6mo': { - label: '3-6 Months', - hr: { awake: '90-120', sleeping: '75-110' }, - rr: '30-45', - sbp: '70-90', dbp: '50-65', - temp: '36.5-37.5', - weight: '5-8 kg', - spo2: '>95%', - notes: [ - 'Expected weight gain: 20-30 g/day (150-200 g/week)', - 'HR gradually decreases as vagal tone matures', - 'RR >60 at rest may indicate lower respiratory tract disease', - 'BP should be measured with appropriate cuff size (width 40% of arm circumference)' - ] - }, - '6-12mo': { - label: '6-12 Months', - hr: { awake: '80-120', sleeping: '70-110' }, - rr: '25-40', - sbp: '80-100', dbp: '55-65', - temp: '36.0-37.5', - weight: '8-10 kg', - spo2: '>95%', - notes: [ - 'Expected weight: triple birth weight by 12 months (~10 kg average)', - 'Weight gain slows to ~10-15 g/day', - 'Sinus arrhythmia (HR varies with breathing) is normal', - 'Febrile tachycardia: HR increases ~10 bpm per 1 degree C above 37' - ] - }, - '1-3yr': { - label: '1-3 Years', - hr: { awake: '70-110', sleeping: '60-100' }, - rr: '20-30', - sbp: '90-105', dbp: '55-70', - temp: '36.0-37.5', - weight: '10-15 kg', - spo2: '>95%', - notes: [ - 'Expected weight gain: ~200-250 g/month (2-2.5 kg/year)', - 'Tachycardia: HR >110 at rest warrants evaluation', - 'Tachypnea: RR >30 at rest may indicate respiratory distress', - 'BP screening begins at age 3 per AAP 2017 guidelines', - 'Estimated weight: 2 x (age in years) + 8' - ] - }, - '3-6yr': { - label: '3-6 Years', - hr: { awake: '65-110', sleeping: '55-100' }, - rr: '20-25', - sbp: '95-110', dbp: '60-75', - temp: '36.0-37.5', - weight: '14-20 kg', - spo2: '>95%', - notes: [ - 'Annual BP screening recommended from age 3', - 'Normal BP <90th percentile for age, sex, and height', - 'Elevated BP: 90th to <95th percentile (or 120/80 if lower)', - 'Estimated weight: 2 x (age in years) + 8', - 'ETT size (uncuffed): (age/4) + 4' - ] - }, - '6-12yr': { - label: '6-12 Years', - hr: { awake: '60-95', sleeping: '50-85' }, - rr: '14-22', - sbp: '100-120', dbp: '60-75', - temp: '36.0-37.5', - weight: '20-40 kg', - spo2: '>95%', - notes: [ - 'Resting HR >95 or <60 warrants evaluation', - 'BP should be measured at every clinical encounter', - 'Stage 1 HTN: >=95th percentile on 3 separate occasions', - 'Estimated weight: 3 x (age in years) + 7', - 'ETT size (cuffed): (age/4) + 3.5' - ] - }, - '>12yr': { - label: '>12 Years', - hr: { awake: '55-85', sleeping: '45-75' }, - rr: '12-18', - sbp: '110-135', dbp: '65-85', - temp: '36.0-37.5', - weight: '40-80 kg', - spo2: '>95%', - notes: [ - 'Vital signs approach adult values', - 'From age 13: use adult BP thresholds (AAP 2017)', - 'Normal: <120/<80 mmHg; Elevated: 120-129/<80 mmHg', - 'Stage 1 HTN: 130-139/80-89 mmHg; Stage 2 HTN: >=140/>=90 mmHg', - 'Orthostatic vitals: measure lying, sitting, standing if dizzy', - 'Athletic bradycardia (HR 45-60) may be normal in trained adolescents' - ] - } - }; + var VITALS_DATA = {}; + loadVitalsData() + .then(function(data) { VITALS_DATA = data; }) + .catch(function(err) { console.warn('[calculators] Vitals data unavailable:', err && err.message); }); // Use event delegation on the vitals panel so the listener works even // when the panel is hidden at init time (hidden elements are still in the DOM, @@ -1805,26 +1681,7 @@ initImageLightbox(); var v = VITALS_DATA[key]; resultDiv.classList.remove('hidden'); - resultDiv.innerHTML = - '