This pdf is from marrow so its more inclimed to neet pg...but can u make this in the most AMC Oriented notes
cd /home/daytona/workspace && python3 -c " import pdfplumber text = '' with pdfplumber.open('/home/daytona/workspace/attachments/0f539ac7-771d-41c6-8028-ae1769f87e3e/Labor.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): t = page.extract_text() if t: text += f'\n\n--- PAGE {i+1} ---\n' + t with open('/home/daytona/workspace/labor_extracted.txt', 'w') as f: f.write(text) print('Done. Chars:', len(text)) "
python3 -c " from pypdf import PdfReader reader = PdfReader('/home/daytona/workspace/attachments/0f539ac7-771d-41c6-8028-ae1769f87e3e/Labor.pdf') text = '' for i, page in enumerate(reader.pages): t = page.extract_text() if t: text += f'\n\n--- PAGE {i+1} ---\n' + t print('Total chars:', len(text)) print('First 500:', text[:500] if text else 'EMPTY') "
Try again
python3 -c " from pypdf import PdfReader reader = PdfReader('/home/daytona/workspace/attachments/0f539ac7-771d-41c6-8028-ae1769f87e3e/Labor.pdf') print('Pages:', len(reader.pages)) text = '' for i, page in enumerate(reader.pages): t = page.extract_text() if t: text += f'PAGE {i+1}:\n' + t + '\n\n' print('Total chars:', len(text)) print(text[:1000] if text else 'EMPTY - likely scanned images') "
which tesseract && tesseract --version 2>&1 | head -3; python3 -c "import pytesseract; print('pytesseract ok')" 2>&1; python3 -c "from pdf2image import convert_from_path; print('pdf2image ok')" 2>&1
python3 -c " from pdf2image import convert_from_path import pytesseract, os pdf_path = '/home/daytona/workspace/attachments/0f539ac7-771d-41c6-8028-ae1769f87e3e/Labor.pdf' pages = convert_from_path(pdf_path, dpi=200) print(f'Converted {len(pages)} pages') all_text = '' for i, img in enumerate(pages): text = pytesseract.image_to_string(img) all_text += f'\n\n=== PAGE {i+1} ===\n' + text print(f' Page {i+1}: {len(text)} chars') with open('/home/daytona/workspace/labor_ocr.txt', 'w') as f: f.write(all_text) print('OCR complete. Total chars:', len(all_text)) " 2>&1
python3 << 'EOF' from pdf2image import convert_from_path import pytesseract pdf_path = '/home/daytona/workspace/attachments/0f539ac7-771d-41c6-8028-ae1769f87e3e/Labor.pdf' all_text = '' # Process 5 pages at a time at 150 dpi to save memory batch_size = 5 total_pages = 50 for start in range(0, total_pages, batch_size): end = min(start + batch_size, total_pages) pages = convert_from_path(pdf_path, dpi=150, first_page=start+1, last_page=end) for i, img in enumerate(pages): pg = start + i + 1 text = pytesseract.image_to_string(img) all_text += f'\n\n=== PAGE {pg} ===\n' + text print(f'Done pages {start+1}-{end}') del pages with open('/home/daytona/workspace/labor_ocr.txt', 'w') as f: f.write(all_text) print('OCR complete. Total chars:', len(all_text)) EOF
mkdir -p /home/daytona/workspace/labor-amc && cat > /home/daytona/workspace/labor-amc/build_pdf.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.lib import colors from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether) from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY # ── colour palette ────────────────────────────────────────────────────────── DARK_BLUE = colors.HexColor("#1a3a5c") MID_BLUE = colors.HexColor("#2e6da4") LIGHT_BLUE = colors.HexColor("#d6e8f7") TEAL = colors.HexColor("#007b7f") ORANGE = colors.HexColor("#e07b00") AMBER = colors.HexColor("#fff3cd") GREEN_BG = colors.HexColor("#e8f5e9") GREEN_FG = colors.HexColor("#2e7d32") RED_BG = colors.HexColor("#fdecea") RED_FG = colors.HexColor("#c62828") GREY_LINE = colors.HexColor("#cccccc") WHITE = colors.white W, H = A4 MARGIN = 1.8 * cm doc = SimpleDocTemplate( "/home/daytona/workspace/labor-amc/Labor_AMC_Notes.pdf", pagesize=A4, leftMargin=MARGIN, rightMargin=MARGIN, topMargin=MARGIN, bottomMargin=MARGIN, title="Labor - AMC-Oriented Clinical Notes" ) styles = getSampleStyleSheet() def S(name, **kw): return ParagraphStyle(name, parent=styles["Normal"], **kw) TITLE = S("TITLE", fontSize=22, textColor=WHITE, alignment=TA_CENTER, spaceAfter=4, spaceBefore=4, fontName="Helvetica-Bold") H1 = S("H1", fontSize=14, textColor=WHITE, spaceAfter=3, spaceBefore=8, fontName="Helvetica-Bold", leading=18) H2 = S("H2", fontSize=11, textColor=DARK_BLUE, spaceAfter=2, spaceBefore=6, fontName="Helvetica-Bold", leading=14) H3 = S("H3", fontSize=10, textColor=TEAL, spaceAfter=2, spaceBefore=4, fontName="Helvetica-Bold", leading=13) BODY = S("BODY", fontSize=9, textColor=colors.black, spaceAfter=2, leading=13, alignment=TA_JUSTIFY) BULLET = S("BULLET", fontSize=9, textColor=colors.black, spaceAfter=1, leading=12, leftIndent=14, firstLineIndent=-8) SUB = S("SUB", fontSize=8, textColor=colors.HexColor("#555555"), spaceAfter=1, leading=11, leftIndent=22, firstLineIndent=-8) WARN = S("WARN", fontSize=9, textColor=RED_FG, spaceAfter=1, leading=12, leftIndent=14, fontName="Helvetica-Bold") KEY = S("KEY", fontSize=9, textColor=GREEN_FG, spaceAfter=1, leading=12, fontName="Helvetica-Bold") NOTE = S("NOTE", fontSize=8, textColor=colors.HexColor("#444444"), spaceAfter=1, leading=11, leftIndent=10, fontName="Helvetica-Oblique") story = [] # ── helpers ───────────────────────────────────────────────────────────────── def section_banner(text, color=DARK_BLUE): tbl = Table([[Paragraph(text, H1)]], colWidths=[W - 2*MARGIN]) tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), color), ("ROUNDEDCORNERS", [4]), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 8), ])) story.append(tbl) story.append(Spacer(1, 4)) def h2(text): story.append(Paragraph(text, H2)) def h3(text): story.append(Paragraph(text, H3)) def body(text): story.append(Paragraph(text, BODY)) def bullet(text, indent=1): sty = BULLET if indent == 1 else SUB story.append(Paragraph(f"• {text}", sty)) def warn(text): tbl = Table([[Paragraph(f"⚠ {text}", WARN)]], colWidths=[W - 2*MARGIN]) tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), RED_BG), ("TOPPADDING",(0,0),(-1,-1),4), ("BOTTOMPADDING",(0,0),(-1,-1),4), ("LEFTPADDING",(0,0),(-1,-1),8), ("BOX",(0,0),(-1,-1),0.5, RED_FG), ])) story.append(tbl) story.append(Spacer(1, 3)) def key_point(text): tbl = Table([[Paragraph(f"★ {text}", KEY)]], colWidths=[W - 2*MARGIN]) tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), GREEN_BG), ("TOPPADDING",(0,0),(-1,-1),4), ("BOTTOMPADDING",(0,0),(-1,-1),4), ("LEFTPADDING",(0,0),(-1,-1),8), ("BOX",(0,0),(-1,-1),0.5, GREEN_FG), ])) story.append(tbl) story.append(Spacer(1, 3)) def note(text): story.append(Paragraph(f"Note: {text}", NOTE)) def amc_tip(text): tbl = Table([[Paragraph(f"AMC FOCUS: {text}", S("amctip", fontSize=8, textColor=colors.HexColor("#1a237e"), fontName="Helvetica-Bold", leading=11))]], colWidths=[W - 2*MARGIN]) tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), colors.HexColor("#e8eaf6")), ("TOPPADDING",(0,0),(-1,-1),4), ("BOTTOMPADDING",(0,0),(-1,-1),4), ("LEFTPADDING",(0,0),(-1,-1),8), ("BOX",(0,0),(-1,-1),0.5, colors.HexColor("#3949ab")), ])) story.append(tbl) story.append(Spacer(1, 3)) def make_table(headers, rows, col_widths=None): data = [[Paragraph(h, S("TH", fontSize=8, fontName="Helvetica-Bold", textColor=WHITE, leading=11)) for h in headers]] for row in rows: data.append([Paragraph(str(c), S("TD", fontSize=8, leading=11)) for c in row]) cw = col_widths or [(W - 2*MARGIN) / len(headers)] * len(headers) tbl = Table(data, colWidths=cw) tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0), MID_BLUE), ("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, LIGHT_BLUE]), ("GRID",(0,0),(-1,-1),0.3, GREY_LINE), ("TOPPADDING",(0,0),(-1,-1),3), ("BOTTOMPADDING",(0,0),(-1,-1),3), ("LEFTPADDING",(0,0),(-1,-1),5), ("VALIGN",(0,0),(-1,-1),"TOP"), ])) story.append(tbl) story.append(Spacer(1, 5)) def divider(): story.append(HRFlowable(width="100%", thickness=0.5, color=GREY_LINE)) story.append(Spacer(1, 4)) def sp(n=1): story.append(Spacer(1, n * 4)) # ═══════════════════════════════════════════════════════════════════════════ # COVER # ═══════════════════════════════════════════════════════════════════════════ cover_tbl = Table([[Paragraph("LABOR", S("CT", fontSize=32, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER)), ],[ Paragraph("AMC-Oriented Clinical Notes", S("CS",fontSize=14, textColor=LIGHT_BLUE, fontName="Helvetica",alignment=TA_CENTER)), ],[ Paragraph("Obstetrics & Gynaecology | Australian Medical Council", S("CS2",fontSize=10, textColor=colors.HexColor("#90caf9"), fontName="Helvetica", alignment=TA_CENTER)), ]], colWidths=[W - 2*MARGIN]) cover_tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), DARK_BLUE), ("TOPPADDING",(0,0),(-1,-1),12), ("BOTTOMPADDING",(0,0),(-1,-1),12), ("ALIGN",(0,0),(-1,-1),"CENTER"), ])) story.append(Spacer(1, 2*cm)) story.append(cover_tbl) story.append(Spacer(1, 0.5*cm)) amc_tip("The AMC MCQ and clinical exams test practical management decisions, " + "safe prescribing, communication, and medico-legal considerations. " + "These notes de-emphasise rare eponyms and Indian-specific statistics " + "and instead focus on: correct management steps, thresholds, drug " + "doses, and clinical reasoning used in the Australian context.") story.append(Spacer(1, 0.3*cm)) # ═══════════════════════════════════════════════════════════════════════════ # SECTION 1 – TERMINOLOGY # ═══════════════════════════════════════════════════════════════════════════ section_banner("1. TERMINOLOGY OF LABOR") h2("Fetal Lie") body("The relationship between the long axis of the fetus and the long axis of the uterus.") make_table( ["Lie", "Definition", "Management"], [ ["Longitudinal", "Fetal & uterine axes are parallel. Normal.", "Vaginal delivery possible if cephalic"], ["Transverse", "Fetal axis perpendicular to uterus.", "Caesarean section (alive or dead fetus)"], ["Oblique", "Intermediate — usually converts to longitudinal or transverse in labor.", "Caesarean if persists in labor"], ], col_widths=[3.5*cm, 7.5*cm, 6.5*cm] ) key_point("Transverse lie = highest risk of cord prolapse. Never attempt vaginal delivery.") sp() h2("Unstable Lie") body("Lie not fixed by 37 weeks gestation.") bullet("Causes: polyhydramnios, placenta praevia, uterine abnormality, multiparity") bullet("Management: elective caesarean section at 37-38 weeks") amc_tip("AMC will ask what to do when a patient presents in labor with transverse lie — always caesarean, regardless of fetal viability.") sp() h2("Fetal Presentation") body("The part of the fetus occupying the lower uterine segment.") make_table( ["Presentation", "Lie required", "Notes"], [ ["Cephalic (vertex)", "Longitudinal", "Normal — 96% of term deliveries"], ["Breech", "Longitudinal", "Most common malpresentation (~3-4%)"], ["Shoulder", "Transverse", "Requires caesarean"], ["Face", "Longitudinal", "Extension of head — mentoanterior can deliver vaginally"], ["Brow", "Longitudinal", "Largest diameter — almost always requires caesarean"], ["Compound", "Any", "Limb prolapsed alongside presenting part"], ], col_widths=[3.5*cm, 4*cm, 10*cm] ) amc_tip("Brow presentation: if it persists, caesarean. If it converts (to vertex or face), may deliver vaginally.") sp() h2("Presenting Part") body("The part of the presentation directly over the internal os — first felt on vaginal examination.") make_table( ["Head position", "Presenting part", "Diameter presented"], [ ["Well flexed (normal)", "Vertex (occiput)", "Suboccipitobregmatic ~9.5 cm"], ["Partially extended", "Brow (sinciput)", "Mentovertical ~13.5 cm (largest)"], ["Fully extended", "Face (chin)", "Submentobregmatic ~9.5 cm"], ], col_widths=[5*cm, 5.5*cm, 7*cm] ) sp() h2("Attitude, Position, and Station") h3("Attitude") body("Relationship of fetal parts to each other. Normal = complete flexion (chin on chest).") sp() h3("Position") body("Relationship of a fixed point on the presenting part (denominator) to the maternal pelvis.") make_table( ["Presentation", "Denominator"], [ ["Vertex (cephalic)", "Occiput"], ["Face", "Mentum (chin)"], ["Breech", "Sacrum"], ["Shoulder", "Acromion"], ], col_widths=[8*cm, 9.5*cm] ) key_point("Most common position at onset of labor: LOT (left occiput transverse). Most common at delivery: LOA.") sp() h3("Station") body("Level of the presenting part relative to the ischial spines (in cm).") bullet("0 station = at the level of ischial spines (engaged)") bullet("Negative station (-1, -2, -3) = above ischial spines") bullet("Positive station (+1, +2, +3) = below ischial spines (deeper in pelvis)") key_point("Engagement in a nullipara normally occurs at ~38 weeks. In a multipara, at the onset of labor.") sp() # ═══════════════════════════════════════════════════════════════════════════ # SECTION 2 – MECHANISM OF LABOR # ═══════════════════════════════════════════════════════════════════════════ section_banner("2. MECHANISM OF LABOR") body("Normal labor: longitudinal lie, cephalic presentation, LOT (left occiput transverse) starting position.") sp() h2("The 7 Cardinal Movements") make_table( ["#", "Movement", "Key Detail"], [ ["1", "Engagement", "Biparietal diameter (BPD) passes through pelvic inlet. Head at 0 station."], ["2", "Descent", "Most important driver = uterine contractions. Occurs throughout labor."], ["3", "Flexion", "Chin to chest — reduces diameter presented. Occurs simultaneously with descent."], ["4", "Internal rotation", "Occiput rotates anteriorly (LOT → LOA → OA). Occurs at level of ischial spines."], ["5", "Extension", "Head delivered under pubic symphysis by extension movement."], ["6", "Restitution / External rotation", "Head rotates back to align with shoulders (LOT direction). Shoulders enter AP diameter."], ["7", "Expulsion", "Anterior shoulder born first under pubis, then posterior shoulder by lateral flexion."], ], col_widths=[0.8*cm, 4.2*cm, 12.5*cm] ) key_point("Crowning = head permanently visible at perineum without retraction. Episiotomy is performed at crowning if needed.") amc_tip("AMC tests: which movement causes the suboccipitobregmatic diameter to present? = Flexion. Internal rotation is driven by pelvic floor (levator ani).") sp() h2("Engaged vs. Not Engaged (Abdominal Palpation)") body("Divide fetal head into 5 equal parts palpable above pubic symphysis:") bullet("5/5 palpable = not engaged at all") bullet("3/5 palpable = at brim (not yet engaged)") bullet("2/5 palpable = engaged (biparietal diameter through inlet)") bullet("0/5 palpable = deeply engaged") sp() # ═══════════════════════════════════════════════════════════════════════════ # SECTION 3 – NORMAL LABOR # ═══════════════════════════════════════════════════════════════════════════ section_banner("3. NORMAL LABOR") h2("Definition of True Labor") bullet("Regular, painful contractions increasing in frequency, duration and intensity") bullet("Associated with cervical change (effacement and dilatation)") bullet("Show (blood-stained mucus plug) may be present") warn("False labor (Braxton Hicks): irregular, no cervical change, relieved by analgesia/ambulation.") sp() h2("Stages of Labor") make_table( ["Stage", "Begins", "Ends", "Duration (nullipara / multipara)"], [ ["1st stage", "Onset of true labor", "Full cervical dilatation (10 cm)", "~12 h / ~6 h"], ["2nd stage", "Full dilatation", "Delivery of baby", "Up to 3 h (with epidural) / 2 h"], ["3rd stage", "Delivery of baby", "Delivery of placenta", "Up to 30 min (actively managed)"], ["4th stage", "Delivery of placenta", "2 hours post-delivery", "Observation for PPH"], ], col_widths=[2.8*cm, 4*cm, 4.2*cm, 6.5*cm] ) sp() h2("First Stage of Labor") h3("Latent Phase") bullet("Onset of labor to ~4 cm dilatation (AMC/WHO new guideline: active phase starts at 5 cm)") bullet("Irregular, mild contractions; cervical effacement occurs") bullet("Duration highly variable — not used to diagnose dystocia") sp() h3("Active Phase") bullet("From 5 cm (new WHO 2018 guideline) to full dilatation (10 cm)") bullet("Expected rate of cervical dilatation: at least 1 cm/hr") bullet("Contraction frequency: 3 in 10 minutes, each lasting 40-60 seconds") key_point("AMC uses WHO 2018: active phase starts at 5 cm, not 4 cm. Failure to progress defined as <1 cm/hr over 4 h.") sp() h3("Management of First Stage") make_table( ["Action", "Details"], [ ["Ambulation", "Encouraged in early labor. Left lateral in active labor to prevent aortocaval compression."], ["Oral intake", "Clear fluids allowed. Solid food avoided (delayed gastric emptying, aspiration risk)."], ["Fetal monitoring", "CTG for high-risk; intermittent auscultation every 15 min (active), 30 min (latent) for low-risk."], ["Vaginal exam", "Every 4 hours in active phase to assess dilatation, effacement, station, position."], ["IV access", "Establish if high-risk, epidural requested, or oxytocin anticipated."], ], col_widths=[3.5*cm, 14*cm] ) warn("Active bleeding is a contraindication to vaginal examination until placenta praevia excluded.") sp() h2("Second Stage of Labor") bullet("Full dilatation (10 cm) to delivery of the baby") bullet("Passive second stage: descent of head before pushing urge") bullet("Active second stage: maternal pushing (bearing down with contractions)") h3("Duration Limits (when to escalate)") make_table( ["Parity", "Without epidural", "With epidural"], [ ["Nullipara", "2 hours", "3 hours"], ["Multipara", "1 hour", "2 hours"], ], col_widths=[5*cm, 7*cm, 5.5*cm] ) amc_tip("If second stage is prolonged, consider: position assessment (is it OP?), instrumental delivery (forceps or vacuum), or caesarean if descent has stalled.") sp() h2("Third Stage of Labor") h3("Signs of Placental Separation") bullet("Gush of blood per vaginam") bullet("Lengthening of the umbilical cord (most reliable clinical sign)") bullet("Uterus rises and becomes globular and firm") bullet("Placenta visible at the vaginal introitus") sp() h3("Active Management of Third Stage (AMTSL)") key_point("Active management of third stage reduces PPH risk by 60-70%. This is the standard of care.") make_table( ["Step", "Action"], [ ["1", "Oxytocin 10 IU IM (or IV infusion) — given within 1 min of baby's birth"], ["2", "Controlled cord traction (Brandt-Andrews manoeuvre) — only after signs of separation"], ["3", "Uterine massage after placenta delivered"], ], col_widths=[1.5*cm, 16*cm] ) warn("Do NOT apply cord traction before signs of separation — risk of cord avulsion or uterine inversion.") sp() h3("Placental Delivery Methods") make_table( ["Method", "Description"], [ ["Schultze mechanism", "Placenta delivers fetal surface first — most common (~80%). Retroplacental clot expels it centrally."], ["Duncan mechanism", "Placenta slides out sideways, maternal surface first (~20%). Lower segment placenta."], ], col_widths=[4*cm, 13.5*cm] ) sp() # ═══════════════════════════════════════════════════════════════════════════ # SECTION 4 – PAIN RELIEF IN LABOR # ═══════════════════════════════════════════════════════════════════════════ section_banner("4. PAIN RELIEF IN LABOR") h2("Pain Pathways") make_table( ["Stage", "Source of pain", "Nerve pathway", "Referred to"], [ ["1st stage (latent)", "Uterine contractions", "T10-L1 via hypogastric plexus", "Lower back/abdomen"], ["1st stage (active)", "Cervical dilatation", "S2-S4 via pelvic (sacral) plexus", "Sacrum"], ["2nd stage", "Vaginal/perineal stretching", "S2-S4 via pudendal nerve", "Perineum, thighs"], ], col_widths=[3.5*cm, 4.5*cm, 5*cm, 4.5*cm] ) sp() h2("Epidural Analgesia") key_point("Gold standard for labor analgesia in Australia. Most commonly used in hospital settings.") bullet("Catheter placed in L2-L3 or L3-L4 epidural space") bullet("Drug: low-dose local anaesthetic (bupivacaine 0.1%) + opioid (fentanyl)") bullet("Provides excellent pain relief for 1st and 2nd stage") h3("Contraindications to Epidural") bullet("Patient refusal") bullet("Coagulopathy / anticoagulation (check platelets, INR)") bullet("Local infection at insertion site") bullet("Uncorrected hypovolaemia") bullet("Some neurological disorders (relative)") warn("Epidural prolongs 2nd stage — be aware of this when assessing progress.") sp() h2("Parenteral Opioids") make_table( ["Drug", "Dose", "Notes"], [ ["Morphine", "2-5 mg IV / 5-10 mg IM", "Commonly used; respiratory depression risk"], ["Pethidine (Meperidine)", "50-100 mg IM", "Avoid if delivery expected within 4 hours (neonatal respiratory depression)"], ["Fentanyl", "25-50 mcg IV", "Rapid onset; short duration"], ], col_widths=[3.5*cm, 5*cm, 9*cm] ) warn("Give naloxone to neonate if respiratory depression occurs after opioid administration to mother.") sp() h2("Regional Nerve Blocks") make_table( ["Block", "Nerve blocked", "Site of injection", "Use"], [ ["Paracervical block", "Pelvic plexus (cervical pain)", "Lateral vaginal fornix (4 & 8 o'clock)", "1st stage pain — rarely used now (fetal bradycardia risk 15%)"], ["Pudendal nerve block", "Pudendal nerve (S2-S4)", "Ischial spine (transvaginal)", "2nd stage; episiotomy repair; instrumental delivery"], ], col_widths=[3.5*cm, 4*cm, 4.5*cm, 5.5*cm] ) amc_tip("Pudendal block: drug is lignocaine (lidocaine), landmark is ischial spine, ligament pierced is sacrospinous. It covers perineum but NOT uterine pain.") sp() h2("Nitrous Oxide (Entonox)") bullet("50% N2O / 50% O2 inhaled — patient self-administers") bullet("Provides mild-moderate analgesia with rapid onset and offset") bullet("Safe for fetus; does not affect labor progress") bullet("Common in Australian midwifery-led settings") sp() # ═══════════════════════════════════════════════════════════════════════════ # SECTION 5 – INDUCTION OF LABOR # ═══════════════════════════════════════════════════════════════════════════ section_banner("5. INDUCTION OF LABOR (IOL)") h2("Indications for IOL") make_table( ["Category", "Examples"], [ ["Post-dates", "41+0 to 42+0 weeks (discuss at 41 weeks; ACOG recommends offering from 39 weeks)"], ["Maternal", "Pre-eclampsia, gestational diabetes poorly controlled, IUGR, obstetric cholestasis"], ["Fetal", "Postmaturity, macrosomia, fetal compromise"], ["Ruptured membranes", "PROM at term (>37 weeks) — induce if labor not established within 24 h"], ], col_widths=[3.5*cm, 14*cm] ) sp() h2("Bishop Score — Cervical Assessment Before IOL") body("Assesses cervical favorability. Higher score = more favorable cervix = better outcome with IOL.") make_table( ["Parameter", "0", "1", "2", "3"], [ ["Dilatation (cm)", "Closed", "1-2", "3-4", "≥5"], ["Effacement (%)", "<30", "40-50", "60-70", "≥80"], ["Station", "-3", "-2", "-1/0", "+1/+2"], ["Consistency", "Firm", "Medium", "Soft", "—"], ["Position", "Posterior", "Mid", "Anterior", "—"], ], col_widths=[3.5*cm, 3*cm, 3*cm, 3*cm, 5*cm] ) key_point("Bishop score ≥8 = favorable — IOL likely to succeed with oxytocin alone. Score ≤5 = cervical ripening needed first.") amc_tip("AMC focus: Bishop score 8+ = proceed to oxytocin. Below 5 = use prostaglandins for ripening first. Maximum possible score = 13.") sp() h2("Methods of Cervical Ripening") make_table( ["Method", "Drug/Device", "Dose & Route", "Key Points"], [ ["PGE2 (Dinoprostone)", "Cervidil (vaginal insert) or Prepidil gel", "Gel 0.5 mg intracervical q6h (max 3 doses); Insert 10 mg vaginal (controlled release)", "Remove Cervidil if hyperstimulation or CTG abnormality. Wait 30-60 min before oxytocin."], ["PGE1 (Misoprostol)", "25 mcg PV q4h or 50 mcg PO q4h", "PV 25 mcg every 4 h (WHO); or 50 mcg PO q4h", "Cheaper, heat stable, widely used. Avoid in prior uterine scar."], ["Mechanical", "Balloon catheter (Foley or double-balloon)", "Transcervical Foley 30-60 mL", "Safe in previous caesarean. No uterotonic effect."], ["Membrane sweep", "Manual", "Performed at 38-41 weeks", "Reduces need for formal IOL. Can cause discomfort, spotting."], ], col_widths=[3*cm, 3.5*cm, 4*cm, 7*cm] ) warn("Misoprostol and Dinoprostone are CONTRAINDICATED in women with a previous uterine scar (e.g., prior caesarean) due to risk of uterine rupture.") sp() h2("Oxytocin Infusion") bullet("Start: 1-2 mU/min IV, increase by 1-2 mU/min every 20-40 min") bullet("Target: 3 contractions in 10 min, each lasting 40-60 s") bullet("Maximum: 20-40 mU/min (protocol-dependent)") h3("Complications of Oxytocin") bullet("Uterine hyperstimulation (tachysystole: >5 contractions/10 min)") bullet("Fetal distress (late decelerations on CTG)") bullet("Hyponatraemia (if high doses with hypotonic fluids — oxytocin has ADH-like effect)") bullet("Uterine rupture (especially with prior scar)") warn("If uterine tachysystole occurs: STOP oxytocin, place patient in left lateral position, give O2, consider terbutaline 0.25 mg SC as tocolysis.") sp() h2("Contraindications to IOL") bullet("Placenta praevia / vasa praevia") bullet("Transverse / oblique lie") bullet("Previous classical (vertical) uterine incision") bullet("Active genital herpes") bullet("Cord prolapse") bullet("Previous myomectomy entering uterine cavity") amc_tip("Previous LOWER SEGMENT caesarean is NOT an absolute contraindication to IOL — VBAC (vaginal birth after caesarean) can be planned, but requires careful monitoring and NO misoprostol.") sp() # ═══════════════════════════════════════════════════════════════════════════ # SECTION 6 – ABNORMAL LABOR # ═══════════════════════════════════════════════════════════════════════════ section_banner("6. ABNORMAL LABOR / DYSTOCIA") h2("The 3 P's Framework") make_table( ["P", "Component", "Examples of problems"], [ ["Power", "Uterine contractions", "Hypotonic uterine dysfunction, inadequate contractions"], ["Passenger", "Fetus (size, position, presentation)", "Macrosomia, OP position, face/brow, shoulder dystocia"], ["Passage", "Bony pelvis + soft tissues", "CPD (cephalopelvic disproportion), cervical dystocia"], ], col_widths=[1.5*cm, 4.5*cm, 11.5*cm] ) sp() h2("Partogram") body("A graphical record of labor progress. Used to identify slow progress and guide management decisions.") bullet("Alert line: starts at 4 cm, slopes at 1 cm/hr. If cervicograph touches alert line → transfer to higher care.") bullet("Action line: 4 hours to the right of alert line. If crossed → intervention required.") key_point("New WHO 2018 guideline: active phase starts at 5 cm, mean duration of active phase up to 12 h (nullipara) and 10 h (multipara).") sp() h2("Prolonged Latent Phase") bullet("Nullipara: >20 hours; Multipara: >14 hours") bullet("Causes: unripe cervix, sedation, false labor") bullet("Management: therapeutic rest (morphine sedation), then reassess; AROM if cervix favorable") sp() h2("Protracted / Arrested Active Phase") make_table( ["Diagnosis", "Definition (ACOG)", "Management"], [ ["Protracted active phase", "Dilatation <1 cm/hr after 4 h of adequate contractions", "Amniotomy + oxytocin augmentation"], ["Active phase arrest", "No dilatation for ≥4 h with adequate contractions (>200 MVU), or ≥6 h with inadequate contractions", "Caesarean section"], ["Protracted descent (2nd stage)", "Nullipara <1 cm/hr descent; Multipara <2 cm/hr", "Assess fetal position; consider instrumental"], ["Arrest of descent", "No descent for ≥1 h (nullipara) or 30 min (multipara) in 2nd stage", "Instrumental delivery or caesarean"], ], col_widths=[4*cm, 7*cm, 6.5*cm] ) amc_tip("Before diagnosing failure to progress, always confirm: adequate contractions (>200 Montevideo units or 3 ctx/10 min × 40 s), ruptured membranes, and correct fetal position assessment.") sp() h2("Occipitoposterior (OP) Position") body("Occiput faces the maternal sacrum. Complicates 5-10% of term labors.") bullet("Presents as: prolonged labor, severe back pain, incomplete fetal rotation") bullet("Spontaneous rotation to OA occurs in ~90% of cases") bullet("If persistent OP: manual rotation, rotational forceps (Kielland's), or caesarean") amc_tip("Persistent OP is a common AMC scenario. Slow progress + severe back pain + OP on VE = offer epidural, consider amniotomy + oxytocin, reassess in 4 hours.") sp() h2("Obstructed Labor") body("Complete arrest of labor due to mechanical obstruction despite adequate contractions.") bullet("Causes: CPD, brow presentation, shoulder dystocia, hydrocephalus") bullet("Signs: Bandl's ring (retraction ring between upper and lower uterine segment), maternal exhaustion, fetal distress, moulding +3") warn("Management: ALWAYS caesarean section. Never attempt vaginal delivery if obstructed. Never give oxytocin.") make_table( ["Feature", "Bandl's Ring (Pathological)", "Constriction Ring (Schroeder)"], [ ["Cause", "Obstructed labor", "Injudicious oxytocin use"], ["Location", "Junction of upper and lower uterine segment", "Anywhere in uterus"], ["Stage", "2nd stage", "1st or 2nd stage"], ["Detection", "Visible and palpable abdominally", "Felt only on vaginal exam"], ["Fetal parts", "Can be felt", "Cannot be felt"], ["Mother", "Maternal distress, dehydration", "Mother and fetus normal"], ["Management", "Caesarean", "Sedation; if ring reappears → lower segment caesarean"], ], col_widths=[3.5*cm, 7.5*cm, 6.5*cm] ) sp() # ═══════════════════════════════════════════════════════════════════════════ # SECTION 7 – CTG INTERPRETATION # ═══════════════════════════════════════════════════════════════════════════ section_banner("7. CTG INTERPRETATION (ACOG/RANZCOG)") h2("CTG Features — ACOG 3-Tier System") make_table( ["Parameter", "Normal / Reassuring", "Concerning / Non-reassuring", "Abnormal / Ominous"], [ ["Baseline FHR", "110-160 bpm", "100-109 or 161-180 bpm", "<100 or >180 bpm"], ["Variability", "6-25 bpm (moderate)", "5 bpm (minimal) or absent", "Absent or sinusoidal"], ["Accelerations", "Present (≥15 bpm × 15 s)", "Absent (after 32 wk)", "Absent (pre-terminal sign)"], ["Decelerations", "None or early decels", "Variable decels", "Late or prolonged decels"], ], col_widths=[3*cm, 4.5*cm, 4.5*cm, 5.5*cm] ) key_point("Category I CTG (normal) = all features normal. Category III (abnormal) = absent variability + late/variable decels or bradycardia → immediate delivery.") sp() h2("Deceleration Types") make_table( ["Type", "Timing", "Shape", "Cause", "Significance"], [ ["Early", "With contraction (mirror image)", "Uniform", "Head compression (vagal)", "Normal — benign"], ["Late", "After contraction peak (lag of >30 s)", "Uniform, gradual", "Uteroplacental insufficiency", "Ominous if repeated"], ["Variable", "Abrupt onset, variable timing", "V-shaped, variable depth", "Cord compression", "Concerning if severe/prolonged"], ["Prolonged", ">2 min, <10 min", "Any", "Abruption, cord prolapse, maternal hypotension", "Requires urgent review"], ], col_widths=[2.2*cm, 4*cm, 2.8*cm, 4*cm, 4.5*cm] ) amc_tip("Late decelerations even of small amplitude are significant — they indicate uteroplacental insufficiency. Act on pattern, not single decel.") sp() h2("Management of Abnormal CTG") bullet("Step 1: Identify and correct the cause (position change, stop oxytocin, IV fluids, O2)") bullet("Step 2: Perform fetal scalp stimulation — acceleration = reassuring") bullet("Step 3: Category III or non-responsive → fetal blood sampling (pH <7.20 = deliver) or immediate delivery") bullet("Step 4: Mode of delivery depends on cervical dilatation and urgency") sp() # ═══════════════════════════════════════════════════════════════════════════ # SECTION 8 – PPH # ═══════════════════════════════════════════════════════════════════════════ section_banner("8. POSTPARTUM HAEMORRHAGE (PPH)") h2("Definition") bullet("Primary PPH: blood loss ≥500 mL after vaginal delivery (or ≥1000 mL after caesarean) within 24 hours") bullet("Minor PPH: 500-1000 mL without shock") bullet("Major PPH: >1000 mL or any amount with shock") bullet("Secondary PPH: abnormal bleeding between 24 hours and 12 weeks postpartum (usually subinvolution or infection)") sp() h2("Causes — The 4 T's") make_table( ["T", "Cause", "Frequency", "Immediate Management"], [ ["Tone", "Uterine atony", "70-80%", "Bimanual compression, uterotonics (oxytocin, ergometrine, carboprost, misoprostol)"], ["Tissue", "Retained placenta/clots", "10%", "Manual removal of placenta; uterine exploration under anaesthesia"], ["Trauma", "Laceration, uterine rupture, inversion", "10%", "Surgical repair, B-Lynch suture, hysterectomy if refractory"], ["Thrombin", "Coagulopathy (DIC)", "1%", "FFP, cryoprecipitate, platelets, TXA"], ], col_widths=[1.5*cm, 3.5*cm, 2.5*cm, 10*cm] ) sp() h2("Uterotonics for PPH") make_table( ["Drug", "Route", "Dose", "Key Points / Cautions"], [ ["Oxytocin", "IV/IM", "10 IU IM; 20-40 IU in 1L NS IV infusion", "1st line. Rapid IV bolus causes hypotension — avoid."], ["Ergometrine", "IM/IV", "0.5 mg IM", "Avoid in hypertension, heart disease, pre-eclampsia."], ["Syntometrine", "IM", "Oxytocin 5 IU + ergometrine 0.5 mg", "Avoid in hypertension."], ["Carboprost (PGF2α)", "IM", "0.25 mg IM, q15 min, max 8 doses", "Avoid in asthma (bronchoconstriction). Most potent uterotonic."], ["Misoprostol (PGE1)", "PO/SL/PR", "800-1000 mcg PR or SL", "Heat stable; 2nd line if oxytocin unavailable. S/E: fever."], ["Tranexamic acid (TXA)", "IV", "1 g IV over 10 min (give within 3 h of birth)", "WHO WOMAN trial: significantly reduces PPH mortality. Give early."], ], col_widths=[3*cm, 2*cm, 4*cm, 8.5*cm] ) key_point("Tranexamic acid 1 g IV within 3 hours of PPH onset reduces mortality — give it early in all PPH cases (WOMAN trial, NEJM 2017).") warn("Carboprost is CONTRAINDICATED in asthma. Ergometrine is CONTRAINDICATED in hypertension.") sp() h2("Surgical Options for Refractory PPH") bullet("Uterine compression sutures (B-Lynch, Hayman)") bullet("Intrauterine balloon tamponade (Bakri balloon)") bullet("Uterine / internal iliac artery ligation") bullet("Interventional radiology: uterine artery embolisation") bullet("Peripartum hysterectomy — last resort, definitive") amc_tip("In the AMC scenario-based exam: escalate stepwise — bimanual compression → uterotonics → surgical if refractory. Document blood loss, call for help early, 2 large-bore IV lines, cross-match.") sp() # ═══════════════════════════════════════════════════════════════════════════ # SECTION 9 – FISTULA & OBSTRUCTED LABOR COMPLICATIONS # ═══════════════════════════════════════════════════════════════════════════ section_banner("9. COMPLICATIONS — VESICOVAGINAL FISTULA & UTERINE RUPTURE") h2("Vesicovaginal Fistula (VVF)") body("Abnormal communication between bladder and vagina. In obstetric context: prolonged obstructed labor causing ischaemic necrosis.") bullet("Most common cause in developing countries: obstructed labor") bullet("Most common cause in developed countries (Australia): iatrogenic — hysterectomy") bullet("Presents: continuous urinary leakage per vaginum, ~7-14 days after delivery") bullet("Diagnosis: examination, dye test (methylene blue), cystoscopy") bullet("Management: catheter drainage initially; surgical repair after 3-6 months (wait for inflammation to settle)") note("Latzko and Chassar Moir techniques are used for surgical repair.") sp() h2("Uterine Rupture") make_table( ["Feature", "Complete rupture", "Incomplete (scar dehiscence)"], [ ["Definition", "Full thickness breach of uterine wall + peritoneum", "Uterine wall tears but visceral peritoneum intact"], ["Risk factors", "Previous uterine scar (LSCS/myomectomy), obstructed labor, grand multipara, oxytocin misuse", "Previous LSCS"], ["Signs", "Sudden tearing pain, cessation of contractions, fetal parts palpable abdominally, maternal shock, absent FHR", "May be asymptomatic; incidental finding at LSCS"], ["Management", "Emergency laparotomy, repair or hysterectomy, blood transfusion", "Usually observation or repair at LSCS"], ], col_widths=[3.5*cm, 7*cm, 7*cm] ) warn("If uterine rupture is suspected: immediate emergency laparotomy. Do not delay for investigations.") sp() # ═══════════════════════════════════════════════════════════════════════════ # SECTION 10 – AMC CLINICAL SCENARIOS QUICK REFERENCE # ═══════════════════════════════════════════════════════════════════════════ section_banner("10. AMC QUICK SCENARIOS & HIGH-YIELD POINTS", color=TEAL) h2("Top AMC Labor Topics") key_point("1. Active management of 3rd stage: oxytocin 10 IU IM is 1st line for ALL patients.") key_point("2. IOL post-dates: discuss at 41 weeks, offer membrane sweep; formal IOL if not in labor by 41+0 to 42+0.") key_point("3. OP position: slow labor + back pain + persistent OP on VE → epidural + oxytocin + reassess in 4 h.") key_point("4. Abnormal CTG: stop oxytocin → left lateral → O2 → scalp stimulation → if unresolved → deliver.") key_point("5. PPH: bimanual uterine compression + oxytocin 10 IU IV/IM + IV access x2 + call for help + TXA within 3 h.") key_point("6. Shoulder dystocia: McRoberts manoeuvre + suprapubic pressure first. Never fundal pressure.") key_point("7. Cord prolapse: elevate presenting part manually or fill bladder → emergency caesarean.") key_point("8. Meconium in liquor: thin meconium = monitor; thick meconium + CTG abnormality = deliver urgently.") sp() h2("Critical Drug Contraindications to Remember") make_table( ["Drug", "Contraindicated in"], [ ["Ergometrine / Syntometrine", "Hypertension, pre-eclampsia, heart disease"], ["Carboprost (PGF2α)", "Asthma (bronchospasm risk)"], ["Misoprostol (IOL)", "Previous uterine scar / prior caesarean"], ["NSAIDs (post-partum)", "Renal impairment, peptic ulcer, hypersensitivity"], ["Oxytocin rapid IV bolus", "Hypotension risk — always dilute or give IM"], ], col_widths=[5.5*cm, 12*cm] ) sp() h2("Normal Labor Values — Quick Reference") make_table( ["Parameter", "Value"], [ ["Latent phase limit (nullipara / multipara)", ">20 h / >14 h = prolonged"], ["Active phase cervical dilatation rate", "≥1 cm/hr"], ["Active phase (WHO 2018)", "Starts at 5 cm"], ["2nd stage limit without epidural (nullipara/multipara)", "2 h / 1 h"], ["2nd stage limit with epidural (nullipara/multipara)", "3 h / 2 h"], ["Normal fetal heart rate", "110-160 bpm"], ["Normal CTG variability", "6-25 bpm"], ["Adequate contractions", "3 in 10 min, each ≥40 s, or >200 MVU"], ["Oxytocin start dose", "1-2 mU/min IV, titrate to response"], ["PPH definition (vaginal)", "≥500 mL within 24 hours"], ["PPH definition (caesarean)", "≥1000 mL within 24 hours"], ["TXA dose in PPH", "1 g IV over 10 min, within 3 hours"], ], col_widths=[8*cm, 9.5*cm] ) sp() sp() story.append(Paragraph( "These notes are AMC-oriented and follow RANZCOG, ACOG, and WHO 2018 guidelines. " "Always cross-reference with current Australian guidelines for clinical use.", S("FOOT", fontSize=7.5, textColor=colors.grey, alignment=TA_CENTER, leading=11) )) doc.build(story) print("PDF generated successfully.") PYEOF python3 /home/daytona/workspace/labor-amc/build_pdf.py
ls -lh /home/daytona/workspace/labor-amc/Labor_AMC_Notes.pdf
Labor AMC Notes
PDF Document · PDF
?
Send me the notes
Labor AMC Notes
PDF Document · PDF
Shows error
ls -lh /home/daytona/workspace/labor-amc/ && file /home/daytona/workspace/labor-amc/Labor_AMC_Notes.pdf
Labor AMC Notes
PDF Document · PDF
It's coming up as .pdf.json
cp /home/daytona/workspace/labor-amc/Labor_AMC_Notes.pdf /home/daytona/workspace/Labor_AMC_Notes.pdf && ls -lh /home/daytona/workspace/Labor_AMC_Notes.pdf
Labor AMC Notes
PDF Document · PDF
.pdf.json, the best fix is to rename it after downloading:Labor_AMC_Notes.pdf.json).json part so it becomes Labor_AMC_Notes.pdf.json to the filename. Renaming it will fix it immediately.What happemed
.pdf.json instead of .pdf.Labor_AMC_Notes.pdf.json).json from the end → now reads Labor_AMC_Notes.pdf.json wrapping issueOption 2
ls /home/daytona/skills/docx/scripts/office/ && node --version
ls /home/daytona/workspace/labor-amc/ && npm list -g docx 2>/dev/null | head -5; node -e "require('docx'); console.log('docx ok')" 2>&1
Failed to delete session:
We encountered an error while processing your request. Please try again or reach out to us for help.
Again
node -e "require('docx'); console.log('docx ok')" 2>&1 && ls /home/daytona/workspace/labor-amc/
~/labor-amc/build_docx.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, WidthType, BorderStyle, ShadingType,
PageBreak, VerticalAlign, Header, Footer, PageNumber
} = require('docx');
const fs = require('fs');
// ── helpers ──────────────────────────────────────────────────────────────
const DARK_BLUE = "1A3A5C";
const MID_BLUE = "2E6DA4";
const TEAL = "007B7F";
const ORANGE = "E07B00";
const WHITE = "FFFFFF";
const LIGHT_BG = "D6E8F7";
const GREEN_BG = "E8F5E9";
const GREEN_FG = "2E7D32";
const RED_BG = "FDECEA";
const RED_FG = "C62828";
const AMBER_BG = "FFF3CD";
const INDIGO_BG = "E8EAF6";
const INDIGO_FG = "1A237E";
const GREY = "CCCCCC";
function sp(n = 1) {
return new Paragraph({ text: "", spacing: { after: n * 80 } });
}
function heading1(text, color = DARK_BLUE) {
return new Paragraph({
children: [new TextRun({ text, bold: true, color: WHITE, size: 28 })],
shading: { type: ShadingType.SOLID, color, fill: color },
spacing: { before: 200, after: 100 },
indent: { left: 100, right: 100 },
});
}
function heading2(text) {
return new Paragraph({
children: [new TextRun({ text, bold: true, color: DARK_BLUE, size: 24 })],
spacing: { before: 160, after: 60 },
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: MID_BLUE } },
});
}
function heading3(text) {
return new Paragraph({
children: [new TextRun({ text, bold: true, color: TEAL, size: 22 })],
spacing: { before: 120, after: 40 },
});
}
function body(text) {
return new Paragraph({
children: [new TextRun({ text, size: 20 })],
spacing: { after: 60 },
alignment: AlignmentType.JUSTIFIED,
});
}
function bullet(text, level = 0) {
return new Paragraph({
children: [new TextRun({ text, size: 20 })],
bullet: { level },
spacing: { after: 40 },
});
}
function warn(text) {
return new Paragraph({
children: [new TextRun({ text: `⚠ ${text}`, bold: true, color: RED_FG, size: 19 })],
shading: { type: ShadingType.SOLID, color: RED_BG, fill: RED_BG },
spacing: { before: 60, after: 60 },
indent: { left: 120 },
border: { left: { style: BorderStyle.THICK, size: 12, color: RED_FG } },
});
}
function keyPoint(text) {
return new Paragraph({
children: [new TextRun({ text: `★ ${text}`, bold: true, color: GREEN_FG, size: 19 })],
shading: { type: ShadingType.SOLID, color: GREEN_BG, fill: GREEN_BG },
spacing: { before: 60, after: 60 },
indent: { left: 120 },
border: { left: { style: BorderStyle.THICK, size: 12, color: GREEN_FG } },
});
}
function amcTip(text) {
return new Paragraph({
children: [new TextRun({ text: `AMC FOCUS: ${text}`, bold: true, color: INDIGO_FG, size: 19 })],
shading: { type: ShadingType.SOLID, color: INDIGO_BG, fill: INDIGO_BG },
spacing: { before: 60, after: 60 },
indent: { left: 120 },
border: { left: { style: BorderStyle.THICK, size: 12, color: "3949AB" } },
});
}
function note(text) {
return new Paragraph({
children: [new TextRun({ text: `Note: ${text}`, italics: true, color: "555555", size: 18 })],
spacing: { after: 40 },
indent: { left: 200 },
});
}
function makeTable(headers, rows, widths) {
const totalW = 9500;
const colW = widths || headers.map(() => Math.floor(totalW / headers.length));
const headerRow = new TableRow({
children: headers.map((h, i) => new TableCell({
children: [new Paragraph({
children: [new TextRun({ text: h, bold: true, color: WHITE, size: 18 })],
alignment: AlignmentType.LEFT,
})],
shading: { type: ShadingType.SOLID, color: MID_BLUE, fill: MID_BLUE },
width: { size: colW[i], type: WidthType.DXA },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 80, right: 80 },
})),
tableHeader: true,
});
const dataRows = rows.map((row, ri) => new TableRow({
children: row.map((cell, ci) => new TableCell({
children: [new Paragraph({
children: [new TextRun({ text: String(cell), size: 18 })],
})],
shading: ri % 2 === 0
? { type: ShadingType.SOLID, color: WHITE, fill: WHITE }
: { type: ShadingType.SOLID, color: LIGHT_BG, fill: LIGHT_BG },
width: { size: colW[ci], type: WidthType.DXA },
margins: { top: 60, bottom: 60, left: 80, right: 80 },
})),
}));
return new Table({
rows: [headerRow, ...dataRows],
width: { size: totalW, type: WidthType.DXA },
borders: {
top: { style: BorderStyle.SINGLE, size: 4, color: GREY },
bottom: { style: BorderStyle.SINGLE, size: 4, color: GREY },
left: { style: BorderStyle.SINGLE, size: 4, color: GREY },
right: { style: BorderStyle.SINGLE, size: 4, color: GREY },
insideH:{ style: BorderStyle.SINGLE, size: 4, color: GREY },
insideV:{ style: BorderStyle.SINGLE, size: 4, color: GREY },
},
});
}
// ═══════════════════════════════════════════════════════════════════════════
// DOCUMENT CONTENT
// ═══════════════════════════════════════════════════════════════════════════
const children = [];
// COVER
children.push(sp(4));
children.push(new Paragraph({
children: [new TextRun({ text: "LABOR", bold: true, size: 64, color: WHITE })],
alignment: AlignmentType.CENTER,
shading: { type: ShadingType.SOLID, color: DARK_BLUE, fill: DARK_BLUE },
spacing: { before: 200, after: 0 },
indent: { left: 200, right: 200 },
}));
children.push(new Paragraph({
children: [new TextRun({ text: "AMC-Oriented Clinical Notes", size: 30, color: "90CAF9" })],
alignment: AlignmentType.CENTER,
shading: { type: ShadingType.SOLID, color: DARK_BLUE, fill: DARK_BLUE },
spacing: { before: 0, after: 0 },
indent: { left: 200, right: 200 },
}));
children.push(new Paragraph({
children: [new TextRun({ text: "Obstetrics & Gynaecology | Australian Medical Council", size: 22, color: "BBDEFB" })],
alignment: AlignmentType.CENTER,
shading: { type: ShadingType.SOLID, color: DARK_BLUE, fill: DARK_BLUE },
spacing: { before: 0, after: 200 },
indent: { left: 200, right: 200 },
}));
children.push(sp(2));
children.push(amcTip(
"These notes follow RANZCOG, ACOG, and WHO 2018 guidelines. NEET PG-specific eponyms, " +
"Indian statistics, and lecture-format timestamps have been removed. Focus is on: correct " +
"management steps, drug doses, thresholds, and clinical reasoning for the Australian context."
));
children.push(sp(2));
// ── SECTION 1 ──────────────────────────────────────────────────────────────
children.push(heading1("1. TERMINOLOGY OF LABOR"));
children.push(heading2("Fetal Lie"));
children.push(body("The relationship between the long axis of the fetus and the long axis of the uterus."));
children.push(makeTable(
["Lie", "Definition", "Management"],
[
["Longitudinal", "Fetal & uterine axes are parallel. Normal.", "Vaginal delivery possible if cephalic presentation"],
["Transverse", "Fetal axis is perpendicular to uterus.", "Caesarean section — alive or dead fetus"],
["Oblique", "Intermediate — converts in labor.", "Caesarean if persists in labor"],
],
[2200, 4500, 2800]
));
children.push(sp());
children.push(keyPoint("Transverse lie = highest risk of cord prolapse. Never attempt vaginal delivery."));
children.push(sp());
children.push(heading2("Unstable Lie"));
children.push(body("Lie not fixed by 37 weeks gestation."));
children.push(bullet("Causes: polyhydramnios, placenta praevia, uterine abnormality, multiparity"));
children.push(bullet("Management: elective caesarean section at 37-38 weeks"));
children.push(amcTip("Patient presents in labor with transverse lie → always caesarean, regardless of fetal viability."));
children.push(sp());
children.push(heading2("Fetal Presentation"));
children.push(body("The part of the fetus occupying the lower uterine segment."));
children.push(makeTable(
["Presentation", "Lie", "Notes"],
[
["Cephalic (vertex)", "Longitudinal", "Normal — 96% of term deliveries"],
["Breech", "Longitudinal", "Most common malpresentation (~3-4%)"],
["Shoulder", "Transverse", "Requires caesarean"],
["Face", "Longitudinal", "Mentoanterior can deliver vaginally; mentoposterior cannot"],
["Brow", "Longitudinal", "Largest diameter presented — almost always requires caesarean"],
["Compound", "Any", "Limb prolapsed alongside presenting part"],
],
[2200, 2000, 5300]
));
children.push(sp());
children.push(amcTip("Brow presentation: persistent = caesarean. Converts to vertex or face = may deliver vaginally."));
children.push(sp());
children.push(heading2("Presenting Part"));
children.push(makeTable(
["Head position", "Presenting part", "Diameter presented"],
[
["Well flexed (normal)", "Vertex (occiput)", "Suboccipitobregmatic ~9.5 cm"],
["Partially extended", "Brow (sinciput)", "Mentovertical ~13.5 cm (largest)"],
["Fully extended", "Face (chin)", "Submentobregmatic ~9.5 cm"],
],
[3000, 3200, 3300]
));
children.push(sp());
children.push(heading2("Position"));
children.push(body("Relationship of a fixed denominator point on the presenting part to the maternal pelvis."));
children.push(makeTable(
["Presentation", "Denominator"],
[
["Vertex (cephalic)", "Occiput"],
["Face", "Mentum (chin)"],
["Breech", "Sacrum"],
["Shoulder", "Acromion"],
],
[4500, 5000]
));
children.push(sp());
children.push(keyPoint("Most common position at onset of labor: LOT (left occiput transverse). Most common at delivery: LOA."));
children.push(sp());
children.push(heading2("Station"));
children.push(body("Level of presenting part relative to ischial spines (measured in cm)."));
children.push(bullet("0 station = at the ischial spines = engaged"));
children.push(bullet("Negative station (-1, -2, -3) = above ischial spines (not yet engaged)"));
children.push(bullet("Positive station (+1, +2, +3) = below ischial spines (deeper in pelvis)"));
children.push(keyPoint("Engagement in a nullipara occurs at ~38 weeks. In a multipara, at the onset of labor."));
children.push(sp(2));
// ── SECTION 2 ──────────────────────────────────────────────────────────────
children.push(heading1("2. MECHANISM OF LABOR"));
children.push(body("Normal labor: longitudinal lie, cephalic presentation, LOT starting position."));
children.push(sp());
children.push(heading2("The 7 Cardinal Movements"));
children.push(makeTable(
["#", "Movement", "Key Detail"],
[
["1", "Engagement", "BPD passes through pelvic inlet. Head at 0 station."],
["2", "Descent", "Most important driver = uterine contractions. Occurs throughout labor."],
["3", "Flexion", "Chin to chest — reduces diameter presented. Simultaneous with descent."],
["4", "Internal rotation", "Occiput rotates anteriorly (LOT → LOA → OA). At level of ischial spines."],
["5", "Extension", "Head delivered under pubic symphysis by extension."],
["6", "Restitution / External rotation", "Head rotates back to align with shoulders. Shoulders enter AP diameter."],
["7", "Expulsion", "Anterior shoulder born first, then posterior shoulder by lateral flexion."],
],
[500, 2500, 6500]
));
children.push(sp());
children.push(keyPoint("Crowning = head permanently visible at perineum without retraction. Episiotomy given at crowning if needed."));
children.push(amcTip("Flexion reduces the diameter presented. Internal rotation is driven by the pelvic floor (levator ani)."));
children.push(sp());
children.push(heading2("Engagement — Abdominal Assessment (Fifths Palpable)"));
children.push(makeTable(
["Fifths palpable above pubis", "Meaning"],
[
["5/5", "Not engaged at all"],
["3/5", "At the brim — not yet engaged"],
["2/5", "Engaged (BPD through inlet)"],
["0/5", "Deeply engaged"],
],
[4000, 5500]
));
children.push(sp(2));
// ── SECTION 3 ──────────────────────────────────────────────────────────────
children.push(heading1("3. NORMAL LABOR"));
children.push(heading2("True Labor vs. False Labor"));
children.push(makeTable(
["Feature", "True Labor", "False Labor (Braxton Hicks)"],
[
["Contractions", "Regular, increasing frequency & intensity", "Irregular, not intensifying"],
["Cervical change", "Progressive effacement & dilatation", "No change"],
["Effect of analgesia/ambulation", "Contractions continue", "Often resolves"],
["Show", "May be present", "Absent"],
],
[2800, 3400, 3300]
));
children.push(sp());
children.push(heading2("Stages of Labor"));
children.push(makeTable(
["Stage", "Begins", "Ends", "Duration (nullipara / multipara)"],
[
["1st stage", "Onset of true labor", "Full dilatation (10 cm)", "~12 h / ~6 h"],
["2nd stage", "Full dilatation", "Delivery of baby", "Up to 3 h / 2 h (with epidural)"],
["3rd stage", "Delivery of baby", "Delivery of placenta", "Up to 30 min (actively managed)"],
["4th stage", "Delivery of placenta", "2 hours post-delivery", "Observation for PPH"],
],
[1800, 2800, 2800, 2100]
));
children.push(sp());
children.push(heading2("First Stage — Phases"));
children.push(heading3("Latent Phase"));
children.push(bullet("Onset of labor to ~5 cm dilatation (WHO 2018: active phase starts at 5 cm)"));
children.push(bullet("Irregular, mild contractions; cervical effacement occurs"));
children.push(bullet("Prolonged latent phase: >20 h (nullipara), >14 h (multipara)"));
children.push(sp());
children.push(heading3("Active Phase"));
children.push(bullet("5 cm to full dilatation (10 cm) — WHO 2018 guideline"));
children.push(bullet("Expected rate: at least 1 cm/hr cervical dilatation"));
children.push(bullet("Adequate contractions: 3 in 10 minutes, each lasting 40-60 seconds"));
children.push(keyPoint("AMC/WHO 2018: active phase starts at 5 cm (not 4 cm). Failure to progress = <1 cm/hr over 4 h."));
children.push(sp());
children.push(heading2("Management of First Stage"));
children.push(makeTable(
["Action", "Details"],
[
["Ambulation", "Encouraged in early labor. Left lateral position in active labor (prevents aortocaval compression)."],
["Oral intake", "Clear fluids allowed. Solid food avoided — delayed gastric emptying, aspiration risk."],
["Fetal monitoring", "CTG for high-risk pregnancies. Intermittent auscultation q15 min (active) / q30 min (latent) for low-risk."],
["Vaginal examination", "Every 4 hours in active phase: dilatation, effacement, station, position, membranes."],
["IV access", "Establish if high-risk, epidural planned, or oxytocin likely needed."],
],
[2500, 7000]
));
children.push(warn("Active bleeding is a contraindication to vaginal examination until placenta praevia is excluded."));
children.push(sp());
children.push(heading2("Second Stage"));
children.push(bullet("Full dilatation to delivery of the baby"));
children.push(bullet("Passive phase: head descends before pushing urge felt"));
children.push(bullet("Active phase: maternal pushing with contractions"));
children.push(sp());
children.push(heading3("Duration Limits Before Intervention"));
children.push(makeTable(
["Parity", "Without epidural", "With epidural"],
[
["Nullipara", "2 hours", "3 hours"],
["Multipara", "1 hour", "2 hours"],
],
[3000, 3200, 3300]
));
children.push(amcTip("Prolonged 2nd stage: assess fetal position (is it OP?), consider instrumental delivery or caesarean if descent has stalled."));
children.push(sp());
children.push(heading2("Third Stage"));
children.push(heading3("Signs of Placental Separation"));
children.push(bullet("Gush of blood per vaginam"));
children.push(bullet("Lengthening of the umbilical cord (most reliable clinical sign)"));
children.push(bullet("Uterus rises and becomes globular and firm"));
children.push(bullet("Placenta visible at the vaginal introitus — surest sign"));
children.push(sp());
children.push(heading3("Active Management of Third Stage (AMTSL)"));
children.push(keyPoint("Active management reduces PPH risk by 60-70%. This is the standard of care in Australia."));
children.push(makeTable(
["Step", "Action"],
[
["1", "Oxytocin 10 IU IM (preferred) or slow IV — given within 1 min of baby's birth"],
["2", "Controlled cord traction (Brandt-Andrews) — ONLY after signs of separation"],
["3", "Uterine massage after placenta delivered"],
],
[1000, 8500]
));
children.push(warn("Never apply cord traction before signs of separation — risk of cord avulsion or uterine inversion."));
children.push(sp());
children.push(heading3("Placental Delivery Methods"));
children.push(makeTable(
["Method", "Description"],
[
["Schultze", "Fetal surface first — most common (~80%). Retroplacental clot expelled centrally."],
["Duncan", "Slides out sideways, maternal surface first (~20%). Associated with lower-segment placenta."],
],
[2000, 7500]
));
children.push(sp(2));
// ── SECTION 4 ──────────────────────────────────────────────────────────────
children.push(heading1("4. PAIN RELIEF IN LABOR"));
children.push(heading2("Pain Pathways"));
children.push(makeTable(
["Stage", "Source", "Nerve pathway", "Referred to"],
[
["1st stage (latent)", "Uterine contractions", "T10-L1 via hypogastric plexus", "Lower back / abdomen"],
["1st stage (active)", "Cervical dilatation", "S2-S4 via pelvic (sacral) plexus", "Sacrum"],
["2nd stage", "Vaginal/perineal stretch", "S2-S4 via pudendal nerve", "Perineum, thighs"],
],
[2200, 2500, 2800, 2000]
));
children.push(sp());
children.push(heading2("Epidural Analgesia"));
children.push(keyPoint("Gold standard for labor analgesia in Australia. Most commonly used method in hospital births."));
children.push(bullet("Catheter placed at L2-L3 or L3-L4 epidural space"));
children.push(bullet("Drug: low-dose bupivacaine 0.1% + fentanyl (low-dose combined spinal-epidural)"));
children.push(bullet("Covers pain from 1st and 2nd stage"));
children.push(heading3("Contraindications to Epidural"));
children.push(makeTable(
["Absolute", "Relative"],
[
["Patient refusal", "Thrombocytopenia (plt <80 — discuss with anaesthetist)"],
["Coagulopathy / therapeutic anticoagulation", "Previous spinal surgery"],
["Local infection at insertion site", "Some neurological conditions"],
["Uncorrected hypovolaemia / haemodynamic instability", "Tattooed skin at insertion site"],
],
[4500, 5000]
));
children.push(warn("Epidural prolongs 2nd stage — document this and apply the extended time limits before diagnosing arrest."));
children.push(sp());
children.push(heading2("Parenteral Opioids"));
children.push(makeTable(
["Drug", "Dose", "Key notes"],
[
["Morphine", "2-5 mg IV / 5-10 mg IM", "Commonly used; monitor for respiratory depression"],
["Pethidine (Meperidine)", "50-100 mg IM", "Avoid if delivery within 4 hours — neonatal respiratory depression"],
["Fentanyl", "25-50 mcg IV", "Rapid onset, short duration; often used with epidural"],
],
[2500, 3000, 4000]
));
children.push(warn("Neonatal respiratory depression after maternal opioids: give naloxone 0.1 mg/kg IM to neonate."));
children.push(sp());
children.push(heading2("Regional Nerve Blocks"));
children.push(makeTable(
["Block", "Nerve blocked", "Site of injection", "Use"],
[
["Paracervical block", "Pelvic plexus (cervical pain)", "Lateral vaginal fornix (4 & 8 o'clock)", "1st stage pain — rarely used now due to 15% fetal bradycardia risk"],
["Pudendal nerve block", "Pudendal nerve (S2-S4)", "Ischial spine (transvaginal)", "2nd stage; episiotomy repair; instrumental delivery"],
],
[2500, 2500, 2500, 2000]
));
children.push(amcTip("Pudendal block: drug = lignocaine (lidocaine), landmark = ischial spine, ligament pierced = sacrospinous. Covers perineum only — NOT uterine pain."));
children.push(sp());
children.push(heading2("Nitrous Oxide (Entonox)"));
children.push(bullet("50% N2O / 50% O2 — patient self-administers via mask"));
children.push(bullet("Mild-moderate analgesia; rapid onset and offset"));
children.push(bullet("Safe for fetus; does not affect labor progress"));
children.push(bullet("Commonly used in Australian midwifery-led birth settings"));
children.push(sp(2));
// ── SECTION 5 ──────────────────────────────────────────────────────────────
children.push(heading1("5. INDUCTION OF LABOR (IOL)"));
children.push(heading2("Indications"));
children.push(makeTable(
["Category", "Examples"],
[
["Post-dates", "Offer membrane sweep at 40-41 weeks; formal IOL at 41+0 to 42+0"],
["Maternal", "Pre-eclampsia, gestational diabetes, obstetric cholestasis, IUGR"],
["Fetal", "Macrosomia, postmaturity, fetal compromise on CTG/BPP"],
["PROM at term", ">37 weeks — induce if labor not established within 24 h (risk of chorioamnionitis)"],
],
[2500, 7000]
));
children.push(sp());
children.push(heading2("Bishop Score — Cervical Favourability"));
children.push(body("Assesses cervical readiness before IOL. Higher score = more favourable = better outcome with oxytocin."));
children.push(makeTable(
["Parameter", "0", "1", "2", "3"],
[
["Dilatation (cm)", "Closed", "1-2", "3-4", "≥5"],
["Effacement (%)", "<30", "40-50", "60-70", "≥80"],
["Station", "-3", "-2", "-1 / 0", "+1 / +2"],
["Consistency", "Firm", "Medium", "Soft", "—"],
["Position", "Posterior", "Mid", "Anterior", "—"],
],
[2800, 1600, 1600, 1600, 1900]
));
children.push(keyPoint("Bishop score ≥8 = favourable — proceed with oxytocin. Score ≤5 = cervical ripening needed first. Maximum score = 13."));
children.push(amcTip("Common AMC scenario: Bishop score 6 with term PROM — cervical ripening first (PGE2 gel or balloon), then oxytocin."));
children.push(sp());
children.push(heading2("Methods of Cervical Ripening"));
children.push(makeTable(
["Method", "Drug/Device", "Dose & Route", "Key Points"],
[
["PGE2 (Dinoprostone)", "Cervidil (vaginal insert) / Prepidil gel", "Gel 0.5 mg intracervical q6h (max 3 doses); Insert 10 mg vaginal", "Remove Cervidil if hyperstimulation. Wait 30-60 min before oxytocin."],
["PGE1 (Misoprostol)", "25 mcg PV q4h", "PV 25 mcg q4h or 50 mcg PO q4h", "Cheaper, heat-stable. Avoid in prior uterine scar."],
["Balloon catheter", "Foley (mechanical)", "Transcervical Foley 30-60 mL", "Safe in previous caesarean. No uterotonic effect."],
["Membrane sweep", "Manual", "38-41 weeks in clinic", "Reduces need for formal IOL. Causes discomfort, minor spotting."],
],
[2000, 2000, 2500, 3000]
));
children.push(warn("Misoprostol and Dinoprostone are CONTRAINDICATED in women with a previous uterine scar (prior caesarean or myomectomy) — risk of uterine rupture."));
children.push(sp());
children.push(heading2("Oxytocin Infusion Protocol"));
children.push(bullet("Start: 1-2 mU/min IV; increase by 1-2 mU/min every 20-40 min"));
children.push(bullet("Target: 3 contractions / 10 min, each lasting 40-60 s"));
children.push(bullet("Maximum: 20-40 mU/min (protocol-dependent)"));
children.push(heading3("Complications"));
children.push(bullet("Uterine tachysystole (>5 contractions per 10 min)"));
children.push(bullet("Fetal distress (late or prolonged decelerations on CTG)"));
children.push(bullet("Hyponatraemia (ADH-like effect with high doses + hypotonic fluids)"));
children.push(bullet("Uterine rupture (especially with prior uterine scar)"));
children.push(warn("Tachysystole: STOP oxytocin → left lateral → O2 → consider terbutaline 0.25 mg SC as tocolysis."));
children.push(sp());
children.push(heading2("Contraindications to IOL"));
children.push(bullet("Placenta praevia / vasa praevia"));
children.push(bullet("Transverse or oblique lie"));
children.push(bullet("Previous classical (vertical) uterine incision"));
children.push(bullet("Active genital herpes"));
children.push(bullet("Cord prolapse"));
children.push(bullet("Previous myomectomy entering uterine cavity"));
children.push(amcTip("Previous LOWER SEGMENT caesarean is NOT an absolute contraindication to IOL — VBAC can be planned, but NO misoprostol, and requires continuous CTG monitoring."));
children.push(sp(2));
// ── SECTION 6 ──────────────────────────────────────────────────────────────
children.push(heading1("6. ABNORMAL LABOR / DYSTOCIA"));
children.push(heading2("The 3 P's Framework"));
children.push(makeTable(
["P", "Component", "Examples of problems"],
[
["Power", "Uterine contractions", "Hypotonic dysfunction, inadequate contractions (<200 MVU)"],
["Passenger", "Fetus — size, position, presentation", "Macrosomia, OP position, brow/face, shoulder dystocia"],
["Passage", "Bony pelvis + soft tissues", "CPD, cervical dystocia, pelvic tumour"],
],
[800, 3000, 5700]
));
children.push(sp());
children.push(heading2("Partogram"));
children.push(body("A graphical record of labor progress used to identify slow progress early."));
children.push(bullet("Alert line: from 5 cm, slopes at 1 cm/hr. Touches alert line → transfer to higher care."));
children.push(bullet("Action line: 4 hours to the right of alert line. Crossed → intervention required."));
children.push(keyPoint("WHO 2018: active phase starts at 5 cm. Mean active-phase duration up to 12 h (nullipara) / 10 h (multipara)."));
children.push(sp());
children.push(heading2("Prolonged Latent Phase"));
children.push(makeTable(
["Parity", "Prolonged if >"],
[
["Nullipara", "20 hours"],
["Multipara", "14 hours"],
],
[4500, 5000]
));
children.push(bullet("Causes: unripe cervix, false labor, excessive sedation"));
children.push(bullet("Management: therapeutic rest (morphine) → reassess; AROM if cervix favourable"));
children.push(sp());
children.push(heading2("Protracted / Arrested Active Phase"));
children.push(makeTable(
["Diagnosis", "ACOG Definition", "Management"],
[
["Protracted active phase", "Dilatation <1 cm/hr after 4 h of adequate contractions", "Amniotomy + oxytocin augmentation"],
["Active phase arrest", "No dilatation for ≥4 h (adequate ctx) or ≥6 h (inadequate ctx)", "Caesarean section"],
["Protracted descent", "Nullipara <1 cm/hr; Multipara <2 cm/hr descent", "Assess position; consider instrumental"],
["Arrest of descent", "No descent ≥1 h (nullipara) or 30 min (multipara) in 2nd stage", "Instrumental or caesarean"],
],
[2800, 3800, 2900]
));
children.push(amcTip("Before diagnosing failure to progress: confirm adequate contractions (>200 MVU or 3 ctx × 40 s in 10 min), ruptured membranes, and correct fetal position."));
children.push(sp());
children.push(heading2("Occipitoposterior (OP) Position"));
children.push(body("Occiput faces the maternal sacrum. Complicates 5-10% of term labors."));
children.push(bullet("Presents as prolonged labor with severe back pain ('back labor')"));
children.push(bullet("Spontaneous rotation to OA in ~90% of cases"));
children.push(bullet("Persistent OP: manual rotation, rotational forceps (Kielland's), or caesarean"));
children.push(amcTip("Scenario: slow 2nd stage + severe back pain + OP on VE → epidural + amniotomy + oxytocin + reassess in 4 h."));
children.push(sp());
children.push(heading2("Obstructed Labor"));
children.push(body("Complete arrest of labor due to mechanical obstruction despite adequate contractions."));
children.push(bullet("Causes: CPD, brow presentation, shoulder dystocia, hydrocephalus"));
children.push(bullet("Signs: Bandl's ring, maternal exhaustion, fetal distress, caput/moulding grade 3"));
children.push(warn("Management: ALWAYS caesarean section. Never attempt vaginal delivery. Never give oxytocin."));
children.push(sp());
children.push(makeTable(
["Feature", "Bandl's Ring (Pathological)", "Constriction Ring"],
[
["Cause", "Obstructed labor", "Injudicious oxytocin use"],
["Location", "Junction of upper/lower uterine segment", "Anywhere in uterus"],
["Stage", "2nd stage", "1st or 2nd stage"],
["Detection", "Visible and palpable abdominally", "Felt only on vaginal exam"],
["Maternal status", "Distress, dehydration", "Mother and fetus normal"],
["Management", "Emergency caesarean", "Sedation; if ring reappears → caesarean"],
],
[2200, 3700, 3600]
));
children.push(sp(2));
// ── SECTION 7 ──────────────────────────────────────────────────────────────
children.push(heading1("7. CTG INTERPRETATION (ACOG 3-TIER SYSTEM)"));
children.push(makeTable(
["Parameter", "Category I (Normal)", "Category II (Indeterminate)", "Category III (Abnormal)"],
[
["Baseline FHR", "110-160 bpm", "100-109 or 161-180 bpm", "<100 or >180 bpm"],
["Variability", "Moderate (6-25 bpm)", "Minimal (≤5 bpm) or marked", "Absent or sinusoidal"],
["Accelerations", "Present", "Absent (after 32 wk)", "Absent (pre-terminal)"],
["Decelerations", "None or early", "Variable decels", "Late or prolonged decels"],
["Action", "Continue monitoring", "Investigate, correct cause", "Immediate delivery"],
],
[2200, 2400, 2500, 2400]
));
children.push(sp());
children.push(heading2("Deceleration Types"));
children.push(makeTable(
["Type", "Timing", "Cause", "Significance"],
[
["Early", "Mirrors contraction — simultaneous", "Head compression (vagal)", "Normal — benign"],
["Late", "Peaks after contraction (>30 s lag)", "Uteroplacental insufficiency", "Ominous if repeated"],
["Variable", "Abrupt onset, variable timing", "Cord compression", "Concerning if severe or prolonged"],
["Prolonged", ">2 min, <10 min duration", "Cord prolapse, abruption, maternal hypotension", "Requires urgent review"],
],
[1800, 3000, 2800, 1900]
));
children.push(amcTip("Late decelerations of any amplitude are significant — they indicate uteroplacental insufficiency. Act on the pattern, not a single deceleration."));
children.push(sp());
children.push(heading2("Management of Abnormal CTG"));
children.push(bullet("Step 1: Correct the cause — change position, stop oxytocin, IV fluids, O2 by mask"));
children.push(bullet("Step 2: Fetal scalp stimulation — acceleration = reassuring (no acidosis)"));
children.push(bullet("Step 3: Category III or non-responsive → fetal blood sampling (pH <7.20 = deliver) or immediate delivery"));
children.push(bullet("Step 4: Mode of delivery based on dilatation and urgency (instrumental vs. caesarean)"));
children.push(sp(2));
// ── SECTION 8 ──────────────────────────────────────────────────────────────
children.push(heading1("8. POSTPARTUM HAEMORRHAGE (PPH)"));
children.push(heading2("Definition"));
children.push(bullet("Primary PPH: blood loss ≥500 mL (vaginal) or ≥1000 mL (caesarean) within 24 hours"));
children.push(bullet("Minor PPH: 500-1000 mL without haemodynamic compromise"));
children.push(bullet("Major PPH: >1000 mL or any amount causing shock"));
children.push(bullet("Secondary PPH: abnormal bleeding 24 h to 12 weeks postpartum (subinvolution or infection)"));
children.push(sp());
children.push(heading2("Causes — The 4 T's"));
children.push(makeTable(
["T", "Cause", "Frequency", "Immediate Management"],
[
["Tone", "Uterine atony", "70-80%", "Bimanual compression + uterotonics"],
["Tissue", "Retained placenta / clots", "10%", "Manual removal; uterine exploration under GA"],
["Trauma", "Laceration, uterine rupture, inversion", "10%", "Surgical repair; B-Lynch suture; hysterectomy"],
["Thrombin", "Coagulopathy / DIC", "1%", "FFP, cryoprecipitate, platelets, TXA"],
],
[1200, 2800, 1600, 3900]
));
children.push(sp());
children.push(heading2("Uterotonics"));
children.push(makeTable(
["Drug", "Route", "Dose", "Cautions"],
[
["Oxytocin", "IV/IM", "10 IU IM; 20-40 IU in 1L NS IV infusion", "1st line. Rapid IV bolus causes hypotension — avoid."],
["Ergometrine", "IM/IV", "0.5 mg IM", "AVOID in hypertension, heart disease, pre-eclampsia."],
["Syntometrine", "IM", "Oxytocin 5 IU + ergometrine 0.5 mg", "AVOID in hypertension."],
["Carboprost (PGF2α)", "IM", "0.25 mg IM q15 min, max 8 doses", "AVOID in asthma (bronchoconstriction)."],
["Misoprostol (PGE1)", "PO/SL/PR", "800-1000 mcg PR or SL", "2nd line if oxytocin unavailable. S/E: fever."],
["Tranexamic acid", "IV", "1 g IV over 10 min within 3 h", "WOMAN trial: reduces PPH mortality. Give early in all PPH."],
],
[2200, 900, 2400, 4000]
));
children.push(keyPoint("Tranexamic acid 1 g IV within 3 hours of PPH onset reduces mortality (WOMAN trial, NEJM 2017). Give it early."));
children.push(warn("Carboprost CONTRAINDICATED in asthma. Ergometrine CONTRAINDICATED in hypertension."));
children.push(sp());
children.push(heading2("Surgical Escalation for Refractory PPH"));
children.push(bullet("Uterine compression sutures (B-Lynch, Hayman)"));
children.push(bullet("Intrauterine balloon tamponade (Bakri balloon) — insert, inflate, reassess"));
children.push(bullet("Uterine artery ligation / internal iliac artery ligation"));
children.push(bullet("Uterine artery embolisation (interventional radiology)"));
children.push(bullet("Peripartum hysterectomy — definitive, last resort"));
children.push(amcTip("AMC escalation sequence: bimanual compression → uterotonics (oxytocin, ergometrine, carboprost, TXA) → surgical. 2 large-bore IV lines + cross-match + call for help early."));
children.push(sp(2));
// ── SECTION 9 ──────────────────────────────────────────────────────────────
children.push(heading1("9. COMPLICATIONS — VVF & UTERINE RUPTURE"));
children.push(heading2("Vesicovaginal Fistula (VVF)"));
children.push(makeTable(
["Feature", "Details"],
[
["Definition", "Abnormal communication between bladder and vagina"],
["Obstetric cause", "Prolonged obstructed labor → ischaemic necrosis of bladder base (most common cause in developing countries)"],
["Developed-world cause (Australia)", "Iatrogenic — hysterectomy (most common cause)"],
["Presentation", "Continuous urinary leakage per vaginam, ~7-14 days post-delivery"],
["Diagnosis", "Clinical examination, dye test (methylene blue), cystoscopy"],
["Management", "Catheter drainage initially; surgical repair after 3-6 months (wait for inflammation to subside)"],
],
[3000, 6500]
));
children.push(sp());
children.push(heading2("Uterine Rupture"));
children.push(makeTable(
["Feature", "Complete Rupture", "Incomplete (Scar Dehiscence)"],
[
["Definition", "Full-thickness breach of uterine wall + visceral peritoneum", "Wall tears but visceral peritoneum remains intact"],
["Risk factors", "Previous uterine scar (LSCS/myomectomy), obstructed labor, grand multiparity, oxytocin misuse", "Previous LSCS (usually lower segment)"],
["Signs", "Sudden tearing pain, cessation of contractions, fetal parts palpable abdominally, maternal shock, absent FHR", "Often asymptomatic; incidental finding at LSCS"],
["Management", "Emergency laparotomy — repair or hysterectomy + blood transfusion", "Observation or repair at LSCS"],
],
[2500, 3500, 3500]
));
children.push(warn("Suspected uterine rupture: immediate emergency laparotomy. Do not delay for investigations."));
children.push(sp(2));
// ── SECTION 10 ──────────────────────────────────────────────────────────────
children.push(heading1("10. AMC QUICK SCENARIOS & HIGH-YIELD POINTS", TEAL));
children.push(heading2("Top AMC Labor Topics"));
children.push(keyPoint("1. AMTSL: oxytocin 10 IU IM is 1st line for ALL patients after delivery, including those with hypertension."));
children.push(keyPoint("2. IOL post-dates: discuss/offer at 41 weeks; membrane sweep at 40-41 weeks; formal IOL by 42 weeks."));
children.push(keyPoint("3. OP position: slow labor + back pain + persistent OP on VE → epidural + oxytocin + reassess in 4 h."));
children.push(keyPoint("4. Abnormal CTG: stop oxytocin → left lateral → O2 → scalp stimulation → if unresolved → deliver."));
children.push(keyPoint("5. PPH: bimanual compression + oxytocin 10 IU + 2x large-bore IV + call for help + TXA 1 g IV within 3 h."));
children.push(keyPoint("6. Shoulder dystocia: McRoberts manoeuvre + suprapubic pressure FIRST. Never apply fundal pressure."));
children.push(keyPoint("7. Cord prolapse: elevate presenting part manually or fill bladder → emergency caesarean."));
children.push(keyPoint("8. Thick meconium + CTG abnormality = urgent delivery. Thin meconium = continue with close monitoring."));
children.push(sp());
children.push(heading2("Critical Drug Contraindications"));
children.push(makeTable(
["Drug", "Contraindicated in"],
[
["Ergometrine / Syntometrine", "Hypertension, pre-eclampsia, heart disease"],
["Carboprost (PGF2α)", "Asthma (bronchospasm risk)"],
["Misoprostol for IOL", "Previous uterine scar / prior caesarean"],
["Oxytocin rapid IV bolus", "Hypotension risk — always dilute and infuse slowly or give IM"],
["NSAIDs (post-partum)", "Renal impairment, peptic ulcer disease, hypersensitivity"],
],
[4000, 5500]
));
children.push(sp());
children.push(heading2("Normal Values — Quick Reference Card"));
children.push(makeTable(
["Parameter", "Value"],
[
["Normal fetal heart rate", "110-160 bpm"],
["Normal CTG variability", "6-25 bpm (moderate)"],
["Active phase start (WHO 2018)", "5 cm dilatation"],
["Active phase dilatation rate", "≥1 cm/hr"],
["Adequate contractions", "3 in 10 min, each ≥40 s, or >200 Montevideo units"],
["Prolonged latent phase (nullipara / multipara)", ">20 h / >14 h"],
["2nd stage limit — no epidural (nullipara / multipara)", "2 h / 1 h"],
["2nd stage limit — with epidural (nullipara / multipara)", "3 h / 2 h"],
["PPH definition — vaginal delivery", "≥500 mL within 24 h"],
["PPH definition — caesarean section", "≥1000 mL within 24 h"],
["Oxytocin AMTSL dose", "10 IU IM within 1 min of delivery"],
["TXA dose in PPH", "1 g IV over 10 min, within 3 h of birth"],
["Oxytocin infusion start dose", "1-2 mU/min IV"],
["Bishop score — favourable", "≥8 (proceed with oxytocin)"],
["Bishop score — unfavourable", "≤5 (cervical ripening needed)"],
["Engagement (nullipara)", "~38 weeks gestation"],
],
[5500, 4000]
));
children.push(sp(2));
children.push(new Paragraph({
children: [new TextRun({
text: "These notes follow RANZCOG, ACOG, and WHO 2018 guidelines. Always cross-reference with current Australian clinical guidelines for practice.",
italics: true, size: 16, color: "777777"
})],
alignment: AlignmentType.CENTER,
spacing: { before: 200 }
}));
// ═══════════════════════════════════════════════════════════════════════════
// BUILD DOCUMENT
// ═══════════════════════════════════════════════════════════════════════════
const doc = new Document({
creator: "Orris AMC Notes",
title: "Labor — AMC-Oriented Clinical Notes",
description: "Labor notes rewritten for the Australian Medical Council exam",
styles: {
default: {
document: {
run: { font: "Calibri", size: 20 },
},
},
},
sections: [{
properties: {
page: {
margin: { top: 900, bottom: 900, left: 900, right: 900 },
},
},
headers: {
default: new Header({
children: [new Paragraph({
children: [
new TextRun({ text: "LABOR — AMC-Oriented Clinical Notes", bold: true, size: 18, color: DARK_BLUE }),
new TextRun({ text: " | RANZCOG / ACOG / WHO 2018", size: 16, color: "888888" }),
],
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: MID_BLUE } },
})],
}),
},
footers: {
default: new Footer({
children: [new Paragraph({
children: [
new TextRun({ text: "For AMC examination preparation only. Not for clinical use without verification.", size: 16, color: "888888", italics: true }),
],
alignment: AlignmentType.CENTER,
border: { top: { style: BorderStyle.SINGLE, size: 4, color: GREY } },
})],
}),
},
children,
}],
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync("/home/daytona/workspace/labor-amc/Labor_AMC_Notes.docx", buffer);
console.log("DOCX created successfully. Size:", buffer.length, "bytes");
}).catch(err => {
console.error("Error:", err);
process.exit(1);
});
cd /home/daytona/workspace/labor-amc && node build_docx.js 2>&1
Send me
Labor AMC Notes
Word Document · DOCX