var vitalsCache = null; export function loadVitalsData() { if (vitalsCache) return Promise.resolve(vitalsCache); return fetch('/data/calculators/vitals.json', { credentials: 'same-origin' }) .then(function(response) { if (!response.ok) throw new Error('Failed to load vitals data'); return response.json(); }) .then(function(data) { vitalsCache = data.ageGroups || {}; return vitalsCache; }); } export function renderVitalsResult(v) { return '' + '
' + '
' + v.label + '
' + '
' + '
' + '
Heart Rate (awake)
' + v.hr.awake + '
bpm
' + '
Heart Rate (sleep)
' + v.hr.sleeping + '
bpm
' + '
Respiratory Rate
' + v.rr + '
breaths/min
' + '
Systolic BP
' + v.sbp + '
mmHg
' + '
Diastolic BP
' + v.dbp + '
mmHg
' + '
Temperature
' + v.temp + '
°C
' + '
SpO2
' + v.spo2 + '
' + '
Weight Range
' + v.weight + '
' + '
' + '
' + '
Clinical Notes
' + '' + '
'; }