Make a presentation on Abnormal uterine bleeding for BHMS intern according to give fromat

Asking for Preferences
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Searching Images

abnormal uterine bleeding PALM-COEIN classification diagram

Finding Sources
Reading File
Searching Images

uterine fibroids leiomyoma ultrasound diagnosis

Reading File
Reading File
Searching Images

endometrial polyp hysteroscopy uterine bleeding

Reading File
Running Command

mkdir -p /home/daytona/workspace/aub-presentation && ls /home/daytona/workspace/aub-presentation/

Writing File

~/aub-presentation/create_pptx.js

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

// ─── Fetch images ───────────────────────────────────────────────────────────
const imageUrls = [
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_bc39d681a989c4cc38dbcfc024ed23707d507abeda6354b75ce9879c5f44ea80.jpg",  // hysteroscopy 6-panel
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_80bdb6baa494aaccf975d4551f3c2e95e3480bd240ef394b827eba5b04097d53.jpg",  // fibroid US
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_1db3a4c56dc8d4022907983cbdb2b3773e7bbd81fe3d7c754419c5eb1f9e8f38.jpg",  // endometrial polyp hysteroscopy
];

let imgs = [];
try {
  imgs = JSON.parse(
    execSync(
      `node /home/daytona/skills/shared/scripts/fetch_images.js "${imageUrls[0]}" "${imageUrls[1]}" "${imageUrls[2]}"`
    ).toString()
  );
} catch (e) {
  console.error("Image fetch failed:", e.message);
}

// ─── Presentation setup ─────────────────────────────────────────────────────
let pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Abnormal Uterine Bleeding";
pres.author = "BHMS Intern Lecture";
pres.subject = "Gynaecology";

// ─── Color palette ──────────────────────────────────────────────────────────
const C = {
  darkPurple:   "2D1B4E",  // dominant background for title/section slides
  midPurple:    "4B2D8A",
  accent:       "C9305E",  // hot-pink accent (headers, bullets)
  accentLight:  "F472B6",
  gold:         "F0B93B",  // highlight accent
  lightBg:      "F8F4FF",  // body slide background
  white:        "FFFFFF",
  darkText:     "1A0A2E",
  mutedText:    "5A4A7A",
  teal:         "0EA5A0",
  green:        "22C55E",
  orange:       "F97316",
  red:          "EF4444",
  blue:         "3B82F6",
  yellow:       "FCD34D",
};

// ─── Helper functions ────────────────────────────────────────────────────────
function addTitleSlide(pres, title, subtitle) {
  const slide = pres.addSlide();
  // Background gradient via large rect
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkPurple } });
  // Decorative accent bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.18, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.44, w: 10, h: 0.18, fill: { color: C.accent } });
  // Decorative circles
  slide.addShape(pres.ShapeType.ellipse, { x: -0.5, y: -0.5, w: 3, h: 3, fill: { color: C.midPurple }, line: { color: C.midPurple } });
  slide.addShape(pres.ShapeType.ellipse, { x: 8.2, y: 3.5, w: 2.2, h: 2.2, fill: { color: C.midPurple }, line: { color: C.midPurple } });
  slide.addShape(pres.ShapeType.ellipse, { x: 7, y: -0.3, w: 1.2, h: 1.2, fill: { color: C.accent }, line: { color: C.accent } });

  // Title text
  slide.addText(title, {
    x: 0.6, y: 1.5, w: 8.8, h: 1.5,
    fontSize: 40, bold: true, color: C.white,
    align: "center", valign: "middle", fontFace: "Calibri",
  });
  // Subtitle
  slide.addText(subtitle, {
    x: 0.6, y: 3.2, w: 8.8, h: 0.7,
    fontSize: 18, color: C.accentLight,
    align: "center", fontFace: "Calibri",
  });
  // Bottom label
  slide.addText("BHMS Internship | Gynaecology & Obstetrics", {
    x: 0.6, y: 4.6, w: 8.8, h: 0.4,
    fontSize: 13, color: C.gold, align: "center", fontFace: "Calibri",
  });
}

function addSectionSlide(pres, sectionTitle) {
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.midPurple } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 2.5, w: 0.12, h: 1.0, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.12, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.ellipse, { x: 7.5, y: 0.3, w: 3.2, h: 3.2, fill: { color: C.darkPurple }, line: { color: C.darkPurple } });
  slide.addText(sectionTitle, {
    x: 0.5, y: 1.8, w: 9, h: 1.4,
    fontSize: 34, bold: true, color: C.white,
    align: "center", fontFace: "Calibri",
  });
  return slide;
}

function addBodySlide(pres, title, bullets, opts = {}) {
  const slide = pres.addSlide();
  // Background
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg } });
  // Left accent bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.accent } });
  // Top header bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.95, fill: { color: C.darkPurple } });
  // Title
  slide.addText(title, {
    x: 0.2, y: 0.05, w: 9.5, h: 0.85,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri",
    valign: "middle", margin: 8,
  });
  // Slide number dot (decorative)
  slide.addShape(pres.ShapeType.ellipse, { x: 9.5, y: 0.22, w: 0.38, h: 0.38, fill: { color: C.accent }, line: { color: C.accent } });

  if (opts.twoCol && bullets.length > 0) {
    const half = Math.ceil(bullets.length / 2);
    const col1 = bullets.slice(0, half);
    const col2 = bullets.slice(half);
    const toRich = (arr) => arr.flatMap((b, i) => {
      const items = [];
      if (b.heading) {
        items.push({ text: b.heading, options: { bold: true, color: C.accent, bullet: { color: C.accent }, breakLine: true, fontSize: 12 } });
        (b.points || []).forEach((p, j) => items.push({ text: p, options: { bullet: { color: C.midPurple }, color: C.darkText, breakLine: j < b.points.length - 1 || i < arr.length - 1, fontSize: 11 } }));
      } else {
        items.push({ text: b, options: { bullet: { color: C.accent }, color: C.darkText, breakLine: i < arr.length - 1, fontSize: 12 } });
      }
      return items;
    });
    slide.addText(toRich(col1), { x: 0.25, y: 1.05, w: 4.6, h: 4.4, valign: "top", fontFace: "Calibri", lineSpacingMultiple: 1.2 });
    slide.addText(toRich(col2), { x: 5.1, y: 1.05, w: 4.7, h: 4.4, valign: "top", fontFace: "Calibri", lineSpacingMultiple: 1.2 });
  } else {
    const richText = bullets.flatMap((b, i) => {
      if (b.heading) {
        const items = [{ text: b.heading, options: { bold: true, color: C.accent, bullet: { color: C.accent }, breakLine: true, fontSize: opts.fontSize || 13 } }];
        (b.points || []).forEach((p, j) => items.push({ text: p, options: { bullet: { color: C.midPurple, indent: 20 }, color: C.darkText, breakLine: true, fontSize: (opts.fontSize || 13) - 1 } }));
        return items;
      }
      return [{ text: b, options: { bullet: { color: C.accent }, color: C.darkText, breakLine: i < bullets.length - 1, fontSize: opts.fontSize || 13 } }];
    });
    slide.addText(richText, {
      x: 0.25, y: 1.05, w: opts.textW || 9.55, h: opts.textH || 4.4,
      valign: "top", fontFace: "Calibri", lineSpacingMultiple: 1.25,
    });
  }
  return slide;
}

function addBodySlideWithImage(pres, title, bullets, imgData, imgPos, fontSize = 12) {
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.95, fill: { color: C.darkPurple } });
  slide.addText(title, { x: 0.2, y: 0.05, w: 9.5, h: 0.85, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 8 });
  slide.addShape(pres.ShapeType.ellipse, { x: 9.5, y: 0.22, w: 0.38, h: 0.38, fill: { color: C.accent }, line: { color: C.accent } });

  const richText = bullets.flatMap((b, i) => {
    if (b.heading) {
      const items = [{ text: b.heading, options: { bold: true, color: C.accent, bullet: { color: C.accent }, breakLine: true, fontSize } }];
      (b.points || []).forEach(p => items.push({ text: p, options: { bullet: { color: C.midPurple, indent: 15 }, color: C.darkText, breakLine: true, fontSize: fontSize - 1 } }));
      return items;
    }
    return [{ text: b, options: { bullet: { color: C.accent }, color: C.darkText, breakLine: i < bullets.length - 1, fontSize } }];
  });
  slide.addText(richText, { x: 0.25, y: 1.05, w: imgPos.textW, h: 4.4, valign: "top", fontFace: "Calibri", lineSpacingMultiple: 1.2 });
  if (imgData && !imgData.error) {
    slide.addImage({ data: imgData.base64, x: imgPos.x, y: imgPos.y, w: imgPos.w, h: imgPos.h });
    // Image caption
    if (imgPos.caption) {
      slide.addText(imgPos.caption, { x: imgPos.x, y: imgPos.y + imgPos.h + 0.05, w: imgPos.w, h: 0.22, fontSize: 8, color: C.mutedText, align: "center", italic: true, fontFace: "Calibri" });
    }
  }
  return slide;
}

function addTableSlide(pres, title, headers, rows, colWidths) {
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.95, fill: { color: C.darkPurple } });
  slide.addText(title, { x: 0.2, y: 0.05, w: 9.5, h: 0.85, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 8 });

  const tableData = [
    headers.map(h => ({ text: h, options: { bold: true, color: C.white, fill: C.midPurple, fontSize: 12, align: "center", fontFace: "Calibri" } })),
    ...rows.map((row, ri) =>
      row.map(cell => ({ text: cell, options: { color: C.darkText, fill: ri % 2 === 0 ? "EFE8FF" : C.white, fontSize: 11, fontFace: "Calibri" } }))
    ),
  ];
  slide.addTable(tableData, {
    x: 0.2, y: 1.05, w: 9.6, colW: colWidths,
    border: { type: "solid", color: "CDB8F0", pt: 0.5 },
    rowH: 0.4,
  });
  return slide;
}

// ─── SLIDE 1: Title ─────────────────────────────────────────────────────────
addTitleSlide(pres,
  "Abnormal Uterine Bleeding (AUB)",
  "Classification · Causes · Evaluation · Management"
);

// ─── SLIDE 2: Learning Objectives ───────────────────────────────────────────
addBodySlide(pres, "Learning Objectives", [
  "Define abnormal uterine bleeding (AUB) and normal menstrual parameters",
  "Apply the FIGO PALM-COEIN classification system to categorize AUB",
  "Recognize age-specific causes of AUB across the reproductive lifespan",
  "Conduct a structured history, examination, and investigation for AUB",
  "Outline medical and surgical management options for AUB",
  "Identify when to investigate for endometrial hyperplasia / malignancy",
  "Understand the Homoeopathic approach in managing AUB",
]);

// ─── SLIDE 3: Definition & Normal Menstrual Parameters ──────────────────────
addBodySlide(pres, "Definition & Normal Menstrual Parameters", [
  {
    heading: "Definition of AUB",
    points: [
      "Bleeding from the uterine corpus that is irregular in volume, frequency, or duration",
      "Occurs in the absence of pregnancy",
      "Overarching term that replaces older labels (menorrhagia, metrorrhagia, DUB)",
    ],
  },
  {
    heading: "Normal Menstrual Cycle (WHO / FIGO)",
    points: [
      "Frequency: every 24–38 days",
      "Duration: 4–8 days",
      "Volume: ≤ 30 mL average; > 80 mL = heavy menstrual bleeding (HMB)",
      "Menarche: 12–13 years (range 10–16); Menopause: ~51 years",
    ],
  },
  {
    heading: "Terminology replaced by AUB",
    points: [
      "Menorrhagia → AUB-HMB (heavy/prolonged at regular intervals)",
      "Metrorrhagia → AUB-IMB (intermenstrual bleeding)",
      "Menometrorrhagia → AUB-HMB + IMB",
      "Dysfunctional Uterine Bleeding (DUB) → AUB-O (ovulatory dysfunction)",
    ],
  },
]);

// ─── SLIDE 4: Section – PALM-COEIN ──────────────────────────────────────────
addSectionSlide(pres, "FIGO PALM-COEIN Classification (2011)");

// ─── SLIDE 5: PALM-COEIN Overview ───────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.95, fill: { color: C.darkPurple } });
  slide.addText("PALM-COEIN Classification System", {
    x: 0.2, y: 0.05, w: 9.5, h: 0.85, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 8,
  });

  // PALM box
  slide.addShape(pres.ShapeType.roundRect, { x: 0.25, y: 1.1, w: 4.55, h: 4.3, fill: { color: "EDE0FF" }, line: { color: C.midPurple, pt: 2 }, rectRadius: 0.15 });
  slide.addText("🏗  STRUCTURAL — PALM", { x: 0.35, y: 1.15, w: 4.35, h: 0.45, fontSize: 14, bold: true, color: C.darkPurple, fontFace: "Calibri" });

  const palmItems = [
    { letter: "P", word: "Polyp", detail: "Endometrial / cervical polyps" },
    { letter: "A", word: "Adenomyosis", detail: "Ectopic endometrial glands in myometrium" },
    { letter: "L", word: "Leiomyoma", detail: "Submucosal fibroids most symptomatic" },
    { letter: "M", word: "Malignancy / Hyperplasia", detail: "Endometrial ca / pre-malignant change" },
  ];
  palmItems.forEach((item, i) => {
    const y = 1.7 + i * 0.85;
    slide.addShape(pres.ShapeType.ellipse, { x: 0.4, y: y + 0.08, w: 0.42, h: 0.42, fill: { color: C.midPurple }, line: { color: C.midPurple } });
    slide.addText(item.letter, { x: 0.4, y: y + 0.08, w: 0.42, h: 0.42, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    slide.addText(item.word, { x: 0.9, y: y, w: 1.4, h: 0.3, fontSize: 13, bold: true, color: C.darkPurple, fontFace: "Calibri" });
    slide.addText(item.detail, { x: 0.9, y: y + 0.3, w: 3.8, h: 0.3, fontSize: 10, color: C.mutedText, fontFace: "Calibri" });
  });

  // COEIN box
  slide.addShape(pres.ShapeType.roundRect, { x: 5.2, y: 1.1, w: 4.55, h: 4.3, fill: { color: "FFF0F5" }, line: { color: C.accent, pt: 2 }, rectRadius: 0.15 });
  slide.addText("💊  NON-STRUCTURAL — COEIN", { x: 5.3, y: 1.15, w: 4.35, h: 0.45, fontSize: 13, bold: true, color: C.accent, fontFace: "Calibri" });

  const coeinItems = [
    { letter: "C", word: "Coagulopathy", detail: "von Willebrand disease, platelet disorders" },
    { letter: "O", word: "Ovulatory Dysfunction", detail: "Anovulation, PCOS, thyroid disease" },
    { letter: "E", word: "Endometrial", detail: "Primary endometrial disorder" },
    { letter: "I", word: "Iatrogenic", detail: "OCP, IUD, anticoagulants, SSRIs" },
    { letter: "N", word: "Not otherwise classified", detail: "AVM, myometrial hypertrophy" },
  ];
  coeinItems.forEach((item, i) => {
    const y = 1.7 + i * 0.72;
    slide.addShape(pres.ShapeType.ellipse, { x: 5.35, y: y + 0.06, w: 0.38, h: 0.38, fill: { color: C.accent }, line: { color: C.accent } });
    slide.addText(item.letter, { x: 5.35, y: y + 0.06, w: 0.38, h: 0.38, fontSize: 13, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
    slide.addText(item.word, { x: 5.8, y: y, w: 1.8, h: 0.28, fontSize: 12, bold: true, color: C.darkPurple, fontFace: "Calibri" });
    slide.addText(item.detail, { x: 5.8, y: y + 0.28, w: 3.8, h: 0.26, fontSize: 9.5, color: C.mutedText, fontFace: "Calibri" });
  });
}

// ─── SLIDE 6: Age-wise causes ────────────────────────────────────────────────
addTableSlide(pres, "AUB — Causes by Age Group",
  ["Age Group", "Common Causes"],
  [
    ["Prepuberty", "Precocious puberty (hypothalamic / pituitary / ovarian)"],
    ["Adolescence (Menarche)", "Anovulatory cycles, coagulation disorders (von Willebrand disease)"],
    ["Reproductive Age (18–40)", "Complications of pregnancy, leiomyoma, adenomyosis, polyps, PCOS, DUB"],
    ["Perimenopause (40–50)", "Anovulatory cycles, endometrial hyperplasia, ovulatory dysfunction"],
    ["Postmenopause (> 50)", "Endometrial atrophy (most common), endometrial carcinoma, polyps"],
  ],
  [2.5, 7.1]
);

// ─── SLIDE 7: Structural causes (PALM) ──────────────────────────────────────
addBodySlide(pres, "Structural Causes — PALM in Detail", [
  {
    heading: "P — Polyps",
    points: [
      "Endometrial or cervical; most common in multiparous women aged 40–50",
      "Friable, prone to bleeding; often intermenstrual spotting",
    ],
  },
  {
    heading: "A — Adenomyosis",
    points: [
      "Endometrial glands & stroma within myometrium → bulky uterus",
      "Heavy, painful periods; definitive diagnosis on histology post-hysterectomy",
    ],
  },
  {
    heading: "L — Leiomyoma (Fibroids)",
    points: [
      "Submucosal fibroids: most symptomatic → increase endometrial surface area",
      "Prevent adequate uterine contractions → heavy, prolonged bleeding",
      "More common in Black women (2–3× higher incidence)",
    ],
  },
  {
    heading: "M — Malignancy & Hyperplasia",
    points: [
      "Endometrial hyperplasia: risk from unopposed estrogen (obesity, PCOS, anovulation)",
      "Endometrial carcinoma: 90% present with AUB; postmenopausal bleeding = red flag",
      "Biopsy indicated: age ≥ 45, failed medical therapy, or risk factors present",
    ],
  },
], { fontSize: 12 });

// ─── SLIDE 8: Non-Structural causes (COEIN) ──────────────────────────────────
addBodySlide(pres, "Non-Structural Causes — COEIN in Detail", [
  {
    heading: "C — Coagulopathy",
    points: [
      "Up to 20% of women with HMB have a coagulation disorder",
      "von Willebrand disease is most common; screen if heavy bleeding since menarche",
      "Screen for: postpartum haemorrhage, surgery/dental bleeding, family history",
    ],
  },
  {
    heading: "O — Ovulatory Dysfunction",
    points: [
      "~50% of AUB cases; anovulation → unopposed estrogen → endometrial instability",
      "Causes: PCOS, thyroid disorders, prolactin excess, obesity, malnutrition",
      "Most common at menarche & perimenopause (fluctuating HPO axis)",
    ],
  },
  {
    heading: "E — Endometrial",
    points: [
      "Primary endometrial disorder: impaired local haemostasis (prostaglandins, fibrinolysis)",
      "Chronic endometritis (e.g. chlamydia) can cause intermenstrual spotting",
    ],
  },
  {
    heading: "I — Iatrogenic",
    points: [
      "Hormonal contraceptives, IUDs (Cu-IUD), anticoagulants, SSRIs, tamoxifen, herbal supplements (ginseng)",
    ],
  },
  {
    heading: "N — Not Otherwise Classified",
    points: ["Arteriovenous malformation (AVM), myometrial hypertrophy"],
  },
], { fontSize: 12 });

// ─── SLIDE 9: Hysteroscopy image (structural causes visual) ──────────────────
{
  const imgData = imgs[0]; // 6-panel hysteroscopy
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.95, fill: { color: C.darkPurple } });
  slide.addText("Hysteroscopic Views of Common AUB Causes", {
    x: 0.2, y: 0.05, w: 9.5, h: 0.85, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 8,
  });

  if (imgData && !imgData.error) {
    slide.addImage({ data: imgData.base64, x: 0.3, y: 1.0, w: 9.4, h: 4.4, sizing: { type: "contain", w: 9.4, h: 4.4 } });
  }
  slide.addText("A: Polyp  |  B: Proliferative endometrium  |  C: Endometritis  |  D: Adenomyosis  |  E: Submucosal fibroid  |  F: Secretory endometrium", {
    x: 0.2, y: 5.35, w: 9.6, h: 0.22, fontSize: 9, color: C.mutedText, align: "center", italic: true, fontFace: "Calibri",
  });
}

// ─── SLIDE 10: Section – Evaluation ─────────────────────────────────────────
addSectionSlide(pres, "Clinical Evaluation of AUB");

// ─── SLIDE 11: History ───────────────────────────────────────────────────────
addBodySlide(pres, "History Taking in AUB", [
  {
    heading: "Menstrual History",
    points: [
      "Onset, duration, frequency, and amount of bleeding (pad/tampon count)",
      "Intermenstrual or postcoital bleeding",
      "Passage of clots (> 1 inch clot = significant HMB)",
      "Associated dysmenorrhoea, pelvic pain",
    ],
  },
  {
    heading: "Relevant History",
    points: [
      "Obstetric history (gravida/para), last menstrual period, pregnancy status",
      "Family history of bleeding disorders, gynaecological cancers",
      "Medications: OCP, anticoagulants, SSRIs, herbal supplements",
      "Sexual history, STI risk (cervicitis, endometritis)",
    ],
  },
  {
    heading: "Systemic Review",
    points: [
      "Thyroid symptoms (hypo/hyperthyroidism)",
      "Signs of androgen excess: acne, hirsutism (PCOS)",
      "Easy bruising, epistaxis, gum bleeding → coagulopathy screen",
      "Galactorrhoea → hyperprolactinaemia",
    ],
  },
], { fontSize: 12 });

// ─── SLIDE 12: Examination ───────────────────────────────────────────────────
addBodySlide(pres, "Physical Examination", [
  {
    heading: "General Examination",
    points: [
      "Haemodynamic stability (pulse, BP) — vital in acute AUB",
      "Pallor, signs of anaemia",
      "BMI, hirsutism, acne (PCOS), galactorrhoea",
      "Petechiae, purpura, ecchymosis → coagulopathy",
    ],
  },
  {
    heading: "Abdominal Examination",
    points: [
      "Uterine enlargement (fibroids, adenomyosis)",
      "Masses, tenderness",
    ],
  },
  {
    heading: "Pelvic / Speculum Examination",
    points: [
      "Inspect vulva, vaginal walls, cervix",
      "Cervical polyps, erosions, discharge",
      "Cervical os — presence of products of conception",
    ],
  },
  {
    heading: "Bimanual Examination",
    points: [
      "Uterine size, shape, consistency, tenderness",
      "Adnexal masses or tenderness",
      "Fixed uterus → endometriosis / PID",
    ],
  },
], { fontSize: 12 });

// ─── SLIDE 13: Investigations ────────────────────────────────────────────────
addBodySlide(pres, "Investigations", [
  {
    heading: "First-line (All patients)",
    points: [
      "Urine pregnancy test (exclude pregnancy-related bleeding)",
      "Complete Blood Count (CBC) — haemoglobin, platelet count",
      "Thyroid function tests (TSH)",
      "Serum prolactin (if anovulation suspected)",
      "Coagulation profile: PT, aPTT, BT, von Willebrand factor (if HMB since menarche)",
    ],
  },
  {
    heading: "Imaging",
    points: [
      "Transvaginal ultrasound (TVUS) — first-line imaging: endometrial thickness, fibroids, polyps",
      "Sonohysterography (SIS) — better delineation of intracavitary lesions",
      "MRI — adenomyosis, precise fibroid mapping",
    ],
  },
  {
    heading: "Endometrial Sampling (Biopsy)",
    points: [
      "Indicated: age ≥ 45, persistent/refractory AUB, obesity + anovulation, family history of endometrial Ca",
      "Pipelle biopsy — office procedure, 95% sensitivity for Ca",
      "Hysteroscopy + D&C — gold standard for intracavitary lesions",
    ],
  },
  {
    heading: "Cervical Screening",
    points: ["Pap smear / cervical cytology if not up to date", "STI screen (chlamydia) if indicated"],
  },
], { fontSize: 12 });

// ─── SLIDE 14: Ultrasound image ──────────────────────────────────────────────
{
  const imgData = imgs[1]; // fibroid TVUS
  addBodySlideWithImage(pres,
    "Imaging — Ultrasound Findings in AUB",
    [
      {
        heading: "Transvaginal Ultrasound (TVUS)",
        points: [
          "First-line imaging modality for AUB",
          "Endometrial thickness > 4 mm (postmenopausal) warrants biopsy",
          "Fibroids: hypoechoic, well-circumscribed myometrial mass",
          "Polyps: echogenic focal lesion within endometrial cavity",
          "Adenomyosis: asymmetric uterine enlargement, myometrial cysts",
        ],
      },
      {
        heading: "Saline Infusion Sonohysterography (SIS)",
        points: [
          "Better for submucosal fibroid / polyp assessment",
          "Cavity distension with saline improves contrast",
        ],
      },
      {
        heading: "Normal Endometrial Thickness",
        points: [
          "Proliferative phase: 4–8 mm",
          "Secretory phase: 8–14 mm",
          "Postmenopausal: ≤ 4 mm",
        ],
      },
    ],
    imgData,
    { x: 5.4, y: 1.1, w: 4.35, h: 3.5, textW: 5.1, caption: "TVUS: Uterine leiomyoma (fibroid) with caliper measurements" },
    11
  );
}

// ─── SLIDE 15: Section – Management ─────────────────────────────────────────
addSectionSlide(pres, "Management of AUB");

// ─── SLIDE 16: Medical Management ───────────────────────────────────────────
addBodySlide(pres, "Medical Management of AUB", [
  {
    heading: "Hormonal Therapy",
    points: [
      "Combined Oral Contraceptives (COC) — regulates cycle, reduces flow by 40–50%",
      "Cyclic Progestins (medroxyprogesterone acetate) — anovulatory AUB",
      "Levonorgestrel IUS (Mirena) — reduces flow by 80–90%; most effective medical option",
      "Depo-Provera (DMPA injection) — amenorrhoea in many users",
      "GnRH Agonists — preoperative downsizing of fibroids; short-term use (6 months)",
    ],
  },
  {
    heading: "Non-Hormonal Therapy",
    points: [
      "Tranexamic Acid (antifibrinolytic) — 1.3 g TDS × 3–5 days of menses; FDA approved for HMB; reduces flow by ~50%",
      "NSAIDs (Mefenamic acid, Ibuprofen) — reduce flow by ~30%; also treat dysmenorrhoea",
      "Iron supplementation — treat concurrent iron-deficiency anaemia",
    ],
  },
  {
    heading: "Specific Conditions",
    points: [
      "Thyroid/prolactin disorders → treat underlying cause first",
      "Coagulopathy → haematology referral, tranexamic acid",
      "PCOS → weight loss, OCP, metformin (if insulin resistant)",
    ],
  },
], { fontSize: 12 });

// ─── SLIDE 17: Surgical Management ──────────────────────────────────────────
addBodySlide(pres, "Surgical Management of AUB", [
  {
    heading: "Minimally Invasive Procedures",
    points: [
      "Hysteroscopic Polypectomy — treatment of choice for endometrial / cervical polyps",
      "Endometrial Ablation — destroys endometrial lining; ≈ 80–90% patient satisfaction",
      "Note: 29% of ablation patients required hysterectomy by 60 months (RCT data)",
    ],
  },
  {
    heading: "Fibroid-specific Surgery",
    points: [
      "Hysteroscopic Myomectomy — submucosal fibroids; preserves fertility",
      "Laparoscopic / Open Myomectomy — intramural / subserosal fibroids",
      "Uterine Artery Embolization (UAE) — 31% require hysterectomy by 5 years",
    ],
  },
  {
    heading: "Hysterectomy — Definitive Treatment",
    points: [
      "Reserved for patients failing medical therapy or not desiring fertility",
      "Absolute cure for AUB; requires informed consent",
      "Indications: refractory AUB, adenomyosis, uterine malignancy",
      "Endometrial biopsy must be performed before hysterectomy",
    ],
  },
  {
    heading: "D&C (Dilation & Curettage)",
    points: [
      "Diagnostic (not therapeutic) — NOT effective as standalone treatment for HMB",
    ],
  },
], { fontSize: 12 });

// ─── SLIDE 18: Management Algorithm ─────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightBg } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.95, fill: { color: C.darkPurple } });
  slide.addText("AUB Management Algorithm", {
    x: 0.2, y: 0.05, w: 9.5, h: 0.85, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle", margin: 8,
  });

  // Box helper
  const box = (slide, x, y, w, h, text, fillColor, textColor, fontSize = 10.5) => {
    slide.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill: { color: fillColor }, line: { color: fillColor }, rectRadius: 0.1 });
    slide.addText(text, { x, y, w, h, fontSize, bold: true, color: textColor, align: "center", valign: "middle", fontFace: "Calibri" });
  };
  const arrow = (slide, x1, y1, x2, y2) => {
    slide.addShape(pres.ShapeType.line, { x: x1, y: y1, w: x2 - x1, h: y2 - y1, line: { color: C.mutedText, width: 1.5, endArrowType: "arrow" } });
  };

  box(slide, 3.5, 1.0, 3.0, 0.5, "AUB Confirmed", C.darkPurple, C.white, 12);
  arrow(slide, 5.0, 1.5, 5.0, 1.85);
  box(slide, 3.5, 1.85, 3.0, 0.45, "Exclude Pregnancy + Pelvic Exam", C.midPurple, C.white, 9.5);
  arrow(slide, 5.0, 2.3, 5.0, 2.6);
  box(slide, 3.5, 2.6, 3.0, 0.45, "Investigations\n(CBC, TFT, TVUS, Biopsy)", C.teal, C.white, 9.5);

  // Arrow left
  slide.addShape(pres.ShapeType.line, { x: 3.5, y: 2.82, w: -1.8, h: 0.6, line: { color: C.mutedText, width: 1.5, endArrowType: "arrow" } });
  box(slide, 0.4, 3.3, 2.6, 0.5, "Structural Cause\n(PALM)", C.orange, C.white, 10);
  slide.addText("Surgical /\nMinimally Invasive", { x: 0.4, y: 3.85, w: 2.6, h: 0.5, fontSize: 9, color: C.darkText, align: "center", fontFace: "Calibri" });

  // Arrow right
  slide.addShape(pres.ShapeType.line, { x: 6.5, y: 2.82, w: 1.8, h: 0.6, line: { color: C.mutedText, width: 1.5, endArrowType: "arrow" } });
  box(slide, 7.0, 3.3, 2.6, 0.5, "Non-Structural\n(COEIN)", C.blue, C.white, 10);
  slide.addText("Medical Therapy\nFirst", { x: 7.0, y: 3.85, w: 2.6, h: 0.5, fontSize: 9, color: C.darkText, align: "center", fontFace: "Calibri" });

  // Down arrows from both
  arrow(slide, 1.7, 4.35, 1.7, 4.65);
  arrow(slide, 8.3, 4.35, 8.3, 4.65);
  box(slide, 0.4, 4.65, 2.6, 0.5, "Failed → Hysterectomy", C.accent, C.white, 9.5);
  box(slide, 7.0, 4.65, 2.6, 0.5, "Failed → Surgical", C.accent, C.white, 9.5);

  // Central bottom
  arrow(slide, 5.0, 3.05, 5.0, 3.3);
  box(slide, 3.5, 3.3, 3.0, 0.5, "Endometrial Biopsy\n(if indicated)", C.green, C.white, 9.5);
}

// ─── SLIDE 19: Postmenopausal Bleeding ───────────────────────────────────────
addBodySlide(pres, "Postmenopausal Bleeding — Special Consideration", [
  "Any bleeding after 12 months of amenorrhoea = postmenopausal bleeding (PMB)",
  "NOT included in PALM-COEIN — managed separately as its own diagnosis",
  {
    heading: "Causes (in order of frequency)",
    points: [
      "1. Endometrial/vaginal atrophy — thinning due to oestrogen deficiency (most common)",
      "2. Endometrial polyps",
      "3. Endometrial hyperplasia",
      "4. Endometrial carcinoma — 90% of cases present with PMB",
      "5. Cervical pathology, fibroids, HRT use",
    ],
  },
  {
    heading: "Red Flags (urgent investigation)",
    points: [
      "Age > 60, BMI > 35, nulliparity, diabetes, hypertension, Lynch syndrome",
      "Endometrial thickness > 4 mm (postmenopausal) → mandatory biopsy",
    ],
  },
  {
    heading: "Management",
    points: [
      "TVUS → endometrial thickness assessment",
      "Pipelle biopsy / Hysteroscopy + D&C for histology",
      "Treat underlying cause (atrophy → topical oestrogen; cancer → surgery ± chemo/radio)",
    ],
  },
], { fontSize: 12 });

// ─── SLIDE 20: Section – Homoeopathic Approach ───────────────────────────────
addSectionSlide(pres, "Homoeopathic Approach to AUB");

// ─── SLIDE 21: Homoeopathic Management ──────────────────────────────────────
addBodySlide(pres, "Homoeopathic Approach to AUB — BHMS Perspective", [
  {
    heading: "Holistic Assessment",
    points: [
      "Complete case-taking: physical generals, mentals, modalities, and concomitants",
      "Miasmatic background: Psora (functional), Sycosis (growths/polyps), Syphilis (destructive/malignant)",
      "Identify the susceptibility and totality of symptoms",
    ],
  },
  {
    heading: "Key Remedies for AUB (indicative — based on totality)",
    points: [
      "Calcarea Carb — profuse, early, prolonged menses; obesity; chilly patient",
      "Phosphorus — bright red, profuse; tall, thin, sympathetic; clotting tendency",
      "Trillium Pendulum — profuse bright red bleeding; gushing on movement",
      "Sabina — bright red, clotted; fibroid uterus; pain radiating to pubis",
      "Ustilago — dark, stringy clots; profuse menorrhagia; fibroids",
      "Sepia — irregular, scanty menses; dragging bearing-down sensation",
      "China / Ferrum Met — after excessive blood loss; weakness, anaemia",
    ],
  },
  {
    heading: "Role of Homoeopathy",
    points: [
      "Complementary role in functional AUB (anovulatory, ovulatory, PCOS-related)",
      "Must refer serious cases (malignancy, structural causes requiring surgery)",
      "Understand limitations and scope — always rule out life-threatening pathology first",
    ],
  },
], { fontSize: 11.5 });

// ─── SLIDE 22: Summary / Key Points ─────────────────────────────────────────
{
  const slide = pres.addSlide();
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkPurple } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.12, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.5, w: 10, h: 0.12, fill: { color: C.accent } });
  slide.addShape(pres.ShapeType.ellipse, { x: 8.0, y: 0.2, w: 2.5, h: 2.5, fill: { color: C.midPurple }, line: { color: C.midPurple } });

  slide.addText("Key Takeaways", {
    x: 0.5, y: 0.2, w: 7.0, h: 0.7, fontSize: 26, bold: true, color: C.white, fontFace: "Calibri",
  });

  const keyPoints = [
    "AUB = any uterine bleeding irregular in volume, frequency, or duration (non-pregnant).",
    "PALM-COEIN (2011 FIGO) is the standard classification — structural vs. non-structural.",
    "Exclude pregnancy first in any woman of reproductive age presenting with AUB.",
    "Up to 20% of HMB have coagulopathy (von Willebrand); screen appropriately.",
    "Endometrial biopsy is mandatory in women ≥ 45 or with risk factors.",
    "Postmenopausal bleeding = endometrial carcinoma until proven otherwise.",
    "Medical therapy first (OCP, progestins, tranexamic acid, LNG-IUS) before surgery.",
    "Hysteroscopy is the gold standard for diagnosing intracavitary lesions.",
    "As a BHMS intern, always exclude serious organic pathology before prescribing.",
  ];

  const richPoints = keyPoints.flatMap((pt, i) => [
    { text: `${i + 1}. `, options: { bold: true, color: C.gold, fontSize: 12, fontFace: "Calibri" } },
    { text: pt, options: { color: C.white, fontSize: 12, breakLine: i < keyPoints.length - 1, fontFace: "Calibri" } },
  ]);

  slide.addText(richPoints, {
    x: 0.5, y: 1.0, w: 9.0, h: 4.4, valign: "top", lineSpacingMultiple: 1.3, fontFace: "Calibri",
  });
}

// ─── SLIDE 23: References ─────────────────────────────────────────────────────
addBodySlide(pres, "References", [
  "Munro MG et al. FIGO classification system (PALM-COEIN) for causes of AUB in nongravid women. Int J Gynaecol Obstet. 2011;113(1):3–13.",
  "Tintinalli's Emergency Medicine: A Comprehensive Study Guide, 9th ed. (Ch. 96 — AUB). McGraw-Hill.",
  "Sabiston Textbook of Surgery, 21st ed. (Ch. 120 — Uterine Surgery). Elsevier.",
  "Berek & Novak's Gynecology, 16th ed. (Ch. 10 — Abnormal Uterine Bleeding). LWW.",
  "Robbins & Kumar Basic Pathology, 10th ed. (Ch. 17 — Female Genital Tract). Elsevier.",
  "Rosen's Emergency Medicine, 9th ed. (Ch. 30 — Vaginal Bleeding). Elsevier.",
  "ACOG Practice Bulletin No. 128: Diagnosis of Abnormal Uterine Bleeding in Reproductive-Aged Women. 2012.",
  "Allen RH & Cwiak C. Contraception for the Medically Challenging Patient. Springer, 2014.",
], { fontSize: 11 });

// ─── Write file ──────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/aub-presentation/Abnormal_Uterine_Bleeding_BHMS.pptx" })
  .then(() => console.log("DONE: File written successfully."))
  .catch(err => console.error("Error writing file:", err));
You've run out of free credits. Sign up for a free account to continue using Orris.
This is a shared conversation. Sign in to Orris to start your own chat.