Priapism make a comprehensive ppt

Reading File
Reading File
Reading File
Finding Sources
Searching PubMed

priapism management treatment

Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Loading Image
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not acce…

Running Command

mkdir -p /home/daytona/workspace/priapism-ppt && ls /home/daytona/workspace/pria…

Writing File

~/priapism-ppt/priapism.js

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

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Priapism - Comprehensive Clinical Review";

// ─── COLOR PALETTE ───────────────────────────────────────────────
const C = {
  navy:     "0D2B4E",  // dominant dark
  teal:     "1A7A8A",  // supporting
  skyBlue:  "4FB3CC",  // accent light
  white:    "FFFFFF",
  offWhite: "F2F7FA",
  lightGray:"E8EEF2",
  amber:    "E8A320",  // highlight / warning
  red:      "C0392B",  // danger / ischemic
  green:    "1E7E5A",  // non-ischemic / safe
  darkText: "1A1A2E",
  midText:  "2C3E50",
};

// ─── HELPERS ─────────────────────────────────────────────────────
function darkSlide(slide) {
  slide.background = { color: C.navy };
}
function lightSlide(slide) {
  slide.background = { color: C.offWhite };
}
function sectionBand(slide, label, color) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.55, fill: { color: color || C.teal } });
  slide.addText(label.toUpperCase(), {
    x: 0.25, y: 0, w: 9.5, h: 0.55,
    fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0,
    charSpacing: 3
  });
}
function slideTitle(slide, title, sub, light) {
  const fg = light ? C.navy : C.white;
  slide.addText(title, { x: 0.5, y: 0.65, w: 9, h: 0.7, fontSize: 26, bold: true, color: fg, fontFace: "Calibri" });
  if (sub) {
    slide.addText(sub, { x: 0.5, y: 1.3, w: 9, h: 0.35, fontSize: 13, color: light ? C.teal : C.skyBlue, fontFace: "Calibri", italic: true });
  }
}
function accentBar(slide, x, y, h, color) {
  slide.addShape(pres.ShapeType.rect, { x, y, w: 0.07, h, fill: { color: color || C.amber } });
}
function footer(slide, text) {
  slide.addText(text || "Priapism — Clinical Review", {
    x: 0, y: 5.3, w: 10, h: 0.32, fontSize: 8, color: "AAAAAA", align: "center"
  });
}

// ─── Fetch images ─────────────────────────────────────────────────
const imgUrls = [
  "https://cdn.orris.care/cdss_images/8e9973b1867bd6ec17b0b5162757489d46fc2578c48adac73e2296cc045e19f7.png",
  "https://cdn.orris.care/cdss_images/1ca6c52f05ff90beda5062544aea5866817fc238dfacfad85deb247c142fe38f.png"
];
let imgs = [];
try {
  const raw = execSync(`node /home/daytona/skills/shared/scripts/fetch_images.js "${imgUrls[0]}" "${imgUrls[1]}"`, { timeout: 30000 }).toString();
  imgs = JSON.parse(raw);
} catch(e) {
  console.log("Image fetch failed:", e.message);
}


// ═══════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE SLIDE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);

  // Left accent stripe
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.45, h: 5.625, fill: { color: C.teal } });
  s.addShape(pres.ShapeType.rect, { x: 0.45, y: 0, w: 0.1, h: 5.625, fill: { color: C.amber } });

  // Main title
  s.addText("PRIAPISM", {
    x: 0.75, y: 1.0, w: 8.5, h: 1.3, fontSize: 64, bold: true,
    color: C.white, fontFace: "Calibri", charSpacing: 8
  });
  s.addText("Comprehensive Clinical Review", {
    x: 0.75, y: 2.25, w: 8.5, h: 0.6, fontSize: 24, color: C.skyBlue,
    fontFace: "Calibri", italic: true
  });

  // Horizontal rule
  s.addShape(pres.ShapeType.rect, { x: 0.75, y: 2.95, w: 6, h: 0.04, fill: { color: C.amber } });

  // Topics line
  s.addText("Definition  •  Classification  •  Pathophysiology  •  Diagnosis  •  Management  •  Complications", {
    x: 0.75, y: 3.15, w: 9, h: 0.4, fontSize: 11, color: "99BBD0", fontFace: "Calibri"
  });

  // Source note
  s.addText("Sources: Campbell-Walsh Urology • Smith & Tanagho General Urology • Goldman-Cecil Medicine • Bailey & Love Surgery", {
    x: 0.75, y: 5.0, w: 9, h: 0.3, fontSize: 8, color: "667788", fontFace: "Calibri"
  });
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 2 — DEFINITION & OVERVIEW
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionBand(s, "Definition & Overview");
  slideTitle(s, "What is Priapism?", "A urologic emergency requiring prompt recognition", true);

  accentBar(s, 0.5, 1.7, 3.3, C.teal);

  const definitionText = [
    { text: "Core Definition", options: { bold: true, fontSize: 14, color: C.navy, breakLine: true } },
    { text: "Prolonged, persistent penile erection unrelated to sexual interest or stimulation, lasting longer than ", options: { fontSize: 12, color: C.midText } },
    { text: "4 hours", options: { bold: true, fontSize: 12, color: C.red } },
    { text: ".", options: { fontSize: 12, color: C.midText, breakLine: true } },
    { text: " ", options: { fontSize: 8, breakLine: true } },
    { text: "Key Features", options: { bold: true, fontSize: 14, color: C.navy, breakLine: true } },
    { text: "• Tumescence confined to corpora cavernosa (corpus spongiosum usually spared)", options: { fontSize: 12, color: C.midText, bullet: false, breakLine: true } },
    { text: "• Glans and corpus spongiosum are typically soft", options: { fontSize: 12, color: C.midText, breakLine: true } },
    { text: "• Considered one of the most common urologic emergencies", options: { fontSize: 12, color: C.midText, breakLine: true } },
    { text: "• Incidence: up to 5.34 per 100,000 men per year (ischemic type)", options: { fontSize: 12, color: C.midText, breakLine: true } },
  ];
  s.addText(definitionText, { x: 0.65, y: 1.7, w: 5.8, h: 3.3, valign: "top", margin: 8 });

  // Info box right
  s.addShape(pres.ShapeType.roundRect, { x: 6.8, y: 1.65, w: 2.9, h: 1.5, fill: { color: C.navy }, rectRadius: 0.1 });
  s.addText([
    { text: "Duration Threshold", options: { bold: true, fontSize: 13, color: C.amber, breakLine: true } },
    { text: "> 4 hours", options: { fontSize: 28, bold: true, color: C.white, breakLine: true } },
    { text: "requires emergency evaluation", options: { fontSize: 11, color: C.skyBlue } },
  ], { x: 6.9, y: 1.7, w: 2.7, h: 1.4, align: "center", valign: "middle" });

  s.addShape(pres.ShapeType.roundRect, { x: 6.8, y: 3.3, w: 2.9, h: 1.7, fill: { color: C.teal }, rectRadius: 0.1 });
  s.addText([
    { text: "Most Affected", options: { bold: true, fontSize: 13, color: C.white, breakLine: true } },
    { text: "• Sickle cell disease patients\n• 2–29% lifetime risk in SCD\n• Also idiopathic (60% of cases)", options: { fontSize: 11, color: C.offWhite } },
  ], { x: 6.9, y: 3.35, w: 2.7, h: 1.6, valign: "top", margin: 6 });

  footer(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 3 — CLASSIFICATION
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionBand(s, "Classification", C.navy);
  slideTitle(s, "Three Types of Priapism", "Ischemic • Non-ischemic • Stuttering", true);

  // TYPE 1 — Ischemic
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.55, w: 2.9, h: 3.6, fill: { color: C.red }, rectRadius: 0.12 });
  s.addText([
    { text: "01", options: { fontSize: 36, bold: true, color: "FFAAAA", breakLine: true } },
    { text: "ISCHEMIC", options: { fontSize: 16, bold: true, color: C.white, breakLine: true, charSpacing: 2 } },
    { text: "Low-flow / Veno-occlusive", options: { fontSize: 10, color: "FFCCCC", italic: true, breakLine: true } },
    { text: " ", options: { fontSize: 7, breakLine: true } },
    { text: "• Most common type\n• Venous outflow obstruction\n• NO cavernous blood flow\n• Rigid & tender corpora\n• Hypoxic, hypercapnic, acidotic blood gas\n• MEDICAL EMERGENCY", options: { fontSize: 10, color: C.white } },
  ], { x: 0.4, y: 1.65, w: 2.7, h: 3.4, valign: "top", margin: 8 });

  // TYPE 2 — Non-ischemic
  s.addShape(pres.ShapeType.roundRect, { x: 3.55, y: 1.55, w: 2.9, h: 3.6, fill: { color: C.green }, rectRadius: 0.12 });
  s.addText([
    { text: "02", options: { fontSize: 36, bold: true, color: "AAFFCC", breakLine: true } },
    { text: "NON-ISCHEMIC", options: { fontSize: 14, bold: true, color: C.white, breakLine: true, charSpacing: 2 } },
    { text: "High-flow / Arterial", options: { fontSize: 10, color: "CCFFEE", italic: true, breakLine: true } },
    { text: " ", options: { fontSize: 7, breakLine: true } },
    { text: "• Less common\n• Unregulated cavernous arterial inflow\n• Usually from perineal/penile trauma\n• Cavernosal artery fistula\n• NOT fully rigid; painless\n• NOT a medical emergency\n• High O2, normal CO2 on blood gas", options: { fontSize: 10, color: C.white } },
  ], { x: 3.65, y: 1.65, w: 2.7, h: 3.4, valign: "top", margin: 8 });

  // TYPE 3 — Stuttering
  s.addShape(pres.ShapeType.roundRect, { x: 6.8, y: 1.55, w: 2.9, h: 3.6, fill: { color: C.teal }, rectRadius: 0.12 });
  s.addText([
    { text: "03", options: { fontSize: 36, bold: true, color: "AADDEE", breakLine: true } },
    { text: "STUTTERING", options: { fontSize: 15, bold: true, color: C.white, breakLine: true, charSpacing: 2 } },
    { text: "Recurrent / Intermittent", options: { fontSize: 10, color: "CCEEEE", italic: true, breakLine: true } },
    { text: " ", options: { fontSize: 7, breakLine: true } },
    { text: "• Recurrent form of ischemic priapism\n• Periodic painful erections\n• Shorter duration with detumescence intervals\n• Common in sickle cell disease\n• PDE5 dysregulation implicated\n• Abnormal NO/cGMP signaling", options: { fontSize: 10, color: C.white } },
  ], { x: 6.9, y: 1.65, w: 2.7, h: 3.4, valign: "top", margin: 8 });

  footer(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 4 — ETIOLOGY & RISK FACTORS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionBand(s, "Etiology & Risk Factors", C.teal);
  slideTitle(s, "Causes of Priapism", "Idiopathic in ~60% of cases", true);

  // Left column
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.6, w: 4.5, h: 3.7, fill: { color: C.navy }, rectRadius: 0.1 });
  s.addText([
    { text: "Hematologic / Systemic", options: { bold: true, fontSize: 13, color: C.amber, breakLine: true } },
    { text: "• Sickle cell disease (most common identifiable cause)\n• Leukemia & other hematologic malignancies\n• Other hemoglobinopathies\n• G6PD deficiency\n• Thalassemia", options: { fontSize: 11, color: C.white } },
    { text: "\nMedications & Substances", options: { bold: true, fontSize: 13, color: C.skyBlue, breakLine: true } },
    { text: "• Intracavernous injection therapy (most common iatrogenic cause)\n• Trazodone (antidepressant)\n• Antipsychotics (clozapine, chlorpromazine)\n• Alcohol & recreational drugs\n• Anticoagulants", options: { fontSize: 11, color: C.white } },
  ], { x: 0.45, y: 1.7, w: 4.2, h: 3.5, valign: "top", margin: 8 });

  // Right column
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.6, w: 4.5, h: 3.7, fill: { color: C.lightGray }, rectRadius: 0.1 });
  s.addText([
    { text: "Neurologic", options: { bold: true, fontSize: 13, color: C.navy, breakLine: true } },
    { text: "• Spinal cord injury / trauma\n• Cauda equina syndrome", options: { fontSize: 11, color: C.midText } },
    { text: "\nNeoplastic", options: { bold: true, fontSize: 13, color: C.navy, breakLine: true } },
    { text: "• Pelvic tumors with local invasion\n• Penile metastasis", options: { fontSize: 11, color: C.midText } },
    { text: "\nTraumatic (Non-ischemic)", options: { bold: true, fontSize: 13, color: C.navy, breakLine: true } },
    { text: "• Perineal or penile blunt trauma\n• Cavernosal artery injury → AV fistula", options: { fontSize: 11, color: C.midText } },
    { text: "\nIdiopathic", options: { bold: true, fontSize: 13, color: C.navy, breakLine: true } },
    { text: "• ~60% of all cases — no identifiable cause\n• Often preceded by prolonged sexual stimulation", options: { fontSize: 11, color: C.midText } },
  ], { x: 5.25, y: 1.7, w: 4.2, h: 3.5, valign: "top", margin: 8 });

  footer(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 5 — PATHOPHYSIOLOGY
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBand(s, "Pathophysiology", C.teal);
  slideTitle(s, "Mechanisms of Priapism", "Ischemic vs Non-Ischemic Pathways");

  // Ischemic pathway box
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.55, w: 4.4, h: 3.8, fill: { color: "1A0505" }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.55, w: 4.4, h: 0.4, fill: { color: C.red } });
  s.addText("ISCHEMIC (Low-Flow)", { x: 0.4, y: 1.55, w: 4.2, h: 0.4, fontSize: 12, bold: true, color: C.white, valign: "middle", margin: 0 });

  const ischemicSteps = [
    "1. Venous outflow obstruction from corpora cavernosa",
    "2. Reduced arterial inflow → blood stasis",
    "3. Falling O2 tension + rising CO2 + acidosis",
    "4. Sickling of RBCs worsens stasis (in SCD)",
    "5. Endothelial & smooth muscle damage",
    "6. PDE5 dysregulation + NO/cGMP dysfunction",
    "7. Interstitial edema → fibrosis if untreated",
    "8. Impotence (most common long-term sequela)",
  ];
  s.addText(ischemicSteps.map((t, i) => ({
    text: t + (i < ischemicSteps.length - 1 ? "\n" : ""),
    options: { fontSize: 10, color: i === 7 ? C.amber : "FFDDDD", bullet: false }
  })).flat(), { x: 0.4, y: 2.05, w: 4.1, h: 3.2, valign: "top", margin: 6 });

  // Non-ischemic pathway
  s.addShape(pres.ShapeType.roundRect, { x: 5.0, y: 1.55, w: 4.6, h: 3.8, fill: { color: "01180E" }, rectRadius: 0.1 });
  s.addShape(pres.ShapeType.rect, { x: 5.0, y: 1.55, w: 4.6, h: 0.4, fill: { color: C.green } });
  s.addText("NON-ISCHEMIC (High-Flow)", { x: 5.1, y: 1.55, w: 4.4, h: 0.4, fontSize: 12, bold: true, color: C.white, valign: "middle", margin: 0 });

  const nonIschemicSteps = [
    "1. Perineal or penile trauma (blunt injury)",
    "2. Cavernosal / helicine artery disruption",
    "3. AV fistula formation between artery & sinusoids",
    "4. Unregulated arterial inflow",
    "5. Venous drainage preserved → no ischemia",
    "6. Persistent painless tumescence",
    "7. High O2 / normal CO2 on corporal blood gas",
    "8. Erectile function often preserved",
  ];
  s.addText(nonIschemicSteps.map((t, i) => ({
    text: t + (i < nonIschemicSteps.length - 1 ? "\n" : ""),
    options: { fontSize: 10, color: i === 7 ? C.amber : "CCFFEE", bullet: false }
  })).flat(), { x: 5.1, y: 2.05, w: 4.3, h: 3.2, valign: "top", margin: 6 });

  footer(s, "Priapism — Pathophysiology");
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 6 — DIAGNOSIS / EVALUATION
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionBand(s, "Diagnosis & Evaluation", C.navy);
  slideTitle(s, "Clinical Evaluation", "History, Examination & Investigations", true);

  // History box
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.6, w: 3.0, h: 3.7, fill: { color: C.navy }, rectRadius: 0.1 });
  s.addText([
    { text: "History", options: { bold: true, fontSize: 13, color: C.amber, breakLine: true } },
    { text: "• Duration of erection\n• Sexual stimulation (absent)\n• Pain character\n• Prior episodes\n• Medications (trazodone, intracavernous agents, antipsychotics)\n• Sickle cell disease Hx\n• Trauma (perineal/penile)\n• Recreational drug use", options: { fontSize: 10.5, color: C.white } },
  ], { x: 0.4, y: 1.7, w: 2.8, h: 3.5, valign: "top", margin: 6 });

  // PE box
  s.addShape(pres.ShapeType.roundRect, { x: 3.5, y: 1.6, w: 3.0, h: 3.7, fill: { color: C.teal }, rectRadius: 0.1 });
  s.addText([
    { text: "Physical Exam", options: { bold: true, fontSize: 13, color: C.white, breakLine: true } },
    { text: "• Rigid, tender corpora cavernosa (ischemic)\n• Soft corpus spongiosum & glans\n• Semi-rigid, painless penis (non-ischemic)\n• Signs of perineal trauma\n• Lymphadenopathy (malignancy)\n• Signs of SCD crisis", options: { fontSize: 10.5, color: C.offWhite } },
    { text: "\nBlood Gas Key Findings", options: { bold: true, fontSize: 12, color: C.amber, breakLine: true } },
    { text: "Ischemic: pO2 <30, pCO2 >60, pH <7.25\nNon-ischemic: pO2 >90, pCO2 normal, pH normal", options: { fontSize: 10, color: C.white } },
  ], { x: 3.6, y: 1.7, w: 2.8, h: 3.5, valign: "top", margin: 6 });

  // Investigations box
  s.addShape(pres.ShapeType.roundRect, { x: 6.7, y: 1.6, w: 3.0, h: 3.7, fill: { color: C.lightGray }, rectRadius: 0.1 });
  s.addText([
    { text: "Investigations", options: { bold: true, fontSize: 13, color: C.navy, breakLine: true } },
    { text: "1st Line", options: { bold: true, fontSize: 11, color: C.teal, breakLine: true } },
    { text: "• Corporal blood gas aspiration (21G butterfly needle)\n• CBC, coagulation screen\n• Toxicology screen\n• Hemoglobin electrophoresis (if SCD suspected)", options: { fontSize: 10, color: C.midText } },
    { text: "\n2nd Line", options: { bold: true, fontSize: 11, color: C.teal, breakLine: true } },
    { text: "• Color Doppler ultrasound (if available) — differentiates high vs low flow\n• Pelvic angiography (non-ischemic — identifies fistula for embolization)\n• MRI (rarely needed)", options: { fontSize: 10, color: C.midText } },
  ], { x: 6.8, y: 1.7, w: 2.8, h: 3.5, valign: "top", margin: 6 });

  footer(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 7 — BLOOD GAS COMPARISON TABLE
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionBand(s, "Differentiation", C.red);
  slideTitle(s, "Ischemic vs Non-Ischemic: Key Differences", "", true);

  const rows = [
    [
      { text: "Feature", options: { bold: true, color: C.white, fontSize: 12 } },
      { text: "Ischemic (Low-Flow)", options: { bold: true, color: C.white, fontSize: 12 } },
      { text: "Non-Ischemic (High-Flow)", options: { bold: true, color: C.white, fontSize: 12 } },
      { text: "Stuttering", options: { bold: true, color: C.white, fontSize: 12 } },
    ],
    ["Mechanism", "Venous outflow obstruction", "Unregulated arterial inflow (AV fistula)", "Recurrent ischemic episodes"],
    ["Cause", "SCD, idiopathic, drugs", "Perineal/penile trauma", "SCD (most common)"],
    ["Pain", "Yes — painful", "No — painless", "Yes — intermittent pain"],
    ["Rigidity", "Rigid corpora", "Semi-rigid / tumescent", "Variable"],
    ["Blood O2", "Low (<30 mmHg)", "Normal / High (>90 mmHg)", "Low during episodes"],
    ["Blood CO2", "High (>60 mmHg)", "Normal", "High during episodes"],
    ["Blood pH", "<7.25 (acidotic)", "Normal (7.35–7.45)", "Acidotic during episodes"],
    ["Emergency?", "YES — urologic emergency", "No — not an emergency", "Yes — treat each episode"],
    ["Doppler Flow", "Absent / low", "Turbulent high flow", "Absent during episode"],
    ["Treatment", "Aspiration + phenylephrine → shunt", "Conservative → angioembolization", "Symptomatic + preventive"],
  ];

  s.addTable(rows, {
    x: 0.3, y: 1.5, w: 9.4, h: 3.9,
    border: { type: "solid", color: "CCDDEE", pt: 0.5 },
    fill: { color: C.offWhite },
    rowH: 0.33,
    fontFace: "Calibri",
    fontSize: 10,
    color: C.darkText,
    colW: [1.6, 2.3, 2.5, 2.0],
    autoPage: false,
  });

  // override header row color via fill
  // (pptxgenjs colors the first row when you set header options)
  footer(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 8 — MANAGEMENT ALGORITHM (with textbook image)
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionBand(s, "Management", C.teal);
  slideTitle(s, "Management of Ischemic Priapism", "Time-dependent treatment algorithm", true);

  // Show the textbook flowchart image if available
  if (imgs[0] && imgs[0].base64) {
    s.addImage({ data: imgs[0].base64, x: 0.3, y: 1.5, w: 5.2, h: 3.8 });
    s.addText("Figure: Management of Ischemic Priapism\n(Smith & Tanagho General Urology / Hudnall et al. 2017)", {
      x: 0.3, y: 5.2, w: 5.2, h: 0.3, fontSize: 7, color: "888888", italic: true
    });
  } else {
    // Fallback flowchart text
    s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.5, w: 5.2, h: 3.8, fill: { color: C.lightGray }, rectRadius: 0.1 });
    s.addText("Management Flowchart\n(see notes)", { x: 0.3, y: 2.5, w: 5.2, h: 1.5, fontSize: 14, color: C.midText, align: "center" });
  }

  // Steps panel
  s.addShape(pres.ShapeType.roundRect, { x: 5.8, y: 1.5, w: 3.9, h: 3.8, fill: { color: C.navy }, rectRadius: 0.1 });
  s.addText([
    { text: "Step-by-Step", options: { bold: true, fontSize: 13, color: C.amber, breakLine: true } },
    { text: "\n< 24 hours", options: { bold: true, fontSize: 12, color: C.skyBlue, breakLine: true } },
    { text: "• Corporal aspiration (21G butterfly)\n• Phenylephrine 500 μg q5min IC\n• Blood gas to confirm ischemic type", options: { fontSize: 10, color: C.white, breakLine: true } },
    { text: "\n1–2 days", options: { bold: true, fontSize: 12, color: C.skyBlue, breakLine: true } },
    { text: "• T-shunt (Ebbehoj / Winter / Al-Ghorab)\n• Perioperative anticoagulation\n(Heparin 5000 U + Aspirin 325 mg)", options: { fontSize: 10, color: C.white, breakLine: true } },
    { text: "\n> 2 days", options: { bold: true, fontSize: 12, color: C.amber, breakLine: true } },
    { text: "• T-shunt + Tunneling + Anticoagulation\n• Consider early penile prosthesis\n  (within 4 weeks → better outcomes)", options: { fontSize: 10, color: C.white } },
  ], { x: 5.9, y: 1.6, w: 3.6, h: 3.6, valign: "top", margin: 8 });

  footer(s, "Priapism — Ischemic Management");
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 9 — SURGICAL SHUNTS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionBand(s, "Surgical Management", C.navy);
  slideTitle(s, "Shunt Procedures for Ischemic Priapism", "When aspiration + pharmacotherapy fail", true);

  // Distal shunts
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.55, w: 4.4, h: 1.9, fill: { color: C.navy }, rectRadius: 0.1 });
  s.addText([
    { text: "Distal Shunts (1st choice)", options: { bold: true, fontSize: 12, color: C.skyBlue, breakLine: true } },
    { text: "• Ebbehoj shunt — needle puncture of glans into corpus\n• Winter shunt — Tru-cut biopsy needle (percutaneous)\n• T-shunt — scalpel excision of tunical wedge\n• Al-Ghorab — open excision bilateral corporal windows", options: { fontSize: 10.5, color: C.white } },
  ], { x: 0.45, y: 1.65, w: 4.15, h: 1.75, valign: "top", margin: 6 });

  // Proximal shunts
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 3.6, w: 4.4, h: 1.7, fill: { color: C.teal }, rectRadius: 0.1 });
  s.addText([
    { text: "Proximal Shunts (historically used)", options: { bold: true, fontSize: 12, color: C.white, breakLine: true } },
    { text: "• Quackels (1964) — cavernosum-spongiosum anastomosis\n• Barry — cavernous to venous shunt\n• Now largely replaced by tunneling procedures (Lue, Burnett)", options: { fontSize: 10.5, color: C.offWhite } },
  ], { x: 0.45, y: 3.7, w: 4.15, h: 1.55, valign: "top", margin: 6 });

  // Anticoagulation box
  s.addShape(pres.ShapeType.roundRect, { x: 5.0, y: 1.55, w: 4.7, h: 2.3, fill: { color: C.amber }, rectRadius: 0.1 });
  s.addText([
    { text: "Perioperative Anticoagulation Protocol", options: { bold: true, fontSize: 12, color: C.navy, breakLine: true } },
    { text: "Critical to prevent premature shunt closure:", options: { fontSize: 10, color: C.navy, breakLine: true } },
    { text: "Preoperative: Heparin 5,000 U SQ + Aspirin 325 mg PO\nPostoperative (≥5 days): Aspirin 325 mg/day + Clopidogrel 75 mg/day", options: { fontSize: 11, bold: true, color: C.navy } },
    { text: "\n\nShunt failure occurs due to tunica albuginea incision → coagulation cascade activation", options: { fontSize: 9, color: C.midText, italic: true } },
  ], { x: 5.1, y: 1.65, w: 4.5, h: 2.15, valign: "top", margin: 8 });

  // Penile prosthesis box
  s.addShape(pres.ShapeType.roundRect, { x: 5.0, y: 4.0, w: 4.7, h: 1.3, fill: { color: C.lightGray }, rectRadius: 0.1 });
  s.addText([
    { text: "Early Penile Prosthesis Implantation", options: { bold: true, fontSize: 12, color: C.navy, breakLine: true } },
    { text: "For ischemia >48h: Early implantation (<4 weeks) → less erosion/infection, higher satisfaction, less penile shortening vs delayed implantation (Systematic Review 2024, PMID: 38465856)", options: { fontSize: 10, color: C.midText } },
  ], { x: 5.1, y: 4.1, w: 4.5, h: 1.2, valign: "top", margin: 6 });

  footer(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 10 — NON-ISCHEMIC MANAGEMENT
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionBand(s, "Non-Ischemic & Stuttering Management", C.green);
  slideTitle(s, "Non-Ischemic & Stuttering Priapism", "Different pathways — different treatments", true);

  // Non-ischemic left
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.55, w: 4.5, h: 3.8, fill: { color: C.green }, rectRadius: 0.1 });
  s.addText([
    { text: "Non-Ischemic Priapism", options: { bold: true, fontSize: 14, color: C.white, breakLine: true } },
    { text: "High-flow / Arterial", options: { italic: true, fontSize: 11, color: "CCFFEE", breakLine: true } },
    { text: " ", options: { fontSize: 7, breakLine: true } },
    { text: "Conservative (1st line):", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "• Observation & perineal ice packs\n• Many cases self-resolve\n• NOT a medical emergency", options: { fontSize: 10.5, color: C.white, breakLine: true } },
    { text: "\nAngiography & Embolization:", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "• Identifies cavernosal AV fistula\n• Superselective embolization\n• Preserves erectile function\n• Autologous clot or absorbable materials preferred (reversible)", options: { fontSize: 10.5, color: C.white } },
  ], { x: 0.45, y: 1.65, w: 4.2, h: 3.6, valign: "top", margin: 8 });

  // Stuttering right
  s.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.55, w: 4.5, h: 3.8, fill: { color: C.navy }, rectRadius: 0.1 });
  s.addText([
    { text: "Stuttering Priapism", options: { bold: true, fontSize: 14, color: C.skyBlue, breakLine: true } },
    { text: "Recurrent Ischemic", options: { italic: true, fontSize: 11, color: "88CCDD", breakLine: true } },
    { text: " ", options: { fontSize: 7, breakLine: true } },
    { text: "Acute episode:", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "• Home self-injection protocol\n• Oral α-adrenergic agents at onset\n• Pseudoephedrine at bedtime\n• Emergency aspiration if >4 hours", options: { fontSize: 10.5, color: C.white, breakLine: true } },
    { text: "\nPrevention / Long-term:", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "• PDE5 inhibitors (paradoxically preventive — normalize PDE5 regulation)\n• Oral β-agonists\n• Antiandrogens (reduce nocturnal erections)\n• GnRH analogues (for refractory cases)\n• Hydroxyurea (for SCD-related stuttering)", options: { fontSize: 10.5, color: C.white } },
  ], { x: 5.25, y: 1.65, w: 4.2, h: 3.6, valign: "top", margin: 8 });

  footer(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 11 — SICKLE CELL DISEASE SPECIAL CONSIDERATIONS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionBand(s, "Special Populations", C.red);
  slideTitle(s, "Priapism in Sickle Cell Disease", "Most common identifiable cause — 2–29% lifetime risk", true);

  // Left info
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.55, w: 5.5, h: 3.8, fill: { color: C.navy }, rectRadius: 0.1 });
  s.addText([
    { text: "Pathomechanism in SCD", options: { bold: true, fontSize: 12, color: C.amber, breakLine: true } },
    { text: "• HbS-predominant RBCs sickle within corpora cavernosa sinusoids during normal erection\n• Causes venous stasis → decreased pH + local O2 tension\n• Potentiates further sickling — a vicious cycle\n• Most episodes occur during sleep\n  (mild hypoventilatory acidosis + oxyhemoglobin desaturation)\n• Pain = sign of tissue ischemia", options: { fontSize: 10.5, color: C.white, breakLine: true } },
    { text: "\nManagement Priority", options: { bold: true, fontSize: 12, color: C.skyBlue, breakLine: true } },
    { text: "• Initial conservative: Hydration + Oxygenation + Alkalization + Analgesia\n• Exchange transfusion (reduces HbS concentration)\n• Evacuation + IC α-adrenergic injection (phenylephrine)\n• Surgical shunting if medical Rx fails\n• Educate patients: seek ED for episodes >1 hour", options: { fontSize: 10.5, color: C.white } },
  ], { x: 0.45, y: 1.65, w: 5.25, h: 3.6, valign: "top", margin: 8 });

  // Right stats / pearls
  s.addShape(pres.ShapeType.roundRect, { x: 6.1, y: 1.55, w: 3.6, h: 1.7, fill: { color: C.red }, rectRadius: 0.1 });
  s.addText([
    { text: "Lifetime Risk in SCD", options: { bold: true, fontSize: 12, color: C.white, breakLine: true } },
    { text: "2–29%", options: { fontSize: 36, bold: true, color: C.white, breakLine: true } },
    { text: "Males with homozygous HbSS", options: { fontSize: 10, color: "FFCCCC" } },
  ], { x: 6.15, y: 1.6, w: 3.45, h: 1.6, align: "center", valign: "middle" });

  s.addShape(pres.ShapeType.roundRect, { x: 6.1, y: 3.4, w: 3.6, h: 2.0, fill: { color: C.lightGray }, rectRadius: 0.1 });
  s.addText([
    { text: "Pediatric SCD Pearls", options: { bold: true, fontSize: 12, color: C.navy, breakLine: true } },
    { text: "• Stuttering priapism more common than fulminant in children\n• Pseudoephedrine at bedtime (oral α-agonist)\n• PDE5 inhibitors may prevent recurrence\n• Treat same as adults — accommodated guidelines (AUA/EAU)", options: { fontSize: 10, color: C.midText } },
  ], { x: 6.15, y: 3.5, w: 3.45, h: 1.8, valign: "top", margin: 6 });

  footer(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 12 — COMPLICATIONS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBand(s, "Complications & Outcomes", C.red);
  slideTitle(s, "Complications of Priapism", "Impotence is the most feared long-term sequel");

  // Big stat
  s.addShape(pres.ShapeType.roundRect, { x: 0.3, y: 1.55, w: 2.8, h: 3.8, fill: { color: C.red }, rectRadius: 0.1 });
  s.addText([
    { text: "Erectile\nDysfunction", options: { fontSize: 16, bold: true, color: C.white, breakLine: true } },
    { text: "#1 Complication", options: { fontSize: 11, color: "FFAAAA", italic: true, breakLine: true } },
    { text: " ", options: { fontSize: 10, breakLine: true } },
    { text: "Worse with:", options: { fontSize: 11, color: C.amber, bold: true, breakLine: true } },
    { text: "• Prolonged ischemia (>24h)\n• Delayed treatment\n• Repeated episodes\n• Fibrosis of corpora", options: { fontSize: 11, color: C.white } },
  ], { x: 0.45, y: 1.65, w: 2.55, h: 3.6, valign: "top", margin: 8 });

  // Complication list
  s.addShape(pres.ShapeType.roundRect, { x: 3.3, y: 1.55, w: 3.3, h: 3.8, fill: { color: "0A1E30" }, rectRadius: 0.1 });
  s.addText([
    { text: "Other Complications", options: { bold: true, fontSize: 13, color: C.skyBlue, breakLine: true } },
    { text: " ", options: { fontSize: 7, breakLine: true } },
    { text: "Penile fibrosis", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "From smooth muscle necrosis & collagen deposition", options: { fontSize: 10, color: C.white, breakLine: true } },
    { text: "\nPenile shortening", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "Post-ischemia corporal scarring", options: { fontSize: 10, color: C.white, breakLine: true } },
    { text: "\nShunt failure", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "Clot formation over tunica incision", options: { fontSize: 10, color: C.white, breakLine: true } },
    { text: "\nInfection / erosion", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "Post-prosthesis (less with early implant)", options: { fontSize: 10, color: C.white } },
  ], { x: 3.45, y: 1.65, w: 3.05, h: 3.6, valign: "top", margin: 8 });

  // Timeline
  s.addShape(pres.ShapeType.roundRect, { x: 6.8, y: 1.55, w: 2.9, h: 3.8, fill: { color: C.teal }, rectRadius: 0.1 });
  s.addText([
    { text: "Time & Outcome", options: { bold: true, fontSize: 13, color: C.white, breakLine: true } },
    { text: " ", options: { fontSize: 7, breakLine: true } },
    { text: "< 4 hours", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "Excellent prognosis for erectile function", options: { fontSize: 10, color: C.white, breakLine: true } },
    { text: "\n4–24 hours", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "Good if treated promptly", options: { fontSize: 10, color: C.white, breakLine: true } },
    { text: "\n24–48 hours", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "Moderate risk of ED", options: { fontSize: 10, color: C.white, breakLine: true } },
    { text: "\n> 48 hours", options: { bold: true, fontSize: 11, color: C.amber, breakLine: true } },
    { text: "High risk of permanent ED; consider early prosthesis", options: { fontSize: 10, color: C.white } },
  ], { x: 6.9, y: 1.65, w: 2.65, h: 3.6, valign: "top", margin: 8 });

  footer(s, "Priapism — Complications & Outcomes");
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 13 — KEY DRUGS & DOSES
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionBand(s, "Pharmacotherapy", C.teal);
  slideTitle(s, "Drug Therapy Summary", "Agents used in acute and preventive management", true);

  const drugRows = [
    [
      { text: "Drug", options: { bold: true, color: C.white, fontSize: 11 } },
      { text: "Class", options: { bold: true, color: C.white, fontSize: 11 } },
      { text: "Dose / Route", options: { bold: true, color: C.white, fontSize: 11 } },
      { text: "Indication", options: { bold: true, color: C.white, fontSize: 11 } },
      { text: "Notes", options: { bold: true, color: C.white, fontSize: 11 } },
    ],
    ["Phenylephrine", "α1-agonist", "500 μg IC q5min", "Ischemic priapism (1st line)", "Preferred — minimal CV risk"],
    ["Epinephrine", "α+β agonist", "Dilute IC injection", "Ischemic priapism", "Use with caution (CV effects)"],
    ["Pseudoephedrine", "Oral α-agonist", "30–60 mg PO at bedtime", "Stuttering priapism prevention", "Especially in children with SCD"],
    ["Terbutaline", "β2-agonist", "0.25–0.5 mg SC / PO", "Stuttering / early ischemic", "Less effective than phenylephrine"],
    ["PDE5 Inhibitors", "PDE5 inhibitor", "Daily low-dose PO", "Prevent recurrent stuttering", "Paradoxically preventive via PDE5 normalization"],
    ["Heparin", "Anticoagulant", "5,000 U SQ periop", "Post-shunt anticoagulation", "Prevents premature shunt closure"],
    ["Aspirin", "Antiplatelet", "325 mg PO periop → 5 days", "Post-shunt anticoagulation", "Combined with clopidogrel postop"],
    ["Clopidogrel", "Antiplatelet (P2Y12)", "75 mg PO daily × 5 days", "Post-shunt (postoperative)", "With aspirin after shunt procedure"],
    ["Hydroxyurea", "Cytoreductive agent", "Per SCD protocol", "SCD-related stuttering (long-term)", "Disease-modifying in SCD"],
    ["Antiandrogens / GnRH", "Hormonal", "Various regimens", "Refractory stuttering priapism", "Reduce nocturnal erections"],
  ];

  s.addTable(drugRows, {
    x: 0.3, y: 1.5, w: 9.4, h: 3.9,
    border: { type: "solid", color: "CCDDEE", pt: 0.5 },
    fill: { color: C.white },
    rowH: 0.33,
    fontFace: "Calibri",
    fontSize: 9.5,
    color: C.darkText,
    colW: [1.6, 1.4, 1.9, 2.2, 2.3],
    autoPage: false,
  });

  footer(s);
}

// ═══════════════════════════════════════════════════════════════════
// SLIDE 14 — SUMMARY & KEY POINTS
// ═══════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.45, h: 5.625, fill: { color: C.teal } });
  s.addShape(pres.ShapeType.rect, { x: 0.45, y: 0, w: 0.1, h: 5.625, fill: { color: C.amber } });

  s.addText("SUMMARY", {
    x: 0.75, y: 0.3, w: 9, h: 0.7, fontSize: 32, bold: true, color: C.white, charSpacing: 8
  });
  s.addShape(pres.ShapeType.rect, { x: 0.75, y: 0.98, w: 5, h: 0.04, fill: { color: C.amber } });

  s.addText([
    { text: "1. ", options: { bold: true, color: C.amber } },
    { text: "Priapism = erection >4 hours unrelated to stimulation — ", options: { color: C.white } },
    { text: "Ischemic is the urologic emergency.", options: { bold: true, color: C.red, breakLine: true } },

    { text: "2. ", options: { bold: true, color: C.amber } },
    { text: "Three types: Ischemic (low-flow, painful, rigid), Non-ischemic (high-flow, painless, post-trauma), Stuttering (recurrent ischemic).", options: { color: C.white, breakLine: true } },

    { text: "3. ", options: { bold: true, color: C.amber } },
    { text: "Sickle cell disease is the most common identifiable cause — affects 2–29% of males with HbSS.", options: { color: C.white, breakLine: true } },

    { text: "4. ", options: { bold: true, color: C.amber } },
    { text: "Diagnosis: Corporal blood gas — hypoxic/hypercapnic/acidotic = ischemic; normal gases = non-ischemic. Doppler USS confirms.", options: { color: C.white, breakLine: true } },

    { text: "5. ", options: { bold: true, color: C.amber } },
    { text: "Treatment of ischemic: Aspiration + Phenylephrine → Surgical shunt (distal first) → Tunneling → Early prosthesis if >48 hours.", options: { color: C.white, breakLine: true } },

    { text: "6. ", options: { bold: true, color: C.amber } },
    { text: "Perioperative anticoagulation (Heparin + Aspirin ± Clopidogrel) prevents shunt failure.", options: { color: C.white, breakLine: true } },

    { text: "7. ", options: { bold: true, color: C.amber } },
    { text: "Non-ischemic: Not an emergency — conservative first; angioembolization for persistent cases.", options: { color: C.white, breakLine: true } },

    { text: "8. ", options: { bold: true, color: C.amber } },
    { text: "Impotence is the #1 sequela — early diagnosis and treatment (<4 hours) offers best prognosis.", options: { color: C.white } },
  ], { x: 0.75, y: 1.1, w: 9, h: 4.2, valign: "top", fontSize: 12, fontFace: "Calibri", lineSpacingMultiple: 1.3 });
}

// ─── WRITE FILE ───────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/priapism-ppt/Priapism_Comprehensive.pptx";
pres.writeFile({ fileName: outPath })
  .then(() => console.log("SUCCESS: " + outPath))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
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.