make a presentation on hypovolemic shock in GI bleeding. Its patho physiology in detail explanation and texts, signs and symptoms, diagnosis and treament plan step by step accordingly, management and approaches in emergency medicine
hypovolemic shock pathophysiology diagram
gastrointestinal bleeding upper GI endoscopy hemorrhage
ls /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/hypovolemic-shock-gi-bleed
mkdir -p /home/daytona/workspace/hypovolemic-shock-gi-bleed && echo "done"
~/hypovolemic-shock-gi-bleed/build.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// ─── Fetch images ───────────────────────────────────────────────────────────
const imageUrls = [
"https://cdn.orris.care/cdss_images/3d12fa52971722e6543bd4c88ab77f013de25cbdd311abb847495fec245deed9.png", // cardiac output vs hemorrhage
"https://cdn.orris.care/cdss_images/244f5a917cc63cef2991643553e298115bd71b5ea6089e5ebf59a4e01157edd0.png", // cardiovascular responses flowchart
"https://cdn.orris.care/cdss_images/26404abcbac79a8d53af99ecccecf5714d928ac9ef8a19f14089eb32e7335f43.png", // positive feedback vicious cycle
"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_bdeafeef7610b98c1313148f2edcdeda5bd5f3adba2ade5ad110c32d716bfb1c.jpg", // echo hypovolemic shock
"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_ae008870116f99b4a05e41e7e23812e7243640bc1a6f09eba0e929b6a5d3384d.jpg", // GI endoscopy
"https://cdn.orris.care/cdss_images/pmc_clinical_VQA_ed7d453cc81a86ced4b3ca3f58185538ae28e1b754597f90f6e780c84bb08eaf.jpg", // CT+endoscopy GI bleed
];
console.log("Fetching images...");
let imgs;
try {
const raw = execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`,
{ maxBuffer: 50 * 1024 * 1024 }
).toString();
imgs = JSON.parse(raw);
} catch (e) {
console.error("Image fetch error:", e.message);
imgs = imageUrls.map(() => ({ base64: null, error: "fetch failed" }));
}
const getImg = (i) => (imgs[i] && !imgs[i].error) ? imgs[i].base64 : null;
// ─── Theme ───────────────────────────────────────────────────────────────────
const DARK_BG = "0D1B2A"; // deep navy
const MID_BG = "1A2B3C"; // slightly lighter navy
const ACCENT = "E63946"; // bold red (blood / urgency)
const ACCENT2 = "F4A261"; // warm orange (warning)
const WHITE = "FFFFFF";
const LIGHT = "D4E5F7"; // light blue-white
const MUTED = "8BA7C1"; // muted steel blue
const TEAL = "2EC4B6"; // teal accent for info
const GREEN = "57CC99"; // green for treatment
const TITLE_FONT = "Calibri";
const BODY_FONT = "Calibri";
let pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3 x 7.5
pres.title = "Hypovolemic Shock in GI Bleeding";
pres.author = "Emergency Medicine";
// ── Helper: slide background ──────────────────────────────────────────────────
function setDarkBg(slide) {
slide.background = { color: DARK_BG };
}
// ── Helper: accent bar (left side) ───────────────────────────────────────────
function accentBar(slide, color = ACCENT) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 0.12, h: 7.5, fill: { color }, line: { color }
});
}
// ── Helper: header band ───────────────────────────────────────────────────────
function addHeaderBand(slide, color = ACCENT) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 13.3, h: 1.1, fill: { color }, line: { color }
});
}
// ── Helper: section tag ────────────────────────────────────────────────────────
function sectionTag(slide, label, x, y, color = ACCENT) {
slide.addShape(pres.ShapeType.rect, {
x, y, w: 2.5, h: 0.32,
fill: { color }, line: { color }, rounding: 0.05
});
slide.addText(label, {
x, y, w: 2.5, h: 0.32,
fontSize: 9, bold: true, color: WHITE, align: "center", valign: "middle",
fontFace: BODY_FONT, margin: 0
});
}
// ── Helper: info box ──────────────────────────────────────────────────────────
function infoBox(slide, x, y, w, h, title, titleColor, items, itemColor = LIGHT) {
slide.addShape(pres.ShapeType.rect, {
x, y, w, h, fill: { color: MID_BG }, line: { color: titleColor, pt: 1.5 }
});
slide.addText(title, {
x: x + 0.12, y: y + 0.08, w: w - 0.24, h: 0.35,
fontSize: 11, bold: true, color: titleColor, fontFace: TITLE_FONT
});
const bullets = items.map((t, i) => ({
text: t,
options: { bullet: { code: "2022", color: titleColor }, breakLine: i < items.length - 1, color: itemColor, fontSize: 9.5, fontFace: BODY_FONT }
}));
slide.addText(bullets, {
x: x + 0.18, y: y + 0.42, w: w - 0.3, h: h - 0.52,
valign: "top"
});
}
// ── Helper: bullet list ───────────────────────────────────────────────────────
function bulletList(slide, x, y, w, h, items, bulletColor = ACCENT, textColor = LIGHT, size = 10.5) {
const arr = items.map((t, i) => ({
text: t,
options: { bullet: { code: "25B6", color: bulletColor }, breakLine: i < items.length - 1, color: textColor, fontSize: size, fontFace: BODY_FONT }
}));
slide.addText(arr, { x, y, w, h, valign: "top" });
}
// ── Helper: step box ─────────────────────────────────────────────────────────
function stepBox(slide, x, y, w, h, num, title, body, numColor = ACCENT, titleColor = WHITE, bodyColor = LIGHT) {
slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: MID_BG }, line: { color: numColor, pt: 1 } });
// Circle number
slide.addShape(pres.ShapeType.ellipse, { x: x + 0.1, y: y + 0.1, w: 0.45, h: 0.45, fill: { color: numColor }, line: { color: numColor } });
slide.addText(String(num), { x: x + 0.1, y: y + 0.1, w: 0.45, h: 0.45, fontSize: 12, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: TITLE_FONT, margin: 0 });
slide.addText(title, { x: x + 0.64, y: y + 0.1, w: w - 0.74, h: 0.42, fontSize: 11, bold: true, color: titleColor, fontFace: TITLE_FONT });
slide.addText(body, { x: x + 0.18, y: y + 0.56, w: w - 0.28, h: h - 0.65, fontSize: 9, color: bodyColor, fontFace: BODY_FONT, valign: "top" });
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE SLIDE
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
// Left dramatic stripe
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 5.2, h: 7.5, fill: { color: ACCENT }, line: { color: ACCENT } });
// Diagonal divider
s.addShape(pres.ShapeType.rect, { x: 4.8, y: 0, w: 0.7, h: 7.5, fill: { color: "B52230" }, line: { color: "B52230" } });
// White overlay text on red
s.addText("HYPOVOLEMIC", { x: 0.3, y: 1.2, w: 4.8, h: 0.9, fontSize: 34, bold: true, color: WHITE, fontFace: TITLE_FONT, charSpacing: 3 });
s.addText("SHOCK", { x: 0.3, y: 2.0, w: 4.8, h: 0.9, fontSize: 56, bold: true, color: WHITE, fontFace: TITLE_FONT, charSpacing: 5 });
s.addText("IN GI BLEEDING", { x: 0.3, y: 2.9, w: 4.8, h: 0.65, fontSize: 26, bold: false, color: "FFD6D9", fontFace: TITLE_FONT, charSpacing: 2 });
// Horizontal rule
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.65, w: 4.4, h: 0.04, fill: { color: WHITE }, line: { color: WHITE } });
s.addText("Emergency Medicine | Critical Care", { x: 0.3, y: 3.75, w: 4.8, h: 0.4, fontSize: 13, color: "FFD6D9", fontFace: BODY_FONT });
// Right side content list
s.addText("Presentation Outline", { x: 5.8, y: 0.8, w: 7.0, h: 0.5, fontSize: 18, bold: true, color: ACCENT2, fontFace: TITLE_FONT });
const topics = [
"01 Definition & Overview",
"02 Pathophysiology",
"03 Hemorrhagic Shock Classification (Class I–IV)",
"04 Signs & Symptoms",
"05 Diagnosis & Risk Stratification",
"06 Emergency Management",
"07 Step-by-Step Treatment Plan",
"08 GI-Specific Interventions",
"09 Special Populations & Pitfalls",
];
topics.forEach((t, i) => {
const yPos = 1.5 + i * 0.55;
s.addShape(pres.ShapeType.rect, { x: 5.7, y: yPos, w: 0.42, h: 0.38, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addText(t.substring(0, 2), { x: 5.7, y: yPos, w: 0.42, h: 0.38, fontSize: 10, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: BODY_FONT, margin: 0 });
s.addText(t.substring(4), { x: 6.2, y: yPos + 0.04, w: 6.8, h: 0.35, fontSize: 11, color: LIGHT, fontFace: BODY_FONT });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — DEFINITION & OVERVIEW
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
addHeaderBand(s, ACCENT);
s.addText("DEFINITION & OVERVIEW", { x: 0.3, y: 0.14, w: 12.5, h: 0.8, fontSize: 26, bold: true, color: WHITE, fontFace: TITLE_FONT });
sectionTag(s, "EMERGENCY MEDICINE", 10.4, 0.2, ACCENT2);
// Left large definition box
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.3, w: 7.5, h: 2.3, fill: { color: MID_BG }, line: { color: ACCENT, pt: 2 } });
s.addText("What is Hypovolemic Shock?", { x: 0.5, y: 1.4, w: 7.1, h: 0.45, fontSize: 14, bold: true, color: ACCENT, fontFace: TITLE_FONT });
s.addText(
"Hypovolemic shock is a life-threatening condition caused by severe intravascular volume depletion. " +
"In GI bleeding, hemorrhage reduces circulating blood volume beyond the heart's ability to maintain " +
"adequate perfusion of vital organs. Loss of >20% of circulating volume is required to produce this syndrome.\n\n" +
"It is the most common form of shock encountered in surgical and emergency practice.",
{ x: 0.5, y: 1.88, w: 7.1, h: 1.6, fontSize: 10.5, color: LIGHT, fontFace: BODY_FONT, valign: "top" }
);
// Right key stats
const stats = [
["~500,000", "UGIB admissions/year (US)"],
["5–10%", "Overall UGIB mortality"],
["10–15%", "Mortality in cirrhosis-related GI bleed"],
[">20%", "Blood volume loss → Shock onset"],
];
stats.forEach(([val, label], i) => {
const xPos = 8.2 + (i % 2) * 2.45;
const yPos = 1.3 + Math.floor(i / 2) * 1.2;
s.addShape(pres.ShapeType.rect, { x: xPos, y: yPos, w: 2.3, h: 1.05, fill: { color: MID_BG }, line: { color: ACCENT2, pt: 1.5 } });
s.addText(val, { x: xPos, y: yPos + 0.08, w: 2.3, h: 0.5, fontSize: 22, bold: true, color: ACCENT2, align: "center", fontFace: TITLE_FONT });
s.addText(label, { x: xPos + 0.1, y: yPos + 0.55, w: 2.1, h: 0.42, fontSize: 9, color: MUTED, align: "center", fontFace: BODY_FONT });
});
// Common causes
s.addText("Common GI Causes of Hemorrhage", { x: 0.3, y: 3.75, w: 6.0, h: 0.4, fontSize: 13, bold: true, color: TEAL, fontFace: TITLE_FONT });
const causes = ["Peptic ulcer disease (PUD) — most common (35–50%)", "Esophageal / gastric varices", "Mallory-Weiss tear", "Gastritis / erosions", "Aortoenteric fistula", "Colorectal cancer, diverticulosis, angiodysplasia"];
bulletList(s, 0.4, 4.18, 5.8, 2.9, causes, ACCENT, LIGHT, 10);
const rightCauses = ["Lower GI: Diverticular bleeding (~40%)", "Angiodysplasia", "Ischemic colitis", "Infectious colitis", "Hemorrhoids / anorectal disease", "Colorectal neoplasm"];
s.addText("Lower GI Sources", { x: 6.5, y: 3.75, w: 6.5, h: 0.4, fontSize: 13, bold: true, color: TEAL, fontFace: TITLE_FONT });
bulletList(s, 6.6, 4.18, 6.4, 2.9, rightCauses, ACCENT2, LIGHT, 10);
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — PATHOPHYSIOLOGY (PART 1)
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
addHeaderBand(s, "14213C");
s.addText("PATHOPHYSIOLOGY", { x: 0.3, y: 0.14, w: 9, h: 0.8, fontSize: 26, bold: true, color: WHITE, fontFace: TITLE_FONT });
s.addText("PART 1: Initial Hemodynamic Response", { x: 0.3, y: 0.85, w: 9, h: 0.4, fontSize: 14, color: ACCENT2, fontFace: BODY_FONT, italic: true });
sectionTag(s, "PHYSIOLOGY", 10.9, 0.2, TEAL);
// Image: cardiac output curve
const imgCO = getImg(0);
if (imgCO) {
s.addImage({ data: imgCO, x: 0.3, y: 1.4, w: 5.2, h: 3.2 });
s.addText("Effect of Hemorrhage on Cardiac Output & Arterial Pressure\n(Guyton & Hall Medical Physiology)", {
x: 0.3, y: 4.55, w: 5.2, h: 0.6, fontSize: 8, color: MUTED, fontFace: BODY_FONT, align: "center", italic: true
});
}
// Right side: mechanism cascade
s.addText("The Hemodynamic Cascade", { x: 5.8, y: 1.35, w: 7.1, h: 0.42, fontSize: 14, bold: true, color: ACCENT2, fontFace: TITLE_FONT });
const cascade = [
{ num: 1, title: "GI Hemorrhage", body: "Blood loss from GI tract → ↓ intravascular volume" },
{ num: 2, title: "↓ Venous Return", body: "Decreased mean systemic filling pressure → ↓ preload" },
{ num: 3, title: "↓ Cardiac Output", body: "Frank-Starling mechanism: ↓ preload → ↓ stroke volume → ↓ CO" },
{ num: 4, title: "↓ Arterial Pressure", body: "Pa = CO × TPR; CO falls first, then Pa follows" },
{ num: 5, title: "Baroreceptor Activation", body: "Aortic arch + carotid baroreceptors fire → sympathetic surge" },
{ num: 6, title: "Sympathetic Compensation", body: "↑ HR, ↑ contractility, arteriolar constriction, venous constriction" },
];
cascade.forEach((c, i) => {
const yy = 1.85 + i * 0.88;
s.addShape(pres.ShapeType.rect, { x: 5.8, y: yy, w: 7.1, h: 0.78, fill: { color: MID_BG }, line: { color: TEAL, pt: 0.8 } });
s.addShape(pres.ShapeType.ellipse, { x: 5.85, y: yy + 0.15, w: 0.48, h: 0.48, fill: { color: TEAL }, line: { color: TEAL } });
s.addText(String(c.num), { x: 5.85, y: yy + 0.15, w: 0.48, h: 0.48, fontSize: 12, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: TITLE_FONT, margin: 0 });
s.addText(c.title, { x: 6.42, y: yy + 0.06, w: 6.3, h: 0.35, fontSize: 10.5, bold: true, color: WHITE, fontFace: TITLE_FONT });
s.addText(c.body, { x: 6.42, y: yy + 0.42, w: 6.3, h: 0.32, fontSize: 9, color: LIGHT, fontFace: BODY_FONT });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — PATHOPHYSIOLOGY PART 2: COMPENSATORY MECHANISMS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
addHeaderBand(s, "14213C");
s.addText("PATHOPHYSIOLOGY", { x: 0.3, y: 0.14, w: 9, h: 0.8, fontSize: 26, bold: true, color: WHITE, fontFace: TITLE_FONT });
s.addText("PART 2: Compensatory Mechanisms & Progressive Failure", { x: 0.3, y: 0.85, w: 11, h: 0.4, fontSize: 14, color: ACCENT2, fontFace: BODY_FONT, italic: true });
// Image: cardiovascular flowchart
const imgFlow = getImg(1);
if (imgFlow) {
s.addImage({ data: imgFlow, x: 0.3, y: 1.35, w: 4.8, h: 3.0 });
s.addText("Cardiovascular Responses to Hemorrhage\n(Costanzo Physiology)", {
x: 0.3, y: 4.3, w: 4.8, h: 0.55, fontSize: 8, color: MUTED, fontFace: BODY_FONT, align: "center", italic: true
});
}
s.addText("Neurohumoral Compensatory Mechanisms", { x: 5.4, y: 1.3, w: 7.6, h: 0.42, fontSize: 13, bold: true, color: TEAL, fontFace: TITLE_FONT });
const mechs = [
["Baroreceptor Reflex", "Rapid ↑ sympathetic outflow → ↑ HR, ↑ TPR, vasoconstriction (within seconds)"],
["CNS Ischemic Response", "Activated when MAP < 50 mmHg → extreme sympathetic burst ('last-stand')"],
["Reverse Stress-Relaxation", "Vessel walls contract around diminished volume, maintaining filling pressure"],
["RAAS Activation", "↑ Renin → Angiotensin II → vasoconstriction + renal Na⁺/H₂O retention (10–60 min)"],
["ADH (Vasopressin)", "Posterior pituitary → vasoconstriction + renal free water retention"],
["Catecholamines", "Adrenal medulla: epinephrine + norepinephrine → ↑ HR, vasoconstriction"],
["Transcapillary Refill", "Interstitial fluid absorbed into capillaries; intestinal fluid absorbed (1–48 hrs)"],
];
mechs.forEach(([t, b], i) => {
const yy = 1.8 + i * 0.75;
s.addShape(pres.ShapeType.rect, { x: 5.4, y: yy, w: 7.6, h: 0.65, fill: { color: MID_BG }, line: { color: TEAL, pt: 0.5 } });
s.addText(t, { x: 5.55, y: yy + 0.04, w: 3.0, h: 0.28, fontSize: 9.5, bold: true, color: TEAL, fontFace: TITLE_FONT });
s.addText(b, { x: 5.55, y: yy + 0.3, w: 7.3, h: 0.3, fontSize: 9, color: LIGHT, fontFace: BODY_FONT });
});
// Vicious cycle box
const imgVC = getImg(2);
if (imgVC) {
s.addImage({ data: imgVC, x: 0.3, y: 4.9, w: 12.7, h: 2.45 });
}
s.addText("Progressive shock: positive feedback → cardiac depression → ischemia → acidosis → irreversible shock (Guyton & Hall)", {
x: 0.3, y: 7.1, w: 12.7, h: 0.3, fontSize: 8, color: MUTED, fontFace: BODY_FONT, align: "center", italic: true
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — HEMORRHAGIC SHOCK CLASSIFICATION
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
addHeaderBand(s, ACCENT);
s.addText("HEMORRHAGIC SHOCK CLASSIFICATION", { x: 0.3, y: 0.14, w: 12.5, h: 0.8, fontSize: 24, bold: true, color: WHITE, fontFace: TITLE_FONT });
s.addText("ATLS System — American College of Surgeons | Blood volume ~4,900 mL in 70 kg adult (7% ideal body weight)", {
x: 0.3, y: 0.88, w: 12.5, h: 0.28, fontSize: 9, color: MUTED, fontFace: BODY_FONT
});
const headers = ["Parameter", "Class I", "Class II", "Class III", "Class IV"];
const colW = [2.4, 2.2, 2.2, 2.2, 2.2];
const rows = [
["Blood Loss (%)", "Up to 15%", "15 – 30%", "30 – 40%", ">40%"],
["Blood Loss (mL)", "<750 mL", "800–1,500 mL", "1,500–2,000 mL", ">2,000 mL"],
["Heart Rate", "Normal <100", "100–120 bpm", "120–140 bpm", ">140 bpm"],
["Blood Pressure", "Normal", "Normal", "Decreased", "Very low/absent"],
["Pulse Pressure", "Normal", "Decreased", "Decreased", "Absent"],
["Resp. Rate", "14–20", "20–30", "30–40", ">35"],
["Urine Output", ">30 mL/hr", "20–30 mL/hr", "5–15 mL/hr", "Negligible"],
["Mental Status", "Normal/Anxious","Mild anxiety", "Confused/combative","Lethargic/comatose"],
["Capillary Refill", "Normal", "Delayed", "Markedly delayed", "Absent"],
["Fluid Resuscitation","Crystalloid", "Crystalloid ±blood","Blood + crystalloid","Immediate blood/surgery"],
];
const classColors = [ACCENT, "C44B00", "9E1B32", "6B0D2B"];
// Header row
let xOff = 0.2;
headers.forEach((h, ci) => {
const col = ci === 0 ? MID_BG : classColors[ci - 1];
s.addShape(pres.ShapeType.rect, { x: xOff, y: 1.25, w: colW[ci], h: 0.42, fill: { color: col }, line: { color: DARK_BG, pt: 0.5 } });
s.addText(h, { x: xOff, y: 1.25, w: colW[ci], h: 0.42, fontSize: 11, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: TITLE_FONT, margin: 2 });
xOff += colW[ci];
});
rows.forEach((row, ri) => {
let xOff2 = 0.2;
row.forEach((cell, ci) => {
const bgColor = ri % 2 === 0 ? DARK_BG : "0A1520";
s.addShape(pres.ShapeType.rect, { x: xOff2, y: 1.67 + ri * 0.53, w: colW[ci], h: 0.53, fill: { color: bgColor }, line: { color: "1E3550", pt: 0.3 } });
const textColor = ci === 0 ? ACCENT2 : LIGHT;
s.addText(cell, { x: xOff2 + 0.05, y: 1.67 + ri * 0.53, w: colW[ci] - 0.1, h: 0.53, fontSize: ci === 0 ? 9.5 : 9, bold: ci === 0, color: textColor, fontFace: BODY_FONT, valign: "middle", align: ci === 0 ? "left" : "center" });
xOff2 += colW[ci];
});
});
s.addText("Source: Mulholland & Greenfield's Surgery, 7e | Sabiston Textbook of Surgery", {
x: 0.2, y: 7.15, w: 12.5, h: 0.28, fontSize: 7.5, color: MUTED, fontFace: BODY_FONT, italic: true
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — SIGNS & SYMPTOMS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
addHeaderBand(s, "5C1A1B");
s.addText("SIGNS & SYMPTOMS", { x: 0.3, y: 0.14, w: 10, h: 0.8, fontSize: 26, bold: true, color: WHITE, fontFace: TITLE_FONT });
sectionTag(s, "CLINICAL FEATURES", 10.5, 0.2, ACCENT2);
// GI bleeding symptoms
infoBox(s, 0.25, 1.25, 4.1, 2.8, "GI Bleeding Manifestations", ACCENT,
[
"Hematemesis (bright red blood or coffee-ground)",
"Melena (black tarry stools — upper GI source)",
"Hematochezia (bright red blood per rectum)",
"Occult blood in stool",
"Nausea, abdominal pain, bloating",
"Syncope / near-syncope (10% with hematochezia)",
]);
// Shock symptoms
infoBox(s, 4.55, 1.25, 4.1, 2.8, "Hemodynamic Shock Signs", ACCENT2,
[
"Tachycardia (earliest & most sensitive sign)",
"Hypotension (SBP <90 mmHg or MAP <65 mmHg)",
"Narrowed pulse pressure (<20 mmHg)",
"Tachypnea (compensatory)",
"Cool, pale, clammy extremities",
"Delayed capillary refill (>2 seconds)",
]);
// Organ perfusion deficit
infoBox(s, 8.85, 1.25, 4.2, 2.8, "End-Organ Hypoperfusion", TEAL,
[
"CNS: Anxiety → confusion → combativeness → coma",
"Renal: Oliguria (↓ urine output <0.5 mL/kg/hr)",
"Myocardial: Ischemia (↓ coronary flow)",
"Skin: Pallor, mottling, cyanosis",
"Metabolic: Lactic acidosis, base deficit",
"GI: Intestinal ischemia, ileus",
]);
// Ortho / positional signs
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 4.2, w: 12.8, h: 1.35, fill: { color: MID_BG }, line: { color: ACCENT, pt: 1 } });
s.addText("Orthostatic Vital Signs & Key Clinical Pearls", { x: 0.4, y: 4.28, w: 8, h: 0.38, fontSize: 12, bold: true, color: ACCENT, fontFace: TITLE_FONT });
const pearls = [
"Orthostatic hypotension (≥20 mmHg SBP drop on standing) indicates ≥15% volume loss",
"Resting tachycardia alone can indicate Class II hemorrhage; hypotension appears late (Class III/IV)",
"Beta-blockers, elderly patients, and athletes may blunt tachycardic response — do not rely on HR alone",
"Shock index (HR/SBP) >1.0 strongly predicts significant hemorrhage and need for transfusion",
];
bulletList(s, 0.4, 4.62, 12.6, 0.9, pearls, ACCENT2, LIGHT, 9.5);
// Echo image (hypovolemic shock ECHO)
const imgEcho = getImg(3);
if (imgEcho) {
s.addImage({ data: imgEcho, x: 0.25, y: 5.65, w: 5.5, h: 1.7 });
s.addText("ECHO: 'Kissing walls' — severely reduced LV cavity in hypovolemic shock", {
x: 5.85, y: 5.75, w: 7.2, h: 0.5, fontSize: 9, color: MUTED, fontFace: BODY_FONT, italic: true, valign: "middle"
});
}
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — DIAGNOSIS & RISK STRATIFICATION
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
addHeaderBand(s, "1D3461");
s.addText("DIAGNOSIS & RISK STRATIFICATION", { x: 0.3, y: 0.14, w: 12.5, h: 0.8, fontSize: 24, bold: true, color: WHITE, fontFace: TITLE_FONT });
sectionTag(s, "WORKUP", 11.0, 0.2, TEAL);
// Lab workup
infoBox(s, 0.25, 1.25, 4.2, 3.4, "Laboratory Workup", TEAL,
[
"CBC: Hemoglobin, hematocrit (may be normal acutely — dilutional delay)",
"BMP/CMP: BUN, creatinine, electrolytes (BUN:Cr ratio >20 suggests upper GI source)",
"Coagulation: PT, INR, aPTT, fibrinogen",
"Type & crossmatch (immediate for active bleeding)",
"Lactate: Marker of tissue hypoperfusion (>2 mmol/L significant)",
"ABG: Base deficit, pH (acidosis indicates severity)",
"Liver function tests (cirrhosis, coagulopathy)",
"Lipase (pancreatitis as cause)",
]);
// Imaging
infoBox(s, 4.65, 1.25, 4.2, 3.4, "Imaging & Endoscopy", ACCENT2,
[
"CXR: Aspiration risk, free air, mediastinal widening",
"Abdominal CT with contrast: Active extravasation, source localization",
"Upper GI Endoscopy (EGD): Gold standard for UGIB — diagnostic + therapeutic",
"Colonoscopy: Lower GI source once hemodynamically stable",
"Tagged RBC scan / angiography: For active bleeding not found on endoscopy",
"Capsule endoscopy: Obscure GI bleeding",
"POINT-OF-CARE ULTRASOUND (POCUS): IVC collapsibility, cardiac function",
]);
// Risk Scores
s.addShape(pres.ShapeType.rect, { x: 9.05, y: 1.25, w: 4.0, h: 3.4, fill: { color: MID_BG }, line: { color: ACCENT, pt: 1.5 } });
s.addText("Risk Stratification Scores", { x: 9.2, y: 1.35, w: 3.7, h: 0.38, fontSize: 11, bold: true, color: ACCENT, fontFace: TITLE_FONT });
s.addText("Glasgow-Blatchford Score (GBS)", { x: 9.2, y: 1.8, w: 3.7, h: 0.3, fontSize: 9.5, bold: true, color: ACCENT2, fontFace: TITLE_FONT });
bulletList(s, 9.2, 2.12, 3.7, 1.05, ["BUN, Hgb, SBP, HR, syncope, melena, hepatic/cardiac disease", "Score 0 = safe for outpatient discharge", "Score ≥1 = inpatient admission required"], ACCENT2, LIGHT, 8.5);
s.addText("Rockall Score (post-endoscopy)", { x: 9.2, y: 3.22, w: 3.7, h: 0.3, fontSize: 9.5, bold: true, color: TEAL, fontFace: TITLE_FONT });
bulletList(s, 9.2, 3.54, 3.7, 1.0, ["Age, shock, comorbidities, diagnosis, stigmata of hemorrhage", "Score ≥5 = high risk of rebleeding and mortality"], TEAL, LIGHT, 8.5);
// Approach algorithm
s.addText("Diagnostic Approach in the ED", { x: 0.25, y: 4.8, w: 13.0, h: 0.38, fontSize: 13, bold: true, color: WHITE, fontFace: TITLE_FONT });
const steps = [
["History", "Onset, NSAID/alcohol/anticoagulant use, prior GI bleed, liver disease"],
["Vitals + POCUS", "Hemodynamic status → shock classification; IVC assessment"],
["Nasogastric Aspirate", "Bloody or coffee-ground aspirate confirms UGIB; clear lavage doesn't exclude"],
["Urgent Labs", "CBC, BMP, coags, type/screen, lactate, ABG"],
["Endoscopy Timing", "Within 24 hrs for hemodynamically stable; immediate (2 hrs) if active GI bleed + shock"],
];
steps.forEach(([t, b], i) => {
const xPos = 0.25 + i * 2.6;
s.addShape(pres.ShapeType.rect, { x: xPos, y: 5.25, w: 2.5, h: 2.0, fill: { color: MID_BG }, line: { color: TEAL, pt: 1 } });
s.addShape(pres.ShapeType.ellipse, { x: xPos + 1.0, y: 5.28, w: 0.5, h: 0.5, fill: { color: TEAL }, line: { color: TEAL } });
s.addText(String(i + 1), { x: xPos + 1.0, y: 5.28, w: 0.5, h: 0.5, fontSize: 12, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: TITLE_FONT, margin: 0 });
s.addText(t, { x: xPos + 0.1, y: 5.82, w: 2.3, h: 0.38, fontSize: 10, bold: true, color: ACCENT2, align: "center", fontFace: TITLE_FONT });
s.addText(b, { x: xPos + 0.1, y: 6.22, w: 2.3, h: 0.95, fontSize: 8.5, color: LIGHT, fontFace: BODY_FONT, valign: "top" });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — EMERGENCY MANAGEMENT (ABCDE + Initial Resuscitation)
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
addHeaderBand(s, ACCENT);
s.addText("EMERGENCY MANAGEMENT", { x: 0.3, y: 0.14, w: 10, h: 0.8, fontSize: 26, bold: true, color: WHITE, fontFace: TITLE_FONT });
s.addText("Primary Survey & Initial Resuscitation", { x: 0.3, y: 0.82, w: 10, h: 0.32, fontSize: 13, color: ACCENT2, fontFace: BODY_FONT, italic: true });
sectionTag(s, "EMERGENCY MEDICINE", 10.3, 0.2, ACCENT2);
const abcde = [
{ letter: "A", label: "Airway", color: ACCENT, items: ["Protect airway in massive hematemesis", "RSI if GCS ≤8 or unprotected airway", "Elevate HOB 30° to reduce aspiration risk", "Suction at bedside"] },
{ letter: "B", label: "Breathing", color: "D4500A", items: ["High-flow O₂ (100% NRB mask)", "Assess SpO₂ and respiratory rate", "Prepare for intubation if tachypnea + fatigue", "Monitor for aspiration pneumonia"] },
{ letter: "C", label: "Circulation", color: ACCENT2, items: ["2 large-bore IVs ≥16G (antecubital)", "IO access if IV access fails", "Warm IV fluids: NS or LR 20 mL/kg bolus", "Send type & crossmatch immediately"] },
{ letter: "D", label: "Disability", color: TEAL, items: ["GCS assessment (baseline)", "Glucose check", "Assess for hepatic encephalopathy in cirrhotics", "Note mental status changes as shock marker"] },
{ letter: "E", label: "Exposure", color: GREEN, items: ["Full exposure — look for external bleeding", "Rectal exam for stool character (melena/hematochezia)", "Abdominal exam: tenderness, rigidity, guarding", "Skin: jaundice, spider angiomata, caput medusae"] },
];
abcde.forEach((item, i) => {
const xPos = 0.15 + i * 2.6;
s.addShape(pres.ShapeType.rect, { x: xPos, y: 1.3, w: 2.5, h: 5.95, fill: { color: MID_BG }, line: { color: item.color, pt: 1.5 } });
// Big letter
s.addShape(pres.ShapeType.rect, { x: xPos, y: 1.3, w: 2.5, h: 0.8, fill: { color: item.color }, line: { color: item.color } });
s.addText(item.letter, { x: xPos, y: 1.3, w: 0.7, h: 0.8, fontSize: 30, bold: true, color: WHITE, align: "center", valign: "middle", fontFace: TITLE_FONT, margin: 0 });
s.addText(item.label, { x: xPos + 0.72, y: 1.44, w: 1.75, h: 0.52, fontSize: 14, bold: true, color: WHITE, fontFace: TITLE_FONT, valign: "middle" });
item.items.forEach((it, j) => {
s.addShape(pres.ShapeType.rect, { x: xPos + 0.12, y: 2.22 + j * 1.2, w: 0.16, h: 0.16, fill: { color: item.color }, line: { color: item.color } });
s.addText(it, { x: xPos + 0.35, y: 2.15 + j * 1.2, w: 2.05, h: 0.95, fontSize: 9, color: LIGHT, fontFace: BODY_FONT, valign: "top" });
});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — STEP-BY-STEP TREATMENT PLAN
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
addHeaderBand(s, GREEN);
s.addText("STEP-BY-STEP TREATMENT PLAN", { x: 0.3, y: 0.14, w: 12.5, h: 0.8, fontSize: 24, bold: true, color: WHITE, fontFace: TITLE_FONT });
sectionTag(s, "TREATMENT PROTOCOL", 10.3, 0.2, ACCENT2);
const steps = [
{
num: 1, title: "Immediate Access & Monitoring",
color: GREEN,
body: "• Two large-bore IVs (≥16G) bilateral antecubital or IO if IV fails\n• Continuous cardiac monitoring, pulse oximetry, capnography\n• Arterial line if Class III/IV shock for continuous BP monitoring\n• Foley catheter for urine output monitoring (target >0.5 mL/kg/hr)\n• Nasogastric tube placement to confirm/clear hematemesis"
},
{
num: 2, title: "Volume Resuscitation",
color: TEAL,
body: "• Warmed isotonic crystalloid: 1–2 L NS or LR rapidly (20 mL/kg bolus)\n• Reassess after each bolus — avoid over-resuscitation (dilutional coagulopathy)\n• Permissive hypotension (MAP 50–65 mmHg) in uncontrolled hemorrhage\n• Do NOT use hypotonic fluids"
},
{
num: 3, title: "Blood Product Transfusion",
color: ACCENT2,
body: "• Packed RBCs: Target Hgb >7 g/dL (>8 g/dL in CAD/elderly)\n• Massive Transfusion Protocol (MTP): 1:1:1 ratio (pRBC:FFP:Platelets)\n• Activate MTP for Class III/IV or ongoing hemodynamic instability\n• Cryoprecipitate if fibrinogen <100 mg/dL\n• Tranexamic acid (TXA) 1g IV over 10 min — especially in variceal/trauma bleed"
},
{
num: 4, title: "Pharmacological Hemostasis",
color: ACCENT,
body: "• Proton pump inhibitor (PPI): Omeprazole/pantoprazole 80 mg IV bolus → 8 mg/hr infusion for non-variceal UGIB\n• Variceal bleeding: Octreotide 50 mcg IV bolus → 50 mcg/hr infusion\n• Vasopressin (terlipressin) for variceal bleeding if octreotide unavailable\n• IV antibiotics (ceftriaxone 1g daily) in cirrhotic patients with GI bleed\n• Hold anticoagulants; reverse if needed (Vitamin K, FFP, PCC)"
},
{
num: 5, title: "Endoscopic Intervention",
color: "9B59B6",
body: "• Urgent EGD: Within 24 hrs (stable) or 2 hrs (unstable with active bleed)\n• Hemostatic techniques: Injection (epinephrine 1:10,000), bipolar coagulation, argon plasma, hemoclips\n• Band ligation or sclerotherapy for esophageal varices\n• TIPS (transjugular intrahepatic portosystemic shunt) if variceal bleeding refractory"
},
{
num: 6, title: "Surgical / IR Intervention",
color: "C0392B",
body: "• Angiographic embolization: Successful in 70–90% of cases when endoscopy fails\n• Surgery indicated: Failure of endoscopy + angiography, or Class IV with hemodynamic collapse\n• Sengstaken-Blakemore tube as temporary bridge (variceal) while awaiting definitive therapy\n• Damage control surgery in massively bleeding patients"
},
];
const colW = 6.45;
steps.forEach((st, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const xPos = 0.2 + col * 6.6;
const yPos = 1.28 + row * 2.05;
s.addShape(pres.ShapeType.rect, { x: xPos, y: yPos, w: colW, h: 1.92, fill: { color: MID_BG }, line: { color: st.color, pt: 1.5 } });
s.addShape(pres.ShapeType.rect, { x: xPos, y: yPos, w: colW, h: 0.48, fill: { color: st.color }, line: { color: st.color } });
s.addText(`STEP ${st.num}`, { x: xPos + 0.1, y: yPos + 0.02, w: 0.8, h: 0.44, fontSize: 9, bold: true, color: WHITE, fontFace: BODY_FONT, valign: "middle" });
s.addText(st.title, { x: xPos + 0.95, y: yPos + 0.06, w: 5.4, h: 0.38, fontSize: 12, bold: true, color: WHITE, fontFace: TITLE_FONT, valign: "middle" });
s.addText(st.body, { x: xPos + 0.12, y: yPos + 0.52, w: colW - 0.22, h: 1.36, fontSize: 8.8, color: LIGHT, fontFace: BODY_FONT, valign: "top" });
});
s.addText("Sources: Rosen's Emergency Medicine | Sabiston Surgery | Mulholland & Greenfield's Surgery | Tintinalli's Emergency Medicine", {
x: 0.2, y: 7.18, w: 12.9, h: 0.28, fontSize: 7.5, color: MUTED, fontFace: BODY_FONT, italic: true
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — GI-SPECIFIC MANAGEMENT & ENDOSCOPY
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
addHeaderBand(s, "1A535A");
s.addText("GI-SPECIFIC MANAGEMENT", { x: 0.3, y: 0.14, w: 10, h: 0.8, fontSize: 26, bold: true, color: WHITE, fontFace: TITLE_FONT });
s.addText("Upper vs. Lower GI Bleeding | Variceal vs. Non-Variceal", { x: 0.3, y: 0.82, w: 11, h: 0.32, fontSize: 12, color: TEAL, fontFace: BODY_FONT, italic: true });
// Endoscopy image
const imgEGD = getImg(4);
if (imgEGD) {
s.addImage({ data: imgEGD, x: 0.25, y: 1.25, w: 5.2, h: 3.1 });
s.addText("Endoscopic views: GI bleeding with melena in colon and ileal coagula", {
x: 0.25, y: 4.35, w: 5.2, h: 0.45, fontSize: 8, color: MUTED, fontFace: BODY_FONT, align: "center", italic: true
});
}
// Non-variceal
infoBox(s, 5.65, 1.25, 3.5, 3.1, "Non-Variceal UGIB", ACCENT2,
[
"PPI infusion (80 mg bolus → 8 mg/hr) before endoscopy",
"IV erythromycin 250 mg (30–90 min pre-scope) to clear stomach",
"Endoscopic hemostasis: epinephrine injection + 2nd modality (clips/thermal)",
"H. pylori testing and eradication post-bleeding",
"Discontinue NSAIDs; COX-2 inhibitors as alternative",
"Forrest classification guides re-bleeding risk",
]);
// Variceal
infoBox(s, 9.35, 1.25, 3.7, 3.1, "Variceal Bleeding (Cirrhosis)", ACCENT,
[
"Octreotide infusion 50 mcg/hr (continue 3–5 days)",
"Ceftriaxone 1g IV daily (reduces mortality — prevents bacterial translocation)",
"Band ligation (preferred) or sclerotherapy for esophageal varices",
"Gastric varices: cyanoacrylate glue injection or TIPS",
"Correct coagulopathy: PLT >50,000, fibrinogen >100 mg/dL",
"Sengstaken-Blakemore tube as bridge if endoscopy fails",
"Beta-blocker therapy (propranolol) for secondary prophylaxis",
]);
// CT angio image
const imgCT = getImg(5);
if (imgCT) {
s.addImage({ data: imgCT, x: 0.25, y: 4.85, w: 5.0, h: 2.4 });
s.addText("CT + endoscopy: Active gastric fundal hemorrhage from bleeding varices\n(Sleisenger & Fordtran's GI and Liver Disease)", {
x: 5.35, y: 5.0, w: 7.7, h: 0.6, fontSize: 8, color: MUTED, fontFace: BODY_FONT, italic: true
});
}
s.addShape(pres.ShapeType.rect, { x: 5.65, y: 4.85, w: 7.4, h: 2.4, fill: { color: MID_BG }, line: { color: GREEN, pt: 1 } });
s.addText("Lower GI Bleeding Management", { x: 5.8, y: 4.9, w: 7.1, h: 0.4, fontSize: 12, bold: true, color: GREEN, fontFace: TITLE_FONT });
const lgi = [
"Initial resuscitation same as UGIB — secure IV access, volume replacement",
"If hemodynamically unstable: rule out UGIB first (NG aspirate or EGD)",
"Urgent colonoscopy after prep (within 24 hrs in stable patients)",
"CT angiography if active bleeding rate >0.5 mL/min — guides intervention",
"Interventional radiology: angiographic embolization for diverticular, angiodysplasia bleeding",
"Surgery (hemicolectomy/segmental resection) for refractory cases or colonic ischemia",
];
bulletList(s, 5.8, 5.35, 7.1, 1.85, lgi, GREEN, LIGHT, 9);
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — SPECIAL POPULATIONS & PITFALLS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
addHeaderBand(s, "5C3D11");
s.addText("SPECIAL POPULATIONS & CLINICAL PITFALLS", { x: 0.3, y: 0.14, w: 12.5, h: 0.8, fontSize: 22, bold: true, color: WHITE, fontFace: TITLE_FONT });
sectionTag(s, "CLINICAL PEARLS", 10.5, 0.2, ACCENT2);
const pops = [
{
title: "Elderly Patients",
color: ACCENT2,
items: [
"Reduced physiologic reserve — decompensate faster",
"Beta-blockers blunt tachycardia (false reassurance)",
"Lower transfusion threshold (target Hgb >8 g/dL if CAD)",
"Higher mortality from peptic ulcer disease",
"NSAIDs commonest offender — review medication list",
]
},
{
title: "Anticoagulated Patients",
color: ACCENT,
items: [
"Reversal: Vitamin K + PCC for warfarin; specific reversal agents for DOACs",
"Idarucizumab for dabigatran; Andexanet alfa for Xa inhibitors",
"Transfusion triggers same as general population",
"Re-initiation of anticoagulation: typically 7–14 days post-bleeding",
"Weigh thromboembolic vs. bleeding risk in shared decision-making",
]
},
{
title: "Cirrhotic Patients",
color: TEAL,
items: [
"Mandatory IV antibiotics (ceftriaxone 1g/day × 7 days)",
"Thrombocytopenia: target PLT >50,000 before endoscopy",
"Avoid excessive crystalloid — worsens ascites and portal HTN",
"Hepatic encephalopathy risk post-bleed (ammonia load from blood)",
"High 6-week mortality: 20–25% in acute variceal hemorrhage",
]
},
{
title: "Pediatric Patients",
color: GREEN,
items: [
"Blood volume ~80 mL/kg (neonates); ~70 mL/kg (children)",
"Initial fluid: 20 mL/kg warm isotonic crystalloid bolus × 2",
"pRBC 10 mL/kg if no improvement after 2 crystalloid boluses",
"MTP >50 mL/kg in children (plasma:pRBC 1:1 ratio)",
"Neonates: umbilical vein access available up to 10 days old",
]
},
];
pops.forEach((p, i) => {
const xPos = 0.2 + i * 3.3;
infoBox(s, xPos, 1.3, 3.1, 3.5, p.title, p.color, p.items);
});
// Pitfalls section
s.addShape(pres.ShapeType.rect, { x: 0.2, y: 5.0, w: 12.9, h: 2.3, fill: { color: MID_BG }, line: { color: ACCENT, pt: 1.5 } });
s.addText("⚠ Common Emergency Pitfalls", { x: 0.38, y: 5.06, w: 12.5, h: 0.42, fontSize: 13, bold: true, color: ACCENT, fontFace: TITLE_FONT });
const pitfalls = [
"Normal H&H on presentation does not exclude massive hemorrhage (hemodilution takes hours)",
"Hemodynamic stability is transient — reassess frequently; shock can evolve within minutes",
"Do not delay endoscopy for stable patients — early endoscopy (≤24 hrs) reduces mortality and length of stay",
"Avoid aggressive crystalloid resuscitation — causes dilutional coagulopathy and worsens bleeding",
"Always consider aortoenteric fistula in patients with prior aortic graft surgery presenting with sentinel GI bleed",
"NG aspirate cannot definitively exclude UGIB — a non-bloody aspirate occurs in 16% of confirmed UGIB",
];
bulletList(s, 0.38, 5.52, 12.6, 1.7, pitfalls, ACCENT, LIGHT, 9.5);
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — SUMMARY & KEY TAKEAWAYS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
setDarkBg(s);
// Full background accent stripe
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: DARK_BG }, line: { color: DARK_BG } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 13.3, h: 1.1, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 6.7, w: 13.3, h: 0.8, fill: { color: "1A1A2E" }, line: { color: "1A1A2E" } });
s.addText("SUMMARY & KEY TAKEAWAYS", { x: 0.3, y: 0.14, w: 12.5, h: 0.8, fontSize: 26, bold: true, color: WHITE, fontFace: TITLE_FONT });
const takeaways = [
{
icon: "①",
color: ACCENT,
title: "Recognize Early",
body: "Tachycardia is the earliest sign. Do not wait for hypotension — it appears late (Class III). Calculate shock index (HR/SBP); >1.0 mandates urgent action."
},
{
icon: "②",
color: ACCENT2,
title: "Classify Severity",
body: "Use ATLS Class I–IV to guide resuscitation intensity. Calculate Glasgow-Blatchford or Rockall score for risk stratification and disposition decisions."
},
{
icon: "③",
color: TEAL,
title: "Resuscitate Strategically",
body: "Warmed crystalloids initially. Activate MTP early for Class III/IV. Target 1:1:1 (pRBC:FFP:PLT). Avoid over-resuscitation — causes dilutional coagulopathy."
},
{
icon: "④",
color: GREEN,
title: "Pharmacotherapy First",
body: "PPI for non-variceal; Octreotide + antibiotics for variceal bleeding (cirrhosis). Correct coagulopathy before endoscopy. Consider TXA in active hemorrhage."
},
{
icon: "⑤",
color: "9B59B6",
title: "Endoscopy = Gold Standard",
body: "Urgent EGD within 24 hrs (or 2 hrs if unstable active bleed). Hemostatic combination therapy reduces rebleeding. Band ligation for varices."
},
{
icon: "⑥",
color: "C0392B",
title: "Escalate When Needed",
body: "Angiographic embolization if endoscopy fails. Surgery for Class IV / refractory. Sengstaken-Blakemore tube as temporizing bridge. Involve GI + surgery early."
},
];
takeaways.forEach((t, i) => {
const row = Math.floor(i / 3);
const col = i % 3;
const xPos = 0.25 + col * 4.35;
const yPos = 1.25 + row * 2.55;
s.addShape(pres.ShapeType.rect, { x: xPos, y: yPos, w: 4.15, h: 2.38, fill: { color: MID_BG }, line: { color: t.color, pt: 1.5 } });
s.addShape(pres.ShapeType.rect, { x: xPos, y: yPos, w: 4.15, h: 0.52, fill: { color: t.color }, line: { color: t.color } });
s.addText(t.icon + " " + t.title, { x: xPos + 0.12, y: yPos + 0.1, w: 3.9, h: 0.38, fontSize: 12, bold: true, color: WHITE, fontFace: TITLE_FONT, valign: "middle" });
s.addText(t.body, { x: xPos + 0.15, y: yPos + 0.6, w: 3.85, h: 1.7, fontSize: 9.5, color: LIGHT, fontFace: BODY_FONT, valign: "top" });
});
s.addText(
"References: Guyton & Hall Medical Physiology 14e | Rosen's Emergency Medicine 9e | Tintinalli's Emergency Medicine 9e | " +
"Sabiston Textbook of Surgery 21e | Mulholland & Greenfield's Surgery 7e | Costanzo Physiology 7e | Sleisenger & Fordtran's GI & Liver Disease",
{ x: 0.2, y: 6.74, w: 12.9, h: 0.42, fontSize: 7.5, color: MUTED, fontFace: BODY_FONT, italic: true, align: "center" }
);
}
// ═══════════════════════════════════════════════════════════════════════════════
// WRITE FILE
// ═══════════════════════════════════════════════════════════════════════════════
const outPath = "/home/daytona/workspace/hypovolemic-shock-gi-bleed/Hypovolemic_Shock_GI_Bleeding.pptx";
pres.writeFile({ fileName: outPath })
.then(() => console.log("✅ PPTX saved to:", outPath))
.catch(err => { console.error("Error:", err); process.exit(1); });