Create a simple ppt black and white print out friendly adding diagrams.topic is Priapism(10 SLIDES) which includes defition,etiology,pathogenesis,classification,clinical manifestation,diagnosis and differential diagnosis and treatment.make it chronological as I said.Together everything should include 10 pages total

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

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

Writing File

~/priapism-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Priapism – Clinical Overview";

// ─── Colour palette (B&W print-friendly) ───────────────────────────────────
const C = {
  BLACK:   "000000",
  WHITE:   "FFFFFF",
  DARK:    "1A1A1A",
  MID:     "444444",
  LGRAY:   "888888",
  XLIGHT:  "E8E8E8",
  BORDER:  "BBBBBB",
};

// ─── Shared helpers ─────────────────────────────────────────────────────────
function titleBar(slide, text, sub) {
  // black top banner
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 10, h: 1.0,
    fill: { color: C.BLACK }, line: { color: C.BLACK },
  });
  slide.addText(text, {
    x: 0.2, y: 0, w: 9.6, h: 1.0,
    fontSize: 22, bold: true, color: C.WHITE, valign: "middle",
    fontFace: "Arial",
  });
  if (sub) {
    slide.addText(sub, {
      x: 0.2, y: 1.0, w: 9.6, h: 0.4,
      fontSize: 11, color: C.LGRAY, fontFace: "Arial", italic: true,
    });
  }
  // bottom rule
  slide.addShape(pres.ShapeType.line, {
    x: 0, y: 5.4, w: 10, h: 0,
    line: { color: C.BORDER, width: 1 },
  });
  slide.addText("Priapism | Clinical Overview", {
    x: 0, y: 5.45, w: 9.5, h: 0.15,
    fontSize: 7, color: C.LGRAY, align: "right", fontFace: "Arial",
  });
}

function bullets(slide, items, opts = {}) {
  const { x = 0.35, y = 1.55, w = 9.3, h = 3.7, fs = 14 } = opts;
  const arr = items.map((it, i) => ({
    text: it.sub ? it.text : it,
    options: {
      bullet: it.sub ? false : { type: "bullet", indent: it.sub ? 30 : 15 },
      breakLine: true,
      fontSize: it.sub ? fs - 1.5 : fs,
      color: it.sub ? C.MID : C.DARK,
      bold: it.bold || false,
      fontFace: "Arial",
      indentLevel: it.indent || 0,
    },
  }));
  slide.addText(arr, { x, y, w, h, valign: "top" });
}

function box(slide, x, y, w, h, title, lines, opts = {}) {
  const { fill = C.XLIGHT, titleFill = C.BLACK } = opts;
  slide.addShape(pres.ShapeType.rect, {
    x, y, w, h, fill: { color: fill },
    line: { color: C.BORDER, width: 0.75 },
  });
  slide.addShape(pres.ShapeType.rect, {
    x, y, w, h: 0.32,
    fill: { color: titleFill }, line: { color: titleFill },
  });
  slide.addText(title, {
    x: x + 0.07, y, w: w - 0.14, h: 0.32,
    fontSize: 10, bold: true, color: C.WHITE, valign: "middle", fontFace: "Arial",
  });
  const bodyArr = lines.map((l, i) => ({
    text: l,
    options: { breakLine: i < lines.length - 1, fontSize: 10, color: C.DARK, fontFace: "Arial" },
  }));
  slide.addText(bodyArr, {
    x: x + 0.1, y: y + 0.36, w: w - 0.2, h: h - 0.42,
    valign: "top",
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 1 – TITLE
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  // full black background
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 10, h: 5.625,
    fill: { color: C.BLACK }, line: { color: C.BLACK },
  });
  // white accent bar (left side)
  s.addShape(pres.ShapeType.rect, {
    x: 0.55, y: 1.3, w: 0.08, h: 3,
    fill: { color: C.WHITE }, line: { color: C.WHITE },
  });
  s.addText("PRIAPISM", {
    x: 0.8, y: 1.25, w: 8.5, h: 1.2,
    fontSize: 48, bold: true, color: C.WHITE, fontFace: "Arial",
  });
  s.addText("Clinical Overview: Definition · Etiology · Pathogenesis\nClassification · Manifestations · Diagnosis · Treatment", {
    x: 0.8, y: 2.6, w: 8.5, h: 1.2,
    fontSize: 14, color: "CCCCCC", fontFace: "Arial",
  });
  // bottom label
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 5.05, w: 10, h: 0.575,
    fill: { color: "222222" }, line: { color: "222222" },
  });
  s.addText("Urology & Emergency Medicine  |  2026", {
    x: 0.5, y: 5.1, w: 9, h: 0.47,
    fontSize: 12, color: C.LGRAY, fontFace: "Arial",
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 2 – DEFINITION
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  titleBar(s, "01  |  Definition", "What is Priapism?");

  // large quote block
  s.addShape(pres.ShapeType.rect, {
    x: 0.35, y: 1.5, w: 9.3, h: 1.45,
    fill: { color: C.XLIGHT }, line: { color: C.BORDER, width: 1 },
  });
  s.addText(""A prolonged, persistent penile erection unrelated to sexual interest or stimulation,\nlasting longer than 4 hours."", {
    x: 0.5, y: 1.55, w: 9.0, h: 1.35,
    fontSize: 15, italic: true, color: C.DARK, valign: "middle",
    align: "center", fontFace: "Arial",
  });

  // etymology note
  s.addText("Etymology: Named after Priapus, the ancient Greek god of fertility depicted with oversized genitalia.", {
    x: 0.35, y: 3.05, w: 9.3, h: 0.35,
    fontSize: 10.5, color: C.LGRAY, italic: true, fontFace: "Arial",
  });

  // key facts row
  box(s, 0.35, 3.5,  3.0, 1.6, "Incidence",
    ["Up to 5.34 / 100,000 men/year", "(ischemic type)", "Higher in sickle cell patients"]);
  box(s, 3.6,  3.5,  3.0, 1.6, "Duration Criterion",
    ["> 4 hours without", "sexual stimulation", "= diagnostic threshold"]);
  box(s, 6.85, 3.5,  2.8, 1.6, "Key Concern",
    ["Urologic EMERGENCY", "(ischemic type)", "Risk of ED if untreated"]);
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 3 – ETIOLOGY
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  titleBar(s, "02  |  Etiology", "Causes by category");

  // Two-column layout
  const leftCauses = [
    "HEMATOLOGIC",
    "  · Sickle cell disease (most common)",
    "  · Leukemia / lymphoma",
    "  · Thalassemia",
    "  · Glucose-6-phosphate deficiency",
    "",
    "NEUROGENIC",
    "  · Spinal cord injury",
    "  · Cauda equina lesions",
    "  · General anaesthesia",
  ];
  const rightCauses = [
    "PHARMACOLOGIC",
    "  · Intracavernous injections (PGE1)",
    "  · Trazodone / antidepressants",
    "  · Antipsychotics (chlorpromazine)",
    "  · Anticoagulants (heparin)",
    "",
    "OTHER",
    "  · Perineal / penile trauma",
    "  · Pelvic tumours / infections",
    "  · Idiopathic (~60% of cases)",
  ];

  s.addText(leftCauses.map((t, i) => ({
    text: t,
    options: {
      breakLine: true,
      fontSize: t === "" ? 6 : (t === t.toUpperCase() && t !== "" ? 11.5 : 11),
      bold: (t === t.toUpperCase() && t !== ""),
      color: (t === t.toUpperCase() && t !== "") ? C.BLACK : C.DARK,
      fontFace: "Arial",
    }
  })), { x: 0.4, y: 1.5, w: 4.5, h: 3.8, valign: "top" });

  s.addShape(pres.ShapeType.line, {
    x: 5.0, y: 1.55, w: 0, h: 3.7,
    line: { color: C.BORDER, width: 0.75 },
  });

  s.addText(rightCauses.map((t, i) => ({
    text: t,
    options: {
      breakLine: true,
      fontSize: t === "" ? 6 : (t === t.toUpperCase() && t !== "" ? 11.5 : 11),
      bold: (t === t.toUpperCase() && t !== ""),
      color: (t === t.toUpperCase() && t !== "") ? C.BLACK : C.DARK,
      fontFace: "Arial",
    }
  })), { x: 5.15, y: 1.5, w: 4.5, h: 3.8, valign: "top" });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 4 – PATHOGENESIS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  titleBar(s, "03  |  Pathogenesis", "Mechanisms of ischemic vs. non-ischemic priapism");

  // ── Cascade diagram – ISCHEMIC ───────────────────────────────────────────
  const steps = [
    "Venous outflow\nobstruction",
    "Arterial inflow\ncontinues",
    "Ischemia &\nhypoxia",
    "Smooth muscle\ndamage",
    "Fibrosis &\nED",
  ];
  const arrowY = 2.0;
  const boxW = 1.6, boxH = 0.75, gap = 0.16;
  const totalW = steps.length * boxW + (steps.length - 1) * gap;
  const startX = (10 - totalW) / 2;

  // header label
  s.addText("ISCHEMIC (Low-Flow) CASCADE", {
    x: startX - 0.1, y: 1.52, w: totalW + 0.2, h: 0.32,
    fontSize: 10, bold: true, color: C.BLACK, fontFace: "Arial",
  });

  steps.forEach((txt, i) => {
    const bx = startX + i * (boxW + gap);
    const shade = i === 2 ? C.BLACK : (i > 2 ? "333333" : "555555");
    s.addShape(pres.ShapeType.rect, {
      x: bx, y: arrowY, w: boxW, h: boxH,
      fill: { color: shade }, line: { color: shade },
    });
    s.addText(txt, {
      x: bx, y: arrowY, w: boxW, h: boxH,
      fontSize: 9.5, color: C.WHITE, bold: true,
      align: "center", valign: "middle", fontFace: "Arial",
    });
    if (i < steps.length - 1) {
      const ax = bx + boxW + 0.02;
      s.addShape(pres.ShapeType.line, {
        x: ax, y: arrowY + boxH / 2, w: gap - 0.04, h: 0,
        line: { color: C.BLACK, width: 1.5, endArrowType: "arrow" },
      });
    }
  });

  // molecular note
  s.addText("Molecular mediators: PDE5 dysregulation  ·  ↓ Nitric Oxide (NO)  ·  ↓ cGMP signalling  ·  RBC sickling / venous stasis", {
    x: startX - 0.3, y: 2.9, w: totalW + 0.6, h: 0.35,
    fontSize: 9.5, italic: true, color: C.MID, align: "center", fontFace: "Arial",
  });

  // dividing line
  s.addShape(pres.ShapeType.line, {
    x: 0.4, y: 3.35, w: 9.2, h: 0,
    line: { color: C.BORDER, width: 0.5 },
  });

  // NON-ISCHEMIC explanation
  s.addText("NON-ISCHEMIC (High-Flow) MECHANISM", {
    x: 0.4, y: 3.42, w: 9.2, h: 0.3,
    fontSize: 10, bold: true, color: C.BLACK, fontFace: "Arial",
  });

  const niSteps = [
    "Perineal /\npenile trauma",
    "Cavernosal artery\ninjury",
    "Arterio-cavernous\nfistula forms",
    "Unregulated\narterial inflow",
    "Persistent painless\ntumescence",
  ];
  const niY = 3.8;
  niSteps.forEach((txt, i) => {
    const bx = startX + i * (boxW + gap);
    s.addShape(pres.ShapeType.rect, {
      x: bx, y: niY, w: boxW, h: boxH,
      fill: { color: C.XLIGHT }, line: { color: C.BORDER, width: 0.75 },
    });
    s.addText(txt, {
      x: bx, y: niY, w: boxW, h: boxH,
      fontSize: 9.5, color: C.DARK, bold: false,
      align: "center", valign: "middle", fontFace: "Arial",
    });
    if (i < niSteps.length - 1) {
      const ax = bx + boxW + 0.02;
      s.addShape(pres.ShapeType.line, {
        x: ax, y: niY + boxH / 2, w: gap - 0.04, h: 0,
        line: { color: C.MID, width: 1.5, endArrowType: "arrow" },
      });
    }
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 5 – CLASSIFICATION
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  titleBar(s, "04  |  Classification", "Three recognised types");

  const types = [
    {
      title: "ISCHEMIC\n(Low-Flow)",
      rows: [
        ["Mechanism", "Venous outflow obstruction"],
        ["Blood gases", "Hypoxic, hypercapnic, acidotic"],
        ["Pain", "Painful, rigid"],
        ["Urgency", "EMERGENCY – treat promptly"],
        ["Most common?", "Yes (~most presentations)"],
      ],
      fill: C.BLACK, hdr: C.WHITE,
    },
    {
      title: "NON-ISCHEMIC\n(High-Flow)",
      rows: [
        ["Mechanism", "Arterio-cavernous fistula"],
        ["Blood gases", "Normal O2, normal CO2"],
        ["Pain", "Painless, not fully rigid"],
        ["Urgency", "NOT an emergency"],
        ["Most common?", "Uncommon"],
      ],
      fill: "333333", hdr: C.WHITE,
    },
    {
      title: "STUTTERING\n(Recurrent)",
      rows: [
        ["Mechanism", "Recurrent ischemic episodes"],
        ["Blood gases", "Hypoxic (during episodes)"],
        ["Pain", "Painful episodes; resolves"],
        ["Urgency", "Requires prevention strategy"],
        ["Most common?", "Sickle cell patients"],
      ],
      fill: "666666", hdr: C.WHITE,
    },
  ];

  types.forEach((t, col) => {
    const bx = 0.35 + col * 3.22;
    const bw = 3.0;
    // header
    s.addShape(pres.ShapeType.rect, {
      x: bx, y: 1.45, w: bw, h: 0.65,
      fill: { color: t.fill }, line: { color: t.fill },
    });
    s.addText(t.title, {
      x: bx, y: 1.45, w: bw, h: 0.65,
      fontSize: 11, bold: true, color: t.hdr,
      align: "center", valign: "middle", fontFace: "Arial",
    });
    // rows
    t.rows.forEach((r, ri) => {
      const ry = 2.15 + ri * 0.56;
      const rowFill = ri % 2 === 0 ? C.XLIGHT : C.WHITE;
      s.addShape(pres.ShapeType.rect, {
        x: bx, y: ry, w: bw, h: 0.54,
        fill: { color: rowFill }, line: { color: C.BORDER, width: 0.5 },
      });
      s.addText(r[0], {
        x: bx + 0.06, y: ry + 0.04, w: bw * 0.42, h: 0.46,
        fontSize: 9, bold: true, color: C.DARK, valign: "middle", fontFace: "Arial",
      });
      s.addText(r[1], {
        x: bx + bw * 0.42 + 0.04, y: ry + 0.04, w: bw * 0.55, h: 0.46,
        fontSize: 9, color: C.DARK, valign: "middle", fontFace: "Arial",
      });
    });
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 6 – CLINICAL MANIFESTATIONS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  titleBar(s, "05  |  Clinical Manifestations", "Signs & symptoms by type");

  // Anatomy callout (text diagram of penis cross-section areas involved)
  s.addShape(pres.ShapeType.rect, {
    x: 0.35, y: 1.5, w: 3.5, h: 3.7,
    fill: { color: C.XLIGHT }, line: { color: C.BORDER, width: 0.75 },
  });
  s.addText("ANATOMICAL BASIS", {
    x: 0.35, y: 1.5, w: 3.5, h: 0.32,
    fontSize: 10, bold: true, color: C.WHITE, valign: "middle",
    fill: { color: C.BLACK },
    fontFace: "Arial",
  });
  // cross-section diagram labels
  const penisLabels = [
    { text: "Corpora Cavernosa (×2)", y: 2.05, note: "→ Engorged; tense & tender" },
    { text: "Corpus Spongiosum", y: 2.65, note: "→ SOFT (not involved)" },
    { text: "Glans Penis", y: 3.25, note: "→ SOFT (not involved)" },
    { text: "Duration", y: 3.85, note: "→ > 4 hours" },
    { text: "Setting", y: 4.3, note: "→ No sexual stimulation" },
  ];
  penisLabels.forEach(p => {
    s.addText(p.text, {
      x: 0.5, y: p.y, w: 1.5, h: 0.35,
      fontSize: 9.5, bold: true, color: C.DARK, fontFace: "Arial",
    });
    s.addText(p.note, {
      x: 2.0, y: p.y, w: 1.7, h: 0.35,
      fontSize: 9, color: C.MID, fontFace: "Arial",
    });
  });

  // Right: two symptom boxes
  box(s, 4.1, 1.5, 5.4, 1.7, "Ischemic (Low-Flow) — Presentation",
    [
      "Painful, rigid erection (corpora cavernosa only)",
      "Glans & corpus spongiosum remain soft",
      "Onset: gradual; often nocturnal in sickle cell Dx",
      "Hypoxic, acidotic blood on aspiration",
    ]);

  box(s, 4.1, 3.3, 5.4, 1.7, "Non-Ischemic (High-Flow) — Presentation",
    [
      "Painless, partially rigid / tumescent erection",
      "History of antecedent trauma to perineum/penis",
      "Normal oxygenation – not ischemic",
      "Bruit may be audible over fistula",
    ]);

  // Stuttering note
  s.addText("Stuttering priapism: recurrent painful episodes < 2 h each, spontaneously resolving; common in sickle cell disease; risk of escalation to prolonged ischemic episode.", {
    x: 0.35, y: 5.22, w: 9.3, h: 0.35,
    fontSize: 8.5, italic: true, color: C.LGRAY, fontFace: "Arial",
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 7 – DIAGNOSIS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  titleBar(s, "06  |  Diagnosis", "History, examination, investigations");

  // 3 column boxes
  box(s, 0.35, 1.5, 2.9, 3.7, "History",
    [
      "Duration of erection",
      "Pain level (1-10)",
      "Prior episodes",
      "Medications (especially intracavernous)",
      "Haematologic Dx (sickle cell, leukaemia)",
      "Trauma / injury",
      "Sickle cell family history",
    ]);

  box(s, 3.45, 1.5, 2.9, 3.7, "Physical Examination",
    [
      "Rigid corpora cavernosa",
      "Soft glans + spongiosum",
      "Perineal bruising (trauma?)",
      "Lymph nodes / splenomegaly",
      "Neurological assessment",
      "Auscultate for bruit (high-flow)",
    ]);

  box(s, 6.55, 1.5, 3.1, 3.7, "Investigations",
    [
      "Corporal blood gas aspiration:",
      "  ischemic: pO2 <30, pCO2 >60",
      "  non-ischemic: normal",
      "CBC / peripheral smear",
      "Sickle cell screen (Hb electrophoresis)",
      "Colour duplex Doppler US",
      "  (fistula in high-flow)",
      "Arteriography (pre-embolisation)",
    ]);
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 8 – DIFFERENTIAL DIAGNOSIS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  titleBar(s, "07  |  Differential Diagnosis", "Conditions to distinguish from priapism");

  const dds = [
    ["Penile fracture", "Acute injury during intercourse; snap sound; rapid detumescence; bruising/haematoma"],
    ["Peyronie's disease", "Painful curvature on erection; fibrous plaque palpable; not prolonged tumescence"],
    ["Penile oedema", "Non-erect, oedematous shaft; cardiac/renal cause; no engorgement of corpora"],
    ["Phimosis / paraphimosis", "Glans involvement; foreskin retraction; constriction rather than prolonged erection"],
    ["Urethral stricture / infection", "Voiding dysfunction predominates; urethra tender; no prolonged erection"],
    ["Psychogenic erection", "Resolves with ejaculation; < 4 hours; no pain; no identifiable vascular cause"],
    ["Penile malignancy", "Mass/lesion palpable; may compress venous drainage; chronic course; constitutional symptoms"],
  ];

  // Table header
  s.addShape(pres.ShapeType.rect, {
    x: 0.35, y: 1.5, w: 9.3, h: 0.35,
    fill: { color: C.BLACK }, line: { color: C.BLACK },
  });
  s.addText("Condition", {
    x: 0.4, y: 1.5, w: 2.5, h: 0.35,
    fontSize: 10, bold: true, color: C.WHITE, valign: "middle", fontFace: "Arial",
  });
  s.addText("Distinguishing Features", {
    x: 3.0, y: 1.5, w: 6.6, h: 0.35,
    fontSize: 10, bold: true, color: C.WHITE, valign: "middle", fontFace: "Arial",
  });

  dds.forEach(([cond, feat], i) => {
    const ry = 1.88 + i * 0.46;
    const rowFill = i % 2 === 0 ? C.XLIGHT : C.WHITE;
    s.addShape(pres.ShapeType.rect, {
      x: 0.35, y: ry, w: 9.3, h: 0.44,
      fill: { color: rowFill }, line: { color: C.BORDER, width: 0.5 },
    });
    s.addText(cond, {
      x: 0.45, y: ry + 0.03, w: 2.5, h: 0.38,
      fontSize: 9.5, bold: true, color: C.DARK, valign: "middle", fontFace: "Arial",
    });
    s.addText(feat, {
      x: 3.05, y: ry + 0.03, w: 6.5, h: 0.38,
      fontSize: 9, color: C.DARK, valign: "middle", fontFace: "Arial",
    });
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 9 – TREATMENT (ISCHEMIC)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  titleBar(s, "08  |  Treatment — Ischemic Priapism", "Step-wise management algorithm");

  // Step flow chart (vertical steps)
  const steps = [
    { n: "1", label: "Analgesia + IV access + CBC / sickle screen", note: "Parenteral opioid; rule out haematologic cause" },
    { n: "2", label: "Oral / SC terbutaline (0.25–0.5 mg SC)", note: "Optional first-line; repeat in 15 min; ~45% detumescence" },
    { n: "3", label: "Intracavernous α-adrenergic injection", note: "Phenylephrine 100–500 mcg; repeat q20 min × 3 (preferred agent)" },
    { n: "4", label: "Corporal aspiration (if above fails)", note: "Aspirate 20–30 mL dark venous blood; visible change to bright red = success" },
    { n: "5", label: "Aspiration + saline / dilute agonist irrigation", note: "Aspirate–irrigate–aspirate cycle until detumescence" },
    { n: "6", label: "Surgical shunt (urology)", note: "Cavernosum–spongiosum shunt; saphenous–cavernous shunt if distal fails" },
  ];

  const sY0 = 1.5, sH = 0.54, sGap = 0.06;
  steps.forEach((st, i) => {
    const sy = sY0 + i * (sH + sGap);
    // circle
    s.addShape(pres.ShapeType.ellipse, {
      x: 0.35, y: sy + 0.06, w: 0.42, h: 0.42,
      fill: { color: C.BLACK }, line: { color: C.BLACK },
    });
    s.addText(st.n, {
      x: 0.35, y: sy + 0.06, w: 0.42, h: 0.42,
      fontSize: 11, bold: true, color: C.WHITE,
      align: "center", valign: "middle", fontFace: "Arial",
    });
    // connector line (except last)
    if (i < steps.length - 1) {
      s.addShape(pres.ShapeType.line, {
        x: 0.555, y: sy + 0.48, w: 0, h: sGap + 0.06,
        line: { color: C.MID, width: 1 },
      });
    }
    // label box
    const shade = i === 5 ? "333333" : (i === 0 ? "555555" : C.XLIGHT);
    const txtColor = (i === 5 || i === 0) ? C.WHITE : C.DARK;
    s.addShape(pres.ShapeType.rect, {
      x: 0.88, y: sy, w: 8.8, h: sH,
      fill: { color: shade }, line: { color: C.BORDER, width: 0.5 },
    });
    s.addText(st.label, {
      x: 0.96, y: sy + 0.02, w: 5.5, h: 0.26,
      fontSize: 10.5, bold: true, color: txtColor, valign: "middle", fontFace: "Arial",
    });
    s.addText(st.note, {
      x: 0.96, y: sy + 0.28, w: 8.6, h: 0.22,
      fontSize: 8.5, italic: true, color: txtColor === C.WHITE ? "CCCCCC" : C.LGRAY,
      fontFace: "Arial",
    });
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 10 – TREATMENT (NON-ISCHEMIC & STUTTERING) + COMPLICATIONS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  titleBar(s, "09–10  |  Treatment (Non-Ischemic & Stuttering) + Complications", "Completing the management picture");

  box(s, 0.35, 1.5, 4.3, 2.15, "Non-Ischemic Treatment",
    [
      "Conservative — NOT an emergency",
      "Observation: may self-resolve",
      "Selective arterial embolisation",
      "  (superselective angio-embolisation of fistula)",
      "Surgery if embolisation fails",
      "Erectile function usually preserved",
    ]);

  box(s, 4.85, 1.5, 4.8, 2.15, "Stuttering / Sickle Cell Treatment",
    [
      "Acute: same as ischemic protocol",
      "Prevention: oral PDE5 inhibitors (long-term)",
      "Oral pseudoephedrine at bedtime",
      "Oral β-agonist (alternative)",
      "Hydration + oxygenation + alkalisation",
      "Exchange transfusion to reduce HbS",
    ]);

  // Complications table
  s.addShape(pres.ShapeType.rect, {
    x: 0.35, y: 3.75, w: 9.3, h: 0.35,
    fill: { color: C.BLACK }, line: { color: C.BLACK },
  });
  s.addText("COMPLICATIONS OF UNTREATED / UNDERTREATED PRIAPISM", {
    x: 0.45, y: 3.75, w: 9.1, h: 0.35,
    fontSize: 10, bold: true, color: C.WHITE, valign: "middle", fontFace: "Arial",
  });

  const comps = [
    ["Erectile dysfunction (ED)", "Most feared; >1/3 of severe cases; risk rises sharply after 24–48 h"],
    ["Penile fibrosis", "Interstitial oedema → fibrosis if ischaemia prolonged"],
    ["Penile gangrene", "Rare; extreme untreated ischemia"],
    ["Psychological morbidity", "Anxiety, depression related to ED and repeated episodes"],
  ];
  comps.forEach(([c, d], i) => {
    const ry = 4.14 + i * 0.34;
    s.addShape(pres.ShapeType.rect, {
      x: 0.35, y: ry, w: 9.3, h: 0.32,
      fill: { color: i % 2 === 0 ? C.XLIGHT : C.WHITE },
      line: { color: C.BORDER, width: 0.5 },
    });
    s.addText(c, {
      x: 0.45, y: ry + 0.02, w: 2.8, h: 0.28,
      fontSize: 9.5, bold: true, color: C.DARK, valign: "middle", fontFace: "Arial",
    });
    s.addText(d, {
      x: 3.3, y: ry + 0.02, w: 6.3, h: 0.28,
      fontSize: 9, color: C.DARK, valign: "middle", fontFace: "Arial",
    });
  });

  s.addText("Key principle: Early recognition (< 6 hours) and prompt treatment are the strongest predictors of preserved erectile function.", {
    x: 0.35, y: 5.26, w: 9.3, h: 0.3,
    fontSize: 9, italic: true, bold: true, color: C.BLACK, fontFace: "Arial",
  });
}

// ─── Write file ──────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/priapism-ppt/Priapism_Clinical_Overview.pptx" })
  .then(() => console.log("Done: Priapism_Clinical_Overview.pptx"))
  .catch(e => { console.error(e); process.exit(1); });
Running Command

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

Editing File

~/priapism-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/priapism-ppt/build.js'
Running Command

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

Running Command

ls -lh /home/daytona/workspace/priapism-ppt/Priapism_Clinical_Overview.pptx

Your presentation is ready:

Priapism Clinical Overview

Presentation · PPTX


Slide breakdown (10 slides total):
#Slide
1Title - Priapism, bold black cover
2Definition - AUA definition quote, etymology, 3 key-fact boxes
3Etiology - Two-column layout: Hematologic, Neurogenic / Pharmacologic, Other
4Pathogenesis - Visual cascade diagram for ischemic (5-step flow) + separate non-ischemic cascade; molecular mediators listed
5Classification - 3-column comparison table: Ischemic vs Non-ischemic vs Stuttering
6Clinical Manifestations - Anatomy callout (what's involved/spared) + symptom boxes per type
7Diagnosis - 3-column boxes: History / Physical exam / Investigations (blood gases, Doppler, labs)
8Differential Diagnosis - Striped table with 7 conditions and distinguishing features
9Treatment - Ischemic - 6-step numbered algorithm flowchart
10Treatment (Non-ischemic & Stuttering) + Complications - Two treatment boxes + complications table
The design is entirely black, white, and grey - no colour blocks that would print poorly. All diagrams are built as native PowerPoint shapes so they scale cleanly on any printer.
This is a shared conversation. Sign in to Orris to start your own chat.