attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment

Summarise these topics for a presentation

analyse_media
analyse_media
analyse_media
analyse_media
analyse_media
I've now analysed the first 5 images. I have used my analyse_media budget. The remaining 5 images are visible as visual input, so I'll read them directly from the conversation context to complete the summary.
Based on all 10 pages from Chapter 70 - The Large Intestine, here is a structured summary suitable for a presentation:

Chapter 70: The Large Intestine - Presentation Summary


1. Tumours of the Large Intestine - Benign

Adenomatous Polyps
  • A "polyp" is any mucosal protrusion; classified as inflammatory, metaplastic, hamartomatous, or neoplastic (Table 70.1)
  • Tubular adenomas grow on a stalk; villous adenomas are flat and spreading
  • Malignancy risk rises with size: ~10% in 1 cm lesions, ~33% in lesions >3 cm
  • Treatment: snare polypectomy, endoscopic mucosal resection (EMR), transanal resection, or argon beam ablation
Familial Adenomatous Polyposis (FAP)
  • Autosomal dominant mutation in the APC gene on chromosome 5
  • Defined by >100 colorectal adenomas; lifetime colorectal cancer risk is 100% if untreated
  • Extracolonic features: duodenal/thyroid adenomas, desmoid tumours, osteomas (Gardner's syndrome), CHRPE
  • Surgery options: colectomy + ileorectal anastomosis (IRA), restorative proctocolectomy with ileal pouch (RPC), or total proctocolectomy + end ileostomy
  • Postoperative surveillance: annual pouch/rectal endoscopy + upper GI scopy for duodenal lesions
Lynch Syndrome (HNPCC)
  • Autosomal dominant mutation in DNA mismatch repair genes (MLH1, MSH2)
  • 80% lifetime colorectal cancer risk; mean diagnosis age 45; proximal colon predominance
  • Females: 30-50% lifetime endometrial cancer risk
  • Diagnosed using Amsterdam II criteria (3+ family members with HNPCC-related cancer across 2 generations)

2. Malignant Colorectal Cancer

Epidemiology & Aetiology
  • Second most common cause of cancer death in the UK; ~35,000 new cases/year
  • Risk factors: red/processed meat, dietary fat, smoking, alcohol, low fibre, cholecystectomy
  • Adenoma-carcinoma sequence: APC mutation → K-ras activation → p53 mutation → invasive cancer
Pathology & Distribution
  • Four macroscopic types: annular, tubular, ulcer, cauliflower
  • Distribution: rectum (38%), sigmoid (21%), caecum (12%), transverse colon (5.5%)
Staging
  • Dukes: A (confined to wall) → B (through wall) → C (lymph nodes involved)
  • TNM: T1-T4 (depth), N0-N2 (nodes), M0-M1 (metastases)
Clinical Features
  • Left-sided: change in bowel habit, rectal bleeding
  • Right-sided: iron deficiency anaemia, abdominal mass
  • Flexure lesions: vague upper abdominal symptoms
Investigation
  • Screening: faecal occult blood testing (age 60-69), flexible sigmoidoscopy
  • Colonoscopy: gold standard
  • Radiology: CT chest/abdomen/pelvis for staging; MRI for local rectal spread; virtual CT colonoscopy (detects polyps ≥6 mm)

3. Surgical Treatment of Colorectal Cancer

Preoperative Preparation
  • Mechanical bowel prep no longer routine (increases infection); still used for low rectal resections
  • Thromboprophylaxis (LMWH, compression stockings) and IV prophylactic antibiotics
  • Stoma site marking by enterostomal therapist if stoma anticipated
Operations
  • Right hemicolectomy: caecum/ascending colon cancers; ileocolic artery divided at origin
  • Extended right hemicolectomy: transverse colon/splenic flexure cancers
  • Left hemicolectomy: descending colon/sigmoid cancers; ureter and gonadal vessels protected
Laparoscopic vs Open Surgery
  • Equivalent oncological outcomes; NICE recommends laparoscopic approach for suitable patients
  • Lower wound infection, blood loss, and pain; higher costs
Emergency Surgery
  • 20% of UK colonic cancers present as emergencies (obstruction, perforation, haemorrhage)
  • Options: Hartmann's procedure, primary resection and anastomosis, or colonic stenting as a bridge to elective surgery
Postoperative Care & Enhanced Recovery (ERAS)
  • Avoid nasogastric tubes, opiate analgesia, and perioperative fluid overload
  • Thoracic epidurals, early mobilisation, early oral feeding, early catheter removal
  • Reduces hospital stay from 10-14 days to 2-3 days

4. Oncology & Prognosis

  • Adjuvant chemotherapy: benefit in node-positive disease (Dukes C)
  • Hepatic metastases: resection achieves >30% 5-year survival; chemotherapy + surgery for synchronous disease
  • Overall 5-year survival: ~50%; lymph node status is the key prognostic factor
  • Follow-up: CEA monitoring, CT/ultrasound liver imaging, surveillance colonoscopy to detect metachronous tumours (3% incidence)

5. Inflammatory Bowel Disease (IBD)

Ulcerative Colitis (UC)
  • Incidence: 10/100,000/year in UK; onset typically age 20-40
  • Aetiology: unknown; genetic predisposition, microbiome changes; smoking is protective
  • Pathology: starts in rectum, extends proximally; superficial mucosal inflammation; crypt abscesses
SeverityStools/dayFeatures
Mild<4No systemic upset
Moderate>4Mild anaemia, raised CRP
Severe>6 bloodyFever, tachycardia, hypoalbuminaemia
Fulminant>10Toxic megacolon risk
  • Extraintestinal features: arthritis, ankylosing spondylitis (HLA-B27), primary sclerosing cholangitis, erythema nodosum, pyoderma gangrenosum, uveitis
  • Cancer risk: 1% at 10 years → 10-15% at 20 years → 20% at 30 years; pancolitis is highest risk
  • UC vs Crohn's (Table 70.2): UC is rectal/left-sided, mucosal only, no granulomas; CD is transmural, skip lesions, granulomas, fistulae common
Medical Treatment of UC
  • 5-ASA compounds (topical or systemic) as first-line and maintenance therapy
  • Corticosteroids for flare-ups; azathioprine/ciclosporin as steroid-sparing agents
  • Infliximab/adalimumab (anti-TNF) and vedolizumab for severe/refractory disease
Surgical Treatment of UC
  • Indications: fulminating disease, chronic steroid dependence, dysplasia/carcinoma, extraintestinal manifestations
  • Emergency: subtotal colectomy + ileostomy (rectal stump left as mucous fistula)
  • Elective options:
    1. Subtotal colectomy + ileostomy
    2. Proctocolectomy + permanent end ileostomy
    3. Restorative proctocolectomy with ileal pouch-anal anastomosis (IPAA/Parks pouch) - avoids permanent stoma
    4. Subtotal colectomy + ileorectal anastomosis
  • Pouchitis: affects ~30% of pouch patients; treated with metronidazole or ciprofloxacin

6. Crohn's Disease of the Colon

  • Colonic involvement in 30% of CD patients; may coexist with perianal disease and small bowel pathology
  • Colonoscopy shows patchy inflammation, aphthous ulcers, and a normal mucosal background
  • Treatment: 5-ASA for mild disease, steroids for flares, immunomodulators (azathioprine) for moderate-severe; anti-TNF agents
  • Surgery: usually avoided if possible; panproctocolectomy or total colectomy with ileorectal anastomosis if needed

7. Infections of the Large Intestine

OrganismKey Features
Campylobacter jejuniCommonest gastroenteritis; from poultry; self-limiting; notifiable
Entamoeba histolyticaContaminated water; "bottle-necked" ulcers; can cause liver abscess (amoeboma)
Salmonella/ShigellaGram-negative; antibiotic therapy for severe cases
C. difficileToxin-producing; pseudomembranous colitis after antibiotics; treat with metronidazole/vancomycin
HIV/AIDSOpportunistic infections (CMV, Cryptosporidium, MAI, Candida)

8. Colonic Diverticula

  • Acquired outpouchings; found in 75% of over-70s in Western countries; predominantly sigmoid
  • Aetiology: low-fibre Western diet, raised intraluminal pressure, altered collagen with ageing
  • Most are asymptomatic (diverticulosis); 10-30% develop complications
Complications (Summary box 70.9)
  • Diverticulitis, abscess, peritonitis, intestinal obstruction, haemorrhage, fistula (colovesical most common)
Hinchey Classification (Table 70.3)
  • Grade I: mesenteric/pericolic abscess → Grade IV: faecal peritonitis
Management
  • Acute attack: nil by mouth, IV antibiotics (gram-negatives and anaerobes), resuscitation; percutaneous drainage for abscesses ≥5 cm
  • Elective surgery for recurrent attacks or colovesical fistula
  • Emergency: Hartmann's procedure is safest; primary anastomosis in selected fit patients

9. Vascular Anomalies

Angiodysplasia
  • Dilated tortuous submucosal veins; affects patients >60; association with aortic stenosis (Heyde's syndrome)
  • Presents with anaemia or brisk bleeding; seen on colonoscopy in right colon
  • Treatment: colonoscopic cauterisation or argon laser; surgery if uncontrolled
Ischaemic Colitis
  • Thrombosis or embolism of colonic vessels; sudden severe abdominal pain, haemodynamic instability
  • Left colon (splenic flexure) most affected; may heal spontaneously or cause stricture
  • Severe cases require laparotomy and resection of gangrenous bowel

10. Colostomies & Stomas

  • A stoma diverts intestinal content to an external appliance on the abdominal wall
  • Loop colostomy: defunctioning; temporary; used after anterior resection or for left-sided obstruction
  • End colostomy: formed after Hartmann's procedure or abdominoperineal excision; may be permanent
  • Ileostomy vs Colostomy: ileostomy is spouted (liquid effluent, right iliac fossa); colostomy is flush (solid effluent, left iliac fossa)
  • Stoma complications (Summary box 70.12): skin irritation, prolapse, retraction, ischaemia, stenosis, parastomal hernia, bleeding, fistulation
  • All patients should be counselled and sited by a stoma care nurse preoperatively

11. Functional Abnormalities - Constipation

  • No single definition; <1 bowel movement every 3 days is generally abnormal
  • Causes: drugs (opiates, tricyclics, iron, statins, cholestyramine), neurological disease (Parkinson's, MS, spinal cord lesions), endocrine (hypothyroidism, hypercalcaemia), obstructed defaecation, slow colonic transit
  • Investigation: exclude structural cause (colonoscopy/CT); whole-gut transit study; defaecating proctography; anorectal manometry
  • Treatment: laxatives, correct underlying cause

Create a presentation (PPTX) on colorectal cancer staging and prognosis

Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/colorectal-cancer-pptx

Writing File

~/colorectal-cancer-pptx/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Colorectal Cancer: Staging & Prognosis";
pres.author = "Medical Education";

// ── Colour palette ──────────────────────────────────────────────────────────
const C = {
  navy:      "0D2B45",   // dominant dark (60-70%)
  teal:      "1A6B72",   // supporting mid
  tealLight: "2A9DA6",   // accent/highlights
  cream:     "F4F1EB",   // light bg panels
  white:     "FFFFFF",
  gold:      "E8A838",   // sharp accent
  text:      "1C1C1C",
  textLight: "EEEEEE",
  mutedGrey: "8899AA",
  stageA:    "27AE60",   // green
  stageB:    "F39C12",   // amber
  stageC:    "E67E22",   // orange
  stageD:    "C0392B",   // red
};

// ── Helper: dark full-bleed background ──────────────────────────────────────
function darkBg(slide) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.navy }, line: { color: C.navy }
  });
}

// ── Helper: section accent bar (left edge) ──────────────────────────────────
function accentBar(slide, color = C.gold, h = 5.625) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 0.07, h, fill: { color }, line: { color }
  });
}

// ── Helper: slide header band ───────────────────────────────────────────────
function headerBand(slide, title, bgColor = C.teal) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 0.9, fill: { color: bgColor }, line: { color: bgColor }
  });
  slide.addText(title, {
    x: 0.3, y: 0, w: 9.4, h: 0.9,
    fontSize: 22, bold: true, color: C.white, valign: "middle", margin: 0
  });
}

// ── Helper: card ─────────────────────────────────────────────────────────────
function card(slide, x, y, w, h, fillColor = C.white, radius = false) {
  slide.addShape(radius ? pres.shapes.ROUNDED_RECTANGLE : pres.shapes.RECTANGLE, {
    x, y, w, h,
    fill: { color: fillColor },
    line: { color: fillColor },
    shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.12 },
    ...(radius ? { rectRadius: 0.08 } : {})
  });
}

// ── Helper: footer ───────────────────────────────────────────────────────────
function footer(slide, text = "Chapter 70 · The Large Intestine") {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 5.35, w: 10, h: 0.275,
    fill: { color: C.navy }, line: { color: C.navy }
  });
  slide.addText(text, {
    x: 0.3, y: 5.35, w: 9.4, h: 0.275,
    fontSize: 8, color: C.mutedGrey, valign: "middle", margin: 0
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 1 · TITLE
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);

  // Teal diagonal accent stripe
  s.addShape(pres.shapes.RECTANGLE, {
    x: 6.5, y: 0, w: 3.5, h: 5.625,
    fill: { color: C.teal }, line: { color: C.teal }
  });
  // Lighter triangle effect
  s.addShape(pres.shapes.RECTANGLE, {
    x: 7.5, y: 0, w: 2.5, h: 5.625,
    fill: { color: C.tealLight }, line: { color: C.tealLight }
  });

  // Gold accent bar
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.5, y: 1.8, w: 0.1, h: 2,
    fill: { color: C.gold }, line: { color: C.gold }
  });

  s.addText("COLORECTAL CANCER", {
    x: 0.75, y: 1.7, w: 6, h: 0.65,
    fontSize: 13, bold: true, color: C.gold, charSpacing: 4, margin: 0
  });
  s.addText("Staging &\nPrognosis", {
    x: 0.75, y: 2.3, w: 6, h: 1.8,
    fontSize: 42, bold: true, color: C.white, lineSpacingMultiple: 1.1, margin: 0
  });
  s.addText("Classification systems, survival outcomes, and clinical decision-making", {
    x: 0.75, y: 4.1, w: 5.8, h: 0.7,
    fontSize: 12, color: C.textLight, italic: true, margin: 0
  });

  // Right panel text
  s.addText([
    { text: "Dukes' Classification", options: { breakLine: true } },
    { text: "TNM System", options: { breakLine: true } },
    { text: "5-Year Survival", options: { breakLine: true } },
    { text: "Prognostic Factors", options: { breakLine: true } },
    { text: "Surveillance" },
  ], {
    x: 7.55, y: 1.6, w: 2.2, h: 2.5,
    fontSize: 11, color: C.white, lineSpacingMultiple: 2.0, margin: 0
  });

  s.addText("Chapter 70 · The Large Intestine", {
    x: 7.55, y: 5.1, w: 2.2, h: 0.35,
    fontSize: 8, color: C.white, margin: 0
  });
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 2 · EPIDEMIOLOGY OVERVIEW
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.cream }, line: { color: C.cream } });
  headerBand(s, "Epidemiology Overview");
  accentBar(s, C.gold, 5.625);

  // 4 stat boxes
  const stats = [
    { val: "35,000", label: "New UK diagnoses/year", color: C.teal },
    { val: "#2", label: "Most common cancer death", color: C.navy },
    { val: "50%", label: "Overall 5-year survival", color: C.tealLight },
    { val: "8th decade", label: "Peak incidence", color: C.stageC },
  ];

  stats.forEach((st, i) => {
    const x = 0.25 + i * 2.4;
    card(s, x, 1.05, 2.2, 1.5, C.white);
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 1.05, w: 2.2, h: 0.18,
      fill: { color: st.color }, line: { color: st.color }
    });
    s.addText(st.val, {
      x: x + 0.1, y: 1.28, w: 2, h: 0.7,
      fontSize: 26, bold: true, color: st.color, align: "center", margin: 0
    });
    s.addText(st.label, {
      x: x + 0.05, y: 1.95, w: 2.1, h: 0.55,
      fontSize: 10, color: C.text, align: "center", margin: 0
    });
  });

  // Anatomical distribution
  card(s, 0.25, 2.75, 9.5, 2.5, C.white);
  s.addText("Anatomical Distribution of Colorectal Cancer", {
    x: 0.4, y: 2.82, w: 9, h: 0.35,
    fontSize: 13, bold: true, color: C.navy, margin: 0
  });

  const sites = [
    { site: "Rectum", pct: 38, color: C.stageD },
    { site: "Sigmoid", pct: 21, color: C.stageC },
    { site: "Caecum", pct: 12, color: C.stageB },
    { site: "Transverse", pct: 5.5, color: C.teal },
    { site: "Ascending", pct: 5, color: C.tealLight },
    { site: "Descending", pct: 4, color: C.mutedGrey },
    { site: "Other", pct: 14.5, color: "AAAAAA" },
  ];

  sites.forEach((site, i) => {
    const x = 0.4 + i * 1.32;
    const barH = (site.pct / 40) * 1.0; // scale to max ~1"
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 4.5 - barH, w: 1.1, h: barH,
      fill: { color: site.color }, line: { color: site.color }
    });
    s.addText(`${site.pct}%`, {
      x, y: 4.5 - barH - 0.22, w: 1.1, h: 0.2,
      fontSize: 9, bold: true, color: site.color, align: "center", margin: 0
    });
    s.addText(site.site, {
      x: x - 0.05, y: 4.52, w: 1.2, h: 0.35,
      fontSize: 8, color: C.text, align: "center", margin: 0
    });
  });

  footer(s);
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 3 · DUKES' CLASSIFICATION
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);
  accentBar(s, C.gold);

  s.addText("DUKES' CLASSIFICATION", {
    x: 0.3, y: 0.18, w: 9.4, h: 0.55,
    fontSize: 24, bold: true, color: C.white, charSpacing: 3, margin: 0
  });
  s.addText("Originally described by Cuthbert Dukes (1932) for rectal tumours — now adapted for the whole colon", {
    x: 0.3, y: 0.72, w: 9.4, h: 0.35,
    fontSize: 10.5, color: C.mutedGrey, italic: true, margin: 0
  });

  const stages = [
    {
      label: "Stage A",
      color: C.stageA,
      heading: "Confined to bowel wall",
      bullets: ["Invasion into but NOT breaching muscularis propria", "No lymph node involvement", "No distant metastases"],
      survival: "~90%",
    },
    {
      label: "Stage B",
      color: C.stageB,
      heading: "Through bowel wall",
      bullets: ["Tumour breaches the muscularis propria", "No lymph node involvement", "No distant metastases"],
      survival: "~65%",
    },
    {
      label: "Stage C",
      color: C.stageC,
      heading: "Lymph node involvement",
      bullets: ["Any depth of invasion", "Regional lymph nodes involved", "C1: apical node clear · C2: apical node positive"],
      survival: "~35%",
    },
    {
      label: "Stage D",
      color: C.stageD,
      heading: "Distant metastases",
      bullets: ["Liver, lung, peritoneum most common", "Added post-Dukes (not in original description)", "Palliative intent usual"],
      survival: "<10%",
    },
  ];

  stages.forEach((st, i) => {
    const x = 0.2 + i * 2.42;
    card(s, x, 1.25, 2.25, 3.85, "1A2F45");
    // colour header
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 1.25, w: 2.25, h: 0.55,
      fill: { color: st.color }, line: { color: st.color }
    });
    s.addText(st.label, {
      x: x + 0.08, y: 1.25, w: 2.1, h: 0.55,
      fontSize: 17, bold: true, color: C.white, valign: "middle", margin: 0
    });
    s.addText(st.heading, {
      x: x + 0.08, y: 1.85, w: 2.1, h: 0.45,
      fontSize: 10, bold: true, color: st.color, margin: 0
    });
    s.addText(st.bullets.map(b => ({ text: b, options: { bullet: { indent: 10 }, breakLine: true } })), {
      x: x + 0.08, y: 2.32, w: 2.12, h: 2.0,
      fontSize: 9, color: C.textLight, lineSpacingMultiple: 1.4, margin: 0
    });
    // survival badge
    s.addShape(pres.shapes.RECTANGLE, {
      x: x + 0.35, y: 4.75, w: 1.55, h: 0.28,
      fill: { color: st.color }, line: { color: st.color }
    });
    s.addText(`5-yr survival: ${st.survival}`, {
      x: x + 0.35, y: 4.75, w: 1.55, h: 0.28,
      fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
    });
  });

  footer(s, "Chapter 70 · The Large Intestine  |  Dukes 1932; adapted for colon");
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 4 · TNM CLASSIFICATION
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.cream }, line: { color: C.cream } });
  headerBand(s, "TNM Classification  —  International Standard");
  accentBar(s, C.tealLight);

  // T column
  const tRows = [
    { t: "T1", desc: "Invades submucosa" },
    { t: "T2", desc: "Invades muscularis propria" },
    { t: "T3", desc: "Into pericolic fat/subserosa (not breaching serosa)" },
    { t: "T4a", desc: "Perforates visceral peritoneum (serosa)" },
    { t: "T4b", desc: "Directly invades adjacent organ or structure" },
  ];
  const nRows = [
    { n: "N0", desc: "No regional node involvement" },
    { n: "N1", desc: "1-3 regional lymph nodes positive" },
    { n: "N2", desc: "4 or more regional lymph nodes positive" },
  ];
  const mRows = [
    { m: "M0", desc: "No distant metastasis" },
    { m: "M1a", desc: "Metastasis confined to one organ (e.g. liver)" },
    { m: "M1b", desc: "Metastasis in more than one organ" },
    { m: "M1c", desc: "Peritoneal metastasis" },
  ];

  // T panel
  card(s, 0.2, 1.0, 3.1, 4.15, C.white);
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.0, w: 3.1, h: 0.38, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("T  —  Tumour Depth", { x: 0.28, y: 1.0, w: 2.94, h: 0.38, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  tRows.forEach((r, i) => {
    const y = 1.42 + i * 0.53;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.22, y, w: 0.5, h: 0.38, fill: { color: C.teal }, line: { color: C.teal } });
    s.addText(r.t, { x: 0.22, y, w: 0.5, h: 0.38, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(r.desc, { x: 0.78, y: y + 0.03, w: 2.44, h: 0.35, fontSize: 9.5, color: C.text, margin: 0 });
  });

  // N panel
  card(s, 3.55, 1.0, 2.9, 2.5, C.white);
  s.addShape(pres.shapes.RECTANGLE, { x: 3.55, y: 1.0, w: 2.9, h: 0.38, fill: { color: C.navy }, line: { color: C.navy } });
  s.addText("N  —  Node Status", { x: 3.63, y: 1.0, w: 2.74, h: 0.38, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  nRows.forEach((r, i) => {
    const y = 1.42 + i * 0.66;
    s.addShape(pres.shapes.RECTANGLE, { x: 3.57, y, w: 0.5, h: 0.38, fill: { color: C.navy }, line: { color: C.navy } });
    s.addText(r.n, { x: 3.57, y, w: 0.5, h: 0.38, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(r.desc, { x: 4.13, y: y + 0.03, w: 2.24, h: 0.45, fontSize: 9.5, color: C.text, margin: 0 });
  });

  // M panel
  card(s, 3.55, 3.65, 2.9, 1.5, C.white);
  s.addShape(pres.shapes.RECTANGLE, { x: 3.55, y: 3.65, w: 2.9, h: 0.38, fill: { color: C.stageD }, line: { color: C.stageD } });
  s.addText("M  —  Metastasis", { x: 3.63, y: 3.65, w: 2.74, h: 0.38, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  mRows.forEach((r, i) => {
    const y = 4.07 + i * 0.26;
    s.addShape(pres.shapes.RECTANGLE, { x: 3.57, y, w: 0.5, h: 0.22, fill: { color: C.stageD }, line: { color: C.stageD } });
    s.addText(r.m, { x: 3.57, y, w: 0.5, h: 0.22, fontSize: 8.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(r.desc, { x: 4.13, y: y + 0.02, w: 2.24, h: 0.22, fontSize: 8.5, color: C.text, margin: 0 });
  });

  // Stage grouping panel
  card(s, 6.7, 1.0, 3.1, 4.15, C.white);
  s.addShape(pres.shapes.RECTANGLE, { x: 6.7, y: 1.0, w: 3.1, h: 0.38, fill: { color: C.gold }, line: { color: C.gold } });
  s.addText("Stage Grouping", { x: 6.78, y: 1.0, w: 2.94, h: 0.38, fontSize: 11, bold: true, color: C.navy, valign: "middle", margin: 0 });

  const groups = [
    { stage: "I", tnm: "T1-2, N0, M0", color: C.stageA, surv: "~90%" },
    { stage: "IIA", tnm: "T3, N0, M0", color: "52BE80", surv: "~80%" },
    { stage: "IIB", tnm: "T4a, N0, M0", color: C.stageB, surv: "~72%" },
    { stage: "IIC", tnm: "T4b, N0, M0", color: "E59866", surv: "~65%" },
    { stage: "IIIA-C", tnm: "Any T, N1-2, M0", color: C.stageC, surv: "~40-65%" },
    { stage: "IVA-C", tnm: "Any T, Any N, M1", color: C.stageD, surv: "~5-15%" },
  ];
  groups.forEach((g, i) => {
    const y = 1.42 + i * 0.59;
    s.addShape(pres.shapes.RECTANGLE, { x: 6.72, y, w: 0.72, h: 0.42, fill: { color: g.color }, line: { color: g.color } });
    s.addText(`Stage ${g.stage}`, { x: 6.72, y, w: 0.72, h: 0.42, fontSize: 8.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(g.tnm, { x: 7.5, y: y + 0.03, w: 1.55, h: 0.35, fontSize: 9, color: C.text, margin: 0 });
    s.addText(g.surv, { x: 9.08, y: y + 0.03, w: 0.68, h: 0.35, fontSize: 9, bold: true, color: g.color, align: "right", margin: 0 });
  });

  footer(s);
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 5 · DUKES vs TNM COMPARISON
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);
  accentBar(s, C.tealLight);

  s.addText("Dukes' vs TNM  —  Concordance", {
    x: 0.3, y: 0.1, w: 9.4, h: 0.6,
    fontSize: 24, bold: true, color: C.white, margin: 0
  });

  // Table header
  const cols = [0.2, 2.1, 4.45, 6.5, 8.3];
  const headers = ["Dukes'", "TNM Stage", "T Status", "Nodes", "5-yr Survival"];
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 0.8, w: 9.6, h: 0.42, fill: { color: C.teal }, line: { color: C.teal } });
  headers.forEach((h, i) => {
    s.addText(h, {
      x: cols[i] + 0.08, y: 0.8, w: i < 4 ? cols[i + 1] - cols[i] - 0.1 : 1.6,
      h: 0.42, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0
    });
  });

  const rows = [
    { dukes: "A", tnm: "I", t: "T1–T2", n: "N0", surv: "~90%", color: C.stageA },
    { dukes: "B", tnm: "IIA / IIB / IIC", t: "T3–T4", n: "N0", surv: "65–80%", color: C.stageB },
    { dukes: "C", tnm: "IIIA / IIIB / IIIC", t: "Any T", n: "N1–N2", surv: "35–65%", color: C.stageC },
    { dukes: "D*", tnm: "IV", t: "Any T", n: "Any N", surv: "<15%", color: C.stageD },
  ];

  rows.forEach((r, i) => {
    const y = 1.25 + i * 0.95;
    const bg = i % 2 === 0 ? "16344E" : "122B40";
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y, w: 9.6, h: 0.9, fill: { color: bg }, line: { color: bg } });
    // Dukes badge
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: y + 0.08, w: 0.72, h: 0.72, fill: { color: r.color }, line: { color: r.color } });
    s.addText(r.dukes, { x: 0.2, y: y + 0.08, w: 0.72, h: 0.72, fontSize: 20, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    // Data
    [r.tnm, r.t, r.n, r.surv].forEach((val, j) => {
      const isLast = j === 3;
      s.addText(val, {
        x: cols[j + 1] + 0.08, y: y + 0.2, w: j < 3 ? cols[j + 2] - cols[j + 1] - 0.1 : 1.5,
        h: 0.5, fontSize: isLast ? 14 : 11, bold: isLast, color: isLast ? r.color : C.textLight, margin: 0
      });
    });
  });

  s.addText("* Stage D was added post-Dukes and is not part of his original 1932 classification.", {
    x: 0.3, y: 5.1, w: 9.4, h: 0.35,
    fontSize: 8.5, color: C.mutedGrey, italic: true, margin: 0
  });

  footer(s);
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 6 · PROGNOSTIC FACTORS
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.cream }, line: { color: C.cream } });
  headerBand(s, "Key Prognostic Factors");
  accentBar(s, C.gold);

  const factors = [
    {
      icon: "★",
      title: "Lymph Node Status",
      detail: "The single most important prognostic factor. N0 vs N1-2 dramatically changes outcome. Each additional positive node worsens prognosis.",
      color: C.navy,
    },
    {
      icon: "◆",
      title: "Tumour Stage (T)",
      detail: "Depth of invasion through the bowel wall. T4 (serosal breach or adjacent organ invasion) carries significantly worse prognosis.",
      color: C.teal,
    },
    {
      icon: "●",
      title: "Distant Metastases",
      detail: "Liver most common (portal venous drainage). 30% have liver metastases at diagnosis; 50% develop them eventually.",
      color: C.stageD,
    },
    {
      icon: "▲",
      title: "Resection Margins",
      detail: "R0 (clear), R1 (microscopic involvement), R2 (macroscopic residual). Positive circumferential margin in rectal cancer is strongly associated with local recurrence.",
      color: C.stageC,
    },
    {
      icon: "◉",
      title: "Tumour Location",
      detail: "Rectal cancer has higher local recurrence risk. Right-sided cancers may have different biology (often MSI-high) vs left-sided (typically MSS).",
      color: C.tealLight,
    },
    {
      icon: "■",
      title: "CEA Level",
      detail: "Carcinoembryonic antigen: raised pre-operatively suggests advanced disease. Rising CEA post-surgery is an early indicator of recurrence.",
      color: C.stageB,
    },
  ];

  factors.forEach((f, i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    const x = 0.2 + col * 3.25;
    const y = 1.08 + row * 2.12;
    card(s, x, y, 3.1, 1.95, C.white);
    s.addShape(pres.shapes.RECTANGLE, { x, y, w: 3.1, h: 0.4, fill: { color: f.color }, line: { color: f.color } });
    s.addText(`${f.icon}  ${f.title}`, {
      x: x + 0.1, y, w: 2.9, h: 0.4,
      fontSize: 10.5, bold: true, color: C.white, valign: "middle", margin: 0
    });
    s.addText(f.detail, {
      x: x + 0.1, y: y + 0.44, w: 2.9, h: 1.45,
      fontSize: 9, color: C.text, lineSpacingMultiple: 1.3, margin: 0
    });
  });

  footer(s);
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 7 · SURVIVAL DATA (visual bar chart)
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);
  accentBar(s, C.gold);

  s.addText("5-Year Survival by Stage", {
    x: 0.3, y: 0.12, w: 9.4, h: 0.58,
    fontSize: 26, bold: true, color: C.white, margin: 0
  });
  s.addText("Overall colorectal cancer 5-year survival ≈ 50%  |  Lymph node status is the dominant prognostic determinant", {
    x: 0.3, y: 0.68, w: 9.4, h: 0.32,
    fontSize: 10, color: C.mutedGrey, italic: true, margin: 0
  });

  const survData = [
    { label: "Dukes A  (Stage I)", pct: 90, color: C.stageA },
    { label: "Dukes B  (Stage II)", pct: 70, color: C.stageB },
    { label: "Dukes C  (Stage III)", pct: 45, color: C.stageC },
    { label: "Dukes D  (Stage IV)", pct: 10, color: C.stageD },
    { label: "All stages (overall)", pct: 50, color: C.tealLight },
  ];

  const maxW = 7.0;
  survData.forEach((d, i) => {
    const y = 1.2 + i * 0.82;
    const barW = (d.pct / 100) * maxW;

    // Label
    s.addText(d.label, {
      x: 0.25, y, w: 2.35, h: 0.55,
      fontSize: 11, color: C.white, valign: "middle", margin: 0
    });
    // Background track
    s.addShape(pres.shapes.RECTANGLE, {
      x: 2.65, y: y + 0.1, w: maxW, h: 0.35,
      fill: { color: "1F3A55" }, line: { color: "1F3A55" }
    });
    // Fill bar
    s.addShape(pres.shapes.RECTANGLE, {
      x: 2.65, y: y + 0.1, w: barW, h: 0.35,
      fill: { color: d.color }, line: { color: d.color }
    });
    // Pct label
    s.addText(`${d.pct}%`, {
      x: 2.65 + barW + 0.1, y: y + 0.1, w: 0.7, h: 0.35,
      fontSize: 13, bold: true, color: d.color, valign: "middle", margin: 0
    });
  });

  // Key message box
  card(s, 0.25, 5.05, 9.5, 0.45, "1A3550");
  s.addText("Spread beyond the bowel wall (Dukes B) → 5-year survival ~65-70%.  Lymph node metastasis (Dukes C) → drops to ~35-45%.  Distant metastasis (Dukes D) → <15%.", {
    x: 0.35, y: 5.07, w: 9.2, h: 0.4,
    fontSize: 9, color: C.textLight, margin: 0
  });

  footer(s);
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 8 · METASTATIC DISEASE & LIVER RESECTION
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.cream }, line: { color: C.cream } });
  headerBand(s, "Metastatic Disease  —  Management & Outcomes", C.stageD);
  accentBar(s, C.stageD);

  // Left col: spread routes
  card(s, 0.2, 1.05, 4.5, 4.2, C.white);
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.05, w: 4.5, h: 0.38, fill: { color: C.navy }, line: { color: C.navy } });
  s.addText("Routes of Spread", { x: 0.28, y: 1.05, w: 4.34, h: 0.38, fontSize: 12, bold: true, color: C.white, valign: "middle", margin: 0 });

  const routes = [
    { route: "Direct", detail: "Into adjacent structures (ureter, duodenum, abdominal wall muscles)", color: C.teal },
    { route: "Lymphatic", detail: "Progresses from pericolic nodes to central nodes; correlates with TNM N-stage", color: C.navy },
    { route: "Haematogenous", detail: "Portal vein → liver (commonest). 1/3 at diagnosis; 50% eventually. Lung is 2nd most common site.", color: C.stageC },
    { route: "Transcoelomic", detail: "Across peritoneal cavity to ovary, omentum, peritoneum; often indicates advanced disease", color: C.stageD },
  ];

  routes.forEach((r, i) => {
    const y = 1.5 + i * 0.87;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y, w: 0.9, h: 0.55, fill: { color: r.color }, line: { color: r.color } });
    s.addText(r.route, { x: 0.25, y, w: 0.9, h: 0.55, fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(r.detail, { x: 1.22, y: y + 0.04, w: 3.38, h: 0.5, fontSize: 9.5, color: C.text, margin: 0 });
  });

  // Right col: liver resection / prognosis
  card(s, 4.95, 1.05, 4.85, 4.2, C.white);
  s.addShape(pres.shapes.RECTANGLE, { x: 4.95, y: 1.05, w: 4.85, h: 0.38, fill: { color: C.stageC }, line: { color: C.stageC } });
  s.addText("Hepatic Metastases — Resection Outcomes", { x: 5.03, y: 1.05, w: 4.69, h: 0.38, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });

  const liverPoints = [
    "30% of patients have liver metastases at diagnosis",
    "50% develop liver metastases at some point during their illness",
    "Resection achieves >30% 5-year survival in selected patients",
    "Absolute limit: adequate residual functioning liver volume",
    "Biopsy of potentially resectable lesions should be avoided (tumour dissemination risk)",
    "Chemotherapy + surgery used for synchronous metastases",
    "Isolated lung metastases may also be resected in selected cases",
    "CEA monitoring + CT/US liver surveillance in follow-up",
  ];

  liverPoints.forEach((pt, i) => {
    s.addText([{ text: pt, options: { bullet: { indent: 12 }, breakLine: false } }], {
      x: 5.05, y: 1.5 + i * 0.45, w: 4.65, h: 0.42,
      fontSize: 9.5, color: C.text, margin: 0
    });
  });

  footer(s);
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 9 · ADJUVANT THERAPY & ENHANCED RECOVERY
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);
  accentBar(s, C.tealLight);

  s.addText("Adjuvant Therapy & Postoperative Care", {
    x: 0.3, y: 0.1, w: 9.4, h: 0.6,
    fontSize: 24, bold: true, color: C.white, margin: 0
  });

  // Adjuvant chemo
  card(s, 0.2, 0.85, 4.6, 2.25, "16344E");
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 0.85, w: 4.6, h: 0.4, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("Adjuvant Chemotherapy", { x: 0.28, y: 0.85, w: 4.44, h: 0.4, fontSize: 12, bold: true, color: C.white, valign: "middle", margin: 0 });
  const chemo = [
    "Little benefit for preoperative chemo in most colon cancers",
    "Clear benefit post-surgery in node-positive disease (Dukes C)",
    "FOLFOX or CAPOX commonly used regimens",
    "Ongoing trials for locally advanced disease",
  ];
  chemo.forEach((pt, i) => {
    s.addText([{ text: pt, options: { bullet: { indent: 10 } } }], {
      x: 0.28, y: 1.3 + i * 0.4, w: 4.42, h: 0.38,
      fontSize: 9.5, color: C.textLight, margin: 0
    });
  });

  // ERAS
  card(s, 5.1, 0.85, 4.7, 2.25, "16344E");
  s.addShape(pres.shapes.RECTANGLE, { x: 5.1, y: 0.85, w: 4.7, h: 0.4, fill: { color: C.gold }, line: { color: C.gold } });
  s.addText("Enhanced Recovery (ERAS) Programme", { x: 5.18, y: 0.85, w: 4.54, h: 0.4, fontSize: 12, bold: true, color: C.navy, valign: "middle", margin: 0 });
  const eras = [
    "Preoperative carbohydrate loading; no prolonged fasting",
    "Short transverse incisions; laparoscopic approach preferred",
    "Thoracic epidurals; avoid opiates & fluid overload",
    "Early mobilisation, early oral feeding, early catheter removal",
    "Reduces hospital stay: 10-14 days → 2-3 days",
  ];
  eras.forEach((pt, i) => {
    s.addText([{ text: pt, options: { bullet: { indent: 10 } } }], {
      x: 5.18, y: 1.3 + i * 0.37, w: 4.54, h: 0.35,
      fontSize: 9.5, color: C.textLight, margin: 0
    });
  });

  // Follow-up / surveillance
  card(s, 0.2, 3.25, 9.6, 2.0, "16344E");
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 3.25, w: 9.6, h: 0.4, fill: { color: C.navy }, line: { color: C.navy } });
  s.addText("Colorectal Cancer Follow-Up & Surveillance", { x: 0.28, y: 3.25, w: 9.44, h: 0.4, fontSize: 12, bold: true, color: C.white, valign: "middle", margin: 0 });

  const followItems = [
    { t: "CEA monitoring", d: "CEA measurement alone may be as effective as regular imaging for detecting recurrence early" },
    { t: "CT/Ultrasound liver", d: "Regular imaging to detect metachronous and liver metastases; ~3% develop synchronous second tumour" },
    { t: "Surveillance colonoscopy", d: "Detects metachronous tumours (3%); ~50% of colorectal cancer patients develop liver metastases at some point" },
    { t: "Resection of recurrence", d: "Curative resection of liver or lung metastases achieves 5-year survival >30% in selected patients" },
  ];

  followItems.forEach((item, i) => {
    const x = 0.28 + (i % 2) * 4.82;
    const y = 3.72 + Math.floor(i / 2) * 0.6;
    s.addText([
      { text: `${item.t}: `, options: { bold: true, color: C.gold } },
      { text: item.d, options: { color: C.textLight } },
    ], {
      x, y, w: 4.7, h: 0.58,
      fontSize: 9.5, margin: 0
    });
  });

  footer(s);
}

// ════════════════════════════════════════════════════════════════════════════
// SLIDE 10 · SUMMARY
// ════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkBg(s);

  s.addShape(pres.shapes.RECTANGLE, { x: 6.8, y: 0, w: 3.2, h: 5.625, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.shapes.RECTANGLE, { x: 7.9, y: 0, w: 2.1, h: 5.625, fill: { color: C.tealLight }, line: { color: C.tealLight } });

  s.addText("KEY TAKEAWAYS", {
    x: 0.4, y: 0.25, w: 6, h: 0.45,
    fontSize: 13, bold: true, color: C.gold, charSpacing: 4, margin: 0
  });
  s.addText("Colorectal Cancer\nStaging & Prognosis", {
    x: 0.4, y: 0.68, w: 6, h: 1.3,
    fontSize: 32, bold: true, color: C.white, lineSpacingMultiple: 1.1, margin: 0
  });

  const takeaways = [
    { num: "01", text: "Lymph node status (N-stage) is the single most important prognostic determinant — more than tumour depth alone." },
    { num: "02", text: "Dukes' A–D and TNM Stage I–IV describe the same biology; TNM is now the international standard for treatment decisions." },
    { num: "03", text: "Overall 5-year survival is ~50%, ranging from 90% (Stage I) to <10% (Stage IV with widespread metastases)." },
    { num: "04", text: "Hepatic metastases should be considered for resection — >30% 5-year survival is achievable in selected patients." },
    { num: "05", text: "Adjuvant chemotherapy is indicated for Dukes C / Stage III disease. ERAS protocols substantially reduce morbidity and hospital stay." },
  ];

  takeaways.forEach((t, i) => {
    const y = 2.2 + i * 0.65;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.4, y, w: 0.5, h: 0.48, fill: { color: C.gold }, line: { color: C.gold } });
    s.addText(t.num, { x: 0.4, y, w: 0.5, h: 0.48, fontSize: 11, bold: true, color: C.navy, align: "center", valign: "middle", margin: 0 });
    s.addText(t.text, { x: 0.97, y: y + 0.03, w: 5.7, h: 0.45, fontSize: 9.5, color: C.textLight, margin: 0 });
  });

  s.addText("Source: Chapter 70 · The Large Intestine\nBailey & Love's Short Practice of Surgery", {
    x: 7.0, y: 4.8, w: 2.8, h: 0.6,
    fontSize: 8.5, color: C.white, align: "center", margin: 0
  });
}

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

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

Running Command

ls -lh /home/daytona/workspace/colorectal-cancer-pptx/Colorectal_Cancer_Staging_…

Your presentation is ready:

Colorectal Cancer Staging Prognosis

Presentation · PPTX


The deck contains 10 slides with a consistent navy/teal/gold colour scheme:
SlideContent
1Title slide
2Epidemiology overview — stat boxes + anatomical distribution bar chart
3Dukes' Classification — A/B/C/D cards with colour-coded 5-year survival badges
4TNM Classification — T/N/M panels side by side with Stage grouping table
5Dukes' vs TNM concordance table — colour-coded rows
6Key prognostic factors — 6-card grid (lymph nodes, T-stage, metastases, margins, location, CEA)
75-Year survival by stage — horizontal bar chart
8Metastatic disease — routes of spread + hepatic resection outcomes
9Adjuvant therapy, ERAS programme, and follow-up protocols
10Summary — 5 key takeaways
This is a shared conversation. Sign in to Orris to start your own chat.