Make an exam oriented notes on the given source
Generate a quick reference PDF with mnemonics and tables
ls -la /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/dub-notes
~/dub-notes/generate_dub_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import PageBreak
# ── Output path ──────────────────────────────────────────────────────────────
OUTPUT = "/home/daytona/workspace/dub-notes/DUB_Quick_Reference.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.5*cm, rightMargin=1.5*cm,
topMargin=1.5*cm, bottomMargin=1.5*cm,
)
W = A4[0] - 3*cm # usable width
# ── Colour palette ────────────────────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#1A237E")
MED_BLUE = colors.HexColor("#1565C0")
LIGHT_BLUE = colors.HexColor("#E3F2FD")
ACCENT_RED = colors.HexColor("#B71C1C")
ACCENT_TEAL = colors.HexColor("#00695C")
GOLD = colors.HexColor("#F57F17")
YELLOW_BG = colors.HexColor("#FFFDE7")
GREEN_BG = colors.HexColor("#E8F5E9")
RED_BG = colors.HexColor("#FFEBEE")
TEAL_BG = colors.HexColor("#E0F2F1")
GREY_BG = colors.HexColor("#F5F5F5")
WHITE = colors.white
BLACK = colors.black
DARK_GREY = colors.HexColor("#212121")
# ── Styles ────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
TITLE = S("TITLE",
fontSize=20, fontName="Helvetica-Bold", textColor=WHITE,
alignment=TA_CENTER, spaceAfter=4)
SUBTITLE = S("SUBTITLE",
fontSize=11, fontName="Helvetica", textColor=LIGHT_BLUE,
alignment=TA_CENTER, spaceAfter=2)
H1 = S("H1",
fontSize=13, fontName="Helvetica-Bold", textColor=WHITE,
alignment=TA_LEFT, spaceAfter=4, spaceBefore=6)
H2 = S("H2",
fontSize=11, fontName="Helvetica-Bold", textColor=DARK_BLUE,
alignment=TA_LEFT, spaceAfter=3, spaceBefore=5)
H3 = S("H3",
fontSize=10, fontName="Helvetica-Bold", textColor=ACCENT_TEAL,
alignment=TA_LEFT, spaceAfter=2, spaceBefore=4)
BODY = S("BODY",
fontSize=8.5, fontName="Helvetica", textColor=DARK_GREY,
alignment=TA_LEFT, spaceAfter=2, leading=12)
BULLET = S("BULLET",
fontSize=8.5, fontName="Helvetica", textColor=DARK_GREY,
leftIndent=12, firstLineIndent=-8, spaceAfter=1, leading=11)
MNEMO = S("MNEMO",
fontSize=9, fontName="Helvetica-Bold", textColor=ACCENT_RED,
alignment=TA_LEFT, spaceAfter=1, leading=12)
SMALL = S("SMALL",
fontSize=7.5, fontName="Helvetica", textColor=DARK_GREY,
alignment=TA_LEFT, leading=10)
WARN = S("WARN",
fontSize=8.5, fontName="Helvetica-Bold", textColor=ACCENT_RED,
alignment=TA_LEFT, spaceAfter=1)
TBL_HDR = S("TBL_HDR",
fontSize=8, fontName="Helvetica-Bold", textColor=WHITE,
alignment=TA_CENTER, leading=10)
TBL_CELL = S("TBL_CELL",
fontSize=7.5, fontName="Helvetica", textColor=DARK_GREY,
alignment=TA_LEFT, leading=10)
TBL_CELL_C = S("TBL_CELL_C",
fontSize=7.5, fontName="Helvetica", textColor=DARK_GREY,
alignment=TA_CENTER, leading=10)
TBL_CELL_B = S("TBL_CELL_B",
fontSize=7.5, fontName="Helvetica-Bold", textColor=DARK_BLUE,
alignment=TA_LEFT, leading=10)
NOTE_STYLE = S("NOTE",
fontSize=8, fontName="Helvetica-Oblique", textColor=ACCENT_TEAL,
alignment=TA_LEFT, spaceAfter=2)
# ── Helper builders ───────────────────────────────────────────────────────────
def section_header(text, bg=MED_BLUE):
tbl = Table([[Paragraph(text, H1)]], colWidths=[W])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("ROWPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("ROUNDEDCORNERS", [4]),
]))
return tbl
def mnemonic_box(title, lines, bg=YELLOW_BG):
content = [Paragraph(f"<b>🧠 {title}</b>", MNEMO)]
for l in lines:
content.append(Paragraph(l, BULLET))
tbl = Table([[content]], colWidths=[W])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("ROWPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 1, GOLD),
("ROUNDEDCORNERS", [4]),
]))
return tbl
def alert_box(text, bg=RED_BG, border=ACCENT_RED):
tbl = Table([[Paragraph(f"⚠ {text}", WARN)]], colWidths=[W])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("ROWPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 1.2, border),
]))
return tbl
def tip_box(text, bg=GREEN_BG, border=ACCENT_TEAL):
tbl = Table([[Paragraph(f"✅ {text}", NOTE_STYLE)]], colWidths=[W])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("ROWPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 1, border),
]))
return tbl
def make_table(headers, rows, col_widths=None, header_bg=MED_BLUE, alt_bg=GREY_BG):
if col_widths is None:
col_widths = [W/len(headers)]*len(headers)
data = [[Paragraph(h, TBL_HDR) for h in headers]]
for i, row in enumerate(rows):
cells = []
for j, cell in enumerate(row):
style = TBL_CELL_B if j == 0 else TBL_CELL
cells.append(Paragraph(str(cell), style))
data.append(cells)
tbl = Table(data, colWidths=col_widths)
ts = [
("BACKGROUND", (0,0), (-1,0), header_bg),
("ROWPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BDBDBD")),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]
for i in range(1, len(data)):
if i % 2 == 0:
ts.append(("BACKGROUND", (0,i), (-1,i), alt_bg))
tbl.setStyle(TableStyle(ts))
return tbl
# ── Story ─────────────────────────────────────────────────────────────────────
story = []
# ════════════════════════════════════════════════════════════════════════════════
# COVER HEADER
# ════════════════════════════════════════════════════════════════════════════════
cover = Table([[
Paragraph("DYSFUNCTIONAL UTERINE BLEEDING", TITLE),
Paragraph("Quick Reference & Mnemonics", SUBTITLE),
Paragraph("DC Dutta's Textbook of Gynecology | Chapter 15 | AUB", SUBTITLE),
]], colWidths=[W])
cover.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("ROWPADDING", (0,0), (-1,-1), 10),
("LEFTPADDING", (0,0), (-1,-1), 12),
("ROUNDEDCORNERS", [6]),
]))
story += [cover, Spacer(1, 0.4*cm)]
# ════════════════════════════════════════════════════════════════════════════════
# 1. DEFINITIONS
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("1. DEFINITIONS"))
story.append(Spacer(1, 0.2*cm))
def_data = [
["Term", "Definition", "Key Point"],
["DUB",
"Abnormal uterine bleeding WITHOUT any clinically detectable organic, systemic, and iatrogenic cause",
"Diagnosis of EXCLUSION; Origin = HPO axis (endocrine)"],
["HMB\n(Heavy Menstrual Bleeding)",
"Bleeding that interferes with woman's physical, emotional, social and maternal quality of life",
"Clinical definition — no volume cutoff required"],
["Metropathia Hemorrhagica",
"Syn: Cystic Glandular Hyperplasia / Schroeder's disease",
"Type of anovulatory DUB; premenopausal; absolutely painless"],
]
story.append(make_table(
["Term", "Definition", "Key Point"],
[r[1:] for r in def_data[1:]],
col_widths=[W*0.2, W*0.45, W*0.35],
))
story.append(Spacer(1, 0.3*cm))
story.append(alert_box("PELVIC PATHOLOGY + PREGNANCY + SYSTEMIC + IATROGENIC cause must be EXCLUDED before diagnosing DUB"))
story.append(Spacer(1, 0.3*cm))
# ════════════════════════════════════════════════════════════════════════════════
# 2. CLASSIFICATION
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("2. CLASSIFICATION OF DUB"))
story.append(Spacer(1, 0.2*cm))
class_data = [
["Type", "% of DUB", "Subtypes / Notes"],
["OVULAR (Cyclical)", "20%",
"Polymenorrhea/Polymenorrhagia | Oligomenorrhea | Functional Menorrhagia\n(Irregular shedding & Irregular ripening)"],
["ANOVULAR (Acyclical)", "80% ← MORE COMMON",
"Menorrhagia | Cystic Glandular Hyperplasia (Metropathia hemorrhagica)"],
]
story.append(make_table(
["Type", "% of DUB", "Subtypes / Notes"],
[r[1:] for r in class_data[1:]],
col_widths=[W*0.22, W*0.2, W*0.58],
header_bg=ACCENT_TEAL,
))
story.append(Spacer(1, 0.3*cm))
story.append(mnemonic_box(
'Mnemonic: "20-80 Rule" — Ovular is 20%, Anovular is 80%',
[
"<b>O</b>vular = <b>O</b>nly 20% (O looks like a small circle)",
"<b>A</b>novular = <b>A</b>lmost All (80%)",
]
))
story.append(Spacer(1, 0.3*cm))
# ════════════════════════════════════════════════════════════════════════════════
# 3. PATHOPHYSIOLOGY
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("3. PATHOPHYSIOLOGY — KEY HORMONAL AXES"))
story.append(Spacer(1, 0.2*cm))
patho_data = [
["Mediator", "Action", "In Anovulatory DUB"],
["PGF2α", "Vasoconstriction + reduces bleeding", "DECREASED → excess bleeding"],
["PGE2", "Vasodilation + promotes bleeding", "PGF2α/PGE2 ratio LOW"],
["Endothelin", "Powerful vasoconstrictor", "Increased in normal menses"],
["Thromboxane", "Vasoconstriction; role in menorrhagia", "LOW in anovulatory DUB → no dysmenorrhea"],
["Progesterone", "Increases PGF2α from arachidonic acid", "ABSENT (no ovulation, no corpus luteum)"],
]
story.append(make_table(
["Mediator", "Action", "In Anovulatory DUB"],
[r[1:] for r in patho_data[1:]],
col_widths=[W*0.22, W*0.42, W*0.36],
header_bg=colors.HexColor("#4A148C"),
))
story.append(Spacer(1, 0.3*cm))
story.append(tip_box("WHY IS METROPATHIA HEMORRHAGICA PAINLESS? → Decreased PGF2α, low PGF2α/PGE2 ratio, low thromboxane → NO vasoconstriction → NO pain!"))
story.append(Spacer(1, 0.3*cm))
# ════════════════════════════════════════════════════════════════════════════════
# 4. ENDOMETRIAL BIOPSY FINDINGS
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("4. ENDOMETRIAL BIOPSY FINDINGS IN DUB", bg=ACCENT_TEAL))
story.append(Spacer(1, 0.2*cm))
eb_data = [
["Condition", "Biopsy Timing", "Histological Finding"],
["Polymenorrhea", "Prior to / within few hours of menstruation", "Secretory changes"],
["Oligomenorrhea", "Prior to / within few hours of menstruation", "Secretory changes"],
["Irregular Shedding", "5th-6th DAY after menstruation starts ★", "MIXTURE of secretory + proliferative; TOTAL ABSENCE of surface epithelium"],
["Irregular Ripening", "Prior to or soon after spotting", "PATCHY secretory changes amidst proliferative endometrium"],
["Cystic Glandular Hyperplasia", "Any time", "Cystic glandular hypertrophy; Swiss cheese pattern; columnar epithelium; NO secretory changes"],
["Atrophic Endometrium", "Any time", "Thin atrophic endometrium; dilated capillaries beneath atrophic surface epithelium"],
]
story.append(make_table(
["Condition", "Biopsy Timing", "Histological Finding"],
[r[1:] for r in eb_data[1:]],
col_widths=[W*0.25, W*0.28, W*0.47],
header_bg=ACCENT_TEAL,
))
story.append(Spacer(1, 0.3*cm))
story.append(alert_box("★ Exam Trap: Irregular SHEDDING biopsy → 5th-6th day (NOT before menses — taken AFTER it starts!)"))
story.append(Spacer(1, 0.3*cm))
# ════════════════════════════════════════════════════════════════════════════════
# 5. WHEN IS ENDOMETRIAL BIOPSY INDICATED?
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("5. WHEN TO PERFORM ENDOMETRIAL BIOPSY?", bg=ACCENT_RED))
story.append(Spacer(1, 0.2*cm))
eb_ind = [
["Age Group", "Indication", "Priority"],
["Adolescent / Pubertal\n(< 20 yrs)", "Only if bleeding fails to stop with medical therapy OR severe in nature", "RARELY needed"],
["Childbearing Period\n(20-40 yrs)", "IF BLEEDING IS ACYCLIC — risk of endometrial carcinoma is LOW in this group", "Done when acyclic"],
["Postmenopausal\n(> 40 yrs)", "MANDATORY to exclude endometrial malignancy; Pipelle sampler (OPD, no anesthesia)", "ALWAYS MANDATORY ★"],
]
story.append(make_table(
["Age Group", "Indication", "Priority"],
[r[1:] for r in eb_ind[1:]],
col_widths=[W*0.24, W*0.52, W*0.24],
header_bg=ACCENT_RED,
))
story.append(Spacer(1, 0.3*cm))
# ════════════════════════════════════════════════════════════════════════════════
# 6. INVESTIGATIONS SUMMARY
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("6. INVESTIGATIONS SUMMARY"))
story.append(Spacer(1, 0.2*cm))
inv_data = [
["Investigation", "Method / Tool", "Key Point"],
["Blood tests", "Hb (every case); ferritin (NOT routine in menorrhagia)", "Pubertal: platelet count, PT, BT, APTT; Thyroid: TSH, T3, T4"],
["TVS + Color Doppler", "Transvaginal sonography", "ET ≥ 12mm = hyperplasia; ET ≤ 4mm = atrophic; sensitive for fibroid, adenomyosis"],
["SIS", "Saline Infusion Sonography", "Superior to TVS for polyps, submucous fibroids, intrauterine abnormality (septate uterus)"],
["Hysteroscopy + Biopsy (H&B)", "Direct visualization + directed biopsy", "REPLACED conventional D&C; detects polyps + submucous fibroids missed by curettage"],
["Pipelle Sampler", "Endometrial sampling (OPD)", "Cannot detect polyps or submucous fibroids; MANDATORY in postmenopausal"],
["Laparoscopy", "Pelvic visualization", "Exclude endometriosis, PID, ovarian tumor (granulosa cell tumor); urgent if pelvic pain"],
["D&C (Diagnostic)", "Dilatation and curettage", "Currently NOT recommended as diagnostic tool or therapy"],
]
story.append(make_table(
["Investigation", "Method / Tool", "Key Point"],
[r[1:] for r in inv_data[1:]],
col_widths=[W*0.22, W*0.28, W*0.50],
))
story.append(Spacer(1, 0.3*cm))
story.append(alert_box("D&C PRESENTLY: Should be used NEITHER as a diagnostic tool NOR for purpose of therapy (replaced by H&B)"))
story.append(Spacer(1, 0.4*cm))
# PAGE BREAK
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════════
# 7. MEDICAL MANAGEMENT
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("7. MEDICAL MANAGEMENT OF DUB — DRUG TABLE"))
story.append(Spacer(1, 0.2*cm))
drug_data = [
["Drug / Class", "Dose", "% Blood Loss Reduction", "Key Notes"],
["Mefenamic Acid (PSI)", "150-600 mg orally in divided doses during bleeding", "25-30%", "2nd line medical treatment; inhibits PG synthesis; side effects: headache, nausea"],
["Tranexamic Acid (Antifibrinolytic)", "Standard doses during bleeding phase", "50%", "2nd line therapy; esp. IUCD-induced; CONTRAINDICATED in thromboembolism history"],
["LNG-IUS (Progestogen IUCD)", "Levonorgestrel; effective 5 years", "97% ★★★", "FIRST LINE for HMB without structural/histological abnormality; medical hysterectomy"],
["Norethisterone/MPA (Progestin)", "MPA 10 mg/day 5th-25th day × 3 cycles OR 10 mg TDS × 90 days (continuous)", "Significant", "MAINLINE treatment; MPA preferred (doesn't alter serum lipids)"],
["Combined OCP", "5th-25th day × 3 cycles (ovulatory bleeding)", "50%", "Causes endometrial atrophy; suppresses H-P-O-E axis; also contraceptive"],
["Conjugated Estrogen (IV)", "25 mg IV every 4 hours till bleeding controlled", "Acute hemostasis", "Acute/severe bleeding; then switch to oral progestin + COC for long term"],
["Danazol (17α-ethynyl testosterone)", "200-400 mg daily in 4 divided doses × 6 months", "60%", "Recurrent symptoms / awaiting hysterectomy; induces amenorrhea at higher doses"],
["GnRH Agonists", "Subtherapeutic → reduces loss; Therapeutic → amenorrhea", "Variable", "Short-term for severe DUB; infertile patients; use before endometrial ablation"],
["Mifepristone (RU 486)", "Antiprogesterone (19-nor steroid)", "—", "Inhibits ovulation; induces amenorrhea; reduces myoma size"],
["Ormeloxifene (SERM)", "60 mg twice weekly × 3 months", "Significant", "Also used as oral contraceptive; reduces blood loss"],
["Desmopressin", "0.3 μg/kg IV or intranasally", "—", "von Willebrand's disease + Factor VIII deficiency ONLY"],
]
story.append(make_table(
["Drug / Class", "Dose", "% Blood Loss Reduction", "Key Notes"],
[r[1:] for r in drug_data[1:]],
col_widths=[W*0.22, W*0.25, W*0.13, W*0.40],
header_bg=colors.HexColor("#1B5E20"),
))
story.append(Spacer(1, 0.3*cm))
story.append(mnemonic_box(
'Mnemonic: Drug Order by Blood Loss Reduction — "LNG-97, Danazol-60, TA-50, COC-50, NSAID-25"',
[
"<b>L</b>NG-IUS → <b>97%</b> (L = Largest reduction)",
"<b>D</b>anazol → <b>60%</b>",
"<b>T</b>ranexamic acid → <b>50%</b>",
"<b>C</b>OC pills → <b>50%</b>",
"<b>N</b>SAIDs → <b>25-30%</b> (N = Narrowest reduction)",
],
bg=YELLOW_BG
))
story.append(Spacer(1, 0.3*cm))
story.append(tip_box("LNG-IUS = FIRST LINE for HMB without structural or histological abnormality (DC Dutta + FIGO)"))
story.append(Spacer(1, 0.3*cm))
# Progestin mechanism box
mech = [
Paragraph("<b>Progestin Mechanism (Antiestrogenic Actions):</b>", H3),
Paragraph("1. Stimulates 17β-hydroxy steroid dehydrogenase → converts estradiol to estrone (less potent)", BULLET),
Paragraph("2. Inhibits induction of estrogen receptor", BULLET),
Paragraph("3. Has antimitotic effect on endometrium", BULLET),
Paragraph("MPA preferred over Norethisterone → does NOT alter serum lipids", NOTE_STYLE),
]
mech_tbl = Table([[mech]], colWidths=[W])
mech_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL_BG),
("ROWPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 1, ACCENT_TEAL),
]))
story.append(mech_tbl)
story.append(Spacer(1, 0.3*cm))
# Uterine curettage timing table
story.append(section_header("8. UTERINE CURETTAGE TIMING TABLE", bg=ACCENT_TEAL))
story.append(Spacer(1, 0.2*cm))
curette_data = [
["Type of Bleeding", "When to Curette"],
["Cyclic — Menorrhagia", "5-6 days PRIOR to period"],
["Cyclic — Irregular Shedding", "5-6 days AFTER period starts"],
["Cyclic — Irregular Ripening", "Soon AFTER period starts"],
["Acyclic", "Soon AFTER period starts"],
["Continuous", "ANY time"],
]
story.append(make_table(
["Type of Bleeding", "When to Curette"],
[r[1:] for r in curette_data[1:]],
col_widths=[W*0.50, W*0.50],
header_bg=ACCENT_TEAL,
))
story.append(Spacer(1, 0.4*cm))
# ════════════════════════════════════════════════════════════════════════════════
# 9. SURGICAL MANAGEMENT — ENDOMETRIAL ABLATION
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("9. ENDOMETRIAL ABLATION — METHODS COMPARISON"))
story.append(Spacer(1, 0.2*cm))
abl_data = [
["Method", "Temperature / Energy", "Depth", "Duration", "Key Feature"],
["Uterine Thermal Balloon ★FIRST LINE", "87°C; hot normal saline", "—", "8-10 min", "No cervical dilatation needed; suitable if unfit for GA; Day care basis"],
["Microwave Endometrial Ablation", "75-80°C", "6 mm", "2-3 min (faster than TCRE)", "Outpatient; results similar to TCRE"],
["Novasure", "Bipolar radiofrequency; expandable base", "Entire endometrium", "90 sec", "CONTRAINDICATED: uterine cavity < 4cm, PID, cesarean delivery; pretreat with GnRH 3 wks"],
["TCRE (Transcervical Resection)", "Continuous flow resectoscope", "Basal layer + superficial myometrium", "Longer", "Must remove basal layer + superficial myometrium; failure if not removed"],
["Laser Ablation (Nd:YAG)", "Coagulation/vaporization/carbonization", "4-5 mm", "—", "Therapeutic Ashermann's + amenorrhea; when hysterectomy is contraindicated"],
["Roller Ball Ablation", "Electrical coagulation", "4 mm", "—", "First generation method; used with TCRE when myomectomy also planned"],
]
story.append(make_table(
["Method", "Temperature / Energy", "Depth", "Duration", "Key Feature"],
[r[1:] for r in abl_data[1:]],
col_widths=[W*0.22, W*0.18, W*0.14, W*0.10, W*0.36],
header_bg=colors.HexColor("#4E342E"),
))
story.append(Spacer(1, 0.3*cm))
results_tbl = Table([[
Paragraph("<b>Ablation Results:</b> Overall success 70-80% | Amenorrhea in 20-40% | Significant blood loss reduction in another 50% | 10% may need repeat/hysterectomy", BODY)
]], colWidths=[W])
results_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), GREEN_BG),
("ROWPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 1, ACCENT_TEAL),
]))
story.append(results_tbl)
story.append(Spacer(1, 0.3*cm))
story.append(mnemonic_box(
'Mnemonic for Ablation Depths: "Micro-6, Laser-5, Roller-4"',
[
"<b>Micro</b>wave → <b>6</b> mm",
"<b>Laser</b> (Nd:YAG) → <b>4-5</b> mm → Therapeutic Ashermann's",
"<b>Roller</b> ball → <b>4</b> mm",
"<b>Novasure</b> → <b>90 seconds</b> (fastest!)",
"<b>Thermal balloon</b> → <b>87°C</b> for <b>8-10 minutes</b>",
]
))
story.append(Spacer(1, 0.4*cm))
# PAGE BREAK
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════════
# 10. HIGH YIELD NUMBERS
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("10. HIGH YIELD NUMBERS — ONE LINERS"))
story.append(Spacer(1, 0.2*cm))
num_data = [
["Fact", "Value"],
["Incidence of DUB among outpatient new patients", "~10%"],
["Ovular : Anovular DUB ratio", "20% : 80%"],
["LNG-IUS blood loss reduction", "97%"],
["LNG-IUS effective duration", "5 years"],
["Danazol blood loss reduction", "60%"],
["Tranexamic acid blood loss reduction", "50%"],
["COC blood loss reduction", "50%"],
["NSAIDs blood loss reduction", "25-30%"],
["Endometrial ablation overall success", "70-80%"],
["Amenorrhea rate post-ablation", "20-40%"],
["Endometrial thickness — hyperplasia on TVS", "≥ 12 mm"],
["Endometrial thickness — atrophic on TVS", "≤ 4 mm"],
["Conjugated estrogen IV dose (acute bleeding)", "25 mg IV every 4 hours"],
["Uterus enlargement in Metropathia hemorrhagica", "8-10 weeks pregnancy size"],
["Normal endometrium in majority of DUB cases", "60% (normal secretory pattern)"],
["Hyperplastic endometrium in DUB", "30%"],
["Uterine thermal balloon temperature", "87°C for 8-10 minutes"],
["Microwave ablation temperature / depth", "75-80°C / 6 mm depth / 2-3 min"],
["Novasure global ablation time", "90 seconds"],
["Laser (Nd:YAG) ablation depth", "4-5 mm (therapeutic Ashermann's)"],
["Roller ball ablation depth", "4 mm"],
["Ormeloxifene dose", "60 mg twice weekly × 3 months"],
["Desmopressin dose", "0.3 μg/kg IV or intranasally"],
["Danazol dose duration", "200-400 mg/day × 6 months"],
["Continuous MPA duration", "10 mg TDS × at least 90 days"],
]
story.append(make_table(
["Fact", "Value"],
[r[1:] for r in num_data[1:]],
col_widths=[W*0.72, W*0.28],
header_bg=colors.HexColor("#37474F"),
))
story.append(Spacer(1, 0.4*cm))
# ════════════════════════════════════════════════════════════════════════════════
# 11. MNEMONICS SUMMARY PAGE
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("11. MNEMONICS COMPILATION", bg=colors.HexColor("#880E4F")))
story.append(Spacer(1, 0.2*cm))
story.append(mnemonic_box(
'Mnemonic 1: DUB Management Depends On — "A-Age, B-Baby, C-Count(severity), D-Disease(pathology)"',
[
"<b>A</b> — Age",
"<b>B</b> — Baby desire (desire for child bearing)",
"<b>C</b> — Count of bleeding (Severity of bleeding)",
"<b>D</b> — Disease associated (Associated pathology)",
]
))
story.append(Spacer(1, 0.2*cm))
story.append(mnemonic_box(
'Mnemonic 2: Progestin Mechanism — "E-R-A" (Antiestrogenic Actions)',
[
"<b>E</b> — Enzyme (17β-HSD) converts estradiol to estrone (less potent)",
"<b>R</b> — Receptor (inhibits induction of estrogen receptor)",
"<b>A</b> — Antimitotic effect on endometrium",
],
bg=TEAL_BG
))
story.append(Spacer(1, 0.2*cm))
story.append(mnemonic_box(
'Mnemonic 3: Ablation Methods Ordered by Approval/Line — "T-M-N-TC-L-R"',
[
"<b>T</b>hermal Balloon → FIRST LINE (Day care)",
"<b>M</b>icrowave → Outpatient, 6mm, 75-80°C, 2-3 min",
"<b>N</b>ovasure → 90 seconds, radiofrequency",
"<b>TC</b>RE → Continuous flow resectoscope",
"<b>L</b>aser Nd:YAG → 4-5mm, therapeutic Ashermann's",
"<b>R</b>oller Ball → 4mm, first generation",
],
bg=GREEN_BG
))
story.append(Spacer(1, 0.2*cm))
story.append(mnemonic_box(
'Mnemonic 4: Cystic Glandular Hyperplasia Features — "SWISS CHEESE PREMAS"',
[
"<b>S</b>chroeder's disease (synonym)",
"<b>W</b>ithout progesterone (unopposed estrogen)",
"<b>I</b>nterference of rhythmic gonadotropin secretion",
"<b>S</b>wiss cheese pattern (microscopy)",
"<b>S</b>tart preceded by amenorrhea for 6-8 weeks",
"<b>C</b>olumnar epithelium lines the glands",
"<b>H</b>ypertrophy, NOT hyperplasia of glands (cystic)",
"<b>E</b>ndometrium: thick + congested + polypoidal",
"<b>E</b>xclusion: ectopic pregnancy / disturbed intrauterine pregnancy",
"<b>S</b>E = absolutely painless (no thromboxane/PGF2α)",
"<b>E</b>strogen unopposed = mechanism",
],
bg=YELLOW_BG
))
story.append(Spacer(1, 0.2*cm))
story.append(mnemonic_box(
'Mnemonic 5: Investigations Summary — "BHE-SLT" (Blood, Hysteroscopy, Endometrial sampling, Saline SIS, Lap, TVS)',
[
"<b>B</b>lood values (Hb, serum ferritin NOT routine, platelet count in pubertal, TSH/T3/T4)",
"<b>H</b>ysteroscopy + directed biopsy (H&B) — replaced D&C",
"<b>E</b>ndometrial sampling (Pipelle) — OPD, mandatory postmenopause",
"<b>S</b>IS (Saline Infusion Sonography) — polyps, submucous fibroids",
"<b>L</b>aparoscopy — exclude endometriosis, PID, ovarian tumor",
"<b>T</b>VS + Color Doppler — measure ET, structural abnormalities",
],
bg=TEAL_BG
))
story.append(Spacer(1, 0.4*cm))
# ════════════════════════════════════════════════════════════════════════════════
# 12. TOP 10 EXAM QUESTIONS
# ════════════════════════════════════════════════════════════════════════════════
story.append(section_header("12. TOP 10 EXAM QUESTIONS & ANSWERS", bg=ACCENT_RED))
story.append(Spacer(1, 0.2*cm))
qa_data = [
["#", "Question", "One-Line Answer"],
["Q1", "Define DUB and its origin", "AUB without organic/systemic/iatrogenic cause; origin = HPO axis (endocrine); diagnosis of exclusion"],
["Q2", "Why is Metropathia hemorrhagica absolutely painless?", "Decreased PGF2α, low PGF2α/PGE2 ratio, and low thromboxane → no vasoconstriction → no dysmenorrhea"],
["Q3", "First line treatment for HMB without structural/histological abnormality?", "LNG-IUS (Levonorgestrel IUS) — reduces blood loss by 97%; considered medical hysterectomy"],
["Q4", "When is endometrial biopsy mandatory?", "Postmenopausal period — ALWAYS mandatory to exclude endometrial malignancy"],
["Q5", "Biopsy timing in irregular shedding of endometrium?", "5th-6th day after menstruation starts; shows mixture of secretory + proliferative + absent surface epithelium"],
["Q6", "What has replaced conventional D&C in DUB?", "Hysteroscopy + directed biopsy (H&B) — can be done as outpatient; replaced conventional D&C"],
["Q7", "Endometrial biopsy finding in cystic glandular hyperplasia?", "Swiss cheese pattern; cystic glandular hypertrophy; columnar epithelium; NO secretory changes"],
["Q8", "Which ablation method is considered first line and done as day care?", "Uterine Thermal Balloon (87°C × 8-10 min); no cervical dilatation needed"],
["Q9", "Contraindications to Novasure ablation?", "Uterine cavity < 4 cm, PID, previous cesarean delivery"],
["Q10", "Drug of choice in DUB with von Willebrand's disease?", "Desmopressin (0.3 μg/kg IV or intranasally) — synthetic analog of arginine-vasopressin"],
]
story.append(make_table(
["#", "Question", "One-Line Answer"],
[r[1:] for r in qa_data[1:]],
col_widths=[W*0.05, W*0.38, W*0.57],
header_bg=ACCENT_RED,
))
story.append(Spacer(1, 0.4*cm))
# FOOTER
footer = Table([[
Paragraph(
"Source: DC Dutta's Textbook of Gynecology, Chapter 15 — Abnormal Uterine Bleeding (AUB) | "
"Quick Reference Notes for Exam Preparation",
SMALL
)
]], colWidths=[W])
footer.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("ROWPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
]))
story.append(footer)
# ── Build ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT}")
cd /home/daytona/workspace/dub-notes && python generate_dub_pdf.py 2>&1
ls -lh /home/daytona/workspace/dub-notes/DUB_Quick_Reference.pdf
DUB Quick Reference
PDF Document · PDF
| Section | Content |
|---|---|
| 1. Definitions | DUB, HMB, Metropathia hemorrhagica with key points |
| 2. Classification | Ovular (20%) vs Anovular (80%) table |
| 3. Pathophysiology | PGF2α / PGE2 / Thromboxane table + why Metropathia is painless |
| 4. Endometrial Biopsy Findings | All conditions with timing and histology |
| 5. When to do EB | Age-wise indications table |
| 6. Investigations Summary | All tools from Hb to Laparoscopy |
| 7. Medical Management | Drug table with doses + % blood loss reduction |
| 8. Uterine Curettage Timing | Cyclic vs acyclic vs continuous |
| 9. Endometrial Ablation | All 6 methods - temperature, depth, duration |
| 10. High-Yield Numbers | 25 key numerical facts |
| 11. Mnemonics | 5 color-coded mnemonics (ABCD, ERA, SWISS CHEESE, etc.) |
| 12. Top 10 Exam Q&A | Classic exam questions with one-line answers |
Generate a long answer exam oriented notes on DUB of 4 pages only covering all the heading
~/dub-notes/generate_dub_long_answer.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
OUTPUT = "/home/daytona/workspace/dub-notes/DUB_Long_Answer_Notes.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.6*cm, rightMargin=1.6*cm,
topMargin=1.4*cm, bottomMargin=1.4*cm,
)
W = A4[0] - 3.2*cm
# ── Colours ───────────────────────────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#0D1B4B")
MED_BLUE = colors.HexColor("#1565C0")
STEEL = colors.HexColor("#37474F")
TEAL = colors.HexColor("#00695C")
RED = colors.HexColor("#B71C1C")
GOLD = colors.HexColor("#E65100")
PURPLE = colors.HexColor("#4A148C")
WHITE = colors.white
LIGHT_BLUE = colors.HexColor("#E3F2FD")
LIGHT_TEAL = colors.HexColor("#E0F2F1")
LIGHT_RED = colors.HexColor("#FFEBEE")
LIGHT_GOLD = colors.HexColor("#FFF3E0")
LIGHT_GREY = colors.HexColor("#F5F5F5")
GREY_TEXT = colors.HexColor("#212121")
MID_GREY = colors.HexColor("#455A64")
# ── Styles ────────────────────────────────────────────────────────────────────
COVER_TITLE = ParagraphStyle("CT",
fontSize=17, fontName="Helvetica-Bold", textColor=WHITE,
alignment=TA_CENTER, spaceAfter=3, leading=22)
COVER_SUB = ParagraphStyle("CS",
fontSize=9, fontName="Helvetica", textColor=LIGHT_BLUE,
alignment=TA_CENTER, spaceAfter=2)
H1 = ParagraphStyle("H1",
fontSize=9.5, fontName="Helvetica-Bold", textColor=WHITE,
alignment=TA_LEFT, spaceAfter=0, leading=13)
H2 = ParagraphStyle("H2",
fontSize=9, fontName="Helvetica-Bold", textColor=DARK_BLUE,
alignment=TA_LEFT, spaceAfter=1, spaceBefore=3, leading=12)
H3 = ParagraphStyle("H3",
fontSize=8.5, fontName="Helvetica-Bold", textColor=TEAL,
alignment=TA_LEFT, spaceAfter=1, spaceBefore=2, leading=11)
BODY = ParagraphStyle("BODY",
fontSize=8, fontName="Helvetica", textColor=GREY_TEXT,
alignment=TA_JUSTIFY, spaceAfter=1, leading=11)
BULLET = ParagraphStyle("BUL",
fontSize=8, fontName="Helvetica", textColor=GREY_TEXT,
leftIndent=10, firstLineIndent=-7, spaceAfter=1, leading=11)
BULLET2 = ParagraphStyle("BUL2",
fontSize=7.5, fontName="Helvetica", textColor=MID_GREY,
leftIndent=20, firstLineIndent=-8, spaceAfter=0.5, leading=10)
TH = ParagraphStyle("TH",
fontSize=7.5, fontName="Helvetica-Bold", textColor=WHITE,
alignment=TA_CENTER, leading=10)
TC = ParagraphStyle("TC",
fontSize=7.5, fontName="Helvetica", textColor=GREY_TEXT,
alignment=TA_LEFT, leading=10)
TCB = ParagraphStyle("TCB",
fontSize=7.5, fontName="Helvetica-Bold", textColor=DARK_BLUE,
alignment=TA_LEFT, leading=10)
TCC = ParagraphStyle("TCC",
fontSize=7.5, fontName="Helvetica", textColor=GREY_TEXT,
alignment=TA_CENTER, leading=10)
ALERT = ParagraphStyle("ALERT",
fontSize=8, fontName="Helvetica-Bold", textColor=RED,
alignment=TA_LEFT, leading=11)
NOTE = ParagraphStyle("NOTE",
fontSize=7.5, fontName="Helvetica-Oblique", textColor=TEAL,
alignment=TA_LEFT, leading=10)
FOOT = ParagraphStyle("FOOT",
fontSize=7, fontName="Helvetica", textColor=LIGHT_BLUE,
alignment=TA_CENTER, leading=9)
def sec(text, bg=MED_BLUE):
t = Table([[Paragraph(text, H1)]], colWidths=[W])
t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), bg),
("TOPPADDING", (0,0),(-1,-1), 4),
("BOTTOMPADDING",(0,0),(-1,-1), 4),
("LEFTPADDING", (0,0),(-1,-1), 7),
]))
return t
def box(content_list, bg=LIGHT_BLUE, border=MED_BLUE):
t = Table([[content_list]], colWidths=[W])
t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), bg),
("TOPPADDING", (0,0),(-1,-1), 4),
("BOTTOMPADDING",(0,0),(-1,-1), 4),
("LEFTPADDING", (0,0),(-1,-1), 7),
("BOX", (0,0),(-1,-1), 0.8, border),
]))
return t
def tbl(headers, rows, cw, hbg=MED_BLUE, alt=LIGHT_GREY):
data = [[Paragraph(h, TH) for h in headers]]
for i, row in enumerate(rows):
cells = []
for j, cell in enumerate(row):
s = TCB if j == 0 else TC
cells.append(Paragraph(str(cell), s))
data.append(cells)
t = Table(data, colWidths=cw)
ts = [
("BACKGROUND", (0,0),(-1,0), hbg),
("TOPPADDING", (0,0),(-1,-1), 3),
("BOTTOMPADDING",(0,0),(-1,-1), 3),
("LEFTPADDING", (0,0),(-1,-1), 4),
("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#BDBDBD")),
("VALIGN", (0,0),(-1,-1), "MIDDLE"),
]
for i in range(1, len(data)):
if i % 2 == 0:
ts.append(("BACKGROUND", (0,i),(-1,i), alt))
t.setStyle(TableStyle(ts))
return t
sp = lambda h=0.15: Spacer(1, h*cm)
# ══════════════════════════════════════════════════════════════════════════════
story = []
# ── COVER ──────────────────────────────────────────────────────────────────────
cov = Table([[
Paragraph("DYSFUNCTIONAL UTERINE BLEEDING (DUB)", COVER_TITLE),
Paragraph("Long Answer Exam Notes · DC Dutta's Textbook of Gynecology, Ch. 15", COVER_SUB),
Paragraph("Definitions · Incidence · Pathophysiology · Classification · Types · Endometrial Patterns · Investigations · Management · Surgical Options · AUB / PALM-COEIN", COVER_SUB),
]], colWidths=[W])
cov.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), DARK_BLUE),
("TOPPADDING", (0,0),(-1,-1), 9),
("BOTTOMPADDING",(0,0),(-1,-1), 9),
("LEFTPADDING", (0,0),(-1,-1), 10),
]))
story += [cov, sp(0.3)]
# ══════════════════════════════════════════════════════════════════════════════
# 1. DEFINITION + INCIDENCE
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("1. DEFINITION AND INCIDENCE"))
story += [sp(0.15),
Paragraph("<b>DUB</b> is defined as a <b>state of abnormal uterine bleeding without any clinically detectable organic, systemic, and iatrogenic cause</b> (pelvic pathology e.g. tumour, inflammation, or pregnancy is <b>excluded</b>). It results from dysfunction of the <b>hypothalamo-pituitary-ovarian (HPO) axis</b> — an endocrine origin.", BODY),
Paragraph("<b>Heavy Menstrual Bleeding (HMB)</b> is defined as bleeding that <b>interferes with woman's physical, emotional, social and maternal quality of life</b>.", BODY),
sp(0.1),
]
story.append(box([
Paragraph("⚠ KEY EXAM POINT: DUB is a <b>diagnosis of exclusion</b>. Organic (fibroids, polyps, malignancy), systemic (bleeding disorders, thyroid), iatrogenic (OCP, IUCD), and pregnancy-related causes must be ruled out first.", ALERT)
], bg=LIGHT_RED, border=RED))
story += [sp(0.15),
Paragraph("<b>Incidence:</b> Prevalence varies widely; approximately <b>10% of new outpatients</b> attending gynaecology clinics. Diagnosis based on exclusion of organic lesion.", BODY),
sp(0.2),
]
# ══════════════════════════════════════════════════════════════════════════════
# 2. PATHOPHYSIOLOGY
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("2. PATHOPHYSIOLOGY", bg=STEEL))
story += [sp(0.15),
Paragraph("<b>Normal Haemostasis in Menstruation</b> involves:", H3),
Paragraph("(1) Platelet adhesion formation (2) Platelet plug + fibrin to seal bleeding vessels (3) Localised vasoconstriction (4) Regeneration of endometrium (5) Biological mechanism: increased ratio of <b>PGF2α/PGE2</b>", BODY),
sp(0.1),
]
patho_rows = [
["PGF2α", "Vasoconstriction + reduces bleeding", "DECREASED → excess bleeding"],
["PGE2", "Vasodilation → promotes bleeding", "PGF2α/PGE2 ratio is LOW in anovulatory DUB"],
["Progesterone", "Increases PGF2α from arachidonic acid; increases endothelin", "ABSENT (no ovulation, no corpus luteum)"],
["Thromboxane", "Vasoconstriction; role in haemostasis", "LOW in anovulatory DUB → no dysmenorrhoea"],
["Endothelin", "Powerful vasoconstrictor", "Decreased in anovulatory DUB"],
]
story.append(tbl(["Mediator", "Normal Action", "In Anovulatory DUB"],
patho_rows, [W*0.18, W*0.42, W*0.40], hbg=STEEL))
story += [sp(0.15),
Paragraph("<b>Endometrial abnormalities</b> may be primary or secondary to <b>incoordination in the hypothalamo-pituitary-ovarian axis</b>. More prevalent in extremes of reproductive period — adolescence, menopause, following childbirth and abortion. Abnormal bleeding may be associated with or without ovulation.", BODY),
sp(0.1),
Paragraph("ⓘ WHY IS METROPATHIA HEMORRHAGICA PAINLESS? Decreased synthesis of PGF2α, low PGF2α/PGE2 ratio, and low thromboxane → no vasoconstriction → DUB of this type is <b>absolutely painless</b>.", NOTE),
sp(0.2),
]
# ══════════════════════════════════════════════════════════════════════════════
# 3. CLASSIFICATION
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("3. CLASSIFICATION OF DUB", bg=TEAL))
story += [sp(0.15)]
class_rows = [
["OVULAR (Cyclical)", "20%", "Polymenorrhea/Polymenorrhagia | Oligomenorrhoea | Functional Menorrhagia:\n• Irregular shedding of endometrium\n• Irregular ripening of endometrium"],
["ANOVULAR (Acyclical)", "80% ★ More common", "Menorrhagia (anovulatory)\nCystic Glandular Hyperplasia (Metropathia haemorrhagica / Schroeder's disease)"],
]
story.append(tbl(["Type", "% of DUB", "Subtypes"],
class_rows, [W*0.20, W*0.18, W*0.62], hbg=TEAL))
story += [sp(0.2)]
# ══════════════════════════════════════════════════════════════════════════════
# 4. TYPES — OVULAR BLEEDING
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("4. OVULAR BLEEDING — TYPES AND FEATURES", bg=PURPLE))
story += [sp(0.15),
Paragraph("<b>A. Polymenorrhoea / Polymenorrhagia</b>", H2),
Paragraph("Occurs following childbirth, abortion, during adolescence, premenopausal period and in pelvic inflammatory disease. Follicular development is sped up → <b>shortening of follicular phase</b>. Luteal phase may shorten due to <b>premature lysis of corpus luteum</b>. Endometrial study prior to/within few hours of menstruation reveals <b>secretory changes</b>.", BODY),
sp(0.1),
Paragraph("<b>B. Oligomenorrhoea</b>", H2),
Paragraph("Primary ovarian oligomenorrhoea rare; met in adolescence and preceding menopause. Due to ovarian unresponsiveness to FSH or pituitary dysfunction. Undue prolongation of <b>proliferative phase</b> with normal secretory phase. Endometrial study reveals <b>secretory changes</b>.", BODY),
sp(0.1),
Paragraph("<b>C. Functional Menorrhagia — Two Varieties:</b>", H2),
sp(0.05),
]
story.append(tbl(
["Variety", "Mechanism", "Biopsy Timing", "Histological Finding"],
[
["Irregular Shedding of Endometrium",
"Incomplete LH withdrawal on 26th day → incomplete corpus luteum atrophy → persistent progesterone. OR persistent LH → ↓FSH → ↓follicle ripening → less estrogen → less regeneration",
"5th-6th DAY after menstruation starts ★",
"MIXTURE of secretory + proliferative endometrium; TOTAL ABSENCE of surface epithelium"],
["Irregular Ripening of Endometrium",
"Poor corpus luteum formation; inadequate secretion of both estrogen and progesterone; slight bleeding prior to proper flow",
"Prior to or soon after spotting",
"PATCHY areas of secretory changes amidst proliferative endometrium"],
],
[W*0.18, W*0.32, W*0.20, W*0.30],
hbg=PURPLE
))
story += [sp(0.1),
Paragraph("★ <b>Exam Trap:</b> Irregular shedding biopsy taken on <b>5th-6th DAY</b> (not before menses — taken AFTER menses starts). Normally endometrium regenerates by 3rd day.", NOTE),
sp(0.2),
]
# ══════════════════════════════════════════════════════════════════════════════
# 5. ANOVULAR BLEEDING
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("5. ANOVULAR BLEEDING — TYPES AND FEATURES (80% OF DUB)", bg=RED))
story += [sp(0.15),
Paragraph("<b>A. Anovulatory Menorrhagia</b>", H2),
Paragraph("No corpus luteum formed → <b>no limiting progesterone</b> → endometrial growth under unopposed estrogen throughout cycle. Inadequate structural stromal support → endometrium remains fragile. Negative feedback of FSH → endometrial shedding continues in <b>asynchronous sequences</b> due to lack of compactness.", BODY),
sp(0.15),
Paragraph("<b>B. Cystic Glandular Hyperplasia (Metropathia Haemorrhagica / Schroeder's Disease)</b>", H2),
Paragraph("<b>Usually met in premenopausal women.</b> Basic fault: disturbance of rhythmic secretion of gonadotropins. There is slow increase in estrogen secretion with <b>no negative feedback inhibition of FSH</b>. Gradual rise in estrogen + <b>amenorrhoea for 6–8 weeks</b>. Endometrium under unopposed estrogen → endometrial shedding with <b>heavy bleeding</b> (absolutely painless).", BODY),
sp(0.1),
]
story.append(tbl(
["Feature", "Details"],
[
["Uterus size", "Symmetrical enlargement to 8-10 weeks size (simultaneous hypertrophy of muscles)"],
["Gross endometrium", "Thick, congested, often polypoidal (multiple polyposis)"],
["Microscopy", "Marked cystic glandular HYPERTROPHY (not hyperplasia); marked disparity in gland sizes; SWISS CHEESE pattern (Fig 15.3); glands lined by columnar epithelium; NO secretory changes; areas of necrosis in superficial layers"],
["Ovarian changes", "Cystic changes (follicular type); NO corpus luteum"],
["Pain", "ABSOLUTELY PAINLESS (low PGF2α, low PGF2α/PGE2, low thromboxane)"],
["Diagnosis confusion", "Phase of amenorrhoea + bleeding PV can mimic disturbed pregnancy or ectopic gestation in postmenopausal women; unlike normal menses — NO uniform sloughing to basal layer"],
],
[W*0.22, W*0.78],
hbg=RED
))
story += [sp(0.1),
Paragraph("<b>Atrophy of Endometrium:</b> Common in postmenopausal women; may occur in reproductive period as final involutionary state. Bleeding from rupture of dilated capillaries beneath atrophic surface epithelium. Cause: total absence of estrogen OR failure of uterine receptors to respond to estrogen.", BODY),
sp(0.2),
]
# ══════════════════════════════════════════════════════════════════════════════
# 6. ENDOMETRIAL PATTERN IN DUB
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("6. ENDOMETRIAL PATTERN IN DUB", bg=STEEL))
story += [sp(0.15)]
story.append(tbl(
["Pattern", "Frequency", "Notes"],
[
["Normal secretory", "60% (majority)", "Most common finding in DUB"],
["Hyperplastic (Cystic Glandular Hyperplasia)", "~30%", "Second most common; Swiss cheese appearance"],
["Irregular shedding / Irregular ripening / Atrophic", "Remaining ~10%", "Seen in extremes of reproductive period"],
],
[W*0.35, W*0.20, W*0.45],
hbg=STEEL
))
story += [sp(0.2)]
# PAGE BREAK
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# 7. INVESTIGATIONS
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("7. INVESTIGATIONS IN DUB", bg=colors.HexColor("#1B5E20")))
story += [sp(0.1),
Paragraph("<b>Aims of investigation:</b> (i) Confirm menstrual abnormality (ii) Exclude systemic, iatrogenic or organic pelvic pathology (iii) Identify probable aetiology (iv) Work out definite therapy protocol", BODY),
sp(0.1),
Paragraph("<b>History:</b> Bleeding through vagina (not urethra/rectum); assessed by number of pads, clots (size and number), duration. Estimated Hb to assess blood loss. Nature: cyclic or acyclic, relation to parity, pregnancy events, last normal cycle. History of OCP/IUCD insertion, history suggestive of bleeding disorders.", BODY),
sp(0.1),
Paragraph("<b>Internal Examination:</b> Bimanual + speculum in all cases except virgins. Rectal examination in virgins. If vaginal examination required in a virgin — under GA + endometrial curettage simultaneously.", BODY),
sp(0.1),
]
story.append(tbl(
["Investigation", "Specifics", "Key Fact"],
[
["Blood values", "Hb — every case; serum ferritin NOT routine in menorrhagia; pubertal: platelet count, PT, BT, APTT; thyroid dysfunction: TSH, T3, T4", "Hb gives indirect assessment of chronic blood loss"],
["TVS + Color Doppler", "Endometrial thickness ≥12 mm = hyperplasia; ≤4 mm = atrophic; hyperechoic and regular outline; angiogenesis signal", "Very sensitive for fibroid, adenomyosis; detect anatomical abnormality of uterus and adnexae"],
["SIS (Saline Infusion Sonography)", "Found superior to TVS for endometrial polyps, submucous fibroids, intrauterine abnormality (septate/subseptate uterus)", "Preferred over TVS for intrauterine structural diagnosis"],
["Hysteroscopy + Directed Biopsy (H&B)", "Better evaluation; biopsy from offending site under direct vision; can be done as outpatient basis", "REPLACED conventional D&C; frequent findings of polyp and submucous fibroid MISSED by blind curettage"],
["Pipelle Sampler (Endometrial Sampling)", "OPD procedure; easy to use; no anaesthesia needed", "CANNOT detect polyps or submucous fibroids; MANDATORY in postmenopausal women"],
["Laparoscopy", "Exclude endometriosis, PID, ovarian tumour (granulosa cell tumour)", "Urgent if associated with pelvic pain; for selected cases"],
["Diagnostic Curettage D&C", "To exclude organic lesions, determine functional state, incidental therapeutic benefit", "Currently NOT recommended as diagnostic tool or for therapy (replaced by H&B)"],
],
[W*0.20, W*0.45, W*0.35],
hbg=colors.HexColor("#1B5E20")
))
story += [sp(0.1)]
story.append(tbl(
["Age Group", "Indication for Endometrial Biopsy", "Priority"],
[
["Adolescent / Pubertal < 20 yrs", "Only if bleeding fails to stop with medical therapy OR severe in nature", "RARELY needed"],
["Childbearing Period 20-40 yrs", "ONLY if bleeding is ACYCLIC — risk of endometrial carcinoma is very low", "Done when acyclic"],
["Postmenopausal > 40 yrs", "MANDATORY to exclude endometrial malignancy; Pipelle sampler available (OPD, no anaesthesia)", "ALWAYS MANDATORY ★"],
],
[W*0.23, W*0.52, W*0.25],
hbg=colors.HexColor("#1B5E20")
))
story += [sp(0.1),
Paragraph("<b>Summary of Investigations:</b> (a) Blood values (b) TVS, SIS — to exclude uterine structural abnormalities (c) Endometrial sampling with Pipelle or hysteroscopic-guided biopsy (d) Laparoscopy — for selected cases", NOTE),
sp(0.2),
]
# ══════════════════════════════════════════════════════════════════════════════
# 8. MANAGEMENT
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("8. MANAGEMENT OF DUB", bg=MED_BLUE))
story += [sp(0.1),
Paragraph("<b>Management depends on:</b> (A) Age (B) Desire for child bearing (C) Severity of bleeding (D) Associated pathology", BODY),
sp(0.1),
]
story.append(tbl(
["Age Group", "Category"],
[
["Pubertal and adolescent menorrhagia", "< 20 years — General measures + medical management"],
["Reproductive period", "20–40 years — Medical ± surgical based on response"],
["Premenopausal", "> 40 years — More aggressive; ablation or hysterectomy acceptable"],
["Postmenopausal", "Always investigate first; manage cause"],
],
[W*0.40, W*0.60],
hbg=MED_BLUE
))
story += [sp(0.1),
Paragraph("<b>General Measures:</b> Rest advised during bleeding phase. <b>Anaemia</b> corrected by diet, haematinics, blood transfusion. Any systemic or endocrinal abnormality investigated and treated.", BODY),
sp(0.15),
Paragraph("<b>A. MEDICAL MANAGEMENT — NON-HORMONAL</b>", H2),
sp(0.05),
]
story.append(tbl(
["Drug Class", "Drug", "Dose", "Blood Loss Reduction", "Notes"],
[
["Prostaglandin Synthetase Inhibitors (PSI)", "Mefenamic acid (Fenamate)", "150-600 mg orally in divided doses during bleeding", "25-30%", "2nd line; inhibits PG synthesis; side effects: headache, nausea; contraindicated in peptic ulcer"],
["Antifibrinolytic Agents", "Tranexamic acid (TA)", "Standard doses during bleeding phase", "50%", "2nd line therapy; useful in IUCD-induced menorrhagia; CONTRAINDICATED in history of thromboembolism"],
],
[W*0.18, W*0.15, W*0.20, W*0.13, W*0.34],
hbg=colors.HexColor("#37474F")
))
story += [sp(0.1),
Paragraph("<b>B. MEDICAL MANAGEMENT — HORMONAL</b>", H2),
Paragraph("With the introduction of potent orally active progestins, <b>they became the mainline in the management of DUB in all age groups</b> and practically replaced the isolated use of estrogens and androgens.", BODY),
sp(0.05),
]
story.append(tbl(
["Hormone", "Drug / Preparation", "Dose / Regimen", "Blood Loss Reduction", "Key Points"],
[
["Progestins (MAINLINE)", "Norethisterone acetate / MPA", "MPA 10 mg/day 5th-25th day × 3 cycles (cyclic);\nMPA 10 mg TDS × 90 days (continuous)", "Significant", "MPA preferred (does NOT alter serum lipids); mechanism: 17β-HSD enzyme → estradiol to estrone; inhibits ER; antimitotic on endometrium"],
["LNG-IUS ★ FIRST LINE", "Levonorgestrel IUS", "Effective for 5 years", "97%", "FIRST LINE for HMB without structural/histological abnormality; considered medical hysterectomy; induces glandular atrophy, decidualisation"],
["Combined OCP", "COC pills (combined oral contraceptive)", "5th-25th day × 3 cycles", "50%", "Causes endometrial atrophy; suppresses H-P-O-E axis; reduces blood loss by 50%; also contraceptive"],
["Estrogen (Acute bleeding)", "Conjugated estrogen", "25 mg IV every 4 hours till controlled", "Acute haemostasis", "Rapid growth of denuded endometrium + platelet adhesiveness; then switch to oral progestin + COC"],
["Danazol", "17α-ethynyl testosterone", "200-400 mg/day in 4 divided doses × 6 months", "60%", "Recurrent symptoms / awaiting hysterectomy; higher dose → amenorrhoea; side effects: androgenic"],
["GnRH Agonists", "GnRH analogs", "Subtherapeutic → reduces loss; Therapeutic → amenorrhoea", "Variable", "Short-term use for severe DUB; use before endometrial ablation; improves anaemia; hypoestrogenic side effects"],
["Mifepristone (RU 486)", "Antiprogesterone (19-nor steroid)", "Varying doses", "—", "Inhibits ovulation; induces amenorrhoea; reduces myoma size"],
["Ormeloxifene (SERM)", "Centchroman", "60 mg twice weekly × 3 months", "Significant", "Selective estrogen receptor modulator; also oral contraceptive"],
["Desmopressin", "Synthetic arginine-vasopressin analogue", "0.3 μg/kg IV or intranasally", "—", "ONLY for von Willebrand's disease + Factor VIII deficiency"],
],
[W*0.15, W*0.15, W*0.20, W*0.11, W*0.39],
hbg=MED_BLUE
))
story += [sp(0.1),
Paragraph("<b>Progestin Cyclic Regimens — Key Summary:</b>", H3),
Paragraph("• <b>To stop bleeding:</b> Norethisterone 5 mg TDS till bleeding stops (3-7 days), then COC long-term.", BULLET),
Paragraph("• <b>5th-25th day course:</b> MPA 10 mg/day × 3 cycles — causes endometrial atrophy; suppresses H-P-O-E axis; reduces blood loss 50%; also contraceptive.", BULLET),
Paragraph("• <b>15th-25th day course:</b> Dydrogesterone 10 mg OD or BD × 3 cycles — for ovular bleeding where pregnancy is desired or irregular shedding/ripening; does NOT suppress ovulation.", BULLET),
Paragraph("• <b>Estrogen (IV) mechanism:</b> Rapid growth of denuded endometrium; promotes platelet adhesiveness; controls bleeding by process of healing; preparation of endometrium; fibrinogen + factors V, X; platelet aggregation.", BULLET),
sp(0.2),
]
# ══════════════════════════════════════════════════════════════════════════════
# 9. SURGICAL MANAGEMENT
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("9. SURGICAL MANAGEMENT OF DUB", bg=colors.HexColor("#4E342E")))
story += [sp(0.1),
Paragraph("<b>Surgical options:</b> (1) Uterine curettage (2) Endometrial ablation / resection (3) Hysterectomy", BODY),
sp(0.1),
Paragraph("<b>A. Uterine Curettage</b>", H2),
Paragraph("Done predominantly as a <b>diagnostic tool</b> for elderly women but has haemostatic/therapeutic effect. Should be done following ultrasonography for detection of endometrial pathology. <b>Presently, D&C should be used NEITHER as a diagnostic tool NOR for the purpose of therapy</b> (replaced by H&B). Indication is urgent if bleeding is acyclic and endometrial pathology is suspected.", BODY),
sp(0.05),
]
story.append(tbl(
["Type of Bleeding", "Timing of Curettage"],
[
["Cyclic — Menorrhagia", "5-6 days PRIOR to period"],
["Cyclic — Irregular Shedding", "5-6 days AFTER period starts"],
["Cyclic — Irregular Ripening", "Soon AFTER period starts"],
["Acyclic", "Soon AFTER period starts"],
["Continuous", "ANY time"],
],
[W*0.50, W*0.50],
hbg=colors.HexColor("#4E342E")
))
story += [sp(0.1),
Paragraph("<b>B. Endometrial Ablation / Resection</b>", H2),
Paragraph("<b>Indications:</b> (a) Failed medical treatment (b) Women who do not wish to preserve menstrual or reproductive function (c) Uterus normal or ≤ 10 weeks size (d) Uterine fibroids < 3 cm (e) Women who no longer want surgery (f) Woman who prefers to preserve her uterus", BODY),
sp(0.05),
]
story.append(tbl(
["Method", "Temp / Energy", "Depth", "Duration", "Key Feature / Notes"],
[
["Uterine Thermal Balloon ★ FIRST LINE", "87°C; hot normal saline", "—", "8-10 min", "No cervical dilatation needed; suitable if unfit for GA/long surgery; FIRST LINE; Day care basis"],
["Microwave Endometrial Ablation", "75-80°C", "6 mm", "2-3 min (faster)", "Outpatient; results similar to TCRE; less costly than laser"],
["Novasure", "Bipolar radiofrequency; expandable base", "Entire endometrium", "90 sec", "CONTRAINDICATED: uterine cavity < 4cm, PID, cesarean delivery; pretreat GnRH/danazol 3 weeks prior"],
["TCRE (Transcervical Resection)", "Continuous flow resectoscope", "Basal layer + superficial myometrium", "Longer", "MUST remove basal layer + superficial myometrium; failure = regeneration"],
["Laser Ablation (Nd:YAG)", "Coagulation/ vaporization/ carbonization", "4-5 mm", "—", "Therapeutic Ashermann's + amenorrhoea; when hysterectomy contraindicated; completed families"],
["Roller Ball Ablation", "Electrical coagulation", "4 mm", "—", "First generation; used with TCRE when myomectomy planned simultaneously"],
],
[W*0.20, W*0.16, W*0.12, W*0.10, W*0.42],
hbg=colors.HexColor("#4E342E")
))
story += [sp(0.1),
Paragraph("<b>Results of Endometrial Ablation:</b> Overall success 70-80%. 20-40% women become amenorrhoeic. Another 50% have significant decrease in blood loss. 10% may need repeat procedure or hysterectomy.", NOTE),
Paragraph("<b>Uterine Artery Embolisation</b> — commonly done in women with large uterine fibroid (>3 cm) with heavy bleeding.", NOTE),
sp(0.1),
Paragraph("<b>C. Hysterectomy</b>", H2),
Paragraph("<b>Not recommended as first line therapy for HMB or DUB.</b> Justified when: (i) Conservative treatment fails or is contraindicated; (ii) Blood loss impairs health and quality of life; (iii) Endometrial hyperplasia with atypia on histology. Route: vaginal, abdominal, or laparoscopic assisted vaginal. Factors: uterine size, mobility, descent, previous surgery, comorbidities (obesity, diabetes, hypertension). Decision can be made as early as patient approaches 40. <b>Especially recommended in those under 45 years of age.</b>", BODY),
sp(0.2),
]
# PAGE BREAK
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# 10. AUB / PALM-COEIN
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("10. ABNORMAL UTERINE BLEEDING (AUB) — PALM-COEIN (FIGO/ACOG 2011)", bg=colors.HexColor("#880E4F")))
story += [sp(0.1),
Paragraph("Abnormal menstrual bleeding pattern has been traditionally expressed by terms like <b>menorrhagia, metrorrhagia, polymenorrhoea, and oligomenorrhoea</b>. To create a universally accepted nomenclature, the <b>International Federation of Gynaecology and Obstetrics (FIGO)</b> and ACOG introduced the PALM-COEIN classification (2011).", BODY),
sp(0.1),
]
story.append(tbl(
["PALM (Structural Causes)", "COEIN (Non-structural Causes)"],
[
["P — Polyp", "C — Coagulopathy"],
["A — Adenomyosis", "O — Ovulatory dysfunction"],
["L — Leiomyoma", "E — Endometrial"],
["M — Malignancy and hyperplasia", "I — Iatrogenic"],
["", "N — Not yet classified"],
],
[W*0.50, W*0.50],
hbg=colors.HexColor("#880E4F")
))
story += [sp(0.2)]
# ══════════════════════════════════════════════════════════════════════════════
# 11. HIGH-YIELD NUMBERS
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("11. HIGH-YIELD NUMBERS AND FACTS — AT A GLANCE", bg=STEEL))
story += [sp(0.1)]
num_left = [
["Fact", "Value"],
["Incidence of DUB (outpatients)", "~10%"],
["Ovular : Anovular ratio", "20% : 80%"],
["LNG-IUS blood loss reduction", "97% ★"],
["LNG-IUS effective duration", "5 years"],
["Danazol blood loss reduction", "60%"],
["Tranexamic acid blood loss reduction", "50%"],
["COC blood loss reduction", "50%"],
["NSAIDs (Mefenamic acid) blood loss reduction", "25-30%"],
["Endometrial ablation overall success", "70-80%"],
["Amenorrhoea rate post-ablation", "20-40%"],
["Normal secretory endometrium in DUB", "60% (most common)"],
["Hyperplastic endometrium in DUB", "~30%"],
]
num_right = [
["Measurement", "Value"],
["ET hyperplasia on TVS", "≥ 12 mm"],
["ET atrophic on TVS", "≤ 4 mm"],
["Uterus size in Metropathia", "8-10 weeks"],
["Conjugated estrogen IV dose", "25 mg every 4h"],
["Thermal balloon temperature", "87°C × 8-10 min"],
["Microwave temperature / depth", "75-80°C / 6 mm / 2-3 min"],
["Novasure ablation time", "90 seconds"],
["Laser (Nd:YAG) depth", "4-5 mm"],
["Roller ball depth", "4 mm"],
["Danazol dose", "200-400 mg/day × 6 months"],
["Ormeloxifene dose", "60 mg twice weekly × 3 months"],
["Desmopressin dose", "0.3 μg/kg IV or intranasally"],
]
# Build two-column table of numbers
left_rows = [[Paragraph(r[0], TCB if i==0 else TC), Paragraph(r[1], TCC if i==0 else TC)] for i, r in enumerate(num_left)]
right_rows = [[Paragraph(r[0], TCB if i==0 else TC), Paragraph(r[1], TCC if i==0 else TC)] for i, r in enumerate(num_right)]
# Pad to same length
while len(left_rows) < len(right_rows):
left_rows.append([Paragraph("", TC), Paragraph("", TC)])
while len(right_rows) < len(left_rows):
right_rows.append([Paragraph("", TC), Paragraph("", TC)])
combined = []
for l, r in zip(left_rows, right_rows):
combined.append(l + r)
num_tbl = Table(combined, colWidths=[W*0.28, W*0.14, W*0.36, W*0.22])
num_ts = [
("BACKGROUND", (0,0),(1,0), STEEL),
("BACKGROUND", (2,0),(3,0), STEEL),
("TEXTCOLOR", (0,0),(-1,0), WHITE),
("FONTNAME", (0,0),(-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0),(-1,-1), 7.5),
("TOPPADDING", (0,0),(-1,-1), 3),
("BOTTOMPADDING",(0,0),(-1,-1), 3),
("LEFTPADDING", (0,0),(-1,-1), 4),
("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#BDBDBD")),
("LINEAFTER", (1,0),(1,-1), 1.0, STEEL),
]
for i in range(1, len(combined)):
if i % 2 == 0:
num_ts.append(("BACKGROUND", (0,i),(1,i), LIGHT_GREY))
num_ts.append(("BACKGROUND", (2,i),(3,i), LIGHT_GREY))
num_tbl.setStyle(TableStyle(num_ts))
story += [num_tbl, sp(0.2)]
# ══════════════════════════════════════════════════════════════════════════════
# 12. COMMONLY ASKED EXAM QUESTIONS
# ══════════════════════════════════════════════════════════════════════════════
story.append(sec("12. COMMONLY ASKED EXAM QUESTIONS", bg=RED))
story += [sp(0.1)]
qa = [
["Q", "Question", "Model Answer"],
["1", "Define DUB and state its origin", "AUB without organic/systemic/iatrogenic cause; origin = HPO axis (endocrine); diagnosis of exclusion"],
["2", "Incidence and pathophysiology of DUB", "~10% outpatients; pathology = low PGF2α/PGE2 ratio, absent progesterone in anovulatory DUB"],
["3", "Classify DUB with types", "Ovular 20% (polymenorrhoea, oligomenorrhoea, irregular shedding/ripening) and Anovular 80% (menorrhagia, CGH)"],
["4", "Why is Metropathia hemorrhagica absolutely painless?", "Decreased PGF2α, low PGF2α/PGE2 ratio, low thromboxane → no vasoconstriction → no dysmenorrhoea"],
["5", "Biopsy finding and timing in irregular shedding", "5th-6th day after menses starts; mixture of secretory + proliferative; total absence of surface epithelium"],
["6", "Biopsy finding in Cystic Glandular Hyperplasia", "Swiss cheese pattern; cystic glandular hypertrophy; columnar epithelium; no secretory changes"],
["7", "First line treatment for HMB without structural abnormality", "LNG-IUS — reduces blood loss by 97%; effective for 5 years; considered medical hysterectomy"],
["8", "When is endometrial biopsy mandatory?", "Postmenopausal period — ALWAYS mandatory to exclude endometrial malignancy"],
["9", "What has replaced D&C in DUB?", "Hysteroscopy + directed biopsy (H&B) — OPD, detects polyps/fibroids missed by curettage"],
["10", "Which ablation is first line and done as day care?", "Uterine Thermal Balloon (87°C × 8-10 min); no cervical dilatation needed; suitable if unfit for GA"],
["11", "Novasure ablation contraindications", "Uterine cavity < 4 cm, PID, previous cesarean delivery"],
["12", "Drug of choice in DUB with von Willebrand's disease?", "Desmopressin 0.3 μg/kg IV or intranasally — synthetic analogue of arginine-vasopressin"],
["13", "Mechanism of progestins in DUB", "17β-HSD → estradiol to estrone (less potent); inhibits ER induction; antimitotic effect on endometrium"],
["14", "PALM-COEIN classification", "FIGO 2011; Structural: Polyp, Adenomyosis, Leiomyoma, Malignancy; Non-structural: Coagulopathy, Ovulatory, Endometrial, Iatrogenic, Not yet classified"],
["15", "When is hysterectomy justified in DUB?", "Failed conservative treatment; blood loss impairs QoL; endometrial hyperplasia with atypia; patient approaching 40"],
]
story.append(tbl(
["Q", "Question", "Model Answer"],
[r[1:] for r in qa[1:]],
[W*0.04, W*0.38, W*0.58],
hbg=RED
))
story += [sp(0.15)]
# FOOTER
foot = Table([[Paragraph(
"Source: DC Dutta's Textbook of Gynecology, Chapter 15 — Abnormal Uterine Bleeding (AUB) | "
"Long Answer Exam-Oriented Notes | All rights to original authors",
FOOT)]], colWidths=[W])
foot.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), DARK_BLUE),
("TOPPADDING", (0,0),(-1,-1), 4),
("BOTTOMPADDING",(0,0),(-1,-1), 4),
("LEFTPADDING", (0,0),(-1,-1), 8),
]))
story.append(foot)
# ── Build ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT}")
cd /home/daytona/workspace/dub-notes && python generate_dub_long_answer.py 2>&1
python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/dub-notes/DUB_Long_Answer_Notes.pdf') print(f'Pages: {len(r.pages)}') import os print(f'Size: {os.path.getsize(\"/home/daytona/workspace/dub-notes/DUB_Long_Answer_Notes.pdf\")/1024:.1f} KB') "
~/dub-notes/generate_dub_long_answer.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.styles import ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
OUTPUT = "/home/daytona/workspace/dub-notes/DUB_Long_Answer_Notes.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.2*cm, rightMargin=1.2*cm,
topMargin=1.0*cm, bottomMargin=1.0*cm,
)
W = A4[0] - 2.4*cm # ~175 mm
# ── Colours ──────────────────────────────────────────────────────────────────
C_DARK = colors.HexColor("#0D1B4B")
C_BLUE = colors.HexColor("#1565C0")
C_STEEL = colors.HexColor("#37474F")
C_TEAL = colors.HexColor("#00695C")
C_RED = colors.HexColor("#B71C1C")
C_PURP = colors.HexColor("#4A148C")
C_BROWN = colors.HexColor("#4E342E")
C_GREEN = colors.HexColor("#1B5E20")
C_PINK = colors.HexColor("#880E4F")
C_WHITE = colors.white
C_LBLUE = colors.HexColor("#E3F2FD")
C_LTEAL = colors.HexColor("#E0F2F1")
C_LRED = colors.HexColor("#FFEBEE")
C_LGREY = colors.HexColor("#F5F5F5")
C_LYELL = colors.HexColor("#FFFDE7")
C_TEXT = colors.HexColor("#212121")
C_MID = colors.HexColor("#455A64")
C_GOLD = colors.HexColor("#E65100")
def S(nm, **kw): return ParagraphStyle(nm, **kw)
# Compact styles — font size 7.2 base
COV_T = S("CT", fontSize=15, fontName="Helvetica-Bold", textColor=C_WHITE, alignment=TA_CENTER, leading=19)
COV_S = S("CS", fontSize=7.5, fontName="Helvetica", textColor=C_LBLUE, alignment=TA_CENTER, leading=9)
SH = S("SH", fontSize=8, fontName="Helvetica-Bold", textColor=C_WHITE, alignment=TA_LEFT, leading=10)
H2 = S("H2", fontSize=8, fontName="Helvetica-Bold", textColor=C_DARK, alignment=TA_LEFT, spaceAfter=1, spaceBefore=2, leading=10)
H3 = S("H3", fontSize=7.5, fontName="Helvetica-Bold", textColor=C_TEAL, alignment=TA_LEFT, spaceAfter=0, spaceBefore=1, leading=10)
BD = S("BD", fontSize=7.2, fontName="Helvetica", textColor=C_TEXT, alignment=TA_JUSTIFY,spaceAfter=1, leading=9.5)
BU = S("BU", fontSize=7.2, fontName="Helvetica", textColor=C_TEXT, leftIndent=9, firstLineIndent=-6, spaceAfter=0.5, leading=9.5)
BU2 = S("B2", fontSize=7, fontName="Helvetica", textColor=C_MID, leftIndent=16, firstLineIndent=-6, spaceAfter=0.5, leading=9)
AL = S("AL", fontSize=7.5, fontName="Helvetica-Bold", textColor=C_RED, alignment=TA_LEFT, leading=10)
NT = S("NT", fontSize=7, fontName="Helvetica-Oblique",textColor=C_TEAL, alignment=TA_LEFT, leading=9)
TH = S("TH", fontSize=7, fontName="Helvetica-Bold", textColor=C_WHITE, alignment=TA_CENTER, leading=9)
TC = S("TC", fontSize=7, fontName="Helvetica", textColor=C_TEXT, alignment=TA_LEFT, leading=9)
TCB = S("TB", fontSize=7, fontName="Helvetica-Bold", textColor=C_DARK, alignment=TA_LEFT, leading=9)
TCC = S("TC2",fontSize=7, fontName="Helvetica", textColor=C_TEXT, alignment=TA_CENTER, leading=9)
FT = S("FT", fontSize=6.5, fontName="Helvetica", textColor=C_LBLUE, alignment=TA_CENTER, leading=8)
def sec(text, bg=C_BLUE):
t = Table([[Paragraph(text, SH)]], colWidths=[W])
t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),bg),
("TOPPADDING",(0,0),(-1,-1),3),("BOTTOMPADDING",(0,0),(-1,-1),3),
("LEFTPADDING",(0,0),(-1,-1),6)]))
return t
def mk_tbl(hdrs, rows, cw, hbg=C_BLUE, alt=C_LGREY):
data = [[Paragraph(h, TH) for h in hdrs]]
for i, row in enumerate(rows):
data.append([Paragraph(str(c), TCB if j==0 else TC) for j,c in enumerate(row)])
t = Table(data, colWidths=cw)
ts = [("BACKGROUND",(0,0),(-1,0),hbg),
("TOPPADDING",(0,0),(-1,-1),2),("BOTTOMPADDING",(0,0),(-1,-1),2),
("LEFTPADDING",(0,0),(-1,-1),3),
("GRID",(0,0),(-1,-1),0.3,colors.HexColor("#BDBDBD")),
("VALIGN",(0,0),(-1,-1),"TOP")]
for i in range(1,len(data)):
if i%2==0: ts.append(("BACKGROUND",(0,i),(-1,i),alt))
t.setStyle(TableStyle(ts))
return t
def alert(text, bg=C_LRED, bc=C_RED):
t = Table([[Paragraph(f"★ {text}", AL)]], colWidths=[W])
t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),bg),
("TOPPADDING",(0,0),(-1,-1),3),("BOTTOMPADDING",(0,0),(-1,-1),3),
("LEFTPADDING",(0,0),(-1,-1),6),("BOX",(0,0),(-1,-1),0.8,bc)]))
return t
def note(text, bg=C_LTEAL, bc=C_TEAL):
t = Table([[Paragraph(f"ⓘ {text}", NT)]], colWidths=[W])
t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),bg),
("TOPPADDING",(0,0),(-1,-1),2),("BOTTOMPADDING",(0,0),(-1,-1),2),
("LEFTPADDING",(0,0),(-1,-1),6),("BOX",(0,0),(-1,-1),0.6,bc)]))
return t
sp = lambda h=0.1: Spacer(1, h*cm)
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
story = []
# ── COVER ────────────────────────────────────────────────────────────────────
cov = Table([[
Paragraph("DYSFUNCTIONAL UTERINE BLEEDING (DUB)", COV_T),
Paragraph("Long Answer Exam Notes | DC Dutta's Textbook of Gynecology, Chapter 15", COV_S),
Paragraph("Definition · Incidence · Pathophysiology · Classification · Types · Endometrial Patterns · Investigations · Management · Surgical Options · AUB/PALM-COEIN", COV_S),
]], colWidths=[W])
cov.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),C_DARK),
("TOPPADDING",(0,0),(-1,-1),7),("BOTTOMPADDING",(0,0),(-1,-1),7),
("LEFTPADDING",(0,0),(-1,-1),8)]))
story += [cov, sp(0.2)]
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TWO-COLUMN LAYOUT HELPER
def two_col(left_items, right_items, lw=None, rw=None):
lw = lw or W*0.495
rw = rw or W*0.495
t = Table([[left_items, right_items]], colWidths=[lw, rw])
t.setStyle(TableStyle([
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1),0),
("BOTTOMPADDING",(0,0),(-1,-1),0),
("LEFTPADDING",(0,0),(-1,-1),0),
("RIGHTPADDING",(0,0),(-1,-1),3),
]))
return t
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# PAGE 1 — Definitions, Incidence, Pathophysiology, Classification
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# LEFT: Def + Incidence + Classification
L1 = [
sec("1. DEFINITION AND INCIDENCE"),
sp(0.1),
Paragraph("<b>DUB</b> = state of <b>abnormal uterine bleeding without any clinically detectable organic, systemic, and iatrogenic cause</b> (pelvic pathology, tumour, inflammation or pregnancy must be <b>EXCLUDED</b>). Origin = <b>hypothalamo-pituitary-ovarian (HPO) axis</b> — endocrine.", BD),
Paragraph("<b>HMB (Heavy Menstrual Bleeding)</b> = bleeding interfering with woman's physical, emotional, social and maternal quality of life.", BD),
alert("DUB = DIAGNOSIS OF EXCLUSION. Organic / systemic / iatrogenic / pregnancy causes must be ruled out."),
sp(0.1),
Paragraph("<b>Incidence:</b> ~<b>10%</b> of new outpatients. Diagnosis based on exclusion of organic lesion.", BD),
sp(0.15),
sec("3. CLASSIFICATION OF DUB", bg=C_TEAL),
sp(0.1),
mk_tbl(["Type", "% of DUB", "Subtypes"],
[["OVULAR (Cyclical)","20%","Polymenorrhoea/Polymenorrhagia | Oligomenorrhoea\nFunctional Menorrhagia:\n• Irregular shedding of endometrium\n• Irregular ripening of endometrium"],
["ANOVULAR (Acyclical)","80% ★","Menorrhagia (anovulatory)\nCystic Glandular Hyperplasia\n(Metropathia haemorrhagica / Schroeder's disease)"]],
[W*0.47*0.22, W*0.47*0.15, W*0.47*0.63], hbg=C_TEAL),
sp(0.1),
note("Ovular = Only 20% (cyclical). Anovular = Almost All 80% (acyclical). DUB most common at EXTREMES of reproductive period."),
]
# RIGHT: Pathophysiology
R1 = [
sec("2. PATHOPHYSIOLOGY", bg=C_STEEL),
sp(0.1),
Paragraph("<b>Normal haemostasis in menstruation:</b> (1) Platelet adhesion (2) Platelet plug + fibrin (3) Localised vasoconstriction (4) Endometrial regeneration (5) ↑ PGF2α/PGE2 ratio", BD),
sp(0.05),
mk_tbl(["Mediator","Normal Role","In Anovulatory DUB"],
[["PGF2α","Vasoconstriction; reduces bleeding","DECREASED → excess bleeding"],
["PGE2","Vasodilation; promotes bleeding","PGF2α/PGE2 ratio is LOW"],
["Progesterone","↑ PGF2α from arachidonic acid; ↑ endothelin","ABSENT — no corpus luteum"],
["Thromboxane","Vasoconstriction; haemostasis","LOW → no dysmenorrhoea"],
["Endothelin","Powerful vasoconstrictor","Decreased"]],
[W*0.47*0.20, W*0.47*0.40, W*0.47*0.40], hbg=C_STEEL),
sp(0.1),
Paragraph("<b>Endometrial abnormalities</b> may be primary or secondary to incoordination in HPO axis. More prevalent in extremes of reproductive period (adolescence, menopause, following childbirth/abortion).", BD),
sp(0.1),
alert("WHY IS METROPATHIA HEMORRHAGICA ABSOLUTELY PAINLESS? Low PGF2α, low PGF2α/PGE2 ratio, low thromboxane → no vasoconstriction → no pain!"),
sp(0.1),
Paragraph("<b>The abnormal bleeding may be associated with or without ovulation.</b> Anovulatory cycles are not usually associated with dysmenorrhoea as the level of PGF2α is low.", BD),
]
story.append(two_col(L1, R1))
story.append(sp(0.2))
# ─── Section 4 + 5 full width ────────────────────────────────────────────────
story.append(sec("4. OVULAR BLEEDING — TYPES AND FEATURES", bg=C_PURP))
story += [sp(0.1),
mk_tbl(["Variety","Pathophysiology","Biopsy Timing","Histological Finding"],
[["Polymenorrhoea / Polymenorrhagia",
"Speeded follicular development → shortened follicular phase. Premature lysis of corpus luteum → shortened luteal phase. Occurs after childbirth, abortion, adolescence, PID.",
"Prior to / within few hours of menses",
"Secretory changes"],
["Oligomenorrhoea",
"Ovarian unresponsiveness to FSH OR pituitary dysfunction → undue prolongation of proliferative phase with normal secretory phase. Rare; met in adolescence and preceding menopause.",
"Prior to / within few hours of menses",
"Secretory changes"],
["Irregular Shedding of Endometrium",
"Incomplete LH withdrawal (26th day) → incomplete atrophy of corpus luteum → persistent progesterone. OR persistent LH → ↓FSH → ↓follicle ripening → less estrogen → less regeneration. Desquamation continues with simultaneous failure of regeneration.",
"5th-6th DAY after menses starts ★",
"MIXTURE of secretory + proliferative endometrium; TOTAL ABSENCE of surface epithelium"],
["Irregular Ripening of Endometrium",
"Poor corpus luteum formation; inadequate secretion of both estrogen and progesterone; persistent low urinary pregnanediol and plasma progesterone in luteal phase. Slight bleeding continues prior to start of proper flow.",
"Prior to or soon after spotting",
"PATCHY areas of secretory changes amidst proliferative endometrium"],
],
[W*0.16, W*0.38, W*0.20, W*0.26], hbg=C_PURP),
sp(0.1),
alert("EXAM TRAP: Irregular SHEDDING biopsy = 5th-6th day AFTER menses starts (NOT before). Normally endometrium regenerates fully by 3rd day of menstruation."),
sp(0.15),
]
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# PAGE 2 — Anovular, Endometrial Pattern, Investigations
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
story.append(PageBreak())
story.append(sec("5. ANOVULAR BLEEDING — TYPES AND FEATURES (80% OF DUB)", bg=C_RED))
story += [sp(0.1)]
# Two columns: Anovulatory menorrhagia + CGH
L2 = [
Paragraph("<b>A. Anovulatory Menorrhagia</b>", H2),
Paragraph("No corpus luteum → <b>no limiting progesterone</b> → endometrial growth under unopposed estrogen throughout cycle. Inadequate structural stromal support → endometrium remains fragile. Negative feedback of FSH → shedding in <b>asynchronous sequences</b> (lack of compactness). Endometrial shedding continues for a longer period.", BD),
sp(0.1),
Paragraph("<b>Atrophy of Endometrium</b> (separate type):", H3),
Paragraph("Common in postmenopausal women. Bleeding from rupture of dilated capillaries beneath atrophic surface epithelium. Cause: total absence of estrogen OR failure of uterine receptors to respond to estrogen.", BD),
]
R2 = [
Paragraph("<b>B. Cystic Glandular Hyperplasia (CGH)</b>", H2),
Paragraph("Syn: <b>Metropathia Haemorrhagica / Schroeder's disease</b>. Usually met in <b>premenopausal women</b>. Basic fault: disturbance of rhythmic gonadotropin secretion → slow ↑ in estrogen + no FSH inhibition. Net: <b>gradual estrogen rise + amenorrhoea 6-8 weeks</b> → heavy bleeding when endometrium outgrows blood supply.", BD),
sp(0.05),
mk_tbl(["Feature","Finding"],
[["Uterus size","8-10 weeks (myometrial hypertrophy)"],
["Gross endometrium","Thick, congested, polypoidal (multiple polyposis)"],
["Microscopy","Cystic glandular HYPERTROPHY; Swiss cheese pattern; columnar epithelium; NO secretory changes; areas of necrosis in superficial layers"],
["Ovary","Cystic changes (follicular type); NO corpus luteum"],
["Pain","ABSOLUTELY PAINLESS ★"],
["Confusion in Dx","Mimics disturbed pregnancy/ectopic in postmenopausal; NO uniform sloughing to basal layer"]],
[W*0.47*0.30, W*0.47*0.70], hbg=C_RED),
]
story.append(two_col(L2, R2))
story += [sp(0.1),
sec("6. ENDOMETRIAL PATTERN IN DUB", bg=C_STEEL),
sp(0.1),
mk_tbl(["Pattern","Frequency","Notes"],
[["Normal secretory","60% (majority)","Most common finding; normal pattern in majority"],
["Hyperplastic (CGH)","~30%","Second most common; Swiss cheese appearance on microscopy"],
["Irregular shedding / Irregular ripening / Atrophic","~10%","Seen in extremes of reproductive period"]],
[W*0.38, W*0.15, W*0.47], hbg=C_STEEL),
sp(0.15),
sec("7. INVESTIGATIONS IN DUB", bg=C_GREEN),
sp(0.1),
Paragraph("<b>Aims:</b> (i) Confirm menstrual abnormality (ii) Exclude systemic/iatrogenic/organic pelvic pathology (iii) Identify probable aetiology (iv) Work out definite therapy protocol", BD),
sp(0.05),
]
story.append(mk_tbl(["Investigation","Specifics","Key Fact"],
[["History",
"Bleeding through vagina (not urethra/rectum); number of pads, clots (size and number), duration. Estimated Hb percentage. Nature: cyclic or acyclic, relation to parity, pregnancy events, last normal cycle. History of OCP/IUCD, bleeding from injury sites (PID).",
"Menstrual blood loss estimation by alkaline hematin or pictorial chart — NOT routinely done"],
["Blood values",
"Hb — every case; serum ferritin NOT routine in menorrhagia; pubertal DUB: platelet count, PT, BT, APTT; thyroid: TSH, T3, T4",
"Hb estimates chronic blood loss; ferritin NOT routine"],
["TVS + Color Doppler",
"ET ≥12 mm = hyperplasia; ET ≤4 mm = atrophic; hyperechoic + regular outline; angiogenesis signal. Also detects anatomical abnormality (fibroid, adenomyosis, adnexae)",
"Very sensitive for structural pathology"],
["SIS (Saline Infusion Sonography)",
"Superior to TVS for endometrial polyps, submucous fibroids, intrauterine abnormality (septate/subseptate uterus)",
"Preferred for intrauterine structural diagnosis"],
["Hysteroscopy + Directed Biopsy (H&B)",
"Better evaluation; biopsy from offending site under direct vision; can be done as outpatient (H and B); replaced conventional D&C",
"DETECTS polyps and submucous fibroids MISSED by blind curettage; REPLACED D&C"],
["Pipelle Sampler",
"Endometrial sampling; OPD procedure; no anaesthesia; easy to use",
"CANNOT detect polyps or submucous fibroids; MANDATORY in postmenopausal"],
["Laparoscopy",
"Exclude endometriosis, PID, ovarian tumour (granulosa cell tumour). Indication urgent if associated with pelvic pain.",
"For selected cases"],
["D&C (Diagnostic)",
"To exclude organic lesions in endometrium, determine functional state of endometrium, incidental therapeutic benefit",
"Currently NOT recommended as diagnostic tool or for therapy (replaced by H&B)"]],
[W*0.17, W*0.47, W*0.36], hbg=C_GREEN))
story += [sp(0.08)]
story.append(mk_tbl(["Age Group","Indication for Endometrial Biopsy","Priority"],
[["Adolescent / Pubertal < 20 yrs","Only if bleeding fails to stop with medical therapy OR severe","RARELY needed"],
["Childbearing Period 20-40 yrs","ONLY if bleeding is ACYCLIC — risk of endometrial carcinoma very low","Done when acyclic"],
["Postmenopausal > 40 yrs","MANDATORY to exclude endometrial malignancy; Pipelle (OPD, no anaesthesia)","ALWAYS MANDATORY ★"]],
[W*0.22, W*0.52, W*0.26], hbg=C_RED))
story += [sp(0.08),
note("Summary of Investigations: (a) Blood values (b) TVS, SIS — exclude structural abnormalities (c) Endometrial sampling (Pipelle) or hysteroscopic guided biopsy (d) Laparoscopy — selected cases"),
]
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# PAGE 3 — Management (Medical)
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
story.append(PageBreak())
story.append(sec("8. MANAGEMENT OF DUB", bg=C_BLUE))
story += [sp(0.08),
Paragraph("<b>Management depends on: (A) Age (B) Desire for child bearing (C) Severity of bleeding (D) Associated pathology</b>", BD),
sp(0.05),
]
story.append(mk_tbl(["Age Group","Category / Approach"],
[["Pubertal and adolescent < 20 yrs","General measures + medical management; reassurance and sympathetic handling"],
["Reproductive period 20-40 yrs","Medical ± surgical based on severity and response"],
["Premenopausal > 40 yrs","More aggressive; ablation or hysterectomy acceptable"],
["Postmenopausal","Always investigate first (EB mandatory); manage cause"]],
[W*0.30, W*0.70], hbg=C_BLUE))
story += [sp(0.08),
Paragraph("<b>General Measures:</b> Rest during bleeding. Anaemia corrected by diet, haematinics, blood transfusion. Any systemic/endocrinal abnormality investigated and treated.", BD),
sp(0.1),
sec("8A. MEDICAL MANAGEMENT — NON-HORMONAL", bg=C_STEEL),
sp(0.08),
]
story.append(mk_tbl(["Drug Class","Drug / Dose","Blood Loss ↓","Key Points"],
[["Prostaglandin Synthetase Inhibitors (PSI)","Mefenamic acid 150-600 mg orally in divided doses during bleeding phase","25-30%","2nd line medical treatment; inhibits PG synthesis + blocks PGE2 receptor binding; side effects: headache, nausea (mild)"],
["Antifibrinolytic Agents","Tranexamic acid (TA) — standard doses during bleeding","50%","2nd line therapy; counteracts endometrial fibrinolytic system; useful in IUCD-induced menorrhagia; GI side effects common; CONTRAINDICATED in thromboembolism history"]],
[W*0.22, W*0.28, W*0.10, W*0.40], hbg=C_STEEL))
story += [sp(0.1),
sec("8B. MEDICAL MANAGEMENT — HORMONAL", bg=C_BLUE),
sp(0.05),
Paragraph("<b>★ With the introduction of potent orally active progestins, they became the MAINLINE in the management of DUB in all age groups</b> and practically replaced isolated use of estrogens and androgens.", BD),
sp(0.05),
]
story.append(mk_tbl(["Drug / Class","Dose / Regimen","Blood Loss ↓","Key Points"],
[["Progestins — MAINLINE\n(Norethisterone acetate / MPA)",
"To stop bleeding: Norethisterone 5 mg TDS till bleeding stops (3-7 days), then COC.\n5th-25th day course: MPA 10 mg/day × 3 cycles (ovulatory or anovulatory).\n15th-25th day course: Dydrogesterone 10 mg OD or BD × 3 cycles (if pregnancy desired; does NOT suppress ovulation).\nContinuous: MPA 10 mg TDS × at least 90 days.",
"Significant\n(50% for 5th-25th day)",
"MPA preferred over Norethisterone (does NOT alter serum lipids). Mechanism (antiestrogenic): (i) 17β-HSD → estradiol to estrone (less potent); (ii) Inhibits ER induction; (iii) Antimitotic on endometrium."],
["LNG-IUS ★ FIRST LINE\n(Levonorgestrel IUS)",
"Effective for 5 years",
"97% ★",
"FIRST LINE for HMB without structural or histological abnormality. Induces endometrial glandular atrophy, stromal decidualisation, endometrial cell inactivation. Considered medical hysterectomy. Also contraceptive."],
["COC Pills\n(Combined Oral Contraceptive)",
"5th-25th day × 3 cycles",
"50%",
"Causes endometrial atrophy; suppresses H-P-O-E axis; also reduces blood loss by 50%; serves as contraceptive."],
["Conjugated Estrogen IV\n(Acute severe bleeding)",
"25 mg IV every 4 hours till controlled, then oral progestin (MPA 10 mg) + COC long term",
"Acute haemostasis",
"Helps rapid growth of denuded endometrium; promotes platelet adhesiveness; controls by process of healing; repeat every 4h. If bleeding continues → D&C indicated."],
["Danazol\n(17α-ethynyl testosterone)",
"200-400 mg/day in 4 divided doses × 6 months",
"60%",
"For recurrent symptoms / awaiting hysterectomy. Smaller dose → minimise blood loss; larger dose → amenorrhoea. Side effects: androgenic."],
["GnRH Agonists\n(GnRH analogs)",
"Subtherapeutic → reduces blood loss; Therapeutic → amenorrhoea",
"Variable",
"Short-term for severe DUB, especially if infertile and wants pregnancy. Improves anaemia. Helpful before endometrial ablation. Hypoestrogenic features may appear."],
["Mifepristone (RU 486)\n(Antiprogesterone — 19-nor steroid)",
"Varying doses",
"—",
"Inhibits ovulation; induces amenorrhoea; reduces myoma size. Suitable in cases with recurrent symptoms or awaiting hysterectomy."],
["Ormeloxifene (SERM — Centchroman)",
"60 mg twice weekly × 3 months",
"Significant",
"Selective estrogen receptor modulator; also used as oral contraceptive."],
["Desmopressin\n(Synthetic arginine-vasopressin analogue)",
"0.3 μg/kg IV or intranasally",
"—",
"ONLY for von Willebrand's disease and Factor VIII deficiency."]],
[W*0.18, W*0.25, W*0.08, W*0.49], hbg=C_BLUE))
story += [sp(0.08),
alert("LNG-IUS = FIRST LINE for HMB without structural/histological abnormality. Blood loss reduction = 97%. Effective 5 years. = Medical hysterectomy."),
]
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# PAGE 4 — Surgical Management, Numbers, Exam Q, PALM-COEIN
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
story.append(PageBreak())
story.append(sec("9. SURGICAL MANAGEMENT OF DUB", bg=C_BROWN))
story += [sp(0.08),
Paragraph("<b>Surgical options: (1) Uterine curettage (2) Endometrial ablation / resection (3) Hysterectomy</b>", BD),
sp(0.08),
]
# Two columns: Curettage + Ablation
L3 = [
Paragraph("<b>A. Uterine Curettage</b>", H2),
Paragraph("Done predominantly as a diagnostic tool for elderly women but has haemostatic/therapeutic effect. Should be done following ultrasonography for detection of endometrial pathology. <b>Presently, D&C should be used NEITHER as a diagnostic tool NOR for purpose of therapy (replaced by H&B).</b>", BD),
sp(0.05),
mk_tbl(["Type","Timing of Curettage"],
[["Cyclic — Menorrhagia","5-6 days PRIOR to period"],
["Cyclic — Irregular Shedding","5-6 days AFTER period starts"],
["Cyclic — Irregular Ripening","Soon AFTER period starts"],
["Acyclic","Soon AFTER period starts"],
["Continuous","ANY time"]],
[W*0.47*0.50, W*0.47*0.50], hbg=C_BROWN),
sp(0.08),
Paragraph("<b>C. Hysterectomy</b>", H2),
Paragraph("<b>Not recommended as first line for HMB/DUB.</b> Justified when: (i) Conservative treatment fails or contraindicated; (ii) Blood loss impairs health and quality of life; (iii) Endometrial hyperplasia with atypia on histology. Route: vaginal, abdominal, or laparoscopic assisted vaginal. Decision can be made as early as patient approaches 40. <b>Especially recommended in those under 45 years of age.</b>", BD),
]
R3 = [
Paragraph("<b>B. Endometrial Ablation/Resection</b>", H2),
Paragraph("<b>Indications:</b> (a) Failed medical treatment (b) Does not wish to preserve menstrual or reproductive function (c) Uterus ≤10 weeks (d) Fibroids <3 cm (e) Women who no longer want surgery (f) Prefers to preserve uterus.", BD),
sp(0.05),
mk_tbl(["Method","Temp/Energy","Depth","Duration","Key Point"],
[["Uterine Thermal Balloon ★ FIRST LINE","87°C; hot saline","—","8-10 min","No cervical dilatation; suitable if unfit for GA; FIRST LINE; Day care basis"],
["Microwave Endometrial Ablation","75-80°C","6 mm","2-3 min (faster)","Outpatient; results = TCRE"],
["Novasure","Bipolar radiofrequency; expandable base","Entire endometrium","90 sec","CONTRAINDICATED: cavity <4cm, PID, cesarean. Pretreat with GnRH/danazol 3 wks."],
["TCRE (Transcervical Resection)","Continuous flow resectoscope","Basal layer + superficial myometrium","Longer","Must remove basal layer + superficial myometrium; failure = regeneration"],
["Laser Ablation (Nd:YAG)","Coagulation/ vaporization/ carbonization","4-5 mm","—","Therapeutic Ashermann's + amenorrhoea; when hysterectomy contraindicated"],
["Roller Ball Ablation","Electrical coagulation","4 mm","—","First generation; used with TCRE if myomectomy planned simultaneously"]],
[W*0.47*0.18, W*0.47*0.16, W*0.47*0.13, W*0.47*0.11, W*0.47*0.42], hbg=C_BROWN),
sp(0.05),
note("Results: Overall success 70-80%. Amenorrhoea in 20-40%. Significant blood loss reduction in another 50%. 10% need repeat/hysterectomy. Uterine Artery Embolisation for large fibroids >3 cm with heavy bleeding."),
]
story.append(two_col(L3, R3))
story += [sp(0.1)]
# TWO COLUMNS: High-Yield Numbers + PALM-COEIN + Exam Questions
story.append(sec("10. AUB — PALM-COEIN (FIGO/ACOG 2011)", bg=C_PINK))
story += [sp(0.08)]
L4 = [
mk_tbl(["PALM (Structural)","COEIN (Non-structural)"],
[["P — Polyp","C — Coagulopathy"],
["A — Adenomyosis","O — Ovulatory dysfunction"],
["L — Leiomyoma","E — Endometrial"],
["M — Malignancy/Hyperplasia","I — Iatrogenic"],
["","N — Not yet classified"]],
[W*0.47*0.50, W*0.47*0.50], hbg=C_PINK),
sp(0.08),
Paragraph("<b>Abnormal menstrual bleeding pattern</b> traditionally expressed as menorrhagia, metrorrhagia, polymenorrhoea, oligomenorrhoea. FIGO/ACOG 2011 created a universally accepted nomenclature. Structural causes grouped as PALM, non-structural as COEIN.", BD),
]
R4 = [
Paragraph("<b>11. HIGH-YIELD NUMBERS</b>", H2),
mk_tbl(["Fact","Value"],
[["Incidence of DUB","~10%"],
["LNG-IUS blood loss reduction","97% ★"],
["LNG-IUS effective duration","5 years"],
["Danazol blood loss reduction","60%"],
["Tranexamic acid / COC","50% each"],
["NSAIDs (Mefenamic acid)","25-30%"],
["Ablation overall success","70-80%"],
["Amenorrhoea post-ablation","20-40%"],
["ET hyperplasia (TVS)","≥12 mm"],
["ET atrophic (TVS)","≤4 mm"],
["Metropathia uterus size","8-10 weeks"],
["Conjugated estrogen IV","25 mg every 4h"],
["Thermal balloon","87°C × 8-10 min"],
["Microwave ablation","75-80°C / 6mm / 2-3min"],
["Novasure","90 seconds"],
["Laser (Nd:YAG) depth","4-5 mm"],
["Roller ball depth","4 mm"],
["Danazol dose","200-400mg/day × 6 months"],
["Ormeloxifene dose","60mg twice weekly × 3 months"],
["Desmopressin dose","0.3μg/kg IV or intranasal"],
["Normal secretory pattern in DUB","60% (most common)"],
["Hyperplastic pattern in DUB","~30%"]],
[W*0.47*0.62, W*0.47*0.38], hbg=C_STEEL),
]
story.append(two_col(L4, R4))
story += [sp(0.1)]
story.append(sec("12. TOP EXAM QUESTIONS AND MODEL ANSWERS", bg=C_RED))
story += [sp(0.08)]
story.append(mk_tbl(["Q","Question","Model Answer (One-Line)"],
[["1","Define DUB and state its origin","AUB without organic/systemic/iatrogenic cause; origin = HPO axis (endocrine); diagnosis of exclusion"],
["2","Why is Metropathia hemorrhagica absolutely painless?","Low PGF2α, low PGF2α/PGE2 ratio, low thromboxane → no vasoconstriction → no dysmenorrhoea"],
["3","Classify DUB with types","Ovular 20% (polymenorrhoea, oligomenorrhoea, irregular shedding/ripening) and Anovular 80% (menorrhagia, CGH)"],
["4","Biopsy timing and finding in irregular shedding","5th-6th day after menses starts; mixture of secretory + proliferative; total absence of surface epithelium"],
["5","Biopsy finding in Cystic Glandular Hyperplasia","Swiss cheese pattern; cystic glandular hypertrophy; columnar epithelium; no secretory changes"],
["6","First line treatment for HMB without structural abnormality","LNG-IUS — 97% blood loss reduction; effective 5 years; considered medical hysterectomy"],
["7","When is endometrial biopsy mandatory?","Postmenopausal period — ALWAYS mandatory to exclude endometrial malignancy"],
["8","What has replaced D&C in DUB?","Hysteroscopy + directed biopsy (H&B) — OPD, detects polyps/fibroids missed by curettage"],
["9","Which ablation method is FIRST LINE and done as day care?","Uterine Thermal Balloon (87°C × 8-10 min); no cervical dilatation needed; suitable if unfit for GA"],
["10","Novasure ablation contraindications","Uterine cavity <4 cm, PID, previous cesarean delivery"],
["11","Drug of choice in DUB with von Willebrand's disease","Desmopressin 0.3 μg/kg IV or intranasally — synthetic analogue of arginine-vasopressin"],
["12","Mechanism of progestins in DUB (antiestrogenic actions)","(i) 17β-HSD → estradiol to estrone; (ii) Inhibits ER induction; (iii) Antimitotic on endometrium"],
["13","PALM-COEIN classification (FIGO 2011)","PALM = structural (Polyp, Adenomyosis, Leiomyoma, Malignancy); COEIN = non-structural (Coagulopathy, Ovulatory, Endometrial, Iatrogenic, Not classified)"],
["14","When is hysterectomy justified in DUB?","Failed conservative treatment; blood loss impairs QoL; endometrial hyperplasia with atypia; patient approaching 40"],
["15","Progestin blood loss reduction and regimen for 5th-25th day course","MPA 10 mg/day 5th-25th day × 3 cycles; 50% blood loss reduction; also contraceptive; causes endometrial atrophy; suppresses H-P-O-E axis"]],
[W*0.04, W*0.37, W*0.59], hbg=C_RED))
story += [sp(0.08)]
# FOOTER
foot = Table([[Paragraph(
"Source: DC Dutta's Textbook of Gynecology, Chapter 15 — Abnormal Uterine Bleeding (AUB) | Long Answer Exam-Oriented Notes | All rights to original authors",
FT)]], colWidths=[W])
foot.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),C_DARK),
("TOPPADDING",(0,0),(-1,-1),3),("BOTTOMPADDING",(0,0),(-1,-1),3),
("LEFTPADDING",(0,0),(-1,-1),8)]))
story.append(foot)
# ── Build ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT}")
~/dub-notes/generate_dub_long_answer.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/dub-notes/generate_dub_long_answer.py'
Generate a exam oriented notes of 4 pgs
~/dub-notes/generate_dub_4pg.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.styles import ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, HRFlowable
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
OUTPUT = "/home/daytona/workspace/dub-notes/DUB_Exam_Notes_4pg.pdf"
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
leftMargin=1.1*cm, rightMargin=1.1*cm,
topMargin=0.9*cm, bottomMargin=0.9*cm,
)
PW = A4[0] - 2.2*cm # ~175 mm usable width
# ── Palette ──────────────────────────────────────────────────────────────────
NAVY = colors.HexColor("#0D1B4B")
BLUE = colors.HexColor("#1565C0")
STEEL = colors.HexColor("#37474F")
TEAL = colors.HexColor("#00695C")
RED = colors.HexColor("#B71C1C")
PURP = colors.HexColor("#4A148C")
BROWN = colors.HexColor("#4E342E")
GREEN = colors.HexColor("#1B5E20")
MAROON = colors.HexColor("#880E4F")
ORANGE = colors.HexColor("#E65100")
WHITE = colors.white
LBLUE = colors.HexColor("#E3F2FD")
LTEAL = colors.HexColor("#E0F2F1")
LRED = colors.HexColor("#FFEBEE")
LGREY = colors.HexColor("#F5F5F5")
LYELL = colors.HexColor("#FFFDE7")
LGRN = colors.HexColor("#E8F5E9")
TEXT = colors.HexColor("#1A1A1A")
MGREY = colors.HexColor("#455A64")
# ── Styles ───────────────────────────────────────────────────────────────────
def PS(n, **k): return ParagraphStyle(n, **k)
COV1 = PS("c1", fontSize=16, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER, leading=20)
COV2 = PS("c2", fontSize=7.5, fontName="Helvetica", textColor=LBLUE, alignment=TA_CENTER, leading=9)
SHD = PS("sh", fontSize=8.2, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_LEFT, leading=10)
H2 = PS("h2", fontSize=8, fontName="Helvetica-Bold", textColor=NAVY, alignment=TA_LEFT, spaceAfter=1,spaceBefore=2, leading=10)
H3 = PS("h3", fontSize=7.5, fontName="Helvetica-Bold", textColor=TEAL, alignment=TA_LEFT, spaceAfter=0,spaceBefore=1, leading=10)
BD = PS("bd", fontSize=7.2, fontName="Helvetica", textColor=TEXT, alignment=TA_JUSTIFY,spaceAfter=1, leading=10)
BU = PS("bu", fontSize=7.2, fontName="Helvetica", textColor=TEXT, leftIndent=9, firstLineIndent=-6, spaceAfter=0.5, leading=9.5)
AL = PS("al", fontSize=7.5, fontName="Helvetica-Bold", textColor=RED, alignment=TA_LEFT, leading=10)
NT = PS("nt", fontSize=7, fontName="Helvetica-Oblique",textColor=TEAL, alignment=TA_LEFT, leading=9)
TH = PS("th", fontSize=7, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER, leading=9)
TC = PS("tc", fontSize=7, fontName="Helvetica", textColor=TEXT, alignment=TA_LEFT, leading=9)
TCB = PS("tb", fontSize=7, fontName="Helvetica-Bold", textColor=NAVY, alignment=TA_LEFT, leading=9)
TCC = PS("t2", fontSize=7, fontName="Helvetica", textColor=TEXT, alignment=TA_CENTER, leading=9)
FT = PS("ft", fontSize=6.5, fontName="Helvetica", textColor=LBLUE, alignment=TA_CENTER, leading=8)
# ── Helpers ───────────────────────────────────────────────────────────────────
def sec(txt, bg=BLUE, w=PW):
t = Table([[Paragraph(txt, SHD)]], colWidths=[w])
t.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1),bg),
("TOPPADDING",(0,0),(-1,-1),3),("BOTTOMPADDING",(0,0),(-1,-1),3),
("LEFTPADDING",(0,0),(-1,-1),6),
]))
return t
def tbl(hdrs, rows, cw, hbg=BLUE, alt=LGREY):
data = [[Paragraph(h, TH) for h in hdrs]]
for i,row in enumerate(rows):
data.append([Paragraph(str(c), TCB if j==0 else TC) for j,c in enumerate(row)])
t = Table(data, colWidths=cw)
ts = [
("BACKGROUND",(0,0),(-1,0),hbg),
("TOPPADDING",(0,0),(-1,-1),2),("BOTTOMPADDING",(0,0),(-1,-1),2),
("LEFTPADDING",(0,0),(-1,-1),3),
("GRID",(0,0),(-1,-1),0.3,colors.HexColor("#BDBDBD")),
("VALIGN",(0,0),(-1,-1),"TOP"),
]
for i in range(1,len(data)):
if i%2==0: ts.append(("BACKGROUND",(0,i),(-1,i),alt))
t.setStyle(TableStyle(ts))
return t
def boxtbl(items, bg=LRED, bc=RED, w=PW):
t = Table([[items]], colWidths=[w])
t.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1),bg),
("TOPPADDING",(0,0),(-1,-1),3),("BOTTOMPADDING",(0,0),(-1,-1),3),
("LEFTPADDING",(0,0),(-1,-1),6),
("BOX",(0,0),(-1,-1),0.8,bc),
]))
return t
def alertbox(txt, bg=LRED, bc=RED, w=PW):
return boxtbl(Paragraph(f"★ {txt}", AL), bg, bc, w)
def notebox(txt, bg=LTEAL, bc=TEAL, w=PW):
return boxtbl(Paragraph(f"◆ {txt}", NT), bg, bc, w)
def col2(left, right, lw=None, rw=None):
lw = lw or PW*0.495
rw = rw or PW*0.495
t = Table([[left, right]], colWidths=[lw, rw])
t.setStyle(TableStyle([
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1),0),("BOTTOMPADDING",(0,0),(-1,-1),0),
("LEFTPADDING",(0,0),(-1,-1),0),("RIGHTPADDING",(0,0),(-1,-1),2),
]))
return t
sp = lambda h=0.1: Spacer(1, h*cm)
LW = PW*0.493 # each column width
RW = PW*0.493
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
story = []
# ── COVER BANNER ─────────────────────────────────────────────────────────────
cov = Table([[
Paragraph("DYSFUNCTIONAL UTERINE BLEEDING (DUB)", COV1),
Paragraph("Exam-Oriented Notes | DC Dutta's Textbook of Gynecology — Chapter 15 | AUB", COV2),
Paragraph("Definition · Pathophysiology · Classification · Ovular/Anovular Types · Endometrial Patterns · Investigations · Medical Management · Surgical Management · PALM-COEIN · High-Yield Numbers", COV2),
]], colWidths=[PW])
cov.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1),NAVY),
("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),
("LEFTPADDING",(0,0),(-1,-1),8),
]))
story += [cov, sp(0.2)]
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ██ PAGE 1 ██
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# LEFT COL P1 — Definition + Incidence + Pathophysiology
Lp1 = [
sec("1. DEFINITION & INCIDENCE", bg=BLUE, w=LW),
sp(0.1),
Paragraph("<b>DUB</b> is defined as a <b>state of abnormal uterine bleeding without any clinically detectable organic, systemic and iatrogenic cause</b>. Pelvic pathology (tumour, inflammation), pregnancy and systemic/iatrogenic causes are <b>excluded</b>. It results from dysfunction of the <b>hypothalamo-pituitary-ovarian (HPO) axis</b>.", BD),
Paragraph("<b>HMB (Heavy Menstrual Bleeding)</b> = bleeding that <b>interferes with woman's physical, emotional, social and maternal quality of life</b>.", BD),
alertbox("DUB = DIAGNOSIS OF EXCLUSION. Organic / systemic / iatrogenic / pregnancy causes MUST be ruled out first.", w=LW),
sp(0.08),
Paragraph("<b>Incidence:</b> ~<b>10%</b> of new outpatients attending gynaecology clinic.", BD),
sp(0.12),
sec("2. PATHOPHYSIOLOGY", bg=STEEL, w=LW),
sp(0.1),
Paragraph("<b>Normal haemostasis in menstruation:</b> (1) Platelet adhesion (2) Platelet plug + fibrin (3) Localised vasoconstriction (4) Endometrial regeneration (5) ↑ PGF2α/PGE2 ratio", BD),
sp(0.06),
tbl(["Mediator","Normal Action","In Anovulatory DUB"],
[["PGF2α","Vasoconstriction; reduces bleeding","DECREASED → excess bleeding"],
["PGE2","Vasodilation; promotes bleeding","PGF2α/PGE2 ratio LOW"],
["Progesterone","↑ PGF2α from arachidonic acid; ↑ endothelin","ABSENT (no ovulation)"],
["Thromboxane","Vasoconstriction; haemostasis","LOW → NO dysmenorrhoea"],
["Endothelin","Powerful vasoconstrictor","Decreased"]],
[LW*0.20, LW*0.40, LW*0.40], hbg=STEEL),
sp(0.08),
alertbox("WHY IS METROPATHIA PAINLESS? Low PGF2α, low PGF2α/PGE2 ratio, low thromboxane → no vasoconstriction → DUB of this type is ABSOLUTELY PAINLESS", w=LW),
sp(0.08),
Paragraph("<b>Endometrial abnormalities</b> may be primary or secondary to incoordination in HPO axis. Most prevalent at <b>extremes of reproductive period</b> — adolescence, menopause, following childbirth/abortion.", BD),
]
# RIGHT COL P1 — Classification + Ovular types
Rp1 = [
sec("3. CLASSIFICATION OF DUB", bg=TEAL, w=RW),
sp(0.1),
tbl(["Type","% DUB","Subtypes"],
[["OVULAR (Cyclical)","20%","Polymenorrhoea/Polymenorrhagia\nOligomenorrhoea\nFunctional Menorrhagia:\n• Irregular shedding of endometrium\n• Irregular ripening of endometrium"],
["ANOVULAR (Acyclical)","80% ★","Menorrhagia (anovulatory)\nCystic Glandular Hyperplasia\n(Metropathia haemorrhagica / Schroeder's disease)"]],
[RW*0.22, RW*0.13, RW*0.65], hbg=TEAL),
sp(0.1),
sec("4. OVULAR BLEEDING — TYPES", bg=PURP, w=RW),
sp(0.08),
tbl(["Variety","Pathophysiology / Features","Biopsy Timing","Histology"],
[["Polymenorrhoea / Polymenorrhagia",
"Speeded follicular development → shortened follicular phase. Premature lysis of corpus luteum → shortened luteal phase. Occurs after childbirth, abortion, adolescence, PID.",
"Prior to/within few hours of menses",
"Secretory changes"],
["Oligomenorrhoea",
"Ovarian unresponsiveness to FSH OR pituitary dysfunction → undue prolongation of proliferative phase with normal secretory phase. Rare; met in adolescence and preceding menopause.",
"Prior to/within few hours of menses",
"Secretory changes"],
["Irregular Shedding of Endometrium",
"Incomplete LH withdrawal (26th day) → incomplete corpus luteum atrophy → persistent progesterone secretion. OR persistent LH → ↓FSH → ↓follicle ripening → less estrogen → less regeneration. Desquamation continues with simultaneous failure of regeneration. Met in extremes of reproductive period.",
"5th-6th DAY after menses STARTS ★",
"MIXTURE of secretory + proliferative endometrium;\nTOTAL ABSENCE of surface epithelium"],
["Irregular Ripening of Endometrium",
"Poor corpus luteum formation; inadequate secretion of both estrogen and progesterone. Persistent low urinary pregnanediol and plasma progesterone in luteal phase. Slight bleeding continues prior to start of proper flow.",
"Prior to or soon after spotting",
"PATCHY secretory changes amidst proliferative endometrium"]],
[RW*0.16, RW*0.42, RW*0.20, RW*0.22], hbg=PURP),
sp(0.08),
alertbox("EXAM TRAP: Irregular SHEDDING biopsy on 5th-6th day AFTER menses starts (NOT before). Normally endometrium regenerates fully by 3rd day.", w=RW),
]
story.append(col2(Lp1, Rp1))
story += [sp(0.1), PageBreak()]
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ██ PAGE 2 ██ — Anovular bleeding + Endometrial Patterns + Investigations
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
story.append(sec("5. ANOVULAR BLEEDING — TYPES AND FEATURES (80% OF DUB)", bg=RED))
story.append(sp(0.08))
Lp2a = [
Paragraph("<b>A. Anovulatory Menorrhagia</b>", H2),
Paragraph("No corpus luteum → <b>no limiting progesterone</b> → endometrial growth under <b>unopposed estrogen</b> throughout cycle. Inadequate structural stromal support → <b>endometrium remains fragile</b>. Negative feedback of FSH → shedding in <b>asynchronous sequences</b> due to lack of compactness. Endometrial shedding continues for a longer period.", BD),
sp(0.08),
Paragraph("<b>Atrophy of Endometrium:</b>", H3),
Paragraph("Seen in postmenopausal women; may occur in reproductive period as final involutionary state. Bleeding from rupture of dilated capillaries beneath atrophic surface epithelium. Cause: total absence of estrogen OR failure of uterine receptors to respond to estrogen.", BD),
]
Rp2a = [
Paragraph("<b>B. Cystic Glandular Hyperplasia (CGH) / Metropathia Haemorrhagica / Schroeder's Disease</b>", H2),
Paragraph("Usually met in <b>premenopausal women</b>. Fault: disturbance of rhythmic gonadotropin secretion → slow ↑ estrogen + <b>no FSH inhibition</b>. Net: <b>gradual estrogen rise + amenorrhoea 6-8 weeks</b> → heavy bleeding when endometrium outgrows blood supply. <b>Absolutely painless</b> (↓PGF2α, ↓PGF2α/PGE2, ↓thromboxane).", BD),
sp(0.05),
tbl(["Feature","Finding"],
[["Uterus size","Symmetrical enlargement 8-10 weeks (myometrial hypertrophy)"],
["Gross endometrium","Thick, congested, polypoidal (multiple polyposis)"],
["Microscopy","Cystic glandular HYPERTROPHY (not hyperplasia); SWISS CHEESE pattern; columnar epithelium; NO secretory changes; necrosis in superficial layers"],
["Ovary","Cystic changes (follicular type); NO corpus luteum"],
["Pain","ABSOLUTELY PAINLESS"],
["Diagnosis confusion","Mimics ectopic/disturbed pregnancy in postmenopausal; NO uniform sloughing to basal layer"]],
[LW*0.28, LW*0.72], hbg=RED),
]
story.append(col2(Lp2a, Rp2a))
story += [sp(0.1)]
story.append(sec("6. ENDOMETRIAL PATTERN IN DUB", bg=STEEL))
story += [sp(0.08),
tbl(["Pattern","Frequency","Notes"],
[["Normal secretory","60% (majority — most common)","Normal endometrial pattern found in majority of DUB"],
["Hyperplastic (Cystic Glandular Hyperplasia)","~30%","Swiss cheese appearance on microscopy; second most common"],
["Irregular shedding / Irregular ripening / Atrophic","~10%","Seen at extremes of reproductive period"]],
[PW*0.35, PW*0.18, PW*0.47], hbg=STEEL),
sp(0.1),
sec("7. INVESTIGATIONS IN DUB", bg=GREEN),
sp(0.08),
Paragraph("<b>Aims:</b> (i) Confirm menstrual abnormality (ii) Exclude systemic/iatrogenic/organic pelvic pathology (iii) Identify probable aetiology (iv) Work out definite therapy protocol", BD),
sp(0.06),
]
story.append(tbl(["Investigation","Specifics","Key Fact"],
[["History",
"Bleeding through vagina (not urethra/rectum); number of pads, clots, duration. Estimated Hb percentage. Nature: cyclic or acyclic, parity, pregnancy events, last normal cycle. History of OCP/IUCD, bleeding disorders (epistaxis, gum bleeding).",
"Menstrual blood loss estimation by alkaline hematin or pictorial chart — NOT routinely done"],
["Blood values",
"Hb — every case. Serum ferritin NOT routine in menorrhagia. Pubertal DUB: platelet count, PT, BT, APTT. Thyroid dysfunction: serum TSH, T3, T4.",
"Hb estimates chronic blood loss"],
["TVS + Color Doppler",
"ET ≥12 mm = hyperplasia; ET ≤4 mm = atrophic; hyperechoic + regular outline; angiogenesis signal. Detects fibroid, adenomyosis, adnexal pathology.",
"Very sensitive for structural pathology"],
["SIS (Saline Infusion Sonography)",
"Superior to TVS for endometrial polyps, submucous fibroids, intrauterine abnormality (septate/subseptate uterus).",
"Preferred for intrauterine structural diagnosis"],
["Hysteroscopy + Directed Biopsy (H&B)",
"Better evaluation; biopsy under direct vision from offending site; can be done as outpatient procedure.",
"REPLACED conventional D&C. Detects polyps and submucous fibroids MISSED by blind curettage."],
["Pipelle Sampler (Endometrial Sampling)",
"OPD procedure; no anaesthesia; blind procedure — cannot detect polyps or submucous fibroids.",
"MANDATORY in postmenopausal women ★"],
["Laparoscopy",
"Exclude endometriosis, PID, ovarian tumour (granulosa cell tumour). Urgent indication if pelvic pain associated.",
"For selected cases only"],
["D&C (Diagnostic Curettage)",
"Exclude organic lesions; determine functional state of endometrium; incidental therapeutic benefit.",
"Currently NOT recommended as diagnostic tool or for therapy (REPLACED by H&B)"]],
[PW*0.16, PW*0.50, PW*0.34], hbg=GREEN))
story += [sp(0.08)]
story.append(tbl(["Age Group","Indication for Endometrial Biopsy","Priority"],
[["Adolescent / Pubertal < 20 yrs","Only if bleeding fails to stop with medical therapy OR severe in nature","RARELY needed"],
["Childbearing Period 20-40 yrs","ONLY if bleeding is ACYCLIC — risk of endometrial carcinoma is very low","Done when acyclic"],
["Postmenopausal > 40 yrs","MANDATORY to exclude endometrial malignancy; Pipelle (OPD, no anaesthesia)","ALWAYS MANDATORY ★"]],
[PW*0.22, PW*0.54, PW*0.24], hbg=RED))
story += [sp(0.08),
notebox("Summary of Investigations: (a) Blood values (b) TVS + SIS — exclude structural abnormalities (c) Endometrial sampling (Pipelle) or hysteroscopic guided biopsy (d) Laparoscopy — for selected cases"),
sp(0.08), PageBreak(),
]
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ██ PAGE 3 ██ — Medical Management
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
story.append(sec("8. MANAGEMENT OF DUB", bg=BLUE))
story += [sp(0.08),
Paragraph("<b>Management depends on: (A) Age (B) Desire for child bearing (C) Severity of bleeding (D) Associated pathology</b>", BD),
sp(0.06),
tbl(["Age Group","Approach"],
[["Pubertal / Adolescent < 20 yrs","Reassurance; general measures + medical management"],
["Reproductive period 20-40 yrs","Medical ± surgical based on severity and response"],
["Premenopausal > 40 yrs","More aggressive; ablation or hysterectomy acceptable"],
["Postmenopausal","Investigate first (EB mandatory); manage cause"]],
[PW*0.30, PW*0.70], hbg=BLUE),
sp(0.08),
Paragraph("<b>General Measures:</b> Rest during bleeding phase. Anaemia corrected by diet, haematinics, blood transfusion. Any systemic/endocrinal abnormality investigated and treated accordingly.", BD),
sp(0.1),
sec("8A. MEDICAL MANAGEMENT — NON-HORMONAL", bg=STEEL),
sp(0.08),
tbl(["Drug Class","Drug / Dose","Blood Loss ↓","Key Points"],
[["Prostaglandin Synthetase Inhibitors (PSI)","Mefenamic acid (Fenamate) 150-600 mg orally in divided doses during bleeding phase","25-30%","2nd line medical treatment. Inhibits PG synthesis + blocks PGE2 receptor binding. Side effects: headache, nausea (mild)."],
["Antifibrinolytic Agents","Tranexamic acid (TA) — standard doses during bleeding phase","50%","2nd line therapy. Counteracts endometrial fibrinolytic system. Useful in IUCD-induced menorrhagia. GI side effects common. CONTRAINDICATED in history of thromboembolism."]],
[PW*0.22, PW*0.28, PW*0.10, PW*0.40], hbg=STEEL),
sp(0.1),
sec("8B. MEDICAL MANAGEMENT — HORMONAL (MAINLINE = PROGESTINS)", bg=BLUE),
sp(0.06),
Paragraph("★ <b>With the introduction of potent orally active progestins, they became the MAINLINE in the management of DUB in all age groups</b> and practically replaced isolated use of estrogens and androgens.", BD),
sp(0.06),
]
story.append(tbl(["Drug / Class","Dose / Regimen","Blood Loss ↓","Key Points"],
[["Progestins — MAINLINE\nNorethisterone acetate / MPA",
"To STOP BLEEDING: Norethisterone 5 mg TDS till bleeding stops (3-7 days), then COC long term.\n5th-25th day course: MPA 10 mg/day × 3 cycles (anovulatory/ovulatory).\n15th-25th day: Dydrogesterone 10 mg OD/BD × 3 cycles (ovulatory, if pregnancy desired; does NOT suppress ovulation).\nContinuous: MPA 10 mg TDS × ≥90 days.",
"Significant; 50% on 5th-25th course",
"MPA preferred (does NOT alter serum lipids). Mechanism (antiestrogenic): (i) 17β-HSD → estradiol to estrone (less potent); (ii) Inhibits estrogen receptor induction; (iii) Antimitotic effect on endometrium."],
["LNG-IUS\n★ FIRST LINE",
"Levonorgestrel IUS; effective for 5 years",
"97% ★★",
"FIRST LINE for HMB without structural or histological abnormality. Induces endometrial glandular atrophy, stromal decidualisation, endometrial cell inactivation. Considered MEDICAL HYSTERECTOMY. Also contraceptive."],
["COC Pills\n(Combined Oral Contraceptive)",
"5th-25th day × 3 cycles",
"50%",
"Causes endometrial atrophy; suppresses H-P-O-E axis; reduces blood loss 50%; also serves as contraceptive."],
["Conjugated Estrogen IV\n(Acute severe bleeding)",
"25 mg IV every 4 hours till controlled, then switch to oral progestin (MPA 10 mg) + COC",
"Acute haemostasis",
"Rapid growth of denuded endometrium; promotes platelet adhesiveness; mechanism: preparation of endometrium, ↑fibrinogen, factors V and X, platelet aggregation. If bleeding continues → D&C indicated."],
["Danazol\n(17α-ethynyl testosterone)",
"200-400 mg/day in 4 divided doses × 6 months",
"60%",
"Recurrent symptoms / awaiting hysterectomy. Smaller dose → minimise blood loss; larger dose → amenorrhoea. Side effects: androgenic."],
["GnRH Agonists",
"Subtherapeutic dose → reduces blood loss; Therapeutic dose → amenorrhoea",
"Variable",
"Short-term use for severe DUB, especially if infertile. Improves anaemia. Helpful before endometrial ablation. Hypoestrogenic side effects may appear."],
["Mifepristone (RU 486)\n(Antiprogesterone — 19-nor steroid)",
"Varying doses; 200-400 mg daily in divided doses",
"—",
"Inhibits ovulation; induces amenorrhoea; reduces myoma size. For recurrent symptoms or awaiting hysterectomy."],
["Ormeloxifene / Centchroman\n(SERM)",
"60 mg twice weekly × 3 months",
"Significant",
"Selective estrogen receptor modulator; also used as oral contraceptive; reduces blood loss."],
["Desmopressin\n(Synthetic arginine-vasopressin analogue)",
"0.3 μg/kg IV or intranasally",
"—",
"ONLY for von Willebrand's disease and Factor VIII deficiency."]],
[PW*0.16, PW*0.26, PW*0.08, PW*0.50], hbg=BLUE))
story += [sp(0.08),
alertbox("LNG-IUS = FIRST LINE for HMB without structural/histological abnormality (FIGO endorsed). Blood loss ↓ = 97%. Effective 5 years. = Medical hysterectomy."),
sp(0.08), PageBreak(),
]
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# ██ PAGE 4 ██ — Surgical + PALM-COEIN + Numbers + Exam Q&A
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
story.append(sec("9. SURGICAL MANAGEMENT OF DUB", bg=BROWN))
story.append(sp(0.08))
Lp4 = [
Paragraph("<b>A. Uterine Curettage</b>", H2),
Paragraph("Done predominantly as diagnostic tool for elderly women but has haemostatic/therapeutic effect. Should be done after ultrasonography. <b>Presently, D&C is NOT recommended as diagnostic tool or therapy (replaced by H&B).</b> Urgent indication: acyclic bleeding with suspected endometrial pathology.", BD),
sp(0.05),
tbl(["Type of Bleeding","Curettage Timing"],
[["Cyclic — Menorrhagia","5-6 days PRIOR to period"],
["Cyclic — Irregular Shedding","5-6 days AFTER period starts"],
["Cyclic — Irregular Ripening","Soon AFTER period starts"],
["Acyclic","Soon AFTER period starts"],
["Continuous","ANY time"]],
[LW*0.52, LW*0.48], hbg=BROWN),
sp(0.1),
Paragraph("<b>C. Hysterectomy</b>", H2),
Paragraph("<b>NOT first line for HMB/DUB.</b> Justified when: (i) Conservative treatment fails or contraindicated; (ii) Blood loss impairs health and quality of life; (iii) Endometrial hyperplasia with atypia on histology. Route: vaginal, abdominal, or laparoscopic assisted vaginal. Decision can be made as patient approaches 40. <b>Especially recommended in those under 45 years.</b>", BD),
sp(0.1),
sec("10. AUB — PALM-COEIN (FIGO/ACOG 2011)", bg=MAROON, w=LW),
sp(0.08),
Paragraph("Traditional terms (menorrhagia, metrorrhagia, polymenorrhoea, oligomenorrhoea) replaced by PALM-COEIN nomenclature for universal acceptance.", BD),
sp(0.05),
tbl(["PALM (Structural Causes)","COEIN (Non-structural)"],
[["P — Polyp","C — Coagulopathy"],
["A — Adenomyosis","O — Ovulatory dysfunction"],
["L — Leiomyoma","E — Endometrial"],
["M — Malignancy and Hyperplasia","I — Iatrogenic"],
["","N — Not yet classified"]],
[LW*0.50, LW*0.50], hbg=MAROON),
]
Rp4 = [
Paragraph("<b>B. Endometrial Ablation / Resection</b>", H2),
Paragraph("<b>Indications:</b> (a) Failed medical treatment (b) Does not wish to preserve menstrual/reproductive function (c) Uterus ≤10 weeks size (d) Uterine fibroids <3 cm (e) Prefers to preserve uterus.", BD),
sp(0.05),
tbl(["Method","Temp / Energy","Depth","Duration","Key Point"],
[["Uterine Thermal Balloon\n★ FIRST LINE","87°C\nhot normal saline","—","8-10 min","No cervical dilatation. Suitable if unfit for GA or long surgery. FIRST LINE. Day care basis."],
["Microwave Endometrial Ablation","75-80°C","6 mm","2-3 min\n(faster than TCRE)","Outpatient procedure. Results similar to TCRE. Less costly than laser."],
["Novasure","Bipolar radiofrequency;\nexpandable base","Entire endometrium","90 sec","CONTRAINDICATED: uterine cavity <4 cm, PID, cesarean delivery. Pretreat GnRH/danazol 3 weeks prior."],
["TCRE (Transcervical Resection of Endometrium)","Continuous flow resectoscope","Basal layer + superficial myometrium","Longer","MUST remove basal layer + superficial myometrium. Failure = regeneration of endometrium."],
["Laser Ablation (Nd:YAG)","Coagulation / vaporization / carbonization","4-5 mm","—","Therapeutic Ashermann's + amenorrhoea. When hysterectomy is contraindicated. Completed families only."],
["Roller Ball Ablation","Electrical coagulation","4 mm","—","First generation method. Used with TCRE when myomectomy planned simultaneously."]],
[RW*0.20, RW*0.16, RW*0.12, RW*0.12, RW*0.40], hbg=BROWN),
sp(0.06),
notebox("Ablation Results: Overall success 70-80%. Amenorrhoea 20-40%. Significant blood loss reduction in another 50%. 10% need repeat/hysterectomy. Uterine Artery Embolisation for large fibroids >3cm.", bg=LGRN, bc=GREEN, w=RW),
]
story.append(col2(Lp4, Rp4))
story += [sp(0.08)]
# High-yield numbers + Exam Q&A in two columns
story.append(sec("11. HIGH-YIELD NUMBERS & KEY FACTS", bg=STEEL))
story += [sp(0.06)]
num_L = [
tbl(["Fact","Value"],
[["Incidence of DUB","~10%"],
["Ovular : Anovular DUB","20% : 80%"],
["LNG-IUS blood loss reduction","97% ★"],
["LNG-IUS effective duration","5 years"],
["Danazol blood loss reduction","60%"],
["Tranexamic acid / COC","50% each"],
["NSAIDs (Mefenamic acid)","25-30%"],
["Endometrial ablation success","70-80%"],
["Amenorrhoea rate post-ablation","20-40%"],
["ET hyperplasia on TVS","≥ 12 mm"],
["ET atrophic on TVS","≤ 4 mm"]],
[LW*0.64, LW*0.36], hbg=STEEL),
]
num_R = [
tbl(["Measurement","Value"],
[["Metropathia uterus size","8-10 weeks"],
["Conjugated estrogen IV dose","25 mg every 4h"],
["Thermal balloon temperature","87°C × 8-10 min"],
["Microwave temp / depth","75-80°C / 6 mm / 2-3 min"],
["Novasure ablation time","90 seconds"],
["Laser (Nd:YAG) depth","4-5 mm"],
["Roller ball depth","4 mm"],
["Danazol dose","200-400 mg/day × 6 months"],
["Ormeloxifene","60 mg twice weekly × 3 months"],
["Desmopressin","0.3 μg/kg IV or intranasal"],
["Normal secretory pattern in DUB","60% (most common)"]],
[RW*0.60, RW*0.40], hbg=STEEL),
]
story.append(col2(num_L, num_R))
story += [sp(0.1)]
story.append(sec("12. TOP EXAM QUESTIONS & MODEL ANSWERS", bg=RED))
story += [sp(0.06)]
story.append(tbl(["Q","Question","Model Answer"],
[["1","Define DUB and state its origin","AUB without organic/systemic/iatrogenic cause; origin = HPO axis (endocrine); diagnosis of exclusion"],
["2","Why is Metropathia hemorrhagica absolutely painless?","Low PGF2α, low PGF2α/PGE2 ratio, low thromboxane → no vasoconstriction → no dysmenorrhoea"],
["3","Classify DUB with types","Ovular 20%: polymenorrhoea, oligomenorrhoea, irregular shedding/ripening; Anovular 80%: menorrhagia, CGH"],
["4","Biopsy timing and finding in irregular shedding","5th-6th day AFTER menses starts; mixture of secretory + proliferative; total absence of surface epithelium"],
["5","Microscopic findings in Cystic Glandular Hyperplasia","Swiss cheese pattern; cystic glandular hypertrophy; columnar epithelium; no secretory changes; necrosis in superficial layers"],
["6","First line treatment for HMB without structural abnormality","LNG-IUS — 97% blood loss reduction; effective 5 years; considered medical hysterectomy (FIGO endorsed)"],
["7","When is endometrial biopsy mandatory?","Postmenopausal period — ALWAYS mandatory to exclude endometrial malignancy (Pipelle, OPD, no anaesthesia)"],
["8","What has replaced D&C in DUB?","Hysteroscopy + directed biopsy (H&B) — OPD, detects polyps/fibroids missed by blind curettage"],
["9","First line ablation done as day care","Uterine Thermal Balloon (87°C × 8-10 min); no cervical dilatation; suitable if unfit for GA"],
["10","Novasure ablation contraindications","Uterine cavity <4 cm, PID, previous cesarean delivery"],
["11","Drug of choice in DUB with von Willebrand's disease","Desmopressin 0.3 μg/kg IV or intranasally"],
["12","Progestin mechanism (antiestrogenic actions — 3 points)","(i) 17β-HSD → estradiol to estrone; (ii) Inhibits ER induction; (iii) Antimitotic effect on endometrium"],
["13","PALM-COEIN classification (FIGO 2011)","PALM = structural (Polyp, Adenomyosis, Leiomyoma, Malignancy); COEIN = non-structural (Coagulopathy, Ovulatory, Endometrial, Iatrogenic, Not classified)"],
["14","When is hysterectomy justified in DUB?","Failed conservative treatment; blood loss impairs QoL; endometrial hyperplasia with atypia; patient approaching 40"],
["15","Progestin preferred and reason","MPA preferred over Norethisterone because it does NOT alter serum lipids"]],
[PW*0.04, PW*0.37, PW*0.59], hbg=RED))
story += [sp(0.08)]
# FOOTER
foot = Table([[Paragraph(
"Source: DC Dutta's Textbook of Gynecology, Chapter 15 — Abnormal Uterine Bleeding (AUB) | Exam-Oriented Notes | All rights to original authors",
FT)]], colWidths=[PW])
foot.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1),NAVY),
("TOPPADDING",(0,0),(-1,-1),3),("BOTTOMPADDING",(0,0),(-1,-1),3),
("LEFTPADDING",(0,0),(-1,-1),8),
]))
story.append(foot)
# ── Build ─────────────────────────────────────────────────────────────────────
doc.build(story)
from pypdf import PdfReader
import os
r = PdfReader(OUTPUT)
print(f"Pages: {len(r.pages)}")
print(f"Size: {os.path.getsize(OUTPUT)/1024:.1f} KB")
print(f"PDF created: {OUTPUT}")
cd /home/daytona/workspace/dub-notes && python generate_dub_4pg.py 2>&1
~/dub-notes/generate_dub_4pg.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/dub-notes/generate_dub_4pg.py'
~/dub-notes/generate_dub_4pg.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/dub-notes/generate_dub_4pg.py'
~/dub-notes/generate_dub_4pg.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/dub-notes/generate_dub_4pg.py'
~/dub-notes/generate_dub_4pg.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/dub-notes/generate_dub_4pg.py'
cd /home/daytona/workspace/dub-notes && python generate_dub_4pg.py 2>&1
~/dub-notes/generate_dub_4pg.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/dub-notes/generate_dub_4pg.py'
cd /home/daytona/workspace/dub-notes && python generate_dub_4pg.py 2>&1
~/dub-notes/generate_dub_4pg.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/dub-notes/generate_dub_4pg.py'
cd /home/daytona/workspace/dub-notes && python generate_dub_4pg.py 2>&1
~/dub-notes/generate_dub_4pg.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/dub-notes/generate_dub_4pg.py'
cd /home/daytona/workspace/dub-notes && python generate_dub_4pg.py 2>&1
cd /home/daytona/workspace/dub-notes && python3 -c " from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.lib.styles import ParagraphStyle from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY OUTPUT = '/home/daytona/workspace/dub-notes/DUB_Exam_Notes_4pg.pdf' doc = SimpleDocTemplate(OUTPUT, pagesize=A4, leftMargin=1.0*cm, rightMargin=1.0*cm, topMargin=0.8*cm, bottomMargin=0.8*cm) PW = A4[0] - 2.0*cm NAVY=colors.HexColor('#0D1B4B'); BLUE=colors.HexColor('#1565C0'); STEEL=colors.HexColor('#37474F') TEAL=colors.HexColor('#00695C'); RED=colors.HexColor('#B71C1C'); PURP=colors.HexColor('#4A148C') BROWN=colors.HexColor('#4E342E'); GREEN=colors.HexColor('#1B5E20'); MAROON=colors.HexColor('#880E4F') WHITE=colors.white; LBLUE=colors.HexColor('#E3F2FD'); LTEAL=colors.HexColor('#E0F2F1') LRED=colors.HexColor('#FFEBEE'); LGREY=colors.HexColor('#F5F5F5'); LYELL=colors.HexColor('#FFFDE7') LGRN=colors.HexColor('#E8F5E9'); TEXT=colors.HexColor('#1A1A1A'); MGREY=colors.HexColor('#455A64') def PS(n,**k): return ParagraphStyle(n,**k) COV1=PS('c1',fontSize=14,fontName='Helvetica-Bold',textColor=WHITE,alignment=TA_CENTER,leading=17) COV2=PS('c2',fontSize=7,fontName='Helvetica',textColor=LBLUE,alignment=TA_CENTER,leading=9) SHD=PS('sh',fontSize=7.8,fontName='Helvetica-Bold',textColor=WHITE,alignment=TA_LEFT,leading=9.5) H2=PS('h2',fontSize=7.5,fontName='Helvetica-Bold',textColor=NAVY,alignment=TA_LEFT,spaceAfter=1,spaceBefore=2,leading=9) H3=PS('h3',fontSize=7,fontName='Helvetica-Bold',textColor=TEAL,alignment=TA_LEFT,spaceAfter=0,spaceBefore=1,leading=9) BD=PS('bd',fontSize=6.8,fontName='Helvetica',textColor=TEXT,alignment=TA_JUSTIFY,spaceAfter=1,leading=9) BU=PS('bu',fontSize=6.8,fontName='Helvetica',textColor=TEXT,leftIndent=8,firstLineIndent=-6,spaceAfter=0.5,leading=9) AL=PS('al',fontSize=7.2,fontName='Helvetica-Bold',textColor=RED,alignment=TA_LEFT,leading=9.5) NT=PS('nt',fontSize=6.8,fontName='Helvetica-Oblique',textColor=TEAL,alignment=TA_LEFT,leading=9) TH=PS('th',fontSize=6.8,fontName='Helvetica-Bold',textColor=WHITE,alignment=TA_CENTER,leading=8.5) TC=PS('tc',fontSize=6.8,fontName='Helvetica',textColor=TEXT,alignment=TA_LEFT,leading=8.5) TCB=PS('tb',fontSize=6.8,fontName='Helvetica-Bold',textColor=NAVY,alignment=TA_LEFT,leading=8.5) FT=PS('ft',fontSize=6.5,fontName='Helvetica',textColor=LBLUE,alignment=TA_CENTER,leading=8) def sec(txt,bg=BLUE,w=PW): t=Table([[Paragraph(txt,SHD)]],colWidths=[w]) t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),bg), ('TOPPADDING',(0,0),(-1,-1),2.5),('BOTTOMPADDING',(0,0),(-1,-1),2.5), ('LEFTPADDING',(0,0),(-1,-1),5)])) return t def tbl(hdrs,rows,cw,hbg=BLUE,alt=LGREY): data=[[Paragraph(h,TH) for h in hdrs]] for i,row in enumerate(rows): data.append([Paragraph(str(c),TCB if j==0 else TC) for j,c in enumerate(row)]) t=Table(data,colWidths=cw) ts=[('BACKGROUND',(0,0),(-1,0),hbg), ('TOPPADDING',(0,0),(-1,-1),1.5),('BOTTOMPADDING',(0,0),(-1,-1),1.5), ('LEFTPADDING',(0,0),(-1,-1),2.5), ('GRID',(0,0),(-1,-1),0.3,colors.HexColor('#BDBDBD')), ('VALIGN',(0,0),(-1,-1),'TOP')] for i in range(1,len(data)): if i%2==0: ts.append(('BACKGROUND',(0,i),(-1,i),alt)) t.setStyle(TableStyle(ts)) return t def boxtbl(items,bg,bc,w=PW): t=Table([[items]],colWidths=[w]) t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),bg), ('TOPPADDING',(0,0),(-1,-1),2.5),('BOTTOMPADDING',(0,0),(-1,-1),2.5), ('LEFTPADDING',(0,0),(-1,-1),5),('BOX',(0,0),(-1,-1),0.7,bc)])) return t def alertbox(txt,bg=LRED,bc=RED,w=PW): return boxtbl(Paragraph(f'★ {txt}',AL),bg,bc,w) def notebox(txt,bg=LTEAL,bc=TEAL,w=PW): return boxtbl(Paragraph(f'◆ {txt}',NT),bg,bc,w) def col2(L,R,lw=None,rw=None): lw=lw or PW*0.495; rw=rw or PW*0.495 t=Table([[L,R]],colWidths=[lw,rw]) t.setStyle(TableStyle([('VALIGN',(0,0),(-1,-1),'TOP'), ('TOPPADDING',(0,0),(-1,-1),0),('BOTTOMPADDING',(0,0),(-1,-1),0), ('LEFTPADDING',(0,0),(-1,-1),0),('RIGHTPADDING',(0,0),(-1,-1),2)])) return t sp=lambda h=0.08: Spacer(1,h*cm) LW=PW*0.493; RW=PW*0.493 story=[] # COVER cov=Table([[Paragraph('DYSFUNCTIONAL UTERINE BLEEDING (DUB)',COV1), Paragraph('Exam-Oriented Notes | DC Dutta Textbook of Gynecology — Chapter 15 | AUB',COV2), Paragraph('Definition · Pathophysiology · Classification · Types · Endometrial Patterns · Investigations · Medical Management · Surgical Management · PALM-COEIN · High-Yield Numbers',COV2)]], colWidths=[PW]) cov.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),NAVY), ('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5), ('LEFTPADDING',(0,0),(-1,-1),7)])) story+=[cov,sp(0.15)] # ── PAGE 1 ── Def+Patho (L) | Classification+Types (R) Lp1=[ sec('1. DEFINITION & INCIDENCE',bg=BLUE,w=LW), sp(0.08), Paragraph('<b>DUB</b> = abnormal uterine bleeding <b>without any clinically detectable organic, systemic and iatrogenic cause</b> (pelvic pathology, pregnancy are <b>excluded</b>). Origin = dysfunction of <b>hypothalamo-pituitary-ovarian (HPO) axis</b>.',BD), Paragraph('<b>HMB</b> = bleeding interfering with woman\'s physical, emotional, social and maternal quality of life.',BD), alertbox('DUB = DIAGNOSIS OF EXCLUSION. Organic/systemic/iatrogenic/pregnancy causes MUST be ruled out.',w=LW), sp(0.06), Paragraph('<b>Incidence:</b> ~<b>10%</b> of new outpatient gynaecology patients.',BD), sp(0.1), sec('2. PATHOPHYSIOLOGY',bg=STEEL,w=LW), sp(0.08), Paragraph('<b>Normal haemostasis:</b> (1) Platelet adhesion (2) Platelet plug + fibrin (3) Vasoconstriction (4) Endometrial regeneration (5) ↑ PGF2α/PGE2 ratio',BD), sp(0.05), tbl(['Mediator','Normal Role','In Anovulatory DUB'], [['PGF2α','Vasoconstriction; reduces bleeding','DECREASED → excess bleeding'], ['PGE2','Vasodilation; promotes bleeding','PGF2α/PGE2 ratio LOW'], ['Progesterone','↑ PGF2α from arachidonic acid; ↑ endothelin','ABSENT (no ovulation)'], ['Thromboxane','Vasoconstriction; haemostasis','LOW → NO dysmenorrhoea'], ['Endothelin','Powerful vasoconstrictor','Decreased']], [LW*0.21,LW*0.40,LW*0.39],hbg=STEEL), sp(0.06), alertbox('WHY IS METROPATHIA PAINLESS? Low PGF2α, low PGF2α/PGE2 ratio, low thromboxane → no vasoconstriction → ABSOLUTELY PAINLESS',w=LW), sp(0.06), Paragraph('<b>Endometrial abnormalities</b> may be primary or secondary to incoordination in HPO axis. Most prevalent at <b>extremes of reproductive period</b> (adolescence, menopause, following childbirth/abortion).',BD), ] Rp1=[ sec('3. CLASSIFICATION & 4. OVULAR BLEEDING TYPES',bg=TEAL,w=RW), sp(0.08), tbl(['Type/Variety','Pathophysiology','Biopsy Timing','Histology'], [['OVULAR (20%)\nPolymenorrhoea / Polymenorrhagia', 'Speeded follicular development → shortened follicular phase. Premature CL lysis → shortened luteal phase. After childbirth, abortion, adolescence, PID.', 'Prior to/within hrs of menses','Secretory changes'], ['OVULAR (20%)\nOligomenorrhoea', 'Ovarian unresponsiveness to FSH OR pituitary dysfunction → prolonged proliferative phase, normal secretory phase. Adolescence, preceding menopause.', 'Prior to/within hrs of menses','Secretory changes'], ['OVULAR (20%)\nIrregular Shedding ★', 'Incomplete LH withdrawal (26th day) → incomplete CL atrophy → persistent progesterone. OR persistent LH → ↓FSH → ↓follicle ripening → ↓estrogen → ↓regeneration.', '5th-6th DAY after\nmenses starts ★★', 'MIXTURE secretory + proliferative; TOTAL ABSENCE surface epithelium'], ['OVULAR (20%)\nIrregular Ripening', 'Poor CL formation; inadequate estrogen + progesterone. Low urinary pregnanediol + plasma progesterone. Slight bleeding prior to proper flow.', 'Prior to / soon after spotting', 'PATCHY secretory changes amidst proliferative endometrium'], ['ANOVULAR (80%) ★★\nMenorrhagia', 'No CL → no limiting progesterone → endometrial growth under unopposed estrogen → fragile endometrium → asynchronous shedding due to lack of compactness.', '—','Irregular; thin fragile endometrium'], ['ANOVULAR (80%) ★★\nCGH / Metropathia\n(Schroeder\'s disease)', 'Rhythmic gonadotropin disturbance → slow ↑ estrogen + no FSH inhibition → amenorrhoea 6-8 wks → heavy painless bleeding. Uterus: 8-10 wks size. Microscopy: SWISS CHEESE pattern, cystic glandular hypertrophy, columnar epithelium, NO secretory changes.', 'Any time', 'Swiss cheese pattern; cystic glandular hypertrophy; columnar epithelium; NO secretory changes; necrosis in superficial layers']], [RW*0.15,RW*0.40,RW*0.20,RW*0.25],hbg=TEAL), sp(0.06), alertbox('★★ EXAM TRAP: Irregular SHEDDING biopsy = 5th-6th day AFTER menses starts. Metropathia = absolutely painless.',w=RW), ] story.append(col2(Lp1,Rp1)) story+=[sp(0.08),PageBreak()] # ── PAGE 2 ── Endometrial Pattern + Investigations story.append(sec('5. ENDOMETRIAL PATTERN IN DUB',bg=STEEL)) story+=[sp(0.06), tbl(['Pattern','Frequency','Notes'], [['Normal secretory','60% (majority)','Most common finding in DUB; normal pattern'], ['Hyperplastic (CGH / Metropathia)','~30%','Swiss cheese pattern on microscopy; second most common'], ['Irregular shedding/ripening/Atrophic','~10%','Seen at extremes of reproductive period']], [PW*0.35,PW*0.15,PW*0.50],hbg=STEEL), sp(0.1), sec('6. INVESTIGATIONS IN DUB',bg=GREEN), sp(0.06), Paragraph('<b>Aims:</b> (i) Confirm menstrual abnormality (ii) Exclude systemic/iatrogenic/organic pelvic pathology (iii) Identify probable aetiology (iv) Work out definite therapy protocol',BD), sp(0.06), ] inv_L=[ tbl(['Investigation','Specifics / Key Fact'], [['Hb + Blood values','Hb — every case. Ferritin NOT routine. Pubertal: platelet count, PT, BT, APTT. Thyroid: TSH, T3, T4.'], ['TVS + Color Doppler','ET ≥12 mm = hyperplasia; ET ≤4 mm = atrophic. Detects fibroid, adenomyosis.'], ['SIS (Saline Infusion Sonography)','Superior to TVS for polyps, submucous fibroids, intrauterine abnormality (septate uterus).'], ['Hysteroscopy + Directed Biopsy (H&B)','Biopsy under direct vision; outpatient. REPLACED D&C. Detects polyps/fibroids missed by blind curettage. ★']], [LW*0.28,LW*0.72],hbg=GREEN), ] inv_R=[ tbl(['Investigation','Specifics / Key Fact'], [['Pipelle Sampler','OPD; no anaesthesia; blind — cannot detect polyps/fibroids. MANDATORY in postmenopausal. ★'], ['Laparoscopy','Exclude endometriosis, PID, granulosa cell tumour. Urgent if pelvic pain.'], ['D&C','Exclude organic lesions; functional state; incidental therapeutic benefit. NOT recommended as diagnostic tool or therapy now (replaced by H&B).']], [RW*0.28,RW*0.72],hbg=GREEN), sp(0.06), tbl(['Age Group','EB Indication','Priority'], [['Adolescent < 20 yrs','Only if severe or fails medical Rx','RARELY needed'], ['Childbearing 20-40 yrs','Only if ACYCLIC bleeding','When acyclic'], ['Postmenopausal > 40 yrs','MANDATORY — exclude malignancy','ALWAYS ★']], [RW*0.28,RW*0.46,RW*0.26],hbg=RED), ] story.append(col2(inv_L,inv_R)) story+=[sp(0.06), notebox('Summary: (a) Blood values (b) TVS + SIS (c) Pipelle or hysteroscopic biopsy (d) Laparoscopy for selected cases'), sp(0.08), sec('7. MANAGEMENT — MEDICAL',bg=BLUE), sp(0.06), Paragraph('<b>Management depends on: (A) Age (B) Desire for child bearing (C) Severity of bleeding (D) Associated pathology.</b> General: Rest during bleeding; correct anaemia; treat systemic/endocrinal abnormalities.',BD), sp(0.06), ] story.append(tbl(['Drug / Class','Dose / Regimen','Blood Loss ↓','Key Points'], [['Mefenamic Acid (PSI)','150-600 mg orally in divided doses during bleeding','25-30%','2nd line. Inhibits PG synthesis + blocks PGE2 receptor. Side effects: headache, nausea.'], ['Tranexamic Acid (Antifibrinolytic)','Standard doses during bleeding phase','50%','2nd line. Counteracts endometrial fibrinolysis. Useful in IUCD-induced menorrhagia. CONTRAINDICATED in thromboembolism history.'], ['Progestins — MAINLINE\nNorethisterone / MPA', 'Stop bleeding: Norethisterone 5 mg TDS till stops (3-7 days), then COC.\n5th-25th day: MPA 10 mg/day × 3 cycles.\n15th-25th day: Dydrogesterone 10 mg OD/BD × 3 cycles (if pregnancy desired).\nContinuous: MPA 10 mg TDS × ≥90 days.', '50% (5th-25th course)', 'MPA preferred (does NOT alter serum lipids). Mechanism: (i) 17β-HSD → estradiol to estrone; (ii) Inhibits ER induction; (iii) Antimitotic on endometrium.'], ['LNG-IUS ★ FIRST LINE','Levonorgestrel IUS; effective 5 years','97% ★★', 'FIRST LINE for HMB without structural/histological abnormality. Glandular atrophy, decidualisation, cell inactivation. = Medical hysterectomy. Also contraceptive.'], ['COC Pills','5th-25th day × 3 cycles','50%', 'Endometrial atrophy; suppresses H-P-O-E axis; reduces blood loss 50%; also contraceptive.'], ['Conjugated Estrogen IV','25 mg IV every 4 hours till controlled, then oral progestin + COC','Acute haemostasis', 'Acute/severe bleeding. Rapid endometrial growth; platelet adhesiveness; ↑fibrinogen, factors V + X. If bleeding continues → D&C.'], ['Danazol (17α-ethynyl testosterone)','200-400 mg/day × 6 months','60%', 'Recurrent symptoms / awaiting hysterectomy. Larger dose → amenorrhoea. Side effects: androgenic.'], ['GnRH Agonists','Subtherapeutic → reduces loss; Therapeutic → amenorrhoea','Variable', 'Short-term severe DUB; infertile patients. Improves anaemia. Before endometrial ablation.'], ['Mifepristone (RU 486)\n(Antiprogesterone)','Varying doses','—', 'Inhibits ovulation; amenorrhoea; reduces myoma size.'], ['Ormeloxifene / Centchroman (SERM)','60 mg twice weekly × 3 months','Significant', 'SERM; also oral contraceptive.'], ['Desmopressin\n(Vasopressin analogue)','0.3 μg/kg IV or intranasally','—', 'ONLY for von Willebrand\'s disease + Factor VIII deficiency.']], [PW*0.15,PW*0.26,PW*0.09,PW*0.50],hbg=BLUE)) story+=[sp(0.06), alertbox('LNG-IUS = FIRST LINE for HMB without structural/histological abnormality. Blood loss ↓ = 97%. Effective 5 years. = Medical hysterectomy.'), sp(0.08),PageBreak(), ] # ── PAGE 3+4 ── Surgical + PALM-COEIN + Numbers + Exam Q&A story.append(sec('8. SURGICAL MANAGEMENT OF DUB',bg=BROWN)) story.append(sp(0.06)) Lp4=[ Paragraph('<b>A. Uterine Curettage</b>',H2), Paragraph('Done as diagnostic tool for elderly women; haemostatic/therapeutic effect. Done after USG. <b>Presently NOT recommended as diagnostic tool or therapy (replaced by H&B).</b>',BD), sp(0.04), tbl(['Type of Bleeding','Curettage Timing'], [['Cyclic — Menorrhagia','5-6 days PRIOR to period'], ['Cyclic — Irregular Shedding','5-6 days AFTER period starts'], ['Cyclic — Irregular Ripening','Soon AFTER period starts'], ['Acyclic','Soon AFTER period starts'], ['Continuous','ANY time']], [LW*0.52,LW*0.48],hbg=BROWN), sp(0.08), Paragraph('<b>C. Hysterectomy</b>',H2), Paragraph('<b>NOT first line for HMB/DUB.</b> Justified when: (i) Conservative treatment fails/contraindicated; (ii) Blood loss impairs QoL; (iii) Endometrial hyperplasia + atypia. Route: vaginal, abdominal, or laparoscopic. Decision made as patient approaches 40. <b>Especially for those under 45 years.</b>',BD), sp(0.08), sec('9. AUB — PALM-COEIN (FIGO/ACOG 2011)',bg=MAROON,w=LW), sp(0.06), Paragraph('Traditional terms replaced by PALM-COEIN nomenclature for universal acceptance.',BD), sp(0.04), tbl(['PALM (Structural)','COEIN (Non-structural)'], [['P — Polyp','C — Coagulopathy'], ['A — Adenomyosis','O — Ovulatory dysfunction'], ['L — Leiomyoma','E — Endometrial'], ['M — Malignancy + Hyperplasia','I — Iatrogenic'], ['','N — Not yet classified']], [LW*0.50,LW*0.50],hbg=MAROON), sp(0.08), sec('10. HIGH-YIELD NUMBERS',bg=STEEL,w=LW), sp(0.05), tbl(['Fact','Value'], [['Incidence of DUB','~10%'], ['Ovular : Anovular','20% : 80%'], ['LNG-IUS blood loss ↓','97% ★'], ['LNG-IUS effective duration','5 years'], ['Danazol blood loss ↓','60%'], ['Tranexamic acid / COC','50% each'], ['NSAIDs (Mefenamic acid)','25-30%'], ['Ablation overall success','70-80%'], ['Amenorrhoea post-ablation','20-40%'], ['ET hyperplasia on TVS','≥ 12 mm'], ['ET atrophic on TVS','≤ 4 mm'], ['Metropathia uterus size','8-10 weeks'], ['Conjugated estrogen IV dose','25 mg every 4h'], ['Normal secretory DUB pattern','60% (most common)'], ['Hyperplastic pattern in DUB','~30%']], [LW*0.68,LW*0.32],hbg=STEEL), ] Rp4=[ Paragraph('<b>B. Endometrial Ablation / Resection</b>',H2), Paragraph('<b>Indications:</b> (a) Failed medical Rx (b) Does not wish menstrual/reproductive function preservation (c) Uterus ≤10 wks (d) Fibroids <3 cm (e) Prefers to preserve uterus.',BD), sp(0.04), tbl(['Method','Temp/Energy','Depth','Duration','Key Point'], [['Uterine Thermal Balloon\n★ FIRST LINE','87°C\nhot saline','—','8-10 min','No cervical dilatation. Suitable if unfit for GA. FIRST LINE. Day care basis.'], ['Microwave Endometrial Ablation','75-80°C','6 mm','2-3 min','Outpatient. Results = TCRE. Less costly than laser.'], ['Novasure','Bipolar radiofrequency;\nexpandable base','Entire endometrium','90 sec','CONTRAINDICATED: cavity <4 cm, PID, cesarean delivery. Pretreat GnRH/danazol 3 wks.'], ['TCRE (Transcervical Resection)','Continuous flow resectoscope','Basal layer + superficial myometrium','Longer','MUST remove basal layer + superficial myometrium. Failure = regeneration.'], ['Laser Ablation (Nd:YAG)','Coagulation/vaporization/carbonization','4-5 mm','—','Therapeutic Ashermann\'s + amenorrhoea. When hysterectomy contraindicated.'], ['Roller Ball Ablation','Electrical coagulation','4 mm','—','First generation. Used with TCRE if myomectomy planned.']], [RW*0.21,RW*0.15,RW*0.12,RW*0.11,RW*0.41],hbg=BROWN), sp(0.05), notebox('Ablation results: Overall success 70-80%. Amenorrhoea 20-40%. Significant blood loss ↓ in another 50%. 10% need repeat/hysterectomy. Uterine Artery Embolisation for large fibroids >3 cm.',bg=LGRN,bc=GREEN,w=RW), sp(0.06), tbl(['Measurement','Value'], [['Thermal balloon','87°C × 8-10 min'], ['Microwave ablation','75-80°C / 6 mm / 2-3 min'], ['Novasure','90 seconds'], ['Laser (Nd:YAG) depth','4-5 mm'], ['Roller ball depth','4 mm'], ['Danazol dose','200-400 mg/day × 6 months'], ['Ormeloxifene','60 mg twice weekly × 3 months'], ['Desmopressin','0.3 μg/kg IV or intranasal']], [RW*0.55,RW*0.45],hbg=STEEL), ] story.append(col2(Lp4,Rp4)) story+=[sp(0.08)] story.append(sec('11. TOP EXAM QUESTIONS & MODEL ANSWERS',bg=RED)) story+=[sp(0.06)] story.append(tbl(['Q','Question','Model Answer'], [['1','Define DUB and state its origin','AUB without organic/systemic/iatrogenic cause; origin = HPO axis (endocrine); diagnosis of exclusion'], ['2','Why is Metropathia absolutely painless?','Low PGF2α, low PGF2α/PGE2 ratio, low thromboxane → no vasoconstriction → no dysmenorrhoea'], ['3','Classify DUB with types','Ovular 20%: polymenorrhoea, oligomenorrhoea, irregular shedding/ripening; Anovular 80%: menorrhagia, CGH'], ['4','Biopsy timing + finding in irregular shedding','5th-6th day AFTER menses starts; mixture secretory + proliferative; total absence of surface epithelium'], ['5','Microscopy of Cystic Glandular Hyperplasia','Swiss cheese pattern; cystic glandular hypertrophy; columnar epithelium; no secretory changes; necrosis in superficial layers'], ['6','First line treatment for HMB without structural abnormality','LNG-IUS — 97% blood loss ↓; effective 5 years; medical hysterectomy (FIGO endorsed)'], ['7','When is endometrial biopsy mandatory?','Postmenopausal period — ALWAYS mandatory to exclude endometrial malignancy'], ['8','What has replaced D&C in DUB?','Hysteroscopy + directed biopsy (H&B) — OPD, detects polyps/fibroids missed by blind curettage'], ['9','First line ablation method (day care)','Uterine Thermal Balloon (87°C × 8-10 min); no cervical dilatation; suitable if unfit for GA'], ['10','Novasure contraindications','Uterine cavity <4 cm, PID, previous cesarean delivery'], ['11','Drug of choice — von Willebrand\'s disease + DUB','Desmopressin 0.3 μg/kg IV or intranasally'], ['12','Progestin mechanism (3 antiestrogenic actions)','(i) 17β-HSD → estradiol to estrone; (ii) Inhibits ER induction; (iii) Antimitotic effect on endometrium'], ['13','PALM-COEIN (FIGO 2011)','PALM = structural (Polyp, Adenomyosis, Leiomyoma, Malignancy); COEIN = non-structural (Coagulopathy, Ovulatory, Endometrial, Iatrogenic, Not classified)'], ['14','When is hysterectomy justified?','Failed conservative Rx; blood loss impairs QoL; endometrial hyperplasia + atypia; patient approaching 40'], ['15','Preferred progestin and reason','MPA preferred over Norethisterone — does NOT alter serum lipids']], [PW*0.04,PW*0.37,PW*0.59],hbg=RED)) story+=[sp(0.06)] foot=Table([[Paragraph('Source: DC Dutta\'s Textbook of Gynecology, Chapter 15 — Abnormal Uterine Bleeding (AUB) | Exam-Oriented Notes | All rights to original authors',FT)]],colWidths=[PW]) foot.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),NAVY), ('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3), ('LEFTPADDING',(0,0),(-1,-1),7)])) story.append(foot) doc.build(story) from pypdf import PdfReader; import os r=PdfReader(OUTPUT); print(f'Pages: {len(r.pages)} Size: {os.path.getsize(OUTPUT)/1024:.1f} KB') print(f'PDF: {OUTPUT}') " 2>&1
Generate a exam oriented notes less than pages than the original
cd /home/daytona/workspace/dub-notes && python3 - << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.lib.styles import ParagraphStyle from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY OUTPUT = '/home/daytona/workspace/dub-notes/DUB_Exam_3pg.pdf' doc = SimpleDocTemplate(OUTPUT, pagesize=A4, leftMargin=1.0*cm, rightMargin=1.0*cm, topMargin=0.8*cm, bottomMargin=0.8*cm) PW = A4[0] - 2.0*cm # ~175mm # ── Palette ────────────────────────────────────────────────────────────────── NAVY = colors.HexColor('#0D1B4B'); BLUE = colors.HexColor('#1565C0') STEEL = colors.HexColor('#37474F'); TEAL = colors.HexColor('#00695C') RED = colors.HexColor('#B71C1C'); PURP = colors.HexColor('#4A148C') BROWN = colors.HexColor('#4E342E'); GREEN = colors.HexColor('#1B5E20') MAROON = colors.HexColor('#880E4F'); WHITE = colors.white LBLUE = colors.HexColor('#E3F2FD'); LTEAL = colors.HexColor('#E0F2F1') LRED = colors.HexColor('#FFEBEE'); LGREY = colors.HexColor('#F5F5F5') LGRN = colors.HexColor('#E8F5E9'); TEXT = colors.HexColor('#1A1A1A') MGREY = colors.HexColor('#455A64') def PS(n,**k): return ParagraphStyle(n,**k) COV1 = PS('c1',fontSize=15,fontName='Helvetica-Bold',textColor=WHITE,alignment=TA_CENTER,leading=18) COV2 = PS('c2',fontSize=7,fontName='Helvetica',textColor=LBLUE,alignment=TA_CENTER,leading=9) SHD = PS('sh',fontSize=7.8,fontName='Helvetica-Bold',textColor=WHITE,alignment=TA_LEFT,leading=9.5) H2 = PS('h2',fontSize=7.5,fontName='Helvetica-Bold',textColor=NAVY,alignment=TA_LEFT,spaceAfter=1,spaceBefore=2,leading=9) BD = PS('bd',fontSize=6.8,fontName='Helvetica',textColor=TEXT,alignment=TA_JUSTIFY,spaceAfter=1,leading=9.2) BU = PS('bu',fontSize=6.8,fontName='Helvetica',textColor=TEXT,leftIndent=8,firstLineIndent=-6,spaceAfter=0.5,leading=9) AL = PS('al',fontSize=7.2,fontName='Helvetica-Bold',textColor=RED,alignment=TA_LEFT,leading=9.5) NT = PS('nt',fontSize=6.8,fontName='Helvetica-Oblique',textColor=TEAL,alignment=TA_LEFT,leading=9) TH = PS('th',fontSize=6.8,fontName='Helvetica-Bold',textColor=WHITE,alignment=TA_CENTER,leading=8.5) TC = PS('tc',fontSize=6.8,fontName='Helvetica',textColor=TEXT,alignment=TA_LEFT,leading=8.5) TCB = PS('tb',fontSize=6.8,fontName='Helvetica-Bold',textColor=NAVY,alignment=TA_LEFT,leading=8.5) FT = PS('ft',fontSize=6.5,fontName='Helvetica',textColor=LBLUE,alignment=TA_CENTER,leading=8) def sec(txt,bg=BLUE,w=PW): t=Table([[Paragraph(txt,SHD)]],colWidths=[w]) t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),bg), ('TOPPADDING',(0,0),(-1,-1),2.5),('BOTTOMPADDING',(0,0),(-1,-1),2.5), ('LEFTPADDING',(0,0),(-1,-1),5)])) return t def tbl(hdrs,rows,cw,hbg=BLUE,alt=LGREY): data=[[Paragraph(h,TH) for h in hdrs]] for i,row in enumerate(rows): data.append([Paragraph(str(c),TCB if j==0 else TC) for j,c in enumerate(row)]) t=Table(data,colWidths=cw) ts=[('BACKGROUND',(0,0),(-1,0),hbg), ('TOPPADDING',(0,0),(-1,-1),1.5),('BOTTOMPADDING',(0,0),(-1,-1),1.5), ('LEFTPADDING',(0,0),(-1,-1),2.5), ('GRID',(0,0),(-1,-1),0.3,colors.HexColor('#BDBDBD')), ('VALIGN',(0,0),(-1,-1),'TOP')] for i in range(1,len(data)): if i%2==0: ts.append(('BACKGROUND',(0,i),(-1,i),alt)) t.setStyle(TableStyle(ts)) return t def bbox(items,bg,bc,w=PW): t=Table([[items]],colWidths=[w]) t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),bg), ('TOPPADDING',(0,0),(-1,-1),2.5),('BOTTOMPADDING',(0,0),(-1,-1),2.5), ('LEFTPADDING',(0,0),(-1,-1),5),('BOX',(0,0),(-1,-1),0.7,bc)])) return t def abox(txt,bg=LRED,bc=RED,w=PW): return bbox(Paragraph(f'★ {txt}',AL),bg,bc,w) def nbox(txt,bg=LTEAL,bc=TEAL,w=PW): return bbox(Paragraph(f'◆ {txt}',NT),bg,bc,w) def c2(L,R,lw=None,rw=None): lw=lw or PW*0.493; rw=rw or PW*0.493 t=Table([[L,R]],colWidths=[lw,rw]) t.setStyle(TableStyle([('VALIGN',(0,0),(-1,-1),'TOP'), ('TOPPADDING',(0,0),(-1,-1),0),('BOTTOMPADDING',(0,0),(-1,-1),0), ('LEFTPADDING',(0,0),(-1,-1),0),('RIGHTPADDING',(0,0),(-1,-1),2)])) return t sp=lambda h=0.08: Spacer(1,h*cm) LW=PW*0.493; RW=PW*0.493 # ════════════════════════════════════════════════════════════════════════ story=[] # ── COVER BANNER ───────────────────────────────────────────────────── cov=Table([[Paragraph('DYSFUNCTIONAL UTERINE BLEEDING (DUB)',COV1), Paragraph('Exam-Oriented Notes | DC Dutta\'s Textbook of Gynecology — Chapter 15',COV2), Paragraph('Definition · Incidence · Pathophysiology · Classification · Types · Endometrial Patterns · Investigations · Medical Management · Surgical Management · PALM-COEIN · High-Yield Numbers',COV2)]], colWidths=[PW]) cov.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),NAVY), ('TOPPADDING',(0,0),(-1,-1),6),('BOTTOMPADDING',(0,0),(-1,-1),6), ('LEFTPADDING',(0,0),(-1,-1),8)])) story+=[cov,sp(0.15)] # ════════════════════════════════════════════════════════════════════════ # PAGE 1 — Definitions + Pathophysiology + Classification + All Types # ════════════════════════════════════════════════════════════════════════ Lp1=[ sec('1. DEFINITION & INCIDENCE',bg=BLUE,w=LW), sp(0.08), Paragraph('<b>DUB</b> = abnormal uterine bleeding <b>without any clinically detectable organic, systemic and iatrogenic cause</b>. Pelvic pathology, tumour, inflammation or pregnancy must be <b>EXCLUDED</b>. Origin = <b>hypothalamo-pituitary-ovarian (HPO) axis</b> dysfunction (endocrine).',BD), Paragraph('<b>HMB (Heavy Menstrual Bleeding)</b> = bleeding interfering with a woman\'s physical, emotional, social and maternal quality of life.',BD), abox('DUB = DIAGNOSIS OF EXCLUSION. Organic / systemic / iatrogenic / pregnancy causes MUST be ruled out first.',w=LW), sp(0.06), Paragraph('<b>Incidence:</b> ~<b>10%</b> of new outpatients attending gynaecology OPD.',BD), sp(0.1), sec('2. PATHOPHYSIOLOGY',bg=STEEL,w=LW), sp(0.08), Paragraph('<b>Normal haemostasis in menstruation involves:</b> (1) Platelet adhesion (2) Platelet plug + fibrin (3) Localised vasoconstriction (4) Endometrial regeneration (5) ↑ PGF2α/PGE2 ratio.',BD), sp(0.05), tbl(['Mediator','Normal Role','In Anovulatory DUB'], [['PGF2α','Vasoconstriction; reduces bleeding','DECREASED → excess bleeding'], ['PGE2','Vasodilation; promotes bleeding','PGF2α/PGE2 ratio LOW'], ['Progesterone','↑PGF2α from arachidonic acid; ↑endothelin','ABSENT — no corpus luteum'], ['Thromboxane','Vasoconstriction; haemostasis','LOW → NO dysmenorrhoea'], ['Endothelin','Powerful vasoconstrictor','Decreased']], [LW*0.22,LW*0.40,LW*0.38],hbg=STEEL), sp(0.06), abox('WHY IS METROPATHIA PAINLESS? Low PGF2α + low PGF2α/PGE2 ratio + low thromboxane → no vasoconstriction → ABSOLUTELY PAINLESS',w=LW), sp(0.07), Paragraph('<b>Endometrial abnormalities</b> may be primary or secondary to HPO incoordination. Most prevalent at <b>extremes of reproductive period</b> (adolescence, menopause, after childbirth/abortion).',BD), sp(0.1), sec('3. CLASSIFICATION',bg=TEAL,w=LW), sp(0.06), tbl(['Type','% DUB','Key Subtypes'], [['OVULAR (Cyclical)','20%','Polymenorrhoea/Polymenorrhagia · Oligomenorrhoea · Irregular Shedding · Irregular Ripening'], ['ANOVULAR (Acyclical)','80% ★','Menorrhagia (anovulatory) · Cystic Glandular Hyperplasia (Metropathia haemorrhagica / Schroeder\'s disease)']], [LW*0.20,LW*0.12,LW*0.68],hbg=TEAL), ] Rp1=[ sec('4. OVULAR BLEEDING — TYPES & BIOPSY',bg=PURP,w=RW), sp(0.06), tbl(['Variety','Features','Biopsy Timing','Histology'], [['Polymenorrhoea / Polymenorrhagia', 'Shortened follicular phase (speeded follicular development). Premature CL lysis → shortened luteal phase. After childbirth, abortion, adolescence, PID.', 'Prior to/within hrs of menses','Secretory changes'], ['Oligomenorrhoea', 'Ovarian unresponsiveness to FSH OR pituitary dysfunction → prolonged proliferative phase with normal secretory phase. Adolescence, preceding menopause.', 'Prior to/within hrs of menses','Secretory changes'], ['Irregular Shedding ★★', 'Incomplete LH withdrawal (26th day) → incomplete CL atrophy → persistent progesterone. OR persistent LH→↓FSH→↓follicle ripening→↓estrogen→↓regeneration. Desquamation continues with failure of regeneration.', '5th-6th DAY after menses STARTS', 'MIXTURE secretory + proliferative; TOTAL ABSENCE of surface epithelium'], ['Irregular Ripening', 'Poor CL formation; inadequate estrogen + progesterone secretion. Low urinary pregnanediol + plasma progesterone. Slight bleeding prior to proper flow.', 'Prior to / soon after spotting', 'PATCHY secretory changes amidst proliferative endometrium']], [RW*0.16,RW*0.40,RW*0.20,RW*0.24],hbg=PURP), sp(0.06), abox('★★ EXAM TRAP: Irregular SHEDDING biopsy = 5th-6th day AFTER menses starts (NOT before). Normal endometrium regenerates by 3rd day.',w=RW), sp(0.1), sec('5. ANOVULAR BLEEDING (80%) — TYPES',bg=RED,w=RW), sp(0.06), tbl(['Type','Features','Histology'], [['Anovulatory Menorrhagia', 'No CL → no limiting progesterone → endometrial growth under unopposed estrogen → fragile endometrium → asynchronous shedding (lack of compactness).', 'Irregular; thin fragile endometrium'], ['Cystic Glandular Hyperplasia\n(Metropathia / Schroeder\'s disease)', 'Premenopausal women. Disturbance of rhythmic gonadotropin secretion → slow ↑estrogen + no FSH inhibition → amenorrhoea 6-8 wks → heavy PAINLESS bleeding. Uterus: 8-10 wks size, polypoidal endometrium.', 'SWISS CHEESE pattern; cystic glandular hypertrophy; columnar epithelium; NO secretory changes; necrosis in superficial layers; follicular cysts in ovary (no CL)'], ['Atrophy of Endometrium', 'Postmenopausal (or end-stage metropathia). Bleeding from rupture of dilated capillaries beneath atrophic surface epithelium. Due to: total absence of estrogen OR failure of uterine receptors.', 'Thin atrophic endometrium; dilated capillaries beneath atrophic surface epithelium']], [RW*0.20,RW*0.46,RW*0.34],hbg=RED), sp(0.07), sec('6. ENDOMETRIAL PATTERN IN DUB',bg=STEEL,w=RW), sp(0.06), tbl(['Pattern','Frequency','Notes'], [['Normal secretory','60% (majority)','Most common finding in DUB'], ['Hyperplastic (CGH/Metropathia)','~30%','Swiss cheese pattern on microscopy'], ['Irregular shedding/ripening/Atrophic','~10%','Extremes of reproductive period']], [RW*0.36,RW*0.15,RW*0.49],hbg=STEEL), ] story.append(c2(Lp1,Rp1)) story+=[sp(0.08),PageBreak()] # ════════════════════════════════════════════════════════════════════════ # PAGE 2 — Investigations + Medical Management # ════════════════════════════════════════════════════════════════════════ story.append(sec('7. INVESTIGATIONS IN DUB',bg=GREEN)) story+=[sp(0.06), Paragraph('<b>Aims:</b> (i) Confirm menstrual abnormality (ii) Exclude systemic/iatrogenic/organic pelvic pathology (iii) Identify probable aetiology (iv) Work out definite therapy protocol',BD), sp(0.05), ] invL=[ tbl(['Investigation','Specifics / Key Fact'], [['History','Pads, clots (size + number), duration. Hb estimate for blood loss. Cyclic vs acyclic. OCP/IUCD history. Bleeding from other sites (PID clue). Note: menstrual blood loss estimation by alkaline hematin or pictorial chart — NOT routinely done.'], ['Blood values','Hb — every case. Serum ferritin NOT routine. Pubertal: platelet count, PT, BT, APTT. Thyroid dysfunction: serum TSH, T3, T4.'], ['TVS + Color Doppler','ET ≥12 mm = hyperplasia; ET ≤4 mm = atrophic. Detects fibroid, adenomyosis, adnexal pathology.'], ['SIS (Saline Infusion Sonography)','Superior to TVS for polyps, submucous fibroids, intrauterine abnormality (septate/subseptate uterus).']], [LW*0.26,LW*0.74],hbg=GREEN), ] invR=[ tbl(['Investigation','Specifics / Key Fact'], [['Hysteroscopy + Directed Biopsy (H&B)','Biopsy under direct vision from offending site; outpatient (OPD) basis. REPLACED conventional D&C. Detects polyps and submucous fibroids MISSED by blind curettage.'], ['Pipelle Sampler','Endometrial sampling; OPD; no anaesthesia; blind — CANNOT detect polyps or submucous fibroids. MANDATORY in postmenopausal.'], ['Laparoscopy','Exclude endometriosis, PID, ovarian tumour (granulosa cell tumour). Urgent if pelvic pain. For selected cases.'], ['D&C (Diagnostic)','Exclude organic lesions; functional state of endometrium; incidental therapeutic benefit. Currently NOT recommended as diagnostic tool or therapy (replaced by H&B).']], [RW*0.26,RW*0.74],hbg=GREEN), sp(0.05), tbl(['Age Group','Endometrial Biopsy Indication','Priority'], [['Adolescent < 20 yrs','Only if severe or fails medical Rx','RARELY needed'], ['Childbearing 20-40 yrs','Only if ACYCLIC bleeding','When acyclic'], ['Postmenopausal > 40 yrs','MANDATORY — exclude malignancy','ALWAYS ★']], [RW*0.28,RW*0.46,RW*0.26],hbg=RED), ] story.append(c2(invL,invR)) story+=[sp(0.06), nbox('Summary of investigations: (a) Blood values (b) TVS + SIS — exclude structural abnormalities (c) Endometrial sampling (Pipelle) or hysteroscopic guided biopsy (d) Laparoscopy — for selected cases'), sp(0.08), sec('8. MANAGEMENT OF DUB — MEDICAL',bg=BLUE), sp(0.06), Paragraph('<b>Management depends on: (A) Age (B) Desire for child bearing (C) Severity of bleeding (D) Associated pathology.</b> Age groups: Pubertal/adolescent <20 yrs → Reproductive period 20-40 yrs → Premenopausal >40 yrs → Postmenopausal. General measures: Rest; correct anaemia; treat systemic/endocrinal abnormalities.',BD), sp(0.06), Paragraph('★ <b>With the introduction of potent orally active progestins, they became the MAINLINE in the management of DUB in all age groups</b> and practically replaced isolated use of estrogens and androgens.',BD), sp(0.05), ] story.append(tbl(['Drug / Class','Dose / Regimen','Blood Loss ↓','Key Points / Mechanism'], [['Mefenamic Acid\n(PSI — Fenamate)','150-600 mg orally in divided doses during bleeding phase','25-30%','2nd line. Inhibits PG synthesis + blocks PGE2 receptor binding. Side effects: headache, nausea (mild).'], ['Tranexamic Acid\n(Antifibrinolytic)','Standard doses during bleeding phase','50%','2nd line. Counteracts endometrial fibrinolytic system. Useful in IUCD-induced menorrhagia. GI side effects. CONTRAINDICATED in history of thromboembolism.'], ['Progestins — MAINLINE\n(Norethisterone / MPA)', 'Stop bleeding: Norethisterone 5 mg TDS till stops (3-7 days), then COC.\n5th-25th day course: MPA 10 mg/day × 3 cycles (ovulatory or anovulatory).\n15th-25th day: Dydrogesterone 10 mg OD/BD × 3 cycles (if pregnancy desired; does NOT suppress ovulation).\nContinuous: MPA 10 mg TDS × ≥90 days.', '50% (5th-25th course)', 'MPA preferred (does NOT alter serum lipids). Mechanism — antiestrogenic: (i) 17β-HSD → estradiol to estrone (less potent); (ii) Inhibits ER induction; (iii) Antimitotic effect on endometrium.'], ['LNG-IUS\n★ FIRST LINE','Levonorgestrel IUS; effective for 5 years','97% ★', 'FIRST LINE for HMB without structural or histological abnormality (FIGO endorsed). Glandular atrophy, stromal decidualisation, endometrial cell inactivation. = Medical hysterectomy. Also contraceptive.'], ['COC Pills','5th-25th day × 3 cycles','50%', 'Causes endometrial atrophy; suppresses H-P-O-E axis; reduces blood loss 50%; also contraceptive. Best for ovulatory bleeding.'], ['Conjugated Estrogen IV\n(Acute severe bleeding)','25 mg IV every 4 hours till controlled, then oral progestin (MPA 10 mg) + COC','Acute haemostasis', 'Rapid endometrial growth of denuded endometrium; promotes platelet adhesiveness; ↑fibrinogen, factors V + X, platelet aggregation. Repeat every 4h. If bleeding continues → D&C.'], ['Danazol\n(17α-ethynyl testosterone)','200-400 mg/day in 4 divided doses × 6 months','60%', 'Recurrent symptoms / awaiting hysterectomy. Larger dose → amenorrhoea. Side effects: androgenic.'], ['GnRH Agonists','Subtherapeutic → reduces blood loss; Therapeutic → amenorrhoea','Variable', 'Short-term severe DUB, especially if infertile and wants pregnancy. Improves anaemia. Before endometrial ablation. Hypoestrogenic features may appear.'], ['Mifepristone (RU 486)\nAntiprogesterone (19-nor steroid)','Varying doses','—', 'Inhibits ovulation; induces amenorrhoea; reduces myoma size. For recurrent symptoms or awaiting hysterectomy.'], ['Ormeloxifene / Centchroman\n(SERM)','60 mg twice weekly × 3 months','Significant', 'Selective estrogen receptor modulator; also used as oral contraceptive.'], ['Desmopressin\n(Synthetic vasopressin analogue)','0.3 μg/kg IV or intranasally','—', 'ONLY for von Willebrand\'s disease and Factor VIII deficiency.']], [PW*0.16,PW*0.24,PW*0.09,PW*0.51],hbg=BLUE)) story+=[sp(0.06), abox('LNG-IUS = FIRST LINE for HMB without structural/histological abnormality. Blood loss ↓ = 97%. Effective 5 years. = Medical hysterectomy (FIGO endorsed).'), sp(0.08),PageBreak(), ] # ════════════════════════════════════════════════════════════════════════ # PAGE 3 — Surgical + PALM-COEIN + Numbers + Exam Q&A # ════════════════════════════════════════════════════════════════════════ story.append(sec('9. SURGICAL MANAGEMENT OF DUB',bg=BROWN)) story.append(sp(0.06)) SurgL=[ Paragraph('<b>A. Uterine Curettage</b>',H2), Paragraph('Predominantly a diagnostic tool for elderly women; has haemostatic/therapeutic effect. Done after ultrasonography for endometrial pathology. <b>Presently NOT recommended as diagnostic tool or therapy (replaced by H&B).</b>',BD), sp(0.04), tbl(['Type of Bleeding','Curettage Timing'], [['Cyclic — Menorrhagia','5-6 days PRIOR to period'], ['Cyclic — Irregular Shedding','5-6 days AFTER period starts'], ['Cyclic — Irregular Ripening','Soon AFTER period starts'], ['Acyclic','Soon AFTER period starts'], ['Continuous','ANY time']], [LW*0.52,LW*0.48],hbg=BROWN), sp(0.08), Paragraph('<b>C. Hysterectomy</b>',H2), Paragraph('<b>NOT first line for HMB/DUB.</b> Justified when: (i) Conservative treatment fails or contraindicated; (ii) Blood loss impairs health and QoL; (iii) Endometrial hyperplasia + atypia on histology. Route: vaginal, abdominal, or laparoscopic assisted vaginal. Decision can be made as patient approaches 40. <b>Especially recommended in those under 45 years.</b>',BD), sp(0.08), sec('10. AUB — PALM-COEIN (FIGO/ACOG 2011)',bg=MAROON,w=LW), sp(0.05), Paragraph('Traditional terms (menorrhagia, metrorrhagia, polymenorrhoea, oligomenorrhoea) replaced by PALM-COEIN for universal acceptance.',BD), sp(0.04), tbl(['PALM (Structural)','COEIN (Non-structural)'], [['P — Polyp','C — Coagulopathy'], ['A — Adenomyosis','O — Ovulatory dysfunction'], ['L — Leiomyoma','E — Endometrial'], ['M — Malignancy + Hyperplasia','I — Iatrogenic'], ['','N — Not yet classified']], [LW*0.50,LW*0.50],hbg=MAROON), sp(0.08), sec('11. HIGH-YIELD NUMBERS',bg=STEEL,w=LW), sp(0.05), tbl(['Fact','Value'], [['Incidence of DUB','~10% (outpatients)'], ['Ovular : Anovular ratio','20% : 80%'], ['LNG-IUS blood loss ↓','97% ★'], ['LNG-IUS effective duration','5 years'], ['Danazol blood loss ↓','60%'], ['Tranexamic acid / COC','50% each'], ['NSAIDs (Mefenamic acid)','25-30%'], ['Ablation overall success','70-80%'], ['Amenorrhoea post-ablation','20-40%'], ['ET hyperplasia (TVS)','≥ 12 mm'], ['ET atrophic (TVS)','≤ 4 mm'], ['Metropathia uterus size','8-10 weeks'], ['Conjugated estrogen IV','25 mg every 4h'], ['Normal secretory pattern in DUB','60% (most common)'], ['Thermal balloon','87°C × 8-10 min'], ['Microwave ablation','75-80°C / 6 mm / 2-3 min'], ['Novasure','90 seconds'], ['Laser (Nd:YAG) depth','4-5 mm'], ['Roller ball depth','4 mm'], ['Danazol dose','200-400 mg/day × 6 months'], ['Ormeloxifene','60 mg twice weekly × 3 months'], ['Desmopressin','0.3 μg/kg IV or intranasal']], [LW*0.70,LW*0.30],hbg=STEEL), ] SurgR=[ Paragraph('<b>B. Endometrial Ablation / Resection</b>',H2), Paragraph('<b>Indications:</b> (a) Failed medical treatment (b) No wish to preserve menstrual/reproductive function (c) Uterus ≤10 weeks (d) Fibroids <3 cm (e) Women who no longer want surgery (f) Prefers to preserve uterus.',BD), sp(0.04), tbl(['Method','Temp / Energy','Depth','Duration','Key Notes'], [['Uterine Thermal\nBalloon ★ FIRST LINE','87°C; hot normal saline','—','8-10 min', 'No cervical dilatation needed. Suitable if unfit for GA or long surgery. FIRST LINE. Day care basis.'], ['Microwave\nEndometrial Ablation','75-80°C','6 mm','2-3 min (faster than TCRE)', 'Outpatient. Results similar to TCRE. Less costly than laser.'], ['Novasure','Bipolar radiofrequency; expandable base','Entire endometrium','90 sec', 'CONTRAINDICATED: cavity <4 cm, PID, cesarean delivery. Pretreat GnRH/danazol × 3 weeks.'], ['TCRE (Transcervical\nResection)','Continuous flow resectoscope','Basal layer + superficial myometrium','Longer', 'MUST remove basal layer + superficial myometrium (otherwise regeneration = failure).'], ['Laser (Nd:YAG)','Coagulation/vaporization/carbonization','4-5 mm','—', 'Therapeutic Ashermann\'s + amenorrhoea. When hysterectomy is contraindicated. Completed families only.'], ['Roller Ball','Electrical coagulation','4 mm','—', 'First generation. Used with TCRE if myomectomy planned simultaneously.']], [RW*0.19,RW*0.15,RW*0.12,RW*0.12,RW*0.42],hbg=BROWN), sp(0.05), nbox('Ablation results: Overall success 70-80%. Amenorrhoea 20-40%. Significant blood loss ↓ in another 50%. 10% need repeat/hysterectomy. Uterine Artery Embolisation for large fibroids >3 cm.',bg=LGRN,bc=GREEN,w=RW), sp(0.08), sec('12. TOP EXAM Q&A',bg=RED,w=RW), sp(0.05), tbl(['Q','Question','Model Answer'], [['1','Define DUB + origin','AUB without organic/systemic/iatrogenic cause; origin = HPO axis (endocrine); diagnosis of exclusion'], ['2','Why is Metropathia absolutely painless?','Low PGF2α, low PGF2α/PGE2, low thromboxane → no vasoconstriction → no pain'], ['3','Classify DUB','Ovular 20% (polymenorrhoea, oligomenorrhoea, irregular shedding/ripening); Anovular 80% (menorrhagia, CGH)'], ['4','Biopsy timing in irregular shedding','5th-6th day AFTER menses starts; mixture secretory + proliferative; total absence surface epithelium'], ['5','CGH microscopy findings','Swiss cheese pattern; cystic glandular hypertrophy; columnar epithelium; no secretory changes; necrosis in superficial layers'], ['6','First line Rx for HMB without structural abnormality','LNG-IUS — 97% blood loss ↓; 5 years; = medical hysterectomy (FIGO)'], ['7','When is EB mandatory?','Postmenopausal — ALWAYS mandatory to exclude endometrial malignancy'], ['8','What replaced D&C?','Hysteroscopy + directed biopsy (H&B) — OPD; detects polyps/fibroids missed by curettage'], ['9','First line ablation (day care)?','Uterine Thermal Balloon (87°C × 8-10 min); no cervical dilatation; unfit for GA'], ['10','Novasure contraindications','Cavity <4 cm, PID, previous cesarean delivery'], ['11','Drug for DUB + von Willebrand\'s','Desmopressin 0.3 μg/kg IV or intranasally'], ['12','Progestin mechanism (3 points)','(i) 17β-HSD → estradiol to estrone; (ii) Inhibits ER induction; (iii) Antimitotic on endometrium'], ['13','PALM-COEIN (FIGO 2011)','PALM = structural (Polyp, Adenomyosis, Leiomyoma, Malignancy); COEIN = non-structural (Coagulopathy, Ovulatory, Endometrial, Iatrogenic, Not classified)'], ['14','Hysterectomy justified when?','Failed conservative Rx; blood loss impairs QoL; hyperplasia + atypia; patient approaching 40'], ['15','Preferred progestin and reason','MPA — does NOT alter serum lipids (unlike norethisterone)']], [RW*0.04,RW*0.35,RW*0.61],hbg=RED), ] story.append(c2(SurgL,SurgR)) story+=[sp(0.06)] foot=Table([[Paragraph('Source: DC Dutta\'s Textbook of Gynecology, Chapter 15 — Abnormal Uterine Bleeding (AUB) | Exam-Oriented Notes | All rights to original authors',FT)]],colWidths=[PW]) foot.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),NAVY), ('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3), ('LEFTPADDING',(0,0),(-1,-1),7)])) story.append(foot) doc.build(story) from pypdf import PdfReader; import os r=PdfReader(OUTPUT) print(f'Pages: {len(r.pages)} | Size: {os.path.getsize(OUTPUT)/1024:.1f} KB') print(f'PDF: {OUTPUT}') PYEOF
DUB Exam 3pg
PDF Document · PDF
| Page | Sections |
|---|---|
| Page 1 | Definition & Incidence · Pathophysiology (mediator table) · Classification · All 4 Ovular Types with biopsy timing & histology · All 3 Anovular types (Menorrhagia, CGH/Metropathia, Atrophy) · Endometrial Pattern in DUB |
| Page 2 | Investigations (all 7 modalities with key facts) · EB indications by age group · Full Medical Management — all 11 drugs with doses, % blood loss reduction, and key points |
| Page 3 | Uterine Curettage (timing table) · All 6 Ablation Methods (temp/depth/duration) · Hysterectomy · PALM-COEIN · 22 High-yield numbers · 15 Top Exam Q&A |