Make a presentation slide with reference for IBD
Put everything definition etio patho diagnosis sign and symptoms treatment with guidelines and algorithm treatment
"inflammatory bowel disease" AND "guidelines"
mkdir -p /home/daytona/workspace/ibd-presentation && ls /home/daytona/workspace/ibd-presentation/
~/ibd-presentation/build_ibd.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Inflammatory Bowel Disease (IBD)";
pres.author = "Medical Education";
// ─── Color Palette ───────────────────────────────────────────────────────────
const C = {
darkBg: "0D2137", // deep navy - title/section slides
midBg: "122B4A", // medium navy
lightBg: "F0F4F8", // off-white for content slides
accent1: "E8A020", // amber/gold
accent2: "2ECC71", // teal-green
accent3: "E74C3C", // red
accent4: "3498DB", // blue
white: "FFFFFF",
textDark: "1A2B3C",
textMid: "34495E",
boxBlue: "D6EAF8",
boxGreen: "D5F5E3",
boxRed: "FDEDEC",
boxAmber: "FEF9E7",
boxPurple: "EBD5F5",
headerBar: "1A4A6E",
};
// ─── Helper: Slide with header bar ────────────────────────────────────────────
function addContentSlide(title, subtitle) {
const s = pres.addSlide();
// White background
s.background = { color: C.lightBg };
// Top header bar
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.darkBg }, line: { color: C.darkBg } });
// Accent stripe
s.addShape(pres.ShapeType.rect, { x: 0, y: 0.75, w: 10, h: 0.07, fill: { color: C.accent1 }, line: { color: C.accent1 } });
// Title
s.addText(title, { x: 0.25, y: 0, w: 9.5, h: 0.75, fontSize: 22, bold: true, color: C.white, valign: "middle", margin: 0 });
if (subtitle) {
s.addText(subtitle, { x: 0.25, y: 0.82, w: 9.5, h: 0.35, fontSize: 11, color: C.accent1, italic: true });
}
return s;
}
// ─── Helper: colored box ──────────────────────────────────────────────────────
function addBox(slide, x, y, w, h, fillColor, borderColor) {
slide.addShape(pres.ShapeType.rect, {
x, y, w, h,
fill: { color: fillColor },
line: { color: borderColor || fillColor, width: 1.5 },
shadow: { type: "outer", color: "AAAAAA", opacity: 0.25, blur: 4, offset: 2, angle: 45 },
});
}
// ─── Helper: footer citation ──────────────────────────────────────────────────
function addFooter(slide, text) {
slide.addText(text, {
x: 0.2, y: 5.3, w: 9.6, h: 0.3,
fontSize: 7.5, color: "888888", italic: true,
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.darkBg };
// Big gradient-style accent block
s.addShape(pres.ShapeType.rect, { x: 0, y: 3.5, w: 10, h: 2.125, fill: { color: C.midBg }, line: { color: C.midBg } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 3.5, w: 0.25, h: 2.125, fill: { color: C.accent1 }, line: { color: C.accent1 } });
// Main title
s.addText("Inflammatory Bowel Disease", {
x: 0.5, y: 0.6, w: 9, h: 1.3,
fontSize: 44, bold: true, color: C.white, align: "center",
glow: { size: 8, opacity: 0.3, color: C.accent1 },
});
// Subtitle
s.addText("IBD", {
x: 0.5, y: 1.9, w: 9, h: 0.6,
fontSize: 28, color: C.accent1, align: "center", bold: true,
});
s.addShape(pres.ShapeType.rect, { x: 3.5, y: 2.55, w: 3, h: 0.06, fill: { color: C.accent1 }, line: { color: C.accent1 } });
// Tagline
s.addText("Definition · Etiology · Pathophysiology · Clinical Features\nDiagnosis · Treatment · Guidelines & Algorithms", {
x: 0.5, y: 2.7, w: 9, h: 0.75,
fontSize: 13, color: "A8C8E8", align: "center", italic: true,
});
// Bottom info
s.addText("For Medical Students | Based on Current Guidelines (BSG 2025, ACG 2025, AGA 2024)", {
x: 0.5, y: 3.6, w: 9, h: 0.4,
fontSize: 10, color: "AAAAAA", align: "center",
});
s.addText("References: BSG Gut 2025 | ACG Am J Gastroenterol 2025 | AGA Gastroenterology 2024\nSleisenger & Fordtran's GI Disease | Maingot's Abdominal Operations | Harrison's Principles of Internal Medicine 22E", {
x: 0.4, y: 4.8, w: 9.2, h: 0.7,
fontSize: 8.5, color: "888888", align: "center", italic: true,
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 – OUTLINE
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Overview / Outline", "Topics covered in this presentation");
const topics = [
["01", "Definition & Classification", C.accent1],
["02", "Epidemiology", C.accent4],
["03", "Etiology & Risk Factors", C.accent2],
["04", "Pathophysiology", "#9B59B6"],
["05", "Clinical Features – UC vs. CD", C.accent3],
["06", "Extraintestinal Manifestations", C.accent4],
["07", "Diagnosis & Investigations", "#1ABC9C"],
["08", "Treatment Algorithm – UC", C.accent1],
["09", "Treatment Algorithm – CD", C.accent2],
["10", "Current Guidelines & References", C.accent4],
];
topics.forEach(([num, label, color], i) => {
const col = i < 5 ? 0 : 1;
const row = i < 5 ? i : i - 5;
const x = 0.3 + col * 4.9;
const y = 1.3 + row * 0.78;
addBox(s, x, y, 4.5, 0.62, "FFFFFF", color);
s.addShape(pres.ShapeType.rect, { x, y, w: 0.45, h: 0.62, fill: { color }, line: { color } });
s.addText(num, { x, y, w: 0.45, h: 0.62, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle" });
s.addText(label, { x: x + 0.55, y: y + 0.05, w: 3.85, h: 0.52, fontSize: 12, color: C.textDark, valign: "middle" });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 – DEFINITION & CLASSIFICATION
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Definition & Classification of IBD");
// Definition box
addBox(s, 0.3, 1.2, 9.4, 1.1, C.boxBlue, C.accent4);
s.addText("Definition", { x: 0.45, y: 1.22, w: 9, h: 0.35, fontSize: 11, bold: true, color: C.accent4 });
s.addText(
"IBD is a group of idiopathic chronic relapsing-remitting inflammatory disorders of the GI tract, characterized by unregulated immune activation and mucosal destruction. The two main subtypes are Ulcerative Colitis (UC) and Crohn's Disease (CD).",
{ x: 0.45, y: 1.55, w: 9.1, h: 0.65, fontSize: 11, color: C.textDark }
);
// UC box
addBox(s, 0.3, 2.45, 4.4, 2.5, C.boxAmber, C.accent1);
s.addText("Ulcerative Colitis (UC)", { x: 0.45, y: 2.48, w: 4.1, h: 0.35, fontSize: 12, bold: true, color: C.accent1 });
s.addText([
{ text: "• Continuous mucosal inflammation\n", options: { breakLine: false } },
{ text: "• Limited to the colon & rectum\n", options: { breakLine: false } },
{ text: "• Always involves rectum (rectal sparing = rare)\n", options: { breakLine: false } },
{ text: "• Superficial – mucosa & submucosa only\n", options: { breakLine: false } },
{ text: "• No skip lesions; no granulomas\n", options: { breakLine: false } },
{ text: "• Surgery is curative (colectomy)", options: {} },
], { x: 0.45, y: 2.87, w: 4.1, h: 2.0, fontSize: 11, color: C.textDark, lineSpacingMultiple: 1.3 });
// CD box
addBox(s, 5.3, 2.45, 4.4, 2.5, C.boxGreen, C.accent2);
s.addText("Crohn's Disease (CD)", { x: 5.45, y: 2.48, w: 4.1, h: 0.35, fontSize: 12, bold: true, color: "1A8A50" });
s.addText([
{ text: "• Transmural (full-thickness) inflammation\n", options: { breakLine: false } },
{ text: "• Can affect mouth to anus (any segment)\n", options: { breakLine: false } },
{ text: "• Most common: terminal ileum + colon\n", options: { breakLine: false } },
{ text: "• Skip lesions; cobblestone mucosa\n", options: { breakLine: false } },
{ text: "• Non-caseating granulomas (50% of specimens)\n", options: { breakLine: false } },
{ text: "• Surgery NOT curative – recurrence common", options: {} },
], { x: 5.45, y: 2.87, w: 4.1, h: 2.0, fontSize: 11, color: C.textDark, lineSpacingMultiple: 1.3 });
addFooter(s, "Sleisenger & Fordtran's GI and Liver Disease | Maingot's Abdominal Operations | Schwartz's Principles of Surgery 11e");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 – EPIDEMIOLOGY
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Epidemiology");
// Stats boxes
const stats = [
["3–20 / 100,000", "UC Incidence\n(W. Europe/N. America)", C.accent1, C.boxAmber],
["5–10 / 100,000", "CD Incidence\n(N. America)", C.accent4, C.boxBlue],
["Bimodal peaks", "Age of onset: 15–30\nand 60–80 years", "#9B59B6", C.boxPurple],
["Equal M = F", "Gender distribution\n(slight F predominance in CD)", C.accent2, C.boxGreen],
];
stats.forEach(([val, label, accent, bg], i) => {
const x = 0.3 + i * 2.38;
addBox(s, x, 1.3, 2.2, 1.7, bg, accent);
s.addText(val, { x, y: 1.42, w: 2.2, h: 0.6, fontSize: 13, bold: true, color: accent, align: "center" });
s.addText(label, { x, y: 2.0, w: 2.2, h: 0.85, fontSize: 9.5, color: C.textDark, align: "center" });
});
// Key points
addBox(s, 0.3, 3.1, 9.4, 2.0, "FFFFFF", C.headerBar);
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.1, w: 9.4, h: 0.32, fill: { color: C.headerBar }, line: { color: C.headerBar } });
s.addText("Key Epidemiological Facts", { x: 0.45, y: 3.1, w: 9, h: 0.32, fontSize: 11, bold: true, color: C.white, valign: "middle" });
s.addText([
{ text: "• Highest prevalence in Western countries; rapidly rising in Asia, Africa, South America (westernization)\n", options: { breakLine: false } },
{ text: "• UC: 8–15 / 100,000 (USA/N. Europe); considerably lower in Asia & Africa\n", options: { breakLine: false } },
{ text: "• Jewish populations have higher risk (2–4×), especially Ashkenazi Jews\n", options: { breakLine: false } },
{ text: "• Family history: 10–15% of patients have a first-degree relative with IBD", options: {} },
], { x: 0.45, y: 3.45, w: 9.1, h: 1.55, fontSize: 11, color: C.textDark, lineSpacingMultiple: 1.3 });
addFooter(s, "Schwartz's Principles of Surgery 11e | Harrison's Principles of Internal Medicine 22E (2025) | BSG Guidelines 2025 [PMID: 40550582]");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 – ETIOLOGY & RISK FACTORS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Etiology & Risk Factors");
const factors = [
{ title: "Genetic Factors", color: "#9B59B6", bg: C.boxPurple, items: [
"NOD2/CARD15 gene (chr 16q12) – CD susceptibility",
"HLA associations (especially UC)",
"10–15% familial aggregation",
"Monozygotic twins: 50% concordance in CD, 15% in UC",
]},
{ title: "Immune Dysregulation", color: C.accent4, bg: C.boxBlue, items: [
"Defective mucosal barrier → abnormal antigen exposure",
"Th1/Th17 overactivation in CD; Th2 in UC",
"Excess TNF-α, IL-6, IL-12, IL-23 production",
"Loss of T-regulatory cell function",
]},
{ title: "Environmental Triggers", color: C.accent1, bg: C.boxAmber, items: [
"Smoking: protective in UC; risk factor in CD",
"NSAIDs, oral contraceptives (possible triggers)",
"Appendectomy is protective for UC",
"Westernized diet, antibiotics in childhood",
]},
{ title: "Microbial / Gut Flora", color: C.accent2, bg: C.boxGreen, items: [
"Altered gut microbiome (dysbiosis)",
"Reduced microbial diversity in IBD patients",
"Mycobacterium paratuberculosis (proposed; not confirmed)",
"Hygiene hypothesis: reduced early microbial exposure",
]},
];
factors.forEach((f, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 0.3 + col * 4.85;
const y = 1.2 + row * 2.05;
addBox(s, x, y, 4.5, 1.9, f.bg, f.color);
s.addShape(pres.ShapeType.rect, { x, y, w: 4.5, h: 0.32, fill: { color: f.color }, line: { color: f.color } });
s.addText(f.title, { x, y, w: 4.5, h: 0.32, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle" });
s.addText(f.items.map(it => "• " + it).join("\n"), {
x: x + 0.12, y: y + 0.35, w: 4.3, h: 1.48,
fontSize: 10, color: C.textDark, lineSpacingMultiple: 1.3,
});
});
addFooter(s, "Maingot's Abdominal Operations | Mulholland & Greenfield's Surgery 7e | Schwartz's Principles of Surgery 11e");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 – PATHOPHYSIOLOGY
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Pathophysiology of IBD");
// Central concept
addBox(s, 3.3, 1.2, 3.4, 0.75, C.darkBg, C.accent1);
s.addText("Genetically susceptible host\n+ Environmental triggers\n→ Uncontrolled mucosal inflammation", {
x: 3.3, y: 1.2, w: 3.4, h: 0.75, fontSize: 9.5, color: C.white, align: "center", valign: "middle",
});
// Arrow
s.addShape(pres.ShapeType.rect, { x: 4.85, y: 1.95, w: 0.3, h: 0.25, fill: { color: C.accent1 }, line: { color: C.accent1 } });
// Steps
const steps = [
{ label: "1. Antigen Exposure", text: "Increased intestinal permeability → luminal antigens (bacteria, dietary) cross the epithelial barrier → activate mucosal dendritic cells", color: C.accent4, bg: C.boxBlue },
{ label: "2. Innate Immunity", text: "Macrophages & neutrophils release TNF-α, IL-1β, IL-6 → acute inflammation; neutrophil cryptitis & crypt abscesses (UC hallmark)", color: "#E67E22", bg: "#FEF0E0" },
{ label: "3. Adaptive Immunity", text: "CD4+ T-cell differentiation: Th1/Th17 (↑ IL-12, IL-23, IFN-γ) in CD; Th2 (↑ IL-4, IL-5, IL-13) in UC → perpetuating mucosal injury", color: "#9B59B6", bg: C.boxPurple },
{ label: "4. Tissue Injury", text: "UC: Superficial mucosal ulceration, goblet cell depletion, pseudopolyps\nCD: Transmural inflammation, fissuring ulcers, non-caseating granulomas, fistulas, strictures", color: C.accent3, bg: C.boxRed },
];
steps.forEach((step, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 0.3 + col * 4.85;
const y = 2.25 + row * 1.55;
addBox(s, x, y, 4.5, 1.4, step.bg, step.color);
s.addShape(pres.ShapeType.rect, { x, y, w: 0.22, h: 1.4, fill: { color: step.color }, line: { color: step.color } });
s.addText(step.label, { x: x + 0.3, y: y + 0.05, w: 4.1, h: 0.3, fontSize: 11, bold: true, color: step.color });
s.addText(step.text, { x: x + 0.3, y: y + 0.35, w: 4.1, h: 0.98, fontSize: 10, color: C.textDark, lineSpacingMultiple: 1.25 });
});
addFooter(s, "Maingot's Abdominal Operations | Mulholland & Greenfield's Surgery 7e | Goldman-Cecil Medicine 2024");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 – CLINICAL FEATURES
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Clinical Features: UC vs. Crohn's Disease");
// Header row
s.addShape(pres.ShapeType.rect, { x: 2.85, y: 1.2, w: 3.2, h: 0.35, fill: { color: C.accent1 }, line: { color: C.accent1 } });
s.addText("Ulcerative Colitis", { x: 2.85, y: 1.2, w: 3.2, h: 0.35, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle" });
s.addShape(pres.ShapeType.rect, { x: 6.15, y: 1.2, w: 3.6, h: 0.35, fill: { color: C.accent2 }, line: { color: C.accent2 } });
s.addText("Crohn's Disease", { x: 6.15, y: 1.2, w: 3.6, h: 0.35, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle" });
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.2, w: 2.5, h: 0.35, fill: { color: C.headerBar }, line: { color: C.headerBar } });
s.addText("Feature", { x: 0.3, y: 1.2, w: 2.5, h: 0.35, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle" });
// Table rows
const rows = [
["Diarrhea", "Bloody, frequent (>6/day severe)", "Non-bloody or loose; ± blood if colon involved"],
["Abdominal Pain", "Crampy, lower abdominal / tenesmus", "RLQ pain (postprandial), colicky → chronic"],
["Location", "Rectum → proximal (colon only)", "Anywhere mouth to anus; terminal ileum most common"],
["Rectal Bleeding", "Very common (hallmark)", "Less common"],
["Fistulas/Abscesses", "Rare (toxic megacolon only)", "Common (enterocutaneous, perianal, enterovesical)"],
["Weight Loss", "Mild", "Marked (malabsorption, anorexia)"],
["Fever", "Moderate (severe disease)", "Common – even in early disease"],
["Perianal Disease", "Absent", "Common – skin tags, fistulas, fissures"],
];
rows.forEach((row, i) => {
const y = 1.58 + i * 0.46;
const bg = i % 2 === 0 ? "F8F9FA" : "FFFFFF";
s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 9.45, h: 0.44, fill: { color: bg }, line: { color: "DDDDDD" } });
s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 0.06, h: 0.44, fill: { color: C.headerBar }, line: { color: C.headerBar } });
s.addText(row[0], { x: 0.42, y, w: 2.35, h: 0.44, fontSize: 10, bold: true, color: C.textDark, valign: "middle" });
s.addText(row[1], { x: 2.82, y, w: 3.25, h: 0.44, fontSize: 9.5, color: "7D4400", valign: "middle" });
s.addText(row[2], { x: 6.12, y, w: 3.55, h: 0.44, fontSize: 9.5, color: "1A6B3C", valign: "middle" });
});
addFooter(s, "Tintinalli's Emergency Medicine | Rheumatology 2-Volume Set 2022 | Sleisenger & Fordtran's GI Disease");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 – EXTRAINTESTINAL MANIFESTATIONS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Extraintestinal Manifestations (EIMs) of IBD");
const systems = [
{ sys: "Musculoskeletal (25–40%)", items: ["Peripheral arthritis (type 1: <5 joints, mirrors disease; type 2: >5 joints, independent)", "Axial arthropathy: sacroiliitis, ankylosing spondylitis", "Osteoporosis (steroid-related)"], color: C.accent3, bg: C.boxRed },
{ sys: "Dermatological (5–15%)", items: ["Erythema nodosum (correlates with disease activity)", "Pyoderma gangrenosum (independent of activity)", "Sweet's syndrome", "Aphthous stomatitis"], color: "#E67E22", bg: "#FEF0E0" },
{ sys: "Ocular (2–5%)", items: ["Uveitis / iritis (anterior most common)", "Episcleritis (correlates with activity)", "Scleritis (independent of activity)"], color: "#9B59B6", bg: C.boxPurple },
{ sys: "Hepatobiliary (5–10%)", items: ["Primary sclerosing cholangitis (PSC) – UC>CD; risk for cholangiocarcinoma", "Fatty liver, autoimmune hepatitis", "Gallstones (CD – ileal malabsorption)"], color: C.accent2, bg: C.boxGreen },
{ sys: "Renal/Urological", items: ["Nephrolithiasis (oxalate stones in CD)", "Enterovesical fistula (CD)", "Hydronephrosis (ureteric compression)"], color: C.accent4, bg: C.boxBlue },
{ sys: "Haematological", items: ["Iron deficiency anemia (blood loss)", "B12/folate deficiency (CD – ileal disease)", "Thromboembolic disease (↑ DVT/PE risk)"], color: C.headerBar, bg: "E8EFF6" },
];
systems.forEach((sys, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.3 + col * 3.22;
const y = 1.22 + row * 1.98;
addBox(s, x, y, 3.05, 1.85, sys.bg, sys.color);
s.addShape(pres.ShapeType.rect, { x, y, w: 3.05, h: 0.3, fill: { color: sys.color }, line: { color: sys.color } });
s.addText(sys.sys, { x, y, w: 3.05, h: 0.3, fontSize: 9.5, bold: true, color: C.white, align: "center", valign: "middle" });
s.addText(sys.items.map(it => "• " + it).join("\n"), {
x: x + 0.1, y: y + 0.33, w: 2.88, h: 1.45,
fontSize: 9, color: C.textDark, lineSpacingMultiple: 1.3,
});
});
addFooter(s, "Rheumatology 2-Volume Set 2022 | Fitzpatrick's Dermatology | BSG Guidelines 2025 [PMID: 40550582]");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 – DIAGNOSIS
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Diagnosis & Investigations");
const cols = [
{ title: "Clinical", color: C.accent1, bg: C.boxAmber, items: [
"History: diarrhea duration, blood, pain, weight loss, family Hx",
"Rectal bleeding + tenesmus → UC",
"RLQ pain, perianal Sx → CD",
"Exclusion of infectious causes first",
"Severity scoring: Mayo (UC) / Harvey-Bradshaw (CD)",
]},
{ title: "Laboratory", color: C.accent4, bg: C.boxBlue, items: [
"FBC: anemia (IDA), leukocytosis",
"CRP / ESR: ↑ in active disease",
"Fecal calprotectin: sensitive marker of mucosal inflammation (>50 μg/g abnormal)",
"Stool cultures & C. diff PCR (exclude infection)",
"Serology: ANCA (UC), ASCA (CD)",
"Albumin, B12, iron studies (CD)",
]},
{ title: "Endoscopy & Histology", color: "#1ABC9C", bg: "#E8FAF5", items: [
"Colonoscopy (gold standard) – full assessment to terminal ileum",
"UC: continuous inflammation from rectum; granularity, friability, pseudopolyps",
"CD: discontinuous skip lesions; cobblestoning; aphthous ulcers",
"Biopsy mandatory: cryptitis, crypt distortion, goblet cell depletion (UC); non-caseating granulomas (CD)",
]},
{ title: "Imaging", color: "#9B59B6", bg: C.boxPurple, items: [
"CT Enterography / MR Enterography: small bowel CD assessment",
"Plain AXR: toxic megacolon (colon >6 cm)",
"USS: abdominal pain assessment",
"MRI pelvis: perianal CD fistula mapping (investigation of choice)",
"Capsule endoscopy: small bowel CD",
]},
];
cols.forEach((col, i) => {
const x = 0.3 + i * 2.38;
addBox(s, x, 1.2, 2.2, 4.0, col.bg, col.color);
s.addShape(pres.ShapeType.rect, { x, y: 1.2, w: 2.2, h: 0.32, fill: { color: col.color }, line: { color: col.color } });
s.addText(col.title, { x, y: 1.2, w: 2.2, h: 0.32, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle" });
s.addText(col.items.map(it => "• " + it).join("\n"), {
x: x + 0.1, y: 1.55, w: 2.05, h: 3.55,
fontSize: 9, color: C.textDark, lineSpacingMultiple: 1.3,
});
});
addFooter(s, "Goldman-Cecil Medicine 2024 | Clinical GI Endoscopy 3e | Harrison's Internal Medicine 22E | Sleisenger & Fordtran");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 – TREATMENT ALGORITHM UC
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Treatment Algorithm – Ulcerative Colitis (Step-Up Approach)");
// Step-up flow
const steps = [
{ label: "MILD UC\nMayo 0–4", drug: "Oral & topical 5-ASA (mesalazine)\n± Topical corticosteroids\nGoal: mucosal healing", color: C.accent2, bg: C.boxGreen },
{ label: "MODERATE UC\nMayo 5–8", drug: "Add oral corticosteroids\n(prednisolone 40–60 mg/day)\nIf steroid-dependent → azathioprine / 6-MP\nor early biologic (infliximab / vedolizumab)", color: C.accent1, bg: C.boxAmber },
{ label: "MODERATE–SEVERE UC\n(Biologic-naive)", drug: "Anti-TNF: infliximab / adalimumab\nAnti-integrin: vedolizumab\nAnti-IL-12/23: ustekinumab\nJAK inhibitor: tofacitinib / upadacitinib\n(Per AGA 2024 & ACG 2025 guidelines)", color: "#E67E22", bg: "#FEF0E0" },
{ label: "ACUTE SEVERE UC\n(Hospitalize)", drug: "IV methylprednisolone 60 mg/day\nNo response after 72 hrs:\n→ Infliximab (rescue) OR cyclosporine\nNo improvement → colectomy", color: C.accent3, bg: C.boxRed },
];
steps.forEach((step, i) => {
const y = 1.2 + i * 1.06;
addBox(s, 0.3, y, 2.6, 0.92, step.bg, step.color);
s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 0.22, h: 0.92, fill: { color: step.color }, line: { color: step.color } });
s.addText(step.label, { x: 0.58, y, w: 2.27, h: 0.92, fontSize: 10, bold: true, color: step.color, valign: "middle" });
addBox(s, 3.1, y, 6.6, 0.92, "FFFFFF", step.color);
s.addText(step.drug, { x: 3.25, y: y + 0.05, w: 6.35, h: 0.8, fontSize: 10, color: C.textDark, valign: "middle", lineSpacingMultiple: 1.25 });
if (i < 3) {
s.addShape(pres.ShapeType.rect, { x: 1.5, y: y + 0.92, w: 0.1, h: 0.14, fill: { color: C.accent3 }, line: { color: C.accent3 } });
}
});
// Maintenance box
addBox(s, 0.3, 5.4, 9.4, 0.32, C.darkBg, C.accent1);
s.addText("Maintenance: Continue 5-ASA (UC mild–moderate) | Biologics for moderate–severe | Surveillance colonoscopy after 8 years for CRC risk", {
x: 0.45, y: 5.4, w: 9.1, h: 0.32, fontSize: 9, color: C.accent1, valign: "middle",
});
addFooter(s, "ACG Clinical Guideline Update: UC 2025 [PMID: 40701556] | AGA Living CPG: UC 2024 [PMID: 39572132] | BSG 2025 [PMID: 40550582]");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 – TREATMENT ALGORITHM CD
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Treatment Algorithm – Crohn's Disease");
// Two-column: Step-up vs Top-down
addBox(s, 0.3, 1.2, 4.55, 0.38, C.accent2, C.accent2);
s.addText("STEP-UP APPROACH", { x: 0.3, y: 1.2, w: 4.55, h: 0.38, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle" });
addBox(s, 5.15, 1.2, 4.55, 0.38, C.accent4, C.accent4);
s.addText("TOP-DOWN APPROACH", { x: 5.15, y: 1.2, w: 4.55, h: 0.38, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle" });
const stepUp = [
["Mild CD", "Budesonide (ileal/RC) or\n5-ASA (limited evidence)\nEnteral nutrition (esp. pediatrics)", C.accent2, C.boxGreen],
["Moderate CD", "Corticosteroids for induction\n+ Immunomodulator (AZA/6-MP/MTX)\nfor maintenance", C.accent1, C.boxAmber],
["Severe / Fistulizing", "Anti-TNF: infliximab / adalimumab\nVedolizumab (gut-selective)\nUstekinumab (anti-IL-12/23)\nRisankizumab (anti-IL-23)", C.accent3, C.boxRed],
];
const topDown = [
["High-risk features\n(young, fistula, stricture)", "Start biologic early\n± Immunomodulator\n(combo therapy)", C.accent4, C.boxBlue],
["Anti-TNF +\nImmuno modulator\n(combo)", "Infliximab + AZA\n↓ Immunogenicity\n↑ Mucosal healing", "#9B59B6", C.boxPurple],
["No response", "Switch biologic class OR\nConsider surgery:\nileocaecal resection (ileitis)\nstrictureplasty (stricture)", C.headerBar, "E8EFF6"],
];
stepUp.forEach((step, i) => {
const y = 1.65 + i * 1.1;
addBox(s, 0.3, y, 4.55, 1.0, step[3], step[2]);
s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 4.55, h: 0.28, fill: { color: step[2] }, line: { color: step[2] } });
s.addText(step[0], { x: 0.38, y, w: 4.35, h: 0.28, fontSize: 10, bold: true, color: C.white, valign: "middle" });
s.addText(step[1], { x: 0.42, y: y + 0.3, w: 4.3, h: 0.65, fontSize: 10, color: C.textDark, lineSpacingMultiple: 1.2 });
});
topDown.forEach((step, i) => {
const y = 1.65 + i * 1.1;
addBox(s, 5.15, y, 4.55, 1.0, step[3], step[2]);
s.addShape(pres.ShapeType.rect, { x: 5.15, y, w: 4.55, h: 0.28, fill: { color: step[2] }, line: { color: step[2] } });
s.addText(step[0], { x: 5.23, y, w: 4.35, h: 0.28, fontSize: 10, bold: true, color: C.white, valign: "middle" });
s.addText(step[1], { x: 5.27, y: y + 0.3, w: 4.3, h: 0.65, fontSize: 10, color: C.textDark, lineSpacingMultiple: 1.2 });
});
addFooter(s, "Schwartz's Principles of Surgery 11e | Mulholland & Greenfield's Surgery 7e | ECCO/ESPGHAN Guidelines 2025 [PMID: 40528309]");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 – DRUG SUMMARY
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Pharmacological Summary of IBD Medications");
const drugs = [
{ class: "5-Aminosalicylates (5-ASA)", examples: "Mesalazine, sulfasalazine, olsalazine", use: "UC maintenance & mild–moderate induction; ± mild CD", moa: "Inhibit prostaglandin synthesis & NF-κB; local anti-inflammatory", color: C.accent2 },
{ class: "Corticosteroids", examples: "Prednisolone (systemic), budesonide (topical/oral)", use: "Induction of remission (NOT maintenance)", moa: "Broad immunosuppression, ↓ cytokine transcription via glucocorticoid receptor", color: C.accent1 },
{ class: "Immunomodulators", examples: "Azathioprine, 6-mercaptopurine, methotrexate", use: "Steroid-sparing maintenance; combo with anti-TNF", moa: "Inhibit purine synthesis → suppress T & B lymphocyte proliferation", color: "#9B59B6" },
{ class: "Anti-TNF Biologics", examples: "Infliximab (IV), adalimumab (SC), certolizumab, golimumab", use: "Moderate–severe UC & CD, perianal CD, fistulizing disease", moa: "Neutralize soluble & membrane-bound TNF-α → apoptosis of activated T cells", color: C.accent3 },
{ class: "Anti-Integrin", examples: "Vedolizumab (gut-selective), natalizumab", use: "Moderate–severe UC & CD (especially UC); steroid-dependent/refractory", moa: "Block α4β7 integrin → prevent lymphocyte trafficking to gut mucosa", color: C.accent4 },
{ class: "Anti-IL-12/23 / Anti-IL-23", examples: "Ustekinumab, risankizumab, mirikizumab", use: "Moderate–severe CD & UC; biologic failure", moa: "Block IL-12/IL-23 p40 subunit → ↓ Th1/Th17 differentiation", color: "#1ABC9C" },
{ class: "JAK Inhibitors", examples: "Tofacitinib (UC), upadacitinib (UC & CD)", use: "Moderate–severe UC; CD (upadacitinib)", moa: "Inhibit JAK1/3 → block cytokine signaling (IL-6, IFN-γ, IL-2, IL-4)", color: "#E67E22" },
];
// Header row
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.2, w: 9.45, h: 0.3, fill: { color: C.headerBar }, line: { color: C.headerBar } });
["Drug Class", "Examples", "Use in IBD", "Mechanism"].forEach((h, i) => {
const widths = [1.9, 2.3, 2.5, 2.65];
const xs = [0.3, 2.2, 4.5, 7.0];
s.addText(h, { x: xs[i], y: 1.2, w: widths[i], h: 0.3, fontSize: 10, bold: true, color: C.white, valign: "middle", align: "center" });
});
drugs.forEach((d, i) => {
const y = 1.52 + i * 0.53;
const bg = i % 2 === 0 ? "F8F9FA" : "FFFFFF";
s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 9.45, h: 0.51, fill: { color: bg }, line: { color: "DDDDDD" } });
s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 0.1, h: 0.51, fill: { color: d.color }, line: { color: d.color } });
s.addText(d.class, { x: 0.44, y, w: 1.72, h: 0.51, fontSize: 8.5, bold: true, color: d.color, valign: "middle" });
s.addText(d.examples, { x: 2.22, y, w: 2.24, h: 0.51, fontSize: 8.5, color: C.textDark, valign: "middle" });
s.addText(d.use, { x: 4.52, y, w: 2.44, h: 0.51, fontSize: 8.5, color: C.textDark, valign: "middle" });
s.addText(d.moa, { x: 7.02, y, w: 2.6, h: 0.51, fontSize: 8, color: C.textMid, valign: "middle", italic: true });
});
addFooter(s, "Goodman & Gilman's Pharmacological Basis of Therapeutics | AGA 2024 [PMID: 39572132] | ACG 2025 [PMID: 40701556]");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 – SURGICAL MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = addContentSlide("Surgical Management of IBD");
// UC
addBox(s, 0.3, 1.2, 4.6, 4.0, C.boxAmber, C.accent1);
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.2, w: 4.6, h: 0.32, fill: { color: C.accent1 }, line: { color: C.accent1 } });
s.addText("Ulcerative Colitis – Indications for Surgery", {
x: 0.3, y: 1.2, w: 4.6, h: 0.32, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle",
});
s.addText([
{ text: "Elective:\n", options: { bold: true, breakLine: false } },
{ text: "• Medical refractory disease (failure of biologics)\n• Steroid-dependent or steroid-intoxicated\n• Dysplasia / colorectal cancer\n• Growth failure in pediatrics\n\n", options: { breakLine: false } },
{ text: "Emergency:\n", options: { bold: true, breakLine: false } },
{ text: "• Acute severe UC unresponsive to IV steroids / infliximab rescue\n• Toxic megacolon (colon >6 cm + systemic toxicity)\n• Free perforation\n• Massive hemorrhage\n\n", options: { breakLine: false } },
{ text: "Procedure of Choice:\n", options: { bold: true, breakLine: false } },
{ text: "Restorative proctocolectomy with IPAA (ileal pouch-anal anastomosis)\n= CURATIVE", options: {} },
], { x: 0.45, y: 1.55, w: 4.3, h: 3.55, fontSize: 10, color: C.textDark, lineSpacingMultiple: 1.3 });
// CD
addBox(s, 5.1, 1.2, 4.6, 4.0, C.boxGreen, C.accent2);
s.addShape(pres.ShapeType.rect, { x: 5.1, y: 1.2, w: 4.6, h: 0.32, fill: { color: C.accent2 }, line: { color: C.accent2 } });
s.addText("Crohn's Disease – Indications for Surgery", {
x: 5.1, y: 1.2, w: 4.6, h: 0.32, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle",
});
s.addText([
{ text: "Indications:\n", options: { bold: true, breakLine: false } },
{ text: "• Fibrostenotic stricture (obstruction)\n• Perforating disease: abscess / fistula\n• Medically refractory disease\n• Growth retardation (pediatrics)\n• Ileocecal disease (ileocecal resection)\n\n", options: { breakLine: false } },
{ text: "Key Principles:\n", options: { bold: true, breakLine: false } },
{ text: "• Surgery is NOT curative; recurrence common\n• Bowel-conserving operations (strictureplasty)\n• Perianal CD: seton placement for fistulas\n• Post-resection: azathioprine ± anti-TNF to\n prevent recurrence (Rutgeerts score >i2)", options: {} },
], { x: 5.25, y: 1.55, w: 4.3, h: 3.55, fontSize: 10, color: C.textDark, lineSpacingMultiple: 1.3 });
addFooter(s, "Sabiston Textbook of Surgery 21e | Fischer's Mastery of Surgery 8e | Maingot's Abdominal Operations | Mulholland & Greenfield 7e");
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 – GUIDELINES & REFERENCES
// ═══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: C.darkBg };
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.7, fill: { color: C.midBg }, line: { color: C.midBg } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 0.7, w: 10, h: 0.07, fill: { color: C.accent1 }, line: { color: C.accent1 } });
s.addText("Current Guidelines & References", { x: 0.3, y: 0, w: 9.4, h: 0.7, fontSize: 22, bold: true, color: C.white, valign: "middle" });
const guidelines = [
{ label: "BSG 2025", ref: "Moran GW, et al. British Society of Gastroenterology guidelines on inflammatory bowel disease in adults: 2025. Gut. 2025 Jun 23. PMID: 40550582", color: C.accent1 },
{ label: "ACG 2025", ref: "Rubin DT, et al. ACG Clinical Guideline Update: Ulcerative Colitis in Adults. Am J Gastroenterol. 2025 Jun. PMID: 40701556", color: C.accent2 },
{ label: "AGA 2024", ref: "Singh S, Loftus EV Jr, Limketkai BN. AGA Living Clinical Practice Guideline on Pharmacological Management of Moderate-to-Severe Ulcerative Colitis. Gastroenterology. 2024 Dec. PMID: 39572132", color: C.accent4 },
{ label: "ESPGHAN 2025", ref: "Assa A, et al. Management of paediatric ulcerative colitis, part 2: Acute severe colitis. J Pediatr Gastroenterol Nutr. 2025. PMID: 40528309", color: "#1ABC9C" },
];
guidelines.forEach((g, i) => {
const y = 0.85 + i * 0.62;
s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 1.0, h: 0.46, fill: { color: g.color }, line: { color: g.color } });
s.addText(g.label, { x: 0.3, y, w: 1.0, h: 0.46, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle" });
s.addShape(pres.ShapeType.rect, { x: 1.35, y, w: 8.35, h: 0.46, fill: { color: "1E3555" }, line: { color: "2E4565" } });
s.addText(g.ref, { x: 1.5, y, w: 8.1, h: 0.46, fontSize: 9.5, color: "D0E4F5", valign: "middle" });
});
// Textbooks
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 3.4, w: 9.4, h: 0.28, fill: { color: C.accent1 }, line: { color: C.accent1 } });
s.addText("Textbook References", { x: 0.5, y: 3.4, w: 9, h: 0.28, fontSize: 11, bold: true, color: C.darkBg, valign: "middle" });
const textbooks = [
"Sleisenger & Fordtran's Gastrointestinal and Liver Disease, 11e (Elsevier)",
"Maingot's Abdominal Operations, 13e (McGraw-Hill)",
"Sabiston Textbook of Surgery: The Biological Basis of Modern Surgical Practice, 21e",
"Schwartz's Principles of Surgery, 11e (McGraw-Hill)",
"Mulholland & Greenfield's Surgery: Scientific Principles and Practice, 7e",
"Goodman & Gilman's The Pharmacological Basis of Therapeutics, 14e",
"Harrison's Principles of Internal Medicine, 22E (2025, McGraw-Hill)",
"Fischer's Mastery of Surgery, 8e | Tintinalli's Emergency Medicine | Rheumatology 2-Volume Set 2022",
];
textbooks.forEach((tb, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 0.3 + col * 4.85;
const y = 3.75 + row * 0.37;
s.addShape(pres.ShapeType.rect, { x, y, w: 0.18, h: 0.28, fill: { color: C.accent1 }, line: { color: C.accent1 } });
s.addText(tb, { x: x + 0.24, y, w: 4.55, h: 0.33, fontSize: 8.8, color: "C8DCF0", valign: "middle" });
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// WRITE FILE
// ═══════════════════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/ibd-presentation/IBD_Presentation.pptx" })
.then(() => console.log("SUCCESS: IBD_Presentation.pptx created"))
.catch(e => { console.error("ERROR:", e); process.exit(1); });
cd /home/daytona/workspace/ibd-presentation && node build_ibd.js 2>&1
ls -lh /home/daytona/workspace/ibd-presentation/IBD_Presentation.pptx
IBD Presentation
Presentation · PPTX
| # | Slide | Content |
|---|---|---|
| 1 | Title | Cover slide with guideline citations |
| 2 | Outline | 10-topic visual index |
| 3 | Definition & Classification | UC vs. CD side-by-side comparison boxes (mucosa vs. transmural, location, skip lesions, granulomas) |
| 4 | Epidemiology | Incidence stats, bimodal age, ethnic risk, rising global burden |
| 5 | Etiology & Risk Factors | 4 domains: genetics (NOD2/CARD15), immune dysregulation (Th1/Th17), environment (smoking, NSAIDs), microbiome |
| 6 | Pathophysiology | 4-step cascade: antigen exposure → innate → adaptive immunity → tissue injury (UC superficial vs. CD transmural) |
| 7 | Clinical Features | Full comparison table: diarrhea, pain, rectal bleeding, fistulas, perianal disease, weight loss |
| 8 | Extraintestinal Manifestations | 6 system boxes: MSK, dermatological, ocular, hepatobiliary, renal, haematological |
| 9 | Diagnosis & Investigations | 4-column layout: clinical, laboratory (calprotectin, ANCA/ASCA), endoscopy/histology, imaging (MRE, capsule) |
| 10 | Treatment Algorithm – UC | Step-up flow: mild 5-ASA → moderate steroids → severe biologics/JAKi → acute severe IV steroids/rescue infliximab |
| 11 | Treatment Algorithm – CD | Step-up vs. Top-down approach side by side |
| 12 | Pharmacological Summary | Full table: 7 drug classes with examples, indications, mechanism |
| 13 | Surgical Management | UC (IPAA = curative) vs. CD (bowel-conserving, strictureplasty, not curative) |
| 14 | Guidelines & References | BSG 2025, ACG 2025, AGA 2024, ESPGHAN 2025 + 8 textbook references |