Ibd Mediicne
Ibd topic for medicine
| Feature | Crohn Disease | Ulcerative Colitis |
|---|---|---|
| Peak age of onset | 15-30 yrs (2nd peak in 7th decade) | 20-40 yrs (2nd smaller peak >7th decade) |
| Sex (F:M ratio) | 1.2:1 | 1:1 |
| GI sites involved | Esophagus to anus | Colon only |
| Pattern | Skip lesions | Continuous (rectum upward) |
| Layer of involvement | Transmural (full wall) | Mucosal only |
| Ulceration | Discrete, cobblestone | Continuous |
| Fistula / Stricture | Yes | No |
| Perianal disease | Yes (20-40%) | No |

| Manifestation | CD | UC |
|---|---|---|
| Arthropathy (most common EIM; 10-20%) | + | + |
| Erythema nodosum (10-15%) | + | + |
| Pyoderma gangrenosum (1-2%) | + | + |
| Uveitis / episcleritis (5-15%) | + | + |
| Oral ulcers | + | - |
| Nephrolithiasis (calcium oxalate > uric acid) | + | +/- |
| Primary sclerosing cholangitis (PSC) | + | ++ (2-7.5%) |
Note: 70-80% of patients with PSC have underlying IBD (usually UC). - Goldman-Cecil Medicine, Table 127-2
| Drug | Brand | Route | Site of Delivery |
|---|---|---|---|
| Sulfasalazine | Azulfidine | Oral | Colon (cleaved by bacteria) |
| Mesalamine | Asacol HD, Pentasa, Lialda | Oral / Rectal | Distal ileum, colon |
| Balsalazide | Colazal | Oral | Colon |
| Olsalazine | Dipentum | Oral | Colon |

| Drug | Route | Use |
|---|---|---|
| Prednisone / Methylprednisolone | Oral / IV | Systemic - moderate-severe flares |
| Hydrocortisone | IV / Rectal enema, foam | Systemic or left-sided UC |
| Budesonide (delayed-release) | Oral | Ileocecal Crohn disease |
| Budesonide (extended-release) | Oral | UC pancolitis |
| Budesonide foam | Rectal | Left-sided UC |
| Drug | Notes |
|---|---|
| Azathioprine (AZA) | Prodrug - converted to 6-MP; used for maintenance in both CD and UC |
| 6-Mercaptopurine (6-MP) | Active metabolite of AZA; purine analog |
| Methotrexate | Used in CD maintenance; folate antagonist |
| Drug | Indication |
|---|---|
| Infliximab (Remicade) | Moderate-severe CD + UC |
| Adalimumab (Humira) | Moderate-severe CD + UC |
| Certolizumab (Cimzia) | Moderate-severe CD only |
| Golimumab (Simponi) | Moderate-severe UC only |
| Severity | UC | CD |
|---|---|---|
| Mild-moderate | 5-ASA (oral ± rectal) | Budesonide (ileocecal); 5-ASA has limited role |
| Moderate-severe | Systemic steroids → add immunomodulator or biologic (anti-TNF/vedolizumab/ustekinumab) | Systemic steroids + anti-TNF first-line for moderate-severe |
| Steroid-refractory | Biologics + immunomodulators; tofacitinib | Biologics + immunomodulators |
| Maintenance | 5-ASA, immunomodulators, biologics | Immunomodulators, biologics |
| Surgery | Total colectomy (curative in UC) | Resection (not curative; disease recurs) |
| Mnemonic | Content |
|---|---|
| CD = CAN DO | Cobblestone, Anywhere (mouth-anus), Non-caseating granulomas, Discontinuous (skip), Obstruction/fistula |
| UC = ULCER | Uniform from rectum, Limited to colon, Continuous, Erythema/bloody diarrhea, Rectum always involved |
| 5-ASA | First-line UC; sulfasalazine causes male infertility + needs folate |
| Biologics | Infliximab/Adalimumab = both CD + UC; Certolizumab = CD only; Golimumab = UC only |
| PSC | 70-80% have IBD (usually UC); "backwash ileitis" is UC, not real ileal disease |
Create a presentation comparing Crohn disease vs Ulcerative colitis features
mkdir -p /home/daytona/workspace/ibd-presentation && ls /home/daytona/workspace/ibd-presentation/
~/ibd-presentation/create_ibd_pptx.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Crohn Disease vs Ulcerative Colitis";
pres.author = "Medical Education";
// ─── Color Palette ───────────────────────────────────────────────
// Crohn = warm amber/orange (#E07B2A)
// UC = cool teal/blue (#1A7FAD)
// Background = deep navy (#0D1B2A)
// Card bg = dark slate (#162233)
// Accent = white / light (#FFFFFF / #E8EFF5)
const C = {
bg: "0D1B2A",
card: "162233",
cardAlt: "1C2E42",
crohn: "E07B2A",
uc: "1A9FD6",
white: "FFFFFF",
light: "C8D8E8",
muted: "7A93A8",
divider: "2A4A62",
crohnBg: "2A1A08",
ucBg: "08192A",
green: "27AE60",
red: "E74C3C",
};
// ─── Helper: slide background ────────────────────────────────────
function setBg(slide, color) {
slide.background = { color: color };
}
// ─── Helper: section label bar ───────────────────────────────────
function sectionBar(slide, text, color) {
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 10, h: 0.55,
fill: { color: color }, line: { color: color }
});
slide.addText(text.toUpperCase(), {
x: 0.3, y: 0, w: 9.4, h: 0.55,
fontSize: 11, bold: true, color: C.white,
charSpacing: 4, valign: "middle", margin: 0
});
}
// ─── Helper: two-column comparison card ─────────────────────────
function twoColCard(slide, lTitle, rTitle, lItems, rItems, yStart, rowH, lColor, rColor) {
const colW = 4.5;
const gap = 0.15;
const lX = 0.25;
const rX = lX + colW + gap;
// Left card
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: lX, y: yStart, w: colW, h: rowH,
fill: { color: C.crohnBg }, line: { color: lColor, pt: 1.5 }, rectRadius: 0.08
});
// Left header
slide.addShape(pres.shapes.RECTANGLE, {
x: lX, y: yStart, w: colW, h: 0.38,
fill: { color: lColor }, line: { color: lColor }
});
slide.addText(lTitle, {
x: lX, y: yStart, w: colW, h: 0.38,
fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
// Right card
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: rX, y: yStart, w: colW, h: rowH,
fill: { color: C.ucBg }, line: { color: rColor, pt: 1.5 }, rectRadius: 0.08
});
// Right header
slide.addShape(pres.shapes.RECTANGLE, {
x: rX, y: yStart, w: colW, h: 0.38,
fill: { color: rColor }, line: { color: rColor }
});
slide.addText(rTitle, {
x: rX, y: yStart, w: colW, h: 0.38,
fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
// Left items
const lTextItems = lItems.map((item, i) => ({
text: item,
options: { bullet: { code: "25B6", color: lColor }, color: C.light, fontSize: 10.5, breakLine: i < lItems.length - 1 }
}));
slide.addText(lTextItems, {
x: lX + 0.12, y: yStart + 0.45, w: colW - 0.24, h: rowH - 0.52,
valign: "top", fontFace: "Calibri"
});
// Right items
const rTextItems = rItems.map((item, i) => ({
text: item,
options: { bullet: { code: "25B6", color: rColor }, color: C.light, fontSize: 10.5, breakLine: i < rItems.length - 1 }
}));
slide.addText(rTextItems, {
x: rX + 0.12, y: yStart + 0.45, w: colW - 0.24, h: rowH - 0.52,
valign: "top", fontFace: "Calibri"
});
}
// ─── Helper: comparison row ──────────────────────────────────────
function compRow(slide, feature, crohnVal, ucVal, y, highlight) {
const rowH = 0.36;
const fillColor = highlight ? C.cardAlt : C.card;
slide.addShape(pres.shapes.RECTANGLE, {
x: 0.2, y: y, w: 9.6, h: rowH,
fill: { color: fillColor }, line: { color: C.divider, pt: 0.5 }
});
slide.addText(feature, {
x: 0.3, y: y, w: 2.8, h: rowH,
fontSize: 10, bold: true, color: C.light, valign: "middle", margin: 0
});
slide.addText(crohnVal, {
x: 3.15, y: y, w: 3.1, h: rowH,
fontSize: 10, color: C.white, valign: "middle", align: "center", margin: 0
});
slide.addText(ucVal, {
x: 6.3, y: y, w: 3.2, h: rowH,
fontSize: 10, color: C.white, valign: "middle", align: "center", margin: 0
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 1: Title
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
// Decorative left stripe - Crohn
slide.addShape(pres.shapes.RECTANGLE, {
x: 0, y: 0, w: 0.18, h: 5.625,
fill: { color: C.crohn }, line: { color: C.crohn }
});
// Decorative right stripe - UC
slide.addShape(pres.shapes.RECTANGLE, {
x: 9.82, y: 0, w: 0.18, h: 5.625,
fill: { color: C.uc }, line: { color: C.uc }
});
// Center divider
slide.addShape(pres.shapes.RECTANGLE, {
x: 4.92, y: 1.2, w: 0.06, h: 2.8,
fill: { color: C.divider }, line: { color: C.divider }
});
// Title
slide.addText("Inflammatory Bowel Disease", {
x: 0.4, y: 0.3, w: 9.2, h: 0.65,
fontSize: 28, bold: true, color: C.white, align: "center",
charSpacing: 2, fontFace: "Calibri"
});
// Subtitle line
slide.addShape(pres.shapes.RECTANGLE, {
x: 2.5, y: 1.05, w: 5, h: 0.04,
fill: { color: C.muted }, line: { color: C.muted }
});
// CD label
slide.addText("CROHN", {
x: 0.4, y: 1.15, w: 4.4, h: 0.55,
fontSize: 26, bold: true, color: C.crohn, align: "center",
charSpacing: 6, fontFace: "Calibri"
});
slide.addText("DISEASE", {
x: 0.4, y: 1.65, w: 4.4, h: 0.4,
fontSize: 18, color: C.crohn, align: "center",
charSpacing: 4, fontFace: "Calibri"
});
// UC label
slide.addText("ULCERATIVE", {
x: 5.15, y: 1.15, w: 4.4, h: 0.55,
fontSize: 26, bold: true, color: C.uc, align: "center",
charSpacing: 4, fontFace: "Calibri"
});
slide.addText("COLITIS", {
x: 5.15, y: 1.65, w: 4.4, h: 0.4,
fontSize: 18, color: C.uc, align: "center",
charSpacing: 6, fontFace: "Calibri"
});
// VS badge
slide.addShape(pres.shapes.ELLIPSE, {
x: 4.55, y: 1.25, w: 0.9, h: 0.9,
fill: { color: C.divider }, line: { color: C.muted, pt: 1 }
});
slide.addText("VS", {
x: 4.55, y: 1.25, w: 0.9, h: 0.9,
fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
// Key phrase
slide.addText("A Clinical Comparison for Medical Students", {
x: 0.4, y: 2.3, w: 9.2, h: 0.4,
fontSize: 13, color: C.muted, align: "center", italic: true
});
// 3 bottom pillars
const pillars = [
{ label: "Pathology", icon: "🔬" },
{ label: "Clinical Features", icon: "🩺" },
{ label: "Management", icon: "💊" },
];
pillars.forEach((p, i) => {
const px = 1.2 + i * 2.8;
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: px, y: 2.95, w: 2.3, h: 0.85,
fill: { color: C.card }, line: { color: C.divider, pt: 1 }, rectRadius: 0.1
});
slide.addText(`${p.icon} ${p.label}`, {
x: px, y: 2.95, w: 2.3, h: 0.85,
fontSize: 11, color: C.light, align: "center", valign: "middle"
});
});
// Source
slide.addText("Source: Goldman-Cecil Medicine · Lippincott Pharmacology · Sleisenger & Fordtran's", {
x: 0.4, y: 5.25, w: 9.2, h: 0.28,
fontSize: 8, color: C.muted, align: "center"
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 2: Overview / At a Glance
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
sectionBar(slide, "Overview — At a Glance", C.divider);
slide.addText("Key Differences at a Glance", {
x: 0.3, y: 0.6, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: C.white, align: "center"
});
// Column headers
slide.addShape(pres.shapes.RECTANGLE, {
x: 3.1, y: 1.12, w: 3.1, h: 0.38,
fill: { color: C.crohn }, line: { color: C.crohn }
});
slide.addText("CROHN DISEASE", {
x: 3.1, y: 1.12, w: 3.1, h: 0.38,
fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
slide.addShape(pres.shapes.RECTANGLE, {
x: 6.25, y: 1.12, w: 3.25, h: 0.38,
fill: { color: C.uc }, line: { color: C.uc }
});
slide.addText("ULCERATIVE COLITIS", {
x: 6.25, y: 1.12, w: 3.25, h: 0.38,
fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
const rows = [
["Location", "Mouth to anus", "Colon only"],
["Pattern", "Skip lesions (discontinuous)", "Continuous from rectum"],
["Wall involvement", "Transmural (full thickness)", "Mucosal only"],
["Ulcers", "Deep, cobblestone, aphthous", "Continuous, superficial"],
["Fistula / Stricture", "Yes — common", "No"],
["Perianal disease", "Yes (20-40%)", "No"],
["Granulomas", "Non-caseating (pathognomonic)", "Absent"],
["Cancer risk (CRC)", "Elevated (4-20× general population)", "High after 7 yrs (~10%/decade)"],
];
rows.forEach((r, i) => {
compRow(slide, r[0], r[1], r[2], 1.52 + i * 0.375, i % 2 === 0);
});
slide.addText("Goldman-Cecil Medicine, Table 127-1", {
x: 0.3, y: 5.35, w: 9.4, h: 0.2,
fontSize: 8, color: C.muted, align: "right"
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 3: Epidemiology
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
sectionBar(slide, "Epidemiology", C.divider);
slide.addText("Who Gets IBD?", {
x: 0.3, y: 0.6, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: C.white, align: "center"
});
// Crohn card
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.25, y: 1.15, w: 4.55, h: 3.9,
fill: { color: C.crohnBg }, line: { color: C.crohn, pt: 2 }, rectRadius: 0.1
});
slide.addShape(pres.shapes.RECTANGLE, {
x: 0.25, y: 1.15, w: 4.55, h: 0.45,
fill: { color: C.crohn }, line: { color: C.crohn }
});
slide.addText("🔥 CROHN DISEASE", {
x: 0.25, y: 1.15, w: 4.55, h: 0.45,
fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
const crohnEpi = [
["Peak Age", "15–30 yrs; 2nd peak in 7th decade"],
["Sex Ratio", "F:M = 1.2:1"],
["Common site", "Terminal ileum (70% of patients)"],
["Ileal only", "30% of patients"],
["Ileocolonic", "40% of patients"],
["Perianal", "20–40% develop fistulas/abscesses"],
["Smoking", "Increases risk / worsens disease"],
];
crohnEpi.forEach((item, i) => {
slide.addText([
{ text: item[0] + ": ", options: { bold: true, color: C.crohn } },
{ text: item[1], options: { color: C.light } }
], {
x: 0.45, y: 1.68 + i * 0.47, w: 4.15, h: 0.42,
fontSize: 10.5, valign: "middle"
});
});
// UC card
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 5.2, y: 1.15, w: 4.55, h: 3.9,
fill: { color: C.ucBg }, line: { color: C.uc, pt: 2 }, rectRadius: 0.1
});
slide.addShape(pres.shapes.RECTANGLE, {
x: 5.2, y: 1.15, w: 4.55, h: 0.45,
fill: { color: C.uc }, line: { color: C.uc }
});
slide.addText("💧 ULCERATIVE COLITIS", {
x: 5.2, y: 1.15, w: 4.55, h: 0.45,
fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
const ucEpi = [
["Peak Age", "20–40 yrs; smaller 2nd peak >70 yrs"],
["Sex Ratio", "F:M = 1:1"],
["Proctitis", "44–49% at diagnosis"],
["Left-sided", "36–41% at diagnosis"],
["Pancolitis", "14–37% at diagnosis"],
["Rectal involvement", "Always (disease starts in rectum)"],
["Smoking", "Protective (paradoxically)"],
];
ucEpi.forEach((item, i) => {
slide.addText([
{ text: item[0] + ": ", options: { bold: true, color: C.uc } },
{ text: item[1], options: { color: C.light } }
], {
x: 5.4, y: 1.68 + i * 0.47, w: 4.15, h: 0.42,
fontSize: 10.5, valign: "middle"
});
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 4: Pathology
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
sectionBar(slide, "Pathology & Endoscopy", C.divider);
slide.addText("Gross & Microscopic Pathology", {
x: 0.3, y: 0.6, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: C.white, align: "center"
});
twoColCard(
slide,
"🔥 Crohn Disease",
"💧 Ulcerative Colitis",
[
"Transmural inflammation (all layers)",
"Non-caseating granulomas (pathognomonic)",
"Cobblestone mucosa — deep ulcers between islands of normal mucosa",
"Skip lesions — normal segments between inflamed areas",
"Fissures, fistulas, strictures due to fibrosis",
"Aphthous ulcers are earliest endoscopic finding",
"Terminal ileum most commonly involved",
],
[
"Mucosal inflammation only (superficial)",
"No granulomas — crypt distortion + lymphocytic infiltrate",
"Continuous from rectum proximally, no skip areas",
"Diffuse erythema → granular mucosa → friable bleeding mucosa",
"Pseudopolyps = regenerating epithelium in chronic disease",
"'Backwash ileitis' — not true ileal involvement",
"Colon only — never small bowel in isolation",
],
1.1,
4.0,
C.crohn,
C.uc
);
slide.addText("Lippincott Pharmacology, Fig. 42.15 · Goldman-Cecil Medicine, p. 1482", {
x: 0.3, y: 5.37, w: 9.4, h: 0.2,
fontSize: 8, color: C.muted, align: "right"
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 5: Clinical Features
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
sectionBar(slide, "Clinical Features", C.divider);
slide.addText("Symptoms & Signs", {
x: 0.3, y: 0.6, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: C.white, align: "center"
});
twoColCard(
slide,
"🔥 Crohn Disease",
"💧 Ulcerative Colitis",
[
"RLQ pain (terminal ileal involvement)",
"Diarrhea — may not be bloody",
"Fever, weight loss",
"Palpable RLQ mass (inflamed bowel)",
"Oral ulcers (aphthae)",
"Perianal disease: fistulas, skin tags, abscesses",
"Obstructive symptoms: distension, nausea",
"B12 deficiency (ileal disease)",
],
[
"Bloody diarrhea — hallmark symptom",
"Tenesmus (constant urge to defecate)",
"Rectal urgency",
"Mucus in stool",
"Lower abdominal crampy pain",
"Proctitis may cause constipation",
"Anemia, fatigue (chronic blood loss)",
"Severe: fever, weight loss, hypoalbuminemia",
],
1.1,
4.0,
C.crohn,
C.uc
);
slide.addText("Goldman-Cecil Medicine, p. 1481–1482", {
x: 0.3, y: 5.37, w: 9.4, h: 0.2,
fontSize: 8, color: C.muted, align: "right"
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 6: Extraintestinal Manifestations
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
sectionBar(slide, "Extraintestinal Manifestations", C.divider);
slide.addText("Beyond the Gut", {
x: 0.3, y: 0.6, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: C.white, align: "center"
});
// Shared EIM
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.25, y: 1.1, w: 9.5, h: 0.6,
fill: { color: C.card }, line: { color: C.divider, pt: 1 }, rectRadius: 0.08
});
slide.addText([
{ text: "Shared by BOTH: ", options: { bold: true, color: C.light } },
{ text: "Arthropathy (most common, 10-20%) • Erythema nodosum (10-15%) • Pyoderma gangrenosum (1-2%) • Uveitis/Episcleritis (5-15%)", options: { color: C.muted } }
], {
x: 0.35, y: 1.1, w: 9.3, h: 0.6,
fontSize: 10, valign: "middle"
});
const eimRows = [
{ feature: "🦴 Arthropathy", crohn: "✅ Peripheral arthritis\nAnkylosing spondylitis\nSacroiliitis", uc: "✅ Peripheral arthritis\nAnkylosing spondylitis\nSacroiliitis" },
{ feature: "🦷 Oral ulcers", crohn: "✅ Yes (aphthous ulcers)", uc: "❌ No" },
{ feature: "🫁 PSC (liver)", crohn: "✅ Rare", uc: "✅✅ Common (2-7.5%)\n70-80% PSC patients have UC" },
{ feature: "🪨 Nephrolithiasis", crohn: "✅ Calcium oxalate (fat malabsorption)\nUric acid stones", uc: "✅ Uric acid (volume depletion)" },
{ feature: "🦴 Osteoporosis", crohn: "✅ ~15% (steroid use)", uc: "✅ ~15% (steroid use)" },
{ feature: "🩸 Thromboembolism", crohn: "✅ Increased risk in active disease", uc: "✅ Increased risk in active disease" },
{ feature: "🧠 Neurologic", crohn: "✅ B12 neuropathy, optic neuritis", uc: "✅/❌ Rare" },
];
eimRows.forEach((row, i) => {
const y = 1.75 + i * 0.5;
const highlight = i % 2 === 0;
slide.addShape(pres.shapes.RECTANGLE, {
x: 0.2, y: y, w: 9.6, h: 0.47,
fill: { color: highlight ? C.cardAlt : C.card }, line: { color: C.divider, pt: 0.5 }
});
slide.addText(row.feature, {
x: 0.3, y: y, w: 2.6, h: 0.47,
fontSize: 9.5, bold: true, color: C.light, valign: "middle", margin: 0
});
slide.addText(row.crohn, {
x: 2.95, y: y, w: 3.2, h: 0.47,
fontSize: 9, color: C.white, valign: "middle", align: "center", margin: 0
});
slide.addText(row.uc, {
x: 6.2, y: y, w: 3.3, h: 0.47,
fontSize: 9, color: C.white, valign: "middle", align: "center", margin: 0
});
});
slide.addText("Goldman-Cecil Medicine, Table 127-2", {
x: 0.3, y: 5.37, w: 9.4, h: 0.2,
fontSize: 8, color: C.muted, align: "right"
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 7: Diagnosis
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
sectionBar(slide, "Diagnosis", C.divider);
slide.addText("Diagnostic Evaluation", {
x: 0.3, y: 0.6, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: C.white, align: "center"
});
const diagData = [
{
icon: "🔭", title: "Endoscopy",
crohn: "Colonoscopy incl. terminal ileum\nAphthous → cobblestone ulcers\nSkip areas\nCapsule endoscopy (if stricture-free)",
uc: "Colonoscopy\nDiffuse erythema → friability\nContinuous from rectum\nPseudopolyps in chronic disease"
},
{
icon: "🔬", title: "Histopathology",
crohn: "Non-caseating granulomas\n(rare in biopsies, but diagnostic)\nTransmural inflammation",
uc: "Crypt distortion\nLymphocytic mucosal infiltrate\nNo granulomas"
},
{
icon: "📡", title: "Imaging",
crohn: "CT/MRI enterography (gold standard)\nDetects: strictures, fistulas, abscesses\nReplaced barium studies",
uc: "CT/MRI: assess severity, complications\nAbdominal X-ray: toxic megacolon\nBarium enema: rarely used now"
},
{
icon: "🧪", title: "Labs / Serology",
crohn: "ASCA positive (anti-Saccharomyces)\nElevated CRP, ESR\nAnemia, ↑ fecal calprotectin\nB12 deficiency (ileal disease)",
uc: "pANCA positive (60-70%)\nElevated CRP, ESR\nIron deficiency anemia (bleeding)\n↑ Fecal calprotectin"
},
];
diagData.forEach((d, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = col === 0 ? 0.25 : 5.2;
const y = 1.12 + row * 2.2;
const w = 4.55;
const h = 2.05;
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w, h,
fill: { color: C.card }, line: { color: C.divider, pt: 1 }, rectRadius: 0.08
});
slide.addShape(pres.shapes.RECTANGLE, {
x, y, w, h: 0.36,
fill: { color: C.cardAlt }, line: { color: C.divider }
});
slide.addText(`${d.icon} ${d.title}`, {
x: x + 0.1, y, w: w - 0.2, h: 0.36,
fontSize: 12, bold: true, color: C.light, valign: "middle", margin: 0
});
// Crohn sub
slide.addText("CD:", {
x: x + 0.1, y: y + 0.4, w: 0.4, h: 0.25,
fontSize: 9, bold: true, color: C.crohn, margin: 0
});
slide.addText(d.crohn, {
x: x + 0.5, y: y + 0.38, w: w - 0.6, h: 0.8,
fontSize: 9, color: C.light, valign: "top"
});
// UC sub
slide.addText("UC:", {
x: x + 0.1, y: y + 1.22, w: 0.4, h: 0.25,
fontSize: 9, bold: true, color: C.uc, margin: 0
});
slide.addText(d.uc, {
x: x + 0.5, y: y + 1.2, w: w - 0.6, h: 0.8,
fontSize: 9, color: C.light, valign: "top"
});
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 8: Treatment — Drug Classes
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
sectionBar(slide, "Treatment — Drug Classes", C.divider);
slide.addText("Pharmacological Management of IBD", {
x: 0.3, y: 0.6, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: C.white, align: "center"
});
const drugs = [
{
name: "5-Aminosalicylates\n(5-ASA)", color: "27AE60",
agents: "Sulfasalazine, Mesalamine,\nBalsalazide, Olsalazine",
cd: "Limited efficacy",
uc: "1st line — mild-moderate",
note: "Sulfasalazine: male infertility + folate depletion"
},
{
name: "Corticosteroids", color: "E67E22",
agents: "Prednisone, Methylprednisolone,\nHydrocortisone, Budesonide",
cd: "Flare induction\nBudesonide (ileocecal CD)",
uc: "Flare induction only\nNOT for maintenance",
note: "Budesonide: low systemic due to 1st-pass metabolism"
},
{
name: "Immunomodulators", color: "8E44AD",
agents: "Azathioprine, 6-MP,\nMethotrexate",
cd: "Maintenance\n(with or without biologics)",
uc: "Maintenance\n(steroid-sparing)",
note: "Not for acute induction; combine with biologics"
},
{
name: "Biologics\n(TNF-α inhibitors)", color: "C0392B",
agents: "Infliximab, Adalimumab,\nCertolizumab (CD), Golimumab (UC)",
cd: "Moderate-severe\n1st line role",
uc: "2nd line (after 5-ASA failure)\nModerate-severe",
note: "Screen for TB before use; monitor antidrug antibodies"
},
{
name: "Vedolizumab\n(α4-integrin inhibitor)", color: "16A085",
agents: "Vedolizumab (Entyvio)",
cd: "Moderate-severe CD",
uc: "Moderate-severe UC",
note: "Gut-selective; fewer systemic side effects"
},
{
name: "Ustekinumab\n(IL-12/23 inhibitor)", color: "2980B9",
agents: "Ustekinumab (Stelara)",
cd: "Refractory to anti-TNF",
uc: "Moderate-severe UC",
note: "Also used in psoriasis, psoriatic arthritis"
},
{
name: "JAK Inhibitors", color: "D35400",
agents: "Tofacitinib (Xeljanz)",
cd: "Not approved",
uc: "Mod-severe; anti-TNF refractory",
note: "Oral agent; risk: infection, VTE, herpes zoster"
},
];
// 7 cards in a grid: 4 top, 3 bottom
const cardW = 2.28;
const cardH = 1.58;
const positions = [
[0.15, 1.1], [2.52, 1.1], [4.88, 1.1], [7.25, 1.1],
[0.9, 2.82], [3.5, 2.82], [6.1, 2.82]
];
drugs.forEach((d, i) => {
const [x, y] = positions[i];
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w: cardW, h: cardH,
fill: { color: C.card }, line: { color: d.color, pt: 1.5 }, rectRadius: 0.08
});
// Top color bar
slide.addShape(pres.shapes.RECTANGLE, {
x, y, w: cardW, h: 0.32,
fill: { color: d.color }, line: { color: d.color }
});
slide.addText(d.name, {
x: x + 0.06, y, w: cardW - 0.12, h: 0.32,
fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
slide.addText(d.agents, {
x: x + 0.06, y: y + 0.34, w: cardW - 0.12, h: 0.32,
fontSize: 8, color: C.muted, align: "center", italic: true
});
slide.addText([
{ text: "CD: ", options: { bold: true, color: C.crohn } },
{ text: d.cd, options: { color: C.light } }
], {
x: x + 0.08, y: y + 0.65, w: cardW - 0.16, h: 0.35,
fontSize: 8.5, valign: "top"
});
slide.addText([
{ text: "UC: ", options: { bold: true, color: C.uc } },
{ text: d.uc, options: { color: C.light } }
], {
x: x + 0.08, y: y + 0.97, w: cardW - 0.16, h: 0.35,
fontSize: 8.5, valign: "top"
});
slide.addText("⚠ " + d.note, {
x: x + 0.06, y: y + 1.3, w: cardW - 0.12, h: 0.25,
fontSize: 7.5, color: "E8BF4D", italic: true, valign: "middle"
});
});
slide.addText("Lippincott Illustrated Reviews: Pharmacology, p. 1445–1452", {
x: 0.3, y: 5.37, w: 9.4, h: 0.2,
fontSize: 8, color: C.muted, align: "right"
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 9: Treatment Strategy
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
sectionBar(slide, "Treatment Strategy", C.divider);
slide.addText("Stepwise Management Approach", {
x: 0.3, y: 0.6, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: C.white, align: "center"
});
// UC column
slide.addShape(pres.shapes.RECTANGLE, {
x: 0.25, y: 1.12, w: 4.5, h: 0.4,
fill: { color: C.uc }, line: { color: C.uc }
});
slide.addText("💧 ULCERATIVE COLITIS", {
x: 0.25, y: 1.12, w: 4.5, h: 0.4,
fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
const ucSteps = [
{ step: "MILD-MODERATE", drugs: "5-ASA (oral ± rectal)\nPrednisone if inadequate response", color: "27AE60" },
{ step: "MODERATE-SEVERE", drugs: "Systemic steroids\n+ Immunomodulator (AZA/6-MP)\nOR Biologic (Infliximab/Adalimumab/Vedolizumab)", color: "E67E22" },
{ step: "STEROID-REFRACTORY", drugs: "Biologics + Immunomodulators\nTofacitinib (oral JAK inhibitor)", color: "C0392B" },
{ step: "SURGERY (CURATIVE)", drugs: "Total proctocolectomy\n→ Curative in UC", color: "7D3C98" },
];
ucSteps.forEach((s, i) => {
const y = 1.58 + i * 0.97;
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.25, y, w: 4.5, h: 0.88,
fill: { color: C.ucBg }, line: { color: s.color, pt: 1.5 }, rectRadius: 0.06
});
slide.addShape(pres.shapes.RECTANGLE, {
x: 0.25, y, w: 1.3, h: 0.88,
fill: { color: s.color }, line: { color: s.color }
});
slide.addText(s.step, {
x: 0.25, y, w: 1.3, h: 0.88,
fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
slide.addText(s.drugs, {
x: 1.6, y: y + 0.05, w: 3.0, h: 0.78,
fontSize: 9.5, color: C.light, valign: "middle"
});
});
// Arrow down
const arrowYs = [1.58, 2.55, 3.52];
arrowYs.forEach(y => {
slide.addText("▼", {
x: 0.25, y: y + 0.88, w: 4.5, h: 0.1,
fontSize: 9, color: C.muted, align: "center", valign: "middle", margin: 0
});
});
// CD column
slide.addShape(pres.shapes.RECTANGLE, {
x: 5.2, y: 1.12, w: 4.5, h: 0.4,
fill: { color: C.crohn }, line: { color: C.crohn }
});
slide.addText("🔥 CROHN DISEASE", {
x: 5.2, y: 1.12, w: 4.5, h: 0.4,
fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
const cdSteps = [
{ step: "MILD-MODERATE", drugs: "Budesonide (ileocecal CD)\nMetronidazole (perianal CD)", color: "27AE60" },
{ step: "MODERATE-SEVERE", drugs: "Systemic steroids\nAnti-TNF 1st line (Infliximab/Adalimumab)\n+ Immunomodulator (AZA/6-MP)", color: "E67E22" },
{ step: "REFRACTORY", drugs: "Vedolizumab\nUstekinumab\nCombination therapy", color: "C0392B" },
{ step: "SURGERY (NOT CURATIVE)", drugs: "Resection for complications\n(stricture, fistula, abscess)\nDisease recurs post-surgery", color: "7D3C98" },
];
cdSteps.forEach((s, i) => {
const y = 1.58 + i * 0.97;
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 5.2, y, w: 4.5, h: 0.88,
fill: { color: C.crohnBg }, line: { color: s.color, pt: 1.5 }, rectRadius: 0.06
});
slide.addShape(pres.shapes.RECTANGLE, {
x: 5.2, y, w: 1.3, h: 0.88,
fill: { color: s.color }, line: { color: s.color }
});
slide.addText(s.step, {
x: 5.2, y, w: 1.3, h: 0.88,
fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
slide.addText(s.drugs, {
x: 6.55, y: y + 0.05, w: 3.0, h: 0.78,
fontSize: 9.5, color: C.light, valign: "middle"
});
});
arrowYs.forEach(y => {
slide.addText("▼", {
x: 5.2, y: y + 0.88, w: 4.5, h: 0.1,
fontSize: 9, color: C.muted, align: "center", valign: "middle", margin: 0
});
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 10: Complications
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
sectionBar(slide, "Complications", C.divider);
slide.addText("Disease Complications", {
x: 0.3, y: 0.6, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: C.white, align: "center"
});
twoColCard(
slide,
"🔥 Crohn Disease",
"💧 Ulcerative Colitis",
[
"Intestinal obstruction (strictures)",
"Fistulas (enteroenteric, rectovaginal, cutaneous)",
"Intra-abdominal / perianal abscesses",
"Short bowel syndrome (after resection)",
"Malnutrition / B12 deficiency",
"Calcium oxalate kidney stones",
"CRC risk: 4-20× general population",
"Amyloidosis (chronic inflammation)",
],
[
"Toxic megacolon (life-threatening!)",
"Colonic perforation",
"Massive GI hemorrhage",
"CRC risk: starts at 7 yrs, ~10%/decade",
"Risk highest with pancolitis",
"Pseudopolyps (benign, marker of severity)",
"Primary sclerosing cholangitis",
"Thromboembolic events",
],
1.1,
4.0,
C.crohn,
C.uc
);
// Shared complications bar
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: 0.25, y: 5.12, w: 9.5, h: 0.38,
fill: { color: C.card }, line: { color: C.divider, pt: 1 }, rectRadius: 0.06
});
slide.addText("⚠ Shared: Osteoporosis (15%) · Thromboembolic disease · Steroid side effects · Avascular necrosis of hip", {
x: 0.35, y: 5.12, w: 9.3, h: 0.38,
fontSize: 9, color: "E8BF4D", valign: "middle"
});
}
// ═══════════════════════════════════════════════════════════════
// SLIDE 11: Memory Aids / Summary
// ═══════════════════════════════════════════════════════════════
{
const slide = pres.addSlide();
setBg(slide, C.bg);
sectionBar(slide, "Memory Aids", C.divider);
slide.addText("Exam Memory Aids", {
x: 0.3, y: 0.6, w: 9.4, h: 0.45,
fontSize: 20, bold: true, color: C.white, align: "center"
});
const mnemonics = [
{
title: "🔥 CD = 'CAN DO'",
color: C.crohn,
items: [
"C — Cobblestone mucosa",
"A — Anywhere (mouth to anus)",
"N — Non-caseating granulomas",
"D — Discontinuous (skip lesions)",
"O — Obstruction / fistulas",
]
},
{
title: "💧 UC = 'ULCER'",
color: C.uc,
items: [
"U — Uniform from rectum upward",
"L — Limited to colon",
"C — Continuous involvement",
"E — Erythema + bloody diarrhea",
"R — Rectum always involved",
]
},
];
mnemonics.forEach((m, i) => {
const x = i === 0 ? 0.25 : 5.15;
const w = 4.55;
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y: 1.12, w, h: 2.6,
fill: { color: C.card }, line: { color: m.color, pt: 2 }, rectRadius: 0.1
});
slide.addShape(pres.shapes.RECTANGLE, {
x, y: 1.12, w, h: 0.45,
fill: { color: m.color }, line: { color: m.color }
});
slide.addText(m.title, {
x: x + 0.1, y: 1.12, w: w - 0.2, h: 0.45,
fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", margin: 0
});
const textItems = m.items.map((item, idx) => ({
text: item,
options: { bullet: false, color: C.light, fontSize: 12, bold: idx === 0 ? false : false, breakLine: idx < m.items.length - 1 }
}));
slide.addText(textItems, {
x: x + 0.2, y: 1.62, w: w - 0.4, h: 2.0,
valign: "top", lineSpacingMultiple: 1.4
});
});
// Quick facts
const facts = [
{ label: "PSC", val: "70-80% have IBD (mostly UC)" },
{ label: "Smoking", val: "Protective in UC, harmful in CD" },
{ label: "Sulfasalazine", val: "Male infertility + give folate" },
{ label: "Surgery", val: "Curative in UC, NOT in CD" },
{ label: "Biologics", val: "Certolizumab = CD only | Golimumab = UC only" },
{ label: "Serology", val: "ASCA → CD | pANCA → UC" },
];
slide.addText("Quick Facts to Remember", {
x: 0.3, y: 3.82, w: 9.4, h: 0.32,
fontSize: 12, bold: true, color: C.light, align: "center"
});
facts.forEach((f, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const fx = 0.25 + col * 3.25;
const fy = 4.18 + row * 0.55;
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x: fx, y: fy, w: 3.1, h: 0.48,
fill: { color: C.cardAlt }, line: { color: C.divider, pt: 0.5 }, rectRadius: 0.05
});
slide.addText([
{ text: f.label + ": ", options: { bold: true, color: "E8BF4D" } },
{ text: f.val, options: { color: C.light } }
], {
x: fx + 0.1, y: fy, w: 2.9, h: 0.48,
fontSize: 9.5, valign: "middle"
});
});
}
// ═══════════════════════════════════════════════════════════════
// Save
// ═══════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/ibd-presentation/IBD_Crohn_vs_UC.pptx" })
.then(() => console.log("✅ Presentation saved: IBD_Crohn_vs_UC.pptx"))
.catch(err => { console.error("❌ Error:", err); process.exit(1); });
cd /home/daytona/workspace/ibd-presentation && node create_ibd_pptx.js
node -e "const p = require('pptxgenjs'); const pr = new p(); console.log(Object.keys(pr.ShapeType || pr.shapes || {}).slice(0,30))"
node -e "const p = require('pptxgenjs'); const pr = new p(); const shapes = Object.keys(pr.ShapeType || pr.shapes || {}); console.log(shapes.filter(s => s.toLowerCase().includes('ellipse') || s.toLowerCase().includes('oval') || s.toLowerCase().includes('circle') || s.toLowerCase().includes('rect')))"
~/ibd-presentation/create_ibd_pptx.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/ibd-presentation/create_ibd_pptx.js'
cd /home/daytona/workspace/ibd-presentation && sed -i \ 's/pres\.shapes\.RECTANGLE/pres.ShapeType.rect/g; s/pres\.shapes\.ROUNDED_RECTANGLE/pres.ShapeType.roundRect/g; s/pres\.shapes\.ELLIPSE/pres.ShapeType.ellipse/g' \ create_ibd_pptx.js && echo "Done"
cd /home/daytona/workspace/ibd-presentation && python3 -c " import re with open('create_ibd_pptx.js', 'r') as f: content = f.read() content = content.replace('pres.shapes.RECTANGLE', 'pres.ShapeType.rect') content = content.replace('pres.shapes.ROUNDED_RECTANGLE', 'pres.ShapeType.roundRect') content = content.replace('pres.shapes.ELLIPSE', 'pres.ShapeType.ellipse') with open('create_ibd_pptx.js', 'w') as f: f.write(content) print('Done') "
cd /home/daytona/workspace/ibd-presentation && node create_ibd_pptx.js
ls -lh /home/daytona/workspace/ibd-presentation/IBD_Crohn_vs_UC.pptx
IBD Crohn vs UC
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 | Title - Bold cover with VS badge and topic pillars |
| 2 | At a Glance - 8-row comparison table (location, pattern, wall, ulcers, fistula, perianal, granulomas, CRC) |
| 3 | Epidemiology - Side-by-side cards with peak age, sex ratio, disease distribution, smoking effects |
| 4 | Pathology & Endoscopy - Gross + microscopic findings for each |
| 5 | Clinical Features - Symptoms and signs side-by-side |
| 6 | Extraintestinal Manifestations - Full table including PSC, arthropathy, skin, eyes, kidneys |
| 7 | Diagnosis - 4 panels: Endoscopy, Histopathology, Imaging, Labs/Serology |
| 8 | Drug Classes - 7 drug cards (5-ASA, steroids, immunomodulators, anti-TNF, vedolizumab, ustekinumab, JAK inhibitors) |
| 9 | Treatment Strategy - Stepwise ladder for UC vs CD side by side |
| 10 | Complications - Intestinal + systemic complications for each |
| 11 | Memory Aids - CD "CAN DO" + UC "ULCER" mnemonics + 6 quick-recall facts |