Add Glasgow Coma Scale calculator and equipment sizing reference
Some checks failed
Build TWA APK / build-apk (push) Has been cancelled
Build & Push Docker Image / build (push) Has been cancelled

GCS Calculator:
- Child/Adult and Infant versions with toggle
- Eye opening (4), Verbal (5), Motor (6) dropdowns
- Auto-calculates total score with severity classification
  (Mild 13-15, Moderate 9-12, Severe/Coma 3-8)
- Infant-modified verbal and motor scales per Kids Kard
- Updates on every dropdown change (no button needed)

Equipment Sizing (Johns Hopkins Kids Kard):
- Select age/weight group (premie through 16+)
- Shows: BVM, oral/nasal airway, blade, ETT, LMA, Glidescope,
  IV catheter, central line, NGT/OGT, chest tube, Foley
- All values from Johns Hopkins Children's Center Kids Kard
- ETT formulas shown as reference
This commit is contained in:
Daniel 2026-04-11 05:01:57 +02:00
parent 6daf08982e
commit 6ed2778a12
2 changed files with 279 additions and 0 deletions

View file

@ -13,6 +13,8 @@
<button class="calc-nav-pill" data-calc="bsa">Body Surface Area</button>
<button class="calc-nav-pill" data-calc="dose">Weight-Based Dosing</button>
<button class="calc-nav-pill" data-calc="resus">Resus Meds</button>
<button class="calc-nav-pill" data-calc="gcs">GCS</button>
<button class="calc-nav-pill" data-calc="equipment">Equipment</button>
</div>
<!-- ═══════════ BP PERCENTILE CALCULATOR ═══════════ -->
@ -517,3 +519,120 @@
</div>
</div>
</div>
<!-- ═══════════ GLASGOW COMA SCALE ═══════════ -->
<div id="calc-gcs" class="calc-panel hidden">
<div class="card">
<div class="card-header">
<h3><i class="fas fa-brain"></i> Glasgow Coma Scale</h3>
<span style="font-size:11px;color:var(--g500);">Child/Adult and Infant versions</span>
</div>
<div style="padding:16px;">
<p style="font-size:12px;color:var(--g500);margin:0 0 14px;">Select responses to calculate GCS. Total score 3-15. Source: Johns Hopkins Kids Kard.</p>
<div style="display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px;">
<button class="calc-pill active" data-gcs="child">Child / Adult</button>
<button class="calc-pill" data-gcs="infant">Infant</button>
</div>
<!-- Child/Adult GCS -->
<div id="gcs-child-panel">
<div class="calc-field" style="margin-bottom:12px;">
<label>Eye Opening</label>
<select id="gcs-child-eye">
<option value="4">4 — Spontaneous</option>
<option value="3">3 — To speech</option>
<option value="2">2 — To pain</option>
<option value="1">1 — None</option>
</select>
</div>
<div class="calc-field" style="margin-bottom:12px;">
<label>Verbal Response</label>
<select id="gcs-child-verbal">
<option value="5">5 — Oriented</option>
<option value="4">4 — Confused</option>
<option value="3">3 — Inappropriate words</option>
<option value="2">2 — Incomprehensible sounds</option>
<option value="1">1 — None</option>
</select>
</div>
<div class="calc-field" style="margin-bottom:12px;">
<label>Motor Response</label>
<select id="gcs-child-motor">
<option value="6">6 — Obeys commands</option>
<option value="5">5 — Localizes pain</option>
<option value="4">4 — Withdraws to pain</option>
<option value="3">3 — Abnormal flexion (decorticate)</option>
<option value="2">2 — Abnormal extension (decerebrate)</option>
<option value="1">1 — None (flaccid)</option>
</select>
</div>
</div>
<!-- Infant GCS -->
<div id="gcs-infant-panel" style="display:none;">
<div class="calc-field" style="margin-bottom:12px;">
<label>Eye Opening</label>
<select id="gcs-infant-eye">
<option value="4">4 — Spontaneous</option>
<option value="3">3 — To speech/sound</option>
<option value="2">2 — To painful stimuli</option>
<option value="1">1 — None</option>
</select>
</div>
<div class="calc-field" style="margin-bottom:12px;">
<label>Verbal Response</label>
<select id="gcs-infant-verbal">
<option value="5">5 — Coos/babbles</option>
<option value="4">4 — Irritable cry</option>
<option value="3">3 — Cries to pain</option>
<option value="2">2 — Moans to pain</option>
<option value="1">1 — None</option>
</select>
</div>
<div class="calc-field" style="margin-bottom:12px;">
<label>Motor Response</label>
<select id="gcs-infant-motor">
<option value="6">6 — Normal spontaneous movement</option>
<option value="5">5 — Withdraws to touch</option>
<option value="4">4 — Withdraws to pain</option>
<option value="3">3 — Abnormal flexion (decorticate)</option>
<option value="2">2 — Abnormal extension (decerebrate)</option>
<option value="1">1 — None (flaccid)</option>
</select>
</div>
</div>
<div id="gcs-result" class="calc-result"></div>
</div>
</div>
</div>
<!-- ═══════════ EQUIPMENT SIZING ═══════════ -->
<div id="calc-equipment" class="calc-panel hidden">
<div class="card">
<div class="card-header">
<h3><i class="fas fa-lungs"></i> Pediatric Equipment Sizing</h3>
<span style="font-size:11px;color:var(--g500);">Johns Hopkins Kids Kard</span>
</div>
<div style="padding:16px;">
<p style="font-size:12px;color:var(--g500);margin:0 0 14px;">Select age/weight group to view recommended equipment sizes.</p>
<div class="calc-field" style="max-width:300px;margin-bottom:16px;">
<label>Age / Weight Group</label>
<select id="equip-age-select">
<option value="">Select</option>
<option value="premie">Premie (1-3 kg)</option>
<option value="newborn">Newborn (2-4 kg)</option>
<option value="6mo">6 months (6-8 kg)</option>
<option value="1yr">1 year (10 kg)</option>
<option value="2-3yr">2-3 years (12-16 kg)</option>
<option value="4-6yr">4-6 years (20-25 kg)</option>
<option value="7-10yr">7-10 years (25-35 kg)</option>
<option value="11-15yr">11-15 years (40-50 kg)</option>
<option value="16yr">16+ years (>50 kg)</option>
</select>
</div>
<div id="equip-result" class="hidden"></div>
</div>
</div>
</div>

View file

@ -1838,5 +1838,165 @@
resultDiv.classList.remove('hidden');
});
}
// ═══════════════════════════════════════════════════════════
// GLASGOW COMA SCALE
// ═══════════════════════════════════════════════════════════
// GCS sub-pill navigation
var gcsPanel = document.getElementById('calc-gcs');
if (gcsPanel) {
gcsPanel.addEventListener('click', function(e) {
var pill = e.target.closest('[data-gcs]');
if (!pill) return;
gcsPanel.querySelectorAll('[data-gcs]').forEach(function(p) { p.classList.remove('active'); });
pill.classList.add('active');
var isInfant = pill.dataset.gcs === 'infant';
var childP = document.getElementById('gcs-child-panel');
var infantP = document.getElementById('gcs-infant-panel');
if (childP) childP.style.display = isInfant ? 'none' : '';
if (infantP) infantP.style.display = isInfant ? '' : 'none';
updateGCS();
});
gcsPanel.addEventListener('change', function(e) {
if (e.target.tagName === 'SELECT') updateGCS();
});
}
function updateGCS() {
var isInfant = document.querySelector('[data-gcs="infant"].active') !== null;
var prefix = isInfant ? 'gcs-infant' : 'gcs-child';
var eye = parseInt(document.getElementById(prefix + '-eye').value) || 0;
var verbal = parseInt(document.getElementById(prefix + '-verbal').value) || 0;
var motor = parseInt(document.getElementById(prefix + '-motor').value) || 0;
var total = eye + verbal + motor;
var severity, color, bg;
if (total <= 8) { severity = 'Severe (Coma)'; color = '#ef4444'; bg = '#fee2e2'; }
else if (total <= 12) { severity = 'Moderate'; color = '#f59e0b'; bg = '#fef3c7'; }
else { severity = 'Mild'; color = '#10b981'; bg = '#d1fae5'; }
var resultDiv = document.getElementById('gcs-result');
if (resultDiv) {
resultDiv.innerHTML =
'<div class="calc-result-header" style="background:' + bg + ';border-color:' + color + ';">' +
'<div style="font-size:24px;font-weight:700;color:' + color + ';">GCS: ' + total + '/15</div>' +
'<div style="font-size:14px;color:var(--g600);margin-top:4px;">' + severity + '</div>' +
'</div>' +
'<div class="calc-result-grid" style="margin-top:12px;">' +
'<div class="calc-result-item"><div class="calc-result-label">Eye (E)</div><div class="calc-result-value">' + eye + '</div></div>' +
'<div class="calc-result-item"><div class="calc-result-label">Verbal (V)</div><div class="calc-result-value">' + verbal + '</div></div>' +
'<div class="calc-result-item"><div class="calc-result-label">Motor (M)</div><div class="calc-result-value">' + motor + '</div></div>' +
'</div>' +
'<div style="margin-top:12px;font-size:12px;color:var(--g500);">' +
'<strong>Interpretation:</strong> 13-15 Mild, 9-12 Moderate, 3-8 Severe/Coma. ' +
'Intubation typically considered at GCS &le; 8. ' +
(isInfant ? 'Using infant-modified verbal and motor scales.' : '') +
'</div>';
}
}
// Initial GCS render
setTimeout(updateGCS, 200);
// ═══════════════════════════════════════════════════════════
// EQUIPMENT SIZING — Johns Hopkins Kids Kard
// ═══════════════════════════════════════════════════════════
var EQUIP_DATA = {
premie: {
label: 'Premie (1-3 kg)',
bvm: 'Infant', nasal: '12 Fr', oral: 'Infant', blade: 'Miller 0',
ett: '2.5-3.0', lma: '1', glidescope: '1',
iv: '22-24 ga', cvl: '3 Fr', ngt: '5 Fr', chest: '10-12 Fr', foley: '6 Fr'
},
newborn: {
label: 'Newborn (2-4 kg)',
bvm: 'Infant', nasal: '14-16 Fr', oral: 'Small 50 mm', blade: 'Miller 0',
ett: '3.0-3.5', lma: '1', glidescope: '1',
iv: '22-24 ga', cvl: '3-4 Fr', ngt: '5-8 Fr', chest: '10-12 Fr', foley: '6 Fr'
},
'6mo': {
label: '6 months (6-8 kg)',
bvm: 'Infant', nasal: '14-16 Fr', oral: 'Small 60 mm', blade: 'Miller 1',
ett: '3.5', lma: '1.5', glidescope: '2',
iv: '20-24 ga', cvl: '4 Fr', ngt: '8 Fr', chest: '12-18 Fr', foley: '8 Fr'
},
'1yr': {
label: '1 year (10 kg)',
bvm: 'Small child', nasal: '14-18 Fr', oral: 'Small 60 mm', blade: 'Miller 1 / MAC 2',
ett: '4.0', lma: '2', glidescope: '2',
iv: '20-24 ga', cvl: '4-5 Fr', ngt: '10 Fr', chest: '16-20 Fr', foley: '8 Fr'
},
'2-3yr': {
label: '2-3 years (12-16 kg)',
bvm: 'Small child', nasal: '14-18 Fr', oral: 'Small 70 mm', blade: 'Miller 1 / MAC 2',
ett: '4.0-4.5', lma: '2', glidescope: '2',
iv: '18-22 ga', cvl: '4-5 Fr', ngt: '10-12 Fr', chest: '16-24 Fr', foley: '8 Fr'
},
'4-6yr': {
label: '4-6 years (20-25 kg)',
bvm: 'Child', nasal: '16-20 Fr', oral: 'Small 70-80 mm', blade: 'Miller 2 / MAC 2',
ett: '4.5-5.0', lma: '2.5', glidescope: '3',
iv: '18-22 ga', cvl: '5 Fr', ngt: '12-14 Fr', chest: '20-28 Fr', foley: '8 Fr'
},
'7-10yr': {
label: '7-10 years (25-35 kg)',
bvm: 'Child / Small adult', nasal: '18-22 Fr', oral: 'Medium 80-90 mm', blade: 'Miller 2 / MAC 2',
ett: '5.5-6.0', lma: '2.5-3', glidescope: '3',
iv: '18-22 ga', cvl: '5 Fr', ngt: '12-14 Fr', chest: '20-32 Fr', foley: '8 Fr'
},
'11-15yr': {
label: '11-15 years (40-50 kg)',
bvm: 'Adult', nasal: '22-36 Fr', oral: 'Medium 90 mm', blade: 'Miller 2 / MAC 3',
ett: '6.0-6.5', lma: '3', glidescope: '3 or 4',
iv: '18-20 ga', cvl: '7 Fr', ngt: '14-18 Fr', chest: '28-38 Fr', foley: '10 Fr'
},
'16yr': {
label: '16+ years (>50 kg)',
bvm: 'Adult', nasal: '22-36 Fr', oral: 'Medium 90 mm', blade: 'Miller 2 / MAC 3',
ett: '7.0-8.0', lma: '4', glidescope: '3 or 4',
iv: '18-20 ga', cvl: '7 Fr', ngt: '14-18 Fr', chest: '28-42 Fr', foley: '12 Fr'
}
};
var equipPanel = document.getElementById('calc-equipment');
if (equipPanel) {
equipPanel.addEventListener('change', function(e) {
if (e.target.id !== 'equip-age-select') return;
var key = e.target.value;
var resultDiv = document.getElementById('equip-result');
if (!key || !EQUIP_DATA[key]) { resultDiv.classList.add('hidden'); return; }
var eq = EQUIP_DATA[key];
resultDiv.classList.remove('hidden');
resultDiv.innerHTML =
'<div class="calc-result-header" style="background:#eff6ff;border-color:#2563eb;">' +
'<div style="font-size:18px;font-weight:700;color:#1d4ed8;">' + eq.label + '</div>' +
'</div>' +
'<div style="margin-top:12px;overflow-x:auto;">' +
'<table class="admin-table" style="font-size:13px;width:100%;">' +
'<tbody>' +
'<tr><td style="font-weight:600;width:40%;">Bag-Valve Mask</td><td>' + eq.bvm + '</td></tr>' +
'<tr><td style="font-weight:600;">Oral Airway</td><td>' + eq.oral + '</td></tr>' +
'<tr><td style="font-weight:600;">Nasal Airway</td><td>' + eq.nasal + '</td></tr>' +
'<tr><td style="font-weight:600;">Laryngoscope Blade</td><td>' + eq.blade + '</td></tr>' +
'<tr><td style="font-weight:600;">ETT Size</td><td>' + eq.ett + '</td></tr>' +
'<tr><td style="font-weight:600;">LMA Size</td><td>' + eq.lma + '</td></tr>' +
'<tr><td style="font-weight:600;">Glidescope</td><td>' + eq.glidescope + '</td></tr>' +
'<tr><td style="font-weight:600;">IV Catheter</td><td>' + eq.iv + '</td></tr>' +
'<tr><td style="font-weight:600;">Central Line</td><td>' + eq.cvl + '</td></tr>' +
'<tr><td style="font-weight:600;">NGT / OGT</td><td>' + eq.ngt + '</td></tr>' +
'<tr><td style="font-weight:600;">Chest Tube</td><td>' + eq.chest + '</td></tr>' +
'<tr><td style="font-weight:600;">Foley Catheter</td><td>' + eq.foley + '</td></tr>' +
'</tbody>' +
'</table>' +
'</div>' +
'<div style="margin-top:10px;font-size:11px;color:var(--g400);">' +
'<strong>ETT Formulas:</strong> Uncuffed = (age/4)+4, Cuffed = (age/4)+3, Depth = ETT size x 3. ' +
'Source: Johns Hopkins Kids Kard.' +
'</div>';
});
}
}
})();