Make notes, compile the notes together.
cd /home/daytona/workspace/attachments/b499874a-8708-4aec-96f6-dcf6bc767856 && python3 -c " import pdfplumber for fname in ['Moduli I pdf.pdf', 'Moduli II pdf.pdf']: print(f'\n\n========== {fname} ==========\n') with pdfplumber.open(fname) as pdf: for i, page in enumerate(pdf.pages): text = page.extract_text() if text: print(f'--- Page {i+1} ---') print(text) " 2>/dev/null
cd /home/daytona/workspace/attachments/b499874a-8708-4aec-96f6-dcf6bc767856 && pandoc "precancerous deseases of the cervix handout new.docx" -o /tmp/cervix_notes.md 2>/dev/null && cat /tmp/cervix_notes.md
ls /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/cervix-notes
~/cervix-notes/build_notes.js
const {
Document, Packer, Paragraph, TextRun, HeadingLevel,
AlignmentType, LevelFormat, BorderStyle, WidthType,
Table, TableRow, TableCell, VerticalAlign, PageBreak
} = require('docx');
const fs = require('fs');
// ─── Numbering config ────────────────────────────────────────────────────────
const numberingConfig = {
config: [
{
reference: "bullets",
levels: [
{
level: 0, format: LevelFormat.BULLET, text: "•",
alignment: AlignmentType.LEFT,
style: {
paragraph: { indent: { left: 720, hanging: 360 } },
run: { font: "Arial" }
}
},
{
level: 1, format: LevelFormat.BULLET, text: "◦",
alignment: AlignmentType.LEFT,
style: {
paragraph: { indent: { left: 1080, hanging: 360 } },
run: { font: "Arial" }
}
}
]
}
]
};
// ─── Helper functions ─────────────────────────────────────────────────────────
function h1(text) {
return new Paragraph({ heading: HeadingLevel.HEADING_1, children: [new TextRun({ text, bold: true, font: "Arial", size: 32 })] });
}
function h2(text) {
return new Paragraph({ heading: HeadingLevel.HEADING_2, children: [new TextRun({ text, bold: true, font: "Arial", size: 28 })] });
}
function h3(text) {
return new Paragraph({ heading: HeadingLevel.HEADING_3, children: [new TextRun({ text, bold: true, font: "Arial", size: 26 })] });
}
function para(text) {
return new Paragraph({ children: [new TextRun({ text, font: "Arial", size: 24 })] });
}
function bullet(text, lvl = 0) {
return new Paragraph({
numbering: { reference: "bullets", level: lvl },
children: [new TextRun({ text, font: "Arial", size: 24 })]
});
}
function boldPara(text) {
return new Paragraph({ children: [new TextRun({ text, bold: true, font: "Arial", size: 24 })] });
}
function emptyLine() {
return new Paragraph({ children: [new TextRun("")] });
}
function pageBreak() {
return new Paragraph({ children: [new PageBreak()] });
}
// ─── Document content ─────────────────────────────────────────────────────────
const children = [
// ── TITLE PAGE ──────────────────────────────────────────────────────────────
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: "CERVICAL & VULVAR DISEASES", bold: true, font: "Arial", size: 48 })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: "Compiled Study Notes", font: "Arial", size: 32, color: "555555" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: "Modules I & II | Precancerous Diseases of the Cervix", font: "Arial", size: 24, italics: true, color: "777777" })]
}),
emptyLine(),
pageBreak(),
// ════════════════════════════════════════════════════════════════════════════
// MODULE I – BENIGN DISEASES OF THE CERVIX
// ════════════════════════════════════════════════════════════════════════════
h1("MODULE I: BENIGN DISEASES OF THE CERVIX"),
emptyLine(),
// ─── Overview ───────────────────────────────────────────────────────────────
h2("Overview"),
para("Background processes of the vaginal portion of the cervix are benign diseases that can contribute to the development and progression of cervical cancer. These are sometimes called \"pre-cancer\" conditions."),
emptyLine(),
boldPara("Conditions covered:"),
bullet("Cervical Erosion (Erosio Vera)"),
bullet("Ectopy (Ectopia)"),
bullet("Ectropion"),
bullet("Cervical Polyp"),
bullet("Leukoplakia / Erythroplakia"),
bullet("Papilloma"),
emptyLine(),
// ─── Diagnostic Methods ─────────────────────────────────────────────────────
h2("Diagnostic Methods"),
h3("1. Cytological (PAP Smear)"),
para("The cytological method is highly effective. Combined with morphological examination, it allows accurate diagnosis in 95–98% of cases."),
emptyLine(),
h3("2. Colposcopy"),
para("Endoscopic binocular examination of the cervix, vagina, and vulva at 10–30× magnification. Differentiates benign from malignant changes and guides targeted biopsy."),
bullet("Standard (overview) colposcopy"),
bullet("Extended colposcopy – uses 3% acetic acid and Lugol's solution (Schiller's test); also coloured (green/yellow) filters"),
bullet("Colpomicroscopy – 150× magnification; vital in-vivo histological examination; used when cytology and colposcopy results conflict"),
bullet("Fluorescent colpocervicoscopy – UV histochemical examination; normal mucosa = dark purple/violet; early cancer = light yellow; advanced cancer = no fluorescence"),
emptyLine(),
h3("3. Schiller's Test"),
para("In a healthy woman of reproductive age the squamous epithelium contains high glycogen and stains dark brown with Lugol's solution uniformly. Areas with defective squamous epithelium (erosion, columnar replacement, cancer) do NOT stain → appear as white spots on a brown background."),
emptyLine(),
h3("4. Biopsy"),
bullet("Targeted biopsy – performed on pathologically altered area"),
bullet("Cone biopsy – for extensive damage or difficult biopsy site selection"),
bullet("Curettage of cervical canal mucosa – usually precedes cone biopsy"),
para("Targeted biopsy + cervical curettage significantly reduces the need for the more traumatic cone biopsy."),
emptyLine(),
h3("5. Histomorphology"),
para("Morphological examination of biopsy material. Mandatory for elder women to rule out cervical cancer."),
emptyLine(),
// ─── True Cervical Erosion ──────────────────────────────────────────────────
h2("True Cervical Erosion (Erosio Vera)"),
bullet("Defect in the epithelium covering the vaginal portion of the cervix"),
bullet("More common in older women"),
bullet("Causes: inflammation, rough examination → desquamation/shedding of squamous epithelium"),
bullet("Shape: irregular, rounded; colour: bright red; contact/touch bleeding present"),
bullet("Base: swollen connective tissue, numerous subepithelial blood vessels, leukocyte infiltration"),
bullet("Usually self-heals within ~10 days by total epithelialisation"),
bullet("If covered by columnar epithelium → pseudo-erosion (ectopy)"),
emptyLine(),
boldPara("Diagnosis:"),
bullet("Colposcopy, cytology, biopsy morphology (in older women to exclude cancer)"),
emptyLine(),
boldPara("Treatment:"),
para("Treat the underlying/coincidental (inflammatory) disease that caused the erosion."),
emptyLine(),
// ─── Ectopy ─────────────────────────────────────────────────────────────────
h2("Ectopy (Ectopia) of the Cervix"),
para("Most common background pathological condition of the ectocervix. Area on the vaginal portion covered by endocervical columnar epithelium. Occurs in ~10–15% of cases, predominantly in young women."),
emptyLine(),
boldPara("Types:"),
bullet("Congenital – columnar epithelium located from the outer cervix toward the uterine cavity; may be seen in newborns"),
bullet("Post-traumatic (Ectropion) – cervical lacerations during delivery or abortion → cervical canal mucosa everts"),
bullet("Hormone-induced – during puberty, glandular epithelial growth outpaces connective tissue → columnar epithelium moves to ectocervix"),
emptyLine(),
boldPara("Histomorphological types:"),
bullet("Glandular ectopy – gland formation on ectocervix"),
bullet("Papillary ectopy – simultaneous stroma + epithelium growth in papillary structure"),
bullet("Epidermised ectopy – islands of multi-layered squamous epithelium within the columnar epithelium"),
emptyLine(),
boldPara("Diagnosis:"),
bullet("Cytology: proliferating cylindrical/cuboidal epithelium; small/large vacuoles; frequent inflammation"),
bullet("Colposcopy: bright red papillary clusters enhanced by acetic acid; pseudo-erosion does NOT stain with Lugol's solution"),
emptyLine(),
// ─── Cervical Polyp ─────────────────────────────────────────────────────────
h2("Cervical Polyp"),
bullet("2–4 mm protrusion of cervical canal mucosa"),
bullet("Cause: hormonal or inflammatory changes"),
bullet("Usually single; occasionally multiple"),
bullet("Shape: rounded/tongue-like, lobular structure, smooth surface"),
bullet("Colour: pink (columnar epithelium – vascular translucence visible) OR whitish (squamous epithelium)"),
emptyLine(),
boldPara("Symptoms:"),
bullet("White/mucoid discharge"),
bullet("Contact/postcoital bleeding"),
bullet("Recurrence after polypectomy → suspect malignancy"),
emptyLine(),
boldPara("Treatment:"),
para("Surgical – polypectomy."),
emptyLine(),
// ─── Leukoplakia ────────────────────────────────────────────────────────────
h2("Cervical Leukoplakia"),
para("Localised hyperkeratosis (hyper- or parakeratosis) of the cervical stratified squamous epithelium. Appears white/pearly. May extend to vaginal fornices."),
bullet("Common at age ~40"),
bullet("Generally asymptomatic"),
emptyLine(),
boldPara("Colposcopy findings:"),
bullet("Cornified plaque; rough, wrinkled, flaky surface"),
emptyLine(),
boldPara("Cytology:"),
bullet("Squamous epithelium cells without nuclei"),
emptyLine(),
boldPara("Histological classification:"),
bullet("Simple leukoplakia – dyskeratosis, thickening of basal/parabasal layers, slight cellular polymorphism; BENIGN"),
bullet("Leukoplakia with cellular atypia – may co-exist with intraepithelial carcinoma → MALIGNANT risk"),
emptyLine(),
boldPara("Macroscopic appearance (malignant features):"),
bullet("Nodular"),
bullet("Adherent to underlying tissue"),
bullet("Arises from surface; may ulcerate"),
emptyLine(),
boldPara("Complications:"),
bullet("Intraepithelial carcinoma"),
bullet("Cervical invasive cancer"),
emptyLine(),
// ─── Erythroplakia ──────────────────────────────────────────────────────────
h2("Cervical Erythroplakia"),
para("A form of dyskeratosis. Thinning of superficial and intermediate layers of cervical squamous epithelium with hyperplasia of basal and parabasal layers."),
bullet("Macroscopy: light red/bluish, irregular patches; bleeds easily"),
bullet("Histology: significant epithelial thinning, keratinised superficial cells, vascular engorgement, lymphatic infiltration"),
bullet("Colposcopy: thinned stratified epithelium, red areas with cornification, underlying tissue and vessels visible"),
emptyLine(),
// ─── Papilloma ──────────────────────────────────────────────────────────────
h2("Cervical Papilloma"),
para("Relatively rare cervical lesion, located on the vaginal portion of the cervix."),
bullet("Appearance: papillary rosette-shaped protrusions; may resemble exophytic cancer"),
bullet("Colour: rose or white; sharply distinct from surrounding tissue"),
bullet("Colposcopy: tree-like branching vessels; Lugol's application → brown margins visible (suggests malignancy)"),
emptyLine(),
// ─── Treatment ──────────────────────────────────────────────────────────────
h2("Treatment of Benign Cervical Diseases"),
bullet("Electrical coagulation (electrosurgery)"),
bullet("Laser removal"),
bullet("Cryotherapy"),
bullet("Ultrasound therapy"),
emptyLine(),
pageBreak(),
// ════════════════════════════════════════════════════════════════════════════
// MODULE II – HPV, DYSPLASIA, CERVICAL CANCER, VULVAR CONDITIONS
// ════════════════════════════════════════════════════════════════════════════
h1("MODULE II: HPV, DYSPLASIA, CERVICAL CANCER & VULVAR CONDITIONS"),
emptyLine(),
// ─── HPV ────────────────────────────────────────────────────────────────────
h2("Human Papillomavirus (HPV)"),
para("Double-stranded DNA virus. The most widely spread sexually transmitted infection. Damages epithelial cells; involved in ~40% of genital tract lesions."),
emptyLine(),
boldPara("Key facts:"),
bullet("Mostly asymptomatic"),
bullet("60–70% undergo spontaneous regression"),
bullet("Carcinogenic: associated with cervical dysplasia and cervical cancer (HPV found in >90% of cases)"),
emptyLine(),
boldPara("Transmission:"),
bullet("Sexual intercourse"),
bullet("Vertical transmission (mother to fetus during delivery)"),
emptyLine(),
h3("HPV Types"),
bullet("High-risk types: 16, 18, 31, 33, 35, 45, 58 → anogenital cancers, cervical cancer", 0),
bullet("Low-risk types: 6, 11 → genital condylomas, recurrent respiratory papillomatosis", 0),
para("Over 100 types known in total."),
emptyLine(),
h3("HPV-Associated Diseases"),
bullet("Simple warts (skin)"),
bullet("Genital condylomas"),
bullet("Recurrent respiratory papillomatosis"),
bullet("Cervical, vulvar, vaginal, anal, penile cancers"),
emptyLine(),
h3("Diagnosis"),
bullet("Inspection of lesions"),
bullet("Cytology (PAP smear)"),
bullet("Histology"),
bullet("Serology"),
bullet("Colposcopy"),
bullet("PCR – gold standard for HPV detection"),
bullet("HPV testing: for women with suspicious PAP results; screening for women >30 years in combination with PAP smear"),
emptyLine(),
h3("Treatment"),
para("Treatment is aimed at the lesion, NOT at eliminating the virus itself."),
emptyLine(),
boldPara("Conservative:"),
bullet("Local tissue removal"),
bullet("Immunostimulatory agents: interferon, podofix (podophyllin)"),
emptyLine(),
boldPara("Surgical:"),
bullet("Laser ablation"),
bullet("Cryotherapy"),
bullet("Electrocauterisation"),
bullet("Excision"),
emptyLine(),
// ─── Dysplasia ──────────────────────────────────────────────────────────────
h2("Cervical Dysplasia (CIN)"),
para("Atypical changes in the superficial cells of the cervix. A precancerous condition. Most common in women aged 25–35."),
emptyLine(),
boldPara("Cause:"),
para("Human papillomavirus (HPV)."),
emptyLine(),
boldPara("Risk factors:"),
bullet("Onset of sexual activity before 18 years"),
bullet("First delivery before age 16"),
bullet("High number of sexual partners"),
bullet("Immunosuppression / comorbidities"),
bullet("Smoking"),
emptyLine(),
boldPara("Clinical presentation:"),
para("Mostly asymptomatic."),
emptyLine(),
h3("Grading of Dysplasia"),
emptyLine(),
boldPara("Morphological (CIN classification):"),
bullet("CIN I (Mild) – damage to lower 1/3 of squamous epithelium"),
bullet("CIN II (Moderate) – middle third of epithelium damaged"),
bullet("CIN III (Severe) – upper third of epithelium damaged"),
bullet("Carcinoma In Situ (CIS) – full thickness of epithelium involved"),
emptyLine(),
boldPara("Cytological (PAP smear / SIL classification):"),
bullet("Low-grade SIL (LSIL) – corresponds to CIN I"),
bullet("High-grade SIL (HSIL) – corresponds to CIN II–III"),
bullet("Probably cancerous"),
emptyLine(),
h3("Diagnosis"),
bullet("PAP smear (cytology) – primary screening tool"),
bullet("Colposcopy"),
bullet("Targeted biopsy"),
bullet("Cone biopsy"),
bullet("Histomorphology of biopsy material"),
bullet("Diagnostic curettage of cervical canal"),
emptyLine(),
h3("Treatment"),
bullet("CIN I (Mild LSIL) – often self-resolving; monitor with PAP smear every 3–6 months"),
bullet("CIN II–III (Moderate–Severe) – require active treatment:"),
bullet("Cryotherapy", 1),
bullet("Laser therapy", 1),
bullet("LEEP (Loop Electrosurgical Excision Procedure)", 1),
bullet("Cone biopsy", 1),
bullet("Hysterectomy – for severe cases", 1),
emptyLine(),
boldPara("Key fact:"),
para("Without treatment, cervical dysplasia often progresses to invasive cancer within approximately 10 years."),
emptyLine(),
boldPara("Follow-up:"),
para("Women treated for dysplasia should have follow-up examinations every 3–6 months. With early diagnosis and timely treatment, recurrence is rare."),
emptyLine(),
h3("Prevention – HPV Vaccination"),
bullet("Bivalent and quadrivalent vaccines available"),
bullet("100% efficacy against HPV types 16 and 18"),
bullet("Reduces risk of cervical cancer by 70% when given before sexual activity begins"),
bullet("Recommended age: 9–26 years; ideally before sexual debut"),
emptyLine(),
// ─── Cervical Cancer ────────────────────────────────────────────────────────
h2("Cervical Cancer"),
para("One of the most frequent malignancies of the female genital tract. Develops from surface cells of the cervix, mainly at the transformation zone (squamocolumnar junction / SCJ)."),
emptyLine(),
boldPara("Carcinogenic agent:"),
para("HPV (Human Papillomavirus)."),
emptyLine(),
h3("Risk Factors"),
bullet("Early onset of sexual activity"),
bullet("High number of sexual partners"),
bullet("Partner with high number of sexual partners"),
bullet("STIs: HPV, HIV, HSV"),
bullet("Combined oral contraceptives (COC)"),
bullet("Smoking"),
bullet("Low socioeconomic status"),
emptyLine(),
h3("Symptoms"),
bullet("Early stages: often asymptomatic (detected on PAP screening)"),
bullet("Postcoital / abnormal vaginal bleeding"),
bullet("Pathological vaginal discharge"),
bullet("Pelvic / lower abdominal pain"),
bullet("Unilateral swelling of lower extremities (lymphatic obstruction)"),
bullet("Heavy vaginal bleeding (advanced)"),
emptyLine(),
h3("Diagnostic Methods"),
bullet("PAP smear"),
bullet("Colposcopy"),
bullet("Targeted biopsy + histomorphology"),
emptyLine(),
h3("Staging – FIGO 1994"),
bullet("Stage 0 – Carcinoma in situ (CIS); intraepithelial; non-invasive"),
bullet("Stage I – Confined to cervix only (does not spread to uterine body)"),
bullet("IA – Microscopically invasive only; max depth 5 mm, max width 7 mm", 1),
bullet("IA1 – Invasion depth ≤3 mm, width ≤7 mm", 1),
bullet("IA2 – Invasion depth 3–5 mm, width ≤7 mm", 1),
bullet("IB – Clinically visible lesion confined to cervix, beyond IA", 1),
bullet("IB1 – Lesion ≤4 cm", 1),
bullet("IB2 – Lesion >4 cm", 1),
bullet("Stage II – Extends beyond cervix; does NOT reach pelvic wall; involves upper vagina"),
bullet("IIA – No parametrium involvement", 1),
bullet("IIB – Parametrium involvement present", 1),
bullet("Stage III – Extends to pelvic wall OR lower 1/3 of vagina; often causes hydronephrosis / renal failure"),
bullet("IIIA – Lower 1/3 of vagina involved; pelvic wall free", 1),
bullet("IIIB – Pelvic wall involved; hydronephrosis / renal failure", 1),
bullet("Stage IV – Beyond true pelvis; bladder or rectal mucosa involved"),
bullet("IVA – Spreads to adjacent organs", 1),
bullet("IVB – Spreads to distant organs", 1),
emptyLine(),
h3("Metastatic Routes"),
bullet("Internal iliac lymph nodes"),
bullet("External iliac lymph nodes"),
bullet("Lumbar lymph nodes"),
bullet("Paraaortic lymph nodes"),
emptyLine(),
h3("Treatment by Stage"),
bullet("Stage IA1 – Cone biopsy OR simple hysterectomy (post-conisation)"),
bullet("Stage IA2 – Type II (modified radical) hysterectomy"),
bullet("Stage IB1, IB2, IIA – Type III (radical) hysterectomy + chemoradiation"),
emptyLine(),
// ─── Dysplastic Diseases of Lower Genital Tract ─────────────────────────────
h2("Dysplastic Diseases & Tumours of the Lower Genital Tract"),
h3("CIN – Cervical Intraepithelial Neoplasia"),
para("(Covered in detail under Cervical Dysplasia section above.)"),
emptyLine(),
h3("VAIN – Vaginal Intraepithelial Neoplasia / Vaginal Cancer"),
bullet("Mostly metastatic; 1–2% of gynaecological tumours"),
bullet("Clinical: bleeding and pathological discharge"),
bullet("Treatment: radiotherapy"),
emptyLine(),
h3("VIN – Vulvar Intraepithelial Neoplasia / Vulvar Cancer"),
bullet("Mostly primary; ~5% of gynaecological tumours"),
bullet("Clinical: itching and bleeding"),
bullet("Treatment: surgical – radical vulvectomy"),
emptyLine(),
h3("AIN – Anal/Perianal Intraepithelial Neoplasia / Anal Cancer"),
bullet("Diagnosis: rectal examination, rectoscopy, biopsy"),
bullet("Treatment: local excision; laser or cryoablation"),
emptyLine(),
// ─── Vulvar Leukoplakia & Kraurosis ─────────────────────────────────────────
h2("Vulvar Leukoplakia and Kraurosis"),
para("Precancerous diseases predominantly affecting women aged 60–70. Characterised by prolonged progressive development."),
emptyLine(),
boldPara("Pathological changes:"),
bullet("Vulvar sclerosis"),
bullet("Fibrosis and hyalinisation"),
bullet("Disturbance in blood flow"),
bullet("Changes in nervous elements"),
emptyLine(),
h3("Etiology"),
bullet("Disorder of trophic function"),
bullet("Adrenal gland dysfunction"),
bullet("Ovarian dysfunction"),
bullet("Thyroid gland dysfunction"),
bullet("Metabolic dysfunction"),
emptyLine(),
h3("Vulvar Leukoplakia"),
boldPara("Types:"),
bullet("Simple leukoplakia – thin membranous plaques easily removed with a swab"),
bullet("Proliferative leukoplakia – rough, raised patches; whitish/grayish/whitish-grayish plaques"),
emptyLine(),
boldPara("Distribution:"),
bullet("Clitoris, inner surfaces of labia minora and majora"),
bullet("Can be surrounded/localised OR diffuse"),
bullet("Risk of malignant transformation"),
emptyLine(),
boldPara("Morphology:"),
bullet("Acanthosis, hyperkeratosis, dyskeratosis"),
bullet("Connective tissue changes: dystrophy, atrophy, fibrosis, sclerosis"),
bullet("Secondary epithelial tissue changes"),
emptyLine(),
h3("Vulvar Kraurosis"),
bullet("Atrophy of external genital organs"),
bullet("Sclerosis of vulvar tissue"),
bullet("Vaginal constriction"),
bullet("Dryness of mucous membrane"),
bullet("Intense itching"),
bullet("Local pigmentation changes"),
bullet("Psycho-emotional disorders"),
emptyLine(),
h3("Diagnosis"),
bullet("Colposcopy"),
bullet("Cytology"),
bullet("Histology / Biopsy"),
emptyLine(),
boldPara("Differential diagnosis:"),
bullet("Vitiligo"),
bullet("Neurodermatitis"),
bullet("Lichen planus"),
emptyLine(),
h3("Treatment of Leukoplakia and Kraurosis"),
bullet("Pharmacological therapy (medications)"),
bullet("Hormonal therapy"),
bullet("Cryotherapy"),
bullet("Anaesthetic block (Novocain block)"),
bullet("Laser therapy"),
bullet("Vulvectomy – in severe/resistant cases"),
emptyLine(),
pageBreak(),
// ════════════════════════════════════════════════════════════════════════════
// QUICK-REFERENCE SUMMARY TABLE
// ════════════════════════════════════════════════════════════════════════════
h1("QUICK REFERENCE SUMMARY"),
emptyLine(),
para("A condensed comparison of the main cervical conditions covered in this module."),
emptyLine(),
new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({
tableHeader: true,
children: [
new TableCell({ width: { size: 2000, type: WidthType.DXA }, shading: { fill: "2E5A9C" },
children: [new Paragraph({ children: [new TextRun({ text: "Condition", bold: true, color: "FFFFFF", font: "Arial", size: 22 })] })] }),
new TableCell({ width: { size: 2000, type: WidthType.DXA }, shading: { fill: "2E5A9C" },
children: [new Paragraph({ children: [new TextRun({ text: "Key Features", bold: true, color: "FFFFFF", font: "Arial", size: 22 })] })] }),
new TableCell({ width: { size: 2000, type: WidthType.DXA }, shading: { fill: "2E5A9C" },
children: [new Paragraph({ children: [new TextRun({ text: "Diagnosis", bold: true, color: "FFFFFF", font: "Arial", size: 22 })] })] }),
new TableCell({ width: { size: 3000, type: WidthType.DXA }, shading: { fill: "2E5A9C" },
children: [new Paragraph({ children: [new TextRun({ text: "Treatment", bold: true, color: "FFFFFF", font: "Arial", size: 22 })] })] }),
]
}),
// row helper
...[
["True Erosion", "Epithelial defect; bright red; contact bleeding; older women", "Colposcopy, cytology, biopsy", "Treat underlying cause (inflammation)"],
["Ectopy", "Columnar epithelium on ectocervix; young women; congenital/post-traumatic/hormonal", "Cytology, colposcopy, histology", "Surveillance; treat if symptomatic"],
["Polyp", "2–4 mm protrusion; mucoid/contact bleeding; recurrence → malignancy risk", "Clinical, colposcopy", "Polypectomy"],
["Leukoplakia", "White plaque; hyperkeratosis; age ~40; can be benign or atypical", "Colposcopy, cytology, biopsy", "Surgical (laser/cryo/electro)"],
["Erythroplakia", "Red/bluish thin patch; bleeds easily; visible vessels", "Colposcopy, biopsy", "Surgical"],
["Papilloma", "Rosette papillary growth; branch-like vessels; rare", "Colposcopy, biopsy", "Surgical excision"],
["CIN I (Mild)", "Lower 1/3 epithelium; LSIL; HPV-related; age 25–35", "PAP, colposcopy, biopsy", "Observation ± LEEP"],
["CIN II–III (Mod–Sev)", "Middle–full thickness; HSIL/CIS; progression in 10 yrs if untreated", "PAP, colposcopy, cone biopsy", "LEEP/cone biopsy/hysterectomy"],
["Cervical Cancer", "SCJ-origin; HPV causative; postcoital bleeding; stage I–IV (FIGO)", "PAP, colposcopy, biopsy", "Surgery ± chemoradiation by stage"],
].map(([cond, feat, diag, treat]) =>
new TableRow({
children: [
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: cond, bold: true, font: "Arial", size: 20 })] })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: feat, font: "Arial", size: 20 })] })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: diag, font: "Arial", size: 20 })] })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: treat, font: "Arial", size: 20 })] })] }),
]
})
)
]
}),
emptyLine(),
emptyLine(),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: "— End of Compiled Notes —", italics: true, color: "888888", font: "Arial", size: 22 })]
}),
];
// ─── Build document ───────────────────────────────────────────────────────────
const doc = new Document({
numbering: numberingConfig,
styles: {
default: {
document: { run: { font: "Arial", size: 24 } }
},
paragraphStyles: [
{
id: "Heading1", name: "Heading 1", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 36, bold: true, font: "Arial", color: "1F3864" },
paragraph: { spacing: { before: 400, after: 200 }, outlineLevel: 0 }
},
{
id: "Heading2", name: "Heading 2", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 28, bold: true, font: "Arial", color: "2E5A9C" },
paragraph: { spacing: { before: 300, after: 120 }, outlineLevel: 1 }
},
{
id: "Heading3", name: "Heading 3", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 24, bold: true, font: "Arial", color: "2E5A9C" },
paragraph: { spacing: { before: 200, after: 80 }, outlineLevel: 2 }
},
]
},
sections: [{
properties: {
page: {
size: { width: 11906, height: 16838 },
margin: { top: 1440, right: 1080, bottom: 1440, left: 1080 }
}
},
children
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/cervix-notes/Cervical_Vulvar_Diseases_Notes.docx', buffer);
console.log('SUCCESS: File written.');
}).catch(err => {
console.error('ERROR:', err);
process.exit(1);
});
cd /home/daytona/workspace/cervix-notes && node build_notes.js
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/cervix-notes/Cervical_Vulvar_Diseases_Notes.docx
# Quick sanity check – verify the DOCX is a valid ZIP with proper structure python3 -c " import zipfile, os path = '/home/daytona/workspace/cervix-notes/Cervical_Vulvar_Diseases_Notes.docx' size = os.path.getsize(path) print(f'File size: {size} bytes') with zipfile.ZipFile(path) as z: names = z.namelist() print('Contents:', names[:10]) "
Cervical Vulvar Diseases Notes
Word Document · DOCX