Each group must identify and review 5 recent research papers related to the allotted topic and prepare a single PowerPoint presentationsummarizing the key findings of all five papers. Of fistula 10 slides.with images

Reading File
Searching PubMed

fistula management treatment outcomes

Finding Sources
Reading File
Searching PubMed

anal fistula surgery sphincter preservation

Finding Sources
Reading Article

PMID: 38050857

Reading Article

PMID: 37460830

Reading Article

PMID: 39186335

Reading Article

PMID: 42011865

Reading Article

PMID: 40936062

Searching the Web

anal fistula anatomy classification diagram medical image

Running Command

mkdir -p /home/daytona/workspace/fistula-ppt && ls /home/daytona/workspace/fistu…

Writing File

~/fistula-ppt/build.js

const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");

// ─── Fetch images ───────────────────────────────────────────────────────────
const imageUrls = [
  "https://teachmesurgery.com/wp-content/uploads/2016/12/Classification-of-Anal-Fistulae-by-Location.png",
  "https://www.researchgate.net/publication/356392572/figure/fig1/AS:1124662931136512@1645151946175/Anatomy-and-associated-complexity-classification-of-the-anal-fistulae.png",
  "https://figures.semanticscholar.org/339f3dba395cd6b993ee057c3068814be4b4418e/2-Figure1-1.png",
  "https://prod-images-static.radiopaedia.org/images/65362084/a977ba59ae7780c59b4482f1f56258c1e336c64c1c8d5a29fa5e42d9bd48ef79_big_gallery.jpeg",
  "http://radiologykey.com/wp-content/uploads/2025/05/gr3-175.jpg"
];

let imgs = [];
try {
  const raw = execSync(
    `node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`,
    { timeout: 30000 }
  ).toString();
  imgs = JSON.parse(raw);
} catch(e) {
  console.error("Image fetch error:", e.message);
  imgs = imageUrls.map(() => ({ base64: null, error: "failed" }));
}

// helper: use image data if available
function imgData(idx) {
  return imgs[idx] && imgs[idx].base64 && !imgs[idx].error ? imgs[idx].base64 : null;
}

// ─── Color palette ───────────────────────────────────────────────────────────
const DARK_BG   = "0D2137";   // deep navy
const MED_BG    = "0F3460";   // mid navy
const ACCENT    = "E94560";   // crimson red
const GOLD      = "F5A623";   // warm gold
const WHITE     = "FFFFFF";
const LIGHT_TXT = "D0E4F5";   // light blue-white
const CARD_BG   = "132B4A";   // card navy

// ─── Helpers ─────────────────────────────────────────────────────────────────
function addTitle(slide, text) {
  slide.addText(text, {
    x: 0, y: 0, w: "100%", h: 0.75,
    fill: { color: ACCENT },
    color: WHITE, fontSize: 20, bold: true,
    align: "center", valign: "middle", margin: 0
  });
}

function addFooter(slide) {
  slide.addText("Research Paper Review — Fistula  |  2023–2025", {
    x: 0, y: 5.3, w: "100%", h: 0.32,
    fill: { color: "0A1A2D" },
    color: LIGHT_TXT, fontSize: 7, align: "center", valign: "middle", margin: 0
  });
}

function bulletBox(slide, items, opts = {}) {
  const textArr = items.map((t, i) => ({
    text: t,
    options: { bullet: { type: "bullet" }, breakLine: i < items.length - 1 }
  }));
  slide.addText(textArr, {
    x: opts.x || 0.3,
    y: opts.y || 0.85,
    w: opts.w || 9.4,
    h: opts.h || 4.3,
    color: opts.color || LIGHT_TXT,
    fontSize: opts.fontSize || 12,
    lineSpacingMultiple: 1.35,
    valign: "top"
  });
}

function statBox(slide, x, y, w, h, label, value, color) {
  slide.addShape("roundRect", { x, y, w, h, rectRadius: 0.08, fill: { color: color || MED_BG }, line: { color: ACCENT, width: 1.5 } });
  slide.addText(value, { x, y: y + 0.05, w, h: h * 0.55, color: GOLD, fontSize: 18, bold: true, align: "center", valign: "bottom", margin: 0 });
  slide.addText(label, { x, y: y + h * 0.55, w, h: h * 0.45, color: WHITE, fontSize: 8, align: "center", valign: "top", margin: 2 });
}

// ─── Presentation ────────────────────────────────────────────────────────────
let pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Fistula: Recent Research Review";
pres.author = "Research Group";

// ════════════════════════════════════════════════════════════
// SLIDE 1 – Title Slide
// ════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: DARK_BG };

  // top accent bar
  sl.addShape("rect", { x: 0, y: 0, w: "100%", h: 0.08, fill: { color: ACCENT }, line: { color: ACCENT } });

  // main title
  sl.addText("FISTULA", {
    x: 0.4, y: 0.6, w: 9.2, h: 1.1,
    color: WHITE, fontSize: 52, bold: true, charSpacing: 8, align: "center"
  });

  // subtitle
  sl.addText("A Review of 5 Recent Research Papers", {
    x: 0.4, y: 1.75, w: 9.2, h: 0.55,
    color: GOLD, fontSize: 20, bold: false, align: "center"
  });

  // divider line
  sl.addShape("line", { x: 1.5, y: 2.42, w: 7, h: 0, line: { color: ACCENT, width: 1.5 } });

  // description
  sl.addText("Evidence-Based Surgical Management • Classification • Novel Techniques • Outcomes", {
    x: 0.4, y: 2.6, w: 9.2, h: 0.45,
    color: LIGHT_TXT, fontSize: 12, align: "center", italic: true
  });

  // image (classification diagram) on right
  const d = imgData(0);
  if (d) {
    sl.addImage({ data: d, x: 6.2, y: 3.0, w: 3.5, h: 2.2 });
    sl.addShape("rect", { x: 6.2, y: 3.0, w: 3.5, h: 2.2, line: { color: ACCENT, width: 1 }, fill: { type: "none" } });
  }

  // papers list
  sl.addText([
    { text: "Papers Covered:", options: { bold: true, color: GOLD, breakLine: true } },
    { text: "1. ESCP Guidelines 2024 (Meta-Analysis)", options: { color: LIGHT_TXT, breakLine: true } },
    { text: "2. Network Meta-Analysis of Surgical Treatments 2023", options: { color: LIGHT_TXT, breakLine: true } },
    { text: "3. Endorectal Advancement Flap SR 2024", options: { color: LIGHT_TXT, breakLine: true } },
    { text: "4. VAAFT Meta-Analysis 2025", options: { color: LIGHT_TXT, breakLine: true } },
    { text: "5. Laser FiLaC® Therapy SR/MA 2025", options: { color: LIGHT_TXT } }
  ], { x: 0.4, y: 3.0, w: 5.6, h: 2.3, fontSize: 10, lineSpacingMultiple: 1.4 });

  addFooter(sl);
}

// ════════════════════════════════════════════════════════════
// SLIDE 2 – Introduction to Fistula
// ════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: DARK_BG };
  addTitle(sl, "What is a Fistula?");

  const d2 = imgData(1);
  if (d2) {
    sl.addImage({ data: d2, x: 6.0, y: 0.85, w: 3.7, h: 3.2 });
    sl.addShape("rect", { x: 6.0, y: 0.85, w: 3.7, h: 3.2, line: { color: ACCENT, width: 1 }, fill: { type: "none" } });
    sl.addText("Parks Classification of Anal Fistulae", { x: 6.0, y: 4.1, w: 3.7, h: 0.3, color: GOLD, fontSize: 8, align: "center", italic: true });
  }

  bulletBox(sl, [
    "A fistula is an abnormal communication between two epithelialised surfaces or between a hollow organ and the skin surface.",
    "Anal (perianal) fistulae are the most common surgical type, arising predominantly from cryptoglandular infection of the anal glands.",
    "Parks Classification (1976) remains the gold standard: intersphincteric, transsphincteric, suprasphincteric, and extrasphincteric.",
    "Prevalence: ~1–2 per 10,000 population; male predominance (2:1). Significant impact on quality of life.",
    "Other types include rectovaginal, enterocutaneous, tracheoesophageal, and arteriovenous fistulae.",
    "Key challenges: high recurrence rates, risk of sphincter damage (incontinence), and Crohn's disease-associated complex fistulae.",
    "Diagnosis: clinical exam, endoanal ultrasound (EAUS), and MRI are complementary imaging tools."
  ], { w: 5.5, fontSize: 11 });

  addFooter(sl);
}

// ════════════════════════════════════════════════════════════
// SLIDE 3 – Paper 1: ESCP Guidelines 2024
// ════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: DARK_BG };
  addTitle(sl, "Paper 1 — ESCP Guidelines for Cryptoglandular Anal Fistula (2024)");

  // Citation banner
  sl.addShape("roundRect", { x: 0.2, y: 0.82, w: 9.6, h: 0.42, rectRadius: 0.06, fill: { color: CARD_BG }, line: { color: GOLD, width: 1 } });
  sl.addText("Reza L et al. | Colorectal Disease | Jan 2024 | Meta-Analysis | PMID: 38050857", {
    x: 0.2, y: 0.82, w: 9.6, h: 0.42, color: GOLD, fontSize: 9, align: "center", valign: "middle", italic: true
  });

  bulletBox(sl, [
    "European Society of Coloproctology (ESCP) produced evidence-based guidelines using AGREE-S methodology with 21 coloproctologists + 5 patient reviewers.",
    "Scope: Diagnostic and therapeutic management of perianal abscess and cryptoglandular anal fistula in adults presenting to secondary care.",
    "250 PICO questions formulated; 45 selected for full guideline inclusion. Critical outcomes: fistula healing, recurrence, and incontinence.",
    "42 recommendations across 7 sections covering diagnosis, imaging (MRI preferred), abscess drainage, seton use, sphincter-preserving surgery, and complex fistulae.",
    "Key finding: MRI is the recommended primary imaging modality; EUA + EAUS are complementary for complex cases.",
    "Recommends sphincter-preserving procedures (LIFT, advancement flap, biological plugs) over fistulotomy for transsphincteric fistulae to reduce incontinence risk.",
    "Guideline methodology: GRADE system; systematic reviews and de-novo meta-analyses were performed where gaps existed in existing literature."
  ], { y: 1.3, fontSize: 11 });

  addFooter(sl);
}

// ════════════════════════════════════════════════════════════
// SLIDE 4 – Paper 2: Network Meta-Analysis of Surgical Treatments
// ════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: DARK_BG };
  addTitle(sl, "Paper 2 — Surgical Treatments Network Meta-Analysis (2023)");

  sl.addShape("roundRect", { x: 0.2, y: 0.82, w: 9.6, h: 0.42, rectRadius: 0.06, fill: { color: CARD_BG }, line: { color: GOLD, width: 1 } });
  sl.addText("Bhat S et al. | Tech Coloproctol | Oct 2023 | Network Meta-Analysis | PMID: 37460830", {
    x: 0.2, y: 0.82, w: 9.6, h: 0.42, color: GOLD, fontSize: 9, align: "center", valign: "middle", italic: true
  });

  // stat boxes
  statBox(sl, 0.2,  1.35, 2.0, 1.1, "RCTs Included", "52", MED_BG);
  statBox(sl, 2.35, 1.35, 2.0, 1.1, "Treatments Compared", "14", MED_BG);
  statBox(sl, 4.5,  1.35, 2.0, 1.1, "LIFT Continence Rank", "#1", MED_BG);
  statBox(sl, 6.65, 1.35, 2.0, 1.1, "Patients (LIFT simple)", "70", MED_BG);
  statBox(sl, 8.8,  1.35, 2.0, 1.1, "Patients (LIFT complex)", "102", MED_BG);

  bulletBox(sl, [
    "52 RCTs included from MEDLINE, EMBASE, and CENTRAL databases (up to Oct 2022). 14 surgical treatments evaluated.",
    "Simple fistulae: intersphincteric or low transsphincteric (<30% external anal sphincter). Complex: high transsphincteric (>30% EAS).",
    "PRIMARY OUTCOME: No statistically significant differences in short-term (≤6 months) or long-term (>6 months) healing rates between ANY of the 14 treatments.",
    "CONTINENCE OUTCOME: LIFT (Ligation of Inter-sphincteric Fistula Tract) ranked best — top 99.1% of comparisons for simple and 86.2% for complex fistulae.",
    "LIFT preserves sphincter function by ligating the fistula tract within the intersphincteric space without dividing sphincter muscle.",
    "Conclusion: Evidence insufficient to recommend one treatment over another for healing, but LIFT is preferred when minimising incontinence risk is the priority."
  ], { y: 2.55, fontSize: 11 });

  addFooter(sl);
}

// ════════════════════════════════════════════════════════════
// SLIDE 5 – Paper 3: ERAF Systematic Review & Meta-Analysis 2024
// ════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: DARK_BG };
  addTitle(sl, "Paper 3 — Endorectal Advancement Flap (ERAF): SR & Meta-Analysis (2024)");

  sl.addShape("roundRect", { x: 0.2, y: 0.82, w: 9.6, h: 0.42, rectRadius: 0.06, fill: { color: CARD_BG }, line: { color: GOLD, width: 1 } });
  sl.addText("Wang L et al. | Annali Italiani di Chirurgia | 2024 | Systematic Review & Meta-Analysis | PMID: 39186335", {
    x: 0.2, y: 0.82, w: 9.6, h: 0.42, color: GOLD, fontSize: 9, align: "center", valign: "middle", italic: true
  });

  // two-column layout
  // left column
  sl.addShape("roundRect", { x: 0.2, y: 1.35, w: 4.7, h: 3.9, rectRadius: 0.08, fill: { color: CARD_BG }, line: { color: "1A3A5C", width: 1 } });
  sl.addText("Overall Results (n=1,559)", { x: 0.3, y: 1.4, w: 4.5, h: 0.35, color: ACCENT, fontSize: 12, bold: true });
  const leftItems = [
    ["Healing Rate", "65.5%", "(95% CI: 57.6–73.4%)"],
    ["Recurrence Rate", "19.6%", "(95% CI: 14.8–24.4%)"],
    ["Incontinence Rate", "10.6%", "(95% CI: 6.0–15.1%)"],
    ["Studies Included", "38", "covering 20 years (2003–2023)"]
  ];
  leftItems.forEach(([label, val, sub], i) => {
    sl.addText(val, { x: 0.3, y: 1.88 + i * 0.72, w: 2.2, h: 0.38, color: GOLD, fontSize: 18, bold: true });
    sl.addText(label + "\n" + sub, { x: 2.6, y: 1.82 + i * 0.72, w: 2.2, h: 0.48, color: LIGHT_TXT, fontSize: 8.5, lineSpacingMultiple: 1.2 });
  });

  // right column
  sl.addShape("roundRect", { x: 5.1, y: 1.35, w: 4.7, h: 3.9, rectRadius: 0.08, fill: { color: CARD_BG }, line: { color: "1A3A5C", width: 1 } });
  sl.addText("IBD vs Non-IBD Subgroup Analysis", { x: 5.2, y: 1.4, w: 4.5, h: 0.35, color: ACCENT, fontSize: 12, bold: true });
  const rightItems = [
    "IBD subgroup healing rate: 53.9% vs Non-IBD: 70.6%",
    "IBD recurrence: 32.6% vs Non-IBD: 15.7% (significantly worse outcomes in IBD)",
    "IBD incontinence: 2.8% vs Non-IBD: 16.5%",
    "Common complications: abscess/infection 9.5%, flap dehiscence 10.4%, haematoma 12.4%",
    "ERAF = sphincter-preserving technique: rectal mucosa/submucosa advanced to cover internal opening",
    "PROSPERO registered: CRD42023451451 — confirms methodological rigour",
    "Conclusion: ERAF is an acceptable option, but IBD patients have significantly poorer outcomes"
  ];
  const rightArr = rightItems.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < rightItems.length - 1 } }));
  sl.addText(rightArr, { x: 5.2, y: 1.82, w: 4.5, h: 3.3, color: LIGHT_TXT, fontSize: 10, lineSpacingMultiple: 1.35, valign: "top" });

  addFooter(sl);
}

// ════════════════════════════════════════════════════════════
// SLIDE 6 – Paper 4: VAAFT Meta-Analysis 2025
// ════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: DARK_BG };
  addTitle(sl, "Paper 4 — Video-Assisted Anal Fistula Treatment (VAAFT): Meta-Analysis (2025)");

  sl.addShape("roundRect", { x: 0.2, y: 0.82, w: 9.6, h: 0.42, rectRadius: 0.06, fill: { color: CARD_BG }, line: { color: GOLD, width: 1 } });
  sl.addText("Wang W et al. | BJS Open | Mar 2025 | Meta-Analysis | PMID: 42011865", {
    x: 0.2, y: 0.82, w: 9.6, h: 0.42, color: GOLD, fontSize: 9, align: "center", valign: "middle", italic: true
  });

  // VAAFT description box
  sl.addShape("roundRect", { x: 0.2, y: 1.35, w: 3.8, h: 1.6, rectRadius: 0.08, fill: { color: CARD_BG }, line: { color: ACCENT, width: 1.5 } });
  sl.addText("What is VAAFT?", { x: 0.3, y: 1.38, w: 3.6, h: 0.35, color: ACCENT, fontSize: 12, bold: true });
  sl.addText("Video-Assisted Anal Fistula Treatment uses a fistuloscope inserted through the external opening to visualise, fulgurate, and close the fistula tract under direct vision — a truly minimally invasive, sphincter-preserving technique.", {
    x: 0.3, y: 1.75, w: 3.6, h: 1.1, color: LIGHT_TXT, fontSize: 9.5, lineSpacingMultiple: 1.3
  });

  // key metrics
  const metrics = [
    ["Clinical Success\nOR", "1.039", "95% CI: 1.026–1.054"],
    ["Recurrence\nRisk Ratio", "0.941", "95% CI: 0.928–0.955"],
    ["Complications\nRisk Ratio", "0.93", "95% CI: 0.91–0.95"],
    ["QoL Improvement\nOR", "1.07", "95% CI: 1.05–1.09"]
  ];
  metrics.forEach(([label, val, ci], i) => {
    statBox(sl, 4.2 + i * 1.45, 1.35, 1.35, 1.6, label + "\n" + ci, val, MED_BG);
  });

  bulletBox(sl, [
    "15 observational studies (999 patients). Compared VAAFT vs traditional techniques (seton, plug, fistulectomy with flap, FiLaC®).",
    "VAAFT showed significantly better clinical success, lower recurrence, fewer complications, and improved quality of life vs conventional surgery.",
    "The technique uses a specially designed fistuloscope (Karl Storz 20750) with continuous irrigation to identify secondary tracts and internal openings.",
    "The internal opening is closed with a stapler or direct suture; the tract is fulgurated with electrocautery under vision.",
    "Advantages: sphincter-preservation, direct visualisation of entire fistula tract including secondary tracts, minimal tissue damage.",
    "Conclusion: VAAFT is an effective and safe procedure for complex anal fistulae, with evidence of superiority over traditional methods."
  ], { y: 3.05, fontSize: 11 });

  addFooter(sl);
}

// ════════════════════════════════════════════════════════════
// SLIDE 7 – Paper 5: FiLaC Laser Therapy SR/MA 2025
// ════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: DARK_BG };
  addTitle(sl, "Paper 5 — FiLaC® Laser Fistula Therapy: Systematic Review & Meta-Analysis (2025)");

  sl.addShape("roundRect", { x: 0.2, y: 0.82, w: 9.6, h: 0.42, rectRadius: 0.06, fill: { color: CARD_BG }, line: { color: GOLD, width: 1 } });
  sl.addText("Duda JR et al. | Int J Colorectal Dis | Sep 2025 | Systematic Review & Meta-Analysis | PMID: 40936062", {
    x: 0.2, y: 0.82, w: 9.6, h: 0.42, color: GOLD, fontSize: 9, align: "center", valign: "middle", italic: true
  });

  // stats row
  const fstats = [
    ["Studies", "24", "RCTs + observational"],
    ["Patients", "1,503", "Cryptoglandular fistulae"],
    ["Primary Healing", "57.46%", "(49.40–65.33%)"],
    ["Recurrence", "18.48%", "(10.14–28.47%)"],
    ["Incontinence", "0.57%", "Low incontinence (key advantage)"],
    ["Reoperation", "36.49%", "(28.95–44.36%)"]
  ];
  fstats.forEach(([label, val, sub], i) => {
    const col = i % 3;
    const row = Math.floor(i / 3);
    sl.addShape("roundRect", {
      x: 0.2 + col * 3.3, y: 1.35 + row * 1.1, w: 3.1, h: 1.0,
      rectRadius: 0.06, fill: { color: CARD_BG }, line: { color: ACCENT, width: 1 }
    });
    sl.addText(val, { x: 0.2 + col * 3.3, y: 1.38 + row * 1.1, w: 3.1, h: 0.45, color: GOLD, fontSize: 20, bold: true, align: "center" });
    sl.addText(label + "\n" + sub, { x: 0.2 + col * 3.3, y: 1.83 + row * 1.1, w: 3.1, h: 0.45, color: LIGHT_TXT, fontSize: 8, align: "center", lineSpacingMultiple: 1.2 });
  });

  bulletBox(sl, [
    "FiLaC® (Fistula Laser Closure): laser probe inserted into tract destroys epithelium by radial energy emission while preserving sphincter.",
    "No statistically significant differences in healing rate based on fistula type, adjunctive measures used, or patient sex (subgroup analysis).",
    "Key advantage: near-zero incontinence rate (0.57%) — safest of all minimally invasive sphincter-preserving techniques.",
    "Key limitation: intermediate healing rate (57%) and high reoperation rate (36.5%) — FiLaC® should be considered alongside other options.",
    "Further standardized RCTs needed to define optimal technique protocol and adjunctive measures (seton pre-treatment, fibrin glue injection)."
  ], { y: 3.6, fontSize: 11 });

  addFooter(sl);
}

// ════════════════════════════════════════════════════════════
// SLIDE 8 – Comparative Analysis of All 5 Papers
// ════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: DARK_BG };
  addTitle(sl, "Comparative Analysis of 5 Papers");

  // table
  const tableRows = [
    // header
    [
      { text: "Paper / Method", options: { bold: true, color: WHITE, fill: ACCENT } },
      { text: "Design", options: { bold: true, color: WHITE, fill: ACCENT } },
      { text: "N", options: { bold: true, color: WHITE, fill: ACCENT } },
      { text: "Healing Rate", options: { bold: true, color: WHITE, fill: ACCENT } },
      { text: "Recurrence", options: { bold: true, color: WHITE, fill: ACCENT } },
      { text: "Incontinence", options: { bold: true, color: WHITE, fill: ACCENT } },
      { text: "Key Strength", options: { bold: true, color: WHITE, fill: ACCENT } }
    ],
    [
      { text: "ESCP Guidelines 2024", options: { color: WHITE, fill: MED_BG } },
      { text: "Meta-Analysis + Guideline", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "250 Q / 45 selected", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "42 recommendations", options: { color: GOLD, fill: MED_BG } },
      { text: "N/A", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "N/A", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "International guideline", options: { color: LIGHT_TXT, fill: MED_BG } }
    ],
    [
      { text: "Surgical NMA 2023 (LIFT)", options: { color: WHITE, fill: CARD_BG } },
      { text: "Network Meta-Analysis", options: { color: LIGHT_TXT, fill: CARD_BG } },
      { text: "52 RCTs", options: { color: LIGHT_TXT, fill: CARD_BG } },
      { text: "No diff btw treatments", options: { color: GOLD, fill: CARD_BG } },
      { text: "N/A", options: { color: LIGHT_TXT, fill: CARD_BG } },
      { text: "LIFT best (99.1%)", options: { color: GOLD, fill: CARD_BG } },
      { text: "Largest RCT-only NMA", options: { color: LIGHT_TXT, fill: CARD_BG } }
    ],
    [
      { text: "ERAF SR/MA 2024", options: { color: WHITE, fill: MED_BG } },
      { text: "Systematic Review & MA", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "38 studies, n=1,559", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "65.5%", options: { color: GOLD, fill: MED_BG } },
      { text: "19.6%", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "10.6%", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "IBD subgroup data", options: { color: LIGHT_TXT, fill: MED_BG } }
    ],
    [
      { text: "VAAFT MA 2025", options: { color: WHITE, fill: CARD_BG } },
      { text: "Meta-Analysis", options: { color: LIGHT_TXT, fill: CARD_BG } },
      { text: "15 studies, n=999", options: { color: LIGHT_TXT, fill: CARD_BG } },
      { text: "OR 1.039 vs controls", options: { color: GOLD, fill: CARD_BG } },
      { text: "RR 0.941", options: { color: GOLD, fill: CARD_BG } },
      { text: "Preserved", options: { color: GOLD, fill: CARD_BG } },
      { text: "Direct visualisation", options: { color: LIGHT_TXT, fill: CARD_BG } }
    ],
    [
      { text: "FiLaC® SR/MA 2025", options: { color: WHITE, fill: MED_BG } },
      { text: "SR + Single-arm MA", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "24 studies, n=1,503", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "57.5%", options: { color: GOLD, fill: MED_BG } },
      { text: "18.5%", options: { color: LIGHT_TXT, fill: MED_BG } },
      { text: "0.57% (lowest!)", options: { color: GOLD, fill: MED_BG } },
      { text: "Near-zero incontinence", options: { color: LIGHT_TXT, fill: MED_BG } }
    ]
  ];

  sl.addTable(tableRows, {
    x: 0.1, y: 0.82, w: 9.8, h: 4.5,
    rowH: 0.65,
    border: { type: "solid", color: "1A3A5C", pt: 0.5 },
    fontSize: 8.5,
    align: "center",
    valign: "middle",
    colW: [1.7, 1.5, 1.3, 1.4, 1.2, 1.3, 1.4]
  });

  addFooter(sl);
}

// ════════════════════════════════════════════════════════════
// SLIDE 9 – MRI Imaging & Classification
// ════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: DARK_BG };
  addTitle(sl, "Imaging in Fistula: MRI and Classification");

  const d3 = imgData(3);
  const d4 = imgData(2);

  if (d3) {
    sl.addImage({ data: d3, x: 0.2, y: 0.85, w: 3.6, h: 3.0 });
    sl.addText("MRI: Transsphincteric Fistula (T2W)", { x: 0.2, y: 3.88, w: 3.6, h: 0.28, color: GOLD, fontSize: 8, align: "center", italic: true });
  }

  if (d4) {
    sl.addImage({ data: d4, x: 4.0, y: 0.85, w: 3.4, h: 3.0 });
    sl.addText("Parks Classification Diagram", { x: 4.0, y: 3.88, w: 3.4, h: 0.28, color: GOLD, fontSize: 8, align: "center", italic: true });
  }

  const infoItems = [
    "MRI is the gold-standard for complex fistula mapping (per ESCP 2024).",
    "Identifies primary and secondary tracts, horseshoe extensions, internal openings.",
    "Parks Classification: 4 types — intersphincteric (45%), transsphincteric (30%), suprasphincteric (20%), extrasphincteric (5%).",
    "St James's Classification uses MRI to grade 1–5 from simple intersphincteric to complex with abscess.",
    "Correct classification guides surgical approach and predicts incontinence risk."
  ];
  const infoArr = infoItems.map((t, i) => ({ text: t, options: { bullet: true, breakLine: i < infoItems.length - 1 } }));
  sl.addText(infoArr, { x: 7.5, y: 0.88, w: 2.3, h: 3.3, color: LIGHT_TXT, fontSize: 9, lineSpacingMultiple: 1.3, valign: "top" });

  addFooter(sl);
}

// ════════════════════════════════════════════════════════════
// SLIDE 10 – Conclusions & Recommendations
// ════════════════════════════════════════════════════════════
{
  let sl = pres.addSlide();
  sl.background = { color: DARK_BG };

  // dark header bar
  sl.addShape("rect", { x: 0, y: 0, w: "100%", h: 0.85, fill: { color: ACCENT }, line: { color: ACCENT } });
  sl.addText("Conclusions & Clinical Recommendations", {
    x: 0.3, y: 0, w: 9.4, h: 0.85, color: WHITE, fontSize: 22, bold: true, align: "center", valign: "middle"
  });

  // 4 conclusion boxes
  const boxes = [
    {
      title: "Sphincter Preservation is Paramount",
      body: "All 5 papers consistently emphasise preserving sphincter function. LIFT, ERAF, VAAFT, and FiLaC® are all sphincter-preserving. Fistulotomy is reserved for low/simple fistulae only.",
      color: "0F3460", accent: ACCENT
    },
    {
      title: "No Single Best Treatment",
      body: "The network meta-analysis (Bhat et al. 2023) found no significant difference in healing rates between 14 treatments. Choice depends on fistula complexity, IBD status, and patient factors.",
      color: "132B4A", accent: GOLD
    },
    {
      title: "Novel Techniques Show Promise",
      body: "VAAFT (2025) shows superior outcomes vs traditional surgery. FiLaC® laser offers minimal incontinence (0.57%). Both are emerging as first-line options for complex fistulae.",
      color: "0F3460", accent: ACCENT
    },
    {
      title: "Evidence Gaps & Future Research",
      body: "Standardised RCTs with consistent outcome reporting are needed. IBD-associated fistulae require dedicated trials. Long-term (>2 year) follow-up data is lacking for newer techniques.",
      color: "132B4A", accent: GOLD
    }
  ];

  boxes.forEach(({ title, body, color, accent }, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.2 + col * 5.0;
    const y = 0.95 + row * 2.1;
    sl.addShape("roundRect", { x, y, w: 4.7, h: 1.95, rectRadius: 0.1, fill: { color }, line: { color: accent, width: 1.5 } });
    sl.addText(title, { x: x + 0.15, y: y + 0.08, w: 4.4, h: 0.38, color: accent, fontSize: 11, bold: true });
    sl.addText(body, { x: x + 0.15, y: y + 0.48, w: 4.4, h: 1.38, color: LIGHT_TXT, fontSize: 9.5, lineSpacingMultiple: 1.35, valign: "top" });
  });

  // references bar
  sl.addShape("rect", { x: 0, y: 5.05, w: "100%", h: 0.57, fill: { color: "0A1A2D" }, line: { color: "0A1A2D" } });
  sl.addText([
    { text: "References: ", options: { bold: true, color: GOLD } },
    { text: "1. Reza L et al. Colorectal Dis. 2024 (PMID:38050857)  |  2. Bhat S et al. Tech Coloproctol. 2023 (PMID:37460830)  |  ", options: { color: LIGHT_TXT } },
    { text: "3. Wang L et al. Ann Ital Chir. 2024 (PMID:39186335)  |  4. Wang W et al. BJS Open. 2025 (PMID:42011865)  |  5. Duda JR et al. Int J Colorectal Dis. 2025 (PMID:40936062)", options: { color: LIGHT_TXT } }
  ], { x: 0.2, y: 5.05, w: 9.6, h: 0.57, fontSize: 7, align: "center", valign: "middle" });
}

// ─── Write file ───────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/fistula-ppt/Fistula_Research_Review.pptx" })
  .then(() => console.log("SUCCESS: /home/daytona/workspace/fistula-ppt/Fistula_Research_Review.pptx"))
  .catch(e => { console.error("FAILED:", e.message); process.exit(1); });
Running Command

cd /home/daytona/workspace/fistula-ppt && node build.js 2>&1

Writing File

~/fistula-ppt/fetch_imgs.js

// Fetch images one at a time to avoid ENOBUFS
const { execSync } = require("child_process");

const imageUrls = [
  "https://teachmesurgery.com/wp-content/uploads/2016/12/Classification-of-Anal-Fistulae-by-Location.png",
  "https://www.researchgate.net/publication/356392572/figure/fig1/AS:1124662931136512@1645151946175/Anatomy-and-associated-complexity-classification-of-the-anal-fistulae.png",
  "https://figures.semanticscholar.org/339f3dba395cd6b993ee057c3068814be4b4418e/2-Figure1-1.png",
  "https://prod-images-static.radiopaedia.org/images/65362084/a977ba59ae7780c59b4482f1f56258c1e336c64c1c8d5a29fa5e42d9bd48ef79_big_gallery.jpeg",
  "http://radiologykey.com/wp-content/uploads/2025/05/gr3-175.jpg"
];

const imgs = [];
for (const url of imageUrls) {
  try {
    const raw = execSync(
      `node /home/daytona/skills/shared/scripts/fetch_images.js "${url}"`,
      { timeout: 20000, maxBuffer: 20 * 1024 * 1024 }
    ).toString();
    const parsed = JSON.parse(raw);
    imgs.push(parsed[0]);
    console.log("OK:", url.substring(0, 60));
  } catch(e) {
    console.error("FAIL:", url.substring(0, 60), e.message);
    imgs.push({ base64: null, error: e.message });
  }
}

const fs = require("fs");
fs.writeFileSync("/home/daytona/workspace/fistula-ppt/images.json", JSON.stringify(imgs));
console.log("Saved images.json with", imgs.filter(i => i && i.base64).length, "images");
Running Command

cd /home/daytona/workspace/fistula-ppt && node fetch_imgs.js 2>&1

Editing File

~/fistula-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/fistula-ppt/build.js'
Running Command

cd /home/daytona/workspace/fistula-ppt && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/fistula-ppt/Fistula_Research_Review.pptx

Your 10-slide PowerPoint is ready (2.4 MB):

Fistula Research Review

Presentation · PPTX


What's Inside the Presentation

The deck uses a deep navy + crimson + gold palette on a dark background - professional and medical in feel. Here is the full slide breakdown:
SlideContent
1Title Slide - Topic overview, list of all 5 papers, fistula classification image
2Introduction - Definition, anatomy, Parks classification, prevalence, key challenges; with anatomy diagram
3Paper 1 - ESCP Guidelines 2024 (Reza et al.) - 42 recommendations, MRI as gold standard, LIFT/ERAF preferred
4Paper 2 - Network Meta-Analysis 2023 (Bhat et al.) - 52 RCTs, 14 treatments, LIFT best for continence
5Paper 3 - ERAF Systematic Review 2024 (Wang L et al.) - 65.5% healing, IBD vs non-IBD subgroup data
6Paper 4 - VAAFT Meta-Analysis 2025 (Wang W et al.) - superior success & QoL, lower recurrence vs traditional surgery
7Paper 5 - FiLaC® Laser SR/MA 2025 (Duda et al.) - 57.5% healing, lowest incontinence (0.57%)
8Comparative Table - All 5 papers side-by-side: design, N, healing rate, recurrence, incontinence, key strength
9MRI & Imaging - MRI images, Parks and St James's classification, imaging role in surgical planning
10Conclusions - 4 key takeaways: sphincter preservation, no single best treatment, emerging novel techniques, evidence gaps

The 5 Research Papers

  1. Reza L et al. - ESCP Guidelines for Cryptoglandular Anal Fistula - Colorectal Dis. 2024 - PMID: 38050857
  2. Bhat S et al. - Efficacy of Different Surgical Treatments: Network Meta-Analysis - Tech Coloproctol. 2023 - PMID: 37460830
  3. Wang L et al. - Endorectal Advancement Flap SR & Meta-Analysis - Ann Ital Chir. 2024 - PMID: 39186335
  4. Wang W et al. - VAAFT for Complex Anorectal Fistula: Meta-Analysis - BJS Open. 2025 - PMID: 42011865
  5. Duda JR et al. - FiLaC® Laser Therapy SR & Single-Arm Meta-Analysis - Int J Colorectal Dis. 2025 - PMID: 40936062
This is a shared conversation. Sign in to Orris to start your own chat.