~/sepsis-slides/create_sepsis.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Sepsis - A Comprehensive Overview";
pres.author = "Medical Education";
// ─── COLOR PALETTE ───
// Deep navy dominant, crimson accent, white/light-grey text, slate for content bg
const C = {
navyDark: "0D1B2A", // dominant dark bg
navy: "1A2E45", // section headers bg
crimson: "C0392B", // accent - danger/alert
crimsonLight:"E74C3C", // lighter crimson
teal: "1ABC9C", // second accent - positive/treatment
gold: "F39C12", // highlight
white: "FFFFFF",
lightGrey: "ECF0F1",
midGrey: "BDC3C7",
darkGrey: "2C3E50",
cardBg: "162033", // slightly lighter than navyDark for cards
cardBg2: "1E2D40",
};
// ─── HELPERS ───
function titleSlide(pres, title, subtitle) {
const s = pres.addSlide();
// Full dark bg
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navyDark } });
// Crimson accent bar left
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.crimson } });
// Gold bottom stripe
s.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.08, fill: { color: C.gold } });
s.addText(title, {
x: 0.4, y: 1.4, w: 9.2, h: 1.5,
fontSize: 44, bold: true, color: C.white,
fontFace: "Calibri", align: "center"
});
s.addText(subtitle, {
x: 0.4, y: 3.1, w: 9.2, h: 0.8,
fontSize: 20, color: C.midGrey,
fontFace: "Calibri", align: "center", italic: true
});
s.addText("Sources: Robbins Pathology | Sabiston Surgery | Rosen's EM | Miller's Anesthesia", {
x: 0.4, y: 4.9, w: 9.2, h: 0.3,
fontSize: 9, color: C.midGrey, fontFace: "Calibri", align: "center"
});
return s;
}
function sectionDivider(pres, number, title) {
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 2.55, w: 10, h: 0.06, fill: { color: C.crimson } });
s.addText(`0${number}`, {
x: 0.4, y: 1.0, w: 2, h: 1.5,
fontSize: 80, bold: true, color: C.crimson,
fontFace: "Calibri", align: "left", transparency: 30
});
s.addText(title, {
x: 0.4, y: 2.7, w: 9.2, h: 1.2,
fontSize: 32, bold: true, color: C.white,
fontFace: "Calibri", align: "left"
});
return s;
}
function contentHeader(s, pres, title, accentColor) {
const ac = accentColor || C.crimson;
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navyDark } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.72, fill: { color: C.navy } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 0.72, w: 10, h: 0.05, fill: { color: ac } });
s.addText(title, {
x: 0.3, y: 0.08, w: 9.4, h: 0.6,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0
});
}
function bulletList(s, items, x, y, w, h, opts) {
const o = opts || {};
const textArr = items.map((item, i) => ({
text: item,
options: {
bullet: { type: "bullet", characterCode: "25B6", color: o.bulletColor || C.crimson },
color: o.color || C.lightGrey,
fontSize: o.fontSize || 14,
fontFace: "Calibri",
paraSpaceBefore: o.spacing || 4,
breakLine: i < items.length - 1
}
}));
s.addText(textArr, { x, y, w, h, valign: "top" });
}
function card(s, pres, x, y, w, h, title, body, titleColor, bgColor) {
const bg = bgColor || C.cardBg;
const tc = titleColor || C.crimson;
s.addShape(pres.ShapeType.roundRect, {
x, y, w, h, fill: { color: bg }, line: { color: tc, width: 1.5 }, rectRadius: 0.05
});
s.addText(title, {
x: x + 0.1, y: y + 0.05, w: w - 0.2, h: 0.35,
fontSize: 12, bold: true, color: tc, fontFace: "Calibri", margin: 0
});
s.addText(body, {
x: x + 0.1, y: y + 0.42, w: w - 0.2, h: h - 0.52,
fontSize: 11, color: C.lightGrey, fontFace: "Calibri", valign: "top", wrap: true, margin: 0
});
}
// ═══════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ═══════════════════════════════════════════════════════════
titleSlide(pres, "SEPSIS", "A Comprehensive Clinical Overview\nDefinition · Pathophysiology · Diagnosis · Management");
// ═══════════════════════════════════════════════════════════
// SLIDE 2 — AGENDA
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "Contents at a Glance", C.teal);
const topics = [
["01", "Definition & Epidemiology"],
["02", "Causes & Infection Sources"],
["03", "Pathophysiology – The Cascade"],
["04", "Endothelial & Coagulation Changes"],
["05", "Metabolic Abnormalities & Organ Failure"],
["06", "Clinical Features"],
["07", "Diagnosis – qSOFA, SOFA & Labs"],
["08", "Management – Surviving Sepsis Campaign"],
];
topics.forEach(([num, topic], i) => {
const col = i < 4 ? 0 : 1;
const row = i % 4;
const x = col === 0 ? 0.3 : 5.2;
const y = 0.95 + row * 1.05;
s.addShape(pres.ShapeType.rect, { x, y, w: 4.6, h: 0.82, fill: { color: C.cardBg2 }, line: { color: C.navy, width: 0.5 } });
s.addText(num, { x: x + 0.08, y: y + 0.1, w: 0.5, h: 0.6, fontSize: 18, bold: true, color: C.crimson, fontFace: "Calibri", margin: 0 });
s.addText(topic, { x: x + 0.65, y: y + 0.16, w: 3.8, h: 0.5, fontSize: 13, color: C.lightGrey, fontFace: "Calibri", valign: "middle", margin: 0 });
});
}
// ═══════════════════════════════════════════════════════════
// SECTION 01 DIVIDER
// ═══════════════════════════════════════════════════════════
sectionDivider(pres, 1, "Definition & Epidemiology");
// ═══════════════════════════════════════════════════════════
// SLIDE 4 — DEFINITION
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "Definition (Sepsis-3, 2016)", C.crimson);
// Sepsis box
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.9, w: 9.4, h: 1.1, fill: { color: C.navy }, line: { color: C.crimson, width: 2 } });
s.addText("SEPSIS", { x: 0.4, y: 0.92, w: 1.8, h: 0.35, fontSize: 13, bold: true, color: C.crimson, fontFace: "Calibri", margin: 0 });
s.addText("Life-threatening organ dysfunction caused by a dysregulated host response to infection.\nFormal criterion: Infection + SOFA score increase ≥ 2 points from baseline.", {
x: 0.4, y: 1.3, w: 9.2, h: 0.62,
fontSize: 13, color: C.lightGrey, fontFace: "Calibri", margin: 0
});
// Septic shock box
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 2.15, w: 9.4, h: 1.3, fill: { color: C.navy }, line: { color: C.gold, width: 2 } });
s.addText("SEPTIC SHOCK", { x: 0.4, y: 2.17, w: 2.6, h: 0.35, fontSize: 13, bold: true, color: C.gold, fontFace: "Calibri", margin: 0 });
s.addText([
{ text: "Sepsis + all three criteria:", options: { bold: true, color: C.midGrey, breakLine: true } },
{ text: " • Persistent hypotension despite 30 mL/kg crystalloid resuscitation", options: { color: C.lightGrey, breakLine: true } },
{ text: " • Vasopressors required to maintain MAP ≥ 65 mmHg", options: { color: C.lightGrey, breakLine: true } },
{ text: " • Serum lactate > 2 mmol/L despite resuscitation", options: { color: C.lightGrey } },
], { x: 0.4, y: 2.54, w: 9.2, h: 0.88, fontSize: 12, fontFace: "Calibri", margin: 0 });
// Mortality badge
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.6, w: 2.8, h: 1.5, fill: { color: C.crimson }, line: { color: C.crimson, width: 1 } });
s.addText(">40%", { x: 0.3, y: 3.65, w: 2.8, h: 0.82, fontSize: 38, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
s.addText("Mortality in\nSeptic Shock", { x: 0.3, y: 4.45, w: 2.8, h: 0.55, fontSize: 12, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
s.addShape(pres.ShapeType.rect, { x: 3.4, y: 3.6, w: 2.8, h: 1.5, fill: { color: C.cardBg2 }, line: { color: C.gold, width: 1.5 } });
s.addText("750,000+", { x: 3.4, y: 3.65, w: 2.8, h: 0.82, fontSize: 34, bold: true, color: C.gold, fontFace: "Calibri", align: "center", margin: 0 });
s.addText("US cases per year\n(rising incidence)", { x: 3.4, y: 4.45, w: 2.8, h: 0.55, fontSize: 12, color: C.midGrey, fontFace: "Calibri", align: "center", margin: 0 });
s.addShape(pres.ShapeType.rect, { x: 6.5, y: 3.6, w: 3.2, h: 1.5, fill: { color: C.cardBg2 }, line: { color: C.teal, width: 1.5 } });
s.addText("Most Common\nTriggers", { x: 6.5, y: 3.65, w: 3.2, h: 0.5, fontSize: 12, bold: true, color: C.teal, fontFace: "Calibri", align: "center", margin: 0 });
s.addText("Gram-positive bacteria\nGram-negative bacteria\nFungi · Viruses (SARS-CoV-2)", { x: 6.5, y: 4.2, w: 3.2, h: 0.85, fontSize: 11, color: C.lightGrey, fontFace: "Calibri", align: "center", margin: 0 });
}
// ═══════════════════════════════════════════════════════════
// SECTION 02 DIVIDER
// ═══════════════════════════════════════════════════════════
sectionDivider(pres, 2, "Causes & Infection Sources");
// ═══════════════════════════════════════════════════════════
// SLIDE 6 — CAUSES
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "Common Sources of Infection", C.gold);
const sources = [
{ site: "Lungs (Pneumonia)", pathogens: "S. pneumoniae, Klebsiella,\nS. aureus, gram-negatives", color: C.crimson },
{ site: "Urinary Tract", pathogens: "E. coli, Klebsiella,\nEnterococcus", color: C.gold },
{ site: "Abdomen", pathogens: "E. coli, Bacteroides,\nanaerobes, Enterococcus", color: C.teal },
{ site: "Skin / Soft Tissue", pathogens: "S. aureus,\nStreptococcus pyogenes", color: C.crimsonLight },
{ site: "Bloodstream (CLABSI)", pathogens: "S. epidermidis, S. aureus,\nCandida", color: C.midGrey },
{ site: "CNS (Meningitis)", pathogens: "N. meningitidis,\nS. pneumoniae", color: "#9B59B6" },
];
sources.forEach((src, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.2 + col * 3.25;
const y = 0.88 + row * 2.2;
s.addShape(pres.ShapeType.roundRect, { x, y, w: 3.1, h: 2.0, fill: { color: C.cardBg }, line: { color: src.color, width: 2 }, rectRadius: 0.06 });
// Top color bar
s.addShape(pres.ShapeType.rect, { x, y, w: 3.1, h: 0.45, fill: { color: src.color } });
s.addText(src.site, { x: x + 0.08, y: y + 0.06, w: 2.94, h: 0.35, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
s.addText(src.pathogens, { x: x + 0.1, y: y + 0.52, w: 2.9, h: 1.35, fontSize: 11.5, color: C.lightGrey, fontFace: "Calibri", valign: "top", margin: 0 });
});
// Risk factors strip
s.addShape(pres.ShapeType.rect, { x: 0, y: 5.28, w: 10, h: 0.345, fill: { color: C.navy } });
s.addText("High-risk hosts: Immunocompromised · Elderly · ICU patients · Multidrug-resistant organism carriers · Chemotherapy recipients", {
x: 0.2, y: 5.3, w: 9.6, h: 0.3, fontSize: 10, color: C.midGrey, fontFace: "Calibri", margin: 0
});
}
// ═══════════════════════════════════════════════════════════
// SECTION 03 DIVIDER
// ═══════════════════════════════════════════════════════════
sectionDivider(pres, 3, "Pathophysiology – The Cascade");
// ═══════════════════════════════════════════════════════════
// SLIDE 8 — PATHOPHYSIOLOGY OVERVIEW
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "Pathophysiology: Step-by-Step Cascade", C.crimson);
const steps = [
{ n: "1", label: "PAMPs/DAMPs\nRecognized by TLRs", color: C.gold },
{ n: "2", label: "NF-κB Activation\n& Cytokine Storm", color: C.crimson },
{ n: "3", label: "Counter-regulatory\nImmunosuppression", color: "#9B59B6" },
{ n: "4", label: "Endothelial Injury\n& Vascular Leak", color: C.teal },
{ n: "5", label: "Procoagulant State\n& DIC", color: C.crimsonLight },
{ n: "6", label: "Metabolic Failure\n& Organ Dysfunction", color: C.gold },
];
steps.forEach((step, i) => {
const x = 0.3 + i * 1.6;
s.addShape(pres.ShapeType.rect, { x, y: 0.88, w: 1.4, h: 1.2, fill: { color: step.color }, line: { color: step.color, width: 1 } });
s.addText(step.n, { x, y: 0.9, w: 1.4, h: 0.5, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
s.addText(step.label, { x, y: 1.4, w: 1.4, h: 0.65, fontSize: 9.5, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
if (i < 5) {
s.addText("→", { x: x + 1.4, y: 1.1, w: 0.2, h: 0.5, fontSize: 18, color: C.midGrey, fontFace: "Calibri", align: "center", margin: 0 });
}
});
// Two column detail
const leftItems = [
"PAMPs (LPS, peptidoglycan) bind Toll-like receptors on macrophages, neutrophils, dendritic cells",
"G-protein-coupled receptors detect bacterial peptides; C-type lectins detect fungal antigens",
"NF-κB translocates to nucleus → upregulates inflammatory gene expression",
"Key cytokines: TNF, IL-1, IL-12, IL-18, IFN-γ, HMGB1",
"Complement activated → C3a (mast cells), C5a (chemotaxis), C3b (opsonin)",
"ROS, prostaglandins, PAF also elaborated → endothelial damage",
];
const rightItems = [
"Hyperinflammation simultaneously triggers counter-regulatory immunosuppression",
"Shift from Th1 (pro-inflammatory) → Th2/anti-inflammatory cytokines",
"IL-10, soluble TNF receptor, IL-1 receptor antagonist produced",
"Lymphocyte apoptosis and cellular anergy occur",
"Patients oscillate between hyperinflammatory & immunosuppressed states",
"Explains high risk of nosocomial (secondary) infections during recovery",
];
s.addText("Initiation & Inflammation", { x: 0.3, y: 2.22, w: 4.5, h: 0.35, fontSize: 12, bold: true, color: C.crimson, fontFace: "Calibri", margin: 0 });
bulletList(s, leftItems, 0.3, 2.58, 4.5, 2.85, { fontSize: 11, color: C.lightGrey, spacing: 2 });
s.addShape(pres.ShapeType.rect, { x: 5.0, y: 2.22, w: 0.04, h: 3.1, fill: { color: C.navy } });
s.addText("Counter-regulation & Immune Paralysis", { x: 5.2, y: 2.22, w: 4.5, h: 0.35, fontSize: 12, bold: true, color: "#9B59B6", fontFace: "Calibri", margin: 0 });
bulletList(s, rightItems, 5.2, 2.58, 4.5, 2.85, { fontSize: 11, color: C.lightGrey, spacing: 2, bulletColor: "#9B59B6" });
}
// ═══════════════════════════════════════════════════════════
// SLIDE 9 — ENDOTHELIAL & COAGULATION
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "Endothelial Activation & Procoagulant State", C.crimson);
// Endothelial section
s.addText("Endothelial Injury", { x: 0.3, y: 0.85, w: 4.5, h: 0.38, fontSize: 14, bold: true, color: C.teal, fontFace: "Calibri", margin: 0 });
bulletList(s, [
"Cytokines loosen tight junctions → protein-rich vascular leak → widespread edema",
"NO and vasoactive mediators (C3a, C5a, PAF) → smooth muscle relaxation → hypotension",
"Loss of microvascular autoregulation → O₂ delivery-demand mismatch",
"Adhesion molecule upregulation → neutrophil tissue infiltration",
"Increased capillaries with intermittent/heterogeneous flow"
], 0.3, 1.25, 4.6, 3.6, { fontSize: 11.5, color: C.lightGrey, spacing: 3, bulletColor: C.teal });
s.addShape(pres.ShapeType.rect, { x: 5.05, y: 0.82, w: 0.04, h: 4.5, fill: { color: C.navy } });
// Coagulation section
s.addText("Procoagulant State & DIC", { x: 5.2, y: 0.85, w: 4.5, h: 0.38, fontSize: 14, bold: true, color: C.crimson, fontFace: "Calibri", margin: 0 });
bulletList(s, [
"Proinflammatory cytokines ↑ tissue factor (TF) on monocytes & endothelial cells",
"Anticoagulant factors suppressed: TFPI, thrombomodulin, Protein C all ↓",
"PAI-1 upregulated → impaired fibrinolysis",
"NETs activate both intrinsic & extrinsic coagulation pathways",
"Systemic thrombin activation → fibrin microthrombi in small vessels → ischemia",
"DIC in up to 50% of septic patients → paradoxical bleeding from factor consumption"
], 5.2, 1.25, 4.6, 3.6, { fontSize: 11.5, color: C.lightGrey, spacing: 3, bulletColor: C.crimson });
// DIC box
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 4.95, w: 9.4, h: 0.5, fill: { color: C.crimson } });
s.addText("⚠ DIC = Disseminated Intravascular Coagulation: simultaneous widespread clotting AND bleeding — a life-threatening emergency", {
x: 0.4, y: 5.0, w: 9.2, h: 0.38, fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0
});
}
// ═══════════════════════════════════════════════════════════
// SECTION 05 DIVIDER (Metabolic + Organ)
// ═══════════════════════════════════════════════════════════
sectionDivider(pres, 5, "Metabolic Abnormalities & Organ Failure");
// ═══════════════════════════════════════════════════════════
// SLIDE 11 — METABOLIC + ORGAN FAILURE
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "Metabolic Derangements & Multiorgan Failure", C.gold);
// Metabolic left
s.addText("Metabolic Abnormalities", { x: 0.3, y: 0.85, w: 4.5, h: 0.38, fontSize: 14, bold: true, color: C.gold, fontFace: "Calibri", margin: 0 });
bulletList(s, [
"Insulin resistance & hyperglycemia: TNF/IL-1 + stress hormones drive gluconeogenesis, impair GLUT-4",
"Hyperglycemia ↓ neutrophil function, ↑ endothelial adhesion molecules",
"Lactic acidosis: tissue hypoxia + mitochondrial damage → impaired oxidative phosphorylation",
"Elevated triglycerides and blood glucose",
"Adrenal insufficiency: initial cortisol surge → relative adrenal failure or frank necrosis (Waterhouse-Friderichsen in DIC)",
], 0.3, 1.28, 4.6, 2.8, { fontSize: 11, color: C.lightGrey, spacing: 2, bulletColor: C.gold });
s.addShape(pres.ShapeType.rect, { x: 5.05, y: 0.82, w: 0.04, h: 4.5, fill: { color: C.navy } });
// Organ failure right - color cards
s.addText("Organ Dysfunction", { x: 5.2, y: 0.85, w: 4.5, h: 0.38, fontSize: 14, bold: true, color: C.crimson, fontFace: "Calibri", margin: 0 });
const organs = [
{ organ: "Lungs", injury: "ARDS – alveolar-capillary disruption, hypoxemia", color: C.crimson },
{ organ: "Kidneys", injury: "AKI – hypoperfusion + direct inflammatory injury", color: C.teal },
{ organ: "Liver", injury: "Jaundice, elevated enzymes, cholestasis – Kupffer cell activation", color: C.gold },
{ organ: "Heart", injury: "Myocardial depression – ↓ contractility & cardiac output", color: C.crimsonLight },
{ organ: "Brain", injury: "Septic encephalopathy – delirium, altered consciousness", color: "#9B59B6" },
{ organ: "Coagulation", injury: "DIC – diffuse microthrombi + haemorrhage", color: C.midGrey },
];
organs.forEach((org, i) => {
const y = 1.3 + i * 0.68;
s.addShape(pres.ShapeType.rect, { x: 5.2, y, w: 0.85, h: 0.55, fill: { color: org.color } });
s.addText(org.organ, { x: 5.2, y, w: 0.85, h: 0.55, fontSize: 10, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
s.addText(org.injury, { x: 6.1, y: y + 0.04, w: 3.6, h: 0.48, fontSize: 10.5, color: C.lightGrey, fontFace: "Calibri", valign: "middle", margin: 0 });
});
}
// ═══════════════════════════════════════════════════════════
// SECTION 06 DIVIDER
// ═══════════════════════════════════════════════════════════
sectionDivider(pres, 6, "Clinical Features & Stages of Shock");
// ═══════════════════════════════════════════════════════════
// SLIDE 13 — CLINICAL FEATURES
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "Clinical Features of Sepsis", C.crimson);
const features = [
{ sign: "Fever", detail: "> 38°C (or hypothermia < 36°C\nin severe/immunocompromised)", color: C.crimson },
{ sign: "Tachycardia", detail: "HR > 90 bpm", color: C.gold },
{ sign: "Tachypnea", detail: "RR > 20/min; early respiratory\nalkalosis → late acidosis", color: C.teal },
{ sign: "Altered Mental Status", detail: "Confusion, agitation,\nobtundation", color: "#9B59B6" },
{ sign: "Hypotension", detail: "SBP < 90 or MAP < 65 mmHg\n(in septic shock)", color: C.crimsonLight },
{ sign: "Skin Changes", detail: "Early: warm, flushed\nLate: cold, clammy, mottled", color: C.midGrey },
{ sign: "Oliguria", detail: "Urine < 0.5 mL/kg/hr\n(early AKI marker)", color: C.teal },
{ sign: "Jaundice", detail: "Hepatic involvement;\nmost common ICU jaundice cause", color: C.gold },
];
features.forEach((f, i) => {
const col = i % 4;
const row = Math.floor(i / 4);
const x = 0.15 + col * 2.44;
const y = 0.88 + row * 2.2;
s.addShape(pres.ShapeType.roundRect, { x, y, w: 2.3, h: 2.0, fill: { color: C.cardBg }, line: { color: f.color, width: 2 }, rectRadius: 0.06 });
s.addShape(pres.ShapeType.rect, { x, y, w: 2.3, h: 0.45, fill: { color: f.color } });
s.addText(f.sign, { x: x + 0.05, y: y + 0.06, w: 2.2, h: 0.35, fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
s.addText(f.detail, { x: x + 0.08, y: y + 0.52, w: 2.14, h: 1.35, fontSize: 11, color: C.lightGrey, fontFace: "Calibri", align: "center", valign: "top", margin: 0 });
});
}
// ═══════════════════════════════════════════════════════════
// SLIDE 14 — STAGES OF SHOCK
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "Stages of Septic Shock", C.gold);
const stages = [
{
n: "Stage 1", label: "Non-Progressive\n(Compensated)",
desc: "Baroreceptor reflexes activated\nCatecholamine release\nRAAS activation; ADH release\nVital organ perfusion maintained\nNo clinical deterioration yet",
color: C.teal
},
{
n: "Stage 2", label: "Progressive",
desc: "Compensatory mechanisms fail\nWorsening tissue hypoperfusion\nMetabolic acidosis develops\nLactate rises\nClinical deterioration apparent",
color: C.gold
},
{
n: "Stage 3", label: "Irreversible",
desc: "Cellular/tissue injury too severe\nOrgan failure irreversible\nEven correcting hemodynamics\ncannot prevent death\nMultiple organ failure ensues",
color: C.crimson
},
];
stages.forEach((st, i) => {
const x = 0.3 + i * 3.2;
s.addShape(pres.ShapeType.roundRect, { x, y: 0.88, w: 3.0, h: 4.5, fill: { color: C.cardBg }, line: { color: st.color, width: 2.5 }, rectRadius: 0.08 });
s.addShape(pres.ShapeType.rect, { x, y: 0.88, w: 3.0, h: 0.72, fill: { color: st.color } });
s.addText(st.n, { x: x + 0.1, y: 0.9, w: 2.8, h: 0.35, fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
s.addText(st.label, { x: x + 0.1, y: 1.25, w: 2.8, h: 0.35, fontSize: 10, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
s.addText(st.desc, { x: x + 0.15, y: 1.72, w: 2.7, h: 3.5, fontSize: 12, color: C.lightGrey, fontFace: "Calibri", valign: "top", margin: 0 });
if (i < 2) {
s.addText("→", { x: x + 3.0, y: 2.6, w: 0.2, h: 0.5, fontSize: 22, color: C.midGrey, fontFace: "Calibri", align: "center", margin: 0 });
}
});
}
// ═══════════════════════════════════════════════════════════
// SECTION 07 DIVIDER
// ═══════════════════════════════════════════════════════════
sectionDivider(pres, 7, "Diagnosis – qSOFA, SOFA & Laboratory Tests");
// ═══════════════════════════════════════════════════════════
// SLIDE 16 — DIAGNOSIS TOOLS
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "Diagnostic Criteria", C.teal);
// qSOFA box
s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 0.88, w: 4.5, h: 3.2, fill: { color: C.cardBg }, line: { color: C.teal, width: 2 }, rectRadius: 0.06 });
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.88, w: 4.5, h: 0.5, fill: { color: C.teal } });
s.addText("qSOFA (Quick SOFA — outside ICU)", { x: 0.38, y: 0.9, w: 4.34, h: 0.42, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
const qItems = [
"Altered mental status (GCS < 15) → 1 pt",
"Respiratory rate ≥ 22 /min → 1 pt",
"Systolic BP ≤ 100 mmHg → 1 pt",
];
bulletList(s, qItems, 0.4, 1.44, 4.3, 1.5, { fontSize: 12, color: C.lightGrey, spacing: 5, bulletColor: C.teal });
s.addShape(pres.ShapeType.rect, { x: 0.4, y: 2.98, w: 4.3, h: 0.42, fill: { color: C.navy } });
s.addText("Score ≥ 2 = Suspect Sepsis → Get full SOFA assessment", { x: 0.45, y: 3.0, w: 4.2, h: 0.35, fontSize: 11, bold: true, color: C.teal, fontFace: "Calibri", margin: 0 });
// SOFA box
s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 0.88, w: 4.6, h: 3.2, fill: { color: C.cardBg }, line: { color: C.gold, width: 2 }, rectRadius: 0.06 });
s.addShape(pres.ShapeType.rect, { x: 5.1, y: 0.88, w: 4.6, h: 0.5, fill: { color: C.gold } });
s.addText("SOFA Score (ICU — definitive criterion)", { x: 5.18, y: 0.9, w: 4.44, h: 0.42, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
const sofaItems = [
"Respiration: PaO₂/FiO₂ ratio",
"Coagulation: Platelet count",
"Liver: Bilirubin",
"Cardiovascular: MAP / vasopressors",
"CNS: Glasgow Coma Scale",
"Renal: Creatinine / urine output",
];
bulletList(s, sofaItems, 5.2, 1.44, 4.3, 1.5, { fontSize: 12, color: C.lightGrey, spacing: 3, bulletColor: C.gold });
s.addShape(pres.ShapeType.rect, { x: 5.2, y: 2.98, w: 4.3, h: 0.42, fill: { color: C.navy } });
s.addText("SOFA ≥ 2 points from baseline = Organ Dysfunction = SEPSIS", { x: 5.25, y: 3.0, w: 4.2, h: 0.35, fontSize: 11, bold: true, color: C.gold, fontFace: "Calibri", margin: 0 });
// Lab header
s.addText("Key Laboratory Investigations", { x: 0.3, y: 4.22, w: 9.4, h: 0.35, fontSize: 13, bold: true, color: C.crimson, fontFace: "Calibri", margin: 0 });
const labs = [
"Blood cultures (×2) — before antibiotics",
"CBC — leukocytosis/leukopenia, bandemia",
"Lactate — >2 mmol/L = hypoperfusion",
"Procalcitonin — bacterial sepsis marker",
"CRP — inflammation",
"BMP/Creatinine — AKI",
"LFTs/Bilirubin — hepatic involvement",
"PT/aPTT, D-dimer — DIC screening",
"ABG — acid-base, respiratory status",
];
// 3-column lab grid
const perCol = 3;
labs.forEach((lab, i) => {
const col = Math.floor(i / perCol);
const row = i % perCol;
s.addText(`• ${lab}`, {
x: 0.3 + col * 3.2, y: 4.6 + row * 0.3,
w: 3.1, h: 0.28,
fontSize: 10, color: C.lightGrey, fontFace: "Calibri", margin: 0
});
});
}
// ═══════════════════════════════════════════════════════════
// SECTION 08 DIVIDER
// ═══════════════════════════════════════════════════════════
sectionDivider(pres, 8, "Management – Surviving Sepsis Campaign");
// ═══════════════════════════════════════════════════════════
// SLIDE 18 — HOUR-1 BUNDLE
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "The Hour-1 Bundle (Immediate Management)", C.crimson);
const bundle = [
{ n: "1", action: "Measure Lactate", detail: "Remeasure if initial > 2 mmol/L", color: C.teal },
{ n: "2", action: "Blood Cultures ×2", detail: "Before antibiotics — do not delay", color: C.gold },
{ n: "3", action: "IV Antibiotics", detail: "Broad-spectrum within 1 HOUR\nof sepsis recognition", color: C.crimson },
{ n: "4", action: "Fluid Resuscitation", detail: "30 mL/kg IV balanced crystalloid\n(Lactated Ringer's preferred)", color: C.teal },
{ n: "5", action: "Vasopressors", detail: "If hypotension persists\nTarget MAP ≥ 65 mmHg", color: C.crimsonLight },
];
bundle.forEach((b, i) => {
const x = 0.2 + i * 1.9;
s.addShape(pres.ShapeType.roundRect, { x, y: 0.9, w: 1.75, h: 3.0, fill: { color: C.cardBg }, line: { color: b.color, width: 2.5 }, rectRadius: 0.06 });
s.addShape(pres.ShapeType.ellipse, { x: x + 0.525, y: 0.95, w: 0.7, h: 0.7, fill: { color: b.color } });
s.addText(b.n, { x: x + 0.525, y: 0.97, w: 0.7, h: 0.65, fontSize: 20, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
s.addText(b.action, { x: x + 0.08, y: 1.74, w: 1.6, h: 0.65, fontSize: 12, bold: true, color: b.color, fontFace: "Calibri", align: "center", margin: 0 });
s.addText(b.detail, { x: x + 0.08, y: 2.45, w: 1.6, h: 1.35, fontSize: 10.5, color: C.lightGrey, fontFace: "Calibri", align: "center", valign: "top", margin: 0 });
});
// Vasopressor section
s.addText("Vasopressor Hierarchy", { x: 0.3, y: 4.08, w: 5, h: 0.35, fontSize: 13, bold: true, color: C.gold, fontFace: "Calibri", margin: 0 });
const vpItems = [
"Norepinephrine — FIRST-LINE (↓ mortality vs dopamine)",
"Vasopressin (0.03–0.04 U/min) — add-on to norepinephrine",
"Epinephrine — second-line add-on",
"Dopamine — no longer preferred (↑ arrhythmia risk)",
];
bulletList(s, vpItems, 0.3, 4.45, 4.8, 1.0, { fontSize: 11, color: C.lightGrey, spacing: 2, bulletColor: C.gold });
// Antibiotics note
s.addText("Antibiotic Principles", { x: 5.2, y: 4.08, w: 4.5, h: 0.35, fontSize: 13, bold: true, color: C.teal, fontFace: "Calibri", margin: 0 });
bulletList(s, [
"Empirical broad-spectrum based on source & local resistance",
"De-escalate based on culture results (stewardship)",
"Duration: 5–7 days once source controlled",
"Procalcitonin guides de-escalation"
], 5.2, 4.45, 4.6, 1.0, { fontSize: 11, color: C.lightGrey, spacing: 2, bulletColor: C.teal });
}
// ═══════════════════════════════════════════════════════════
// SLIDE 19 — ADJUNCTIVE THERAPIES
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
contentHeader(s, pres, "Adjunctive & Supportive Therapies", C.teal);
const therapies = [
{ therapy: "Hydrocortisone\n200–300 mg/day", indication: "Refractory septic shock (persisting despite fluids + vasopressors) — addresses relative adrenal insufficiency", color: C.crimson },
{ therapy: "Insulin Infusion", indication: "Target blood glucose 140–180 mg/dL; avoid hypoglycemia which worsens outcomes", color: C.gold },
{ therapy: "Lung-Protective\nVentilation (ARDS)", indication: "Low tidal volume 6 mL/kg IBW; PEEP titration; proven to ↓ mortality in ARDS", color: C.teal },
{ therapy: "Renal Replacement\nTherapy (CRRT)", indication: "Severe AKI unresponsive to medical management; continuous mode preferred in hemodynamically unstable patients", color: "#9B59B6" },
{ therapy: "Source Control", indication: "Drain abscess, remove infected central line, debride necrotizing tissue — critical to antibiotics working", color: C.crimsonLight },
{ therapy: "DVT & Stress Ulcer\nProphylaxis", indication: "Heparin for DVT unless DIC contraindication; PPI or H₂ blocker for stress ulcer prophylaxis", color: C.midGrey },
];
therapies.forEach((t, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.2 + col * 3.25;
const y = 0.9 + row * 2.2;
s.addShape(pres.ShapeType.roundRect, { x, y, w: 3.1, h: 2.05, fill: { color: C.cardBg }, line: { color: t.color, width: 2 }, rectRadius: 0.06 });
s.addShape(pres.ShapeType.rect, { x, y, w: 3.1, h: 0.52, fill: { color: t.color } });
s.addText(t.therapy, { x: x + 0.07, y: y + 0.06, w: 2.96, h: 0.42, fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
s.addText(t.indication, { x: x + 0.1, y: y + 0.58, w: 2.9, h: 1.38, fontSize: 10.5, color: C.lightGrey, fontFace: "Calibri", valign: "top", wrap: true, margin: 0 });
});
}
// ═══════════════════════════════════════════════════════════
// SLIDE 20 — SUMMARY / CONCLUSION
// ═══════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navyDark } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.teal } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 5.2, w: 10, h: 0.08, fill: { color: C.gold } });
s.addText("Key Takeaways", { x: 0.4, y: 0.25, w: 9.2, h: 0.65, fontSize: 28, bold: true, color: C.white, fontFace: "Calibri", align: "center" });
const takeaways = [
{ icon: "01", text: "Sepsis = infection + organ dysfunction. Septic shock = sepsis + vasopressors needed + lactate > 2 mmol/L", color: C.crimson },
{ icon: "02", text: "The cascade: PAMPs activate TLRs → NF-κB → cytokine storm + simultaneous immunosuppression → endothelial injury → DIC → multiorgan failure", color: C.gold },
{ icon: "03", text: "Pathophysiology is biphasic: hyperinflammatory AND immunosuppressed simultaneously — explaining secondary infection risk", color: "#9B59B6" },
{ icon: "04", text: "SOFA ≥ 2 = sepsis; qSOFA ≥ 2 = screen positive outside ICU; lactate is key prognostic marker", color: C.teal },
{ icon: "05", text: "Hour-1 Bundle: culture → antibiotics within 1 hr → 30 mL/kg fluid → vasopressors if needed → norepinephrine is first-line", color: C.teal },
];
takeaways.forEach((tk, i) => {
const y = 1.05 + i * 0.85;
s.addShape(pres.ShapeType.rect, { x: 0.4, y, w: 0.5, h: 0.65, fill: { color: tk.color } });
s.addText(tk.icon, { x: 0.4, y, w: 0.5, h: 0.65, fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle", margin: 0 });
s.addText(tk.text, { x: 1.05, y: y + 0.06, w: 8.65, h: 0.55, fontSize: 12, color: C.lightGrey, fontFace: "Calibri", valign: "middle", margin: 0 });
});
s.addText("Sources: Robbins & Cotran Pathologic Basis of Disease · Sabiston Textbook of Surgery · Rosen's Emergency Medicine · Miller's Anesthesia 10e", {
x: 0.4, y: 5.3, w: 9.2, h: 0.25, fontSize: 8.5, color: C.midGrey, fontFace: "Calibri", align: "center", italic: true
});
}
// ─── WRITE FILE ───
pres.writeFile({ fileName: "/home/daytona/workspace/sepsis-slides/Sepsis_Complete.pptx" })
.then(() => console.log("✅ Sepsis_Complete.pptx created successfully"))
.catch(err => { console.error("❌ Error:", err); process.exit(1); });