Myocardial protection during cardiopulmonary bypass. Make pptx

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Searching Images

cardioplegia cardiopulmonary bypass myocardial protection

Running Command

mkdir -p /home/daytona/workspace/myocardial-protection-pptx && ls /home/daytona/workspace/myocardial-protection-pptx/

Writing File

~/myocardial-protection-pptx/create_pptx.js

const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Orris Medical Education";
pres.title = "Myocardial Protection during Cardiopulmonary Bypass";

// ─── Color Palette ────────────────────────────────────────────────────────────
const C = {
  navy:      "0D1B3E",   // dominant background
  darkBlue:  "112244",   // secondary bg panels
  midBlue:   "1A3A6B",   // accent panels
  accent:    "2E86DE",   // bright accent blue
  iceBlue:   "6EC6F5",   // hypothermia cold
  warm:      "E86A2C",   // warm cardioplegia / danger
  gold:      "F4C430",   // callout highlight
  white:     "FFFFFF",
  offWhite:  "E8F0FE",
  light:     "B0C4DE",
  red:       "C0392B",
  green:     "27AE60",
};

// Fetch images via the shared helper
function fetchImages(urls) {
  try {
    const json = execSync(
      `node /home/daytona/skills/shared/scripts/fetch_images.js ${urls.map(u => `"${u}"`).join(" ")}`,
      { timeout: 30000 }
    ).toString();
    return JSON.parse(json);
  } catch (e) {
    console.error("Image fetch error:", e.message);
    return urls.map(() => ({ base64: null, error: e.message }));
  }
}

// Image URLs from search_image results
const IMG_CANNULATION = "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_9aa3b0bcf014f877d1d5c328fa5dc11234d521b426ae7f4c1dccf3ccfbb00bee.jpg";
const IMG_AORTIC_CLAMP = "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_0776e18fd66c71362d6475a9576a0aef7dc4019092ce8534e4b65b3aec5a6c85.jpg";
const IMG_CPB_SETUP    = "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_bf7f0c72a22cb764174bc789e8911ee4328f8d0ae5f47ef7929a4ae0ecb2bf0a.jpg";
const IMG_CABG         = "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_148664081f9ed0032a43b154039df98817fffefae9870b6292adb94e20449411.jpg";

console.log("Fetching images...");
const imgs = fetchImages([IMG_CANNULATION, IMG_AORTIC_CLAMP, IMG_CPB_SETUP, IMG_CABG]);
const [imgCannulation, imgAorticClamp, imgCPBSetup, imgCABG] = imgs;

// ─── Helper: standard slide header ───────────────────────────────────────────
function addHeader(slide, title, subtitle) {
  // top accent bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.07, fill: { color: C.accent }, line: { type: "none" } });
  // nav strip
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.07, w: 10, h: 0.55, fill: { color: C.midBlue }, line: { type: "none" } });
  // title
  slide.addText(title, {
    x: 0.35, y: 0.07, w: 9.3, h: 0.55,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri",
    valign: "middle", margin: 0,
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.35, y: 0.62, w: 9.3, h: 0.28,
      fontSize: 11, color: C.iceBlue, fontFace: "Calibri", italic: true,
      valign: "middle", margin: 0,
    });
  }
}

// ─── Helper: slide background ─────────────────────────────────────────────────
function bgDark(slide) {
  slide.background = { color: C.navy };
}

// ─── Helper: bullet block ────────────────────────────────────────────────────
function bulletBlock(slide, items, opts = {}) {
  const {
    x = 0.35, y = 1.1, w = 9.3, h = 3.8,
    fontSize = 14, color = C.offWhite, indent = 0.2,
  } = opts;
  const textArr = items.map((item, i) => ({
    text: typeof item === "string" ? item : item.text,
    options: {
      bullet: { type: "bullet", indent: indent },
      fontSize: typeof item === "object" && item.sub ? fontSize - 1.5 : fontSize,
      color: typeof item === "object" && item.sub ? C.light : color,
      bold: typeof item === "object" && item.bold ? true : false,
      breakLine: i < items.length - 1,
    },
  }));
  slide.addText(textArr, { x, y, w, h, fontFace: "Calibri", valign: "top" });
}

// ─── SLIDE 1 — Title slide ────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.background = { color: C.navy };

  // left accent stripe
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.accent }, line: { type: "none" } });
  // large bottom gradient bar
  s.addShape(pres.ShapeType.rect, { x: 0.18, y: 4.2, w: 9.82, h: 1.425, fill: { color: C.midBlue }, line: { type: "none" } });

  // heart icon placeholder (decorative circle)
  s.addShape(pres.ShapeType.ellipse, { x: 6.5, y: 0.5, w: 3.0, h: 3.0,
    fill: { type: "solid", color: C.midBlue }, line: { color: C.accent, width: 3 } });
  s.addText("❤", { x: 6.5, y: 0.5, w: 3.0, h: 3.0, fontSize: 80, align: "center", valign: "middle", color: C.accent });

  s.addText("MYOCARDIAL PROTECTION", {
    x: 0.5, y: 0.6, w: 5.8, h: 0.7,
    fontSize: 28, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 2,
  });
  s.addText("during Cardiopulmonary Bypass", {
    x: 0.5, y: 1.25, w: 5.8, h: 0.55,
    fontSize: 22, color: C.iceBlue, fontFace: "Calibri", italic: true,
  });
  s.addShape(pres.ShapeType.line, { x: 0.5, y: 1.85, w: 5.0, h: 0, line: { color: C.accent, width: 2.5 } });
  s.addText([
    { text: "Principles of Myocardial Preservation  •  Cardioplegia  •  Hypothermia  •  Reperfusion Strategies", options: {} }
  ], { x: 0.5, y: 2.0, w: 5.8, h: 0.5, fontSize: 10, color: C.light, fontFace: "Calibri" });

  s.addText("Sources: Morgan & Mikhail's Clinical Anesthesiology 7e  |  Barash Clinical Anesthesia 9e  |  Miller's Anesthesia 10e", {
    x: 0.5, y: 4.3, w: 9.0, h: 0.35,
    fontSize: 9, color: C.light, fontFace: "Calibri",
  });
  s.addText("Cardiac Surgery  •  Anesthesiology", {
    x: 0.5, y: 4.7, w: 9.0, h: 0.35,
    fontSize: 9, color: C.gold, fontFace: "Calibri", bold: true,
  });
}

// ─── SLIDE 2 — Overview / Agenda ─────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Overview", "Key domains of myocardial protection during CPB");

  const topics = [
    { n: "01", title: "The Problem", desc: "Myocardial injury during CPB — mechanisms & risk factors" },
    { n: "02", title: "Aortic Cross-Clamping", desc: "Ischemia from coronary exclusion, safe clamp times" },
    { n: "03", title: "Hypothermia", desc: "Systemic & topical cooling — metabolic rationale" },
    { n: "04", title: "Cardioplegia — Composition", desc: "K⁺, Ca²⁺, Mg²⁺, buffers, substrates, blood vs crystalloid" },
    { n: "05", title: "Delivery Routes", desc: "Antegrade, retrograde, combined strategies" },
    { n: "06", title: "Warm vs Cold Cardioplegia", desc: "Temperature considerations & del Nido solution" },
    { n: "07", title: "Ischemia–Reperfusion Injury", desc: "Free radicals, Ca²⁺ overload, hot shot, reperfusion control" },
    { n: "08", title: "LV Venting & Monitoring", desc: "Decompression, TEE assessment, ECG limitations" },
    { n: "09", title: "Anesthetic Preconditioning", desc: "Volatile agents & ischemic preconditioning" },
    { n: "10", title: "Weaning & Post-Bypass Care", desc: "Protamine, inotropes, hemodynamic support" },
  ];

  const cols = 2;
  const rows = 5;
  const bw = 4.5, bh = 0.72;
  const startX = [0.28, 5.22];
  const startY = 1.05;
  const gap = 0.04;

  topics.forEach((t, i) => {
    const col = i % cols;
    const row = Math.floor(i / cols);
    const x = startX[col];
    const y = startY + row * (bh + gap);

    s.addShape(pres.ShapeType.rect, { x, y, w: bw, h: bh, fill: { color: C.darkBlue }, line: { color: C.midBlue, width: 1 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 0.45, h: bh, fill: { color: C.accent }, line: { type: "none" } });
    s.addText(t.n, { x, y, w: 0.45, h: bh, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(t.title, { x: x + 0.48, y: y + 0.03, w: bw - 0.55, h: 0.3, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
    s.addText(t.desc, { x: x + 0.48, y: y + 0.33, w: bw - 0.55, h: 0.35, fontSize: 9, color: C.light, fontFace: "Calibri", margin: 0 });
  });
}

// ─── SLIDE 3 — The Problem ────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "The Problem: Myocardial Injury during CPB", "Morgan & Mikhail 7e; Barash 9e");

  // left column — mechanisms
  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 0.95, w: 4.5, h: 4.3, fill: { color: C.darkBlue }, line: { color: C.midBlue, width: 1 } });
  s.addText("MECHANISMS OF INJURY", { x: 0.28, y: 0.95, w: 4.5, h: 0.38, fontSize: 11, bold: true, color: C.gold, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "O₂ demand–supply imbalance → cell ischemia",
    "Aortic cross-clamping stops coronary flow",
    "Ventricular fibrillation → ↑ O₂ consumption",
    "LV distension → ↑ wall tension + ↓ subendocardial flow",
    "Reperfusion: free radicals, Ca²⁺ overload, leukocyte–endothelial interaction",
    "Coronary embolism (air, thrombus, fat, atheromatous debris)",
    "Graft occlusion / vasospasm / kinking",
    "Anaerobic metabolism → ATP depletion + acidosis",
  ], { x: 0.38, y: 1.38, w: 4.25, h: 3.8, fontSize: 12 });

  // right column — risk factors + manifestations
  s.addShape(pres.ShapeType.rect, { x: 5.22, y: 0.95, w: 4.5, h: 2.0, fill: { color: C.darkBlue }, line: { color: C.accent, width: 1 } });
  s.addText("HIGH-RISK PATIENTS", { x: 5.22, y: 0.95, w: 4.5, h: 0.38, fontSize: 11, bold: true, color: C.accent, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Poor preoperative ventricular function",
    "Ventricular hypertrophy (pressure/volume overload)",
    "Diffuse severe coronary artery disease",
    "Combination of above factors",
  ], { x: 5.32, y: 1.38, w: 4.3, h: 1.5, fontSize: 12 });

  s.addShape(pres.ShapeType.rect, { x: 5.22, y: 3.0, w: 4.5, h: 2.3, fill: { color: C.darkBlue }, line: { color: C.warm, width: 1 } });
  s.addText("CLINICAL MANIFESTATIONS", { x: 5.22, y: 3.0, w: 4.5, h: 0.38, fontSize: 11, bold: true, color: C.warm, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "↓ Cardiac output at end of bypass",
    "Worsened ventricular function (TEE)",
    "Cardiac arrhythmias",
    "Myocardial stunning → systolic & diastolic dysfunction (reversible)",
    "Myocardial necrosis → irreversible injury",
    { text: "ECG changes often masked by pacing", sub: true },
  ], { x: 5.32, y: 3.43, w: 4.3, h: 1.8, fontSize: 12 });
}

// ─── SLIDE 4 — Aortic Cross-Clamping ─────────────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Aortic Cross-Clamping & Ischemia", "Morgan & Mikhail 7e, p. 817–818");

  // image
  if (imgAorticClamp && imgAorticClamp.base64) {
    s.addImage({ data: imgAorticClamp.base64, x: 5.5, y: 1.0, w: 4.2, h: 3.5 });
    s.addText("Aortic cross-clamp with cardioplegia cannula in situ", {
      x: 5.5, y: 4.45, w: 4.2, h: 0.4, fontSize: 8, color: C.light, italic: true, align: "center",
    });
  }

  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 0.95, w: 5.0, h: 4.3, fill: { color: C.darkBlue }, line: { color: C.midBlue, width: 1 } });
  s.addText("KEY CONCEPTS", { x: 0.28, y: 0.95, w: 5.0, h: 0.35, fontSize: 11, bold: true, color: C.gold, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Cross-clamping completely excludes coronary arteries from bypass flow",
    "Coronary blood flow halts → ischemia begins",
    { text: "Safe cross-clamp time: difficult to define; >120 min ↑ risk", bold: true },
    "Ischemia causes:",
    { text: "Depletion of high-energy phosphates (ATP)", sub: true },
    { text: "Intracellular Ca²⁺ accumulation", sub: true },
    { text: "Shift to anaerobic metabolism → acidosis", sub: true },
    { text: "Fatty acid oxidation impaired", sub: true },
    "Post-clamp ischemia possible via:",
    { text: "Low perfusion pressure, coronary emboli (air/thrombus/fat/plaque)", sub: true },
    { text: "Graft occlusion, vasospasm, cardiac contortion", sub: true },
    "Myocardium distal to high-grade obstruction — most at risk",
  ], { x: 0.38, y: 1.35, w: 4.8, h: 3.8, fontSize: 12 });
}

// ─── SLIDE 5 — Hypothermia ────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Hypothermia: Systemic & Topical", "Barash 9e, p. 3340; Morgan & Mikhail 7e, p. 818");

  // Temperature range graphic
  const tempRanges = [
    { label: "NORMOTHERMIA", temp: "37°C", color: C.warm, x: 0.3 },
    { label: "TEPID", temp: "30–35°C", color: C.gold, x: 2.45 },
    { label: "MILD", temp: "28–32°C", color: C.iceBlue, x: 4.6 },
    { label: "MODERATE", temp: "20–28°C", color: C.accent, x: 6.75 },
    { label: "DEEP", temp: "≤20°C", color: "4169E1", x: 8.5 },
  ];
  const barY = 1.08;
  tempRanges.forEach(t => {
    s.addShape(pres.ShapeType.rect, { x: t.x, y: barY, w: 1.45, h: 0.65, fill: { color: t.color }, line: { type: "none" } });
    s.addText(t.label, { x: t.x, y: barY, w: 1.45, h: 0.35, fontSize: 8, bold: true, color: C.navy, align: "center", valign: "middle", margin: 0 });
    s.addText(t.temp, { x: t.x, y: barY + 0.32, w: 1.45, h: 0.33, fontSize: 9, bold: true, color: C.navy, align: "center", valign: "middle", margin: 0 });
  });

  // two columns
  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 1.85, w: 4.6, h: 3.45, fill: { color: C.darkBlue }, line: { color: C.iceBlue, width: 1 } });
  s.addText("SYSTEMIC HYPOTHERMIA", { x: 0.28, y: 1.85, w: 4.6, h: 0.35, fontSize: 11, bold: true, color: C.iceBlue, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Metabolic O₂ requirement halved per 10°C decrease",
    "~8% decrease in cellular metabolism per °C below 37°C",
    "At 28°C: metabolic rate falls to ~50%",
    "Preserves high-energy phosphate substrates",
    "Inhibits excitatory neurotransmitter release (neuroprotection)",
    "VF often occurs below 28–29°C → establish cardioplegia immediately",
    "Adverse effects: platelet dysfunction, coagulopathy, ↓ myocardial contractility",
    "Tepid bypass: drift to 30–35°C gaining popularity",
    "Deep (≤20°C): allows circulatory arrest up to 60 min (aortic arch, PE surgery)",
  ], { x: 0.38, y: 2.24, w: 4.4, h: 3.0, fontSize: 11 });

  s.addShape(pres.ShapeType.rect, { x: 5.12, y: 1.85, w: 4.6, h: 3.45, fill: { color: C.darkBlue }, line: { color: C.accent, width: 1 } });
  s.addText("TOPICAL CARDIAC COOLING", { x: 5.12, y: 1.85, w: 4.6, h: 0.35, fontSize: 11, bold: true, color: C.accent, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Ice slush bathing of the heart surface",
    "Reduces basal metabolic O₂ consumption",
    "Cold cardioplegia solution (10–15°C) infused into coronary vessels",
    "Direct myocardial temperature monitoring: target 10–15°C",
    "Synergistic with systemic hypothermia",
    "Reduces warming from adjacent aorta and ambient OR air",
    "Must be repeated ~every 30 min (washout + rewarming)",
    "Rewarming via heat exchanger restores temperature post-CPB",
  ], { x: 5.22, y: 2.24, w: 4.4, h: 3.0, fontSize: 11 });
}

// ─── SLIDE 6 — Cardioplegia Composition ──────────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Cardioplegia: Composition", "Morgan & Mikhail 7e, p. 819–820; Barash 9e");

  // Table of components
  const headers = ["Component", "Concentration", "Rationale"];
  const rows = [
    ["Potassium (K⁺)", "10–40 mEq/L (induction)\nLow-K maintenance", "Reduces transmembrane potential → diastolic arrest"],
    ["Sodium (Na⁺)", "< 140 mEq/L (hypotonic)", "Counters ischemic intracellular Na⁺ gain"],
    ["Calcium (Ca²⁺)", "0.7–1.2 mmol/L", "Maintains cellular integrity; avoid excess (Ca²⁺ overload)"],
    ["Magnesium (Mg²⁺)", "1.5–15 mmol/L", "Blocks excessive Ca²⁺ influx into cells"],
    ["Buffer (HCO₃⁻ / Histidine)", "pH ≈ 7.4–7.8", "Neutralise acid metabolites; alkalotic = better preservation"],
    ["Mannitol", "Hyperosmolar", "Free radical scavenger; reduces cellular edema"],
    ["Lidocaine / Steroids", "Membrane stabiliser", "Additional protection; dampens electrical activity"],
    ["Glucose / Glutamate / Aspartate", "Energy substrate", "Supports anaerobic metabolism during arrest"],
    ["Blood (North America)", "4:1 blood:crystalloid (del Nido: 1:4)", "O₂-carrying capacity; metabolic support"],
  ];

  const tColW = [2.2, 2.3, 5.2];
  const tStartX = 0.25;
  const tStartY = 1.0;
  const rowH = 0.42;

  // header row
  let curX = tStartX;
  headers.forEach((h, i) => {
    s.addShape(pres.ShapeType.rect, { x: curX, y: tStartY, w: tColW[i], h: 0.38, fill: { color: C.accent }, line: { type: "none" } });
    s.addText(h, { x: curX + 0.04, y: tStartY, w: tColW[i] - 0.06, h: 0.38, fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });
    curX += tColW[i];
  });

  rows.forEach((row, ri) => {
    const rowY = tStartY + 0.38 + ri * rowH;
    const bg = ri % 2 === 0 ? C.darkBlue : C.midBlue;
    let cx = tStartX;
    row.forEach((cell, ci) => {
      s.addShape(pres.ShapeType.rect, { x: cx, y: rowY, w: tColW[ci], h: rowH, fill: { color: bg }, line: { color: C.navy, width: 0.5 } });
      s.addText(cell, {
        x: cx + 0.04, y: rowY, w: tColW[ci] - 0.06, h: rowH,
        fontSize: ci === 0 ? 10 : 9.5,
        bold: ci === 0,
        color: ci === 0 ? C.gold : C.offWhite,
        fontFace: "Calibri", valign: "middle",
      });
      cx += tColW[ci];
    });
  });
}

// ─── SLIDE 7 — Delivery Routes ───────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Cardioplegia Delivery Routes", "Morgan & Mikhail 7e, p. 820; Barash 9e, p. 3340");

  if (imgCannulation && imgCannulation.base64) {
    s.addImage({ data: imgCannulation.base64, x: 6.55, y: 1.0, w: 3.15, h: 3.0 });
    s.addText("CPB cannulation & cardioplegia cannula setup", {
      x: 6.55, y: 3.95, w: 3.15, h: 0.4, fontSize: 7.5, color: C.light, italic: true, align: "center",
    });
  }

  // ANTEGRADE box
  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 0.98, w: 6.0, h: 2.0, fill: { color: C.darkBlue }, line: { color: C.iceBlue, width: 1.5 } });
  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 0.98, w: 6.0, h: 0.38, fill: { color: C.iceBlue }, line: { type: "none" } });
  s.addText("ANTEGRADE", { x: 0.28, y: 0.98, w: 6.0, h: 0.38, fontSize: 12, bold: true, color: C.navy, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Delivered proximal to aortic cross-clamp → into aortic root",
    "Pressure: 60–100 mmHg",
    "Directly into coronary ostia if AI or coronary artery disease is present",
    "Rapid arrest: 30–60 sec",
    { text: "Limitation: may not reach areas distal to severe coronary obstructions", bold: true },
  ], { x: 0.38, y: 1.4, w: 5.8, h: 1.5, fontSize: 11.5 });

  // RETROGRADE box
  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 3.05, w: 6.0, h: 2.2, fill: { color: C.darkBlue }, line: { color: C.accent, width: 1.5 } });
  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 3.05, w: 6.0, h: 0.38, fill: { color: C.accent }, line: { type: "none" } });
  s.addText("RETROGRADE", { x: 0.28, y: 3.05, w: 6.0, h: 0.38, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Catheter placed via right atrium into coronary sinus",
    "Flow: 200–400 mL/min at venous pressure 30–50 mmHg",
    "Often combined with antegrade for maximal protection in severe CAD",
    "Arrest in ~2–4 min (slower than antegrade)",
    "Also used for individual graft delivery after distal anastomoses in CABG",
    { text: "Advantage: bypasses obstructed coronaries; reaches diffuse disease territory", bold: true },
  ], { x: 0.38, y: 3.48, w: 5.8, h: 1.7, fontSize: 11.5 });
}

// ─── SLIDE 8 — Warm vs Cold Cardioplegia & del Nido ───────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Warm vs Cold Cardioplegia & Special Solutions", "Barash 9e; Morgan & Mikhail 7e, p. 820");

  // Three columns
  const colW = 3.0;
  const colY = 0.98;
  const colH = 4.3;
  const colGap = 0.15;

  // Column 1 — Cold
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: colY, w: colW, h: colH, fill: { color: C.darkBlue }, line: { color: C.iceBlue, width: 1.5 } });
  s.addShape(pres.ShapeType.rect, { x: 0.2, y: colY, w: colW, h: 0.4, fill: { color: C.iceBlue }, line: { type: "none" } });
  s.addText("❄ COLD", { x: 0.2, y: colY, w: colW, h: 0.4, fontSize: 13, bold: true, color: C.navy, align: "center", valign: "middle" });
  bulletBlock(s, [
    "Temperature: 4–15°C",
    "Administered intermittently",
    "Re-dose every 20–30 min",
    "Allows bloodless surgical field",
    "Most widely used globally",
    "Repeated dosing flushes metabolites",
    "Standard potassium arrest solution",
    { text: "May not need continuous monitoring of arrest", sub: true },
  ], { x: 0.3, y: 1.43, w: 2.85, h: 3.8, fontSize: 11 });

  // Column 2 — Warm / Normothermic
  s.addShape(pres.ShapeType.rect, { x: 0.2 + colW + colGap, y: colY, w: colW, h: colH, fill: { color: C.darkBlue }, line: { color: C.warm, width: 1.5 } });
  s.addShape(pres.ShapeType.rect, { x: 0.2 + colW + colGap, y: colY, w: colW, h: 0.4, fill: { color: C.warm }, line: { type: "none" } });
  s.addText("🔥 WARM / TEPID", { x: 0.2 + colW + colGap, y: colY, w: colW, h: 0.4, fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle" });
  bulletBlock(s, [
    "Normothermic: 37°C",
    "Must be delivered CONTINUOUSLY",
    "Associated with better post-op cardiac indices",
    "No protective hypothermia benefit",
    "Concerns: cerebral ischemia risk with normothermia",
    "'Hot shot': warm blood cardioplegia just before reperfusion",
    { text: "Hot shot washes metabolites + replenishes substrates", sub: true },
  ], { x: 0.2 + colW + colGap + 0.1, y: 1.43, w: 2.85, h: 3.8, fontSize: 11 });

  // Column 3 — del Nido
  s.addShape(pres.ShapeType.rect, { x: 0.2 + 2 * (colW + colGap), y: colY, w: colW + 0.35, h: colH, fill: { color: C.darkBlue }, line: { color: C.gold, width: 1.5 } });
  s.addShape(pres.ShapeType.rect, { x: 0.2 + 2 * (colW + colGap), y: colY, w: colW + 0.35, h: 0.4, fill: { color: C.gold }, line: { type: "none" } });
  s.addText("★ DEL NIDO SOLUTION", { x: 0.2 + 2 * (colW + colGap), y: colY, w: colW + 0.35, h: 0.4, fontSize: 11.5, bold: true, color: C.navy, align: "center", valign: "middle" });
  bulletBlock(s, [
    "1 part blood + 4 parts crystalloid",
    "Additives: Lidocaine, MgSO₄, NaHCO₃, Mannitol, KCl",
    "Single-shot for short aortic cross-clamp cases",
    "Arrest lasts longer between re-doses",
    "Popular for congenital cardiac surgery",
    "Reduces interruptions to surgical field",
    { text: "Gaining wide adoption in adult cardiac surgery", sub: true },
  ], { x: 0.2 + 2 * (colW + colGap) + 0.1, y: 1.43, w: colW + 0.2, h: 3.8, fontSize: 11 });
}

// ─── SLIDE 9 — Ischemia–Reperfusion Injury ───────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Ischemia–Reperfusion Injury & Strategies to Limit It", "Morgan & Mikhail 7e, p. 820–821");

  // left: mechanisms
  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 0.98, w: 4.5, h: 2.3, fill: { color: C.darkBlue }, line: { color: C.red, width: 1.5 } });
  s.addText("REPERFUSION INJURY MECHANISMS", { x: 0.28, y: 0.98, w: 4.5, h: 0.38, fontSize: 10.5, bold: true, color: C.red, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Rapid Ca²⁺ accumulation → extensive cell injury / necrosis",
    "Oxygen-derived free radical burst on reperfusion",
    "Abnormal endothelial–leukocyte interactions",
    "Myocardial cellular edema",
    "Altered coronary autoregulation",
  ], { x: 0.38, y: 1.4, w: 4.3, h: 1.8, fontSize: 12 });

  // right: strategies
  s.addShape(pres.ShapeType.rect, { x: 5.22, y: 0.98, w: 4.5, h: 2.3, fill: { color: C.darkBlue }, line: { color: C.green, width: 1.5 } });
  s.addText("PROTECTIVE STRATEGIES", { x: 5.22, y: 0.98, w: 4.5, h: 0.38, fontSize: 10.5, bold: true, color: C.green, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Hot shot: warm blood cardioplegia pre-reperfusion",
    "Low-K wash-out solution just before unclamping",
    "Avoid hypercalcemia in immediate reperfusion period",
    "Controlled reperfusion pressure: start ~40 mmHg → gradually 70 mmHg",
    "Free radical scavengers in priming solution (mannitol)",
  ], { x: 5.32, y: 1.4, w: 4.3, h: 1.8, fontSize: 12 });

  // lower: recovery
  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 3.38, w: 9.44, h: 1.92, fill: { color: C.darkBlue }, line: { color: C.gold, width: 1 } });
  s.addText("RECOVERY PHASE — AFTER CLAMP RELEASE", { x: 0.28, y: 3.38, w: 9.44, h: 0.38, fontSize: 11, bold: true, color: C.gold, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Allow heart to recover in empty (decompressed) state before resuming contracting",
    "Stunned myocardium: reversible systolic & diastolic dysfunction — responds to positive inotropic agents",
    "Reperfusion at reduced pressure minimises further endothelial/myocardial damage",
    "Myocardial necrosis (irreversible): prevented by adequate protection during ischemia",
  ], { x: 0.38, y: 3.8, w: 9.24, h: 1.44, fontSize: 12 });
}

// ─── SLIDE 10 — LV Venting & Monitoring ───────────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "LV Venting & Intraoperative Monitoring", "Morgan & Mikhail 7e, p. 816; Barash 9e, p. 3347");

  if (imgCPBSetup && imgCPBSetup.base64) {
    s.addImage({ data: imgCPBSetup.base64, x: 5.6, y: 1.0, w: 4.1, h: 3.3 });
    s.addText("CPB cannulation with LV vent & cardioplegia lines (annotated)", {
      x: 5.6, y: 4.25, w: 4.1, h: 0.4, fontSize: 7.5, color: C.light, italic: true, align: "center",
    });
  }

  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 0.98, w: 5.0, h: 2.35, fill: { color: C.darkBlue }, line: { color: C.accent, width: 1 } });
  s.addText("LV VENTING", { x: 0.28, y: 0.98, w: 5.0, h: 0.35, fontSize: 11, bold: true, color: C.accent, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Blood reaccumulates in LV via bronchial arteries, thebesian veins, or aortic regurgitation",
    "LV distension: ↑ O₂ consumption + ↓ subendocardial flow → impaired preservation",
    "Vent routes: right superior pulmonary vein → LA → across mitral valve, LV apex, or across aortic valve",
    "Aspirated blood → filtered → returned to venous reservoir",
    { text: "TEE is essential: monitor LV filling / distension throughout CPB", bold: true },
    { text: "Special vigilance for severe AI: antegrade cardioplegia may seep into LV cavity", sub: true },
  ], { x: 0.38, y: 1.37, w: 4.8, h: 1.9, fontSize: 11.5 });

  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 3.37, w: 5.0, h: 1.95, fill: { color: C.darkBlue }, line: { color: C.gold, width: 1 } });
  s.addText("MONITORING ADEQUACY OF PROTECTION", { x: 0.28, y: 3.37, w: 5.0, h: 0.35, fontSize: 11, bold: true, color: C.gold, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "ECG quiescence (flat line confirms arrest)",
    "Time since last cardioplegia dose",
    "Direct myocardial temperature: target 10–15°C",
    "Ventricular chamber fullness (via TEE & vent output)",
    { text: "ECG ischemia changes often difficult to interpret intraoperatively due to pacing", sub: true },
  ], { x: 0.38, y: 3.76, w: 4.8, h: 1.5, fontSize: 11.5 });
}

// ─── SLIDE 11 — Anesthetic Preconditioning ───────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Anesthetic & Ischemic Preconditioning", "Barash 9e, Fuster's Heart 15e");

  // decorative block
  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 0.98, w: 9.44, h: 0.5, fill: { color: C.midBlue }, line: { type: "none" } });
  s.addText("Volatile anesthetics can mimic ischemic preconditioning — a powerful endogenous cardioprotective mechanism", {
    x: 0.35, y: 0.98, w: 9.3, h: 0.5, fontSize: 11.5, color: C.gold, fontFace: "Calibri", italic: true, valign: "middle",
  });

  // two col
  s.addShape(pres.ShapeType.rect, { x: 0.28, y: 1.55, w: 4.5, h: 3.7, fill: { color: C.darkBlue }, line: { color: C.accent, width: 1 } });
  s.addText("ISCHEMIC PRECONDITIONING", { x: 0.28, y: 1.55, w: 4.5, h: 0.38, fontSize: 11, bold: true, color: C.accent, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Brief, sublethal ischemia renders myocardium resistant to subsequent prolonged ischemia",
    "Endogenous protective mechanism activated by ischemia itself",
    "Reduces infarct size, arrhythmias, and reperfusion injury",
    "Mechanisms: KATP channels, adenosine, PKC pathways",
    "Classic IPC: 2–5 min ischemia / reperfusion cycles prior to index ischemia",
  ], { x: 0.38, y: 1.97, w: 4.3, h: 3.2, fontSize: 12 });

  s.addShape(pres.ShapeType.rect, { x: 5.22, y: 1.55, w: 4.5, h: 3.7, fill: { color: C.darkBlue }, line: { color: C.warm, width: 1 } });
  s.addText("VOLATILE ANESTHETIC PRECONDITIONING", { x: 5.22, y: 1.55, w: 4.5, h: 0.38, fontSize: 10, bold: true, color: C.warm, fontFace: "Calibri", align: "center", valign: "middle" });
  bulletBlock(s, [
    "Potent volatile agents (isoflurane, sevoflurane, desflurane) given before (preconditioning) or after (postconditioning) ischemia",
    "Trigger similar intracellular cascade as IPC",
    "Reduces myocardial injury markers (troponin, CK-MB)",
    "May attenuate post-CABG ventricular dysfunction",
    "Evidence: volatile anesthesia may be preferred over TIVA for cardiac surgery",
    { text: "Complex mechanisms: mitochondrial KATP channels, reactive O₂ species signalling", sub: true },
  ], { x: 5.32, y: 1.97, w: 4.3, h: 3.2, fontSize: 12 });
}

// ─── SLIDE 12 — Cardioplegia Pump & Dosing ───────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Cardioplegia Pump & Dosing Regimen", "Morgan & Mikhail 7e; Miller's Anesthesia 10e");

  // DOSING TABLE
  const rows2 = [
    ["Induction / Arrest dose", "High-K solution\n(20–30 mEq/L K⁺)", "1000–1500 mL", "Rapid diastolic arrest within 30–60 sec (antegrade)"],
    ["Maintenance doses", "Low-K solution\n(8–15 mEq/L K⁺)", "200–500 mL every 20–30 min", "Delivers nutrients, flushes metabolites, sustains arrest"],
    ["Hot shot (pre-reperfusion)", "Warm normokalemic blood", "200–400 mL", "Washes metabolites, replenishes energy substrates"],
    ["del Nido single-shot", "1:4 blood:crystalloid\n+ Lido / Mg / bicarb / mannitol / KCl", "Single large dose", "Short cross-clamp cases; prolonged arrest without redosing"],
  ];
  const colW2 = [2.2, 2.2, 2.3, 3.0];
  const hdrs2 = ["Dose Type", "Solution", "Volume", "Purpose"];
  let cx = 0.22;
  hdrs2.forEach((h, i) => {
    s.addShape(pres.ShapeType.rect, { x: cx, y: 1.0, w: colW2[i], h: 0.38, fill: { color: C.accent }, line: { type: "none" } });
    s.addText(h, { x: cx + 0.04, y: 1.0, w: colW2[i] - 0.06, h: 0.38, fontSize: 11, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });
    cx += colW2[i];
  });
  rows2.forEach((row, ri) => {
    const rowY2 = 1.38 + ri * 0.65;
    const bg2 = ri % 2 === 0 ? C.darkBlue : C.midBlue;
    let cx2 = 0.22;
    row.forEach((cell, ci) => {
      s.addShape(pres.ShapeType.rect, { x: cx2, y: rowY2, w: colW2[ci], h: 0.63, fill: { color: bg2 }, line: { color: C.navy, width: 0.5 } });
      s.addText(cell, {
        x: cx2 + 0.04, y: rowY2, w: colW2[ci] - 0.06, h: 0.63,
        fontSize: ci === 0 ? 10.5 : 10,
        bold: ci === 0,
        color: ci === 0 ? C.gold : C.offWhite,
        fontFace: "Calibri", valign: "middle",
      });
      cx2 += colW2[ci];
    });
  });

  // Lower info box
  s.addShape(pres.ShapeType.rect, { x: 0.22, y: 4.04, w: 9.56, h: 1.28, fill: { color: C.darkBlue }, line: { color: C.iceBlue, width: 1 } });
  s.addText("CARDIOPLEGIA PUMP (CPB machine accessory pump):", { x: 0.32, y: 4.07, w: 9.36, h: 0.3, fontSize: 10.5, bold: true, color: C.iceBlue, fontFace: "Calibri" });
  bulletBlock(s, [
    "Provides optimal control over infusion pressure, rate, and temperature  •  Separate heat exchanger for solution temperature control  •  Less common: pressurised cold IV bag",
  ], { x: 0.32, y: 4.37, w: 9.36, h: 0.88, fontSize: 11 });
}

// ─── SLIDE 13 — Weaning & Post-Bypass ────────────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Weaning from CPB & Post-Bypass Care", "Miller's Anesthesia 10e; Morgan & Mikhail 7e");

  const steps = [
    { n: "1", title: "Rewarm", body: "Restore core temperature to 37°C via heat exchanger. Confirm adequate rewarming before weaning." },
    { n: "2", title: "De-air Heart", body: "Evacuate air from cardiac chambers to prevent coronary / cerebral air embolism." },
    { n: "3", title: "Restore Rhythm", body: "Confirm regular electrical activity; support with pacemaker if needed (heart block common post-ischemia)." },
    { n: "4", title: "Resume Ventilation", body: "Restart ventilation; confirm ABG / electrolytes; correct coagulopathy if present." },
    { n: "5", title: "Wean Bypass Flow", body: "Gradually ↓ venous drainage / arterial pump flow while monitoring haemodynamics and TEE." },
    { n: "6", title: "Terminate CPB", body: "When CO maintained; replace volume from reservoir; support with vasopressors / inotropes as needed." },
    { n: "7", title: "Protamine Reversal", body: "1–1.3 mg protamine per 100 units heparin, given slowly over 5–10 min. Verify reversal with ACT. Communicate with perfusionist before administration." },
    { n: "8", title: "Haemodynamic Support", body: "Inotropes, vasopressors, IABP, or ECMO for inadequate cardiac output. Stunned myocardium may recover with time + inotropic support." },
  ];

  const bw2 = 4.6, bh2 = 0.6;
  const cols2 = 2;
  const gapX = 0.28, gapY = 0.06;
  const sY = 1.0;
  const sX = [0.28, 5.12];

  steps.forEach((st, i) => {
    const col = i % cols2;
    const row = Math.floor(i / cols2);
    const x = sX[col];
    const y = sY + row * (bh2 + gapY);
    s.addShape(pres.ShapeType.rect, { x, y, w: bw2, h: bh2, fill: { color: C.darkBlue }, line: { color: C.midBlue, width: 1 } });
    s.addShape(pres.ShapeType.rect, { x, y, w: 0.38, h: bh2, fill: { color: C.accent }, line: { type: "none" } });
    s.addText(st.n, { x, y, w: 0.38, h: bh2, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(st.title, { x: x + 0.42, y: y + 0.02, w: bw2 - 0.5, h: 0.24, fontSize: 11, bold: true, color: C.gold, fontFace: "Calibri", margin: 0 });
    s.addText(st.body, { x: x + 0.42, y: y + 0.26, w: bw2 - 0.5, h: 0.3, fontSize: 9.5, color: C.offWhite, fontFace: "Calibri", margin: 0 });
  });
}

// ─── SLIDE 14 — Summary / Key Takeaways ──────────────────────────────────────
{
  const s = pres.addSlide();
  bgDark(s);
  addHeader(s, "Key Takeaways", "Myocardial Protection during Cardiopulmonary Bypass");

  const points = [
    { icon: "⚡", color: C.red, title: "Ischemia is inevitable", body: "Aortic cross-clamping halts coronary flow; virtually all patients sustain some myocardial injury — minimise it, don't ignore it." },
    { icon: "❄", color: C.iceBlue, title: "Hypothermia is foundational", body: "Systemic + topical cooling reduces O₂ demand ~50% at 28°C. Target myocardial temp 10–15°C." },
    { icon: "💊", color: C.gold, title: "Cardioplegia = electromechanical silence", body: "K⁺-induced diastolic arrest + metabolic additives (buffers, Mg²⁺, mannitol, energy substrates) = minimal energy expenditure." },
    { icon: "🔄", color: C.accent, title: "Route matters for protection", body: "Combined antegrade + retrograde cardioplegia maximises coverage, especially in severe CAD." },
    { icon: "🔥", color: C.warm, title: "Reperfusion is a second injury", body: "Controlled pressure, hot shot, free radical scavengers, and empty-heart recovery limit ischemia–reperfusion injury." },
    { icon: "👁", color: C.green, title: "TEE + vigilance throughout", body: "Monitor LV distension, cardioplegia effectiveness, and ventricular function continuously. Inadequate protection = arrhythmias + low CO on weaning." },
  ];

  const bw3 = 4.55, bh3 = 0.75;
  const sX3 = [0.28, 5.17];
  const sY3 = 0.98;
  const gap3 = 0.05;

  points.forEach((p, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x3 = sX3[col];
    const y3 = sY3 + row * (bh3 + gap3);
    s.addShape(pres.ShapeType.rect, { x: x3, y: y3, w: bw3, h: bh3, fill: { color: C.darkBlue }, line: { color: p.color, width: 1.5 } });
    s.addText(p.icon, { x: x3 + 0.06, y: y3, w: 0.5, h: bh3, fontSize: 22, align: "center", valign: "middle" });
    s.addText(p.title, { x: x3 + 0.6, y: y3 + 0.04, w: bw3 - 0.68, h: 0.3, fontSize: 11.5, bold: true, color: p.color, fontFace: "Calibri" });
    s.addText(p.body, { x: x3 + 0.6, y: y3 + 0.34, w: bw3 - 0.68, h: 0.38, fontSize: 9.5, color: C.offWhite, fontFace: "Calibri" });
  });

  // footer
  s.addShape(pres.ShapeType.line, { x: 0.28, y: 5.22, w: 9.44, h: 0, line: { color: C.accent, width: 1 } });
  s.addText("Sources: Morgan & Mikhail's Clinical Anesthesiology 7e  •  Barash Clinical Anesthesia 9e  •  Miller's Anesthesia 10e  •  Fuster and Hurst's The Heart 15e", {
    x: 0.28, y: 5.27, w: 9.44, h: 0.28, fontSize: 8, color: C.light, fontFace: "Calibri", italic: true,
  });
}

// ─── Write file ───────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/myocardial-protection-pptx/Myocardial_Protection_CPB.pptx";
pres.writeFile({ fileName: outPath })
  .then(() => console.log("✅ PPTX created:", outPath))
  .catch(e => { console.error("Error:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/myocardial-protection-pptx && node create_pptx.js 2>&1

Running Command

ls -lh /home/daytona/workspace/myocardial-protection-pptx/Myocardial_Protection_CPB.pptx

Your presentation is ready:

Myocardial Protection CPB

Presentation · PPTX


14 slides built from Morgan & Mikhail 7e, Barash Clinical Anesthesia 9e, and Miller's Anesthesia 10e, with intraoperative clinical photographs embedded:
SlideContent
1Title slide
2Overview / agenda (10 topics)
3The problem — mechanisms of injury & risk factors
4Aortic cross-clamping & coronary ischemia (with clinical photo)
5Hypothermia — systemic & topical, temperature ranges
6Cardioplegia composition table — K⁺, Ca²⁺, Mg²⁺, buffers, substrates, blood vs crystalloid
7Delivery routes — antegrade vs retrograde (with CPB cannulation photo)
8Warm vs cold vs del Nido solution comparison
9Ischemia–reperfusion injury + protective strategies
10LV venting & intraoperative monitoring (with annotated CPB setup photo)
11Anesthetic & ischemic preconditioning (volatile agents)
12Cardioplegia pump & dosing regimen table
13Weaning from CPB — 8-step sequence including protamine reversal
14Key takeaways summary
Design uses a navy/deep-blue palette with ice-blue and warm orange accents to visually separate cold vs warm concepts throughout.
This is a shared conversation. Sign in to Orris to start your own chat.