generate 20 slide ppt on duodenal ulcer
mkdir -p /home/daytona/workspace/duodenal-ulcer-ppt && ls /home/daytona/workspac…
~/duodenal-ulcer-ppt/build.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Duodenal Ulcer";
pres.author = "Medical Presentation";
// ── Palette ──────────────────────────────────────────────────────────────────
const DARK_BG = "0D1B2A"; // deep navy
const MID_BG = "1B2E42"; // medium navy (section slides)
const ACCENT = "E84545"; // medical red
const GOLD = "F4A261"; // warm amber accent
const WHITE = "FFFFFF";
const LIGHT = "E8F0FE"; // pale blue-white body text bg
const SUBTEXT = "B0C4D8"; // muted blue-grey
const BODY_TEXT = "1A1A2E"; // near-black for light bg slides
// ── Helpers ───────────────────────────────────────────────────────────────────
function titleSlide(slide) {
// Dark full-bleed background
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: DARK_BG } });
// Red bar left accent
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: ACCENT } });
// Top accent line
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.07, fill: { color: ACCENT } });
// Bottom accent line
slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.555, w: 10, h: 0.07, fill: { color: ACCENT } });
}
function darkSlide(slide) {
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: DARK_BG } });
// left accent bar
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: ACCENT } });
}
function lightSlide(slide) {
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: LIGHT } });
// Top red header strip
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 1.1, fill: { color: DARK_BG } });
// Accent underline of header
slide.addShape(pres.ShapeType.rect, { x: 0, y: 1.1, w: 10, h: 0.06, fill: { color: ACCENT } });
}
function addSlideTitle(slide, text, dark = true) {
slide.addText(text, {
x: 0.35, y: 0.18, w: 9.4, h: 0.75,
fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri",
align: "left", valign: "middle", margin: 0
});
}
function addBullets(slide, items, opts = {}) {
const {
x = 0.35, y = 1.25, w = 9.3, h = 4.1,
fontSize = 17, color = BODY_TEXT, dark = false
} = opts;
const textColor = dark ? WHITE : color;
const arr = items.map((item, i) => {
if (typeof item === "string") {
return { text: item, options: { bullet: { indent: 20 }, breakLine: i < items.length - 1 } };
}
// object with { text, sub }
return [
{ text: item.text, options: { bullet: { indent: 20 }, breakLine: true, bold: true } },
{ text: item.sub, options: { bullet: { indent: 40, type: "number" }, breakLine: i < items.length - 1, fontSize: fontSize - 1 } }
];
}).flat();
slide.addText(arr, {
x, y, w, h, fontSize, color: textColor, fontFace: "Calibri", valign: "top", margin: 4
});
}
function addBodyText(slide, text, opts = {}) {
const { x = 0.35, y = 1.3, w = 9.3, h = 4.1, fontSize = 16, color = BODY_TEXT, dark = false } = opts;
slide.addText(text, {
x, y, w, h, fontSize, color: dark ? WHITE : color, fontFace: "Calibri", valign: "top", margin: 4
});
}
function sectionDivider(slide, number, title, subtitle = "") {
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: MID_BG } });
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: ACCENT } });
slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.545, w: 10, h: 0.08, fill: { color: ACCENT } });
slide.addShape(pres.ShapeType.rect, { x: 4.3, y: 0, w: 0.08, h: 5.625, fill: { color: ACCENT } });
// Left: section number
slide.addText(`${number}`, {
x: 0.3, y: 1.5, w: 3.8, h: 2.5, fontSize: 90, bold: true, color: ACCENT,
fontFace: "Calibri", align: "center", valign: "middle", margin: 0
});
// Right: title + subtitle
slide.addText(title, {
x: 4.7, y: 1.6, w: 5.1, h: 1.4, fontSize: 30, bold: true, color: WHITE,
fontFace: "Calibri", align: "left", valign: "middle", margin: 0
});
if (subtitle) {
slide.addText(subtitle, {
x: 4.7, y: 3.1, w: 5.1, h: 1.2, fontSize: 16, color: SUBTEXT,
fontFace: "Calibri", align: "left", valign: "top", margin: 0
});
}
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 1 — Title
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
titleSlide(s);
s.addText("DUODENAL ULCER", {
x: 0.5, y: 1.2, w: 9, h: 1.3, fontSize: 46, bold: true, color: WHITE,
fontFace: "Calibri", align: "center", charSpacing: 4
});
s.addShape(pres.ShapeType.rect, { x: 2.5, y: 2.55, w: 5, h: 0.06, fill: { color: ACCENT } });
s.addText("Pathophysiology • Diagnosis • Management • Complications", {
x: 0.5, y: 2.7, w: 9, h: 0.6, fontSize: 16, color: SUBTEXT,
fontFace: "Calibri", align: "center"
});
s.addText("Based on Schwartz's Principles of Surgery, Current Surgical Therapy & Yamada's Gastroenterology", {
x: 0.5, y: 4.9, w: 9, h: 0.45, fontSize: 11, color: SUBTEXT,
fontFace: "Calibri", align: "center", italic: true
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 2 — Outline
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
lightSlide(s);
addSlideTitle(s, "Presentation Outline");
const topics = [
"01 Definition & Epidemiology",
"02 Anatomy & Normal Physiology",
"03 Pathophysiology",
"04 Etiology & Risk Factors",
"05 H. pylori & NSAID-Driven Ulcers",
"06 Clinical Features",
"07 Diagnosis",
"08 Medical Management",
"09 H. pylori Eradication Regimens",
"10 Complications Overview",
"11 Perforation",
"12 Bleeding",
"13 Gastric Outlet Obstruction",
"14 Surgical Management",
"15 Summary & Key Take-Aways",
];
// two columns
const col1 = topics.slice(0, 8);
const col2 = topics.slice(8);
const makeArr = (items) => items.map((t, i) => ({
text: t, options: { breakLine: i < items.length - 1 }
}));
s.addText(makeArr(col1), {
x: 0.35, y: 1.25, w: 4.6, h: 4.0, fontSize: 14, color: BODY_TEXT, fontFace: "Calibri", valign: "top", margin: 4, lineSpacingMultiple: 1.4
});
s.addText(makeArr(col2), {
x: 5.1, y: 1.25, w: 4.6, h: 4.0, fontSize: 14, color: BODY_TEXT, fontFace: "Calibri", valign: "top", margin: 4, lineSpacingMultiple: 1.4
});
// divider line
s.addShape(pres.ShapeType.line, { x: 5.0, y: 1.3, w: 0, h: 3.9, line: { color: ACCENT, width: 1.5 } });
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 3 — Definition & Epidemiology
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
lightSlide(s);
addSlideTitle(s, "Definition & Epidemiology");
// Definition box
s.addShape(pres.ShapeType.rect, { x: 0.35, y: 1.25, w: 9.3, h: 1.0, fill: { color: DARK_BG }, line: { color: ACCENT, width: 2 } });
s.addText("A duodenal ulcer is a disruption of the mucosal integrity of the duodenum extending through the muscularis mucosae, resulting from acid-peptic injury exceeding mucosal defense capacity.", {
x: 0.45, y: 1.28, w: 9.1, h: 0.94, fontSize: 13, color: WHITE, fontFace: "Calibri", valign: "middle", margin: 4, italic: true
});
const bullets = [
"Peptic ulcer disease (PUD) affects ~2% of the US population; lifetime prevalence ~10%, peaking around age 70",
"Duodenal ulcers are ~4× more common than gastric ulcers",
"Approximately 1.5% of all Medicare hospital costs are spent treating PUD",
"Mortality rate: hospitalized duodenal ulcer patients ~3.7% (higher than gastric ulcer at 2.1%)",
"Age-adjusted hospitalization rate: 56.5 per 100,000 — down 21% over the past decade",
"Incidence rising in elderly, partly driven by increased NSAID and aspirin use",
"Men are ~2× more likely than women to develop duodenal ulcer",
];
addBullets(s, bullets, { y: 2.35, h: 3.15, fontSize: 14 });
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 4 — Anatomy & Normal Physiology
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
darkSlide(s);
addSlideTitle(s, "Anatomy & Normal Physiology");
// Left column
s.addText("Duodenal Anatomy", {
x: 0.3, y: 1.25, w: 4.5, h: 0.45, fontSize: 16, bold: true, color: GOLD,
fontFace: "Calibri", margin: 0
});
const anatomy = [
"Four parts: D1 (bulb), D2, D3, D4",
"D1 (duodenal bulb) — most common ulcer site",
"Blood supply: gastroduodenal artery (posterior to D1)",
"Kocher maneuver provides surgical access",
"Ampulla of Vater opens into D2",
];
s.addText(anatomy.map((t, i) => ({ text: t, options: { bullet: { indent: 18 }, breakLine: i < anatomy.length - 1 } })), {
x: 0.3, y: 1.75, w: 4.5, h: 2.2, fontSize: 14, color: WHITE, fontFace: "Calibri", valign: "top", margin: 2
});
// Right column
s.addText("Mucosal Defense Mechanisms", {
x: 5.1, y: 1.25, w: 4.5, h: 0.45, fontSize: 16, bold: true, color: GOLD,
fontFace: "Calibri", margin: 0
});
const defense = [
"Bicarbonate secretion: neutralizes luminal acid",
"Mucus layer: physical barrier over epithelium",
"Prostaglandins: stimulate mucus & HCO₃ secretion",
"Mucosal blood flow: removes diffused H⁺ ions",
"Epithelial restitution: rapid repair after injury",
"Tight junctions: prevent back-diffusion of H⁺",
];
s.addText(defense.map((t, i) => ({ text: t, options: { bullet: { indent: 18 }, breakLine: i < defense.length - 1 } })), {
x: 5.1, y: 1.75, w: 4.5, h: 2.5, fontSize: 14, color: WHITE, fontFace: "Calibri", valign: "top", margin: 2
});
// Bottom box
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 4.15, w: 9.4, h: 0.9, fill: { color: "1A3A5C" }, line: { color: ACCENT, width: 1 } });
s.addText("Ulceration occurs when AGGRESSIVE factors (acid, pepsin) overwhelm DEFENSIVE factors (mucus, bicarbonate, prostaglandins, blood flow)", {
x: 0.4, y: 4.18, w: 9.2, h: 0.84, fontSize: 13, color: GOLD, fontFace: "Calibri", valign: "middle", margin: 4, bold: true
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 5 — Pathophysiology
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
lightSlide(s);
addSlideTitle(s, "Pathophysiology");
const points = [
"Duodenal ulcer was traditionally viewed as a disease of increased acid-peptic action on the duodenal mucosa (vs. gastric ulcer = weakened defenses) — this distinction has now been blurred",
"Final common pathway: acid-peptic injury exceeding mucosal defense capacity",
"DU patients as a group show higher mean Basal Acid Output (BAO) and Mean Acid Output (MAO) vs. normal controls, but many individuals overlap with normal range",
"DU patients produce more acid in response to all known stimuli (meal, gastrin, histamine, carbachol)",
"H. pylori causes acid hypersecretion AND compromises mucosal defense (dual mechanism)",
"NSAIDs impair prostaglandin synthesis → reduced mucus, bicarbonate, mucosal blood flow",
"Acid suppression alone heals ulcers and prevents recurrence if continued — confirming acid as the final mediator",
];
addBullets(s, points, { y: 1.28, h: 4.2, fontSize: 14 });
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 6 — Etiology & Risk Factors
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
darkSlide(s);
addSlideTitle(s, "Etiology & Risk Factors");
const causes = [
{ label: "H. pylori", color: ACCENT, pct: "Up to 90%", detail: "Most common cause; present in ~90% of DU patients" },
{ label: "NSAIDs / Aspirin", color: GOLD, pct: "~10-15%", detail: "Second major cause; impair prostaglandin-mediated defenses" },
{ label: "Zollinger-Ellison", color: "5BC0EB", pct: "<1%", detail: "Gastrinoma → massive acid hypersecretion" },
{ label: "Smoking", color: "A0C4FF", pct: "2× risk", detail: "Increases acid, decreases HCO₃ & prostaglandins" },
{ label: "Other", color: SUBTEXT, pct: "Rare", detail: "Systemic mastocytosis, burns (Curling's), head injury (Cushing's), crack cocaine" },
];
causes.forEach((c, i) => {
const y = 1.3 + i * 0.83;
s.addShape(pres.ShapeType.rect, { x: 0.25, y, w: 2.1, h: 0.65, fill: { color: c.color }, line: { color: c.color, width: 1 } });
s.addText(c.label, { x: 0.25, y, w: 2.1, h: 0.65, fontSize: 13, bold: true, color: DARK_BG, fontFace: "Calibri", align: "center", valign: "middle" });
s.addShape(pres.ShapeType.rect, { x: 2.4, y, w: 1.1, h: 0.65, fill: { color: "1A3A5C" }, line: { color: c.color, width: 1 } });
s.addText(c.pct, { x: 2.4, y, w: 1.1, h: 0.65, fontSize: 13, bold: true, color: c.color, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText(c.detail, { x: 3.6, y: y + 0.07, w: 6.1, h: 0.55, fontSize: 13, color: WHITE, fontFace: "Calibri", valign: "middle", margin: 4 });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 7 — H. pylori & NSAID Mechanisms
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
lightSlide(s);
addSlideTitle(s, "H. pylori & NSAID Mechanisms");
// H. pylori panel
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.25, w: 4.5, h: 3.95, fill: { color: "F8F9FF" }, line: { color: ACCENT, width: 2 } });
s.addText("H. pylori", { x: 0.35, y: 1.35, w: 4.3, h: 0.4, fontSize: 17, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0 });
const hpyl = [
"Gram-negative spiral bacterium colonising antrum",
"Produces urease → ammonia → mucosal injury",
"Causes antral gastritis → impairs somatostatin → ↑ gastrin → ↑ acid",
"Bacterial lipopolysaccharides + cytotoxins damage epithelium",
"Present in ~90% of duodenal ulcer patients",
"Eradication alone heals ulcer and prevents recurrence",
];
s.addText(hpyl.map((t, i) => ({ text: t, options: { bullet: { indent: 16 }, breakLine: i < hpyl.length - 1 } })), {
x: 0.35, y: 1.8, w: 4.3, h: 3.2, fontSize: 13, color: BODY_TEXT, fontFace: "Calibri", valign: "top", margin: 2
});
// NSAID panel
s.addShape(pres.ShapeType.rect, { x: 5.0, y: 1.25, w: 4.7, h: 3.95, fill: { color: "FFF8F0" }, line: { color: GOLD, width: 2 } });
s.addText("NSAIDs / Aspirin", { x: 5.1, y: 1.35, w: 4.5, h: 0.4, fontSize: 17, bold: true, color: GOLD, fontFace: "Calibri", margin: 0 });
const nsaid = [
"Inhibit COX-1 → ↓ prostaglandin E₂ and I₂",
"↓ Mucus and bicarbonate secretion",
"↓ Mucosal blood flow",
"↑ Epithelial permeability to H⁺ back-diffusion",
"Topical acid damage from direct NSAID contact",
"Risk multiplied when combined with H. pylori",
"PPI co-prescription dramatically reduces NSAID ulcer risk",
];
s.addText(nsaid.map((t, i) => ({ text: t, options: { bullet: { indent: 16 }, breakLine: i < nsaid.length - 1 } })), {
x: 5.1, y: 1.8, w: 4.5, h: 3.2, fontSize: 13, color: BODY_TEXT, fontFace: "Calibri", valign: "top", margin: 2
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 8 — Clinical Features
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
darkSlide(s);
addSlideTitle(s, "Clinical Features");
// Typical pain box
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.25, w: 9.5, h: 0.9, fill: { color: "1A3A5C" }, line: { color: ACCENT, width: 2 } });
s.addText([
{ text: "Classic Pain: ", options: { bold: true, color: GOLD } },
{ text: "Burning epigastric pain, 2–3 hours after meals, often waking patient at night (2/3 of DU patients). Relieved by food or antacids.", options: { color: WHITE } }
], { x: 0.35, y: 1.3, w: 9.3, h: 0.8, fontSize: 14, fontFace: "Calibri", valign: "middle", margin: 4 });
// Symptoms list
s.addText("Symptoms & Signs", { x: 0.25, y: 2.3, w: 4.5, h: 0.4, fontSize: 15, bold: true, color: GOLD, fontFace: "Calibri", margin: 0 });
const sx = [
"Epigastric pain (>90% of patients)",
"Nausea, bloating",
"Weight loss (less common in DU than GU)",
"Occult blood in stool / iron deficiency anaemia",
"Symptoms often periodic with remissions",
"May be SILENT until complication arises",
];
s.addText(sx.map((t, i) => ({ text: t, options: { bullet: { indent: 16 }, breakLine: i < sx.length - 1 } })), {
x: 0.25, y: 2.75, w: 4.5, h: 2.65, fontSize: 13, color: WHITE, fontFace: "Calibri", valign: "top", margin: 2
});
// DU vs GU
s.addText("DU vs. Gastric Ulcer Pain", { x: 5.1, y: 2.3, w: 4.5, h: 0.4, fontSize: 15, bold: true, color: GOLD, fontFace: "Calibri", margin: 0 });
const compare = [
{ text: "DU:", options: { bold: true, color: ACCENT, breakLine: false } },
{ text: " Pain 2–3 h postprandial, relieved by eating, wakes from sleep", options: { color: WHITE, breakLine: true } },
{ text: "GU:", options: { bold: true, color: GOLD, breakLine: false } },
{ text: " Pain with eating (worse), less likely to wake at night", options: { color: WHITE, breakLine: true } },
{ text: "Both:", options: { bold: true, color: SUBTEXT, breakLine: false } },
{ text: " Nonradiating, burning, epigastric location", options: { color: WHITE, breakLine: false } },
];
s.addText(compare, {
x: 5.1, y: 2.75, w: 4.5, h: 2.65, fontSize: 13, fontFace: "Calibri", valign: "top", margin: 4
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 9 — Diagnosis
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
lightSlide(s);
addSlideTitle(s, "Diagnosis");
const steps = [
{ label: "1. Empiric PPI", color: "27AE60", detail: "Young patients with dyspepsia, no alarm symptoms → trial of PPI without endoscopy" },
{ label: "2. Endoscopy (EGD)", color: ACCENT, detail: "Gold standard. Required if: alarm symptoms, persistent dyspepsia, cannot stop NSAIDs. Biopsy not required for DU (but biopsy any gastric ulcer to exclude malignancy)" },
{ label: "3. Upper GI Series", color: GOLD, detail: "Double-contrast barium study — useful where endoscopy unavailable" },
{ label: "4. H. pylori Testing", color: "5BC0EB", detail: "Urea breath test, stool antigen, or biopsy/rapid urease test (RUT). All positive patients should be treated" },
{ label: "5. Serum Gastrin", color: "9B59B6", detail: "Rule out Zollinger-Ellison syndrome in refractory or recurrent ulcers without obvious cause" },
];
// Alarm symptoms box
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.25, w: 9.5, h: 0.72, fill: { color: DARK_BG }, line: { color: ACCENT, width: 2 } });
s.addText([
{ text: "ALARM SYMPTOMS requiring urgent EGD: ", options: { bold: true, color: ACCENT } },
{ text: "Dysphagia, weight loss, early satiety, haematemesis, melaena, anaemia, palpable mass, age >55 with new dyspepsia", options: { color: WHITE } }
], { x: 0.35, y: 1.28, w: 9.3, h: 0.66, fontSize: 12.5, fontFace: "Calibri", valign: "middle", margin: 2 });
steps.forEach((st, i) => {
const y = 2.1 + i * 0.67;
s.addShape(pres.ShapeType.rect, { x: 0.25, y, w: 2.0, h: 0.55, fill: { color: st.color }, line: { color: st.color } });
s.addText(st.label, { x: 0.25, y, w: 2.0, h: 0.55, fontSize: 12, bold: true, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText(st.detail, { x: 2.35, y: y + 0.04, w: 7.4, h: 0.5, fontSize: 12.5, color: BODY_TEXT, fontFace: "Calibri", valign: "middle", margin: 2 });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 10 — H. pylori Testing
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
darkSlide(s);
addSlideTitle(s, "H. pylori — Diagnostic Tests");
// Table header
const headers = ["Test", "Invasive?", "Sensitivity", "Notes"];
const colX = [0.2, 3.5, 4.9, 6.1];
const colW = [3.2, 1.3, 1.1, 3.7];
s.addShape(pres.ShapeType.rect, { x: 0.2, y: 1.25, w: 9.6, h: 0.5, fill: { color: ACCENT } });
headers.forEach((h, i) => {
s.addText(h, { x: colX[i], y: 1.28, w: colW[i], h: 0.44, fontSize: 14, bold: true, color: WHITE, fontFace: "Calibri", valign: "middle", margin: 4 });
});
const rows = [
["Urea Breath Test (UBT)", "No", "~95%", "Best for confirming eradication; avoid PPI 2 wks prior"],
["Stool Antigen Test", "No", "~94%", "Non-invasive; equally accurate for active infection"],
["Rapid Urease Test (RUT)", "Yes (biopsy)", "~90%", "Done at endoscopy; quick result; false-neg if on PPI"],
["Histology", "Yes (biopsy)", "~95%", "Gold standard; detects both infection and gastritis"],
["Culture", "Yes (biopsy)", "~75%", "Allows sensitivity testing; useful for resistance patterns"],
["Serology (IgG)", "No", "~85%", "Not useful for confirming eradication; stays positive"],
["RT-PCR", "Yes (biopsy)", ">95%", "Detects resistance genes; increasingly used"],
];
rows.forEach((r, i) => {
const y = 1.78 + i * 0.52;
const bg = i % 2 === 0 ? "1A2E45" : "142235";
s.addShape(pres.ShapeType.rect, { x: 0.2, y, w: 9.6, h: 0.49, fill: { color: bg } });
r.forEach((cell, j) => {
s.addText(cell, { x: colX[j], y: y + 0.03, w: colW[j], h: 0.44, fontSize: 12, color: j === 0 ? GOLD : WHITE, fontFace: "Calibri", valign: "middle", margin: 3 });
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 11 — Medical Management
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
lightSlide(s);
addSlideTitle(s, "Medical Management");
const boxes = [
{ title: "1 Acid Suppression", color: ACCENT, items: ["PPI (e.g. omeprazole 20 mg OD before breakfast) — first-line", "H₂-receptor antagonists (less effective than PPIs)", "Long-term PPI indicated after hospitalization for DU complication"] },
{ title: "2 H. pylori Eradication", color: GOLD, items: ["Treat all confirmed H. pylori positive patients", "Eradication alone heals ulcer and prevents recurrence", "Up to 90% of DU patients harbor H. pylori"] },
{ title: "3 NSAID / Risk Modification", color: "27AE60", items: ["Stop NSAIDs where clinically possible", "If unavoidable: co-prescribe PPI daily", "Aspirin (CV prophylaxis) permissible with concurrent PPI"] },
{ title: "4 Lifestyle", color: "5BC0EB", items: ["Smoking cessation (doubles ulcer risk)", "Dietary modifications (avoid acidic/spicy triggers)", "Limit alcohol"] },
];
boxes.forEach((b, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = col === 0 ? 0.25 : 5.1;
const y = 1.25 + row * 2.05;
s.addShape(pres.ShapeType.rect, { x, y, w: 4.6, h: 1.9, fill: { color: "F0F4FF" }, line: { color: b.color, width: 2 } });
s.addShape(pres.ShapeType.rect, { x, y, w: 4.6, h: 0.42, fill: { color: b.color } });
s.addText(b.title, { x, y, w: 4.6, h: 0.42, fontSize: 13.5, bold: true, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText(b.items.map((t, j) => ({ text: t, options: { bullet: { indent: 14 }, breakLine: j < b.items.length - 1 } })), {
x: x + 0.1, y: y + 0.46, w: 4.4, h: 1.4, fontSize: 12, color: BODY_TEXT, fontFace: "Calibri", valign: "top", margin: 2
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 12 — H. pylori Eradication Regimens
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
darkSlide(s);
addSlideTitle(s, "H. pylori Eradication Regimens (10–14 Days)");
const regimens = [
{ name: "Standard Triple Therapy", color: ACCENT, drugs: "PPI (BD) + Clarithromycin 500 mg BD + Amoxicillin 1 g BD", notes: "First-line where clarithromycin resistance <15%" },
{ name: "Bismuth Quadruple", color: GOLD, drugs: "PPI + Bismuth subcitrate + Metronidazole 400 mg TDS + Tetracycline 500 mg QDS", notes: "Preferred in high clarithromycin resistance areas; salvage therapy" },
{ name: "Levofloxacin Triple", color: "5BC0EB", drugs: "PPI (BD) + Levofloxacin 500 mg OD + Amoxicillin 1 g BD", notes: "Second-line; use when clarithromycin resistance suspected" },
{ name: "Concomitant Therapy", color: "27AE60", drugs: "PPI + Clarithromycin + Amoxicillin + Metronidazole (all BD, simultaneously)", notes: "High eradication rates; good in mixed resistance areas" },
{ name: "Sequential Therapy", color: "9B59B6", drugs: "Days 1–5: PPI + Amoxicillin; Days 6–10: PPI + Clarithromycin + Metronidazole", notes: "Alternative approach; check local resistance patterns" },
];
regimens.forEach((r, i) => {
const y = 1.28 + i * 0.84;
s.addShape(pres.ShapeType.rect, { x: 0.2, y, w: 2.3, h: 0.72, fill: { color: r.color } });
s.addText(r.name, { x: 0.2, y, w: 2.3, h: 0.72, fontSize: 11.5, bold: true, color: DARK_BG, fontFace: "Calibri", align: "center", valign: "middle", margin: 2 });
s.addShape(pres.ShapeType.rect, { x: 2.55, y, w: 9.55 - 2.55, h: 0.72, fill: { color: "12243A" } });
s.addText([
{ text: r.drugs + " ", options: { bold: false, color: WHITE } },
{ text: "— " + r.notes, options: { bold: false, color: SUBTEXT, italic: true } }
], { x: 2.62, y: y + 0.04, w: 7.1, h: 0.65, fontSize: 12, fontFace: "Calibri", valign: "middle", margin: 2 });
});
s.addText("Confirm eradication 4+ weeks post-treatment with UBT or stool antigen test (NOT serology)", {
x: 0.2, y: 5.25, w: 9.6, h: 0.3, fontSize: 11.5, color: GOLD, fontFace: "Calibri", italic: true, align: "center"
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 13 — Complications Overview
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
lightSlide(s);
addSlideTitle(s, "Complications — Overview");
const comps = [
{ icon: "🔴", name: "Haemorrhage", freq: "Most common reason for hospitalisation & death", key: "Managed medically/endoscopically; surgery reserved for failure" },
{ icon: "💥", name: "Perforation", freq: "Most common indication for emergency surgery", key: "Acute abdomen; up to 30% mortality if delayed; CT shows pneumoperitoneum" },
{ icon: "🚫", name: "Gastric Outlet Obstruction", freq: "Least common (<5%); late complication", key: "Repeated scarring of duodenal bulb → pyloric stenosis; requires surgical relief" },
{ icon: "↑", name: "Penetration", freq: "Posterior DU erodes into pancreas", key: "Pain radiating to back, elevated amylase; may mimic pancreatitis" },
];
comps.forEach((c, i) => {
const y = 1.28 + i * 1.04;
s.addShape(pres.ShapeType.rect, { x: 0.25, y, w: 9.5, h: 0.9, fill: { color: i % 2 === 0 ? "EAF0FB" : "F8F4FF" }, line: { color: ACCENT, width: 1 } });
s.addText(c.name, { x: 0.35, y: y + 0.04, w: 2.5, h: 0.5, fontSize: 15, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0 });
s.addText(c.freq, { x: 0.35, y: y + 0.48, w: 3.5, h: 0.38, fontSize: 11.5, color: MID_BG, fontFace: "Calibri", italic: true, margin: 0 });
s.addText(c.key, { x: 3.95, y: y + 0.1, w: 5.7, h: 0.75, fontSize: 13, color: BODY_TEXT, fontFace: "Calibri", valign: "middle", margin: 4 });
s.addShape(pres.ShapeType.line, { x: 3.85, y: y + 0.12, w: 0, h: 0.7, line: { color: ACCENT, width: 1.5 } });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 14 — Perforation
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
darkSlide(s);
addSlideTitle(s, "Perforated Duodenal Ulcer");
// Left: Presentation
s.addText("Presentation", { x: 0.25, y: 1.28, w: 4.5, h: 0.4, fontSize: 15, bold: true, color: GOLD, fontFace: "Calibri", margin: 0 });
const pres_sx = [
"Sudden onset severe epigastric pain — patient can pinpoint exact moment",
"Rigid, board-like abdomen — generalised peritonitis",
"Tachycardia (early) → fever, tachypnea → hypotension (late)",
"Leukocytosis; may have prior DU history",
"\"Kissing ulcers\": bleeding posterior ulcer + perforated anterior ulcer",
];
s.addText(pres_sx.map((t, i) => ({ text: t, options: { bullet: { indent: 16 }, breakLine: i < pres_sx.length - 1 } })), {
x: 0.25, y: 1.72, w: 4.5, h: 2.6, fontSize: 13, color: WHITE, fontFace: "Calibri", valign: "top", margin: 2
});
// Right: Diagnosis & Management
s.addText("Diagnosis & Management", { x: 5.1, y: 1.28, w: 4.6, h: 0.4, fontSize: 15, bold: true, color: GOLD, fontFace: "Calibri", margin: 0 });
const mgmt = [
"CXR: pneumoperitoneum in ~85–90% of cases",
"CT abdomen: extraluminal air ± free fluid (nearly always positive)",
"Prompt IV fluids + analgesia + NG tube + catheter",
"Urgent surgery: Graham patch repair (omental patch over perforation)",
"Laparoscopic repair feasible in stable patients",
"Mortality up to 30% — rises sharply with delayed intervention",
"Post-op: long-term PPI + empiric H. pylori eradication",
];
s.addText(mgmt.map((t, i) => ({ text: t, options: { bullet: { indent: 16 }, breakLine: i < mgmt.length - 1 } })), {
x: 5.1, y: 1.72, w: 4.6, h: 3.4, fontSize: 13, color: WHITE, fontFace: "Calibri", valign: "top", margin: 2
});
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 4.9, w: 9.5, h: 0.45, fill: { color: ACCENT } });
s.addText("Delay = Death: every hour of delay after perforation significantly increases mortality", {
x: 0.3, y: 4.93, w: 9.4, h: 0.38, fontSize: 12, bold: true, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle"
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 15 — Bleeding DU
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
lightSlide(s);
addSlideTitle(s, "Bleeding Duodenal Ulcer");
// Risk stratification table
s.addText("Risk Stratification", { x: 0.25, y: 1.28, w: 4.5, h: 0.4, fontSize: 14, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0 });
const riskRows = [
["Score", "Glasgow-Blatchford", "Rockall"],
["Purpose", "Predict need for treatment", "Predict mortality"],
["Low risk", "0–1: outpatient safe", "0–1: 0% mortality"],
["High risk", "≥6: 50% need endoscopic Rx", "≥8: 40% mortality"],
["Factors", "BUN, Hgb, BP, HR, melena, liver disease", "Age, shock, comorbidity, EGD findings"],
];
const tcolX = [0.25, 2.05, 3.95];
const tcolW = [1.75, 1.85, 0.7];
riskRows.forEach((r, i) => {
const y = 1.72 + i * 0.62;
const bg = i === 0 ? DARK_BG : (i % 2 === 0 ? "EAF0FB" : WHITE);
s.addShape(pres.ShapeType.rect, { x: 0.25, y, w: 4.6, h: 0.58, fill: { color: bg }, line: { color: SUBTEXT, width: 0.5 } });
r.forEach((cell, j) => {
s.addText(cell, {
x: tcolX[j] ?? (0.25 + j * 1.52), y: y + 0.04, w: j < 2 ? 1.75 : 2.8, h: 0.5,
fontSize: 11.5, color: i === 0 ? WHITE : BODY_TEXT, bold: i === 0, fontFace: "Calibri", valign: "middle", margin: 2
});
});
});
// Management steps
s.addText("Management Algorithm", { x: 5.1, y: 1.28, w: 4.6, h: 0.4, fontSize: 14, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0 });
const steps = [
{ step: "1", text: "IV PPI infusion + IV fluids → 75% stop spontaneously" },
{ step: "2", text: "Urgent EGD: haemostasis with cautery, clips, epinephrine injection" },
{ step: "3", text: "Rebleeding → repeat EGD; if fails → angioembolisation" },
{ step: "4", text: "Surgery if: haemodynamic instability + >6 units transfused or failed endoscopy" },
{ step: "5", text: "Surgical options: oversewing ± vagotomy + drainage; V+A (rarely)" },
];
steps.forEach((st, i) => {
const y = 1.72 + i * 0.72;
s.addShape(pres.ShapeType.ellipse, { x: 5.1, y: y + 0.06, w: 0.48, h: 0.48, fill: { color: ACCENT } });
s.addText(st.step, { x: 5.1, y: y + 0.06, w: 0.48, h: 0.48, fontSize: 14, bold: true, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText(st.text, { x: 5.67, y: y + 0.08, w: 4.1, h: 0.5, fontSize: 12.5, color: BODY_TEXT, fontFace: "Calibri", valign: "middle", margin: 2 });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 16 — Endoscopic Stigmata (Forrest Classification)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
darkSlide(s);
addSlideTitle(s, "Forrest Classification — Endoscopic Stigmata");
const forest = [
{ class: "Ia", desc: "Spurting haemorrhage", rebleed: "~55%", mortal: "~11%", rx: "Endoscopic therapy mandatory" },
{ class: "Ib", desc: "Oozing haemorrhage", rebleed: "~55%", mortal: "~11%", rx: "Endoscopic therapy" },
{ class: "IIa", desc: "Non-bleeding visible vessel", rebleed: "~43%", mortal: "~11%", rx: "Endoscopic therapy mandatory" },
{ class: "IIb", desc: "Adherent clot", rebleed: "~22%", mortal: "~7%", rx: "Attempt clot removal + therapy" },
{ class: "IIc", desc: "Haematin-covered flat spot", rebleed: "~10%", mortal: "~3%", rx: "Medical management sufficient" },
{ class: "III", desc: "Clean base ulcer", rebleed: "~5%", mortal: "~2%", rx: "Early discharge; outpatient PPI" },
];
const cols = ["Class", "Finding", "Rebleed %", "Mortality", "Management"];
const cX = [0.2, 1.1, 4.1, 5.4, 6.6];
const cW = [0.85, 3.0, 1.2, 1.1, 3.1];
s.addShape(pres.ShapeType.rect, { x: 0.2, y: 1.25, w: 9.6, h: 0.45, fill: { color: ACCENT } });
cols.forEach((c, i) => {
s.addText(c, { x: cX[i], y: 1.28, w: cW[i], h: 0.38, fontSize: 13, bold: true, color: WHITE, fontFace: "Calibri", valign: "middle", margin: 3 });
});
forest.forEach((r, i) => {
const y = 1.73 + i * 0.63;
const bgColor = i < 2 ? "3D0000" : (i < 4 ? "2A2000" : "0D2A0D");
s.addShape(pres.ShapeType.rect, { x: 0.2, y, w: 9.6, h: 0.58, fill: { color: bgColor } });
const cells = [r.class, r.desc, r.rebleed, r.mortal, r.rx];
cells.forEach((c, j) => {
const textColor = j === 0 ? (i < 2 ? ACCENT : i < 4 ? GOLD : "7BFF7B") : WHITE;
s.addText(c, { x: cX[j], y: y + 0.04, w: cW[j], h: 0.5, fontSize: 12, color: textColor, bold: j === 0, fontFace: "Calibri", valign: "middle", margin: 3 });
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 17 — Gastric Outlet Obstruction
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
lightSlide(s);
addSlideTitle(s, "Gastric Outlet Obstruction (GOO)");
// Definition
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.25, w: 9.5, h: 0.7, fill: { color: DARK_BG }, line: { color: GOLD, width: 2 } });
s.addText("Cicatricial (scar) narrowing of the duodenal bulb or pylorus from repeated ulceration and healing — least common DU complication (<5% of cases).", {
x: 0.35, y: 1.28, w: 9.3, h: 0.64, fontSize: 13, color: WHITE, fontFace: "Calibri", valign: "middle", margin: 4, italic: true
});
s.addText("Clinical Features", { x: 0.25, y: 2.08, w: 4.5, h: 0.38, fontSize: 14, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0 });
const feat = [
"Projectile non-bilious vomiting (food eaten hours/days ago)",
"Succussion splash on examination",
"Progressive weight loss + malnutrition",
"Metabolic alkalosis: hypochloraemia, hypokalaemia",
"Dehydration (paradoxical aciduria — urine pH low despite alkalosis)",
];
s.addText(feat.map((t, i) => ({ text: t, options: { bullet: { indent: 16 }, breakLine: i < feat.length - 1 } })), {
x: 0.25, y: 2.5, w: 4.5, h: 2.8, fontSize: 13, color: BODY_TEXT, fontFace: "Calibri", valign: "top", margin: 2
});
s.addText("Management", { x: 5.1, y: 2.08, w: 4.6, h: 0.38, fontSize: 14, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0 });
const mgmt = [
"Nasogastric decompression + IV PPI",
"Correct fluid and electrolyte abnormalities first",
"Endoscopic balloon dilatation: first-line for benign stricture",
"Surgical options if dilatation fails or recurs:",
" • Truncal vagotomy + gastrojejunostomy",
" • Vagotomy + antrectomy (V/A)",
"Always biopsy stricture to exclude malignancy",
];
s.addText(mgmt.map((t, i) => ({ text: t, options: { bullet: { indent: 16 }, breakLine: i < mgmt.length - 1 } })), {
x: 5.1, y: 2.5, w: 4.6, h: 2.8, fontSize: 13, color: BODY_TEXT, fontFace: "Calibri", valign: "top", margin: 2
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 18 — Surgical Management
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
darkSlide(s);
addSlideTitle(s, "Surgical Management");
const ops = [
{
name: "Graham Patch Repair",
ind: "Perforated DU",
color: ACCENT,
detail: "Omental patch sutured over perforation; most common emergency procedure. Consider H. pylori Rx + PPI post-op."
},
{
name: "Truncal Vagotomy + Pyloroplasty (V+P)",
ind: "Bleeding / Intractable DU",
color: GOLD,
detail: "Reduces acid by 75%; adds drainage procedure to prevent post-vagotomy gastric stasis. Lower risk than V+A."
},
{
name: "Vagotomy + Antrectomy (V/A)",
ind: "Definitive / Recurrent DU",
color: "5BC0EB",
detail: "Most effective at preventing recurrence; removes antral gastrin source. Reserved for stable, fit patients. Avoid in malnourished."
},
{
name: "Highly Selective Vagotomy (HSV)",
ind: "Elective / Intractable DU",
color: "27AE60",
detail: "Divides parietal-cell vagal branches only; preserves pyloric function. Lowest side-effect profile but highest recurrence rate."
},
{
name: "Oversewing ± Vagotomy",
ind: "Bleeding DU (emergency)",
color: "9B59B6",
detail: "30-day mortality: oversewing alone 27%, V+drainage 12%, V+antrectomy 23%. Prefer V+drainage in stable patients."
},
];
ops.forEach((op, i) => {
const y = 1.28 + i * 0.83;
s.addShape(pres.ShapeType.rect, { x: 0.2, y, w: 3.1, h: 0.72, fill: { color: op.color } });
s.addText([
{ text: op.name + "\n", options: { bold: true, fontSize: 12, breakLine: false } },
{ text: "Ind: " + op.ind, options: { bold: false, fontSize: 10, italic: true } }
], { x: 0.2, y, w: 3.1, h: 0.72, fontSize: 12, color: DARK_BG, fontFace: "Calibri", align: "center", valign: "middle", margin: 2 });
s.addShape(pres.ShapeType.rect, { x: 3.35, y, w: 6.45, h: 0.72, fill: { color: "12243A" } });
s.addText(op.detail, { x: 3.42, y: y + 0.04, w: 6.3, h: 0.65, fontSize: 12, color: WHITE, fontFace: "Calibri", valign: "middle", margin: 3 });
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 19 — Special Situations
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
lightSlide(s);
addSlideTitle(s, "Special Situations & Rare Causes");
const specials = [
{
title: "Zollinger-Ellison Syndrome (ZES)",
color: ACCENT,
points: ["Gastrin-secreting tumour (gastrinoma) of pancreas/duodenum", "Refractory or multiple ulcers, often distal duodenum/jejunum", "Fasting serum gastrin >1000 pg/mL + basal acid output >15 mEq/h", "Secretin stimulation test: paradoxical rise in gastrin", "Treatment: high-dose PPI + surgical resection if localised"]
},
{
title: "Stress Ulcers",
color: GOLD,
points: ["Curling's ulcer: burns (catecholamine-driven ischaemia)", "Cushing's ulcer: head injury (vagal hyperstimulation → hyperacidity)", "ICU prophylaxis: IV PPI or H₂ blocker in ventilated, coagulopathic patients", "Treatment mirrors standard DU management"]
},
{
title: "Drug-Induced & Other",
color: "5BC0EB",
points: ["Crack cocaine: juxtapyloric ulcers with propensity to perforate", "Systemic mastocytosis: histamine-driven acid hypersecretion", "Antral G-cell hyperplasia/hyperfunction: benign hypergastrinaemia", "Idiopathic DU: H. pylori negative, NSAID negative — consider ZES workup"]
},
];
specials.forEach((sp, i) => {
const y = 1.25 + i * 1.42;
s.addShape(pres.ShapeType.rect, { x: 0.25, y, w: 9.5, h: 1.28, fill: { color: "F4F6FF" }, line: { color: sp.color, width: 2 } });
s.addShape(pres.ShapeType.rect, { x: 0.25, y, w: 2.6, h: 0.38, fill: { color: sp.color } });
s.addText(sp.title, { x: 0.3, y: y + 0.02, w: 2.5, h: 0.34, fontSize: 12, bold: true, color: WHITE, fontFace: "Calibri", valign: "middle", margin: 0 });
s.addText(sp.points.join(" • "), {
x: 0.35, y: y + 0.42, w: 9.2, h: 0.82, fontSize: 11.5, color: BODY_TEXT, fontFace: "Calibri", valign: "top", margin: 2
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 20 — Summary & Key Take-Aways
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
const s = pres.addSlide();
titleSlide(s);
s.addText("Key Take-Aways", {
x: 0.5, y: 0.2, w: 9, h: 0.65, fontSize: 28, bold: true, color: WHITE,
fontFace: "Calibri", align: "center", charSpacing: 2
});
s.addShape(pres.ShapeType.rect, { x: 2.0, y: 0.9, w: 6, h: 0.05, fill: { color: ACCENT } });
const takeaways = [
{ num: "01", text: "H. pylori and NSAIDs account for >90% of duodenal ulcers — address both in every patient" },
{ num: "02", text: "Classic DU pain: epigastric, burning, 2–3 h postprandial, wakes from sleep, relieved by food" },
{ num: "03", text: "EGD is gold standard; biopsy DU is not required, but biopsy all gastric ulcers to exclude malignancy" },
{ num: "04", text: "Medical management: PPI + H. pylori eradication + NSAID cessation + smoking cessation" },
{ num: "05", text: "Perforation: surgical emergency (Graham patch); delay dramatically increases mortality" },
{ num: "06", text: "Bleeding: 75% stop with IV PPI; EGD hemostasis for high-risk Forrest stigmata; surgery is last resort" },
{ num: "07", text: "Confirm H. pylori eradication 4 weeks post-therapy with UBT or stool antigen (not serology)" },
];
takeaways.forEach((ta, i) => {
const col = i < 4 ? 0 : 1;
const row = col === 0 ? i : i - 4;
const x = col === 0 ? 0.25 : 5.15;
const y = 1.1 + row * 1.08;
s.addShape(pres.ShapeType.rect, { x, y, w: 0.56, h: 0.56, fill: { color: ACCENT } });
s.addText(ta.num, { x, y, w: 0.56, h: 0.56, fontSize: 14, bold: true, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText(ta.text, { x: x + 0.65, y: y + 0.02, w: 4.25, h: 0.6, fontSize: 12, color: WHITE, fontFace: "Calibri", valign: "middle", margin: 2 });
});
s.addText("Sources: Schwartz's Surgery 11e · Current Surgical Therapy 14e · Yamada's Gastroenterology 7e", {
x: 0.5, y: 5.35, w: 9, h: 0.25, fontSize: 10, color: SUBTEXT, fontFace: "Calibri", align: "center", italic: true
});
}
// ── Write file ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/duodenal-ulcer-ppt/Duodenal_Ulcer.pptx" })
.then(() => console.log("Done: /home/daytona/workspace/duodenal-ulcer-ppt/Duodenal_Ulcer.pptx"))
.catch(err => { console.error(err); process.exit(1); });
cd /home/daytona/workspace/duodenal-ulcer-ppt && node build.js 2>&1
ls -lh /home/daytona/workspace/duodenal-ulcer-ppt/Duodenal_Ulcer.pptx
Duodenal Ulcer
Presentation · PPTX
| # | Slide |
|---|---|
| 1 | Title slide — bold navy/red design |
| 2 | Presentation outline (two-column) |
| 3 | Definition & Epidemiology |
| 4 | Anatomy & Normal Physiology / Mucosal Defense |
| 5 | Pathophysiology |
| 6 | Etiology & Risk Factors (visual card layout) |
| 7 | H. pylori vs. NSAID Mechanisms (side-by-side panels) |
| 8 | Clinical Features (DU vs. GU pain comparison) |
| 9 | Diagnosis (alarm symptoms + step-by-step approach) |
| 10 | H. pylori Diagnostic Tests (formatted table with sensitivity data) |
| 11 | Medical Management (4-box layout: PPIs, H. pylori, NSAID, lifestyle) |
| 12 | H. pylori Eradication Regimens (5 regimens with drugs and duration) |
| 13 | Complications Overview |
| 14 | Perforated Duodenal Ulcer (presentation + management) |
| 15 | Bleeding DU (Glasgow-Blatchford/Rockall + management algorithm) |
| 16 | Forrest Classification (colour-coded rebleed/mortality table) |
| 17 | Gastric Outlet Obstruction |
| 18 | Surgical Options (5 procedures with indications + detail) |
| 19 | Special Situations (ZES, stress ulcers, rare causes) |
| 20 | Key Take-Aways summary |
make each slide has 10 points and each point will have not more than 10 words
~/duodenal-ulcer-ppt/build2.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Duodenal Ulcer";
// ── Palette ──────────────────────────────────────────────────────────────────
const DARK_BG = "0D1B2A";
const MID_BG = "1B2E42";
const ACCENT = "E84545";
const GOLD = "F4A261";
const WHITE = "FFFFFF";
const LIGHT_BG = "EEF3FB";
const SUBTEXT = "B0C4D8";
const BODY = "1A1A2E";
// ── Shared slide background helper ──────────────────────────────────────────
function addDarkBg(s) {
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color: DARK_BG } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.12, h:5.625, fill:{ color: ACCENT } });
}
function addLightBg(s) {
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color: LIGHT_BG } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:1.05, fill:{ color: DARK_BG } });
s.addShape(pres.ShapeType.rect, { x:0, y:1.05, w:10, h:0.06, fill:{ color: ACCENT } });
}
function addTitle(s, text, dark=true) {
s.addText(text, {
x:0.28, y:0.15, w:9.5, h:0.75,
fontSize:24, bold:true, color:WHITE, fontFace:"Calibri",
align:"left", valign:"middle", margin:0
});
}
// 10-point bullet renderer — auto-sizes to fill slide body
function addBullets10(s, points, dark=false) {
const textColor = dark ? WHITE : BODY;
const bgBox = dark ? "122034" : "FFFFFF";
const numColor = ACCENT;
// body area: y=1.18 to y=5.50 => h=4.32 => each row ~0.432
const rowH = 0.432;
const startY = 1.18;
points.forEach((pt, i) => {
const y = startY + i * rowH;
// number badge
s.addShape(pres.ShapeType.rect, { x:0.18, y:y+0.03, w:0.34, h:0.34, fill:{ color: ACCENT }, rectRadius:0.05 });
s.addText(`${i+1}`, { x:0.18, y:y+0.03, w:0.34, h:0.34, fontSize:11, bold:true, color:WHITE, fontFace:"Calibri", align:"center", valign:"middle" });
// row bg (alternating)
s.addShape(pres.ShapeType.rect, { x:0.60, y:y+0.02, w:9.22, h:0.38,
fill:{ color: i%2===0 ? (dark?"172B42":"EEF3FB") : (dark?"0D1B2A":"FFFFFF") } });
// text
s.addText(pt, {
x:0.68, y:y+0.02, w:9.1, h:0.38,
fontSize:14.5, color: textColor, fontFace:"Calibri", valign:"middle", margin:3
});
});
}
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// All 20 slides — data-driven
// Each slide: { title, dark, points[10] (≤10 words each) }
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
const slides = [
// 1 — Title/Overview
{
title: "Duodenal Ulcer — Overview",
dark: true,
subtitle: "Pathophysiology • Diagnosis • Management • Complications",
isTitle: true,
points: [] // title slide handled separately
},
// 2 — Definition & Epidemiology
{
title: "Definition & Epidemiology",
dark: true,
points: [
"Mucosal break extending through muscularis mucosae in duodenum",
"Peptic ulcer disease affects ~2% of US population",
"Lifetime cumulative prevalence approximately 10%",
"Duodenal ulcers are 4× more common than gastric ulcers",
"Men are twice as likely as women to develop DU",
"Peak incidence occurs around age 70 years",
"Hospitalized DU mortality rate is ~3.7%",
"Age-adjusted admission rate: 56.5 per 100,000",
"Hospitalization rates fell 21% over the past decade",
"Costs exceed $8 billion per year in the US",
]
},
// 3 — Anatomy
{
title: "Relevant Anatomy",
dark: false,
points: [
"Duodenum has four parts: D1, D2, D3, D4",
"D1 (duodenal bulb) is the most common ulcer site",
"Posterior D1 wall is adjacent to gastroduodenal artery",
"GDA erosion causes severe, life-threatening haemorrhage",
"Ampulla of Vater opens into D2 segment",
"Kocher maneuver mobilises duodenum for surgical access",
"Portal vein lies posterior to the duodenal head",
"Common bile duct runs within the pancreatic head",
"D2–D3 junction is fixed at ligament of Treitz",
"Brunner's glands in D1 secrete alkaline mucus",
]
},
// 4 — Normal Physiology
{
title: "Normal Gastroduodenal Physiology",
dark: true,
points: [
"Parietal cells secrete HCl via H⁺/K⁺-ATPase pump",
"Chief cells produce pepsinogen, activated to pepsin by acid",
"Gastrin (G-cells) stimulates acid secretion from antrum",
"Somatostatin (D-cells) inhibits gastrin and acid release",
"Mucus layer forms physical barrier over epithelium",
"Bicarbonate secretion neutralises acid at mucosal surface",
"Prostaglandins stimulate mucus and bicarbonate production",
"Mucosal blood flow removes back-diffused hydrogen ions",
"Vagal stimulation increases acid output (cephalic phase)",
"Secretin from duodenum inhibits acid and stimulates HCO₃",
]
},
// 5 — Pathophysiology
{
title: "Pathophysiology of Duodenal Ulcer",
dark: false,
points: [
"Final pathway: acid-peptic injury exceeds mucosal defenses",
"DU traditionally = increased acid vs. weakened defenses",
"This distinction is now known to be oversimplified",
"H. pylori causes acid excess AND impairs mucosal defense",
"NSAIDs inhibit COX-1, reducing protective prostaglandins",
"DU patients show higher mean BAO and MAO",
"Many DU patients have acid outputs in normal range",
"No direct correlation between acid level and ulcer severity",
"Acid suppression alone heals ulcers and prevents recurrence",
"Smoking increases acid and decreases bicarbonate secretion",
]
},
// 6 — Etiology & Risk Factors
{
title: "Etiology & Risk Factors",
dark: true,
points: [
"H. pylori infection: present in up to 90% of DU",
"NSAIDs / aspirin: second most common cause",
"Smoking doubles the risk of peptic ulcer disease",
"Zollinger-Ellison syndrome causes acid hypersecretion",
"Systemic mastocytosis: histamine drives excess acid",
"Antral G-cell hyperplasia causes benign hypergastrinaemia",
"Burns cause Curling's ulcer via ischaemic mucosal injury",
"Head injury causes Cushing's ulcer via vagal stimulation",
"Crack cocaine linked to juxtapyloric ulcers that perforate",
"Psychologic stress exacerbates ulceration in susceptible patients",
]
},
// 7 — H. pylori Mechanism
{
title: "H. pylori — Mechanism of Ulceration",
dark: false,
points: [
"Gram-negative spiral bacterium colonising the gastric antrum",
"Produces urease: converts urea to toxic ammonia",
"Ammonia directly damages gastric epithelial cells",
"Causes antral gastritis → impairs somatostatin secretion",
"Reduced somatostatin → increased gastrin → increased acid",
"Bacterial toxins (CagA, VacA) damage epithelial integrity",
"Promotes gastric metaplasia in duodenum → ulcer site",
"Present in ~90% of duodenal ulcer patients worldwide",
"Eradication alone heals ulcer and prevents recurrence",
"Confirmed eradication required 4+ weeks after treatment",
]
},
// 8 — NSAID Mechanism
{
title: "NSAID-Induced Duodenal Ulcer",
dark: true,
points: [
"NSAIDs inhibit COX-1 enzyme → reduced prostaglandins",
"PGE₂ and PGI₂ normally protect gastroduodenal mucosa",
"Reduced mucus and bicarbonate output follow NSAID use",
"Mucosal blood flow decreases, impairing rapid repair",
"Epithelial permeability to H⁺ back-diffusion increases",
"Topical acid injury from direct NSAID mucosal contact",
"Risk multiplied when combined with H. pylori infection",
"Aspirin irreversibly inhibits COX-1 at low doses",
"Selective COX-2 inhibitors carry lower but real GI risk",
"PPI co-prescription dramatically reduces NSAID ulcer risk",
]
},
// 9 — Clinical Features
{
title: "Clinical Features",
dark: false,
points: [
"Epigastric burning pain present in >90% of patients",
"Pain classically occurs 2–3 hours after meals",
"Two-thirds of patients wake at night with pain",
"Pain is typically relieved by food or antacids",
"Nausea, bloating, and early satiety are common",
"Weight loss is less common than in gastric ulcer",
"Occult blood in stool causes iron deficiency anaemia",
"Symptoms are often periodic with spontaneous remissions",
"May be completely silent until a complication occurs",
"NSAID users often present directly with complications",
]
},
// 10 — Diagnosis
{
title: "Diagnosis",
dark: true,
points: [
"EGD (endoscopy) is the gold standard for diagnosis",
"Young patients with no alarm symptoms: trial PPI first",
"Biopsy duodenal ulcer is NOT routinely required",
"All gastric ulcers must be biopsied to exclude malignancy",
"Double-contrast barium study: useful where EGD unavailable",
"Test all patients for H. pylori (UBT or stool antigen)",
"Alarm symptoms mandate urgent EGD regardless of age",
"Alarm signs: dysphagia, weight loss, haematemesis, anaemia",
"Serum gastrin if recurrent or refractory ulcers present",
"CT abdomen if perforation or obstruction is suspected",
]
},
// 11 — H. pylori Tests
{
title: "H. pylori Diagnostic Tests",
dark: false,
points: [
"Urea breath test (UBT): non-invasive, sensitivity ~95%",
"Stool antigen test: non-invasive, accuracy ~94%",
"Rapid urease test (RUT): done at endoscopy on biopsy",
"Histology: gold standard; detects infection and gastritis",
"Culture: allows antibiotic sensitivity/resistance testing",
"Serology (IgG): NOT useful for confirming eradication",
"RT-PCR: detects resistance genes; increasingly adopted",
"Withhold PPIs 2 weeks before UBT to avoid false negatives",
"Withhold antibiotics 4 weeks before any H. pylori test",
"ALL positive patients must receive eradication therapy",
]
},
// 12 — Medical Management
{
title: "Medical Management",
dark: true,
points: [
"PPI (e.g., omeprazole 20 mg OD) is first-line therapy",
"H. pylori eradication mandatory in all positive patients",
"Stop NSAIDs wherever clinically possible",
"If NSAIDs unavoidable: co-prescribe daily PPI",
"Long-term PPI after hospitalisation for DU complication",
"Aspirin for CV prophylaxis: permissible with PPI cover",
"Smoking cessation: reduces recurrence and complications",
"Alcohol limitation advised; confirmatory data are limited",
"Evaluate for gastrinoma in refractory or recurrent cases",
"Routine follow-up EGD not needed after DU healing",
]
},
// 13 — H. pylori Eradication Regimens
{
title: "H. pylori Eradication Regimens (10–14 Days)",
dark: false,
points: [
"Standard triple: PPI + clarithromycin + amoxicillin (BD)",
"Use where clarithromycin resistance is below 15%",
"Bismuth quadruple: PPI + bismuth + metronidazole + tetracycline",
"Quadruple therapy preferred in high-resistance regions",
"Levofloxacin triple: second-line if clarithromycin resistance",
"Concomitant therapy: PPI + all three antibiotics simultaneously",
"Sequential: amoxicillin 5 days, then triple for 5 days",
"Check local resistance patterns before choosing regimen",
"Confirm eradication: UBT or stool antigen, NOT serology",
"Test at least 4 weeks after completing antibiotic course",
]
},
// 14 — Complications Overview
{
title: "Complications of Duodenal Ulcer",
dark: true,
points: [
"Haemorrhage: most common cause of hospitalisation and death",
"Perforation: most common indication for emergency surgery",
"Gastric outlet obstruction: least common, chronic complication",
"Penetration: posterior ulcer erodes into adjacent pancreas",
"Bleeding ulcer causes haematemesis and/or melaena",
"Perforated ulcer causes acute peritonitis and pneumoperitoneum",
"Obstruction causes projectile non-bilious vomiting",
"Penetration mimics acute pancreatitis with back pain",
"NSAID users may perforate without prior pain symptoms",
"Elderly patients have higher mortality from all complications",
]
},
// 15 — Perforation
{
title: "Perforated Duodenal Ulcer",
dark: false,
points: [
"Sudden severe epigastric pain — patient recalls exact onset",
"Rigid board-like abdomen with generalised peritonitis",
"Tachycardia early; hypotension is a late sign",
"CXR shows pneumoperitoneum in ~85–90% of cases",
"CT abdomen almost always reveals extraluminal air",
"Mortality up to 30%; rises sharply with delay",
"Prompt IV fluids, NG tube, catheter, antibiotics",
"Graham patch repair: omental plug sutured over hole",
"Laparoscopic repair is feasible in stable patients",
"Post-op: long-term PPI + H. pylori eradication therapy",
]
},
// 16 — Bleeding DU
{
title: "Bleeding Duodenal Ulcer",
dark: true,
points: [
"Most common DU emergency; leading cause of death",
"75% of bleeds stop spontaneously with IV PPI alone",
"Glasgow-Blatchford score identifies low-risk outpatients",
"Rockall score predicts rebleed risk and mortality",
"Urgent EGD: cautery, clips, epinephrine injection",
"Forrest Ia/IIa lesions require immediate endoscopic therapy",
"Rebleeding: repeat EGD then consider angioembolisation",
"Surgery if >6 units transfused or haemodynamic instability",
"Surgical options: oversewing ± vagotomy and drainage",
"Vagotomy + drainage gives lower 30-day mortality than oversewing",
]
},
// 17 — Forrest Classification
{
title: "Forrest Classification — Bleeding Stigmata",
dark: false,
points: [
"Ia: active spurting — rebleed 55%, endoscopic therapy mandatory",
"Ib: active oozing — rebleed 55%, endoscopic therapy indicated",
"IIa: visible vessel — rebleed 43%, treat endoscopically",
"IIb: adherent clot — rebleed 22%, attempt removal and treat",
"IIc: flat pigmented spot — rebleed 10%, medical therapy",
"III: clean ulcer base — rebleed 5%, early discharge safe",
"Forrest I and IIa: highest mortality, require ICU observation",
"IV PPI infusion reduces rebleed rate in all Forrest classes",
"Posterior DU bleeds may involve gastroduodenal artery",
"GDA bleed can cause exsanguinating, life-threatening haemorrhage",
]
},
// 18 — Gastric Outlet Obstruction
{
title: "Gastric Outlet Obstruction",
dark: true,
points: [
"Caused by chronic scarring of duodenal bulb or pylorus",
"Least common DU complication; occurs in <5% of cases",
"Presents with projectile non-bilious vomiting of old food",
"Succussion splash positive on abdominal examination",
"Progressive weight loss and malnutrition develop over time",
"Metabolic alkalosis: hypochloraemia and hypokalaemia",
"Initial treatment: NG decompression + IV PPI + fluids",
"Correct electrolytes before any surgical or endoscopic intervention",
"Endoscopic balloon dilatation: first-line for benign stricture",
"Surgical relief (vagotomy + gastrojejunostomy) if dilatation fails",
]
},
// 19 — Surgical Management
{
title: "Surgical Management of Duodenal Ulcer",
dark: false,
points: [
"Graham patch: omental repair for perforated DU",
"Truncal vagotomy + pyloroplasty: reduces acid by ~75%",
"V+P adds drainage to prevent post-vagotomy gastric stasis",
"Vagotomy + antrectomy (V/A): most effective recurrence prevention",
"V/A removes antral gastrin source; avoid in malnourished patients",
"Highly selective vagotomy: preserves pyloric function, elective only",
"HSV has lowest side effects but highest recurrence rate",
"Oversewing alone for bleeding: 27% 30-day postoperative mortality",
"Vagotomy + drainage: 12% mortality — preferred in bleeding DU",
"Surgery now mostly emergency; elective surgery is rarely needed",
]
},
// 20 — Summary
{
title: "Key Take-Aways",
dark: true,
points: [
"H. pylori and NSAIDs cause >90% of duodenal ulcers",
"Classic pain: epigastric, burning, 2–3 h postprandial",
"Two-thirds of DU patients wake at night in pain",
"EGD is gold standard; no biopsy needed for DU",
"PPI + H. pylori eradication + NSAID cessation = cure",
"Perforation: surgical emergency; delay dramatically raises mortality",
"75% of bleeds stop with IV PPI; EGD for high-risk stigmata",
"Forrest Ia and IIa require mandatory endoscopic haemostasis",
"Confirm H. pylori eradication with UBT, not serology",
"Long-term PPI required after any DU-related hospitalisation",
]
},
];
// ── Render slides ─────────────────────────────────────────────────────────────
slides.forEach((sd, idx) => {
const s = pres.addSlide();
if (sd.isTitle) {
// ── Special title slide ──────────────────────────────────────────────────
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color: DARK_BG } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.08, fill:{ color: ACCENT } });
s.addShape(pres.ShapeType.rect, { x:0, y:5.545, w:10, h:0.08, fill:{ color: ACCENT } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.18, h:5.625, fill:{ color: ACCENT } });
s.addText("DUODENAL ULCER", {
x:0.5, y:1.3, w:9, h:1.4, fontSize:50, bold:true, color:WHITE,
fontFace:"Calibri", align:"center", charSpacing:5
});
s.addShape(pres.ShapeType.rect, { x:2.2, y:2.75, w:5.6, h:0.07, fill:{ color: ACCENT } });
s.addText(sd.subtitle, {
x:0.5, y:2.9, w:9, h:0.6, fontSize:17, color:SUBTEXT,
fontFace:"Calibri", align:"center"
});
s.addText("A Comprehensive Clinical Review", {
x:0.5, y:3.6, w:9, h:0.5, fontSize:14, color:GOLD,
fontFace:"Calibri", align:"center", italic:true
});
s.addText("Sources: Schwartz's Surgery 11e · Current Surgical Therapy 14e · Yamada's Gastroenterology 7e", {
x:0.5, y:5.1, w:9, h:0.35, fontSize:10.5, color:SUBTEXT,
fontFace:"Calibri", align:"center", italic:true
});
// slide number label
s.addText(`${idx+1} / ${slides.length}`, {
x:9.3, y:5.35, w:0.65, h:0.22, fontSize:9, color:SUBTEXT,
fontFace:"Calibri", align:"right"
});
return;
}
// ── Regular slides ────────────────────────────────────────────────────────
if (sd.dark) addDarkBg(s); else addLightBg(s);
addTitle(s, sd.title, sd.dark);
// Slide number
s.addText(`${idx+1} / ${slides.length}`, {
x:9.2, y:0.22, w:0.72, h:0.3, fontSize:9, color:SUBTEXT,
fontFace:"Calibri", align:"right"
});
addBullets10(s, sd.points, sd.dark);
});
// ── Write ─────────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/duodenal-ulcer-ppt/Duodenal_Ulcer_v2.pptx" })
.then(() => console.log("Done: Duodenal_Ulcer_v2.pptx"))
.catch(err => { console.error(err); process.exit(1); });
cd /home/daytona/workspace/duodenal-ulcer-ppt && node build2.js 2>&1
ls -lh /home/daytona/workspace/duodenal-ulcer-ppt/Duodenal_Ulcer_v2.pptx
Duodenal Ulcer v2
Presentation · PPTX
| # | Slide Title |
|---|---|
| 1 | Title / Overview |
| 2 | Definition & Epidemiology |
| 3 | Relevant Anatomy |
| 4 | Normal Gastroduodenal Physiology |
| 5 | Pathophysiology |
| 6 | Etiology & Risk Factors |
| 7 | H. pylori — Mechanism of Ulceration |
| 8 | NSAID-Induced Duodenal Ulcer |
| 9 | Clinical Features |
| 10 | Diagnosis |
| 11 | H. pylori Diagnostic Tests |
| 12 | Medical Management |
| 13 | H. pylori Eradication Regimens |
| 14 | Complications Overview |
| 15 | Perforated Duodenal Ulcer |
| 16 | Bleeding Duodenal Ulcer |
| 17 | Forrest Classification |
| 18 | Gastric Outlet Obstruction |
| 19 | Surgical Management |
| 20 | Key Take-Aways |
make each slide has 10 points and each point will have not more than 10 words
ls -lh /home/daytona/workspace/duodenal-ulcer-ppt/Duodenal_Ulcer_v2.pptx
Duodenal Ulcer v2
Presentation · PPTX