Massive blood transfusion protocol in MD anesthesia ppt

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Searching PubMed

"massive transfusion protocol" AND anesthesia

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

massive transfusion protocol blood components ratio

Finding Sources
Finding Sources
Finding Sources
Running Command

mkdir -p /home/daytona/workspace/mtp-anesthesia-ppt && ls /home/daytona/workspace/mtp-anesthesia-ppt/

Writing File

~/mtp-anesthesia-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "MD Anesthesia";
pres.title = "Massive Blood Transfusion Protocol in Anesthesia";

// ─── COLOR PALETTE ─────────────────────────────────────────────────────────
const C = {
  darkRed:   "8B0000",
  crimson:   "B22222",
  blood:     "C0392B",
  darkBg:    "1A1A2E",
  darkNav:   "16213E",
  panelBg:   "0F3460",
  accent:    "E94560",
  gold:      "F0C040",
  white:     "FFFFFF",
  lightGray: "E8E8E8",
  paleRed:   "FDECEA",
  offWhite:  "F5F5F5",
  green:     "27AE60",
  orange:    "E67E22",
  teal:      "1ABC9C",
  steelBlue: "2980B9",
};

// ─── HELPER: add background rect ───────────────────────────────────────────
function bg(slide, color) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color } });
}

// ─── HELPER: section title bar ─────────────────────────────────────────────
function titleBar(slide, text, sub) {
  // left accent stripe
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.crimson } });
  // top band
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 1.1, fill: { color: C.darkNav } });
  slide.addText(text, { x: 0.2, y: 0.1, w: 9.5, h: 0.7, fontSize: 26, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
  if (sub) {
    slide.addText(sub, { x: 0.2, y: 0.75, w: 9.5, h: 0.35, fontSize: 13, color: C.gold, fontFace: "Calibri", margin: 0 });
  }
}

// ─── HELPER: colored pill badge ────────────────────────────────────────────
function pill(slide, text, x, y, w, h, fill, textColor) {
  slide.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: fill }, line: { color: fill }, rectRadius: 0.08 });
  slide.addText(text, { x, y, w, h, fontSize: 11, bold: true, color: textColor || C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
}

// ─── HELPER: card ──────────────────────────────────────────────────────────
function card(slide, x, y, w, h, header, headerBg, items, itemColor) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: C.white }, line: { color: headerBg, width: 1.5 }, shadow: { type: "outer", blur: 3, offset: 2, angle: 45, color: "AAAAAA" } });
  slide.addShape(pres.ShapeType.rect, { x, y, w, h: 0.35, fill: { color: headerBg } });
  slide.addText(header, { x, y, w, h: 0.35, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  const bulletItems = items.map((t, i) => ({ text: t, options: { bullet: { type: "bullet", code: "25CF", color: headerBg }, color: itemColor || "222222", fontSize: 10, fontFace: "Calibri", breakLine: i < items.length - 1 } }));
  slide.addText(bulletItems, { x: x + 0.1, y: y + 0.38, w: w - 0.2, h: h - 0.4, valign: "top", margin: 2 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.darkBg);
  // blood drop decoration
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.crimson } });
  sl.addShape(pres.ShapeType.rect, { x: 9.82, y: 0, w: 0.18, h: 5.625, fill: { color: C.crimson } });
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.3, w: 10, h: 0.325, fill: { color: C.panelBg } });

  // Red horizontal accent bar mid
  sl.addShape(pres.ShapeType.rect, { x: 1.5, y: 2.05, w: 7, h: 0.06, fill: { color: C.crimson } });
  sl.addShape(pres.ShapeType.rect, { x: 1.5, y: 3.35, w: 7, h: 0.06, fill: { color: C.crimson } });

  sl.addText("MASSIVE BLOOD TRANSFUSION", { x: 0.5, y: 0.7, w: 9, h: 0.85, fontSize: 38, bold: true, color: C.white, align: "center", fontFace: "Calibri", charSpacing: 2, margin: 0 });
  sl.addText("PROTOCOL (MTP)", { x: 0.5, y: 1.45, w: 9, h: 0.65, fontSize: 32, bold: true, color: C.accent, align: "center", fontFace: "Calibri", margin: 0 });
  sl.addText("Anesthesia Perspective — MD Seminar", { x: 1, y: 2.2, w: 8, h: 0.5, fontSize: 18, color: C.gold, align: "center", fontFace: "Calibri", margin: 0 });
  sl.addText([
    { text: "Morgan & Mikhail's Clinical Anesthesiology  |  Miller's Anesthesia  |  Sabiston Textbook of Surgery", options: { fontSize: 11, color: "AAAAAA", breakLine: true } },
    { text: "Rosen's Emergency Medicine  |  Henry's Clinical Diagnosis  |  PROPPR Trial Evidence", options: { fontSize: 11, color: "AAAAAA" } }
  ], { x: 0.5, y: 3.5, w: 9, h: 0.6, align: "center", fontFace: "Calibri", margin: 0 });
  sl.addText("Department of Anaesthesiology & Critical Care  •  May 2026", { x: 0.5, y: 5.3, w: 9, h: 0.3, fontSize: 10, color: C.lightGray, align: "center", fontFace: "Calibri", margin: 0 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — OVERVIEW / TABLE OF CONTENTS
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.offWhite);
  titleBar(sl, "Presentation Overview", "A structured approach to MTP in Anesthesia Practice");

  const topics = [
    ["01", "Definition & Triggers", "When to declare MTP"],
    ["02", "Pathophysiology", "Lethal Triad — Hypothermia · Acidosis · Coagulopathy"],
    ["03", "Blood Products & Ratios", "1:1:1 vs 1:1:2 — PROPPR Trial Evidence"],
    ["04", "Damage Control Resuscitation", "Permissive hypotension, DCR principles"],
    ["05", "Point-of-Care Monitoring", "TEG / ROTEM — Viscoelastic guided therapy"],
    ["06", "Adjuncts", "TXA, Calcium, Vasopressors, Warming"],
    ["07", "Complications", "Hypothermia, Coagulopathy, TACO, TRALI, Electrolytes"],
    ["08", "Anesthesia Checklist", "Practical step-by-step intraoperative guide"],
  ];

  topics.forEach(([num, title, sub], i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.3 + col * 4.9;
    const y = 1.25 + row * 1.05;
    sl.addShape(pres.ShapeType.rect, { x, y, w: 4.6, h: 0.88, fill: { color: col === 0 ? C.darkNav : C.panelBg }, line: { color: C.crimson, width: 1.5 } });
    sl.addShape(pres.ShapeType.rect, { x, y, w: 0.5, h: 0.88, fill: { color: C.crimson } });
    sl.addText(num, { x, y, w: 0.5, h: 0.88, fontSize: 18, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    sl.addText(title, { x: x + 0.55, y: y + 0.04, w: 3.9, h: 0.38, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
    sl.addText(sub, { x: x + 0.55, y: y + 0.42, w: 3.9, h: 0.36, fontSize: 10, color: C.gold, fontFace: "Calibri", margin: 0 });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — DEFINITION & TRIGGERS
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.darkBg);
  titleBar(sl, "Definition & Triggers of MTP", "Morgan & Mikhail 7e · Henry's Clinical Diagnosis · Rosen's EM");

  // Definition box
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.2, w: 9.5, h: 0.75, fill: { color: C.panelBg }, line: { color: C.crimson, width: 2 } });
  sl.addText([
    { text: "DEFINITION: ", options: { bold: true, color: C.gold, fontSize: 13 } },
    { text: "Replacement of ≥1 blood volume within 24 hours  |  OR  ≥10 units pRBC in 24 h  |  OR active blood loss >150 mL/min", options: { color: C.white, fontSize: 13 } }
  ], { x: 0.35, y: 1.2, w: 9.3, h: 0.75, valign: "middle", fontFace: "Calibri", margin: 4 });

  // Practical triggers
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 2.05, w: 4.6, h: 2.85, fill: { color: C.darkNav }, line: { color: C.steelBlue, width: 1 } });
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 2.05, w: 4.6, h: 0.35, fill: { color: C.steelBlue } });
  sl.addText("PRACTICAL TRIGGERS", { x: 0.25, y: 2.05, w: 4.6, h: 0.35, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  sl.addText([
    { text: "≥3 units pRBC in 1 hour with ongoing hemorrhage", options: { bullet: true, breakLine: true } },
    { text: "≥4 blood components in 30 minutes", options: { bullet: true, breakLine: true } },
    { text: "Shock Index (HR/SBP) > 1.0", options: { bullet: true, breakLine: true } },
    { text: "Assessment of Blood Consumption (ABC) score ≥ 2", options: { bullet: true, breakLine: true } },
    { text: "Anticipated massive surgical loss (AAA, liver Tx, trauma)", options: { bullet: true } },
  ].map((i, idx, arr) => ({ text: i.text, options: { ...i.options, color: C.lightGray, fontSize: 11, fontFace: "Calibri", breakLine: idx < arr.length - 1 } })),
  { x: 0.35, y: 2.45, w: 4.4, h: 2.4, valign: "top", margin: 2 });

  // Etiology box
  sl.addShape(pres.ShapeType.rect, { x: 5.15, y: 2.05, w: 4.6, h: 2.85, fill: { color: C.darkNav }, line: { color: C.crimson, width: 1 } });
  sl.addShape(pres.ShapeType.rect, { x: 5.15, y: 2.05, w: 4.6, h: 0.35, fill: { color: C.crimson } });
  sl.addText("COMMON ETIOLOGIES", { x: 5.15, y: 2.05, w: 4.6, h: 0.35, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  const etio = ["Major trauma / polytrauma", "Ruptured aortic aneurysm (AAA)", "GI hemorrhage (esp. with liver disease)", "Obstetric emergencies (PPH, uterine rupture)", "Liver transplantation", "Cardiac / vascular surgery"];
  sl.addText(etio.map((t, i) => ({ text: t, options: { bullet: { code: "25B6", color: C.crimson }, color: C.lightGray, fontSize: 11, fontFace: "Calibri", breakLine: i < etio.length - 1 } })),
  { x: 5.25, y: 2.45, w: 4.4, h: 2.4, valign: "top", margin: 2 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — LETHAL TRIAD
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.darkBg);
  titleBar(sl, "Pathophysiology — The Lethal Triad", "Mulholland & Greenfield Surgery · Sabiston · Miller's Anesthesia");

  // Triangle representation
  const triItems = [
    { label: "HYPOTHERMIA", sub: "< 35°C", desc: "↓ coagulation factor activity\n↓ platelet function\n↓ cardiac output", color: C.steelBlue, x: 3.5, y: 1.15 },
    { label: "ACIDOSIS", sub: "pH < 7.2", desc: "↓ coagulation enzyme activity\n↓ Ca²⁺ sensitivity\nLactic acidosis from hypoperfusion", color: C.crimson, x: 0.3, y: 3.1 },
    { label: "COAGULOPATHY", sub: "TIC / DIC", desc: "Dilution of factors & platelets\nConsumption via DIC\nDysfunction (hypothermia/acidosis)", color: C.orange, x: 6.65, y: 3.1 },
  ];

  triItems.forEach(({ label, sub, desc, color, x, y }) => {
    sl.addShape(pres.ShapeType.roundRect, { x, y, w: 3.1, h: 1.9, fill: { color: C.panelBg }, line: { color, width: 2.5 }, rectRadius: 0.1 });
    sl.addShape(pres.ShapeType.rect, { x, y, w: 3.1, h: 0.4, fill: { color } });
    sl.addText(label, { x, y, w: 3.1, h: 0.4, fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    sl.addText(sub, { x, y: y + 0.4, w: 3.1, h: 0.3, fontSize: 11, bold: true, color: color, align: "center", fontFace: "Calibri", margin: 0 });
    sl.addText(desc, { x: x + 0.1, y: y + 0.72, w: 2.9, h: 1.12, fontSize: 10, color: C.lightGray, fontFace: "Calibri", margin: 0 });
  });

  // Center circle
  sl.addShape(pres.ShapeType.ellipse, { x: 3.95, y: 2.75, w: 2.1, h: 0.85, fill: { color: C.crimson } });
  sl.addText("DEATH", { x: 3.95, y: 2.75, w: 2.1, h: 0.85, fontSize: 16, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });

  // Arrows between
  sl.addText("⟵ feeds ⟶", { x: 3.8, y: 3.8, w: 2.4, h: 0.3, fontSize: 9, color: "999999", align: "center", fontFace: "Calibri", margin: 0 });

  // Bottom note
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 5.1, w: 9.5, h: 0.4, fill: { color: C.panelBg } });
  sl.addText("Each element drives the others — modern DCR targets ALL THREE simultaneously to break the cycle", { x: 0.3, y: 5.1, w: 9.4, h: 0.4, fontSize: 11, italic: true, color: C.gold, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — BLOOD PRODUCTS & RATIOS
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.offWhite);
  titleBar(sl, "Blood Products & Transfusion Ratios", "PROPPR RCT · Henry's · Rosen's · Goldman-Cecil · Morgan & Mikhail");

  // 1:1:1 big badge
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.25, w: 3.2, h: 3.8, fill: { color: C.darkNav }, line: { color: C.crimson, width: 2 } });
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.25, w: 3.2, h: 0.45, fill: { color: C.crimson } });
  sl.addText("RECOMMENDED RATIO", { x: 0.25, y: 1.25, w: 3.2, h: 0.45, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
  sl.addText("1 : 1 : 1", { x: 0.25, y: 1.7, w: 3.2, h: 1.1, fontSize: 46, bold: true, color: C.gold, align: "center", fontFace: "Calibri", margin: 0 });
  sl.addText("pRBC : FFP : Platelets", { x: 0.25, y: 2.75, w: 3.2, h: 0.4, fontSize: 13, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0 });
  sl.addShape(pres.ShapeType.rect, { x: 0.5, y: 3.2, w: 2.7, h: 0.04, fill: { color: C.crimson } });
  sl.addText([
    { text: "PROPPR Trial (JAMA 2015): ", options: { bold: true, color: C.gold } },
    { text: "1:1:1 reduced 24-h exsanguination vs 1:1:2 — no difference in 30-day mortality", options: { color: C.lightGray } },
  ], { x: 0.3, y: 3.28, w: 3.0, h: 1.7, fontSize: 10, fontFace: "Calibri", margin: 2 });

  // Component cards
  const comps = [
    { name: "pRBC", detail: "Hct ~70%\nVolume: ~350 mL/unit\nShelf life: 35–42 days (4°C)\nIndication: Hb < 7–8 g/dL\n(or ongoing hemorrhage)", color: C.crimson },
    { name: "FFP", detail: "Contains all factors\nVolume: ~200 mL/unit\nIndication: PT/aPTT > 1.5× UNL\nGive ABO-compatible\nThaw in 30 min", color: C.steelBlue },
    { name: "Platelets", detail: "1 apheresis unit =\n6–8 pooled units\nVolume: 50–70 mL\nIndication: plt < 50 × 10⁹/L\nStore 20–24°C; 5 days", color: C.teal },
    { name: "Cryo-\nprecipitate", detail: "Rich in: Fibrinogen,\nFactor VIII, vWF, FXIII\nIndication: Fibrinogen < 1 g/L\nGive 10 units (pool)\n= 2–4 g fibrinogen", color: C.orange },
  ];

  comps.forEach(({ name, detail, color }, i) => {
    const x = 3.7 + i * 1.55;
    sl.addShape(pres.ShapeType.rect, { x, y: 1.25, w: 1.45, h: 3.8, fill: { color: C.white }, line: { color, width: 1.5 } });
    sl.addShape(pres.ShapeType.rect, { x, y: 1.25, w: 1.45, h: 0.45, fill: { color } });
    sl.addText(name, { x, y: 1.25, w: 1.45, h: 0.45, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    sl.addText(detail, { x: x + 0.06, y: 1.75, w: 1.33, h: 3.25, fontSize: 9.5, color: "222222", fontFace: "Calibri", margin: 2, valign: "top" });
  });

  // Whole blood note
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 5.1, w: 9.5, h: 0.38, fill: { color: C.panelBg } });
  sl.addText("Cold-stored Low-Titer O Whole Blood (LTOWB): Emerging preference in trauma — provides all components in physiologic balance (Sabiston 2024)", { x: 0.3, y: 5.1, w: 9.4, h: 0.38, fontSize: 10, color: C.gold, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — DAMAGE CONTROL RESUSCITATION
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.darkBg);
  titleBar(sl, "Damage Control Resuscitation (DCR)", "Miller's Anesthesia · Sabiston · Mulholland & Greenfield · Rockwood & Green");

  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.2, w: 9.5, h: 0.55, fill: { color: C.panelBg } });
  sl.addText('"DCR combines an empiric hemostatic resuscitation strategy with permissive hypotension during Phase 1 uncontrolled hemorrhage — the goal is hemostasis, not normalization." — Miller\'s Anesthesia 10e', { x: 0.3, y: 1.2, w: 9.4, h: 0.55, fontSize: 10.5, italic: true, color: C.gold, valign: "middle", fontFace: "Calibri", margin: 4 });

  const pillars = [
    { title: "PERMISSIVE\nHYPOTENSION", items: ["Target SBP 80–90 mmHg\n(unless TBI present)", "Goal: palpable radial pulse\nin non-head-injured", "Avoid aggressive\ncrystalloid resuscitation", "Stops prior to\ndefinitive hemorrhage control"], color: C.steelBlue },
    { title: "EARLY BLOOD\nPRODUCT USE", items: ["Initiate 1:1:1 pRBC:FFP:plt\nbefore labs available", "Avoid dilutional\ncoagulopathy", "Reduced total pRBC use\nby 25% in studies", "Type O pRBC\n+ type AB FFP if no type"], color: C.crimson },
    { title: "DAMAGE CONTROL\nSURGERY", items: ["Abbreviated surgery\n→ ICU → re-look", "Achieve hemostasis &\ncontamination control", "Pack & close\n(staged approach)", "Anesthesia team role:\nbridging physiology"], color: C.orange },
    { title: "AVOID\nCRYSTALLOID", items: ["Normal saline → hyper-\nchloremic acidosis", "Dilutes clotting factors\n& platelets", "Restricted use:\nonly as drug carrier", "Plasma-Lyte preferred\nif crystalloid needed"], color: C.teal },
  ];

  pillars.forEach(({ title, items, color }, i) => {
    const x = 0.25 + i * 2.38;
    sl.addShape(pres.ShapeType.rect, { x, y: 1.85, w: 2.22, h: 3.55, fill: { color: C.darkNav }, line: { color, width: 1.5 } });
    sl.addShape(pres.ShapeType.rect, { x, y: 1.85, w: 2.22, h: 0.5, fill: { color } });
    sl.addText(title, { x, y: 1.85, w: 2.22, h: 0.5, fontSize: 10.5, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    items.forEach((item, j) => {
      sl.addShape(pres.ShapeType.rect, { x: x + 0.1, y: 2.42 + j * 0.75, w: 2.02, h: 0.65, fill: { color: "0D2137" }, line: { color, width: 0.5 } });
      sl.addText(item, { x: x + 0.1, y: 2.42 + j * 0.75, w: 2.02, h: 0.65, fontSize: 9, color: C.lightGray, align: "center", valign: "middle", fontFace: "Calibri", margin: 2 });
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — POC MONITORING (TEG / ROTEM)
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.offWhite);
  titleBar(sl, "Point-of-Care Coagulation Monitoring", "Miller's Anesthesia · Rosen's · Mulholland · Current Surgical Therapy 14e");

  // TEG box
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.25, w: 4.65, h: 4.1, fill: { color: C.darkNav }, line: { color: C.steelBlue, width: 2 } });
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.25, w: 4.65, h: 0.42, fill: { color: C.steelBlue } });
  sl.addText("TEG (Thromboelastography)", { x: 0.25, y: 1.25, w: 4.65, h: 0.42, fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });

  const tegItems = [
    ["R time (reaction)", "Time to first clot formation; ↑ = factor deficiency", C.steelBlue],
    ["K time", "Clot kinetics; ↑ = fibrinogen deficiency", C.teal],
    ["Angle (α)", "Rate of clot strengthening; ↓ = fibrinogen/plt deficiency", C.orange],
    ["MA (max amplitude)", "Clot strength; ↓ = platelet dysfunction or thrombocytopenia", C.crimson],
    ["LY30 / EPL", "Fibrinolysis — ↑ = hyperfibrinolysis → TXA indicated", C.gold],
  ];
  tegItems.forEach(([param, desc, col], i) => {
    sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: 1.78 + i * 0.68, w: 1.3, h: 0.52, fill: { color: col }, rectRadius: 0.05 });
    sl.addText(param, { x: 0.35, y: 1.78 + i * 0.68, w: 1.3, h: 0.52, fontSize: 9.5, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    sl.addText(desc, { x: 1.72, y: 1.78 + i * 0.68, w: 3.1, h: 0.52, fontSize: 9.5, color: C.lightGray, valign: "middle", fontFace: "Calibri", margin: 2 });
  });

  // ROTEM box
  sl.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.25, w: 4.65, h: 4.1, fill: { color: C.darkNav }, line: { color: C.crimson, width: 2 } });
  sl.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.25, w: 4.65, h: 0.42, fill: { color: C.crimson } });
  sl.addText("ROTEM (Rotational Thromboelastometry)", { x: 5.1, y: 1.25, w: 4.65, h: 0.42, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });

  const rotemChannels = [
    ["EXTEM", "Extrinsic pathway — screen overall clot formation", C.crimson],
    ["INTEM", "Intrinsic pathway — hemophilia, heparin effect", C.steelBlue],
    ["FIBTEM", "Fibrin clot strength (platelet-inhibited) — fibrinogen level", C.orange],
    ["APTEM", "Fibrinolysis screen — aprotinin reference channel", C.teal],
    ["MCF (FIBTEM)", "< 9 mm → fibrinogen < 1 g/L → give cryoprecipitate", C.gold],
  ];
  rotemChannels.forEach(([param, desc, col], i) => {
    sl.addShape(pres.ShapeType.roundRect, { x: 5.2, y: 1.78 + i * 0.68, w: 1.3, h: 0.52, fill: { color: col }, rectRadius: 0.05 });
    sl.addText(param, { x: 5.2, y: 1.78 + i * 0.68, w: 1.3, h: 0.52, fontSize: 9.5, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    sl.addText(desc, { x: 6.57, y: 1.78 + i * 0.68, w: 3.1, h: 0.52, fontSize: 9.5, color: C.lightGray, valign: "middle", fontFace: "Calibri", margin: 2 });
  });

  // Bottom note
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 5.1, w: 9.5, h: 0.38, fill: { color: C.panelBg } });
  sl.addText("Evidence: TEG-guided resuscitation reduced mortality vs conventional coagulation assays in trauma (ITACTIC 2020) — viscoelastic testing preferred in MTP", { x: 0.3, y: 5.1, w: 9.4, h: 0.38, fontSize: 10, color: C.gold, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — ADJUNCTS
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.darkBg);
  titleBar(sl, "Adjunct Therapies in MTP", "Miller's Anesthesia · Tintinalli · Current Surgical Therapy 14e · Barash 9e");

  const adjuncts = [
    {
      title: "TRANEXAMIC ACID (TXA)", color: C.steelBlue, x: 0.25, y: 1.2, w: 4.6, h: 2.2,
      items: ["Antifibrinolytic — inhibits plasminogen → plasmin conversion", "CRASH-2 (20,211 pts): ↓ all-cause mortality when given within 3h", "MATTERS trial (military): ↓ mortality especially in MTP patients", "Dose: 1 g IV over 10 min, then 1 g over 8 h", "Give WITHIN 3 HOURS of injury — harm if given later", "Indicated when TEG/ROTEM shows hyperfibrinolysis (LY30 > 3%)"]
    },
    {
      title: "CALCIUM SUPPLEMENTATION", color: C.orange, x: 5.15, y: 1.2, w: 4.6, h: 2.2,
      items: ["Citrate in banked blood chelates ionized Ca²⁺", "Hypocalcemia = ↓ cardiac contractility + coagulation impairment", "Monitor ionized Ca²⁺ every 5–10 units pRBC", "Treat if iCa < 1.1 mmol/L", "CaCl₂ 1 g IV preferred (3× more bioavailable than gluconate)", "Critical in liver failure — impaired citrate metabolism"]
    },
    {
      title: "RECOMBINANT FACTOR VIIa (rFVIIa)", color: C.teal, x: 0.25, y: 3.55, w: 3.0, h: 1.9,
      items: ["Rescue agent — refractory coagulopathic hemorrhage", "pH > 7.2 & Temp > 33°C required for efficacy", "Dose: 90–120 μg/kg IV bolus", "NOT routinely recommended (↑ thrombotic risk)"]
    },
    {
      title: "PROTHROMBIN COMPLEX\nCONCENTRATE (PCC)", color: C.crimson, x: 3.55, y: 3.55, w: 3.0, h: 1.9,
      items: ["Contains Factors II, VII, IX, X", "Reversal of warfarin anticoagulation", "25–50 units/kg IV rapid infusion", "Increasingly used in MTP for factor replacement"]
    },
    {
      title: "VASOPRESSORS", color: C.gold, x: 6.8, y: 3.55, w: 2.95, h: 1.9,
      items: ["Noradrenaline: first-line for vasodilatory shock", "Vasopressin: adjunct in catecholamine-resistant shock", "Avoid before hemorrhage control — ↑ uncontrolled bleeding", "Target MAP ≥ 50–65 mmHg (no TBI)"]
    },
  ];

  adjuncts.forEach(({ title, color, x, y, w, h, items }) => {
    sl.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: C.darkNav }, line: { color, width: 1.5 } });
    sl.addShape(pres.ShapeType.rect, { x, y, w, h: 0.38, fill: { color } });
    sl.addText(title, { x, y, w, h: 0.38, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    sl.addText(items.map((t, i) => ({ text: t, options: { bullet: true, color: C.lightGray, fontSize: 9, fontFace: "Calibri", breakLine: i < items.length - 1 } })),
    { x: x + 0.1, y: y + 0.42, w: w - 0.2, h: h - 0.46, valign: "top", margin: 2 });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — COMPLICATIONS
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.offWhite);
  titleBar(sl, "Complications of Massive Transfusion", "Henry's Clinical Diagnosis · Rosen's EM · Morgan & Mikhail · Tietz Lab Medicine");

  const comps = [
    { title: "HYPOTHERMIA", color: C.steelBlue, items: ["Stored blood temp 1–6°C", "↓ coag factor activity (pH↓)", "Use: blood warmers, forced-air warming blankets, warm IV fluids", "Target: core temp > 36°C"] },
    { title: "COAGULOPATHY / DIC", color: C.crimson, items: ["Dilution of factors & platelets", "Consumptive in trauma/DIC", "Monitor PT, aPTT, fibrinogen, TEG/ROTEM", "Replace: FFP, cryo, plt"] },
    { title: "METABOLIC ACIDOSIS", color: C.orange, items: ["Citrate → bicarbonate (liver)", "Overwhelmed in hepatic failure → net acidosis", "DO NOT give NaHCO₃ empirically", "Optimize O₂ delivery + ventilation"] },
    { title: "HYPOCALCEMIA", color: C.teal, items: ["Citrate chelation of Ca²⁺", "Each unit pRBC reduces iCa ~0.04 mmol/L", "Monitor: check iCa every 5–10 units", "Treat: CaCl₂ 1 g IV"] },
    { title: "TACO", color: C.panelBg, items: ["Transfusion-Associated Circulatory Overload", "SpO₂↓, hypertension, pulmonary edema", "Risk: rapid infusion, cardiac dysfunction", "Treat: diuresis, slow/stop transfusion"] },
    { title: "TRALI", color: "5D4037", items: ["Transfusion-Related Acute Lung Injury", "Anti-HLA / anti-HNA antibodies", "Onset: within 6 h of transfusion", "Hypoxia + bilateral infiltrates (non-cardiac)"] },
  ];

  comps.forEach(({ title, color, items }, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.25 + col * 3.22;
    const y = 1.25 + row * 2.05;
    sl.addShape(pres.ShapeType.rect, { x, y, w: 3.1, h: 1.9, fill: { color: C.white }, line: { color, width: 2 } });
    sl.addShape(pres.ShapeType.rect, { x, y, w: 3.1, h: 0.38, fill: { color } });
    sl.addText(title, { x, y, w: 3.1, h: 0.38, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    sl.addText(items.map((t, idx) => ({ text: t, options: { bullet: true, color: "222222", fontSize: 9.5, fontFace: "Calibri", breakLine: idx < items.length - 1 } })),
    { x: x + 0.1, y: y + 0.42, w: 2.9, h: 1.42, valign: "top", margin: 2 });
  });

  // Electrolytes note
  sl.addShape(pres.ShapeType.rect, { x: 0.25, y: 5.1, w: 9.5, h: 0.38, fill: { color: C.darkNav } });
  sl.addText("Also monitor: Hyperkalemia (stored blood K⁺ leakage) · Hypomagnesemia · Metabolic alkalosis (late — citrate → HCO₃⁻) · Thrombocytopenia · Haemolytic reactions", { x: 0.3, y: 5.1, w: 9.4, h: 0.38, fontSize: 9.5, color: C.gold, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — ANESTHESIA MANAGEMENT CHECKLIST
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.darkBg);
  titleBar(sl, "Anesthesia Management Checklist — Intraoperative MTP", "Miller's Anesthesia 10e · Morgan & Mikhail 7e · Barash 9e");

  const phases = [
    {
      label: "PHASE 1\nPREPARATION", color: C.steelBlue, x: 0.2, y: 1.2, w: 2.35, h: 4.2,
      steps: ["Large-bore IV access (×2, ≥16G)", "Arterial line (radial/femoral)", "Central venous access (consider)", "Blood warmer ready (Level 1 / Belmont)", "Activate MTP with blood bank", "Type & screen / uncrossmatched O-neg RBC", "Pre-warm patient (forced air)", "Notify ICU team"]
    },
    {
      label: "PHASE 2\nINDUCTION", color: C.crimson, x: 2.65, y: 1.2, w: 2.35, h: 4.2,
      steps: ["RSI if full stomach / airway compromise", "Ketamine preferred (↑ SVR, bronchodilation)", "Avoid propofol (vasodilatation)", "Etomidate if haemodynamic instability", "Succinylcholine or rocuronium + sugammadex", "Video laryngoscopy available", "Maintain C-spine precautions in trauma", "Target MAP ≥ 50 mmHg (no TBI)"]
    },
    {
      label: "PHASE 3\nMAINTENANCE", color: C.orange, x: 5.1, y: 1.2, w: 2.35, h: 4.2,
      steps: ["Low-dose volatile + opioid or TIVA", "Monitor: temp (probe), SpO₂, EtCO₂, iCa", "iCa check per 5 units pRBC", "TEG/ROTEM goal-directed transfusion", "Transfuse 1:1:1 until hemorrhage controlled", "TXA 1g IV within 3h of onset", "Vasopressors PRN — noradrenaline first", "Permissive hypotension (no TBI)"]
    },
    {
      label: "PHASE 4\nHANDOVER/ICU", color: C.teal, x: 7.45, y: 1.2, w: 2.35, h: 4.2,
      steps: ["Reverse coagulopathy before closure", "Target: plt > 50, fibrinogen > 2 g/L", "Correction of acidosis + temp > 36°C", "Document: total blood products, labs", "SBAR handover to ICU/PACU team", "Continue warming — hypothermia high risk", "Arrange: repeat labs at 1h post-op", "ICU admission criteria if MTP activated"]
    },
  ];

  phases.forEach(({ label, color, x, y, w, h, steps }) => {
    sl.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: C.darkNav }, line: { color, width: 2 } });
    sl.addShape(pres.ShapeType.rect, { x, y, w, h: 0.52, fill: { color } });
    sl.addText(label, { x, y, w, h: 0.52, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    sl.addText(steps.map((t, i) => ({ text: t, options: { bullet: { code: "25CF", color }, color: C.lightGray, fontSize: 9, fontFace: "Calibri", breakLine: i < steps.length - 1 } })),
    { x: x + 0.1, y: y + 0.56, w: w - 0.2, h: h - 0.6, valign: "top", margin: 2 });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — LABORATORY TARGETS
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.offWhite);
  titleBar(sl, "Laboratory Targets During MTP", "Henry's · Miller's · Barash · Goldman-Cecil Medicine");

  const labs = [
    ["PARAMETER", "ACTION THRESHOLD", "TARGET", "PRODUCT", C.darkNav],
    ["Hb / Haematocrit", "Hb < 7 g/dL (< 10 in cardiac)", "Hb 7–9 g/dL", "pRBC", C.crimson],
    ["Platelet count", "< 50 × 10⁹/L (< 100 in CNS)", "> 50–100 × 10⁹/L", "Platelets", C.teal],
    ["PT / INR", "INR > 1.5", "INR < 1.5", "FFP", C.steelBlue],
    ["aPTT", "> 1.5× upper normal", "< 45 sec", "FFP", C.steelBlue],
    ["Fibrinogen", "< 1.5–2 g/L", "> 2 g/L", "Cryoprecipitate", C.orange],
    ["Ionized Ca²⁺", "< 1.1 mmol/L", "> 1.1 mmol/L", "CaCl₂ 1 g IV", C.gold],
    ["Temp (core)", "< 35°C", "> 36°C", "Warming measures", C.purple || "7D3C98"],
    ["pH / BE", "pH < 7.2 / BE < -6", "pH > 7.3", "Optimize O₂ delivery", C.panelBg],
    ["TEG — MA", "MA < 50 mm", "> 55 mm", "Platelets ± rFVIIa", "5D4037"],
  ];

  const colWidths = [2.3, 2.2, 2.2, 1.9, 1.15]; // ignore last (color)
  labs.forEach((row, ri) => {
    row.slice(0, 4).forEach((cell, ci) => {
      const x = 0.25 + [0, 2.35, 4.6, 6.85, 8.8][ci];
      const y = 1.25 + ri * 0.38;
      const isHeader = ri === 0;
      sl.addShape(pres.ShapeType.rect, { x, y, w: colWidths[ci], h: 0.38, fill: { color: isHeader ? C.darkNav : (ri % 2 === 0 ? "F0F0F0" : C.white) }, line: { color: "CCCCCC", width: 0.5 } });
      sl.addText(cell, { x: x + 0.05, y, w: colWidths[ci] - 0.1, h: 0.38, fontSize: isHeader ? 10 : 9.5, bold: isHeader, color: isHeader ? C.white : (ci === 0 ? "111111" : "222222"), valign: "middle", fontFace: "Calibri", margin: 0 });
    });
    // Color dot in last column
    if (ri > 0) {
      sl.addShape(pres.ShapeType.ellipse, { x: 9.0, y: 1.25 + ri * 0.38 + 0.09, w: 0.2, h: 0.2, fill: { color: row[4] } });
    }
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — SUMMARY / KEY MESSAGES
// ══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  bg(sl, C.darkBg);
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.crimson } });
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.85, fill: { color: C.darkNav } });
  sl.addText("KEY TAKEAWAYS", { x: 0.25, y: 0.0, w: 9.5, h: 0.85, fontSize: 28, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", charSpacing: 3, margin: 0 });

  const messages = [
    { num: "1", text: "Activate MTP EARLY — do not wait for labs. Use clinical triggers: ≥3 pRBC/h or ABC score ≥ 2.", color: C.crimson },
    { num: "2", text: "Transfuse 1:1:1 (pRBC:FFP:Platelets) — PROPPR trial evidence; consider LTOWB where available.", color: C.steelBlue },
    { num: "3", text: "Damage Control Resuscitation: permissive hypotension (SBP 80–90) + minimize crystalloid + early blood products.", color: C.orange },
    { num: "4", text: "TXA within 3 hours of injury — reduces mortality in CRASH-2 and MATTERS; harmful if delayed.", color: C.teal },
    { num: "5", text: "Break the lethal triad: keep patient WARM (>36°C), correct ACIDOSIS, and replace coagulation factors.", color: C.gold },
    { num: "6", text: "Use TEG/ROTEM for goal-directed therapy — superior to conventional labs in guiding blood product choice.", color: "7D3C98" },
  ];

  messages.forEach(({ num, text, color }, i) => {
    const row = Math.floor(i / 2);
    const col = i % 2;
    const x = 0.3 + col * 4.88;
    const y = 1.0 + row * 1.45;
    sl.addShape(pres.ShapeType.rect, { x, y, w: 4.6, h: 1.28, fill: { color: C.darkNav }, line: { color, width: 1.5 } });
    sl.addShape(pres.ShapeType.rect, { x, y, w: 0.5, h: 1.28, fill: { color } });
    sl.addText(num, { x, y, w: 0.5, h: 1.28, fontSize: 22, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
    sl.addText(text, { x: x + 0.58, y: y + 0.1, w: 3.95, h: 1.08, fontSize: 11, color: C.lightGray, valign: "middle", fontFace: "Calibri", margin: 2 });
  });

  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.25, w: 10, h: 0.375, fill: { color: C.panelBg } });
  sl.addText("Sources: Morgan & Mikhail 7e · Miller's Anesthesia 10e · Barash 9e · Sabiston · Rosen's · Henry's · PROPPR (JAMA 2015) · CRASH-2 · MATTERS", { x: 0.2, y: 5.25, w: 9.6, h: 0.375, fontSize: 9, color: "AAAAAA", align: "center", valign: "middle", fontFace: "Calibri", margin: 0 });
}

// ══════════════════════════════════════════════════════════════════════════════
// WRITE FILE
// ══════════════════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/mtp-anesthesia-ppt/MTP_Anesthesia_MD.pptx" })
  .then(() => console.log("SUCCESS: MTP_Anesthesia_MD.pptx created"))
  .catch(err => { console.error("ERROR:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/mtp-anesthesia-ppt && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/mtp-anesthesia-ppt/

Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.
This is a shared conversation. Sign in to Orris to start your own chat.