Topic is Describe the clinical features, investigations and principles of management of disorders of small intestine including Short gut syndrome Add relevant pictures to the presentation
What format would you like this in? · Who is the target audience?
small intestine disorders clinical features investigations management medical education diagrams
mkdir -p /home/daytona/workspace/small-intestine-ppt && ls /home/daytona/workspace/small-intestine-ppt/
~/small-intestine-ppt/create_pptx.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// Fetch images
const imageUrls = [
"https://cdn.orris.care/cdss_images/158bc9cc39e323c81d9f0cccaa784bfbb067bab526f2241ccac5c8435bc1e400.png",
"https://cdn.orris.care/cdss_images/d2918e8deba389a22ac8f4bbb21a6215b76958fc3eccdb92b55aa48059500ff8.png"
];
let images = [];
try {
images = JSON.parse(execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js "${imageUrls[0]}" "${imageUrls[1]}"`
).toString());
} catch(e) {
console.log("Image fetch error:", e.message);
}
const obsImg = images[0] && !images[0].error ? images[0].base64 : null;
const stepImg = images[1] && !images[1].error ? images[1].base64 : null;
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Medical Education";
pres.title = "Disorders of Small Intestine";
// ─── Color palette ───────────────────────────────────────────────────
const C = {
navy: "0D2B55", // dominant dark
teal: "1A7A8A", // supporting
accent: "E8A020", // warm gold accent
light: "EEF4F7", // light background
white: "FFFFFF",
text: "1C2B36",
subtext: "4A6070",
red: "C0392B",
green: "1E8449",
};
// ─── Helper: section slide ───────────────────────────────────────────
function sectionSlide(title, subtitle) {
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 4.8, w: "100%", h: 0.8, fill: { color: C.teal } });
sl.addShape(pres.ShapeType.rect, { x: 0.5, y: 1.8, w: 0.1, h: 2, fill: { color: C.accent } });
sl.addText(title, { x: 0.8, y: 1.8, w: 8.5, h: 2, fontSize: 38, bold: true, color: C.white, fontFace: "Calibri" });
if (subtitle) {
sl.addText(subtitle, { x: 0.8, y: 3.9, w: 8.5, h: 0.7, fontSize: 18, color: C.accent, fontFace: "Calibri" });
}
return sl;
}
// ─── Helper: content slide ───────────────────────────────────────────
function contentSlide(title, bullets, opts = {}) {
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } });
sl.addText(title, { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });
const bx = opts.imgRight ? 0.3 : 0.3;
const bw = opts.imgRight ? 5.7 : 9.4;
const by = 1.05;
const bh = opts.imgRight ? 4.3 : 4.3;
const items = bullets.map((b, i) => {
if (typeof b === "object") {
const arr = [];
arr.push({ text: b.head, options: { bullet: { type: "bullet" }, bold: true, color: C.navy, fontSize: b.size || 15, breakLine: true, fontFace: "Calibri" } });
if (b.sub) {
b.sub.forEach((s, si) => {
arr.push({ text: " " + s, options: { bullet: false, color: C.text, fontSize: (b.size || 15) - 1, breakLine: si < b.sub.length - 1, fontFace: "Calibri" } });
});
}
return arr;
}
return { text: b, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 14, breakLine: i < bullets.length - 1, fontFace: "Calibri" } };
}).flat();
sl.addText(items, { x: bx, y: by, w: bw, h: bh, valign: "top" });
if (opts.imgRight && opts.imgData) {
sl.addImage({ data: opts.imgData, x: 6.15, y: 1.05, w: 3.55, h: 4.3 });
}
return sl;
}
// ─── Helper: two-column slide ─────────────────────────────────────────
function twoColSlide(title, leftItems, rightItems, leftTitle, rightTitle) {
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } });
sl.addText(title, { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });
// Left column
sl.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.0, w: 4.4, h: 4.5, fill: { color: C.white }, line: { color: C.teal, width: 1.5 } });
sl.addText(leftTitle, { x: 0.3, y: 1.0, w: 4.4, h: 0.45, fontSize: 14, bold: true, color: C.white, fontFace: "Calibri", align: "center", fill: { color: C.teal } });
sl.addText(leftItems.map((t, i) => ({ text: t, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 13, breakLine: i < leftItems.length - 1, fontFace: "Calibri" } })),
{ x: 0.4, y: 1.5, w: 4.2, h: 3.9, valign: "top" });
// Right column
sl.addShape(pres.ShapeType.rect, { x: 5.3, y: 1.0, w: 4.4, h: 4.5, fill: { color: C.white }, line: { color: C.accent, width: 1.5 } });
sl.addText(rightTitle, { x: 5.3, y: 1.0, w: 4.4, h: 0.45, fontSize: 14, bold: true, color: C.white, fontFace: "Calibri", align: "center", fill: { color: C.accent } });
sl.addText(rightItems.map((t, i) => ({ text: t, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 13, breakLine: i < rightItems.length - 1, fontFace: "Calibri" } })),
{ x: 5.4, y: 1.5, w: 4.2, h: 3.9, valign: "top" });
return sl;
}
// ─────────────────────────────────────────────────────────────────────
// SLIDE 1 – TITLE
// ─────────────────────────────────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 4.6, w: "100%", h: 1.025, fill: { color: C.teal } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 2.1, w: "100%", h: 0.08, fill: { color: C.accent } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 2.18, w: "100%", h: 0.02, fill: { color: C.white } });
sl.addText("Disorders of the Small Intestine", {
x: 0.5, y: 0.3, w: 9, h: 1.8, fontSize: 40, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle"
});
sl.addText("Clinical Features • Investigations • Management", {
x: 0.5, y: 2.3, w: 9, h: 0.7, fontSize: 20, color: C.accent, fontFace: "Calibri", align: "center"
});
sl.addText("Including Short Gut Syndrome", {
x: 0.5, y: 3.05, w: 9, h: 0.55, fontSize: 18, color: C.light, fontFace: "Calibri", align: "center"
});
sl.addText("For MBBS Students | General Surgery & Medicine", {
x: 0.5, y: 4.7, w: 9, h: 0.7, fontSize: 15, color: C.white, fontFace: "Calibri", align: "center", valign: "middle"
});
}
// ─────────────────────────────────────────────────────────────────────
// SLIDE 2 – OVERVIEW / ANATOMY
// ─────────────────────────────────────────────────────────────────────
contentSlide("Anatomy & Overview of Small Intestine", [
{ head: "Three segments: Duodenum | Jejunum | Ileum", sub: ["Total length: 6–7 m in vivo (3 m contracted)", "Duodenum: 25 cm, retroperitoneal, C-shaped"] },
{ head: "Functions", sub: ["Digestion and absorption of nutrients, water, electrolytes", "Immune surveillance (Peyer's patches, IgA secretion)", "Endocrine functions (GIP, CCK, secretin, motilin)"] },
{ head: "Ileum — unique absorptive sites", sub: ["Vitamin B12 (intrinsic factor complex)", "Bile salts (enterohepatic circulation)", "Fat-soluble vitamins A, D, E, K"] },
{ head: "Key disorders covered in this presentation", sub: ["Crohn's disease | Celiac disease | Tropical sprue", "Intestinal obstruction | Intussusception", "Short gut syndrome | SIBO | Intestinal tumors"] },
]);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 3 – SECTION: INFLAMMATORY DISORDERS
// ─────────────────────────────────────────────────────────────────────
sectionSlide("1. Inflammatory Disorders", "Crohn's Disease • Celiac Disease • Tropical Sprue");
// ─────────────────────────────────────────────────────────────────────
// SLIDE 4 – CROHN'S DISEASE: CLINICAL FEATURES
// ─────────────────────────────────────────────────────────────────────
contentSlide("Crohn's Disease – Clinical Features", [
{ head: "Definition", sub: ["Transmural, granulomatous, skip-lesion inflammation — anywhere from mouth to anus", "Most common in terminal ileum (ileitis) and ileocaecal region"] },
{ head: "Symptoms (small intestine involvement)", sub: ["Abdominal pain: postprandial, crampy (partial obstruction) in 90%", "Diarrhoea (non-bloody in SI disease), weight loss, anorexia", "Palpable RLQ mass (thickened bowel / abscess / phlegmon)"] },
{ head: "Complications", sub: ["Strictures → bowel obstruction; Fistulas (enteroenteric, enterovesical, enterovaginal)", "Abscess formation; Perianal disease (fissures, fistulas, skin tags) in ~40%"] },
{ head: "Extraintestinal manifestations", sub: ["Joints: ankylosing spondylitis, sacroiliitis, seronegative polyarthritis", "Skin: erythema nodosum, pyoderma gangrenosum", "Eyes: uveitis, episcleritis; Liver: primary sclerosing cholangitis (rare)"] },
]);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 5 – CROHN'S DISEASE: INVESTIGATIONS & MANAGEMENT
// ─────────────────────────────────────────────────────────────────────
twoColSlide("Crohn's Disease – Investigations & Management",
["Bloods: FBC (anaemia), ESR/CRP, albumin (low)", "Stool: culture, C. diff toxin, faecal calprotectin ↑↑", "Endoscopy: ileoscopy — cobblestone mucosa, skip lesions, deep ulcers", "CT/MRI enterography: wall thickening, creeping fat, fistulas", "Barium follow-through: string sign of Kantor (stricture)", "Histology: transmural inflammation, non-caseating granulomas"],
["5-ASA (mild), corticosteroids (moderate flare)", "Immunomodulators: azathioprine, 6-MP (maintenance)", "Biologics: anti-TNF (infliximab, adalimumab)", "Surgery: resection for obstruction, fistulas, abscess (conservative — preserve bowel)", "Nutritional support: elemental diet, TPN if severe", "Monitor: colonoscopy for dysplasia after 10 yrs"],
"Investigations", "Management"
);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 6 – CELIAC DISEASE
// ─────────────────────────────────────────────────────────────────────
contentSlide("Celiac Disease (Gluten-Sensitive Enteropathy)", [
{ head: "Pathophysiology", sub: ["Autoimmune enteropathy triggered by gluten (wheat/barley/rye) in genetically predisposed (HLA-DQ2/DQ8)", "IgA anti-gliadin, anti-endomysial (EMA), anti-tTG antibodies → villous atrophy"] },
{ head: "Clinical Features", sub: ["Classic: diarrhoea, steatorrhoea, bloating, weight loss, failure to thrive (children)", "Atypical: iron-deficiency anaemia, osteoporosis, dermatitis herpetiformis, infertility", "Silent: asymptomatic, found on screening"] },
{ head: "Investigations", sub: ["Serology: anti-tTG IgA (sensitivity ~95%), IgA level (exclude deficiency)", "Endoscopy + duodenal biopsy: villous atrophy, crypt hyperplasia, intraepithelial lymphocytes (Marsh III)", "HLA typing (DQ2/DQ8 — high NPV to exclude)"] },
{ head: "Management", sub: ["Strict lifelong gluten-free diet — cornerstone of treatment", "Nutritional supplementation: iron, folate, B12, calcium, vitamin D", "Refractory celiac: corticosteroids, azathioprine"] },
]);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 7 – TROPICAL SPRUE
// ─────────────────────────────────────────────────────────────────────
contentSlide("Tropical Sprue", [
{ head: "Definition", sub: ["Acquired malabsorption disorder in residents of / visitors to tropical regions", "Likely caused by bacterial overgrowth (enterotoxigenic organisms + folate depletion)"] },
{ head: "Clinical Features", sub: ["Diarrhoea (3–10 loose stools/day), steatorrhoea, weight loss", "Macrocytic / megaloblastic anaemia (folate/B12 deficiency)", "Glossitis, oedema, wasting"] },
{ head: "Investigations", sub: ["Blood: megaloblastic anaemia, low serum folate & B12", "D-xylose absorption test: reduced absorption (villous atrophy)", "Biopsy: partial villous atrophy (less severe than celiac), not IgA mediated", "Stool: fat globules, no parasites"] },
{ head: "Management", sub: ["Folic acid + B12 replacement (2–3 months)", "Tetracycline 250 mg QID for 3–6 months (eradicates bacterial overgrowth)", "Response expected within weeks; most achieve full remission"] },
]);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 8 – SECTION: OBSTRUCTIVE DISORDERS
// ─────────────────────────────────────────────────────────────────────
sectionSlide("2. Obstructive Disorders", "Intestinal Obstruction • Intussusception • Volvulus");
// ─────────────────────────────────────────────────────────────────────
// SLIDE 9 – INTESTINAL OBSTRUCTION (with image)
// ─────────────────────────────────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } });
sl.addText("Intestinal Obstruction – Small Bowel", { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });
const bullets = [
{ head: "Causes (80%: hernias, adhesions, intussusception, volvulus)", sub: ["Adhesions (MC in adults — post-surgical)", "Hernias (inguinal, femoral, incisional)", "Neoplasms; Crohn's strictures; Gallstone ileus"] },
{ head: "Clinical Features", sub: ["Colicky abdominal pain, vomiting (bilious early), abdominal distension", "Absolute constipation (no flatus/stool) in complete obstruction", "High-pitched tinkling bowel sounds early; silent in strangulation"] },
{ head: "Investigations", sub: ["X-ray abdomen: dilated loops, air-fluid levels, no gas in colon", "CT abdomen: transition point, identify cause, detect strangulation", "USS: dilated bowel, peristalsis assessment"] },
{ head: "Management", sub: ["Conservative: NBM, NG tube (decompression), IV fluids, electrolyte correction", "Surgery: if strangulation, perforation, or failed conservative — resection/adhesiolysis"] },
];
const items = bullets.map(b => {
const arr = [];
arr.push({ text: b.head, options: { bullet: { type: "bullet" }, bold: true, color: C.navy, fontSize: 14, breakLine: true, fontFace: "Calibri" } });
b.sub.forEach((s, si) => {
arr.push({ text: " " + s, options: { bullet: false, color: C.text, fontSize: 13, breakLine: true, fontFace: "Calibri" } });
});
return arr;
}).flat();
// remove last breakLine
if (items.length > 0) items[items.length - 1].options.breakLine = false;
sl.addText(items, { x: 0.3, y: 1.05, w: 5.7, h: 4.4, valign: "top" });
if (obsImg) {
sl.addImage({ data: obsImg, x: 6.2, y: 1.1, w: 3.5, h: 3.5 });
sl.addText("FIG: Four major causes of intestinal obstruction\n(Robbins & Kumar Basic Pathology)", {
x: 6.1, y: 4.6, w: 3.7, h: 0.7, fontSize: 9, color: C.subtext, fontFace: "Calibri", italic: true, align: "center"
});
}
}
// ─────────────────────────────────────────────────────────────────────
// SLIDE 10 – INTUSSUSCEPTION
// ─────────────────────────────────────────────────────────────────────
contentSlide("Intussusception", [
{ head: "Definition", sub: ["Telescoping of a proximal bowel segment (intussusceptum) into the distal segment (intussuscipiens)", "MC cause of intestinal obstruction in children < 2 years"] },
{ head: "Types", sub: ["Idiopathic (infants — reactive Peyer's patch hyperplasia; rotavirus association)", "Secondary to lead point: Meckel's diverticulum, polyp, lymphoma (older children/adults)"] },
{ head: "Clinical Features", sub: ["Classic triad: colicky abdominal pain, redcurrant jelly stools, palpable sausage-shaped mass (RUQ)", "Vomiting, lethargy, intermittent pain episodes", "Dance sign: emptiness in RIF (mass moved toward right)"] },
{ head: "Investigations & Management", sub: ["USS: target sign / doughnut sign (concentric rings)", "Contrast/air enema: diagnostic AND therapeutic (80–90% success in children)", "Surgery if peritonitis, failed reduction, or lead point identified (adults)"] },
]);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 11 – SECTION: NUTRITIONAL/ABSORPTIVE DISORDERS
// ─────────────────────────────────────────────────────────────────────
sectionSlide("3. Malabsorption & Nutritional Disorders", "Short Gut Syndrome • SIBO • Whipple's Disease");
// ─────────────────────────────────────────────────────────────────────
// SLIDE 12 – SHORT GUT SYNDROME (PATHOPHYSIOLOGY)
// ─────────────────────────────────────────────────────────────────────
contentSlide("Short Gut Syndrome (SGS) – Pathophysiology", [
{ head: "Definition", sub: ["Clinical state where residual intestine cannot maintain adequate absorption of nutrients, fluids, and electrolytes", "Usually follows massive small bowel resection (>50% loss)"] },
{ head: "Common causes", sub: ["Adults: Crohn's disease (most common), mesenteric ischaemia/infarction, trauma, radiation enteritis", "Neonates/Paediatric: NEC (35%), intestinal atresia (25%), gastroschisis (18%), midgut volvulus (14%)"] },
{ head: "Key determinants of outcome", sub: ["Residual bowel length: ≥35–40 cm → 50% chance of weaning off TPN", "Each additional cm increases enteral autonomy rate by 4%", "Presence of ileocaecal valve (acts as surrogate for terminal ileum)", "Colon in continuity: essential for water/electrolyte salvage"] },
{ head: "Intestinal adaptation", sub: ["Physiologic process post-resection: villous hyperplasia, crypt deepening, bowel dilation", "Takes weeks to months; enhanced by enteral feeding and growth factors (GLP-2/teduglutide)"] },
]);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 13 – SHORT GUT SYNDROME: CLINICAL FEATURES & INVESTIGATIONS
// ─────────────────────────────────────────────────────────────────────
contentSlide("Short Gut Syndrome – Clinical Features & Investigations", [
{ head: "Clinical features", sub: ["High-volume diarrhoea / steatorrhoea, dehydration, electrolyte imbalances", "Weight loss, malnutrition, fatigue", "Fat-soluble vitamin deficiencies (A, D, E, K) → coagulopathy, metabolic bone disease", "Vitamin B12 deficiency (ileal loss) → macrocytic anaemia", "D-lactic acidosis (colonic bacterial fermentation) → confusion, ataxia"] },
{ head: "Complications of TPN dependence", sub: ["Catheter-related bloodstream infections (CRBSI)", "TPN-associated liver disease / cholestasis → cirrhosis", "Gallstones (biliary stasis, 100% incidence in severe cases on long-term TPN)", "Metabolic bone disease"] },
{ head: "Investigations", sub: ["Bloods: FBC, LFTs, renal function, electrolytes, vitamins (B12, folate, D, A, E, K)", "Serum zinc, selenium, magnesium, phosphate", "Bone densitometry (DEXA) for osteoporosis; USS liver/gallbladder", "72-hour faecal fat collection (confirms steatorrhoea)", "Barium/CT enterography to assess residual bowel length and anatomy"] },
]);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 14 – SHORT GUT SYNDROME: MANAGEMENT (with image)
// ─────────────────────────────────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } });
sl.addText("Short Gut Syndrome – Principles of Management", { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });
// Phases boxes
const phases = [
{ label: "Phase 1\n(0–3 wks)", text: "Total parenteral nutrition (TPN)\nIV fluid & electrolyte replacement\nAntidiarrhoeals (loperamide, codeine)", col: C.red },
{ label: "Phase 2\n(3 wks–1 yr)", text: "Gradual introduction of oral/enteral feeds\nTPN weaned as tolerance improves\nTrophic feeds stimulate adaptation", col: C.teal },
{ label: "Phase 3\n(>1 yr)", text: "Enteral autonomy if bowel adapts\nTeduglutide (GLP-2 analogue) to enhance adaptation\nProkinetics / antisecretory agents", col: C.green },
];
phases.forEach((p, i) => {
const x = 0.3 + i * 3.2;
sl.addShape(pres.ShapeType.rect, { x, y: 1.0, w: 3.0, h: 0.5, fill: { color: p.col } });
sl.addText(p.label, { x, y: 1.0, w: 3.0, h: 0.5, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });
sl.addShape(pres.ShapeType.rect, { x, y: 1.5, w: 3.0, h: 1.5, fill: { color: C.white }, line: { color: p.col, width: 1.5 } });
sl.addText(p.text, { x: x + 0.08, y: 1.55, w: 2.84, h: 1.4, fontSize: 11, color: C.text, fontFace: "Calibri", valign: "top" });
});
// Surgical options
sl.addText("Surgical Options for Dilated Residual Bowel:", { x: 0.3, y: 3.15, w: 5.5, h: 0.4, fontSize: 14, bold: true, color: C.navy, fontFace: "Calibri" });
const surgBullets = [
"Bianchi (LILT): Longitudinal intestinal lengthening — splits bowel into 2 parallel segments, doubles length",
"STEP (Serial Transverse Enteroplasty): transverse stapling creates zigzag, narrows & lengthens bowel",
"Small bowel transplantation: last resort for irreversible intestinal failure + TPN complications",
"Cholecystectomy: prophylactic in long-term TPN patients (100% gallstone risk)",
];
sl.addText(surgBullets.map((t, i) => ({ text: t, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 12, breakLine: i < surgBullets.length - 1, fontFace: "Calibri" } })),
{ x: 0.3, y: 3.55, w: 5.6, h: 1.9, valign: "top" });
if (stepImg) {
sl.addImage({ data: stepImg, x: 6.15, y: 3.1, w: 3.55, h: 2.35 });
sl.addText("FIG: Bianchi (A) & STEP (B) bowel-lengthening procedures\n(Sabiston Textbook of Surgery)", {
x: 6.05, y: 5.45, w: 3.7, h: 0.4, fontSize: 9, color: C.subtext, fontFace: "Calibri", italic: true, align: "center"
});
}
}
// ─────────────────────────────────────────────────────────────────────
// SLIDE 15 – SIBO (Small Intestinal Bacterial Overgrowth)
// ─────────────────────────────────────────────────────────────────────
contentSlide("Small Intestinal Bacterial Overgrowth (SIBO)", [
{ head: "Definition", sub: [">10^5 CFU/mL organisms in proximal small intestine", "Normally kept low by gastric acid, peristalsis, IgA, ileocaecal valve"] },
{ head: "Causes / Predisposing factors", sub: ["Hypomotility: scleroderma, diabetic autonomic neuropathy, post-surgical (Roux-en-Y, blind loops)", "Anatomical: strictures, diverticula, fistulas, SGS", "Achlorhydria (PPI use, gastric surgery); Immunodeficiency"] },
{ head: "Clinical Features", sub: ["Bloating, abdominal discomfort, diarrhoea, steatorrhoea", "Fat-soluble vitamin and B12 deficiency", "D-lactic acidosis (short bowel + colon in continuity)"] },
{ head: "Investigations & Management", sub: ["Hydrogen/methane breath test (lactulose or glucose) — elevated H2/CH4 at <90 min", "Gold standard: jejunal aspirate & culture (>10^5 CFU/mL)", "Rifaximin 550 mg TDS × 14 days (first line); also metronidazole, ciprofloxacin", "Address underlying cause; rotating antibiotics for recurrent SIBO"] },
]);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 16 – SECTION: TUMOURS
// ─────────────────────────────────────────────────────────────────────
sectionSlide("4. Tumours of the Small Intestine", "Benign • Malignant • Carcinoid / NET");
// ─────────────────────────────────────────────────────────────────────
// SLIDE 17 – SMALL BOWEL TUMOURS
// ─────────────────────────────────────────────────────────────────────
twoColSlide("Small Bowel Tumours – Overview",
["Adenoma (tubular/villous — duodenum)", "Leiomyoma / GIST (stromal)", "Lipoma (submucosal)", "Brunner's gland hyperplasia", "Peutz-Jeghers hamartomas (hamartomatous polyps)", "Haemangioma (cause of GI bleeding)"],
["Adenocarcinoma (most common malignant — duodenum/jejunum)", "Carcinoid / NET: ileum MC site; secretes serotonin — carcinoid syndrome", "Lymphoma (MALT type; increased risk in celiac)", "GIST (KIT/PDGFRA mutation; CD117+)", "Metastases (melanoma, lung, breast)"],
"Benign Tumours", "Malignant Tumours"
);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 18 – CARCINOID / NET & INVESTIGATIONS
// ─────────────────────────────────────────────────────────────────────
contentSlide("Carcinoid Syndrome & Small Bowel Tumour Investigations", [
{ head: "Carcinoid Syndrome (when liver metastases present)", sub: ["Episodic flushing, secretory diarrhoea, bronchospasm, right-sided valvular disease (tricuspid)", "Elevated urinary 5-HIAA (>25 mg/24h)", "Serum chromogranin A (tumour marker)"] },
{ head: "Investigations for small bowel tumours", sub: ["CT/MRI enterography: mass, lymphadenopathy, liver metastases", "Capsule endoscopy: best for mid-gut tumours (no biopsy)", "Double-balloon enteroscopy: biopsy + therapy", "Octreotide scan (Ga-68 DOTANOC PET/CT for NETs)", "Upper GI endoscopy + biopsy for duodenal tumours"] },
{ head: "Management principles", sub: ["Surgical resection (curative for localised disease)", "Somatostatin analogues (octreotide/lanreotide) for carcinoid syndrome control", "PRRT (Peptide Receptor Radionuclide Therapy) for metastatic NETs", "Imatinib/sunitinib for GIST; R-CHOP for lymphoma"] },
]);
// ─────────────────────────────────────────────────────────────────────
// SLIDE 19 – SUMMARY TABLE
// ─────────────────────────────────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } });
sl.addText("Summary: At-a-Glance", { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });
const rows = [
["Condition", "Key Feature", "Diagnostic Test", "Management"],
["Crohn's disease", "Transmural, skip lesions, RLQ pain", "CT enterography, ileoscopy", "5-ASA → steroids → biologics"],
["Celiac disease", "Gluten enteropathy, villous atrophy", "Anti-tTG IgA + duodenal biopsy", "Lifelong gluten-free diet"],
["Tropical sprue", "Tropical region, megaloblastic anaemia", "D-xylose test, biopsy", "Folic acid + tetracycline"],
["Intestinal obstruction", "Colicky pain, distension, vomiting", "AXR air-fluid levels, CT", "NBM + NGT; surgery if needed"],
["Intussusception", "Redcurrant jelly stool, RUQ mass", "USS target sign", "Air/contrast enema; surgery"],
["Short gut syndrome", "Diarrhoea, malnutrition, TPN dependence", "Serum vitamins, CT enterography", "TPN → enteral feeds; STEP/Bianchi"],
["SIBO", "Bloating, B12 deficiency, H2 breath test +", "Breath test / jejunal aspirate", "Rifaximin × 14 days"],
["Carcinoid/NET", "Flushing, diarrhoea, 5-HIAA ↑", "Octreotide scan, chromogranin A", "Resection + octreotide"],
];
const colW = [1.9, 2.3, 2.5, 2.8];
const startX = 0.25;
const startY = 1.0;
const rowH = 0.46;
rows.forEach((row, ri) => {
row.forEach((cell, ci) => {
const x = startX + colW.slice(0, ci).reduce((a, b) => a + b, 0);
const y = startY + ri * rowH;
const isHeader = ri === 0;
sl.addShape(pres.ShapeType.rect, {
x, y, w: colW[ci], h: rowH,
fill: { color: isHeader ? C.teal : (ri % 2 === 0 ? C.white : "D9EFF3") },
line: { color: C.teal, width: 0.5 }
});
sl.addText(cell, {
x: x + 0.05, y: y + 0.03, w: colW[ci] - 0.1, h: rowH - 0.06,
fontSize: isHeader ? 11 : 10,
bold: isHeader,
color: isHeader ? C.white : C.text,
fontFace: "Calibri",
valign: "middle"
});
});
});
}
// ─────────────────────────────────────────────────────────────────────
// SLIDE 20 – THANK YOU / KEY TAKEAWAYS
// ─────────────────────────────────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 3.8, w: "100%", h: 1.825, fill: { color: C.teal } });
sl.addShape(pres.ShapeType.rect, { x: 0, y: 3.75, w: "100%", h: 0.08, fill: { color: C.accent } });
sl.addText("Key Takeaways", { x: 0.5, y: 0.25, w: 9, h: 0.7, fontSize: 30, bold: true, color: C.accent, fontFace: "Calibri", align: "center" });
const takeaways = [
"Crohn's: transmural skip lesions — think complications (stricture, fistula, abscess)",
"Celiac: anti-tTG + biopsy — treat with STRICT lifelong gluten-free diet",
"Short gut syndrome: >50% resection → TPN dependence; bowel adapts over months",
"Intestinal obstruction: closed-loop & strangulation = surgical emergency",
"SGS surgery: STEP procedure or Bianchi to lengthen and narrow dilated bowel",
"Carcinoid tumours: ileum is MC site; carcinoid syndrome only with liver metastases",
];
sl.addText(takeaways.map((t, i) => ({
text: "✦ " + t,
options: { bullet: false, color: C.white, fontSize: 14, breakLine: i < takeaways.length - 1, fontFace: "Calibri" }
})), { x: 0.6, y: 1.05, w: 8.8, h: 2.6, valign: "top" });
sl.addText("Thank You", { x: 0.5, y: 3.85, w: 9, h: 0.6, fontSize: 26, bold: true, color: C.white, fontFace: "Calibri", align: "center" });
sl.addText("References: Sabiston Surgery 21e | Robbins Basic Pathology 11e | Sleisenger & Fordtran GI | Maingot's Abdominal Operations", {
x: 0.5, y: 4.5, w: 9, h: 0.7, fontSize: 10, color: "D0E8EF", fontFace: "Calibri", align: "center"
});
}
pres.writeFile({ fileName: "/home/daytona/workspace/small-intestine-ppt/Small_Intestine_Disorders.pptx" })
.then(() => console.log("DONE"))
.catch(e => console.error(e));
~/small-intestine-ppt/create_pptx.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/small-intestine-ppt/create_pptx.js'
cat > /home/daytona/workspace/small-intestine-ppt/create_pptx.js << 'JSEOF' const pptxgen = require("pptxgenjs"); const { execSync } = require("child_process"); // Fetch images const imageUrls = [ "https://cdn.orris.care/cdss_images/158bc9cc39e323c81d9f0cccaa784bfbb067bab526f2241ccac5c8435bc1e400.png", "https://cdn.orris.care/cdss_images/d2918e8deba389a22ac8f4bbb21a6215b76958fc3eccdb92b55aa48059500ff8.png" ]; let images = []; try { images = JSON.parse(execSync( `node /home/daytona/skills/shared/scripts/fetch_images.js "${imageUrls[0]}" "${imageUrls[1]}"` ).toString()); } catch(e) { console.log("Image fetch error:", e.message); } const obsImg = images[0] && !images[0].error ? images[0].base64 : null; const stepImg = images[1] && !images[1].error ? images[1].base64 : null; console.log("obsImg loaded:", !!obsImg); console.log("stepImg loaded:", !!stepImg); const pres = new pptxgen(); pres.layout = "LAYOUT_16x9"; pres.author = "Medical Education"; pres.title = "Disorders of Small Intestine"; const C = { navy: "0D2B55", teal: "1A7A8A", accent: "E8A020", light: "EEF4F7", white: "FFFFFF", text: "1C2B36", subtext: "4A6070", red: "C0392B", green: "1E8449", }; function sectionSlide(title, subtitle) { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 4.8, w: "100%", h: 0.825, fill: { color: C.teal } }); sl.addShape(pres.ShapeType.rect, { x: 0.5, y: 1.8, w: 0.12, h: 2, fill: { color: C.accent } }); sl.addText(title, { x: 0.9, y: 1.8, w: 8.5, h: 2, fontSize: 38, bold: true, color: C.white, fontFace: "Calibri" }); if (subtitle) sl.addText(subtitle, { x: 0.9, y: 3.9, w: 8.5, h: 0.7, fontSize: 18, color: C.accent, fontFace: "Calibri" }); return sl; } function contentSlide(title, bullets, opts = {}) { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } }); sl.addText(title, { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" }); const bw = opts.imgRight ? 5.7 : 9.4; const items = []; bullets.forEach((b, bi) => { if (typeof b === "object") { items.push({ text: b.head, options: { bullet: { type: "bullet" }, bold: true, color: C.navy, fontSize: b.size || 14, breakLine: true, fontFace: "Calibri" } }); if (b.sub) { b.sub.forEach((s, si) => { items.push({ text: " \u2022 " + s, options: { bullet: false, color: C.text, fontSize: (b.size || 14) - 1, breakLine: true, fontFace: "Calibri" } }); }); } } else { items.push({ text: b, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 13, breakLine: true, fontFace: "Calibri" } }); } }); if (items.length) items[items.length - 1].options.breakLine = false; sl.addText(items, { x: 0.3, y: 1.05, w: bw, h: 4.4, valign: "top" }); if (opts.imgRight && opts.imgData) { sl.addImage({ data: opts.imgData, x: 6.2, y: 1.1, w: 3.5, h: 3.8 }); if (opts.imgCaption) { sl.addText(opts.imgCaption, { x: 6.1, y: 4.9, w: 3.7, h: 0.5, fontSize: 9, color: C.subtext, fontFace: "Calibri", italic: true, align: "center" }); } } return sl; } function twoColSlide(title, leftItems, rightItems, leftTitle, rightTitle) { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } }); sl.addText(title, { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" }); sl.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.0, w: 4.4, h: 4.5, fill: { color: C.white }, line: { color: C.teal, width: 1.5 } }); sl.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.0, w: 4.4, h: 0.45, fill: { color: C.teal } }); sl.addText(leftTitle, { x: 0.3, y: 1.0, w: 4.4, h: 0.45, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" }); sl.addText(leftItems.map((t, i) => ({ text: t, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 12, breakLine: i < leftItems.length - 1, fontFace: "Calibri" } })), { x: 0.4, y: 1.5, w: 4.2, h: 3.9, valign: "top" }); sl.addShape(pres.ShapeType.rect, { x: 5.3, y: 1.0, w: 4.4, h: 4.5, fill: { color: C.white }, line: { color: C.accent, width: 1.5 } }); sl.addShape(pres.ShapeType.rect, { x: 5.3, y: 1.0, w: 4.4, h: 0.45, fill: { color: C.accent } }); sl.addText(rightTitle, { x: 5.3, y: 1.0, w: 4.4, h: 0.45, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" }); sl.addText(rightItems.map((t, i) => ({ text: t, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 12, breakLine: i < rightItems.length - 1, fontFace: "Calibri" } })), { x: 5.4, y: 1.5, w: 4.2, h: 3.9, valign: "top" }); return sl; } // ── SLIDE 1: TITLE ── { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 4.6, w: "100%", h: 1.025, fill: { color: C.teal } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 2.1, w: "100%", h: 0.08, fill: { color: C.accent } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 2.18, w: "100%", h: 0.02, fill: { color: C.white } }); sl.addText("Disorders of the Small Intestine", { x: 0.5, y: 0.3, w: 9, h: 1.75, fontSize: 40, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" }); sl.addText("Clinical Features \u2022 Investigations \u2022 Management", { x: 0.5, y: 2.3, w: 9, h: 0.7, fontSize: 20, color: C.accent, fontFace: "Calibri", align: "center" }); sl.addText("Including Short Gut Syndrome", { x: 0.5, y: 3.05, w: 9, h: 0.55, fontSize: 18, color: C.light, fontFace: "Calibri", align: "center" }); sl.addText("For MBBS Students | General Surgery & Medicine", { x: 0.5, y: 4.7, w: 9, h: 0.7, fontSize: 15, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" }); } // ── SLIDE 2: OVERVIEW ── contentSlide("Anatomy & Overview of Small Intestine", [ { head: "Three segments: Duodenum | Jejunum | Ileum", sub: ["Total length: 6-7 m in vivo (3 m contracted)", "Duodenum: 25 cm, retroperitoneal, C-shaped loop around head of pancreas"] }, { head: "Key functions", sub: ["Digestion and absorption of nutrients, water, electrolytes", "Immune surveillance via Peyer's patches and secretory IgA", "Endocrine secretion: GIP, CCK, secretin, motilin, GLP-1, GLP-2"] }, { head: "Ileum: unique absorptive sites", sub: ["Vitamin B12 (bound to intrinsic factor)", "Bile salts (enterohepatic circulation)", "Fat-soluble vitamins A, D, E, K"] }, { head: "Disorders covered in this presentation", sub: ["Inflammatory: Crohn's disease, Celiac disease, Tropical sprue", "Obstructive: Intestinal obstruction, Intussusception, Volvulus", "Malabsorptive: Short gut syndrome, SIBO", "Neoplastic: Adenocarcinoma, Carcinoid/NET, Lymphoma, GIST"] }, ]); // ── SLIDE 3: SECTION ── sectionSlide("1. Inflammatory Disorders", "Crohn's Disease \u2022 Celiac Disease \u2022 Tropical Sprue"); // ── SLIDE 4: CROHN'S CLINICAL ── contentSlide("Crohn's Disease - Clinical Features", [ { head: "Definition", sub: ["Transmural granulomatous inflammation; can affect any part of GI tract (mouth to anus)", "Most common in terminal ileum and ileocaecal region; skip lesions are hallmark"] }, { head: "Symptoms of small intestine involvement", sub: ["Abdominal pain: postprandial, crampy (partial obstruction) - present in 90% of cases", "Non-bloody diarrhoea; weight loss and anorexia", "Palpable RLQ mass (thickened bowel, abscess, or phlegmon)"] }, { head: "Complications", sub: ["Strictures leading to bowel obstruction", "Fistulas: enteroenteric, enterovesical, enterovaginal, enterocutaneous", "Abscess formation; Perianal disease (fissures, fistulas, skin tags) - in ~40%"] }, { head: "Extraintestinal manifestations", sub: ["Joints: ankylosing spondylitis, sacroiliitis, seronegative polyarthritis", "Skin: erythema nodosum, pyoderma gangrenosum", "Eyes: uveitis, episcleritis | Liver: primary sclerosing cholangitis (rare)"] }, ]); // ── SLIDE 5: CROHN'S INVESTIGATIONS & MANAGEMENT ── twoColSlide("Crohn's Disease - Investigations & Management", ["Bloods: FBC (anaemia), ESR/CRP (elevated), albumin (low)", "Stool: culture, C. diff toxin, faecal calprotectin (markedly elevated)", "Ileoscopy: cobblestone mucosa, skip lesions, deep ulcers, pseudopolyps", "CT/MRI enterography: bowel wall thickening, creeping fat, fistulas", "Barium follow-through: string sign of Kantor (stricture)", "Histology (biopsy): transmural inflammation, non-caseating granulomas"], ["Mild: 5-ASA (mesalazine)", "Moderate flare: corticosteroids (prednisolone / budesonide)", "Maintenance: azathioprine, 6-mercaptopurine", "Severe/refractory: Anti-TNF biologics (infliximab, adalimumab)", "Surgery: resection for obstruction, abscess, fistulas (bowel-sparing)", "Nutritional support: elemental diet, TPN in severe disease", "Surveillance colonoscopy after 10 years for cancer"], "Investigations", "Management" ); // ── SLIDE 6: CELIAC DISEASE ── contentSlide("Celiac Disease (Gluten-Sensitive Enteropathy)", [ { head: "Pathophysiology", sub: ["Autoimmune enteropathy triggered by dietary gluten (wheat, barley, rye)", "Genetic predisposition: HLA-DQ2 (90%) and HLA-DQ8", "IgA anti-gliadin, anti-endomysial (EMA), anti-tissue transglutaminase (anti-tTG) antibodies", "Results in villous atrophy -> malabsorption"] }, { head: "Clinical Features", sub: ["Classic: chronic diarrhoea, steatorrhoea, bloating, failure to thrive in children", "Atypical: iron-deficiency anaemia, osteoporosis, dermatitis herpetiformis, infertility, fatigue", "Silent: asymptomatic (found incidentally or on screening)"] }, { head: "Investigations", sub: ["Serology: anti-tTG IgA (sensitivity ~95%); check total IgA to exclude IgA deficiency", "Endoscopy + duodenal biopsy: villous atrophy, crypt hyperplasia, intraepithelial lymphocytes (Marsh III)", "HLA typing (DQ2/DQ8): negative result has high NPV to exclude celiac"] }, { head: "Management", sub: ["STRICT lifelong gluten-free diet (cornerstone of treatment)", "Nutritional supplementation: iron, folate, B12, calcium, vitamin D", "Refractory celiac disease: corticosteroids, azathioprine; exclude lymphoma"] }, ]); // ── SLIDE 7: TROPICAL SPRUE ── contentSlide("Tropical Sprue", [ { head: "Definition & Aetiology", sub: ["Acquired malabsorption syndrome in residents of or visitors to tropical/subtropical regions", "Likely caused by bacterial overgrowth + folate depletion (possibly Enterotoxigenic E. coli or Klebsiella)", "Affects proximal small intestine; partially overlaps with SIBO"] }, { head: "Clinical Features", sub: ["Watery diarrhoea (3-10 loose stools/day), steatorrhoea", "Macrocytic / megaloblastic anaemia (folate and B12 deficiency)", "Glossitis, angular cheilitis, oedema, profound weight loss and fatigue"] }, { head: "Investigations", sub: ["Bloods: megaloblastic anaemia; low serum folate (<3 ng/mL) and serum B12", "D-xylose absorption test: reduced (confirms absorptive defect)", "Small bowel biopsy: partial villous atrophy (less severe than celiac), not IgA-mediated", "Stool microscopy: fat globules (steatorrhoea); no parasites (distinguishes from giardiasis)"] }, { head: "Management", sub: ["Folic acid (5 mg/day) + Vitamin B12 replacement for 2-3 months", "Tetracycline 250 mg QID for 3-6 months (eradicates bacterial overgrowth)", "Most patients achieve full clinical and histological remission within weeks"] }, ]); // ── SLIDE 8: SECTION ── sectionSlide("2. Obstructive Disorders", "Intestinal Obstruction \u2022 Intussusception \u2022 Volvulus"); // ── SLIDE 9: INTESTINAL OBSTRUCTION (with image) ── { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } }); sl.addText("Small Bowel Obstruction - Features & Management", { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" }); const items = []; const data = [ { head: "Causes (80%: hernias, adhesions, intussusception, volvulus)", sub: ["Adhesions (MC cause in adults - post-surgical)", "Hernias: inguinal, femoral, incisional", "Tumours; Crohn's strictures; Gallstone ileus"] }, { head: "Clinical Features", sub: ["Colicky abdominal pain, nausea and vomiting (bilious in SBO)", "Abdominal distension; absolute constipation (no flatus, no stool)", "High-pitched tinkling bowel sounds early; silent bowel in strangulation"] }, { head: "Investigations", sub: ["X-ray abdomen: dilated loops, multiple air-fluid levels (>2.5 cm), no colonic gas", "CT abdomen with contrast: transition point, identify aetiology, detect strangulation", "Blood: raised WCC, lactate (strangulation)"] }, { head: "Management", sub: ["Conservative: NBM, nasogastric tube decompression, IV fluids, electrolyte correction", "Surgery: if strangulation, perforation, peritonitis, or failed conservative management"] }, ]; data.forEach(b => { items.push({ text: b.head, options: { bullet: { type: "bullet" }, bold: true, color: C.navy, fontSize: 13, breakLine: true, fontFace: "Calibri" } }); b.sub.forEach(s => items.push({ text: " \u2022 " + s, options: { bullet: false, color: C.text, fontSize: 12, breakLine: true, fontFace: "Calibri" } })); }); if (items.length) items[items.length - 1].options.breakLine = false; sl.addText(items, { x: 0.3, y: 1.05, w: 5.65, h: 4.4, valign: "top" }); if (obsImg) { sl.addImage({ data: obsImg, x: 6.15, y: 1.1, w: 3.55, h: 3.6 }); sl.addText("FIG: Four major mechanical causes\nof intestinal obstruction\n(Robbins & Kumar Basic Pathology)", { x: 6.05, y: 4.72, w: 3.7, h: 0.75, fontSize: 9, color: C.subtext, fontFace: "Calibri", italic: true, align: "center" }); } } // ── SLIDE 10: INTUSSUSCEPTION ── contentSlide("Intussusception", [ { head: "Definition", sub: ["Telescoping of proximal bowel (intussusceptum) into distal segment (intussuscipiens)", "Most common cause of intestinal obstruction in children under 2 years"] }, { head: "Types & Causes", sub: ["Idiopathic (infants): reactive Peyer's patch hyperplasia after viral illness; rotavirus vaccine association", "Secondary (older children/adults): Meckel's diverticulum, polyp, lymphoma serve as lead point"] }, { head: "Clinical Features - Classic Triad", sub: ["Severe colicky abdominal pain (child draws knees to chest, screams intermittently)", "Redcurrant jelly stools (blood and mucus - late feature; bowel ischaemia)", "Palpable sausage-shaped mass in right upper/central abdomen", "Dance sign: emptiness in RIF as mass displaces into right upper quadrant"] }, { head: "Investigations & Management", sub: ["Ultrasound: target sign / doughnut sign (concentric rings - diagnostic)", "X-ray: may show meniscus sign, soft tissue mass in RUQ", "Air/contrast enema: diagnostic AND therapeutic - 80-90% success in children", "Surgery: peritonitis, failed reduction, or adult lead point identified"] }, ]); // ── SLIDE 11: SECTION ── sectionSlide("3. Malabsorption & Nutritional Disorders", "Short Gut Syndrome \u2022 SIBO \u2022 Nutritional Deficiencies"); // ── SLIDE 12: SGS PATHOPHYSIOLOGY ── contentSlide("Short Gut Syndrome - Definition & Pathophysiology", [ { head: "Definition", sub: ["Clinical state where residual intestine cannot maintain adequate absorption of nutrients, fluids, and electrolytes", "Usually follows massive small bowel resection (loss of >50-70% of small bowel)"] }, { head: "Common causes (adults vs. paediatric)", sub: ["Adults: Crohn's disease (MC), mesenteric ischaemia/infarction, trauma, radiation enteritis", "Neonates: NEC (35%), intestinal atresia (25%), gastroschisis (18%), midgut volvulus (14%)"] }, { head: "Key determinants of outcome", sub: ["Residual bowel length: 35-40 cm gives 50% chance of weaning off TPN; each additional cm adds 4%", "Presence of ileocaecal valve (acts as surrogate for terminal ileum integrity)", "Colon in continuity: essential for water and electrolyte salvage after massive resection"] }, { head: "Intestinal adaptation (post-resection process)", sub: ["Villous hyperplasia, crypt deepening, bowel dilation over weeks to months", "Stimulated by enteral feeding, growth factors (GLP-2 analogue: teduglutide)", "Jejunum adapts less well; terminal ileum has greatest adaptive capacity"] }, ]); // ── SLIDE 13: SGS CLINICAL + INVESTIGATIONS ── contentSlide("Short Gut Syndrome - Clinical Features & Investigations", [ { head: "Clinical Features", sub: ["Profuse watery diarrhoea / steatorrhoea; severe dehydration and electrolyte loss", "Weight loss, cachexia, failure to thrive (paediatric)", "Fat-soluble vitamin deficiencies (A, D, E, K) -> coagulopathy, metabolic bone disease, night blindness", "Vitamin B12 deficiency (ileal loss) -> macrocytic anaemia", "D-lactic acidosis (colonic bacteria ferment unabsorbed carbs) -> encephalopathy, ataxia, slurred speech"] }, { head: "Complications of long-term TPN dependence", sub: ["Catheter-related bloodstream infections (CRBSI) - most common complication", "TPN-associated liver disease / cholestasis -> fibrosis -> cirrhosis", "Gallstones: biliary stasis (100% incidence in severe SGS on long-term TPN)", "Metabolic bone disease (osteoporosis) and renal stones"] }, { head: "Investigations", sub: ["Bloods: FBC, LFTs, renal panel, electrolytes, serum vitamins (A, D, E, K, B12, folate)", "Serum zinc, selenium, magnesium, phosphate (trace elements)", "DEXA scan for bone mineral density; Abdominal USS (gallstones, liver steatosis)", "72-hr faecal fat (confirms steatorrhoea); CT/MRI enterography (residual bowel anatomy)"] }, ]); // ── SLIDE 14: SGS MANAGEMENT (with image) ── { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } }); sl.addText("Short Gut Syndrome - Principles of Management", { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" }); const phases = [ { label: "Phase 1 (0-3 wks)", text: "TPN (total parenteral nutrition)\nIV fluids & electrolyte replacement\nAntidiarrhoeals: loperamide, codeine\nPPI: reduce gastric hypersecretion", col: C.red }, { label: "Phase 2 (3 wks-1 yr)", text: "Gradual introduction of oral/enteral feeds (trophic feeds)\nTPN weaned as tolerance improves\nTeduglutide (GLP-2 analogue) to stimulate adaptation", col: C.teal }, { label: "Phase 3 (>1 yr)", text: "Enteral autonomy (if adapted)\nContinue teduglutide if needed\nProkinetics; antisecretory agents\nOral rehydration solution (ORS)", col: C.green }, ]; phases.forEach((p, i) => { const x = 0.28 + i * 3.18; sl.addShape(pres.ShapeType.rect, { x, y: 1.0, w: 3.0, h: 0.48, fill: { color: p.col } }); sl.addText(p.label, { x, y: 1.0, w: 3.0, h: 0.48, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" }); sl.addShape(pres.ShapeType.rect, { x, y: 1.48, w: 3.0, h: 1.6, fill: { color: C.white }, line: { color: p.col, width: 1.5 } }); sl.addText(p.text, { x: x + 0.08, y: 1.52, w: 2.84, h: 1.5, fontSize: 10.5, color: C.text, fontFace: "Calibri", valign: "top" }); }); sl.addText("Surgical Options (for dilated residual bowel):", { x: 0.3, y: 3.22, w: 5.55, h: 0.38, fontSize: 13, bold: true, color: C.navy, fontFace: "Calibri" }); const surgBullets = [ "Bianchi (LILT): splits mesentery into 2 planes; bowel stapled longitudinally -> doubles length, halves diameter", "STEP (Serial Transverse Enteroplasty): transverse stapling in V-shapes on alternating sides -> narrower, longer bowel", "Small bowel transplantation: last resort for irreversible intestinal failure with TPN-related complications", "Prophylactic cholecystectomy: in long-term TPN patients (virtually 100% gallstone risk)", ]; sl.addText(surgBullets.map((t, i) => ({ text: t, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 11, breakLine: i < surgBullets.length - 1, fontFace: "Calibri" } })), { x: 0.3, y: 3.62, w: 5.55, h: 1.85, valign: "top" }); if (stepImg) { sl.addImage({ data: stepImg, x: 6.1, y: 3.18, w: 3.6, h: 2.2 }); sl.addText("FIG: Bianchi (A) & STEP (B) bowel-\nlengthening procedures\n(Sabiston Textbook of Surgery)", { x: 6.0, y: 5.38, w: 3.8, h: 0.5, fontSize: 9, color: C.subtext, fontFace: "Calibri", italic: true, align: "center" }); } } // ── SLIDE 15: SIBO ── contentSlide("Small Intestinal Bacterial Overgrowth (SIBO)", [ { head: "Definition", sub: [">10^5 CFU/mL organisms in proximal small intestine (normally <10^4 CFU/mL)", "Normally kept low by: gastric acid, peristalsis, secretory IgA, ileocaecal valve"] }, { head: "Causes & Predisposing Factors", sub: ["Hypomotility: scleroderma, diabetic neuropathy, post-surgical (Roux-en-Y, blind loops)", "Anatomical: strictures (Crohn's), diverticula, fistulas, short gut syndrome", "Achlorhydria (PPI overuse, post-gastrectomy); immunodeficiency states"] }, { head: "Clinical Features", sub: ["Bloating, excessive flatulence, abdominal discomfort, diarrhoea, steatorrhoea", "Vitamin B12 deficiency (bacteria consume B12); fat-soluble vitamin malabsorption", "D-lactic acidosis in SGS patients with colon in continuity"] }, { head: "Investigations & Management", sub: ["Hydrogen/methane breath test (glucose or lactulose): early peak (<90 min) = SIBO", "Gold standard: jejunal aspirate and culture (>10^5 CFU/mL) - invasive", "Rifaximin 550 mg TDS x 14 days (first-line, non-absorbable antibiotic)", "Alternatives: metronidazole, ciprofloxacin; rotating antibiotics for recurrent SIBO"] }, ]); // ── SLIDE 16: SECTION ── sectionSlide("4. Neoplasms of the Small Intestine", "Benign \u2022 Malignant \u2022 Carcinoid / NET"); // ── SLIDE 17: TUMOURS TWO-COL ── twoColSlide("Small Bowel Tumours - Overview", ["Adenoma (tubular/villous - duodenum, polyp syndromes)", "GIST - Gastrointestinal Stromal Tumour (stromal, CD117+)", "Lipoma (submucosal, smooth on imaging)", "Haemangioma (cause of obscure GI bleeding)", "Peutz-Jeghers hamartomas (hamartomatous polyps)", "Brunner's gland hyperplasia (duodenal bulb)"], ["Adenocarcinoma (most common malignant - duodenum/proximal jejunum)", "Carcinoid / NET: ileum is MC site; secretes serotonin", "MALT Lymphoma (increased risk in celiac disease)", "GIST (malignant potential): KIT / PDGFRA mutations", "Metastases: melanoma (MC), lung, breast, kidney"], "Benign Tumours", "Malignant Tumours" ); // ── SLIDE 18: CARCINOID & INVESTIGATIONS ── contentSlide("Carcinoid / NET & Small Bowel Tumour Investigations", [ { head: "Carcinoid Syndrome (occurs when liver metastases bypass portal detoxification)", sub: ["Episodic cutaneous flushing (face, neck, upper chest)", "Secretory watery diarrhoea; bronchospasm (wheezing)", "Right-sided valvular disease: tricuspid regurgitation, pulmonary stenosis", "Elevated urinary 5-HIAA (>25 mg/24h); serum chromogranin A (tumour marker)"] }, { head: "Investigations for small bowel tumours", sub: ["CT/MRI enterography: mass, lymphadenopathy, liver metastases, desmoplastic reaction", "Capsule endoscopy: best sensitivity for mid-gut tumours (no biopsy capability)", "Double-balloon enteroscopy: biopsy + endoscopic therapy", "Ga-68 DOTATATE PET/CT: best for NET localisation and staging", "OGD + biopsy for duodenal tumours"] }, { head: "Management principles", sub: ["Surgical resection: curative intent for localised disease", "Carcinoid syndrome: somatostatin analogues (octreotide / lanreotide) for symptom control", "Metastatic NET: PRRT (Peptide Receptor Radionuclide Therapy) with Lu-177-DOTATATE", "GIST: imatinib (KIT inhibitor); MALT lymphoma: R-CHOP chemotherapy"] }, ]); // ── SLIDE 19: SUMMARY TABLE ── { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } }); sl.addText("Summary: Key Disorders at a Glance", { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" }); const rows = [ ["Condition", "Hallmark Feature", "Key Investigation", "First-line Management"], ["Crohn's disease", "Transmural skip lesions, RLQ pain", "CT enterography, ileoscopy", "5-ASA -> steroids -> biologics"], ["Celiac disease", "Gluten enteropathy, villous atrophy", "Anti-tTG IgA + duodenal biopsy", "Lifelong gluten-free diet"], ["Tropical sprue", "Megaloblastic anaemia, tropical region", "D-xylose test, small bowel biopsy", "Folic acid + tetracycline"], ["Intestinal obstruction", "Colicky pain, distension, bilious vomiting", "AXR (air-fluid levels), CT abdomen", "NGT + IV fluids; surgery if needed"], ["Intussusception", "Redcurrant jelly stool, RUQ sausage mass", "USS (target sign)", "Air/contrast enema; surgery"], ["Short gut syndrome", "Diarrhoea, malnutrition, TPN dependence", "Serum vitamins, CT enterography", "TPN -> enteral feeds; STEP/Bianchi"], ["SIBO", "Bloating, B12 deficiency, breath test +ve", "Glucose breath test", "Rifaximin 550 mg TDS x 14 days"], ["Carcinoid/NET (ileum)", "Flushing, diarrhoea, cardiac (R-sided)", "5-HIAA, Ga-68 DOTANOC PET/CT", "Resection + octreotide"], ]; const colW = [2.0, 2.35, 2.45, 2.75]; const startX = 0.22; const startY = 1.0; const rowH = 0.46; rows.forEach((row, ri) => { row.forEach((cell, ci) => { const x = startX + colW.slice(0, ci).reduce((a, b) => a + b, 0); const y = startY + ri * rowH; const isHeader = ri === 0; sl.addShape(pres.ShapeType.rect, { x, y, w: colW[ci], h: rowH, fill: { color: isHeader ? C.teal : (ri % 2 === 0 ? C.white : "D9EFF3") }, line: { color: C.teal, width: 0.5 } }); sl.addText(cell, { x: x + 0.05, y: y + 0.03, w: colW[ci] - 0.1, h: rowH - 0.06, fontSize: isHeader ? 11 : 10, bold: isHeader, color: isHeader ? C.white : C.text, fontFace: "Calibri", valign: "middle" }); }); }); } // ── SLIDE 20: THANK YOU ── { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 3.8, w: "100%", h: 1.825, fill: { color: C.teal } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 3.75, w: "100%", h: 0.08, fill: { color: C.accent } }); sl.addText("Key Takeaways", { x: 0.5, y: 0.2, w: 9, h: 0.7, fontSize: 30, bold: true, color: C.accent, fontFace: "Calibri", align: "center" }); const takeaways = [ "Crohn's: transmural skip lesions - think complications: stricture, fistula, abscess", "Celiac: anti-tTG IgA + biopsy (Marsh III) - strict lifelong GLUTEN-FREE diet is the treatment", "Short gut syndrome: >50% resection -> TPN dependence; ileum & ileocaecal valve are critical", "Intestinal obstruction: AXR (air-fluid levels) + CT; closed-loop/strangulation = surgical emergency", "SGS surgery: STEP or Bianchi procedure to lengthen and narrow dilated residual bowel", "Carcinoid syndrome: only when liver metastases present (serotonin bypasses portal system)", "SIBO: hydrogen breath test; treat with rifaximin; address underlying cause", ]; sl.addText(takeaways.map((t, i) => ({ text: "\u2726 " + t, options: { bullet: false, color: C.white, fontSize: 13.5, breakLine: i < takeaways.length - 1, fontFace: "Calibri" } })), { x: 0.6, y: 1.0, w: 8.8, h: 2.7, valign: "top" }); sl.addText("Thank You", { x: 0.5, y: 3.82, w: 9, h: 0.55, fontSize: 26, bold: true, color: C.white, fontFace: "Calibri", align: "center" }); sl.addText("References: Sabiston Textbook of Surgery 21e | Robbins & Kumar Basic Pathology 11e | Sleisenger & Fordtran's GI & Liver Disease | Maingot's Abdominal Operations", { x: 0.5, y: 4.45, w: 9, h: 0.7, fontSize: 9.5, color: "D0E8EF", fontFace: "Calibri", align: "center" }); } pres.writeFile({ fileName: "/home/daytona/workspace/small-intestine-ppt/Small_Intestine_Disorders.pptx" }) .then(() => console.log("SUCCESS")) .catch(e => { console.error("ERROR:", e.message); process.exit(1); }); JSEOF echo "File written"
cd /home/daytona/workspace/small-intestine-ppt && node create_pptx.js
cd /home/daytona/workspace/small-intestine-ppt && curl -s -o obs_img.png "https://cdn.orris.care/cdss_images/158bc9cc39e323c81d9f0cccaa784bfbb067bab526f2241ccac5c8435bc1e400.png" && curl -s -o step_img.png "https://cdn.orris.care/cdss_images/d2918e8deba389a22ac8f4bbb21a6215b76958fc3eccdb92b55aa48059500ff8.png" && ls -lh *.png
cd /home/daytona/workspace/small-intestine-ppt && sed -i 's|// Fetch images.*||' create_pptx.js && head -5 create_pptx.js
cd /home/daytona/workspace/small-intestine-ppt && node -e " const pptxgen = require('pptxgenjs'); const fs = require('fs'); const path = require('path'); // Load images from local files const obsImgBuf = fs.readFileSync('/home/daytona/workspace/small-intestine-ppt/obs_img.png'); const stepImgBuf = fs.readFileSync('/home/daytona/workspace/small-intestine-ppt/step_img.png'); const obsImg = 'image/png;base64,' + obsImgBuf.toString('base64'); const stepImg = 'image/png;base64,' + stepImgBuf.toString('base64'); console.log('obsImg size:', obsImg.length); console.log('stepImg size:', stepImg.length); const pres = new pptxgen(); pres.layout = 'LAYOUT_16x9'; const sl = pres.addSlide(); sl.addImage({ data: obsImg, x: 1, y: 1, w: 3, h: 3 }); sl.addImage({ data: stepImg, x: 5, y: 1, w: 3, h: 3 }); sl.addText('Image test', { x: 0.5, y: 4.5, w: 9, h: 0.5, fontSize: 24, color: '000000' }); pres.writeFile({ fileName: '/home/daytona/workspace/small-intestine-ppt/test_img.pptx' }) .then(() => console.log('TEST OK')) .catch(e => console.error('ERROR:', e)); "
cat > /home/daytona/workspace/small-intestine-ppt/build_final.js << 'JSEOF' const pptxgen = require("pptxgenjs"); const fs = require("fs"); const obsImgBuf = fs.readFileSync('/home/daytona/workspace/small-intestine-ppt/obs_img.png'); const stepImgBuf = fs.readFileSync('/home/daytona/workspace/small-intestine-ppt/step_img.png'); const obsImg = 'image/png;base64,' + obsImgBuf.toString('base64'); const stepImg = 'image/png;base64,' + stepImgBuf.toString('base64'); const pres = new pptxgen(); pres.layout = "LAYOUT_16x9"; pres.author = "Medical Education"; pres.title = "Disorders of Small Intestine"; const C = { navy: "0D2B55", teal: "1A7A8A", accent: "E8A020", light: "EEF4F7", white: "FFFFFF", text: "1C2B36", subtext: "4A6070", red: "C0392B", green: "1E8449", }; function sectionSlide(title, subtitle) { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 4.8, w: "100%", h: 0.825, fill: { color: C.teal } }); sl.addShape(pres.ShapeType.rect, { x: 0.5, y: 1.8, w: 0.12, h: 2, fill: { color: C.accent } }); sl.addText(title, { x: 0.9, y: 1.8, w: 8.5, h: 2, fontSize: 38, bold: true, color: C.white, fontFace: "Calibri" }); if (subtitle) sl.addText(subtitle, { x: 0.9, y: 3.9, w: 8.5, h: 0.7, fontSize: 18, color: C.accent, fontFace: "Calibri" }); } function buildItems(bullets) { const items = []; bullets.forEach(b => { if (typeof b === "object") { items.push({ text: b.head, options: { bullet: { type: "bullet" }, bold: true, color: C.navy, fontSize: b.size || 14, breakLine: true, fontFace: "Calibri" } }); if (b.sub) b.sub.forEach(s => items.push({ text: " \u2022 " + s, options: { bullet: false, color: C.text, fontSize: (b.size || 14) - 1, breakLine: true, fontFace: "Calibri" } })); } else { items.push({ text: b, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 13, breakLine: true, fontFace: "Calibri" } }); } }); if (items.length) items[items.length - 1].options.breakLine = false; return items; } function contentSlide(title, bullets, imgData, imgCaption) { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } }); sl.addText(title, { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" }); const bw = imgData ? 5.65 : 9.4; sl.addText(buildItems(bullets), { x: 0.3, y: 1.05, w: bw, h: 4.4, valign: "top" }); if (imgData) { sl.addImage({ data: imgData, x: 6.15, y: 1.05, w: 3.55, h: 3.7 }); if (imgCaption) sl.addText(imgCaption, { x: 6.05, y: 4.78, w: 3.7, h: 0.65, fontSize: 9, color: C.subtext, fontFace: "Calibri", italic: true, align: "center" }); } } function twoColSlide(title, leftItems, rightItems, leftTitle, rightTitle) { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } }); sl.addText(title, { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" }); [[leftItems, leftTitle, C.teal, 0.3], [rightItems, rightTitle, C.accent, 5.3]].forEach(([items, hdr, col, x]) => { sl.addShape(pres.ShapeType.rect, { x, y: 1.0, w: 4.4, h: 4.5, fill: { color: C.white }, line: { color: col, width: 1.5 } }); sl.addShape(pres.ShapeType.rect, { x, y: 1.0, w: 4.4, h: 0.45, fill: { color: col } }); sl.addText(hdr, { x, y: 1.0, w: 4.4, h: 0.45, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" }); sl.addText(items.map((t, i) => ({ text: t, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 12, breakLine: i < items.length - 1, fontFace: "Calibri" } })), { x: x + 0.1, y: 1.5, w: 4.2, h: 3.9, valign: "top" }); }); } // SLIDE 1: TITLE { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 4.6, w: "100%", h: 1.025, fill: { color: C.teal } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 2.1, w: "100%", h: 0.08, fill: { color: C.accent } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 2.18, w: "100%", h: 0.02, fill: { color: C.white } }); sl.addText("Disorders of the Small Intestine", { x: 0.5, y: 0.3, w: 9, h: 1.75, fontSize: 40, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" }); sl.addText("Clinical Features \u2022 Investigations \u2022 Management", { x: 0.5, y: 2.3, w: 9, h: 0.7, fontSize: 20, color: C.accent, fontFace: "Calibri", align: "center" }); sl.addText("Including Short Gut Syndrome", { x: 0.5, y: 3.05, w: 9, h: 0.55, fontSize: 18, color: C.light, fontFace: "Calibri", align: "center" }); sl.addText("For MBBS Students | General Surgery & Medicine", { x: 0.5, y: 4.72, w: 9, h: 0.7, fontSize: 15, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" }); } // SLIDE 2: OVERVIEW contentSlide("Anatomy & Overview of Small Intestine", [ { head: "Three segments: Duodenum | Jejunum | Ileum", sub: ["Total length: 6-7 m in vivo (3 m contracted)", "Duodenum: 25 cm, retroperitoneal, C-shaped loop around head of pancreas"] }, { head: "Key functions", sub: ["Digestion and absorption of nutrients, water, electrolytes", "Immune surveillance via Peyer's patches and secretory IgA", "Endocrine: GIP, CCK, secretin, motilin, GLP-1, GLP-2"] }, { head: "Ileum: unique absorptive sites", sub: ["Vitamin B12 (bound to intrinsic factor)", "Bile salts (enterohepatic circulation)", "Fat-soluble vitamins A, D, E, K"] }, { head: "Disorders covered", sub: ["Inflammatory: Crohn's, Celiac, Tropical sprue", "Obstructive: Intestinal obstruction, Intussusception, Volvulus", "Malabsorptive: Short gut syndrome, SIBO", "Neoplastic: Adenocarcinoma, Carcinoid/NET, Lymphoma, GIST"] }, ]); // SLIDE 3: SECTION sectionSlide("1. Inflammatory Disorders", "Crohn's Disease \u2022 Celiac Disease \u2022 Tropical Sprue"); // SLIDE 4: CROHN'S CLINICAL contentSlide("Crohn's Disease - Clinical Features", [ { head: "Definition", sub: ["Transmural granulomatous inflammation; any part of GI tract (mouth to anus)", "Most common: terminal ileum and ileocaecal region; SKIP LESIONS are the hallmark"] }, { head: "Symptoms (small intestine involvement)", sub: ["Abdominal pain: postprandial, crampy (partial obstruction) - present in 90% of cases", "Non-bloody diarrhoea; weight loss and anorexia", "Palpable RLQ mass (thickened bowel, abscess, or phlegmon)"] }, { head: "Complications", sub: ["Strictures -> bowel obstruction; Fistulas (enteroenteric, enterovesical, enterovaginal)", "Abscess formation; Perianal disease (fissures, fistulas, skin tags) in ~40%"] }, { head: "Extraintestinal manifestations", sub: ["Joints: ankylosing spondylitis, sacroiliitis, seronegative polyarthritis", "Skin: erythema nodosum, pyoderma gangrenosum", "Eyes: uveitis, episcleritis | Liver: primary sclerosing cholangitis (less common than UC)"] }, ]); // SLIDE 5: CROHN'S INX & RX twoColSlide("Crohn's Disease - Investigations & Management", ["Bloods: FBC (anaemia), ESR/CRP elevated, albumin low", "Stool: culture, C. diff, faecal calprotectin markedly elevated", "Ileoscopy: cobblestone mucosa, skip lesions, deep ulcers", "CT/MRI enterography: wall thickening, creeping fat, fistulas", "Barium follow-through: string sign of Kantor (stricture)", "Histology: transmural inflammation, non-caseating granulomas"], ["Mild: 5-ASA (mesalazine), nutritional support", "Moderate flare: corticosteroids (prednisolone/budesonide)", "Maintenance: azathioprine, 6-mercaptopurine", "Severe/refractory: Anti-TNF biologics (infliximab, adalimumab)", "Surgery: resection for obstruction/fistulas/abscess (bowel-sparing)", "Surveillance colonoscopy after 10 years for cancer risk"], "Investigations", "Management" ); // SLIDE 6: CELIAC contentSlide("Celiac Disease (Gluten-Sensitive Enteropathy)", [ { head: "Pathophysiology", sub: ["Autoimmune enteropathy triggered by dietary gluten (wheat, barley, rye)", "Genetic predisposition: HLA-DQ2 (90%) and HLA-DQ8", "Anti-tTG, anti-endomysial (EMA) IgA antibodies -> villous atrophy -> malabsorption"] }, { head: "Clinical Features", sub: ["Classic: chronic diarrhoea, steatorrhoea, bloating, weight loss, failure to thrive in children", "Atypical: iron-deficiency anaemia, osteoporosis, dermatitis herpetiformis, infertility", "Silent: asymptomatic, found on screening (e.g. relatives of known cases)"] }, { head: "Investigations", sub: ["Serology: anti-tTG IgA (sensitivity ~95%); check total IgA (exclude IgA deficiency)", "Duodenal biopsy: villous atrophy + crypt hyperplasia + intraepithelial lymphocytes = Marsh III", "HLA typing (DQ2/DQ8): high NPV to exclude celiac disease if negative"] }, { head: "Management", sub: ["STRICT lifelong gluten-free diet (cornerstone; most patients respond within weeks)", "Nutritional supplementation: iron, folate, B12, calcium, vitamin D", "Refractory celiac: budesonide, azathioprine; exclude T-cell lymphoma (EATL)"] }, ]); // SLIDE 7: TROPICAL SPRUE contentSlide("Tropical Sprue", [ { head: "Definition & Aetiology", sub: ["Acquired malabsorption in residents of / visitors to tropical/subtropical regions", "Likely caused by bacterial overgrowth + folate depletion (possibly enterotoxigenic E. coli)"] }, { head: "Clinical Features", sub: ["Watery diarrhoea (3-10 stools/day), steatorrhoea, anorexia, weight loss", "Macrocytic / megaloblastic anaemia (folate and vitamin B12 deficiency)", "Glossitis, angular cheilitis, peripheral oedema"] }, { head: "Investigations", sub: ["Bloods: megaloblastic anaemia; low serum folate (<3 ng/mL) and B12", "D-xylose absorption test: reduced (confirms villous absorptive defect)", "Small bowel biopsy: partial villous atrophy (less severe than celiac), not IgA-mediated", "Stool: fat globules; no parasites (distinguishes from giardiasis)"] }, { head: "Management", sub: ["Folic acid (5 mg/day) + Vitamin B12 replacement for 2-3 months", "Tetracycline 250 mg QID for 3-6 months (eradicates bacterial overgrowth)", "Most patients achieve full clinical and histological remission"] }, ]); // SLIDE 8: SECTION sectionSlide("2. Obstructive Disorders", "Intestinal Obstruction \u2022 Intussusception \u2022 Volvulus"); // SLIDE 9: INTESTINAL OBSTRUCTION (with obs image) contentSlide("Small Bowel Obstruction - Features & Management", [ { head: "Causes (80%: hernias, adhesions, intussusception, volvulus)", sub: ["Adhesions (MC cause in adults - post-surgical)", "Hernias: inguinal, femoral, incisional | Volvulus (midgut)", "Tumours; Crohn's strictures; Gallstone ileus"] }, { head: "Clinical Features", sub: ["Colicky abdominal pain, bilious vomiting (high SBO = early/more severe vomiting)", "Abdominal distension; absolute constipation (complete obstruction)", "High-pitched tinkling bowel sounds early; SILENT in strangulation (emergency!)"] }, { head: "Investigations", sub: ["AXR erect: dilated loops >3 cm, multiple air-fluid levels, no gas in colon", "CT abdomen with contrast: transition point, identify cause, detect strangulation", "Bloods: raised WCC, elevated lactate (warns of strangulation)"] }, { head: "Management", sub: ["Conservative (partial/early): NBM, nasogastric tube decompression, IV fluids", "Surgical: strangulation, perforation, peritonitis, complete obstruction, failed conservative"] }, ], obsImg, "FIG: Four major mechanical causes of intestinal\nobstruction: herniation, adhesions, volvulus, intussusception\n(Robbins & Kumar Basic Pathology)"); // SLIDE 10: INTUSSUSCEPTION contentSlide("Intussusception", [ { head: "Definition", sub: ["Telescoping of proximal bowel (intussusceptum) into distal segment (intussuscipiens)", "MC cause of intestinal obstruction in children under 2 years"] }, { head: "Types & Causes", sub: ["Idiopathic (infants): reactive Peyer's patch hyperplasia after viral illness; rotavirus association", "Secondary (older children/adults): Meckel's diverticulum, polyp, or lymphoma as lead point"] }, { head: "Classic Triad", sub: ["Colicky abdominal pain (child draws knees to chest, screams intermittently)", "Redcurrant jelly stools (blood and mucus - late feature; indicates bowel ischaemia)", "Palpable sausage-shaped mass in right upper/central abdomen", "Dance sign: emptiness in RIF as mass migrates to right upper quadrant"] }, { head: "Investigations & Management", sub: ["Ultrasound: TARGET SIGN / doughnut sign (concentric rings) - diagnostic", "Air/contrast enema: diagnostic AND therapeutic (80-90% success in children)", "Surgery: peritonitis, failed reduction, or adult lead point identified"] }, ]); // SLIDE 11: SECTION sectionSlide("3. Short Gut Syndrome", "Definition \u2022 Pathophysiology \u2022 Management"); // SLIDE 12: SGS PATHOPHYSIOLOGY contentSlide("Short Gut Syndrome - Definition & Pathophysiology", [ { head: "Definition", sub: ["Clinical state where residual intestine cannot maintain adequate absorption of nutrients, fluids, and electrolytes", "Usually follows massive small bowel resection (loss of >50-70% of small bowel)"] }, { head: "Common causes", sub: ["Adults: Crohn's disease (MC), mesenteric ischaemia/infarction, trauma, radiation enteritis", "Neonates/Paediatric: NEC (35%), intestinal atresia (25%), gastroschisis (18%), midgut volvulus (14%)"] }, { head: "Key determinants of outcome", sub: ["Residual bowel length: 35-40 cm gives 50% chance of weaning off TPN; each additional cm adds 4%", "Presence of ileocaecal valve (surrogate for terminal ileum integrity)", "Colon in continuity: essential for water and electrolyte salvage"] }, { head: "Intestinal adaptation (post-resection)", sub: ["Villous hyperplasia, crypt deepening, bowel dilation over weeks to months", "Stimulated by enteral feeding, growth factors (GLP-2 analogue: teduglutide)", "Terminal ileum has greatest adaptive capacity"] }, ]); // SLIDE 13: SGS CLINICAL + INX contentSlide("Short Gut Syndrome - Clinical Features & Investigations", [ { head: "Clinical Features", sub: ["Profuse watery diarrhoea/steatorrhoea; severe dehydration; electrolyte imbalances", "Weight loss, cachexia, failure to thrive (paediatric)", "Fat-soluble vitamin deficiencies (A, D, E, K) -> coagulopathy, bone disease, night blindness", "Vitamin B12 deficiency (ileal loss) -> macrocytic anaemia", "D-lactic acidosis (colonic bacteria ferment unabsorbed carbs) -> confusion, ataxia, slurred speech"] }, { head: "Complications of TPN dependence", sub: ["Catheter-related bloodstream infections (CRBSI)", "TPN-associated liver disease -> cholestasis -> cirrhosis", "Gallstones: 100% incidence in severe SGS on long-term TPN", "Metabolic bone disease (osteoporosis) and renal oxalate stones"] }, { head: "Investigations", sub: ["Bloods: FBC, LFTs, renal panel, electrolytes, vitamins (A, D, E, K, B12, folate)", "Serum zinc, selenium, magnesium, phosphate; DEXA scan for bone density", "Abdominal USS (gallstones, liver steatosis); 72-hr faecal fat collection", "CT/MRI enterography: assess residual bowel length and anatomy"] }, ]); // SLIDE 14: SGS MANAGEMENT (with step image) { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } }); sl.addText("Short Gut Syndrome - Principles of Management", { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" }); const phases = [ { label: "Phase 1 (0-3 wks)", text: "Total parenteral nutrition (TPN)\nIV fluids & electrolyte replacement\nAntidiarrhoeals: loperamide, codeine\nPPI: reduce gastric hypersecretion", col: C.red }, { label: "Phase 2 (3 wks-1 yr)", text: "Gradual oral/enteral feeds (trophic)\nTPN weaned as tolerance improves\nTeduglutide (GLP-2 analogue)\nto stimulate intestinal adaptation", col: C.teal }, { label: "Phase 3 (>1 yr)", text: "Enteral autonomy (if adapted)\nContinue teduglutide if needed\nOral rehydration solution (ORS)\nProkinetics / antisecretory agents", col: C.green }, ]; phases.forEach((p, i) => { const x = 0.28 + i * 3.18; sl.addShape(pres.ShapeType.rect, { x, y: 1.0, w: 3.0, h: 0.48, fill: { color: p.col } }); sl.addText(p.label, { x, y: 1.0, w: 3.0, h: 0.48, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" }); sl.addShape(pres.ShapeType.rect, { x, y: 1.48, w: 3.0, h: 1.65, fill: { color: C.white }, line: { color: p.col, width: 1.5 } }); sl.addText(p.text, { x: x + 0.08, y: 1.53, w: 2.84, h: 1.55, fontSize: 10.5, color: C.text, fontFace: "Calibri", valign: "top" }); }); sl.addText("Surgical Options for Dilated Residual Bowel:", { x: 0.3, y: 3.22, w: 5.55, h: 0.38, fontSize: 13, bold: true, color: C.navy, fontFace: "Calibri" }); const surg = [ "Bianchi (LILT): splits mesentery into 2 planes; bowel stapled longitudinally -> doubles length, halves diameter", "STEP (Serial Transverse Enteroplasty): transverse stapling in V-shapes on alternating sides -> narrower, longer bowel", "Small bowel transplantation: last resort for irreversible intestinal failure + TPN complications", "Prophylactic cholecystectomy: in long-term TPN patients (virtually 100% gallstone risk)", ]; sl.addText(surg.map((t, i) => ({ text: t, options: { bullet: { type: "bullet" }, color: C.text, fontSize: 11, breakLine: i < surg.length - 1, fontFace: "Calibri" } })), { x: 0.3, y: 3.62, w: 5.55, h: 1.85, valign: "top" }); sl.addImage({ data: stepImg, x: 6.1, y: 3.18, w: 3.6, h: 2.2 }); sl.addText("FIG: Bianchi (A) & STEP (B) bowel-\nlengthening procedures\n(Sabiston Textbook of Surgery)", { x: 6.0, y: 5.38, w: 3.8, h: 0.5, fontSize: 9, color: C.subtext, fontFace: "Calibri", italic: true, align: "center" }); } // SLIDE 15: SIBO contentSlide("Small Intestinal Bacterial Overgrowth (SIBO)", [ { head: "Definition", sub: [">10^5 CFU/mL organisms in proximal small intestine (normally <10^4 CFU/mL)", "Maintained by: gastric acid, peristalsis, secretory IgA, ileocaecal valve"] }, { head: "Causes & Predisposing Factors", sub: ["Hypomotility: scleroderma, diabetic neuropathy, post-surgical (Roux-en-Y, blind loops)", "Anatomical: strictures (Crohn's), diverticula, fistulas, short gut syndrome", "Achlorhydria (PPI overuse, post-gastrectomy); immunodeficiency"] }, { head: "Clinical Features", sub: ["Bloating, excessive flatulence, abdominal discomfort, diarrhoea, steatorrhoea", "Vitamin B12 deficiency (bacteria consume B12); fat-soluble vitamin malabsorption", "D-lactic acidosis in SGS patients with colon in continuity"] }, { head: "Investigations & Management", sub: ["Hydrogen/methane breath test (glucose or lactulose): early peak (<90 min) = SIBO", "Gold standard: jejunal aspirate and culture (>10^5 CFU/mL) - invasive", "Rifaximin 550 mg TDS x 14 days (first-line, non-absorbable antibiotic)", "Address underlying cause; rotating antibiotics for recurrent SIBO"] }, ]); // SLIDE 16: SECTION sectionSlide("4. Neoplasms of the Small Intestine", "Benign \u2022 Malignant \u2022 Carcinoid / NET"); // SLIDE 17: TUMOURS twoColSlide("Small Bowel Tumours - Overview", ["Adenoma (tubular/villous - duodenum, polyp syndromes)", "GIST - stromal (CD117+, KIT mutation, spindle cell)", "Lipoma (submucosal, smooth on imaging)", "Haemangioma (cause of obscure GI bleeding)", "Peutz-Jeghers hamartomas (associated syndrome)", "Brunner's gland hyperplasia (duodenal bulb)"], ["Adenocarcinoma (most common malignant - duodenum)", "Carcinoid / NET: ileum is MC site; secretes serotonin", "MALT Lymphoma (increased risk in celiac disease)", "Malignant GIST: KIT/PDGFRA mutation", "Metastases: melanoma (MC metastasis to SB), lung, breast"], "Benign Tumours", "Malignant Tumours" ); // SLIDE 18: CARCINOID & INVESTIGATIONS contentSlide("Carcinoid / NET - Clinical Features & Management", [ { head: "Carcinoid Syndrome (occurs only when liver metastases present)", sub: ["Episodic cutaneous FLUSHING (face, neck, upper chest)", "Secretory watery DIARRHOEA; BRONCHOSPASM (wheezing)", "Right-sided valvular disease: tricuspid regurgitation, pulmonary stenosis", "Elevated urinary 5-HIAA (>25 mg/24h); serum chromogranin A (tumour marker)"] }, { head: "Investigations for small bowel tumours", sub: ["CT/MRI enterography: mass, mesenteric lymphadenopathy, liver metastases", "Capsule endoscopy: best sensitivity for mid-gut tumours (no biopsy)", "Double-balloon enteroscopy: biopsy capability + endoscopic therapy", "Ga-68 DOTANOC/DOTATATE PET/CT: localisation and staging of NETs", "OGD + biopsy for duodenal tumours; octreotide scan"] }, { head: "Management principles", sub: ["Surgical resection: curative intent for localised disease", "Somatostatin analogues (octreotide/lanreotide): carcinoid syndrome symptom control", "PRRT with Lu-177-DOTATATE: metastatic NETs unresectable", "GIST: imatinib (KIT inhibitor); MALT lymphoma: R-CHOP regimen"] }, ]); // SLIDE 19: SUMMARY TABLE { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.light } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: "100%", h: 0.06, fill: { color: C.accent } }); sl.addText("Summary: Key Disorders at a Glance", { x: 0.2, y: 0.08, w: 9.6, h: 0.7, fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" }); const rows = [ ["Condition", "Hallmark Feature", "Key Investigation", "First-line Management"], ["Crohn's disease", "Transmural skip lesions, RLQ pain", "CT enterography, ileoscopy", "5-ASA -> steroids -> biologics"], ["Celiac disease", "Gluten enteropathy, villous atrophy", "Anti-tTG IgA + duodenal biopsy", "Lifelong gluten-free diet"], ["Tropical sprue", "Megaloblastic anaemia, tropical region", "D-xylose test, small bowel biopsy", "Folic acid + tetracycline"], ["Intestinal obstruction", "Colicky pain, distension, bilious vomiting", "AXR (air-fluid levels), CT abdomen", "NGT + IV fluids; surgery if needed"], ["Intussusception", "Redcurrant jelly stool, RUQ mass", "USS (target sign / doughnut sign)", "Air/contrast enema; surgery"], ["Short gut syndrome", "Diarrhoea, malnutrition, TPN dependence", "Serum vitamins, CT enterography", "TPN -> enteral feeds; STEP/Bianchi"], ["SIBO", "Bloating, B12 deficiency, breath test +ve", "Glucose hydrogen breath test", "Rifaximin 550 mg TDS x 14 days"], ["Carcinoid/NET (ileum)", "Flushing, diarrhoea, right-sided valves", "5-HIAA, Ga-68 DOTANOC PET/CT", "Resection + octreotide/lanreotide"], ]; const colW = [2.0, 2.35, 2.45, 2.75]; const startX = 0.22, startY = 1.0, rowH = 0.46; rows.forEach((row, ri) => { row.forEach((cell, ci) => { const x = startX + colW.slice(0, ci).reduce((a, b) => a + b, 0); const y = startY + ri * rowH; const isHeader = ri === 0; sl.addShape(pres.ShapeType.rect, { x, y, w: colW[ci], h: rowH, fill: { color: isHeader ? C.teal : (ri % 2 === 0 ? C.white : "D9EFF3") }, line: { color: C.teal, width: 0.5 } }); sl.addText(cell, { x: x + 0.05, y: y + 0.03, w: colW[ci] - 0.1, h: rowH - 0.06, fontSize: isHeader ? 11 : 10, bold: isHeader, color: isHeader ? C.white : C.text, fontFace: "Calibri", valign: "middle" }); }); }); } // SLIDE 20: THANK YOU { const sl = pres.addSlide(); sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: "100%", h: "100%", fill: { color: C.navy } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 3.8, w: "100%", h: 1.825, fill: { color: C.teal } }); sl.addShape(pres.ShapeType.rect, { x: 0, y: 3.75, w: "100%", h: 0.08, fill: { color: C.accent } }); sl.addText("Key Takeaways", { x: 0.5, y: 0.2, w: 9, h: 0.7, fontSize: 30, bold: true, color: C.accent, fontFace: "Calibri", align: "center" }); const takeaways = [ "Crohn's: transmural skip lesions - think COMPLICATIONS: stricture, fistula, abscess", "Celiac: anti-tTG IgA + biopsy (Marsh III) - strict lifelong GLUTEN-FREE diet", "Short gut syndrome: >50% resection -> TPN dependence; ileum and ileocaecal valve are critical", "Intestinal obstruction: AXR (air-fluid levels) + CT; strangulation = surgical EMERGENCY", "SGS surgery: STEP or Bianchi to lengthen and narrow the dilated residual bowel", "Carcinoid syndrome: ONLY when liver metastases present (serotonin bypasses portal system)", "SIBO: hydrogen breath test; treat with rifaximin; address the underlying cause", ]; sl.addText(takeaways.map((t, i) => ({ text: "\u2726 " + t, options: { bullet: false, color: C.white, fontSize: 13.5, breakLine: i < takeaways.length - 1, fontFace: "Calibri" } })), { x: 0.6, y: 1.0, w: 8.8, h: 2.7, valign: "top" }); sl.addText("Thank You", { x: 0.5, y: 3.82, w: 9, h: 0.55, fontSize: 26, bold: true, color: C.white, fontFace: "Calibri", align: "center" }); sl.addText("References: Sabiston Textbook of Surgery 21e | Robbins & Kumar Basic Pathology 11e | Sleisenger & Fordtran's GI & Liver Disease | Maingot's Abdominal Operations", { x: 0.5, y: 4.45, w: 9, h: 0.7, fontSize: 9.5, color: "D0E8EF", fontFace: "Calibri", align: "center" }); } pres.writeFile({ fileName: "/home/daytona/workspace/small-intestine-ppt/Small_Intestine_Disorders.pptx" }) .then(() => console.log("SUCCESS")) .catch(e => { console.error("ERROR:", e.message); process.exit(1); }); JSEOF echo "Script written"
cd /home/daytona/workspace/small-intestine-ppt && node build_final.js && ls -lh Small_Intestine_Disorders.pptx