Abnormal uterine bleeding ppt
mkdir -p /home/daytona/workspace/aub-pptx
~/aub-pptx/create_aub.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Orris Medical";
pres.title = "Abnormal Uterine Bleeding";
// ─── DESIGN PALETTE ─────────────────────────────────────────────────────────
const C = {
deepPlum: "4A1942", // dominant dark - titles, header bars
midPlum: "7B2D6B", // supporting accent
dustyRose: "C4758E", // accent
cream: "F7F1F0", // slide background
white: "FFFFFF",
charcoal: "2D2D2D",
steel: "5A6072",
lightPink: "F2D9E3",
paleBlue: "E8EEF5",
gold: "C9A84C",
};
const FONT = "Calibri";
// ─── HELPER: header bar ──────────────────────────────────────────────────────
function addHeader(slide, title) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 0.72,
fill: { color: C.deepPlum },
line: { color: C.deepPlum },
});
slide.addText(title, {
x: 0.25, y: 0, w: 9.5, h: 0.72,
fontSize: 20, bold: true, color: C.white, fontFace: FONT,
valign: "middle",
});
}
// accent left bar
function addLeftBar(slide, color) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0.72, w: 0.12, h: 4.9,
fill: { color: color || C.midPlum },
line: { color: color || C.midPlum },
});
}
// ─── SLIDE BACKGROUND ───────────────────────────────────────────────────────
function setBg(slide, color) {
slide.background = { color: color || C.cream };
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 1 – TITLE SLIDE
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.deepPlum };
// Decorative shapes
s.addShape(pres.ShapeType.rect, { x: 0, y: 4.2, w: 10, h: 1.42, fill: { color: C.midPlum }, line: { color: C.midPlum } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 4.75, w: 10, h: 0.875, fill: { color: C.dustyRose }, line: { color: C.dustyRose } });
s.addShape(pres.ShapeType.ellipse, { x: 7.5, y: -1, w: 4, h: 4, fill: { color: "5C1F53", transparency: 40 }, line: { color: "5C1F53", transparency: 40 } });
s.addText("ABNORMAL UTERINE BLEEDING", {
x: 0.5, y: 1.1, w: 9, h: 1.4,
fontSize: 36, bold: true, color: C.white, fontFace: FONT,
align: "center", charSpacing: 2,
});
s.addText("AUB — Classification, Diagnosis & Management", {
x: 0.5, y: 2.6, w: 9, h: 0.6,
fontSize: 18, color: C.lightPink, fontFace: FONT, align: "center", italic: true,
});
s.addText("For Medical Students | Gynecology & Obstetrics", {
x: 0.5, y: 4.85, w: 9, h: 0.5,
fontSize: 13, color: C.white, fontFace: FONT, align: "center",
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 2 – LEARNING OBJECTIVES
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "Learning Objectives");
addLeftBar(s);
const objectives = [
"Define abnormal uterine bleeding (AUB) and distinguish it from normal menstruation",
"Apply the PALM-COEIN classification system to categorize causes of AUB",
"Describe the pathophysiology of anovulatory and ovulatory AUB",
"Outline a systematic approach to history, examination, and investigation",
"Discuss medical and surgical management options based on etiology",
"Recognize special populations: adolescents, reproductive age, perimenopausal, and postmenopausal",
];
const items = objectives.map((o, i) => [
{ text: `${i + 1}`, options: { bold: true, color: C.white, highlight: C.midPlum } },
{ text: ` ${o}`, options: { color: C.charcoal } },
]).flat();
// Render as numbered list
const textArr = objectives.map((o, i) => ({
text: ` ${i + 1}. ${o}`,
options: { breakLine: true, color: C.charcoal, fontSize: 14.5, fontFace: FONT, paraSpaceAfter: 4 },
}));
textArr[textArr.length - 1].options.breakLine = false;
s.addText(textArr, { x: 0.35, y: 0.9, w: 9.3, h: 4.5 });
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 3 – WHAT IS NORMAL?
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "Normal Menstruation — The Baseline");
addLeftBar(s, C.dustyRose);
// Two-column boxes
const colW = 4.2;
const rowData = [
["Parameter", "Normal Range"],
["Cycle length", "24 – 38 days"],
["Duration of flow", "4 – 8 days"],
["Average blood loss", "35 mL per cycle"],
["Upper limit of normal", "80 mL per cycle"],
["Prolonged bleeding", "> 7 days is abnormal"],
];
const xStart = 0.35;
const yStart = 0.85;
const rowH = 0.55;
rowData.forEach(([left, right], idx) => {
const y = yStart + idx * rowH;
const isHeader = idx === 0;
const bg = isHeader ? C.deepPlum : idx % 2 === 0 ? C.lightPink : C.white;
const textCol = isHeader ? C.white : C.charcoal;
s.addShape(pres.ShapeType.rect, { x: xStart, y, w: colW, h: rowH, fill: { color: bg }, line: { color: "D5C0CB" } });
s.addShape(pres.ShapeType.rect, { x: xStart + colW + 0.05, y, w: colW, h: rowH, fill: { color: bg }, line: { color: "D5C0CB" } });
s.addText(left, { x: xStart + 0.1, y: y + 0.05, w: colW - 0.2, h: rowH - 0.1, fontSize: 13.5, bold: isHeader, color: textCol, fontFace: FONT, valign: "middle" });
s.addText(right, { x: xStart + colW + 0.15, y: y + 0.05, w: colW - 0.2, h: rowH - 0.1, fontSize: 13.5, bold: isHeader, color: textCol, fontFace: FONT, valign: "middle" });
});
s.addText("Any deviation from these parameters constitutes Abnormal Uterine Bleeding (AUB)", {
x: 0.35, y: 4.3, w: 9.3, h: 0.7,
fontSize: 13, italic: true, color: C.midPlum, fontFace: FONT, align: "center",
fill: { color: "F0E4EC" }, margin: 6,
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 4 – PALM-COEIN (overview)
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s, C.cream);
addHeader(s, "PALM-COEIN Classification System (FIGO 2011)");
// PALM box
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.85, w: 4.4, h: 3.8, fill: { color: C.deepPlum }, line: { color: C.deepPlum }, rectRadius: 0.1 });
s.addText("PALM — Structural", { x: 0.4, y: 0.9, w: 4.2, h: 0.5, fontSize: 15, bold: true, color: C.gold, fontFace: FONT, align: "center" });
const palmItems = [
{ letter: "P", label: "Polyp", sub: "AUB-P" },
{ letter: "A", label: "Adenomyosis", sub: "AUB-A" },
{ letter: "L", label: "Leiomyoma", sub: "AUB-L (SM/O)" },
{ letter: "M", label: "Malignancy / Hyperplasia", sub: "AUB-M" },
];
palmItems.forEach((item, i) => {
const y = 1.5 + i * 0.72;
s.addShape(pres.ShapeType.ellipse, { x: 0.5, y: y - 0.02, w: 0.38, h: 0.38, fill: { color: C.gold }, line: { color: C.gold } });
s.addText(item.letter, { x: 0.5, y: y - 0.02, w: 0.38, h: 0.38, fontSize: 13, bold: true, color: C.deepPlum, fontFace: FONT, align: "center", valign: "middle" });
s.addText(`${item.label}`, { x: 1.0, y: y, w: 2.6, h: 0.32, fontSize: 13, bold: true, color: C.white, fontFace: FONT });
s.addText(`${item.sub}`, { x: 3.6, y: y, w: 0.9, h: 0.32, fontSize: 10.5, color: C.lightPink, fontFace: FONT, align: "right" });
});
// COEIN box
s.addShape(pres.ShapeType.rect, { x: 5.1, y: 0.85, w: 4.6, h: 4.65, fill: { color: C.midPlum }, line: { color: C.midPlum }, rectRadius: 0.1 });
s.addText("COEIN — Non-Structural", { x: 5.2, y: 0.9, w: 4.4, h: 0.5, fontSize: 15, bold: true, color: C.gold, fontFace: FONT, align: "center" });
const coeinItems = [
{ letter: "C", label: "Coagulopathy", sub: "AUB-C" },
{ letter: "O", label: "Ovulatory Dysfunction", sub: "AUB-O" },
{ letter: "E", label: "Endometrial", sub: "AUB-E" },
{ letter: "I", label: "Iatrogenic", sub: "AUB-I" },
{ letter: "N", label: "Not Yet Classified", sub: "AUB-N" },
];
coeinItems.forEach((item, i) => {
const y = 1.5 + i * 0.72;
s.addShape(pres.ShapeType.ellipse, { x: 5.25, y: y - 0.02, w: 0.38, h: 0.38, fill: { color: C.gold }, line: { color: C.gold } });
s.addText(item.letter, { x: 5.25, y: y - 0.02, w: 0.38, h: 0.38, fontSize: 13, bold: true, color: C.midPlum, fontFace: FONT, align: "center", valign: "middle" });
s.addText(`${item.label}`, { x: 5.75, y: y, w: 2.7, h: 0.32, fontSize: 13, bold: true, color: C.white, fontFace: FONT });
s.addText(`${item.sub}`, { x: 8.5, y: y, w: 1.0, h: 0.32, fontSize: 10.5, color: C.lightPink, fontFace: FONT, align: "right" });
});
s.addText("Structural causes (PALM) are identified by imaging or histology; Non-structural (COEIN) are functional/medical", {
x: 0.3, y: 5.2, w: 9.4, h: 0.3,
fontSize: 10, italic: true, color: C.steel, fontFace: FONT, align: "center",
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 5 – STRUCTURAL CAUSES (PALM) detail
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "Structural Causes (PALM) — Key Points");
addLeftBar(s, C.deepPlum);
const causes = [
{
title: "Polyps (AUB-P)",
text: "Focal overgrowths of endometrial stroma and glands. Common in multiparous women in their 40s–50s. Friable → intermenstrual spotting.",
},
{
title: "Adenomyosis (AUB-A)",
text: "Endometrial glands & stroma within the myometrium. Causes heavy, painful menstruation (dysmenorrhea). Uterus is uniformly enlarged & tender.",
},
{
title: "Leiomyoma / Fibroids (AUB-L)",
text: "Benign smooth muscle tumors. Submucosal fibroids are the most symptomatic — increased surface area prevents uterine contraction. 2–3× more common in Black women.",
},
{
title: "Malignancy & Hyperplasia (AUB-M)",
text: "Endometrial hyperplasia (due to unopposed estrogen) → risk of adenocarcinoma. Any postmenopausal bleeding must be evaluated to exclude malignancy.",
},
];
causes.forEach((item, i) => {
const y = 0.85 + i * 1.1;
s.addShape(pres.ShapeType.rect, {
x: 0.3, y, w: 9.4, h: 0.98,
fill: { color: i % 2 === 0 ? "F8EBF2" : C.white },
line: { color: "D5C0CB" },
});
s.addText(item.title, { x: 0.45, y: y + 0.06, w: 2.5, h: 0.38, fontSize: 13, bold: true, color: C.deepPlum, fontFace: FONT });
s.addShape(pres.ShapeType.line, { x: 2.95, y: y + 0.06, w: 0, h: 0.86, line: { color: C.dustyRose, width: 1.5 } });
s.addText(item.text, { x: 3.1, y: y + 0.06, w: 6.4, h: 0.86, fontSize: 12.5, color: C.charcoal, fontFace: FONT, valign: "middle" });
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 6 – NON-STRUCTURAL CAUSES (COEIN)
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "Non-Structural Causes (COEIN) — Key Points");
addLeftBar(s, C.midPlum);
const causes = [
{
title: "Coagulopathy (AUB-C)",
text: "Inherited (von Willebrand disease) or acquired. Suspect if heavy bleeding since menarche, family history, or systemic bleeding signs (epistaxis, bruising).",
},
{
title: "Ovulatory Dysfunction (AUB-O)",
text: "Most common non-structural cause (~50% of AUB). Anovulation → no corpus luteum → no progesterone → unopposed estrogen → unstable endometrium. Common in PCOS, adolescence, perimenopause.",
},
{
title: "Endometrial (AUB-E)",
text: "Normal hormones but primary endometrial disorder: altered prostaglandin ratio, decreased plasminogen activator inhibitor, or chronic endometritis.",
},
{
title: "Iatrogenic (AUB-I)",
text: "Medications: anticoagulants, antipsychotics (↑ prolactin → anovulation), intrauterine devices, hormone therapy, tamoxifen.",
},
];
causes.forEach((item, i) => {
const y = 0.85 + i * 1.1;
s.addShape(pres.ShapeType.rect, {
x: 0.3, y, w: 9.4, h: 0.98,
fill: { color: i % 2 === 0 ? "EEE4F5" : C.white },
line: { color: "C0B0D8" },
});
s.addText(item.title, { x: 0.45, y: y + 0.06, w: 2.6, h: 0.38, fontSize: 13, bold: true, color: C.midPlum, fontFace: FONT });
s.addShape(pres.ShapeType.line, { x: 3.05, y: y + 0.06, w: 0, h: 0.86, line: { color: C.dustyRose, width: 1.5 } });
s.addText(item.text, { x: 3.2, y: y + 0.06, w: 6.3, h: 0.86, fontSize: 12.5, color: C.charcoal, fontFace: FONT, valign: "middle" });
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 7 – AUB BY AGE GROUP
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "AUB by Age Group");
addLeftBar(s, C.gold);
const ageData = [
{ age: "Prepubertal", color: "E8D5F0", tcolor: C.deepPlum, causes: "Precocious puberty (hypothalamic, pituitary, or ovarian origin)" },
{ age: "Adolescence", color: "D6EAF8", tcolor: "1A5276", causes: "Anovulatory cycles (HPO axis immaturity), coagulation disorders (von Willebrand)" },
{ age: "Reproductive Age", color: "D5F5E3", tcolor: "1E8449", causes: "Pregnancy complications, PCOS, fibroids, polyps, endometriosis, coagulopathy, iatrogenic" },
{ age: "Perimenopause", color: "FDEBD0", tcolor: "784212", causes: "Anovulatory cycles (declining ovarian reserve), endometrial hyperplasia, fibroids" },
{ age: "Postmenopause", color: "FADBD8", tcolor: "922B21", causes: "Endometrial atrophy (most common), malignancy (must exclude), polyps, exogenous hormone use" },
];
ageData.forEach((row, i) => {
const y = 0.82 + i * 0.92;
s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 2.4, h: 0.8, fill: { color: row.color }, line: { color: "CCCCCC" } });
s.addText(row.age, { x: 0.35, y, w: 2.3, h: 0.8, fontSize: 13, bold: true, color: row.tcolor, fontFace: FONT, align: "center", valign: "middle" });
s.addShape(pres.ShapeType.rect, { x: 2.7, y, w: 6.95, h: 0.8, fill: { color: C.white }, line: { color: "CCCCCC" } });
s.addText(row.causes, { x: 2.85, y, w: 6.75, h: 0.8, fontSize: 12, color: C.charcoal, fontFace: FONT, valign: "middle" });
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 8 – PATHOPHYSIOLOGY (anovulatory)
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "Pathophysiology of Anovulatory AUB");
addLeftBar(s, C.dustyRose);
// Flow diagram - simple box-arrow sequence
const steps = [
{ text: "No ovulation\n(Anovulation)", x: 0.4 },
{ text: "No corpus luteum\nforms", x: 2.45 },
{ text: "No progesterone\nsecretion", x: 4.5 },
{ text: "Unopposed\nestrogen", x: 6.55 },
{ text: "Endometrial\nbreakdown", x: 8.3 },
];
steps.forEach((step, i) => {
const bx = step.x;
const by = 1.5;
s.addShape(pres.ShapeType.rect, { x: bx, y: by, w: 1.75, h: 0.9, fill: { color: C.deepPlum }, line: { color: C.deepPlum }, rectRadius: 0.08 });
s.addText(step.text, { x: bx, y: by, w: 1.75, h: 0.9, fontSize: 11, color: C.white, fontFace: FONT, align: "center", valign: "middle" });
if (i < steps.length - 1) {
s.addShape(pres.ShapeType.line, { x: bx + 1.75, y: by + 0.45, w: 0.7, h: 0, line: { color: C.gold, width: 2 } });
}
});
// Causes of anovulation
s.addText("Common Causes of Anovulation:", {
x: 0.35, y: 2.65, w: 9.3, h: 0.4,
fontSize: 14, bold: true, color: C.deepPlum, fontFace: FONT,
});
const anovCauses = [
{ cat: "Endocrine", detail: "PCOS (most common), hyperprolactinemia (pituitary tumors → ↓ GnRH → ↓ LH/FSH), thyroid disorders" },
{ cat: "Ovarian", detail: "Granulosa cell tumors, diminished ovarian reserve, premature ovarian insufficiency" },
{ cat: "Systemic", detail: "Obesity, malnutrition, extreme exercise, chronic illness, stress" },
{ cat: "Physiologic", detail: "Adolescence (HPO axis immaturity), perimenopause (declining estrogen)" },
];
anovCauses.forEach((item, i) => {
const y = 3.15 + i * 0.55;
s.addShape(pres.ShapeType.rect, { x: 0.35, y, w: 1.6, h: 0.46, fill: { color: C.midPlum }, line: { color: C.midPlum } });
s.addText(item.cat, { x: 0.35, y, w: 1.6, h: 0.46, fontSize: 12, bold: true, color: C.white, fontFace: FONT, align: "center", valign: "middle" });
s.addText(item.detail, { x: 2.1, y, w: 7.6, h: 0.46, fontSize: 12, color: C.charcoal, fontFace: FONT, valign: "middle" });
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 9 – CLINICAL EVALUATION
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "Clinical Evaluation of AUB");
addLeftBar(s, C.steel);
const sections = [
{
title: "History",
color: "D6EAF8",
points: [
"Menstrual history: cycle length, duration, pad/tampon count, clots",
"Associated symptoms: pain, discharge, post-coital bleeding",
"Obstetric & contraceptive history",
"Medications (anticoagulants, antipsychotics, hormones)",
"Family history of bleeding disorders / endometrial cancer",
"Systemic symptoms: weight change, galactorrhea, heat/cold intolerance",
],
},
{
title: "Examination",
color: "D5F5E3",
points: [
"BMI, signs of hyperandrogenism (PCOS), thyroid exam",
"Pelvic examination: uterine size/tenderness, adnexal masses",
"Signs of coagulopathy: petechiae, ecchymoses",
],
},
];
const colW = 4.5;
sections.forEach((sec, col) => {
const x = 0.3 + col * 4.9;
s.addShape(pres.ShapeType.rect, { x, y: 0.82, w: colW, h: 4.65, fill: { color: sec.color }, line: { color: "AAAAAA" } });
s.addText(sec.title, { x: x + 0.1, y: 0.88, w: colW - 0.2, h: 0.42, fontSize: 14.5, bold: true, color: C.deepPlum, fontFace: FONT });
const txtArr = sec.points.map((p, pi) => ({
text: `• ${p}`,
options: { breakLine: pi < sec.points.length - 1, fontSize: 12.5, color: C.charcoal, fontFace: FONT, paraSpaceAfter: 5 },
}));
s.addText(txtArr, { x: x + 0.1, y: 1.38, w: colW - 0.2, h: 3.85 });
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 10 – INVESTIGATIONS
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "Investigations");
addLeftBar(s, C.gold);
// Three category boxes
const cats = [
{
title: "ALL Patients",
icon: "★",
color: C.deepPlum,
items: [
"Pregnancy test (β-hCG)",
"Full blood count (anemia)",
"Cervical cancer screening",
"STI screen (Chlamydia, GC)",
"Pelvic ultrasound (TVS)",
"Thyroid function (TSH)",
"Prolactin level",
],
},
{
title: "Selected Patients",
icon: "◆",
color: C.midPlum,
items: [
"Coagulation studies: if heavy bleeding since menarche, family Hx, or signs of systemic bleeding",
"Endometrial biopsy: age ≥45 with AUB; or <45 with risk factors (obesity, anovulation, unopposed estrogen, family Hx of cancer)",
"Hysteroscopy: confirm polyps, fibroid location",
"Sonohysterogram / MRI",
],
},
{
title: "Endometrial Biopsy — Indications",
icon: "✓",
color: "C0392B",
items: [
"Age ≥ 45 years with AUB",
"Any age with persistent AUB",
"Obesity + AUB (↑ estrogen from adipose)",
"PCOS with prolonged anovulation",
"Tamoxifen therapy",
"Failed medical management",
],
},
];
cats.forEach((cat, i) => {
const x = 0.22 + i * 3.27;
s.addShape(pres.ShapeType.rect, { x, y: 0.82, w: 3.1, h: 0.52, fill: { color: cat.color }, line: { color: cat.color } });
s.addText(`${cat.icon} ${cat.title}`, { x: x + 0.05, y: 0.82, w: 3.0, h: 0.52, fontSize: 13, bold: true, color: C.white, fontFace: FONT, align: "center", valign: "middle" });
s.addShape(pres.ShapeType.rect, { x, y: 1.34, w: 3.1, h: 4.12, fill: { color: "FAFAFA" }, line: { color: cat.color } });
const txtArr = cat.items.map((p, pi) => ({
text: `• ${p}`,
options: { breakLine: pi < cat.items.length - 1, fontSize: 12, color: C.charcoal, fontFace: FONT, paraSpaceAfter: 6 },
}));
s.addText(txtArr, { x: x + 0.08, y: 1.42, w: 2.95, h: 3.9 });
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 11 – MEDICAL MANAGEMENT
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "Medical Management of AUB");
addLeftBar(s, C.midPlum);
const drugs = [
{ drug: "Levonorgestrel-IUS", class: "Hormonal IUD", notes: "Most effective for heavy menstrual bleeding; reduces flow by 70–90%; also treats dysmenorrhea", badge: "1st Line" },
{ drug: "Combined OCP", class: "Estrogen + Progestin", notes: "Controls anovulatory bleeding; regulates cycle; also used for PCOS-related AUB", badge: "1st Line" },
{ drug: "Progestin (oral)", class: "Progestin-only", notes: "Norethisterone / Medroxyprogesterone; useful when estrogen is contraindicated; opposes estrogen effect on endometrium", badge: "Option" },
{ drug: "Tranexamic Acid", class: "Antifibrinolytic", notes: "Non-hormonal; reduces bleeding by 30–55%; take during menstruation only; does not affect ovulation", badge: "Option" },
{ drug: "NSAIDs", class: "Prostaglandin inhibitor", notes: "Mefenamic acid; reduces blood loss ~25%; effective for ovulatory AUB and dysmenorrhea; taken during menses", badge: "Adjunct" },
{ drug: "GnRH Agonists", class: "Hormone analog", notes: "Leuprolide; induces medical menopause; short-term use (6 months); used pre-surgically to shrink fibroids", badge: "Specialist" },
];
const headers = ["Drug / Agent", "Class", "Key Notes", "Status"];
const colWidths = [2.1, 1.7, 4.6, 1.1];
const colX = [0.25, 2.38, 4.11, 8.73];
// Header row
headers.forEach((h, ci) => {
s.addShape(pres.ShapeType.rect, { x: colX[ci], y: 0.82, w: colWidths[ci], h: 0.42, fill: { color: C.deepPlum }, line: { color: C.deepPlum } });
s.addText(h, { x: colX[ci] + 0.05, y: 0.82, w: colWidths[ci], h: 0.42, fontSize: 12.5, bold: true, color: C.white, fontFace: FONT, valign: "middle" });
});
drugs.forEach((row, ri) => {
const y = 1.26 + ri * 0.68;
const bg = ri % 2 === 0 ? "FAF0F5" : C.white;
const badgeColor = row.badge === "1st Line" ? "1A8C4E" : row.badge === "Option" ? C.midPlum : row.badge === "Adjunct" ? "C07A00" : C.steel;
[row.drug, row.class, row.notes, row.badge].forEach((cell, ci) => {
s.addShape(pres.ShapeType.rect, { x: colX[ci], y, w: colWidths[ci], h: 0.64, fill: { color: ci === 3 ? badgeColor : bg }, line: { color: "DDDDDD" } });
s.addText(cell, { x: colX[ci] + 0.05, y, w: colWidths[ci] - 0.1, h: 0.64, fontSize: ci === 3 ? 11 : 12, bold: ci === 0 || ci === 3, color: ci === 3 ? C.white : C.charcoal, fontFace: FONT, valign: "middle", align: ci === 3 ? "center" : "left" });
});
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 12 – SURGICAL MANAGEMENT
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "Surgical Management of AUB");
addLeftBar(s, C.deepPlum);
const surgeries = [
{
title: "Endometrial Ablation",
when: "Medical therapy failed; completed family; no malignancy",
detail: "Destroys endometrial lining. ~70% achieve amenorrhea or significant reduction. 29% still undergo hysterectomy by 5 years.",
risk: "Low",
},
{
title: "Hysteroscopic Polypectomy / Myomectomy",
when: "AUB-P (polyp) or AUB-LSM (submucosal fibroid)",
detail: "Removes specific lesion; fertility-sparing. Preferred first-line surgical approach for structural lesions.",
risk: "Low",
},
{
title: "Uterine Artery Embolization (UAE)",
when: "Symptomatic fibroids; desire uterine preservation",
detail: "Cuts blood supply to fibroids. ~31% eventually require hysterectomy. Preserves uterus but may affect fertility.",
risk: "Moderate",
},
{
title: "Hysterectomy",
when: "Failed all other treatments; completed family; intractable bleeding",
detail: "Definitive cure. Endometrial sampling MUST be done before surgery. Laparoscopic preferred over open when feasible.",
risk: "Higher",
},
];
surgeries.forEach((item, i) => {
const y = 0.88 + i * 1.14;
const riskColor = item.risk === "Low" ? "1A8C4E" : item.risk === "Moderate" ? "C07A00" : item.risk === "Higher" ? "C0392B" : C.steel;
s.addShape(pres.ShapeType.rect, { x: 0.28, y, w: 9.45, h: 1.05, fill: { color: i % 2 === 0 ? "F5EBF0" : C.white }, line: { color: "D5C0CB" } });
s.addShape(pres.ShapeType.rect, { x: 0.28, y, w: 0.18, h: 1.05, fill: { color: riskColor }, line: { color: riskColor } });
s.addText(item.title, { x: 0.55, y: y + 0.06, w: 2.9, h: 0.4, fontSize: 13, bold: true, color: C.deepPlum, fontFace: FONT });
s.addText(`Indication: ${item.when}`, { x: 0.55, y: y + 0.45, w: 3.1, h: 0.5, fontSize: 11, color: C.steel, fontFace: FONT, italic: true });
s.addShape(pres.ShapeType.line, { x: 3.7, y: y + 0.1, w: 0, h: 0.88, line: { color: C.dustyRose, width: 1 } });
s.addText(item.detail, { x: 3.85, y: y + 0.1, w: 5.6, h: 0.88, fontSize: 12, color: C.charcoal, fontFace: FONT, valign: "middle" });
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 13 – POSTMENOPAUSAL BLEEDING
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
setBg(s);
addHeader(s, "Postmenopausal Bleeding — Special Consideration");
addLeftBar(s, "C0392B");
s.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.85, w: 9.4, h: 0.58, fill: { color: "FADBD8" }, line: { color: "C0392B" } });
s.addText("ANY bleeding after 12 months of amenorrhea is considered ABNORMAL until proven otherwise — malignancy must be excluded", {
x: 0.45, y: 0.85, w: 9.1, h: 0.58,
fontSize: 13, bold: true, color: "922B21", fontFace: FONT, align: "center", valign: "middle",
});
const causes = [
["Most Common", "Endometrial atrophy", "Thinning of the endometrium & vaginal tissue due to estrogen deficiency → fragile vessels bleed easily"],
["2nd", "Endometrial polyps", "Often benign; present as intermittent spotting"],
["Must Exclude", "Endometrial carcinoma", "Risk factors: obesity, nulliparity, late menopause, unopposed estrogen, Lynch syndrome"],
["Other", "Exogenous hormones / HRT", "Breakthrough bleeding with hormone replacement therapy"],
["Other", "Cervical pathology", "Cervical polyps, atrophic vaginitis, cervical cancer"],
];
causes.forEach(([rank, cause, detail], i) => {
const y = 1.56 + i * 0.76;
const rColor = rank === "Must Exclude" ? "C0392B" : rank === "Most Common" ? "1A8C4E" : C.steel;
s.addShape(pres.ShapeType.rect, { x: 0.3, y, w: 1.35, h: 0.66, fill: { color: rColor }, line: { color: rColor } });
s.addText(rank, { x: 0.3, y, w: 1.35, h: 0.66, fontSize: 10.5, bold: true, color: C.white, fontFace: FONT, align: "center", valign: "middle" });
s.addShape(pres.ShapeType.rect, { x: 1.68, y, w: 2.1, h: 0.66, fill: { color: i % 2 === 0 ? "FAF0F5" : C.white }, line: { color: "CCCCCC" } });
s.addText(cause, { x: 1.75, y, w: 2.0, h: 0.66, fontSize: 12.5, bold: true, color: C.charcoal, fontFace: FONT, valign: "middle" });
s.addShape(pres.ShapeType.rect, { x: 3.81, y, w: 5.88, h: 0.66, fill: { color: i % 2 === 0 ? "FAF0F5" : C.white }, line: { color: "CCCCCC" } });
s.addText(detail, { x: 3.9, y, w: 5.68, h: 0.66, fontSize: 12, color: C.charcoal, fontFace: FONT, valign: "middle" });
});
}
// ────────────────────────────────────────────────────────────────────────────
// SLIDE 14 – SUMMARY / KEY TAKEAWAYS
// ────────────────────────────────────────────────────────────────────────────
{
const s = pres.addSlide();
s.background = { color: C.deepPlum };
s.addText("Key Takeaways", {
x: 0.5, y: 0.2, w: 9, h: 0.65,
fontSize: 26, bold: true, color: C.white, fontFace: FONT, align: "center",
});
s.addShape(pres.ShapeType.line, { x: 2.5, y: 0.88, w: 5, h: 0, line: { color: C.gold, width: 2 } });
const points = [
{ num: "1", text: "AUB = any bleeding deviating from normal menstrual parameters (cycle 24–38 days, flow 4–8 days, loss <80 mL)" },
{ num: "2", text: "Use PALM-COEIN to classify: PALM = structural (imaging/histology), COEIN = functional/non-structural" },
{ num: "3", text: "Anovulation (~50% of AUB) → no progesterone → unopposed estrogen → unstable, proliferative endometrium" },
{ num: "4", text: "Workup: pregnancy test, FBC, pelvic ultrasound, TSH, prolactin; add endometrial biopsy for patients ≥45 or with risk factors" },
{ num: "5", text: "Medical management first: LNG-IUS, combined OCP, progestins, tranexamic acid, NSAIDs" },
{ num: "6", text: "Surgery (ablation or hysterectomy) reserved for failed medical therapy; always biopsy before hysterectomy" },
{ num: "7", text: "Postmenopausal bleeding is ALWAYS abnormal — must exclude endometrial carcinoma" },
];
points.forEach((p, i) => {
const y = 1.05 + i * 0.62;
s.addShape(pres.ShapeType.ellipse, { x: 0.4, y: y + 0.04, w: 0.4, h: 0.4, fill: { color: C.gold }, line: { color: C.gold } });
s.addText(p.num, { x: 0.4, y: y + 0.04, w: 0.4, h: 0.4, fontSize: 13, bold: true, color: C.deepPlum, fontFace: FONT, align: "center", valign: "middle" });
s.addText(p.text, { x: 0.95, y, w: 8.7, h: 0.52, fontSize: 12.5, color: C.white, fontFace: FONT, valign: "middle" });
});
}
// ─── WRITE FILE ──────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/aub-pptx/Abnormal_Uterine_Bleeding.pptx" })
.then(() => console.log("✅ PPTX saved successfully"))
.catch(err => { console.error("❌ Error:", err); process.exit(1); });
cd /home/daytona/workspace/aub-pptx && node create_aub.js 2>&1
ls -lh /home/daytona/workspace/aub-pptx/
Abnormal Uterine Bleeding
Presentation · PPTX
| # | Slide | Content |
|---|---|---|
| 1 | Title | Styled cover with subtitle |
| 2 | Learning Objectives | 6 clear objectives for medical students |
| 3 | Normal Menstruation | Table of normal parameters (cycle, duration, blood loss) |
| 4 | PALM-COEIN Overview | Visual two-column layout of structural vs. non-structural causes |
| 5 | Structural Causes (PALM) | Detailed rows for Polyp, Adenomyosis, Leiomyoma, Malignancy |
| 6 | Non-Structural Causes (COEIN) | Coagulopathy, Ovulatory Dysfunction, Endometrial, Iatrogenic |
| 7 | AUB by Age Group | Color-coded table from prepubertal to postmenopausal |
| 8 | Pathophysiology | Anovulatory AUB flow diagram + causes of anovulation |
| 9 | Clinical Evaluation | History and examination checklist |
| 10 | Investigations | Three-column table: all patients / selected / biopsy indications |
| 11 | Medical Management | Drug table: LNG-IUS, OCP, progestins, tranexamic acid, NSAIDs, GnRH agonists |
| 12 | Surgical Management | Endometrial ablation, UAE, hysteroscopy, hysterectomy with indications |
| 13 | Postmenopausal Bleeding | Special considerations with "must-exclude" malignancy callout |
| 14 | Key Takeaways | 7 summary points on dark background |