Carcinoma colon risk factors pathogenesis cilincalbfeactute diagnois and treatment
"colorectal cancer"[MeSH Terms] AND "treatment"[MeSH Terms]
"colorectal neoplasms"[MeSH Terms] AND "risk factors"[MeSH Terms]
| Factor | Details |
|---|---|
| Age | Peak incidence after age 50; risk rises with age |
| Family history | 1st-degree relative with CRC doubles risk |
| FAP (Familial Adenomatous Polyposis) | APC gene mutation (chr 5q); lifetime CRC risk approaches 100% by age 50 |
| Lynch syndrome (HNPCC) | Mismatch repair (MMR) gene mutations (MLH1, MSH2, etc.); 70-80% lifetime risk |
| Inflammatory bowel disease | Both ulcerative colitis and Crohn's disease increase risk |
| Prior colorectal polyps or cancer | Adenomatous polyps are precursors |
| Factor | Details |
|---|---|
| Red/processed meat | Haem iron and N-nitroso compounds are carcinogenic |
| Low dietary fibre | Longer mucosal exposure to dietary carcinogens |
| Obesity and sedentary lifestyle | Increased risk |
| Smoking and alcohol | Both independently increase risk |
| Cholecystectomy | Marginally increases risk of right-sided colon cancer |
| Pathway | Early Events | Progressive Events | Clinical Notes |
|---|---|---|---|
| APC / Chromosomal Instability | APC gene mutation (somatic or inherited) | KRAS mutation → P53 mutation → DCC mutation | Conventional adenoma-to-carcinoma sequence (most common) |
| MMR / Microsatellite Instability | MMR gene mutation (inherited in Lynch, sporadic methylation) | KRAS, PIK3CA mutations | HNPCC/Lynch syndrome; sporadic right-sided tumours |
| CpG Island Methylator (CIMP/Serrated) | BRAF V600E mutation + MMR promoter methylation | Epigenetic silencing of tumour suppressor genes | Serrated adenoma-associated carcinoma |
| Right-sided colon (caecum, ascending) | Left-sided colon (sigmoid, descending) |
|---|---|
| Occult blood loss → iron-deficiency anaemia | Change in bowel habit (constipation / loose stools) |
| Vague abdominal discomfort | Rectal bleeding (bright red or dark) |
| Palpable right iliac fossa mass | Tenesmus |
| Constitutional: weight loss, fatigue | Colicky abdominal pain |
| Often presents late (large lumen) | Bowel obstruction (smaller lumen) |
| Stage | Description |
|---|---|
| A | Limited to bowel wall |
| B | Through bowel wall, no nodes |
| C | Lymph node involvement |
| D | Distant metastases |
| T | Description |
|---|---|
| Tis | Carcinoma in situ (intramucosal) |
| T1 | Invades submucosa |
| T2 | Invades muscularis propria |
| T3 | Through muscularis propria into pericolorectal tissues |
| T4a | Invades visceral peritoneum |
| T4b | Invades/adheres to adjacent organs |
| N | Description |
|---|---|
| N0 | No nodes |
| N1 | 1-3 positive regional nodes |
| N2 | ≥4 positive regional nodes |
| M | Description |
|---|---|
| M0 | No distant metastases |
| M1a | One distant site/organ |
| M1b | Two or more distant sites/organs |
| M1c | Peritoneal metastases |
| Stage | Recommendation |
|---|---|
| Stage I | Surgery alone; no adjuvant chemo |
| Stage II (low risk) | Surgery alone (controversial; consider if high-risk features) |
| Stage II (high risk) | Consider FOLFOX or capecitabine (high-risk features: T4, perforation, <12 nodes, PNI, LVI) |
| Stage III | FOLFOX (oxaliplatin + 5-FU + leucovorin) or CAPOX x 6 months - standard of care |
| Stage IV | Systemic chemotherapy +/- targeted therapy |
| Agent | Target | Indication |
|---|---|---|
| Bevacizumab (Avastin) | Anti-VEGF | Metastatic CRC, with chemo |
| Cetuximab (Erbitux) | Anti-EGFR (monoclonal Ab) | Metastatic CRC - RAS wild type only |
| Panitumumab | Anti-EGFR (monoclonal Ab) | Metastatic CRC - RAS wild type only |
| Pembrolizumab / Nivolumab | Anti-PD-1 (immune checkpoint) | MSI-H / dMMR metastatic CRC |
| Encorafenib + cetuximab | BRAF V600E + EGFR | BRAF V600E mutant metastatic CRC |
Critical: KRAS/NRAS mutation = resistance to anti-EGFR agents; these must be tested before prescribing cetuximab or panitumumab.
| Aspect | Key Points |
|---|---|
| Commonest type | Adenocarcinoma (>95%) |
| Precursor | Adenomatous polyp (adenoma-carcinoma sequence) |
| Key gene | APC (early), KRAS (intermediate), p53 (late) |
| Presentation | Right: anaemia; Left: bleeding/obstruction |
| Staging | TNM / Dukes' |
| Curative treatment | Surgery (hemicolectomy) |
| Stage III adjuvant | FOLFOX chemotherapy |
| Metastatic targeted | Anti-EGFR only if RAS wild-type; anti-PD1 if MSI-H |
Make a presentation comparing surgical approaches for different CRC locations
ls /home/daytona/workspace/ 2>/dev/null && echo "---" && ls /home/daytona/skills/pptx/
mkdir -p /home/daytona/workspace/crc-surgery-ppt && echo "dir ready"
~/crc-surgery-ppt/build.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// Fetch the colon diagram image
const images = JSON.parse(execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js "https://cdn.orris.care/cdss_images/7de8c917a6f368adeac60eb1b0e87aa3e02dd9d40562d39396aa8bdea122668c.png"`
).toString());
const colonImg = images[0] && !images[0].error ? images[0].base64 : null;
// ─── PALETTE ───────────────────────────────────────────────────────
const DARK_BG = "0D1F2D"; // deep navy – dominant
const MID_BG = "152535"; // slightly lighter navy
const ACCENT1 = "E84855"; // surgical red
const ACCENT2 = "3ABEFF"; // clinical blue
const ACCENT3 = "F4A261"; // warm amber
const ACCENT4 = "2EC4B6"; // teal
const WHITE = "FFFFFF";
const LIGHT = "D6E4F0";
const GREY = "8BA5BC";
const CARD_BG = "1A3045";
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" × 7.5"
pres.title = "Surgical Approaches for CRC by Location";
pres.author = "Orris Medical";
// ─── HELPER: section label bar ─────────────────────────────────────
function addTopBar(slide, color, label) {
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.55, fill: { color } });
slide.addText(label, {
x: 0.3, y: 0, w: 12.7, h: 0.55,
fontSize: 13, bold: true, color: WHITE, valign: "middle", margin: 0
});
}
function addFooter(slide) {
slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 7.22, w: 13.3, h: 0.28, fill: { color: "0A1620" } });
slide.addText("Sources: Schwartz's Principles of Surgery 11th Ed. | Bailey & Love 28th Ed. | Yamada's Gastroenterology 7th Ed.", {
x: 0.3, y: 7.22, w: 12.7, h: 0.28,
fontSize: 7.5, color: GREY, valign: "middle", margin: 0
});
}
function addSlideBg(slide) {
slide.background = { color: DARK_BG };
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 1 – TITLE
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
// Red accent block left
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.35, h: 7.5, fill: { color: ACCENT1 } });
// Title
s.addText("Surgical Approaches in", {
x: 0.7, y: 1.5, w: 8.5, h: 0.9,
fontSize: 36, bold: true, color: WHITE, fontFace: "Calibri"
});
s.addText("Colorectal Carcinoma", {
x: 0.7, y: 2.35, w: 8.5, h: 0.9,
fontSize: 36, bold: true, color: ACCENT1, fontFace: "Calibri"
});
s.addText("by Tumour Location", {
x: 0.7, y: 3.2, w: 8.5, h: 0.7,
fontSize: 28, bold: false, color: LIGHT, fontFace: "Calibri"
});
// Divider
s.addShape(pres.shapes.RECTANGLE, { x: 0.7, y: 4.0, w: 5.5, h: 0.05, fill: { color: ACCENT2 } });
// Subtitle info
s.addText([
{ text: "Surgical principles | Extent of resection | Vascular ligation | Anastomosis", options: { color: GREY, fontSize: 13 } }
], { x: 0.7, y: 4.2, w: 9, h: 0.5 });
// Colon image on right
if (colonImg) {
s.addImage({ data: colonImg, x: 9.2, y: 0.5, w: 3.8, h: 6.0 });
}
s.addText("Based on Schwartz's, Bailey & Love, and Yamada's Gastroenterology", {
x: 0.7, y: 7.1, w: 9, h: 0.3, fontSize: 9, color: GREY
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 2 – OVERVIEW: CRC LOCATIONS AND PROCEDURES (TABLE)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addSlideBg(s);
addTopBar(s, ACCENT1, "OVERVIEW | Tumour Location → Surgical Procedure");
addFooter(s);
// Table header
const cols = [
{ label: "Tumour Location", w: 2.8, x: 0.15 },
{ label: "Operation", w: 2.9, x: 3.05 },
{ label: "Vessels Ligated", w: 3.3, x: 6.05 },
{ label: "Anastomosis", w: 3.6, x: 9.45 }
];
const hdrY = 0.65;
cols.forEach(c => {
s.addShape(pres.shapes.RECTANGLE, { x: c.x, y: hdrY, w: c.w, h: 0.42, fill: { color: "1D3F5C" } });
s.addText(c.label, {
x: c.x + 0.08, y: hdrY, w: c.w - 0.1, h: 0.42,
fontSize: 11, bold: true, color: ACCENT2, valign: "middle", margin: 0
});
});
const rows = [
["Caecum / Terminal ileum", "Ileocaecectomy", "Ileocolic artery", "Ileum → ascending colon"],
["Caecum + Ascending colon", "Right Hemicolectomy", "Ileocolic + right colic arteries", "Ileum → transverse colon"],
["Hepatic flexure / proximal transverse", "Extended Right Hemicolectomy", "Above + right branch of middle colic", "Ileum → mid transverse colon"],
["Mid/distal transverse colon", "Transverse Colectomy", "Middle colic artery", "Ascending → descending colon"],
["Splenic flexure / distal transverse", "Extended Left Hemicolectomy", "Left colic + right br. middle colic", "Transverse → sigmoid colon"],
["Descending colon", "Left Hemicolectomy", "Left colic artery (IMA branch)", "Transverse → sigmoid colon"],
["Sigmoid colon", "Sigmoid Colectomy", "Sigmoid branches of IMA", "Descending colon → upper rectum"],
["Multiple / FAP / IBD", "Total / Subtotal Colectomy", "All colic vessels; preserve superior rectal", "Ileum → sigmoid or upper rectum"],
];
rows.forEach((row, i) => {
const rowY = 1.15 + i * 0.68;
const bg = i % 2 === 0 ? CARD_BG : MID_BG;
const rowData = [
{ val: row[0], x: 0.15, w: 2.8, color: WHITE, bold: true },
{ val: row[1], x: 3.05, w: 2.9, color: ACCENT3, bold: false },
{ val: row[2], x: 6.05, w: 3.3, color: LIGHT, bold: false },
{ val: row[3], x: 9.45, w: 3.6, color: ACCENT4, bold: false },
];
rowData.forEach(cell => {
s.addShape(pres.shapes.RECTANGLE, { x: cell.x, y: rowY, w: cell.w, h: 0.62, fill: { color: bg } });
s.addText(cell.val, {
x: cell.x + 0.1, y: rowY + 0.04, w: cell.w - 0.15, h: 0.58,
fontSize: 10, bold: cell.bold, color: cell.color, valign: "middle", wrap: true, margin: 0
});
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 3 – RIGHT COLON (with diagram)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addSlideBg(s);
addTopBar(s, ACCENT3, "RIGHT-SIDED CRC | Caecum · Ascending Colon · Hepatic Flexure");
addFooter(s);
// Colon diagram
if (colonImg) {
s.addImage({ data: colonImg, x: 7.3, y: 0.65, w: 5.6, h: 6.25 });
// Overlay label for right hemicolectomy area
s.addShape(pres.shapes.RECTANGLE, {
x: 7.3, y: 6.55, w: 5.6, h: 0.35,
fill: { color: "0A1620" }
});
s.addText("Fig: Resection types A→F (right hemicolectomy outlined)", {
x: 7.35, y: 6.57, w: 5.5, h: 0.3,
fontSize: 8, color: GREY, italic: true, margin: 0
});
}
// Operation cards
const ops = [
{
title: "Ileocaecectomy",
loc: "Caecum / terminal ileum",
vessels: "Ileocolic artery",
anastomosis: "Ileum → ascending colon",
nodes: "Requires ≥12 lymph nodes",
color: ACCENT3
},
{
title: "Right Hemicolectomy",
loc: "Caecum + ascending colon",
vessels: "Ileocolic + right colic arteries",
anastomosis: "Ileum → transverse colon",
nodes: "Standard for right colon CRC",
color: ACCENT1
},
{
title: "Extended Right Hemicolectomy",
loc: "Hepatic flexure / proximal transverse",
vessels: "Above + right br. middle colic artery",
anastomosis: "Ileum → mid-transverse colon",
nodes: "Splenic flexure mobilisation if needed",
color: ACCENT2
}
];
ops.forEach((op, i) => {
const cardY = 0.65 + i * 2.05;
s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: cardY, w: 6.9, h: 1.9, fill: { color: CARD_BG }, shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.2 } });
// colour accent strip
s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: cardY, w: 0.2, h: 1.9, fill: { color: op.color } });
// title
s.addText(op.title, { x: 0.5, y: cardY + 0.07, w: 6.5, h: 0.38, fontSize: 14, bold: true, color: op.color, margin: 0 });
const details = [
{ text: "Location: ", options: { bold: true, color: LIGHT } },
{ text: op.loc + "\n", options: { color: LIGHT } },
{ text: "Vessels: ", options: { bold: true, color: GREY } },
{ text: op.vessels + "\n", options: { color: GREY } },
{ text: "Anastomosis: ", options: { bold: true, color: ACCENT4 } },
{ text: op.anastomosis + "\n", options: { color: ACCENT4 } },
{ text: "Note: ", options: { bold: true, color: ACCENT3 } },
{ text: op.nodes, options: { color: ACCENT3 } },
];
s.addText(details, { x: 0.5, y: cardY + 0.48, w: 6.5, h: 1.32, fontSize: 10.5, valign: "top", margin: 0, wrap: true });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 4 – LEFT COLON
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addSlideBg(s);
addTopBar(s, ACCENT2, "LEFT-SIDED CRC | Transverse · Splenic Flexure · Descending · Sigmoid");
addFooter(s);
if (colonImg) {
s.addImage({ data: colonImg, x: 7.3, y: 0.65, w: 5.6, h: 6.25 });
s.addShape(pres.shapes.RECTANGLE, { x: 7.3, y: 6.55, w: 5.6, h: 0.35, fill: { color: "0A1620" } });
s.addText("Fig: Resection types G→K (left hemicolectomy, sigmoid)", {
x: 7.35, y: 6.57, w: 5.5, h: 0.3, fontSize: 8, color: GREY, italic: true, margin: 0
});
}
const ops = [
{
title: "Transverse Colectomy",
loc: "Mid/distal transverse colon",
vessels: "Middle colic artery",
anastomosis: "Ascending colon → descending colon",
note: "Hepatic + splenic flexure mobilisation required",
color: ACCENT3
},
{
title: "Left Hemicolectomy",
loc: "Descending colon",
vessels: "Left colic artery (IMA branch)",
anastomosis: "Transverse colon → sigmoid colon",
note: "Splenic flexure mobilised for tension-free anastomosis",
color: ACCENT2
},
{
title: "Sigmoid Colectomy",
loc: "Sigmoid colon",
vessels: "Sigmoid branches of inferior mesenteric artery",
anastomosis: "Descending colon → upper rectum",
note: "Full mobilisation of splenic flexure often needed",
color: ACCENT4
}
];
ops.forEach((op, i) => {
const cardY = 0.65 + i * 2.05;
s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: cardY, w: 6.9, h: 1.9, fill: { color: CARD_BG }, shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.2 } });
s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: cardY, w: 0.2, h: 1.9, fill: { color: op.color } });
s.addText(op.title, { x: 0.5, y: cardY + 0.07, w: 6.5, h: 0.38, fontSize: 14, bold: true, color: op.color, margin: 0 });
const details = [
{ text: "Location: ", options: { bold: true, color: LIGHT } },
{ text: op.loc + "\n", options: { color: LIGHT } },
{ text: "Vessels: ", options: { bold: true, color: GREY } },
{ text: op.vessels + "\n", options: { color: GREY } },
{ text: "Anastomosis: ", options: { bold: true, color: ACCENT4 } },
{ text: op.anastomosis + "\n", options: { color: ACCENT4 } },
{ text: "Note: ", options: { bold: true, color: ACCENT3 } },
{ text: op.note, options: { color: ACCENT3 } },
];
s.addText(details, { x: 0.5, y: cardY + 0.48, w: 6.5, h: 1.32, fontSize: 10.5, valign: "top", margin: 0, wrap: true });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 5 – RECTAL CANCER
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addSlideBg(s);
addTopBar(s, ACCENT1, "RECTAL CANCER | Upper · Mid · Low Rectum");
addFooter(s);
// Key principle banner
s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: 0.65, w: 13.0, h: 0.52, fill: { color: "1D3F5C" } });
s.addText("Total Mesorectal Excision (TME) is the oncological cornerstone for all rectal cancer surgery — ensures complete removal of node-bearing mesorectum", {
x: 0.3, y: 0.65, w: 12.7, h: 0.52,
fontSize: 11, bold: true, color: ACCENT3, valign: "middle", margin: 0
});
const rops = [
{
title: "Local Excision / TEM",
subtitle: "Transanal Endoscopic Microsurgery",
loc: "T1 tumours, <3 cm, well-differentiated, no LVI/PNI",
detail: "Transanal endoscopic approach\nNegative 2 mm margins required\n15% recurrence risk (higher in T2/T3)\nFollow-up colonoscopy at 3 months",
color: ACCENT4
},
{
title: "Anterior Resection (AR / LAR)",
subtitle: "Low/Ultra-low Anterior Resection",
loc: "Upper rectum (>12 cm) and mid rectum (5–12 cm) with sphincter preservation",
detail: "Sphincter-sparing; maintains anal continence\nTotal mesorectal excision (TME)\nCircumferential resection margin (CRM) assessed by MRI\nColorectal or coloanal anastomosis",
color: ACCENT2
},
{
title: "Abdominoperineal Resection (APR)",
subtitle: "Miles' Operation",
loc: "Low rectum when negative distal margins cannot be achieved",
detail: "Removes entire rectum, anal canal, and sphincter complex\nPermanent end colostomy\nIndicated when LAR not possible\nHigher morbidity; perineal wound complications",
color: ACCENT1
},
{
title: "Hartmann's Procedure",
subtitle: "Emergency / High Risk",
loc: "Obstructing / perforated left colon or rectal cancer; frail patients",
detail: "Sigmoid / rectal resection without anastomosis\nEnd colostomy + Hartmann's pouch (rectal stump)\nReversal possible (2nd stage) in fit patients\nReduces anastomotic leak risk in emergency",
color: ACCENT3
}
];
rops.forEach((op, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const cx = 0.15 + col * 6.6;
const cy = 1.3 + row * 2.95;
s.addShape(pres.shapes.RECTANGLE, { x: cx, y: cy, w: 6.4, h: 2.75, fill: { color: CARD_BG }, shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.2 } });
s.addShape(pres.shapes.RECTANGLE, { x: cx, y: cy, w: 6.4, h: 0.55, fill: { color: op.color } });
s.addText(op.title, { x: cx + 0.1, y: cy + 0.04, w: 6.2, h: 0.28, fontSize: 13, bold: true, color: WHITE, margin: 0 });
s.addText(op.subtitle, { x: cx + 0.1, y: cy + 0.3, w: 6.2, h: 0.22, fontSize: 9, italic: true, color: "rgba(255,255,255,0.8)", margin: 0, color: "E0E0E0" });
s.addText([
{ text: "Indication: ", options: { bold: true, color: ACCENT3 } },
{ text: op.loc + "\n", options: { color: LIGHT } },
], { x: cx + 0.1, y: cy + 0.6, w: 6.2, h: 0.45, fontSize: 10, wrap: true, margin: 0 });
s.addText(op.detail, {
x: cx + 0.1, y: cy + 1.05, w: 6.2, h: 1.6,
fontSize: 10, color: GREY, wrap: true, valign: "top", margin: 0
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 6 – SPECIAL CASES (Total Colectomy, Laparoscopic vs Open)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addSlideBg(s);
addTopBar(s, ACCENT4, "SPECIAL CASES | Total Colectomy · Laparoscopic vs Open");
addFooter(s);
// LEFT COLUMN: Total / Subtotal Colectomy
s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: 0.65, w: 6.3, h: 0.4, fill: { color: ACCENT4 } });
s.addText("Total / Subtotal Colectomy", { x: 0.25, y: 0.65, w: 6.1, h: 0.4, fontSize: 13, bold: true, color: WHITE, valign: "middle", margin: 0 });
const totalItems = [
{ head: "Indications", text: "FAP (attenuated or classic)\nLynch syndrome / IBD-related CRC\nSynchronous colon carcinomas\nFulminant colitis" },
{ head: "Vessels ligated", text: "All colic vessels (ileocolic, right colic, middle colic, left colic)\nSuperior rectal vessels preserved" },
{ head: "Anastomosis options", text: "Ileum → sigmoid (subtotal, ileosigmoid)\nIleum → upper rectum (total abdominal colectomy + IRA)\nEnd ileostomy + Hartmann's pouch if anastomosis contraindicated" },
{ head: "IPAA (Restorative Proctocolectomy)", text: "Entire colon + rectum removed; ileal pouch-anal anastomosis\nPreserves anal function\nPreferred for FAP; 50% risk of minor incontinence" },
];
totalItems.forEach((item, i) => {
const iy = 1.15 + i * 1.45;
s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: iy, w: 6.3, h: 1.35, fill: { color: CARD_BG } });
s.addText(item.head, { x: 0.3, y: iy + 0.04, w: 6.0, h: 0.3, fontSize: 11, bold: true, color: ACCENT4, margin: 0 });
s.addText(item.text, { x: 0.3, y: iy + 0.35, w: 6.0, h: 0.9, fontSize: 9.5, color: LIGHT, wrap: true, valign: "top", margin: 0 });
});
// RIGHT COLUMN: Laparoscopic vs Open
s.addShape(pres.shapes.RECTANGLE, { x: 6.85, y: 0.65, w: 6.3, h: 0.4, fill: { color: ACCENT2 } });
s.addText("Laparoscopic vs Open Approach", { x: 6.95, y: 0.65, w: 6.1, h: 0.4, fontSize: 13, bold: true, color: WHITE, valign: "middle", margin: 0 });
// comparison table
const compRows = [
["Aspect", "Laparoscopic", "Open"],
["Recovery", "Faster (shorter LOS)", "Longer hospital stay"],
["Oncological outcome", "Equivalent to open", "Equivalent"],
["Complications", "Lower wound complications","Higher wound morbidity"],
["Conversion rate", "5–10% (to open)", "N/A"],
["Preferred when", "Elective, non-perforated", "Adjacent organ invasion, perforation"],
["Standard?", "Yes – elective CRC", "Emergency / complex cases"],
];
compRows.forEach((row, i) => {
const ry = 1.15 + i * 0.77;
const bg = i === 0 ? "1D3F5C" : (i % 2 === 0 ? CARD_BG : MID_BG);
const textColor = i === 0 ? ACCENT2 : LIGHT;
const boldFlag = i === 0;
[row[0], row[1], row[2]].forEach((cell, ci) => {
const cx2 = 6.85 + ci * 2.1;
const cw = ci === 0 ? 2.1 : 2.1;
s.addShape(pres.shapes.RECTANGLE, { x: cx2, y: ry, w: cw, h: 0.7, fill: { color: bg } });
s.addText(cell, { x: cx2 + 0.07, y: ry + 0.04, w: cw - 0.1, h: 0.62, fontSize: 9.5, bold: boldFlag, color: i === 0 ? ACCENT2 : (ci === 1 ? ACCENT4 : (ci === 2 ? ACCENT3 : LIGHT)), valign: "middle", wrap: true, margin: 0 });
});
});
// Key quality metric note
s.addShape(pres.shapes.RECTANGLE, { x: 6.85, y: 6.65, w: 6.3, h: 0.5, fill: { color: "1D3F5C" } });
s.addText("Quality standard: Minimum 12 lymph nodes must be examined at resection (ACSS / ASCO / NCCN)", {
x: 6.95, y: 6.65, w: 6.1, h: 0.5, fontSize: 10, bold: true, color: ACCENT3, valign: "middle", wrap: true, margin: 0
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 7 – SURGICAL PRINCIPLES (GENERAL)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
addSlideBg(s);
addTopBar(s, ACCENT3, "GENERAL SURGICAL PRINCIPLES | Applicable to All CRC Resections");
addFooter(s);
const principles = [
{ icon: "01", title: "Adequate Margins", body: "Wide resection of tumour with clear proximal and distal margins. No tumour at cut end ensures R0 resection.", color: ACCENT1 },
{ icon: "02", title: "En Bloc Lymphadenectomy", body: "Minimum 12 regional lymph nodes must be harvested and examined. More nodes = more accurate staging = better treatment selection.", color: ACCENT2 },
{ icon: "03", title: "High Vascular Ligation", body: "Vessels ligated at their origin to maximise lymph node yield along the vascular pedicle (central vascular ligation).", color: ACCENT3 },
{ icon: "04", title: "Total Mesorectal Excision (TME)", body: "Mandatory for rectal cancer. Sharp dissection in avascular plane surrounding the mesorectum. Reduces local recurrence from ~25% to <5%.", color: ACCENT4 },
{ icon: "05", title: "Tension-free Anastomosis", body: "Adequate mobilisation (e.g., splenic flexure) to prevent anastomotic leak. Stapled or hand-sewn depending on location and surgeon preference.", color: ACCENT1 },
{ icon: "06", title: "Endoscopic Options", body: "Carcinoma in polyp (T1, well-diff, no LVI): endoscopic resection ± ESD acceptable. 2 mm negative margins + follow-up colonoscopy at 3 months.", color: ACCENT2 },
];
principles.forEach((p, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const cx = 0.15 + col * 4.37;
const cy = 0.65 + row * 3.1;
s.addShape(pres.shapes.RECTANGLE, { x: cx, y: cy, w: 4.15, h: 2.95, fill: { color: CARD_BG }, shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.18 } });
// top colour bar
s.addShape(pres.shapes.RECTANGLE, { x: cx, y: cy, w: 4.15, h: 0.12, fill: { color: p.color } });
// number badge
s.addShape(pres.shapes.ELLIPSE, { x: cx + 0.15, y: cy + 0.2, w: 0.48, h: 0.48, fill: { color: p.color } });
s.addText(p.icon, { x: cx + 0.15, y: cy + 0.2, w: 0.48, h: 0.48, fontSize: 13, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
// title
s.addText(p.title, { x: cx + 0.75, y: cy + 0.22, w: 3.3, h: 0.48, fontSize: 13, bold: true, color: p.color, valign: "middle", margin: 0 });
// body
s.addText(p.body, { x: cx + 0.15, y: cy + 0.8, w: 3.85, h: 2.0, fontSize: 10.5, color: LIGHT, wrap: true, valign: "top", margin: 0 });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 8 – SUMMARY QUICK-REFERENCE
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.55, fill: { color: ACCENT1 } });
s.addText("QUICK REFERENCE | CRC Location → Operation at a Glance", {
x: 0.3, y: 0, w: 12.7, h: 0.55, fontSize: 13, bold: true, color: WHITE, valign: "middle", margin: 0
});
// Visual horizontal flow
const zones = [
{ label: "Caecum", op: "Ileocaecectomy", color: ACCENT1 },
{ label: "Ascending", op: "Right Hemi-colectomy", color: ACCENT1 },
{ label: "Hepatic Flexure", op: "Extended Right Hemi-colectomy", color: ACCENT3 },
{ label: "Transverse", op: "Transverse Colectomy", color: ACCENT3 },
{ label: "Splenic Flexure", op: "Extended Left Hemi-colectomy", color: ACCENT2 },
{ label: "Descending", op: "Left Hemi-colectomy", color: ACCENT2 },
{ label: "Sigmoid", op: "Sigmoid Colectomy", color: ACCENT4 },
{ label: "Rectum", op: "AR / APR + TME", color: ACCENT4 },
];
zones.forEach((z, i) => {
const bx = 0.15 + i * 1.62;
// top location block
s.addShape(pres.shapes.RECTANGLE, { x: bx, y: 0.65, w: 1.5, h: 0.52, fill: { color: z.color } });
s.addText(z.label, { x: bx, y: 0.65, w: 1.5, h: 0.52, fontSize: 9.5, bold: true, color: WHITE, align: "center", valign: "middle", margin: 0 });
// arrow down
s.addText("▼", { x: bx, y: 1.2, w: 1.5, h: 0.3, fontSize: 12, color: z.color, align: "center", margin: 0 });
// operation block
s.addShape(pres.shapes.RECTANGLE, { x: bx, y: 1.5, w: 1.5, h: 0.95, fill: { color: CARD_BG } });
s.addShape(pres.shapes.RECTANGLE, { x: bx, y: 1.5, w: 1.5, h: 0.08, fill: { color: z.color } });
s.addText(z.op, { x: bx + 0.05, y: 1.58, w: 1.4, h: 0.85, fontSize: 9, color: WHITE, align: "center", valign: "middle", wrap: true, margin: 0 });
});
// Below: key rules
s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: 2.6, w: 13.0, h: 0.05, fill: { color: ACCENT2 } });
const rules = [
{ col: ACCENT1, title: "Right colon", text: "Typically presents with occult bleeding & anaemia\nRight hemicolectomy: standard approach" },
{ col: ACCENT3, title: "Transverse colon", text: "Less common; both flexures may need mobilisation\nExtended right or left hemicolectomy often preferred" },
{ col: ACCENT2, title: "Left colon", text: "Presents with change in bowel habit / obstruction\nSplenic flexure mobilisation for tension-free anastomosis" },
{ col: ACCENT4, title: "Rectum", text: "TME is mandatory\nT1: local excision; T2/T3: LAR or APR\nNeoadjuvant chemoradiotherapy for T3/T4 or N+" },
];
rules.forEach((r, i) => {
const rx = 0.15 + i * 3.3;
s.addShape(pres.shapes.RECTANGLE, { x: rx, y: 2.75, w: 3.15, h: 3.8, fill: { color: CARD_BG } });
s.addShape(pres.shapes.RECTANGLE, { x: rx, y: 2.75, w: 3.15, h: 0.42, fill: { color: r.col } });
s.addText(r.title, { x: rx + 0.1, y: 2.75, w: 2.95, h: 0.42, fontSize: 13, bold: true, color: WHITE, valign: "middle", margin: 0 });
s.addText(r.text, { x: rx + 0.1, y: 3.22, w: 2.95, h: 3.2, fontSize: 11, color: LIGHT, wrap: true, valign: "top", margin: 0 });
});
// Footer note
s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 7.22, w: 13.3, h: 0.28, fill: { color: "0A1620" } });
s.addText("Sources: Schwartz's Principles of Surgery 11th Ed. | Bailey & Love 28th Ed. | Yamada's Gastroenterology 7th Ed.", {
x: 0.3, y: 7.22, w: 12.7, h: 0.28, fontSize: 7.5, color: GREY, valign: "middle", margin: 0
});
}
// ─── WRITE FILE ────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/crc-surgery-ppt/CRC_Surgical_Approaches.pptx" })
.then(() => console.log("DONE"))
.catch(e => { console.error(e); process.exit(1); });
cd /home/daytona/workspace/crc-surgery-ppt && node build.js 2>&1
node -e "const p = require('pptxgenjs'); const pr = new p(); console.log(Object.keys(pr.shapes).filter(k => k.toLowerCase().includes('ell') || k.toLowerCase().includes('circ')))"
~/crc-surgery-ppt/build.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/crc-surgery-ppt/build.js'
cd /home/daytona/workspace/crc-surgery-ppt && node build.js 2>&1
CRC Surgical Approaches
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 | Title slide - with the Schwartz's colon anatomy diagram |
| 2 | Master overview table - all CRC locations, operations, vessels ligated, and anastomosis type |
| 3 | Right-sided CRC - Ileocaecectomy, Right Hemicolectomy, Extended Right Hemicolectomy (with anatomy diagram) |
| 4 | Left-sided CRC - Transverse Colectomy, Left Hemicolectomy, Sigmoid Colectomy (with anatomy diagram) |
| 5 | Rectal cancer - Local excision/TEM, Anterior Resection, Abdominoperineal Resection, Hartmann's Procedure |
| 6 | Special cases - Total/Subtotal Colectomy, IPAA for FAP; Laparoscopic vs Open comparison table |
| 7 | General surgical principles - 6 principles: margins, lymphadenectomy, TME, vascular ligation, tension-free anastomosis, endoscopic options |
| 8 | Quick-reference summary - visual horizontal flow (caecum → rectum → operation) + 4 regional rule cards |