Priapism all important things in urology make a ppt 15/20 pages

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Running Command

ls -la /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/priapism-ppt

Running Command

mkdir -p /home/daytona/priapism-ppt && ls /home/daytona/

Writing File

/home/daytona/priapism-ppt/priapism.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Priapism - A Urological Emergency";
pres.author = "Urology";

// ─── COLOR PALETTE ────────────────────────────────────────────────────────
const DARK_NAVY   = "0D1B2A";  // dominant background for title/section slides
const MID_BLUE    = "1B4F72";  // secondary dark
const ACCENT      = "2E86C1";  // bright blue accent
const LIGHT_BLUE  = "AED6F1";  // subtle tint
const WHITE       = "FFFFFF";
const LIGHT_GRAY  = "F2F6FA";
const DARK_TEXT   = "1A1A2E";
const RED_ALERT   = "C0392B";  // emergency emphasis
const GOLD        = "F1C40F";  // highlight accent

// ─── HELPER: add slide header bar ─────────────────────────────────────────
function addHeader(slide, title) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 0.85,
    fill: { color: DARK_NAVY }, line: { color: DARK_NAVY }
  });
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0.85, w: 10, h: 0.06,
    fill: { color: ACCENT }, line: { color: ACCENT }
  });
  slide.addText(title, {
    x: 0.3, y: 0.05, w: 9.4, h: 0.75,
    fontSize: 22, bold: true, color: WHITE, fontFace: "Calibri",
    valign: "middle", margin: 0
  });
}

// ─── HELPER: add body content slide ───────────────────────────────────────
function addContentSlide(title, bullets) {
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, title);
  slide.addText(bullets, {
    x: 0.4, y: 1.05, w: 9.2, h: 4.3,
    fontSize: 16, color: DARK_TEXT, fontFace: "Calibri",
    valign: "top", margin: 4
  });
  return slide;
}

// ─── HELPER: two-column slide ─────────────────────────────────────────────
function addTwoColSlide(title, col1Label, col1Bullets, col2Label, col2Bullets, col1Color, col2Color) {
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, title);

  const colY = 1.05, colH = 4.3;

  // Left column
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.25, y: colY, w: 4.55, h: colH,
    fill: { color: col1Color || DARK_NAVY }, line: { color: col1Color || DARK_NAVY },
    rectRadius: 0.08
  });
  slide.addText(col1Label, {
    x: 0.35, y: colY + 0.05, w: 4.35, h: 0.45,
    fontSize: 14, bold: true, color: GOLD, fontFace: "Calibri",
    align: "center", margin: 0
  });
  slide.addText(col1Bullets, {
    x: 0.35, y: colY + 0.55, w: 4.35, h: colH - 0.65,
    fontSize: 13.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 4
  });

  // Right column
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 5.2, y: colY, w: 4.55, h: colH,
    fill: { color: col2Color || MID_BLUE }, line: { color: col2Color || MID_BLUE },
    rectRadius: 0.08
  });
  slide.addText(col2Label, {
    x: 5.3, y: colY + 0.05, w: 4.35, h: 0.45,
    fontSize: 14, bold: true, color: GOLD, fontFace: "Calibri",
    align: "center", margin: 0
  });
  slide.addText(col2Bullets, {
    x: 5.3, y: colY + 0.55, w: 4.35, h: colH - 0.65,
    fontSize: 13.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 4
  });
  return slide;
}

// ─── HELPER: section divider ──────────────────────────────────────────────
function addSectionSlide(number, text, sub) {
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625,
    fill: { color: DARK_NAVY }, line: { color: DARK_NAVY }
  });
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 2.5, w: 0.18, h: 0.8,
    fill: { color: ACCENT }, line: { color: ACCENT }
  });
  slide.addText(number, {
    x: 0.5, y: 0.8, w: 9, h: 1,
    fontSize: 52, bold: true, color: ACCENT, fontFace: "Calibri",
    align: "left", margin: 0
  });
  slide.addText(text, {
    x: 0.5, y: 1.7, w: 9, h: 1.2,
    fontSize: 28, bold: true, color: WHITE, fontFace: "Calibri",
    align: "left", margin: 0
  });
  if (sub) {
    slide.addText(sub, {
      x: 0.5, y: 2.85, w: 9, h: 0.6,
      fontSize: 16, color: LIGHT_BLUE, fontFace: "Calibri",
      align: "left", margin: 0, italic: true
    });
  }
  return slide;
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 1 — TITLE
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  // Full dark background
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625,
    fill: { color: DARK_NAVY }, line: { color: DARK_NAVY }
  });
  // Accent strip
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 4.1, w: 10, h: 0.08,
    fill: { color: ACCENT }, line: { color: ACCENT }
  });
  // Decorative left bar
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 0.25, h: 5.625,
    fill: { color: ACCENT }, line: { color: ACCENT }
  });
  // EMERGENCY badge
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.6, y: 0.35, w: 2.5, h: 0.45,
    fill: { color: RED_ALERT }, line: { color: RED_ALERT }, rectRadius: 0.08
  });
  slide.addText("UROLOGICAL EMERGENCY", {
    x: 0.6, y: 0.35, w: 2.5, h: 0.45,
    fontSize: 10, bold: true, color: WHITE, fontFace: "Calibri",
    align: "center", valign: "middle", margin: 0
  });

  slide.addText("PRIAPISM", {
    x: 0.5, y: 0.9, w: 9, h: 1.6,
    fontSize: 64, bold: true, color: WHITE, fontFace: "Calibri",
    align: "left", margin: 0, charSpacing: 8
  });
  slide.addText("Pathophysiology • Classification • Diagnosis • Management", {
    x: 0.5, y: 2.55, w: 9, h: 0.6,
    fontSize: 17, color: LIGHT_BLUE, fontFace: "Calibri",
    align: "left", margin: 0
  });
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0.5, y: 3.25, w: 3, h: 0.04,
    fill: { color: ACCENT }, line: { color: ACCENT }
  });
  slide.addText("A Comprehensive Urology Review", {
    x: 0.5, y: 3.4, w: 9, h: 0.5,
    fontSize: 14, color: LIGHT_BLUE, fontFace: "Calibri",
    align: "left", italic: true, margin: 0
  });
  slide.addText("Source: Smith & Tanagho's General Urology • Campbell-Walsh-Wein Urology", {
    x: 0.5, y: 4.25, w: 9, h: 0.4,
    fontSize: 11, color: LIGHT_BLUE, fontFace: "Calibri",
    align: "left", margin: 0, italic: true
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 2 — DEFINITION & OVERVIEW
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Definition & Overview");

  // Definition box
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.3, y: 1.0, w: 9.4, h: 1.1,
    fill: { color: ACCENT }, line: { color: ACCENT }, rectRadius: 0.1
  });
  slide.addText([
    { text: "Definition: ", options: { bold: true, color: WHITE } },
    { text: "A prolonged, persistent penile erection unrelated to sexual interest or stimulation lasting ", options: { color: WHITE } },
    { text: ">4 hours", options: { bold: true, color: GOLD } },
    { text: " — constituting a urological emergency", options: { color: WHITE } }
  ], {
    x: 0.5, y: 1.05, w: 9, h: 1.0,
    fontSize: 15.5, fontFace: "Calibri", valign: "middle", margin: 4
  });

  slide.addText([
    { text: "Key characteristics:\n", options: { bold: true, breakLine: true } },
    { text: "• Tumescence restricted primarily to the corpora cavernosa\n", options: { breakLine: true } },
    { text: "• Corpus spongiosum and glans penis typically NOT involved\n", options: { breakLine: true } },
    { text: "• Named after Priapus, Greek/Roman god of fertility\n", options: { breakLine: true } },
    { text: "• Incidence: up to 5.34 per 100,000 men per year (ischemic type)\n", options: { breakLine: true } },
    { text: "• Idiopathic in ~60% of cases; remaining 40% have identifiable cause\n", options: { breakLine: true } },
    { text: "• Most frequently affects men in 3rd-4th decade; also seen in pediatric sickle cell patients", options: {} }
  ], {
    x: 0.4, y: 2.25, w: 9.2, h: 3.1,
    fontSize: 15, color: DARK_TEXT, fontFace: "Calibri", valign: "top", margin: 4
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 3 — CLASSIFICATION (3 types)
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Classification of Priapism");

  const cards = [
    { x: 0.2,  label: "1. ISCHEMIC", sub: "(Low-Flow / Veno-Occlusive)", color: "8B0000", pts: ["Most common type","Venous outflow obstruction","Stagnant, hypoxic blood","Painful, rigid corpora","EMERGENCY — time sensitive","Cavernous blood: low O₂, high CO₂, acidotic"] },
    { x: 3.55, label: "2. NON-ISCHEMIC", sub: "(High-Flow / Arterial)", color: MID_BLUE, pts: ["Less common","Cavernosal artery fistula","Unregulated arterial inflow","Painless, partially rigid","NOT a medical emergency","High-O₂ bright red blood on aspiration"] },
    { x: 6.9,  label: "3. STUTTERING", sub: "(Recurrent / Intermittent)", color: "4A235A", pts: ["Recurrent ischemic episodes","Short-lived, self-limiting","Common in sickle cell disease","Precursor to fulminant priapism","PDE5 dysregulation implicated","Painful episodes with detumescence"] }
  ];

  cards.forEach(c => {
    slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x: c.x, y: 1.0, w: 3.15, h: 4.35,
      fill: { color: c.color }, line: { color: c.color }, rectRadius: 0.1
    });
    slide.addText(c.label, {
      x: c.x + 0.1, y: 1.05, w: 2.95, h: 0.4,
      fontSize: 13, bold: true, color: GOLD, fontFace: "Calibri",
      align: "center", margin: 0
    });
    slide.addText(c.sub, {
      x: c.x + 0.1, y: 1.42, w: 2.95, h: 0.3,
      fontSize: 10.5, color: LIGHT_BLUE, fontFace: "Calibri",
      align: "center", italic: true, margin: 0
    });
    slide.addShape(pres.shapes.RECTANGLE, {
      x: c.x + 0.2, y: 1.74, w: 2.75, h: 0.03,
      fill: { color: GOLD }, line: { color: GOLD }
    });
    const bulletText = c.pts.map((p, i) => ({
      text: "• " + p,
      options: { breakLine: i < c.pts.length - 1, color: WHITE }
    }));
    slide.addText(bulletText, {
      x: c.x + 0.12, y: 1.82, w: 2.91, h: 3.4,
      fontSize: 12, fontFace: "Calibri", valign: "top", margin: 3
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 4 — ETIOLOGY / CAUSES
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Etiology & Predisposing Factors");

  const cats = [
    { label: "Hematologic", color: "6E2C00", items: ["Sickle cell disease (most common in children)","Leukemia / lymphoma","Thalassemia","G6PD deficiency","Polycythemia"] },
    { label: "Medications", color: "145A32", items: ["Intracavernous injections (papaverine, PGE1)","Trazodone (antidepressant)","Chlorpromazine / antipsychotics","Prazosin / α-blockers","Heparin, warfarin"] },
    { label: "Neurological", color: "154360", items: ["Spinal cord injury","Cauda equina compression","Autonomic neuropathy","Cerebrovascular accident","Multiple sclerosis"] },
    { label: "Other Causes", color: "4A235A", items: ["Perineal / penile trauma (high-flow)","Pelvic tumors / metastases","Pelvic infections","Idiopathic (60%)","Recreational drugs (cocaine, alcohol)"] }
  ];

  cats.forEach((c, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.2 : 5.1;
    const y = row === 0 ? 1.0 : 3.2;
    slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y, w: 4.65, h: 2.0,
      fill: { color: c.color }, line: { color: c.color }, rectRadius: 0.08
    });
    slide.addText(c.label, {
      x: x + 0.1, y: y + 0.07, w: 4.45, h: 0.35,
      fontSize: 13, bold: true, color: GOLD, fontFace: "Calibri",
      align: "left", margin: 0
    });
    const bulletText = c.items.map((item, idx) => ({
      text: "• " + item,
      options: { breakLine: idx < c.items.length - 1, color: WHITE }
    }));
    slide.addText(bulletText, {
      x: x + 0.1, y: y + 0.45, w: 4.45, h: 1.45,
      fontSize: 12, fontFace: "Calibri", valign: "top", margin: 2
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 5 — PATHOPHYSIOLOGY
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Pathophysiology");

  // Ischemic pathway (left)
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.2, y: 1.0, w: 4.6, h: 4.35,
    fill: { color: DARK_NAVY }, line: { color: DARK_NAVY }, rectRadius: 0.1
  });
  slide.addText("ISCHEMIC (Low-Flow)", {
    x: 0.3, y: 1.05, w: 4.4, h: 0.38,
    fontSize: 13, bold: true, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText([
    { text: "Venous outflow obstruction\n", options: { breakLine: true } },
    { text: "↓\n", options: { breakLine: true, color: ACCENT, bold: true } },
    { text: "Impaired arterial inflow\n", options: { breakLine: true } },
    { text: "↓\n", options: { breakLine: true, color: ACCENT, bold: true } },
    { text: "Stagnant blood in corpora cavernosa\n", options: { breakLine: true } },
    { text: "↓\n", options: { breakLine: true, color: ACCENT, bold: true } },
    { text: "Tissue hypoxia + acidosis + hypercapnia\n", options: { breakLine: true } },
    { text: "↓\n", options: { breakLine: true, color: ACCENT, bold: true } },
    { text: "Endothelial & smooth muscle damage\n", options: { breakLine: true } },
    { text: "↓\n", options: { breakLine: true, color: ACCENT, bold: true } },
    { text: "Interstitial edema → Fibrosis → ED", options: { bold: true, color: GOLD } }
  ], {
    x: 0.3, y: 1.5, w: 4.4, h: 3.7,
    fontSize: 13.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 4
  });

  // High-flow / Stuttering (right)
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 5.2, y: 1.0, w: 4.6, h: 2.0,
    fill: { color: MID_BLUE }, line: { color: MID_BLUE }, rectRadius: 0.1
  });
  slide.addText("NON-ISCHEMIC (High-Flow)", {
    x: 5.3, y: 1.05, w: 4.4, h: 0.38,
    fontSize: 13, bold: true, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText([
    { text: "Perineal/penile trauma → Cavernosal artery injury\n", options: { breakLine: true } },
    { text: "↓\n", options: { breakLine: true, color: GOLD, bold: true } },
    { text: "Arterio-sinusoidal fistula formation\n", options: { breakLine: true } },
    { text: "↓\n", options: { breakLine: true, color: GOLD, bold: true } },
    { text: "Unregulated arterial inflow\n", options: { breakLine: true } },
    { text: "↓\n", options: { breakLine: true, color: GOLD, bold: true } },
    { text: "Venous drainage INTACT → no ischemia", options: {} }
  ], {
    x: 5.3, y: 1.48, w: 4.4, h: 1.42,
    fontSize: 12.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 3
  });

  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 5.2, y: 3.15, w: 4.6, h: 2.2,
    fill: { color: "4A235A" }, line: { color: "4A235A" }, rectRadius: 0.1
  });
  slide.addText("STUTTERING Pathophysiology", {
    x: 5.3, y: 3.2, w: 4.4, h: 0.38,
    fontSize: 13, bold: true, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText([
    { text: "• Microvascular occlusion by sickled RBCs\n", options: { breakLine: true } },
    { text: "• PDE5 dysregulation → ↑cGMP signaling\n", options: { breakLine: true } },
    { text: "• Abnormal nitric oxide (NO) regulation\n", options: { breakLine: true } },
    { text: "• Hypoxia during sleep (mild hypoventilatory acidosis)\n", options: { breakLine: true } },
    { text: "• Recurring episodes → eventual fulminant priapism", options: {} }
  ], {
    x: 5.3, y: 3.63, w: 4.4, h: 1.62,
    fontSize: 12.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 3
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 6 — CLINICAL FEATURES
// ══════════════════════════════════════════════════════════════════════════
{
  addTwoColSlide(
    "Clinical Features",
    "ISCHEMIC (Low-Flow)",
    [
      { text: "• Painful, rigid erection >4 hours\n", options: { breakLine: true } },
      { text: "• Corpora cavernosa: tense, tender\n", options: { breakLine: true } },
      { text: "• Glans & corpus spongiosum: SOFT\n", options: { breakLine: true } },
      { text: "• Progressive pain intensity\n", options: { breakLine: true } },
      { text: "• Skin may become ischemic/dusky\n", options: { breakLine: true } },
      { text: "• No sexual desire/stimulation\n", options: { breakLine: true } },
      { text: "• Cavernous blood: dark, deoxygenated\n", options: { breakLine: true } },
      { text: "• May progress to penile necrosis if untreated", options: {} }
    ],
    "NON-ISCHEMIC (High-Flow)",
    [
      { text: "• Partially rigid, often PAINLESS erection\n", options: { breakLine: true } },
      { text: "• History of perineal/penile trauma\n", options: { breakLine: true } },
      { text: "• Can last days to weeks\n", options: { breakLine: true } },
      { text: "• Cavernous blood: bright red, oxygenated\n", options: { breakLine: true } },
      { text: "• Pulsatile flow may be palpable\n", options: { breakLine: true } },
      { text: "• No associated ischemia\n", options: { breakLine: true } },
      { text: "• Cavernosal artery aneurysm possible\n", options: { breakLine: true } },
      { text: "• Erectile function usually preserved", options: {} }
    ],
    "8B0000", MID_BLUE
  );
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 7 — DIAGNOSTIC EVALUATION
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Diagnostic Evaluation");

  const steps = [
    { n: "01", t: "History", d: "Duration, pain level, trauma, medications (intracavernous therapy, trazodone), sickle cell disease, prior episodes" },
    { n: "02", t: "Physical Examination", d: "Assess rigidity, tenderness, glans softness; perineal trauma signs; lymphadenopathy; abdominal mass" },
    { n: "03", t: "Corporal Blood Gas", d: "Gold standard: aspirate with 21G needle. Ischemic: pO₂ <30 mmHg, pCO₂ >60 mmHg, pH <7.25. Non-ischemic: normal/high pO₂" },
    { n: "04", t: "Color Doppler Ultrasound", d: "Ischemic: absent/minimal arterial flow. Non-ischemic: high-velocity turbulent arterial flow, visible fistula" },
    { n: "05", t: "Lab Tests", d: "CBC (sickle cell screen, leukocytosis), coagulation profile, urine/serum toxicology, G6PD level if indicated" },
    { n: "06", t: "Angiography/MRI", d: "Pudendal arteriography for non-ischemic: localizes fistula for embolization. MRI evaluates corporal fibrosis if chronic" }
  ];

  steps.forEach((s, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.2 : 5.1;
    const y = 1.02 + row * 1.48;
    slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y, w: 4.65, h: 1.35,
      fill: { color: DARK_NAVY }, line: { color: DARK_NAVY }, rectRadius: 0.08
    });
    // Number badge
    slide.addShape(pres.shapes.RECTANGLE, {
      x, y, w: 0.48, h: 1.35,
      fill: { color: ACCENT }, line: { color: ACCENT }
    });
    slide.addText(s.n, {
      x, y, w: 0.48, h: 1.35,
      fontSize: 16, bold: true, color: WHITE, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
    slide.addText(s.t, {
      x: x + 0.55, y: y + 0.08, w: 3.95, h: 0.32,
      fontSize: 12.5, bold: true, color: GOLD, fontFace: "Calibri", margin: 0
    });
    slide.addText(s.d, {
      x: x + 0.55, y: y + 0.42, w: 3.95, h: 0.85,
      fontSize: 11, color: WHITE, fontFace: "Calibri", valign: "top", margin: 2
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 8 — CAVERNOUS BLOOD GAS TABLE
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Cavernous Blood Gas Analysis — Diagnostic Criteria");

  const tableData = [
    [
      { text: "Parameter", options: { bold: true, color: WHITE, align: "center" } },
      { text: "Normal Arterial", options: { bold: true, color: WHITE, align: "center" } },
      { text: "Ischemic Priapism", options: { bold: true, color: WHITE, align: "center" } },
      { text: "Non-Ischemic Priapism", options: { bold: true, color: WHITE, align: "center" } }
    ],
    [
      { text: "pO₂", options: { bold: true, align: "center" } },
      { text: ">90 mmHg", options: { align: "center" } },
      { text: "<30 mmHg ⚠", options: { color: "C0392B", bold: true, align: "center" } },
      { text: ">90 mmHg", options: { color: "1A7A40", align: "center" } }
    ],
    [
      { text: "pCO₂", options: { bold: true, align: "center" } },
      { text: "<40 mmHg", options: { align: "center" } },
      { text: ">60 mmHg ⚠", options: { color: "C0392B", bold: true, align: "center" } },
      { text: "<40 mmHg", options: { color: "1A7A40", align: "center" } }
    ],
    [
      { text: "pH", options: { bold: true, align: "center" } },
      { text: "7.35 – 7.45", options: { align: "center" } },
      { text: "<7.25 ⚠", options: { color: "C0392B", bold: true, align: "center" } },
      { text: "Normal (7.35-7.45)", options: { color: "1A7A40", align: "center" } }
    ],
    [
      { text: "Blood Color", options: { bold: true, align: "center" } },
      { text: "Bright red", options: { align: "center" } },
      { text: "Dark, deoxygenated", options: { color: "C0392B", bold: true, align: "center" } },
      { text: "Bright red, pulsatile", options: { color: "1A7A40", align: "center" } }
    ],
    [
      { text: "Doppler Flow", options: { bold: true, align: "center" } },
      { text: "Normal", options: { align: "center" } },
      { text: "Absent / minimal", options: { color: "C0392B", bold: true, align: "center" } },
      { text: "High velocity, turbulent", options: { color: "1A7A40", align: "center" } }
    ]
  ];

  slide.addTable(tableData, {
    x: 0.3, y: 1.05, w: 9.4, h: 4.25,
    border: { type: "solid", color: "BBBBBB", pt: 0.5 },
    colW: [1.9, 2.2, 2.5, 2.8],
    fill: { color: WHITE },
    fontFace: "Calibri",
    fontSize: 13,
    rowH: 0.62,
    firstRowFill: { color: DARK_NAVY }
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 9 — MANAGEMENT: ISCHEMIC (OVERVIEW)
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Management: Ischemic Priapism — Step-by-Step");

  // Emergency banner
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.3, y: 0.92, w: 9.4, h: 0.38,
    fill: { color: RED_ALERT }, line: { color: RED_ALERT }, rectRadius: 0.06
  });
  slide.addText("⚠  TIME-SENSITIVE: Prompt treatment essential to prevent penile fibrosis and permanent erectile dysfunction", {
    x: 0.3, y: 0.92, w: 9.4, h: 0.38,
    fontSize: 12, bold: true, color: WHITE, fontFace: "Calibri",
    align: "center", valign: "middle", margin: 0
  });

  const steps = [
    { num: "STEP 1", label: "Corporal Aspiration", color: "7B241C",
      desc: "21-gauge butterfly needle, aspirate 20-30 mL of dark blood from corpus cavernosum. Can irrigate with normal saline. Often provides immediate relief." },
    { num: "STEP 2", label: "Intracavernous Phenylephrine", color: MID_BLUE,
      desc: "Phenylephrine 500 µg (diluted) every 5 minutes — preferred α-adrenergic agent. Max: 1 mg/hour. Monitor BP and heart rate. Alternatives: epinephrine, norepinephrine." },
    { num: "STEP 3", label: "Surgical Shunting", color: "145A32",
      desc: "If aspiration/medication fails or episode >24-48h. Distal shunts first (Winter, Ebbehoj, T-shunt, Al-Ghorab). Progress to proximal only if needed (Quackels, Barry)." },
    { num: "STEP 4", label: "Tunneling / Prosthesis", color: "4A235A",
      desc: "For ischemia >48h: Lue tunneling through T-shunt. Penile prosthesis implantation if refractory — ideally within 4 weeks of ischemic episode to reduce complications." }
  ];

  steps.forEach((s, i) => {
    const x = i % 2 === 0 ? 0.2 : 5.1;
    const y = 1.42 + Math.floor(i / 2) * 2.05;
    slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y, w: 4.65, h: 1.9,
      fill: { color: s.color }, line: { color: s.color }, rectRadius: 0.08
    });
    slide.addText(s.num, {
      x: x + 0.12, y: y + 0.1, w: 1.2, h: 0.3,
      fontSize: 10, bold: true, color: GOLD, fontFace: "Calibri", margin: 0
    });
    slide.addText(s.label, {
      x: x + 0.12, y: y + 0.38, w: 4.35, h: 0.38,
      fontSize: 14, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
    });
    slide.addText(s.desc, {
      x: x + 0.12, y: y + 0.8, w: 4.41, h: 1.0,
      fontSize: 12, color: LIGHT_BLUE, fontFace: "Calibri", valign: "top", margin: 2
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 10 — SURGICAL SHUNTS
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Surgical Shunt Procedures");

  // Distal shunts
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.2, y: 1.0, w: 4.6, h: 4.35,
    fill: { color: DARK_NAVY }, line: { color: DARK_NAVY }, rectRadius: 0.1
  });
  slide.addText("DISTAL SHUNTS (1st choice)", {
    x: 0.3, y: 1.05, w: 4.4, h: 0.38,
    fontSize: 13.5, bold: true, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText([
    { text: "Corporoglanular Shunts:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• Winter shunt: Tru-Cut needle through glans into corpora\n", options: { breakLine: true } },
    { text: "• Ebbehoj shunt: Scalpel blade through glans\n", options: { breakLine: true } },
    { text: "• T-shunt: Bilateral scalpel incision + optional tunneling (Lue)\n", options: { breakLine: true } },
    { text: "• Al-Ghorab shunt: Open excision of distal tunica albuginea\n\n", options: { breakLine: true } },
    { text: "Principle:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "Create fistula between corpus cavernosum and glans penis to drain trapped blood\n\n", options: { breakLine: true } },
    { text: "Post-op anticoagulation:\n", options: { bold: true, color: GOLD, breakLine: true } },
    { text: "Heparin 5000 U SQ + Aspirin 325 mg PO perioperatively\nAspirin 325 mg + Clopidogrel 75 mg for ≥5 days post-op", options: {} }
  ], {
    x: 0.3, y: 1.48, w: 4.4, h: 3.75,
    fontSize: 12.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 4
  });

  // Proximal shunts
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 5.2, y: 1.0, w: 4.6, h: 4.35,
    fill: { color: MID_BLUE }, line: { color: MID_BLUE }, rectRadius: 0.1
  });
  slide.addText("PROXIMAL SHUNTS (2nd choice)", {
    x: 5.3, y: 1.05, w: 4.4, h: 0.38,
    fontSize: 13.5, bold: true, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText([
    { text: "Corporospongiosal Shunts:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• Quackels shunt (1964): perineal anastomosis of corpora cavernosa to corpus spongiosum\n", options: { breakLine: true } },
    { text: "• Sacher shunt: scrotal approach\n\n", options: { breakLine: true } },
    { text: "Caverno-Venous Shunts:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• Barry shunt (1976): cavernosum to dorsal vein anastomosis\n", options: { breakLine: true } },
    { text: "• Saphenous vein to corpus cavernosum shunt\n\n", options: { breakLine: true } },
    { text: "Note:\n", options: { bold: true, color: GOLD, breakLine: true } },
    { text: "These technically complex procedures have largely been replaced by tunneling (Lue) and early prosthesis implantation for refractory cases (>48h ischemia)\n\n", options: { breakLine: true } },
    { text: "Shunt failure risk: collagen exposure activates coagulation → anticoagulation mandatory", options: { color: GOLD } }
  ], {
    x: 5.3, y: 1.48, w: 4.4, h: 3.75,
    fontSize: 12.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 4
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 11 — MANAGEMENT: NON-ISCHEMIC
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Management: Non-Ischemic (High-Flow) Priapism");

  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.3, y: 0.92, w: 9.4, h: 0.38,
    fill: { color: MID_BLUE }, line: { color: MID_BLUE }, rectRadius: 0.06
  });
  slide.addText("NOT an emergency — conservative management acceptable initially", {
    x: 0.3, y: 0.92, w: 9.4, h: 0.38,
    fontSize: 12, bold: true, color: WHITE, fontFace: "Calibri",
    align: "center", valign: "middle", margin: 0
  });

  const mgmt = [
    { step: "OBSERVATION", color: "145A32",
      body: "• Spontaneous resolution in some cases\n• Perineal ice pack / compression\n• Suitable if minimally symptomatic\n• Safe period for observation: days to weeks" },
    { step: "ARTERIOGRAPHY + EMBOLIZATION", color: DARK_NAVY,
      body: "• Pudendal arteriography to localize fistula\n• Selective embolization: autologous clot, coil, or Gelfoam\n• First-line definitive treatment\n• Erectile function preserved in >80% of cases\n• Repeat embolization possible if recurrence" },
    { step: "SURGICAL LIGATION", color: "7B241C",
      body: "• Reserved for failed embolization\n• Direct surgical exposure and ligation of fistula\n• Higher risk of erectile dysfunction vs embolization\n• Rarely required" },
    { step: "FOLLOW-UP", color: "4A235A",
      body: "• Doppler USS to confirm resolution\n• Post-embolization erectile function assessment\n• Long-term: PDE5 inhibitors if needed\n• MRI if fibrosis suspected" }
  ];

  mgmt.forEach((m, i) => {
    const x = i % 2 === 0 ? 0.2 : 5.1;
    const y = 1.42 + Math.floor(i / 2) * 2.05;
    slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y, w: 4.65, h: 1.9,
      fill: { color: m.color }, line: { color: m.color }, rectRadius: 0.08
    });
    slide.addText(m.step, {
      x: x + 0.12, y: y + 0.08, w: 4.41, h: 0.38,
      fontSize: 13, bold: true, color: GOLD, fontFace: "Calibri", margin: 0
    });
    slide.addText(m.body, {
      x: x + 0.12, y: y + 0.5, w: 4.41, h: 1.3,
      fontSize: 12, color: WHITE, fontFace: "Calibri", valign: "top", margin: 2
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 12 — SICKLE CELL & STUTTERING MANAGEMENT
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Sickle Cell Disease & Stuttering Priapism — Special Management");

  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.2, y: 1.0, w: 4.6, h: 4.35,
    fill: { color: DARK_NAVY }, line: { color: DARK_NAVY }, rectRadius: 0.1
  });
  slide.addText("Sickle Cell Priapism", {
    x: 0.3, y: 1.05, w: 4.4, h: 0.38,
    fontSize: 14, bold: true, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText([
    { text: "Conservative First-Line:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• IV hydration\n• Supplemental oxygen\n• Systemic alkalinization\n• Adequate analgesia (opioids)\n• Exchange transfusion (reduce HbS%)\n• Hyperbaric oxygen (adjunct)\n\n", options: { breakLine: true } },
    { text: "If above fails → intracavernous phenylephrine + aspiration\n\n", options: { breakLine: true } },
    { text: "If still fails → surgical shunting\n", options: { breakLine: true } },
    { text: "(Same algorithm as idiopathic ischemic priapism)", options: { italic: true, color: LIGHT_BLUE } }
  ], {
    x: 0.3, y: 1.48, w: 4.4, h: 3.78,
    fontSize: 12.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 4
  });

  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 5.2, y: 1.0, w: 4.6, h: 4.35,
    fill: { color: "4A235A" }, line: { color: "4A235A" }, rectRadius: 0.1
  });
  slide.addText("Stuttering Priapism Prevention", {
    x: 5.3, y: 1.05, w: 4.4, h: 0.38,
    fontSize: 14, bold: true, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText([
    { text: "Oral Agents:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• Pseudoephedrine (oral α-agonist) at bedtime\n• Oral terbutaline (β-agonist)\n\n", options: { breakLine: true } },
    { text: "PDE5 Inhibitors (Paradoxical use):\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• Long-term low-dose sildenafil\n• Rationale: upregulate PDE5, restore cGMP homeostasis\n• RCT evidence (Burnett et al., 2014)\n\n", options: { breakLine: true } },
    { text: "Hormonal Therapy:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• GnRH agonists (leuprolide) — suppress erections\n• Anti-androgens (cyproterone, bicalutamide)\n• Limited to refractory adult cases\n\n", options: { breakLine: true } },
    { text: "Ketoconazole + hydrocortisone\nDigoxin\nBaclofen (sickle cell specific)", options: { color: LIGHT_BLUE } }
  ], {
    x: 5.3, y: 1.48, w: 4.4, h: 3.78,
    fontSize: 12, color: WHITE, fontFace: "Calibri", valign: "top", margin: 4
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 13 — DRUG TABLE (Intracavernous agents)
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Pharmacological Agents in Priapism Management");

  const tableData = [
    [
      { text: "Drug", options: { bold: true, color: WHITE, align: "center" } },
      { text: "Class", options: { bold: true, color: WHITE, align: "center" } },
      { text: "Dose / Route", options: { bold: true, color: WHITE, align: "center" } },
      { text: "Notes", options: { bold: true, color: WHITE, align: "center" } }
    ],
    [
      { text: "Phenylephrine", options: { bold: true } },
      { text: "α₁-agonist (pure)", options: {} },
      { text: "500 µg IC q5min\nMax 1 mg/hr", options: {} },
      { text: "PREFERRED agent — minimal cardiac side effects", options: { color: "1A7A40", bold: true } }
    ],
    [
      { text: "Epinephrine", options: {} },
      { text: "α+β agonist", options: {} },
      { text: "100-200 µg IC diluted", options: {} },
      { text: "Avoid in cardiac disease; β effects may cause arrhythmia", options: { color: "C0392B" } }
    ],
    [
      { text: "Norepinephrine", options: {} },
      { text: "α+β agonist", options: {} },
      { text: "100 µg IC diluted", options: {} },
      { text: "Alternative if phenylephrine unavailable", options: {} }
    ],
    [
      { text: "Terbutaline (oral)", options: {} },
      { text: "β₂-agonist", options: {} },
      { text: "5 mg PO, repeat q15min", options: {} },
      { text: "Less effective than IC phenylephrine; stuttering priapism", options: {} }
    ],
    [
      { text: "Sildenafil (oral)", options: {} },
      { text: "PDE5 inhibitor", options: {} },
      { text: "Low-dose, long-term", options: {} },
      { text: "Paradoxical: prevents recurrence in stuttering priapism", options: {} }
    ],
    [
      { text: "Methylene Blue", options: {} },
      { text: "Guanylate cyclase inhibitor", options: {} },
      { text: "50 mg IC", options: {} },
      { text: "Experimental; inhibits NO-cGMP pathway", options: {} }
    ]
  ];

  slide.addTable(tableData, {
    x: 0.2, y: 1.0, w: 9.6, h: 4.35,
    border: { type: "solid", color: "BBBBBB", pt: 0.5 },
    colW: [2.0, 1.8, 2.1, 3.7],
    fill: { color: WHITE },
    fontFace: "Calibri",
    fontSize: 12.5,
    rowH: 0.55,
    firstRowFill: { color: DARK_NAVY }
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 14 — COMPLICATIONS & PROGNOSIS
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Complications & Prognosis");

  // Left column
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.2, y: 1.0, w: 4.6, h: 4.35,
    fill: { color: DARK_NAVY }, line: { color: DARK_NAVY }, rectRadius: 0.1
  });
  slide.addText("Complications", {
    x: 0.3, y: 1.05, w: 4.4, h: 0.38,
    fontSize: 14, bold: true, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText([
    { text: "Erectile Dysfunction (most feared):\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• Incidence: 35-90% after ischemic priapism\n• Higher risk with prolonged duration (>24h)\n• Early treatment (<4-6h) offers best preservation\n\n", options: { breakLine: true } },
    { text: "Penile Fibrosis:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• Smooth muscle necrosis → fibrosis → Peyronie's-like changes\n• Occurs with prolonged ischemia\n\n", options: { breakLine: true } },
    { text: "Penile Necrosis:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• Rare; with very prolonged untreated cases\n\n", options: { breakLine: true } },
    { text: "Procedural Complications:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• Shunt failure (premature clot closure)\n• Infection\n• Urethral fistula (rare)\n• Priapism recurrence post-shunt", options: {} }
  ], {
    x: 0.3, y: 1.5, w: 4.4, h: 3.7,
    fontSize: 12.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 4
  });

  // Right column
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 5.2, y: 1.0, w: 4.6, h: 4.35,
    fill: { color: "145A32" }, line: { color: "145A32" }, rectRadius: 0.1
  });
  slide.addText("Prognosis & Time Correlation", {
    x: 5.3, y: 1.05, w: 4.4, h: 0.38,
    fontSize: 14, bold: true, color: GOLD, fontFace: "Calibri", align: "center", margin: 0
  });
  slide.addText([
    { text: "Duration vs. Outcome:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• <4-6 hours: Excellent recovery likely\n• 12-24 hours: Moderate risk of ED (~35%)\n• 24-48 hours: High risk of ED (~50-60%)\n• >48 hours: Very high ED risk (>80%)\n• >72 hours: Near-certain ED; early prosthesis advised\n\n", options: { breakLine: true } },
    { text: "Non-Ischemic Prognosis:\n", options: { bold: true, color: LIGHT_BLUE, breakLine: true } },
    { text: "• Generally good; embolization preserves erectile function in >80%\n• No time pressure vs. ischemic type\n\n", options: { breakLine: true } },
    { text: "Key Message:\n", options: { bold: true, color: GOLD, breakLine: true } },
    { text: "\"Early recognition and prompt treatment of priapism offer the best opportunity to avoid permanent erectile dysfunction\"", options: { italic: true, color: GOLD } }
  ], {
    x: 5.3, y: 1.5, w: 4.4, h: 3.7,
    fontSize: 12.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 4
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 15 — PEDIATRIC PRIAPISM
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Priapism in Pediatric Population");

  slide.addText([
    { text: "• Most pediatric priapism is LOW-FLOW (ischemic) due to ", options: { breakLine: false } },
    { text: "sickle cell disease (homozygous HbSS)\n", options: { bold: true, color: RED_ALERT, breakLine: true } },
    { text: "• Sickle cell priapism affects 2-29% of males with the disease\n", options: { breakLine: true } },
    { text: "• Priapism typically occurs during sleep (hypoventilatory acidosis ↓ pO₂ → potentiates sickling)\n", options: { breakLine: true } },
    { text: "• Stuttering (transient episodes <2h) more common than fulminant priapism in children\n\n", options: { breakLine: true } },
    { text: "Other pediatric causes: ", options: { bold: true } },
    { text: "Leukemia, other hemoglobinopathies, local malignancy, idiopathic\n\n", options: { breakLine: true } },
    { text: "Management follows adult AUA/EAU guidelines with pediatric adjustments:\n", options: { bold: true, breakLine: true } },
    { text: "• Hydration + O₂ + alkalinization + analgesia first\n", options: { breakLine: true } },
    { text: "• Exchange transfusion to reduce HbS < 30-50%\n", options: { breakLine: true } },
    { text: "• Pseudoephedrine at bedtime for prevention of stuttering episodes\n", options: { breakLine: true } },
    { text: "• Intracavernous phenylephrine + aspiration if conservative fails\n", options: { breakLine: true } },
    { text: "• Surgical shunting (distal first) if all else fails\n", options: { breakLine: true } },
    { text: "• Hydroxyurea may reduce sickle cell crises (and stuttering priapism episodes) long-term", options: {} }
  ], {
    x: 0.4, y: 1.05, w: 9.2, h: 4.3,
    fontSize: 14.5, color: DARK_TEXT, fontFace: "Calibri", valign: "top", margin: 4
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 16 — DIFFERENTIAL DIAGNOSIS
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Differential Diagnosis");

  const diffs = [
    { title: "Penile Fracture", color: "7B241C",
      body: "Trauma during erection; audible snap; acute detumescence; penile deviation. No prolonged erection. Requires surgical exploration." },
    { title: "Peyronie's Disease", color: DARK_NAVY,
      body: "Painful erections with curvature; fibrous plaque formation; usually no prolonged erection. Chronic condition, not emergency." },
    { title: "Psychogenic Erection", color: MID_BLUE,
      body: "Normal erection related to sexual stimulation; resolves spontaneously. Duration <30 minutes, no pain, no tenderness." },
    { title: "Penile Tumour / Metastasis", color: "145A32",
      body: "Penile induration/mass; may cause venous engorgement. Painless or minimally painful. Check PSA, imaging. Often secondary to prostate/bladder Ca." },
    { title: "Penile Infection / Fournier's", color: "4A235A",
      body: "Scrotal/perineal involvement; fever; crepitus; systemic sepsis. Aggressive surgical debridement required. No prolonged erection typically." },
    { title: "Normal Nocturnal Penile Tumescence", color: "6E2C00",
      body: "Physiological; occurs during REM sleep; not sustained on waking; no pain. Duration <30 min. No treatment required." }
  ];

  diffs.forEach((d, i) => {
    const col = i % 2;
    const row = Math.floor(i / 3) * 3 + (i % 3);
    const x = col === 0 ? 0.2 : 5.1;
    const baseY = 1.0;
    const r = Math.floor(i / 2);
    const y = baseY + r * 1.55;
    slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y, w: 4.65, h: 1.4,
      fill: { color: d.color }, line: { color: d.color }, rectRadius: 0.08
    });
    slide.addText(d.title, {
      x: x + 0.12, y: y + 0.06, w: 4.41, h: 0.33,
      fontSize: 12.5, bold: true, color: GOLD, fontFace: "Calibri", margin: 0
    });
    slide.addText(d.body, {
      x: x + 0.12, y: y + 0.42, w: 4.41, h: 0.88,
      fontSize: 11.5, color: WHITE, fontFace: "Calibri", valign: "top", margin: 2
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 17 — PENILE PROSTHESIS IN PRIAPISM
// ══════════════════════════════════════════════════════════════════════════
{
  addContentSlide("Penile Prosthesis Implantation in Refractory Priapism", [
    { text: "INDICATIONS:\n", options: { bold: true, color: ACCENT, breakLine: true } },
    { text: "• Ischemic priapism > 48–72 hours unresponsive to all conservative and shunting measures\n", options: { breakLine: true } },
    { text: "• Corporal fibrosis established on MRI / clinical assessment\n", options: { breakLine: true } },
    { text: "• Patient counselled about expected erectile dysfunction\n\n", options: { breakLine: true } },
    { text: "TIMING:\n", options: { bold: true, color: ACCENT, breakLine: true } },
    { text: "• Early (within 2–4 weeks of acute episode): preferred — easier insertion, less fibrosis, fewer complications\n", options: { breakLine: true } },
    { text: "• Delayed (>3 months): more difficult due to dense fibrosis; higher erosion/infection risk; may require penile reconstruction\n\n", options: { breakLine: true } },
    { text: "TYPES:\n", options: { bold: true, color: ACCENT, breakLine: true } },
    { text: "• Malleable (semi-rigid) prosthesis — simpler, preferred in acute setting\n", options: { breakLine: true } },
    { text: "• Inflatable (3-piece) prosthesis — better cosmesis; for elective setting post-fibrosis\n\n", options: { breakLine: true } },
    { text: "OUTCOMES:\n", options: { bold: true, color: ACCENT, breakLine: true } },
    { text: "• Patient satisfaction high when appropriately counselled\n", options: { breakLine: true } },
    { text: "• Best outcomes when implanted early in the post-priapism period\n", options: { breakLine: true } },
    { text: "• Source: Campbell-Walsh-Wein Urology; Smith & Tanagho's General Urology", options: { italic: true, color: ACCENT } }
  ]);
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 18 — AUA GUIDELINES SUMMARY
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "AUA / EAU Guidelines Summary");

  const guidelines = [
    { num: "1", text: "History + physical exam → determine ischemic vs non-ischemic type FIRST", tag: "Diagnosis" },
    { num: "2", text: "Corporal blood gas aspiration is the diagnostic gold standard (+ color Doppler USS)", tag: "Diagnosis" },
    { num: "3", text: "Ischemic priapism: corporal aspiration ± irrigation as first intervention (Grade A)", tag: "Treatment" },
    { num: "4", text: "Phenylephrine is the preferred intracavernous sympathomimetic (safest cardiac profile)", tag: "Treatment" },
    { num: "5", text: "Distal shunts (T-shunt with tunneling preferred) for failed pharmacotherapy", tag: "Surgery" },
    { num: "6", text: "Perioperative anticoagulation mandatory to prevent shunt thrombosis", tag: "Surgery" },
    { num: "7", text: "Non-ischemic: observation acceptable; selective arterial embolization is definitive", tag: "Non-ischemic" },
    { num: "8", text: "Early penile prosthesis (within 2-4 weeks) for prolonged ischemic cases to prevent fibrosis complications", tag: "Prosthesis" }
  ];

  const tagColors = {
    "Diagnosis": ACCENT,
    "Treatment": "145A32",
    "Surgery": "7B241C",
    "Non-ischemic": MID_BLUE,
    "Prosthesis": "4A235A"
  };

  guidelines.forEach((g, i) => {
    const y = 1.05 + i * 0.55;
    slide.addShape(pres.shapes.RECTANGLE, {
      x: 0.2, y, w: 0.42, h: 0.45,
      fill: { color: ACCENT }, line: { color: ACCENT }
    });
    slide.addText(g.num, {
      x: 0.2, y, w: 0.42, h: 0.45,
      fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
    const tColor = tagColors[g.tag] || ACCENT;
    slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x: 0.7, y: y + 0.06, w: 1.2, h: 0.32,
      fill: { color: tColor }, line: { color: tColor }, rectRadius: 0.05
    });
    slide.addText(g.tag, {
      x: 0.7, y: y + 0.06, w: 1.2, h: 0.32,
      fontSize: 9.5, bold: true, color: WHITE, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
    slide.addText(g.text, {
      x: 2.05, y, w: 7.7, h: 0.45,
      fontSize: 13, color: DARK_TEXT, fontFace: "Calibri", valign: "middle", margin: 2
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 19 — QUICK REFERENCE / EXAM TABLE
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT_GRAY }, line: { color: LIGHT_GRAY }
  });
  addHeader(slide, "Quick Reference — Ischemic vs Non-Ischemic Comparison");

  const tableData = [
    [
      { text: "Feature", options: { bold: true, color: WHITE, align: "center" } },
      { text: "ISCHEMIC (Low-Flow)", options: { bold: true, color: GOLD, align: "center" } },
      { text: "NON-ISCHEMIC (High-Flow)", options: { bold: true, color: LIGHT_BLUE, align: "center" } }
    ],
    [
      { text: "Common cause", options: { bold: true } },
      { text: "Idiopathic, sickle cell, meds", options: {} },
      { text: "Perineal/penile trauma", options: {} }
    ],
    [
      { text: "Pain", options: { bold: true } },
      { text: "Yes — progressively worsening", options: { color: "C0392B", bold: true } },
      { text: "No — usually painless", options: { color: "1A7A40" } }
    ],
    [
      { text: "Penile rigidity", options: { bold: true } },
      { text: "Fully rigid, tense corpora", options: {} },
      { text: "Partial tumescence, not fully rigid", options: {} }
    ],
    [
      { text: "Blood gas pO₂", options: { bold: true } },
      { text: "<30 mmHg (hypoxic)", options: { color: "C0392B", bold: true } },
      { text: ">90 mmHg (normal)", options: { color: "1A7A40" } }
    ],
    [
      { text: "Doppler USS", options: { bold: true } },
      { text: "Absent / minimal flow", options: { color: "C0392B" } },
      { text: "High-velocity turbulent flow", options: { color: "1A7A40" } }
    ],
    [
      { text: "Emergency?", options: { bold: true } },
      { text: "YES — urological emergency", options: { color: "C0392B", bold: true } },
      { text: "No — can observe", options: { color: "1A7A40" } }
    ],
    [
      { text: "Treatment", options: { bold: true } },
      { text: "Aspiration → phenylephrine → shunt → prosthesis", options: {} },
      { text: "Observation / selective embolization", options: {} }
    ],
    [
      { text: "ED risk", options: { bold: true } },
      { text: "High (duration-dependent)", options: { color: "C0392B" } },
      { text: "Low (>80% preserve function post-embolization)", options: { color: "1A7A40" } }
    ]
  ];

  slide.addTable(tableData, {
    x: 0.2, y: 1.0, w: 9.6, h: 4.35,
    border: { type: "solid", color: "BBBBBB", pt: 0.5 },
    colW: [2.4, 3.6, 3.6],
    fill: { color: WHITE },
    fontFace: "Calibri",
    fontSize: 12.5,
    rowH: 0.43,
    firstRowFill: { color: DARK_NAVY }
  });
}

// ══════════════════════════════════════════════════════════════════════════
//  SLIDE 20 — KEY TAKEAWAYS / CONCLUSION
// ══════════════════════════════════════════════════════════════════════════
{
  const slide = pres.addSlide();
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625,
    fill: { color: DARK_NAVY }, line: { color: DARK_NAVY }
  });
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 0.06,
    fill: { color: ACCENT }, line: { color: ACCENT }
  });
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 5.56, w: 10, h: 0.065,
    fill: { color: ACCENT }, line: { color: ACCENT }
  });

  slide.addText("Key Takeaways", {
    x: 0.5, y: 0.15, w: 9, h: 0.7,
    fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri",
    align: "left", margin: 0
  });
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0.5, y: 0.85, w: 2.5, h: 0.05,
    fill: { color: ACCENT }, line: { color: ACCENT }
  });

  const points = [
    "Priapism = erection >4 hours unrelated to sexual stimulation — ischemic type is a UROLOGICAL EMERGENCY",
    "Always classify FIRST: ischemic vs non-ischemic vs stuttering — management differs completely",
    "Corporal blood gas is the gold standard (pO₂ <30 + pCO₂ >60 + pH <7.25 = ischemic)",
    "Ischemic treatment: aspiration → phenylephrine → distal shunts → tunneling → early prosthesis",
    "Non-ischemic: NOT an emergency — selective pudendal artery embolization is definitive (>80% preserve erections)",
    "Sickle cell: hydration + O₂ + alkalinization + exchange transfusion FIRST before invasive procedures",
    "Stuttering priapism: paradoxical long-term PDE5 inhibitors prevent recurrence",
    "TIME IS PENILE FUNCTION — erectile dysfunction risk rises sharply beyond 24–48 hours of ischemia"
  ];

  points.forEach((p, i) => {
    slide.addShape(pres.shapes.RECTANGLE, {
      x: 0.5, y: 0.98 + i * 0.57, w: 0.3, h: 0.38,
      fill: { color: ACCENT }, line: { color: ACCENT }
    });
    slide.addText((i + 1).toString(), {
      x: 0.5, y: 0.98 + i * 0.57, w: 0.3, h: 0.38,
      fontSize: 12, bold: true, color: WHITE, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
    slide.addText(p, {
      x: 0.9, y: 0.98 + i * 0.57, w: 8.8, h: 0.38,
      fontSize: 13, color: i === 7 ? GOLD : WHITE, fontFace: "Calibri",
      bold: i === 7, valign: "middle", margin: 2
    });
  });
}

// ─── WRITE FILE ──────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/priapism-ppt/Priapism_Urology.pptx" })
  .then(() => console.log("SUCCESS: Priapism_Urology.pptx created"))
  .catch(err => console.error("ERROR:", err));
You've run out of free credits. Sign up for a free account to continue using Orris.
This is a shared conversation. Sign in to Orris to start your own chat.