Appendicitis. Make ppt

Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Now let me get the main content from the key textbooks on appendicitis.
Reading File
Reading File
Reading File
I now have enough content to build a comprehensive, visually rich PPT. Let me create it now.
Running Command

mkdir -p /home/daytona/workspace/appendicitis-ppt && ls /home/daytona/workspace/appendicitis-ppt/

Writing File

~/appendicitis-ppt/create_ppt.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Acute Appendicitis";
pres.author = "Medical Education";

// ─── COLOUR PALETTE ────────────────────────────────────────────────────────────
const C = {
  darkBg:    "0D1B2A",  // deep navy – title/section slides
  midBg:     "1B3A5C",  // mid-navy – accent bars
  accent:    "E94F37",  // vibrant red-orange (surgical/alert)
  accentSoft:"F5A623",  // amber – highlights
  light:     "F0F4F8",  // near-white content bg
  white:     "FFFFFF",
  textDark:  "1A1A2E",
  textMid:   "2C4A70",
  textLight: "D4E4F7",
  subtext:   "5A7FA8",
  green:     "27AE60",
  red:       "C0392B",
};

// ─── HELPER – section-divider slide ─────────────────────────────────────────
function sectionSlide(title, subtitle) {
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBg } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 2.6, w: 10, h: 0.06, fill: { color: C.accent } });
  s.addText(title, { x: 0.6, y: 1.8, w: 8.8, h: 0.9, fontSize: 40, bold: true, color: C.white, fontFace: "Calibri" });
  if (subtitle) {
    s.addText(subtitle, { x: 0.6, y: 2.8, w: 8.8, h: 0.7, fontSize: 18, color: C.textLight, fontFace: "Calibri" });
  }
  return s;
}

// ─── HELPER – content slide template ────────────────────────────────────────
function contentSlide(heading, accent = C.accent) {
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.light } });
  // left accent bar
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: accent } });
  // header strip
  s.addShape(pres.ShapeType.rect, { x: 0.12, y: 0, w: 9.88, h: 0.85, fill: { color: C.midBg } });
  s.addText(heading, { x: 0.3, y: 0.08, w: 9.4, h: 0.7, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0 });
  return s;
}

// ─── HELPER – bullet block ───────────────────────────────────────────────────
function addBullets(slide, items, x, y, w, h, opts = {}) {
  const rows = items.map((item, i) => ({
    text: item,
    options: {
      bullet: { code: "25B6", indent: 12 },
      breakLine: i < items.length - 1,
      fontSize: opts.fontSize || 14,
      color: opts.color || C.textDark,
      fontFace: "Calibri",
      paraSpaceAfter: 4,
      bold: false,
    },
  }));
  slide.addText(rows, { x, y, w, h, valign: "top", margin: [4, 8, 4, 8] });
}

// ─── HELPER – stat box ───────────────────────────────────────────────────────
function statBox(slide, x, y, w, h, value, label, bg = C.accent) {
  slide.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: bg }, rectRadius: 0.1, line: { color: bg } });
  slide.addText(value, { x, y: y + 0.07, w, h: h * 0.52, fontSize: 24, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  slide.addText(label, { x, y: y + h * 0.52, w, h: h * 0.45, fontSize: 10, color: C.white, align: "center", valign: "top", fontFace: "Calibri", wrap: true });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 1 – TITLE
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBg } });
  // diagonal accent shape
  s.addShape(pres.ShapeType.rect, { x: 6.8, y: 0, w: 3.2, h: 5.625, fill: { color: C.midBg } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 4.6, w: 10, h: 0.1, fill: { color: C.accent } });
  s.addText("ACUTE APPENDICITIS", {
    x: 0.5, y: 1.0, w: 6.0, h: 1.0,
    fontSize: 38, bold: true, color: C.white, fontFace: "Calibri",
    charSpacing: 2,
  });
  s.addText("A Comprehensive Clinical Overview", {
    x: 0.5, y: 2.15, w: 6.0, h: 0.5,
    fontSize: 17, color: C.accentSoft, fontFace: "Calibri", italic: true,
  });
  s.addText([
    { text: "Anatomy  |  Pathophysiology  |  Diagnosis  |  Management", options: { breakLine: true } },
    { text: "Source: Current Surgical Therapy 14e, Mulholland & Greenfield Surgery 7e, Rosen's Emergency Medicine" },
  ], {
    x: 0.5, y: 2.9, w: 6.0, h: 0.9,
    fontSize: 11, color: C.textLight, fontFace: "Calibri",
  });
  // RLQ icon area (text-art placeholder)
  s.addText("⚕", { x: 7.3, y: 1.5, w: 2, h: 2, fontSize: 90, align: "center", color: C.accentSoft });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 2 – OVERVIEW / EPIDEMIOLOGY
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Overview & Epidemiology", C.accent);
  // stat boxes
  statBox(s, 0.3,  1.1, 2.1, 1.3, "7–10%",   "Lifetime risk",        C.accent);
  statBox(s, 2.6,  1.1, 2.1, 1.3, "400,000", "US cases/year",        C.midBg);
  statBox(s, 4.9,  1.1, 2.1, 1.3, "100–150", "per 100,000/yr (global)", C.accentSoft);
  statBox(s, 7.2,  1.1, 2.1, 1.3, "16–40%",  "Present perforated",   C.red);

  addBullets(s, [
    "Most common cause of acute surgical abdomen worldwide",
    "Peak incidence: 10–30 years of age; slight male predominance",
    "Mortality <1% for simple appendicitis; rises sharply with perforation",
    "Negative appendectomy rate ~7% with CT-guided diagnosis",
    "Increasing incidence in developing countries parallels Western diet adoption",
  ], 0.3, 2.65, 9.4, 2.6);
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION DIVIDER – Anatomy
// ─────────────────────────────────────────────────────────────────────────────
sectionSlide("01  Anatomy", "Structure, location, and blood supply of the vermiform appendix");

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 3 – ANATOMY
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Anatomy of the Appendix", C.midBg);
  // left column bullets
  addBullets(s, [
    "~9 cm long, ~0.6 cm wide vermiform (worm-shaped) hollow viscus",
    "Originates from the terminal cecum where the three taenia coli converge",
    "Normally located in the right lower quadrant (RLQ) after normal intestinal rotation",
    "Tip position is variable: retrocecal (most common ~65%), subcecal, pelvic, preileal, postileal",
    "Blood supply: appendiceal artery – a branch of the ileocolic artery",
    "Lymphoid tissue is abundant (MALT); peaks in the second decade of life",
  ], 0.25, 1.0, 5.3, 4.4);

  // right panel – position labels
  s.addShape(pres.ShapeType.rect, { x: 5.8, y: 0.95, w: 3.9, h: 4.4, fill: { color: C.midBg }, rectRadius: 0.08, line: { color: C.midBg } });
  s.addText("Tip Positions & Frequency", { x: 5.85, y: 1.0, w: 3.8, h: 0.4, fontSize: 13, bold: true, color: C.accentSoft, fontFace: "Calibri", align: "center" });

  const positions = [
    ["Retrocecal",  "~65%",  C.accent],
    ["Pelvic",      "~30%",  C.accentSoft],
    ["Subcecal",    "~2%",   C.subtext],
    ["Pre-ileal",   "~1%",   C.subtext],
    ["Post-ileal",  "~0.5%", C.subtext],
  ];
  positions.forEach(([pos, pct, col], i) => {
    const y = 1.55 + i * 0.68;
    s.addShape(pres.ShapeType.roundRect, { x: 5.95, y, w: 3.7, h: 0.52, fill: { color: "1C3A5A" }, rectRadius: 0.06, line: { color: "1C3A5A" } });
    s.addText(pos, { x: 6.1, y: y + 0.05, w: 2.4, h: 0.42, fontSize: 12, color: C.white, fontFace: "Calibri", valign: "middle" });
    s.addText(pct, { x: 8.3, y: y + 0.05, w: 1.2, h: 0.42, fontSize: 13, bold: true, color: col, fontFace: "Calibri", valign: "middle", align: "right" });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION DIVIDER – Pathophysiology
// ─────────────────────────────────────────────────────────────────────────────
sectionSlide("02  Pathophysiology", "Mechanism of obstruction, bacterial overgrowth, and perforation");

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 4 – PATHOPHYSIOLOGY
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Pathophysiology – Cascade of Events", C.accent);

  const steps = [
    ["1", "Luminal Obstruction",         "Fecalith / appendicolith (most common), lymphoid hyperplasia, neoplasm, foreign body, parasites"],
    ["2", "Bacterial Overgrowth",        "Mucus accumulation → distension → venous congestion → bacterial proliferation"],
    ["3", "Visceral Pain",               "Stretching of afferent nerve fibers → vague periumbilical / epigastric pain"],
    ["4", "Arterial Ischemia",           "Progressive congestion obstructs arterial inflow → ischemia → necrosis → gangrene"],
    ["5", "Perforation / Abscess",       "Untreated: wall necrosis → perforation → localised abscess OR generalised peritonitis"],
  ];

  steps.forEach(([num, title, desc], i) => {
    const y = 1.0 + i * 0.88;
    // number circle
    s.addShape(pres.ShapeType.ellipse, { x: 0.22, y: y + 0.08, w: 0.48, h: 0.48, fill: { color: C.accent }, line: { color: C.accent } });
    s.addText(num, { x: 0.22, y: y + 0.08, w: 0.48, h: 0.48, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    // connector (except last)
    if (i < steps.length - 1) {
      s.addShape(pres.ShapeType.rect, { x: 0.43, y: y + 0.56, w: 0.06, h: 0.34, fill: { color: C.accent }, line: { color: C.accent } });
    }
    s.addText(title, { x: 0.85, y: y + 0.02, w: 3.3, h: 0.28, fontSize: 13, bold: true, color: C.accent, fontFace: "Calibri" });
    s.addText(desc,  { x: 0.85, y: y + 0.3,  w: 8.8, h: 0.46, fontSize: 11, color: C.textDark, fontFace: "Calibri", wrap: true });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 5 – ORGANISMS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Causative Organisms", C.red);

  addBullets(s, [
    "Escherichia coli – most common Gram-negative; isolated in majority of perforated cases",
    "Bacteroides fragilis – dominant anaerobe in perforated/gangrenous appendicitis",
    "Klebsiella pneumoniae",
    "Streptococcus spp.",
    "Enterococcus spp.",
    "Pseudomonas aeruginosa",
  ], 0.3, 1.1, 5.5, 4.2);

  // right info box
  s.addShape(pres.ShapeType.rect, { x: 6.0, y: 1.0, w: 3.7, h: 4.3, fill: { color: C.midBg }, line: { color: C.midBg } });
  s.addText("Clinical Significance", { x: 6.1, y: 1.1, w: 3.5, h: 0.4, fontSize: 13, bold: true, color: C.accentSoft, fontFace: "Calibri" });
  const items = [
    "Guides empirical antibiotic selection",
    "Simple appendicitis: 2nd-gen cephalosporin or amox-clav",
    "Perforated: broad-spectrum coverage (pip/tazo, carbapenems) targeting E. coli + anaerobes",
    "Cefoxitin or ertapenem used in APPAC trial",
  ];
  items.forEach((txt, i) => {
    s.addText("• " + txt, { x: 6.1, y: 1.65 + i * 0.82, w: 3.5, h: 0.75, fontSize: 11, color: C.textLight, fontFace: "Calibri", wrap: true });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION DIVIDER – Clinical Presentation
// ─────────────────────────────────────────────────────────────────────────────
sectionSlide("03  Clinical Presentation", "History, physical signs, and scoring systems");

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 6 – SYMPTOMS / SIGNS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Clinical Presentation", C.accent);

  // Column headings
  s.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.0, w: 4.55, h: 0.38, fill: { color: C.midBg }, line: { color: C.midBg } });
  s.addText("SYMPTOMS", { x: 0.25, y: 1.0, w: 4.55, h: 0.38, fontSize: 13, bold: true, color: C.accentSoft, align: "center", fontFace: "Calibri" });

  s.addShape(pres.ShapeType.rect, { x: 5.2, y: 1.0, w: 4.55, h: 0.38, fill: { color: C.midBg }, line: { color: C.midBg } });
  s.addText("SIGNS", { x: 5.2, y: 1.0, w: 4.55, h: 0.38, fontSize: 13, bold: true, color: C.accentSoft, align: "center", fontFace: "Calibri" });

  addBullets(s, [
    "Vague periumbilical / epigastric pain (early)",
    "Pain migrates to RLQ within 12–24 h",
    "Anorexia (nearly universal)",
    "Nausea and vomiting",
    "Low-grade fever",
    "Malaise",
  ], 0.3, 1.45, 4.5, 3.8);

  addBullets(s, [
    "RLQ tenderness at McBurney's point",
    "Rebound tenderness / guarding",
    "Rovsing's sign (LLQ pressure → RLQ pain)",
    "Psoas sign (retrocecal appendix)",
    "Obturator sign (pelvic appendix)",
    "Tachycardia; voluntary/involuntary guarding",
  ], 5.25, 1.45, 4.5, 3.8);
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 7 – ALVARADO SCORE
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Alvarado Scoring System (MANTRELS)", C.accentSoft);

  s.addText("A practical bedside tool to risk-stratify suspected appendicitis (max score: 10)", {
    x: 0.25, y: 1.0, w: 9.5, h: 0.32, fontSize: 12, color: C.textMid, fontFace: "Calibri", italic: true,
  });

  const rows = [
    ["Feature",                                      "Points", true],
    ["Migration of pain to RLQ",                     "1",      false],
    ["Anorexia",                                     "1",      false],
    ["Nausea / Vomiting",                            "1",      false],
    ["RLQ tenderness on exam",                       "2",      false],
    ["Rebound tenderness",                           "1",      false],
    ["Elevated temperature (>37.3°C / 99.1°F)",     "1",      false],
    ["Leukocytosis (WBC >10,000)",                   "2",      false],
    ["Left shift (neutrophilia)",                    "1",      false],
  ];

  rows.forEach(([feat, pts, isHeader], i) => {
    const y = 1.42 + i * 0.44;
    const bg = isHeader ? C.midBg : (i % 2 === 0 ? "E8EEF4" : C.white);
    s.addShape(pres.ShapeType.rect, { x: 0.25, y, w: 7.8, h: 0.43, fill: { color: bg }, line: { color: "C5D3E0" } });
    s.addShape(pres.ShapeType.rect, { x: 8.05, y, w: 1.65, h: 0.43, fill: { color: isHeader ? C.accent : bg }, line: { color: "C5D3E0" } });
    s.addText(feat, { x: 0.35, y: y + 0.04, w: 7.6, h: 0.35, fontSize: isHeader ? 12 : 11, bold: isHeader, color: isHeader ? C.white : C.textDark, fontFace: "Calibri" });
    s.addText(pts,  { x: 8.05, y: y + 0.04, w: 1.65, h: 0.35, fontSize: isHeader ? 12 : 13, bold: true, color: isHeader ? C.white : C.accent, align: "center", fontFace: "Calibri" });
  });

  // legend
  const legend = [
    ["1–4", "Low risk – discharge / observation", C.green],
    ["5–6", "Equivocal – imaging / surgical consult", C.accentSoft],
    ["7–10", "High risk – surgical intervention", C.red],
  ];
  legend.forEach(([score, txt, col], i) => {
    s.addShape(pres.ShapeType.rect, { x: 0.25, y: 5.3 - 0.0 + i * 0, w: 0, h: 0 }); // spacer
    // small badge row below table but abbreviated – fit within slide
  });
  // Single legend line to keep layout clean
  s.addText("Score: 1–4 = low risk  |  5–6 = equivocal  |  7–10 = high risk → surgery", {
    x: 0.25, y: 5.25, w: 9.5, h: 0.3, fontSize: 10.5, color: C.textMid, fontFace: "Calibri",
    bold: true,
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION DIVIDER – Investigations
// ─────────────────────────────────────────────────────────────────────────────
sectionSlide("04  Investigations", "Laboratory tests and imaging modalities");

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 8 – LABS + IMAGING
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Laboratory & Imaging Workup", C.midBg);

  // Labs column
  s.addShape(pres.ShapeType.rect, { x: 0.25, y: 1.0, w: 4.3, h: 0.38, fill: { color: C.accent }, line: { color: C.accent } });
  s.addText("LABORATORY", { x: 0.25, y: 1.0, w: 4.3, h: 0.38, fontSize: 12, bold: true, color: C.white, align: "center", fontFace: "Calibri" });

  addBullets(s, [
    "WBC: leukocytosis (>10,000); neutrophilia with left shift",
    "CRP: elevated; correlates with severity",
    "Urinalysis: sterile pyuria in 40% (proximity to ureter) – NOT diagnostic of UTI",
    "β-hCG: rule out ectopic pregnancy in females of childbearing age",
    "BMP / LFTs: baseline before surgery",
  ], 0.3, 1.45, 4.2, 3.8, { fontSize: 12 });

  // Imaging column
  s.addShape(pres.ShapeType.rect, { x: 5.2, y: 1.0, w: 4.55, h: 0.38, fill: { color: C.accent }, line: { color: C.accent } });
  s.addText("IMAGING", { x: 5.2, y: 1.0, w: 4.55, h: 0.38, fontSize: 12, bold: true, color: C.white, align: "center", fontFace: "Calibri" });

  const imaging = [
    ["CT Abdomen/Pelvis", "Gold standard. Sensitivity ~94%, specificity ~95%. Appendix >6 mm, periappendiceal fat stranding, fecalith."],
    ["Ultrasound (US)", "First-line in children & pregnant patients. Avoids radiation. Sensitivity ~75–90%. Non-compressible appendix >6 mm."],
    ["MRI", "Preferred in pregnancy when US is inconclusive. No radiation. Sensitivity ~96%."],
    ["Plain X-ray", "Limited utility. May show appendicolith (~10%), air-fluid levels."],
  ];
  imaging.forEach(([mod, desc], i) => {
    const y = 1.45 + i * 1.02;
    s.addText(mod, { x: 5.3, y, w: 4.3, h: 0.28, fontSize: 12, bold: true, color: C.midBg, fontFace: "Calibri" });
    s.addText(desc, { x: 5.3, y: y + 0.28, w: 4.3, h: 0.65, fontSize: 10.5, color: C.textDark, fontFace: "Calibri", wrap: true });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION DIVIDER – Differential Diagnosis
// ─────────────────────────────────────────────────────────────────────────────
sectionSlide("05  Differential Diagnosis", "Conditions mimicking acute appendicitis");

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 9 – DIFFERENTIAL DIAGNOSIS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Differential Diagnosis", C.red);

  const diffs = [
    { group: "GI",           items: ["Mesenteric adenitis", "Meckel's diverticulitis", "Crohn's disease (terminal ileitis)", "Cecal diverticulitis", "Bowel obstruction"] },
    { group: "Gynaecological", items: ["Ectopic pregnancy", "Ovarian torsion", "Ruptured ovarian cyst", "PID / Tubo-ovarian abscess", "Mittelschmerz"] },
    { group: "Urological",   items: ["Ureteral / renal colic", "Right-sided pyelonephritis", "Cystitis"] },
    { group: "Other",        items: ["Psoas abscess", "Right-sided hernia", "Rectus sheath haematoma"] },
  ];

  const cols = [
    { x: 0.25, y: 1.05 },
    { x: 5.15, y: 1.05 },
  ];
  diffs.forEach((d, idx) => {
    const col = idx < 2 ? cols[0] : cols[1];
    const offset = idx < 2 ? idx : idx - 2;
    const startY = col.y + offset * 2.2;
    const startX = (idx < 2) ? 0.25 : 5.15;

    s.addShape(pres.ShapeType.rect, { x: startX, y: startY, w: 4.6, h: 0.35, fill: { color: C.midBg }, line: { color: C.midBg } });
    s.addText(d.group, { x: startX + 0.1, y: startY, w: 4.4, h: 0.35, fontSize: 12, bold: true, color: C.accentSoft, fontFace: "Calibri", valign: "middle" });
    addBullets(s, d.items, startX + 0.05, startY + 0.38, 4.5, 1.78, { fontSize: 11 });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION DIVIDER – Management
// ─────────────────────────────────────────────────────────────────────────────
sectionSlide("06  Management", "Non-operative and operative approaches");

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 10 – MANAGEMENT OVERVIEW
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Management Overview", C.accent);

  // Decision tree style – 3 boxes
  const boxData = [
    { label: "Uncomplicated\nAppendicitis", x: 0.3,  col: C.green,    w: 2.9 },
    { label: "Perforated /\nAbscess",       x: 3.55, col: C.red,      w: 2.9 },
    { label: "Interval / Elective\n(after non-op)", x: 6.8, col: C.midBg, w: 2.9 },
  ];
  boxData.forEach(b => {
    s.addShape(pres.ShapeType.roundRect, { x: b.x, y: 1.05, w: b.w, h: 0.72, fill: { color: b.col }, rectRadius: 0.08, line: { color: b.col } });
    s.addText(b.label, { x: b.x, y: 1.05, w: b.w, h: 0.72, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
  });

  const optionsLeft = [
    "Laparoscopic appendectomy (standard of care)",
    "Open appendectomy (when laparoscopy unavailable/contraindicated)",
    "Antibiotics-only (alternative for select patients – no fecalith, no perforation)",
  ];
  const optionsMid = [
    "IV fluid resuscitation + broad-spectrum antibiotics",
    "If free perforation: emergency surgery",
    "If abscess: IR drain + antibiotics → interval appendectomy 6–8 wk",
    "Oral antibiotics on discharge for 7–10 days",
  ];
  const optionsRight = [
    "Elective laparoscopic appendectomy after non-op success",
    "Colonoscopy in older patients (rule out neoplasm)",
    "Recurrence rate after antibiotics-alone: ~14–40% at 5 yr",
  ];

  addBullets(s, optionsLeft,  0.3,  1.95, 2.85, 3.4, { fontSize: 11 });
  addBullets(s, optionsMid,   3.55, 1.95, 2.85, 3.4, { fontSize: 11 });
  addBullets(s, optionsRight, 6.8,  1.95, 2.85, 3.4, { fontSize: 11 });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 11 – ANTIBIOTICS vs APPENDECTOMY (EVIDENCE)
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Antibiotics vs Appendectomy – Key Evidence", C.accentSoft);

  const trials = [
    { name: "APPAC Trial\n(Finland, 2015/2020)", result: "72.7% no appendectomy at 1 yr; 60.9% at 5 yr; long-term QoL similar", color: C.midBg },
    { name: "CODA Trial\n(USA, 2020)", result: "n=1,552; Antibiotics non-inferior at 30 days for Alvarado ≤7; patient-preference driven", color: C.midBg },
    { name: "Cochrane Meta-analysis\n(6 RCTs)", result: "73.4% antibiotic vs 97.4% surgery cured at 2 wks; complications lower with antibiotics", color: C.midBg },
    { name: "Meta-analysis\n(11 trials, n=2,751)", result: "Non-op: fewer complications, shorter stay; lower efficacy, higher relapse", color: C.midBg },
  ];

  trials.forEach((t, i) => {
    const y = 1.05 + i * 1.12;
    s.addShape(pres.ShapeType.roundRect, { x: 0.25, y, w: 9.5, h: 1.0, fill: { color: i % 2 === 0 ? "E8EEF4" : C.white }, line: { color: "C5D3E0" }, rectRadius: 0.06 });
    s.addText(t.name, { x: 0.35, y: y + 0.08, w: 3.0, h: 0.82, fontSize: 11, bold: true, color: C.midBg, fontFace: "Calibri", valign: "top" });
    s.addShape(pres.ShapeType.rect, { x: 3.35, y: y + 0.18, w: 0.04, h: 0.64, fill: { color: C.accent }, line: { color: C.accent } });
    s.addText(t.result, { x: 3.5, y: y + 0.08, w: 6.1, h: 0.82, fontSize: 11, color: C.textDark, fontFace: "Calibri", valign: "top", wrap: true });
  });

  s.addText("Current standard: Appendectomy. Antibiotics-only is an accepted alternative in uncomplicated cases without fecalith.", {
    x: 0.25, y: 5.28, w: 9.5, h: 0.28, fontSize: 10, bold: true, color: C.accent, fontFace: "Calibri",
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 12 – SPECIAL POPULATIONS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Special Populations", C.midBg);

  const pops = [
    {
      title: "Paediatric",
      color: C.accentSoft,
      points: [
        "Most common acute surgical problem in children",
        "Children <6 yr frequently present perforated",
        "US or MRI preferred to avoid radiation",
        "Laparoscopic appendectomy is standard; non-op viable (80–90% respond at 24–48 h)",
        "Fecalith → NOT suitable for non-operative management",
      ]
    },
    {
      title: "Pregnancy",
      color: C.accent,
      points: [
        "Most common surgical emergency in pregnant patients",
        "Same incidence as non-pregnant; higher perforation rate due to diagnostic delays",
        "Appendix displaced only in <25% at 3rd trimester – typical RLQ pain still valid",
        "MRI preferred when US inconclusive; CT if MRI unavailable and high clinical suspicion",
        "Risk: fetal mortality, maternal sepsis, preterm labour",
      ]
    },
  ];

  pops.forEach((p, idx) => {
    const xStart = idx === 0 ? 0.25 : 5.15;
    s.addShape(pres.ShapeType.rect, { x: xStart, y: 1.0, w: 4.6, h: 0.38, fill: { color: p.color }, line: { color: p.color } });
    s.addText(p.title, { x: xStart, y: 1.0, w: 4.6, h: 0.38, fontSize: 13, bold: true, color: C.white, align: "center", fontFace: "Calibri" });
    addBullets(s, p.points, xStart + 0.1, 1.45, 4.4, 3.9, { fontSize: 11.5 });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 13 – COMPLICATIONS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = contentSlide("Complications of Appendicitis", C.red);

  const comps = [
    { title: "Perforation", desc: "16–40% of all cases; risk increases >24–36 h from symptom onset; leads to peritonitis or abscess formation", col: C.red },
    { title: "Peritonitis", desc: "Generalised soiling of peritoneal cavity; sepsis, multi-organ failure; requires emergency surgery", col: C.red },
    { title: "Appendiceal Abscess / Phlegmon", desc: "Walled-off perforation; managed with IR drainage + antibiotics → interval appendectomy", col: C.accentSoft },
    { title: "Wound Infection / SSI", desc: "More common after open vs laparoscopic surgery; risk higher in perforated disease", col: C.accentSoft },
    { title: "Enterocutaneous Fistula", desc: "Rare; may occur after antibiotic-only management failure or complicated perforation", col: C.subtext },
    { title: "Missed Neoplasm", desc: "Colonoscopy after non-operative treatment in older patients; carcinoid tumour most common appendiceal neoplasm", col: C.subtext },
  ];

  comps.forEach((c, i) => {
    const col = i % 2 === 0 ? 0 : 1;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.25 : 5.15;
    const y = 1.05 + row * 1.48;
    s.addShape(pres.ShapeType.roundRect, { x, y, w: 4.6, h: 1.38, fill: { color: i % 4 < 2 ? "FDECEA" : "FFF8EC" }, line: { color: c.col }, rectRadius: 0.08 });
    s.addShape(pres.ShapeType.rect, { x, y, w: 0.18, h: 1.38, fill: { color: c.col }, line: { color: c.col } });
    s.addText(c.title, { x: x + 0.26, y: y + 0.07, w: 4.2, h: 0.32, fontSize: 12, bold: true, color: C.textDark, fontFace: "Calibri" });
    s.addText(c.desc,  { x: x + 0.26, y: y + 0.42, w: 4.2, h: 0.88, fontSize: 10.5, color: C.textDark, fontFace: "Calibri", wrap: true });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 14 – SUMMARY / KEY TAKEAWAYS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBg } });
  s.addShape(pres.ShapeType.rect, { x: 0, y: 0.85, w: 10, h: 0.06, fill: { color: C.accent } });

  s.addText("Key Takeaways", { x: 0.4, y: 0.15, w: 9.2, h: 0.65, fontSize: 28, bold: true, color: C.white, fontFace: "Calibri" });

  const takes = [
    "Appendicitis is the most common surgical emergency with a 7–10% lifetime risk",
    "Obstruction → bacterial overgrowth → ischaemia → perforation is the classic cascade",
    "McBurney's point tenderness + migration of periumbilical pain to RLQ is the hallmark presentation",
    "Alvarado score ≥7 warrants surgical consultation; CT is gold-standard imaging",
    "Laparoscopic appendectomy remains the standard treatment; antibiotics-only is viable for uncomplicated disease without fecalith",
    "Perforated appendicitis: emergency surgery or IR drainage + antibiotics → interval appendectomy",
    "Always consider special populations: paediatric (prefer US/MRI), pregnant (diagnostic delay = higher perforation risk)",
    "Post-treatment: colonoscopy for older patients to exclude neoplasm",
  ];

  takes.forEach((t, i) => {
    const y = 1.05 + i * 0.55;
    s.addShape(pres.ShapeType.rect, { x: 0.3, y: y + 0.08, w: 0.32, h: 0.32, fill: { color: C.accent }, line: { color: C.accent } });
    s.addText((i + 1).toString(), { x: 0.3, y: y + 0.08, w: 0.32, h: 0.32, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    s.addText(t, { x: 0.72, y, w: 9.0, h: 0.52, fontSize: 12, color: C.textLight, fontFace: "Calibri", valign: "middle" });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// WRITE FILE
// ─────────────────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/appendicitis-ppt/Acute_Appendicitis.pptx" })
  .then(() => console.log("Done: Acute_Appendicitis.pptx"))
  .catch(e => { console.error(e); process.exit(1); });
Editing File

~/appendicitis-ppt/create_ppt.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/appendicitis-ppt/create_ppt.js'
The file already exists from a previous session. Let me read it and replace it entirely with the new content.
Reading File
The file has old content. Let me write the full new script directly using execute:
Running Command

cat > /home/daytona/workspace/appendicitis-ppt/create_ppt.js << 'ENDOFSCRIPT' const pptxgen = require("pptxgenjs"); const pres = new pptxgen(); pres.layout = "LAYOUT_16x9"; pres.title = "Acute Appendicitis"; const C = { darkBg: "0D1B2A", midBg: "1B3A5C", accent: "E94F37", accentSoft:"F5A623", light: "F0F4F8", white: "FFFFFF", textDark: "1A1A2E", textMid: "2C4A70", textLight: "D4E4F7", subtext: "5A7FA8", green: "27AE60", red: "C0392B", }; function sectionSlide(title, subtitle) { const s = pres.addSlide(); s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.darkBg} }); s.addShape(pres.ShapeType.rect, { x:0, y:2.6, w:10, h:0.06, fill:{color:C.accent} }); s.addText(title, { x:0.6, y:1.8, w:8.8, h:0.9, fontSize:40, bold:true, color:C.white, fontFace:"Calibri" }); if (subtitle) s.addText(subtitle, { x:0.6, y:2.8, w:8.8, h:0.7, fontSize:18, color:C.textLight, fontFace:"Calibri" }); return s; } function contentSlide(heading, accent) { accent = accent || C.accent; const s = pres.addSlide(); s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.light} }); s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.12, h:5.625, fill:{color:accent} }); s.addShape(pres.ShapeType.rect, { x:0.12, y:0, w:9.88, h:0.85, fill:{color:C.midBg} }); s.addText(heading, { x:0.3, y:0.08, w:9.4, h:0.7, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 }); return s; } function addBullets(slide, items, x, y, w, h, opts) { opts = opts || {}; const rows = items.map((item, i) => ({ text: item, options: { bullet: {code:"25B6", indent:12}, breakLine: i < items.length - 1, fontSize: opts.fontSize || 14, color: opts.color || C.textDark, fontFace: "Calibri", paraSpaceAfter: 4, bold: false, } })); slide.addText(rows, { x, y, w, h, valign:"top", margin:[4,8,4,8] }); } function statBox(slide, x, y, w, h, value, label, bg) { bg = bg || C.accent; slide.addShape(pres.ShapeType.roundRect, { x,y,w,h, fill:{color:bg}, rectRadius:0.1, line:{color:bg} }); slide.addText(value, { x, y:y+0.07, w, h:h*0.52, fontSize:24, bold:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri" }); slide.addText(label, { x, y:y+h*0.52, w, h:h*0.45, fontSize:10, color:C.white, align:"center", valign:"top", fontFace:"Calibri", wrap:true }); } // SLIDE 1 – TITLE { const s = pres.addSlide(); s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.darkBg} }); s.addShape(pres.ShapeType.rect, { x:6.8, y:0, w:3.2, h:5.625, fill:{color:C.midBg} }); s.addShape(pres.ShapeType.rect, { x:0, y:4.6, w:10, h:0.1, fill:{color:C.accent} }); s.addText("ACUTE APPENDICITIS", { x:0.5, y:1.0, w:6.0, h:1.0, fontSize:38, bold:true, color:C.white, fontFace:"Calibri", charSpacing:2 }); s.addText("A Comprehensive Clinical Overview", { x:0.5, y:2.15, w:6.0, h:0.5, fontSize:17, color:C.accentSoft, fontFace:"Calibri", italic:true }); s.addText([ {text:"Anatomy | Pathophysiology | Diagnosis | Management", options:{breakLine:true}}, {text:"Source: Current Surgical Therapy 14e, Mulholland & Greenfield Surgery 7e, Rosen's Emergency Medicine"} ], { x:0.5, y:2.9, w:6.0, h:0.9, fontSize:11, color:C.textLight, fontFace:"Calibri" }); s.addText("⚕", { x:7.3, y:1.5, w:2, h:2, fontSize:90, align:"center", color:C.accentSoft }); } // SLIDE 2 – EPIDEMIOLOGY { const s = contentSlide("Overview & Epidemiology", C.accent); statBox(s, 0.3, 1.1, 2.1, 1.3, "7–10%", "Lifetime risk", C.accent); statBox(s, 2.6, 1.1, 2.1, 1.3, "400,000", "US cases/year", C.midBg); statBox(s, 4.9, 1.1, 2.1, 1.3, "100–150", "per 100,000/yr (global)", C.accentSoft); statBox(s, 7.2, 1.1, 2.1, 1.3, "16–40%", "Present perforated", C.red); addBullets(s, [ "Most common cause of acute surgical abdomen worldwide", "Peak incidence: 10–30 years of age; slight male predominance", "Mortality <1% for simple appendicitis; rises sharply with perforation", "Negative appendectomy rate ~7% with CT-guided diagnosis", "~$3 billion annual cost burden in the United States", ], 0.3, 2.65, 9.4, 2.6); } // SECTION – Anatomy sectionSlide("01 Anatomy", "Structure, location, and blood supply of the vermiform appendix"); // SLIDE 3 – ANATOMY { const s = contentSlide("Anatomy of the Appendix", C.midBg); addBullets(s, [ "~9 cm long, ~0.6 cm wide vermiform (worm-shaped) hollow viscus", "Originates from terminal cecum where the three taenia coli converge", "Normally in the right lower quadrant (RLQ) after normal intestinal rotation", "Tip position is variable: retrocecal most common (~65%)", "Blood supply: appendiceal artery, a branch of the ileocolic artery", "Rich in lymphoid tissue (MALT); peaks in 2nd decade of life", ], 0.25, 1.0, 5.3, 4.4); s.addShape(pres.ShapeType.rect, { x:5.8, y:0.95, w:3.9, h:4.4, fill:{color:C.midBg}, line:{color:C.midBg} }); s.addText("Tip Positions & Frequency", { x:5.85, y:1.0, w:3.8, h:0.4, fontSize:13, bold:true, color:C.accentSoft, fontFace:"Calibri", align:"center" }); const positions = [ ["Retrocecal", "~65%", C.accent], ["Pelvic", "~30%", C.accentSoft], ["Subcecal", "~2%", C.subtext], ["Pre-ileal", "~1%", C.subtext], ["Post-ileal", "~0.5%", C.subtext], ]; positions.forEach(function(p, i) { const y = 1.55 + i * 0.68; s.addShape(pres.ShapeType.roundRect, { x:5.95, y, w:3.7, h:0.52, fill:{color:"1C3A5A"}, rectRadius:0.06, line:{color:"1C3A5A"} }); s.addText(p[0], { x:6.1, y:y+0.05, w:2.4, h:0.42, fontSize:12, color:C.white, fontFace:"Calibri", valign:"middle" }); s.addText(p[1], { x:8.3, y:y+0.05, w:1.2, h:0.42, fontSize:13, bold:true, color:p[2], fontFace:"Calibri", valign:"middle", align:"right" }); }); } // SECTION – Pathophysiology sectionSlide("02 Pathophysiology", "Obstruction cascade → bacterial overgrowth → perforation"); // SLIDE 4 – PATHOPHYSIOLOGY STEPS { const s = contentSlide("Pathophysiology – Cascade of Events", C.accent); const steps = [ ["1","Luminal Obstruction", "Fecalith/appendicolith (most common), lymphoid hyperplasia, neoplasm, foreign body, parasites"], ["2","Bacterial Overgrowth", "Mucus accumulation → distension → venous congestion → bacterial proliferation"], ["3","Visceral Pain", "Stretching of visceral afferent fibers → vague periumbilical/epigastric pain"], ["4","Arterial Ischaemia", "Progressive congestion obstructs arterial inflow → ischaemia → necrosis → gangrene"], ["5","Perforation / Abscess", "Untreated wall necrosis → perforation → localised abscess OR generalised peritonitis"], ]; steps.forEach(function(st, i) { const y = 1.0 + i * 0.88; s.addShape(pres.ShapeType.ellipse, { x:0.22, y:y+0.08, w:0.48, h:0.48, fill:{color:C.accent}, line:{color:C.accent} }); s.addText(st[0], { x:0.22, y:y+0.08, w:0.48, h:0.48, fontSize:14, bold:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri" }); if (i < steps.length - 1) s.addShape(pres.ShapeType.rect, { x:0.43, y:y+0.56, w:0.06, h:0.34, fill:{color:C.accent}, line:{color:C.accent} }); s.addText(st[1], { x:0.85, y:y+0.02, w:3.3, h:0.28, fontSize:13, bold:true, color:C.accent, fontFace:"Calibri" }); s.addText(st[2], { x:0.85, y:y+0.30, w:8.8, h:0.46, fontSize:11, color:C.textDark, fontFace:"Calibri", wrap:true }); }); } // SLIDE 5 – ORGANISMS { const s = contentSlide("Causative Organisms", C.red); addBullets(s, [ "Escherichia coli – most common; isolated in majority of perforated cases", "Bacteroides fragilis – dominant anaerobe in perforated/gangrenous appendicitis", "Klebsiella pneumoniae", "Streptococcus spp.", "Enterococcus spp.", "Pseudomonas aeruginosa", ], 0.3, 1.1, 5.5, 4.2); s.addShape(pres.ShapeType.rect, { x:6.0, y:1.0, w:3.7, h:4.3, fill:{color:C.midBg}, line:{color:C.midBg} }); s.addText("Antibiotic Guidance", { x:6.1, y:1.1, w:3.5, h:0.4, fontSize:13, bold:true, color:C.accentSoft, fontFace:"Calibri" }); const abxNotes = [ "Simple appendicitis: 2nd-gen cephalosporin or amox-clav", "Perforated: pip/tazo or carbapenem targeting E. coli + anaerobes", "APPAC trial: ertapenem IV → oral levofloxacin + metronidazole", "Duration guided by clinical response and institution protocol", ]; abxNotes.forEach(function(txt, i) { s.addText("• " + txt, { x:6.1, y:1.65 + i*0.82, w:3.5, h:0.75, fontSize:11, color:C.textLight, fontFace:"Calibri", wrap:true }); }); } // SECTION – Clinical Presentation sectionSlide("03 Clinical Presentation", "History, physical examination, and scoring systems"); // SLIDE 6 – SYMPTOMS / SIGNS { const s = contentSlide("Clinical Presentation", C.accent); s.addShape(pres.ShapeType.rect, { x:0.25, y:1.0, w:4.55, h:0.38, fill:{color:C.midBg}, line:{color:C.midBg} }); s.addText("SYMPTOMS", { x:0.25, y:1.0, w:4.55, h:0.38, fontSize:13, bold:true, color:C.accentSoft, align:"center", fontFace:"Calibri" }); s.addShape(pres.ShapeType.rect, { x:5.2, y:1.0, w:4.55, h:0.38, fill:{color:C.midBg}, line:{color:C.midBg} }); s.addText("SIGNS", { x:5.2, y:1.0, w:4.55, h:0.38, fontSize:13, bold:true, color:C.accentSoft, align:"center", fontFace:"Calibri" }); addBullets(s, [ "Vague periumbilical/epigastric pain (early)", "Pain migrates to RLQ within 12–24 h", "Anorexia (nearly universal)", "Nausea and vomiting", "Low-grade fever", "Malaise", ], 0.3, 1.45, 4.5, 3.8); addBullets(s, [ "RLQ tenderness at McBurney's point", "Rebound tenderness / involuntary guarding", "Rovsing's sign: LLQ pressure → RLQ pain", "Psoas sign (retrocecal appendix)", "Obturator sign (pelvic appendix)", "Tachycardia, fever", ], 5.25, 1.45, 4.5, 3.8); } // SLIDE 7 – ALVARADO SCORE { const s = contentSlide("Alvarado Scoring System (MANTRELS)", C.accentSoft); s.addText("Bedside tool to risk-stratify suspected appendicitis (max score: 10)", { x:0.25, y:1.0, w:9.5, h:0.32, fontSize:12, color:C.textMid, fontFace:"Calibri", italic:true }); const rows = [ ["Feature", "Points", true], ["Migration of pain to RLQ", "1", false], ["Anorexia", "1", false], ["Nausea / Vomiting", "1", false], ["RLQ tenderness", "2", false], ["Rebound tenderness", "1", false], ["Elevated temperature (>37.3°C)", "1", false], ["Leukocytosis (WBC >10,000)", "2", false], ["Left shift (neutrophilia)", "1", false], ]; rows.forEach(function(r, i) { const y = 1.42 + i * 0.44; const bg = r[2] ? C.midBg : (i%2===0 ? "E8EEF4" : C.white); s.addShape(pres.ShapeType.rect, { x:0.25, y, w:7.8, h:0.43, fill:{color:bg}, line:{color:"C5D3E0"} }); s.addShape(pres.ShapeType.rect, { x:8.05, y, w:1.65, h:0.43, fill:{color:r[2] ? C.accent : bg}, line:{color:"C5D3E0"} }); s.addText(r[0], { x:0.35, y:y+0.04, w:7.6, h:0.35, fontSize:r[2]?12:11, bold:r[2], color:r[2]?C.white:C.textDark, fontFace:"Calibri" }); s.addText(r[1], { x:8.05, y:y+0.04, w:1.65, h:0.35, fontSize:r[2]?12:13, bold:true, color:r[2]?C.white:C.accent, align:"center", fontFace:"Calibri" }); }); s.addText("Score: 1–4 = low risk | 5–6 = equivocal | 7–10 = high risk → surgical referral", { x:0.25, y:5.25, w:9.5, h:0.3, fontSize:10.5, color:C.textMid, fontFace:"Calibri", bold:true, }); } // SECTION – Investigations sectionSlide("04 Investigations", "Laboratory tests and imaging modalities"); // SLIDE 8 – LABS + IMAGING { const s = contentSlide("Laboratory & Imaging Workup", C.midBg); s.addShape(pres.ShapeType.rect, { x:0.25, y:1.0, w:4.3, h:0.38, fill:{color:C.accent}, line:{color:C.accent} }); s.addText("LABORATORY", { x:0.25, y:1.0, w:4.3, h:0.38, fontSize:12, bold:true, color:C.white, align:"center", fontFace:"Calibri" }); addBullets(s, [ "WBC: leukocytosis >10,000; neutrophilia (left shift)", "CRP: elevated; correlates with severity and perforation risk", "Urinalysis: sterile pyuria in ~40% (proximity to ureter)", "Beta-hCG: mandatory to exclude ectopic pregnancy", "BMP/LFTs: baseline before operative intervention", ], 0.3, 1.45, 4.2, 3.8, {fontSize:12}); s.addShape(pres.ShapeType.rect, { x:5.2, y:1.0, w:4.55, h:0.38, fill:{color:C.accent}, line:{color:C.accent} }); s.addText("IMAGING", { x:5.2, y:1.0, w:4.55, h:0.38, fontSize:12, bold:true, color:C.white, align:"center", fontFace:"Calibri" }); const imaging = [ ["CT Abdomen/Pelvis", "Gold standard. Sensitivity ~94%, specificity ~95%. Criteria: appendix >6 mm, fat stranding, fecalith, free fluid."], ["Ultrasound (US)", "First-line for children & pregnancy. Sensitivity ~75–90%. Non-compressible appendix >6 mm."], ["MRI", "Preferred in pregnancy when US inconclusive. No radiation. Sensitivity ~96%."], ["Plain X-ray", "Limited. May show appendicolith (~10%); air-fluid levels if perforation."], ]; imaging.forEach(function(im, i) { const y = 1.45 + i * 1.02; s.addText(im[0], { x:5.3, y, w:4.3, h:0.28, fontSize:12, bold:true, color:C.midBg, fontFace:"Calibri" }); s.addText(im[1], { x:5.3, y:y+0.28, w:4.3, h:0.65, fontSize:10.5, color:C.textDark, fontFace:"Calibri", wrap:true }); }); } // SECTION – Differential Diagnosis sectionSlide("05 Differential Diagnosis", "Conditions mimicking acute appendicitis"); // SLIDE 9 – DIFFERENTIAL DIAGNOSIS { const s = contentSlide("Differential Diagnosis", C.red); const diffs = [ { group:"Gastrointestinal", items:["Mesenteric adenitis","Meckel's diverticulitis","Crohn's / terminal ileitis","Cecal diverticulitis","Bowel obstruction"] }, { group:"Gynaecological", items:["Ectopic pregnancy","Ovarian torsion","Ruptured ovarian cyst","PID / Tubo-ovarian abscess","Mittelschmerz"] }, { group:"Urological", items:["Ureteral/renal colic","Right pyelonephritis","Cystitis"] }, { group:"Other", items:["Psoas abscess","Right-sided inguinal hernia","Rectus sheath haematoma"] }, ]; diffs.forEach(function(d, idx) { const x = idx < 2 ? 0.25 : 5.15; const offset = idx < 2 ? idx : idx - 2; const y = 1.05 + offset * 2.2; s.addShape(pres.ShapeType.rect, { x, y, w:4.6, h:0.35, fill:{color:C.midBg}, line:{color:C.midBg} }); s.addText(d.group, { x:x+0.1, y, w:4.4, h:0.35, fontSize:12, bold:true, color:C.accentSoft, fontFace:"Calibri", valign:"middle" }); addBullets(s, d.items, x+0.05, y+0.38, 4.5, 1.78, {fontSize:11}); }); } // SECTION – Management sectionSlide("06 Management", "Non-operative and operative treatment strategies"); // SLIDE 10 – MANAGEMENT OVERVIEW { const s = contentSlide("Management Overview", C.accent); const boxes = [ {label:"Uncomplicated\nAppendicitis", x:0.3, col:C.green, w:2.9}, {label:"Perforated /\nAbscess", x:3.55, col:C.red, w:2.9}, {label:"Interval / Elective\n(post non-op)", x:6.8, col:C.midBg, w:2.9}, ]; boxes.forEach(function(b) { s.addShape(pres.ShapeType.roundRect, { x:b.x, y:1.05, w:b.w, h:0.72, fill:{color:b.col}, rectRadius:0.08, line:{color:b.col} }); s.addText(b.label, { x:b.x, y:1.05, w:b.w, h:0.72, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri" }); }); addBullets(s, [ "Laparoscopic appendectomy (standard of care)", "Open appendectomy if laparoscopy unavailable", "Antibiotics-only: alternative for select patients (no fecalith, no perforation)", ], 0.3, 1.95, 2.85, 3.4, {fontSize:11}); addBullets(s, [ "IV fluids + broad-spectrum antibiotics", "Free perforation: emergency surgery", "Abscess: IR drainage → interval appendectomy at 6–8 wk", "Oral antibiotics on discharge 7–10 days", ], 3.55, 1.95, 2.85, 3.4, {fontSize:11}); addBullets(s, [ "Elective laparoscopic appendectomy", "Colonoscopy in older patients (exclude neoplasm)", "Recurrence after antibiotics-only: ~14–40% at 5 yr", ], 6.8, 1.95, 2.85, 3.4, {fontSize:11}); } // SLIDE 11 – ANTIBIOTICS vs APPENDECTOMY EVIDENCE { const s = contentSlide("Antibiotics vs Appendectomy – Key Evidence", C.accentSoft); const trials = [ {name:"APPAC Trial (Finland, 2015/2020)", result:"72.7% avoided appendectomy at 1 yr; 60.9% at 5 yr; long-term QoL similar between groups"}, {name:"CODA Trial (USA, 2020; n=1,552)", result:"Antibiotics non-inferior at 30 days for Alvarado ≤7; patient preference strongly influences choice"}, {name:"Cochrane Meta-analysis (6 RCTs)", result:"73.4% cured with antibiotics vs 97.4% with surgery at 2 wks; complication rate significantly lower with antibiotics"}, {name:"Meta-analysis (11 trials, n=2,751)", result:"Non-op: fewer complications, shorter stay; lower efficacy, higher relapse than surgery"}, ]; trials.forEach(function(t, i) { const y = 1.05 + i * 1.12; s.addShape(pres.ShapeType.roundRect, { x:0.25, y, w:9.5, h:1.0, fill:{color:i%2===0?"E8EEF4":C.white}, line:{color:"C5D3E0"}, rectRadius:0.06 }); s.addText(t.name, { x:0.35, y:y+0.08, w:3.0, h:0.82, fontSize:11, bold:true, color:C.midBg, fontFace:"Calibri", valign:"top" }); s.addShape(pres.ShapeType.rect, { x:3.35, y:y+0.18, w:0.04, h:0.64, fill:{color:C.accent}, line:{color:C.accent} }); s.addText(t.result, { x:3.5, y:y+0.08, w:6.1, h:0.82, fontSize:11, color:C.textDark, fontFace:"Calibri", valign:"top", wrap:true }); }); s.addText("Current standard: Appendectomy. Antibiotics-only is an accepted alternative in uncomplicated cases without fecalith.", { x:0.25, y:5.28, w:9.5, h:0.28, fontSize:10, bold:true, color:C.accent, fontFace:"Calibri", }); } // SLIDE 12 – SPECIAL POPULATIONS { const s = contentSlide("Special Populations", C.midBg); const pops = [ {title:"Paediatric", color:C.accentSoft, points:[ "Most common acute surgical problem in children", "Children <6 yr often present perforated", "US or MRI preferred (avoid radiation)", "Laparoscopic appendectomy is standard; non-op viable if no fecalith (80–90% respond at 24–48 h)", "Recurrence after non-op: up to 40% medium-term", ]}, {title:"Pregnancy", color:C.accent, points:[ "Most common surgical emergency in pregnancy", "Same incidence as non-pregnant; higher perforation due to delayed diagnosis", "Appendix in RLQ in >75% of 3rd-trimester patients – classic pain pattern still useful", "Preferred imaging: US first, then MRI; CT if unavailable and high suspicion", "Risks: fetal mortality, maternal sepsis, preterm labour", ]}, ]; pops.forEach(function(p, idx) { const x = idx === 0 ? 0.25 : 5.15; s.addShape(pres.ShapeType.rect, { x, y:1.0, w:4.6, h:0.38, fill:{color:p.color}, line:{color:p.color} }); s.addText(p.title, { x, y:1.0, w:4.6, h:0.38, fontSize:13, bold:true, color:C.white, align:"center", fontFace:"Calibri" }); addBullets(s, p.points, x+0.1, 1.45, 4.4, 3.9, {fontSize:11.5}); }); } // SLIDE 13 – COMPLICATIONS { const s = contentSlide("Complications of Appendicitis", C.red); const comps = [ {title:"Perforation", desc:"16–40% of cases; risk increases >24–36 h from onset; leads to peritonitis or abscess", col:C.red}, {title:"Generalised Peritonitis", desc:"Free perforation → soiling; sepsis, MOF; requires emergency laparotomy", col:C.red}, {title:"Appendiceal Abscess", desc:"Walled-off perforation; IR drainage + antibiotics → interval appendectomy at 6–8 wk", col:C.accentSoft}, {title:"Wound Infection / SSI", desc:"Higher after open vs laparoscopic surgery; increased in perforated disease", col:C.accentSoft}, {title:"Enterocutaneous Fistula", desc:"Rare; may follow failed antibiotic-only management or complicated perforation", col:C.subtext}, {title:"Missed Neoplasm", desc:"Carcinoid most common appendiceal neoplasm; colonoscopy after non-op in older patients", col:C.subtext}, ]; comps.forEach(function(c, i) { const col = i%2===0 ? 0 : 1; const row = Math.floor(i/2); const x = col===0 ? 0.25 : 5.15; const y = 1.05 + row * 1.48; s.addShape(pres.ShapeType.roundRect, { x, y, w:4.6, h:1.38, fill:{color:i%4<2?"FDECEA":"FFF8EC"}, line:{color:c.col}, rectRadius:0.08 }); s.addShape(pres.ShapeType.rect, { x, y, w:0.18, h:1.38, fill:{color:c.col}, line:{color:c.col} }); s.addText(c.title, { x:x+0.26, y:y+0.07, w:4.2, h:0.32, fontSize:12, bold:true, color:C.textDark, fontFace:"Calibri" }); s.addText(c.desc, { x:x+0.26, y:y+0.42, w:4.2, h:0.88, fontSize:10.5, color:C.textDark, fontFace:"Calibri", wrap:true }); }); } // SLIDE 14 – KEY TAKEAWAYS { const s = pres.addSlide(); s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.darkBg} }); s.addShape(pres.ShapeType.rect, { x:0, y:0.85, w:10, h:0.06, fill:{color:C.accent} }); s.addText("Key Takeaways", { x:0.4, y:0.15, w:9.2, h:0.65, fontSize:28, bold:true, color:C.white, fontFace:"Calibri" }); const takes = [ "Appendicitis carries a 7–10% lifetime risk and is the most common surgical emergency", "Obstruction → bacterial overgrowth → ischaemia → perforation is the defining cascade", "McBurney's point tenderness + pain migration to RLQ is the hallmark presentation", "Alvarado score ≥7 warrants surgical consultation; CT is the diagnostic gold standard", "Laparoscopic appendectomy is the standard; antibiotics-only is viable without fecalith or perforation", "Perforated disease: emergency surgery or IR drainage + antibiotics → interval appendectomy", "Paediatric: prefer US/MRI. Pregnancy: delayed diagnosis markedly increases perforation risk", "Colonoscopy post-treatment for older patients to exclude underlying neoplasm", ]; takes.forEach(function(t, i) { const y = 1.05 + i * 0.55; s.addShape(pres.ShapeType.rect, { x:0.3, y:y+0.08, w:0.32, h:0.32, fill:{color:C.accent}, line:{color:C.accent} }); s.addText(String(i+1), { x:0.3, y:y+0.08, w:0.32, h:0.32, fontSize:11, bold:true, color:C.white, align:"center", valign:"middle", fontFace:"Calibri" }); s.addText(t, { x:0.72, y, w:9.0, h:0.52, fontSize:12, color:C.textLight, fontFace:"Calibri", valign:"middle" }); }); } pres.writeFile({ fileName: "/home/daytona/workspace/appendicitis-ppt/Acute_Appendicitis.pptx" }) .then(function() { console.log("Done: Acute_Appendicitis.pptx"); }) .catch(function(e) { console.error(e); process.exit(1); }); ENDOFSCRIPT echo "Script written successfully"

Running Command

cd /home/daytona/workspace/appendicitis-ppt && node create_ppt.js

Running Command

ls -lh /home/daytona/workspace/appendicitis-ppt/Acute_Appendicitis.pptx

Your presentation is ready. Download it here:

Acute Appendicitis

Presentation · PPTX


What's inside (14 slides, deep navy + red-orange palette):
#Slide
1Title – bold cover with icon
2Epidemiology – 4 stat boxes (7–10% lifetime risk, 400,000 US cases/yr, 16–40% perforated) + bullets
Section divider: Anatomy
3Anatomy – bullet column + tip-position frequency table (retrocecal 65%, pelvic 30%, etc.)
Section divider: Pathophysiology
4Pathophysiology cascade – numbered flow (obstruction → bacterial overgrowth → visceral pain → ischaemia → perforation)
5Causative organisms – E. coli, B. fragilis, Klebsiella, etc. + antibiotic guidance panel
Section divider: Clinical Presentation
6Symptoms vs Signs – two-column layout (McBurney's, Rovsing's, Psoas, Obturator signs)
7Alvarado Score (MANTRELS) – full table with risk-category legend
Section divider: Investigations
8Labs + Imaging – WBC/CRP/hCG vs CT/US/MRI/plain X-ray
Section divider: Differential Diagnosis
9Differential Diagnosis – 4 groups (GI, Gynaecological, Urological, Other)
Section divider: Management
10Management overview – 3-column boxes (uncomplicated / perforated-abscess / interval)
11Antibiotics vs Appendectomy evidence – APPAC, CODA, Cochrane, 11-trial meta-analysis
12Special populations – Paediatric & Pregnancy side-by-side
13Complications – 6 colour-coded cards (perforation, peritonitis, abscess, SSI, fistula, neoplasm)
14Key Takeaways – dark closing slide with 8 numbered points
Sources: Current Surgical Therapy 14e, Mulholland & Greenfield Surgery 7e, Rosen's Emergency Medicine.
This is a shared conversation. Sign in to Orris to start your own chat.