Make a notes of 1.Endocrine in puberty 2. Puberty 3.Precocious puberty 4.Delayed puberty ..make a notes of atleast 1.5 pgs from the given source
mkdir -p /home/daytona/workspace/puberty-notes && ls /home/daytona/workspace/puberty-notes/
~/puberty-notes/create_notes.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageBreak, UnderlineType
} = require('docx');
const fs = require('fs');
// Color palette
const BLUE_DARK = "1F3864";
const BLUE_MID = "2E75B6";
const BLUE_LIGHT= "D6E4F0";
const RED = "C00000";
const GREEN = "375623";
const ORANGE = "C55A11";
const YELLOW_BG = "FFF2CC";
const WHITE = "FFFFFF";
const BLACK = "000000";
function heading1(text) {
return new Paragraph({
children: [
new TextRun({
text,
bold: true,
color: WHITE,
size: 28,
font: "Calibri",
})
],
shading: { type: ShadingType.SOLID, color: BLUE_DARK },
spacing: { before: 200, after: 120 },
indent: { left: 100, right: 100 },
});
}
function heading2(text) {
return new Paragraph({
children: [
new TextRun({
text: "■ " + text,
bold: true,
color: WHITE,
size: 24,
font: "Calibri",
})
],
shading: { type: ShadingType.SOLID, color: BLUE_MID },
spacing: { before: 160, after: 80 },
indent: { left: 80 },
});
}
function heading3(text) {
return new Paragraph({
children: [
new TextRun({
text,
bold: true,
color: BLUE_DARK,
size: 22,
underline: { type: UnderlineType.SINGLE },
font: "Calibri",
})
],
spacing: { before: 140, after: 60 },
});
}
function heading4(text) {
return new Paragraph({
children: [
new TextRun({
text,
bold: true,
color: ORANGE,
size: 20,
font: "Calibri",
})
],
spacing: { before: 100, after: 40 },
});
}
function body(text, options = {}) {
return new Paragraph({
children: [
new TextRun({
text,
size: 20,
font: "Calibri",
color: BLACK,
bold: options.bold || false,
italics: options.italic || false,
})
],
spacing: { before: 40, after: 40 },
indent: options.indent ? { left: 360 } : {},
});
}
function bullet(text, bold_part = null, rest = null) {
const children = [];
if (bold_part) {
children.push(new TextRun({ text: bold_part, bold: true, size: 20, font: "Calibri", color: BLACK }));
if (rest) children.push(new TextRun({ text: rest, size: 20, font: "Calibri", color: BLACK }));
} else {
children.push(new TextRun({ text, size: 20, font: "Calibri", color: BLACK }));
}
return new Paragraph({
children,
bullet: { level: 0 },
spacing: { before: 30, after: 30 },
indent: { left: 360, hanging: 260 },
});
}
function subbullet(text, bold_part = null, rest = null) {
const children = [];
if (bold_part) {
children.push(new TextRun({ text: bold_part, bold: true, size: 19, font: "Calibri", color: BLACK }));
if (rest) children.push(new TextRun({ text: rest, size: 19, font: "Calibri", color: BLACK }));
} else {
children.push(new TextRun({ text, size: 19, font: "Calibri", color: BLACK }));
}
return new Paragraph({
children,
bullet: { level: 1 },
spacing: { before: 20, after: 20 },
indent: { left: 720, hanging: 260 },
});
}
function keybox(label, text) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
margins: { top: 60, bottom: 60, left: 120, right: 120 },
rows: [
new TableRow({
children: [
new TableCell({
children: [
new Paragraph({
children: [
new TextRun({ text: label + " ", bold: true, color: RED, size: 20, font: "Calibri" }),
new TextRun({ text, size: 20, font: "Calibri", color: BLACK }),
],
spacing: { before: 40, after: 40 },
})
],
shading: { type: ShadingType.SOLID, color: YELLOW_BG },
borders: {
top: { style: BorderStyle.SINGLE, size: 4, color: ORANGE },
bottom: { style: BorderStyle.SINGLE, size: 4, color: ORANGE },
left: { style: BorderStyle.SINGLE, size: 8, color: RED },
right: { style: BorderStyle.SINGLE, size: 4, color: ORANGE },
},
})
]
})
]
});
}
function spacer() {
return new Paragraph({ children: [new TextRun({ text: "" })], spacing: { before: 60, after: 60 } });
}
function makeTableRow(cells, isHeader = false) {
return new TableRow({
children: cells.map((c, i) => new TableCell({
children: [new Paragraph({
children: [new TextRun({ text: c, bold: isHeader, size: 18, font: "Calibri", color: isHeader ? WHITE : BLACK })],
alignment: AlignmentType.LEFT,
})],
shading: isHeader ? { type: ShadingType.SOLID, color: BLUE_MID } : (i % 2 === 0 ? {} : { type: ShadingType.SOLID, color: "EBF3FB" }),
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 100, right: 100 },
}))
});
}
function tannerTable() {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
makeTableRow(["Stage", "Breast", "Pubic Hair"], true),
makeTableRow(["Stage I", "Prepubertal, elevation of papilla only", "No pubic hair present"]),
makeTableRow(["Stage II", "Breast buds; areola begins to enlarge (Median age: 9.8 yrs)", "Sparse, long hair on either majora"]),
makeTableRow(["Stage III", "Further enlargement of entire breast tissue (Median age: 11.2 yrs)", "Darker, coarser, curly hair over mons pubis"]),
makeTableRow(["Stage IV", "Secondary mound of areola projecting above breast (Median age: 12.1 yrs)", "Adult type hair covering mons only (Median age: 12 yrs)"]),
makeTableRow(["Stage V", "Areola recessed to general contour (Median age: 14.6 yrs)", "Adult hair with inverse triangle (Median age: 13.7 yrs)"]),
]
});
}
function causesPrecocious() {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
makeTableRow(["Category", "Specific Causes"], true),
makeTableRow(["GnRH Dependent (80%)", "Constitutional (most common), Juvenile primary hypothyroidism, CNS lesions (tumour, trauma, infection/TB, encephalitis)"]),
makeTableRow(["Incomplete forms", "Premature thelarche, Premature pubarche, Premature menarche"]),
makeTableRow(["GnRH Independent (Ovary)", "Granulosa cell tumour, Theca cell tumour, Leydig cell tumour, Chorionic epithelioma, Androblastoma, McCune-Albright syndrome"]),
makeTableRow(["GnRH Independent (Adrenal)", "Hyperplasia, Tumour"]),
makeTableRow(["GnRH Independent (Liver/Iatrogenic)", "Hepatoblastoma; Oestrogen or androgen intake"]),
]
});
}
function causesDelayed() {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
makeTableRow(["Category", "Specific Causes"], true),
makeTableRow(["Hypergonadotropic Hypogonadism", "Gonadal dysgenesis 45 XO; Pure gonadal dysgenesis 46 XX / 46 XY; Ovarian failure 46 XX"]),
makeTableRow(["Hypogonadotropic Hypogonadism", "Constitutional delay; Chronic illness/malnutrition; Isolated GnRH deficiency (Kallmann's syndrome); Intracranial lesions-tumours (craniopharyngioma, pituitary adenoma)"]),
makeTableRow(["Eugonadism", "Anatomical: Mullerian agenesis, Imperforate hymen, Transverse vaginal septum; Androgen insensitivity syndrome"]),
]
});
}
const doc = new Document({
numbering: {
config: [
{
reference: "bullet-list",
levels: [
{ level: 0, format: "bullet", text: "\u2022", alignment: AlignmentType.LEFT,
style: { paragraph: { indent: { left: 360, hanging: 260 } } } },
{ level: 1, format: "bullet", text: "\u25E6", alignment: AlignmentType.LEFT,
style: { paragraph: { indent: { left: 720, hanging: 260 } } } },
]
}
]
},
sections: [{
properties: {
page: {
margin: { top: 720, bottom: 720, left: 900, right: 900 }
}
},
children: [
// ============================================================
// TITLE
// ============================================================
new Paragraph({
children: [new TextRun({ text: "PUBERTY — COMPREHENSIVE NOTES", bold: true, size: 36, color: WHITE, font: "Calibri" })],
shading: { type: ShadingType.SOLID, color: BLUE_DARK },
alignment: AlignmentType.CENTER,
spacing: { before: 100, after: 100 },
indent: { left: 100, right: 100 },
}),
new Paragraph({
children: [new TextRun({ text: "Source: DC Dutta's Textbook of Gynecology", italics: true, size: 18, color: BLUE_MID, font: "Calibri" })],
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 200 },
}),
// ============================================================
// SECTION 1: PUBERTY
// ============================================================
heading1("1. PUBERTY"),
heading2("Definition"),
body("Puberty in girls is the period which links childhood to adulthood. It is the period of gradual development of secondary sexual characters, involving profound biological, morphological, and psychological changes leading to full sexual maturity and eventual fertility."),
heading2("Morphological Changes (Tanner & Marshall — 5 Changes)"),
bullet("Breast development (thelarche)"),
bullet("Pubic hair growth (pubarche)"),
bullet("Axillary hair growth"),
bullet("Growth in height (growth spurt)"),
bullet("Menstruation (menarche)"),
spacer(),
body("Sequence: Growth spurt → Breast budding (thelarche) → Pubic & axillary hair growth (adrenarche) → Peak growth in height → Menstruation (menarche)", { bold: true }),
body("Age range: 10–16 years. Important controlling factors: genetic, nutritional, body weight, psychologic state, social/cultural background, and light exposure."),
heading2("Tanner Staging of Pubertal Development in Girls"),
tannerTable(),
spacer(),
heading2("Menarche"),
bullet("First menstrual period in life"),
bullet("Occurs between age 10–16 years; peak time: 13 years"),
bullet("There is endometrial proliferation due to ovarian oestrogen"),
bullet("Denotes: intact HPO axis, functioning ovaries, responsive endometrium, patent uterovaginal canal"),
bullet("First period is usually anovular"),
bullet("May take ~2 years for regular ovulation to establish"),
bullet("Menses may be irregular initially"),
heading2("Growth"),
bullet("Growth of height in adolescence mainly due to hormones"),
bullet("Key hormones: Growth hormone, Oestrogen, IGF-1 (Insulin-like growth factor-1)"),
bullet("Bone/skeletal age determined by X-ray of hand or knee"),
heading2("Changes in Genital Organs"),
bullet("Ovaries: become bulky and oval; enlargement at various stages of development and proliferation of stromal cells"),
bullet("Uterus: cervix-to-body ratio at birth = 1:2; becomes 1:1 at menarche; rapidly becomes 2:1"),
bullet("Vagina: epithelium becomes stratified with many layers; cells rich in glycogen; Doderlein's bacilli convert glycogen to lactic acid; pH becomes acidic (4–5)"),
bullet("Vulva: responds to steroids; mons pubis and labia minora increase in size"),
bullet("Breasts: marked proliferation of duct systems, fat deposition; becomes prominent and round; progesterone increases acini development"),
spacer(),
// ============================================================
// SECTION 2: ENDOCRINOLOGY IN PUBERTY
// ============================================================
heading1("2. ENDOCRINOLOGY IN PUBERTY"),
heading2("Baseline Hormonal Status"),
body("Levels of gonadal steroids and gonadotropins are low until age 6–8 years due to negative feedback of oestrogen on the hypothalamic-pituitary system (Gonadostat). The Gonadostat remains very sensitive (6–15x) to negative feedback even when oestradiol is very low (10 pg/mL). As puberty approaches, this negative feedback of oestrogen is gradually lost."),
heading2("Hypothalamopituitary Gonadal Axis"),
bullet("GnRH pulses from hypothalamus result in pulsatile gonadotropin secretion (first at night, then by day)"),
bullet("GnRH → FSH, LH → Oestradiol"),
bullet("Secretion pattern changes from tonic/episodic in prepubertal period to cyclic release in postpubertal period"),
heading2("Role of Specific Glands & Hormones"),
heading4("Thyroid Gland"),
bullet("Plays an active role in the hypothalamopituitary gonadal axis"),
heading4("Adrenal Glands (Adrenarche)"),
bullet("Increase activity of sex steroid synthesis (androstenedione, DHEA, DHAS) from ~7 years of age"),
bullet("Increased sebum formation, pubic and axillary hair, voice change - primarily due to adrenal androgen production"),
heading4("Gonadarche"),
bullet("Increased amplitude and frequency of GnRH → ↑ secretion of FSH and LH"),
bullet("FSH/LH → ovarian follicular development → ↑ oestrogen"),
bullet("Gonadal oestrogen responsible for development of uterus, vagina, vulva, and breasts"),
heading4("Leptin"),
bullet("A peptide secreted in adipose tissue"),
bullet("Involved in pubertal changes and menarche"),
bullet("This explains why adequate body weight is needed for puberty initiation"),
spacer(),
keybox("KEY:", "Important hormone cascade: GnRH (hypothalamus) → FSH + LH (pituitary) → Oestradiol (ovary) → Secondary sexual characteristics"),
spacer(),
// ============================================================
// SECTION 3: PRECOCIOUS PUBERTY
// ============================================================
heading1("3. PRECOCIOUS PUBERTY"),
heading2("Definition"),
body("Precocious puberty is reserved for girls who exhibit any secondary sex characteristics before the age of 8 (before age 7 in white girls) OR who menstruate before age 10."),
body("20x more common in girls than boys."),
heading2("Types"),
bullet("Isosexual (most common): features due to excess oestrogen production"),
bullet("Heterosexual: features due to excess androgen production (ovarian or adrenal neoplasm)"),
heading2("Causes (Table 5.2)"),
causesPrecocious(),
spacer(),
heading2("Etiopathology — Constitutional (GnRH Dependent)"),
body("Due to premature activation of hypothalamopituitary-ovarian axis. Secretion of gonadotropins and gonadal steroids due to premature release of GnRH. Bone maturation is accelerated → premature closure of epiphysis and curtailed stature. Changes in puberty may progress in normal sequence. If menstruation occurs, cycles may be ovulatory."),
heading2("Intracranial Lesions"),
bullet("Meningitis, encephalitis, craniopharyngioma, neurofibroma, or any tumour (hypothalamic or pineal gland)"),
bullet("McCune-Albright Syndrome: sexual precocity + multiple cystic bone lesions (polyostotic fibrous dysplasia) + endocrinopathies + café-au-lait spots. Sexual precocity due to early and excessive oestrogen production. FSH and LH levels are low. Treated with aromatase inhibitors"),
heading2("Incomplete Precocious Puberty"),
heading4("Premature Thelarche"),
bullet("Isolated development of breast tissue before age 8 (commonly 2–4 years)"),
bullet("Either or both breasts may be enlarged"),
bullet("No other features of precocious puberty"),
bullet("Life-threatening neoplasms of ovary, adrenal, or CNS excluded on priority"),
bullet("Examination: breast buds enlarge to 2–4 cm; somatic growth not accelerated; bone age not advanced; nipple development absent; vaginal smear shows negative oestrogen effect"),
bullet("Breast buds enlargement may be isolated event or continuum of GnRH dependent precocious puberty with follicular activity — periodic follow-up needed"),
heading4("Premature Pubarche"),
bullet("Isolated development of axillary and/or pubic hair before age 8 WITHOUT other signs of precocious puberty"),
bullet("May be due to unusual sensitivity of end organs to low-level hormones in blood during childhood"),
bullet("Rarely, may be signs of excess androgen production (Leydig cell tumour, androblastoma, etc.)"),
bullet("Investigations: USG/CT/MRI scan required to detect ovarian or adrenal tumour; serum 17-a-hydroxyprogesterone, DHEA-S, testosterone to be done if adrenal pathology suspected"),
heading4("Premature Menarche"),
bullet("Isolated event of cyclic vaginal bleeding without any other signs of secondary sexual development"),
bullet("Cause remains unclear but may be related to unusual endocrine sensitivity of endometrium to low levels of oestrogen"),
bullet("Other causes of vaginal bleeding: foreign body or injury — must be excluded"),
bullet("If bleeding is cyclic, diagnosis is confirmed"),
heading2("Diagnosis of Precocious Puberty"),
heading4("History & Examination"),
bullet("Meticulous history taking and physical examination are essential"),
bullet("Constitutional type is most common — keep in mind"),
bullet("History of early menarche of mother and sisters"),
bullet("Pubertal changes occur in orderly sequence"),
bullet("Tanner stages"),
bullet("No cause found in majority (90%)"),
heading4("Basic Investigations"),
bullet("Serum hCG, FSH, LH, and prolactin"),
bullet("Serum oestradiol, testosterone, 17-OH progesterone, DHEA"),
bullet("Thyroid profile (TSH, T3, T4)"),
bullet("USG, CT or MRI of abdomen and pelvis to rule out pathology of ovaries, adrenals, or uterus"),
bullet("Skull X-ray, CT scan, or MRI brain — to exclude intracranial lesion (hypothalamic hamartoma)"),
bullet("Electroencephalogram"),
bullet("X-ray hand and wrist (non-dominant) for bone age — acceleration of growth is one of earliest clinical features of skeletal maturation"),
bullet("GnRH Stimulation Test: 100 µg of GnRH SC administered; serum LH >15 mIU/mL suggests gonadotropin dependent precocious puberty"),
heading2("Treatment"),
heading4("Constitutional/Idiopathic Type — Goals"),
bullet("To reduce gonadotropin secretions"),
bullet("To suppress gonadal steroidogenesis or counteract peripheral action of sex steroids"),
bullet("To decrease growth rate to normal and slow skeletal maturation"),
bullet("To protect the girl from sex abuse"),
heading4("Drug of Choice: GnRH Agonist Therapy"),
body("GnRH agonist therapy arrests pubertal precocity and growth velocity significantly. Acts via down-regulation → diminished oestrogen secretion.", { bold: false }),
bullet("GnRH agonist is the drug of choice in GnRH dependent precocious puberty"),
bullet("Suppresses FSH, LH secretion; reverses ovarian cycle; establishes amenorrhoea; causes regression of breast, pubic hair changes, and other secondary sexual characteristics"),
bullet("Safe and effective; should be continued till median age of puberty (see p. 39)"),
bullet("Dose: Depot forms (goserelin or leuprolide) once a month; dose adjusted to maintain serum oestradiol below 10 pg/mL"),
bullet("Duration: Drugs used up to age of 11 years; individualization to be done"),
heading4("Other Drugs"),
bullet("Medroxyprogesterone acetate: 30 mg daily oral or 100–200 mg IM weekly to suppress gonadal steroids; can suppress menstruation and breast development but cannot change skeletal growth rate"),
bullet("Danazol: Produces amenorrhoea and arrests breast development; no effect on growth rate or skeletal maturation"),
heading2("Prognosis"),
bullet("Varies with etiology"),
bullet("Good prognosis with primary hypothyroidism, improvement of general health, and treatment of any illness"),
bullet("CNS group: depends on neurological involvement and treatment outcome"),
bullet("Idiopathic group: normal future fertility rate expected"),
bullet("Short stature due to accelerated bone maturation is the main concern"),
spacer(),
// ============================================================
// SECTION 4: DELAYED PUBERTY
// ============================================================
heading1("4. DELAYED PUBERTY"),
heading2("Definition"),
keybox("DEFINITION:", "Puberty is said to be delayed when breast tissue and/or pubic hair have not appeared by 13–14 years OR menarche appears as late as 16 years. Normal upper age limit of menarche is 15 years. More common in boys than girls."),
spacer(),
heading2("Causes (Table 5.3)"),
causesDelayed(),
spacer(),
heading2("Diagnosis"),
body("Detailed history taking and physical examination."),
heading4("Examination of Secondary Sexual Characters"),
bullet("Mature: to evaluate for Müllerian agenesis/dysgenesis"),
bullet("Asynchronous: pubic hair → Androgen insensitivity syndrome"),
bullet("Immature: Serum FSH, PRL, TSH, T4"),
subbullet("↑ FSH: Karyotype for gonadal dysgenesis / premature gonadal failure"),
subbullet("Low/Normal FSH → sellar CT/MRI → normal → constitutional/chronic illness/malnutrition"),
subbullet("Abnormal sellar CT/MRI → Hypopituitarism/CNS tumour"),
subbullet("↑ TSH → Hypothyroidism"),
heading2("Treatment"),
body("Directed according to etiology."),
bullet("Assurance, improvement of general health, treatment of any illness for non-endocrine causes"),
bullet("Hypogonadism: treat with cyclic oestrogen; Unopposed oestrogen 0.3 mg (conjugated oestrogen) daily given for first 6 months; then combined oestrogen and progestin sequential regimen started"),
bullet("Hypergonadotropic hypogonadism: chromosomal study to exclude intersexuality"),
spacer(),
// ============================================================
// SECTION 5: PUBERTY MENORRHAGIA (Bonus)
// ============================================================
heading1("5. PUBERTY MENORRHAGIA (Bonus)"),
heading2("Definition & Background"),
body("Menstrual abnormality in adolescents is common. Periods may be heavy, irregular, or scanty initially. Eventually the majority of teenaged girls establish a normal cycle and are fertile."),
heading2("Important Causes of Menorrhagia in Puberty"),
bullet("Dysfunctional uterine bleeding (95%): Anovulatory cycles → unopposed oestrogen → endometrial hyperplasia → prolonged and heavy periods"),
bullet("Endocrine dysfunction: PCOS, Hypothyroidism/Hyperthyroidism"),
bullet("Hematological: Idiopathic thrombocytopenic purpura (ITP), Von-Willebrand's disease, Leukaemia"),
bullet("Pelvic tumours: Fibroid uterus, Sarcoma botryoides, Oestrogen producing ovarian tumour"),
bullet("Pregnancy complications (abortion)"),
heading2("Management"),
bullet("Adequate explanation, reassurance, and psychological support"),
bullet("Rest and correction of anaemia helpful in majority"),
bullet("Therapy with haematinics or even blood transfusion may be needed"),
bullet("Progestins in refractory cases: MPA or norethisterone 5 mg thrice daily till bleeding stops; usually controlled in 3–7 days; medication continued for 21 days"),
bullet("In emergency: conjugated equine oestrogen 20–40 mg IV every 6–8 hours; once bleeding controlled, combined oral pills started"),
bullet("GnRH analogs can be used for short term"),
bullet("Regular menstrual cycle established once hypothalamic-pituitary-ovarian axis is matured"),
spacer(),
new Paragraph({
children: [new TextRun({ text: "Source: DC Dutta's Textbook of Gynecology | Chapter 5 — Puberty", italics: true, size: 17, color: BLUE_MID, font: "Calibri" })],
alignment: AlignmentType.CENTER,
spacing: { before: 120, after: 60 },
}),
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/puberty-notes/Puberty_Notes_DC_Dutta.docx', buffer);
console.log('Document created successfully!');
}).catch(err => {
console.error('Error:', err);
process.exit(1);
});
cd /home/daytona/workspace/puberty-notes && node create_notes.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/puberty-notes/Puberty_Notes_DC_Dutta.docx 2>&1
ls -lh /home/daytona/workspace/puberty-notes/Puberty_Notes_DC_Dutta.docx && python3 -c "import zipfile; z=zipfile.ZipFile('/home/daytona/workspace/puberty-notes/Puberty_Notes_DC_Dutta.docx'); print('Valid ZIP/DOCX. Files:', z.namelist()[:6])"
Puberty Notes DC Dutta
Word Document · DOCX
| Stage | Breast | Pubic Hair |
|---|---|---|
| I | Prepubertal, papilla only | None |
| II | Breast buds (9.8 yrs) | Sparse hair, majora |
| III | Entire breast enlarges (11.2 yrs) | Darker, coarser, curly over mons |
| IV | Areola secondary mound (12.1 yrs) | Adult type, mons only |
| V | Areola recessed (14.6 yrs) | Adult, inverse triangle (13.7 yrs) |
Make an exam oriented of the following things given in the source in detail version of atleast 1.5 pgs of each topic
~/puberty-notes/create_exam_notes.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageBreak, UnderlineType, convertInchesToTwip
} = require('docx');
const fs = require('fs');
// Color palette
const DARK_NAVY = "1F3864";
const BLUE_MID = "2E75B6";
const BLUE_LIGHT = "BDD7EE";
const RED = "C00000";
const DARK_RED = "7B0000";
const GREEN_DARK = "375623";
const GREEN_LIGHT = "E2EFDA";
const ORANGE = "C55A11";
const ORANGE_LIGHT= "FCE4D6";
const PURPLE = "7030A0";
const YELLOW_BG = "FFF2CC";
const TEAL = "006064";
const TEAL_LIGHT = "E0F2F1";
const WHITE = "FFFFFF";
const BLACK = "1A1A1A";
const GRAY_BG = "F2F2F2";
// ── helpers ──────────────────────────────────────────────────────────────────
function title(text) {
return new Paragraph({
children: [new TextRun({ text, bold: true, size: 38, color: WHITE, font: "Calibri" })],
shading: { type: ShadingType.SOLID, color: DARK_NAVY },
alignment: AlignmentType.CENTER,
spacing: { before: 80, after: 80 },
indent: { left: 120, right: 120 },
});
}
function sourceTag(text) {
return new Paragraph({
children: [new TextRun({ text, italics: true, size: 18, color: BLUE_MID, font: "Calibri" })],
alignment: AlignmentType.CENTER,
spacing: { before: 40, after: 200 },
});
}
function h1(text) {
return new Paragraph({
children: [new TextRun({ text: " " + text + " ", bold: true, size: 30, color: WHITE, font: "Calibri" })],
shading: { type: ShadingType.SOLID, color: DARK_NAVY },
spacing: { before: 280, after: 120 },
});
}
function h2(text) {
return new Paragraph({
children: [new TextRun({ text: "■ " + text, bold: true, size: 24, color: WHITE, font: "Calibri" })],
shading: { type: ShadingType.SOLID, color: BLUE_MID },
spacing: { before: 200, after: 80 },
indent: { left: 60 },
});
}
function h3(text, color = DARK_NAVY) {
return new Paragraph({
children: [new TextRun({ text, bold: true, size: 22, color, underline: { type: UnderlineType.SINGLE }, font: "Calibri" })],
spacing: { before: 160, after: 60 },
});
}
function h4(text, color = ORANGE) {
return new Paragraph({
children: [new TextRun({ text: "▸ " + text, bold: true, size: 21, color, font: "Calibri" })],
spacing: { before: 120, after: 40 },
});
}
function body(text, opts = {}) {
return new Paragraph({
children: [new TextRun({ text, size: 20, font: "Calibri", color: BLACK, bold: opts.bold || false, italics: opts.italic || false })],
spacing: { before: 40, after: 40 },
indent: opts.indent ? { left: 300 } : {},
});
}
function mixed(runs) {
return new Paragraph({
children: runs.map(r => new TextRun({ text: r.text, bold: r.bold || false, italics: r.italic || false, size: 20, font: "Calibri", color: r.color || BLACK, underline: r.underline ? { type: UnderlineType.SINGLE } : undefined })),
spacing: { before: 40, after: 40 },
});
}
function bullet(text, opts = {}) {
const children = [];
if (opts.bold_start) {
children.push(new TextRun({ text: opts.bold_start, bold: true, size: 20, font: "Calibri", color: opts.color || BLACK }));
children.push(new TextRun({ text: opts.rest || "", size: 20, font: "Calibri", color: BLACK }));
} else {
children.push(new TextRun({ text, size: 20, font: "Calibri", color: opts.color || BLACK, bold: opts.bold || false }));
}
return new Paragraph({ children, bullet: { level: 0 }, spacing: { before: 28, after: 28 }, indent: { left: 400, hanging: 300 } });
}
function subbullet(text, opts = {}) {
const children = [];
if (opts.bold_start) {
children.push(new TextRun({ text: opts.bold_start, bold: true, size: 19, font: "Calibri", color: opts.color || BLACK }));
children.push(new TextRun({ text: opts.rest || "", size: 19, font: "Calibri", color: BLACK }));
} else {
children.push(new TextRun({ text, size: 19, font: "Calibri", color: opts.color || BLACK, bold: opts.bold || false }));
}
return new Paragraph({ children, bullet: { level: 1 }, spacing: { before: 18, after: 18 }, indent: { left: 720, hanging: 300 } });
}
function spacer(n = 1) {
return new Paragraph({ children: [new TextRun({ text: "" })], spacing: { before: 30 * n, after: 30 * n } });
}
function pageBreak() {
return new Paragraph({ children: [new PageBreak()] });
}
// Highlighted important box
function examBox(label, content) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({
children: [
new TableCell({
children: [
new Paragraph({
children: [
new TextRun({ text: "★ " + label + " ", bold: true, color: DARK_RED, size: 21, font: "Calibri" }),
new TextRun({ text: content, size: 20, font: "Calibri", color: BLACK }),
],
spacing: { before: 60, after: 60 },
})
],
shading: { type: ShadingType.SOLID, color: YELLOW_BG },
borders: {
top: { style: BorderStyle.THICK, size: 6, color: ORANGE },
bottom: { style: BorderStyle.THICK, size: 6, color: ORANGE },
left: { style: BorderStyle.THICK, size: 12, color: RED },
right: { style: BorderStyle.THICK, size: 6, color: ORANGE },
},
margins: { top: 80, bottom: 80, left: 160, right: 160 },
})
]
})
]
});
}
function infoBox(label, content, bgColor = TEAL_LIGHT, borderColor = TEAL) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({
children: [
new TableCell({
children: [
new Paragraph({
children: [
new TextRun({ text: label + " ", bold: true, color: borderColor, size: 21, font: "Calibri" }),
new TextRun({ text: content, size: 20, font: "Calibri", color: BLACK }),
],
spacing: { before: 60, after: 60 },
})
],
shading: { type: ShadingType.SOLID, color: bgColor },
borders: {
top: { style: BorderStyle.SINGLE, size: 4, color: borderColor },
bottom: { style: BorderStyle.SINGLE, size: 4, color: borderColor },
left: { style: BorderStyle.THICK, size: 12, color: borderColor },
right: { style: BorderStyle.SINGLE, size: 4, color: borderColor },
},
margins: { top: 60, bottom: 60, left: 140, right: 140 },
})
]
})
]
});
}
function makeHRow(cells) {
return new TableRow({
children: cells.map(c => new TableCell({
children: [new Paragraph({ children: [new TextRun({ text: c, bold: true, size: 19, font: "Calibri", color: WHITE })], alignment: AlignmentType.CENTER })],
shading: { type: ShadingType.SOLID, color: DARK_NAVY },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 100, right: 100 },
}))
});
}
function makeRow(cells, shade = false) {
return new TableRow({
children: cells.map((c, i) => new TableCell({
children: [new Paragraph({ children: [new TextRun({ text: c, size: 19, font: "Calibri", color: BLACK })], alignment: AlignmentType.LEFT })],
shading: shade ? { type: ShadingType.SOLID, color: BLUE_LIGHT } : (i === 0 ? { type: ShadingType.SOLID, color: GRAY_BG } : {}),
margins: { top: 50, bottom: 50, left: 100, right: 100 },
}))
});
}
// ── TABLE: Differentiating Primary vs Secondary Dysmenorrhea ────────────────
function diffTable() {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
makeHRow(["Feature", "Primary Dysmenorrhea", "Secondary Dysmenorrhea"]),
makeRow(["Pelvic pathology", "No identifiable pelvic pathology", "Secondary to pelvic pathology"], false),
makeRow(["Age group", "Mostly in adolescents", "Elderly/parous women"], true),
makeRow(["Cycle type", "Confined to ovulatory cycle", "Starts 3–5 days before menstruation"], false),
makeRow(["Onset of pain", "Starts with onset or just before menses", "No systemic discomfort between periods"], true),
makeRow(["Freedom from pain", "Pain-free between periods", "May have discomfort between periods"], false),
makeRow(["Systemic symptoms", "Nausea, vomiting, diarrhea, headache", "Usually absent"], true),
makeRow(["Examination", "Normal", "Abdominal/vaginal exam reveals pathology"], false),
makeRow(["Response to PSI/OCP", "Good", "Variable — depends on cause"], true),
]
});
}
// ── TABLE: Causes of Secondary Dysmenorrhea ─────────────────────────────────
function secDysTable() {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
makeHRow(["Category", "Causes"]),
makeRow(["Uterine", "Endometriosis, Adenomyosis, Fibroid uterus, IUCD in utero, Obstruction due to Müllerian anomalies, Cervical stenosis"], false),
makeRow(["Adnexal/Peritoneal", "Pelvic adhesions, Pelvic congestion, Ovarian cysts"], true),
makeRow(["Unilateral causes", "Ovarian dysmenorrhea, Bicornuate uterus, Unilateral pelvic endometriosis, Small fibroid near one cornu, Right ovarian vein syndrome, Colonic or cecal spasm"], false),
]
});
}
// ── TABLE: PMS Symptomatology ────────────────────────────────────────────────
function pmsTable() {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
makeHRow(["Category", "Symptoms"]),
makeRow(["Related to water retention", "Abdominal bloating, Breast tenderness, Swelling of extremities, Weight gain"], false),
makeRow(["Neuropsychiatric", "Irritability, Tearfulness, Depression, Anxiety, Mood swings, Tension, Forgetfulness, Confusion, Restlessness, Headache, Increased appetite, Anger"], true),
makeRow(["Behavioral", "Fatigue, Tiredness, Dyspareunia, Insomnia"], false),
]
});
}
// ── TABLE: PMS Management ────────────────────────────────────────────────────
function pmsMgmtTable() {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
makeHRow(["Category", "Drug/Measure", "Dose/Notes"]),
makeRow(["Nonpharmacological", "Life style modification, Dietetic advice, Exercise, Yoga, Stress management", "Avoidance of salt, caffeine, alcohol especially in 2nd half of cycle"], false),
makeRow(["Non-hormonal", "Pyridoxine (Vit B6)", "100 mg daily — corrects tryptophan metabolism"], true),
makeRow(["Non-hormonal", "Anxiolytic: Alprazolam", "0.25 mg BID — given in luteal phase"], false),
makeRow(["Non-hormonal", "SSRI: Fluoxetine", "20 mg/day — drug of choice; given 2 days before symptoms"], true),
makeRow(["Non-hormonal", "SNRI: Venlafaxine", "Effective alternative"], false),
makeRow(["Non-hormonal", "Diuretic: Frusemide", "Second half of cycle × 5 days — reduces fluid retention"], true),
makeRow(["Hormonal", "OCP (Oral contraceptive pills)", "3–6 cycles; newer OCPs with drospirenone have best control"], false),
makeRow(["Hormonal", "Progesterone", "Not effective in treating PMS"], true),
makeRow(["Hormonal", "Spironolactone", "25–200 mg/day — potassium sparing, anti-mineralocorticoid, anti-androgenic"], false),
makeRow(["Hormonal", "Danazol", "200 mg/day — suppress ovarian cycle; produces amenorrhoea"], true),
makeRow(["Hormonal", "GnRH analogue", "Goserelin 3.6 mg SC q4wk; add-back progestin to combat hypoestrogenic effects"], false),
makeRow(["Surgical", "Hysterectomy + bilateral oophorectomy", "Last resort in established cases nearing menopause"], true),
]
});
}
// ── TABLE: AUB Patterns ─────────────────────────────────────────────────────
function aubTable() {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
makeHRow(["Term", "Definition", "Key Cause"]),
makeRow(["Menorrhagia (Hypermenorrhea)", "Cyclic bleeding, excessive amount (>80 mL) or duration (>7 days)", "DUB, Fibroids, Adenomyosis"], false),
makeRow(["Polymenorrhea (Epimenorrhea)", "Cyclic bleeding, intervals <21 days", "DUB, Ovarian hyperstimulation"], true),
makeRow(["Metrorrhagia", "Irregular, acyclic bleeding from uterus", "Malignancy must be excluded"], false),
makeRow(["Oligomenorrhea", "Menstrual intervals >35 days", "PCOS, Weight-related, Hyperprolactinemia"], true),
makeRow(["Hypomenorrhea", "Scanty bleeding lasting <2 days", "Uterine synechiae, OCPs, Thyroid disorder"], false),
makeRow(["Menometrorrhagia", "Bleeding so irregular that menses cannot be identified", "DUB, Malignancy"], true),
]
});
}
// ── TABLE: Drug treatment Primary Dysmenorrhea ──────────────────────────────
function dysDrugTable() {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
makeHRow(["Drug Class", "Drug", "Dose", "Mechanism/Notes"]),
makeRow(["PSI (NSAIDs)", "Mefenamic acid", "250–500 mg 8 hrly", "COX inhibitor; reduces PG synthesis; start 2–3 days with onset of period"], false),
makeRow(["PSI (NSAIDs)", "Ibuprofen", "400 mg 8 hrly", "COX-1 and COX-2 inhibitor"], true),
makeRow(["PSI (NSAIDs)", "Naproxen", "250 mg 6 hrly", "Longer acting NSAID"], false),
makeRow(["PSI (selective)", "Celecoxib (COX-2i)", "200 mg twice daily", "Selective COX-2; similar efficacy, fewer GI side effects"], true),
makeRow(["Hormonal", "OCP (combined E+P)", "1 tab daily", "Suppress ovulation; maintain uniform hormonal milieu; 3–6 cycles"], false),
makeRow(["Hormonal", "Dydrogesterone (progestagen)", "D5–D25 of cycle, 20 days", "Does not inhibit ovulation; 3–6 cycles"], true),
makeRow(["Hormonal", "LNG-IUS", "Intrauterine system", "Very effective (50%); used when contraception desired + oestrogen contraindicated"], false),
]
});
}
// ── MAIN DOCUMENT ────────────────────────────────────────────────────────────
const doc = new Document({
sections: [{
properties: {
page: { margin: { top: 720, bottom: 720, left: 900, right: 900 } }
},
children: [
// ════════════════════════════════════════════════════════════════
// TITLE PAGE
// ════════════════════════════════════════════════════════════════
title("GYNECOLOGY — EXAM-ORIENTED NOTES"),
sourceTag("Source: DC Dutta's Textbook of Gynecology | Chapter 14 & 15"),
new Paragraph({
children: [new TextRun({ text: "Topics Covered:", bold: true, size: 22, color: BLUE_MID, font: "Calibri" })],
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 40 },
}),
new Paragraph({
children: [new TextRun({ text: "1. Primary Dysmenorrhea 2. Secondary Dysmenorrhea 3. Premenstrual Syndrome (PMS/PMDD) 4. Abnormal Uterine Bleeding (AUB)", size: 20, font: "Calibri", color: BLACK })],
alignment: AlignmentType.CENTER,
spacing: { before: 20, after: 200 },
}),
// ════════════════════════════════════════════════════════════════
// TOPIC 1: PRIMARY DYSMENORRHEA
// ════════════════════════════════════════════════════════════════
h1("TOPIC 1: PRIMARY DYSMENORRHEA (SPASMODIC)"),
h2("Definition"),
examBox("EXAM DEFINITION:", "Primary dysmenorrhea is painful menstruation of sufficient magnitude so as to incapacitate day to day activities, where there is NO identifiable pelvic pathology."),
spacer(),
bullet("Incidence: 15–20% of all women; with incapacitation = 15–20%"),
bullet("NSAIDs and OCPs have markedly reduced the symptom burden"),
h2("Etiopathology"),
h3("Key Mechanisms (IMP for MCQ)", RED),
bullet("Junctional Zone (JZ) dysperistalsis and hyperactivity of uterine muscle — the MOST IMPORTANT mechanism"),
bullet("Imbalance in autonomic nervous control of uterine muscle — overactivity of sympathetic nerves → hypertonicity of circular fibres of isthmus and internal os"),
h4("Role of Prostaglandins (MOST IMPORTANT)"),
bullet("In ovulatory cycles, under the action of progesterone: PGF2α and PGE2 are synthesized from secretory endometrium"),
bullet("PGF2α is a strong vasoconstrictor → causes ischaemia (angina) of myometrium"),
bullet("Either increased production or increased sensitivity of myometrium to normal PG production → increased myometrial contraction with/without dysrhythmia"),
bullet("Possible cause of pain: JZ change → dysperistalsis and hyperactivity"),
h4("Role of Vasopressin"),
bullet("Increased vasopressin release during menstruation → increases uterine hyperactivity and dysrhythmic contractions → ischaemia and hypoxia → pain"),
bullet("Explains persistence of pain even in cases treated with anti-prostaglandin drugs"),
bullet("Vasopressin increases PG synthesis and directly increases myometrial activity"),
h4("Role of Endothelins"),
bullet("Causes myometrial smooth muscle contractions, specially in JZ endometrium"),
bullet("Endothelins in endometrium can induce PGF2α"),
bullet("Local myometrial ischaemia caused by endothelins and PGF2α aggravates uterine dysperistalsis and hyperactivity"),
h4("Platelet Activating Factor (PAF)"),
bullet("Also associated with etiology; concentration is found high"),
bullet("Leukotrienes and PAFs are vasoconstrictors and stimulate myometrial contractions"),
h4("Psychosomatic Factors"),
bullet("Tension and anxiety during adolescence lower the pain threshold"),
h4("Abnormal Anatomical & Functional Aspect of Myometrium"),
bullet("Uterine myometrial hyperactivity — has been observed in primary dysmenorrhea"),
bullet("Subendometrial myometrium (JZ) is different structurally and functionally from outer myometrium"),
bullet("Marked hyperperistalsis of JZ in women with endometriosis and adenomyosis"),
bullet("Significant JZ changes seen — irregular thickening, hyperplasia of smooth muscle, less vascularity"),
bullet("This is known as Junctional Zone Hyperplasia"),
spacer(),
examBox("FLOWCHART SUMMARY:", "Progesterone → PGF2α synthesis and release → Endothelin, Leukotrienes, PAFs → Reduced blood flow + ↑ Myometrial contractions (JZ) ± dysrhythmia → PAIN"),
spacer(),
h2("Patient Profile"),
bullet("Predominantly in adolescent girls"),
bullet("Usually appears within 2 years of menarche"),
bullet("More common in girls from affluent society"),
bullet("Mother or sister may be dysmenorrhoeic (genetic predisposition)"),
h2("Clinical Features"),
bullet("Pain begins a few hours before or just with the onset of menstruation"),
bullet("Severity: usually lasts for a few hours, may extend to 24 hours but seldom persists beyond 48 hours"),
bullet("Character: spasmodic and confined to lower abdomen; may radiate to back and medial aspect of thighs"),
bullet("Systemic discomforts: nausea, vomiting, fatigue, diarrhea, headache, tachycardia"),
bullet("Vasomotor changes: pallor, cold sweats, occasional fainting; syncope in severe cases"),
bullet("Abdominal and pelvic examination: no abnormal findings"),
bullet("Ultrasound: very useful for detecting pelvic abnormalities — not invasive"),
h2("Clinical Differentiating Features"),
diffTable(),
spacer(),
h2("Treatment"),
h3("General Measures"),
bullet("Improvement of general health and simple psychotherapy — explanation and assurance"),
bullet("Usual activities including sports should be continued"),
bullet("During menses: keep bowel empty; mild analgesics and antispasmodics may be prescribed"),
bullet("HABIT-FORMING drugs like pethidine or morphine must NOT be prescribed"),
bullet("With these simple measures pain is relieved in majority"),
h3("Drug Treatment (Table 14.1)"),
dysDrugTable(),
spacer(),
examBox("DRUG OF CHOICE:", "Prostaglandin Synthetase Inhibitors (PSIs/NSAIDs) are FIRST LINE. Oral contraceptive pills are drug of choice when contraception is also required."),
spacer(),
h4("Suitable Cases for Medical Therapy"),
bullet("Comparatively young age and having contraindications to pill"),
bullet("Contraindications to medical therapy: allergy to aspirin, gastric ulceration, history of asthma"),
h4("Oral Contraceptive Pills — Suitable Candidates"),
bullet("(i) Wanting contraceptive precaution, (ii) with heavy periods, (iii) unresponsive or having contraindications to anti-prostaglandin drugs"),
bullet("The pill should be used for 3–6 cycles"),
h4("Dydrogesterone (Progestagen)"),
bullet("Does NOT inhibit ovulation but interferes with ovarian steroidogenesis"),
bullet("Drug taken from D5 of cycle for 20 days; continued for 3–6 cycles"),
h4("LNG-IUS"),
bullet("Very effective (50%) in reducing pain"),
bullet("Used when contraception desired and where oestrogen is contraindicated"),
h3("Surgical Treatment"),
bullet("Laparoscopy is indicated if all pelvic medical therapy fails — important one being endometriosis"),
bullet("Transcutaneous Electrical Nerve Stimulation (TENS): results are not better than analgesics"),
bullet("Laparoscopic Uterine Nerve Ablation (LUNA): not found beneficial for primary dysmenorrhea"),
bullet("Laparoscopic Presacral Neurectomy (LPSN): done to cut down sensory pathways via T11–T12 from uterus; not helpful for adnexal pain (T9–T10)"),
bullet("Dilatation of Cervical Canal: done under anaesthesia for slow dilatation of cervix; not commonly done; late sequela may be cervical incompetence"),
spacer(),
pageBreak(),
// ════════════════════════════════════════════════════════════════
// TOPIC 2: SECONDARY DYSMENORRHEA
// ════════════════════════════════════════════════════════════════
h1("TOPIC 2: SECONDARY DYSMENORRHEA (CONGESTIVE)"),
h2("Definition"),
examBox("EXAM DEFINITION:", "Secondary dysmenorrhea is menstrual pain occurring in association with pelvic pathology. It is normally considered to be menstruation-associated pain occurring in the presence of pelvic pathology."),
spacer(),
h2("Causes of Pain"),
bullet("Related to increasing tension in pelvic tissues due to premenstrual pelvic congestion or increased vascularity in pelvic organs"),
h2("Patient Profile"),
bullet("Usually in their thirties"),
bullet("More often parous"),
bullet("Unrelated to any social status"),
h2("Clinical Features"),
bullet("Pain is dull, situated in back and in front without radiation"),
bullet("Usually appears 3–5 days prior to period and relieves with onset of bleeding"),
bullet("No systemic discomfort — unlike primary dysmenorrhea"),
bullet("Patients may have had some discomfort even in between periods"),
bullet("Abdominal and vaginal examinations usually reveal the pathology"),
h2("Causes (Table 14.2)"),
secDysTable(),
spacer(),
h2("Investigations"),
bullet("Transvaginal sonography: detects most pelvic pathology (leiomyoma, adenomyosis)"),
bullet("Saline infusion sonography: submucous fibroid, polyps"),
bullet("Laparoscopy: endometriosis — both diagnostic and therapeutic"),
bullet("Hysteroscopy: both diagnostic and therapeutic"),
h2("Treatment"),
bullet("Treatment aims at the cause rather than the symptom"),
bullet("Type of treatment depends on severity, age, and parity of the patient"),
h3("Special Conditions"),
h4("Ovarian Dysmenorrhea"),
bullet("Right ovarian vein crosses ureter at right angle"),
bullet("During premenstrual period: pelvic congestion or increased blood flow → marked engorgement in vein → pressure on ureter → stasis → infection → pyelonephritis → pain"),
bullet("Important cause of UNILATERAL dysmenorrhea"),
bullet("Diagnosis: physical examination, radiologic study (pelvic venography), Doppler scan, duplex ultrasound scans, CT, MRI, angiography; laparoscopic diagnosis is difficult with intraperitoneal pressure and Trendelenberg position"),
bullet("Pain referred to area innervated by T10 to L1 segments"),
bullet("Treatment: often unsatisfactory; MPA 50 mg daily for 4 months found effective; in parous women with advancing age, hysterectomy may relieve symptoms"),
h4("Mittelschmerz's Syndrome (Ovular Pain)"),
bullet("Ovular pain — not infrequent complaint; appears in midmenstrual period"),
bullet("Usually situated in hypogastrium or either iliac fossa; usually one side depending on which ovary is ovulating"),
bullet("Does not change from side to side"),
bullet("Rarely lasts >12 hours; may be associated with slight vaginal bleeding or excessive mucoid vaginal discharge"),
bullet("Probable factors: (i) increased tension of Graafian follicle just prior to rupture; (ii) peritoneal irritation by follicular fluid; (iii) contraction of tubes and uterus"),
bullet("Treatment: assurance and analgesics; obstinate cases — make cycle anovular with OCP"),
h4("Pelvic Congestion Syndrome"),
bullet("Disturbance in autonomic nervous system → gross vascular congestion with pelvic varicosities"),
bullet("Patient has congestive type of dysmenorrhea without demonstrable pelvic pathology"),
bullet("Patient complains of vague appearance of pelvic tumour with backache and pelvic pain with long standing position — sometimes with dyspareunia"),
bullet("There may be menorrhagia or epimenorrhea"),
bullet("Uterus may feel bulky and boggy"),
bullet("Diagnosis: Physical examination, pelvic venography, Doppler — bilateral vessels may be compressed with intraperitoneal pressure but reappear as pressure is reduced"),
bullet("Treatment: MPA 50 mg daily for 4 months found effective; hysterectomy in parous women with advancing age"),
spacer(),
pageBreak(),
// ════════════════════════════════════════════════════════════════
// TOPIC 3: PREMENSTRUAL SYNDROME (PMS / PMDD)
// ════════════════════════════════════════════════════════════════
h1("TOPIC 3: PREMENSTRUAL SYNDROME (PMS/PMDD)"),
h2("Definition & Diagnostic Criteria (ACOG)"),
examBox("EXAM DEFINITION:", "PMS is a psychoneuroendocrine disorder of unknown etiology, often noticed just prior to menstruation, occurring regularly in the luteal phase of each ovulatory menstrual cycle with a large number of symptoms during the last 7–10 days of the menstrual cycle."),
spacer(),
h3("ACOG Criteria for PMS (Must Fulfil ALL)", RED),
bullet("No organic lesion"),
bullet("Regularly occurs during the luteal phase of each ovulatory menstrual cycle"),
bullet("Symptoms must be severe enough to disturb the life style or she requires medical help"),
bullet("Symptom-free period during rest of the cycle"),
body("When symptoms disrupt daily functioning, they are grouped under the name PREMENSTRUAL DYSPHORIC DISORDER (PMDD).", { bold: true }),
h2("Pathophysiology (Hypotheses)"),
h4("1. Alteration in Oestrogen : Progesterone Ratio"),
bullet("Altered oestrogen:progesterone ratio starting from midluteal phase"),
bullet("Altered oestrogen:progesterone ratio → diminished progesterone level"),
bullet("Women aged 30–45 more commonly affected"),
h4("2. Neuroendocrine Factors"),
bullet("Serotonin is an important neurotransmitter in CNS; During luteal phase, decreased synthesis of serotonin observed in women suffering from PMS"),
bullet("SSRIs are therefore effective in treatment"),
bullet("Endorphins: PMS symptom complex thought to be due to withdrawal of endorphins (neurotransmitters) from CNS during luteal phase"),
bullet("γ-aminobutyric acid (GABA): suppresses the anxiety level in brain; medications that are GABA agonists are effective"),
h4("3. Other Factors"),
bullet("Thyrotropin releasing hormone (TRH), prolactin, renin, aldosterone, prostaglandins — mentioned but nothing conclusive"),
bullet("Pyridoxine (Vit B6): corrects tryptophan metabolism, specially 'pill'-associated depression"),
h2("Clinical Features"),
bullet("More common in women aged 30–45"),
bullet("May be related to childhood or a disturbing life event"),
bullet("No abnormal pelvic findings excepting features of pelvic congestion"),
h2("Symptomatology (Table 14.4)"),
pmsTable(),
spacer(),
examBox("MOST USEFUL DIAGNOSTIC TOOL:", "Patient's symptom diary (Table 14.4) — documented over 2–3 cycles. Helps confirm cyclicity and luteal phase predominance."),
spacer(),
h2("Treatment (Table 14.5) — Comprehensive"),
pmsMgmtTable(),
spacer(),
h3("Detailed Drug Notes"),
h4("SSRI — Fluoxetine (DRUG OF CHOICE)"),
bullet("An antidepressant that inhibits neuronal uptake of serotonin (SSRI)"),
bullet("Single oral dose of 20 mg found to significantly improve psychiatric and behavioral symptoms"),
bullet("Drugs prescribed at least 2 days prior to onset of symptoms and continued till menstruation starts"),
bullet("Other drugs used: Sertraline (50 mg/day) and Venlafaxine (SNRI)"),
h4("GnRH Analogue Therapy"),
bullet("Gonadal steroids suppressed by GnRH agonist for 6 months (medical oophorectomy)"),
bullet("Used to: (i) assess role of ovarian steroids in PMS, (ii) predict whether bilateral oophorectomy would be of help or not"),
bullet("Goserelin (Zoladex): 3.6 mg SC subcutaneously every 4 weeks"),
bullet("Leuprorelin acetate (Prostap): 3.75 mg SC or IM every 4 weeks"),
bullet("Triptorelin (Decapeptyl): 3 mg IM every 4 weeks"),
bullet("Results of GnRH agonist therapy are dramatic"),
bullet("GnRH agonist therapy combined with oestrogen and progestin 'add-back' to combat hypoestrogenic symptoms"),
bullet("In established cases approaching menopause: hysterectomy with bilateral oophorectomy is last resort"),
h4("Spironolactone"),
bullet("Potassium sparing diuretic"),
bullet("Has antimineralocorticoid and anti-androgenic effects"),
bullet("Given in luteal phase 25–200 mg/day"),
bullet("Improves symptoms of PMDD"),
h3("Menstrual Migraine & Catamenial Seizure"),
bullet("Menstrual Migraine: attack of migraine occurring perimenstrually or both perimenstrually and at other times; Treatment: triptans and/or NSAIDs"),
bullet("Catamenial Seizure: seizure that occurs around the menstrual cycle; Imbalance of oestrogen:progesterone ratio thought to be cause as hormones modulate the cerebral excitability; Treatment: anticonvulsants; depot MPA (DMPA) found helpful"),
spacer(),
pageBreak(),
// ════════════════════════════════════════════════════════════════
// TOPIC 4: ABNORMAL UTERINE BLEEDING (AUB)
// ════════════════════════════════════════════════════════════════
h1("TOPIC 4: ABNORMAL UTERINE BLEEDING (AUB)"),
h2("Definition & Normal Menstruation"),
examBox("EXAM DEFINITION:", "Any uterine bleeding outside the normal volume, duration, regularity or frequency is considered Abnormal Uterine Bleeding (AUB). Nearly 30% of all gynecological outpatient attendants are for AUB."),
spacer(),
new Table({
width: { size: 60, type: WidthType.PERCENTAGE },
rows: [
makeHRow(["Parameter", "Normal Value"]),
makeRow(["Cycle interval", "28 days (21–35 days)"]),
makeRow(["Menstrual flow", "4–5 days"], true),
makeRow(["Menstrual blood loss", "35 mL (20–80 mL)"]),
]
}),
spacer(),
h2("Common Causes of AUB"),
bullet("Dysfunctional uterine bleeding (DUB)"),
bullet("Infections"),
bullet("Endocrine dysfunction (thyroid disorder)"),
bullet("Pregnancy complications"),
bullet("Hematological disorders"),
bullet("Neoplastic growth"),
h2("Patterns of AUB — Definitions & Causes"),
aubTable(),
spacer(),
h2("1. MENORRHAGIA (Syn: Hypermenorrhea)"),
examBox("DEFINITION:", "Menorrhagia = cyclic bleeding at normal intervals where bleeding is either excessive in amount (>80 mL) OR duration (>7 days) or BOTH. 'Menotaxis' = prolonged bleeding."),
spacer(),
h3("Causes"),
h4("Organic — Pelvic"),
bullet("Fibroid uterus, Adenomyosis, Pelvic endometriosis, IUCD in utero, Chronic tubo-ovarian mass"),
bullet("Tubercular endometritis (early cases), Retroverted uterus — congestion, Granulosa cell tumour"),
bullet("Endometrial polyp, Pelvic adhesions, Cervical stenosis"),
h4("Organic — Systemic"),
bullet("Liver dysfunction (cirrhosis) — failure to conjugate and inactivate oestrogens"),
bullet("Congestive cardiac failure"),
bullet("Severe hypertension"),
h4("Endocrinal"),
bullet("Hypothyroidism, Hyperthyroidism"),
h4("Hematological"),
bullet("Idiopathic thrombocytopenic purpura (ITP)"),
bullet("Leukaemia"),
bullet("Von Willebrand's disease"),
bullet("Platelet deficiency (thrombocytopenia)"),
h4("Functional"),
bullet("Dysfunctional uterine bleeding (DUB) — disturbed hypothalamo-pituitary-ovarian-endometrial axis"),
bullet("Emotional upset"),
h3("Diagnosis"),
bullet("Long duration of flow, passage of big clots, use of increased number of thick sanitary pads, pallor, low haemoglobin"),
bullet("Transvaginal sonography: can detect most pelvic pathology (leiomyoma, adenomyosis)"),
h3("Treatment"),
bullet("Definitive treatment appropriate to the cause for menorrhagia"),
h2("2. POLYMENORRHEA (Syn: Epimenorrhea)"),
examBox("DEFINITION:", "Polymenorrhea = cyclic bleeding where the cycle is reduced to less than 21 days and remains constant at that frequency. If associated with excessive/prolonged bleeding, it is called epimenorrhagia."),
spacer(),
h3("Causes"),
bullet("Dysfunctional: predominantly during adolescence, preceding menopause, and following delivery and abortion"),
bullet("Ovarian hyperstimulation by pituitary hormones may be responsible"),
bullet("Ovarian hyperemia in pelvic inflammatory disease (PID) or ovarian endometriosis"),
h3("Treatment"),
bullet("Persistent dysfunctional type: hormone treatment as outlined in DUB"),
h2("3. METRORRHAGIA"),
examBox("DEFINITION:", "Metrorrhagia = irregular, acyclic bleeding from the uterus. Amount variable. 'Menometrorrhagia' = bleeding so irregular and excessive that the menses (periods) cannot be identified at all."),
spacer(),
h3("Causes"),
bullet("Surface lesion in the uterus (Fig 15.1 — cervical polyp)"),
bullet("Metrorrhagia strictly concerns uterine bleeding but in clinical practice, bleeding from any part of the genital tract is included — includes contact bleeding (Tables 15.3) or intermenstrual bleeding (Tables 15.4 and 15.5)"),
bullet("Malignancy must be excluded prior to any definitive treatment"),
h4("Causes of Contact Bleeding (Table 15.3)"),
bullet("Carcinoma cervix"),
bullet("Mucous polyp of cervix"),
bullet("Vascular ectopy of cervix — especially during pregnancy, pill use"),
bullet("Infections — chlamydial or tubercular cervicitis"),
bullet("Cervical endometriosis"),
h4("Causes of Acyclic Bleeding (Table 15.4)"),
bullet("DUB — usually during adolescence, following childbirth/abortion and preceding menopause"),
bullet("Submucous fibroid, Uterine polyp"),
bullet("Carcinoma cervix and endometrial carcinoma"),
h4("Causes of Intermenstrual Bleeding (Table 15.5)"),
bullet("Urethral caruncle, Ovular bleeding"),
bullet("Breakthrough bleeding in pill use"),
bullet("IUCD in utero, Decubitus ulcer"),
h2("4. OLIGOMENORRHEA"),
examBox("DEFINITION:", "Oligomenorrhea = menstrual bleeding occurring more than 35 days apart and which remains constant at that frequency."),
spacer(),
h3("Causes (Table 15.6)"),
bullet("Age-related: during adolescence and preceding menopause"),
bullet("Weight-related: obesity"),
bullet("Stress and exercise related"),
bullet("Endocrine disorders: PCOS (most common), Hyperprolactinemia, Hyperthyroidism"),
bullet("Androgen producing tumours: ovarian, adrenal"),
bullet("Tubercular endometritis — late cases"),
bullet("Drugs: Phenothiazines, Cimetidine, Methyldopa"),
h2("5. HYPOMENORRHEA"),
examBox("DEFINITION:", "Hypomenorrhea = menstrual bleeding that is unduly scanty and lasts for less than 2 days."),
spacer(),
h3("Causes"),
bullet("Local: uterine synechiae or endometrial tuberculosis"),
bullet("Endocrinal: use of oral contraceptives, thyroid dysfunction, premenopausal period"),
bullet("Systemic: malnutrition"),
spacer(2),
// ════════════════════════════════════════════════════════════════
// QUICK REVISION POINTS
// ════════════════════════════════════════════════════════════════
h1("QUICK REVISION — EXAM POINTS"),
infoBox("✔", "Dysmenorrhea is painful menstruation of sufficient magnitude so as to incapacitate day to day activities. Incidence of primary dysmenorrhea = 15–20%.", BLUE_LIGHT, BLUE_MID),
spacer(),
infoBox("✔", "Primary dysmenorrhea is almost always confined to ovulatory cycle and relieved following pregnancy and vaginal delivery. Pain usually appears following painless periods after menarche.", BLUE_LIGHT, BLUE_MID),
spacer(),
infoBox("✔", "Uterine Junctional Zone (JZ) dysperistalsis and hyperactivity are the BASIC PATHOLOGICAL CHANGE for primary dysmenorrhea. Biochemical mediators: Progesterone, PGF2α, Endothelin, PAFs and leukotrienes.", BLUE_LIGHT, BLUE_MID),
spacer(),
infoBox("✔", "PSIs (NSAIDs), oral contraceptives, or dydrogesterone are usually effective to minimize pain. Only cervical dilatation is required in obstinate cases.", GREEN_LIGHT, GREEN_DARK),
spacer(),
infoBox("✔", "Secondary dysmenorrhea may occur at any age.", GREEN_LIGHT, GREEN_DARK),
spacer(),
infoBox("✔", "Combined oral contraceptives REDUCE the severity of dysmenorrhea. It is the drug of choice when contraception is required.", GREEN_LIGHT, GREEN_DARK),
spacer(),
infoBox("✔", "In ovarian dysmenorrhea, the pain is referred to the area innervated by T10 to L1 segments. Right ovarian vein syndrome due to engorgement of right ovarian vein premenstrually compresses the right ureter → pyelonephritis and pain.", ORANGE_LIGHT, ORANGE),
spacer(),
infoBox("✔", "PMS (Premenstrual Syndrome) regularly occurs in the LUTEAL PHASE of each ovulatory menstrual cycle.", TEAL_LIGHT, TEAL),
spacer(),
infoBox("✔", "The MOST USEFUL DIAGNOSTIC TOOL for PMS is the patient's symptom diary (Table 14.4).", TEAL_LIGHT, TEAL),
spacer(),
infoBox("✔", "Treatment of PMS: Beneficial effects observed with SSRI (Fluoxetine 20 mg/day or Sertraline 50 mg/day). LNG-IUS, danazol also helpful. GnRH agonist therapy is DRAMATIC.", TEAL_LIGHT, TEAL),
spacer(),
infoBox("✔", "Women with PMDD show NO deficit in cognitive function in the luteal phase.", TEAL_LIGHT, TEAL),
spacer(),
infoBox("✔", "Exact etiology of PMS is UNKNOWN. Altered oestrogen, progesterone ratio; reduced circulatory level of neurotransmitters (serotonin, GABA or endorphins) in CNS may be responsible for symptom complex.", YELLOW_BG, ORANGE),
spacer(),
infoBox("✔", "Tranquilizers (alprazolam 0.25 mg) and/or antidepressants (fluoxetine 20 mg daily or sertraline 50 mg/day) significantly improve symptoms of PMDD.", YELLOW_BG, ORANGE),
spacer(),
infoBox("✔", "Oral contraceptive pills suppressing ovulation, calcium, aerobic exercise are helpful in relieving symptoms of PMDD.", YELLOW_BG, ORANGE),
spacer(2),
new Paragraph({
children: [new TextRun({ text: "End of Notes | Source: DC Dutta's Textbook of Gynecology, Chapter 14 & 15", italics: true, size: 17, color: BLUE_MID, font: "Calibri" })],
alignment: AlignmentType.CENTER,
spacing: { before: 120, after: 60 },
}),
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/puberty-notes/Exam_Notes_Dysmenorrhea_PMS_AUB.docx', buffer);
console.log('✔ Document created successfully!');
}).catch(err => {
console.error('Error:', err);
process.exit(1);
});
Failed to create session: unauthorized: authentication failed: Bearer token is invalid
We encountered an error while processing your request. Please try again or reach out to us for help.
Make notes
FLOWCHART: Progesterone → PGF2α synthesis → Endothelin + Leukotrienes + PAFs → Reduced blood flow + ↑ Myometrial contractions (JZ) ± dysrhythmia → PAIN
| Feature | Primary | Secondary |
|---|---|---|
| Pelvic pathology | None | Present |
| Age | Adolescents | Elderly/parous women |
| Cycle | Ovulatory only | Any age |
| Pain onset | Start of menses | 3–5 days before menses |
| Free period | Pain-free between periods | Discomfort even between periods |
| Systemic symptoms | Yes (nausea, vomiting, diarrhea) | Usually absent |
| Examination | Normal | Reveals pathology |
| Response to PSI/OCP | Good | Variable |
| Drug Class | Drug | Dose |
|---|---|---|
| PSI (NSAIDs) | Mefenamic acid | 250–500 mg 8 hrly |
| PSI (NSAIDs) | Ibuprofen | 400 mg 8 hrly |
| PSI (NSAIDs) | Naproxen | 250 mg 6 hrly |
| PSI (COX-2 selective) | Celecoxib | 200 mg twice daily |
| Hormonal | OCP (combined E+P) | 1 tab daily × 3–6 cycles |
| Hormonal | Dydrogesterone | D5–D25 × 3–6 cycles |
| Hormonal | LNG-IUS | Very effective (50%); used when contraception desired |
DRUG OF CHOICE: PSIs/NSAIDs are FIRST LINE. OCP is drug of choice when contraception is also required.
| Category | Causes |
|---|---|
| Uterine | Endometriosis, Adenomyosis, Fibroid uterus, IUCD in utero, Obstruction due to Müllerian anomalies, Cervical stenosis |
| Adnexal/Peritoneal | Pelvic adhesions, Pelvic congestion, Endometrial polyp |
| Unilateral | Ovarian dysmenorrhea, Bicornuate uterus, Unilateral pelvic endometriosis, Right ovarian vein syndrome, Colonic/cecal spasm |
PMS is a psychoneuroendocrine disorder of unknown etiology, noticed just prior to menstruation, occurring regularly in the luteal phase of each ovulatory menstrual cycle, with a large number of symptoms during the last 7–10 days of the menstrual cycle.
| Category | Symptoms |
|---|---|
| Water retention | Abdominal bloating, Breast tenderness, Swelling of extremities, Weight gain |
| Neuropsychiatric | Irritability, Tearfulness, Depression, Anxiety, Mood swings, Tension, Forgetfulness, Confusion, Restlessness, Headache, Increased appetite, Anger |
| Behavioral | Fatigue, Tiredness, Dyspareunia, Insomnia |
MOST USEFUL DIAGNOSTIC TOOL: Patient's symptom diary documented over 2–3 cycles (Table 14.4)
| Drug | Dose | Notes |
|---|---|---|
| Pyridoxine (Vit B6) | 100 mg daily | Corrects tryptophan metabolism; helps 'pill'-associated depression |
| Alprazolam (anxiolytic) | 0.25 mg BID | Given in luteal phase only |
| Fluoxetine (SSRI) — DOC | 20 mg/day | Drug of choice; given at least 2 days before symptom onset; continue till menstruation starts |
| Sertraline | 50 mg/day | Alternative SSRI |
| Venlafaxine (SNRI) | — | Effective alternative |
| Frusemide (diuretic) | 2nd half of cycle × 5 days | Reduces fluid retention |
| Drug | Notes |
|---|---|
| OCP (combined) | 3–6 cycles; newer OCPs with drospirenone have BEST symptom control |
| Progesterone | NOT effective in treating PMS |
| Spironolactone | 25–200 mg/day; anti-mineralocorticoid + anti-androgenic; improves PMDD |
| Danazol | 200 mg/day; suppresses ovarian cycle; produces amenorrhoea |
| GnRH Analogue | Goserelin 3.6 mg SC q4wk; Leuprorelin 3.75 mg SC/IM q4wk; Triptorelin 3 mg IM q4wk; GnRH agonist therapy results are DRAMATIC; combine with oestrogen/progestin 'add-back' |
| Bromocriptine | 2.5 mg daily or twice daily; at least relieves breast complaints |
KEY POINTS:
- SSRI (fluoxetine) is DOC
- GnRH agonist therapy results are DRAMATIC
- Women with PMDD show NO deficit in cognitive function in the luteal phase
- Exact etiology UNKNOWN
| Parameter | Normal |
|---|---|
| Cycle interval | 28 days (21–35 days) |
| Menstrual flow | 4–5 days |
| Menstrual blood loss | 35 mL (20–80 mL) |
| Term | Definition | Key Cause |
|---|---|---|
| Menorrhagia (Hypermenorrhea) | Cyclic bleeding; excessive amount (>80 mL) OR duration (>7 days) or BOTH | DUB, Fibroids, Adenomyosis |
| Polymenorrhea (Epimenorrhea) | Cyclic bleeding; intervals <21 days | DUB, Ovarian hyperstimulation |
| Metrorrhagia | Irregular, acyclic bleeding from uterus; amount variable | Malignancy must be excluded |
| Menometrorrhagia | Bleeding so irregular that menses cannot be identified | DUB, Malignancy |
| Oligomenorrhea | Menstrual intervals >35 days | PCOS, Weight-related, Hyperprolactinemia |
| Hypomenorrhea | Scanty bleeding lasting <2 days | Uterine synechiae, OCPs, Thyroid disorder |
| Point | Fact |
|---|---|
| Incidence primary dysmenorrhea | 15–20% |
| Primary dysmenorrhea confined to | Ovulatory cycles only |
| Relieved after | Pregnancy and vaginal delivery |
| Most important mechanism | JZ dysperistalsis and hyperactivity |
| Biochemical mediators | Progesterone, PGF2α, Endothelin, PAFs, Leukotrienes |
| Drug of first choice | PSI/NSAIDs (Mefenamic acid, Ibuprofen) |
| Drug of choice when contraception needed | OCP |
| Surgery in primary dysmenorrhea | LPSN (not LUNA — not beneficial) |
| Secondary dysmenorrhea common cause | Endometriosis, Adenomyosis |
| Ovarian dysmenorrhea referred pain | T10 to L1 segments |
| Right ovarian vein syndrome | Engorgement → ureter compression → pyelonephritis → pain |
| PMS occurs during | Luteal phase (last 7–10 days) |
| PMS diagnostic tool | Symptom diary |
| PMS DOC | Fluoxetine (SSRI) 20 mg/day |
| GnRH agonist in PMS | Results are DRAMATIC |
| Progesterone in PMS | NOT effective |
| Women with PMDD | No deficit in cognitive function in luteal phase |
| Normal menstrual blood loss | 20–80 mL (average 35 mL) |
| Menorrhagia | >80 mL or >7 days |
| Polymenorrhea | <21 day intervals |
| Oligomenorrhea | >35 day intervals |
| Most common cause oligomenorrhea | PCOS |
| Metrorrhagia — must exclude | Malignancy |
| AUB — % of OPD | ~30% of all gynecological OPD |
Make a quick reference PDF cheat sheet
~/puberty-notes/cheatsheet.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT
from reportlab.platypus.flowables import BalancedColumns
from reportlab.lib.colors import HexColor
# ── Colors ────────────────────────────────────────────────────────────────────
NAVY = HexColor("#1F3864")
BLUE = HexColor("#2E75B6")
BLUE_LIGHT = HexColor("#BDD7EE")
BLUE_PALE = HexColor("#EBF3FB")
RED = HexColor("#C00000")
RED_LIGHT = HexColor("#FFE0E0")
ORANGE = HexColor("#C55A11")
ORANGE_PALE = HexColor("#FCE4D6")
GREEN = HexColor("#375623")
GREEN_PALE = HexColor("#E2EFDA")
PURPLE = HexColor("#7030A0")
PURPLE_PALE = HexColor("#EAD8F7")
TEAL = HexColor("#006064")
TEAL_PALE = HexColor("#E0F2F1")
YELLOW = HexColor("#FFC000")
YELLOW_PALE = HexColor("#FFF2CC")
WHITE = colors.white
BLACK = HexColor("#1A1A1A")
GRAY = HexColor("#F2F2F2")
GRAY_MID = HexColor("#D9D9D9")
W, H = A4
# ── Styles ────────────────────────────────────────────────────────────────────
SS = getSampleStyleSheet()
def style(name, **kw):
base = kw.pop("parent", "Normal")
s = ParagraphStyle(name, parent=SS[base], **kw)
return s
TITLE_S = style("TitleS", fontSize=20, textColor=WHITE, backColor=NAVY, alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=2, spaceBefore=2, leftIndent=4, rightIndent=4, leading=26)
SUBTITLE_S = style("SubtitleS", fontSize=9, textColor=BLUE, alignment=TA_CENTER, fontName="Helvetica-Oblique", spaceAfter=6, spaceBefore=0)
H1_S = style("H1S", fontSize=11, textColor=WHITE, backColor=NAVY, alignment=TA_LEFT, fontName="Helvetica-Bold", spaceBefore=10, spaceAfter=2, leftIndent=0, leading=16)
H2_S = style("H2S", fontSize=9.5,textColor=WHITE, backColor=BLUE, alignment=TA_LEFT, fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=2, leftIndent=0, leading=14)
H3_S = style("H3S", fontSize=9, textColor=NAVY, alignment=TA_LEFT, fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=1, leading=12)
H4_S = style("H4S", fontSize=8.5,textColor=ORANGE, alignment=TA_LEFT, fontName="Helvetica-Bold", spaceBefore=3, spaceAfter=1, leading=11)
BODY_S = style("BodyS", fontSize=8, textColor=BLACK, alignment=TA_LEFT, fontName="Helvetica", spaceBefore=1, spaceAfter=1, leading=11)
BODY_B_S = style("BodyBS", fontSize=8, textColor=BLACK, alignment=TA_LEFT, fontName="Helvetica-Bold", spaceBefore=1, spaceAfter=1, leading=11)
BULLET_S = style("BulletS", fontSize=7.8,textColor=BLACK, alignment=TA_LEFT, fontName="Helvetica", spaceBefore=1, spaceAfter=1, leftIndent=10, firstLineIndent=-8, leading=10.5)
SUBBUL_S = style("SubBulS", fontSize=7.5,textColor=BLACK, alignment=TA_LEFT, fontName="Helvetica", spaceBefore=0.5, spaceAfter=0.5, leftIndent=20, firstLineIndent=-8, leading=10)
EXAM_S = style("ExamS", fontSize=7.8,textColor=RED, backColor=YELLOW_PALE, alignment=TA_LEFT, fontName="Helvetica-Bold", spaceBefore=2, spaceAfter=2, leftIndent=6, rightIndent=4, leading=11)
EXAM_BODY_S = style("ExamBodyS", fontSize=7.8,textColor=BLACK, backColor=YELLOW_PALE, alignment=TA_LEFT, fontName="Helvetica", spaceBefore=0, spaceAfter=2, leftIndent=6, rightIndent=4, leading=11)
NOTE_S = style("NoteS", fontSize=7.5,textColor=TEAL, alignment=TA_LEFT, fontName="Helvetica-Oblique", spaceBefore=1, spaceAfter=1, leftIndent=6, leading=10)
TH_S = style("ThS", fontSize=7.5,textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER, leading=10)
TD_S = style("TdS", fontSize=7.5,textColor=BLACK, fontName="Helvetica", alignment=TA_LEFT, leading=10)
TD_B_S = style("TdBS", fontSize=7.5,textColor=BLACK, fontName="Helvetica-Bold", alignment=TA_LEFT, leading=10)
FOOTER_S = style("FooterS", fontSize=7, textColor=BLUE, alignment=TA_CENTER, fontName="Helvetica-Oblique")
def h1(t): return Paragraph(f" {t}", H1_S)
def h2(t): return Paragraph(f" ■ {t}", H2_S)
def h3(t): return Paragraph(t, H3_S)
def h4(t): return Paragraph(f"▸ {t}", H4_S)
def body(t): return Paragraph(t, BODY_S)
def bodyb(t): return Paragraph(t, BODY_B_S)
def bul(t): return Paragraph(f"• {t}", BULLET_S)
def subbul(t): return Paragraph(f"◦ {t}", SUBBUL_S)
def note(t): return Paragraph(f"✎ {t}", NOTE_S)
def sp(h=3): return Spacer(1, h)
def hr(c=BLUE_LIGHT): return HRFlowable(width="100%", thickness=0.5, color=c, spaceAfter=2, spaceBefore=2)
def exam_box(label, content):
return Table(
[[Paragraph(f"<b>★ {label}</b> {content}", style("EB", parent="Normal", fontSize=7.8, fontName="Helvetica", leading=11, textColor=BLACK))]],
colWidths=["100%"],
style=TableStyle([
("BACKGROUND", (0,0), (-1,-1), YELLOW_PALE),
("BOX", (0,0), (-1,-1), 0.5, ORANGE),
("LEFTPADDING",(0,0), (-1,-1), 8),
("RIGHTPADDING",(0,0),(-1,-1), 6),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
])
)
def info_box(label, content, bg=TEAL_PALE, lc=TEAL):
return Table(
[[Paragraph(f"<b>{label}</b> {content}", style("IB", parent="Normal", fontSize=7.8, fontName="Helvetica", leading=11, textColor=BLACK))]],
colWidths=["100%"],
style=TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("BOX", (0,0), (-1,-1), 0.5, lc),
("LEFTPADDING",(0,0), (-1,-1), 8),
("RIGHTPADDING",(0,0),(-1,-1), 6),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING",(0,0),(-1,-1), 4),
])
)
def make_table(headers, rows, col_widths=None, header_bg=NAVY):
hrow = [Paragraph(h, TH_S) for h in headers]
data = [hrow]
for i, r in enumerate(rows):
data.append([Paragraph(str(c), TD_S) for c in r])
tbl = Table(data, colWidths=col_widths, repeatRows=1)
ts = TableStyle([
("BACKGROUND", (0,0), (-1,0), header_bg),
("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, BLUE_PALE]),
("GRID", (0,0), (-1,-1), 0.3, GRAY_MID),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING",(0,0),(-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 4),
("RIGHTPADDING",(0,0), (-1,-1), 4),
("VALIGN", (0,0), (-1,-1), "TOP"),
])
tbl.setStyle(ts)
return tbl
# ── Page template ─────────────────────────────────────────────────────────────
def on_page(canvas, doc):
canvas.saveState()
# Header bar
canvas.setFillColor(NAVY)
canvas.rect(0, H - 18*mm, W, 18*mm, fill=1, stroke=0)
canvas.setFillColor(WHITE)
canvas.setFont("Helvetica-Bold", 10)
canvas.drawCentredString(W/2, H - 11*mm, "GYNECOLOGY QUICK REFERENCE CHEAT SHEET")
canvas.setFont("Helvetica-Oblique", 7.5)
canvas.drawRightString(W - 1.5*cm, H - 15*mm, "DC Dutta's Textbook of Gynecology | Ch. 14 & 15")
# Footer
canvas.setFillColor(NAVY)
canvas.rect(0, 0, W, 10*mm, fill=1, stroke=0)
canvas.setFillColor(WHITE)
canvas.setFont("Helvetica", 7)
canvas.drawCentredString(W/2, 3.5*mm, f"Page {doc.page} | Primary Dysmenorrhea · Secondary Dysmenorrhea · PMS/PMDD · AUB")
# Side accent
canvas.setFillColor(BLUE)
canvas.rect(0, 10*mm, 3*mm, H - 28*mm, fill=1, stroke=0)
canvas.restoreState()
# ── Build content ─────────────────────────────────────────────────────────────
story = []
# ── PAGE 1: PRIMARY & SECONDARY DYSMENORRHEA ──────────────────────────────────
story += [
h1("1. PRIMARY DYSMENORRHEA (SPASMODIC)"),
sp(4),
exam_box("DEFINITION:", "Painful menstruation of sufficient magnitude to INCAPACITATE day to day activities. NO identifiable pelvic pathology. Incidence = 15–20%."),
sp(4),
]
story += [
h2("ETIOPATHOLOGY — KEY MECHANISMS"),
sp(2),
make_table(
["Mechanism", "Details"],
[
["PGF2α (MOST IMP)", "In ovulatory cycles: Progesterone → PGF2α + PGE2 from secretory endometrium. PGF2α = vasoconstrictor → myometrial ischaemia (angina). ↑ PG production or ↑ sensitivity → ↑ myometrial contractions ± dysrhythmia"],
["JZ Dysperistalsis", "Junctional Zone (JZ) = subendometrial myometrium. Hyperperistalsis of JZ → dysperistalsis and hyperactivity → PAIN. JZ Hyperplasia seen (irregular thickening, smooth muscle hyperplasia, less vascularity)"],
["Vasopressin", "↑ Vasopressin during menstruation → ↑ uterine hyperactivity + dysrhythmic contractions → ischaemia → pain. Also ↑ PG synthesis. Explains pain persistence EVEN WITH NSAIDs"],
["Endothelins", "Smooth muscle contractions in JZ. Endothelins induce PGF2α. Aggravate JZ dysperistalsis + hyperactivity"],
["PAF + Leukotrienes", "Platelet Activating Factor concentration is HIGH. Vasoconstrictors → stimulate myometrial contractions"],
["Autonomic imbalance", "Overactivity of sympathetic nerves → hypertonicity of circular fibres of isthmus and internal os"],
],
col_widths=[3.2*cm, 12.8*cm]
),
sp(4),
exam_box("FLOWCHART:", "Progesterone → PGF2α → Endothelin + PAFs + Leukotrienes → ↓ Blood flow + ↑ Myometrial contractions (JZ) ± dysrhythmia → PAIN"),
sp(4),
]
story += [
h2("PATIENT PROFILE & CLINICAL FEATURES"),
sp(2),
make_table(
["Profile", "Clinical Features"],
[
["Adolescent girls", "Pain: few hours before or AT ONSET of menses"],
["Within 2 yrs of menarche", "Duration: few hrs → max 24 hrs; rarely >48 hrs"],
["Ovulatory cycles ONLY", "Character: SPASMODIC; lower abdomen ± back ± medial thigh"],
["Cured after pregnancy/delivery", "Systemic: nausea, vomiting, diarrhea, headache, tachycardia"],
["Mother/sister history", "Vasomotor: pallor, cold sweats, fainting"],
["Affluent society (more common)", "Examination: NO ABNORMAL FINDINGS"],
],
col_widths=[4.5*cm, 11.5*cm]
),
sp(4),
]
story += [
h2("PRIMARY vs SECONDARY — DIFFERENTIATING FEATURES"),
sp(2),
make_table(
["Feature", "Primary", "Secondary"],
[
["Pelvic pathology", "NONE", "PRESENT"],
["Age", "Adolescents", "Elderly/parous women"],
["Cycle", "OVULATORY only", "Any age, any cycle"],
["Pain onset", "At start of menses", "3–5 days BEFORE menses"],
["Between-period pain", "PAIN FREE", "May have discomfort"],
["Systemic symptoms", "Yes (N/V/D/headache)", "Usually ABSENT"],
["Examination", "Normal", "Reveals pathology"],
["USG/laparoscopy", "Normal", "Shows pathology"],
],
col_widths=[4*cm, 5.5*cm, 6.5*cm]
),
sp(4),
]
story += [
h2("TREATMENT — PRIMARY DYSMENORRHEA"),
sp(2),
make_table(
["Drug/Measure", "Dose", "Notes"],
[
["Mefenamic acid (PSI/NSAID)", "250–500 mg 8 hrly", "DOC — start 2–3 days with onset; 3–6 cycles. COX inhibitor → ↓ PG synthesis"],
["Ibuprofen (PSI/NSAID)", "400 mg 8 hrly", "COX-1 and COX-2 inhibitor"],
["Naproxen (PSI/NSAID)", "250 mg 6 hrly", "Longer acting"],
["Celecoxib (COX-2 selective)", "200 mg twice daily", "Fewer GI side effects; similar efficacy"],
["OCP (Combined E+P)", "1 tab daily", "DOC when CONTRACEPTION needed. Suppress ovulation → uniform hormonal milieu. 3–6 cycles"],
["Dydrogesterone", "D5–D25 of cycle", "Does NOT inhibit ovulation; 3–6 cycles"],
["LNG-IUS", "Intrauterine system", "50% effective; use when oestrogen contraindicated"],
],
col_widths=[4.5*cm, 3*cm, 8.5*cm]
),
sp(3),
info_box("CI to PSI:", "Allergy to aspirin | Gastric ulceration | History of asthma", ORANGE_PALE, ORANGE),
sp(3),
make_table(
["Surgical Option", "Notes"],
[
["TENS", "Results NOT better than analgesics"],
["LUNA (Laparoscopic Uterine Nerve Ablation)", "NOT found beneficial for primary dysmenorrhea"],
["LPSN (Presacral Neurectomy)", "Cuts sensory pathways via T₁₁–T₁₂. NOT helpful for adnexal pain (T₉–T₁₀)"],
["Cervical dilatation", "Under anaesthesia; late sequela = cervical incompetence. Not commonly done"],
],
col_widths=[5.5*cm, 10.5*cm]
),
sp(4),
]
story += [
h1("2. SECONDARY DYSMENORRHEA (CONGESTIVE)"),
sp(4),
exam_box("DEFINITION:", "Menstrual pain occurring in the PRESENCE OF PELVIC PATHOLOGY. Appears 3–5 days BEFORE menses; relieves with onset of bleeding. NO systemic discomfort. Patients usually in their 30s, parous."),
sp(4),
make_table(
["Category", "Causes"],
[
["Uterine", "Endometriosis · Adenomyosis · Fibroid · IUCD in utero · Müllerian anomaly obstruction · Cervical stenosis"],
["Adnexal/Peritoneal", "Pelvic adhesions · Pelvic congestion · Endometrial polyp"],
["Unilateral causes", "Ovarian dysmenorrhea · Bicornuate uterus · Unilateral pelvic endometriosis · Right ovarian vein syndrome · Colonic/cecal spasm"],
],
col_widths=[3.5*cm, 12.5*cm]
),
sp(3),
h3("Special Conditions"),
sp(2),
make_table(
["Condition", "Key Points"],
[
["Ovarian Dysmenorrhea", "Right ovarian vein crosses ureter at right angle → premenstrual engorgement → pressure on ureter → pyelonephritis → pain. UNILATERAL. Pain referred T₁₀–L₁. Dx: pelvic venography/Doppler. Rx: MPA 50 mg × 4 months"],
["Mittelschmerz's (Ovular pain)", "MIDMENSTRUAL pain — indirect evidence of ovulation. Hypogastrium/iliac fossa (side of ovulating ovary). Lasts <12 hrs. ± vaginal bleeding/mucoid discharge. Rx: assurance; obstinate → OCP"],
["Pelvic Congestion Syndrome", "Disturbance in autonomic NS → pelvic varicosities. Congestive dysmenorrhea WITHOUT demonstrable pathology. Vague pelvic discomfort + backache with standing ± dyspareunia. Uterus bulky/boggy. Rx: MPA 50 mg × 4 months"],
],
col_widths=[4.2*cm, 11.8*cm]
),
sp(3),
make_table(
["Investigation", "Use"],
[
["Transvaginal sonography", "Detects most pelvic pathology (leiomyoma, adenomyosis)"],
["Saline infusion sonography", "Submucous fibroid, polyps"],
["Laparoscopy", "Endometriosis — BOTH diagnostic and therapeutic"],
["Hysteroscopy", "Both diagnostic and therapeutic"],
],
col_widths=[5.5*cm, 10.5*cm]
),
sp(4),
]
story.append(PageBreak())
# ── PAGE 2: PMS & AUB ──────────────────────────────────────────────────────────
story += [
h1("3. PREMENSTRUAL SYNDROME (PMS / PMDD)"),
sp(4),
exam_box("DEFINITION (ACOG — ALL 4 must be fulfilled):", "1. No organic lesion | 2. Occurs REGULARLY in LUTEAL PHASE (last 7–10 days) | 3. Severe enough to disturb lifestyle / require medical help | 4. SYMPTOM-FREE during rest of cycle. When symptoms disrupt daily functioning → PMDD (Premenstrual Dysphoric Disorder)"),
sp(4),
make_table(
["Pathophysiology Hypothesis", "Details"],
[
["Oestrogen:Progesterone Ratio", "Altered ratio from midluteal phase → ↓ progesterone level. Common in women aged 30–45"],
["↓ Serotonin (KEY)", "Decreased serotonin synthesis in luteal phase → explains WHY SSRIs work"],
["Endorphin Withdrawal", "PMS symptoms due to withdrawal of endorphins from CNS in luteal phase"],
["↓ GABA", "GABA suppresses anxiety level in brain; GABA agonists are effective"],
["Others (inconclusive)", "TRH, prolactin, renin, aldosterone, prostaglandins — mentioned but nothing conclusive"],
],
col_widths=[4.5*cm, 11.5*cm]
),
sp(4),
h2("SYMPTOMATOLOGY (Table 14.4)"),
sp(2),
make_table(
["Category", "Symptoms"],
[
["Water retention", "Abdominal bloating · Breast tenderness · Swelling of extremities · Weight gain"],
["Neuropsychiatric", "Irritability · Tearfulness · Depression · Anxiety · Mood swings · Tension · Forgetfulness · Confusion · Restlessness · Headache · ↑ Appetite · Anger"],
["Behavioral", "Fatigue · Tiredness · Dyspareunia · Insomnia"],
],
col_widths=[3.5*cm, 12.5*cm]
),
sp(3),
info_box("DIAGNOSTIC TOOL:", "Patient's SYMPTOM DIARY documented over 2–3 cycles (Table 14.4) — most useful diagnostic tool for PMS", TEAL_PALE, TEAL),
sp(4),
h2("TREATMENT (Table 14.5)"),
sp(2),
make_table(
["Drug/Measure", "Dose", "Notes"],
[
["Non-pharmacological", "—", "Lifestyle modification · Yoga · Stress management · ↓ salt, caffeine, alcohol in 2nd half of cycle"],
["Pyridoxine (Vit B6)", "100 mg daily", "Corrects tryptophan metabolism; helpful for 'pill'-associated depression"],
["Alprazolam (anxiolytic)", "0.25 mg BID", "Given in LUTEAL PHASE only"],
["FLUOXETINE (SSRI) ★DOC★", "20 mg/day", "DOC. Inhibits neuronal uptake of serotonin. Give ≥2 days BEFORE symptom onset; continue till menstruation starts"],
["Sertraline (SSRI)", "50 mg/day", "Alternative SSRI"],
["Venlafaxine (SNRI)", "—", "Effective alternative"],
["Frusemide (diuretic)", "2nd half × 5 days", "Reduces fluid retention"],
["OCP (combined, drospirenone)", "3–6 cycles", "Suppress ovulation. Newer OCPs with drospirenone = BEST symptom control; antimineralocorticoid + antiandrogenic"],
["Spironolactone", "25–200 mg/day (luteal)", "Potassium sparing. Anti-mineralocorticoid + anti-androgenic. Improves PMDD"],
["Danazol", "200 mg/day", "Suppresses ovarian cycle; produces amenorrhoea. Advise barrier contraception"],
["GnRH Analogue", "Goserelin 3.6 mg SC q4wk\nLeuprorelin 3.75 mg SC/IM q4wk\nTriptorelin 3 mg IM q4wk", "Results are DRAMATIC. Medical oophorectomy. Add oestrogen+progestin 'add-back' to combat hypoestrogenic symptoms"],
["Bromocriptine", "2.5 mg od/bd", "At least relieves breast complaints"],
["Hysterectomy + B/L oophorectomy", "—", "LAST RESORT in established cases approaching menopause"],
],
col_widths=[3.8*cm, 3.2*cm, 9*cm]
),
sp(4),
exam_box("KEY EXAM POINTS — PMS:", "Progesterone = NOT effective | GnRH agonist = DRAMATIC results | Women with PMDD = NO deficit in cognitive function in luteal phase | Exact etiology = UNKNOWN | Altered oestrogen:progesterone ratio → reduced serotonin/GABA/endorphins in CNS"),
sp(4),
]
story += [
h1("4. ABNORMAL UTERINE BLEEDING (AUB)"),
sp(4),
exam_box("DEFINITION:", "Any uterine bleeding outside NORMAL volume, duration, regularity or frequency. ~30% of all gynecological outpatient attendants are for AUB."),
sp(4),
info_box("NORMAL MENSTRUATION:", "Cycle interval: 28 days (21–35 days) | Menstrual flow: 4–5 days | Menstrual blood loss: 35 mL (20–80 mL)", BLUE_PALE, BLUE),
sp(4),
h2("PATTERNS OF AUB — DEFINITIONS & CAUSES"),
sp(2),
make_table(
["Term", "Definition", "Key Causes"],
[
["Menorrhagia\n(Hypermenorrhea)", "Cyclic bleeding; >80 mL OR >7 days or BOTH. 'Menotaxis' = prolonged bleeding", "DUB · Fibroids · Adenomyosis · IUCD · ITP · Von Willebrand's · Hypothyroidism"],
["Polymenorrhea\n(Epimenorrhea)", "Cyclic bleeding; intervals <21 days (constant). With excessive/prolonged = epimenorrhagia", "DUB (adolescence, pre-menopause, post-delivery) · PID · Ovarian endometriosis"],
["Metrorrhagia", "Irregular, acyclic bleeding; amount variable. Menometrorrhagia = so irregular menses cannot be identified", "Surface uterine lesion. MALIGNANCY MUST BE EXCLUDED"],
["Oligomenorrhea", "Intervals >35 days; constant at that frequency", "PCOS (MOST COMMON) · Obesity · Hyperprolactinemia · Hyperthyroidism · Androgen-producing tumours · TB endometritis · Drugs (Phenothiazines, Cimetidine, Methyldopa)"],
["Hypomenorrhea", "Scanty bleeding lasting <2 days", "Uterine synechiae · Endometrial TB · OCPs · Thyroid dysfunction · Malnutrition"],
],
col_widths=[3.2*cm, 5.3*cm, 7.5*cm]
),
sp(4),
h2("MENORRHAGIA — CAUSES (Tables 15.1 & 15.2)"),
sp(2),
make_table(
["Category", "Causes"],
[
["Pelvic organic", "Fibroid uterus · Adenomyosis · Pelvic endometriosis · IUCD in utero · Chronic tubo-ovarian mass · TB endometritis (early) · Retroverted uterus (congestion) · Granulosa cell tumour · Endometrial polyp"],
["Systemic organic", "Liver dysfunction (cirrhosis — fails to inactivate oestrogens) · Congestive cardiac failure · Severe hypertension"],
["Endocrinal", "Hypothyroidism · Hyperthyroidism"],
["Haematological", "ITP · Leukaemia · Von Willebrand's disease · Platelet deficiency (thrombocytopenia)"],
["Functional (DUB)", "Disturbed HPO-endometrial axis · Emotional upset"],
],
col_widths=[3.5*cm, 12.5*cm]
),
sp(4),
make_table(
["Contact Bleeding (Table 15.3)", "Acyclic Bleeding (Table 15.4)", "Intermenstrual Bleeding (Table 15.5)"],
[
["Carcinoma cervix\nMucous polyp of cervix\nVascular ectopy of cervix\nChlamydial/TB cervicitis\nCervical endometriosis",
"DUB (adolescence/post-delivery/pre-menopause)\nSubmucous fibroid\nUterine polyp\nCarcinoma cervix/endometrium",
"Urethral caruncle\nOvular bleeding\nBreakthrough bleeding (pill)\nIUCD in utero\nDecubitus ulcer"]
],
col_widths=[5.3*cm, 5.3*cm, 5.4*cm]
),
sp(4),
exam_box("HIGH YIELD:", "Menorrhagia > 80 mL or > 7 days | Polymenorrhea < 21 days | Oligomenorrhea > 35 days | Hypomenorrhea < 2 days | Most common cause oligomenorrhea = PCOS | Metrorrhagia → always exclude MALIGNANCY | Normal blood loss = 20–80 mL | AUB = 30% of gynae OPD"),
sp(4),
]
story += [
h1("RAPID REVISION — HIGH YIELD MCQ POINTS"),
sp(4),
make_table(
["Topic", "Key Fact"],
[
["Primary dysmenorrhea incidence", "15–20%"],
["Confined to", "OVULATORY cycles only (primary dysmenorrhea)"],
["Relieved after", "Pregnancy and vaginal delivery"],
["Most important mechanism", "JZ (Junctional Zone) dysperistalsis and hyperactivity"],
["Biochemical mediators", "PGF2α, Endothelin, PAFs, Leukotrienes, Vasopressin"],
["Drug of first choice (primary dysmenorrhea)", "PSI/NSAIDs (Mefenamic acid, Ibuprofen)"],
["Drug of choice when contraception needed", "Combined OCP"],
["Surgical option (primary dysmenorrhea)", "LPSN (NOT LUNA — not beneficial)"],
["Ovarian dysmenorrhea referred pain", "T₁₀ to L₁ segments"],
["Right ovarian vein syndrome", "Engorgement → ureter compression → pyelonephritis → pain"],
["Mittelschmerz = indirect evidence of", "Ovulation (occurs at MIDMENSTRUAL period)"],
["PMS occurs in", "LUTEAL PHASE (last 7–10 days of cycle)"],
["Most useful PMS diagnostic tool", "Patient's symptom DIARY"],
["PMS drug of choice", "FLUOXETINE (SSRI) 20 mg/day"],
["GnRH agonist in PMS", "Results are DRAMATIC"],
["Progesterone in PMS", "NOT EFFECTIVE"],
["Women with PMDD", "NO deficit in cognitive function in luteal phase"],
["PMS exact etiology", "UNKNOWN"],
["Normal menstrual blood loss", "20–80 mL (average 35 mL)"],
["Menorrhagia cut-off", ">80 mL or >7 days"],
["Polymenorrhea cut-off", "<21 day intervals"],
["Oligomenorrhea cut-off", ">35 day intervals"],
["Most common cause of oligomenorrhea", "PCOS"],
["Metrorrhagia — must always exclude", "MALIGNANCY"],
["AUB — % of gynae OPD", "~30%"],
["Combined OCP reduces", "Severity of dysmenorrhea (DOC when contraception needed)"],
["LNG-IUS efficacy in dysmenorrhea", "~50%"],
],
col_widths=[7*cm, 9*cm],
header_bg=NAVY
),
sp(6),
Paragraph("Source: DC Dutta's Textbook of Gynecology, Chapter 14 (Dysmenorrhea & Other Disorders of Menstrual Cycles) & Chapter 15 (Abnormal Uterine Bleeding)", FOOTER_S),
]
# ── Build PDF ─────────────────────────────────────────────────────────────────
output_path = "/home/daytona/workspace/puberty-notes/Cheatsheet_Dysmenorrhea_PMS_AUB.pdf"
doc = SimpleDocTemplate(
output_path,
pagesize=A4,
leftMargin=1.5*cm,
rightMargin=1.5*cm,
topMargin=2.2*cm,
bottomMargin=1.5*cm,
)
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF created: {output_path}")
cd /home/daytona/workspace/puberty-notes && python3 cheatsheet.py 2>&1
ls -lh /home/daytona/workspace/puberty-notes/Cheatsheet_Dysmenorrhea_PMS_AUB.pdf
Cheatsheet Dysmenorrhea PMS AUB
PDF Document · PDF
Make a visual comparison poster: Primary vs Secondary Dysmenorrhea
A clean, professional medical comparison poster titled "Primary vs Secondary Dysmenorrhea" split into two vertical columns. Left column has a blue header "PRIMARY DYSMENORRHEA (Spasmodic)" and right column has a red/burgundy header "SECONDARY DYSMENORRHEA (Congestive)". Each column contains clearly labeled sections with icons or small illustrations: LEFT COLUMN (blue theme): - Definition: "No identifiable pelvic pathology" - Age: "Adolescents (within 2 yrs of menarche)" - Cycle: "Ovulatory cycles ONLY" - Pain onset: "At start of menses or few hours before" - Pain type: "Spasmodic, lower abdomen, colicky" - Duration: "Few hours, max 24-48 hrs" - Systemic symptoms: "Nausea, vomiting, diarrhea, headache, fainting" - Between periods: "PAIN FREE" - Examination: "Normal - no pelvic pathology" - Key cause diagram: "PGF2α → JZ dysperistalsis → Ischaemia → PAIN" - Treatment: "NSAIDs (1st line), OCP, LNG-IUS" - Relieved by: "Pregnancy & vaginal delivery" RIGHT COLUMN (red/burgundy theme): - Definition: "Associated with pelvic pathology" - Age: "30s, parous women" - Cycle: "Any age, any cycle" - Pain onset: "3-5 days BEFORE menses" - Pain type: "Dull, back + front, no radiation" - Duration: "Persistent, may persist between periods" - Systemic symptoms: "Usually ABSENT" - Between periods: "May have discomfort" - Examination: "REVEALS pathology" - Common causes: "Endometriosis, Adenomyosis, Fibroids, IUCD, Cervical stenosis" - Treatment: "Treat underlying cause, Laparoscopy, Hysteroscopy" - Special types: "Ovarian dysmenorrhea, Mittelschmerz, Pelvic congestion" Center divider has a bold "VS" symbol. Bottom has a yellow highlighted box "KEY DIFFERENTIATOR: Primary = starts AT menses, pain-free between | Secondary = starts BEFORE menses, may persist between periods". Clean white background, medical textbook style, color-coded with blue and red themes, organized grid layout with clear typography.

Can't able to download the cheat sheet pdf
ls /home/daytona/workspace/puberty-notes/ && python3 /home/daytona/workspace/puberty-notes/cheatsheet.py 2>&1
ls -lh /home/daytona/workspace/puberty-notes/Cheatsheet_Dysmenorrhea_PMS_AUB.pdf && python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/puberty-notes/Cheatsheet_Dysmenorrhea_PMS_AUB.pdf') print(f'Pages: {len(r.pages)}') print('PDF is valid and readable.') "
Cheatsheet Dysmenorrhea PMS AUB
PDF Document · PDF
Convert cheat sheet to Word document (DOCX) for easy viewing