Create a surgery presentation on the topics that should have clinical features,treatment(surgical treatment ),management on the following topics: adenomatous polyps Familial adenomatous polyps Lynch syndrome Colorectal cancer Inflammatory bowel disease Infections of large intestine Vascular anomalies of large intestine Constipation Irritable bowel syndrome

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

mkdir -p /home/daytona/workspace/surgery-pptx && ls /home/daytona/workspace/surg…

Writing File

~/surgery-pptx/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE";
pres.title = "Large Intestine: Surgery Presentation";
pres.author = "Surgery Department";

// ─── THEME ───────────────────────────────────────────────────────────────────
const C = {
  navy:    "0D2137",
  teal:    "1A6B72",
  gold:    "E8A020",
  white:   "FFFFFF",
  offWhite:"F4F6F8",
  light:   "D6E4EA",
  dark:    "0A1929",
  accent:  "2EC4B6",
  red:     "C0392B",
  text:    "1C2D3A",
  sub:     "3A5068",
};

const FF = "Calibri";

// ─── HELPERS ─────────────────────────────────────────────────────────────────
function addBg(slide, dark = false) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: "100%",
    fill: { color: dark ? C.navy : C.offWhite },
    line: { type: "none" },
  });
}

function addSideBar(slide, color = C.teal) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.22, h: "100%",
    fill: { color },
    line: { type: "none" },
  });
}

function addTopBar(slide, color = C.teal, h = 1.1) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h,
    fill: { color },
    line: { type: "none" },
  });
}

function sectionHeader(title, subtitle = "") {
  const s = pres.addSlide();
  // full navy bg
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy }, line: { type: "none" } });
  // teal accent strip left
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.7, h: "100%", fill: { color: C.teal }, line: { type: "none" } });
  // gold accent bar
  s.addShape(pres.ShapeType.rect, { x: 0.7, y: 2.4, w: 12, h: 0.08, fill: { color: C.gold }, line: { type: "none" } });
  s.addText(title, {
    x: 1.1, y: 1.5, w: 11.5, h: 1.4,
    fontFace: FF, fontSize: 44, bold: true, color: C.white,
    valign: "middle",
  });
  if (subtitle) {
    s.addText(subtitle, {
      x: 1.1, y: 3.1, w: 11.5, h: 0.8,
      fontFace: FF, fontSize: 22, color: C.light, italic: true,
    });
  }
  return s;
}

function contentSlide(title, columns) {
  // columns: array of { heading, bullets }
  const s = pres.addSlide();
  addBg(s, false);
  addTopBar(s, C.teal, 1.05);
  addSideBar(s, C.navy);

  s.addText(title, {
    x: 0.4, y: 0.1, w: 12.8, h: 0.85,
    fontFace: FF, fontSize: 26, bold: true, color: C.white,
    valign: "middle",
  });

  const n = columns.length;
  const gutter = 0.18;
  const totalW = 12.8;
  const colW = (totalW - gutter * (n - 1)) / n;
  const startX = 0.35;
  const startY = 1.2;
  const colH = 5.9;

  columns.forEach((col, i) => {
    const x = startX + i * (colW + gutter);

    // column card
    s.addShape(pres.ShapeType.rect, {
      x, y: startY, w: colW, h: colH,
      fill: { color: C.white },
      line: { color: C.light, pt: 1.2 },
      shadow: { type: "outer", blur: 6, offset: 2, angle: 45, color: "00000018" },
    });

    // heading band
    s.addShape(pres.ShapeType.rect, {
      x, y: startY, w: colW, h: 0.5,
      fill: { color: C.navy },
      line: { type: "none" },
    });

    s.addText(col.heading, {
      x: x + 0.08, y: startY, w: colW - 0.16, h: 0.5,
      fontFace: FF, fontSize: 13.5, bold: true, color: C.gold,
      valign: "middle", margin: 0,
    });

    const bulletItems = col.bullets.map((b, idx) => [
      { text: b, options: { bullet: { type: "bullet", characterCode: "25B8" }, fontSize: 12.5, color: C.text, fontFace: FF, breakLine: idx < col.bullets.length - 1 } }
    ]).flat();

    s.addText(bulletItems, {
      x: x + 0.1, y: startY + 0.56, w: colW - 0.2, h: colH - 0.62,
      fontFace: FF, fontSize: 12.5, color: C.text,
      valign: "top", wrap: true, margin: [4, 4, 4, 4],
    });
  });

  return s;
}

// ═══════════════════════════════════════════════════════════════════════════════
//  TITLE SLIDE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  // gradient-ish navy bg
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.dark }, line: { type: "none" } });
  // decorative teal rectangle
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.6, fill: { color: C.teal }, line: { type: "none" } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 6.9, w: "100%", h: 0.6, fill: { color: C.teal }, line: { type: "none" } });
  // gold accent
  s.addShape(pres.ShapeType.rect, { x: 1.5, y: 2.6, w: 10.3, h: 0.1, fill: { color: C.gold }, line: { type: "none" } });
  s.addShape(pres.ShapeType.rect, { x: 1.5, y: 5.1, w: 10.3, h: 0.1, fill: { color: C.gold }, line: { type: "none" } });

  s.addText("LARGE INTESTINE", {
    x: 0, y: 0.9, w: "100%", h: 0.85,
    fontFace: FF, fontSize: 18, bold: false, color: C.accent,
    align: "center", charSpacing: 8,
  });
  s.addText("Surgery Presentation", {
    x: 0, y: 1.75, w: "100%", h: 1.3,
    fontFace: FF, fontSize: 46, bold: true, color: C.white,
    align: "center",
  });
  s.addText("Clinical Features  ·  Surgical Treatment  ·  Management", {
    x: 0, y: 3.0, w: "100%", h: 0.7,
    fontFace: FF, fontSize: 17, color: C.light,
    align: "center", italic: true,
  });

  const topics = [
    "Adenomatous Polyps", "Familial Adenomatous Polyposis", "Lynch Syndrome",
    "Colorectal Cancer", "Inflammatory Bowel Disease", "Infections of Large Intestine",
    "Vascular Anomalies", "Constipation", "Irritable Bowel Syndrome"
  ];
  const topicText = topics.map((t, i) => ({
    text: (i < topics.length - 1 ? t + "   ·   " : t),
    options: { fontSize: 12, color: C.light, fontFace: FF }
  }));
  s.addText(topicText, {
    x: 0.5, y: 4.0, w: 12.3, h: 1.2,
    align: "center", valign: "middle", wrap: true,
  });
  s.addText("Bailey & Love · Mulholland & Greenfield · Schwartz's Surgery · Rosen's EM", {
    x: 0, y: 6.55, w: "100%", h: 0.35,
    fontFace: FF, fontSize: 10, color: C.teal, align: "center",
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
//  1. ADENOMATOUS POLYPS
// ═══════════════════════════════════════════════════════════════════════════════
sectionHeader("1. Adenomatous Polyps", "Neoplastic epithelial lesions — precancerous precursors to CRC");

contentSlide("Adenomatous Polyps — Overview & Clinical Features", [
  {
    heading: "Definition & Types",
    bullets: [
      "Epithelial lesions — smooth to nodular as they grow",
      "Tubular adenoma: ≥80% dysplastic tubules (most common, 80%)",
      "Villous adenoma: ≥80% villous fronds (highest malignant risk)",
      "Tubulovillous adenoma: mixed features",
      "By definition dysplastic — nuclear atypia & architectural irregularity",
      "Found in up to 50% of screening colonoscopies",
      "Prevalence increases with age; incidence rising globally",
      "2–3× CRC risk with first-degree relative with adenomas",
    ],
  },
  {
    heading: "Clinical Features",
    bullets: [
      "Usually asymptomatic — found incidentally on colonoscopy",
      "Rectal bleeding (hematochezia) — most common symptom",
      "Change in bowel habits — constipation or diarrhea",
      "Large villous adenomas → profuse watery diarrhea, hypokalemia",
      "Abdominal cramping or discomfort (larger polyps)",
      "Mucus per rectum with villous adenomas",
      "Iron-deficiency anemia from chronic occult blood loss",
      "Rarely palpable on digital rectal examination (rectal polyps)",
    ],
  },
  {
    heading: "Diagnosis & Risk Stratification",
    bullets: [
      "Colonoscopy: gold standard — visualization + biopsy",
      "CT colonography (virtual colonoscopy) if colonoscopy contraindicated",
      "Fecal occult blood test (FOBT) / fecal immunochemical test (FIT)",
      "High-risk features: size >1 cm, villous histology, high-grade dysplasia",
      "Advanced adenoma: ≥1 cm OR villous OR high-grade dysplasia",
      "Adenoma-carcinoma sequence: APC → K-ras → p53 mutations",
      "30–50% chance of additional synchronous adenoma",
      "Surveillance interval based on number, size, and histology",
    ],
  },
]);

contentSlide("Adenomatous Polyps — Treatment & Management", [
  {
    heading: "Endoscopic Treatment",
    bullets: [
      "Polypectomy: standard snare excision for pedunculated polyps",
      "Endoscopic mucosal resection (EMR) for sessile polyps ≤2 cm",
      "Endoscopic submucosal dissection (ESD) for larger sessile lesions",
      "Piecemeal resection for polyps >2 cm if ESD not available",
      "Tattooing polyp site for surgical planning if needed",
      "Complete excision confirmed by histology (clear margins)",
      "Cold snare preferred for polyps <10 mm (lower perforation risk)",
    ],
  },
  {
    heading: "Surgical Treatment",
    bullets: [
      "Indicated for: polyps not amenable to endoscopic removal",
      "Polyps with high-grade dysplasia / intramucosal carcinoma",
      "Failed endoscopic resection or incomplete excision",
      "Laparoscopic colectomy — preferred (faster recovery, cosmesis)",
      "Open colectomy — for complex cases or locally advanced disease",
      "Segmental resection based on blood supply and lymphatics",
      "Right hemicolectomy (cecum/ascending colon polyps)",
      "Sigmoid colectomy / anterior resection for left-sided polyps",
    ],
  },
  {
    heading: "Surveillance & Management",
    bullets: [
      "Low-risk (1–2 small tubular adenomas): colonoscopy at 5–10 years",
      "High-risk (3–4 adenomas, or advanced adenoma): at 3 years",
      "≥5 adenomas: colonoscopy at 1 year",
      "Post-polypectomy: confirm complete excision histologically",
      "Chemoprevention: Aspirin/NSAIDs reduce recurrence (not routine)",
      "Lifestyle: diet high in fibre, low in red/processed meat",
      "Genetic counseling if strong family history",
      "Annual FOBT in higher-risk populations",
    ],
  },
]);

// ═══════════════════════════════════════════════════════════════════════════════
//  2. FAMILIAL ADENOMATOUS POLYPOSIS
// ═══════════════════════════════════════════════════════════════════════════════
sectionHeader("2. Familial Adenomatous Polyposis (FAP)", "Autosomal dominant — APC gene mutation — 100% lifetime CRC risk");

contentSlide("FAP — Definition, Genetics & Clinical Features", [
  {
    heading: "Genetics & Pathology",
    bullets: [
      "Mutation in APC gene (chromosome 5q21) — autosomal dominant",
      "Classic FAP: >100 colorectal adenomas (often thousands)",
      "Attenuated FAP (AFAP): <100 polyps; later onset (4th decade)",
      ">80% have positive family history; ~20% are new mutations",
      "Lifetime CRC risk: virtually 100% without prophylactic surgery",
      "Codon 1309 mutation → most severe phenotype",
      "Codons 1286–1513 → worse prognosis, earlier disease onset",
      "Gardner's syndrome: FAP + osteomas + epidermoid cysts",
    ],
  },
  {
    heading: "Clinical Features",
    bullets: [
      "Polyps visible on sigmoidoscopy by age 15; always by age 30",
      "Rectal bleeding, change in bowel habit, mucus PR",
      "Abdominal pain; iron-deficiency anemia",
      "Duodenal adenomas (periampullary) — risk of duodenal cancer",
      "Desmoid tumours (mesentery) — locally invasive, non-metastatic",
      "Osteomas (jaw, skull, long bones)",
      "CHRPE (congenital hypertrophy of retinal pigment epithelium) — 50%",
      "Epidermoid cysts, brain tumours (Turcot's syndrome)",
    ],
  },
  {
    heading: "Screening & Diagnosis",
    bullets: [
      "Flexible sigmoidoscopy from age 12–14 years in at-risk family members",
      "Colonoscopy once polyps detected",
      "Genetic testing: APC gene mutation analysis",
      "Upper GI endoscopy: screen for duodenal/ampullary adenomas",
      "Spigelman classification for duodenal polyposis severity",
      "If >100 adenomas on colonoscopy → diagnosis confirmed",
      "AFAP: colonoscopy (not just sigmoidoscopy) required",
      "Family tree construction; refer to medical genetics",
    ],
  },
]);

contentSlide("FAP — Surgical Treatment & Postoperative Management", [
  {
    heading: "Surgical Options",
    bullets: [
      "Goal: prevent colorectal cancer — prophylactic surgery mandatory",
      "Surgery usually deferred to age 17–18 unless symptoms develop",
      "Malignant change unusual before age 20",
      "Option 1: Restorative proctocolectomy + ileal pouch-anal anastomosis (IPAA) — removes entire colorectum, avoids stoma",
      "Option 2: Total colectomy + ileorectal anastomosis (IRA) — for <20 rectal polyps; preserves rectum",
      "Option 3: Total proctocolectomy + end ileostomy — poor sphincter function, rectal cancer, single-stage preference",
      "Laparoscopic approach: faster recovery, better cosmesis, improved fecundity in women",
    ],
  },
  {
    heading: "IPAA vs IRA Considerations",
    bullets: [
      "IPAA: preferred for most — removes all at-risk colorectal mucosa",
      "IPAA failure rate ~10%; pouch surveillance still needed",
      "Stapled anastomosis → residual rectal cuff mucosectomy advocated",
      "IRA: suitable if <20 rectal polyps; lower sexual/fertility dysfunction risk",
      "IRA: up to 10% develop rectal cancer — mandatory rectal surveillance",
      "AFAP: rectal-preserving surgery acceptable (cancer risk ~2%)",
      "Proctocolectomy + ileostomy: definitive, no surveillance required",
    ],
  },
  {
    heading: "Postoperative & Medical Management",
    bullets: [
      "IPAA/IRA: lifelong endoscopic surveillance of pouch/rectum",
      "Duodenal surveillance: upper GI endoscopy every 1–5 years (Spigelman stage)",
      "Spigelman stage IV → consider prophylactic pancreaticoduodenectomy",
      "Sulindac (NSAID): reduces polyp number in rectum post-IRA",
      "Celecoxib: reduces duodenal/rectal polyp burden",
      "Desmoid tumours: sulindac, tamoxifen, chemotherapy (doxorubicin/dacarbazine) if unresectable",
      "Register patients with national FAP registry",
      "Annual thyroid exam; consider hepatoblastoma screening in children",
    ],
  },
]);

// ═══════════════════════════════════════════════════════════════════════════════
//  3. LYNCH SYNDROME
// ═══════════════════════════════════════════════════════════════════════════════
sectionHeader("3. Lynch Syndrome (HNPCC)", "Most common hereditary CRC syndrome — mismatch repair gene defects");

contentSlide("Lynch Syndrome — Genetics & Clinical Features", [
  {
    heading: "Genetics & Epidemiology",
    bullets: [
      "Autosomal dominant — mismatch repair (MMR) gene mutations",
      "Genes: MLH1, MSH2, MSH6, PMS2, EpCAM",
      "3–5% of all colorectal cancers (1 in 20)",
      "Lifetime CRC risk: 53–69%; median age diagnosis: early 60s",
      "MLH1 mutation → younger age of onset vs MSH2, PMS2",
      "PMS2 mutations: relatively lower CRC risk",
      "Amsterdam II criteria used for clinical diagnosis",
      "Microsatellite instability (MSI-H) hallmark on tumour testing",
    ],
  },
  {
    heading: "Clinical Features",
    bullets: [
      "Fewer adenomas than FAP (<10 polyps, usually)",
      "Right-sided colonic predominance — flat adenomas",
      "Rapid progression from adenoma to dysplasia to cancer",
      "High rate of metachronous colorectal tumours (3–5% annual)",
      "Rectal bleeding, change in bowel habits, abdominal pain",
      "Associated extra-colonic cancers: endometrial (most common), ovarian, gastric, small bowel, urinary tract, biliary tract",
      "Sebaceous skin tumours (Muir-Torre syndrome variant)",
      "Brain tumours (glioblastoma) — Turcot's syndrome variant",
    ],
  },
  {
    heading: "Diagnosis",
    bullets: [
      "Amsterdam II Criteria: 3 relatives with Lynch-associated cancer, 2+ generations, 1 case <50 years old, FAP excluded",
      "Revised Bethesda Guidelines: clinical screening trigger",
      "Tumour testing: MSI testing + immunohistochemistry (IHC) for MMR proteins",
      "Loss of MLH1/PMS2 or MSH2/MSH6 on IHC → germline testing",
      "Germline genetic testing: confirms specific mutation",
      "Universal tumour screening: all CRC specimens tested for MMR status",
      "Mutation-specific cancer risks guide surveillance intensity",
    ],
  },
]);

contentSlide("Lynch Syndrome — Treatment & Management", [
  {
    heading: "Surgical Treatment of CRC in Lynch",
    bullets: [
      "Extended colonic resection preferred over segmental (high metachronous risk)",
      "Subtotal colectomy + ileorectal anastomosis: for colon cancer",
      "Reduces metachronous CRC risk vs. segmental resection",
      "Total proctocolectomy: if rectal cancer or significant rectal disease",
      "Annual surveillance colonoscopy (vs. 3-yearly in sporadic CRC)",
      "Laparoscopic approach: standard in experienced hands",
      "Synchronous liver metastases: resect if feasible",
    ],
  },
  {
    heading: "Gynaecological Management",
    bullets: [
      "Endometrial cancer risk: 40–60% (most common extra-colonic cancer)",
      "Prophylactic hysterectomy + bilateral salpingo-oophorectomy: after childbearing complete",
      "Annual gynaecological surveillance: endometrial biopsy, transvaginal USS",
      "Ovarian cancer risk: 10–12%",
      "Discuss risk-reduction surgery with gynaecologist",
      "Oral contraceptive use: may reduce gynaecological cancer risk",
    ],
  },
  {
    heading: "Surveillance & Medical Management",
    bullets: [
      "Colonoscopy every 1–2 years from age 25 (or 5 years before earliest family case)",
      "Upper GI endoscopy: for gastric/small bowel surveillance in high-risk families",
      "Annual urinalysis (urothelial cancer surveillance)",
      "Aspirin 600 mg/day: proven CRC reduction in Lynch (CAPP2 trial)",
      "Immunotherapy (pembrolizumab): highly effective for MMR-deficient advanced CRC",
      "Cascade genetic testing: all first-degree relatives",
      "Psychosocial support and genetic counseling",
    ],
  },
]);

// ═══════════════════════════════════════════════════════════════════════════════
//  4. COLORECTAL CANCER
// ═══════════════════════════════════════════════════════════════════════════════
sectionHeader("4. Colorectal Cancer (CRC)", "2nd most common cancer death in the UK · ~42,000 new UK cases/year");

contentSlide("Colorectal Cancer — Epidemiology & Clinical Features", [
  {
    heading: "Epidemiology & Pathology",
    bullets: [
      "2nd most common cause of cancer death in the UK",
      "~42,000 new cases/year UK; male > female (56% vs 44%)",
      "Rectum 38%, sigmoid 21%, caecum 12%, ascending colon 5%",
      "Adenoma-carcinoma sequence: APC → K-ras → SMAD4 → p53",
      "Four consensus molecular subtypes (CMS1–4)",
      "MSI-H tumours: right-sided, better prognosis, immunotherapy-sensitive",
      "Risk factors: red/processed meat, alcohol, smoking, obesity",
      "Protective: dietary fibre, calcium, magnesium, aspirin",
    ],
  },
  {
    heading: "Clinical Features",
    bullets: [
      "Right colon: insidious blood loss → iron-deficiency anaemia, weight loss, RIF mass",
      "Left colon: change in bowel habit, rectal bleeding, tenesmus, pencil-thin stools",
      "Rectal cancer: rectal bleeding, tenesmus, incomplete evacuation, rectal mass on DRE",
      "Obstruction: colicky abdominal pain, absolute constipation, distension",
      "Perforation: peritonitis, septic shock (emergency presentation)",
      "Fistula formation to bladder (pneumaturia), vagina, skin",
      "Liver metastases: hepatomegaly, jaundice, RUQ pain",
      "Constitutional: weight loss, anorexia, fatigue",
    ],
  },
  {
    heading: "Staging (Dukes / TNM)",
    bullets: [
      "Dukes A: confined to bowel wall (T1–2, N0)",
      "Dukes B: through bowel wall, no nodes (T3–4, N0)",
      "Dukes C: regional lymph node involvement (any T, N1–2)",
      "Dukes D: distant metastases (M1)",
      "TNM: T (depth), N (nodes 0/1/2), M (metastases 0/1)",
      "CT chest/abdomen/pelvis: staging workup",
      "MRI rectum: T staging, CRM assessment for rectal cancer",
      "CEA: baseline (prognostic) + post-operative surveillance",
    ],
  },
]);

contentSlide("Colorectal Cancer — Surgical Treatment", [
  {
    heading: "Colon Cancer Surgery",
    bullets: [
      "Curative intent: radical resection with clear margins (R0)",
      "Right hemicolectomy: caecum, ascending, hepatic flexure tumours",
      "Extended right hemicolectomy: transverse colon tumours",
      "Left hemicolectomy: descending colon tumours",
      "Sigmoid colectomy: sigmoid colon tumours",
      "Principle: en-bloc resection with supplying mesentery + lymph nodes",
      "Minimum 12 lymph nodes for adequate staging",
      "Laparoscopic colectomy: equivalent oncological outcomes, faster recovery",
      "Robotic surgery: emerging, improved dexterity in pelvis",
    ],
  },
  {
    heading: "Rectal Cancer Surgery",
    bullets: [
      "Total mesorectal excision (TME): gold standard for rectal cancer",
      "Sharp dissection in mesorectal plane preserves autonomic nerves",
      "Anterior resection (AR): for upper/mid rectum — colorectal/coloanal anastomosis",
      "Low anterior resection (LAR): temporary defunctioning stoma common",
      "Abdominoperineal resection (APR): for very low tumours — permanent colostomy",
      "Hartmann's procedure: left-sided obstruction/perforation",
      "Transanal TME (TaTME): improved access for obese/narrow pelvis patients",
      "HIPEC: for peritoneal metastases (selected centres)",
    ],
  },
  {
    heading: "Multimodal & Palliative Management",
    bullets: [
      "Neoadjuvant chemoradiotherapy (long course) or short-course RT: rectal cancer (downsizing)",
      "Adjuvant chemotherapy: FOLFOX/CAPOX for stage III (and high-risk II)",
      "Biologic agents: bevacizumab (anti-VEGF), cetuximab/panitumumab (RAS wild-type)",
      "Immunotherapy: pembrolizumab for MSI-H/dMMR tumours",
      "Colorectal stenting: bridge to surgery in obstructing CRC",
      "Liver resection: for resectable hepatic metastases (30–40% 5-year survival)",
      "MDT: mandatory preoperative + postoperative discussion",
      "5-year survival: Stage I 90–95%, Stage III 40–60%, Stage IV 5–10%",
    ],
  },
]);

// ═══════════════════════════════════════════════════════════════════════════════
//  5. INFLAMMATORY BOWEL DISEASE
// ═══════════════════════════════════════════════════════════════════════════════
sectionHeader("5. Inflammatory Bowel Disease (IBD)", "Crohn's Disease & Ulcerative Colitis — chronic idiopathic gut inflammation");

contentSlide("IBD — Clinical Features & Diagnosis", [
  {
    heading: "Ulcerative Colitis (UC)",
    bullets: [
      "Continuous mucosal inflammation from rectum proximally",
      "Bloody diarrhoea — cardinal symptom",
      "Urgency, tenesmus, mucus in stool",
      "Abdominal cramps, crampy left-sided pain",
      "Fever, weight loss in severe attacks",
      "Toxic megacolon: fever, tachycardia, abdominal distension (emergency)",
      "Extra-intestinal: primary sclerosing cholangitis (UC-specific), iritis, erythema nodosum, pyoderma gangrenosum, arthropathy",
      "Truelove & Witts criteria: mild/moderate/severe UC",
    ],
  },
  {
    heading: "Crohn's Disease (CD)",
    bullets: [
      "Transmural, skip-lesion inflammation; any GI segment",
      "Most common: terminal ileum + right colon (ileocolic)",
      "Abdominal pain (RIF), diarrhoea (may be non-bloody)",
      "Weight loss, malnutrition, malabsorption",
      "Perianal disease: fissures, fistulae, abscesses",
      "Strictures → partial/complete small bowel obstruction",
      "Entero-enteric, entero-vesical, entero-vaginal fistulae",
      "Mouth ulcers, cobblestoning on endoscopy, skip lesions, transmural granulomas",
    ],
  },
  {
    heading: "Investigations",
    bullets: [
      "Bloods: FBC (anaemia, leukocytosis), CRP/ESR, albumin, LFTs, B12",
      "Stool: MC&S, C. difficile, faecal calprotectin (inflammatory marker)",
      "Colonoscopy + biopsies: key diagnostic tool; assess extent/severity",
      "Small bowel MRI (MRE): Crohn's small bowel disease",
      "CT abdomen/pelvis: complications (abscess, perforation, obstruction)",
      "Capsule endoscopy: small bowel Crohn's (ensure no stricture first)",
      "ASCA (Crohn's), p-ANCA (UC): limited diagnostic utility",
      "Plain AXR: in severe/acute UC — assess for dilatation, perforation",
    ],
  },
]);

contentSlide("IBD — Medical & Surgical Treatment", [
  {
    heading: "Medical Treatment",
    bullets: [
      "UC induction: 5-ASA (mesalazine) oral+topical for mild-moderate",
      "Severe UC: IV hydrocortisone (inpatient); ciclosporin/infliximab rescue",
      "UC maintenance: 5-ASA; azathioprine/mercaptopurine",
      "CD induction: prednisolone; budesonide for ileocolic CD",
      "Biologics: infliximab, adalimumab (anti-TNF) for moderate-severe CD & UC",
      "Vedolizumab (anti-α4β7): gut-selective biologic",
      "Ustekinumab (anti-IL12/23): CD maintenance",
      "Exclusive enteral nutrition (EEN): CD remission induction in children",
    ],
  },
  {
    heading: "Surgical Treatment — UC",
    bullets: [
      "Indications: acute severe UC not responding to medical therapy, toxic megacolon, perforation, haemorrhage, dysplasia/cancer, chronic refractory disease",
      "Emergency: subtotal colectomy + end ileostomy (safest in acutely ill)",
      "Elective: restorative proctocolectomy + IPAA (ileal pouch-anal anastomosis) — gold standard",
      "Pouch construction: J-pouch, S-pouch or W-pouch",
      "Defunctioning loop ileostomy routinely used; closed 8–12 weeks later",
      "Proctocolectomy + permanent ileostomy: if poor sphincter function, elderly, or pouch failure",
    ],
  },
  {
    heading: "Surgical Treatment — Crohn's",
    bullets: [
      "Surgery does not cure Crohn's — 70–80% require surgery in lifetime",
      "Principle: bowel-conserving surgery (strictureplasty preferred over resection)",
      "Ileocaecal resection: most common — for terminal ileal disease",
      "Strictureplasty (Finney/Heineke-Mikulicz): for short/multiple strictures",
      "Segmental colonic resection: for colonic disease",
      "Subtotal colectomy + IRA: selected Crohn's colitis",
      "Perianal Crohn's: examine under anaesthesia, seton drainage, fistulotomy, advancement flap",
      "Intraabdominal abscess: CT-guided drainage first, then elective resection",
    ],
  },
]);

// ═══════════════════════════════════════════════════════════════════════════════
//  6. INFECTIONS OF LARGE INTESTINE
// ═══════════════════════════════════════════════════════════════════════════════
sectionHeader("6. Infections of the Large Intestine", "Bacterial, parasitic and viral causes of infectious colitis");

contentSlide("Infections of Large Intestine — Clinical Features", [
  {
    heading: "Clostridioides difficile (C. diff)",
    bullets: [
      "Gram-positive spore-forming anaerobe; toxin A + B mediated",
      "Risk factors: antibiotics (broad-spectrum), hospitalisation, PPIs, elderly, immunosuppression",
      "Mild-moderate: watery diarrhoea (>3 stools/day), crampy abdominal pain",
      "Severe: fever, leukocytosis (WBC >15×10⁹), raised creatinine",
      "Fulminant: pseudomembranous colitis, toxic megacolon, perforation, septic shock",
      "Diagnosis: stool toxin PCR/EIA; colonoscopy shows pseudomembranes",
      "Recurrent C. difficile infection: major clinical challenge",
    ],
  },
  {
    heading: "Other Infectious Causes",
    bullets: [
      "Amoebic colitis (E. histolytica): bloody mucoid diarrhoea, flask-shaped ulcers, RIF tenderness; amoebic liver abscess",
      "Campylobacter jejuni: most common bacterial gastroenteritis; bloody diarrhoea, crampy pain",
      "Salmonella: non-typhoidal; self-limiting diarrhoea, fever",
      "Shigella: dysentery — bloody mucoid diarrhoea, fever, tenesmus",
      "E. coli O157 (EHEC): haemorrhagic colitis; haemolytic-uraemic syndrome (HUS)",
      "CMV colitis: immunocompromised patients; colonoscopy shows ulcers",
      "Typhlitis/neutropenic colitis: right colon, chemotherapy patients",
    ],
  },
  {
    heading: "Diagnosis",
    bullets: [
      "Stool cultures, microscopy and sensitivity",
      "Stool PCR for C. difficile, E. coli O157, norovirus",
      "Stool ova and parasites (E. histolytica, Giardia)",
      "Serology: anti-amoebic antibodies",
      "Colonoscopy: assess mucosal pattern (pseudomembranes, ulcers, inflammation)",
      "CT abdomen: complications — perforation, abscess, megacolon",
      "FBC, CRP, U&E, LFTs (severity assessment)",
      "Blood cultures if systemic sepsis suspected",
    ],
  },
]);

contentSlide("Infections of Large Intestine — Treatment & Management", [
  {
    heading: "C. difficile Treatment",
    bullets: [
      "Discontinue offending antibiotic if possible",
      "Mild-moderate: oral vancomycin 125 mg QID × 10 days (first-line)",
      "Fidaxomicin 200 mg BD × 10 days: lower recurrence than vancomycin",
      "Severe/fulminant: oral vancomycin 500 mg QID + IV metronidazole",
      "Recurrent C. diff: bezlotoxumab (monoclonal antibody) adjunct",
      "Faecal microbiota transplantation (FMT): highly effective for recurrent C. diff",
      "Surgical: colectomy (subtotal/segmental) for toxic megacolon/perforation",
      "Infection control: hand hygiene (soap+water), contact precautions, environmental disinfection",
    ],
  },
  {
    heading: "Treatment — Other Infections",
    bullets: [
      "Amoebic colitis: metronidazole 800 mg TID × 5–10 days + luminal agent (diloxanide furoate)",
      "Amoebic liver abscess: metronidazole ± aspiration if >5 cm, no response, or left lobe",
      "Campylobacter: usually self-limiting; azithromycin if severe/immunocompromised",
      "Shigella: ciprofloxacin or azithromycin",
      "Non-typhoidal Salmonella: antibiotics if bacteraemia/severe",
      "E. coli O157: supportive (avoid antibiotics — risk of HUS); dialysis if HUS",
      "CMV colitis: ganciclovir (IV) or valganciclovir (oral)",
      "Typhlitis: broad-spectrum antibiotics, bowel rest; surgery if perforation/failed medical treatment",
    ],
  },
  {
    heading: "Surgical Indications & General Management",
    bullets: [
      "Surgery for: toxic megacolon, perforation, uncontrolled haemorrhage",
      "Fulminant C. diff: subtotal colectomy + end ileostomy (standard)",
      "Diverting loop ileostomy + colonic lavage: colostomy-sparing option (selected centres)",
      "Amoebic liver abscess: percutaneous drainage preferred over open",
      "Supportive: IV fluids, electrolyte replacement, nutritional support",
      "Barrier nursing, contact precautions for confirmed/suspected C. diff",
      "Antibiotic stewardship: restrict causative antibiotics in institutional setting",
    ],
  },
]);

// ═══════════════════════════════════════════════════════════════════════════════
//  7. VASCULAR ANOMALIES
// ═══════════════════════════════════════════════════════════════════════════════
sectionHeader("7. Vascular Anomalies of the Large Intestine", "Angiodysplasia · Colonic Ischaemia · Haemorrhoids · AVM");

contentSlide("Vascular Anomalies — Clinical Features", [
  {
    heading: "Angiodysplasia",
    bullets: [
      "Most common vascular lesion of the colon",
      "Ectatic mucosal and submucosal vessels — degenerative",
      "Predominance in right colon/caecum (elderly)",
      "Recurrent painless lower GI bleeding (fresh red blood PR)",
      "Intermittent haematochezia or chronic occult bleeding",
      "Iron-deficiency anaemia from chronic blood loss",
      "Associated with aortic stenosis (Heyde's syndrome)",
      "Associated with chronic renal failure",
    ],
  },
  {
    heading: "Colonic Ischaemia",
    bullets: [
      "Most common ischaemic GI disorder; primarily affects elderly",
      "Local hypoperfusion + reperfusion injury",
      "Watershed areas: splenic flexure (Griffiths' point), rectosigmoid junction",
      "Crampy abdominal pain over affected segment",
      "Bloody diarrhoea within 24 hours (hallmark)",
      "Peritoneal signs if transmural ischaemia/perforation",
      "Risk factors: atherosclerosis, low-flow states, aortic surgery, thrombophilia, vasculitis, cocaine",
      "CT abdomen shows bowel wall thickening, thumbprinting",
    ],
  },
  {
    heading: "Other Vascular Anomalies",
    bullets: [
      "Colonic haemangioma: rare; rectal bleeding, may be diffuse",
      "Hereditary haemorrhagic telangiectasia (HHT/Osler-Weber-Rendu): telangiectasias throughout GI tract",
      "Dieulafoy's lesion: large submucosal artery; rare in colon",
      "Haemorrhoids: internal (painless bleeding) / external (painful perianal swelling)",
      "Rectal varices: portal hypertension; massive PR bleeding",
      "Aorto-enteric fistula: post-aortic surgery, massive haemorrhage",
      "Cavernous haemangioma: large lesion, may require colectomy",
    ],
  },
]);

contentSlide("Vascular Anomalies — Treatment & Management", [
  {
    heading: "Angiodysplasia Treatment",
    bullets: [
      "Colonoscopy: first-line — argon plasma coagulation (APC), bipolar coagulation, clipping",
      "APC (argon plasma coagulation): most widely used endoscopic thermal therapy",
      "Repeat colonoscopy for recurrent lesions",
      "Angiography + transarterial embolisation: for active bleeding, failed endoscopy",
      "Somatostatin analogues (octreotide): reduce recurrence in recurrent angiodysplasia",
      "Surgical resection (right hemicolectomy): recurrent/massive uncontrolled haemorrhage",
      "Thalidomide: for HHT-related GI angiodysplasia",
      "Iron replacement for chronic anaemia; transfusion for significant haemorrhage",
    ],
  },
  {
    heading: "Colonic Ischaemia Treatment",
    bullets: [
      "Most cases self-limiting — supportive management",
      "Bowel rest (NPO), IV fluids, analgesia",
      "Broad-spectrum antibiotics for transmural ischaemia",
      "Discontinue vasopressors, NSAIDs, constipating medications",
      "Colonoscopy within 48 hours: confirms diagnosis, assesses extent",
      "Serial abdominal exams and imaging to monitor progression",
      "Surgical intervention: peritonitis, full-thickness necrosis, perforation, clinical deterioration",
      "Segmental colectomy with end-colostomy (Hartmann's) in emergency",
    ],
  },
  {
    heading: "Haemorrhoids & Other",
    bullets: [
      "Grade I–II haemorrhoids: dietary advice (fibre, fluid), rubber band ligation, injection sclerotherapy",
      "Grade III haemorrhoids: rubber band ligation, stapled haemorrhoidopexy, Doppler-guided haemorrhoidal artery ligation (DGHAL)",
      "Grade IV/thrombosed: haemorrhoidectomy (Milligan-Morgan / Ferguson)",
      "Rectal varices: portosystemic shunting, TIPS, band ligation",
      "HHT: laser/APC therapy, antifibrinolytics, bevacizumab (anti-VEGF)",
      "Colonic haemangioma: endoscopic treatment or surgical resection",
      "Postoperative colonic ischaemia (post-aortic surgery): segmental resection",
    ],
  },
]);

// ═══════════════════════════════════════════════════════════════════════════════
//  8. CONSTIPATION
// ═══════════════════════════════════════════════════════════════════════════════
sectionHeader("8. Constipation", "Functional & organic — affecting 15–20% of general population");

contentSlide("Constipation — Clinical Features & Diagnosis", [
  {
    heading: "Definition & Types",
    bullets: [
      "Rome IV: <3 spontaneous complete bowel movements/week + ≥1 of: straining, lumpy/hard stools, incomplete evacuation, anorectal obstruction, manual manoeuvres",
      "Normal transit constipation (functional constipation)",
      "Slow transit constipation: colonic dysmotility (Hinton's radiopaque marker study)",
      "Outlet/obstructive defaecation: pelvic floor dysfunction, anismus, rectocele",
      "Secondary causes: hypothyroidism, hypercalcaemia, Parkinson's, opioids, tricyclics, CCBs, antacids",
      "Hirschsprung's disease (congenital): absence of ganglion cells — neonates/adults",
    ],
  },
  {
    heading: "Clinical Features",
    bullets: [
      "Infrequent stool passage (<3/week)",
      "Hard, pellet-like stools; excessive straining",
      "Sensation of incomplete evacuation or anorectal blockage",
      "Abdominal bloating, distension, cramping",
      "Faecal impaction in elderly: paradoxical overflow diarrhoea",
      "Stercoral ulcer: pressure necrosis from impacted faeces",
      "Rectal prolapse: from chronic straining",
      "Solitary rectal ulcer syndrome: straining + rectal mucosal prolapse",
    ],
  },
  {
    heading: "Investigations",
    bullets: [
      "History: Rome IV criteria, drug history, dietary fibre intake, fluid intake",
      "Physical exam: abdominal palpation, DRE (anal tone, rectocele, faecal loading)",
      "Bloods: TFTs, calcium, FBC, CRP",
      "Plain AXR: faecal loading extent",
      "Colonic transit study (radiopaque markers): slow-transit vs outlet",
      "Anorectal physiology: anorectal manometry, balloon expulsion test",
      "Defaecating proctogram/MRI defaecography: identify structural causes (rectocele, intussusception)",
      "Colonoscopy: exclude colorectal cancer, strictures",
    ],
  },
]);

contentSlide("Constipation — Treatment & Management", [
  {
    heading: "Medical Treatment",
    bullets: [
      "Dietary: high-fibre diet (25–35 g/day), increased fluid intake",
      "Bulk-forming laxatives: ispaghula husk (psyllium), methylcellulose",
      "Osmotic laxatives: macrogol (polyethylene glycol) — first-line in adults",
      "Stimulant laxatives: senna, bisacodyl — short-term use",
      "Lactulose: osmotic; less effective than macrogol",
      "Prucalopride (5-HT4 agonist): for chronic constipation unresponsive to laxatives",
      "Linaclotide / plecanatide (guanylate cyclase-C agonist): IBS-C and chronic constipation",
      "Biofeedback therapy: first-line for outlet/obstructive defaecation (anismus)",
    ],
  },
  {
    heading: "Surgical Treatment",
    bullets: [
      "Indicated for: slow-transit constipation failing medical treatment, obstructive defaecation refractory to biofeedback",
      "Total colectomy + ileorectal anastomosis (IRA): for pan-colonic slow-transit — best surgical outcome",
      "Subtotal colectomy + caecoproctostomy: alternative",
      "Segmental colectomy: less effective; not routinely recommended",
      "Anterior rectopexy (laparoscopic): for rectal prolapse causing outlet obstruction",
      "STARR procedure (Stapled TransAnal Rectal Resection): for obstructive defaecation with internal intussusception/rectocele",
      "Sacral nerve stimulation: for idiopathic slow-transit, less invasive option",
    ],
  },
  {
    heading: "Management of Complications",
    bullets: [
      "Faecal impaction: phosphate/warm water enemas, manual disimpaction under sedation",
      "Stercoral ulcer: bowel rest, fluids, treat underlying impaction; surgery if perforated",
      "Rectal prolapse: Altemeier's procedure (perineal rectosigmoidectomy) or Delorme's procedure",
      "Hirschsprung's disease: pull-through procedure (Swenson/Soave/Duhamel)",
      "Sigmoid volvulus: flexible sigmoidoscopic decompression; elective sigmoid colectomy post-decompression",
      "Solitary rectal ulcer: biofeedback, high-fibre; rectopexy if full-thickness prolapse",
    ],
  },
]);

// ═══════════════════════════════════════════════════════════════════════════════
//  9. IRRITABLE BOWEL SYNDROME
// ═══════════════════════════════════════════════════════════════════════════════
sectionHeader("9. Irritable Bowel Syndrome (IBS)", "Chronic functional bowel disorder — 7–21% of the general population");

contentSlide("IBS — Clinical Features & Diagnosis", [
  {
    heading: "Definition & Pathophysiology",
    bullets: [
      "Chronic functional disorder: abdominal pain + altered bowel habit without structural/biochemical cause",
      "Affects 7–21% of population; female predominance (2:1)",
      "Pathophysiology: gut microbiome alteration, increased intestinal permeability, altered gut motility, visceral hypersensitivity, brain-gut axis dysregulation",
      "Post-infectious IBS: 10–30% after acute gastroenteritis",
      "Subtypes: IBS-D (diarrhoea), IBS-C (constipation), IBS-M (mixed), unsubtyped",
      "Increased gas production from altered microbiome → bowel distension",
    ],
  },
  {
    heading: "Clinical Features",
    bullets: [
      "Recurrent abdominal pain (crampy, lower abdominal, relieved by defaecation)",
      "Bloating and abdominal distension",
      "Diarrhoea and/or constipation; altered stool consistency (Bristol Stool Scale)",
      "Mucus in stool (without blood)",
      "Urgency, feeling of incomplete evacuation",
      "Symptoms worse after eating (gastrocolic reflex)",
      "Symptom exacerbation with stress/anxiety",
      "Absence of rectal bleeding, nocturnal symptoms, or constitutional symptoms (red flags)",
    ],
  },
  {
    heading: "Rome IV Criteria & Diagnosis",
    bullets: [
      "Recurrent abdominal pain ≥1 day/week (last 3 months); onset ≥6 months before diagnosis",
      "Pain related to defaecation; AND/OR change in stool frequency; AND/OR change in stool form",
      "Requires ≥2 of the 3 criteria above",
      "RED FLAGS requiring investigation: age >50, no prior CRC screening, rectal bleeding, nocturnal pain, unintentional weight loss, family history CRC/IBD, palpable mass, iron-deficiency anaemia",
      "Investigations: FBC, CRP, coeliac serology, faecal calprotectin, stool culture",
      "Colonoscopy if red flags present or diagnostic uncertainty",
      "IBS is NOT a diagnosis of exclusion under Rome IV — positive symptom-based diagnosis",
    ],
  },
]);

contentSlide("IBS — Treatment & Management", [
  {
    heading: "Dietary & Lifestyle",
    bullets: [
      "Low-FODMAP diet: highly effective — reduces fermentable carbohydrates",
      "Regular meals, avoid large meals, reduce fizzy drinks",
      "Probiotics: some evidence for symptom relief (Lactobacillus, Bifidobacterium)",
      "Soluble fibre (ispaghula): IBS-C",
      "Avoid insoluble fibre (bran) — may worsen bloating",
      "Stress management, regular exercise",
      "Cognitive Behavioural Therapy (CBT): effective for refractory IBS",
      "Gut-directed hypnotherapy: evidence-based psychological treatment",
    ],
  },
  {
    heading: "Medical Treatment",
    bullets: [
      "IBS-D: loperamide, rifaximin (non-absorbable antibiotic), alosetron (5-HT3 antagonist — women)",
      "IBS-C: macrogol, linaclotide, prucalopride (5-HT4 agonist)",
      "Antispasmodics: mebeverine, hyoscine butylbromide — for abdominal cramping",
      "Peppermint oil: smooth muscle relaxant, reduces pain/bloating",
      "Low-dose tricyclic antidepressants (amitriptyline 10–30 mg): visceral analgesia (all subtypes)",
      "SSRIs: for IBS-D and psychological comorbidity",
      "Eluxadoline (μ-opioid agonist/δ-antagonist): IBS-D",
    ],
  },
  {
    heading: "Surgery & Advanced Management",
    bullets: [
      "Surgery has NO established role in IBS — functional disorder",
      "Colectomy/resection NOT recommended (worsens outcome)",
      "Ensure differential diagnoses excluded before surgical referral: IBD, CRC, endometriosis, coeliac",
      "Neuromodulation (sacral nerve stimulation): experimental for refractory IBS",
      "FMT (faecal microbiota transplant): investigational — mixed results",
      "Multidisciplinary approach: gastroenterologist, dietitian, psychologist",
      "Patient education and reassurance: cornerstone of management",
      "Regular follow-up with symptom diary and response monitoring",
    ],
  },
]);

// ═══════════════════════════════════════════════════════════════════════════════
//  SUMMARY / CONCLUSION
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.dark }, line: { type: "none" } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.5, fill: { color: C.teal }, line: { type: "none" } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 6.5, w: "100%", h: 1.0, fill: { color: C.teal }, line: { type: "none" } });
  s.addShape(pres.ShapeType.rect, { x: 1, y: 1.15, w: 11.3, h: 0.07, fill: { color: C.gold }, line: { type: "none" } });
  s.addText("Summary", {
    x: 0, y: 0.55, w: "100%", h: 0.7,
    fontFace: FF, fontSize: 30, bold: true, color: C.white, align: "center",
  });

  const summary = [
    { num: "1", label: "Adenomatous Polyps", text: "Precancerous lesions — polypectomy (EMR/ESD); surveillance by risk stratification" },
    { num: "2", label: "FAP", text: "APC gene mutation — prophylactic proctocolectomy (IPAA preferred) by age 17–18" },
    { num: "3", label: "Lynch Syndrome", text: "MMR gene defect (MLH1/MSH2) — subtotal colectomy; aspirin reduces CRC risk (CAPP2)" },
    { num: "4", label: "Colorectal Cancer", text: "Radical resection (TME for rectum); neoadjuvant CRT; immunotherapy for MSI-H" },
    { num: "5", label: "IBD", text: "UC: IPAA; Crohn's: bowel-conserving surgery (strictureplasty/ileocaecal resection)" },
    { num: "6", label: "GI Infections", text: "C. diff: vancomycin/FMT; amoebic colitis: metronidazole; surgery for toxic complications" },
    { num: "7", label: "Vascular Anomalies", text: "Angiodysplasia: APC endoscopy; colonic ischaemia: supportive ± colectomy" },
    { num: "8", label: "Constipation", text: "Slow-transit: total colectomy + IRA; outlet: biofeedback; STARR for rectocele" },
    { num: "9", label: "IBS", text: "Low-FODMAP; antispasmodics; TCAs; no surgical role — multidisciplinary management" },
  ];

  const cols = [summary.slice(0, 5), summary.slice(5, 9)];
  const colXs = [0.35, 7.0];
  const colW = 6.4;

  cols.forEach((col, ci) => {
    col.forEach((item, ri) => {
      const y = 1.35 + ri * 1.02;
      s.addShape(pres.ShapeType.rect, {
        x: colXs[ci], y, w: colW, h: 0.9,
        fill: { color: "0A2540" },
        line: { color: C.teal, pt: 1 },
      });
      s.addShape(pres.ShapeType.rect, {
        x: colXs[ci], y, w: 0.5, h: 0.9,
        fill: { color: C.teal },
        line: { type: "none" },
      });
      s.addText(item.num, {
        x: colXs[ci], y, w: 0.5, h: 0.9,
        fontFace: FF, fontSize: 16, bold: true, color: C.white,
        align: "center", valign: "middle", margin: 0,
      });
      s.addText([
        { text: item.label + ": ", options: { bold: true, color: C.gold, fontSize: 11 } },
        { text: item.text, options: { color: C.light, fontSize: 10.5 } },
      ], {
        x: colXs[ci] + 0.55, y: y + 0.05, w: colW - 0.65, h: 0.8,
        fontFace: FF, valign: "middle", wrap: true,
      });
    });
  });

  s.addText("Sources: Bailey & Love 28e  ·  Mulholland & Greenfield 7e  ·  Schwartz's Surgery 11e  ·  Rosen's EM  ·  Yamada's Gastroenterology", {
    x: 0, y: 6.5, w: "100%", h: 0.5,
    fontFace: FF, fontSize: 9.5, color: C.white, align: "center", valign: "middle",
  });
}

// ─── WRITE FILE ────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/surgery-pptx/Large_Intestine_Surgery.pptx";
pres.writeFile({ fileName: outPath }).then(() => {
  console.log("SUCCESS:", outPath);
}).catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/surgery-pptx && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/surgery-pptx/Large_Intestine_Surgery.pptx && pyth…

Your surgery presentation is ready:

Large Intestine Surgery

Presentation · PPTX


What's inside (29 slides, 538 KB):
SectionSlidesContents
Title slide1Overview, all 9 topics listed
1. Adenomatous Polyps2Definition/types, clinical features, diagnosis + endoscopic/surgical treatment, surveillance
2. Familial Adenomatous Polyposis2APC genetics, Gardner's/Turcot's, CHRPE + IPAA vs IRA vs proctocolectomy, medical (sulindac/celecoxib)
3. Lynch Syndrome2MMR genes (MLH1/MSH2/MSH6/PMS2), Amsterdam II criteria, MSI-H + subtotal colectomy, aspirin (CAPP2), pembrolizumab
4. Colorectal Cancer2Dukes/TNM staging, adenoma-carcinoma sequence + TME, hemicolectomy, neoadjuvant CRT, FOLFOX, biologics
5. IBD2UC (bloody diarrhoea, toxic megacolon) + Crohn's (skip lesions, fistulae) + IPAA for UC, strictureplasty/ileocaecal resection for Crohn's
6. Infections of Large Intestine2C. diff, amoebic colitis, Shigella, E. coli O157 + vancomycin/FMT, metronidazole, surgical colectomy
7. Vascular Anomalies2Angiodysplasia (APC/embolisation), colonic ischaemia (supportive/colectomy), haemorrhoids
8. Constipation2Slow-transit vs outlet, Rome IV criteria + total colectomy + IRA, biofeedback, STARR, Hirschsprung pull-through
9. IBS2Rome IV criteria, subtypes, brain-gut axis + Low-FODMAP, TCAs, loperamide — NO surgical role
Summary19-point visual summary with key management takeaway for each topic
Design: Navy/teal/gold colour palette with white card columns, section divider slides, and a summary index slide. All content sourced from Bailey & Love 28e, Mulholland & Greenfield 7e, Schwartz's Surgery 11e, and Rosen's Emergency Medicine.
This is a shared conversation. Sign in to Orris to start your own chat.