Urology fistula (mbbs urology in detail)

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Loading Image
I now have comprehensive content from multiple authoritative urology textbooks. Let me compile the complete answer.

Urological Fistulae - Complete MBBS Guide

A urological fistula is an abnormal communication between any part of the urinary tract (kidney, ureter, bladder, urethra) and another hollow viscus, body surface, or organ. The primary disease causing the fistula is almost always non-urological.

Classification of Urological Fistulae

CategoryTypeCommunication
VesicalVesicovaginal (VVF)Bladder → Vagina
Vesicointestinal (colovesical/ileovesical)Bladder → Bowel
VesicocutaneousBladder → Skin
VesicouterineBladder → Uterus
UreteralUreterovaginalUreter → Vagina
UreterocutaneousUreter → Skin
UrethralUrethrovaginalUrethra → Vagina
UrethrocutaneousUrethra → Skin
RectourethralRectum → Urethra
VascularUreteroarterialUreter → Artery
Renovascular/PyelovascularRenal pelvis → Vessel

1. Vesicovaginal Fistula (VVF)

Definition

The most common urinary tract fistula. An abnormal communication between the posterior wall of the bladder and the anterior wall of the vagina.

Etiology

Developing countries: Obstetric fistula predominates.
  • Prolonged obstructed labour causes ischaemic pressure necrosis of the anterior vaginal wall, bladder, and urethra
  • Risk factors: younger age at first marriage, short stature, low socioeconomic status, illiteracy, lack of prenatal care
  • Large areas of bladder neck and urethra may be involved
  • Concomitant rectovaginal fistulae may also be present
Developed countries: Iatrogenic (surgical) predominates.
  • Post-hysterectomy (most common): unrecognised bladder injury near vaginal cuff, diathermy injury causing delayed tissue necrosis, suture placed through bladder and vaginal wall
  • Abdominal hysterectomy is 3x more likely to cause fistula than vaginal hysterectomy
  • Overall rate post-hysterectomy: 0.1-4%
  • Other causes: radiotherapy (may manifest years later), advanced pelvic malignancy, TB, congenital disorders, foreign body erosion

Clinical Features

  • Constant urinary leakage from the vagina - the cardinal symptom
  • May be intermittent in very small fistulae
  • Post-hysterectomy VVF: appears in first few days post-op, or 1-3 weeks after catheter removal
  • Post-irradiation VVF: may not manifest until years later
  • Physical examination: fistula site on anterior vaginal wall at vaginal cuff; leakage visible on instillation of blue dye into bladder

Investigation

1. Imaging
  • CT urogram, MRI with gadolinium contrast, or cystogram - identifies fistulous tract and excludes concomitant ureteric injury
CT scan showing a vesicovaginal fistula from the posterior wall of the bladder to the vagina
CT scan showing a vesicovaginal fistula from the posterior bladder wall to the vagina (Bailey & Love's Surgery)
2. Cystoscopy + Retrograde Ureteropyelography + EUA
  • Assess fistula: site, location, size, proximity to ureteric orifices
  • Assess vaginal size, depth, and mobility for surgical planning
  • Biopsy of tract to exclude malignancy in prior pelvic cancer history
3. Three-Swab Test (when fistula not visualised above)
  • Three numbered gauze swabs placed in vagina (1 = proximal, 2 = mid, 3 = distal)
  • Blue dye instilled into bladder via catheter
  • Swab 1 wet + stained blue = VVF (proximal/vault)
  • Swab 1 wet but NOT stained blue = ureterovaginal fistula
  • Only distal swab blue = urinary incontinence (SUI/UUI)
4. Double-Dye Pad Test (to differentiate VVF from ureterovaginal fistula)
  • Oral phenazopyridine (Pyridium) colours urine orange
  • Methylene blue instilled into bladder; Foley clamped
  • Pad placed in vagina
  • Orange stain = ureteral fistula
  • Blue stain (deep pad) = vesicovaginal fistula
  • Blue distal + orange proximal = both fistulae present

Classification - Goh & Waaldijk Systems

Goh and Waaldijk classification of vesicovaginal fistula
Goh classification (by distance from continence zone) and Waaldijk classification (by size: small <2 cm to extensive ≥6 cm) - Campbell-Walsh Wein Urology

Treatment

Conservative (selected cases only)
  • Indwelling catheter + anticholinergics for 2-6 weeks
  • Best for newly diagnosed, small (<1 cm), non-radiated fistulae
  • Spontaneous closure rates: up to 28% in obstetric fistula (Waaldijk); 13% overall from combined data
  • Radiotherapy-related VVF: 0% spontaneous closure
Surgical Treatment
  • Required if conservative fails
  • Approaches: vaginal, transabdominal (open or minimally invasive), or combined
Principles of VVF Repair (Bailey & Love, Table 83.8):
  1. Adequate exposure and debridement of ischaemic tissue
  2. Adequate separation of involved organs
  3. Watertight, multilayer, tension-free closure with non-overlapping suture lines
  4. Use of well-vascularised tissue flaps (omentum, peritoneum, Martius labial fat pad)
  5. Adequate postoperative urinary drainage
  6. Treatment and prevention of infection
  7. Meticulous haemostasis
Tissue Flaps Used:
  • Martius labial fat pad flap (Henri Martius, 1928): labial fat pad (+/- bulbospongiosus muscle) tunneled over repair - most commonly used
  • Peritoneal flap: for apical fistulae close to peritoneal reflection
  • Island flap (Lehoczky): when insufficient vaginal skin for tension-free closure
  • Omentum: for large/complex/irradiated fistulae

2. Vesicointestinal Fistulae (Enterovesical)

Types and Causes

The primary disease is rarely urological.
CauseFrequency
Diverticulitis50-75% (most common overall)
Colorectal malignancy20-25%
Crohn's disease5-10%
Other (trauma, appendiceal abscess, foreign body, radiotherapy)<5%
  • Colovesical fistula: most common; usually from diverticulitis (sigmoid colon to dome of bladder)
  • Ileovesical fistula: more common in Crohn's disease; 93% occur in men (Ben-Ami et al.)
  • Previous hysterectomy increases risk 25-fold when combined with diverticulitis

Clinical Features

  • Pneumaturia (passage of gas per urethra) - pathognomonic
  • Fecaluria (passage of faecal debris in urine)
  • Vesical irritability (frequency, dysuria, haematuria)
  • Change in bowel habits (constipation, diarrhoea, distension)
  • Mixed bacterial urinary infection (polymicrobial)
  • Signs of bowel obstruction / abdominal tenderness if inflammatory cause

Investigation

  • CT scan/MRI: most sensitive - shows bladder wall thickening, adjacent bowel mass, air in bladder (CT triad for colovesical: (1) bladder wall thickening adjacent to thickened colon loop, (2) air in bladder, (3) fistulous tract)
  • Cystoscopy: localised inflammatory reaction; bowel contents may exude; catheterisation of tract
  • Urinalysis: pyuria, bacteriuria, mixed flora on culture
  • Poppy seed / charcoal test (historical): oral ingestion followed by urine collection

Treatment

Bowel resection with primary anastomosis + bladder repair (partial cystectomy or closure of defect). Management of underlying cause (diverticulitis, Crohn's) is essential.

3. Ureterovaginal Fistula

Aetiology

  • Most common cause: iatrogenic ureteric injury during pelvic surgery (hysterectomy, colorectal surgery, caesarean section)
  • Delayed presentation - patient complains of ongoing incontinence after surgery

Diagnosis

  • Double-dye test: IV methylene blue + clamp Foley → orange stain on vaginal pad = ureteral fistula
  • CT urogram: localise level and extent of ureteral injury
  • Retrograde ureterography + cystoscopy

Treatment

  • Endoscopic first: ureteral stent or percutaneous nephrostomy with antegrade stenting (for partial transections/small leaks)
  • Stents maintained 4-8 weeks
  • Surgical repair if endoscopic management fails:
    • Wait 6 weeks (inflammation subsides) before open repair
    • Early repair (within 7 days) possible if detected immediately post-op
    • Options: ureteroneocystostomy, ureteroureterostomy, Boari flap, ileal ureter

4. Urethrovaginal Fistula

Features

  • Distal urethrovaginal fistulae: often asymptomatic
  • Proximal fistulae: intermittent or constant urinary leakage
  • Caused by surgical trauma (anterior vaginal wall surgery, sling procedures, diverticulectomy) - difficult to visualise on physical exam or cystoscopy
  • Diagnosis best made with voiding cystourethrogram (VCUG)

Treatment

  • Challenging repair; almost always requires interpositional tissue flap due to lack of surrounding connective tissue in mid/distal urethra
  • Martius flap is standard

5. Rectourethral Fistula (RUF)

Aetiology

  • Most common cause: surgical treatment of localised prostate cancer (radical prostatectomy, cryotherapy, HIFU, radiotherapy)
  • Radiotherapy/ablation-related RUF is far more difficult to manage

Clinical Features

  • Passage of urine per rectum
  • Faecal soiling of urine
  • Recurrent UTI

Diagnosis

  • Confirmed with VCUG

Treatment

  • Conservative: Foley catheter drainage (select patients)
  • Surgical repair (majority) - but radiation-induced RUF has much higher morbidity:
    • 86% require permanent colostomy (vs 0% for non-radiated)
    • 93% require permanent urinary diversion (vs 6% for non-radiated)

6. Urethrocutaneous Fistula

Aetiology

  • Most common surgical complication after hypospadias repair (~10% incidence)
  • Occurs anywhere along urethroplasty; most often at original meatal site or coronal margin
  • Causes: ischaemia, oedema, infection, haematoma, meatal stenosis, overlapping suture lines, poor tissue perfusion
  • "Watering-can perineum": multiple urethrocutaneous fistulae from periurethral abscess complicating urethral stricture

Management

  • Surgical repair delayed 6-12 months after initial hypospadias repair
  • Pre-op: calibration with bougie à boule + urethroscopy to assess urethral patency
  • Stress test: saline injected into clamped urethra to identify concealed tracts
  • Small shaft fistulas: excise tract + primary multilayer closure
  • Large/coronal/complex fistulas: trap-door or island flap with vascularised tissue coverage
  • Smaller fistulas (<1 cm) noted immediately post-op without stenosis: rarely close spontaneously; most require repair

7. Urovascular Fistulae (Rare but Life-Threatening)

Ureteroarterial Fistula

  • Predisposing factors: radiation, vascular pathology, chronic ureteral stenting
  • Massive haemorrhage, high mortality
  • Treatment: endovascular stenting (initial modality of choice in stable patients)

Renovascular / Pyelovascular Fistula

  • Most common cause: percutaneous nephrolithotomy (PCNL) - puncture of intrarenal vessel
  • Bleeding may be tamponaded by catheter; brisk haemorrhage on removal
  • Incidence of post-PCNL bleeding requiring transfusion: ~11%; requiring intervention: ~1.2%
  • Also: penetrating/blunt trauma, infection, renal surgery
  • Treatment: angioembolisation; surgical repair if needed

Summary Table: Key Points for Exams

FistulaMost Common CauseCardinal SymptomKey InvestigationTreatment
VVFObstetric (developing world) / Hysterectomy (developed world)Constant vaginal urine leakCystoscopy + Three-swab testMultilayer surgical repair + Martius flap
VesicointestinalDiverticulitis (65-75%)Pneumaturia + FecaluriaCT (air in bladder)Bowel resection + bladder repair
UreterovaginalHysterectomyIncontinence post-opCT urogram + double-dye testStent → surgical reimplant
UrethrovaginalAnterior vaginal surgeryProximal: constant leakVCUGInterpositional flap repair
RectourethralProstate cancer treatmentUrine per rectumVCUGSurgical repair (colostomy if irradiated)
UrethrocutaneousHypospadias repairDouble urine streamStress test / urethroscopyDelayed fistula closure at 6-12 months

Sources: Smith & Tanagho's General Urology 19e; Campbell-Walsh-Wein Urology (3-Volume Set); Bailey & Love's Short Practice of Surgery 28e; Hinman's Atlas of Urologic Surgery.

Make a ppt of this with 10 slides

Reading File
Reading File
Reading File
Running Command

ls -la /home/daytona/workspace/

Running Command

mkdir -p /home/daytona/workspace/urology-fistula-ppt && node /home/daytona/skill…

Writing File

~/urology-fistula-ppt/make_ppt.js

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

// Fetch images
const imageUrls = [
  "https://cdn.orris.care/cdss_images/1706805e7263f0f436cc863ae3e15032a3ddee7948590372e4a5e3b1f8877b45.png", // CT VVF
  "https://cdn.orris.care/cdss_images/a12fa5498fa109ecca48920c516f18ae276a0bbc333c6a08d37e4934ac0d5b53.png", // Goh/Waaldijk classification
  "https://cdn.orris.care/cdss_images/00137ba9088cdd8ed22d0ca623793cffb3dd67792a424d383baa29df60cff298.png", // Anatomical VVF diagram
];

const images = JSON.parse(execSync(
  `node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`
).toString());

// Color palette — deep navy/teal medical theme
const C = {
  navy:      "0D2137",   // dominant dark
  teal:      "0A7B8C",   // accent
  tealLight: "14A8BE",   // highlight
  mint:      "D6F5F7",   // light bg chip
  white:     "FFFFFF",
  offWhite:  "F0F6F8",
  slate:     "3A5068",
  gold:      "E8A020",   // warm accent for highlights
  lightGold: "FFF3D6",
  red:       "C0392B",
  lightRed:  "FDECEA",
  green:     "1A7A4A",
  lightGreen:"E6F7EE",
};

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"
pres.title = "Urological Fistulae";
pres.author = "MBBS Urology";

// ─────────────────────────────────────────────────────────
// HELPER: section header bar
function addHeader(slide, title, subtitle) {
  // Top dark navy bar
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 13.3, h: 1.05,
    fill: { color: C.navy }, line: { color: C.navy }
  });
  // Teal accent strip
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 1.05, w: 13.3, h: 0.08,
    fill: { color: C.teal }, line: { color: C.teal }
  });
  slide.addText(title, {
    x: 0.35, y: 0.05, w: 10, h: 0.7,
    fontSize: 26, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 0
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.35, y: 0.68, w: 10, h: 0.32,
      fontSize: 13, color: C.tealLight, fontFace: "Calibri", valign: "top", margin: 0
    });
  }
}

// HELPER: slide number
function addSlideNum(slide, n) {
  slide.addText(`${n} / 10`, {
    x: 12.3, y: 7.1, w: 0.9, h: 0.3,
    fontSize: 9, color: C.slate, align: "right", fontFace: "Calibri"
  });
}

// HELPER: card box
function addCard(slide, x, y, w, h, fillColor, text, textOpts) {
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x, y, w, h,
    fill: { color: fillColor },
    line: { color: fillColor },
    rectRadius: 0.08,
    shadow: { type: "outer", color: "000000", blur: 4, offset: 2, angle: 135, opacity: 0.1 }
  });
  slide.addText(text, { x, y, w, h, ...textOpts });
}

// ─────────────────────────────────────────────────────────
// SLIDE 1 — Title
// ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  // Full dark background
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 13.3, h: 7.5,
    fill: { color: C.navy }, line: { color: C.navy }
  });
  // Teal decorative block left
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 0.45, h: 7.5,
    fill: { color: C.teal }, line: { color: C.teal }
  });
  // Gold accent line
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.45, y: 3.1, w: 6.5, h: 0.07,
    fill: { color: C.gold }, line: { color: C.gold }
  });
  // Main title
  s.addText("UROLOGICAL FISTULAE", {
    x: 0.7, y: 1.5, w: 7.5, h: 1.4,
    fontSize: 44, bold: true, color: C.white, fontFace: "Calibri",
    charSpacing: 2, valign: "middle"
  });
  // Subtitle
  s.addText("A Comprehensive MBBS Guide", {
    x: 0.7, y: 3.25, w: 7, h: 0.55,
    fontSize: 20, color: C.tealLight, fontFace: "Calibri", italic: true
  });
  // Topics preview
  s.addText("Classification  ·  VVF  ·  Vesicointestinal  ·  Ureterovaginal\nUrethrovaginal  ·  Rectourethral  ·  Urethrocutaneous  ·  Diagnosis & Treatment", {
    x: 0.7, y: 4.0, w: 8, h: 1.1,
    fontSize: 13, color: "A8C8D5", fontFace: "Calibri", lineSpacingMultiple: 1.4
  });
  // Bottom tag
  s.addText("Sources: Campbell-Walsh-Wein Urology · Smith & Tanagho · Bailey & Love · Hinman's Atlas", {
    x: 0.7, y: 7.0, w: 10, h: 0.38,
    fontSize: 10, color: "5A8099", fontFace: "Calibri", italic: true
  });
  // Right decorative image (Goh classification)
  s.addImage({ data: images[1].base64, x: 7.8, y: 0.7, w: 5.0, h: 5.6, transparency: 18 });
  addSlideNum(s, 1);
}

// ─────────────────────────────────────────────────────────
// SLIDE 2 — Definition & Classification
// ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:C.offWhite}, line:{color:C.offWhite} });
  addHeader(s, "Definition & Classification", "Urological fistulae — abnormal communications involving the urinary tract");

  // Definition box
  addCard(s, 0.35, 1.25, 12.6, 0.8, C.mint,
    "A urological fistula is an abnormal communication between any part of the urinary tract (kidney, ureter, bladder, urethra) and another hollow viscus, body surface, or organ. The primary disease causing the fistula is almost always NON-urological.",
    { fontSize: 13, color: C.navy, fontFace: "Calibri", valign: "middle", margin: 8 }
  );

  // Classification table — 3 columns
  const cats = [
    { title: "VESICAL FISTULAE", color: C.teal, items: ["Vesicovaginal (VVF)", "Vesicointestinal", "Vesicocutaneous", "Vesicouterine"] },
    { title: "URETERAL FISTULAE", color: C.slate, items: ["Ureterovaginal", "Ureterocutaneous", "Ureterointestinal"] },
    { title: "URETHRAL FISTULAE", color: C.gold, items: ["Urethrovaginal", "Urethrocutaneous", "Rectourethral"] },
  ];

  cats.forEach((cat, i) => {
    const x = 0.35 + i * 4.2;
    // Header
    s.addShape(pres.shapes.RECTANGLE, { x, y:2.2, w:4.0, h:0.42, fill:{color:cat.color}, line:{color:cat.color}, rectRadius:0.04 });
    s.addText(cat.title, { x, y:2.2, w:4.0, h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });
    // Items
    cat.items.forEach((item, j) => {
      const iy = 2.72 + j * 0.55;
      s.addShape(pres.shapes.RECTANGLE, { x, y:iy, w:4.0, h:0.46, fill:{color: j%2===0?"FFFFFF":"F5FAFB"}, line:{color:"D0E8EC"} });
      s.addText(item, { x:x+0.15, y:iy, w:3.7, h:0.46, fontSize:12.5, color:C.navy, fontFace:"Calibri", valign:"middle" });
    });
  });

  // Plus vascular note
  addCard(s, 0.35, 5.55, 12.6, 0.55, C.lightGold,
    "▸  Urovascular fistulae (ureteroarterial, renovascular) — rare but life-threatening; increased risk with PCNL, radiation, and chronic ureteral stenting",
    { fontSize: 12, color: C.navy, fontFace: "Calibri", valign: "middle", margin: 8 }
  );

  addSlideNum(s, 2);
}

// ─────────────────────────────────────────────────────────
// SLIDE 3 — VVF: Aetiology & Epidemiology
// ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:C.offWhite}, line:{color:C.offWhite} });
  addHeader(s, "Vesicovaginal Fistula (VVF)", "Most common urinary tract fistula · Bladder ↔ Vagina communication");

  // Two column layout
  // Left — Developing world
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:1.25, w:5.9, h:0.45, fill:{color:C.teal}, line:{color:C.teal}, rectRadius:0.04 });
  s.addText("DEVELOPING WORLD", { x:0.35, y:1.25, w:5.9, h:0.45, fontSize:13, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });

  const devItems = [
    ["Cause", "Prolonged obstructed labour → ischaemic pressure necrosis"],
    ["Structures", "Anterior vaginal wall, bladder, urethra, bladder neck"],
    ["Risk factors", "Young age at marriage, short stature, low SES, illiteracy"],
    ["Association", "Concomitant rectovaginal fistula may be present"],
    ["Magnitude", "Majority of cases worldwide in low-resource settings"],
  ];
  devItems.forEach(([k, v], i) => {
    const iy = 1.78 + i * 0.7;
    s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:iy, w:5.9, h:0.62, fill:{color: i%2===0?"FFFFFF":"F0F9FB"}, line:{color:"D0E8EC"} });
    s.addText([{text:k+": ", options:{bold:true, color:C.teal}}, {text:v, options:{color:C.navy}}], {
      x:0.5, y:iy, w:5.6, h:0.62, fontSize:11.5, fontFace:"Calibri", valign:"middle"
    });
  });

  // Right — Developed world
  s.addShape(pres.shapes.RECTANGLE, { x:7.05, y:1.25, w:5.9, h:0.45, fill:{color:C.slate}, line:{color:C.slate}, rectRadius:0.04 });
  s.addText("DEVELOPED WORLD", { x:7.05, y:1.25, w:5.9, h:0.45, fontSize:13, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });

  const devdItems = [
    ["Cause", "Iatrogenic — post-hysterectomy most common"],
    ["Mechanism", "Unrecognised bladder injury / diathermy necrosis near vaginal cuff"],
    ["Rate", "Abdominal hysterectomy 3× > vaginal hysterectomy; overall 0.1–4%"],
    ["Others", "Radiotherapy (may manifest years later), pelvic malignancy, TB, foreign body"],
    ["Timing", "Days post-op (recognised) or 1–3 weeks post catheter removal"],
  ];
  devdItems.forEach(([k, v], i) => {
    const iy = 1.78 + i * 0.7;
    s.addShape(pres.shapes.RECTANGLE, { x:7.05, y:iy, w:5.9, h:0.62, fill:{color: i%2===0?"FFFFFF":"F5F6FA"}, line:{color:"C8D0DE"} });
    s.addText([{text:k+": ", options:{bold:true, color:C.slate}}, {text:v, options:{color:C.navy}}], {
      x:7.2, y:iy, w:5.6, h:0.62, fontSize:11.5, fontFace:"Calibri", valign:"middle"
    });
  });

  // Separator
  s.addShape(pres.shapes.RECTANGLE, { x:6.6, y:1.2, w:0.1, h:4.4, fill:{color:"D0D8E0"}, line:{color:"D0D8E0"} });

  // Bottom note
  addCard(s, 0.35, 6.55, 12.6, 0.6, C.lightRed,
    "⚠  Post-irradiation VVF has 0% spontaneous closure rate and requires complex surgical repair",
    { fontSize: 12, color: C.red, fontFace: "Calibri", valign: "middle", bold: true, margin: 8 }
  );

  addSlideNum(s, 3);
}

// ─────────────────────────────────────────────────────────
// SLIDE 4 — VVF: Clinical Features & Investigations
// ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:C.offWhite}, line:{color:C.offWhite} });
  addHeader(s, "VVF: Clinical Features & Investigations", "Diagnosis requires systematic workup to confirm and localise");

  // Clinical features left
  s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:1.25, w:4.9, h:0.42, fill:{color:C.teal}, line:{color:C.teal}, rectRadius:0.04 });
  s.addText("CLINICAL FEATURES", { x:0.35, y:1.25, w:4.9, h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });
  const clinItems = [
    "Constant urinary leakage from vagina (cardinal symptom)",
    "May be intermittent in very small fistulae",
    "Recurrent UTIs, unpleasant odour, skin excoriation",
    "Fistula site visible on anterior vaginal wall at vault",
    "Blue dye instilled into bladder → leakage visible at fistula site",
  ];
  s.addText(clinItems.map((t,i)=>({text:t, options:{bullet:true, breakLine: i<clinItems.length-1, color:C.navy}})), {
    x:0.35, y:1.75, w:4.9, h:3.0, fontSize:12, fontFace:"Calibri", valign:"top", margin:8,
    fill:{color:"FFFFFF"}, line:{color:"D0E8EC"}
  });

  // Investigations — right
  s.addShape(pres.shapes.RECTANGLE, { x:5.6, y:1.25, w:7.35, h:0.42, fill:{color:C.slate}, line:{color:C.slate}, rectRadius:0.04 });
  s.addText("INVESTIGATIONS", { x:5.6, y:1.25, w:7.35, h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });

  const invItems = [
    ["1. CT Urogram / MRI / Cystogram", "Identifies fistulous tract, excludes ureteric injury"],
    ["2. Cystoscopy + RUP + EUA", "Assess size, site, proximity to ureteric orifices; biopsy to exclude malignancy"],
    ["3. Three-Swab Test", "3 swabs in vagina + blue dye in bladder\n• Swab 1 blue = VVF (vault) • Swab 1 wet, not blue = ureterovaginal fistula\n• Only distal swab blue = urinary incontinence"],
    ["4. Double-Dye Pad Test", "Oral pyridium (orange) + bladder methylene blue (blue)\n• Orange pad = ureteral fistula • Blue deep pad = VVF\n• Blue distal + orange proximal = both"],
    ["5. VCUG (voiding cystourethrogram)", "Best for urethrovaginal fistula diagnosis"],
  ];
  invItems.forEach(([title, desc], i) => {
    const iy = 1.75 + i * 0.98;
    s.addShape(pres.shapes.RECTANGLE, { x:5.6, y:iy, w:7.35, h:0.9, fill:{color: i%2===0?"FFFFFF":"F5FAFB"}, line:{color:"D0E8EC"} });
    s.addText([
      {text: title, options:{bold:true, color:C.teal, breakLine:true}},
      {text: desc, options:{color:C.navy}}
    ], { x:5.75, y:iy+0.04, w:7.1, h:0.82, fontSize:11, fontFace:"Calibri", valign:"top" });
  });

  // CT image
  s.addImage({ data: images[0].base64, x:0.35, y:4.9, w:2.9, h:2.3 });
  s.addText("CT scan: VVF — posterior\nbladder wall to vagina", {
    x:0.35, y:7.2, w:2.9, h:0.25, fontSize:9, color:C.slate, fontFace:"Calibri", italic:true, align:"center"
  });

  // Key point
  addCard(s, 3.45, 5.25, 2.3, 1.8, C.mint,
    "Key point:\nThree-swab test is the standard bedside test for localising vaginal fistulae",
    { fontSize: 12, color: C.navy, fontFace:"Calibri", valign:"middle", margin:8, align:"center" }
  );

  addSlideNum(s, 4);
}

// ─────────────────────────────────────────────────────────
// SLIDE 5 — VVF Classification & Treatment
// ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:C.offWhite}, line:{color:C.offWhite} });
  addHeader(s, "VVF: Classification & Treatment", "Goh & Waaldijk systems · Conservative vs Surgical repair");

  // Classification image
  s.addImage({ data: images[1].base64, x:0.35, y:1.25, w:5.5, h:3.9 });
  s.addText("Goh classification (by distance from continence zone)\nWaaldijk classification (by size: small <2 cm to extensive ≥6 cm)", {
    x:0.35, y:5.2, w:5.5, h:0.5, fontSize:10, color:C.slate, fontFace:"Calibri", italic:true, align:"center"
  });

  // Treatment right
  s.addShape(pres.shapes.RECTANGLE, { x:6.2, y:1.25, w:6.75, h:0.42, fill:{color:C.teal}, line:{color:C.teal}, rectRadius:0.04 });
  s.addText("TREATMENT PRINCIPLES", { x:6.2, y:1.25, w:6.75, h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });

  // Conservative box
  addCard(s, 6.2, 1.75, 6.75, 1.0, "EBF5F7",
    [
      {text:"Conservative (selected): ", options:{bold:true, color:C.teal}},
      {text:"Catheter + anticholinergics × 2–6 weeks\nBest for small (<1 cm), non-radiated, newly diagnosed\nSpontaneous closure: 13% overall; 28% obstetric; 0% post-irradiation", options:{color:C.navy}}
    ],
    { fontSize:11, fontFace:"Calibri", valign:"top", margin:8, line:{color:"A8D8E0"} }
  );

  // Surgical principles
  s.addShape(pres.shapes.RECTANGLE, { x:6.2, y:2.85, w:6.75, h:0.38, fill:{color:C.slate}, line:{color:C.slate} });
  s.addText("Surgical Repair — Principles (Bailey & Love)", { x:6.2, y:2.85, w:6.75, h:0.38, fontSize:11.5, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });

  const surgPrinciples = [
    "Adequate exposure + debridement of ischaemic tissue",
    "Adequate separation of involved organs",
    "Watertight, multilayer, tension-free, non-overlapping suture lines",
    "Well-vascularised tissue flaps (omentum / peritoneum / Martius flap)",
    "Adequate postoperative urinary drainage",
    "Treatment and prevention of infection · Meticulous haemostasis",
  ];
  s.addText(surgPrinciples.map((t,i)=>({text:t, options:{bullet:true, breakLine: i<surgPrinciples.length-1, color:C.navy}})), {
    x:6.2, y:3.27, w:6.75, h:2.45, fontSize:11.5, fontFace:"Calibri", valign:"top", margin:8,
    fill:{color:"FFFFFF"}, line:{color:"D0E8EC"}
  });

  // Flaps
  addCard(s, 6.2, 5.8, 6.75, 0.85, C.lightGold,
    [
      {text:"Tissue Flaps: ", options:{bold:true, color:C.gold}},
      {text:"Martius labial fat pad flap (most common)  ·  Peritoneal flap (apical fistulae)  ·  Island flap (limited vaginal skin)  ·  Omentum (large/irradiated)", options:{color:C.navy}}
    ],
    { fontSize:11, fontFace:"Calibri", valign:"middle", margin:8 }
  );

  addSlideNum(s, 5);
}

// ─────────────────────────────────────────────────────────
// SLIDE 6 — Vesicointestinal Fistula
// ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:C.offWhite}, line:{color:C.offWhite} });
  addHeader(s, "Vesicointestinal (Enterovesical) Fistula", "Bladder ↔ Bowel communication · Primary disease is rarely urological");

  // Causes pie-like bars
  s.addText("CAUSES", { x:0.35, y:1.3, w:4.5, h:0.38, fontSize:13, bold:true, color:C.navy, fontFace:"Calibri" });
  const causes = [
    { label:"Diverticulitis", pct:"50–75%", color:C.teal, w:8.5 },
    { label:"Colorectal malignancy", pct:"20–25%", color:C.slate, w:4.3 },
    { label:"Crohn's disease", pct:"5–10%", color:C.gold, w:2.2 },
    { label:"Other (trauma, foreign body)", pct:"<5%", color:"9ABAC8", w:1.3 },
  ];
  causes.forEach((c,i)=>{
    const iy = 1.75 + i*0.82;
    s.addShape(pres.shapes.RECTANGLE, { x:0.35, y:iy, w:c.w, h:0.62, fill:{color:c.color}, line:{color:c.color}, rectRadius:0.04 });
    s.addText(`${c.label}  ${c.pct}`, { x:0.5, y:iy, w:c.w-0.2, h:0.62, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", valign:"middle" });
  });
  s.addText("Most common = Diverticulitis (sigmoid colon → bladder dome)", {
    x:0.35, y:5.1, w:5.5, h:0.4, fontSize:11, color:C.slate, fontFace:"Calibri", italic:true
  });

  // Key note on Crohn's
  addCard(s, 0.35, 5.6, 5.5, 0.65, C.mint,
    "Crohn's: ileovesical > colovesical. 93% of ileovesical fistulae occur in men (Ben-Ami et al.)",
    { fontSize:11, color:C.navy, fontFace:"Calibri", valign:"middle", margin:7 }
  );

  // Clinical Features & Diagnosis
  s.addShape(pres.shapes.RECTANGLE, { x:6.2, y:1.25, w:6.75, h:0.42, fill:{color:C.slate}, line:{color:C.slate}, rectRadius:0.04 });
  s.addText("CLINICAL FEATURES", { x:6.2, y:1.25, w:6.75, h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });

  const clinF = [
    ["Pneumaturia", "Passage of gas per urethra — PATHOGNOMONIC"],
    ["Fecaluria", "Passage of faecal debris in urine"],
    ["Vesical irritability", "Frequency, dysuria, haematuria"],
    ["Bowel changes", "Constipation, diarrhoea, abdominal distension"],
    ["Infection", "Mixed bacterial urinary infection (polymicrobial)"],
  ];
  clinF.forEach(([k,v],i)=>{
    const iy = 1.75+i*0.62;
    s.addShape(pres.shapes.RECTANGLE, {x:6.2,y:iy,w:6.75,h:0.55, fill:{color:i%2===0?"FFFFFF":"F0F9FB"}, line:{color:"D0E8EC"}});
    s.addText([{text:k+": ",options:{bold:true,color:C.teal}},{text:v,options:{color:C.navy}}], {
      x:6.35,y:iy,w:6.5,h:0.55, fontSize:11.5, fontFace:"Calibri", valign:"middle"
    });
  });

  // Investigation
  s.addShape(pres.shapes.RECTANGLE, { x:6.2, y:4.93, w:6.75, h:0.38, fill:{color:C.teal}, line:{color:C.teal} });
  s.addText("INVESTIGATION & TREATMENT", { x:6.2, y:4.93, w:6.75, h:0.38, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });

  s.addText([
    {text:"CT/MRI: ", options:{bold:true, color:C.teal}},
    {text:"CT triad — bladder wall thickening, adjacent bowel mass, air in bladder\n", options:{color:C.navy}},
    {text:"Cystoscopy: ", options:{bold:true, color:C.teal}},
    {text:"Localised inflammation, bowel contents exuding, tract catheterisation\n", options:{color:C.navy}},
    {text:"Treatment: ", options:{bold:true, color:C.teal}},
    {text:"Bowel resection + primary anastomosis + bladder repair (treat underlying cause)", options:{color:C.navy}},
  ], { x:6.2, y:5.35, w:6.75, h:1.8, fontSize:11.5, fontFace:"Calibri", valign:"top", margin:8, fill:{color:"FFFFFF"}, line:{color:"D0E8EC"} });

  // CT image small
  s.addImage({ data: images[2].base64, x:0.35, y:6.35, w:2.5, h:1.0 });

  addSlideNum(s, 6);
}

// ─────────────────────────────────────────────────────────
// SLIDE 7 — Ureterovaginal & Urethrovaginal Fistulae
// ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:C.offWhite}, line:{color:C.offWhite} });
  addHeader(s, "Ureterovaginal & Urethrovaginal Fistulae", "Common post-surgical complications presenting as urinary incontinence");

  // Ureterovaginal — left
  s.addShape(pres.shapes.RECTANGLE, {x:0.35,y:1.25,w:6.0,h:0.42, fill:{color:C.teal}, line:{color:C.teal}, rectRadius:0.04});
  s.addText("URETEROVAGINAL FISTULA", {x:0.35,y:1.25,w:6.0,h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle"});

  const uvfData = [
    ["Aetiology", "Iatrogenic ureteric injury during hysterectomy, colorectal surgery, caesarean section"],
    ["Presentation", "Delayed — ongoing incontinence after surgery (ureter continues to drain urine)"],
    ["Diagnosis", "Double-dye test: IV methylene blue + clamp Foley → orange pad = ureteral fistula\nCT urogram + retrograde ureterography + cystoscopy"],
    ["Treatment (1st)", "Ureteral stent or percutaneous nephrostomy (antegrade stent) for 4–8 weeks"],
    ["Treatment (2nd)", "Surgical: wait 6 weeks (inflammation); ureteroneocystostomy, Boari flap, ileal ureter"],
  ];
  uvfData.forEach(([k,v],i)=>{
    const iy = 1.75+i*0.88;
    s.addShape(pres.shapes.RECTANGLE, {x:0.35,y:iy,w:6.0,h:0.8, fill:{color:i%2===0?"FFFFFF":"F0F9FB"}, line:{color:"D0E8EC"}});
    s.addText([{text:k+":\n",options:{bold:true,color:C.teal}},{text:v,options:{color:C.navy}}], {
      x:0.5,y:iy+0.04,w:5.7,h:0.72, fontSize:11, fontFace:"Calibri", valign:"top"
    });
  });

  // Urethrovaginal — right
  s.addShape(pres.shapes.RECTANGLE, {x:7.0,y:1.25,w:5.95,h:0.42, fill:{color:C.slate}, line:{color:C.slate}, rectRadius:0.04});
  s.addText("URETHROVAGINAL FISTULA", {x:7.0,y:1.25,w:5.95,h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle"});

  const urethvagData = [
    ["Aetiology", "Anterior vaginal wall surgery, sling procedures, urethral diverticulectomy"],
    ["Distal", "Often ASYMPTOMATIC"],
    ["Proximal", "Intermittent or CONSTANT urinary leakage"],
    ["Diagnosis", "VCUG (Voiding Cystourethrogram) — investigation of choice\nMay be difficult to visualise on PE or cystoscopy"],
    ["Treatment", "Interpositional tissue flap (Martius) almost always required — relative lack of connective tissue in mid/distal urethra"],
  ];
  urethvagData.forEach(([k,v],i)=>{
    const iy = 1.75+i*0.88;
    s.addShape(pres.shapes.RECTANGLE, {x:7.0,y:iy,w:5.95,h:0.8, fill:{color:i%2===0?"FFFFFF":"F5F6FA"}, line:{color:"C8D0DE"}});
    s.addText([{text:k+":\n",options:{bold:true,color:C.slate}},{text:v,options:{color:C.navy}}], {
      x:7.15,y:iy+0.04,w:5.65,h:0.72, fontSize:11, fontFace:"Calibri", valign:"top"
    });
  });

  // Key differentiation box
  addCard(s, 0.35, 6.45, 12.6, 0.7, C.lightGold,
    "KEY: Double-dye test differentiates VVF from ureterovaginal fistula — Orange = ureteral leak; Blue (deep pad) = VVF; Both = coexisting. VCUG is gold standard for urethrovaginal fistula.",
    { fontSize:12, color:C.navy, fontFace:"Calibri", valign:"middle", margin:8 }
  );

  addSlideNum(s, 7);
}

// ─────────────────────────────────────────────────────────
// SLIDE 8 — Rectourethral & Urethrocutaneous Fistulae
// ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:C.offWhite}, line:{color:C.offWhite} });
  addHeader(s, "Rectourethral & Urethrocutaneous Fistulae", "Surgical complications with significant morbidity");

  // Rectourethral left
  s.addShape(pres.shapes.RECTANGLE, {x:0.35,y:1.25,w:6.0,h:0.42, fill:{color:C.teal}, line:{color:C.teal}, rectRadius:0.04});
  s.addText("RECTOURETHRAL FISTULA (RUF)", {x:0.35,y:1.25,w:6.0,h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle"});

  const rufData = [
    ["Most common cause", "Surgical treatment of prostate cancer (radical prostatectomy, cryotherapy, HIFU, radiotherapy)"],
    ["Clinical features", "Passage of urine per rectum · Faecal contamination of urine · Recurrent UTI"],
    ["Diagnosis", "VCUG (Voiding Cystourethrogram) — confirmatory"],
    ["Conservative Rx", "Foley catheter drainage (selected patients with small RUF)"],
    ["Surgical Rx (non-irradiated)", "Repair with low morbidity; colostomy rarely needed (<6%)"],
    ["Surgical Rx (irradiated)", "86% require permanent colostomy; 93% require permanent urinary diversion"],
  ];
  rufData.forEach(([k,v],i)=>{
    const iy = 1.75+i*0.75;
    s.addShape(pres.shapes.RECTANGLE, {x:0.35,y:iy,w:6.0,h:0.67, fill:{color:i%2===0?"FFFFFF":"F0F9FB"}, line:{color:"D0E8EC"}});
    s.addText([{text:k+":\n",options:{bold:true,color:C.teal}},{text:v,options:{color:C.navy}}], {
      x:0.5,y:iy+0.03,w:5.7,h:0.61, fontSize:11, fontFace:"Calibri", valign:"top"
    });
  });

  addCard(s, 0.35, 6.42, 6.0, 0.72, C.lightRed,
    "⚠  Radiation/ablation-related RUF: far higher morbidity. Most require permanent stoma + urinary diversion.",
    { fontSize:11.5, color:C.red, fontFace:"Calibri", valign:"middle", bold:true, margin:7 }
  );

  // Urethrocutaneous right
  s.addShape(pres.shapes.RECTANGLE, {x:7.0,y:1.25,w:5.95,h:0.42, fill:{color:C.slate}, line:{color:C.slate}, rectRadius:0.04});
  s.addText("URETHROCUTANEOUS FISTULA", {x:7.0,y:1.25,w:5.95,h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle"});

  const ucfData = [
    ["Most common cause", "Most common complication of hypospadias repair (~10% incidence)"],
    ["Pathogenesis", "Ischaemia, oedema, infection, haematoma, overlapping suture lines, meatal stenosis"],
    ["\"Watering-can perineum\"", "Multiple fistulae from periurethral abscess complicating urethral stricture"],
    ["Location", "Most common at original meatal site or coronal margin"],
    ["Presentation", "Double urine stream; noticed by parent or at toilet training"],
    ["Pre-op workup", "Bougie à boule calibration + urethroscopy + saline stress test"],
    ["Treatment timing", "Delay repair 6–12 months after initial hypospadias repair"],
    ["Technique", "Small: excise tract + multilayer closure. Large/coronal: island or trap-door flap"],
  ];
  ucfData.forEach(([k,v],i)=>{
    const iy = 1.75+i*0.58;
    s.addShape(pres.shapes.RECTANGLE, {x:7.0,y:iy,w:5.95,h:0.51, fill:{color:i%2===0?"FFFFFF":"F5F6FA"}, line:{color:"C8D0DE"}});
    s.addText([{text:k+": ",options:{bold:true,color:C.slate}},{text:v,options:{color:C.navy}}], {
      x:7.15,y:iy,w:5.65,h:0.51, fontSize:10.5, fontFace:"Calibri", valign:"middle"
    });
  });

  addSlideNum(s, 8);
}

// ─────────────────────────────────────────────────────────
// SLIDE 9 — Diagnostic Algorithm & Key Tests
// ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:C.offWhite}, line:{color:C.offWhite} });
  addHeader(s, "Diagnostic Algorithm & Key Tests", "Step-by-step approach to urinary fistula workup");

  // Flow chart style
  const steps = [
    { step:"1", label:"Presenting complaint", desc:"Continuous vaginal urinary leakage OR pneumaturia/fecaluria OR post-surgical incontinence", color:C.teal },
    { step:"2", label:"Urinalysis + Urine culture", desc:"Pyuria + mixed flora → enterovesical; simple infection → secondary cause", color:C.slate },
    { step:"3", label:"Three-swab / Double-dye test", desc:"Swab 1 blue = VVF · Swab 1 not blue = ureterovaginal · Orange = ureteral · VCUG for urethral", color:C.teal },
    { step:"4", label:"CT Urogram / MRI", desc:"Localise tract · Identify bladder wall thickening + air + adjacent bowel mass for enterovesical · Ureteric injury", color:C.slate },
    { step:"5", label:"Cystoscopy ± EUA ± Retrograde pyelography", desc:"Confirm site, size, proximity to ureters · Biopsy if prior malignancy · Catheterise tract", color:C.teal },
    { step:"6", label:"VCUG (if urethral fistula suspected)", desc:"Gold standard for urethrovaginal and rectourethral fistulae", color:C.slate },
  ];

  steps.forEach((item, i) => {
    const row = Math.floor(i/3);
    const col = i % 3;
    const x = 0.35 + col * 4.3;
    const y = 1.3 + row * 2.5;

    // Number circle
    s.addShape(pres.shapes.OVAL, { x:x, y:y, w:0.5, h:0.5, fill:{color:item.color}, line:{color:item.color} });
    s.addText(item.step, { x:x, y:y, w:0.5, h:0.5, fontSize:14, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });

    // Card
    s.addShape(pres.shapes.RECTANGLE, { x:x+0.6, y:y, w:3.55, h:1.95, fill:{color:"FFFFFF"}, line:{color:"D0E8EC"},
      shadow:{type:"outer",color:"000000",blur:4,offset:2,angle:135,opacity:0.08} });
    s.addText([
      {text:item.label+"\n", options:{bold:true, color:item.color, fontSize:12}},
      {text:item.desc, options:{color:C.navy, fontSize:11}}
    ], { x:x+0.7, y:y+0.07, w:3.35, h:1.8, fontFace:"Calibri", valign:"top" });

    // Arrow (except last in each row)
    if (col < 2) {
      s.addShape(pres.shapes.RECTANGLE, { x:x+4.2, y:y+0.2, w:0.1, h:0.12, fill:{color:C.teal}, line:{color:C.teal} });
    }
  });

  // Key mnemonic box
  addCard(s, 0.35, 6.4, 12.6, 0.72, C.navy,
    "REMEMBER: Three-swab test (localise VVF) · Double-dye (VVF vs Ureteral) · VCUG (Urethrovaginal/Rectourethral) · CT Urogram (Ureterovaginal + enterovesical)",
    { fontSize:12.5, color:C.white, fontFace:"Calibri", valign:"middle", bold:false, margin:10 }
  );

  addSlideNum(s, 9);
}

// ─────────────────────────────────────────────────────────
// SLIDE 10 — Summary Table & High-Yield Points
// ─────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:13.3,h:7.5, fill:{color:C.navy}, line:{color:C.navy} });
  // teal accent
  s.addShape(pres.shapes.RECTANGLE, { x:0,y:0,w:0.35,h:7.5, fill:{color:C.teal}, line:{color:C.teal} });
  // Title
  s.addText("SUMMARY — High-Yield Points for Exams", {
    x:0.5, y:0.12, w:12.5, h:0.7,
    fontSize:22, bold:true, color:C.white, fontFace:"Calibri"
  });
  s.addShape(pres.shapes.RECTANGLE, { x:0.5, y:0.82, w:12.5, h:0.05, fill:{color:C.teal}, line:{color:C.teal} });

  // Table header
  const cols = ["Fistula", "Most Common Cause", "Cardinal Symptom", "Key Investigation", "Treatment"];
  const colW = [2.1, 2.7, 2.5, 2.45, 2.55];
  let cx = 0.4;
  cols.forEach((c,i)=>{
    s.addShape(pres.shapes.RECTANGLE, {x:cx,y:0.93,w:colW[i]-0.05,h:0.42, fill:{color:C.teal}, line:{color:C.teal}});
    s.addText(c, {x:cx+0.05,y:0.93,w:colW[i]-0.1,h:0.42, fontSize:10.5, bold:true, color:C.white, fontFace:"Calibri", valign:"middle"});
    cx += colW[i];
  });

  // Table rows
  const rows = [
    ["VVF", "Obstetric (developing) / Hysterectomy (developed)", "Constant vaginal urine leak", "Three-swab test + Cystoscopy", "Multilayer repair + Martius flap"],
    ["Vesicointestinal", "Diverticulitis 65–75%", "Pneumaturia + Fecaluria", "CT (air in bladder)", "Bowel resection + bladder repair"],
    ["Ureterovaginal", "Pelvic surgery (hysterectomy)", "Post-op incontinence", "CT urogram + Double-dye test", "Stent → Ureteroneocystostomy"],
    ["Urethrovaginal", "Anterior vaginal surgery / sling", "Proximal: constant leak", "VCUG", "Interpositional flap"],
    ["Rectourethral", "Prostate cancer treatment", "Urine per rectum", "VCUG", "Repair ± colostomy / diversion"],
    ["Urethrocutaneous", "Hypospadias repair (~10%)", "Double urine stream", "Stress test / urethroscopy", "Delayed closure at 6–12 months"],
  ];

  rows.forEach((row,ri)=>{
    const rowY = 1.4 + ri * 0.8;
    const bg = ri%2===0 ? "152840" : "0D2137";
    let rx = 0.4;
    row.forEach((cell,ci)=>{
      s.addShape(pres.shapes.RECTANGLE, {x:rx,y:rowY,w:colW[ci]-0.05,h:0.73, fill:{color:bg}, line:{color:"1A3A54"}});
      s.addText(cell, {x:rx+0.06,y:rowY+0.03,w:colW[ci]-0.12,h:0.67, fontSize:10, color: ci===0?"8ED8E8":"D0E8F0", fontFace:"Calibri", valign:"middle", bold:ci===0});
      rx += colW[ci];
    });
  });

  // Bottom gold strip — key mnemonics
  s.addShape(pres.shapes.RECTANGLE, {x:0.4,y:6.3,w:12.55,h:0.05, fill:{color:C.gold}, line:{color:C.gold}});
  addCard(s, 0.4, 6.4, 12.55, 0.82, "0F2A42",
    "Key mnemonics: VVF = most common urinary fistula · Pneumaturia = enterovesical · Double-dye test = VVF vs Ureteral · VCUG = urethrovaginal/rectourethral · Martius flap = workhorse repair · Delay hypospadias fistula repair 6–12 months",
    { fontSize:11, color:C.tealLight, fontFace:"Calibri", valign:"middle", margin:8 }
  );

  addSlideNum(s, 10);
}

// Write file
pres.writeFile({ fileName: "/home/daytona/workspace/urology-fistula-ppt/Urological_Fistulae_MBBS.pptx" })
  .then(() => console.log("DONE"))
  .catch(e => { console.error(e); process.exit(1); });
Running Command

cd /home/daytona/workspace/urology-fistula-ppt && node make_ppt.js

Running Command

cd /home/daytona/workspace/urology-fistula-ppt && node /home/daytona/skills/shar…

Running Command

node /home/daytona/skills/shared/scripts/fetch_images.js "https://cdn.orris.care…

Editing File

~/urology-fistula-ppt/make_ppt.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/urology-fistula-ppt/make_ppt.js'
Editing File

~/urology-fistula-ppt/make_ppt.js

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

cd /home/daytona/workspace/urology-fistula-ppt && node make_ppt.js

Running Command

ls -lh /home/daytona/workspace/urology-fistula-ppt/Urological_Fistulae_MBBS.pptx

Your presentation is ready (3.7 MB):

Urological Fistulae MBBS

Presentation · PPTX


Here's what's in each of the 10 slides (wide 16:9 format, deep navy/teal medical theme):
SlideContent
1Title slide with Goh/Waaldijk classification diagram as background art
2Definition + Classification table (Vesical / Ureteral / Urethral / Vascular)
3VVF Aetiology - Developing world vs Developed world (side-by-side)
4VVF Clinical Features + All 5 Investigations (Three-swab, double-dye, CT, cystoscopy, VCUG) with CT image
5VVF Classification (Goh + Waaldijk diagram) + Surgical Principles + Tissue Flaps
6Vesicointestinal Fistula - Causes bar chart + Pneumaturia/Fecaluria + CT triad
7Ureterovaginal vs Urethrovaginal fistula side-by-side comparison
8Rectourethral fistula (post-prostate cancer Rx, irradiation morbidity) + Urethrocutaneous / hypospadias
9Diagnostic Algorithm - 6-step flowchart with colour coding
10Dark summary table - all 6 fistula types with cause, symptom, investigation, treatment + key mnemonics
This is a shared conversation. Sign in to Orris to start your own chat.