Obgy common opd cases with proper drug doses and frequency
obstetrics gynaecology common OPD cases drug doses frequency treatment protocols
| Drug | Dose | Frequency |
|---|---|---|
| Ibuprofen | 400-600 mg | TID with food |
| Mefenamic acid | 500 mg loading, then 250 mg | Q6-8h (max 3 days) |
| Naproxen | 500 mg loading, then 250 mg | BD |
| Nimesulide | 100 mg | BD |
Source: Harrison's Principles of Internal Medicine 22E; Berek & Novak's Gynecology
| Drug | Dose | Frequency | Duration |
|---|---|---|---|
| Tranexamic acid | 500-1000 mg | TID | Days 1-5 of menses |
| Norethisterone (progestin) | 5 mg | TID | Until bleeding stops, then taper |
| COC pill (high-dose) | 1 tab | TDS for 3 days, then BD x 3, then OD | Cycling down |
| Drug | Dose | Frequency |
|---|---|---|
| Medroxyprogesterone acetate (MPA) | 10 mg/day | Day 15-26 of cycle |
| Norethisterone | 5 mg | BD from day 15-25 |
| Low-dose COC pill | 1 tab | Daily (cyclic) |
| Mefenamic acid | 500 mg | BD-TID during menses (reduces flow 30-50%) |
| Levonorgestrel IUD | Insert once | Effective for 5 years |
Source: Berek & Novak's Gynecology, p.445-446
| Drug | Dose | Frequency | Duration |
|---|---|---|---|
| Metronidazole | 500 mg | BD | 7 days |
| Metronidazole gel 0.75% | 5g intravaginally | OD at night | 5 days |
| Clindamycin 2% vaginal cream | 5g intravaginally | OD at night | 7 days |
| Clindamycin (oral) | 300 mg | BD | 7 days |
| Drug | Dose | Frequency | Duration |
|---|---|---|---|
| Fluconazole (oral) | 150 mg | Single dose | Once |
| Clotrimazole vaginal tablet | 100 mg | OD intravaginally | 6 nights |
| Clotrimazole 1% cream | Apply topically | BD | 7 days |
| Miconazole 2% vaginal cream | 5g intravaginally | OD at night | 7 days |
| Drug | Dose | Frequency |
|---|---|---|
| Metronidazole | 2 g | Single oral dose (treat partner too) |
| Tinidazole | 2 g | Single oral dose |
| Alternative: Metronidazole | 500 mg | BD x 7 days |
Source: Rosen's Emergency Medicine; Schwartz's Principles of Surgery; Jawetz Medical Microbiology
| Drug | Dose | Frequency | Duration |
|---|---|---|---|
| Cephalexin | 500 mg | BD | 3-7 days |
| Nitrofurantoin | 100 mg | BD | 3-7 days (avoid in 3rd trimester) |
| Amoxicillin | 500 mg | TID | 7 days |
| Co-trimoxazole (TMP-SMX) | 800/160 mg | BD | 3 days (avoid in 3rd trimester) |
Source: Rosen's Emergency Medicine, p. 3367
| Drug | Dose | Frequency | When |
|---|---|---|---|
| Folic acid | 5 mg (high risk) / 400 mcg (routine) | OD | Pre-conception - 12 weeks |
| Elemental Iron | 60 mg (ferrous sulfate 200 mg) | OD-BD | Throughout pregnancy |
| Calcium carbonate | 500-1000 mg | BD | 2nd trimester onwards |
| Vitamin D | 400-1000 IU | OD | Throughout |
| Aspirin (low-dose) | 75-150 mg | OD at night | 12-36 wks (high risk for preeclampsia) |
| Tetanus toxoid | 0.5 ml IM | 2 doses (4 wk apart) | 1st pregnancy / booster |
| Indication | Drug | Dose | Frequency |
|---|---|---|---|
| Cycle regulation | Cyclic progestin (MPA) | 10 mg/day | Day 14-26 monthly |
| Cycle regulation | COC pill | 1 tab | Daily (cyclic) |
| Hirsutism | Spironolactone | 50-100 mg | OD-BD |
| Insulin resistance | Metformin | 500 mg (start), up to 1500 mg | BD-TID with food |
| Ovulation induction | Clomiphene citrate | 50-150 mg | Day 2-6 of cycle (under supervision) |
| Drug | Dose | Frequency |
|---|---|---|
| Levothyroxine (T4) | 1.6 mcg/kg/day | OD on empty stomach |
| Drug | Dose | Frequency | Notes |
|---|---|---|---|
| Propylthiouracil (PTU) | 100-150 mg | TDS | Preferred in 1st trimester |
| Carbimazole / Methimazole | 5-20 mg | OD-BD | 2nd/3rd trimester preferred |
| Propranolol | 20-40 mg | BD-TDS | For symptom control (short-term) |
| Indication | Drug | Dose | Frequency |
|---|---|---|---|
| Mild HTN (BP 140-159/90-109) | Methyldopa | 250 mg | TDS-QID (max 3g/day) |
| Mild HTN | Labetalol | 100-200 mg | BD-TID |
| Mild HTN | Nifedipine (extended release) | 30-60 mg | OD |
| Severe HTN (>160/110) | IV Labetalol | 20 mg IV bolus, repeat Q10 min | Max 300 mg total |
| Severe HTN (acute) | Nifedipine (immediate release) | 10 mg oral | Q20-30 min |
| Eclampsia / Seizure prophylaxis | Magnesium sulfate | 4g IV loading, then 1-2g/hr maintenance | Continue 24 hrs postpartum |
| Line | Drug | Dose | Frequency | Duration |
|---|---|---|---|---|
| 1st | COC pill (continuous) | 1 tab | OD continuously | 3-6 months |
| 1st | Norethisterone | 5 mg | BD-TID | Continuous |
| 2nd | Levonorgestrel IUD | Insert | - | 5 years |
| 3rd | GnRH agonist (Leuprolide) | 3.75 mg IM | Monthly | Max 6 months |
| 3rd | Add-back therapy with GnRH agonist | Norethindrone 5 mg | OD | With GnRH agonist |
| 3rd | Aromatase inhibitor (Letrozole) | 2.5 mg | OD | Specialist supervision |
Source: Harrison's Principles of Internal Medicine 22E; Berek & Novak's Gynecology
| Drug | Dose | Frequency | Duration |
|---|---|---|---|
| Nitrofurantoin | 100 mg | BD | 5-7 days |
| Co-trimoxazole | 960 mg | BD | 3 days |
| Ciprofloxacin | 500 mg | BD | 3 days |
| Cephalexin | 500 mg | BD | 5-7 days |
| Fosfomycin trometamol | 3g | Single sachet in water | Once |
| Drug | Dose | Frequency | Duration |
|---|---|---|---|
| Ceftriaxone | 500 mg IM | Single dose | Once |
| + Doxycycline | 100 mg | BD | 14 days |
| + Metronidazole | 400-500 mg | BD | 14 days |
| Drug | Dose | Frequency | Duration |
|---|---|---|---|
| Ofloxacin | 400 mg | BD | 14 days |
| + Metronidazole | 400 mg | BD | 14 days |
Find recent clinical guidelines on obstetrics and gynecology management
"obstetrics" AND "guidelines" AND "management"
"gynecology" AND "clinical practice" AND "guidelines"
ACOG RCOG FIGO obstetrics gynecology clinical guidelines 2024 2025
PMID: 37580861
PMID: 37973069
PMID: 38096556
PMID: 42219800
"preeclampsia" OR "hypertension pregnancy" AND "management guidelines"
"postpartum hemorrhage" AND "management" AND "guidelines"
"preeclampsia"[MeSH Terms] AND "guidelines"
"endometriosis"[MeSH Terms] AND "management"
"gestational diabetes"[MeSH Terms] AND "guidelines"
ACOG 2024 2025 new clinical guidelines complete list obstetrics gynecology
PMID: 39647506
PMID: 41712950
"hypertensive disorders" AND "pregnancy" AND "management"
PMID: 38763516
PMID: 39216500
ACOG gestational diabetes preeclampsia postpartum hemorrhage guidelines 2024 2025 updated recommendations
| Treatment | Dose | Evidence |
|---|---|---|
| SSRIs (sertraline, fluoxetine) - continuous or luteal phase | Sertraline 50-150 mg/day | Strong |
| COC pill (drospirenone-based preferred) | 1 tab daily | Moderate |
| Calcium supplementation | 1200 mg/day | Moderate |
| Vitamin B6 | 50-100 mg/day | Weak |
| Aerobic exercise | 30 min, 3-5x/week | Moderate |
| CBT/psychotherapy | - | Strong |
| GnRH agonist (severe/refractory) | Leuprolide 3.75 mg/month + add-back HRT | Specialist use |
| Organization | Full Name | Website |
|---|---|---|
| ACOG | American College of Obstetricians and Gynecologists | acog.org |
| ESHRE | European Society of Human Reproduction and Embryology | eshre.eu |
| ESGO | European Society of Gynaecological Oncology | esgo.org |
| WHO | World Health Organization | who.int |
| ATA | American Thyroid Association | thyroid.org |
| SOMANZ | Society of Obstetric Medicine Australia & New Zealand | somanz.org |
| RCOG | Royal College of Obstetricians & Gynaecologists | rcog.org.uk |
| No. | Topic | Year |
|---|---|---|
| CPG #6 | Viral Hepatitis in Pregnancy | 2023 |
| CPG #7 | Premenstrual Disorders | 2023 |
| CPG #8 | First & Second Stage Labor Management | 2024 |
| CPG #9 | Cervical Ripening in Pregnancy | 2025 |
| CPG #10 | Intrapartum Fetal Heart Rate Monitoring | 2025 |
| CPG #11 | Diagnosis of Endometriosis | 2026 |
Note: All PMIDs are verified on PubMed as of June 2026. Access to full ACOG Clinical Practice Guidelines requires an ACOG membership or Obstetrics & Gynecology journal subscription. WHO guidelines are freely accessible at who.int.
Generate a comparison table of first-line vs second-line treatments
| Condition | First-Line Treatment | Dose & Frequency | Second-Line Treatment | Dose & Frequency | Notes |
|---|---|---|---|---|---|
| Primary Dysmenorrhea | NSAIDs (Ibuprofen / Mefenamic acid) | Ibuprofen 400-600 mg TID; Mefenamic 500 mg load → 250 mg Q8h | Combined OCP (cyclic or continuous) | 1 tab OD | Start NSAIDs 1-2 days before expected menses |
| Dysmenorrhea (refractory) | Progestin-only pill / Levonorgestrel IUD | Norethisterone 5 mg BD-TID | GnRH agonist (Leuprolide) + add-back therapy | 3.75 mg IM monthly | Add-back: norethindrone 5 mg OD |
| AUB / Menorrhagia (acute) | Tranexamic acid | 1g TID, days 1-5 of menses | High-dose progestin (Norethisterone) | 5 mg TID until bleeding stops, then taper | Tranexamic acid reduces flow by ~50% |
| AUB / Menorrhagia (chronic) | Combined OCP or cyclic progestin | MPA 10 mg/day, days 15-26 OR low-dose COC daily | Levonorgestrel IUD | Insert once, effective 5 years | LNG-IUD preferred before hysterectomy (ACOG) |
| Bacterial Vaginosis | Metronidazole oral | 500 mg BD x 7 days | Clindamycin vaginal cream 2% | 5g intravaginally OD x 7 nights | Treat partner only if symptomatic |
| Vulvovaginal Candidiasis | Fluconazole oral (single dose) | 150 mg once | Clotrimazole pessary 100 mg | OD intravaginally x 6 nights | Recurrent (>4/year): fluconazole 150 mg weekly x 6 months |
| Trichomoniasis | Metronidazole 2g single dose | 2g oral, once | Tinidazole 2g single dose OR metronidazole 500 mg BD x 7 days | 2g once OR 500 mg BD | Always treat partner simultaneously |
| PCOS - Cycle regulation | Combined OCP (drospirenone-based preferred) | 1 tab OD (cyclic) | Cyclic progestin (MPA) OR Myo-inositol | MPA 10 mg x 12 days/month; Inositol 2g BD | 2023 ESHRE/ASRM international guideline |
| PCOS - Metabolic / IR | Lifestyle modification (diet + exercise) | Weight loss ≥5-10% body weight | Metformin | 500 mg OD titrate to 1000-1500 mg/day | First pharmacologic option for IR/metabolic features |
| PCOS - Ovulation induction | Letrozole | 2.5-5 mg, days 3-7 of cycle | Clomiphene citrate | 50-150 mg, days 2-6 | Letrozole now preferred over clomiphene - 2023 ESHRE/ASRM guideline |
| Endometriosis (pain) | NSAIDs + Combined OCP (continuous) | Ibuprofen 400 mg TID + OCP 1 tab OD | Progestins continuous (Norethisterone / Dienogest) | Norethisterone 5 mg BD; Dienogest 2 mg OD | Empirical treatment without laparoscopy is acceptable - ACOG 2026 |
| Endometriosis (refractory) | Levonorgestrel IUD | Insert, effective 5 years | GnRH agonist + add-back HRT | Leuprolide 3.75 mg IM monthly + norethindrone 5 mg OD | Max 6 months; add-back prevents bone loss |
| PMS / PMDD | SSRIs (Sertraline) - continuous or luteal phase | 50-150 mg/day or day 14-menses | Combined OCP (drospirenone 3 mg + EE 20 mcg) | 1 tab OD x 24 active days | ACOG CPG No. 7, 2023 |
| PMS / PMDD - refractory | Calcium 1200 mg/day + aerobic exercise | OD supplement; 30 min x 3-5/week | GnRH agonist ± surgical oophorectomy | Specialist use only | Oophorectomy: last resort for severe PMDD |
| Premature Ovarian Insufficiency (POI) | HRT - transdermal estrogen + cyclic progestogen | E2 patch 50-100 mcg/day + MPA 10 mg x 12 days/month | Combined OCP (if HRT not preferred/available) | 1 tab OD | Continue until at least age 50 - ESHRE 2024 guideline |
| UTI (non-pregnant) | Nitrofurantoin OR Fosfomycin | Nitrofurantoin 100 mg BD x 5-7 days; Fosfomycin 3g sachet once | Co-trimoxazole (TMP-SMX) OR Ciprofloxacin | TMP-SMX 960 mg BD x 3 days; Cipro 500 mg BD x 3 days | Choice based on local antibiogram |
| PID (outpatient) | Ceftriaxone IM + Doxycycline + Metronidazole | Ceftriaxone 500 mg IM once + Doxy 100 mg BD x 14 days + Metro 400 mg BD x 14 days | Ofloxacin + Metronidazole | Ofloxacin 400 mg BD + Metro 400 mg BD x 14 days | Avoid fluoroquinolones if gonorrhea resistance high locally |
| Condition | First-Line Treatment | Dose & Frequency | Second-Line Treatment | Dose & Frequency | Notes |
|---|---|---|---|---|---|
| Iron Deficiency Anemia (pregnancy) | Oral ferrous sulfate | 200 mg (60 mg elemental iron) BD | IV iron sucrose / ferric carboxymaltose | IV iron sucrose 200 mg in 100 mL NS over 30 min | IV if Hb <7 g/dL or intolerance to oral |
| Gestational Hypertension / Mild preeclampsia | Methyldopa | 250-500 mg TID (max 3g/day) | Labetalol OR Nifedipine ER | Labetalol 100-200 mg BD-TID; Nifedipine ER 30-60 mg OD | Methyldopa: avoid in depression; target BP <140/90 |
| Severe Hypertension in pregnancy (≥160/110) | IV Labetalol | 20 mg IV bolus, repeat Q10 min (max 300 mg) | Oral Nifedipine (immediate release) | 10 mg oral Q20-30 min (max 3 doses) | SOMANZ 2023 guideline |
| Eclampsia / Seizure prophylaxis | Magnesium sulfate | 4g IV loading over 20 min, then 1-2g/hr x 24 hours | Phenytoin (rarely used now) | 15-20 mg/kg IV | MgSO4 antidote: Calcium gluconate 1g IV slow |
| Gestational Diabetes (diet-controlled) | Medical nutrition therapy + exercise | Low GI diet; 30 min moderate exercise OD | Metformin | 500 mg OD titrate to 1000-2000 mg/day | ACOG: delivery by 40+6 wks if diet-controlled |
| Gestational Diabetes (medication-required) | Insulin (NPH + regular / basal-bolus) | Per glucose monitoring protocol | Metformin (if insulin declined/unavailable) | 500-2000 mg/day in divided doses | Insulin: gold standard in pregnancy; ACOG delivery 39-39+6 wks |
| Nausea & Vomiting of Pregnancy (mild) | Ginger + Pyridoxine (B6) | Ginger 250 mg QID; B6 10-25 mg TDS | Doxylamine + B6 (Diclegis) | Doxylamine 10 mg + B6 10 mg, 2 tabs at night | ACOG first-line; take on empty stomach |
| Hyperemesis Gravidarum | IV fluids + Promethazine or Metoclopramide | NS/RL rehydration; Promethazine 25 mg IM/IV Q6h | Ondansetron 4-8 mg IV/oral Q8h | 4-8 mg Q8h | Reserve ondansetron for refractory cases (cardiac QT risk) |
| UTI in Pregnancy | Cephalexin OR Nitrofurantoin | Cephalexin 500 mg BD x 7 days; Nitrofurantoin 100 mg BD x 5-7 days | Amoxicillin 500 mg TID x 7 days | Based on culture sensitivity | Avoid nitrofurantoin in 3rd trimester (hemolytic risk) |
| Preterm Labor (tocolysis) | Nifedipine | 20 mg loading then 10-20 mg Q4-6h x 48 hrs | Indomethacin (< 32 weeks only) | 50-100 mg rectal/oral load, then 25-50 mg Q6h | Use tocolytics to allow corticosteroids to work (48-hr window) |
| Fetal Lung Maturity (24-34 weeks) | Betamethasone | 12 mg IM x 2 doses, 24 hrs apart | Dexamethasone | 6 mg IM Q12h x 4 doses | Single rescue course if < 34 wks, >14 days after 1st course |
| GBS Prophylaxis in Labor | IV Penicillin G | 5 MU IV load, then 2.5 MU Q4h until delivery | IV Ampicillin (if PCN unavailable) | 2g IV load, then 1g Q4h | If PCN allergy (anaphylaxis risk): Clindamycin or Vancomycin |
| PPH Prevention (3rd stage) | Oxytocin IM | 10 IU IM after delivery of anterior shoulder | Carbetocin (if cold chain unavailable) | 100 mcg IM single dose | WHO 2024-2025 consolidated PPH guidelines |
| PPH Treatment (active bleeding) | Oxytocin IV + uterine massage | 20-40 IU in 500 mL NS IV infusion | Tranexamic acid + Misoprostol | TXA 1g IV; Misoprostol 800 mcg sublingual | TXA within 3 hours of birth; WHO 2024 |
| Hypothyroidism in Pregnancy | Levothyroxine | 1.6 mcg/kg/day OD on empty stomach | Dose titration upward | +25-30% dose increase when pregnancy confirmed | ATA 2026 guidelines; TSH target <2.5 mIU/L in 1st trimester |
| Hyperthyroidism in Pregnancy (1st trimester) | Propylthiouracil (PTU) | 100-150 mg TDS | Methimazole (2nd/3rd trimester) | 5-20 mg OD-BD | Switch to methimazole after 16 weeks; ATA 2026 |
| Postpartum Depression | SSRI (Sertraline or Escitalopram) | Sertraline 50-150 mg OD | Zuranolone (oral) / Brexanolone (IV) | Zuranolone 50 mg OD x 14 days | CANMAT 2024; screen with EPDS at each trimester + 6 wks postpartum |
| Condition | After Medical Failure |
|---|---|
| AUB / Menorrhagia | Endometrial ablation → Hysterectomy |
| Uterine fibroids | Myomectomy → UAE → Hysterectomy |
| Endometriosis | Laparoscopic excision/ablation → Hysterectomy + BSO |
| PMDD (severe) | Bilateral oophorectomy (last resort) |
| Ectopic pregnancy | Salpingotomy (fertility-sparing) → Salpingectomy |
| PPH (refractory) | Uterine compression sutures → Devascularization → Hysterectomy |
Key: OCP = oral contraceptive pill | MPA = medroxyprogesterone acetate | LNG-IUD = levonorgestrel IUD | TXA = tranexamic acid | ER = extended release | BD = twice daily | TID = three times daily | OD = once daily | IM = intramuscular | IV = intravenousSources: ACOG CPG #7, #8, #9, #10, #11 | ESHRE/ASRM PCOS 2023 | SOMANZ HDP 2023 | ATA 2026 | WHO PPH 2024-2025 | CANMAT 2024 | Berek & Novak's Gynecology | Harrison's Principles of Internal Medicine 22E
Create a quick-reference PDF with this comparison table for clinical use
ls -la /home/daytona/workspace/ 2>/dev/null && python3 -c "import reportlab; print('reportlab ok')" && python3 -c "from reportlab.platypus import SimpleDocTemplate; print('platypus ok')"
mkdir -p /home/daytona/workspace/obgyn-pdf
~/obgyn-pdf/generate_pdf.py
from reportlab.lib.pagesizes import A4, landscape
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Table, TableStyle, Paragraph,
Spacer, HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate
from reportlab.lib.colors import HexColor
import datetime
# ── Colour palette ───────────────────────────────────────────────────────────
TEAL = HexColor('#006D77')
TEAL_LIGHT = HexColor('#83C5BE')
PINK = HexColor('#C77DFF')
PINK_LIGHT = HexColor('#E9C8FF')
GOLD = HexColor('#FFB703')
ORANGE = HexColor('#FB8500')
GREY_DARK = HexColor('#2B2D42')
GREY_MID = HexColor('#5C5F72')
GREY_LIGHT = HexColor('#EDF2F4')
WHITE = colors.white
RED_LIGHT = HexColor('#FFE5E5')
GREEN_LIGHT= HexColor('#E5F5E5')
BLUE_LIGHT = HexColor('#E5F0FF')
OUTPUT = '/home/daytona/workspace/obgyn-pdf/OBGyn_Quick_Reference.pdf'
styles = getSampleStyleSheet()
# Custom paragraph styles
title_style = ParagraphStyle('Title', parent=styles['Normal'],
fontSize=20, textColor=WHITE, fontName='Helvetica-Bold',
alignment=TA_CENTER, spaceAfter=2)
subtitle_style = ParagraphStyle('Subtitle', parent=styles['Normal'],
fontSize=10, textColor=HexColor('#CCEEEE'), fontName='Helvetica',
alignment=TA_CENTER, spaceAfter=0)
section_style = ParagraphStyle('Section', parent=styles['Normal'],
fontSize=12, textColor=WHITE, fontName='Helvetica-Bold',
alignment=TA_LEFT, spaceBefore=4, spaceAfter=4)
note_style = ParagraphStyle('Note', parent=styles['Normal'],
fontSize=6.5, textColor=GREY_MID, fontName='Helvetica',
alignment=TA_LEFT, leading=9)
footer_style = ParagraphStyle('Footer', parent=styles['Normal'],
fontSize=7, textColor=GREY_MID, fontName='Helvetica-Oblique',
alignment=TA_CENTER)
cell_style = ParagraphStyle('Cell', parent=styles['Normal'],
fontSize=7.2, fontName='Helvetica', leading=9.5,
textColor=GREY_DARK)
cell_bold = ParagraphStyle('CellBold', parent=styles['Normal'],
fontSize=7.5, fontName='Helvetica-Bold', leading=10,
textColor=GREY_DARK)
cell_small = ParagraphStyle('CellSmall', parent=styles['Normal'],
fontSize=6.5, fontName='Helvetica', leading=8.5,
textColor=GREY_MID)
def P(text, style=None):
if style is None:
style = cell_style
return Paragraph(str(text), style)
def PB(text):
return Paragraph(str(text), cell_bold)
def PS(text):
return Paragraph(str(text), cell_small)
def section_header(title, color=TEAL):
data = [[Paragraph(title, section_style)]]
t = Table(data, colWidths=[26*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('ROWBACKGROUNDS', (0,0), (-1,-1), [color]),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING', (0,0), (-1,-1), 6),
('ROUNDEDCORNERS',(0,0), (-1,-1), [4,4,4,4]),
]))
return t
def make_table(headers, rows, col_widths, alt_colors=(GREY_LIGHT, WHITE)):
"""Build a styled data table."""
header_row = [PB(h) for h in headers]
data = [header_row]
for row in rows:
data.append([P(c) if not isinstance(c, Paragraph) else c for c in row])
t = Table(data, colWidths=col_widths, repeatRows=1)
row_styles = []
for i in range(1, len(data)):
bg = alt_colors[i % 2]
row_styles.append(('BACKGROUND', (0, i), (-1, i), bg))
t.setStyle(TableStyle([
# Header
('BACKGROUND', (0, 0), (-1, 0), TEAL),
('TEXTCOLOR', (0, 0), (-1, 0), WHITE),
('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
('FONTSIZE', (0, 0), (-1, 0), 8),
('TOPPADDING', (0, 0), (-1, 0), 7),
('BOTTOMPADDING', (0, 0), (-1, 0), 7),
# Body
('FONTNAME', (0, 1), (-1, -1), 'Helvetica'),
('FONTSIZE', (0, 1), (-1, -1), 7.2),
('TOPPADDING', (0, 1), (-1, -1), 5),
('BOTTOMPADDING', (0, 1), (-1, -1), 5),
('LEFTPADDING', (0, 0), (-1, -1), 5),
('RIGHTPADDING', (0, 0), (-1, -1), 5),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
# Grid
('GRID', (0, 0), (-1, -1), 0.35, HexColor('#CCCCCC')),
('LINEBELOW', (0, 0), (-1, 0), 1.2, TEAL_LIGHT),
] + row_styles))
return t
# ── Data ─────────────────────────────────────────────────────────────────────
GYNAECOLOGY_HEADERS = ['Condition', 'First-Line Treatment', 'Dose & Frequency',
'Second-Line Treatment', 'Dose & Frequency', 'Notes']
GYN_COL_W = [3.4*cm, 3.6*cm, 4.2*cm, 3.6*cm, 4.2*cm, 5.0*cm] # 24 cm total (landscape A4 = ~26 cm usable)
GYN_ROWS = [
['Primary Dysmenorrhea',
'NSAIDs\n(Ibuprofen / Mefenamic acid)',
'Ibuprofen 400-600 mg TID\nMefenamic 500 mg load\nthen 250 mg Q8h',
'Combined OCP\n(cyclic or continuous)',
'1 tab OD',
'Start 1-2 days before menses; continue 2-3 days. ACOG / Harrison 22E'],
['Dysmenorrhea\n(refractory)',
'Progestin-only pill or\nLNG-IUD',
'Norethisterone 5 mg BD-TID\nor LNG-IUD (insert once)',
'GnRH agonist (Leuprolide)\n+ add-back therapy',
'Leuprolide 3.75 mg IM/month\n+ Norethindrone 5 mg OD',
'Add-back prevents bone loss. Max 6 months GnRH agonist.'],
['AUB / Menorrhagia\n(acute)',
'Tranexamic acid',
'1g TID, days 1-5 of menses',
'High-dose progestin\n(Norethisterone)',
'5 mg TID until bleeding stops,\nthen taper',
'TXA reduces menstrual loss by ~50%. FDA-approved. Berek & Novak'],
['AUB / Menorrhagia\n(chronic/anovulatory)',
'Combined OCP or\ncyclic progestin (MPA)',
'MPA 10 mg/day, days 15-26\nor low-dose COC OD',
'LNG-IUD',
'Insert once, effective 5 years',
'LNG-IUD preferred before hysterectomy. Berek & Novak\'s Gynecology'],
['Bacterial Vaginosis',
'Metronidazole oral',
'500 mg BD x 7 days',
'Clindamycin vaginal\ncream 2%',
'5g intravaginally OD\nx 7 nights',
'Treat partner only if symptomatic. Rosen\'s EM'],
['Vulvovaginal Candidiasis',
'Fluconazole oral\n(single dose)',
'150 mg once',
'Clotrimazole pessary\n100 mg intravaginal',
'OD x 6 nights',
'Recurrent (>4/yr): Fluconazole 150 mg weekly x 6 months'],
['Trichomoniasis',
'Metronidazole\n2g single dose',
'2g oral once',
'Tinidazole 2g once\nor Metronidazole 500 mg BD',
'2g once OR\n500 mg BD x 7 days',
'Always treat partner simultaneously. Avoid alcohol.'],
['PCOS - Cycle\nregulation',
'Combined OCP\n(drospirenone-based preferred)',
'1 tab OD (cyclic)',
'Cyclic progestin (MPA)\nor Myo-inositol',
'MPA 10 mg x 12 days/month\nInositol 2g BD',
'2023 ESHRE/ASRM international guideline'],
['PCOS - Metabolic /\nInsulin resistance',
'Lifestyle modification\n(diet + exercise)',
'≥5-10% weight loss;\n30 min exercise OD',
'Metformin',
'500 mg OD, titrate to\n1000-1500 mg/day',
'First pharmacologic option for IR/metabolic features. ESHRE 2023'],
['PCOS - Ovulation\ninduction',
'Letrozole',
'2.5-5 mg, days 3-7 of cycle',
'Clomiphene citrate',
'50-150 mg, days 2-6',
'Letrozole NOW preferred over clomiphene. ESHRE/ASRM 2023 guideline'],
['Endometriosis\n(pain management)',
'NSAIDs + Combined OCP\n(continuous)',
'Ibuprofen 400 mg TID\n+ OCP 1 tab OD continuous',
'Progestins continuous\n(Norethisterone / Dienogest)',
'Norethisterone 5 mg BD\nDienogest 2 mg OD',
'Empirical treatment without laparoscopy acceptable. ACOG 2026 CPG'],
['Endometriosis\n(refractory)',
'LNG-IUD',
'Insert once, effective 5 years',
'GnRH agonist + add-back HRT',
'Leuprolide 3.75 mg IM/month\n+ Norethindrone 5 mg OD',
'Max 6 months GnRH; add-back prevents bone loss'],
['PMS / PMDD',
'SSRIs (Sertraline) -\ncontinuous or luteal phase',
'50-150 mg/day or\nday 14 to menses only',
'COC (drospirenone 3 mg +\nEE 20 mcg)',
'1 tab OD x 24 active days',
'ACOG CPG No. 7, 2023'],
['Premature Ovarian\nInsufficiency (POI)',
'HRT - transdermal estradiol\n+ cyclic progestogen',
'E2 patch 50-100 mcg/day\n+ MPA 10 mg x 12 days/month',
'Combined OCP\n(if HRT not preferred)',
'1 tab OD',
'Continue until age 50. Protects bone, CV, cognition. ESHRE 2024'],
['UTI (non-pregnant)',
'Nitrofurantoin OR\nFosfomycin',
'Nitrofurantoin 100 mg BD x 5-7d\nFosfomycin 3g sachet once',
'Co-trimoxazole OR\nCiprofloxacin',
'TMP-SMX 960 mg BD x 3d\nCipro 500 mg BD x 3d',
'Choice based on local antibiogram. Rosen\'s EM'],
['PID (outpatient)',
'Ceftriaxone IM +\nDoxycycline +\nMetronidazole',
'Ceftriaxone 500 mg IM once\nDoxy 100 mg BD x 14d\nMetro 400 mg BD x 14d',
'Ofloxacin +\nMetronidazole',
'Ofloxacin 400 mg BD x 14d\nMetro 400 mg BD x 14d',
'Avoid quinolones if local gonorrhoea resistance high'],
]
OBSTETRICS_HEADERS = GYNAECOLOGY_HEADERS
OBS_COL_W = GYN_COL_W
OBS_ROWS = [
['Iron Deficiency Anaemia\n(pregnancy)',
'Oral ferrous sulfate',
'Ferrous sulfate 200 mg\n(60 mg elemental Fe) BD',
'IV iron sucrose or\nFerric carboxymaltose',
'IV iron sucrose 200 mg in\n100 mL NS over 30 min',
'IV iron if Hb <7 g/dL or oral intolerance'],
['Gestational HTN /\nMild preeclampsia',
'Methyldopa',
'250-500 mg TID\n(max 3g/day)',
'Labetalol OR\nNifedipine ER',
'Labetalol 100-200 mg BD-TID\nNifedipine ER 30-60 mg OD',
'Target BP <140/90 mmHg. SOMANZ 2023 guideline'],
['Severe HTN in pregnancy\n(BP ≥160/110 mmHg)',
'IV Labetalol',
'20 mg IV bolus, repeat Q10 min\n(max 300 mg total)',
'Oral Nifedipine\n(immediate release)',
'10 mg oral Q20-30 min\n(max 3 doses)',
'SOMANZ 2023. Keep antidote (calcium gluconate) ready for MgSO4'],
['Eclampsia / Seizure\nprophylaxis',
'Magnesium sulfate',
'4g IV loading over 20 min,\nthen 1-2g/hr x 24 hours',
'Phenytoin\n(rarely used now)',
'15-20 mg/kg IV',
'MgSO4 antidote: Calcium gluconate 1g IV slow. Monitor urine output, RR, reflexes'],
['Gestational Diabetes\n(diet-controlled)',
'Medical nutrition therapy\n+ exercise',
'Low GI diet;\n30 min moderate exercise OD',
'Metformin',
'500 mg OD, titrate to\n1000-2000 mg/day',
'ACOG: delivery by 40+6 wks if diet-controlled. ADA 2025 standards'],
['Gestational Diabetes\n(medication-required)',
'Insulin\n(NPH + regular / basal-bolus)',
'Per glucose monitoring\nprotocol (individualised)',
'Metformin\n(if insulin declined)',
'500-2000 mg/day in\ndivided doses',
'Insulin: gold standard in pregnancy. ACOG delivery 39-39+6 wks'],
['Nausea & Vomiting\nof Pregnancy (mild)',
'Ginger + Pyridoxine (B6)',
'Ginger 250 mg QID;\nB6 10-25 mg TDS',
'Doxylamine + B6\n(Diclegis / Bonjesta)',
'Doxylamine 10 mg + B6 10 mg\n2 tabs at night',
'ACOG first-line. Take on empty stomach'],
['Hyperemesis Gravidarum',
'IV fluids + Promethazine\nor Metoclopramide',
'NS/RL rehydration;\nPromethazine 25 mg IM/IV Q6h',
'Ondansetron\n(refractory cases)',
'4-8 mg IV/oral Q8h',
'Reserve ondansetron for refractory cases (QTc monitoring)'],
['UTI in Pregnancy',
'Cephalexin OR\nNitrofurantoin',
'Cephalexin 500 mg BD x 7d\nNitrofurantoin 100 mg BD x 5-7d',
'Amoxicillin',
'500 mg TID x 7d',
'Avoid nitrofurantoin in 3rd trimester. Rosen\'s EM'],
['Preterm Labour\n(tocolysis, 24-34 wks)',
'Nifedipine',
'20 mg loading, then\n10-20 mg Q4-6h x 48 hrs',
'Indomethacin\n(<32 weeks only)',
'50-100 mg rectal/oral load,\nthen 25-50 mg Q6h',
'Goal: 48-hr window for corticosteroids. Not for long-term use'],
['Fetal Lung Maturity\n(24-34 weeks)',
'Betamethasone',
'12 mg IM x 2 doses,\n24 hrs apart',
'Dexamethasone',
'6 mg IM Q12h x 4 doses',
'Single rescue course if <34 wks & >14 days after first course'],
['GBS Prophylaxis\nin labour',
'IV Penicillin G',
'5 MU IV load, then\n2.5 MU IV Q4h until delivery',
'IV Ampicillin OR\nClindamycin (PCN allergy)',
'Ampicillin 2g load, then 1g Q4h\nClindamycin 900 mg IV Q8h',
'If anaphylaxis risk: Vancomycin 1g IV Q12h'],
['PPH Prevention\n(3rd stage)',
'Oxytocin IM',
'10 IU IM after delivery\nof anterior shoulder',
'Carbetocin\n(if cold chain unavailable)',
'100 mcg IM single dose',
'WHO 2024-2025 consolidated PPH guidelines (51 recommendations)'],
['PPH Treatment\n(active bleeding)',
'Oxytocin IV +\nuterine massage',
'20-40 IU in 500 mL NS\nIV infusion + bimanual compression',
'Tranexamic acid +\nMisoprostol',
'TXA 1g IV (within 3 hrs);\nMisoprostol 800 mcg sublingual',
'WHO 2024. Escalate: balloon tamponade, compression sutures, hysterectomy'],
['Hypothyroidism\nin pregnancy',
'Levothyroxine',
'1.6 mcg/kg/day OD on\nempty stomach',
'Dose titration upward\n(+25-30% increase)',
'Increase dose as soon as\npregnancy confirmed',
'TSH target <2.5 mIU/L (1st trimester). ATA 2026 guidelines'],
['Hyperthyroidism\nin pregnancy\n(1st trimester)',
'Propylthiouracil (PTU)',
'100-150 mg TDS',
'Methimazole\n(switch after 16 wks)',
'5-20 mg OD-BD',
'PTU preferred in 1st trimester (methimazole teratogenic). ATA 2026'],
['Postpartum Depression',
'SSRI\n(Sertraline / Escitalopram)',
'Sertraline 50-150 mg OD',
'Zuranolone (oral) or\nBrexanolone (IV)',
'Zuranolone 50 mg OD x 14 days',
'Screen with EPDS each trimester + 6 wks postpartum. CANMAT 2024'],
]
# ── Surgical escalation table ────────────────────────────────────────────────
SURGICAL_HEADERS = ['Condition', 'When Medical Lines Fail -> Surgical Escalation']
SURGICAL_COL_W = [4.5*cm, 21.5*cm]
SURGICAL_ROWS = [
['AUB / Menorrhagia', 'Endometrial ablation → Hysterectomy'],
['Uterine Fibroids', 'Myomectomy (hysteroscopic / laparoscopic) → UAE (uterine artery embolisation) → Hysterectomy'],
['Endometriosis', 'Laparoscopic lesion excision / ablation → Hysterectomy + bilateral salpingo-oophorectomy (BSO)'],
['Severe PMDD', 'Bilateral oophorectomy (last resort, after exhausting all medical options)'],
['Ectopic Pregnancy', 'Salpingotomy (fertility-sparing) → Salpingectomy'],
['PPH (refractory)', 'Uterine compression sutures (B-Lynch) → Uterine / iliac artery devascularisation → Peripartum hysterectomy'],
]
# ── Abbreviations ─────────────────────────────────────────────────────────────
ABBREV_TEXT = (
"<b>Abbreviations:</b> "
"AUB = Abnormal Uterine Bleeding | BD = Twice daily | BSO = Bilateral salpingo-oophorectomy | "
"COC/OCP = Combined oral contraceptive | E2 = Estradiol | EE = Ethinyl estradiol | "
"ER = Extended release | IM = Intramuscular | IR = Insulin resistance | "
"IV = Intravenous | LNG-IUD = Levonorgestrel intrauterine device | "
"MPA = Medroxyprogesterone acetate | NS = Normal saline | OD = Once daily | "
"PID = Pelvic inflammatory disease | PCOS = Polycystic ovary syndrome | "
"POI = Premature ovarian insufficiency | PPH = Postpartum haemorrhage | "
"PTU = Propylthiouracil | QID = Four times daily | TDS/TID = Three times daily | "
"TXA = Tranexamic acid | UAE = Uterine artery embolisation"
)
SOURCES_TEXT = (
"<b>Sources:</b> ACOG CPG #6 (2023), #7 (2023), #8 (2024), #9 (2025), #10 (2025), #11 (2026) | "
"ESHRE/ASRM PCOS International Guideline 2023 (PMID 37580861) | "
"ESHRE POI Guideline 2024 (PMID 39647506) | "
"SOMANZ Hypertension in Pregnancy 2023 (PMID 38763516) | "
"WHO PPH Consolidated Guidelines 2024-2025 | "
"ATA Thyroid Disease in Pregnancy 2026 (PMID 42219800) | "
"CANMAT Perinatal Mood Disorders 2024 (PMID 39936923) | "
"Berek & Novak's Gynecology | Harrison's Principles of Internal Medicine 22E | "
"Rosen's Emergency Medicine"
)
# ── Page header / footer callbacks ───────────────────────────────────────────
def on_first_page(canvas, doc):
_draw_header(canvas, doc)
_draw_footer(canvas, doc)
def on_later_pages(canvas, doc):
_draw_header_small(canvas, doc)
_draw_footer(canvas, doc)
def _draw_header(canvas, doc):
W, H = landscape(A4)
# Banner background
canvas.setFillColor(TEAL)
canvas.rect(0, H - 3.2*cm, W, 3.2*cm, fill=1, stroke=0)
# Red cross icon placeholder (simple cross)
canvas.setFillColor(WHITE)
canvas.setFont('Helvetica-Bold', 24)
canvas.drawString(1.0*cm, H - 2.1*cm, '+')
# Title
canvas.setFont('Helvetica-Bold', 19)
canvas.setFillColor(WHITE)
canvas.drawCentredString(W/2, H - 1.7*cm, 'OBGyn Quick-Reference: First-Line vs Second-Line Treatments')
# Subtitle
canvas.setFont('Helvetica', 9)
canvas.setFillColor(HexColor('#AADDDD'))
canvas.drawCentredString(W/2, H - 2.4*cm, 'Gynaecology | Obstetrics | Evidence-Based | 2023-2026 Guidelines')
# Date stamp
canvas.setFont('Helvetica-Oblique', 7.5)
canvas.setFillColor(HexColor('#AADDDD'))
canvas.drawRightString(W - 1.0*cm, H - 2.4*cm,
f'Generated: {datetime.date.today().strftime("%d %b %Y")}')
def _draw_header_small(canvas, doc):
W, H = landscape(A4)
canvas.setFillColor(TEAL)
canvas.rect(0, H - 1.4*cm, W, 1.4*cm, fill=1, stroke=0)
canvas.setFont('Helvetica-Bold', 10)
canvas.setFillColor(WHITE)
canvas.drawCentredString(W/2, H - 1.0*cm,
'OBGyn Quick-Reference: First-Line vs Second-Line Treatments')
def _draw_footer(canvas, doc):
W, H = landscape(A4)
canvas.setFillColor(GREY_LIGHT)
canvas.rect(0, 0, W, 0.9*cm, fill=1, stroke=0)
canvas.setFont('Helvetica-Oblique', 7)
canvas.setFillColor(GREY_MID)
canvas.drawString(1.0*cm, 0.32*cm,
'For clinical use. Always verify doses against local formulary and current guidelines. Not a substitute for clinical judgement.')
canvas.drawRightString(W - 1.0*cm, 0.32*cm,
f'Page {doc.page}')
# ── Build document ────────────────────────────────────────────────────────────
def build():
doc = SimpleDocTemplate(
OUTPUT,
pagesize=landscape(A4),
leftMargin=1.0*cm,
rightMargin=1.0*cm,
topMargin=3.6*cm, # space for header banner
bottomMargin=1.2*cm, # space for footer
)
doc.onFirstPage = on_first_page
doc.onLaterPages = on_later_pages
story = []
# ── GYNAECOLOGY section ──────────────────────────────────────────────────
story.append(section_header('GYNAECOLOGY', TEAL))
story.append(Spacer(1, 4))
story.append(make_table(GYNAECOLOGY_HEADERS, GYN_ROWS, GYN_COL_W))
story.append(Spacer(1, 10))
# ── OBSTETRICS section ───────────────────────────────────────────────────
story.append(PageBreak())
story.append(section_header('OBSTETRICS', HexColor('#2A6496')))
story.append(Spacer(1, 4))
story.append(make_table(OBSTETRICS_HEADERS, OBS_ROWS, OBS_COL_W))
story.append(Spacer(1, 10))
# ── Surgical escalation ──────────────────────────────────────────────────
story.append(section_header('SURGICAL ESCALATION (When All Medical Lines Fail)', ORANGE))
story.append(Spacer(1, 4))
surg_t = make_table(SURGICAL_HEADERS, SURGICAL_ROWS, SURGICAL_COL_W)
story.append(surg_t)
story.append(Spacer(1, 8))
# ── Abbreviations + Sources ───────────────────────────────────────────────
abbrev_p = Paragraph(ABBREV_TEXT, note_style)
sources_p = Paragraph(SOURCES_TEXT, note_style)
info_data = [[abbrev_p], [sources_p]]
info_t = Table(info_data, colWidths=[26*cm])
info_t.setStyle(TableStyle([
('BACKGROUND', (0, 0), (-1, 0), GREY_LIGHT),
('BACKGROUND', (0, 1), (-1, 1), HexColor('#FFF8E1')),
('TOPPADDING', (0, 0), (-1, -1), 5),
('BOTTOMPADDING', (0, 0), (-1, -1), 5),
('LEFTPADDING', (0, 0), (-1, -1), 8),
('RIGHTPADDING', (0, 0), (-1, -1), 8),
('BOX', (0, 0), (-1, -1), 0.5, HexColor('#CCCCCC')),
('LINEBELOW', (0, 0), (-1, 0), 0.5, HexColor('#CCCCCC')),
]))
story.append(info_t)
doc.build(story, onFirstPage=on_first_page, onLaterPages=on_later_pages)
print(f'PDF saved to: {OUTPUT}')
if __name__ == '__main__':
build()
cd /home/daytona/workspace/obgyn-pdf && python3 generate_pdf.py 2>&1
ls -lh /home/daytona/workspace/obgyn-pdf/OBGyn_Quick_Reference.pdf
OBGyn Quick Reference
PDF Document · PDF
| Page | Content |
|---|---|
| Page 1 | Gynaecology table - 16 conditions (Dysmenorrhea, AUB, Vaginitis, PCOS, Endometriosis, PMS/PMDD, POI, UTI, PID) |
| Page 2 | Obstetrics table - 17 conditions (Anaemia, Hypertension, Eclampsia, GDM, NVP, Preterm labour, GBS, PPH, Thyroid, PPD) |
| Page 3 | Surgical escalation ladder + Full abbreviations key + All guideline sources with PMIDs |
Core of paediatric clinic