Act as a MRCOG1 mentor, MRCOG mentor, and make beautiful notes from this TOG article on the topic of amniotic fluid index. It's the latest TOG article. Make a lot of flowcharts, lots of bullet points, tables to make it comprehensive, elaborate, and easily explainable to the MRCOG students. Give it to me in a Word document format.U CAN ALOS USE FLOW CHARTS DIRECTLY FROM THE ARTCILE ITSELF WITHOUT EDITING ANY PART OF IT
cd /home/daytona/workspace/attachments/874b50f1-71a5-42f2-aea3-ab6b54c9b12c && python3 -c " from pypdf import PdfReader reader = PdfReader('TOG 2026 AFI.pdf') print(f'Total pages: {len(reader.pages)}') for i, page in enumerate(reader.pages): print(f'--- PAGE {i+1} ---') print(page.extract_text()) print() " 2>&1
cd /home/daytona/workspace/attachments/874b50f1-71a5-42f2-aea3-ab6b54c9b12c && python3 -c " import pdfplumber import os os.makedirs('/home/daytona/workspace/afi-notes/images', exist_ok=True) with pdfplumber.open('TOG 2026 AFI.pdf') as pdf: for i, page in enumerate(pdf.pages): images = page.images print(f'Page {i+1}: {len(images)} images') for j, img in enumerate(images): print(f' Image {j}: {img}') " 2>&1
/home/daytona/skills/docx
ls /home/daytona/skills/docx/scripts/ && ls /home/daytona/workspace/ 2>&1
WHAT?
PLS CONTINUE
CONTINUE PLS
mkdir -p /home/daytona/workspace/afi-notes && cat > /home/daytona/workspace/afi-notes/create_afi_notes.js << 'JSEOF' const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType, VerticalAlign, PageBreak, TableOfContents, Header, Footer, PageNumber, NumberFormat } = require('docx'); const fs = require('fs'); // ─── COLOUR PALETTE ─────────────────────────────────────────────────────────── const NAVY = "1B3A6B"; // dark navy - headings const TEAL = "0E7490"; // teal - section headers const MINT = "D1FAE5"; // mint fill - key boxes const AMBER = "FEF3C7"; // amber fill - warnings const RED = "FEE2E2"; // red fill - critical const BLUE = "DBEAFE"; // blue fill - tables header const WHITE = "FFFFFF"; const LTGRAY = "F8FAFC"; const PURPLE = "7C3AED"; const ORANGE = "D97706"; // ─── HELPERS ────────────────────────────────────────────────────────────────── const bold = (txt, sz=22, color="000000") => new TextRun({ text: txt, bold: true, size: sz, color }); const norm = (txt, sz=20, color="000000") => new TextRun({ text: txt, bold: false, size: sz, color }); const ital = (txt, sz=20, color="000000") => new TextRun({ text: txt, bold: false, size: sz, color, italics: true }); const h1 = (txt) => new Paragraph({ children: [new TextRun({ text: txt, bold: true, size: 32, color: WHITE, font: "Calibri" })], heading: HeadingLevel.HEADING_1, alignment: AlignmentType.CENTER, shading: { type: ShadingType.SOLID, fill: NAVY }, spacing: { before: 200, after: 200 }, indent: { left: 100, right: 100 } }); const h2 = (txt) => new Paragraph({ children: [new TextRun({ text: txt, bold: true, size: 26, color: WHITE, font: "Calibri" })], heading: HeadingLevel.HEADING_2, shading: { type: ShadingType.SOLID, fill: TEAL }, spacing: { before: 240, after: 120 }, indent: { left: 80 } }); const h3 = (txt) => new Paragraph({ children: [new TextRun({ text: "▶ " + txt, bold: true, size: 23, color: NAVY, font: "Calibri" })], heading: HeadingLevel.HEADING_3, spacing: { before: 180, after: 80 } }); const h4 = (txt) => new Paragraph({ children: [new TextRun({ text: "◆ " + txt, bold: true, size: 21, color: TEAL })], spacing: { before: 140, after: 60 } }); const bullet = (txt, lvl=0, color="000000") => new Paragraph({ children: [norm(txt, 20, color)], bullet: { level: lvl }, spacing: { before: 40, after: 40 } }); const subbullet = (txt) => bullet(txt, 1, "374151"); const kv = (key, val) => new Paragraph({ children: [bold(key + ": ", 20, NAVY), norm(val, 20)], bullet: { level: 0 }, spacing: { before: 40, after: 40 } }); const blankLine = () => new Paragraph({ children: [norm("")], spacing: { before: 60, after: 60 } }); const boxPara = (txt, fillColor, textColor="000000", bold_=true) => new Paragraph({ children: [new TextRun({ text: txt, bold: bold_, size: 20, color: textColor })], shading: { type: ShadingType.SOLID, fill: fillColor }, spacing: { before: 80, after: 80 }, indent: { left: 200, right: 200 }, alignment: AlignmentType.CENTER, border: { top: { style: BorderStyle.SINGLE, size: 6, color: TEAL }, bottom: { style: BorderStyle.SINGLE, size: 6, color: TEAL }, left: { style: BorderStyle.SINGLE, size: 6, color: TEAL }, right: { style: BorderStyle.SINGLE, size: 6, color: TEAL }, } }); const centred = (txt, sz=20, color="000000", b=false) => new Paragraph({ children: [new TextRun({ text: txt, size: sz, color, bold: b })], alignment: AlignmentType.CENTER, spacing: { before: 40, after: 40 } }); const pageBreak = () => new Paragraph({ children: [new PageBreak()] }); // ─── TABLE HELPER ───────────────────────────────────────────────────────────── function makeTable(headers, rows, colWidths, headerFill=NAVY) { const headerRow = new TableRow({ tableHeader: true, children: headers.map((h, i) => new TableCell({ children: [new Paragraph({ children: [bold(h, 19, WHITE)], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, fill: headerFill }, verticalAlign: VerticalAlign.CENTER, width: { size: colWidths[i], type: WidthType.DXA } })) }); const dataRows = rows.map((row, ri) => new TableRow({ children: row.map((cell, ci) => new TableCell({ children: [new Paragraph({ children: [norm(cell, 19)], alignment: AlignmentType.LEFT, spacing: { before: 40, after: 40 } })], shading: { type: ShadingType.SOLID, fill: ri % 2 === 0 ? WHITE : LTGRAY }, verticalAlign: VerticalAlign.CENTER, width: { size: colWidths[ci], type: WidthType.DXA } })) })); return new Table({ rows: [headerRow, ...dataRows], width: { size: 9000, type: WidthType.DXA }, margins: { top: 60, bottom: 60, left: 100, right: 100 } }); } // ─── FLOWCHART TABLE HELPER ─────────────────────────────────────────────────── // Simulates a flowchart using coloured table cells + arrows function flowBox(txt, fill=TEAL, textColor=WHITE, w=6000) { return new Table({ rows: [new TableRow({ children: [ new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: txt, bold: true, size: 20, color: textColor })], alignment: AlignmentType.CENTER, spacing: { before: 80, after: 80 } })], shading: { type: ShadingType.SOLID, fill }, verticalAlign: VerticalAlign.CENTER, width: { size: w, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 140, right: 140 }, borders: { top: { style: BorderStyle.THICK, size: 8, color: NAVY }, bottom: { style: BorderStyle.THICK, size: 8, color: NAVY }, left: { style: BorderStyle.THICK, size: 8, color: NAVY }, right: { style: BorderStyle.THICK, size: 8, color: NAVY }, } }) ]})], alignment: AlignmentType.CENTER }); } function arrow() { return centred("↓", 28, TEAL, true); } function diamond(txt) { return new Table({ rows: [new TableRow({ children: [ new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "◇ " + txt, bold: true, size: 20, color: WHITE })], alignment: AlignmentType.CENTER, spacing: { before: 80, after: 80 } })], shading: { type: ShadingType.SOLID, fill: ORANGE }, verticalAlign: VerticalAlign.CENTER, width: { size: 6000, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 140, right: 140 }, borders: { top: { style: BorderStyle.THICK, size: 8, color: ORANGE }, bottom: { style: BorderStyle.THICK, size: 8, color: ORANGE }, left: { style: BorderStyle.THICK, size: 8, color: ORANGE }, right: { style: BorderStyle.THICK, size: 8, color: ORANGE }, } }) ]})], alignment: AlignmentType.CENTER }); } // Two-column branch row function branchRow(leftTxt, rightTxt, leftFill=MINT, rightFill=RED) { return new Table({ rows: [new TableRow({ children: [ new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: leftTxt, bold: true, size: 18, color: NAVY })], alignment: AlignmentType.CENTER, spacing: { before: 60, after: 60 } })], shading: { type: ShadingType.SOLID, fill: leftFill }, width: { size: 4200, type: WidthType.DXA }, margins: { top: 60, bottom: 60, left: 100, right: 100 } }), new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: rightTxt, bold: true, size: 18, color: NAVY })], alignment: AlignmentType.CENTER, spacing: { before: 60, after: 60 } })], shading: { type: ShadingType.SOLID, fill: rightFill }, width: { size: 4200, type: WidthType.DXA }, margins: { top: 60, bottom: 60, left: 100, right: 100 } }) ]})], alignment: AlignmentType.CENTER, width: { size: 8400, type: WidthType.DXA } }); } // ─── DOCUMENT SECTIONS ──────────────────────────────────────────────────────── // COVER PAGE const cover = [ blankLine(), blankLine(), blankLine(), new Paragraph({ children: [new TextRun({ text: "MRCOG PART 1 & 2", bold: true, size: 36, color: TEAL, font: "Calibri" })], alignment: AlignmentType.CENTER, spacing: { before: 100, after: 100 } }), new Paragraph({ children: [new TextRun({ text: "COMPREHENSIVE STUDY NOTES", bold: true, size: 48, color: NAVY, font: "Calibri" })], alignment: AlignmentType.CENTER, spacing: { before: 60, after: 60 } }), blankLine(), new Paragraph({ children: [new TextRun({ text: "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", size: 28, color: TEAL })], alignment: AlignmentType.CENTER }), blankLine(), new Paragraph({ children: [new TextRun({ text: "AMNIOTIC FLUID INDEX &", bold: true, size: 44, color: NAVY, font: "Calibri" })], alignment: AlignmentType.CENTER, spacing: { before: 80, after: 80 } }), new Paragraph({ children: [new TextRun({ text: "ABNORMAL AMNIOTIC FLUID VOLUME", bold: true, size: 44, color: NAVY, font: "Calibri" })], alignment: AlignmentType.CENTER, spacing: { before: 80, after: 80 } }), new Paragraph({ children: [new TextRun({ text: "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━", size: 28, color: TEAL })], alignment: AlignmentType.CENTER }), blankLine(), blankLine(), new Paragraph({ children: [new TextRun({ text: "Based on TOG Article (2026)", bold: true, size: 24, color: "555555" })], alignment: AlignmentType.CENTER }), new Paragraph({ children: [new TextRun({ text: "Falola AO, Filby L, Timmons P, Alleemudder D.", size: 22, color: "666666", italics: true })], alignment: AlignmentType.CENTER, spacing: { before: 40, after: 40 } }), new Paragraph({ children: [new TextRun({ text: "The Obstetrician & Gynaecologist 2026;28:41–50", size: 22, color: "666666", italics: true })], alignment: AlignmentType.CENTER, spacing: { before: 40, after: 40 } }), blankLine(), blankLine(), new Paragraph({ children: [new TextRun({ text: "Management of Isolated Abnormal Amniotic Fluid Volume in Pregnancy", bold: true, size: 24, color: TEAL, italics: true })], alignment: AlignmentType.CENTER }), blankLine(), blankLine(), blankLine(), pageBreak() ]; // SECTION 1: INTRODUCTION & PHYSIOLOGY const sec1 = [ h1("SECTION 1: AMNIOTIC FLUID - PHYSIOLOGY & MEASUREMENT"), blankLine(), h2("1.1 What is Amniotic Fluid?"), bullet("Amniotic fluid (AF) is produced by the FETUS and comprises:"), subbullet("Fetal URINE (predominant source from mid-gestation onwards)"), subbullet("Fetal LUNG FLUID"), bullet("Maintenance of AFV is ALSO controlled by placental transfer of water and solutes"), bullet("AFV exists in a state of FLUX - constantly produced and removed"), blankLine(), h3("Functions of Amniotic Fluid - MNEMONIC: 'BUMPS'"), boxPara("B - Bacteriostatic properties | U - Uterine growth (fetal movement → musculoskeletal development)\nM - Mechanical protection from trauma | P - Prevents cord compression | S - Swallowing (fetal lung maturation)", BLUE, NAVY, true), blankLine(), h3("Regulation of AFV"), makeTable( ["Process", "Direction", "Clinical Significance"], [ ["Fetal urination", "↑ AFV (produces fluid)", "Reduced in renal agenesis/dysplasia → oligohydramnios"], ["Fetal swallowing", "↓ AFV (removes fluid)", "Impaired in GI obstruction → polyhydramnios"], ["Fetal lung fluid production", "↑ AFV", "Reduced in pulmonary hypoplasia"], ["Placental water transfer", "Bidirectional regulation", "Affected in placental insufficiency"], ["Membrane resorption (intramembranous pathway)", "↓ AFV", "Abnormal in PPROM"], ], [2500, 2200, 4300], NAVY ), blankLine(), h3("Important Relationship: AFV and Gestational Age"), bullet("AFV CORRELATES with gestational age and fetal size - critical context for interpretation"), bullet("Peak AFV occurs around 32-34 weeks gestation then gradually declines"), bullet("Post-dates pregnancies → physiologically decreasing AFV"), blankLine(), h2("1.2 Measurement of Amniotic Fluid Volume"), blankLine(), h3("Gold Standard vs Clinical Methods"), makeTable( ["Method", "Description", "Limitation", "Use"], [ ["Dye Dilution Test", "Indicator dilution technique - most accurate", "Requires amniocentesis (INVASIVE)", "Research only - NOT clinical use"], ["Amniotic Fluid Index (AFI)", "Sum of largest vertical pocket in each of 4 uterine quadrants (cm)", "Overdiagnoses oligohydramnios; no improvement in outcomes", "Clinical - preferred for polyhydramnios confirmation"], ["Single Deepest Vertical Pocket (SDVP)", "Measurement of largest single vertical pocket (cm)\nAlso called: MVP, SDP, DVP", "May underdiagnose some conditions", "PREFERRED method (Cochrane 2008, SAFE Trial 2015)"], ], [2000, 3500, 2500, 1500], NAVY ), blankLine(), boxPara("⭐ KEY EXAM POINT: SDVP is the PREFERRED method for AFV assessment (Cochrane 2008 + SAFE Trial 2015)\nAFI increases DIAGNOSIS of oligohydramnios WITHOUT improving outcomes\nFor polyhydramnios CONFIRMATION and severity grading → use AFI", AMBER, NAVY), blankLine(), h3("The SAFE Trial (2015) - Key Study"), bullet("Multicentre, open-label RCT"), bullet("Conclusion: AFI method increased rates of diagnosis of oligohydramnios without improving perinatal outcome"), bullet("Supported the 2008 Cochrane Review findings"), bullet("SDVP recommended as the standard measurement"), blankLine(), h3("How to Measure AFI - Four-Quadrant Technique"), flowBox("STEP 1: Position patient supine, divide uterus into 4 quadrants\n(using umbilicus as horizontal divider, linea nigra as vertical divider)", "1B3A6B"), arrow(), flowBox("STEP 2: Transducer held perpendicular to floor\nMeasure LARGEST vertical pocket in EACH quadrant (no umbilical cord)", TEAL), arrow(), flowBox("STEP 3: Sum the 4 measurements = AFI (cm)\n[Normal range: 5–24 cm]", "1B3A6B"), blankLine(), blankLine(), pageBreak() ]; // SECTION 2: POLYHYDRAMNIOS const sec2 = [ h1("SECTION 2: POLYHYDRAMNIOS (HYDRAMNIOS)"), blankLine(), h2("2.1 Definition & Severity Classification"), bullet("Polyhydramnios = increased AFV"), bullet("SDVP > 8 cm OR AFI ≥ 24 cm"), blankLine(), makeTable( ["Severity", "SDVP (cm)", "AFI (cm)", "Most Common Cause"], [ ["Mild", "≥8 to <12", "≥24.0 to <30", "Idiopathic (majority)"], ["Moderate", "≥12 to <16", "≥30.0 to <35", "Idiopathic / Early fetal pathology"], ["Severe", "≥16", "≥35.0", "Fetal structural/chromosomal abnormality (>30% cases)"], ], [2000, 2500, 2500, 2000], NAVY ), blankLine(), boxPara("🔴 Fetal abnormalities account for >30% of SEVERE polyhydramnios cases\n🟡 Severe / early-onset polyhydramnios = POOR PROGNOSIS → genetic anomalies more likely\n🟢 Mild-to-moderate = 80% of all polyhydramnios cases; 90% of cases at term", AMBER, NAVY), blankLine(), h3("Epidemiology"), bullet("Polyhydramnios complicates 1-2% of pregnancies"), bullet("UK prevalence of ISOLATED polyhydramnios: up to 2% of pregnancies"), bullet("Most common cause overall: IDIOPATHIC (60-70% of all cases)"), bullet("Most cases identified in THIRD TRIMESTER"), blankLine(), h2("2.2 Aetiology of Polyhydramnios"), blankLine(), h3("Pathophysiology Summary - Why does AFV increase?"), flowBox("NORMAL: Fetal swallowing ↔ Fetal urination (balanced)", TEAL), arrow(), branchRow( "↑ Fluid PRODUCTION\n(e.g. high-output cardiac failure,\nrenal pathology with ↑ urine output,\ne.g. Bartter syndrome)", "↓ Fluid REMOVAL\n(e.g. GI obstruction → can't swallow,\nneuromuscular → reduced swallowing,\nairway obstruction)", BLUE, RED ), arrow(), flowBox("→ POLYHYDRAMNIOS ←", "1B3A6B"), blankLine(), blankLine(), h3("Maternal Causes"), makeTable( ["Cause", "Associated Findings / Clue"], [ ["Diabetes mellitus", "Macrosomia, ↑ fetal AC, maternal hyperglycaemia, glycosuria"], ["High sugar diet / Obesity", "Macrosomia"], ["Maternal uraemia (osmotic diuresis)", "Maternal renal failure, high serum urea"], ["Alloimmunisation", "Fetal hydrops (MCA Doppler ↑)"], ], [4000, 5000], TEAL ), blankLine(), h3("Fetal Causes - Organised by Mechanism"), makeTable( ["Mechanism", "Specific Causes"], [ ["Fetal infection (TORCH)", "Toxoplasma, Rubella, CMV, HSV, Parvovirus B19"], ["Chromosomal abnormality", "Numerous (trisomies, microdeletions)"], ["Neuromuscular → ↓ swallowing", "Intracranial anomaly (anencephaly), Dandy-Walker, Fetal akinesia sequence, Myotonic dystrophy"], ["GI obstruction → ↓ swallowing", "Oesophageal/duodenal atresia, TOF, Diaphragmatic hernia, Micrognathia, Cleft lip/palate, Facial/neck tumour compression"], ["Decreased lung fluid outflow", "CPAM, CHAOS, Skeletal dysplasia (narrow thorax)"], ["High output cardiac failure", "AV shunting, Tachyarrhythmia, Sacrococcygeal teratoma"], ["Renal (unusual - ↑ urine output)", "PUJ obstruction, Mesoblastic nephroma, BARTTER SYNDROME"], ["Hydrops fetalis / Fetal anaemia", "Immune & non-immune, Parvovirus B19"], ["Placental tumour", "Chorioangioma"], ["Multiple gestations", "TTTS (recipient twin)"], ], [3200, 5800], TEAL ), blankLine(), boxPara("⭐ MRCOG FAVOURITE: Oesophageal/duodenal atresia → polyhydramnios (absent/small stomach bubble on USS)\nTOF → polyhydramnios (stomach may be visible if fistula present)\nAnencephaly → most common fetal cause in some series\nBartter Syndrome → autosomal recessive, most common GENOMIC abnormality in isolated polyhydramnios (21%)", BLUE, NAVY), blankLine(), h2("2.3 Investigation of Polyhydramnios"), blankLine(), h3("Flowchart 1 (from TOG Article): Investigating Polyhydramnios"), blankLine(), flowBox("POLYHYDRAMNIOS DETECTED\nSDVP ≥ 8 cm OR AFI ≥ 25 cm", "1B3A6B"), arrow(), new Table({ rows: [new TableRow({ children: [ new TableCell({ children: [ new Paragraph({ children: [bold("1. HISTORY", 19, NAVY)], spacing: { before: 60, after: 40 } }), new Paragraph({ children: [norm("• Travel history", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Family history", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Exposure to infection/disease", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Detailed medical history", 18)], spacing: { before: 20, after: 40 } }), ], shading: { type: ShadingType.SOLID, fill: MINT }, width: { size: 2200, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), new TableCell({ children: [ new Paragraph({ children: [bold("2. EXAMINATION", 19, NAVY)], spacing: { before: 60, after: 40 } }), new Paragraph({ children: [norm("• Weight assessment", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Skin rashes", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Signs of severe polyhydramnios", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Urine assessment", 18)], spacing: { before: 20, after: 40 } }), ], shading: { type: ShadingType.SOLID, fill: BLUE }, width: { size: 2200, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), new TableCell({ children: [ new Paragraph({ children: [bold("3. BLOOD TESTS", 19, NAVY)], spacing: { before: 60, after: 40 } }), new Paragraph({ children: [norm("• OGTT or 1 week BSL to rule out DM", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• TORCH screen", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Renal function (if uraemia suspected)", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Rhesus status + antibody screen", 18)], spacing: { before: 20, after: 40 } }), ], shading: { type: ShadingType.SOLID, fill: AMBER }, width: { size: 2200, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), new TableCell({ children: [ new Paragraph({ children: [bold("4. ULTRASOUND", 19, NAVY)], spacing: { before: 60, after: 40 } }), new Paragraph({ children: [norm("• Detailed anomaly scan", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Fetal biometry / growth", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• MCA Doppler if hydrops/anaemia suspected", 18)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Exclude fetal anomalies", 18)], spacing: { before: 20, after: 40 } }), ], shading: { type: ShadingType.SOLID, fill: RED }, width: { size: 2200, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), ]})], width: { size: 8800, type: WidthType.DXA }, alignment: AlignmentType.CENTER }), arrow(), branchRow( "✅ ALL NORMAL\n(normal anatomy, no infection,\nno maternal DM, no hydrops)\n\n→ IDIOPATHIC POLYHYDRAMNIOS", "🔴 ABNORMAL FINDINGS\n\nPositive infection / FGR / SGA /\nsevere polyhydramnios / fetal cause\n→ REFER FETAL MEDICINE\n(consider genetic testing)", MINT, RED ), blankLine(), centred("If MATERNAL cause (DM, uraemia) → refer to MATERNAL MEDICINE SERVICES", 20, ORANGE, true), blankLine(), blankLine(), h2("2.4 Management of Isolated / Idiopathic Polyhydramnios"), blankLine(), boxPara("ISOLATED (IDIOPATHIC) POLYHYDRAMNIOS = diagnosis of EXCLUSION\nAccounts for 60-70% of all polyhydramnios | Most common in 3rd trimester", MINT, NAVY), blankLine(), h3("Overview of Management Options"), makeTable( ["Option", "When Used", "Evidence / Notes"], [ ["Conservative management (watchful waiting)", "Mild polyhydramnios", "No evidence of benefit from intervention. ACOG: no change in management for mild isolated"], ["Increased surveillance\n(serial biometry, CTG)", "All severities", "RCOG Green-top: regular biometry scans. NICE: continuous CTG in labour for all severities"], ["Amnioreduction", "Severe maternal discomfort, dyspnoea, severe polyhydramnios only", "High chance of reaccumulation. Risks: chorioamnionitis, placental abruption, preterm birth. Allows amniotic fluid for genetic testing"], ["Indomethacin (historical)", "No longer used", "Formerly used to delay reaccumulation. ABANDONED due to neonatal morbidity"], ["Induction of labour", "Moderate: offer from 40 weeks. Severe: before 40 weeks (individualised)", "Mild IOL: little to no evidence of benefit. Moderate/severe: rising evidence of benefit but no clear threshold"], ], [2200, 2800, 4000], TEAL ), blankLine(), h3("Flowchart 2: Management by Severity of Isolated Polyhydramnios"), flowBox("ISOLATED POLYHYDRAMNIOS CONFIRMED\n(after exclusion of maternal/fetal causes)", "1B3A6B"), arrow(), new Table({ rows: [new TableRow({ children: [ new TableCell({ children: [ new Paragraph({ children: [bold("MILD", 22, WHITE)], alignment: AlignmentType.CENTER, spacing: { before: 60 } }), new Paragraph({ children: [norm("AFI 24–30 / SDVP 8–12 cm", 18, WHITE)], alignment: AlignmentType.CENTER, spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Regular biometry scans", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Continuous CTG in labour (NICE)", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• No change in management (ACOG)", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Await spontaneous labour", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• 1% risk of neonatal genomic abnormality", 18, WHITE)], spacing: { before: 20, after: 60 } }), ], shading: { type: ShadingType.SOLID, fill: "22C55E" }, width: { size: 2800, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), new TableCell({ children: [ new Paragraph({ children: [bold("MODERATE", 22, WHITE)], alignment: AlignmentType.CENTER, spacing: { before: 60 } }), new Paragraph({ children: [norm("AFI 30–35 / SDVP 12–16 cm", 18, WHITE)], alignment: AlignmentType.CENTER, spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Weekly surveillance (ACOG)", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Regular biometry scans", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• IOL may be OFFERED from 40 weeks", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm(" (after risks/benefits discussion)", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• 2% risk of neonatal genomic abnormality", 18, WHITE)], spacing: { before: 20, after: 60 } }), ], shading: { type: ShadingType.SOLID, fill: ORANGE }, width: { size: 2800, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), new TableCell({ children: [ new Paragraph({ children: [bold("SEVERE", 22, WHITE)], alignment: AlignmentType.CENTER, spacing: { before: 60 } }), new Paragraph({ children: [norm("AFI ≥35 / SDVP ≥16 cm", 18, WHITE)], alignment: AlignmentType.CENTER, spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Weekly surveillance", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• IOL BEFORE 40 weeks - individualised", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Consider amnioreduction if dyspnoea", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• Genetic testing if not done", 18, WHITE)], spacing: { before: 20, after: 20 } }), new Paragraph({ children: [norm("• 10% risk of neonatal genomic abnormality", 18, WHITE)], spacing: { before: 20, after: 60 } }), ], shading: { type: ShadingType.SOLID, fill: "DC2626" }, width: { size: 2800, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), ]})], width: { size: 8400, type: WidthType.DXA }, alignment: AlignmentType.CENTER }), blankLine(), blankLine(), h2("2.5 Maternal & Fetal Complications of Polyhydramnios"), makeTable( ["MATERNAL Complications", "FETAL / NEONATAL Complications"], [ ["Increased induction of labour", "Macrosomia"], ["Prolonged first stage of labour", "Transient tachypnoea of the newborn"], ["Increased assisted vaginal delivery rate", "Genomic anomalies (1-10% depending on severity)"], ["Postpartum haemorrhage (uterine overdistension)", "Fetal distress / HIE"], ["Placental abruption", "Shoulder dystocia (often linked to macrosomia)"], ["Malpresentation", "Lower APGAR scores at 1 and 5 minutes"], ["Increased emergency Caesarean section rate", "NICU admission"], ["Failed TOLAC", "Hypoglycaemia (if diabetic cause)"], ["Pre-term birth", "Cord prolapse"], ["PPROM", "Cephalopelvic disproportion"], ["Stillbirth", "Perinatal mortality"], ], [4500, 4500], TEAL ), blankLine(), h2("2.6 Postnatal Management"), bullet("Important: some cases of APPARENT isolated polyhydramnios reveal an underlying FETAL cause postnatally"), blankLine(), h3("Neonatal Screening: Nasogastric Tube Passage"), bullet("Some units advocate ROUTINE NGT passage after birth in all polyhydramnios cases to exclude oesophageal atresia/fistula"), bullet("Evidence does NOT support routine NGT unless high index of suspicion:"), subbullet("Persistent severe/worsening polyhydramnios"), subbullet("Inability to visualise fetal stomach on USS"), bullet("No national consensus - large multicentre trials needed"), blankLine(), h3("Genomic Risk Stratification (Tsakmaki et al. meta-analysis 2024)"), makeTable( ["Severity of Isolated Polyhydramnios", "Risk of Neonatal Genomic Abnormality"], [ ["Mild", "~1%"], ["Moderate", "~2%"], ["Severe", "~10%"], ["Overall rate in isolated polyhydramnios (diagnosed antenatally)", "4.5%"], ], [5500, 3500], TEAL ), blankLine(), boxPara("⭐ Most common genomic abnormality in isolated polyhydramnios = BARTTER SYNDROME (21% of genomic cases)\nBartter syndrome: Autosomal recessive | Polyuria → polyhydramnios\nNeonatal: hypokalaemia, hyperchloraemic metabolic alkalosis, hyperaldosteronism, polyuria - can be FATAL", RED, NAVY), blankLine(), bullet("UK population risk: chromosomal abnormalities = 23.1 per 10,000 births (2019 data)"), bullet("No current national consensus on childhood follow-up screening after isolated polyhydramnios"), bullet("Further risk stratification needed to identify most at-risk neonates for follow-up"), blankLine(), pageBreak() ]; // SECTION 3: OLIGOHYDRAMNIOS const sec3 = [ h1("SECTION 3: OLIGOHYDRAMNIOS & ANHYDRAMNIOS"), blankLine(), h2("3.1 Definitions"), makeTable( ["Condition", "AFI", "SDVP", "Notes"], [ ["Normal", "5-24 cm", "2-8 cm", "Normal range"], ["Oligohydramnios", "≤ 5 cm", "< 2 cm", "Reduction in AFV below normal limits"], ["Anhydramnios", "Absent", "Absent", "Complete absence of amniotic fluid"], ["Borderline", "5-8 cm", ">2 cm", "Some units monitor conservatively"], ], [2500, 2000, 2000, 2500], NAVY ), blankLine(), boxPara("OLIGOHYDRAMNIOS = AFI ≤ 5 cm AND/OR SDVP < 2 cm\nAnhydramnios = complete absence of amniotic fluid\nUK prevalence of ISOLATED oligohydramnios: 0.5-5% of pregnancies", AMBER, NAVY), blankLine(), h2("3.2 Aetiology of Oligohydramnios"), blankLine(), h3("Pathophysiology - Why does AFV decrease?"), flowBox("NORMAL: Fetal urination ↔ balanced amniotic fluid dynamics", TEAL), arrow(), branchRow( "↓ Fluid PRODUCTION\n(e.g. renal agenesis, renal dysplasia,\nposterior urethral valves,\nplacental insufficiency → ↓ renal\nperfusion → ↓ urine output)", "↑ Fluid LOSS\n(e.g. rupture of membranes\n→ fluid leaks out of amniotic\ncavity)", BLUE, RED ), arrow(), flowBox("→ OLIGOHYDRAMNIOS ←", "1B3A6B"), blankLine(), blankLine(), h3("Maternal Causes"), makeTable( ["Category", "Specific Cause", "Mechanism"], [ ["Placental disorders", "Pregnancy-induced hypertension, essential HTN, pre-eclampsia, nephropathy, cocaine abuse", "Placental insufficiency → ↓ fetal renal perfusion → ↓ urine output"], ["Disruptions to maternal fluid state", "Anorexia nervosa, hyperemesis gravidarum, maternal dehydration", "Reduced maternal circulating volume → ↓ placental perfusion"], ], [2000, 3500, 3500], TEAL ), blankLine(), h3("Fetal & Other Causes"), makeTable( ["Category", "Specific Causes"], [ ["Fetal infection (TORCH)", "Toxoplasma, Rubella, CMV, HSV"], ["Medications", "ACE inhibitors, ARBs, Indomethacin, NSAIDs"], ["Chromosomal abnormalities", "Numerous"], ["Fetal structural / Renal outflow obstruction", "Bilateral renal agenesis, PUJ obstruction, bilateral MCDK, ARPCKD, Posterior urethral valves, Prune-Belly syndrome, LUTO"], ["Fetal anaemia", "Various causes"], ["Placental insufficiency", "FGR (most important association)"], ["Post-dates", "Extreme post-maturity"], ["Multiple gestations", "TTTS (donor twin)"], ["Rupture of membranes", "PPROM, PROM (most common acute cause)"], ], [3500, 5500], TEAL ), blankLine(), boxPara("⭐ KEY DRUGS causing oligohydramnios: ACE inhibitors, ARBs, Indomethacin, NSAIDs\nAlways take a MEDICATION HISTORY in oligohydramnios!", RED, NAVY), blankLine(), h2("3.3 Early-Onset Oligohydramnios"), blankLine(), bullet("Almost ALWAYS associated with significant fetal morbidity - rarely isolated"), bullet("Most common causes:"), subbullet("Previable preterm rupture of membranes (PPROM)"), subbullet("Bilateral renal agenesis / severe renal abnormalities ('renal oligohydramnios')"), blankLine(), h3("Potter's Sequence"), makeTable( ["Feature", "Detail"], [ ["Original definition", "Syndrome caused by bilateral renal agenesis"], ["Modern use", "Describes any severe early-onset oligohydramnios/anhydramnios syndrome"], ["Mechanism", "Absent/reduced urine production → ↓ AFV → lung compression → pulmonary hypoplasia"], ["Features (MNEMONIC: 'CLAP')", "C - Clubbed feet | L - Lung hypoplasia (pulmonary) | A - Abnormal facies (flattened, wide-set eyes, broad flat nose) | P - Position deformities (cranial & skin abnormalities)"], ["Prognosis", "INCOMPATIBLE WITH LIFE → termination of pregnancy offered"], ["Other causes", "Severe PPROM and renal oligohydramnios can cause the same phenotype"], ], [3000, 6000], NAVY ), blankLine(), h2("3.4 Investigation of Oligohydramnios"), blankLine(), boxPara("Isolated oligohydramnios = DIAGNOSIS OF EXCLUSION\nMust systematically rule out: rupture of membranes, placental disorders, FGR, fetal infection, structural anomalies, medications", AMBER, NAVY), blankLine(), h3("Flowchart 3 (from TOG Article): Investigating Oligohydramnios"), flowBox("OLIGOHYDRAMNIOS DETECTED\nSDVP < 2 cm OR AFI < 5 cm", "1B3A6B"), arrow(), new Table({ rows: [new TableRow({ children: [ new TableCell({ children: [ new Paragraph({ children: [bold("1. HISTORY", 19, NAVY)], spacing: { before: 60, after: 40 } }), new Paragraph({ children: [norm("• Travel history", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• Medication history (ACE-i, ARBs, NSAIDs)", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• Family history", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• Hydration status", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• Symptom of membrane rupture", 18)], spacing: { before: 20, after: 40 } }), ], shading: { type: ShadingType.SOLID, fill: MINT }, width: { size: 2200, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), new TableCell({ children: [ new Paragraph({ children: [bold("2. EXAMINATION", 19, NAVY)], spacing: { before: 60, after: 40 } }), new Paragraph({ children: [norm("• Speculum examination", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm(" (rule out membrane rupture)", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• Blood pressure monitoring", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm(" (rule out pre-eclampsia)", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• Urine assessment", 18)], spacing: { before: 20, after: 40 } }), ], shading: { type: ShadingType.SOLID, fill: BLUE }, width: { size: 2200, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), new TableCell({ children: [ new Paragraph({ children: [bold("3. BLOOD TESTS", 19, NAVY)], spacing: { before: 60, after: 40 } }), new Paragraph({ children: [norm("• sFlt-1/PlGF ratio", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm(" (assess for placental disease)", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• Renal function (if maternal renal failure suspected)", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• TORCH screening (consider in all cases)", 18)], spacing: { before: 20, after: 40 } }), ], shading: { type: ShadingType.SOLID, fill: AMBER }, width: { size: 2200, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), new TableCell({ children: [ new Paragraph({ children: [bold("4. ULTRASOUND", 19, NAVY)], spacing: { before: 60, after: 40 } }), new Paragraph({ children: [norm("• Detailed anatomy scan", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• Fetal biometry / growth", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• MCA Doppler (if placental disease/FGR)", 18)], spacing: { before: 20 } }), new Paragraph({ children: [norm("• Umbilical artery Doppler", 18)], spacing: { before: 20, after: 40 } }), ], shading: { type: ShadingType.SOLID, fill: RED }, width: { size: 2200, type: WidthType.DXA }, margins: { top: 80, bottom: 80, left: 100, right: 100 } }), ]})], width: { size: 8800, type: WidthType.DXA }, alignment: AlignmentType.CENTER }), arrow(), branchRow( "✅ ALL NORMAL\n(normal anatomy, no infection,\nno placental dysfunction)\n\n→ IDIOPATHIC OLIGOHYDRAMNIOS", "🔴 ABNORMAL FINDINGS\n\nFGR / SGA / anhydramnios /\npositive infection / fetal anomaly\n→ REFER FETAL MEDICINE\n(consider genetic testing)", MINT, RED ), blankLine(), centred("If MATERNAL cause (renal failure, hypertensive disease) → refer to MATERNAL MEDICINE SERVICES", 20, ORANGE, true), blankLine(), blankLine(), h2("3.5 Biomarkers for Placental Disease in Oligohydramnios"), bullet("PlGF (Placental Growth Factor) and sFlt-1/PlGF RATIO:"), subbullet("Used to identify impending pre-eclampsia-associated FGR and oligohydramnios"), subbullet("Important biomarker in the workup of oligohydramnios"), bullet("Significant: some cases labelled 'isolated' oligohydramnios have unrecognised placental pathology"), blankLine(), h2("3.6 Management of Isolated / Idiopathic Oligohydramnios"), blankLine(), h3("Antenatal Surveillance (Consensus)"), bullet("ACOG and NICE: INCREASED surveillance and monitoring for signs of fetal deterioration"), bullet("Regular fetal biometry scans"), bullet("Continuous CTG monitoring in labour"), blankLine(), h3("Interventions to Improve AFV - Evidence"), makeTable( ["Intervention", "Evidence", "Current Practice (UK)"], [ ["Maternal oral/IV hydration", "Small studies suggest modest AFV improvement; not robust evidence for outcome improvement", "May be trialled for borderline cases"], ["Intrapartum amnioinfusion", "Cochrane 2012: may reduce cord compression, ↓ CS rate, ↓ FHR decelerations, ↑ APGAR scores, ↓ endometritis. LIMITED by methodological issues", "NOT common practice in UK. Mostly studied for PPROM management"], ["Antenatal amnioinfusion", "Limited evidence; studied mostly in mid-trimester PPROM", "Specialist centres only"], ], [2500, 4000, 2500], TEAL ), blankLine(), boxPara("⚠ IMPORTANT: There is little evidence of improvement in OUTCOMES with attempts to increase AFV in isolated oligohydramnios", AMBER, NAVY), blankLine(), h3("Timing of Delivery - The Great Debate"), blankLine(), flowBox("ISOLATED OLIGOHYDRAMNIOS AT TERM - TIMING OF DELIVERY", "1B3A6B"), arrow(), branchRow( "ARGUMENT FOR IOL at term:\n\n• Oligohydramnios may be FIRST SIGN of placental disorder\n• ↑ adverse outcomes at post-dates with oligohydramnios\n• ↑ rate of undiagnosed SGA found at birth\n• Many clinicians deliver at term\n\n★ AUTHORS' RECOMMENDATION:\nIOL at TERM for isolated oligohydramnios", "ARGUMENT AGAINST (watchful waiting):\n\n• Normal growth + no placental abnormality\n• No clear evidence IOL reduces morbidity/mortality\n• IOL with PGE2 + unfavourable cervix → ↑ CS rate\n• Rossi et al.: similar adverse outcomes vs normal liquor at post-term\n\n• No consensus: ACOG, FIGO, NICE, RCOG all differ", MINT, AMBER ), blankLine(), makeTable( ["Gestational Age", "Recommendation / Evidence"], [ ["Pre-term (<37 weeks)", "No clear evidence for early IOL. High risk of morbidity from prematurity vs oligohydramnios. Individualised decision"], ["Late pre-term (34-36+6 weeks)", "Brzezinski-Sinai et al. 2019: IOL not clearly justified. Individualised approach"], ["Term (37-39+6 weeks)", "AUTHORS recommend: IOL at term. Evidence: ↑ fetal morbidity + post-natal SGA after 40 weeks"], ["Post-term (≥40 weeks)", "Strong evidence for delivery. ↑ risk of interventions. Rossi et al.: ↑ intervention rates but similar adverse outcomes vs normal AFV"], ], [2500, 6500], TEAL ), blankLine(), boxPara("KEY META-ANALYSES:\n• Shrem et al.: ↑ short-term neonatal morbidity, ↑ CS rate, ↑ IOL rate - UNABLE to support/oppose routine IOL\n• Rossi et al.: post-term isolated oligohydramnios → ↑ intervention but similar adverse outcomes vs normal liquor\n• No consensus between ACOG, FIGO, NICE, RCOG on timing of delivery", BLUE, NAVY), blankLine(), h3("Intrapartum Management"), bullet("CONTINUOUS CTG monitoring in labour - CONSENSUS across guidelines"), bullet("Increased risk of fetal hypoxia - multiple contributing factors:"), subbullet("Acute cord compression (reduced liquor cushioning)"), subbullet("Chronic/repeated cord compression"), subbullet("Underlying placental insufficiency"), bullet("Consider amnioinfusion if cord compression-related decelerations"), bullet("Lower threshold for Caesarean section (though unclear if this is appropriate or reflects clinician caution)"), blankLine(), h2("3.7 Complications of Oligohydramnios"), makeTable( ["MATERNAL Complications", "FETAL / NEONATAL Complications"], [ ["Increased rate of expedited birth for non-reassuring FHR", "Meconium-stained amniotic fluid"], ["Chorioamnionitis (in PPROM)", "Increased NICU admission"], ["Higher CS rate (unclear if appropriate or over-intervention)", "Low birth weight"], ["", "Malposition"], ["", "Stillbirth / neonatal death"], ["", "Intrapartum fetal distress"], ["", "Low 5-minute APGAR score"], ["", "Fetal pulmonary hypoplasia (if early onset)"], ["", "Increased respiratory morbidity"], ["", "Long-term neurological morbidity (Dorot et al. 2020)"], ], [4500, 4500], TEAL ), blankLine(), h2("3.8 Postnatal Management after Isolated Oligohydramnios"), bullet("Some cases labelled 'isolated' antenatally reveal an underlying FETAL CAUSE after delivery"), bullet("Higher rate of respiratory distress + lower APGAR scores, especially post-dates"), bullet("Delivery should ideally occur where NEONATAL SERVICES are available"), blankLine(), h3("Subsequent Pregnancies"), bullet("Leytes et al. (2022): INCREASED rate of placental disorders in subsequent pregnancies after apparently isolated oligohydramnios"), bullet("Recommendation: increased antenatal USS growth surveillance in subsequent pregnancies"), bullet("Not yet established in large multicentre studies"), blankLine(), pageBreak() ]; // SECTION 4: COMPARISON TABLE const sec4 = [ h1("SECTION 4: HEAD-TO-HEAD COMPARISON - MRCOG QUICK REFERENCE"), blankLine(), h2("4.1 Polyhydramnios vs Oligohydramnios - Master Comparison Table"), makeTable( ["Feature", "POLYHYDRAMNIOS", "OLIGOHYDRAMNIOS"], [ ["Definition", "SDVP >8 cm OR AFI ≥24 cm", "SDVP <2 cm OR AFI ≤5 cm"], ["UK Prevalence", "Up to 2% of pregnancies", "0.5-5% of pregnancies"], ["Most common cause", "Idiopathic (60-70%)", "Idiopathic (most common)"], ["Mechanism", "↑ production OR ↓ removal of AF", "↓ production OR ↑ loss of AF"], ["Diagnostic method preferred", "SDVP (screen) + AFI (confirm severity)", "SDVP (preferred)"], ["Intrapartum surveillance", "Continuous CTG (NICE)", "Continuous CTG (consensus)"], ["Induction timing (mild)", "No change in management", "IOL at term (authors' recommendation)"], ["Induction timing (moderate)", "Offer from 40 weeks", "IOL at term"], ["Induction timing (severe)", "Before 40 weeks - individualised", "IOL - individualised"], ["Main antenatal risk", "Macrosomia, malpresentation, PPROM, PPH", "FGR, cord compression, placental insufficiency"], ["Main fetal risk", "Genomic anomalies, macrosomia complications", "SGA, pulmonary hypoplasia, cord compression"], ["Key intervention", "Amnioreduction (severe only)", "Amnioinfusion (evidence limited, not UK standard)"], ["Genomic risk", "1-10% depending on severity", "Less well quantified"], ["Subsequent pregnancy risk", "Counsel about childhood screening", "↑ placental disorders in next pregnancy"], ], [2500, 3250, 3250], NAVY ), blankLine(), h2("4.2 AFV Measurement Quick Reference"), makeTable( ["Parameter", "Normal", "Oligohydramnios", "Polyhydramnios"], [ ["AFI", "5-24 cm", "≤5 cm", "≥24 cm"], ["SDVP", "2-8 cm", "<2 cm", ">8 cm"], ["Preferred method", "SDVP", "SDVP", "AFI (for severity grading)"], ], [2500, 2000, 2000, 2500], NAVY ), blankLine(), h2("4.3 Guideline Positions Summary"), makeTable( ["Organisation", "Polyhydramnios", "Oligohydramnios"], [ ["NICE", "Continuous CTG in labour for ALL severities", "Increased surveillance; continuous CTG in labour"], ["ACOG", "Weekly surveillance if moderate-severe. No change in management for mild isolated", "Increased surveillance. No clear consensus on delivery timing"], ["RCOG Green-top", "Regular biometry scans for all polyhydramnios (SFH inaccurate)", "No specific guideline - follows NICE principles"], ["SMFM / ASMFM", "Amnioreduction only for severe discomfort/dyspnoea", "Individualised approach"], ["Authors (TOG 2026)", "Moderate: IOL from 40 weeks. Severe: IOL before 40 weeks", "IOL at term; pragmatic individualised approach"], ["FIGO", "No specific guidance noted", "No consensus on delivery timing"], ], [2000, 3500, 3500], TEAL ), blankLine(), pageBreak() ]; // SECTION 5: MRCOG EXAM PEARLS const sec5 = [ h1("SECTION 5: MRCOG EXAM PEARLS & HIGH-YIELD FACTS"), blankLine(), h2("5.1 Must-Know Numbers"), makeTable( ["Fact", "Value"], [ ["AFI - Normal range", "5-24 cm"], ["AFI - Oligohydramnios", "≤ 5 cm"], ["AFI - Polyhydramnios", "≥ 24 cm"], ["SDVP - Normal range", "2-8 cm"], ["SDVP - Oligohydramnios", "< 2 cm"], ["SDVP - Polyhydramnios", "> 8 cm (mild ≥8, moderate ≥12, severe ≥16)"], ["Polyhydramnios prevalence (UK)", "1-2% of pregnancies"], ["Oligohydramnios prevalence (UK)", "0.5-5% of pregnancies"], ["Idiopathic polyhydramnios", "60-70% of all polyhydramnios cases"], ["Fetal abnormality in SEVERE polyhydramnios", ">30% of cases"], ["Genomic risk - mild polyhydramnios", "~1%"], ["Genomic risk - moderate polyhydramnios", "~2%"], ["Genomic risk - severe polyhydramnios", "~10%"], ["Overall genomic risk in isolated polyhydramnios", "4.5% (Tsakmaki et al. 2024)"], ["Most common genomic abnormality", "Bartter syndrome (21% of genomic cases)"], ["UK chromosomal abnormality population risk", "23.1 per 10,000 births (2019)"], ], [5500, 3500], NAVY ), blankLine(), h2("5.2 Key Studies to Know"), makeTable( ["Study", "Year", "Key Finding"], [ ["Cochrane Review (Nabhan & Abdelmoula)", "2008", "SDVP preferred over AFI. AFI ↑ diagnosis of oligohydramnios without improving outcomes"], ["SAFE Trial (Kehl et al.)", "2015/16", "Multicentre RCT. Confirmed AFI ↑ oligohydramnios diagnosis without improving perinatal outcome"], ["Cochrane (Hofmeyr & Lawrie)", "2012", "Intrapartum amnioinfusion may ↓ CS, ↓ FHR decels, ↑ APGAR. Limited by methodology"], ["Shrem et al. meta-analysis", "2016", "Isolated oligohydramnios → ↑ neonatal morbidity, ↑ CS, ↑ IOL. Cannot support/oppose routine IOL"], ["Rossi & Prefumo meta-analysis", "2013", "Post-term isolated oligohydramnios → ↑ interventions, similar adverse outcomes vs normal AFV"], ["Tsakmaki et al. meta-analysis", "2024", "Genomic abnormality in isolated polyhydramnios = 4.5%. Bartter syndrome most common (21%)"], ["Kechagias et al. meta-analysis", "2024", "↑ morbidity with ↑ severity of polyhydramnios. High bias due to macrosomia confounding"], ["Pagan et al. (classification)", "2023", "Systematic review establishing severity classification using AFI and SDVP thresholds"], ["Leytes et al.", "2022", "Previous isolated oligohydramnios → ↑ placental disorders in next pregnancy"], ["Dorot et al.", "2020", "Isolated oligohydramnios → ↑ long-term neurological morbidity in offspring"], ], [3500, 700, 4800], TEAL ), blankLine(), h2("5.3 Common MRCOG Traps & Mnemonics"), blankLine(), h3("MNEMONIC: Causes of Polyhydramnios - 'DIG FETAL'"), boxPara( "D - Diabetes mellitus (maternal)\nI - Idiopathic (most common!)\nG - GI obstruction (oesophageal/duodenal atresia, TOF, diaphragmatic hernia)\n\nF - Fetal infection (TORCH)\nE - Endocrine/metabolic (Bartter syndrome)\nT - Twins (TTTS - recipient)\nA - Anomalies (structural/chromosomal)\nL - Lung abnormalities (CPAM, CHAOS) + high output cardiac failure", BLUE, NAVY, false ), blankLine(), h3("MNEMONIC: Causes of Oligohydramnios - 'DAMP RUMP'"), boxPara( "D - Drugs (ACE inhibitors, ARBs, NSAIDs, indomethacin)\nA - Agenesis (bilateral renal agenesis → Potter sequence)\nM - Maternal dehydration/anorexia/hyperemesis\nP - Placental insufficiency (pre-eclampsia, FGR, hypertension)\n\nR - Renal obstruction (LUTO, posterior urethral valves, MCDK, ARPCKD)\nU - Uteroplacental disorder (PIH, cocaine)\nM - Membranes ruptured (PROM/PPROM - most common ACUTE cause)\nP - Post-dates pregnancy", AMBER, NAVY, false ), blankLine(), h3("Common Exam Traps"), makeTable( ["Trap", "Correct Answer"], [ ["Which is the PREFERRED method for AFV assessment?", "SDVP - not AFI. Cochrane 2008 + SAFE Trial 2015"], ["When do you use AFI over SDVP?", "For CONFIRMING polyhydramnios diagnosis AND grading its severity"], ["AFI increases diagnosis of oligohydramnios - so why is it NOT preferred?", "Because it increases diagnosis WITHOUT improving outcomes - over-medicalises"], ["Indomethacin: why no longer used for polyhydramnios?", "Neonatal morbidity"], ["Amnioreduction: when indicated?", "ONLY severe maternal discomfort, dyspnoea, severe polyhydramnios - NOT routine"], ["Is there consensus on delivery timing in isolated oligohydramnios?", "NO - ACOG, FIGO, NICE, RCOG all differ. Authors recommend IOL at term"], ["Most common genomic abnormality in isolated polyhydramnios?", "Bartter syndrome (autosomal recessive, 21% of genomic cases)"], ["What is Potter's sequence?", "Clubbed feet + pulmonary hypoplasia + cranial/skin abnormalities from early severe oligohydramnios. Incompatible with life"], ["Mild isolated polyhydramnios - what does ACOG recommend?", "NO change in management required"], ["Key biomarker for placental disease in oligohydramnios?", "sFlt-1/PlGF ratio and PlGF"], ], [4500, 4500], NAVY ), blankLine(), h2("5.4 Summary Algorithm: Approach to Abnormal AFV"), flowBox("ABNORMAL AFV FOUND ON ULTRASOUND", "1B3A6B"), arrow(), branchRow("POLYHYDRAMNIOS\nSDVP >8 cm or AFI ≥24 cm", "OLIGOHYDRAMNIOS\nSDVP <2 cm or AFI ≤5 cm", TEAL, "1B3A6B"), arrow(), branchRow( "History + Exam + OGTT + TORCH\n+ USS anomaly scan + MCA Doppler\n→ Rule out DM, infection, fetal anomaly", "History + Speculum exam + BP\n+ sFlt-1/PlGF + TORCH + USS\n→ Rule out PROM, FGR, renal anomaly, medications", MINT, AMBER ), arrow(), branchRow( "ISOLATED POLYHYDRAMNIOS\n→ Grade severity\n→ Mild: conservative\n→ Moderate: IOL from 40/40\n→ Severe: IOL before 40/40", "ISOLATED OLIGOHYDRAMNIOS\n→ Increased surveillance\n→ Continuous CTG in labour\n→ Authors: IOL at term\n→ No national consensus", MINT, AMBER ), blankLine(), blankLine(), h2("5.5 Areas of Ongoing Controversy / Future Research Needs"), bullet("No multicentre RCTs studying isolated polyhydramnios NOT complicated by macrosomia"), bullet("No consensus on delivery timing in isolated oligohydramnios (ACOG, FIGO, NICE, RCOG all differ)"), bullet("No national consensus on routine NGT passage for newborns with polyhydramnios"), bullet("No consensus on childhood follow-up after severe isolated polyhydramnios"), bullet("Role of intrapartum amnioinfusion in isolated oligohydramnios needs multicentre RCTs"), bullet("Further risk stratification needed for genomic screening after isolated polyhydramnios"), bullet("Many studies confounded by macrosomia co-existing with polyhydramnios"), blankLine(), pageBreak() ]; // SECTION 6: NEONATAL CONSIDERATIONS const sec6 = [ h1("SECTION 6: NEONATAL CONSIDERATIONS"), blankLine(), h2("6.1 Neonatal Complications: Quick Reference"), makeTable( ["Condition", "Polyhydramnios", "Oligohydramnios"], [ ["Respiratory", "Transient tachypnoea of newborn", "Pulmonary hypoplasia (early-onset), ↑ respiratory morbidity"], ["Metabolic", "Hypoglycaemia (if DM-related)", "-"], ["Neurological", "HIE (fetal distress in labour)", "Long-term neurological morbidity (Dorot et al.)"], ["Resuscitation", "Lower APGAR scores at 1 & 5 min", "Low 5-min APGAR score"], ["NICU", "↑ NICU admission", "↑ NICU admission"], ["Birth weight", "Macrosomia risk", "Low birth weight / SGA"], ["Hidden diagnosis", "GI atresia, Bartter, chromosomal", "Renal anomalies, SGA not detected antenatally"], ], [3000, 3000, 3000], NAVY ), blankLine(), h2("6.2 Bartter Syndrome - MRCOG Detail"), bullet("Autosomal RECESSIVE condition"), bullet("Mechanism: defect in renal tubular salt reabsorption → polyuria → polyhydramnios"), bullet("Neonatal features:"), subbullet("Polyuria"), subbullet("Hypokalaemia"), subbullet("Hyperchloraemic metabolic alkalosis"), subbullet("Hyperaldosteronism"), bullet("Can be FATAL in the newborn period if not recognised"), bullet("Most common specific genomic abnormality in isolated polyhydramnios (21% of genomic cases)"), blankLine(), h2("6.3 Potter Sequence - Key for MRCOG"), makeTable( ["Aspect", "Details"], [ ["Classic cause", "Bilateral renal agenesis"], ["Modern usage", "Any severe early-onset oligohydramnios/anhydramnios causing the syndrome"], ["Pathological sequence", "No/minimal urine → ↓ AF → compression → pulmonary hypoplasia + deformation sequence"], ["Clinical features", "Pulmonary hypoplasia, clubbed feet, flattened facies, positional deformities, skin/cranial abnormalities"], ["Prognosis", "Incompatible with life"], ["Management", "Offer termination of pregnancy"], ["Similar phenotype", "Severe PPROM, bilateral MCDK, ARPCKD, LUTO with severe renal involvement"], ], [3000, 6000], TEAL ), blankLine(), blankLine(), new Paragraph({ children: [new TextRun({ text: "END OF NOTES", bold: true, size: 28, color: NAVY })], alignment: AlignmentType.CENTER, spacing: { before: 200, after: 100 } }), new Paragraph({ children: [new TextRun({ text: "Reference: Falola AO, Filby L, Timmons P, Alleemudder D. Management of isolated abnormal amniotic fluid volume in pregnancy. TOG 2026;28:41-50. DOI: 10.1111/tog.70021", size: 18, color: "666666", italics: true })], alignment: AlignmentType.CENTER, spacing: { before: 60, after: 200 } }), ]; // ─── ASSEMBLE & WRITE ───────────────────────────────────────────────────────── const doc = new Document({ numbering: { config: [{ reference: "bullet-list", levels: [ { level: 0, format: LevelFormat.BULLET, text: "\u2022", alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 400, hanging: 200 } } } }, { level: 1, format: LevelFormat.BULLET, text: "\u25E6", alignment: AlignmentType.LEFT, style: { paragraph: { indent: { left: 720, hanging: 200 } } } }, ] }] }, styles: { default: { document: { run: { font: "Calibri", size: 20 } } } }, sections: [{ properties: { page: { margin: { top: 720, bottom: 720, left: 900, right: 900 }, } }, headers: { default: new Header({ children: [new Paragraph({ children: [ new TextRun({ text: "MRCOG Notes: Amniotic Fluid Volume | TOG 2026", size: 18, color: "888888", italics: true }), ], border: { bottom: { style: BorderStyle.SINGLE, size: 4, color: TEAL } } })] }) }, footers: { default: new Footer({ children: [new Paragraph({ children: [ new TextRun({ text: "Page ", size: 18, color: "888888" }), new PageNumber({ format: NumberFormat.DECIMAL }), new TextRun({ text: " | Falola et al., The Obstetrician & Gynaecologist 2026;28:41-50", size: 18, color: "888888", italics: true }), ], alignment: AlignmentType.CENTER })] }) }, children: [ ...cover, ...sec1, ...sec2, ...sec3, ...sec4, ...sec5, ...sec6, ] }] }); Packer.toBuffer(doc).then(buffer => { fs.writeFileSync('/home/daytona/workspace/afi-notes/MRCOG_AFI_Notes_TOG2026.docx', buffer); console.log('SUCCESS: Document created!'); }).catch(err => { console.error('ERROR:', err.message); console.error(err.stack); }); JSEOF echo "Script written successfully"
pls continue
cd /home/daytona/workspace/afi-notes && node create_afi_notes.js 2>&1
~/afi-notes/create_afi_notes.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/afi-notes/create_afi_notes.js'
cd /home/daytona/workspace/afi-notes && node create_afi_notes.js 2>&1
~/afi-notes/create_afi_notes.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/afi-notes/create_afi_notes.js'
cd /home/daytona/workspace/afi-notes && node create_afi_notes.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/afi-notes/MRCOG_AFI_Notes_TOG2026.docx 2>&1 && ls -lh /home/daytona/workspace/afi-notes/MRCOG_AFI_Notes_TOG2026.docx
ls -lh /home/daytona/workspace/afi-notes/MRCOG_AFI_Notes_TOG2026.docx && python3 -c " from zipfile import ZipFile z = ZipFile('/home/daytona/workspace/afi-notes/MRCOG_AFI_Notes_TOG2026.docx') print('Valid ZIP/DOCX - contents:', z.namelist()[:8]) "
MRCOG AFI Notes TOG2026
Word Document · DOCX
Convert this document to PDF for easy reference on exams
python3 /home/daytona/skills/docx/scripts/office/soffice.py --headless --convert-to pdf /home/daytona/workspace/afi-notes/MRCOG_AFI_Notes_TOG2026.docx --outdir /home/daytona/workspace/afi-notes/ 2>&1
cp /home/daytona/workspace/afi-notes/MRCOG_AFI_Notes_TOG2026.docx /tmp/afi_convert.docx && python3 /home/daytona/skills/docx/scripts/office/soffice.py --headless --convert-to pdf /tmp/afi_convert.docx --outdir /tmp/ 2>&1 && ls -lh /tmp/afi_convert.pdf
cp /tmp/afi_convert.pdf /home/daytona/workspace/afi-notes/MRCOG_AFI_Notes_TOG2026.pdf && ls -lh /home/daytona/workspace/afi-notes/MRCOG_AFI_Notes_TOG2026.pdf
MRCOG AFI Notes TOG2026
PDF Document · PDF
MRCOG AFI Notes TOG2026
Word Document · DOCX
u have sent tables which are dark with no content pls correct them and send again in word format
Generate corrected MRCOG AFI Word notes with readable tables