I am a general surgery resident and i will present my seminar on Differential diagnosis of RIF mass . Make a detail ppt with images so that i can present it in my class which includes all mass which are present in RIf region in all 3 1) abdominal wall

Asking for Preferences
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Searching Images

right iliac fossa mass differential diagnosis anatomy

Searching Images

appendix mass appendiceal abscess CT scan

Searching Images

ileocecal tuberculosis CT scan abdominal

Searching Images

Crohn disease terminal ileum CT inflammation

Searching Images

ovarian cyst right adnexal mass ultrasound

Searching Images

psoas abscess iliopsoas CT retroperitoneal

Searching Images

caecal carcinoma cecal cancer CT right colon

Searching Images

rectus sheath hematoma abdominal wall mass

Searching Images

inguinal hernia groin swelling clinical

Searching Images

lymphoma retroperitoneal lymph node mass CT

Finding Sources
Finding Sources
Running Command

mkdir -p /home/daytona/workspace/rif-mass-ppt && ls /home/daytona/workspace/rif-mass-ppt/

Answer my questions

Sure! Go ahead and ask your questions — I'm ready to help.

I am a general surgery resident and i will present my seminar on Differential diagnosis of RIF mass . Make a detail ppt with images so that i can present it in my class which includes all mass which are present in RIf region in all 3 1) abdominal wall 2) ant 3) retro peritoneal

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

right iliac fossa RIF mass differential diagnosis anatomy regions

Searching Images

appendicular mass appendiceal abscess CT scan ultrasound

Finding Sources
Finding Sources
Finding Sources
Searching Images

ileocecal tuberculosis CT abdominal mass cecum

Searching Images

Crohn disease terminal ileum right iliac fossa mass CT

Searching Images

psoas abscess retroperitoneal CT right side

Searching Images

ovarian cyst torsion right adnexal mass ultrasound CT

Searching Images

cecal carcinoma right colon cancer CT scan surgery specimen

Searching Images

rectus sheath hematoma abdominal wall CT scan

Searching Images

inguinal hernia lipoma desmoid tumor abdominal wall RIF

Running Command

mkdir -p /home/daytona/workspace/rif-mass-ppt && echo "ready"

Writing File

~/rif-mass-ppt/build.js

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

// ─────────────────────────────────────────────────────────────────
// FETCH IMAGES
// ─────────────────────────────────────────────────────────────────
const imageUrls = [
  // 0 – RIF mass overview / overview CT
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_e03e72d4af7428fe57e6cd7144a4847a6cd130b319465d6468289e44f2b4a718.jpg",
  // 1 – Appendicular phlegmon US
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_df3fb89bf24ccce9b27c9eae8f28608c24bc91c0f6ca7db1465dfab83e7bbf1d.jpg",
  // 2 – Appendiceal abscess CT axial
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a4e18e95ce302d9a5b2d2235a7b2acb1deac79b41526a7c2906912e56f472e87.jpg",
  // 3 – Appendiceal mucocele CT
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_7f6658f67a70ba5cada6da9123255609d69c021defb33f2b14774769165d19be.jpg",
  // 4 – Ileocecal TB coronal CT (before/after ATT)
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_cf9ce00c108f113a6cb8e949d5322c823ad238e1bad76d4585e85f2f3d858517.jpg",
  // 5 – Ileocecal TB axial CT wall thickening
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_d8756dce4b4f26693dde5457a7d6d06d85f4f135302aa63b5b8a318bc1144a1b.jpg",
  // 6 – Crohn's disease RIF abscess CT
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_946425e61c12a44f8c44dfc5f0b94e6209d8b80ce762bbc25a8a48a00b8f0559.jpg",
  // 7 – Crohn's terminal ileum CT comb sign
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_10478fac4cfc39c9a44595169568317aa389b3c3797078dac73c7d9fd7e22643.jpg",
  // 8 – Cecal carcinoma CT mass
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_248486df466254dc29c2fbe06f29aeb43810883e2aa0c7d07921c4a3bbc132be.jpg",
  // 9 – Right hemicolectomy specimen
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_78cc1e15cdc62e923639ce52911af128261d17195c39da6eaefcd659fb6fe0c9.jpg",
  // 10 – Ovarian torsion CT whirlpool sign
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_e7448b30c79e830748e9a8f54b38a94092774f0ecca63bb1c4888b453dd34466.jpg",
  // 11 – Psoas abscess right side CT
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_64289d252966f351d61982c88710dac73fed898cda45b3287372392a352c7027.jpg",
  // 12 – Psoas abscess bilateral CT
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_66135e71eb9523206b0d79ea1a9de1cbaade681da129e3e194698be7d41dc30c.jpg",
  // 13 – Rectus sheath hematoma CT axial
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_6fdaa566f820444c5b98061354aa99424bcec83d19c601703e3e8e51cd21de83.jpg",
  // 14 – Rectus sheath hematoma coronal CT
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a4f1013579427230a37ef2ca0167d2ec656fcf23b8770a9e7d00027725ea6e7b.jpg",
  // 15 – Desmoid tumor MRI FAP
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_c4a3a7b6d36e7dec5d5c81e8fcd25f5929c94db7754e1b70b07eeb4742c91bfb.jpg",
  // 16 – Ileocecal TB pediatric CT calcified nodes
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_0a31147251d631d88c1fe10d6c2539f7e67b0f34391f5fc5351a195c887ee31b.jpg",
  // 17 – Ovarian torsion US whirl sign + CT + specimen
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_daaf0770ce1722690df939859c5e1a04ab4ddc53c0563fa7ba2ac581d6957b39.jpg",
  // 18 – RIF phlegmon ROCO US
  "https://cdn.orris.care/cdss_images/roco_radiology_ROCO_34063_1766648007727.png",
  // 19 – Ileocecal complex mass + pericaecal abscess CT
  "https://cdn.orris.care/cdss_images/roco_radiology_ROCO_33895_1766647994697.png",
];

console.log("Fetching images...");
const imagesRaw = execSync(
  `node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`,
  { maxBuffer: 200 * 1024 * 1024 }
).toString();
const images = JSON.parse(imagesRaw);
console.log("Images fetched:", images.filter(i => !i.error).length, "OK,", images.filter(i => i.error).length, "failed");

function img(idx) {
  const i = images[idx];
  return (!i || i.error) ? null : i.base64;
}

// ─────────────────────────────────────────────────────────────────
// PRESENTATION SETUP
// ─────────────────────────────────────────────────────────────────
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3 x 7.5
pres.title = "Differential Diagnosis of RIF Mass";
pres.author = "General Surgery Resident Seminar";

// ─────────────────────────────────────────────────────────────────
// THEME COLORS
// ─────────────────────────────────────────────────────────────────
const C = {
  navy:    "0D2137",
  teal:    "1A6B7C",
  gold:    "D4A030",
  white:   "FFFFFF",
  light:   "EEF4F7",
  gray:    "8A9BAD",
  dark:    "1C2D3C",
  green:   "1E7A55",
  red:     "B03030",
  orange:  "CC5500",
  purple:  "5C2E7E",
  lblue:   "3A8FC7",
};

// ─────────────────────────────────────────────────────────────────
// HELPER FUNCTIONS
// ─────────────────────────────────────────────────────────────────
function addSlideHeader(slide, title, accent = C.teal) {
  // top header bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.75, fill: { color: C.navy } });
  slide.addText(title, {
    x: 0.3, y: 0, w: 12.7, h: 0.75,
    fontSize: 22, bold: true, color: C.white, valign: "middle", fontFace: "Calibri",
  });
  // accent stripe
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.75, w: "100%", h: 0.08, fill: { color: accent } });
}

function addSectionDivider(slide, sectionLabel, color = C.teal) {
  slide.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.9, w: 0.12, h: 0.35, fill: { color } });
  slide.addText(sectionLabel, {
    x: 0.52, y: 0.9, w: 12, h: 0.35,
    fontSize: 13, bold: true, color, valign: "middle", fontFace: "Calibri",
  });
}

function addBullets(slide, items, x, y, w, h, opts = {}) {
  const textArr = items.map((it, i) => ({
    text: it,
    options: {
      bullet: { type: "bullet", indent: opts.indent || 15 },
      breakLine: i < items.length - 1,
      fontSize: opts.fontSize || 13,
      color: opts.color || C.dark,
      bold: opts.bold || false,
      fontFace: "Calibri",
    }
  }));
  slide.addText(textArr, { x, y, w, h, valign: "top", fontFace: "Calibri" });
}

function addTwoCol(slide, leftItems, rightItems, yStart = 1.05) {
  const colW = 6.2, colH = 5.8, gap = 0.2;
  const lx = 0.3, rx = lx + colW + gap;
  addBullets(slide, leftItems, lx, yStart, colW, colH);
  addBullets(slide, rightItems, rx, yStart, colW, colH);
}

function addImageWithCaption(slide, imgData, x, y, w, h, caption) {
  if (imgData) {
    slide.addImage({ data: imgData, x, y, w, h });
  } else {
    slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: "CCCCCC" } });
    slide.addText("Image unavailable", { x, y, w, h, fontSize: 10, color: "666666", align: "center", valign: "middle" });
  }
  if (caption) {
    slide.addText(caption, {
      x, y: y + h + 0.05, w, h: 0.35,
      fontSize: 9, color: C.gray, italic: true, align: "center", fontFace: "Calibri",
    });
  }
}

function categoryBadge(slide, label, color) {
  slide.addShape(pres.ShapeType.roundRect, {
    x: 0.3, y: 0.83, w: 2.5, h: 0.28,
    fill: { color }, line: { color, width: 0 },
    rectRadius: 0.05,
  });
  slide.addText(label, {
    x: 0.3, y: 0.83, w: 2.5, h: 0.28,
    fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

function bgFill(slide, color = C.white) {
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color }, line: { color, width: 0 } });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 1 — TITLE
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.navy);

  // decorative shapes
  s.addShape(pres.ShapeType.rect, { x: 0, y: 5.8, w: "100%", h: 1.7, fill: { color: C.teal }, line: { color: C.teal, width: 0 } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.5, h: "100%", fill: { color: C.gold }, line: { color: C.gold, width: 0 } });

  if (img(0)) s.addImage({ data: img(0), x: 8.5, y: 0.8, w: 4.5, h: 4.8 });
  // subtle overlay on image
  s.addShape(pres.ShapeType.rect, { x: 8.5, y: 0.8, w: 4.5, h: 4.8, fill: { color: C.navy, transparency: 40 }, line: { color: C.navy, width: 0 } });

  s.addText("DIFFERENTIAL DIAGNOSIS OF", {
    x: 0.8, y: 1.2, w: 7.8, h: 0.6,
    fontSize: 18, color: C.gold, bold: false, fontFace: "Calibri", charSpacing: 3,
  });
  s.addText("RIF MASS", {
    x: 0.8, y: 1.8, w: 7.8, h: 1.4,
    fontSize: 58, color: C.white, bold: true, fontFace: "Calibri",
  });
  s.addText("Right Iliac Fossa Mass", {
    x: 0.8, y: 3.2, w: 7.8, h: 0.6,
    fontSize: 20, color: C.light, italic: true, fontFace: "Calibri",
  });

  s.addText([
    { text: "General Surgery Resident Seminar  |  ", options: { color: C.white, fontSize: 13 } },
    { text: "Abdominal Wall  •  Intraperitoneal  •  Retroperitoneal", options: { color: C.gold, fontSize: 13, bold: true } },
  ], { x: 0.8, y: 4.1, w: 7.8, h: 0.5, fontFace: "Calibri" });

  s.addShape(pres.ShapeType.rect, { x: 0.8, y: 4.75, w: 5, h: 0.04, fill: { color: C.teal }, line: { color: C.teal, width: 0 } });

  s.addText("Comprehensive approach to diagnosis, pathology, imaging & management", {
    x: 0.8, y: 5.85, w: 11.7, h: 0.5,
    fontSize: 13, color: C.white, fontFace: "Calibri", align: "center",
  });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 2 — ANATOMY & OVERVIEW
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "The Right Iliac Fossa — Anatomy & Clinical Significance", C.teal);

  // Left box: anatomical boundaries
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.95, w: 4.0, h: 3.0, fill: { color: C.light }, line: { color: C.teal, width: 1 } });
  s.addText("ANATOMICAL BOUNDARIES", { x: 0.3, y: 0.95, w: 4.0, h: 0.4, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", fill: { color: C.teal } });
  addBullets(s, [
    "Superiorly: Plane through ASIS (iliac crest)",
    "Inferiorly: Inguinal ligament",
    "Medially: Right lateral border of rectus abdominis",
    "Laterally: Right flank / iliac fossa",
    "Floor: Iliacus + psoas muscles",
    "Anteriorly: Anterior abdominal wall",
  ], 0.4, 1.4, 3.8, 2.4, { fontSize: 11 });

  // Middle box: structures
  s.addShape(pres.ShapeType.rect, { x: 4.6, y: 0.95, w: 4.1, h: 3.0, fill: { color: C.light }, line: { color: C.navy, width: 1 } });
  s.addText("STRUCTURES IN THE RIF", { x: 4.6, y: 0.95, w: 4.1, h: 0.4, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", fill: { color: C.navy } });
  addBullets(s, [
    "Cecum & appendix",
    "Terminal ileum",
    "Right ovary & fallopian tube (♀)",
    "Right ureter",
    "Iliac vessels (ext/int)",
    "Iliopsoas muscle",
    "Inguinal lymph nodes",
    "Abdominal wall (skin→muscle→fascia)",
  ], 4.7, 1.4, 3.9, 2.4, { fontSize: 11 });

  // Right box: 3 categories
  s.addShape(pres.ShapeType.rect, { x: 9.0, y: 0.95, w: 4.0, h: 3.0, fill: { color: C.light }, line: { color: C.gold, width: 1 } });
  s.addText("3 ANATOMICAL LAYERS", { x: 9.0, y: 0.95, w: 4.0, h: 0.4, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri", fill: { color: C.gold } });

  const cats = [
    { label: "1. ABDOMINAL WALL", color: C.orange, items: ["Rectus sheath hematoma", "Lipoma / Fibroma", "Desmoid tumor", "Spigelian hernia", "Seroma / Abscess"] },
    { label: "2. INTRAPERITONEAL", color: C.teal, items: ["Appendicular mass", "Ileocecal TB", "Crohn disease", "Cecal carcinoma", "Ovarian / Adnexal mass"] },
    { label: "3. RETROPERITONEAL", color: C.purple, items: ["Psoas abscess", "Iliac lymphadenopathy", "Retroperitoneal sarcoma", "Iliac artery aneurysm", "Undescended testis"] },
  ];
  cats.forEach((cat, ci) => {
    const cy = 1.42 + ci * 0.85;
    s.addShape(pres.ShapeType.roundRect, { x: 9.15, y: cy, w: 3.7, h: 0.28, fill: { color: cat.color }, line: { color: cat.color, width: 0 }, rectRadius: 0.04 });
    s.addText(cat.label, { x: 9.15, y: cy, w: 3.7, h: 0.28, fontSize: 9.5, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    s.addText(cat.items.join("  •  "), { x: 9.15, y: cy + 0.3, w: 3.7, h: 0.48, fontSize: 8.5, color: C.dark, fontFace: "Calibri", valign: "top" });
  });

  // Bottom: approach table
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 4.1, w: 12.7, h: 0.35, fill: { color: C.navy }, line: { color: C.navy, width: 0 } });
  s.addText("CLINICAL APPROACH — History → Examination → Carnett's Test → Imaging (USG / CT) → Biopsy / Surgery", {
    x: 0.3, y: 4.1, w: 12.7, h: 0.35, fontSize: 11, color: C.white, bold: true, align: "center", valign: "middle", fontFace: "Calibri",
  });

  const approach = [
    ["History", "Duration, onset, fever, weight loss,\nmenstrual history, TB contact"],
    ["Examination", "Site, size, surface, consistency,\nCarnett's sign, Fothergill's sign"],
    ["Investigations", "CBC, ESR, CRP, CA-125, β-hCG,\nCEA, Mantoux / IGRA"],
    ["Imaging", "USG abdomen/pelvis (1st line)\nCT abdomen with contrast (gold std)"],
  ];
  approach.forEach(([hd, bd], i) => {
    const ax = 0.3 + i * 3.2;
    s.addShape(pres.ShapeType.rect, { x: ax, y: 4.5, w: 3.1, h: 0.4, fill: { color: C.teal }, line: { color: C.teal, width: 0 } });
    s.addText(hd, { x: ax, y: 4.5, w: 3.1, h: 0.4, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    s.addShape(pres.ShapeType.rect, { x: ax, y: 4.9, w: 3.1, h: 0.85, fill: { color: C.light }, line: { color: C.teal, width: 0.5 } });
    s.addText(bd, { x: ax + 0.05, y: 4.9, w: 3.0, h: 0.85, fontSize: 10, color: C.dark, valign: "middle", fontFace: "Calibri" });
  });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 3 — SECTION DIVIDER: ABDOMINAL WALL
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.dark);
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.6, h: "100%", fill: { color: C.orange }, line: { color: C.orange, width: 0 } });
  s.addShape(pres.ShapeType.rect, { x: 0.6, y: 2.5, w: 12.7, h: 0.08, fill: { color: C.orange }, line: { color: C.orange, width: 0 } });

  s.addText("SECTION 1", { x: 1.0, y: 1.5, w: 8, h: 0.6, fontSize: 20, color: C.orange, bold: false, charSpacing: 5, fontFace: "Calibri" });
  s.addText("ABDOMINAL WALL", { x: 1.0, y: 2.0, w: 10, h: 1.1, fontSize: 52, color: C.white, bold: true, fontFace: "Calibri" });
  s.addText("MASSES", { x: 1.0, y: 2.9, w: 10, h: 1.1, fontSize: 52, color: C.orange, bold: true, fontFace: "Calibri" });

  addBullets(s, [
    "Rectus Sheath Hematoma",
    "Lipoma / Fibroma / Sebaceous Cyst",
    "Desmoid Tumor (Aggressive Fibromatosis)",
    "Spigelian Hernia",
    "Abdominal Wall Abscess / Seroma",
    "Inguinal Hernia (indirect / Spigelian)",
    "Metastatic Umbilical Nodule (Sister Mary Joseph)",
  ], 1.0, 4.1, 8, 2.8, { fontSize: 13, color: C.light });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 4 — RECTUS SHEATH HEMATOMA
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Rectus Sheath Hematoma", C.orange);
  categoryBadge(s, "ABDOMINAL WALL", C.orange);

  // left panel
  addBullets(s, [
    "Hemorrhage within rectus sheath → epigastric vessels / direct muscle injury",
    "Causes: Anticoagulation, trauma, vigorous coughing, pregnancy",
    "Classic presentation: Acute RIF pain, tender fixed mass",
    "Fothergill's sign: Mass DOES NOT cross midline; remains palpable on rectus contraction",
    "Carnett's sign: Pain increases on tensing abdomen",
  ], 0.3, 1.3, 5.2, 2.5, { fontSize: 12 });

  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.9, w: 5.2, h: 0.35, fill: { color: C.orange }, line: { color: C.orange, width: 0 } });
  s.addText("MANAGEMENT", { x: 0.3, y: 3.9, w: 5.2, h: 0.35, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "Conservative: ICU monitoring, reverse anticoagulation, transfusion",
    "IR: Angioembolisation (angiography + embolisation of epigastric artery)",
    "Surgery: Evacuation of hematoma if expanding / infected",
    "Type I/II → conservative; Type III → often needs intervention",
  ], 0.3, 4.3, 5.2, 2.0, { fontSize: 11 });

  addImageWithCaption(s, img(13), 5.8, 0.9, 3.7, 3.0, "CT Axial — Hyperdense mass within right rectus muscle");
  addImageWithCaption(s, img(14), 9.7, 0.9, 3.3, 3.0, "CT Coronal — Rectus sheath hematoma with mass effect");

  // classification table
  s.addShape(pres.ShapeType.rect, { x: 5.8, y: 4.15, w: 7.2, h: 0.35, fill: { color: C.dark }, line: { color: C.dark, width: 0 } });
  s.addText("BERNÁ-MESTRE CLASSIFICATION", { x: 5.8, y: 4.15, w: 7.2, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  const typeRows = [
    ["Type I", "Intramuscular hematoma", "Conservative"],
    ["Type II", "Between muscle & transversalis fascia", "Conservative"],
    ["Type III", "Extends between peritoneum & fascia", "Intervention / Surgery"],
  ];
  typeRows.forEach(([t, desc, mgmt], ri) => {
    const ry = 4.55 + ri * 0.6;
    const bg = ri % 2 === 0 ? C.light : C.white;
    s.addShape(pres.ShapeType.rect, { x: 5.8, y: ry, w: 7.2, h: 0.55, fill: { color: bg }, line: { color: C.gray, width: 0.3 } });
    s.addText(t, { x: 5.85, y: ry + 0.05, w: 1.0, h: 0.45, fontSize: 10, bold: true, color: C.orange, fontFace: "Calibri" });
    s.addText(desc, { x: 6.85, y: ry + 0.05, w: 4.0, h: 0.45, fontSize: 10, color: C.dark, fontFace: "Calibri", valign: "middle" });
    s.addText(mgmt, { x: 10.85, y: ry + 0.05, w: 2.1, h: 0.45, fontSize: 10, color: C.teal, bold: true, fontFace: "Calibri", valign: "middle" });
  });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 5 — LIPOMA / DESMOID / SPIGELIAN HERNIA
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Other Abdominal Wall Masses — Lipoma, Desmoid, Spigelian Hernia", C.orange);
  categoryBadge(s, "ABDOMINAL WALL", C.orange);

  const cards = [
    {
      title: "LIPOMA / FIBROMA",
      color: C.teal,
      pts: [
        "Commonest benign soft tissue tumors",
        "Soft, non-tender, mobile, lobulated",
        "Encapsulated mass within subcutaneous fat",
        "USG: Echogenic, compressible; MRI: Fat signal",
        "Rx: Excision if symptomatic; liposarcoma must be excluded",
      ],
    },
    {
      title: "DESMOID TUMOR (Aggressive Fibromatosis)",
      color: C.orange,
      pts: [
        "Low-grade fibroblastic tumors; locally invasive, NO metastasis",
        "Associated with FAP / Gardner syndrome (mesenteric desmoid)",
        "Post-surgical scar / trauma site",
        "MRI: T2 hypointense — hallmark of desmoid",
        "Rx: Surgery (R0), NSAIDs (sulindac), anti-oestrogens, imatinib",
      ],
      imgIdx: 15,
    },
    {
      title: "SPIGELIAN HERNIA",
      color: C.purple,
      pts: [
        "Hernia through Spigelian fascia (semi-lunar line)",
        "Lateral border of rectus, below arcuate line — RIF",
        "Often interparietal (between muscle layers) → easy to miss",
        "Risk: Incarceration / strangulation",
        "USG / CT: Fascial defect with bowel / fat herniation",
        "Rx: Surgical repair (open or laparoscopic)",
      ],
    },
  ];

  cards.forEach((card, ci) => {
    const cx = 0.3 + ci * 4.35;
    s.addShape(pres.ShapeType.rect, { x: cx, y: 0.95, w: 4.15, h: 0.4, fill: { color: card.color }, line: { color: card.color, width: 0 } });
    s.addText(card.title, { x: cx, y: 0.95, w: 4.15, h: 0.4, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    s.addShape(pres.ShapeType.rect, { x: cx, y: 1.35, w: 4.15, h: 4.8, fill: { color: C.light }, line: { color: card.color, width: 0.8 } });
    addBullets(s, card.pts, cx + 0.1, 1.4, 3.95, card.imgIdx !== undefined ? 2.0 : 4.6, { fontSize: 11 });
    if (card.imgIdx !== undefined && img(card.imgIdx)) {
      addImageWithCaption(s, img(card.imgIdx), cx + 0.1, 3.5, 3.95, 2.5, "MRI: Desmoid tumors in FAP — mesenteric + abdominal wall");
    }
  });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 6 — SECTION DIVIDER: INTRAPERITONEAL
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.dark);
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.6, h: "100%", fill: { color: C.teal }, line: { color: C.teal, width: 0 } });
  s.addShape(pres.ShapeType.rect, { x: 0.6, y: 2.5, w: 12.7, h: 0.08, fill: { color: C.teal }, line: { color: C.teal, width: 0 } });

  s.addText("SECTION 2", { x: 1.0, y: 1.5, w: 8, h: 0.6, fontSize: 20, color: C.teal, bold: false, charSpacing: 5, fontFace: "Calibri" });
  s.addText("INTRAPERITONEAL", { x: 1.0, y: 2.0, w: 11, h: 1.1, fontSize: 42, color: C.white, bold: true, fontFace: "Calibri" });
  s.addText("MASSES", { x: 1.0, y: 2.9, w: 10, h: 1.1, fontSize: 52, color: C.teal, bold: true, fontFace: "Calibri" });

  addBullets(s, [
    "Appendicular Mass (Phlegmon / Abscess)",
    "Appendiceal Mucocele / Neoplasm",
    "Ileocecal Tuberculosis",
    "Crohn Disease (Terminal Ileal Mass)",
    "Carcinoma Cecum / Ascending Colon",
    "Cecal Lymphoma",
    "Ovarian / Adnexal Mass (♀)",
    "Meckel's Diverticulum Complications",
  ], 1.0, 4.1, 8, 2.8, { fontSize: 13, color: C.light });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 7 — APPENDICULAR MASS
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Appendicular Mass (Phlegmon / Abscess)", C.teal);
  categoryBadge(s, "INTRAPERITONEAL", C.teal);

  addBullets(s, [
    "Result of contained perforation of appendix → omentum + loops of bowel wall off the appendix",
    "Phlegmon: Solid inflammatory mass (no pus cavity)",
    "Abscess: Central liquefaction → pus cavity (surgical emergency if large / septic)",
    "Presents 3–5 days after onset of appendicitis",
  ], 0.3, 1.3, 6.0, 1.8, { fontSize: 12 });

  // 2 column below
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.15, w: 2.8, h: 0.35, fill: { color: C.teal }, line: { color: C.teal, width: 0 } });
  s.addText("CLINICAL FEATURES", { x: 0.3, y: 3.15, w: 2.8, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "RIF pain (dull aching → severe)",
    "Fever, tachycardia",
    "Palpable tender RIF mass",
    "Guarding/rigidity (if peritonitis)",
    "Leukocytosis, ↑CRP/ESR",
  ], 0.3, 3.55, 2.8, 2.0, { fontSize: 11 });

  s.addShape(pres.ShapeType.rect, { x: 3.3, y: 3.15, w: 2.8, h: 0.35, fill: { color: C.navy }, line: { color: C.navy, width: 0 } });
  s.addText("IMAGING", { x: 3.3, y: 3.15, w: 2.8, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "USG: Heterogeneous mass, non-compressible, ± abscess cavity, ± free fluid",
    "CT (gold standard): Periappendiceal fat stranding, wall thickening, abscess",
    "Appendicolith may be visible",
  ], 3.3, 3.55, 2.8, 2.0, { fontSize: 11 });

  addImageWithCaption(s, img(1), 6.4, 0.92, 3.3, 3.0, "USG — Appendicular mass with fluid (RIF phlegmon)");
  addImageWithCaption(s, img(2), 9.9, 0.92, 3.1, 3.0, "CT Axial — Periappendiceal abscess cavity");

  // management
  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 5.7, w: 12.7, h: 0.35, fill: { color: C.dark }, line: { color: C.dark, width: 0 } });
  s.addText("OCHSNER-SHERREN REGIMEN (Conservative): NPO · IV antibiotics · IV fluids · 4-hourly vitals · Serial abdominal exam  →  Interval appendicectomy at 6–8 weeks", {
    x: 0.3, y: 5.7, w: 12.7, h: 0.35, fontSize: 10, color: C.white, align: "center", valign: "middle", fontFace: "Calibri",
  });

  addImageWithCaption(s, img(18), 6.4, 4.0, 6.6, 1.55, "USG — Periappendiceal phlegmon in pediatric patient");
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 8 — APPENDICEAL MUCOCELE / NEOPLASM
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Appendiceal Mucocele & Appendiceal Neoplasms", C.teal);
  categoryBadge(s, "INTRAPERITONEAL", C.teal);

  addBullets(s, [
    "Mucocele: Dilatation of appendix lumen with mucin — spectrum from benign (retention cyst) to malignant (mucinous adenocarcinoma)",
    "Classified: Simple mucocoele → LAMN (Low-grade appendiceal mucinous neoplasm) → HAMN → Mucinous adenocarcinoma",
    "LAMN: Most common; rupture → pseudomyxoma peritonei (PMP) — 'jelly belly'",
    "Carcinoid tumor: Commonest appendiceal tumor; tip of appendix; < 2 cm usually benign",
    "Adenocarcinoma: Rare; presents as RIF mass ± obstruction",
  ], 0.3, 1.0, 6.5, 2.6, { fontSize: 11.5 });

  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.7, w: 6.5, h: 0.35, fill: { color: C.teal }, line: { color: C.teal, width: 0 } });
  s.addText("KEY MANAGEMENT POINTS", { x: 0.3, y: 3.7, w: 6.5, h: 0.35, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "CT: Cystic appendiceal mass, ± calcification in wall, ± pseudomyxoma peritonei",
    "No biopsy if mucocele suspected (risk of seeding)",
    "Rx: Laparoscopic appendicectomy (intact removal, no spillage); right hemicolectomy if base involved or adenocarcinoma",
    "PMP: HIPEC (hyperthermic intraperitoneal chemotherapy) ± cytoreductive surgery",
  ], 0.3, 4.1, 6.5, 2.1, { fontSize: 11 });

  addImageWithCaption(s, img(3), 7.1, 0.9, 5.9, 5.8, "CT — Appendiceal mucocele: well-defined cystic mass adjacent to cecum (red arrow)");
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 9 — ILEOCECAL TUBERCULOSIS
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Ileocecal Tuberculosis", C.teal);
  categoryBadge(s, "INTRAPERITONEAL", C.teal);

  addBullets(s, [
    "Commonest site of abdominal TB (80%) — ileocecal region due to abundant lymphoid tissue (Peyer's patches)",
    "Hyperplastic type: Inflammatory mass mimicking carcinoma or Crohn's disease",
    "Ulcerative type: Transverse ulcers → 'napkin ring' stricture",
    "Lymphadenopathic type: Mesenteric lymphadenopathy ± caseous necrosis",
    "Pathology: Caseating granulomas; AFB positive (variable); IGRA / Mantoux +ve",
  ], 0.3, 1.05, 6.3, 2.4, { fontSize: 11.5 });

  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.55, w: 3.0, h: 0.35, fill: { color: C.teal }, line: { color: C.teal, width: 0 } });
  s.addText("CT FEATURES", { x: 0.3, y: 3.55, w: 3.0, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "Concentric cecal wall thickening",
    "Pulled-up / fibrosed cecum (shrunken)",
    "Necrotic mesenteric lymph nodes",
    "Calcified lymph nodes (pathognomonic)",
    "Responds to ATT on follow-up CT",
  ], 0.3, 3.95, 3.0, 2.1, { fontSize: 11 });

  s.addShape(pres.ShapeType.rect, { x: 3.5, y: 3.55, w: 3.1, h: 0.35, fill: { color: C.navy }, line: { color: C.navy, width: 0 } });
  s.addText("MANAGEMENT", { x: 3.5, y: 3.55, w: 3.1, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "ATT × 6–9 months (HRZE × 2 → HR × 4)",
    "Surgery: Stricturoplasty or resection for obstruction",
    "Difficult to distinguish from Crohn / carcinoma",
    "Colonoscopy + biopsy essential",
    "Key differentiator from Crohn: +ve IGRA, caseating granuloma, response to ATT",
  ], 3.5, 3.95, 3.1, 2.1, { fontSize: 10.5 });

  addImageWithCaption(s, img(4), 6.9, 0.9, 6.1, 2.9, "Coronal CT — Cecal wall thickening (A); resolution after ATT (B)");
  addImageWithCaption(s, img(16), 6.9, 4.0, 3.0, 2.5, "CT — Cecal & ileal wall thickening + calcified nodes (↑TB)");
  addImageWithCaption(s, img(5), 10.1, 4.0, 3.0, 2.5, "Axial CT — Ileocecal TB: circumferential thickening, fat stranding");
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 10 — CROHN DISEASE
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Crohn's Disease — Terminal Ileal Mass", C.teal);
  categoryBadge(s, "INTRAPERITONEAL", C.teal);

  addBullets(s, [
    "Transmural granulomatous inflammation; most commonly involves terminal ileum + ileocecal junction",
    "Presents as RIF mass in 30–40% — due to matted loops, mesenteric fat hypertrophy ('creeping fat'), phlegmon",
    "Skip lesions; cobblestone mucosa; rose-thorn ulcers; fistulae / sinus tracts",
    "Extra-intestinal: Arthritis, uveitis, erythema nodosum, pyoderma gangrenosum, primary sclerosing cholangitis",
  ], 0.3, 1.05, 6.2, 2.1, { fontSize: 11.5 });

  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.25, w: 3.0, h: 0.35, fill: { color: C.teal }, line: { color: C.teal, width: 0 } });
  s.addText("CT ENTEROGRAPHY", { x: 0.3, y: 3.25, w: 3.0, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "Wall thickening (>4 mm) + mural hyperenhancement",
    "Comb sign (engorgement of vasa recta)",
    "Creeping fat / fibrofatty proliferation",
    "Abscess / fistula in penetrating disease",
    "String sign (Kantor) on barium follow-through",
  ], 0.3, 3.65, 3.0, 2.4, { fontSize: 11 });

  s.addShape(pres.ShapeType.rect, { x: 3.5, y: 3.25, w: 3.0, h: 0.35, fill: { color: C.navy }, line: { color: C.navy, width: 0 } });
  s.addText("MANAGEMENT", { x: 3.5, y: 3.25, w: 3.0, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "Medical: 5-ASA, steroids, azathioprine, anti-TNF (infliximab, adalimumab)",
    "Surgery: Ileocolic resection for stricture / abscess / fistula / failure of medical Rx",
    "Abscess: Percutaneous drainage + antibiotics → elective resection",
    "Stricturoplasty for short fibrous strictures",
  ], 3.5, 3.65, 3.0, 2.4, { fontSize: 11 });

  addImageWithCaption(s, img(6), 6.8, 0.92, 3.2, 3.2, "CT — Crohn's abscess in RIF with terminal ileal thickening (arrows & *)");
  addImageWithCaption(s, img(7), 10.1, 0.92, 3.0, 3.2, "CT — Comb sign + creeping fat in active Crohn's");
  addImageWithCaption(s, img(19), 6.8, 4.2, 6.3, 2.0, "CT — Ileocaecal complex mass with pericaecal collection; Crohn vs appendicitis vs TB");
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 11 — CARCINOMA CECUM
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Carcinoma of the Cecum & Right Colon", C.teal);
  categoryBadge(s, "INTRAPERITONEAL", C.teal);

  addBullets(s, [
    "Right-sided colon cancer: Typically presents late — large fungating mass (insidious onset)",
    "Symptoms: Vague RIF pain, palpable mass, iron-deficiency anaemia (± occult bleeding), weight loss",
    "No obstructive symptoms early (wide lumen) — but may cause partial obstruction in advanced cases",
    "Risk factors: Age >50, FAP, HNPCC, IBD, high-fat low-fibre diet",
    "Tumour markers: ↑ CEA (monitoring, not diagnosis); colonoscopy + biopsy = definitive diagnosis",
  ], 0.3, 1.05, 6.2, 2.5, { fontSize: 11.5 });

  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.65, w: 3.0, h: 0.35, fill: { color: C.teal }, line: { color: C.teal, width: 0 } });
  s.addText("STAGING (TNM / DUKES)", { x: 0.3, y: 3.65, w: 3.0, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  const dukes = [["A", "Mucosa / submucosa", "95%"], ["B", "Through muscularis propria", "65%"], ["C", "Lymph nodes positive", "35%"], ["D", "Distant metastasis", "5%"]];
  dukes.forEach(([d, desc, surv], di) => {
    const dy = 4.05 + di * 0.4;
    s.addShape(pres.ShapeType.rect, { x: 0.3, y: dy, w: 0.4, h: 0.37, fill: { color: C.navy }, line: { color: C.navy, width: 0 } });
    s.addText(d, { x: 0.3, y: dy, w: 0.4, h: 0.37, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    s.addText(`${desc}  —  5-yr survival: ${surv}`, { x: 0.75, y: dy + 0.04, w: 2.55, h: 0.3, fontSize: 10, color: C.dark, fontFace: "Calibri" });
  });

  s.addShape(pres.ShapeType.rect, { x: 3.5, y: 3.65, w: 3.0, h: 0.35, fill: { color: C.navy }, line: { color: C.navy, width: 0 } });
  s.addText("MANAGEMENT", { x: 3.5, y: 3.65, w: 3.0, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "Right hemicolectomy (± extended) — gold standard",
    "Complete mesocolic excision (CME) for optimal nodal clearance",
    "Adjuvant chemo (FOLFOX / CAPOX) for Stage III/IV",
    "Laparoscopic approach: Equivalent oncological outcomes",
  ], 3.5, 4.05, 3.0, 1.85, { fontSize: 11 });

  addImageWithCaption(s, img(8), 6.8, 0.9, 3.3, 3.7, "CT — Cecal mass with wall thickening and lumen narrowing");
  addImageWithCaption(s, img(9), 10.2, 0.9, 2.8, 3.7, "Surgical specimen — right hemicolectomy for cecal carcinoma");
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 12 — OVARIAN / ADNEXAL MASS
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Ovarian & Adnexal Masses (Female Patients)", C.teal);
  categoryBadge(s, "INTRAPERITONEAL", C.teal);

  const otypes = [
    { name: "Ovarian Cyst / Torsion", color: C.teal, pts: ["Commonest in reproductive age", "Torsion: Acute RIF pain, vomiting,\ntender adnexal mass", "Whirlpool sign on CT/Doppler", "Rx: Emergency laparoscopy\n(detorsion ± oophorectomy)"] },
    { name: "Dermoid Cyst (Mature Teratoma)", color: C.orange, pts: ["Commonest ovarian tumour 15–30 yrs", "Contains fat, hair, teeth, sebaceous material", "USG: Mixed echogenicity, acoustic shadow", "Rx: Cystectomy (preserve ovary)"] },
    { name: "Tubo-ovarian Abscess", color: C.red, pts: ["PID complication — Nesseria, Chlamydia", "Bilateral tender adnexal masses", "Fever, vaginal discharge", "Rx: IV antibiotics; drainage if no response"] },
    { name: "Ectopic Pregnancy (Ruptured)", color: C.navy, pts: ["Amenorrhoea + RIF pain + haemoperitoneum", "+ve β-hCG; empty uterus on USG", "Adnexal mass ± free fluid in POD", "Surgical emergency: Salpingectomy"] },
  ];

  otypes.forEach((ot, i) => {
    const col = i < 2 ? i : i - 2;
    const row = i < 2 ? 0 : 1;
    const ox = 0.3 + col * 6.5;
    const oy = 1.0 + row * 3.0;
    s.addShape(pres.ShapeType.rect, { x: ox, y: oy, w: 6.2, h: 0.38, fill: { color: ot.color }, line: { color: ot.color, width: 0 } });
    s.addText(ot.name, { x: ox, y: oy, w: 6.2, h: 0.38, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    s.addShape(pres.ShapeType.rect, { x: ox, y: oy + 0.38, w: 6.2, h: 2.45, fill: { color: C.light }, line: { color: ot.color, width: 0.8 } });
    addBullets(s, ot.pts, ox + 0.1, oy + 0.45, 6.0, 2.2, { fontSize: 11 });
  });

  addImageWithCaption(s, img(10), 6.9, 1.0, 6.1, 2.75, "CT Coronal — Large right adnexal cyst with whirlpool sign (ovarian torsion)");
  addImageWithCaption(s, img(17), 6.9, 4.0, 6.1, 2.75, "Multimodal — Ovarian torsion: US whirl sign + CT + surgical specimen (dermoid)");
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 13 — SECTION DIVIDER: RETROPERITONEAL
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.dark);
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.6, h: "100%", fill: { color: C.purple }, line: { color: C.purple, width: 0 } });
  s.addShape(pres.ShapeType.rect, { x: 0.6, y: 2.5, w: 12.7, h: 0.08, fill: { color: C.purple }, line: { color: C.purple, width: 0 } });

  s.addText("SECTION 3", { x: 1.0, y: 1.5, w: 8, h: 0.6, fontSize: 20, color: C.purple, bold: false, charSpacing: 5, fontFace: "Calibri" });
  s.addText("RETROPERITONEAL", { x: 1.0, y: 2.0, w: 11, h: 1.1, fontSize: 40, color: C.white, bold: true, fontFace: "Calibri" });
  s.addText("MASSES", { x: 1.0, y: 2.9, w: 10, h: 1.1, fontSize: 52, color: C.purple, bold: true, fontFace: "Calibri" });

  addBullets(s, [
    "Psoas Abscess (Primary & Secondary)",
    "Iliac Lymphadenopathy (Reactive / Metastatic / Lymphoma)",
    "Retroperitoneal Sarcoma (Liposarcoma / Leiomyosarcoma)",
    "Iliac Artery Aneurysm",
    "Undescended Testis (Ectopic testis in RIF)",
    "Retroperitoneal Fibrosis",
    "Iliac Bone Tumors / Metastases",
  ], 1.0, 4.1, 8, 2.8, { fontSize: 13, color: C.light });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 14 — PSOAS ABSCESS
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Psoas Abscess", C.purple);
  categoryBadge(s, "RETROPERITONEAL", C.purple);

  addBullets(s, [
    "Primary psoas abscess: Haematogenous spread (Staphylococcus aureus) — common in immunocompromised, diabetics, IV drug users",
    "Secondary psoas abscess: Spread from adjacent structures — vertebral TB (Pott's disease), Crohn's disease, perinephric abscess, appendicitis, diverticulitis",
    "Classic triad: Fever + back/groin pain + RIF mass — only 30% present with full triad",
    "Psoas sign: Pain on passive extension of hip (hip held in flexion posture)",
    "Obturator sign: Pain on internal rotation of flexed hip (pelvic abscess)",
    "Fluctuant RIF mass that may point below inguinal ligament (cold abscess from TB spine)",
  ], 0.3, 1.05, 6.2, 3.0, { fontSize: 11.5 });

  s.addShape(pres.ShapeType.rect, { x: 0.3, y: 4.15, w: 3.0, h: 0.35, fill: { color: C.purple }, line: { color: C.purple, width: 0 } });
  s.addText("MANAGEMENT", { x: 0.3, y: 4.15, w: 3.0, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "CT-guided percutaneous drainage (first-line for primary abscess)",
    "IV antibiotics (anti-staphylococcal; anti-TB for secondary TB abscess)",
    "Surgical drainage if failed percutaneous / multiloculated",
    "Treat underlying cause (Crohn / TB spine)",
  ], 0.3, 4.55, 3.0, 2.0, { fontSize: 11 });

  s.addShape(pres.ShapeType.rect, { x: 3.5, y: 4.15, w: 3.0, h: 0.35, fill: { color: C.navy }, line: { color: C.navy, width: 0 } });
  s.addText("INVESTIGATIONS", { x: 3.5, y: 4.15, w: 3.0, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  addBullets(s, [
    "CT abdomen+pelvis with contrast — modality of choice",
    "Enlarged psoas muscle with central hypodensity, ± gas",
    "MRI: Superior for soft tissue involvement / spinal TB",
    "Blood cultures, pus C&S",
    "IGRA / Mantoux for TB",
  ], 3.5, 4.55, 3.0, 2.0, { fontSize: 11 });

  addImageWithCaption(s, img(11), 6.8, 0.92, 3.2, 3.2, "CT — Enlarged right psoas with hypodense abscess cavity");
  addImageWithCaption(s, img(12), 10.1, 0.92, 3.0, 3.2, "CT — Bilateral psoas abscesses (right >> left) with multi-loculations");
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 15 — ILIAC LYMPHADENOPATHY / RETROPERITONEAL SARCOMA
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Iliac Lymphadenopathy & Retroperitoneal Sarcoma", C.purple);
  categoryBadge(s, "RETROPERITONEAL", C.purple);

  const cards = [
    {
      title: "ILIAC LYMPHADENOPATHY",
      color: C.purple,
      pts: [
        "Reactive: Secondary to RIF region infection / appendicitis",
        "Lymphoma: NHL (most common) / Hodgkin's — painless discrete nodes; B-symptoms (fever, night sweats, weight loss)",
        "Metastatic: From colorectal, testicular, ovarian, prostate carcinoma",
        "CT: Multiple enlarged nodes >1 cm, ± necrosis (lymphoma: 'rubber-stamp' nodes); PET-CT for staging",
        "Biopsy: Image-guided core needle biopsy for tissue diagnosis",
        "Rx: Chemotherapy / radiotherapy (lymphoma); treat primary (metastatic)",
      ],
    },
    {
      title: "RETROPERITONEAL SARCOMA",
      color: C.navy,
      pts: [
        "Liposarcoma (most common) & Leiomyosarcoma",
        "Present as large, painless RIF / retroperitoneal mass",
        "MRI: Gold standard — fat signal (liposarcoma); heterogeneous enhancing mass",
        "Often large (>10 cm) at diagnosis",
        "Rx: En bloc radical resection (R0) — mainstay; adjuvant radiation for high-grade",
        "5-year survival: 50–60% (local recurrence common)",
      ],
    },
    {
      title: "ILIAC ARTERY ANEURYSM & OTHER",
      color: C.orange,
      pts: [
        "Iliac artery aneurysm: Pulsatile expansile RIF mass; bruit on auscultation",
        "CT-angiography: Confirms diagnosis; measures size",
        "Rx: Endovascular repair (EVAR) or open surgery if symptomatic / >3.5 cm",
        "Undescended testis: Firm, rubbery RIF mass in young male; inguinal or intraabdominal",
        "Risk: Malignant transformation (seminoma) — orchidopexy + surveillance",
        "Retroperitoneal fibrosis: Periaortic fibrosis; bilateral ureteric obstruction; IgG4-related",
      ],
    },
  ];

  cards.forEach((card, ci) => {
    const cx = 0.3 + ci * 4.35;
    s.addShape(pres.ShapeType.rect, { x: cx, y: 0.95, w: 4.15, h: 0.4, fill: { color: card.color }, line: { color: card.color, width: 0 } });
    s.addText(card.title, { x: cx, y: 0.95, w: 4.15, h: 0.4, fontSize: 9.5, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    s.addShape(pres.ShapeType.rect, { x: cx, y: 1.35, w: 4.15, h: 5.8, fill: { color: C.light }, line: { color: card.color, width: 0.8 } });
    addBullets(s, card.pts, cx + 0.1, 1.42, 3.95, 5.6, { fontSize: 10.5 });
  });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 16 — DIFFERENTIAL DIAGNOSIS COMPARISON TABLE
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Differential Diagnosis Summary Table — RIF Mass", C.navy);

  const headers = ["Condition", "Key Feature", "Sign / Test", "Imaging", "Management"];
  const rows = [
    ["Rectus Sheath\nHematoma", "Fothergill's +ve\nAnticoag history", "Carnett's sign +ve", "CT: Hyperdense wall mass", "Conservative / Embolisation"],
    ["Appendicular\nMass/Abscess", "H/O appendicitis\n3–5 days", "Rebound/Guarding", "USG/CT: Periappendiceal\ninflammatory mass", "Ochsner-Sherren /\nInterval appendicectomy"],
    ["Ileocecal TB", "Hyperplastic mass\nChronic onset", "TB contact, Mantoux +ve", "CT: Shrunken cecum,\ncalcified nodes", "ATT 6–9 months ±\nSurgery"],
    ["Crohn Disease", "Skip lesions, fistulae\nYoung adult", "String sign (barium)", "CT: Comb sign,\ncreeping fat", "Biologics → Ileocolic\nresection"],
    ["Cecal Carcinoma", "Anaemia, weight loss\nAge >50", "↑CEA, colonoscopy", "CT: Enhancing mass,\nlymph nodes", "Right hemicolectomy\n± adjuvant chemo"],
    ["Ovarian Cyst /\nTorsion", "Female, acute pain\nMenstrual h/o", "β-hCG, β-USG; +ve\nAdnexal tenderness", "CT/USG: Whirlpool sign\nadnexal cyst", "Emergency laparoscopy\n(detorsion/oophorectomy)"],
    ["Psoas Abscess", "Fever + hip held\nin flexion", "Psoas sign +ve\nIGRA/Mantoux", "CT: Enlarged psoas\nhypodense collection", "CT-guided drainage +\nAntibiotics / ATT"],
    ["Iliac\nLymphadenopathy", "B-symptoms\nSystemic malaise", "PET-CT staging\nCore biopsy", "CT: Nodes >1 cm,\n± necrosis", "Chemo/Radiotherapy\n(Lymphoma)"],
    ["Spigelian Hernia", "Lateral rectus mass\nCough impulse +", "Defect at semi-\nlunar line", "CT: Fascial defect\nbowel herniation", "Laparoscopic / Open\nhernia repair"],
  ];

  const colWidths = [2.0, 2.3, 2.3, 2.6, 2.7];
  const startX = 0.3;
  const startY = 0.85;
  const rowH = 0.6;
  const headerH = 0.42;

  // header row
  let cx = startX;
  headers.forEach((h, hi) => {
    s.addShape(pres.ShapeType.rect, { x: cx, y: startY, w: colWidths[hi], h: headerH, fill: { color: C.navy }, line: { color: C.navy, width: 0 } });
    s.addText(h, { x: cx + 0.05, y: startY, w: colWidths[hi] - 0.1, h: headerH, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    cx += colWidths[hi] + 0.02;
  });

  rows.forEach((row, ri) => {
    const ry = startY + headerH + ri * rowH;
    const bgCol = ri % 2 === 0 ? C.light : C.white;
    let colx = startX;
    const rowColors = [C.orange, C.teal, C.teal, C.teal, C.teal, C.teal, C.purple, C.purple, C.orange];
    row.forEach((cell, ci) => {
      const isFirst = ci === 0;
      s.addShape(pres.ShapeType.rect, { x: colx, y: ry, w: colWidths[ci], h: rowH, fill: { color: isFirst ? rowColors[ri] : bgCol }, line: { color: C.gray, width: 0.3 } });
      s.addText(cell, {
        x: colx + 0.05, y: ry + 0.03, w: colWidths[ci] - 0.1, h: rowH - 0.05,
        fontSize: isFirst ? 9.5 : 9.5,
        color: isFirst ? C.white : C.dark,
        bold: isFirst,
        fontFace: "Calibri",
        valign: "middle",
        align: isFirst ? "center" : "left",
      });
      colx += colWidths[ci] + 0.02;
    });
  });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 17 — CLINICAL APPROACH ALGORITHM
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Systematic Approach to RIF Mass — Algorithm", C.navy);

  // Flowchart using boxes + connectors
  function box(sl, x, y, w, h, text, fillColor, textColor = C.white, fSize = 11) {
    sl.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: fillColor }, line: { color: fillColor, width: 0 }, rectRadius: 0.06 });
    sl.addText(text, { x, y, w, h, fontSize: fSize, color: textColor, align: "center", valign: "middle", bold: true, fontFace: "Calibri" });
  }
  function arrow(sl, x1, y1, x2, y2) {
    sl.addShape(pres.ShapeType.line, { x: x1, y: y1, w: x2 - x1, h: y2 - y1, line: { color: C.gray, width: 1.5 } });
  }

  box(s, 4.5, 0.9, 4.3, 0.5, "RIF MASS DETECTED", C.navy, C.white, 13);
  arrow(s, 6.65, 1.4, 6.65, 1.65);

  box(s, 4.5, 1.65, 4.3, 0.55, "HISTORY & EXAMINATION\n(Carnett / Fothergill / Psoas sign)", C.teal, C.white, 10);
  arrow(s, 6.65, 2.2, 6.65, 2.5);

  box(s, 4.5, 2.5, 4.3, 0.5, "Carnett's sign POSITIVE?", C.orange, C.white, 11);

  // Yes branch — abdominal wall
  arrow(s, 4.5, 2.75, 2.0, 2.75);
  box(s, 0.3, 2.5, 1.7, 0.5, "YES", C.orange, C.white, 11);
  arrow(s, 1.15, 3.0, 1.15, 3.3);
  box(s, 0.3, 3.3, 3.5, 0.5, "ABDOMINAL WALL MASS\n→ USG / CT → Excision / Evacuate", C.orange, C.white, 9.5);

  // No branch — intraperitoneal/retroperitoneal
  arrow(s, 8.8, 2.75, 11.3, 2.75);
  box(s, 11.3, 2.5, 1.7, 0.5, "NO", C.teal, C.white, 11);
  arrow(s, 12.15, 3.0, 12.15, 3.3);

  arrow(s, 6.65, 3.0, 6.65, 3.3);
  box(s, 4.5, 3.3, 4.3, 0.5, "USG ABDOMEN & PELVIS\n(1st line imaging)", C.lblue, C.white, 10);
  arrow(s, 6.65, 3.8, 6.65, 4.1);
  box(s, 4.5, 4.1, 4.3, 0.5, "CECT ABDOMEN (Gold Standard)\n+ Tumour markers / IGRA / β-hCG", C.lblue, C.white, 10);
  arrow(s, 6.65, 4.6, 6.65, 4.9);

  // Branch out from CT
  // Intraperitoneal
  s.addShape(pres.ShapeType.line, { x: 4.5, y: 5.15, w: -3.0, h: 0, line: { color: C.gray, width: 1.5 } });
  box(s, 0.3, 4.9, 4.15, 0.5, "INTRAPERITONEAL\n(Appendix/Cecum/Ovary/IBD)", C.teal, C.white, 9.5);
  // Retroperitoneal
  s.addShape(pres.ShapeType.line, { x: 8.8, y: 5.15, w: 3.0, h: 0, line: { color: C.gray, width: 1.5 } });
  box(s, 8.8, 4.9, 4.15, 0.5, "RETROPERITONEAL\n(Psoas/Lymph nodes/Sarcoma)", C.purple, C.white, 9.5);

  box(s, 4.5, 4.9, 4.3, 0.5, "DIAGNOSIS CONFIRMED?", C.navy, C.white, 11);
  arrow(s, 6.65, 5.4, 6.65, 5.7);

  // Bottom row
  const finalBoxes = [
    ["Conservative\n(TB/Crohn)", C.teal, 0.3],
    ["Percutaneous\nDrainage (Abscess)", C.orange, 3.3],
    ["Surgical\nResection", C.red, 6.3],
    ["Chemo/Radio\n(Lymphoma)", C.purple, 9.3],
    ["Emergency\nLaparoscopy", C.navy, 11.0],
  ];
  finalBoxes.forEach(([t, c, fx]) => {
    arrow(s, 6.65, 5.7, fx + 0.8, 5.7);
    box(s, fx, 5.7, 1.9, 0.6, t, c, C.white, 9);
  });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 18 — KEY CLINICAL SIGNS
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Key Clinical Signs in RIF Mass", C.navy);

  const signs = [
    { sign: "Carnett's Sign", desc: "Pain INCREASES on tensing the rectus abdominis (abdominal wall origin vs intraperitoneal)", color: C.orange },
    { sign: "Fothergill's Sign", desc: "Mass does NOT cross midline and remains palpable when rectus is contracted (rectus sheath hematoma)", color: C.orange },
    { sign: "Psoas Sign", desc: "RIF pain on passive hip extension with knee straight — retrocaecal appendicitis / psoas abscess", color: C.purple },
    { sign: "Obturator Sign", desc: "RIF pain on internal rotation of flexed right hip — pelvic abscess / pelvic appendicitis", color: C.purple },
    { sign: "Rovsing's Sign", desc: "RIF pain on palpation of LIF — acute appendicitis (referred pain along iliocaecal mesentery)", color: C.teal },
    { sign: "McBurney's Point Tenderness", desc: "Maximum tenderness at 2/3rd from umbilicus to ASIS — classic appendicitis sign", color: C.teal },
    { sign: "Dance's Sign", desc: "Empty RIF on palpation — intussusception (ileocolic)", color: C.navy },
    { sign: "Grey-Turner's Sign", desc: "Flank bruising — retroperitoneal haemorrhage (haematoma tracking in retroperitoneum)", color: C.navy },
    { sign: "Sister Mary Joseph Nodule", desc: "Periumbilical metastatic nodule from intra-abdominal malignancy (gastric, colorectal, ovarian)", color: C.red },
    { sign: "Whirlpool Sign (CT/USG)", desc: "Twisting of vascular pedicle — pathognomonic of ovarian torsion", color: C.lblue },
    { sign: "Comb Sign (CT)", desc: "Engorgement of vasa recta (small bowel mesenteric vessels) — active Crohn's disease", color: C.lblue },
    { sign: "Napkin-Ring Sign (Ba Enema)", desc: "Circumferential annular constriction — carcinoma of colon", color: C.green },
  ];

  const perCol = 6;
  signs.forEach((sign, i) => {
    const col = i < perCol ? 0 : 1;
    const row = i % perCol;
    const sx = 0.3 + col * 6.65;
    const sy = 0.88 + row * 1.08;
    s.addShape(pres.ShapeType.rect, { x: sx, y: sy, w: 0.22, h: 0.9, fill: { color: sign.color }, line: { color: sign.color, width: 0 } });
    s.addShape(pres.ShapeType.rect, { x: sx + 0.22, y: sy, w: 6.2, h: 0.9, fill: { color: C.light }, line: { color: sign.color, width: 0.5 } });
    s.addText(sign.sign, { x: sx + 0.28, y: sy + 0.04, w: 5.9, h: 0.35, fontSize: 11, bold: true, color: sign.color, fontFace: "Calibri" });
    s.addText(sign.desc, { x: sx + 0.28, y: sy + 0.4, w: 5.9, h: 0.46, fontSize: 9.5, color: C.dark, fontFace: "Calibri" });
  });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 19 — IMAGING APPROACH
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.white);
  addSlideHeader(s, "Imaging Approach to RIF Mass", C.navy);

  const modalities = [
    {
      name: "ULTRASONOGRAPHY (USG)",
      color: C.teal,
      role: "First-line investigation — cheap, no radiation, dynamic",
      features: [
        "Appendix: Non-compressible blind-end tube >6 mm = appendicitis",
        "Appendicular mass: Hyperechoic periappendiceal fat, abscess cavity",
        "Ovarian cyst: Size, morphology, Doppler flow; whirlpool sign in torsion",
        "Psoas abscess: Hypoechoic collection in psoas",
        "Wall: RSH — hypoechoic intramural collection; hernia defect",
      ],
      limitation: "Operator-dependent; bowel gas limits visualization",
    },
    {
      name: "CONTRAST CT ABDOMEN",
      color: C.navy,
      role: "Gold standard — best anatomical delineation",
      features: [
        "Appendiceal abscess: Periappendiceal stranding, rim-enhancing collection",
        "TB: Shrunken cecum, calcified mesenteric nodes, necrotic lymph nodes",
        "Crohn: Comb sign, creeping fat, wall thickening, fistulae",
        "Cecal carcinoma: Irregular enhancing mass, lymph nodes, liver mets",
        "Psoas: Enlarged psoas, hypodense collection, ± gas",
        "Retroperitoneal sarcoma: Heterogeneous large mass",
      ],
      limitation: "Radiation; contrast nephropathy risk",
    },
    {
      name: "MRI",
      color: C.purple,
      role: "Superior soft tissue detail; no radiation; MR Enterography for IBD",
      features: [
        "Crohn: MR Enterography — mural hyperenhancement, fistulae",
        "Desmoid: T2 hypointense (hallmark)",
        "Retroperitoneal sarcoma: Tissue characterization",
        "Psoas abscess: Extent, spinal involvement (Pott's disease)",
        "Ovarian masses: Complex morphology, T1 fat-sat for dermoid",
      ],
      limitation: "Expensive; time-consuming; bowel motion artefact",
    },
    {
      name: "BARIUM ENEMA / FOLLOW-THROUGH",
      color: C.orange,
      role: "Dynamic mucosal assessment — largely superseded by CT/endoscopy",
      features: [
        "String sign of Kantor — Crohn's stricture of terminal ileum",
        "Napkin-ring sign — carcinoma colon",
        "Caecal filling defect — carcinoma / hyperplastic TB mass",
        "Bird's beak / claw sign — intussusception",
        "Reversed 3 sign — annular carcinoma",
      ],
      limitation: "No information on adjacent organs; poor sensitivity",
    },
  ];

  modalities.forEach((mod, mi) => {
    const mx = 0.3 + (mi % 2) * 6.5;
    const my = 0.85 + Math.floor(mi / 2) * 3.3;
    s.addShape(pres.ShapeType.rect, { x: mx, y: my, w: 6.2, h: 0.38, fill: { color: mod.color }, line: { color: mod.color, width: 0 } });
    s.addText(mod.name, { x: mx, y: my, w: 6.2, h: 0.38, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    s.addShape(pres.ShapeType.rect, { x: mx, y: my + 0.38, w: 6.2, h: 2.75, fill: { color: C.light }, line: { color: mod.color, width: 0.8 } });
    s.addText(`Role: ${mod.role}`, { x: mx + 0.1, y: my + 0.42, w: 6.0, h: 0.4, fontSize: 10, italic: true, color: mod.color, bold: true, fontFace: "Calibri" });
    addBullets(s, mod.features, mx + 0.1, my + 0.85, 6.0, 1.8, { fontSize: 10.5 });
    s.addText(`⚠ Limitation: ${mod.limitation}`, { x: mx + 0.1, y: my + 2.7, w: 6.0, h: 0.35, fontSize: 9.5, italic: true, color: C.red, fontFace: "Calibri" });
  });
}

// ─────────────────────────────────────────────────────────────────
// SLIDE 20 — TAKE HOME MESSAGES
// ─────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  bgFill(s, C.navy);
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.75, fill: { color: C.dark }, line: { color: C.dark, width: 0 } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0.75, w: "100%", h: 0.08, fill: { color: C.gold }, line: { color: C.gold, width: 0 } });
  s.addText("TAKE HOME MESSAGES — RIF Mass", {
    x: 0.3, y: 0, w: 12.7, h: 0.75,
    fontSize: 22, bold: true, color: C.white, valign: "middle", fontFace: "Calibri",
  });

  const msgs = [
    { n: "1", t: "Systematic Anatomical Approach", d: "Always categorize: Abdominal Wall → Intraperitoneal → Retroperitoneal. Use Carnett's test to differentiate wall from visceral origin." },
    { n: "2", t: "History is Half the Diagnosis", d: "Age, sex, duration, fever, weight loss, TB contact, menstrual history, and prior surgery narrow the differential dramatically." },
    { n: "3", t: "Appendicular Mass — Ochsner-Sherren", d: "Do not operate on an appendicular mass acutely. Conservative management + interval appendicectomy at 6–8 weeks is standard practice." },
    { n: "4", t: "TB vs Crohn vs Carcinoma — The Great Mimics", d: "These three are the most difficult to distinguish. Mantoux/IGRA, colonoscopic biopsy, and response to ATT guide diagnosis. CT and MRI are essential." },
    { n: "5", t: "Imaging Strategy", d: "USG first (no radiation, cheap) → CECT abdomen (gold standard) → MRI for soft tissue/IBD. Never skip CT if malignancy is suspected." },
    { n: "6", t: "Female RIF — Always Consider Gynaecological", d: "β-hCG (rule out ectopic pregnancy), pelvic USG, and gynaecology review are mandatory in women of reproductive age with RIF mass." },
    { n: "7", t: "Psoas Abscess — Don't Miss", d: "Hip held in flexion + Psoas sign + fluctuant RIF mass = psoas abscess until proven otherwise. CT-guided drainage is first-line treatment." },
    { n: "8", t: "Malignancy Must Always Be Excluded", d: "Age >50, anaemia, weight loss, ↑CEA → exclude cecal carcinoma. Colonoscopy + biopsy is essential even after CT diagnosis." },
  ];

  msgs.forEach((msg, mi) => {
    const col = mi < 4 ? 0 : 1;
    const row = mi % 4;
    const bx = 0.3 + col * 6.5;
    const by = 0.95 + row * 1.6;
    s.addShape(pres.ShapeType.roundRect, { x: bx, y: by, w: 6.2, h: 1.45, fill: { color: C.dark }, line: { color: C.gold, width: 0.8 }, rectRadius: 0.06 });
    s.addShape(pres.ShapeType.roundRect, { x: bx, y: by, w: 0.5, h: 1.45, fill: { color: C.gold }, line: { color: C.gold, width: 0 }, rectRadius: 0.06 });
    s.addText(msg.n, { x: bx, y: by, w: 0.5, h: 1.45, fontSize: 18, bold: true, color: C.navy, align: "center", valign: "middle", fontFace: "Calibri" });
    s.addText(msg.t, { x: bx + 0.55, y: by + 0.1, w: 5.6, h: 0.4, fontSize: 12, bold: true, color: C.gold, fontFace: "Calibri" });
    s.addText(msg.d, { x: bx + 0.55, y: by + 0.52, w: 5.6, h: 0.85, fontSize: 10, color: C.light, fontFace: "Calibri" });
  });
}

// ─────────────────────────────────────────────────────────────────
// WRITE FILE
// ─────────────────────────────────────────────────────────────────
const outputPath = "/home/daytona/workspace/rif-mass-ppt/RIF_Mass_DDx.pptx";
pres.writeFile({ fileName: outputPath }).then(() => {
  console.log("✅ Presentation saved:", outputPath);
}).catch(err => {
  console.error("❌ Error:", err);
  process.exit(1);
});
Running Command

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

Running Command

ls -lh /home/daytona/workspace/rif-mass-ppt/RIF_Mass_DDx.pptx

Your presentation is ready! Download it here:

RIF Mass DDx

Presentation · PPTX

(1.6 MB, 20 slides)

What's Inside — Slide-by-Slide

#SlideHighlights
1Title SlideBold navy/gold design with CT image
2Anatomy & OverviewBoundaries, structures, 3-category framework, clinical approach table
3Section Divider — Abdominal WallOrange theme, full list
4Rectus Sheath HematomaFothergill's/Carnett's signs, Berná-Mestre classification, 2 CT images
5Lipoma / Desmoid / Spigelian Hernia3-column comparison with MRI image of FAP desmoid
6Section Divider — IntraperitonealTeal theme, full list
7Appendicular MassOchsner-Sherren regimen, 3 images (USG phlegmon + CT abscess)
8Appendiceal Mucocele & NeoplasmsLAMN → PMP spectrum, CT mucocele image
9Ileocecal TuberculosisATT response CT, calcified nodes CT, TB vs Crohn differentiators
10Crohn's DiseaseComb sign CT, RIF abscess CT, penetrating disease CT
11Carcinoma CecumDukes staging, CT mass, surgical specimen
12Ovarian/Adnexal MassesTorsion (whirlpool sign CT), dermoid, TOA, ectopic pregnancy
13Section Divider — RetroperitonealPurple theme, full list
14Psoas AbscessPrimary vs secondary, psoas sign, 2 CT images
15Lymphadenopathy & Retroperitoneal SarcomaLymphoma, metastatic nodes, liposarcoma, iliac aneurysm
16DDx Summary Table9 conditions × 5 parameters (key feature, sign, imaging, management)
17Clinical Algorithm FlowchartStep-by-step decision tree from RIF mass to management
18Key Clinical Signs12 signs: Carnett's, Fothergill's, Psoas, Obturator, Rovsing's, Dance's, etc.
19Imaging ApproachUSG / CT / MRI / Barium — roles, findings, limitations
20Take Home Messages8 numbered gold-on-navy key pearls
This is a shared conversation. Sign in to Orris to start your own chat.