Is this app free?
Dysmenorrhea ppt
mkdir -p /home/daytona/workspace/dysmenorrhea-ppt && ls /home/daytona/workspace/…
~/dysmenorrhea-ppt/create_ppt.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Dysmenorrhea";
pres.author = "Medical Education";
// ─── COLOR PALETTE ─────────────────────────────────────────────────────────────
const C = {
darkBg: "1A1A2E", // deep navy - title/section slides
midBg: "16213E", // darker navy
accent: "E94560", // vivid crimson accent
accent2: "F5A623", // warm amber
accent3: "00B4D8", // sky blue
lightBg: "F8F9FA", // near-white content bg
cardBg: "FFFFFF", // card white
textDark: "1A1A2E", // dark text on light
textLight: "FFFFFF", // white text on dark
textMid: "4A4E69", // mid-tone body text
border: "E94560", // accent borders
subtitleGray: "B0B3C1",
};
// ─── HELPERS ──────────────────────────────────────────────────────────────────
function addSlideHeader(slide, title, subtitle, dark = true) {
const bg = dark ? C.darkBg : C.lightBg;
const titleColor = dark ? C.textLight : C.textDark;
const subColor = dark ? C.subtitleGray : C.textMid;
slide.background = { color: bg };
// accent bar top
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 0.08,
fill: { color: C.accent }, line: { color: C.accent }
});
slide.addText(title, {
x: 0.5, y: 0.2, w: 9, h: 0.65,
fontSize: 22, bold: true, color: titleColor, fontFace: "Calibri"
});
if (subtitle) {
slide.addText(subtitle, {
x: 0.5, y: 0.85, w: 9, h: 0.35,
fontSize: 12, color: subColor, fontFace: "Calibri", italic: true
});
}
// divider line
slide.addShape(pres.ShapeType.rect, {
x: 0.5, y: 1.22, w: 9, h: 0.03,
fill: { color: C.accent }, line: { color: C.accent }
});
}
function bulletItems(items, opts = {}) {
return items.map((item, i) => ({
text: item,
options: {
bullet: { type: "bullet", indent: opts.indent || 15 },
breakLine: i < items.length - 1,
fontSize: opts.fontSize || 15,
color: opts.color || C.textDark,
fontFace: "Calibri",
paraSpaceAfter: opts.paraSpaceAfter || 4,
}
}));
}
function addCard(slide, x, y, w, h, title, items, titleColor = C.accent) {
// Card shadow
slide.addShape(pres.ShapeType.rect, {
x: x + 0.05, y: y + 0.05, w, h,
fill: { color: "DADADA" }, line: { color: "DADADA" }
});
// Card body
slide.addShape(pres.ShapeType.rect, {
x, y, w, h,
fill: { color: C.cardBg },
line: { color: titleColor, width: 1.5 }
});
// Card title strip
slide.addShape(pres.ShapeType.rect, {
x, y, w, h: 0.38,
fill: { color: titleColor }, line: { color: titleColor }
});
slide.addText(title, {
x: x + 0.12, y: y + 0.04, w: w - 0.2, h: 0.3,
fontSize: 11, bold: true, color: C.textLight, fontFace: "Calibri"
});
// Card content
slide.addText(bulletItems(items, { fontSize: 11, color: C.textDark, paraSpaceAfter: 2 }), {
x: x + 0.1, y: y + 0.42, w: w - 0.2, h: h - 0.5,
valign: "top", fontFace: "Calibri"
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE SLIDE
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.background = { color: C.darkBg };
// background decorative circles
sl.addShape(pres.ShapeType.ellipse, {
x: 7.8, y: -0.8, w: 4, h: 4,
fill: { color: "E94560", transparency: 88 }, line: { color: "E94560", transparency: 88 }
});
sl.addShape(pres.ShapeType.ellipse, {
x: 8.5, y: 3, w: 2.5, h: 2.5,
fill: { color: "00B4D8", transparency: 85 }, line: { color: "00B4D8", transparency: 85 }
});
// red accent bar
sl.addShape(pres.ShapeType.rect, {
x: 0.5, y: 1.6, w: 0.12, h: 2.1,
fill: { color: C.accent }, line: { color: C.accent }
});
sl.addText("DYSMENORRHEA", {
x: 0.8, y: 1.4, w: 8.5, h: 1,
fontSize: 48, bold: true, color: C.textLight, fontFace: "Calibri",
charSpacing: 4
});
sl.addText("Painful Menstruation: Etiology, Pathophysiology, Diagnosis & Management", {
x: 0.8, y: 2.45, w: 7.5, h: 0.6,
fontSize: 16, color: C.subtitleGray, fontFace: "Calibri", italic: true
});
sl.addShape(pres.ShapeType.rect, {
x: 0.8, y: 3.2, w: 6, h: 0.03,
fill: { color: C.accent2 }, line: { color: C.accent2 }
});
sl.addText("For Medical Students | Obstetrics & Gynecology", {
x: 0.8, y: 3.35, w: 7, h: 0.4,
fontSize: 12, color: C.subtitleGray, fontFace: "Calibri"
});
sl.addText("Sources: Berek & Novak's Gynecology | Harrison's | Goldman-Cecil Medicine", {
x: 0.5, y: 5.2, w: 9, h: 0.3,
fontSize: 9, color: "606080", fontFace: "Calibri", align: "center"
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — TABLE OF CONTENTS
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.background = { color: C.darkBg };
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 0.08,
fill: { color: C.accent }, line: { color: C.accent }
});
sl.addText("OUTLINE", {
x: 0.5, y: 0.2, w: 9, h: 0.55,
fontSize: 26, bold: true, color: C.textLight, fontFace: "Calibri", charSpacing: 3
});
const topics = [
["01", "Definition & Overview"],
["02", "Epidemiology & Prevalence"],
["03", "Classification: Primary vs Secondary"],
["04", "Pathophysiology of Primary Dysmenorrhea"],
["05", "Risk Factors"],
["06", "Clinical Features & Symptoms"],
["07", "Diagnosis & Differential Diagnosis"],
["08", "Secondary Dysmenorrhea - Causes"],
["09", "Medical Management"],
["10", "Hormonal Therapy"],
["11", "Surgical & Non-pharmacological Treatment"],
["12", "Complications & Intractable Dysmenorrhea"],
];
const cols = 2;
const perCol = Math.ceil(topics.length / cols);
const startY = 1.0;
const rowH = 0.37;
topics.forEach(([num, topic], i) => {
const col = Math.floor(i / perCol);
const row = i % perCol;
const x = col === 0 ? 0.5 : 5.3;
const y = startY + row * rowH;
sl.addShape(pres.ShapeType.rect, {
x, y, w: 0.4, h: 0.28,
fill: { color: C.accent }, line: { color: C.accent }
});
sl.addText(num, {
x: x + 0.02, y: y + 0.02, w: 0.36, h: 0.24,
fontSize: 10, bold: true, color: C.textLight, align: "center", fontFace: "Calibri"
});
sl.addText(topic, {
x: x + 0.48, y: y + 0.02, w: 4.1, h: 0.26,
fontSize: 12, color: C.textLight, fontFace: "Calibri"
});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — DEFINITION & OVERVIEW
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Definition & Overview", "What is Dysmenorrhea?");
sl.addText([
{ text: "Dysmenorrhea", options: { bold: true, color: C.accent } },
{ text: " is defined as ", options: {} },
{ text: "painful menstruation", options: { bold: true } },
{ text: " — a common gynecologic disorder affecting as many as ", options: {} },
{ text: "60% of menstruating women.", options: { bold: true, color: C.accent } },
], {
x: 0.5, y: 1.35, w: 9, h: 0.55,
fontSize: 15, fontFace: "Calibri", color: C.textDark
});
// Two definition cards
addCard(sl, 0.4, 2.05, 4.3, 2.9, "PRIMARY DYSMENORRHEA", [
"Menstrual pain WITHOUT underlying pelvic pathology",
"Appears within 1–2 years of menarche",
"Occurs when ovulatory cycles are established",
"Affects younger women; may persist into 40s",
"Most common gynecologic complaint in young women",
"Prevalence rates reported as high as 90%",
], C.accent);
addCard(sl, 5.1, 2.05, 4.3, 2.9, "SECONDARY DYSMENORRHEA", [
"Painful menses ASSOCIATED with underlying pelvic pathology",
"Usually develops years after menarche",
"Can occur with anovulatory cycles",
"Common causes: endometriosis, fibroids, adenomyosis",
"Requires thorough investigation to identify etiology",
"Treatment directed at underlying cause",
], C.accent3);
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — EPIDEMIOLOGY
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Epidemiology & Prevalence", "Berek & Novak's Gynecology | Goldman-Cecil Medicine");
// stat boxes
const stats = [
{ val: "60%", label: "of menstruating\nwomen affected", color: C.accent },
{ val: "90%", label: "prevalence rate in\nyoung women (peak)", color: C.accent2 },
{ val: "10%", label: "of adult women\nincapacitated ≥3 days/month", color: C.accent3 },
{ val: "#1", label: "leading cause of\nabsenteeism in adolescents", color: "7B61FF" },
];
stats.forEach((s, i) => {
const x = 0.4 + i * 2.35;
sl.addShape(pres.ShapeType.rect, {
x, y: 1.4, w: 2.1, h: 1.8,
fill: { color: s.color }, line: { color: s.color }
});
sl.addText(s.val, {
x, y: 1.5, w: 2.1, h: 0.9,
fontSize: 36, bold: true, color: C.textLight, align: "center", fontFace: "Calibri"
});
sl.addText(s.label, {
x, y: 2.38, w: 2.1, h: 0.75,
fontSize: 11, color: C.textLight, align: "center", fontFace: "Calibri"
});
});
sl.addText(bulletItems([
"Primary dysmenorrhea usually begins within 6–12 months of menarche; peak prevalence in late teens and early 20s",
"Secondary dysmenorrhea affects women of all reproductive ages; endometriosis affects ~10% of reproductive-age women",
"Dysmenorrhea is one of the most common reasons for gynecologic consultation and school/work absenteeism",
"Severity correlates with early menarche, longer menstrual duration, and higher body mass index in some studies",
], { fontSize: 13, color: C.textDark, paraSpaceAfter: 5 }), {
x: 0.5, y: 3.35, w: 9, h: 2.1,
valign: "top", fontFace: "Calibri"
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — CLASSIFICATION
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Classification of Dysmenorrhea", "Primary vs Secondary — Key Distinguishing Features");
const headers = ["Feature", "Primary Dysmenorrhea", "Secondary Dysmenorrhea"];
const rows = [
["Definition", "Pain without pelvic pathology", "Pain with identifiable pelvic cause"],
["Onset", "1–2 years after menarche", "Years after menarche"],
["Cycle type", "Ovulatory cycles", "Can occur with anovulatory cycles"],
["Timing of pain", "Starts at onset of menses, lasts 48–72 hrs", "Begins 1–2 weeks before menses"],
["Nature of pain", "Colicky, suprapubic, cramping", "Often dull, constant, or progressive"],
["Associated symptoms", "Nausea, vomiting, diarrhea, backache", "Dyspareunia, abnormal bleeding"],
["Pelvic exam", "Normal", "May reveal pathology"],
["First-line treatment", "NSAIDs, hormonal contraceptives", "Treat underlying cause"],
];
const colW = [2.1, 3.5, 3.5];
const colX = [0.35, 2.5, 6.05];
const rowH = 0.42;
const startY = 1.35;
// Header row
headers.forEach((h, ci) => {
const hColor = ci === 0 ? C.midBg : (ci === 1 ? C.accent : C.accent3);
sl.addShape(pres.ShapeType.rect, {
x: colX[ci], y: startY, w: colW[ci], h: 0.42,
fill: { color: hColor }, line: { color: hColor }
});
sl.addText(h, {
x: colX[ci] + 0.05, y: startY + 0.06, w: colW[ci] - 0.1, h: 0.3,
fontSize: 11, bold: true, color: C.textLight, fontFace: "Calibri", align: "center"
});
});
// Data rows
rows.forEach((row, ri) => {
const y = startY + 0.42 + ri * rowH;
const rowBg = ri % 2 === 0 ? "F4F4F8" : "FFFFFF";
row.forEach((cell, ci) => {
const bg = ci === 0 ? "E8E8F0" : rowBg;
sl.addShape(pres.ShapeType.rect, {
x: colX[ci], y, w: colW[ci], h: rowH,
fill: { color: bg }, line: { color: "D0D0D8", width: 0.5 }
});
sl.addText(cell, {
x: colX[ci] + 0.07, y: y + 0.05, w: colW[ci] - 0.14, h: rowH - 0.1,
fontSize: 10.5, color: ci === 0 ? C.textDark : C.textMid, fontFace: "Calibri",
bold: ci === 0
});
});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — PATHOPHYSIOLOGY
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Pathophysiology of Primary Dysmenorrhea", "Prostaglandin-Mediated Mechanism | Berek & Novak's Gynecology");
// Pathway boxes
const steps = [
{ label: "Progesterone withdrawal\n(late luteal phase)", color: "7B61FF" },
{ label: "Lytic enzyme activation\n→ Phospholipid release", color: C.accent2 },
{ label: "Arachidonic acid\ngeneration", color: "F7801A" },
{ label: "COX pathway activation\n(COX-1 & COX-2)", color: C.accent },
{ label: "↑ Prostaglandin synthesis\n(esp. PGF2α, PGE2)", color: C.accent },
];
steps.forEach((s, i) => {
const x = 0.3 + i * 1.88;
sl.addShape(pres.ShapeType.rect, {
x, y: 1.35, w: 1.72, h: 0.9,
fill: { color: s.color }, line: { color: s.color }
});
sl.addText(s.label, {
x, y: 1.35, w: 1.72, h: 0.9,
fontSize: 9.5, bold: true, color: C.textLight, align: "center", valign: "middle", fontFace: "Calibri"
});
// Arrow
if (i < steps.length - 1) {
sl.addShape(pres.ShapeType.rect, {
x: x + 1.72, y: 1.72, w: 0.16, h: 0.14,
fill: { color: "888888" }, line: { color: "888888" }
});
}
});
// Consequences
const effects = [
{ title: "Increased Uterine Contractions", items: ["Dysrhythmic pattern", "High-amplitude contractions", "Increased basal tone", "Increased active pressure"], color: C.accent },
{ title: "Vascular Effects", items: ["Vasoconstriction of uterine arteries", "Decreased uterine blood flow", "Uterine hypoxia (\"uterine angina\")", "Local tissue ischemia"], color: C.accent2 },
{ title: "Sensitization", items: ["Peripheral nerve hypersensitivity", "Upregulated COX enzyme activity", "Upregulated prostanoid synthase", "Lower pain threshold"], color: C.accent3 },
];
effects.forEach((e, i) => {
addCard(sl, 0.4 + i * 3.1, 2.4, 2.9, 2.9, e.title, e.items, e.color);
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — RISK FACTORS
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Risk Factors for Dysmenorrhea", "Swanson's Family Medicine Review");
const rf = [
{ cat: "Menstrual Factors", items: ["Early age at menarche (< 12 years)", "Longer duration of menstrual flow", "Heavier menstrual flow", "Irregular menstrual cycles"] },
{ cat: "Reproductive Factors", items: ["Nulliparity", "No prior pregnancies", "History of pelvic surgery", "Underlying endometriosis or fibroids"] },
{ cat: "Lifestyle Factors", items: ["Cigarette smoking", "Alcohol consumption", "Sedentary lifestyle / low physical activity", "High dietary fat intake"] },
{ cat: "Psychosocial Factors", items: ["Stress and anxiety", "Depression", "History of sexual abuse", "Poor social support"] },
];
rf.forEach((r, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
addCard(sl, 0.4 + col * 4.7, 1.4 + row * 2.1, 4.4, 1.95, r.cat, r.items, i === 0 ? C.accent : i === 1 ? C.accent3 : C.accent2 : "7B61FF");
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — CLINICAL FEATURES
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Clinical Features & Symptoms", "Berek & Novak's Gynecology | Swanson's Family Medicine Review");
// Pain characteristics box
sl.addShape(pres.ShapeType.rect, {
x: 0.4, y: 1.35, w: 4.5, h: 3.9,
fill: { color: "FFF0F3" }, line: { color: C.accent, width: 1.5 }
});
sl.addShape(pres.ShapeType.rect, {
x: 0.4, y: 1.35, w: 4.5, h: 0.38,
fill: { color: C.accent }, line: { color: C.accent }
});
sl.addText("PAIN CHARACTERISTICS", {
x: 0.5, y: 1.38, w: 4.3, h: 0.3,
fontSize: 11, bold: true, color: C.textLight, fontFace: "Calibri"
});
sl.addText(bulletItems([
"Begins a few hours before or just after onset of menses",
"Lasts 48 to 72 hours",
"Colicky in nature — similar to labor pains",
"Suprapubic cramping, lower abdominal pain",
"Pain relieved by abdominal massage, counterpressure, or movement",
"Peaks on the day of heaviest flow",
"Not worsened by positional change (unlike peritonitis)",
], { fontSize: 12, color: C.textDark, paraSpaceAfter: 3 }), {
x: 0.5, y: 1.78, w: 4.3, h: 3.3, valign: "top", fontFace: "Calibri"
});
// Associated symptoms
sl.addShape(pres.ShapeType.rect, {
x: 5.2, y: 1.35, w: 4.4, h: 3.9,
fill: { color: "F0F8FF" }, line: { color: C.accent3, width: 1.5 }
});
sl.addShape(pres.ShapeType.rect, {
x: 5.2, y: 1.35, w: 4.4, h: 0.38,
fill: { color: C.accent3 }, line: { color: C.accent3 }
});
sl.addText("ASSOCIATED SYMPTOMS", {
x: 5.3, y: 1.38, w: 4.2, h: 0.3,
fontSize: 11, bold: true, color: C.textLight, fontFace: "Calibri"
});
sl.addText(bulletItems([
"Lumbosacral backache",
"Pain radiating down the anterior thighs",
"Nausea and vomiting",
"Diarrhea",
"Headache and fatigue",
"Rarely: syncopal episodes",
"Bloating and breast tenderness (if PMS coexists)",
], { fontSize: 12, color: C.textDark, paraSpaceAfter: 3 }), {
x: 5.3, y: 1.78, w: 4.2, h: 3.3, valign: "top", fontFace: "Calibri"
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — DIAGNOSIS
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Diagnosis of Dysmenorrhea", "Clinical Approach & Investigations");
const steps = [
{ num: "1", title: "Detailed History", items: ["Onset in relation to menarche", "Cyclic vs. non-cyclic nature of pain", "Severity (VAS scale)", "Abnormal uterine bleeding / dyspareunia", "Sexual history, contraceptive use"] },
{ num: "2", title: "Physical Examination", items: ["Pelvic exam: uterine size, shape, mobility", "Adnexal tenderness and masses", "Uterosacral ligament nodularity", "Rectovaginal septum fibrosis", "Signs of infection"] },
{ num: "3", title: "Investigations", items: ["NAAT for gonorrhea & chlamydia", "CBC and ESR (to rule out endometritis/PID)", "Pelvic ultrasound (if NSAIDs fail)", "Diagnostic laparoscopy (if secondary cause suspected)", "Serum CA-125 (if endometriosis suspected)"] },
];
steps.forEach((s, i) => {
const x = 0.35 + i * 3.2;
sl.addShape(pres.ShapeType.ellipse, {
x: x + 1.1, y: 1.35, w: 0.85, h: 0.85,
fill: { color: C.accent }, line: { color: C.accent }
});
sl.addText(s.num, {
x: x + 1.1, y: 1.37, w: 0.85, h: 0.8,
fontSize: 22, bold: true, color: C.textLight, align: "center", valign: "middle", fontFace: "Calibri"
});
sl.addShape(pres.ShapeType.rect, {
x, y: 2.28, w: 3.05, h: 3.0,
fill: { color: "F8F9FA" }, line: { color: C.accent, width: 1.5 }
});
sl.addText(s.title, {
x: x + 0.1, y: 2.3, w: 2.85, h: 0.38,
fontSize: 12, bold: true, color: C.accent, fontFace: "Calibri"
});
sl.addText(bulletItems(s.items, { fontSize: 11, color: C.textDark, paraSpaceAfter: 2 }), {
x: x + 0.1, y: 2.7, w: 2.85, h: 2.4, valign: "top", fontFace: "Calibri"
});
});
sl.addText("Note: Laparoscopy is NOT necessary initially when primary dysmenorrhea is suspected and examination is normal.", {
x: 0.4, y: 5.3, w: 9.2, h: 0.25,
fontSize: 10, color: C.accent2, italic: true, fontFace: "Calibri"
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — DIFFERENTIAL DIAGNOSIS / SECONDARY CAUSES
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Secondary Dysmenorrhea — Causes & Differential Diagnosis", "Berek & Novak's Gynecology, Table 12-3");
const causes = [
{ cat: "Endometrial/Uterine", items: ["Endometriosis (most common)", "Adenomyosis", "Uterine fibroids (leiomyomas)", "Endometrial polyps", "Intrauterine adhesions (Asherman's)"] },
{ cat: "Cervical/Anatomical", items: ["Cervical stenosis", "Cervical polyps", "Obstructive Mullerian anomalies", "Cervical myoma"] },
{ cat: "Infectious/Inflammatory", items: ["Pelvic inflammatory disease (PID)", "Chronic endometritis", "Subacute salpingo-oophoritis"] },
{ cat: "Ovarian", items: ["Ovarian cysts (incl. endometrioma)", "Ovarian remnant syndrome", "Adnexal adhesions"] },
{ cat: "Iatrogenic", items: ["Copper IUD use", "Post-surgical adhesions", "Post-procedure scarring"] },
{ cat: "Other Pelvic Causes", items: ["Pelvic congestion syndrome", "Interstitial cystitis", "Irritable bowel syndrome", "Inflammatory bowel disease"] },
];
causes.forEach((c, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const colors = [C.accent, C.accent3, C.accent2, "7B61FF", "E67E22", "27AE60"];
addCard(sl, 0.35 + col * 3.2, 1.4 + row * 2.0, 3.0, 1.85, c.cat, c.items, colors[i]);
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — NSAID MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Medical Management — NSAIDs (First-Line)", "Berek & Novak's Gynecology | Swanson's Family Medicine Review");
sl.addShape(pres.ShapeType.rect, {
x: 0.4, y: 1.35, w: 9.2, h: 0.6,
fill: { color: "FFF0F0" }, line: { color: C.accent, width: 1.5 }
});
sl.addText("NSAIDs are the FIRST-LINE treatment for primary dysmenorrhea — they inhibit COX enzymes, reducing prostaglandin production, and are effective in 70–80% of patients", {
x: 0.5, y: 1.43, w: 9.0, h: 0.44,
fontSize: 12, bold: true, color: C.accent, fontFace: "Calibri"
});
// Table of NSAIDs
const nHeaders = ["Drug", "Class", "Dose", "Frequency", "Notes"];
const nCols = [1.6, 1.7, 2.0, 1.9, 2.4];
const nX = [0.35, 1.95, 3.65, 5.65, 7.55];
const drugs = [
["Ibuprofen", "Propionic acid", "400–600 mg", "Every 4–6 hrs", "Most commonly used; OTC"],
["Naproxen sodium", "Propionic acid", "550 mg loading,\nthen 275 mg", "Every 6–8 hrs", "Longer half-life"],
["Mefenamic acid", "Fenamate", "500 mg loading,\nthen 250 mg", "Every 6 hrs", "Also reduces flow"],
["Celecoxib", "COX-2 selective", "200 mg", "Once/twice daily", "Use if GI intolerance"],
["Diclofenac", "Acetic acid", "50 mg", "Every 8 hrs", "Available as gel/suppository"],
];
const tStartY = 2.05;
// Header
nHeaders.forEach((h, ci) => {
sl.addShape(pres.ShapeType.rect, {
x: nX[ci], y: tStartY, w: nCols[ci], h: 0.38,
fill: { color: C.accent }, line: { color: C.accent }
});
sl.addText(h, {
x: nX[ci] + 0.05, y: tStartY + 0.06, w: nCols[ci] - 0.1, h: 0.26,
fontSize: 11, bold: true, color: C.textLight, fontFace: "Calibri", align: "center"
});
});
drugs.forEach((row, ri) => {
const ry = tStartY + 0.38 + ri * 0.44;
row.forEach((cell, ci) => {
const bg = ri % 2 === 0 ? "FFF5F5" : "FFFFFF";
sl.addShape(pres.ShapeType.rect, {
x: nX[ci], y: ry, w: nCols[ci], h: 0.44,
fill: { color: bg }, line: { color: "E0E0E0", width: 0.5 }
});
sl.addText(cell, {
x: nX[ci] + 0.05, y: ry + 0.04, w: nCols[ci] - 0.1, h: 0.36,
fontSize: 10, color: C.textDark, fontFace: "Calibri"
});
});
});
sl.addText("Protocol: Start 1–3 days before expected menses or at first sign of pain. Continue every 6–8 hours for first 2–3 days. Trial for 4–6 months before concluding treatment failure.", {
x: 0.4, y: 5.15, w: 9.2, h: 0.35,
fontSize: 10, color: C.textMid, italic: true, fontFace: "Calibri"
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — HORMONAL THERAPY
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Hormonal Therapy for Dysmenorrhea", "Berek & Novak's Gynecology — Equally Effective to NSAIDs");
sl.addText("Mechanism: Hormonal contraceptives inhibit ovulation, decrease endometrial proliferation, and create a hormonal milieu similar to the early proliferative phase — when prostaglandin levels are lowest.", {
x: 0.5, y: 1.35, w: 9, h: 0.55,
fontSize: 13, color: C.textDark, fontFace: "Calibri", italic: false
});
const hormone = [
{ type: "Combined OCP\n(Estrogen + Progestin)", detail: "Cyclic or continuous regimens effective\nContinuous/extended cycle equally efficacious\nIdeal for women desiring contraception", color: C.accent },
{ type: "Progestin-only Pills", detail: "Suitable when estrogen contraindicated\nReduces endometrial proliferation\nMay cause irregular bleeding", color: C.accent2 },
{ type: "Transdermal Patch", detail: "Weekly application\nSimilar efficacy to combined OCP\nGood option for pill non-compliance", color: C.accent3 },
{ type: "Vaginal Ring", detail: "Monthly insertion\nSteady hormone delivery\nReduced systemic side effects", color: "7B61FF" },
{ type: "Injectable Progestin\n(DMPA)", detail: "Depot medroxyprogesterone acetate\nAmenorrhea reduces dysmenorrhea\nLong-acting (every 3 months)", color: "E67E22" },
{ type: "LNG-IUD\n(Mirena)", detail: "Levonorgestrel-releasing IUD\nSignificantly reduces dysmenorrhea\nAlso treats heavy menstrual bleeding", color: "27AE60" },
];
hormone.forEach((h, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.35 + col * 3.2;
const y = 2.05 + row * 1.75;
sl.addShape(pres.ShapeType.rect, {
x, y, w: 3.0, h: 1.6,
fill: { color: "FAFAFA" }, line: { color: h.color, width: 1.5 }
});
sl.addShape(pres.ShapeType.rect, {
x, y, w: 3.0, h: 0.38,
fill: { color: h.color }, line: { color: h.color }
});
sl.addText(h.type, {
x: x + 0.08, y: y + 0.04, w: 2.84, h: 0.3,
fontSize: 10, bold: true, color: C.textLight, fontFace: "Calibri"
});
sl.addText(h.detail, {
x: x + 0.1, y: y + 0.42, w: 2.8, h: 1.1,
fontSize: 10, color: C.textDark, fontFace: "Calibri", valign: "top"
});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 — TREATMENT ALGORITHM
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Treatment Algorithm — Primary Dysmenorrhea", "Step-up Approach | Berek & Novak's Gynecology");
const steps = [
{ step: "Step 1", title: "First-Line", detail: "NSAIDs (ibuprofen, naproxen, mefenamic acid)\nStart 1–3 days before or at onset of menses\nContinue for 4–6 months to assess response", color: C.accent },
{ step: "Step 2", title: "Add or Switch", detail: "Hormonal contraceptives (combined OCP, patch, ring)\nInjectables or LNG-IUD\nUse alone or in combination with NSAIDs", color: C.accent2 },
{ step: "Step 3", title: "Refractory Cases", detail: "Hydrocodone or codeine (short-course, 2–3 days/month)\nRule out psychological contributing factors\nEvaluate for secondary cause", color: "E67E22" },
{ step: "Step 4", title: "Investigate Secondary Cause", detail: "Pelvic ultrasound → Diagnostic laparoscopy\nTreat underlying pathology\n(Endometriosis, fibroids, adenomyosis)", color: C.accent3 },
{ step: "Step 5", title: "Surgical / Specialized", detail: "Laparoscopic surgery for endometriosis\nPresacral neurectomy (rarely)\nHysterectomy (intractable, family complete)", color: "7B61FF" },
];
steps.forEach((s, i) => {
const y = 1.35 + i * 0.82;
sl.addShape(pres.ShapeType.rect, {
x: 0.35, y, w: 1.1, h: 0.7,
fill: { color: s.color }, line: { color: s.color }
});
sl.addText(s.step, {
x: 0.35, y, w: 1.1, h: 0.7,
fontSize: 10, bold: true, color: C.textLight, align: "center", valign: "middle", fontFace: "Calibri"
});
sl.addShape(pres.ShapeType.rect, {
x: 1.55, y, w: 8.0, h: 0.7,
fill: { color: i % 2 === 0 ? "F8F9FA" : "FFFFFF" }, line: { color: "DDDDDD", width: 0.5 }
});
sl.addText(s.title + ": ", {
x: 1.65, y: y + 0.07, w: 1.4, h: 0.28,
fontSize: 11, bold: true, color: s.color, fontFace: "Calibri"
});
sl.addText(s.detail, {
x: 3.1, y: y + 0.04, w: 6.3, h: 0.62,
fontSize: 10.5, color: C.textDark, fontFace: "Calibri", valign: "middle"
});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 — NON-PHARMACOLOGICAL & COMPLEMENTARY
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Non-Pharmacological & Complementary Treatments", "Berek & Novak's Gynecology | Evidence-Based Review");
const rems = [
{ title: "Heat Therapy", items: ["Local heat application (heating pad)", "Comparable efficacy to low-dose ibuprofen in some studies", "Increases endometrial blood flow", "Safe, widely available"], color: C.accent },
{ title: "Exercise", items: ["Regular aerobic exercise reduces severity", "Mechanism: release of endorphins", "Reduces prostaglandin production", "Low-impact (walking, swimming, yoga)"], color: C.accent2 },
{ title: "Dietary Supplements", items: ["Omega-3 fatty acids: reduce prostaglandin synthesis", "Krill oil outperforms fish oil in some RCTs", "Vitamin B1 (100 mg/day): evidence from 1 large RCT", "Magnesium: promising but optimal dose unclear"], color: C.accent3 },
{ title: "Psychological & Other", items: ["TENS (transcutaneous nerve stimulation)", "Acupuncture: some evidence of benefit", "Stress reduction, mindfulness", "Dietary fat reduction"], color: "7B61FF" },
];
rems.forEach((r, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
addCard(sl, 0.35 + col * 4.75, 1.4 + row * 2.05, 4.45, 1.9, r.title, r.items, r.color);
});
sl.addText("Note: These approaches are adjunctive. NSAIDs and hormonal therapy remain the mainstay of treatment.", {
x: 0.4, y: 5.42, w: 9.2, h: 0.22,
fontSize: 10, color: C.textMid, italic: true, fontFace: "Calibri"
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 15 — SECONDARY DYSMENORRHEA MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Management of Secondary Dysmenorrhea", "Treatment Directed at Underlying Pathology");
const causes2 = [
{ cond: "Endometriosis", tx: ["NSAIDs for pain relief", "Combined OCP (cyclic or continuous)", "GnRH agonists (leuprolide) ± add-back therapy", "Progestins (norethindrone, DMPA)", "Laparoscopic excision/ablation", "Danazol (second-line due to androgenic side effects)"] },
{ cond: "Adenomyosis", tx: ["LNG-IUD (Mirena) — first-line", "Combined oral contraceptives", "GnRH agonists for temporary relief", "Hysterectomy (definitive — family complete)"] },
{ cond: "Uterine Fibroids", tx: ["NSAIDs for pain management", "Ulipristal acetate (SPRMs)", "GnRH agonists (pre-surgical)", "Myomectomy (fertility-sparing)", "Uterine artery embolization", "Hysterectomy (definitive)"] },
{ cond: "PID / Infection", tx: ["Antibiotics based on NAAT results", "Doxycycline + metronidazole ± ceftriaxone", "Treat sexual partners", "NSAIDs for pain"] },
];
causes2.forEach((c, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const colors2 = [C.accent, C.accent3, C.accent2, "7B61FF"];
addCard(sl, 0.35 + col * 4.75, 1.4 + row * 2.1, 4.45, 1.95, c.cond.toUpperCase(), c.tx, colors2[i]);
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 16 — INTRACTABLE DYSMENORRHEA
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Intractable Dysmenorrhea", "When Standard Treatment Fails | Berek & Novak's Gynecology");
sl.addShape(pres.ShapeType.rect, {
x: 0.4, y: 1.35, w: 9.2, h: 0.58,
fill: { color: "FFF0F0" }, line: { color: C.accent, width: 1.5 }
});
sl.addText("About 10% of adult women are incapacitated for up to 3 days per month due to dysmenorrhea — these are cases of 'intractable dysmenorrhea' requiring specialized management.", {
x: 0.55, y: 1.42, w: 8.9, h: 0.44,
fontSize: 12, color: C.accent, fontFace: "Calibri", bold: true
});
const intract = [
{ title: "Criteria for Intractability", items: ["Failure of NSAIDs after 4–6 months trial", "Failure of combination NSAIDs + hormonal therapy", "Severe pain causing significant functional impairment", "Pain persisting despite trial of opioid analgesics"] },
{ title: "Surgical Options", items: ["Diagnostic laparoscopy to rule out secondary cause", "Laparoscopic uterosacral nerve ablation (LUNA)", "Presacral neurectomy (interrupts pain pathway)", "Treatment of endometriosis if found at laparoscopy", "Hysterectomy ± bilateral salpingo-oophorectomy (last resort)"] },
{ title: "Multidisciplinary Approach", items: ["Chronic pain clinic referral", "Psychological support / CBT", "Pelvic floor physiotherapy", "Pain medication review", "Assess for central sensitization"] },
];
intract.forEach((item, i) => {
addCard(sl, 0.35 + i * 3.2, 2.05, 3.0, 3.2, item.title, item.items, [C.accent, C.accent3, C.accent2][i]);
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 17 — KEY POINTS SUMMARY
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
addSlideHeader(sl, "Key Points Summary", "Examination Essentials for Medical Students");
const keyPoints = [
{ num: "1", point: "Primary dysmenorrhea = painful menses WITHOUT pelvic pathology; secondary = WITH identifiable pathology" },
{ num: "2", point: "Pathophysiology: Progesterone withdrawal → COX activation → PGF2α/PGE2 → uterine vasoconstriction → ischemia → pain" },
{ num: "3", point: "Primary dysmenorrhea begins within 1–2 years of menarche; pain starts at onset of menses, lasts 48–72 hrs" },
{ num: "4", point: "First-line treatment: NSAIDs (ibuprofen, naproxen). Start 1–3 days before menses. Trial for 4–6 months" },
{ num: "5", point: "Second-line: Hormonal contraceptives (OCP, patch, ring, LNG-IUD). Equally effective to NSAIDs. Indicated if contraception desired" },
{ num: "6", point: "Most common cause of secondary dysmenorrhea: Endometriosis (affects ~10% of reproductive-age women)" },
{ num: "7", point: "Red flags for secondary cause: late onset, progressive worsening, dyspareunia, abnormal bleeding, non-midline pain" },
{ num: "8", point: "10% of women are incapacitated by dysmenorrhea; surgical options (laparoscopy, presacral neurectomy) reserved for intractable cases" },
];
keyPoints.forEach((kp, i) => {
const y = 1.35 + i * 0.5;
sl.addShape(pres.ShapeType.rect, {
x: 0.35, y, w: 0.45, h: 0.4,
fill: { color: i < 4 ? C.accent : C.accent3 }, line: { color: i < 4 ? C.accent : C.accent3 }
});
sl.addText(kp.num, {
x: 0.35, y, w: 0.45, h: 0.4,
fontSize: 13, bold: true, color: C.textLight, align: "center", valign: "middle", fontFace: "Calibri"
});
sl.addShape(pres.ShapeType.rect, {
x: 0.88, y, w: 8.75, h: 0.4,
fill: { color: i % 2 === 0 ? "F4F5FA" : "FFFFFF" }, line: { color: "DEDEE8", width: 0.5 }
});
sl.addText(kp.point, {
x: 1.0, y: y + 0.04, w: 8.5, h: 0.32,
fontSize: 11.5, color: C.textDark, fontFace: "Calibri", valign: "middle"
});
});
}
// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 18 — THANK YOU / REFERENCES
// ═══════════════════════════════════════════════════════════════════════════════
{
const sl = pres.addSlide();
sl.background = { color: C.darkBg };
// Decorative shapes
sl.addShape(pres.ShapeType.ellipse, {
x: -1, y: -1, w: 4, h: 4,
fill: { color: C.accent, transparency: 85 }, line: { color: C.accent, transparency: 85 }
});
sl.addShape(pres.ShapeType.ellipse, {
x: 7, y: 3.5, w: 5, h: 5,
fill: { color: C.accent3, transparency: 88 }, line: { color: C.accent3, transparency: 88 }
});
sl.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: "100%", h: 0.08,
fill: { color: C.accent }, line: { color: C.accent }
});
sl.addText("Thank You", {
x: 1, y: 1.0, w: 8, h: 1.2,
fontSize: 48, bold: true, color: C.textLight, fontFace: "Calibri", align: "center"
});
sl.addShape(pres.ShapeType.rect, {
x: 3.5, y: 2.3, w: 3, h: 0.05,
fill: { color: C.accent }, line: { color: C.accent }
});
sl.addText("References & Sources", {
x: 1, y: 2.5, w: 8, h: 0.4,
fontSize: 14, bold: true, color: C.accent2, fontFace: "Calibri", align: "center"
});
const refs = [
"1. Berek JS, Berek DL. Berek & Novak's Gynecology. 16th ed. Philadelphia: Wolters Kluwer; 2022.",
"2. Kasper DL, et al. Harrison's Principles of Internal Medicine. 22nd ed. McGraw-Hill; 2025.",
"3. Goldman L, Cooney KA. Goldman-Cecil Medicine. 27th ed. Elsevier; 2023.",
"4. Swanson RC. Swanson's Family Medicine Review. 9th ed. Elsevier; 2021.",
];
refs.forEach((ref, i) => {
sl.addText(ref, {
x: 1.5, y: 3.05 + i * 0.42, w: 7, h: 0.35,
fontSize: 11, color: C.subtitleGray, fontFace: "Calibri"
});
});
}
// ─── WRITE FILE ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/dysmenorrhea-ppt/Dysmenorrhea.pptx" })
.then(() => console.log("✅ Presentation saved successfully!"))
.catch(err => { console.error("❌ Error:", err); process.exit(1); });
cd /home/daytona/workspace/dysmenorrhea-ppt && node create_ppt.js 2>&1
~/dysmenorrhea-ppt/create_ppt.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/dysmenorrhea-ppt/create_ppt.js'
cd /home/daytona/workspace/dysmenorrhea-ppt && node create_ppt.js 2>&1
ls -lh /home/daytona/workspace/dysmenorrhea-ppt/Dysmenorrhea.pptx
Dysmenorrhea
Presentation · PPTX
| # | Slide | Content |
|---|---|---|
| 1 | Title Slide | Bold navy/crimson design |
| 2 | Outline | 12-topic overview |
| 3 | Definition | Primary vs Secondary with comparison cards |
| 4 | Epidemiology | Key stats - 60% prevalence, 10% incapacitated |
| 5 | Classification Table | 8-feature comparison table |
| 6 | Pathophysiology | Progesterone withdrawal → COX → PGF2α → uterine ischemia pathway |
| 7 | Risk Factors | Menstrual, reproductive, lifestyle, psychosocial |
| 8 | Clinical Features | Pain characteristics + associated symptoms |
| 9 | Diagnosis | History → Exam → Investigations (step-by-step) |
| 10 | Secondary Causes | Differential diagnosis with 6 categories |
| 11 | NSAIDs (1st-line) | Drug table with doses (ibuprofen, naproxen, mefenamic acid, etc.) |
| 12 | Hormonal Therapy | OCP, patch, ring, DMPA, LNG-IUD |
| 13 | Treatment Algorithm | 5-step escalation approach |
| 14 | Non-pharmacological | Heat, exercise, omega-3, TENS, acupuncture |
| 15 | Secondary Dysmenorrhea Tx | Endometriosis, adenomyosis, fibroids, PID |
| 16 | Intractable Dysmenorrhea | 10% incapacitated; surgical options |
| 17 | Key Points Summary | 8 exam-essential takeaways |
| 18 | References | Berek & Novak, Harrison's, Goldman-Cecil, Swanson's |