Young age and old age fetal and maternal complications. Rh incompatibility and treatment. Occupational complications in pregnancy, religious practice in pregnancy, define gravida, para, abortion, love birth still birth standard definition from standard updated obg textbook and who website, negle rule in edd calculation indication and contraindications, calculate period of gestation, booking visit ,who updated definition of booked,Direct and indirect coombs test , causes of blleeding ov and leaking pv in all 3 trimester , chief complains a anc mother can comes in each trimester,immunization in pregnancy with dose and routeGood dates, excellent dates,types of preterm, all types of post term and post dateGood dates and excellent dates in pregnancy obg, criteria for itDefine and criteria for hyperemesis gravidarum, physiological d pathological cause of it , why fever with rash important in pregnancy, how much radiation accepted in pregnancy, which imaging suitable in pregnancy what tr the lab investigation in each trimesterDose and duration of preconception , post on epfion, folic acid and iron and calcium, drugs that is avoided in pregnancy and lactation, drugs that can be given replacing those drugs and those drugs sideefectsNst , ntnb, what are the scans in pregnancy which sibtge ideal weekw for each scan given by who and what are the significance of the scanOgtt and ogct and itsprocedure , indications, contraindications and interpretation, gdm , pih , chronic hypertension,afi, preecllpasia scaling, eclampsia ,pih,gestational hypertension, high riskh pregnancyAfi , sdp,how to differentiate leaking pvvs white dischargeComplications of devresed fetal movement , hyperemesis, preterm labor ,post term laborDating , nt , anomaly, growth exact weeks and what you wills see in it

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Searching the Web

WHO 2016 definition booked unbooked antenatal care gravida para abortion stillbirth live birth standard

Searching the Web

WHO preterm post-term definition types 2023 gestational age classification

Searching the Web

hyperemesis gravidarum diagnostic criteria PUQE score 2023 management

Searching the Web

drugs contraindicated pregnancy lactation safe alternatives folic acid iron calcium preconception dose WHO

Here is a comprehensive, structured OBG reference covering all topics you asked about. Sources: Creasy & Resnik's Maternal-Fetal Medicine, Berek & Novak's Gynecology, Williams Obstetrics 25e, WHO ANC 2016 Guidelines, ACOG, RCOG, and current evidence.

COMPREHENSIVE ANTENATAL CARE (ANC) REFERENCE


PART 1: CORE OBSTETRIC DEFINITIONS

Gravida, Para, Abortion - Standard Definitions (Williams Obstetrics / FIGO)

TermDefinition
GravidaTotal number of pregnancies, including current one, regardless of outcome. Even a multiple gestation counts as ONE.
NulligravidaNever been pregnant
PrimigravidaPregnant for the first time
MultigravidaHas been pregnant more than once
ParaNumber of pregnancies that reached the age of viability (20 weeks or 500 g), regardless of whether born alive or dead
NulliparaNever delivered at viability
PrimiparaDelivered once at or beyond viability
MultiparaDelivered twice or more
Grand multipara5 or more deliveries at viability
GTPAL notation = Gravida / Term / Preterm / Abortions / Living children

Abortion (WHO / FIGO Standard)

  • Definition: Expulsion or extraction of an embryo or fetus weighing 500 g or less (corresponds approximately to 20-22 weeks gestation), or where weight is not available, gestation of less than 20 completed weeks
  • WHO standard: loss before 28 weeks (used in many developing countries)
  • Further classified as: spontaneous / induced; complete / incomplete / inevitable / missed / threatened / septic

Live Birth (WHO Definition)

The complete expulsion or extraction from the mother of a product of conception, irrespective of duration of pregnancy, which breathes or shows any other evidence of life such as heartbeat, pulsation of the umbilical cord, or definite movement of voluntary muscles, regardless of whether the umbilical cord has been cut.

Stillbirth (WHO Definition)

Birth of a baby with no signs of life at or after 28 completed weeks of gestation (birth weight ≥1000 g). WHO divides into:
  • Early fetal death: 20-27+6 weeks
  • Late fetal death (stillbirth): ≥28 weeks
Note: ACOG/CDC use ≥20 weeks for stillbirth definition. WHO threshold = 28 weeks (for international reporting).

PART 2: NAEGELE'S RULE

EDD Calculation

Formula: EDD = First day of LMP + 9 months + 7 days (OR: LMP - 3 months + 7 days + 1 year)
Example: LMP = 1st April → EDD = 8th January next year

Indications

  • Regular menstrual cycle (28-30 days)
  • Certain, reliable LMP
  • No recent OCP use
  • No recent breastfeeding amenorrhea

Contraindications / Limitations

  • Irregular cycles
  • Uncertain LMP
  • Recent OCP use (cycle may not have normalized)
  • Lactation amenorrhea preceding pregnancy
  • Oligomenorrhea or PCOS
  • First trimester bleeding (can confuse LMP)
  • In all these cases: first trimester ultrasound (CRL at 7-13+6 weeks) supersedes Naegele's rule

PART 3: PERIOD OF GESTATION (POG)

  • POG is calculated from the first day of LMP (not conception)
  • Normal pregnancy = 40 weeks (280 days) from LMP = 38 weeks from conception
  • Trimesters:
    • 1st: 0 - 13+6 weeks
    • 2nd: 14 - 27+6 weeks
    • 3rd: 28 weeks - delivery
Quick calculation: From LMP to today's date = weeks + days of gestation

PART 4: BOOKING VISIT & WHO BOOKED DEFINITION

WHO 2016 ANC Model (Updated - 8 Contacts)

WHO replaced the old 4-visit "Focused ANC" model with 8 contacts for positive pregnancy experience:
ContactTiming
1Up to 12 weeks
220 weeks
326 weeks
430 weeks
534 weeks
636 weeks
738 weeks
840 weeks (+41 weeks if not delivered)

Booking Visit (1st Contact - up to 12 weeks)

Includes: history, general/obstetric examination, baseline investigations, immunization, dietary advice, folic acid, registration, risk assessment, counseling.

WHO Definition of "Booked" (Updated)

A woman is considered booked (registered) if she:
  • Attended ANC at least once before 20 weeks of gestation (some definitions: before 28 weeks)
  • Has completed the booking assessment with basic investigations
Unbooked: No prior ANC before arrival in labor/delivery. Associated with significantly higher maternal and perinatal mortality.

PART 5: YOUNG AGE AND OLD AGE - MATERNAL AND FETAL COMPLICATIONS

Young Age (Teenage Pregnancy, <20 years / Adolescent Pregnancy)

Maternal Complications:
  • Higher risk of PIH and preeclampsia
  • Iron deficiency anemia (competing nutritional demands)
  • Cephalopelvic disproportion (CPD) - pelvis not fully mature
  • Obstructed labor and obstetric fistula
  • Higher rates of STIs
  • Postpartum depression
  • Poor compliance with ANC
  • Higher maternal mortality in very young (<16 years)
  • Social and psychological complications
Fetal/Neonatal Complications:
  • Prematurity / preterm birth
  • Low birth weight (LBW) / IUGR
  • Higher perinatal mortality
  • Increased congenital anomalies in very young mothers

Old Age (Elderly Primigravida / Advanced Maternal Age, ≥35 years; Very Advanced ≥40)

Maternal Complications:
  • Gestational diabetes (GDM) - 2-3x increased risk
  • Gestational hypertension, preeclampsia
  • Placenta previa, abruption
  • Increased cesarean section rate
  • Uterine dysfunction (dysfunctional labor)
  • Postpartum hemorrhage
  • Thromboembolic events
  • Pre-existing medical conditions (HTN, DM, thyroid)
  • Higher operative delivery rates
Fetal/Neonatal Complications:
  • Chromosomal abnormalities (esp. Down syndrome - trisomy 21; risk at 35 = 1:350; at 40 = 1:100; at 45 = 1:30)
  • Stillbirth (2x risk at ≥40 years)
  • IUGR / LBW
  • Preterm birth

PART 6: Rh INCOMPATIBILITY AND TREATMENT

Mechanism

  • Mother is Rh-negative, fetus is Rh-positive (inherited from father)
  • Fetal RBCs enter maternal circulation (fetomaternal hemorrhage) → maternal sensitization → IgG anti-D antibodies formed
  • In subsequent pregnancies: antibodies cross placenta → destroy fetal RBCs → Hemolytic Disease of the Fetus and Newborn (HDFN)

Maternal Complications

  • Sensitization (no direct harm to mother)
  • Risk of sensitization increases with: delivery, abortion, APH, invasive procedures (amniocentesis, CVS), ECV

Fetal Complications (Severity depends on antibody titer)

  • Fetal hemolytic anemia
  • Hydrops fetalis (severe anemia → cardiac failure → generalized edema)
  • Intrauterine fetal death (IUFD)
  • Neonatal jaundice (rapidly progressive within 24 hours of birth)
  • Kernicterus (bilirubin deposits in basal ganglia → brain damage)
  • Neonatal anemia

Direct Coombs Test (Direct Antiglobulin Test, DAT)

  • What it tests: Detects antibodies already bound to RBCs (in vivo sensitization)
  • Used on: Newborn's blood / fetal cord blood
  • Positive in: HDFN, autoimmune hemolytic anemia
  • Principle: Coombs reagent (anti-human globulin) added to washed RBCs → if antibody-coated RBCs → agglutination = positive
  • Purpose: Diagnose HDFN in the neonate

Indirect Coombs Test (Indirect Antiglobulin Test, IAT)

  • What it tests: Detects free antibodies in maternal serum (looking for anti-D antibodies)
  • Used on: Mother's serum
  • Positive in: Already sensitized Rh-negative mother
  • Principle: Mother's serum + Rh+ RBCs → incubate → add Coombs reagent → if anti-D present → agglutination = positive
  • Purpose: Screening (type and screen), cross-matching, monitoring Rh-negative pregnant women

Management of Rh Incompatibility

Prevention (most important):
  • Anti-D immunoglobulin (Rho-GAM / Anti-D Ig):
    • Dose: 300 mcg IM (covers 30 mL fetal whole blood)
    • Routine antenatal prophylaxis: 28 weeks (and optionally 34 weeks)
    • Post-delivery: Within 72 hours of delivery of Rh+ baby
    • After sensitizing events: Abortion, amniocentesis, CVS, ECV, APH, trauma - give within 72 hours
Monitoring sensitized mother:
  • Indirect Coombs titer every 4 weeks; critical titer = 1:16 (indicates need for further action)
  • Middle cerebral artery peak systolic velocity (MCA-PSV) by Doppler - gold standard for fetal anemia
  • Amniocentesis for bilirubin (OD 450)
  • Fetal blood sampling
Treatment of affected fetus:
  • Intrauterine transfusion (IUT) - if MCA-PSV >1.5 MoM (indicates fetal anemia)
  • Early delivery at 32-34 weeks if near term
  • Neonatal treatment: phototherapy, exchange transfusion for jaundice/kernicterus prevention, top-up transfusion for anemia

PART 7: OCCUPATIONAL AND RELIGIOUS COMPLICATIONS IN PREGNANCY

Occupational Hazards in Pregnancy

  • Physical: Prolonged standing, heavy lifting → preterm labor, LBW, varicosities, back pain
  • Chemical: Pesticides, solvents, anesthetic gases → miscarriage, congenital anomalies, IUGR
  • Radiation: X-ray workers, radiographers (see radiation section)
  • Biological: Healthcare workers → exposure to rubella, CMV, hepatitis B, HIV, COVID-19
  • Psychosocial: Stress → preterm labor, GDM, PIH
  • Shift work / night work: Disrupted circadian rhythm → preterm birth, LBW
  • Recommendations: Modify duties from early pregnancy, avoid teratogen exposure, adequate rest

Religious Practices in Pregnancy

  • Fasting (Ramadan, Yom Kippur, etc.): Risk of ketosis, dehydration, hypoglycemia, reduced fetal movements - GDM mothers especially at risk
  • Dietary restrictions: May cause nutritional deficiencies (iron, B12 in vegetarians/vegans)
  • Herbal/traditional remedies: Some are teratogenic or abortifacient (counsel against)
  • Refusal of blood products (Jehovah's Witnesses): Requires careful counseling, advance directives, cell salvage planning for high-risk delivery
  • Refusal of certain medications/vaccines: Counseling needed
  • Pilgrimage (Hajj): Long travel, heat, crowding → DVT, dehydration, infections
  • Approach: Culturally sensitive counseling without judgment; offer evidence-based alternatives

PART 8: GOOD DATES AND EXCELLENT DATES

These criteria determine how reliable the LMP-based gestational age is.

Good Dates (Reliable LMP)

All of the following must be true:
  1. LMP is certain and known
  2. Regular menstrual cycles (28 ± 7 days)
  3. No OCP use in preceding 3 months
  4. No breastfeeding in preceding 3 months
  5. No bleeding in early pregnancy that could be confused with LMP
  6. LMP confirmed by first trimester ultrasound (CRL) - concordance within 7 days

Excellent Dates (Gold Standard)

All criteria for Good Dates PLUS:
  1. First trimester CRL ultrasound performed at 7-13+6 weeks
  2. CRL-based EDD differs from LMP-based EDD by ≤5-7 days
  3. IVF/ART: embryo transfer date known (most precise)
Clinical importance: If dates are excellent, ultrasound is not used to change EDD. If discrepancy exists, US-based dating takes priority in first trimester.

PART 9: TYPES OF PRETERM, POST-TERM, AND POST-DATES

Preterm (WHO / ACOG / RCOG)

Definition: Delivery before 37+0 completed weeks of gestation
SubtypeGestational Age
Extremely preterm< 28 weeks
Very preterm28 - 31+6 weeks
Moderate preterm32 - 33+6 weeks
Late preterm34 - 36+6 weeks
By etiology:
  • Spontaneous preterm labor (PTL)
  • Preterm Premature Rupture of Membranes (PPROM)
  • Iatrogenic (medically indicated) preterm delivery

Term Gestational Age Categories (ACOG 2013, still current)

CategoryWeeks
Early term37+0 to 38+6
Full term39+0 to 40+6
Late term41+0 to 41+6
Post-term≥42+0 weeks

Post-Date vs Post-Term

  • Post-dates: Pregnancy beyond the expected date of delivery (>40 weeks) - colloquial term
  • Prolonged pregnancy: >41+0 weeks
  • Post-term pregnancy (official): ≥42+0 completed weeks (WHO / ACOG definition)
  • Post-term occurs in 5-10% of pregnancies; risk of: uteroplacental insufficiency, oligohydramnios, macrosomia, meconium aspiration, stillbirth, cesarean section

PART 10: BLEEDING PV AND LEAKING PV IN ALL 3 TRIMESTERS

Bleeding PV by Trimester

First Trimester (0-13+6 weeks):
CauseKey Features
Implantation bleedScanty, 6-10 days after conception
Threatened abortionBleeding + closed os, viable fetus
Inevitable abortionBleeding + open os, painful
Incomplete abortionPartial expulsion, open os
Complete abortionAll products expelled
Missed abortionNo symptoms, fetal demise
Ectopic pregnancyAmenorrhea + bleeding + pain + adnexal mass
Hydatidiform moleHeavy bleeding, uterus > dates, snowstorm US
Cervical ectropion/polypPost-coital, painless
Second Trimester (14-27+6 weeks):
  • Cervical incompetence (painless dilation)
  • Placenta previa (painless, bright red)
  • Abruptio placentae (painful, dark)
  • Late miscarriage/mid-trimester loss
  • Cervical causes (polyp, ectropion)
  • Vasa previa (fetal blood - bright red at membrane rupture)
Third Trimester (28 weeks onward) - Antepartum Hemorrhage (APH):
CauseFeatures
Placenta previaPainless, bright red, recurrent, no uterine tenderness
Abruptio placentaePainful, woody hard uterus, fetal distress
Vasa previaFetal blood, occurs with membrane rupture, fetal bradycardia
Uterine ruptureSevere pain, fetal parts palpable abdominally
Bloody showLabor onset, mucus-mixed
Cervical causesPolyp, carcinoma

Leaking PV by Trimester

All Trimesters:
  • PPROM (Preterm Premature Rupture of Membranes): spontaneous membrane rupture before 37 weeks
  • PROM (Prelabor Rupture of Membranes): rupture at ≥37 weeks before labor onset
  • Amniocentesis/procedure-related membrane rupture
Differentiating Leaking PV from White Discharge (Leucorrhoea):
FeatureAmniotic Fluid (Leaking)White Discharge
ColorClear / pale strawWhite / yellow
OdorOdorless or faint sweetMay be offensive (if infected)
AmountContinuous trickle, worsens with activity/ValsalvaConstant but not progressive
Ferning (microscopy)Positive (arborization pattern)Negative
Nitrazine/pH testAlkaline (pH 7-7.5) - turns yellow paper blueAcidic (pH 4-4.5)
Pooling in posterior fornixPresent on speculumAbsent
IGFBP-1 / AmniSure testPositive (placental alpha-microglobulin)Negative
Fetal fibronectinMay be positiveUsually negative

PART 11: CHIEF COMPLAINTS PER ANC TRIMESTER

First Trimester (0-13+6 weeks)

  • Amenorrhea (missed period)
  • Nausea and vomiting (morning sickness)
  • Breast tenderness / heaviness
  • Frequency of micturition
  • Fatigue / tiredness
  • Implantation bleeding (spotting)
  • Abdominal cramping (mild)
  • Headache
  • Ptyalism (excessive salivation)

Second Trimester (14-27+6 weeks)

  • Quickening (fetal movements - first felt at 18-20 weeks primigravida, 16-18 weeks multigravida)
  • Increased abdominal size
  • Back pain (lumbar / sacral)
  • Heartburn / reflux
  • Leg cramps
  • Varicosities
  • Constipation
  • Skin changes (linea nigra, chloasma, striae)
  • Nasal congestion / epistaxis
  • Ankle edema (physiological)
  • Pressure symptoms

Third Trimester (28 weeks - delivery)

  • Increasing abdominal girth
  • Reduced fetal movements (alarm symptom)
  • Braxton Hicks contractions
  • Dyspnea (diaphragm pushed up)
  • Frequency of micturition (presenting part pressing bladder)
  • Edema (feet, ankles, face - if face: preeclampsia)
  • Headache / visual disturbances (PIH/preeclampsia)
  • Epigastric pain (preeclampsia - HELLP)
  • Leaking PV / show
  • Labor pains (regular, increasing contractions)

PART 12: IMMUNIZATION IN PREGNANCY

VaccineDoseRouteTimingNotes
Tetanus Toxoid (TT)TT1: 0.5 mL; TT2: 0.5 mL (4 weeks after TT1)IM (deltoid)TT1 at booking or 1st contact; TT2 at 4 weeksIf previously immunized (TT3/4/5), single booster
Td (Tetanus-diphtheria)0.5 mLIMSame as TT - preferred in some programsWHO recommends Td over TT
Influenza0.5 mL (inactivated)IMAny trimester (especially 2nd/3rd)Recommended by WHO/CDC every flu season
COVID-19Per vaccine protocolIMAny trimesterWHO recommends for all pregnant women
Hepatitis B1 mL (if non-immune)IMAny trimester3-dose series
Pertussis (Tdap)0.5 mLIM27-36 weeks (each pregnancy)Protects neonate via transplacental antibodies
Live vaccines - CONTRAINDICATED in pregnancy:
  • MMR (measles-mumps-rubella)
  • Varicella (chickenpox)
  • Yellow fever (use only if benefit >> risk)
  • Oral polio vaccine (use IPV instead)
  • BCG

PART 13: LAB INVESTIGATIONS BY TRIMESTER

First Trimester (Booking investigations)

  • Blood group and Rh type
  • CBC (complete blood count) - hemoglobin, platelets
  • Urine routine and microscopy (R/M) + culture/sensitivity
  • Random blood glucose / fasting glucose
  • VDRL/RPR (syphilis)
  • HIV (counseled and tested)
  • HBsAg (Hepatitis B)
  • Hepatitis C antibody (if high risk)
  • Rubella IgG titer
  • Thyroid function (TSH) - if symptomatic or risk
  • Indirect Coombs test (if Rh-negative)
  • First trimester combined screening: PAPP-A + free beta-hCG + NT ultrasound (11-13+6 weeks) for Down syndrome
  • Cell-free fetal DNA (NIPT) if indicated/available

Second Trimester (16-20 weeks)

  • Anomaly scan (18-20 weeks)
  • Triple/Quadruple screen (15-20 weeks): AFP, hCG, uE3, inhibin A
  • CBC repeat
  • Urine R/M repeat
  • Glucose Challenge Test (GCT/OGCT) - 24-28 weeks (often straddles 2nd/3rd trimester)
  • Amniocentesis if indicated (chromosomal/genetic)

Third Trimester

  • Repeat CBC (28-32 weeks and 36 weeks)
  • OGTT (24-28 weeks) - if GCT positive; or direct OGTT in high-risk
  • Group B Streptococcus (GBS) swab (35-37 weeks)
  • Repeat urine culture
  • Repeat HIV, syphilis (if high risk or policy mandates)
  • Fetal well-being tests: NST, BPP, Doppler
  • AFI (amniotic fluid index)

PART 14: HYPEREMESIS GRAVIDARUM

Definition

Severe intractable nausea and vomiting in pregnancy causing:
  • Persistent vomiting not relieved by standard treatment
  • ≥5% loss of pre-pregnancy body weight
  • Dehydration + ketonuria (ketones in urine 2+ or more)
  • Electrolyte imbalance (hypokalemia, hyponatremia)
  • Onset typically 4-6 weeks, peaks 8-12 weeks, usually resolves by 20 weeks (but can persist)

Diagnostic Criteria (CMAJ 2024 / RCOG 2024)

  • Onset first 16 weeks
  • Nausea AND vomiting, at least one severe
  • Impairs daily activities and/or adequate intake
  • PUQE-24 score ≥13 = severe (presence of ketonuria no longer required to diagnose)
  • Weight loss ≥5% pre-pregnancy weight

Physiological Causes

  • hCG: Peak coincides with worst symptoms (8-12 weeks); hyperplacentosis (molar pregnancy, multiple pregnancy) worsens it
  • Estrogen: High levels correlate with severity
  • Progesterone: Reduces gastric motility → delayed emptying
  • H. pylori infection: Association found in some studies
  • Thyroid: Transient hyperthyroidism (hCG cross-reacts with TSH receptor)
  • Psychosocial factors: Anxiety, poor support

Pathological Causes (to exclude)

  • Gastroenteritis
  • Peptic ulcer / gastritis
  • Pancreatitis
  • Hepatitis
  • Appendicitis
  • Urinary tract infection / pyelonephritis
  • Thyrotoxicosis
  • Diabetic ketoacidosis
  • Raised ICP / meningitis
  • Vestibular disease

Complications

  • Wernicke's encephalopathy (thiamine/B1 deficiency - give B1 before IV dextrose!)
  • Mallory-Weiss tears
  • Esophageal rupture
  • Fetal growth restriction
  • Marchiafava-Bignami (corpus callosum demyelination - rare)
  • Maternal: muscle wasting, weight loss, electrolyte disturbances

Treatment

  • IV fluids (normal saline - NOT dextrose first, risk of Wernicke's)
  • Thiamine (B1) 100 mg IV before any dextrose
  • Anti-emetics: ondansetron, metoclopramide, prochlorperazine, promethazine
  • Pyridoxine (B6) ± doxylamine (first-line for mild-moderate NVP)
  • Corticosteroids (methylprednisolone) for refractory cases
  • Nutritional support (nasogastric or parenteral)
  • Ginger supplements (mild-moderate)
  • Avoid oral iron in acute hyperemesis (worsens nausea)

PART 15: FEVER WITH RASH IN PREGNANCY - IMPORTANCE

Fever with rash in pregnancy is important because certain infections causing this combination are:
  1. Teratogenic - cause congenital abnormalities
  2. Cause fetal death - IUGR, hydrops, stillbirth
  3. Cause neonatal infection - serious morbidity/mortality
InfectionRisk to Fetus
Rubella (rash + low fever)Congenital rubella syndrome: cataracts, sensorineural deafness, CHD (PDA, pulmonary stenosis), microcephaly, IUGR - worst in 1st trimester
Varicella (chickenpox)Congenital varicella syndrome (skin scars, limb hypoplasia, eye defects, CNS); neonatal varicella if near delivery = fatal
Parvovirus B19Fetal hydrops, aplastic crisis, IUFD (especially 2nd trimester)
CMVMicrocephaly, sensorineural deafness, IUGR, periventricular calcifications
Zika virusMicrocephaly, brain malformations
Syphilis (secondary)Congenital syphilis - stillbirth, multi-organ disease
DenguePreterm, thrombocytopenia, neonatal dengue
MeaslesPreterm, miscarriage, pneumonia
COVID-19Preterm labor, maternal severe disease

PART 16: RADIATION IN PREGNANCY

Acceptable Dose

  • Threshold for fetal harm: >50 mGy (5 rad) - organogenesis period most sensitive (2-8 weeks)
  • US recommended safe limit: <50 mGy throughout pregnancy
  • Most diagnostic X-rays deliver far below this threshold

Radiation Dose of Common Investigations

InvestigationFetal Dose
Chest X-ray (single)0.01 mGy (negligible)
Abdomen/pelvis X-ray1-3 mGy
CT abdomen/pelvis8-25 mGy
CT chest<0.1 mGy
Mammography<0.01 mGy
Barium enema1.4-4 mGy

Imaging Safety in Pregnancy (Priority)

ModalitySafetyNotes
UltrasoundSAFEST - no ionizing radiationFirst choice for all obstetric imaging
MRI (without gadolinium)Safe - no ionizing radiationSecond choice; avoid gadolinium (especially 1st trimester)
X-rayLow dose - generally safe, avoid if possibleUse if clinically necessary; shield abdomen
CT scanHigher dose - use only if necessaryBenefit vs risk; MRI preferred
Nuclear medicineCase-by-caseTechnetium-99m generally acceptable; I-131 contraindicated
PET scanAvoid if possibleHigher radiation

PART 17: FOLIC ACID, IRON, CALCIUM - DOSE AND DURATION

Folic Acid

PhaseDoseDurationRoute
Preconception400 mcg/day (0.4 mg)At least 1 month before conceptionOral
During pregnancy400-800 mcg/dayUntil 12 weeks (neural tube closes by 28 days post-conception)Oral
High-risk (prev NTD, anticonvulsants, DM, obesity)5 mg/day3 months pre-conception to 12 weeksOral
Postconception continued400 mcg/dayThroughout pregnancy (for erythropoiesis)Oral
Why: Prevents neural tube defects (spina bifida, anencephaly). Neural tube closes at day 26-28 post-fertilization - most women don't know they're pregnant yet.

Iron (WHO 2016 Recommendations)

PhaseDose (elemental iron)DurationRoute
All pregnant women30-60 mg elemental iron daily + 400 mcg folic acidThroughout pregnancyOral
Anemia present (Hb <11 g/dL)120 mg elemental iron daily + 400 mcg folic acidUntil anemia corrected, then 30-60 mg dailyOral
Intermittent (if daily not tolerated)120 mg elemental iron once weeklyFrom 1st ANC contact through deliveryOral
Common forms: Ferrous sulfate 325 mg = 65 mg elemental iron; Ferrous fumarate 200 mg = 66 mg elemental iron Side effects: Nausea, constipation, dark stools, epigastric pain
Preconception: 60 mg daily (or dietary sources) to build stores

Calcium

PhaseDoseDurationRouteNotes
Pregnancy1000-1200 mg/day (dietary)ThroughoutOral
WHO for PIH prevention (low dietary calcium)1.5-2 g/day elemental calciumFrom 20 weeksOral (divided doses)Reduces preeclampsia risk by 50%
Lactation1000-1200 mg/dayThroughout breastfeedingOral
Note: Give calcium and iron at different times (calcium inhibits iron absorption).

PART 18: DRUGS TO AVOID IN PREGNANCY / SAFE ALTERNATIVES

Drugs Contraindicated in Pregnancy (Key List)

DrugRiskSafe Alternative
ACE inhibitors (enalapril, lisinopril)Fetal renal agenesis, oligohydramnios, neonatal renal failure (2nd/3rd trimester)Methyldopa, labetalol, nifedipine
ARBs (losartan, valsartan)Same as ACE inhibitorsMethyldopa, labetalol, nifedipine
WarfarinEmbryopathy (6-12 weeks): stippled epiphyses, nasal hypoplasia; CNS anomalies; fetal hemorrhageLMWH (enoxaparin) or UFH
Tetracyclines (doxycycline)Dental staining, inhibited bone growth (2nd/3rd trimester)Amoxicillin, erythromycin, azithromycin
Fluoroquinolones (ciprofloxacin)Cartilage damage (animal studies); use only if no alternativeNitrofurantoin (avoid near term), beta-lactams
MethotrexateTeratogen - skull, limb, palate defects; embryotoxicContraindicated - avoid pregnancy for 3 months after
ThalidomidePhocomelia (limb reduction defects)Contraindicated
Isotretinoin (Accutane)Severe craniofacial, CNS, cardiac anomaliesTopical treatments (azelaic acid, topical erythromycin)
Misoprostol (1st trimester misuse)Moebius sequence, limb defectsN/A - abortifacient
NSAIDs (ibuprofen, indomethacin after 32 weeks)Premature closure of ductus arteriosus, oligohydramniosParacetamol (acetaminophen)
Valproate (sodium valproate)Neural tube defects, autism, cognitive impairmentLamotrigine, levetiracetam (with monitoring)
CarbamazepineSpina bifida, craniofacial defectsLamotrigine
PhenytoinFetal hydantoin syndrome: growth retardation, dysmorphic featuresLevetiracetam
LithiumEbstein's anomaly (tricuspid valve)Quetiapine (lower risk)
Streptomycin/AminoglycosidesSensorineural deafness, renal toxicityPenicillin, erythromycin
Chloramphenicol (near term)Gray baby syndrome in neonateAlternatives per organism
Sulfonamides (near term)Neonatal hyperbilirubinemia, kernicterusNitrofurantoin (avoid >36 weeks)
AlcoholFetal alcohol syndrome: growth restriction, facial anomalies, CNSAbstinence
Androgens / testosteroneVirilization of female fetusAvoid
Radioactive iodine (I-131)Fetal thyroid ablationPTU (first trimester) / Methimazole (2nd/3rd trimester)
StatinsPossible teratogenStop statins; resume postpartum

Drugs Avoided in Lactation (Key)

DrugRiskAlternative
TetracyclinesDental stainingAmoxicillin, erythromycin
FluoroquinolonesCartilage concernBeta-lactams
MethotrexateImmunosuppression in infantAvoid - temporary stop feeding
LithiumToxicity in infantValproate, olanzapine (with monitoring)
Radioactive iodineThyroid ablationStop breastfeeding 48 hours after
AmiodaroneNeonatal thyroid dysfunctionAvoid if possible
Anticancer drugsCytotoxic to infantStop breastfeeding
AlcoholSedation, developmental delayAbstain or delay feeding 2h after alcohol
Generally safe in lactation: Paracetamol, ibuprofen (short-term), amoxicillin, cefalexin, metronidazole, methyldopa, labetalol, nifedipine, heparin, insulin, low-dose prednisolone.

PART 19: NST (NON-STRESS TEST) AND NTNB

Non-Stress Test (NST)

  • Definition: Electronic fetal monitoring (EFM) without uterine contractions - assesses fetal heart rate (FHR) response to fetal movement
  • Principle: Normally, FHR accelerates with fetal movement (intact CNS)
  • Technique: CTG (cardiotocography) machine; 20-40 minutes; external Doppler transducer; patient marks fetal movements
  • Indications: High-risk pregnancy, reduced fetal movement, post-dates, GDM, PIH, IUGR, SGA
  • When to start: From 28 weeks (generally); 32-34 weeks standard in many protocols

NST Interpretation (Reactive vs Non-Reactive)

Reactive (Normal) NST:
  • ≥2 accelerations in 20 minutes
  • Each acceleration: FHR rises ≥15 bpm above baseline
  • Duration ≥15 seconds
  • (At <32 weeks: ≥10 bpm rise for ≥10 seconds is acceptable)
Non-Reactive NST:
  • Fails to meet above criteria in 40 minutes (extend to 40 min before calling non-reactive)
  • Causes: fetal sleep cycle (wake with vibroacoustic stimulation), fetal prematurity, fetal compromise, drugs (sedatives, steroids)
  • Action: Extend to 40 min; vibroacoustic stimulation; if still non-reactive → BPP or CST
NTNB = Non-Reactive Non-Stress Test (NST) - indicates need for further evaluation

Contraction Stress Test (CST)

  • Assesses FHR response to uterine contractions (placental reserve)
  • Negative CST (normal): No late decelerations - adequate placental reserve
  • Positive CST (abnormal): Persistent late decelerations with >50% contractions

PART 20: ANTENATAL ULTRASOUND SCANS

1. Dating Scan (First Trimester Scan)

  • Ideal timing: 7-13+6 weeks (best: 8-10 weeks for viability; 11-13+6 weeks for combined screening)
  • What to assess:
    • Confirm intrauterine pregnancy
    • Viability (FHR present)
    • Number of fetuses / chorionicity in multiples
    • Gestational age by Crown-Rump Length (CRL)
    • Uterine and adnexal pathology

2. NT (Nuchal Translucency) Scan - First Trimester Combined Screening

  • Ideal timing: 11 weeks + 2 days to 13 weeks + 6 days (CRL 45-84 mm)
  • What to assess:
    • Nuchal Translucency (NT) - fluid-filled space at back of fetal neck
    • Normal NT: <3.5 mm (3rd percentile = 2.5 mm, 95th = 3.5 mm; risk-based cut-off varies)
    • Combined with: maternal age, PAPP-A, free beta-hCG
    • Nasal bone presence/absence
    • Ductus venosus flow
    • Tricuspid regurgitation
    • Significance: Screening for Down syndrome (trisomy 21), trisomy 18, trisomy 13, Turner syndrome, major cardiac defects. Increased NT also seen in structural anomalies (cardiac defects most common).

3. Anomaly Scan (Mid-Trimester Morphology Scan)

  • Ideal timing: 18-20 weeks (WHO/ISUOG - best at 18-22 weeks; RCOG: 18+0 to 20+6)
  • What to assess:
    • Fetal biometry: BPD, HC, AC, FL
    • Fetal anatomy systematically:
      • Head: brain, cerebellum, cavum septum pellucidum, lateral ventricles
      • Face: lips, orbits, nose
      • Neck: no masses
      • Heart: 4-chamber view, outflow tracts (LVOT, RVOT)
      • Thorax: lungs, diaphragm
      • Abdomen: stomach, kidneys (presence + echogenicity), bladder, abdominal wall
      • Spine: neural tube defects
      • Limbs: all 4 limbs present
      • Umbilical cord: 3-vessel cord, insertion
    • Placental site (and relation to internal os - for previa)
    • AFI (amniotic fluid index)
    • Cervical length (transvaginal if placenta previa or risk of PTL)
  • Significance: Detects major structural anomalies (cardiac, neural tube, abdominal wall, renal, skeletal)

4. Growth Scan (Third Trimester)

  • Ideal timing: 28-32 weeks (standard); 34-36 weeks (if IUGR concern)
  • What to assess:
    • Fetal biometry: BPD, HC, AC, FL → calculate EFW (estimated fetal weight)
    • Growth velocity (compared to previous scan)
    • AFI / SDP
    • Placental position and maturity (Grannum grade)
    • Umbilical artery Doppler (S/D ratio, RI, PI) - key for IUGR
    • MCA Doppler (if anemia/IUGR suspected)
    • Ductus venosus (if severe IUGR)
    • Presentation of fetus
  • Significance: Detect IUGR/SGA, macrosomia, oligohydramnios, polyhydramnios, placental insufficiency

PART 21: AFI AND SDP

Amniotic Fluid Index (AFI)

  • Ultrasound technique: 4-quadrant measurement; sum of largest vertical pocket in each quadrant (in cm), probe held vertically, no fetal parts in pocket
  • Normal AFI: 8-24 cm (5th-95th percentile at term)
  • Oligohydramnios: AFI <5 cm (or largest single pocket <2 cm)
  • Polyhydramnios: AFI >24 cm (or largest single pocket >8 cm)

Single Deepest Pocket (SDP) / Maximum Vertical Pocket (MVP)

  • Measures the single largest vertical pocket of fluid
  • Normal SDP: 2-8 cm
  • Oligohydramnios: SDP <2 cm
  • Polyhydramnios: SDP >8 cm
Note: SDP is preferred in multiple pregnancies; AFI preferred for singleton monitoring. Recent evidence suggests SDP may reduce unnecessary intervention rate compared to AFI.

Causes of Oligohydramnios

  • Fetal renal agenesis (Potter's sequence)
  • IUGR / uteroplacental insufficiency
  • PPROM / PROM
  • Post-term pregnancy
  • NSAIDs use

Causes of Polyhydramnios

  • Fetal: GI obstruction (duodenal atresia, esophageal atresia), CNS anomalies (anencephaly - can't swallow), neuromuscular (reduced swallowing)
  • Maternal: GDM (most common maternal cause)
  • Idiopathic (60%)

PART 22: GDM AND OGCT/OGTT

OGCT (Oral Glucose Challenge Test) - Screening Test

  • Dose: 50 g oral glucose load, non-fasting
  • Timing: Blood drawn at 1 hour
  • Cut-off: ≥7.8 mmol/L (140 mg/dL) → positive → proceed to OGTT
  • Some centers use ≥7.2 mmol/L (130 mg/dL) for greater sensitivity
  • When: 24-28 weeks (routine); earlier in high-risk women

OGTT (Oral Glucose Tolerance Test) - Diagnostic Test

WHO 2013 Criteria (75 g OGTT, fasting):
Fasting1-hour2-hour
GDM≥5.1 mmol/L (92 mg/dL)≥10.0 mmol/L (180 mg/dL)≥8.5 mmol/L (153 mg/dL)
Overt DM≥7.0 mmol/L-≥11.1 mmol/L
IADPSG/WHO criteria: GDM diagnosed if ANY one value meets or exceeds threshold.
OGTT Procedure:
  1. Fasting overnight (8-14 hours)
  2. Baseline fasting plasma glucose
  3. 75 g oral glucose in 250-300 mL water over 5 minutes
  4. Blood at 1 hour and 2 hours
  5. Patient remains seated, no smoking, no exercise
Contraindications to OGTT:
  • Active hyperemesis
  • Gastroparesis (delayed absorption)
  • Bariatric surgery (dumping syndrome)

GDM Definition (WHO 2013)

Gestational Diabetes Mellitus = any degree of glucose intolerance with onset or first recognition during pregnancy, diagnosed by 75 g OGTT meeting IADPSG criteria.

High-Risk Screening (early OGTT < 20 weeks) Indications:

  • BMI >30
  • Previous GDM
  • Previous macrosomic baby (>4.5 kg)
  • First-degree relative with DM
  • Polycystic ovarian syndrome
  • Previous unexplained stillbirth
  • Glycosuria on routine testing

PART 23: PIH, GESTATIONAL HYPERTENSION, PREECLAMPSIA, ECLAMPSIA

Definitions

ConditionDefinition
Chronic hypertensionHTN diagnosed before pregnancy or before 20 weeks; persists >12 weeks postpartum
Gestational hypertensionNew onset HTN ≥140/90 mmHg after 20 weeks without proteinuria, resolving by 12 weeks PP
PreeclampsiaNew onset HTN ≥140/90 after 20 weeks + proteinuria ≥300 mg/24h (or protein:creatinine ≥30 mg/mmol) OR end-organ damage
Severe preeclampsiaBP ≥160/110 + severe features (see below)
EclampsiaSeizures in a woman with preeclampsia (no other cause)
HELLP syndromeHemolysis + Elevated Liver enzymes + Low Platelets - variant of severe preeclampsia
PIH (Pregnancy-Induced Hypertension)Umbrella term - encompasses gestational HTN + preeclampsia
Superimposed preeclampsiaPreeclampsia developing on background of chronic HTN

Severe Features of Preeclampsia (ACOG 2024)

  • BP ≥160/110 mmHg (on two occasions ≥4 hours apart)
  • Thrombocytopenia (<100,000/mm³)
  • Renal impairment (creatinine >1.1 mg/dL or doubling of baseline)
  • Impaired liver function (transaminases 2x normal; epigastric/RUQ pain)
  • Pulmonary edema
  • New-onset headache unresponsive to medication
  • Visual disturbances

Eclampsia Management (ABCDE)

  • Airway/oxygen
  • MgSO4: Loading dose 4-6 g IV over 15-20 min → maintenance 1-2 g/hour
  • Antihypertensives: hydralazine IV or labetalol IV
  • Delivery (after stabilization)
  • Monitor: patellar reflexes (MgSO4 toxicity - absent before respiratory arrest), urine output, respiratory rate, serum Mg
  • MgSO4 antidote: Calcium gluconate 1 g IV

PART 24: HIGH-RISK PREGNANCY

A pregnancy is classified high-risk when there is an increased likelihood of adverse maternal or fetal outcome.
High-Risk Factors:
  • Age <18 or >35 years
  • BMI <18.5 or >30
  • Height <145 cm (CPD risk)
  • Grand multiparity (≥5)
  • Prior obstetric history: previous C-section, preterm birth, stillbirth, neonatal death, PPH, preeclampsia
  • Medical conditions: DM, HTN, cardiac disease, renal disease, thyroid disease, epilepsy, SLE, sickle cell disease, thrombophilia
  • Obstetric complications in current pregnancy: GDM, PIH, IUGR, multiple pregnancy, placenta previa, malpresentation
  • Social: substance abuse, teenage pregnancy, domestic violence

PART 25: COMPLICATIONS OF DECREASED FETAL MOVEMENTS

Normal Fetal Movements

  • Felt from 18-20 weeks (primi), 16-18 weeks (multi)
  • Cardiff "count to 10": 10 movements in 2 hours (or up to 12 hours)
  • Fetal Kick Count: ≥10 movements in 2 hours

Causes of Reduced FM

  • Fetal sleep cycle (normal - lasts 20-40 min usually, max 90 min)
  • Maternal sedatives/alcohol
  • Fetal compromise / uteroplacental insufficiency
  • Oligohydramnios
  • Cord compression
  • Prematurity
  • Anterior placenta (can dampen perception of movements)

Complications / Significance

  • IUGR (most common cause of reduced FM)
  • Cord accident (cord around neck, true knot)
  • Fetal hypoxia and acidosis
  • IUFD (intrauterine fetal death) - reduced FM often precedes death
  • Placental insufficiency

Management

  • History + CTG/NST
  • Ultrasound: AFI, biophysical profile, Doppler
  • If NST reactive + AFI normal + no other risk factors: reassure, continue kick counting
  • If non-reactive or concern: further evaluation, consider admission/delivery

PART 26: PRETERM LABOR COMPLICATIONS

Maternal:
  • Chorioamnionitis (infection)
  • Postpartum hemorrhage
  • Anxiety, psychological impact
Fetal/Neonatal:
  • Respiratory Distress Syndrome (RDS) - surfactant deficiency
  • Intraventricular hemorrhage (IVH)
  • Necrotizing enterocolitis (NEC)
  • Retinopathy of prematurity (ROP)
  • Hypothermia
  • Hypoglycemia
  • Sepsis
  • Cerebral palsy (long-term)
  • Death (especially <28 weeks without intensive care)
Management:
  • Corticosteroids (betamethasone 12 mg IM x2 doses 24h apart OR dexamethasone 6 mg IM x4 doses 12h apart) - 24-34+6 weeks to promote lung maturity
  • Tocolytics (nifedipine, atosiban, indomethacin <32 weeks) - delay delivery 48h for steroids
  • MgSO4 for neuroprotection (24-31+6 weeks, ACOG)
  • GBS prophylaxis (if applicable)

PART 27: POST-TERM LABOR COMPLICATIONS

Maternal:
  • Increased cesarean rate
  • Perineal trauma (macrosomic baby)
  • PPH
  • Anxiety / psychological
Fetal/Neonatal:
  • Uteroplacental insufficiency → fetal hypoxia
  • Oligohydramnios → cord compression
  • Meconium-stained liquor → Meconium Aspiration Syndrome (MAS)
  • Macrosomia (>4 kg or >4.5 kg) → shoulder dystocia
  • Stillbirth (risk doubles after 42 weeks)
  • Dysmaturity syndrome (post-mature appearance: dry, peeling skin, long nails, alert facies, no vernix/lanugo)
Management: Induction of labor at 41+0 to 42+0 weeks (NICE/ACOG recommend offering induction at 41 weeks to reduce stillbirth risk). At 42 weeks, induction is mandatory or intensive fetal monitoring.

SUMMARY TABLE: ANC SCANS - IDEAL WEEKS AND SIGNIFICANCE

ScanIdeal WeekKey Findings
Viability scan6-8 weeksHeartbeat, sac, CRL, ectopic exclusion
Combined/NT scan11+2 to 13+6NT measurement, nasal bone, CRL, trisomy screening
Anomaly scan18-20 weeks (up to 22)Full anatomy, placenta, AFI, biometry, cardiac views
Growth scan28-32 weeksEFW, growth velocity, AFI, Doppler
Late growth scan34-36 weeksEFW, presentation, placental site, Doppler
NST / BPP28+ weeksFetal well-being, reactive NST = normal

Sources: Creasy & Resnik's Maternal-Fetal Medicine 8e; Berek & Novak's Gynecology 16e; Williams Obstetrics 25e; WHO ANC Recommendations 2016 (who.int); ACOG Practice Bulletins; RCOG Green-top Guidelines; CMAJ Hyperemesis Gravidarum 2024.

Create a comprehensive OBG reference document (DOCX/PDF)

Reading File
Running Command

ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "created"

Running Command

mkdir -p /tmp/workspace/obg-reference

Writing File

~/obg-reference/build_obg.py

#!/usr/bin/env python3
"""
Comprehensive OBG Reference Document Builder
Generates a professionally formatted DOCX using python-docx
"""

from docx import Document
from docx.shared import Pt, Inches, RGBColor, Cm
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.enum.table import WD_TABLE_ALIGNMENT, WD_ALIGN_VERTICAL
from docx.oxml.ns import qn
from docx.oxml import OxmlElement
import copy

# ─────────────────────────── helpers ────────────────────────────

def set_cell_bg(cell, hex_color):
    """Set table cell background color."""
    tc = cell._tc
    tcPr = tc.get_or_add_tcPr()
    shd = OxmlElement('w:shd')
    shd.set(qn('w:val'), 'clear')
    shd.set(qn('w:color'), 'auto')
    shd.set(qn('w:fill'), hex_color)
    tcPr.append(shd)

def set_cell_font(cell, bold=False, size=10, color=None):
    for para in cell.paragraphs:
        for run in para.runs:
            run.bold = bold
            run.font.size = Pt(size)
            if color:
                run.font.color.rgb = RGBColor(*color)

def add_header_row(table, headers, bg="1A3C5E", fg=(255,255,255)):
    row = table.rows[0]
    for i, h in enumerate(headers):
        cell = row.cells[i]
        cell.text = h
        set_cell_bg(cell, bg)
        set_cell_font(cell, bold=True, size=9, color=fg)
        cell.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER

def add_table_row(table, values, alt=False):
    row = table.add_row()
    bg = "EEF4FB" if alt else "FFFFFF"
    for i, v in enumerate(values):
        cell = row.cells[i]
        cell.text = str(v)
        set_cell_bg(cell, bg)
        set_cell_font(cell, bold=False, size=9)
    return row

def style_heading(para, level, color_hex=None):
    """Apply custom color to a heading paragraph."""
    if color_hex:
        for run in para.runs:
            r, g, b = tuple(int(color_hex[i:i+2], 16) for i in (0, 2, 4))
            run.font.color.rgb = RGBColor(r, g, b)

def add_colored_heading(doc, text, level, color="1A3C5E"):
    p = doc.add_heading(text, level=level)
    r, g, b = tuple(int(color[i:i+2], 16) for i in (0, 2, 4))
    for run in p.runs:
        run.font.color.rgb = RGBColor(r, g, b)
    return p

def add_note_box(doc, text, bg="FFF3CD", border="FFC107"):
    """Add a highlighted note paragraph."""
    p = doc.add_paragraph()
    p.paragraph_format.left_indent = Inches(0.3)
    p.paragraph_format.right_indent = Inches(0.3)
    p.paragraph_format.space_before = Pt(4)
    p.paragraph_format.space_after = Pt(4)
    run = p.add_run(f"  NOTE: {text}  ")
    run.bold = True
    run.font.size = Pt(9)
    run.font.color.rgb = RGBColor(0x85, 0x64, 0x04)
    return p

def add_bullet(doc, text, level=0):
    p = doc.add_paragraph(style='List Bullet')
    p.paragraph_format.left_indent = Inches(0.3 + 0.2*level)
    run = p.add_run(text)
    run.font.size = Pt(10)
    return p

def simple_table(doc, headers, rows, col_widths=None):
    """Create a styled table with header and data rows."""
    t = doc.add_table(rows=1, cols=len(headers))
    t.style = 'Table Grid'
    t.alignment = WD_TABLE_ALIGNMENT.CENTER
    add_header_row(t, headers)
    for i, row in enumerate(rows):
        add_table_row(t, row, alt=(i % 2 == 0))
    if col_widths:
        for i, row in enumerate(t.rows):
            for j, cell in enumerate(row.cells):
                if j < len(col_widths):
                    cell.width = Inches(col_widths[j])
    doc.add_paragraph()
    return t

# ────────────────────────────────────────────────────────────────
# BUILD DOCUMENT
# ────────────────────────────────────────────────────────────────

doc = Document()

# Page margins
for section in doc.sections:
    section.top_margin = Cm(2.0)
    section.bottom_margin = Cm(2.0)
    section.left_margin = Cm(2.5)
    section.right_margin = Cm(2.0)

# Default styles
normal_style = doc.styles['Normal']
normal_style.font.name = 'Calibri'
normal_style.font.size = Pt(10)

for lvl in range(1, 5):
    try:
        h = doc.styles[f'Heading {lvl}']
        h.font.name = 'Calibri'
        h.font.bold = True
        if lvl == 1:
            h.font.size = Pt(15)
        elif lvl == 2:
            h.font.size = Pt(12)
        elif lvl == 3:
            h.font.size = Pt(11)
        else:
            h.font.size = Pt(10)
    except Exception:
        pass

# ══════════════════ COVER PAGE ══════════════════
p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = p.add_run("\n\n\n")

p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = p.add_run("COMPREHENSIVE OBSTETRICS & GYNAECOLOGY")
run.bold = True
run.font.size = Pt(22)
run.font.color.rgb = RGBColor(0x1A, 0x3C, 0x5E)

p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = p.add_run("ANC REFERENCE GUIDE")
run.bold = True
run.font.size = Pt(18)
run.font.color.rgb = RGBColor(0x1A, 0x3C, 0x5E)

doc.add_paragraph()
p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = p.add_run("─────────────────────────────────────────────────")
run.font.color.rgb = RGBColor(0x1A, 0x3C, 0x5E)

doc.add_paragraph()
p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = p.add_run("Based on: Williams Obstetrics 25e • Creasy & Resnik's Maternal-Fetal Medicine 8e\n"
                "Berek & Novak's Gynecology 16e • WHO ANC Guidelines 2016 • ACOG/RCOG/FIGO")
run.font.size = Pt(11)
run.font.color.rgb = RGBColor(0x55, 0x55, 0x55)

doc.add_paragraph()
p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = p.add_run("Date: July 2026")
run.font.size = Pt(10)
run.font.color.rgb = RGBColor(0x77, 0x77, 0x77)

doc.add_page_break()

# ══════════════════ SECTION 1: CORE DEFINITIONS ══════════════════
add_colored_heading(doc, "PART 1: CORE OBSTETRIC DEFINITIONS", 1)

add_colored_heading(doc, "Gravida and Para", 2)
simple_table(doc,
    ["Term", "Definition"],
    [
        ["Gravida", "Total number of pregnancies including current one, regardless of outcome. Multiple gestation counts as ONE."],
        ["Nulligravida", "Never been pregnant"],
        ["Primigravida", "Pregnant for the first time"],
        ["Multigravida", "Has been pregnant more than once"],
        ["Para", "Number of pregnancies that reached the age of viability (≥20 weeks / ≥500 g), alive or dead"],
        ["Nullipara", "Never delivered at or beyond viability"],
        ["Primipara", "Delivered once at or beyond viability"],
        ["Multipara", "Delivered twice or more at viability"],
        ["Grand Multipara", "5 or more deliveries at or beyond viability"],
    ],
    col_widths=[1.5, 4.5]
)
p = doc.add_paragraph()
run = p.add_run("GTPAL Notation: ")
run.bold = True
run.font.size = Pt(10)
p.add_run("Gravida / Term / Preterm / Abortions / Living children").font.size = Pt(10)

add_colored_heading(doc, "Abortion (WHO / FIGO Standard)", 2)
add_bullet(doc, "Expulsion or extraction of an embryo or fetus weighing 500 g or less (approximately ≤20-22 weeks gestation)")
add_bullet(doc, "Where weight unavailable: gestation less than 20 completed weeks")
add_bullet(doc, "WHO threshold in developing countries: before 28 weeks")
add_bullet(doc, "Types: Threatened | Inevitable | Incomplete | Complete | Missed | Septic | Recurrent")

add_colored_heading(doc, "Live Birth (WHO)", 2)
p = doc.add_paragraph("Complete expulsion or extraction of a product of conception from mother, irrespective of duration of pregnancy, which breathes or shows ANY evidence of life (heartbeat, pulsation of umbilical cord, definite voluntary muscle movement), regardless of whether cord is cut.")
p.font_size = Pt(10)

add_colored_heading(doc, "Stillbirth (WHO)", 2)
add_bullet(doc, "Birth of a baby with NO signs of life at or after 28 completed weeks gestation (birth weight ≥1000 g)")
add_bullet(doc, "Early fetal death: 20-27+6 weeks")
add_bullet(doc, "Late fetal death (Stillbirth): ≥28 weeks")
add_bullet(doc, "ACOG/CDC: ≥20 weeks | WHO international reporting: ≥28 weeks")

doc.add_paragraph()

# ══════════════════ SECTION 2: NAEGELE'S RULE ══════════════════
add_colored_heading(doc, "PART 2: NAEGELE'S RULE — EDD CALCULATION", 1)

add_colored_heading(doc, "Formula", 2)
p = doc.add_paragraph()
run = p.add_run("EDD = LMP + 9 months + 7 days   OR   LMP − 3 months + 7 days + 1 year")
run.bold = True
run.font.size = Pt(11)
run.font.color.rgb = RGBColor(0x1A, 0x3C, 0x5E)
p = doc.add_paragraph()
run = p.add_run("Example: ")
run.bold = True
p.add_run("LMP = 1st April → EDD = 8th January (next year)")

add_colored_heading(doc, "Indications (Reliable LMP)", 2)
for item in ["Regular menstrual cycles (28 ± 7 days)", "Certain, known LMP date",
             "No OCP use in preceding 3 months", "No breastfeeding in preceding 3 months",
             "No early pregnancy bleeding mimicking LMP"]:
    add_bullet(doc, item)

add_colored_heading(doc, "Contraindications / Limitations", 2)
for item in ["Irregular cycles / PCOS / oligomenorrhea", "Uncertain or unknown LMP",
             "Recent oral contraceptive pill use (cycle not normalized)",
             "Lactation amenorrhea preceding pregnancy",
             "First trimester bleeding causing confusion",
             "In all above: first trimester CRL ultrasound (7-13+6 weeks) SUPERSEDES Naegele's rule"]:
    add_bullet(doc, item)

# ══════════════════ SECTION 3: PERIOD OF GESTATION ══════════════════
add_colored_heading(doc, "PART 3: PERIOD OF GESTATION (POG)", 1)
add_bullet(doc, "POG calculated from FIRST DAY of LMP (not conception date)")
add_bullet(doc, "Normal pregnancy = 40 weeks (280 days) from LMP = 38 weeks from conception")
simple_table(doc,
    ["Trimester", "Weeks"],
    [
        ["1st Trimester", "0 to 13+6 weeks"],
        ["2nd Trimester", "14 to 27+6 weeks"],
        ["3rd Trimester", "28 weeks to delivery"],
    ],
    col_widths=[2.5, 3.5]
)

# ══════════════════ SECTION 4: BOOKING VISIT ══════════════════
add_colored_heading(doc, "PART 4: BOOKING VISIT AND WHO ANC CONTACTS (2016)", 1)

add_colored_heading(doc, "WHO 2016 Updated Model — 8 ANC Contacts", 2)
simple_table(doc,
    ["Contact", "Gestational Timing", "Key Activities"],
    [
        ["Contact 1", "Up to 12 weeks", "History, examination, booking investigations, TT1, folic acid, risk stratification"],
        ["Contact 2", "20 weeks", "Anomaly scan, anatomy check, anaemia screen"],
        ["Contact 3", "26 weeks", "Fetal growth, BP, urine, haemoglobin"],
        ["Contact 4", "30 weeks", "BP, fundal height, fetal movement"],
        ["Contact 5", "34 weeks", "OGTT result review, anaemia management, birth planning"],
        ["Contact 6", "36 weeks", "Presentation, BP, GBS swab, birth plan"],
        ["Contact 7", "38 weeks", "Fetal wellbeing, BP monitoring"],
        ["Contact 8", "40 weeks", "Fetal wellbeing; if not delivered return at 41 weeks"],
    ],
    col_widths=[1.0, 1.5, 4.0]
)

add_colored_heading(doc, "WHO Definition of Booked (Updated)", 2)
add_bullet(doc, "A woman is BOOKED if she attended ANC at least once before 20 weeks gestation and completed booking assessment with basic investigations")
add_bullet(doc, "Some definitions accept: at least 4 ANC visits, first before 20 weeks, last after 36 weeks")
add_bullet(doc, "UNBOOKED: No ANC before arrival in labor — associated with significantly higher maternal and perinatal mortality")

doc.add_paragraph()

# ══════════════════ SECTION 5: AGE COMPLICATIONS ══════════════════
add_colored_heading(doc, "PART 5: MATERNAL AND FETAL COMPLICATIONS BY MATERNAL AGE", 1)

add_colored_heading(doc, "Young Age (Teenage / Adolescent Pregnancy, <20 years)", 2)
simple_table(doc,
    ["Type", "Complications"],
    [
        ["Maternal", "PIH/Preeclampsia • Iron deficiency anaemia • Cephalopelvic disproportion (CPD) • Obstructed labour • Obstetric fistula • Higher STI rates • Postpartum depression • Poor ANC compliance"],
        ["Fetal/Neonatal", "Prematurity/Preterm birth • Low birth weight (LBW) / IUGR • Higher perinatal mortality • Congenital anomalies (very young mothers <16 years)"],
    ],
    col_widths=[1.5, 5.0]
)

add_colored_heading(doc, "Advanced Maternal Age (AMA, ≥35 years; Very Advanced ≥40 years)", 2)
simple_table(doc,
    ["Type", "Complications"],
    [
        ["Maternal", "GDM (2-3x risk) • Gestational HTN/Preeclampsia • Placenta previa & abruption • Increased C-section rate • Uterine dysfunction • Postpartum haemorrhage • Thromboembolic events • Pre-existing medical conditions"],
        ["Fetal/Neonatal", "Chromosomal anomalies (Down syndrome risk: age 35=1:350, age 40=1:100, age 45=1:30) • Stillbirth (2x risk at ≥40) • IUGR/LBW • Preterm birth"],
    ],
    col_widths=[1.5, 5.0]
)

# ══════════════════ SECTION 6: Rh INCOMPATIBILITY ══════════════════
add_colored_heading(doc, "PART 6: Rh INCOMPATIBILITY AND TREATMENT", 1)

add_colored_heading(doc, "Mechanism", 2)
add_bullet(doc, "Mother Rh-negative + Fetus Rh-positive → Fetomaternal haemorrhage → Maternal sensitisation")
add_bullet(doc, "IgG anti-D antibodies formed → cross placenta in subsequent pregnancies → destroy fetal RBCs")
add_bullet(doc, "Result: Haemolytic Disease of the Fetus and Newborn (HDFN)")

add_colored_heading(doc, "Fetal Complications (Severity by Antibody Titer)", 2)
for item in ["Fetal haemolytic anaemia", "Hydrops fetalis (severe anaemia → cardiac failure → generalised oedema)",
             "Intrauterine fetal death (IUFD)", "Neonatal jaundice (within 24h of birth)",
             "Kernicterus (bilirubin in basal ganglia → brain damage)", "Neonatal anaemia"]:
    add_bullet(doc, item)

add_colored_heading(doc, "Direct Coombs Test (DAT) vs Indirect Coombs Test (IAT)", 2)
simple_table(doc,
    ["Feature", "Direct Coombs Test (DAT)", "Indirect Coombs Test (IAT)"],
    [
        ["What it detects", "Antibodies BOUND to RBCs (in vivo sensitisation)", "FREE antibodies in maternal SERUM"],
        ["Sample used", "Newborn/fetal cord blood", "Mother's serum"],
        ["Positive in", "HDFN, autoimmune haemolytic anaemia", "Sensitised Rh-negative mother"],
        ["Principle", "Wash RBCs + add Coombs reagent → agglutination = positive", "Maternal serum + Rh+ RBCs → incubate → Coombs reagent → agglutination"],
        ["Purpose", "Diagnose HDFN in neonate", "Antenatal screening, cross-matching, monitoring Rh-negative mothers"],
    ],
    col_widths=[1.5, 2.8, 2.8]
)

add_colored_heading(doc, "Management", 2)
p = doc.add_paragraph()
run = p.add_run("Prevention — Anti-D Immunoglobulin (Rho-GAM):")
run.bold = True
add_bullet(doc, "Dose: 300 mcg IM (covers 30 mL fetal whole blood)")
add_bullet(doc, "Routine antenatal prophylaxis: 28 weeks (and optionally 34 weeks)")
add_bullet(doc, "Post-delivery: within 72 hours of delivery of Rh+ baby")
add_bullet(doc, "After sensitising events: abortion, amniocentesis, CVS, ECV, APH, trauma — give within 72 hours")
p = doc.add_paragraph()
run = p.add_run("Monitoring sensitised mother:")
run.bold = True
add_bullet(doc, "Indirect Coombs titer every 4 weeks; critical titer = 1:16")
add_bullet(doc, "MCA-PSV Doppler (gold standard for fetal anaemia): >1.5 MoM indicates significant anaemia")
p = doc.add_paragraph()
run = p.add_run("Treatment:")
run.bold = True
add_bullet(doc, "Intrauterine transfusion (IUT) if MCA-PSV >1.5 MoM")
add_bullet(doc, "Early delivery at 32-34 weeks if near term")
add_bullet(doc, "Neonatal: phototherapy, exchange transfusion, top-up transfusion")

doc.add_paragraph()

# ══════════════════ SECTION 7: OCCUPATIONAL & RELIGIOUS ══════════════════
add_colored_heading(doc, "PART 7: OCCUPATIONAL AND RELIGIOUS COMPLICATIONS IN PREGNANCY", 1)

add_colored_heading(doc, "Occupational Hazards", 2)
simple_table(doc,
    ["Hazard Type", "Examples", "Pregnancy Risk"],
    [
        ["Physical", "Prolonged standing, heavy lifting", "Preterm labour, LBW, varicosities, back pain"],
        ["Chemical", "Pesticides, solvents, anaesthetic gases", "Miscarriage, congenital anomalies, IUGR"],
        ["Radiation", "X-ray workers, radiographers", "Teratogenesis if >50 mGy; see Part 16"],
        ["Biological", "Healthcare workers", "Rubella, CMV, HBV, HIV, COVID-19 exposure"],
        ["Psychosocial", "High stress, shift work, night work", "Preterm birth, GDM, PIH, circadian disruption"],
    ],
    col_widths=[1.4, 2.0, 3.0]
)

add_colored_heading(doc, "Religious Practice Considerations", 2)
simple_table(doc,
    ["Practice", "Risk", "Recommendation"],
    [
        ["Fasting (Ramadan, Yom Kippur)", "Ketosis, dehydration, hypoglycaemia, reduced FM — especially in GDM", "Counselling; GDM patients may be exempt"],
        ["Dietary restrictions (vegan/vegetarian)", "Iron, B12, calcium, zinc deficiency", "Supplementation; dietitian referral"],
        ["Herbal/traditional remedies", "Some teratogenic or abortifacient", "Counsel against; document all use"],
        ["Refusal of blood products (JW)", "Risk in PPH, surgery", "Advance directive, cell salvage, iron optimisation"],
        ["Pilgrimage (Hajj)", "DVT, dehydration, infection, heat exhaustion", "Delay if <20 or >32 weeks; hydration; TED stockings"],
    ],
    col_widths=[1.8, 2.4, 2.4]
)

doc.add_page_break()

# ══════════════════ SECTION 8: GOOD DATES / EXCELLENT DATES ══════════════════
add_colored_heading(doc, "PART 8: GOOD DATES AND EXCELLENT DATES", 1)

add_colored_heading(doc, "Good Dates (Reliable LMP)", 2)
for item in ["LMP is certain and known",
             "Regular menstrual cycles (28 ± 7 days)",
             "No OCP use in preceding 3 months",
             "No breastfeeding in preceding 3 months",
             "No early pregnancy bleeding mistaken for LMP",
             "First trimester ultrasound (CRL) concordant — within 7 days of LMP dates"]:
    add_bullet(doc, item)

add_colored_heading(doc, "Excellent Dates (Gold Standard)", 2)
for item in ["All criteria for Good Dates PLUS:",
             "First trimester CRL ultrasound performed at 7-13+6 weeks",
             "CRL-based EDD differs from LMP-based EDD by ≤5-7 days",
             "IVF/ART: embryo transfer date known (most precise — EDD = transfer date + 266 days for day-3 embryo)"]:
    add_bullet(doc, item)
add_note_box(doc, "If US-based EDD and LMP-based EDD differ by >7 days (1st trimester), US dating supersedes LMP.")

# ══════════════════ SECTION 9: PRETERM / POST-TERM ══════════════════
add_colored_heading(doc, "PART 9: GESTATIONAL AGE CLASSIFICATION — PRETERM, TERM, POST-TERM", 1)

add_colored_heading(doc, "Preterm (WHO/ACOG) — Delivery before 37+0 completed weeks", 2)
simple_table(doc,
    ["Classification", "Gestational Age", "Notes"],
    [
        ["Extremely Preterm", "< 28+0 weeks", "Highest mortality/morbidity"],
        ["Very Preterm", "28+0 to 31+6 weeks", "High NICU dependency"],
        ["Moderate Preterm", "32+0 to 33+6 weeks", "Better outcomes with steroids"],
        ["Late Preterm", "34+0 to 36+6 weeks", "Largest group; still at risk"],
    ],
    col_widths=[2.0, 2.0, 2.5]
)

add_colored_heading(doc, "By Aetiology", 2)
for item in ["Spontaneous preterm labour (PTL)", 
             "Preterm Premature Rupture of Membranes (PPROM)",
             "Iatrogenic/medically indicated preterm delivery (PIH, IUGR, etc.)"]:
    add_bullet(doc, item)

add_colored_heading(doc, "Term Gestational Age Categories (ACOG 2013)", 2)
simple_table(doc,
    ["Category", "Gestational Age"],
    [
        ["Early Term", "37+0 to 38+6 weeks"],
        ["Full Term", "39+0 to 40+6 weeks"],
        ["Late Term", "41+0 to 41+6 weeks"],
        ["Post-Term", "≥ 42+0 weeks"],
    ],
    col_widths=[2.5, 3.5]
)

add_colored_heading(doc, "Post-Date vs Post-Term", 2)
add_bullet(doc, "Post-dates: Beyond EDD (>40 weeks) — colloquial term")
add_bullet(doc, "Prolonged pregnancy: >41+0 weeks")
add_bullet(doc, "Post-term (official): ≥42+0 completed weeks (WHO/ACOG)")
add_bullet(doc, "Risks: uteroplacental insufficiency, oligohydramnios, macrosomia, meconium aspiration, stillbirth (risk doubles after 42 weeks)")

doc.add_page_break()

# ══════════════════ SECTION 10: BLEEDING PV ══════════════════
add_colored_heading(doc, "PART 10: BLEEDING PV — CAUSES BY TRIMESTER", 1)

add_colored_heading(doc, "First Trimester Bleeding (0-13+6 weeks)", 2)
simple_table(doc,
    ["Cause", "Key Features"],
    [
        ["Threatened Abortion", "Bleeding + closed os + viable fetus on US"],
        ["Inevitable Abortion", "Bleeding + open os + painful cramps"],
        ["Incomplete Abortion", "Partial expulsion, open os, retained products"],
        ["Complete Abortion", "All products expelled, os closing, pain reducing"],
        ["Missed Abortion", "No symptoms, fetal demise on US (no FHR), brownish discharge"],
        ["Ectopic Pregnancy", "Amenorrhea + unilateral pain + bleeding + adnexal mass; raised hCG without IUP on US — EMERGENCY"],
        ["Hydatidiform Mole", "Heavy bleeding, uterus > dates, hyperemesis, snowstorm on US, very high hCG"],
        ["Implantation Bleeding", "Scanty spotting 6-10 days post conception, self-limiting"],
        ["Cervical Ectropion/Polyp", "Post-coital, painless, cervix on speculum"],
    ],
    col_widths=[2.0, 4.5]
)

add_colored_heading(doc, "Second Trimester Bleeding (14-27+6 weeks)", 2)
for item in ["Cervical incompetence — painless dilatation, 'bulging membranes'",
             "Placenta previa — painless, bright red bleeding",
             "Abruptio placentae — painful, dark blood, uterine tenderness",
             "Late miscarriage / mid-trimester loss",
             "Vasa previa — fetal blood, occurs with membrane rupture",
             "Cervical causes — polyp, ectropion, rarely carcinoma"]:
    add_bullet(doc, item)

add_colored_heading(doc, "Third Trimester — Antepartum Haemorrhage (APH, ≥28 weeks)", 2)
simple_table(doc,
    ["Cause", "Features", "Management Clue"],
    [
        ["Placenta Previa", "Painless, bright red, recurrent, no uterine tenderness, no fetal distress initially", "NEVER do VE before USS"],
        ["Abruptio Placentae", "Painful, dark blood, woody-hard uterus, fetal distress, concealed possible", "Immediate delivery if severe"],
        ["Vasa Previa", "Fetal blood — bright red at membrane rupture; fetal bradycardia", "Emergency LSCS"],
        ["Uterine Rupture", "Severe pain, cessation of contractions, fetal parts palpable, maternal shock", "Emergency laparotomy"],
        ["Bloody Show", "Labour onset, mucus-mixed, painless initially", "Assess for labour"],
        ["Cervical Causes", "Polyp, ectropion, carcinoma — post-coital / contact bleeding", "Speculum exam"],
    ],
    col_widths=[1.8, 2.8, 2.0]
)

doc.add_page_break()

# ══════════════════ SECTION 11: LEAKING PV ══════════════════
add_colored_heading(doc, "PART 11: LEAKING PV — DIFFERENTIATION FROM WHITE DISCHARGE", 1)

simple_table(doc,
    ["Feature", "Amniotic Fluid (LEAKING)", "White Discharge (Leucorrhoea)"],
    [
        ["Color", "Clear / pale straw", "White / yellow"],
        ["Odor", "Odorless or faint sweet", "May be offensive if infected"],
        ["Amount", "Continuous trickle, worsens with Valsalva / activity", "Constant but not progressive"],
        ["Ferning test (microscopy)", "POSITIVE — arborization pattern on dry slide", "NEGATIVE"],
        ["Nitrazine / pH test", "ALKALINE pH 7-7.5 — turns yellow paper BLUE", "ACIDIC pH 4-4.5 — paper stays yellow"],
        ["Pooling on speculum", "PRESENT in posterior fornix", "Absent"],
        ["AmniSure / IGFBP-1 test", "POSITIVE", "Negative"],
        ["Fetal fibronectin", "May be positive", "Usually negative"],
    ],
    col_widths=[2.2, 2.5, 2.5]
)
add_note_box(doc, "In ANY trimester: PPROM (before 37 weeks) or PROM (at term before labour) — confirm with ferning + pH + pooling. Never miss leaking in preterm — risk of chorioamnionitis and cord prolapse.")

doc.add_paragraph()

# ══════════════════ SECTION 12: ANC CHIEF COMPLAINTS PER TRIMESTER ══════════════════
add_colored_heading(doc, "PART 12: ANC CHIEF COMPLAINTS PER TRIMESTER", 1)

simple_table(doc,
    ["Trimester", "Common Chief Complaints"],
    [
        ["1st Trimester\n(0-13+6 wks)", "Amenorrhea (missed period) • Nausea and vomiting • Breast tenderness/heaviness • Frequency of micturition • Fatigue • Implantation spotting • Mild abdominal cramps • Headache • Ptyalism (excess salivation)"],
        ["2nd Trimester\n(14-27+6 wks)", "Quickening (first fetal movements) • Increasing abdominal size • Back pain (lumbar/sacral) • Heartburn/reflux • Leg cramps • Varicosities • Constipation • Skin changes (linea nigra, chloasma, striae) • Nasal congestion/epistaxis • Ankle oedema (physiological)"],
        ["3rd Trimester\n(28 wks-delivery)", "Increasing abdominal girth • Reduced fetal movements (ALARM) • Braxton Hicks • Dyspnoea • Frequency of micturition • Oedema (feet/ankles; face = PREECLAMPSIA alert) • Headache/visual disturbances • Epigastric pain • Leaking PV • Show • Labour pains"],
    ],
    col_widths=[1.5, 5.0]
)

doc.add_page_break()

# ══════════════════ SECTION 13: IMMUNIZATION ══════════════════
add_colored_heading(doc, "PART 13: IMMUNIZATION IN PREGNANCY", 1)

add_colored_heading(doc, "Recommended Vaccines", 2)
simple_table(doc,
    ["Vaccine", "Dose", "Route", "Timing", "Notes"],
    [
        ["Tetanus Toxoid (TT)\nor Td (preferred)", "0.5 mL x 2 doses\n(TT2: 4 weeks after TT1)", "IM (deltoid)", "TT1 at booking;\nTT2 at 4 weeks", "If previously immunized (TT3/4/5): single 0.5 mL booster"],
        ["Influenza (inactivated)", "0.5 mL single dose", "IM", "Any trimester;\nespecially 2nd/3rd", "Recommended every flu season; reduces maternal and neonatal morbidity"],
        ["Tdap (Pertussis)", "0.5 mL single dose", "IM", "27-36 weeks\n(each pregnancy)", "Protects neonate via transplacental antibodies before their own immunisation"],
        ["COVID-19\n(inactivated/mRNA)", "Per protocol", "IM", "Any trimester", "WHO recommends for all pregnant women"],
        ["Hepatitis B\n(if non-immune)", "1 mL x 3 doses", "IM", "Any trimester", "0, 1, 6 month schedule; safe in pregnancy"],
    ],
    col_widths=[1.5, 1.4, 0.7, 1.2, 2.5]
)

add_colored_heading(doc, "Vaccines CONTRAINDICATED in Pregnancy (Live vaccines)", 2)
for item in ["MMR (measles-mumps-rubella) — give postpartum",
             "Varicella (chickenpox) — give postpartum",
             "Yellow fever — use only if benefit >> risk (unavoidable travel to endemic area)",
             "Oral Polio Vaccine (OPV) — use IPV instead",
             "BCG — avoid"]:
    add_bullet(doc, item)

doc.add_paragraph()

# ══════════════════ SECTION 14: LAB INVESTIGATIONS ══════════════════
add_colored_heading(doc, "PART 14: LAB INVESTIGATIONS BY TRIMESTER", 1)

simple_table(doc,
    ["Trimester", "Investigation", "Purpose"],
    [
        ["1st (Booking)", "Blood group + Rh type", "Type and screen; Rh status"],
        ["1st (Booking)", "CBC (Hb, platelets)", "Anaemia, thrombocytopaenia"],
        ["1st (Booking)", "Urine R/M + C/S", "Asymptomatic bacteriuria (treat to prevent pyelonephritis)"],
        ["1st (Booking)", "Blood glucose (fasting/random)", "Screen for overt DM"],
        ["1st (Booking)", "VDRL/RPR", "Syphilis screening"],
        ["1st (Booking)", "HIV (with counselling)", "PMTCT"],
        ["1st (Booking)", "HBsAg", "Hepatitis B — neonatal prophylaxis planning"],
        ["1st (Booking)", "Rubella IgG", "Immunity status"],
        ["1st (Booking)", "TSH", "Thyroid disease screening"],
        ["1st (Booking)", "Indirect Coombs test", "If Rh-negative — detect alloimmunisation"],
        ["1st (Booking)", "NIPT / Combined screen (PAPP-A + free beta-hCG + NT US)", "Down syndrome + chromosomal anomaly screening (11-13+6 wks)"],
        ["2nd (14-22 wks)", "Anomaly scan (18-20 wks)", "Structural anomaly detection"],
        ["2nd (15-20 wks)", "Triple/Quad screen (AFP, hCG, uE3, Inhibin A)", "NTD + Down syndrome screen"],
        ["2nd", "Amniocentesis (if indicated)", "Karyotype, genetic diagnosis"],
        ["2nd-3rd (24-28 wks)", "GCT 50g (screening) then OGTT 75g if positive", "GDM diagnosis"],
        ["3rd (28 wks)", "Repeat CBC", "Anaemia"],
        ["3rd (35-37 wks)", "Group B Streptococcus (GBS) swab", "Intrapartum GBS prophylaxis"],
        ["3rd", "Repeat urine C/S, HIV, VDRL (if high risk)", "Per protocol"],
        ["3rd", "NST, BPP, Doppler, AFI", "Fetal well-being"],
    ],
    col_widths=[1.4, 2.5, 2.7]
)

doc.add_page_break()

# ══════════════════ SECTION 15: HYPEREMESIS ══════════════════
add_colored_heading(doc, "PART 15: HYPEREMESIS GRAVIDARUM", 1)

add_colored_heading(doc, "Definition and Diagnostic Criteria (CMAJ 2024 / RCOG 2024)", 2)
for item in ["Onset: typically 4-6 weeks, peaks 8-12 weeks",
             "Persistent vomiting not relieved by standard measures",
             "Weight loss ≥5% of pre-pregnancy body weight",
             "Dehydration + ketonuria (2+ on urinalysis)",
             "Electrolyte imbalance (hyponatraemia, hypokalaemia)",
             "PUQE-24 score ≥13 = severe",
             "Ketonuria NOT required for diagnosis (CMAJ 2024)"]:
    add_bullet(doc, item)

add_colored_heading(doc, "Causes", 2)
p = doc.add_paragraph()
run = p.add_run("Physiological: ")
run.bold = True
run.font.color.rgb = RGBColor(0x1A, 0x3C, 0x5E)
p.add_run("Peak hCG (8-12 weeks) • Oestrogen excess • Progesterone (reduced gastric motility) • H. pylori association • Thyroid (transient gestational hyperthyroidism — hCG cross-reacts with TSH receptor) • Psychosocial factors")

p = doc.add_paragraph()
run = p.add_run("Pathological (to exclude): ")
run.bold = True
run.font.color.rgb = RGBColor(0xC0, 0x39, 0x2B)
p.add_run("Gastroenteritis • Peptic ulcer • Pancreatitis • Hepatitis • Appendicitis • UTI/Pyelonephritis • True thyrotoxicosis • DKA • Raised ICP • Vestibular disease")

add_colored_heading(doc, "Treatment", 2)
simple_table(doc,
    ["Step", "Treatment", "Notes"],
    [
        ["1 - IV fluids", "Normal saline with KCl", "NOT dextrose first — risk of Wernicke's encephalopathy"],
        ["2 - Thiamine", "B1 100 mg IV BEFORE any dextrose", "MANDATORY to prevent Wernicke's"],
        ["3 - Anti-emetics", "Ondansetron • Metoclopramide • Prochlorperazine • Promethazine", "Ondansetron: use cautiously (risk of cleft palate if 1st trimester, limited data)"],
        ["4 - B6 ± Doxylamine", "Pyridoxine 25 mg + Doxylamine 12.5 mg (Diclegis)", "First-line for mild-moderate NVP"],
        ["5 - Steroids", "Methylprednisolone 16 mg TDS tapering", "Refractory hyperemesis only"],
        ["6 - Nutrition", "NG feeding or TPN if oral intake impossible", "Avoid oral iron during acute HG"],
    ],
    col_widths=[1.2, 2.5, 3.0]
)

add_colored_heading(doc, "Complications of Untreated Hyperemesis", 2)
for item in ["Wernicke's encephalopathy (thiamine deficiency — classic triad: confusion, ataxia, ophthalmoplegia)",
             "Mallory-Weiss oesophageal tears",
             "Fetal growth restriction / LBW",
             "Preterm birth",
             "Marchiafava-Bignami (rare corpus callosum demyelination)",
             "Maternal muscle wasting, severe electrolyte disturbances"]:
    add_bullet(doc, item)

doc.add_paragraph()

# ══════════════════ SECTION 16: FEVER WITH RASH ══════════════════
add_colored_heading(doc, "PART 16: FEVER WITH RASH IN PREGNANCY — IMPORTANCE", 1)
p = doc.add_paragraph("Fever with rash is critical because several infections causing this combination are teratogenic, cause fetal death, or cause serious neonatal disease.")

simple_table(doc,
    ["Infection", "Fetal / Neonatal Risk"],
    [
        ["Rubella (German measles)", "Congenital rubella syndrome: cataracts, SNHL, CHD (PDA, pulmonary stenosis), microcephaly, IUGR — WORST in 1st trimester (risk 90% <11 wks)"],
        ["Varicella (Chickenpox)", "Congenital varicella syndrome: skin scarring, limb hypoplasia, eye defects, CNS (5-12 weeks); Neonatal varicella if maternal VZV within 5 days of delivery — can be fatal"],
        ["Parvovirus B19 (Slapped Cheek)", "Fetal hydrops (profound anaemia), aplastic crisis, IUFD — especially 2nd trimester"],
        ["CMV", "Microcephaly, periventricular calcifications, SNHL, IUGR, hepatosplenomegaly — most common congenital infection"],
        ["Zika Virus", "Microcephaly, brain malformations (calcifications, cortical atrophy)"],
        ["Dengue", "Preterm birth, neonatal thrombocytopaenia, neonatal dengue"],
        ["Measles", "Miscarriage, preterm, pneumonia — no proven teratogenicity"],
        ["Syphilis (secondary)", "Congenital syphilis: stillbirth, multi-organ disease, rash, hepatomegaly, SNHL"],
    ],
    col_widths=[1.8, 4.7]
)

doc.add_page_break()

# ══════════════════ SECTION 17: RADIATION ══════════════════
add_colored_heading(doc, "PART 17: RADIATION IN PREGNANCY AND IMAGING SAFETY", 1)

add_colored_heading(doc, "Acceptable Radiation Dose", 2)
add_bullet(doc, "Threshold for fetal harm: >50 mGy (5 rad) — organogenesis (2-8 weeks) most sensitive")
add_bullet(doc, "US recommended safe limit: <50 mGy throughout pregnancy")
add_bullet(doc, "Most diagnostic X-rays deliver far below threshold")

simple_table(doc,
    ["Investigation", "Approximate Fetal Dose", "Safe?"],
    [
        ["Chest X-ray (single)", "0.01 mGy", "Yes — negligible"],
        ["Abdomen/pelvis X-ray", "1-3 mGy", "Yes"],
        ["CT Abdomen/Pelvis", "8-25 mGy", "Acceptable if necessary"],
        ["CT Chest", "<0.1 mGy", "Yes"],
        ["Barium Enema", "1.4-4 mGy", "Yes if necessary"],
        ["Nuclear medicine (Tc-99m)", "~5 mGy", "Generally acceptable"],
        ["I-131 (radioactive iodine)", "High thyroid dose", "CONTRAINDICATED"],
    ],
    col_widths=[2.5, 1.8, 2.0]
)

add_colored_heading(doc, "Imaging Priority in Pregnancy", 2)
simple_table(doc,
    ["Modality", "Safety", "Notes"],
    [
        ["Ultrasound", "SAFEST — no ionising radiation", "First choice for all obstetric imaging"],
        ["MRI (without gadolinium)", "Safe — no ionising radiation", "Second choice; avoid gadolinium especially 1st trimester"],
        ["X-ray", "Low dose — generally safe", "Use if clinically necessary; shield uterus"],
        ["CT scan", "Higher dose — use if necessary", "MRI preferred; use when CT changes management"],
        ["PET/Nuclear medicine", "Avoid if possible", "Case-by-case risk-benefit"],
    ],
    col_widths=[1.8, 1.8, 3.0]
)

doc.add_paragraph()

# ══════════════════ SECTION 18: SUPPLEMENTS ══════════════════
add_colored_heading(doc, "PART 18: FOLIC ACID, IRON, CALCIUM — DOSES AND DURATION", 1)

simple_table(doc,
    ["Supplement", "Phase", "Dose", "Duration", "Route", "Notes"],
    [
        ["Folic Acid", "Preconception", "400-800 mcg/day", "≥1 month before conception", "Oral", "Prevents neural tube defects"],
        ["Folic Acid", "Pregnancy (standard)", "400-800 mcg/day", "Throughout (esp. first 12 weeks)", "Oral", "Neural tube closes day 26-28"],
        ["Folic Acid", "High-risk (prev NTD, anticonvulsants, DM, obesity)", "5 mg/day", "3 months pre-conception to 12 weeks", "Oral", "High-dose regimen"],
        ["Iron (WHO 2016)", "All pregnant women", "30-60 mg elemental iron/day + 400 mcg folate", "Throughout pregnancy", "Oral", "Prevents IDA"],
        ["Iron", "Anaemia (Hb <11 g/dL)", "120 mg elemental iron/day + folate", "Until corrected, then 30-60 mg/day", "Oral", "Monitor Hb response"],
        ["Iron", "Intermittent (intolerant)", "120 mg elemental iron once weekly", "1st ANC contact to delivery", "Oral", "Reduces GI side effects"],
        ["Calcium", "All pregnant women", "1000-1200 mg/day (dietary)", "Throughout", "Oral/Dietary", ""],
        ["Calcium", "PIH prevention (low dietary Ca)", "1.5-2 g/day elemental calcium", "From 20 weeks", "Oral (divided doses)", "Reduces preeclampsia risk ~50% (WHO)"],
        ["Calcium", "Lactation", "1000-1200 mg/day", "Throughout breastfeeding", "Oral", ""],
    ],
    col_widths=[1.3, 1.5, 1.6, 1.6, 0.8, 1.8]
)
add_note_box(doc, "Give calcium and iron at DIFFERENT meal times — calcium inhibits iron absorption. Common ferrous sulfate 325 mg = 65 mg elemental iron.")

doc.add_page_break()

# ══════════════════ SECTION 19: DRUGS ══════════════════
add_colored_heading(doc, "PART 19: DRUGS AVOIDED IN PREGNANCY AND LACTATION", 1)

add_colored_heading(doc, "Key Drugs Contraindicated in Pregnancy", 2)
simple_table(doc,
    ["Drug", "Risk to Fetus", "Safe Alternative"],
    [
        ["ACE Inhibitors\n(enalapril, lisinopril)", "Fetal renal agenesis, oligohydramnios, neonatal renal failure (2nd/3rd trimester)", "Methyldopa, Labetalol, Nifedipine"],
        ["ARBs (losartan)", "Same as ACE inhibitors", "Methyldopa, Labetalol"],
        ["Warfarin", "Embryopathy 6-12 wks (stippled epiphyses, nasal hypoplasia); CNS anomalies; fetal haemorrhage", "LMWH (Enoxaparin) or UFH"],
        ["Tetracyclines\n(doxycycline)", "Dental staining, impaired bone growth (2nd/3rd trimester)", "Amoxicillin, Erythromycin, Azithromycin"],
        ["Fluoroquinolones", "Cartilage damage (animal data)", "Beta-lactams, Nitrofurantoin (avoid near term)"],
        ["Methotrexate", "Embryotoxic — CNS, limb, craniofacial defects", "Contraindicated; avoid pregnancy 3 months after"],
        ["Isotretinoin\n(Accutane)", "Severe craniofacial, CNS, cardiac anomalies", "Topical: azelaic acid, topical erythromycin"],
        ["NSAIDs\n(after 32 wks)", "Premature DA closure, oligohydramnios", "Paracetamol (acetaminophen)"],
        ["Sodium Valproate", "NTDs, autism, cognitive impairment — HIGH RISK", "Lamotrigine, Levetiracetam"],
        ["Phenytoin", "Fetal hydantoin syndrome: dysmorphic features, IUGR", "Levetiracetam"],
        ["Carbamazepine", "Spina bifida, craniofacial defects", "Lamotrigine"],
        ["Lithium", "Ebstein's anomaly (tricuspid valve)", "Quetiapine (lower risk)"],
        ["Streptomycin/Aminoglycosides", "Sensorineural deafness, renal toxicity", "Penicillin, Erythromycin"],
        ["Statins", "Possible teratogen (uncertain)", "Stop statins; resume postpartum"],
        ["Radioactive Iodine (I-131)", "Fetal thyroid ablation", "PTU (1st trimester) / Methimazole (2nd/3rd)"],
        ["Thalidomide", "Phocomelia (limb reduction defects)", "Strictly contraindicated"],
        ["Alcohol", "Fetal Alcohol Syndrome: IUGR, CNS, facial anomalies", "Complete abstinence"],
    ],
    col_widths=[1.5, 2.5, 2.5]
)

add_colored_heading(doc, "Key Drugs Avoided in Lactation", 2)
simple_table(doc,
    ["Drug", "Risk to Infant", "Alternative"],
    [
        ["Tetracyclines", "Dental staining", "Amoxicillin, Erythromycin"],
        ["Fluoroquinolones", "Cartilage risk", "Beta-lactams"],
        ["Methotrexate", "Immunosuppression", "Temporary breastfeeding cessation"],
        ["Lithium", "Toxicity", "Valproate, Olanzapine (monitor)"],
        ["Radioactive iodine", "Thyroid ablation", "Stop feeding 48h post-dose"],
        ["Amiodarone", "Neonatal thyroid dysfunction", "Avoid if possible"],
        ["Cytotoxic drugs", "Neonatal cytotoxicity", "Stop breastfeeding"],
        ["Alcohol (>1-2 units)", "Sedation, developmental delay", "Abstain or wait 2h per unit"],
    ],
    col_widths=[1.8, 2.2, 2.6]
)
add_note_box(doc, "Generally SAFE in lactation: Paracetamol, short-term ibuprofen, amoxicillin, cefalexin, metronidazole, methyldopa, labetalol, nifedipine, heparin, insulin, low-dose prednisolone.")

doc.add_page_break()

# ══════════════════ SECTION 20: NST / CTG ══════════════════
add_colored_heading(doc, "PART 20: NST (NON-STRESS TEST) AND CTG INTERPRETATION", 1)

add_colored_heading(doc, "Non-Stress Test (NST)", 2)
add_bullet(doc, "Electronic fetal monitoring WITHOUT contractions — assesses FHR response to fetal movement")
add_bullet(doc, "Principle: Normally, FHR accelerates with fetal movement (intact CNS = 'reactive')")
add_bullet(doc, "Equipment: CTG/cardiotocograph, external Doppler transducer")
add_bullet(doc, "Duration: 20 minutes; extend to 40 minutes before calling non-reactive")
add_bullet(doc, "Indications: High-risk pregnancy, reduced FM, post-dates, GDM, PIH, IUGR, SGA")
add_bullet(doc, "When to start: From 28 weeks; 32-34 weeks standard in most protocols")

add_colored_heading(doc, "NST Interpretation", 2)
simple_table(doc,
    ["Result", "Criteria", "Action"],
    [
        ["REACTIVE (Normal)", "≥2 accelerations in 20 min; each ≥15 bpm above baseline for ≥15 seconds\n(<32 weeks: ≥10 bpm for ≥10 seconds)", "Reassure; routine follow-up"],
        ["NON-REACTIVE (NTNB)", "Fails reactive criteria in 40 minutes", "Vibroacoustic stimulation; extend to 40 min; if still non-reactive → BPP or CST"],
        ["NTNB causes", "Fetal sleep cycle (commonest) • Prematurity • Fetal compromise • CNS depressants (opioids, sedatives) • Steroids given <48h prior", "Investigate cause; serial monitoring"],
    ],
    col_widths=[1.8, 3.0, 2.0]
)

add_colored_heading(doc, "Contraction Stress Test (CST)", 2)
add_bullet(doc, "Negative CST (NORMAL): No late decelerations — adequate placental reserve")
add_bullet(doc, "Positive CST (ABNORMAL): Persistent late decelerations with >50% contractions — placental insufficiency")

doc.add_paragraph()

# ══════════════════ SECTION 21: SCANS ══════════════════
add_colored_heading(doc, "PART 21: ANTENATAL ULTRASOUND SCANS — IDEAL WEEKS AND SIGNIFICANCE", 1)

simple_table(doc,
    ["Scan", "Ideal Week", "Key Structures Assessed", "Significance"],
    [
        ["Viability / Early Scan", "6-8 weeks", "FHR, gestational sac, CRL, number of fetuses, adnexa", "Confirm IUP, viability, exclude ectopic, date by CRL"],
        ["First Trimester Combined / NT Scan", "11+2 to 13+6 weeks\n(CRL 45-84 mm)", "NT (normal <3.5 mm), nasal bone, ductus venosus, tricuspid flow, CRL, anatomy survey", "Trisomy 21/18/13 screening; major cardiac defects; chorionicity in twins"],
        ["Anomaly / Morphology Scan", "18-20 weeks\n(up to 22 weeks)", "Full fetal anatomy: head (BPD, cerebellum, CSP), face, heart (4-chamber + outflow tracts), spine, abdomen (stomach, kidneys, bladder, AC), limbs, cord insertion; placenta; AFI; cervical length if indicated", "Detect major structural anomalies (cardiac, NTD, abdominal wall defects, renal anomalies, skeletal dysplasias)"],
        ["Growth Scan (standard)", "28-32 weeks", "Biometry (BPD, HC, AC, FL) → EFW; AFI/SDP; placental site + maturity; umbilical artery Doppler (RI, PI, S/D ratio); presentation", "IUGR / macrosomia detection; placental insufficiency; oligohydramnios/polyhydramnios"],
        ["Late Growth / Pre-labour Scan", "34-36 weeks", "EFW, presentation, Doppler, AFI, placental position", "Birth planning; confirm presentation; placenta previa re-assessment"],
    ],
    col_widths=[1.4, 1.3, 2.8, 2.0]
)

doc.add_paragraph()

# ══════════════════ SECTION 22: AFI / SDP ══════════════════
add_colored_heading(doc, "PART 22: AFI AND SDP (AMNIOTIC FLUID ASSESSMENT)", 1)

simple_table(doc,
    ["Parameter", "Normal", "Oligohydramnios", "Polyhydramnios"],
    [
        ["AFI (4-quadrant sum)", "8-24 cm", "<5 cm", ">24 cm"],
        ["SDP / MVP (single deepest pocket)", "2-8 cm", "<2 cm", ">8 cm"],
    ],
    col_widths=[2.0, 1.5, 1.5, 1.5]
)

simple_table(doc,
    ["Condition", "Causes"],
    [
        ["Oligohydramnios", "Fetal renal agenesis (Potter's) • IUGR/Uteroplacental insufficiency • PPROM/PROM • Post-term pregnancy • NSAIDs"],
        ["Polyhydramnios", "Fetal GI obstruction (duodenal/oesophageal atresia) • CNS anomalies (anencephaly — cannot swallow) • Neuromuscular (reduced swallowing) • GDM (most common maternal cause) • Idiopathic (60%)"],
    ],
    col_widths=[2.0, 5.5]
)
add_note_box(doc, "SDP preferred for multiple pregnancies; AFI preferred for singleton monitoring. Recent evidence suggests SDP reduces unnecessary intervention vs AFI.")

doc.add_page_break()

# ══════════════════ SECTION 23: OGCT / OGTT / GDM ══════════════════
add_colored_heading(doc, "PART 23: OGCT, OGTT, GDM, PIH, PREECLAMPSIA, ECLAMPSIA", 1)

add_colored_heading(doc, "OGCT — Glucose Challenge Test (Screening)", 2)
add_bullet(doc, "Dose: 50 g oral glucose — NON-FASTING")
add_bullet(doc, "Blood drawn at 1 HOUR")
add_bullet(doc, "Cut-off: ≥7.8 mmol/L (140 mg/dL) → POSITIVE → proceed to OGTT")
add_bullet(doc, "Some centres: ≥7.2 mmol/L (130 mg/dL) for higher sensitivity")
add_bullet(doc, "When: 24-28 weeks routine; earlier in high-risk women")

add_colored_heading(doc, "OGTT — Oral Glucose Tolerance Test (Diagnostic)", 2)
p = doc.add_paragraph()
run = p.add_run("Procedure: ")
run.bold = True
for step in ["Fast 8-14 hours overnight",
             "Fasting plasma glucose (FPG) taken",
             "75 g oral glucose in 250-300 mL water over 5 minutes",
             "Blood at 1 hour and 2 hours",
             "Patient remains seated, no smoking, no exercise during test"]:
    add_bullet(doc, step)

add_colored_heading(doc, "WHO/IADPSG 2013 Diagnostic Criteria (75 g OGTT)", 2)
simple_table(doc,
    ["Diagnosis", "Fasting", "1-hour", "2-hour"],
    [
        ["GDM (any 1 threshold met)", "≥5.1 mmol/L (92 mg/dL)", "≥10.0 mmol/L (180 mg/dL)", "≥8.5 mmol/L (153 mg/dL)"],
        ["Overt DM in pregnancy", "≥7.0 mmol/L (126 mg/dL)", "—", "≥11.1 mmol/L (200 mg/dL)"],
    ],
    col_widths=[2.0, 1.8, 1.5, 1.5]
)

add_colored_heading(doc, "OGTT Contraindications", 2)
for item in ["Active hyperemesis gravidarum", "Gastroparesis (delayed absorption)", "Post-bariatric surgery (dumping syndrome risk)"]:
    add_bullet(doc, item)

add_colored_heading(doc, "High-Risk Screening (Early OGTT <20 weeks)", 2)
for item in ["BMI ≥30", "Previous GDM", "Previous macrosomic baby (>4.5 kg)",
             "First-degree relative with DM", "PCOS",
             "Previous unexplained stillbirth", "Glycosuria on routine urinalysis"]:
    add_bullet(doc, item)

doc.add_paragraph()

# ══════════════════ SECTION 24: HYPERTENSIVE DISORDERS ══════════════════
add_colored_heading(doc, "PART 24: HYPERTENSIVE DISORDERS OF PREGNANCY", 1)

simple_table(doc,
    ["Condition", "Definition"],
    [
        ["Chronic Hypertension", "HTN diagnosed before pregnancy OR before 20 weeks; persists >12 weeks postpartum"],
        ["Gestational Hypertension", "NEW onset HTN ≥140/90 mmHg AFTER 20 weeks WITHOUT proteinuria; resolves by 12 weeks postpartum"],
        ["Preeclampsia", "NEW onset HTN ≥140/90 after 20 weeks PLUS proteinuria ≥300 mg/24h (or PCR ≥30 mg/mmol) OR end-organ damage"],
        ["Severe Preeclampsia", "BP ≥160/110 + ≥1 severe feature"],
        ["Eclampsia", "Seizures in a preeclamptic woman with no other cause"],
        ["HELLP Syndrome", "Haemolysis + Elevated Liver enzymes + Low Platelets — severe preeclampsia variant"],
        ["Superimposed Preeclampsia", "Preeclampsia developing on background of pre-existing chronic HTN"],
    ],
    col_widths=[2.0, 5.0]
)

add_colored_heading(doc, "Severe Features of Preeclampsia (ACOG 2024)", 2)
for item in ["BP ≥160/110 mmHg on two occasions ≥4 hours apart",
             "Thrombocytopaenia (<100,000/mm³)",
             "Renal impairment (creatinine >1.1 mg/dL or doubling of baseline)",
             "Impaired liver function (transaminases >2x normal; epigastric/RUQ pain)",
             "Pulmonary oedema",
             "New-onset headache unresponsive to medication",
             "Visual disturbances (scotomata, blurred vision)"]:
    add_bullet(doc, item)

add_colored_heading(doc, "Eclampsia Management (ABCDE)", 2)
simple_table(doc,
    ["Step", "Action"],
    [
        ["A — Airway", "Left lateral position, oxygen, protect airway"],
        ["B — MgSO4", "Loading: 4-6 g IV over 15-20 min → Maintenance: 1-2 g/hour IV"],
        ["C — Antihypertensives", "Hydralazine 5-10 mg IV or Labetalol 20-80 mg IV boluses"],
        ["D — Deliver", "Stabilise first; aim delivery within 24 hours"],
        ["E — Monitor", "Patellar reflexes (absent = Mg toxicity), RR >12/min, UO >25 mL/h, serum Mg 4-7 mEq/L"],
        ["Antidote", "Calcium gluconate 1 g IV (10 mL of 10%) — for MgSO4 toxicity"],
    ],
    col_widths=[2.0, 5.0]
)

doc.add_page_break()

# ══════════════════ SECTION 25: DECREASED FM ══════════════════
add_colored_heading(doc, "PART 25: DECREASED FETAL MOVEMENTS — SIGNIFICANCE AND COMPLICATIONS", 1)

add_colored_heading(doc, "Normal Fetal Movement", 2)
add_bullet(doc, "First felt at 18-20 weeks (primigravida); 16-18 weeks (multigravida)")
add_bullet(doc, "Cardiff Count to 10: 10 movements within 2 hours (or up to 12 hours)")
add_bullet(doc, "Fetal sleep cycle: normally 20-40 min (max 90 min)")

add_colored_heading(doc, "Causes of Reduced FM", 2)
for item in ["Fetal sleep cycle (most common, benign — max 90 min)",
             "Maternal sedatives, alcohol, opioids",
             "Fetal compromise / uteroplacental insufficiency",
             "Oligohydramnios", "Cord compression", "Anterior placenta (dampens perception)",
             "Fetal prematurity", "IUGR"]:
    add_bullet(doc, item)

add_colored_heading(doc, "Complications / Significance", 2)
for item in ["IUGR — most common cause of reduced FM",
             "Cord accident (true knot, nuchal cord)",
             "Fetal hypoxia and acidosis",
             "Intrauterine fetal death (IUFD) — reduced FM often precedes death by 12-48h",
             "Placental insufficiency"]:
    add_bullet(doc, item)

add_colored_heading(doc, "Management", 2)
add_bullet(doc, "History + NST/CTG")
add_bullet(doc, "Ultrasound: AFI, biophysical profile (BPP), Doppler")
add_bullet(doc, "Reactive NST + normal AFI + no other risk factors → reassure, continue kick counting")
add_bullet(doc, "Non-reactive or concern → extended monitoring, admission, consider delivery")

doc.add_paragraph()

# ══════════════════ SECTION 26: PRETERM COMPLICATIONS ══════════════════
add_colored_heading(doc, "PART 26: COMPLICATIONS OF PRETERM LABOUR", 1)

simple_table(doc,
    ["Neonatal Complication", "Details"],
    [
        ["Respiratory Distress Syndrome (RDS)", "Surfactant deficiency — commonest cause of preterm death; risk inversely proportional to GA"],
        ["Intraventricular Haemorrhage (IVH)", "Germinal matrix bleed → brain injury; grades I-IV"],
        ["Necrotising Enterocolitis (NEC)", "Ischaemic gut necrosis; <32 weeks risk"],
        ["Retinopathy of Prematurity (ROP)", "Abnormal retinal vascularisation; risk if <32 weeks or O2 exposure"],
        ["Hypothermia", "Inadequate brown fat; maintain thermoneutral environment"],
        ["Hypoglycaemia", "Inadequate glycogen stores"],
        ["Sepsis (early + late onset)", "Immature immune system"],
        ["Cerebral Palsy (long-term)", "Periventricular leukomalacia; esp. <28 weeks"],
    ],
    col_widths=[2.5, 5.0]
)

add_colored_heading(doc, "Management of Preterm Labour", 2)
simple_table(doc,
    ["Intervention", "Detail"],
    [
        ["Corticosteroids", "Betamethasone 12 mg IM × 2 doses 24h apart OR Dexamethasone 6 mg IM × 4 doses 12h apart — 24-34+6 weeks"],
        ["Tocolytics (delay 48h for steroids)", "Nifedipine (first-line) • Atosiban (oxytocin antagonist) • Indomethacin (<32 weeks, short-term)"],
        ["MgSO4 (neuroprotection)", "24-31+6 weeks — 4 g loading, 1 g/hour maintenance (ACOG/SMFM)"],
        ["GBS Prophylaxis", "Penicillin G IV if GBS positive or unknown and <37 weeks"],
    ],
    col_widths=[2.0, 5.5]
)

doc.add_page_break()

# ══════════════════ SECTION 27: POST-TERM COMPLICATIONS ══════════════════
add_colored_heading(doc, "PART 27: COMPLICATIONS OF POST-TERM PREGNANCY (≥42 WEEKS)", 1)

simple_table(doc,
    ["Complication", "Details"],
    [
        ["Uteroplacental insufficiency", "Placental 'ageing' → reduced O2/nutrient delivery → fetal hypoxia"],
        ["Oligohydramnios", "Fetal urine output falls → cord compression risk"],
        ["Meconium-stained liquor", "Fetal hypoxia → meconium passage → Meconium Aspiration Syndrome (MAS)"],
        ["Macrosomia", "Continued fetal growth → shoulder dystocia, traumatic delivery"],
        ["Stillbirth", "Risk doubles after 42 weeks vs 39-40 weeks"],
        ["Dysmaturity syndrome", "Dry peeling skin, long nails, alert facies, no vernix/lanugo, meconium-stained skin"],
        ["Maternal", "Increased C-section • Perineal trauma • PPH • Psychological distress"],
    ],
    col_widths=[2.0, 5.5]
)
add_note_box(doc, "Induction of labour at 41+0-42+0 weeks reduces stillbirth without increasing C-section rate (ARRIVE trial, NICE 2021). At 42 weeks: induction is mandatory or intensive fetal surveillance.")

doc.add_paragraph()

# ══════════════════ SECTION 28: HIGH-RISK PREGNANCY ══════════════════
add_colored_heading(doc, "PART 28: HIGH-RISK PREGNANCY", 1)
p = doc.add_paragraph("A pregnancy with increased likelihood of adverse maternal or fetal outcome requiring additional monitoring or intervention.")

add_colored_heading(doc, "Risk Factors", 2)
simple_table(doc,
    ["Category", "Factors"],
    [
        ["Age/Demographics", "Age <18 or ≥35 • Height <145 cm (CPD risk) • BMI <18.5 or >30"],
        ["Obstetric History", "Previous C-section • Preterm birth • Stillbirth/NND • PPH • Preeclampsia • Grand multiparity (≥5) • Previous molar pregnancy"],
        ["Current Pregnancy", "GDM • PIH/Preeclampsia • IUGR • Multiple pregnancy • Placenta previa • Malpresentation • Polyhydramnios/Oligohydramnios"],
        ["Medical Conditions", "DM • HTN • Cardiac disease • Renal disease • Thyroid disease • Epilepsy • SLE • Sickle cell • Thrombophilia"],
        ["Social", "Substance abuse • Teenage pregnancy • Domestic violence • Poor socioeconomic status • Unbooked"],
    ],
    col_widths=[1.8, 5.0]
)

doc.add_paragraph()

# ══════════════════ REFERENCES ══════════════════
doc.add_page_break()
add_colored_heading(doc, "REFERENCES AND SOURCES", 1)
refs = [
    "Williams Obstetrics, 25th Edition — Cunningham et al., McGraw-Hill",
    "Creasy & Resnik's Maternal-Fetal Medicine: Principles and Practice, 8th Edition",
    "Berek & Novak's Gynecology, 16th Edition",
    "WHO Recommendations on Antenatal Care for a Positive Pregnancy Experience (2016) — WHO/RHR/16.12",
    "ACOG Practice Bulletin: Gestational Hypertension and Preeclampsia (2024 update)",
    "ACOG Committee Opinion: Definition of Term Pregnancy (2013)",
    "RCOG Green-top Guideline: The Management of Nausea and Vomiting of Pregnancy (2024)",
    "CMAJ: Diagnosis and treatment of hyperemesis gravidarum (2024)",
    "IADPSG/WHO Diagnostic Criteria for GDM (2013)",
    "RCOG/SOGC: Management of Reduced Fetal Movements",
    "ACOG/SMFM: Magnesium Sulphate for Neuroprotection (2021)",
    "March of Dimes / CDC Gestational Age Classification (2024)",
]
for i, ref in enumerate(refs, 1):
    p = doc.add_paragraph()
    run = p.add_run(f"{i}. {ref}")
    run.font.size = Pt(9)
    run.font.color.rgb = RGBColor(0x44, 0x44, 0x44)

# ══════════════════ FOOTER NOTE ══════════════════
doc.add_paragraph()
p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = p.add_run("─────────────────────────────────────────────────────────────────────")
run.font.color.rgb = RGBColor(0x1A, 0x3C, 0x5E)
p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = p.add_run("This document is for educational reference only. "
                "Always consult current institutional guidelines and clinical judgment for patient care.")
run.italic = True
run.font.size = Pt(9)
run.font.color.rgb = RGBColor(0x77, 0x77, 0x77)

# ══════════════════ SAVE ══════════════════
out_path = "/tmp/workspace/obg-reference/OBG_Comprehensive_ANC_Reference.docx"
doc.save(out_path)
print(f"SUCCESS: Saved to {out_path}")
Running Command

cd /tmp/workspace/obg-reference && python3 build_obg.py 2>&1

Running Command

ls -lh /tmp/workspace/obg-reference/

Your comprehensive OBG reference document is ready. Here is a summary of what's inside:

Document:

OBG Comprehensive ANC Reference

Word Document · DOCX

Size: 59 KB | Fully formatted DOCX with colour-coded headings, styled tables, and note boxes

What's Included (28 Sections):

#Topic
1Core Definitions — Gravida, Para, Abortion (WHO/FIGO), Live Birth, Stillbirth
2Naegele's Rule — Formula, Indications, Contraindications
3Period of Gestation — Trimester breakdown
4Booking Visit — WHO 2016 model (8 contacts), Booked/Unbooked definition
5Age Complications — Young age vs AMA (maternal + fetal)
6Rh Incompatibility — Mechanism, Direct/Indirect Coombs, Anti-D prophylaxis, Treatment
7Occupational & Religious complications
8Good Dates & Excellent Dates — Criteria
9Gestational Age Classification — Preterm (4 types), Term, Post-term, Post-dates
10Bleeding PV — All 3 trimesters with causes + APH table
11Leaking PV vs White Discharge — Ferning, pH, AmniSure comparison table
12ANC Chief Complaints — Per trimester
13Immunization — Doses, routes, timing; contraindicated live vaccines
14Lab Investigations — By trimester
15Hyperemesis Gravidarum — Criteria, PUQE, physio/pathological causes, treatment steps
16Fever with Rash — Rubella, Varicella, Parvovirus, CMV, Zika, Dengue
17Radiation in Pregnancy — Dose thresholds, imaging safety priority
18Folic Acid, Iron, Calcium — Preconception/pregnancy/lactation doses (WHO 2016)
19Drugs to Avoid — Pregnancy + lactation with safe alternatives
20NST / CTG — Reactive vs Non-reactive (NTNB), CST
21Antenatal Scans — Dating, NT, Anomaly, Growth — ideal weeks + what to see
22AFI & SDP — Normal values, oligohydramnios, polyhydramnios causes
23OGCT + OGTT — Procedure, WHO/IADPSG criteria, GDM, high-risk screening
24Hypertensive Disorders — Gestational HTN, Preeclampsia, Eclampsia, HELLP, MgSO4 protocol
25Decreased Fetal Movements — Causes, complications, management
26Preterm Labour Complications — Neonatal + management (steroids, tocolysis, MgSO4)
27Post-Term Complications — Dysmaturity, macrosomia, MAS, stillbirth risk
28High-Risk Pregnancy — Risk factor classification
This is a shared conversation. Sign in to Orris to start your own chat.