Generate a ppt for all shock management pathophysiology and management and all and same for sepsis DKA and hypertention in one ppt
ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"
mkdir -p /home/daytona/workspace/critical-care-ppt && echo "done"
~/critical-care-ppt/build.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE";
pres.title = "Critical Care Medicine: Shock, Sepsis, DKA & Hypertension";
pres.author = "Orris Medical Education";
// ─── THEME COLOURS ───────────────────────────────────────────────────────────
const C = {
navyDark: "0A1628", // slide backgrounds (dark sections)
navy: "122347", // header bars
teal: "00B4D8", // accent / highlight
tealDark: "0077A8",
amber: "F4A261", // shock accent
red: "E63946", // sepsis accent
green: "2DC653", // DKA accent
purple: "7B2D8B", // hypertension accent
purpleLight:"A855F7",
white: "FFFFFF",
lightGray: "E8EDF4",
midGray: "8899AA",
cardBg: "162C4A",
};
// ─── HELPERS ─────────────────────────────────────────────────────────────────
function darkSlide(slide) {
slide.background = { color: C.navyDark };
}
function addHeader(slide, title, accent) {
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 0.7, fill: { color: C.navy }, line: { color: C.navy } });
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.7, w: 13.3, h: 0.04, fill: { color: accent }, line: { color: accent } });
slide.addText(title, { x: 0.35, y: 0.05, w: 12.6, h: 0.6, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
}
function card(slide, x, y, w, h, heading, bullets, accent, bgColor) {
const bg = bgColor || C.cardBg;
slide.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: bg }, line: { color: accent, pt: 1.5 }, rectRadius: 0.08 });
slide.addText(heading, { x: x + 0.12, y: y + 0.08, w: w - 0.24, h: 0.36, fontSize: 13, bold: true, color: accent, fontFace: "Calibri", valign: "top", margin: 0 });
const items = bullets.map((b, i) => ({
text: b,
options: { bullet: { indent: 12 }, breakLine: i < bullets.length - 1, fontSize: 10.5, color: C.lightGray, fontFace: "Calibri" }
}));
slide.addText(items, { x: x + 0.12, y: y + 0.48, w: w - 0.24, h: h - 0.58, valign: "top", margin: 0 });
}
function sectionDivider(title, subtitle, accent) {
const s = pres.addSlide();
s.background = { color: C.navyDark };
// big accent bar left
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.5, h: 7.5, fill: { color: accent }, line: { color: accent } });
s.addText(title, { x: 0.8, y: 2.4, w: 11.8, h: 1.3, fontSize: 48, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });
s.addText(subtitle, { x: 0.8, y: 3.75, w: 11.8, h: 0.7, fontSize: 20, color: accent, fontFace: "Calibri", valign: "top" });
// decorative dots
for (let i = 0; i < 6; i++) {
s.addShape(pres.ShapeType.ellipse, { x: 11.5 + (i % 3) * 0.55, y: 5.5 + Math.floor(i / 3) * 0.55, w: 0.3, h: 0.3, fill: { color: accent, transparency: 60 }, line: { color: accent, transparency: 60 } });
}
return s;
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE SLIDE
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.navyDark };
// gradient bar top
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 1.2, fill: { color: C.navy }, line: { color: C.navy } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 1.2, w: 13.3, h: 0.06, fill: { color: C.teal }, line: { color: C.teal } });
// topic pills
const topics = [
{ label: "SHOCK", color: C.amber, x: 1.1 },
{ label: "SEPSIS", color: C.red, x: 4.1 },
{ label: "DKA", color: C.green, x: 7.1 },
{ label: "HYPERTENSION", color: C.purpleLight, x: 9.5 },
];
topics.forEach(t => {
s.addShape(pres.ShapeType.roundRect, { x: t.x, y: 1.55, w: t.label === "HYPERTENSION" ? 2.9 : 1.8, h: 0.45, fill: { color: t.color }, line: { color: t.color }, rectRadius: 0.08 });
s.addText(t.label, { x: t.x, y: 1.55, w: t.label === "HYPERTENSION" ? 2.9 : 1.8, h: 0.45, fontSize: 13, bold: true, color: C.navyDark, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
});
s.addText("Critical Care Medicine", { x: 0.5, y: 2.3, w: 12.3, h: 1.0, fontSize: 44, bold: true, color: C.white, fontFace: "Calibri", align: "center" });
s.addText("Pathophysiology & Management", { x: 0.5, y: 3.3, w: 12.3, h: 0.65, fontSize: 26, color: C.teal, fontFace: "Calibri", align: "center" });
s.addText("Shock | Sepsis | Diabetic Ketoacidosis | Hypertensive Emergency", { x: 0.5, y: 4.15, w: 12.3, h: 0.5, fontSize: 15, color: C.midGray, fontFace: "Calibri", align: "center" });
// bottom bar
s.addShape(pres.ShapeType.rect, { x: 0, y: 7.1, w: 13.3, h: 0.4, fill: { color: C.navy }, line: { color: C.navy } });
s.addText("Sources: Harrison's Principles of Internal Medicine 22E · Fuster & Hurst's The Heart 15E · Rosen's Emergency Medicine · WHO / Surviving Sepsis Campaign Guidelines", {
x: 0.3, y: 7.12, w: 12.7, h: 0.34, fontSize: 8, color: C.midGray, fontFace: "Calibri", align: "center", valign: "middle", margin: 0
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SECTION 1 – SHOCK
// ═══════════════════════════════════════════════════════════════════════════════
sectionDivider("SHOCK", "Pathophysiology · Classification · Assessment · Management", C.amber);
// SLIDE: Shock – Definition & Overview
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "SHOCK — Definition & Overview", C.amber);
s.addText("Shock is defined as a state of life-threatening circulatory failure resulting in inadequate oxygen delivery relative to tissue demand, leading to cellular dysfunction and, if untreated, organ failure and death.", {
x: 0.35, y: 0.85, w: 12.6, h: 0.75, fontSize: 13, color: C.lightGray, fontFace: "Calibri", italic: true
});
card(s, 0.25, 1.65, 3.9, 2.35, "Hypovolemic", ["• Hemorrhagic (trauma, GI bleed)", "• Non-hemorrhagic (burns, vomiting,", " diarrhea, 3rd-spacing)", "• ↓ Preload → ↓ CO → hypoperfusion"], C.amber);
card(s, 4.45, 1.65, 3.9, 2.35, "Distributive", ["• Septic (most common)", "• Anaphylactic", "• Neurogenic", "• Abnormal vasodilation → ↓ SVR → maldistribution"], C.red);
card(s, 8.65, 1.65, 4.35, 2.35, "Cardiogenic & Obstructive", ["Cardiogenic: pump failure (AMI, cardiomyopathy)", "• ↑ LVEDP, ↓ BP, inflammatory cascade", "Obstructive: mechanical blockage", "• PE, tamponade, tension pneumothorax"], C.teal);
card(s, 0.25, 4.15, 6.1, 2.85, "Pathophysiology – Common Pathway", [
"1. Reduced oxygen delivery (DO₂ = CO × CaO₂)",
"2. Tissues switch to anaerobic metabolism → lactic acidosis",
"3. Compensatory SNS activation → tachycardia, vasoconstriction",
"4. RAAS activation → Na⁺/H₂O retention",
"5. Uncompensated shock → MODS → death",
"Key lab: Serum lactate ≥2 mmol/L = hypoperfusion"
], C.amber);
card(s, 6.65, 4.15, 6.3, 2.85, "Clinical Recognition", [
"Hypotension: SBP <90 mmHg or MAP <65 mmHg",
"Tachycardia, tachypnea, altered mentation",
"Cool clammy skin (cardiogenic/hypovolemic)",
"Warm skin + wide pulse pressure (distributive)",
"Oliguria (<0.5 mL/kg/hr)",
"Elevated lactate, base deficit on ABG"
], C.teal);
}
// SLIDE: Cardiogenic Shock – Pathophysiology & Management (Harrison's + Fuster)
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "CARDIOGENIC SHOCK — Pathophysiology & Management", C.amber);
card(s, 0.25, 0.85, 5.85, 3.1, "Pathophysiology (Fuster & Hurst's The Heart, 15E)", [
"Acute ↓ CO triggers maladaptive compensatory cycle:",
"1. ↑ LVEDP → pulmonary congestion → hypoxia",
"2. ↓ BP → reflex vasoconstriction → ↑ afterload",
"3. Systemic inflammatory response amplifies injury",
"Classification:",
"• LV failure (most common – coronary ischaemia)",
"• RV failure (massive/submassive PE)",
"• Biventricular failure (structural, electrical)",
"Uninterrupted cycle → progressive dysfunction → death"
], C.amber);
card(s, 6.45, 0.85, 6.6, 3.1, "Management Goals", [
"Reduce ventricular afterload",
"Optimise preload",
"Augment cardiac contractility",
"Maintain MAP ≥65 mmHg for organ perfusion",
"Vasopressors + inotropes: backbone of therapy",
"• Norepinephrine (first-line vasopressor)",
"• Dobutamine (inotrope of choice)",
"AMI-related: urgent coronary revascularisation (PCI)",
"Antithrombotic therapy essential",
"MCS: IABP, Impella, VA-ECMO in refractory shock"
], C.amber);
card(s, 0.25, 4.1, 4.0, 2.8, "Assessment", [
"Physical exam (cold/clammy, S3 gallop, JVD)",
"Point-of-care ultrasound (LV/RV function)",
"Serum lactate (tissue hypoperfusion marker)",
"Invasive haemodynamics: Swan-Ganz catheter",
"• CI <2.2 L/min/m² + PCWP >18 mmHg",
"Coronary angiography if AMI suspected"
], C.tealDark);
card(s, 4.55, 4.1, 4.0, 2.8, "Haemodynamic Profile", [
"↓ Cardiac Index (<2.2 L/min/m²)",
"↑ PCWP (>18 mmHg)",
"↑ SVR (>1200 dyn·s/cm⁵)",
"↓ SvO₂ (<60%)",
"↑ Serum lactate",
"Distinguish from RV failure: ↑ CVP, normal/↓ PCWP"
], C.tealDark);
card(s, 8.85, 4.1, 4.2, 2.8, "Prognosis & Escalation", [
"In-hospital mortality: 40–50%",
"SCAI shock stage classification (A–E) guides therapy",
"Stage D/E: consider MCS or palliative care",
"Multidisciplinary shock team approach recommended",
"Early revascularisation remains best intervention"
], C.amber);
}
// SLIDE: Hypovolemic & Distributive Shock Management
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "HYPOVOLEMIC & DISTRIBUTIVE SHOCK — Management", C.amber);
card(s, 0.25, 0.85, 6.1, 3.3, "Hypovolemic Shock", [
"IMMEDIATE: haemorrhage control (direct pressure, tourniquet)",
"IV access × 2 large-bore; send type & cross",
"Fluid resuscitation:",
"• Haemorrhagic: 1:1:1 pRBC:FFP:platelets (MTP)",
"• Non-haemorrhagic: crystalloid (0.9% NaCl or LR) 500 mL bolus",
"Avoid over-resuscitation (coagulopathy, abdominal compartment)",
"Permissive hypotension SBP 80–90 in penetrating trauma",
"Vasopressors only if inadequate response to volume",
"Surgical intervention for ongoing haemorrhage",
"Monitor: urine output, lactate clearance, BP, HR"
], C.amber);
card(s, 6.65, 0.85, 6.3, 3.3, "Distributive / Anaphylactic Shock", [
"ANAPHYLAXIS (first-line = ADRENALINE):",
"• IM Epinephrine 0.5 mg (1:1000) anterolateral thigh STAT",
"• Repeat q5–15 min if needed",
"• IV fluids: 1–2 L NS rapidly",
"• Antihistamines (H1 + H2), corticosteroids adjuncts",
"• Nebulised salbutamol for bronchospasm",
"NEUROGENIC SHOCK:",
"• Spinal immobilisation, avoid secondary cord injury",
"• IV fluids + vasopressors (phenylephrine or norepinephrine)",
"• Target MAP ≥85 mmHg for 7 days post-SCI"
], C.red);
card(s, 0.25, 4.3, 12.8, 2.5, "Monitoring Targets for All Shock States", [
"MAP ≥65 mmHg | Urine output ≥0.5 mL/kg/hr | Lactate clearance ≥10% per 2 hrs | ScvO₂ ≥70% | CVP 8–12 mmHg (fluid-responsive state)",
"Reassess haemodynamics every 15–30 min in acute phase | Dynamic fluid responsiveness testing: PLR, pulse-pressure variation | Avoid fluid overload – associated with worse outcomes"
], C.teal);
}
// ═══════════════════════════════════════════════════════════════════════════════
// SECTION 2 – SEPSIS
// ═══════════════════════════════════════════════════════════════════════════════
sectionDivider("SEPSIS", "Definitions · Pathophysiology · Surviving Sepsis Bundle · Management", C.red);
// SLIDE: Sepsis Definitions & Recognition
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "SEPSIS — Definitions & Recognition (Sepsis-3, 2016)", C.red);
card(s, 0.25, 0.85, 4.0, 3.15, "Sepsis-3 Definitions", [
"Sepsis: Life-threatening organ dysfunction caused",
"by dysregulated host response to infection",
"Criteria: Suspected infection + SOFA ↑ ≥2",
"",
"Septic Shock:",
"Sepsis + vasopressors required to maintain",
"MAP >65 mmHg AND lactate >2 mmol/L",
"despite adequate fluid resuscitation",
"",
"qSOFA (rapid bedside screen): ≥2 of:",
"• RR ≥22/min, AMS, SBP ≤100 mmHg"
], C.red);
card(s, 4.6, 0.85, 4.35, 3.15, "Pathophysiology", [
"PAMPs/DAMPs activate innate immunity",
"→ systemic cytokine storm (TNF-α, IL-1, IL-6)",
"→ systemic vasodilation + ↓ SVR",
"→ vascular leakage + interstitial oedema",
"→ myocardial depression (↓ EF)",
"→ microcirculatory dysfunction",
"→ mitochondrial dysfunction (cytopathic hypoxia)",
"→ MODS (kidneys, liver, lungs, brain, heart)",
"ROS/RNS cause direct cellular protein/DNA damage"
], C.red);
card(s, 9.3, 0.85, 3.75, 3.15, "Diagnostic Workup", [
"CBC with differential",
"BMP, LFTs, coagulation",
"Serum lactate (↑ >2 = hypoperfusion)",
"Blood cultures × 2 BEFORE antibiotics",
"Urine C&S, sputum if applicable",
"CXR / CT / USS (source identification)",
"Procalcitonin (de-escalation guidance)",
"Rule out mimics: heart failure, vasculitis,",
"mesenteric ischaemia, adrenal insufficiency"
], C.teal);
card(s, 0.25, 4.15, 12.8, 2.65, "SOFA Score Components (organ dysfunction)", [
"Respiration: PaO₂/FiO₂ ratio | Coagulation: Platelets | Liver: Bilirubin | Cardiovascular: MAP / vasopressor requirement",
"CNS: Glasgow Coma Scale | Renal: Creatinine / urine output",
"Score 0–24; ↑ SOFA ≥2 from baseline = organ dysfunction; mortality risk rises sharply with score >10"
], C.red);
}
// SLIDE: Sepsis Management – Surviving Sepsis Campaign Hour-1 Bundle
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "SEPSIS — Hour-1 Bundle & Initial Management (SSC 2021)", C.red);
const bundle = [
{ x: 0.25, y: 0.85, heading: "1. Measure Lactate", bullets: ["Serum lactate ASAP", "Remeasure if initial >2 mmol/L", "Target: clearance ≥10% per 2 hours", "Lactate >4 mmol/L = high mortality"], color: C.red },
{ x: 3.55, y: 0.85, heading: "2. Blood Cultures", bullets: ["≥2 sets BEFORE antibiotics", "Aerobic + anaerobic bottles", "Do NOT delay antibiotics >45 min", "Fungal cultures if immunocompromised"], color: C.red },
{ x: 6.85, y: 0.85, heading: "3. Broad-Spectrum ABx", bullets: ["Within 1 hour of recognition", "Cover likely source & local resistance", "CAP: β-lactam + macrolide/FQ", "HAP/VAP: vancomycin + pip-tazo/carbapenem"], color: C.red },
{ x: 10.15, y: 0.85, heading: "4. Fluid Resuscitation", bullets: ["30 mL/kg IV crystalloid", "Balanced crystalloids preferred (LR)", "Reassess with dynamic measures", "Avoid over-resuscitation (FACTT trial)"], color: C.amber },
{ x: 0.25, y: 3.6, heading: "5. Vasopressors", bullets: ["If MAP <65 mmHg despite fluids", "Norepinephrine: FIRST-LINE", "Vasopressin add-on (↑ NE to 0.25–0.5)", "Dopamine: only if low AF risk"], color: C.amber },
{ x: 3.55, y: 3.6, heading: "6. Corticosteroids", bullets: ["Hydrocortisone 200 mg/day IV", "Only if refractory shock (NE >0.25 μg/kg/min)", "Improves MAP, reduces vasopressor days", "Do NOT use for sepsis without shock"], color: C.amber },
{ x: 6.85, y: 3.6, heading: "7. Source Control", bullets: ["Identify & remove infectious focus", "Drain abscesses, remove infected lines", "Surgical consultation when needed", "Timing: within 6–12 hours of recognition"], color: C.teal },
{ x: 10.15, y: 3.6, heading: "8. Supportive Care", bullets: ["Lung-protective ventilation (ARDS)", "Glucose control 140–180 mg/dL", "DVT prophylaxis", "Stress ulcer prophylaxis"], color: C.teal },
];
bundle.forEach(b => {
card(s, b.x, b.y, 3.0, 2.6, b.heading, b.bullets, b.color);
});
}
// SLIDE: Antibiotic Selection by Source
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "SEPSIS — Empiric Antibiotic Selection by Source (Harrison's 22E)", C.red);
const abx = [
{ site: "Community-Acquired Pneumonia", rx: "β-lactam (ceftriaxone) + macrolide (azithromycin)\nOR respiratory fluoroquinolone (levofloxacin)", note: "Add anti-MRSA/Pseudomonal coverage if risk factors present", col: C.red },
{ site: "Hospital / Ventilator Pneumonia", rx: "Vancomycin or linezolid +\nPip-tazo OR cefepime OR meropenem", note: "Consider carbapenem-resistant organisms if prior IV antibiotics within 90 days", col: C.red },
{ site: "Intra-Abdominal Source", rx: "Pip-tazo OR cefoxitin (mild)\nMeropenem + vancomycin (severe)", note: "Prompt surgical drainage for abscesses; cover anaerobes always", col: C.amber },
{ site: "Urinary Tract (UTI/Urosepsis)", rx: "Ceftriaxone OR fluoroquinolone\nMeropenem if MDR/ESBL risk", note: "Remove/replace urinary catheter if present; urine C&S guides de-escalation", col: C.amber },
{ site: "Skin & Soft Tissue / Necrotising", rx: "Vancomycin or linezolid +\npip-tazo OR carbapenem", note: "URGENT surgical consultation for necrotising fasciitis (Fournier gangrene)", col: C.teal },
{ site: "CNS (Meningitis)", rx: "Ceftriaxone + ampicillin ± dexamethasone\nVancomycin if healthcare-associated", note: "Dexamethasone 0.15 mg/kg q6h × 4 days reduces hearing loss in bacterial meningitis", col: C.teal },
];
abx.forEach((a, i) => {
const col = i % 2 === 0 ? 0.25 : 6.85;
const row = Math.floor(i / 2);
const y = 0.85 + row * 2.2;
card(s, col, y, 6.3, 2.0, a.site, [a.rx, "► " + a.note], a.col);
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SECTION 3 – DKA
// ═══════════════════════════════════════════════════════════════════════════════
sectionDivider("DIABETIC KETOACIDOSIS", "Pathophysiology · Diagnosis · Treatment Protocol", C.green);
// SLIDE: DKA Pathophysiology
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "DKA — Pathophysiology (Rosen's Emergency Medicine)", C.green);
s.addText("DKA is caused by absolute or relative insulin deficiency combined with glucagon excess, producing hyperglycaemia, ketoacidosis, and profound fluid/electrolyte depletion.", {
x: 0.35, y: 0.82, w: 12.6, h: 0.55, fontSize: 13, color: C.lightGray, fontFace: "Calibri", italic: true
});
card(s, 0.25, 1.5, 4.1, 3.0, "Core Pathophysiology", [
"Insulin deficiency + glucagon excess →",
"1. Impaired glucose uptake by cells",
"2. Hepatic gluconeogenesis + glycogenolysis → hyperglycaemia",
"3. Hormone-sensitive lipase activated",
" → ↑ free fatty acids (FFA) → liver converts to",
" acetoacetate + β-hydroxybutyrate → KETONAEMIA",
"4. Osmotic diuresis → dehydration + electrolyte loss",
"5. H⁺ accumulation → high-anion-gap metabolic acidosis"
], C.green);
card(s, 4.65, 1.5, 4.2, 3.0, "Fluid & Electrolyte Deficits", [
"Total water deficit: 3–5 L (average 5 L)",
"Sodium: 8–10 mEq/kg deficit",
"Potassium: 5–7 mEq/kg deficit",
" (serum K⁺ may appear normal/high due to acidosis",
" — masks profound total body depletion)",
"Phosphorus: ~3 mEq/kg deficit",
"Magnesium, calcium also depleted",
"Vomiting + poor intake worsen electrolyte loss"
], C.green);
card(s, 9.15, 1.5, 3.9, 3.0, "Precipitating Causes", [
"Most common:",
"• Infection (pneumonia, UTI) — 40%",
"• Insulin omission — 25%",
"• New-onset T1DM — 15%",
"Others:",
"• MI, stroke, pancreatitis",
"• Medications (steroids, SGLT2i)",
"• Trauma, surgery",
"• Alcohol / substance use"
], C.teal);
card(s, 0.25, 4.65, 12.8, 2.15, "Diagnostic Criteria for DKA", [
"Glucose >250 mg/dL (>13.9 mmol/L) | pH <7.3 | Bicarbonate <15 mEq/L | Anion gap >12 mEq/L | Ketonaemia/ketonuria",
"Severity: Mild (pH 7.25–7.30, HCO₃ 15–18) | Moderate (pH 7.00–7.24, HCO₃ 10–14) | Severe (pH <7.00, HCO₃ <10)"
], C.green);
}
// SLIDE: DKA Management Protocol
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "DKA — Management Protocol", C.green);
card(s, 0.25, 0.85, 3.15, 6.05, "FLUIDS", [
"STEP 1 – First hour:",
"1 L isotonic saline (0.9% NaCl) IV",
"or 20 mL/kg in paediatrics",
"",
"STEP 2 – Ongoing:",
"0.45% NaCl at 250–500 mL/hr",
"Switch to 0.9% NaCl if Na⁺ low",
"",
"STEP 3 – When glucose ≤250 mg/dL:",
"Change to D5W + 0.45% NaCl",
"(allows continued insulin to clear ketones)",
"",
"Total first 24 hrs: 4–6 L (adult)"
], C.green);
card(s, 3.7, 0.85, 3.15, 6.05, "INSULIN", [
"Hold until K⁺ ≥3.5 mEq/L",
"",
"Regular insulin drip:",
"0.1 units/kg/hr IV continuous",
"(NO bolus required if K⁺ adequate)",
"",
"Target glucose reduction:",
"50–75 mg/dL per hour",
"",
"Transition to SubQ insulin:",
"When: pH >7.3, HCO₃ >18, AG normal,",
"patient tolerating oral intake",
"",
"Overlap SubQ + drip by 1–2 hrs",
"to avoid rebound hyperglycaemia"
], C.green);
card(s, 7.15, 0.85, 3.0, 6.05, "POTASSIUM", [
"K⁺ <3.5 mEq/L:",
"HOLD insulin, give 40 mEq/hr KCl",
"Recheck K⁺ q1–2h",
"",
"K⁺ 3.5–5.0 mEq/L:",
"Add 20–40 mEq K⁺ per litre fluid",
"",
"K⁺ >5.0 mEq/L:",
"Hold K⁺ replacement, recheck q2h",
"",
"CRITICAL: K⁺ falls rapidly with",
"insulin + fluid — monitor every",
"1–2 hours in first 4–6 hours",
"",
"Goal K⁺: 4.0–5.0 mEq/L"
], C.amber);
card(s, 10.45, 0.85, 2.6, 6.05, "OTHER / MONITORING", [
"BICARB:",
"Consider ONLY if pH <6.9",
"50 mEq NaHCO₃ in 200 mL",
"over 2 hrs (controversial)",
"",
"PHOSPHATE:",
"Replace if <1.0 mEq/L",
"or cardiac dysfunction",
"",
"Monitoring Schedule:",
"• BMP q2–4h",
"• ABG q4–6h",
"• Urine output hourly",
"• Neurological checks",
"",
"COMPLICATION:",
"Cerebral oedema (paediatric!)",
"→ Slow glucose reduction",
"→ Mannitol if occurs"
], C.teal);
}
// ═══════════════════════════════════════════════════════════════════════════════
// SECTION 4 – HYPERTENSION
// ═══════════════════════════════════════════════════════════════════════════════
sectionDivider("HYPERTENSION", "Classification · Pathophysiology · Hypertensive Emergencies · Management", C.purpleLight);
// SLIDE: HTN Classification & Pathophysiology
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "HYPERTENSION — Classification & Pathophysiology", C.purpleLight);
card(s, 0.25, 0.85, 6.0, 3.2, "BP Classification (ACC/AHA 2017)", [
"Normal: <120/<80 mmHg",
"Elevated: 120–129 / <80 mmHg",
"Stage 1 HTN: 130–139 / 80–89 mmHg",
"Stage 2 HTN: ≥140 / ≥90 mmHg",
"Hypertensive Urgency: SBP >180 or DBP >120, no end-organ damage",
"Hypertensive Emergency: SBP >180/120 WITH end-organ damage",
" • Hypertensive encephalopathy, ICH",
" • Acute aortic dissection, STEMI",
" • Flash pulmonary oedema, AKI, eclampsia"
], C.purpleLight);
card(s, 6.6, 0.85, 6.45, 3.2, "Pathophysiology", [
"Primary (Essential) HTN – 90–95%:",
"• ↑ cardiac output and/or ↑ SVR",
"• RAAS dysregulation (↑ angiotensin II → vasoconstriction, Na⁺ retention)",
"• SNS overactivation",
"• Endothelial dysfunction (↓ NO, ↑ endothelin)",
"• Structural vascular remodelling (↑ wall:lumen ratio)",
"Secondary HTN – 5–10%:",
"• Renovascular disease, primary hyperaldosteronism",
"• Obstructive sleep apnoea, phaeochromocytoma",
"• CKD, coarctation of aorta, hypothyroidism"
], C.purpleLight);
card(s, 0.25, 4.2, 3.85, 2.65, "End-Organ Damage", [
"Heart: LVH, diastolic dysfunction, HF, IHD",
"Brain: lacunar infarcts, white matter changes,",
" hypertensive encephalopathy, haemorrhagic stroke",
"Kidneys: hypertensive nephrosclerosis → CKD",
"Eyes: Keith-Wagener retinopathy (grades I–IV)",
"Vessels: accelerated atherosclerosis, aortic aneurysm"
], C.purple);
card(s, 4.45, 4.2, 4.0, 2.65, "Investigations", [
"Urinalysis + ACR (proteinuria)",
"BMP: creatinine, electrolytes",
"Fasting glucose, lipid profile",
"ECG: LVH (Sokolow-Lyon, Cornell voltage)",
"Echo: structural heart disease",
"Fundoscopy: hypertensive retinopathy",
"Renal imaging if secondary cause suspected"
], C.purple);
card(s, 8.8, 4.2, 4.25, 2.65, "Non-Pharmacological", [
"DASH diet (↓ BP by ~11/5 mmHg)",
"Sodium restriction <2.3 g/day",
"Weight loss (1 mmHg per kg)",
"Regular aerobic exercise ≥150 min/week",
"Limit alcohol: ≤1 drink/day (women), ≤2 (men)",
"Smoking cessation"
], C.purple);
}
// SLIDE: Antihypertensive Pharmacotherapy
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "HYPERTENSION — Pharmacological Management", C.purpleLight);
const drugs = [
{ cls: "ACE Inhibitors", eg: "Ramipril, Enalapril, Lisinopril", moa: "Block ACE → ↓ angiotensin II → vasodilation + ↓ aldosterone", ind: "HF, post-MI, diabetic nephropathy, proteinuria, CKD", ci: "Pregnancy, bilateral RAS, hyperkalaemia", col: C.purpleLight },
{ cls: "ARBs", eg: "Losartan, Valsartan, Irbesartan", moa: "Block AT1 receptor → same effects as ACEi without bradykinin", ind: "ACEi-intolerant, HFrEF, diabetic nephropathy", ci: "Pregnancy, bilateral RAS", col: C.purpleLight },
{ cls: "Calcium Channel Blockers", eg: "Amlodipine (DHP), Diltiazem, Verapamil", moa: "Block L-type Ca²⁺ channels → vasodilation (DHP) or ↓ HR/contractility", ind: "Older adults, Black patients, angina, Raynaud's", ci: "Verapamil/diltiazem + HF with ↓EF, AV block", col: C.amber },
{ cls: "Thiazide Diuretics", eg: "Hydrochlorothiazide, Chlorthalidone", moa: "↓ Na⁺ reabsorption in DCT → ↓ plasma volume + vasodilation", ind: "Black patients (highly effective), osteoporosis, volume excess", ci: "Gout (relative), severe hypokalaemia", col: C.amber },
{ cls: "Beta-Blockers", eg: "Metoprolol, Bisoprolol, Carvedilol", moa: "Block β1 receptors → ↓ HR, ↓ contractility, ↓ renin release", ind: "Post-MI, HFrEF, atrial fibrillation, angina", ci: "Asthma (non-selective), bradycardia, AV block", col: C.teal },
{ cls: "Aldosterone Antagonists", eg: "Spironolactone, Eplerenone", moa: "Block mineralocorticoid receptor → ↓ Na⁺/H₂O retention", ind: "Resistant HTN (4th agent), HFrEF, Conn syndrome", ci: "Hyperkalaemia, severe renal failure", col: C.teal },
];
drugs.forEach((d, i) => {
const col = i % 2 === 0 ? 0.25 : 6.85;
const y = 0.85 + Math.floor(i / 2) * 2.2;
card(s, col, y, 6.3, 2.0, d.cls + " — " + d.eg, ["MOA: " + d.moa, "Indications: " + d.ind, "Cautions: " + d.ci], d.col);
});
}
// SLIDE: Hypertensive Emergency Management
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "HYPERTENSIVE EMERGENCY — Management Algorithm", C.purpleLight);
s.addText("Goal: Reduce MAP by ≤25% in first hour, then to 160/100 mmHg over next 2–6 hrs. Avoid rapid over-correction (risk of ischaemic stroke, MI, acute kidney injury).", {
x: 0.35, y: 0.82, w: 12.6, h: 0.55, fontSize: 12.5, color: C.lightGray, fontFace: "Calibri", italic: true
});
const emrx = [
{ cond: "Hypertensive Encephalopathy / ICH", rx: "IV Nicardipine or Labetalol\nTarget SBP 140–160 mmHg\nAvoid nitroprusside (↑ ICP)", col: C.purpleLight },
{ cond: "Acute Aortic Dissection", rx: "IV Esmolol + Nitroprusside or Nicardipine\nTarget HR <60, SBP 100–120 mmHg urgently\nEarliest possible surgical consultation", col: C.purpleLight },
{ cond: "Flash Pulmonary Oedema / LV Failure", rx: "IV Nitroglycerine (vasodilate, ↓ preload/afterload)\nIV Furosemide (diuresis)\nNon-invasive ventilation (BiPAP)", col: C.amber },
{ cond: "Hypertensive Emergency in Pregnancy (Eclampsia)", rx: "IV Labetalol or Hydralazine\nMagnesium sulfate 4–6 g IV (anti-seizure)\nDefinitive: delivery of baby", col: C.amber },
{ cond: "Phaeochromocytoma Crisis", rx: "IV Phentolamine (α-blocker) FIRST\nThen beta-blocker (NEVER beta first)\nSurgical tumour resection", col: C.red },
{ cond: "Hypertensive Urgency (no end-organ damage)", rx: "Oral antihypertensives (Captopril, Labetalol,\nClonidine, Amlodipine)\nClose outpatient follow-up within 24–72 hrs", col: C.teal },
];
emrx.forEach((r, i) => {
const col = i % 2 === 0 ? 0.25 : 6.85;
const y = 1.5 + Math.floor(i / 2) * 2.0;
card(s, col, y, 6.3, 1.85, r.cond, [r.rx], r.col);
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// FINAL SLIDE – Summary Comparison
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
addHeader(s, "SUMMARY — Critical Care Emergencies at a Glance", C.teal);
const rows = [
["Condition", "Key Pathophysiology", "Immediate Priority", "First-Line Drug", "Target"],
["Hypovolemic Shock", "↓ Preload → ↓ CO", "Haemorrhage control + fluids", "0.9% NaCl / Blood products", "MAP >65, Lactate clearance"],
["Cardiogenic Shock", "↓ Contractility → ↓ CO + ↑ LVEDP", "Vasopressors + inotropes", "Norepinephrine + Dobutamine", "CI >2.2, MAP >65"],
["Distributive / Septic Shock", "↓ SVR + maldistribution", "Antibiotics + fluids + vasopressors", "Norepinephrine + Pip-tazo", "MAP >65, Lactate <2"],
["Anaphylactic Shock", "IgE-mediated vasodilation + bronchospasm", "IM Epinephrine STAT", "Epinephrine 1:1000 0.5 mg IM", "Stabilise BP + airway"],
["Sepsis", "Dysregulated immune → MODS", "Hour-1 bundle: cultures, ABx, fluids", "Broad-spectrum IV antibiotics", "qSOFA <2, Lactate clearance"],
["DKA", "Insulin deficiency → ketoacidosis", "IV fluids + insulin drip + K⁺ monitoring", "0.9% NaCl then insulin 0.1 u/kg/hr", "pH >7.3, HCO₃ >18, AG normal"],
["Hypertensive Emergency", "↑↑ BP → end-organ damage", "IV antihypertensive + identify cause", "Nicardipine or Labetalol IV", "MAP ↓ ≤25% in first hour"],
];
const colWidths = [2.2, 2.6, 2.6, 2.5, 3.15];
const colX = [0.15, 2.4, 5.05, 7.7, 10.25];
rows.forEach((row, ri) => {
const y = 0.85 + ri * 0.77;
const isHeader = ri === 0;
row.forEach((cell, ci) => {
s.addShape(pres.ShapeType.rect, { x: colX[ci], y, w: colWidths[ci], h: 0.72,
fill: { color: isHeader ? C.navy : ri % 2 === 0 ? "162C4A" : "0E1E36" },
line: { color: C.tealDark, pt: 0.5 }
});
s.addText(cell, { x: colX[ci] + 0.07, y: y + 0.05, w: colWidths[ci] - 0.14, h: 0.62,
fontSize: isHeader ? 10.5 : 9, bold: isHeader, color: isHeader ? C.teal : C.lightGray,
fontFace: "Calibri", valign: "middle", wrap: true, margin: 0
});
});
});
}
// LAST SLIDE – References
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 0.7, fill: { color: C.navy }, line: { color: C.navy } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 0.7, w: 13.3, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });
s.addText("References & Sources", { x: 0.35, y: 0.05, w: 12.6, h: 0.6, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
const refs = [
"1. Jameson JL, et al. Harrison's Principles of Internal Medicine, 22nd Edition. McGraw Hill Medical, 2025.",
"2. Fuster V, et al. Fuster and Hurst's The Heart, 15th Edition. McGraw Hill, 2022.",
"3. Walls RM, et al. Rosen's Emergency Medicine: Concepts and Clinical Practice, 10th Edition. Elsevier, 2023.",
"4. Evans L, et al. Surviving Sepsis Campaign: International Guidelines for Management of Sepsis and Septic Shock 2021. Crit Care Med. 2021;49(11):e1063–e1143.",
"5. Singer M, et al. The Third International Consensus Definitions for Sepsis and Septic Shock (Sepsis-3). JAMA. 2016;315(8):801–810.",
"6. Whelton PK, et al. 2017 ACC/AHA High Blood Pressure Clinical Practice Guideline. Hypertension. 2018;71(6):e13–e115.",
"7. Kitabchi AE, et al. Hyperglycemic Crises in Adult Patients With Diabetes. Diabetes Care. 2009;32(7):1335–1343.",
"8. van Diepen S, et al. Contemporary Management of Cardiogenic Shock: A Scientific Statement From the AHA. Circulation. 2017;136(16):e232–e268.",
];
const refItems = refs.map((r, i) => ({ text: r, options: { breakLine: i < refs.length - 1, fontSize: 12, color: C.lightGray, fontFace: "Calibri" } }));
s.addText(refItems, { x: 0.5, y: 0.95, w: 12.3, h: 6.0, valign: "top", margin: 0 });
}
pres.writeFile({ fileName: "/home/daytona/workspace/critical-care-ppt/Critical_Care_Medicine.pptx" })
.then(() => console.log("DONE: /home/daytona/workspace/critical-care-ppt/Critical_Care_Medicine.pptx"))
.catch(e => { console.error("ERROR:", e); process.exit(1); });
cd /home/daytona/workspace/critical-care-ppt && node build.js 2>&1
ls -lh /home/daytona/workspace/critical-care-ppt/Critical_Care_Medicine.pptx
Critical Care Medicine
Presentation · PPTX
| Section | Slides | Content |
|---|---|---|
| Title | 1 | Overview with color-coded topic pills |
| SHOCK | 4 | Definition & 4-type overview, Cardiogenic shock (Fuster & Hurst 15E), Hypovolemic & Distributive shock, Monitoring targets |
| SEPSIS | 3 | Sepsis-3 definitions, SOFA score, pathophysiology; Hour-1 Bundle (SSC 2021); Empiric ABx by infection source (Harrison's 22E) |
| DKA | 2 | Full pathophysiology + precipitants + diagnostic criteria; Step-by-step IV fluids / insulin / K⁺ protocol |
| HYPERTENSION | 3 | ACC/AHA classification, pathophysiology, end-organ damage; 6 drug classes with MOA/indications/CI; Hypertensive emergency algorithm by condition |
| Summary + References | 2 | All-conditions comparison table; 8 authoritative references |