PPROM and PROM theory and clinical notes
"premature rupture of membranes" management
| Term | Definition |
|---|---|
| PROM (Premature / Prelabor Rupture of Membranes) | Rupture of fetal membranes before onset of contractions, at any gestational age |
| PPROM (Preterm Premature Rupture of Membranes) | PROM occurring before 37 weeks gestation |
| Periviable PROM | PROM at <23 weeks gestation (before the limit of viability) |
| Latent period | Time interval from membrane rupture to onset of labor/delivery |
| Category | Specific Factors |
|---|---|
| Prior obstetric history | Previous preterm PROM (3x increased risk), prior preterm birth |
| Infection | STIs (GBS, gonorrhea, chlamydia, TV), bacterial vaginosis, UTI, pyelonephritis, periodontal disease, pneumonia |
| Uterine overdistension | Multiple gestation, polyhydramnios |
| Cervical factors | Short cervix, cervical insufficiency, cerclage |
| Procedural | Amniocentesis, fetal surgery |
| Placental | Placental abruption, placenta previa |
| Lifestyle | Smoking, low BMI, low socioeconomic status |
| Nutritional | Vitamin C, copper, zinc deficiency |
| Test | Basis | Notes |
|---|---|---|
| Nitrazine (pH) test | Amniotic fluid pH 7.1-7.3 vs vaginal pH 3.8-4.2 | False positives: blood, semen, BV, antiseptic |
| Ferning (arborization) | Crystallization pattern of amniotic fluid on glass slide | Disappears if blood or cervical mucus contamination |
| Pooling | Visual fluid in posterior fornix | High specificity |
| Ultrasound | Assess amniotic fluid volume (AFI/MVP) | Oligohydramnios supports but is NOT diagnostic |
| AmniSure (PAMG-1) | Placental alpha-microglobulin-1 immunoassay | High sensitivity/specificity; useful in equivocal cases |
| ActimPROM (IGFBP-1) | Insulin-like growth factor binding protein-1 | Similar to AmniSure |
| Amnioinfusion + dye | Indigo carmine intraamniotically, look for blue staining on tampon | Gold standard when others equivocal |
| Complication | Incidence |
|---|---|
| Chorioamnionitis (term PROM) | ~9% |
| Chorioamnionitis (>24h rupture) | Up to 24% |
| Chorioamnionitis (remote from term) | 13-35% |
| Chorioamnionitis (2nd trimester PROM, conservatively managed) | 25-77% |
| Endometritis | 2-13% |
| Placental abruption | 4-12% |
| Maternal sepsis | ~0.8% |
| Maternal death | ~0.14% |
| Intervention | Details |
|---|---|
| Hospitalization | Bed rest, pelvic rest, regular monitoring |
| Antenatal corticosteroids | Betamethasone 12 mg IM × 2 doses, 24h apart OR dexamethasone 6 mg IM × 4 doses, 12h apart. Recommended at 24 0/7 - 33 6/7 weeks; may be considered from 22 0/7 weeks |
| Adjuvant antibiotics | Reduce chorioamnionitis (RR 0.66), delivery within 48h (RR 0.71), neonatal infection (RR 0.67). Regimen: IV ampicillin 2g q6h + IV erythromycin 250mg q6h × 48h, then amoxicillin 250mg PO q8h + erythromycin 333mg PO q8h × 5 days (ORACLE/ACOG regimen). Avoid amoxicillin-clavulanate (increased NEC risk) |
| GBS prophylaxis | If GBS positive/unknown, continue intrapartum prophylaxis |
| Tocolysis | Short-term (48h) to allow steroid benefit; not for prolonged use; contraindicated with chorioamnionitis, abruption, nonreassuring FHR |
| Magnesium sulfate | Neuroprotection at <32 weeks (4g IV bolus then 1-2g/h maintenance) |
| Monitoring | Daily fetal kick counts, NST/BPP, ultrasound for growth, fluid, cord, and doppler |
| Temperature/WBC | 4-hourly maternal temp, daily WBC; rising temp or WBC = suspect chorioamnionitis |
PROM Diagnosed
|
≥37 weeks?
/ \
YES NO (PPROM)
| |
Induce Immediate delivery indicated?
(oxytocin) (chorioamnionitis, abruption,
non-reassuring FHR, cord prolapse)
/ \
YES NO
| |
Deliver Gestational age?
/ | \
<23wk 23-33wk 34-36wk
| | |
Counsel Conservative Deliver
re: prognosis mgmt bundle (individualize)
offer options - Steroids
- Antibiotics
- MgSO4 if <32wk
- Monitor closely
- Plan delivery at 34wk
Generate a diagnostic flowchart PDF for PROM bedside evaluation
ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"
mkdir -p /home/daytona/workspace/prom-flowchart && python3 -c "import reportlab; print('reportlab OK')" && python3 -c "from reportlab.lib.pagesizes import A4; print('A4 OK')"
~/prom-flowchart/generate_flowchart.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.pdfgen import canvas
from reportlab.lib.colors import HexColor
# ── Color palette ──────────────────────────────────────────────
C_HEADER = HexColor("#1A3557") # dark navy
C_START = HexColor("#1A3557")
C_DECISION = HexColor("#2471A3") # blue
C_ACTION = HexColor("#117A65") # teal/green
C_WARN = HexColor("#C0392B") # red
C_NEUTRAL = HexColor("#5D6D7E") # slate
C_LIGHT_BG = HexColor("#EAF4FB") # very light blue
C_WARN_BG = HexColor("#FDEDEC")
C_ACTION_BG = HexColor("#E9F7EF")
C_DECISION_BG= HexColor("#EBF5FB")
WHITE = colors.white
BLACK = colors.black
PAGE_W, PAGE_H = A4 # 595 x 842 pt
def wrap_text(c, text, x, y, max_width, font, size, line_height, align="center"):
"""Draw wrapped text; returns final y after last line."""
c.setFont(font, size)
words = text.split()
lines = []
current = ""
for w in words:
test = (current + " " + w).strip()
if c.stringWidth(test, font, size) <= max_width:
current = test
else:
if current:
lines.append(current)
current = w
if current:
lines.append(current)
total_h = len(lines) * line_height
start_y = y + total_h / 2 - line_height / 2
for i, line in enumerate(lines):
ly = start_y - i * line_height
if align == "center":
c.drawCentredString(x, ly, line)
elif align == "left":
c.drawString(x, ly, line)
return start_y - (len(lines) - 1) * line_height
def rounded_box(c, x, y, w, h, r, fill_color, stroke_color=None, stroke_w=1.2):
"""Draw a rounded rectangle."""
c.setLineWidth(stroke_w)
c.setFillColor(fill_color)
if stroke_color:
c.setStrokeColor(stroke_color)
else:
c.setStrokeColor(fill_color)
c.roundRect(x - w/2, y - h/2, w, h, r, fill=1, stroke=1)
def diamond(c, x, y, w, h, fill_color, stroke_color):
"""Draw a diamond shape."""
c.setFillColor(fill_color)
c.setStrokeColor(stroke_color)
c.setLineWidth(1.5)
p = c.beginPath()
p.moveTo(x, y + h/2)
p.lineTo(x + w/2, y)
p.lineTo(x, y - h/2)
p.lineTo(x - w/2, y)
p.close()
c.drawPath(p, fill=1, stroke=1)
def arrow(c, x1, y1, x2, y2, color=None, label=None, label_side="right"):
"""Draw an arrow from (x1,y1) to (x2,y2)."""
col = color or C_NEUTRAL
c.setStrokeColor(col)
c.setFillColor(col)
c.setLineWidth(1.4)
c.line(x1, y1, x2, y2)
# arrowhead
import math
angle = math.atan2(y2 - y1, x2 - x1)
ah = 6
aw = 4
c.saveState()
c.translate(x2, y2)
c.rotate(math.degrees(angle))
p = c.beginPath()
p.moveTo(0, 0)
p.lineTo(-ah, aw/2)
p.lineTo(-ah, -aw/2)
p.close()
c.drawPath(p, fill=1, stroke=0)
c.restoreState()
if label:
c.setFont("Helvetica-Oblique", 7)
c.setFillColor(HexColor("#7F8C8D"))
mx, my = (x1+x2)/2, (y1+y2)/2
if label_side == "right":
c.drawString(mx + 3, my, label)
else:
c.drawRightString(mx - 3, my, label)
def side_arrow(c, x1, y1, x2, y2, color=None):
"""L-shaped arrow: go horizontal then vertical."""
col = color or C_NEUTRAL
c.setStrokeColor(col)
c.setLineWidth(1.3)
c.line(x1, y1, x2, y1)
c.line(x2, y1, x2, y2)
# arrowhead at x2,y2
c.setFillColor(col)
import math
angle = math.atan2(y2 - y1, 0) if y2 != y1 else 0
ah, aw = 6, 4
c.saveState()
c.translate(x2, y2)
if y2 < y1:
c.rotate(-90)
else:
c.rotate(90)
p = c.beginPath()
p.moveTo(0, 0)
p.lineTo(-ah, aw/2)
p.lineTo(-ah, -aw/2)
p.close()
c.drawPath(p, fill=1, stroke=0)
c.restoreState()
# ── Build PDF ──────────────────────────────────────────────────
out = "/home/daytona/workspace/prom-flowchart/PROM_Diagnostic_Flowchart.pdf"
c = canvas.Canvas(out, pagesize=A4)
c.setTitle("PROM Bedside Diagnostic Flowchart")
c.setAuthor("Orris Medical")
c.setSubject("Premature Rupture of Membranes - Bedside Evaluation")
# ── PAGE 1 ──────────────────────────────────────────────────────
CX = PAGE_W / 2 # center x = 297.6
# ── Header banner ──
c.setFillColor(C_HEADER)
c.rect(0, PAGE_H - 52*mm, PAGE_W, 52*mm, fill=1, stroke=0)
c.setFillColor(WHITE)
c.setFont("Helvetica-Bold", 17)
c.drawCentredString(CX, PAGE_H - 18*mm, "PROM BEDSIDE DIAGNOSTIC FLOWCHART")
c.setFont("Helvetica", 9)
c.drawCentredString(CX, PAGE_H - 27*mm, "Premature (Prelabor) Rupture of Membranes — Stepwise Bedside Evaluation")
c.setFont("Helvetica-Oblique", 7.5)
c.drawCentredString(CX, PAGE_H - 34*mm, "Source: Creasy & Resnik MFM 9e • Tintinalli Emergency Medicine • ACOG Practice Bulletins")
# ── Legend ──
leg_x = PAGE_W - 38*mm
leg_y = PAGE_H - 44*mm
c.setFont("Helvetica-Bold", 7)
c.setFillColor(WHITE)
c.drawString(leg_x, leg_y + 5, "LEGEND")
boxes = [
(C_START, WHITE, "Start / End"),
(C_DECISION_BG, C_DECISION, "Decision"),
(C_ACTION_BG, C_ACTION, "Action / Step"),
(C_WARN_BG, C_WARN, "Caution / Stop"),
]
for i, (bg, fg, lbl) in enumerate(boxes):
bx = leg_x
by = leg_y - 5 - i*9
c.setFillColor(bg)
c.setStrokeColor(fg)
c.setLineWidth(0.8)
c.roundRect(bx, by-3, 22, 7, 2, fill=1, stroke=1)
c.setFillColor(fg)
c.setFont("Helvetica", 6.5)
c.drawString(bx + 24, by, lbl)
# ── START node ──────────────────────────────────────────────────
y = PAGE_H - 65*mm
W_WIDE = 150; H_BOX = 22; R = 10
rounded_box(c, CX, y, W_WIDE, H_BOX, R, C_START, WHITE, 1.5)
c.setFillColor(WHITE)
c.setFont("Helvetica-Bold", 10)
c.drawCentredString(CX, y - 3.5, "PATIENT PRESENTS WITH SUSPECTED")
c.setFont("Helvetica-Bold", 10)
c.drawCentredString(CX, y + 4.5, "FLUID LOSS / RUPTURE OF MEMBRANES")
# ── Arrow down ──
arrow(c, CX, y - H_BOX/2, CX, y - H_BOX/2 - 12)
# ── STEP 1: History ─────────────────────────────────────────────
y1 = y - H_BOX/2 - 12 - 28
W1 = 200; H1 = 42
rounded_box(c, CX, y1, W1, H1, 8, C_ACTION_BG, C_ACTION)
c.setFillColor(C_ACTION)
c.setFont("Helvetica-Bold", 9)
c.drawCentredString(CX, y1 + H1/2 - 9, "STEP 1: HISTORY")
c.setFont("Helvetica", 7.5)
items1 = [
"• Sudden gush or continuous leaking of watery fluid",
"• Time of onset, amount, color, odor",
"• LMP → calculate gestational age accurately",
"• Contractions? Fetal movements?",
"• GBS status, prior PROM, cervical procedures",
"• ⚠ Do NOT perform digital cervical exam",
]
for i, txt in enumerate(items1):
c.drawString(CX - W1/2 + 8, y1 + H1/2 - 19 - i*8.5, txt)
arrow(c, CX, y1 - H1/2, CX, y1 - H1/2 - 12)
# ── STEP 2: Speculum exam ──────────────────────────────────────
y2 = y1 - H1/2 - 12 - 28
H2 = 36
rounded_box(c, CX, y2, W1, H2, 8, C_ACTION_BG, C_ACTION)
c.setFillColor(C_ACTION)
c.setFont("Helvetica-Bold", 9)
c.drawCentredString(CX, y2 + H2/2 - 9, "STEP 2: SPECULUM EXAMINATION ONLY")
c.setFont("Helvetica", 7.5)
items2 = [
"• Inspect posterior fornix for pooling of fluid",
"• Ask patient to cough / Valsalva → observe gush",
"• Apply fundal pressure if needed",
"• Assess cervical dilation visually (do NOT use finger)",
]
for i, txt in enumerate(items2):
c.drawString(CX - W1/2 + 8, y2 + H2/2 - 19 - i*8.5, txt)
arrow(c, CX, y2 - H2/2, CX, y2 - H2/2 - 12)
# ── DECISION: Pooling visible? ──────────────────────────────────
y3 = y2 - H2/2 - 12 - 22
DW = 160; DH = 28
diamond(c, CX, y3, DW, DH, C_DECISION_BG, C_DECISION)
c.setFillColor(C_DECISION)
c.setFont("Helvetica-Bold", 8.5)
c.drawCentredString(CX, y3 + 4, "Fluid pooling clearly visible")
c.drawCentredString(CX, y3 - 5, "in posterior fornix?")
# YES branch (right) → confirmed PROM box
arrow(c, CX + DW/2, y3, CX + DW/2 + 45, y3, C_ACTION)
c.setFont("Helvetica-Bold", 7)
c.setFillColor(C_ACTION)
c.drawString(CX + DW/2 + 4, y3 + 3, "YES")
conf_x = CX + DW/2 + 45 + 50
conf_y = y3
rounded_box(c, conf_x, conf_y, 75, 22, 6, C_ACTION_BG, C_ACTION)
c.setFillColor(C_ACTION)
c.setFont("Helvetica-Bold", 7.5)
c.drawCentredString(conf_x, conf_y + 4, "HIGH SUSPICION PROM")
c.setFont("Helvetica", 7)
c.drawCentredString(conf_x, conf_y - 4, "Proceed to bedside tests")
# NO → continue down
arrow(c, CX, y3 - DH/2, CX, y3 - DH/2 - 12, label="NO")
c.setFont("Helvetica-Bold", 7)
c.setFillColor(C_NEUTRAL)
c.drawString(CX + 3, y3 - DH/2 - 6, "NO")
# ── STEP 3: Bedside Tests ──────────────────────────────────────
y4 = y3 - DH/2 - 12 - 38
H4 = 62
rounded_box(c, CX, y4, W1 + 30, H4, 8, C_ACTION_BG, C_ACTION)
c.setFillColor(C_ACTION)
c.setFont("Helvetica-Bold", 9)
c.drawCentredString(CX, y4 + H4/2 - 9, "STEP 3: BEDSIDE DIAGNOSTIC TESTS")
headers = ["Test", "Technique", "Result", "Pitfalls"]
col_x = [CX - 108, CX - 45, CX + 18, CX + 72]
col_w = [55, 65, 50, 65]
c.setFont("Helvetica-Bold", 7)
c.setFillColor(C_ACTION)
row_y = y4 + H4/2 - 20
for j, h in enumerate(headers):
c.drawString(col_x[j], row_y, h)
rows = [
("Nitrazine pH", "Apply fluid to paper", "Blue = alkaline (7.1-7.3) = PROM", "FP: blood, semen, BV, antiseptic"),
("Ferning", "Air-dry smear on slide", "Crystalline arborization = PROM", "FN: blood / cervical mucus"),
("AmniSure®", "Vaginal swab; immunoassay","PAMG-1 +ve = PROM", "High Sn/Sp; useful if equivocal"),
("ActimPROM®", "Vaginal swab", "IGFBP-1 +ve = PROM", "Similar accuracy to AmniSure"),
]
c.setFont("Helvetica", 6.8)
for i, row in enumerate(rows):
ry = row_y - 10 - i * 10
c.setFillColor(C_DECISION if i % 2 == 0 else C_NEUTRAL)
for j, cell in enumerate(row):
c.setFillColor(BLACK)
txt = cell[:38] + "…" if len(cell) > 38 else cell
c.drawString(col_x[j], ry, txt)
# bottom note
c.setFont("Helvetica-Oblique", 6.5)
c.setFillColor(C_ACTION)
c.drawCentredString(CX, y4 - H4/2 + 7, "History + Nitrazine + Ferning together = ~90% diagnostic accuracy (Tintinalli)")
arrow(c, CX, y4 - H4/2, CX, y4 - H4/2 - 10)
# ── Footer page 1 ──────────────────────────────────────────────
c.setFillColor(C_HEADER)
c.rect(0, 0, PAGE_W, 12*mm, fill=1, stroke=0)
c.setFillColor(WHITE)
c.setFont("Helvetica", 7)
c.drawString(10*mm, 4.5*mm, "Orris Medical Reference | PROM Bedside Diagnostic Flowchart | Page 1 of 2")
c.drawRightString(PAGE_W - 10*mm, 4.5*mm, "For clinical use — always correlate with patient context")
# ── Continue label ──────────────────────────────────────────────
c.setFillColor(C_NEUTRAL)
c.setFont("Helvetica-Bold", 8)
c.drawCentredString(CX, 16*mm, "► Continued on Page 2: Interpretation, Ultrasound & Management Pathway")
c.showPage()
# ══════════════════════════════════════════════════════════════
# PAGE 2
# ══════════════════════════════════════════════════════════════
# ── Header ──
c.setFillColor(C_HEADER)
c.rect(0, PAGE_H - 24*mm, PAGE_W, 24*mm, fill=1, stroke=0)
c.setFillColor(WHITE)
c.setFont("Helvetica-Bold", 13)
c.drawCentredString(CX, PAGE_H - 10*mm, "PROM FLOWCHART — PAGE 2: INTERPRETATION & MANAGEMENT PATHWAY")
c.setFont("Helvetica", 7.5)
c.drawCentredString(CX, PAGE_H - 17*mm, "Following bedside tests → Interpret results → Stratify by gestational age → Act")
# ── DECISION: Tests positive? ──────────────────────────────────
y = PAGE_H - 38*mm
DW2 = 170; DH2 = 30
diamond(c, CX, y, DW2, DH2, C_DECISION_BG, C_DECISION)
c.setFillColor(C_DECISION)
c.setFont("Helvetica-Bold", 9)
c.drawCentredString(CX, y + 5, "Bedside tests POSITIVE")
c.drawCentredString(CX, y - 5, "(Nitrazine / Ferning / AmniSure)?")
# ── NO branch → equivocal box ──────────────────────────────────
neq_x = 55
neq_y = y
arrow(c, CX - DW2/2, y, neq_x + 42, y, C_WARN)
c.setFont("Helvetica-Bold", 7)
c.setFillColor(C_WARN)
c.drawString(CX - DW2/2 + 3, y + 3, "NO / EQUIVOCAL")
rounded_box(c, neq_x, neq_y, 82, 42, 8, C_WARN_BG, C_WARN)
c.setFillColor(C_WARN)
c.setFont("Helvetica-Bold", 8)
c.drawCentredString(neq_x, neq_y + 13, "EQUIVOCAL /")
c.drawCentredString(neq_x, neq_y + 5, "NEGATIVE RESULT")
c.setFont("Helvetica", 7)
equiv = [
"• Repeat exam in 1–2h",
"• USS: AFI/MVP oligohydramnios?",
"• Consider amnio-dye test",
" (indigo carmine + tampon)",
"• Review: Ureaplasma, BV?",
]
for i, t in enumerate(equiv):
c.setFillColor(BLACK)
c.drawString(neq_x - 38, neq_y - 3 - i * 8, t)
# ── YES → USS + confirm ────────────────────────────────────────
arrow(c, CX, y - DH2/2, CX, y - DH2/2 - 12, label="YES")
c.setFont("Helvetica-Bold", 7)
c.setFillColor(C_ACTION)
c.drawString(CX + 3, y - DH2/2 - 6, "YES")
# ── USS assessment ──────────────────────────────────────────────
y5 = y - DH2/2 - 12 - 22
W5 = 200; H5 = 28
rounded_box(c, CX, y5, W5, H5, 8, C_ACTION_BG, C_ACTION)
c.setFillColor(C_ACTION)
c.setFont("Helvetica-Bold", 9)
c.drawCentredString(CX, y5 + H5/2 - 9, "STEP 4: ULTRASOUND ASSESSMENT")
c.setFont("Helvetica", 7.5)
uss = [
"• Confirm gestational age (BPD, HC, AC, FL)",
"• AFI < 5 cm OR MVP < 2 cm = oligohydramnios → supports PROM",
"• Fetal presentation • Placental location • Cord position",
"• Exclude cord prolapse / velamentous cord / placenta previa",
]
for i, t in enumerate(uss):
c.drawString(CX - W5/2 + 8, y5 + H5/2 - 18 - i*8.5, t)
arrow(c, CX, y5 - H5/2, CX, y5 - H5/2 - 10)
# ── CONFIRMED PROM ──────────────────────────────────────────────
y6 = y5 - H5/2 - 10 - 14
rounded_box(c, CX, y6, 160, 18, 8, C_DECISION, WHITE)
c.setFillColor(WHITE)
c.setFont("Helvetica-Bold", 9.5)
c.drawCentredString(CX, y6 - 3, "PROM CONFIRMED → STRATIFY BY GESTATIONAL AGE")
arrow(c, CX, y6 - 9, CX, y6 - 20)
# ── GA stratification: 3 columns ───────────────────────────────
y7 = y6 - 35
bw = 155; bh = 115; gap = 10
# column centers
cx1 = CX - bw - gap
cx2 = CX
cx3 = CX + bw + gap
# ── Column headers ──
for cx, lbl, color in [
(cx1, "< 34 WEEKS (PPROM)", C_WARN),
(cx2, "34⁰/⁷ – 36⁶/⁷ WEEKS", C_DECISION),
(cx3, "≥ 37 WEEKS (TERM PROM)", C_ACTION),
]:
rounded_box(c, cx, y7, bw, 14, 5, color, WHITE, 1.2)
c.setFillColor(WHITE)
c.setFont("Helvetica-Bold", 8)
c.drawCentredString(cx, y7 - 2.5, lbl)
# ── Column bodies ──
def col_body(c, cx, y_top, bw, bh, bg, stroke, lines):
rounded_box(c, cx, y_top - bh/2 - 7, bw, bh, 6, bg, stroke)
c.setFillColor(stroke)
c.setFont("Helvetica-Bold", 7.5)
c.drawCentredString(cx, y_top - 7, lines[0])
c.setFont("Helvetica", 7)
c.setFillColor(BLACK)
for i, ln in enumerate(lines[1:]):
c.drawString(cx - bw/2 + 7, y_top - 17 - i * 9, ln)
lines1 = [
"CONSERVATIVE MANAGEMENT",
"• Admit for monitoring",
"• Speculum only — no digital exam",
"• Betamethasone 12mg IM ×2 (24h apart)",
" [24⁰/⁷ – 33⁶/⁷ wks; consider ≥22wks]",
"• IV Ampicillin 2g q6h + Erythromycin",
" 250mg q6h ×48h → oral ×5 days",
"• Avoid amoxicillin-clavulanate (↑NEC)",
"• MgSO₄ neuroprotection if < 32 wks",
"• GBS prophylaxis if positive/unknown",
"• CTG, BPP, daily WBC/Temp (q4h)",
"• Deliver at 34⁰/⁷ wks or if IAI,",
" abruption, or non-reassuring FHR",
]
lines2 = [
"INDIVIDUALIZE DECISION",
"• Balance: chorioamnionitis risk vs",
" prematurity complications",
"• Conservative mgmt extends latency",
" only 3–4 days on average",
"• Chorioamnionitis risk 2–5× higher",
" with conservative management",
"• Antenatal steroids if not given",
"• GBS prophylaxis",
"• Consider delivery at 34–37 wks",
"• Shared decision-making with patient",
"• PROMEXIL / PPROM trial evidence:",
" lean toward delivery ≥34 wks",
]
lines3 = [
"ACTIVE MANAGEMENT",
"• Confirm GBS status",
"• GBS prophylaxis if +ve or unknown",
"• Commence oxytocin induction",
"• Most will labor within 24h",
"• Do NOT await labor > 18–24h",
" (chorioamnionitis risk ↑ greatly)",
"• Chorioamnionitis at term: 9% overall;",
" up to 24% if rupture >24 hours",
"• Monitor: FHR, maternal temp q4h",
"• C-section only for obstetric",
" indications (malpresentation etc.)",
"",
]
col_body(c, cx1, y7 - 7, bw, bh, C_WARN_BG, C_WARN, lines1)
col_body(c, cx2, y7 - 7, bw, bh, C_DECISION_BG, C_DECISION, lines2)
col_body(c, cx3, y7 - 7, bw, bh, C_ACTION_BG, C_ACTION, lines3)
# ── RED FLAGS box at bottom ─────────────────────────────────────
y8 = y7 - bh - 30
W8 = PAGE_W - 24*mm; H8 = 42
rounded_box(c, CX, y8, W8, H8, 8, C_WARN_BG, C_WARN, 1.8)
c.setFillColor(C_WARN)
c.setFont("Helvetica-Bold", 9)
c.drawCentredString(CX, y8 + H8/2 - 10, "⚠ RED FLAGS: DELIVER IMMEDIATELY — REGARDLESS OF GESTATIONAL AGE")
c.setFont("Helvetica", 7.5)
flags = [
("Clinical chorioamnionitis", "Maternal fever ≥38°C + ≥1 of: leukocytosis, maternal/fetal tachy, uterine tenderness, purulent fluid"),
("Placental abruption", "Painful bleeding, woody uterus, fetal distress"),
("Non-reassuring FHR", "Persistent decelerations, bradycardia, absent variability"),
("Cord prolapse", "Visible / palpable cord; emergency delivery — do not delay"),
]
for i, (flag, detail) in enumerate(flags):
fx = CX - W8/2 + 10
fy = y8 + H8/2 - 20 - i * 9.5
c.setFillColor(C_WARN)
c.setFont("Helvetica-Bold", 7.5)
c.drawString(fx, fy, f"• {flag}:")
c.setFillColor(BLACK)
c.setFont("Helvetica", 7.5)
c.drawString(fx + 110, fy, detail)
# ── Footer page 2 ──────────────────────────────────────────────
c.setFillColor(C_HEADER)
c.rect(0, 0, PAGE_W, 12*mm, fill=1, stroke=0)
c.setFillColor(WHITE)
c.setFont("Helvetica", 7)
c.drawString(10*mm, 4.5*mm, "Orris Medical Reference | PROM Bedside Diagnostic Flowchart | Page 2 of 2")
c.drawRightString(PAGE_W - 10*mm, 4.5*mm, "Based on ACOG PB #217, Creasy & Resnik MFM 9e, Tintinalli EM — July 2026")
c.save()
print(f"PDF saved: {out}")
cd /home/daytona/workspace/prom-flowchart && python3 generate_flowchart.py 2>&1
ls -lh /home/daytona/workspace/prom-flowchart/PROM_Diagnostic_Flowchart.pdf
PROM Diagnostic Flowchart
PDF Document · PDF
A flow chart explaining the theory ,clinical investigations and management
ls /tmp/workspace/ 2>/dev/null || echo "no tmp workspace"; ls /home/daytona/workspace/ 2>/dev/null || echo "no home workspace"; python3 -c "import reportlab; print('reportlab OK')"
mkdir -p /tmp/workspace/prom-full && echo "ready"
~/prom-full/prom_full_flowchart.py
"""
PROM / PPROM — Comprehensive Flowchart PDF
Theory · Clinical Investigations · Management
3 pages, A4, ReportLab
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.pdfgen import canvas as rl_canvas
from reportlab.lib.colors import HexColor
import math
# ── Palette ────────────────────────────────────────────────────
NAVY = HexColor("#1B3A5C")
BLUE = HexColor("#2471A3")
TEAL = HexColor("#0E7B6C")
RED = HexColor("#B03A2E")
AMBER = HexColor("#B7770D")
PURPLE = HexColor("#6C3483")
SLATE = HexColor("#5D6D7E")
NAVY_L = HexColor("#D6E4F0")
BLUE_L = HexColor("#EBF5FB")
TEAL_L = HexColor("#E8F8F5")
RED_L = HexColor("#FDEDEC")
AMBER_L = HexColor("#FEF9E7")
PURPLE_L= HexColor("#F5EEF8")
WHITE = colors.white
BLACK = colors.black
LGREY = HexColor("#F2F3F4")
PW, PH = A4 # 595.3 x 841.9
# ── Drawing helpers ─────────────────────────────────────────────
def rbox(cv, cx, cy, w, h, r=8, bg=BLUE_L, stroke=BLUE, lw=1.4):
cv.setFillColor(bg); cv.setStrokeColor(stroke); cv.setLineWidth(lw)
cv.roundRect(cx - w/2, cy - h/2, w, h, r, fill=1, stroke=1)
def diamond(cv, cx, cy, w, h, bg, stroke):
cv.setFillColor(bg); cv.setStrokeColor(stroke); cv.setLineWidth(1.6)
p = cv.beginPath()
p.moveTo(cx, cy + h/2); p.lineTo(cx + w/2, cy)
p.lineTo(cx, cy - h/2); p.lineTo(cx - w/2, cy); p.close()
cv.drawPath(p, fill=1, stroke=1)
def arrowV(cv, x, y1, y2, col=SLATE, label="", lside="right"):
cv.setStrokeColor(col); cv.setLineWidth(1.3); cv.line(x, y1, x, y2)
_arrowhead(cv, x, y2, math.pi*1.5 if y2 < y1 else math.pi*0.5, col)
if label:
cv.setFont("Helvetica-Oblique", 6.5); cv.setFillColor(SLATE)
mx = (y1+y2)/2
if lside == "right": cv.drawString(x+3, mx, label)
else: cv.drawRightString(x-3, mx, label)
def arrowH(cv, x1, x2, y, col=SLATE, label="", lside="top"):
cv.setStrokeColor(col); cv.setLineWidth(1.3); cv.line(x1, y, x2, y)
_arrowhead(cv, x2, y, 0 if x2 > x1 else math.pi, col)
if label:
cv.setFont("Helvetica-Oblique", 6.5); cv.setFillColor(SLATE)
mx = (x1+x2)/2
if lside == "top": cv.drawCentredString(mx, y+3, label)
else: cv.drawCentredString(mx, y-8, label)
def arrowL(cv, x1, y1, x2, y2, col=SLATE):
"""Elbow arrow: horizontal then vertical."""
cv.setStrokeColor(col); cv.setLineWidth(1.3)
cv.line(x1, y1, x2, y1); cv.line(x2, y1, x2, y2)
_arrowhead(cv, x2, y2, math.pi*1.5 if y2 < y1 else math.pi*0.5, col)
def _arrowhead(cv, x, y, angle_rad, col):
cv.setFillColor(col); ah, aw = 7, 4
cv.saveState(); cv.translate(x, y); cv.rotate(math.degrees(angle_rad)-90)
p = cv.beginPath()
p.moveTo(0, 0); p.lineTo(-aw/2, -ah); p.lineTo(aw/2, -ah); p.close()
cv.drawPath(p, fill=1, stroke=0); cv.restoreState()
def txt(cv, text, x, y, font="Helvetica", size=8, col=BLACK, align="left"):
cv.setFont(font, size); cv.setFillColor(col)
if align == "center": cv.drawCentredString(x, y, text)
elif align == "right": cv.drawRightString(x, y, text)
else: cv.drawString(x, y, text)
def txt_block(cv, lines, x, y, size=7.5, col=BLACK, leading=9.5):
"""Draw a list of strings stacked downward."""
for i, line in enumerate(lines):
cv.setFont("Helvetica", size); cv.setFillColor(col)
cv.drawString(x, y - i*leading, line)
def hdr(cv, title, sub=""):
cv.setFillColor(NAVY)
cv.rect(0, PH-26*mm, PW, 26*mm, fill=1, stroke=0)
txt(cv, title, PW/2, PH-12*mm, "Helvetica-Bold", 15, WHITE, "center")
if sub: txt(cv, sub, PW/2, PH-19*mm, "Helvetica", 8, HexColor("#AED6F1"), "center")
txt(cv, "PROM & PPROM Clinical Reference | Creasy & Resnik MFM 9e · ACOG PB#217 · Tintinalli EM",
PW/2, PH-23.5*mm, "Helvetica-Oblique", 6.5, HexColor("#7FB3D3"), "center")
def footer(cv, page_label):
cv.setFillColor(NAVY)
cv.rect(0, 0, PW, 11*mm, fill=1, stroke=0)
txt(cv, "Orris Medical Reference | PROM/PPROM Comprehensive Flowchart", 10*mm, 4*mm,
"Helvetica", 6.8, WHITE)
txt(cv, page_label, PW-10*mm, 4*mm, "Helvetica", 6.8, WHITE, "right")
def section_label(cv, label, x, y, color=NAVY):
cv.setFillColor(color)
cv.roundRect(x-4, y-3, cv.stringWidth(label,"Helvetica-Bold",8)+8, 12, 3, fill=1, stroke=0)
txt(cv, label, x, y, "Helvetica-Bold", 8, WHITE)
# ══════════════════════════════════════════════════════════════════
# PAGE 1 — THEORY (Definitions · Pathophysiology · Risk Factors · Complications)
# ══════════════════════════════════════════════════════════════════
OUT = "/tmp/workspace/prom-full/PROM_PPROM_Complete_Flowchart.pdf"
cv = rl_canvas.Canvas(OUT, pagesize=A4)
cv.setTitle("PROM & PPROM — Theory, Investigations & Management")
cv.setAuthor("Orris Medical")
# Header
hdr(cv, "PROM & PPROM — PAGE 1: THEORY",
"Definitions · Membrane Physiology · Pathophysiology · Risk Factors · Complications")
# ── DEFINITION PANEL ────────────────────────────────────────────
Y = PH - 32*mm
section_label(cv, "DEFINITIONS", 12*mm, Y)
rbox(cv, PW/2, Y-15*mm, PW-20*mm, 22*mm, 8, NAVY_L, NAVY, 1.5)
defs = [
("PROM", "Rupture of membranes BEFORE onset of contractions — at ANY gestational age"),
("PPROM", "PROM occurring BEFORE 37 weeks gestation"),
("Previable PROM","PROM before 23 weeks (before limit of viability)"),
("Latent period", "Time from membrane rupture to onset of labor / delivery"),
("Term PROM", "PROM at ≥ 37 weeks — delivery usually follows within 24–48 h"),
]
col1_x = 14*mm; col2_x = 55*mm
for i, (term, defn) in enumerate(defs):
ry = Y - 9*mm - i*8.5
txt(cv, term, col1_x, ry, "Helvetica-Bold", 7.5, NAVY)
txt(cv, defn, col2_x, ry, "Helvetica", 7.3, BLACK)
# Incidence badge
rbox(cv, PW - 28*mm, Y - 5*mm, 34*mm, 12*mm, 6, AMBER_L, AMBER)
txt(cv, "INCIDENCE", PW-28*mm, Y-2*mm, "Helvetica-Bold", 7.5, AMBER, "center")
txt(cv, "Complicates ~8% of all pregnancies", PW-28*mm, Y-8*mm, "Helvetica", 6.8, BLACK, "center")
# ── ARROW ──
Y2 = Y - 30*mm
arrowV(cv, PW/2, Y2+5, Y2-2)
# ── MEMBRANE ANATOMY ────────────────────────────────────────────
section_label(cv, "MEMBRANE ANATOMY & NORMAL PHYSIOLOGY", 12*mm, Y2-3*mm)
rbox(cv, PW/2, Y2-17*mm, PW-20*mm, 22*mm, 8, BLUE_L, BLUE, 1.4)
anat = [
"• AMNION — innermost layer: single cuboidal epithelium + compact & spongy connective tissue",
"• CHORION — outer layer: reticular & trophoblastic layers; adheres to maternal decidua",
"• Layers fuse by end of week 14; together they are STRONGER than either alone",
"• With gestation: ↓collagen content, ↑apoptosis, ↑MMP activity → physiologic weakening near internal os",
"• Membrane rupture at term = final step of physiologic cervical ripening + uterine contractions",
]
for i, line in enumerate(anat):
txt(cv, line, 14*mm, Y2-9*mm - i*9, "Helvetica", 7.3, BLACK)
# ── PATHOPHYSIOLOGY ─────────────────────────────────────────────
Y3 = Y2 - 44*mm
arrowV(cv, PW/2, Y2-28.5*mm, Y3+2)
section_label(cv, "PATHOPHYSIOLOGY OF PPROM", 12*mm, Y3+1*mm)
# 4 pathway boxes side by side
pw_boxes = [
(TEAL, TEAL_L, "ASCENDING\nINFECTION",
["Bacteria secrete", "collagenases &", "proteases → direct", "membrane weakening",
"Amniotic cx +ve in", "25–35% of cases"]),
(BLUE, BLUE_L, "MMP / TIMP\nIMBALANCE",
["↑ Matrix metallo-", "proteinases (MMPs)", "↓ Tissue inhibitors", "(TIMPs) → collagen",
"degradation near", "internal cervical os"]),
(PURPLE, PURPLE_L, "UTERINE\nOVERDISTENSION",
["↑ Intraamniotic", "pressure from", "twins / poly-", "hydramnios →", "membrane bursting",
"threshold exceeded"]),
(AMBER, AMBER_L, "NUTRITIONAL /\nBIOCHEMICAL",
["Deficiency of:", "• Vitamin C", "• Copper", "• Zinc", "→ impaired collagen",
"synthesis & repair"]),
]
bw = (PW - 28*mm) / 4 - 3
bh = 44*mm
bx_start = 12*mm
for i, (sc, bc, title, items) in enumerate(pw_boxes):
bx = bx_start + i*(bw+3) + bw/2
by = Y3 - bh/2 - 4*mm
rbox(cv, bx, by, bw, bh, 7, bc, sc, 1.3)
lines = title.split("\n")
txt(cv, lines[0], bx, by+bh/2-8, "Helvetica-Bold", 7.5, sc, "center")
if len(lines)>1: txt(cv, lines[1], bx, by+bh/2-16, "Helvetica-Bold", 7.5, sc, "center")
for j, it in enumerate(items):
txt(cv, it, bx - bw/2 + 5, by+bh/2-26 - j*8.5, "Helvetica", 6.8, BLACK)
# ── RISK FACTORS ────────────────────────────────────────────────
Y4 = Y3 - bh - 14*mm
arrowV(cv, PW/2, Y3-bh/2-4*mm-1, Y4+2)
section_label(cv, "RISK FACTORS", 12*mm, Y4+1*mm)
rbox(cv, PW/2, Y4-14*mm, PW-20*mm, 22*mm, 8, LGREY, SLATE, 1.2)
rfs = [
("Prior obstetric", "Previous PPROM (3× risk), preterm birth, cervical surgery (LEEP/cone)"),
("Infection", "GBS, gonorrhoea, chlamydia, TV, bacterial vaginosis, UTI, pyelonephritis"),
("Uterine", "Multiple gestation, polyhydramnios, uterine anomalies, cervical insufficiency"),
("Procedural", "Amniocentesis, fetal surgery, cerclage"),
("Placental", "Abruption, placenta praevia, bleeding in pregnancy"),
("Lifestyle", "Smoking, low BMI, low socioeconomic status, nutritional deficiencies"),
]
col_xs = [14*mm, 52*mm, PW/2 + 2*mm, PW/2 + 40*mm]
for i, (cat, detail) in enumerate(rfs):
col = 0 if i < 3 else 2
row = i if i < 3 else i - 3
ry = Y4 - 7*mm - row * 9
cx_cat = col_xs[col]; cx_det = col_xs[col+1]
txt(cv, cat + ":", cx_cat, ry, "Helvetica-Bold", 7.2, NAVY)
txt(cv, detail, cx_det, ry, "Helvetica", 7, BLACK)
# ── COMPLICATIONS ────────────────────────────────────────────────
Y5 = Y4 - 32*mm
arrowV(cv, PW/2, Y4-26.5*mm, Y5+2)
section_label(cv, "COMPLICATIONS", 12*mm, Y5+1*mm)
comp_data = [
(RED, RED_L, "MATERNAL",
["Chorioamnionitis: 9% (term)", " → 24% if rupture >24h", " → 13–35% remote from term",
"Endometritis: 2–13%", "Placental abruption: 4–12%",
"Maternal sepsis: 0.8%", "Maternal death: 0.14%"]),
(AMBER, AMBER_L, "FETAL",
["Cord compression (oligohydramnios)", "Cord prolapse (esp. malpresentation)",
"Fetal death: 1–2% overall", " → 12–71% if PROM <24wks",
"Intrauterine infection", "Placental abruption"]),
(PURPLE, PURPLE_L, "NEONATAL",
["RDS — most common acute morbidity", "Neonatal sepsis (2× vs preterm labour)",
"IVH / periventricular leukomalacia", "Necrotising enterocolitis (NEC)",
"Pulmonary hypoplasia (<20wk PROM)", "Long-term: cerebral palsy, CLD"]),
]
bh2 = 36*mm; bw2 = (PW-20*mm)/3 - 3
for i, (sc, bc, title, items) in enumerate(comp_data):
bx = 12*mm + i*(bw2+3) + bw2/2
by = Y5 - bh2/2 - 3*mm
rbox(cv, bx, by, bw2, bh2, 7, bc, sc, 1.3)
txt(cv, title, bx, by+bh2/2-8, "Helvetica-Bold", 8, sc, "center")
for j, it in enumerate(items):
txt(cv, it, bx-bw2/2+5, by+bh2/2-18 - j*8.5, "Helvetica", 6.8, BLACK)
footer(cv, "Page 1 of 3 | Theory")
txt(cv, "▶ Continued on Page 2: Clinical Investigations", PW/2, 14*mm,
"Helvetica-Bold", 8, NAVY, "center")
cv.showPage()
# ══════════════════════════════════════════════════════════════════
# PAGE 2 — CLINICAL INVESTIGATIONS
# ══════════════════════════════════════════════════════════════════
hdr(cv, "PROM & PPROM — PAGE 2: CLINICAL INVESTIGATIONS",
"History · Examination · Bedside Tests · Laboratory · Imaging · Interpretation Algorithm")
# ── ENTRY BANNER ────────────────────────────────────────────────
Y = PH - 33*mm
rbox(cv, PW/2, Y, PW-16*mm, 9*mm, 6, NAVY, NAVY, 0)
txt(cv, "PATIENT PRESENTS: Suspected fluid loss / rupture of membranes in pregnancy",
PW/2, Y-2.5, "Helvetica-Bold", 9, WHITE, "center")
arrowV(cv, PW/2, Y-4.5*mm, Y-10*mm)
# ── STEP 1: HISTORY ─────────────────────────────────────────────
Y1 = Y - 20*mm
section_label(cv, "STEP 1 — HISTORY", 12*mm, Y1+4*mm)
rbox(cv, PW/2, Y1, PW-16*mm, 20*mm, 7, TEAL_L, TEAL, 1.4)
h_cols = [
["SYMPTOM HISTORY",
"• Sudden gush or continuous trickle of watery fluid",
"• Time of onset, amount, colour, odour",
"• Ongoing leakage / intermittent?",
"• Contractions or uterine tightening?",
"• Fetal movements present?"],
["OBSTETRIC HISTORY",
"• LMP → gestational age calculation",
"• Gravida / para, prior PPROM",
"• GBS status from recent swab",
"• Cervical cerclage in situ?",
"• Recent amniocentesis / procedure?"],
["RED FLAG HISTORY",
"• Fever / rigors (infection?)",
"• Abdominal pain / bleeding",
"• Decreased fetal movement",
"• Offensive vaginal discharge",
"⚠ NO digital vaginal exam until term"],
]
col_w = (PW-20*mm)/3
for ci, col in enumerate(h_cols):
cx = 12*mm + ci*col_w
txt(cv, col[0], cx, Y1+7*mm, "Helvetica-Bold", 7.5, TEAL)
for j, line in enumerate(col[1:]):
c_ = RED if "⚠" in line else BLACK
txt(cv, line, cx, Y1+7*mm-9-j*8.5, "Helvetica", 7, c_)
arrowV(cv, PW/2, Y1-10*mm, Y1-15*mm)
# ── STEP 2: EXAMINATION ─────────────────────────────────────────
Y2 = Y1 - 27*mm
section_label(cv, "STEP 2 — PHYSICAL EXAMINATION", 12*mm, Y2+4*mm)
rbox(cv, PW/2, Y2, PW-16*mm, 20*mm, 7, BLUE_L, BLUE, 1.4)
exam_cols = [
["GENERAL / VITALS",
"• Temperature (q4h if admitted)",
"• Pulse, BP, respiratory rate",
"• Fundal height / uterine size",
"• Uterine tenderness (IAI sign)",
"• Abdominal guarding?"],
["SPECULUM EXAM ONLY",
"• Inspect posterior fornix: pooling?",
"• Cough / Valsalva → observe gush",
"• Fundal pressure if needed",
"• Visual cervical OS assessment",
"• Take swabs: GBS, HVS, STI"],
["FETAL ASSESSMENT",
"• Fetal heart rate auscultation",
"• Leopold manoeuvres — presentation",
"• CTG if ≥ 26 weeks",
"• Rule out cord prolapse",
"• Amniotic fluid colour (meconium?)"],
]
for ci, col in enumerate(exam_cols):
cx = 12*mm + ci*col_w
txt(cv, col[0], cx, Y2+7*mm, "Helvetica-Bold", 7.5, BLUE)
for j, line in enumerate(col[1:]):
txt(cv, line, cx, Y2+7*mm-9-j*8.5, "Helvetica", 7, BLACK)
arrowV(cv, PW/2, Y2-10*mm, Y2-15*mm)
# ── STEP 3: BEDSIDE TESTS ───────────────────────────────────────
Y3 = Y2 - 30*mm
section_label(cv, "STEP 3 — BEDSIDE DIAGNOSTIC TESTS", 12*mm, Y3+4*mm)
tests = [
(TEAL, TEAL_L, "NITRAZINE pH TEST",
["Method: apply fluid to pH paper",
"Normal vaginal pH: 3.8–4.2",
"Amniotic fluid pH: 7.1–7.3",
"POSITIVE: paper turns blue/green",
"False +ve: blood, semen,",
" BV, antiseptic solutions",
"Sensitivity ~90%"]),
(BLUE, BLUE_L, "FERNING (ARBORIZATION)",
["Method: smear on glass slide,",
" air-dry, view under microscope",
"POSITIVE: fern-like crystals",
" = NaCl crystallization of AF",
"False -ve: blood, cervical",
" mucus contamination",
"Spec ~98% if clean sample"]),
(PURPLE, PURPLE_L, "IMMUNOASSAY TESTS",
["AmniSure® — PAMG-1:",
" Placental alpha-microglobulin-1",
" Very high Sn/Sp (~98%/98%)",
"ActimPROM® — IGFBP-1:",
" Insulin-like GF binding protein",
" Useful if nitrazine equivocal",
"Gold std: amnioinfusion + dye"]),
(AMBER, AMBER_L, "COMBINED ACCURACY",
["History alone: ~70%",
"Nitrazine alone: ~90%",
"Ferning alone: ~95%",
"History + Nitrazine",
" + Ferning = ~90–95%",
"AmniSure: ~97–99%",
"Dye test: near 100%"]),
]
bw3 = (PW-20*mm)/4 - 3; bh3 = 36*mm
for i, (sc, bc, title, items) in enumerate(tests):
bx = 12*mm + i*(bw3+3) + bw3/2
by = Y3 - bh3/2 - 2*mm
rbox(cv, bx, by, bw3, bh3, 7, bc, sc, 1.3)
txt(cv, title, bx, by+bh3/2-8, "Helvetica-Bold", 7.2, sc, "center")
for j, it in enumerate(items):
txt(cv, it, bx-bw3/2+4, by+bh3/2-18 - j*8.2, "Helvetica", 6.5, BLACK)
arrowV(cv, PW/2, Y3-bh3/2-2*mm-1, Y3-bh3/2-8*mm)
# ── STEP 4: LAB + IMAGING ───────────────────────────────────────
Y4 = Y3 - bh3 - 22*mm
section_label(cv, "STEP 4 — LABORATORY & IMAGING INVESTIGATIONS", 12*mm, Y4+4*mm)
lab_img = [
(SLATE, LGREY, "LABORATORY TESTS",
["• FBC: ↑WBC >15,000 = IAI sign",
"• CRP: rising = infection marker",
"• Blood cultures if febrile",
"• U&E, LFTs (baseline)",
"• Coagulation (if abruption ?)",
"• HVS, GBS rectal/vaginal swab",
"• MSU: exclude UTI / bacteriuria",
"• STI screen (GC, Chlamydia)"]),
(TEAL, TEAL_L, "ULTRASOUND SCAN",
["• Confirm gestational age",
" (BPD, HC, AC, FL biometry)",
"• AFI <5 cm / MVP <2 cm",
" = oligohydramnios → supports PROM",
"• Fetal presentation",
"• Placental location / praevia",
"• Cord position — exclude prolapse",
"• Fetal weight estimate"]),
(BLUE, BLUE_L, "CTG / FETAL MONITORING",
["• Baseline FHR: 110–160 bpm",
"• Variable decelerations:",
" cord compression from oligo",
"• Prolonged decelerations:",
" cord compression / prolapse",
"• Reduced variability:",
" consider infection / hypoxia",
"• BPP if CTG equivocal"]),
(PURPLE, PURPLE_L, "ADVANCED / EQUIVOCAL",
["• Amnio-dye test:",
" indigo carmine 1mL IA →",
" blue staining on tampon",
" = definitive PROM",
"• Serial USS q1–2 wks",
" (fluid reaccumulation?)",
"• Fetal lung maturity if",
" 34–36 wks borderline"]),
]
bw4 = (PW-20*mm)/4 - 3; bh4 = 40*mm
for i, (sc, bc, title, items) in enumerate(lab_img):
bx = 12*mm + i*(bw4+3) + bw4/2
by = Y4 - bh4/2 - 2*mm
rbox(cv, bx, by, bw4, bh4, 7, bc, sc, 1.3)
txt(cv, title, bx, by+bh4/2-8, "Helvetica-Bold", 7.2, sc, "center")
for j, it in enumerate(items):
txt(cv, it, bx-bw4/2+4, by+bh4/2-18 - j*8.5, "Helvetica", 6.8, BLACK)
arrowV(cv, PW/2, Y4-bh4/2-2*mm-1, Y4-bh4/2-7*mm)
# ── INTERPRETATION ALGORITHM ──────────────────────────────────
Y5 = Y4 - bh4 - 19*mm
rbox(cv, PW/2, Y5, PW-16*mm, 11*mm, 6, NAVY, NAVY, 0)
txt(cv, "INTERPRETATION: Pooling + Nitrazine + Ferning/AmniSure + USS oligohydramnios = PROM CONFIRMED",
PW/2, Y5-2.5, "Helvetica-Bold", 8.5, WHITE, "center")
# Two outcome boxes
arrowV(cv, PW/3, Y5-5.5*mm, Y5-10.5*mm, TEAL)
arrowV(cv, 2*PW/3, Y5-5.5*mm, Y5-10.5*mm, RED)
Y6 = Y5 - 19*mm
rbox(cv, PW/3, Y6, PW/2-14*mm, 12*mm, 6, TEAL_L, TEAL)
txt(cv, "PROM CONFIRMED", PW/3, Y6+2.5, "Helvetica-Bold", 8.5, TEAL, "center")
txt(cv, "→ Proceed to gestational age stratification (Page 3)", PW/3, Y6-4,
"Helvetica", 7.5, BLACK, "center")
rbox(cv, 2*PW/3, Y6, PW/2-14*mm, 12*mm, 6, AMBER_L, AMBER)
txt(cv, "EQUIVOCAL / NEGATIVE", 2*PW/3, Y6+2.5, "Helvetica-Bold", 8.5, AMBER, "center")
txt(cv, "→ Repeat in 1–2h; USS; consider dye test; re-evaluate", 2*PW/3, Y6-4,
"Helvetica", 7.5, BLACK, "center")
footer(cv, "Page 2 of 3 | Clinical Investigations")
txt(cv, "▶ Continued on Page 3: Management by Gestational Age + Red Flags",
PW/2, 14*mm, "Helvetica-Bold", 8, NAVY, "center")
cv.showPage()
# ══════════════════════════════════════════════════════════════════
# PAGE 3 — MANAGEMENT
# ══════════════════════════════════════════════════════════════════
hdr(cv, "PROM & PPROM — PAGE 3: MANAGEMENT",
"Gestational Age Stratification · Conservative Bundle · Delivery Triggers · Red Flags")
Y = PH - 33*mm
# ── GA STRATIFICATION HEADER ────────────────────────────────────
rbox(cv, PW/2, Y, PW-16*mm, 9*mm, 5, NAVY, NAVY, 0)
txt(cv, "PROM CONFIRMED → STRATIFY BY GESTATIONAL AGE",
PW/2, Y-2.5, "Helvetica-Bold", 11, WHITE, "center")
arrowV(cv, PW/2, Y-4.5*mm, Y-8*mm)
# ── 4 COLUMNS for GA bands ──────────────────────────────────────
Y1 = Y - 18*mm
bands = [
(RED, RED_L, "< 23 WEEKS\nPERIVIABLE PROM",
["COUNSELLING ESSENTIAL",
"• Average fetal loss ~30%",
"• Neonatal survival ≤24wks: 44%",
"• Risk pulmonary hypoplasia if",
" severe oligo + PROM <20wks",
"",
"OPTIONS (shared decision):",
"• Expectant management",
" — inpatient initially",
" — pelvic & bed rest",
" — temp q4h, WBC daily",
" — USS q1–2 wks",
" — admit at viability limit",
"• Termination of pregnancy:",
" PGE2 / misoprostol /",
" high-dose oxytocin / D&E",
"",
"ANTIBIOTICS: consider at",
"viability (no clear benefit",
"at diagnosis vs viability)",
"AMNIOPATCH: experimental",
"(success 36–63% post-amnio)"]),
(AMBER, AMBER_L, "23–33⁶/⁷ WEEKS\nPPROM (REMOTE FROM TERM)",
["CONSERVATIVE MANAGEMENT",
"",
"★ CORTICOSTEROIDS",
"Betamethasone 12mg IM ×2",
"(24h apart) [24⁰/⁷–33⁶/⁷wk]",
"May start from 22⁰/⁷ wks",
"",
"★ ANTIBIOTICS (7-day course)",
"IV Ampicillin 2g q6h +",
"IV Erythromycin 250mg q6h",
"×48h, THEN:",
"Amoxicillin 250mg PO q8h +",
"Erythromycin 333mg PO q8h",
"×5 days",
"⚠ Avoid amox-clavulanate",
" (↑ NEC risk 4.72×)",
"",
"★ MgSO₄ NEUROPROTECTION",
"If <32 wks: 4g IV over 20min",
"then 1–2g/h maintenance",
"",
"★ GBS PROPHYLAXIS",
"If +ve or unknown status"]),
(BLUE, BLUE_L, "34⁰/⁷–36⁶/⁷ WEEKS\nLATE PRETERM",
["INDIVIDUALISE — balance:",
"chorioamnionitis risk vs",
"prematurity complications",
"",
"EVIDENCE (PROMEXIL/PPROM):",
"Conservative management",
"extends latency only 3–4 days",
"Chorioamnionitis risk 2–5×",
"higher with expectant mgmt",
"",
"CURRENT RECOMMENDATION:",
"Deliver at 34⁰/⁷ weeks",
"(or individualise 34–36wk)",
"",
"★ ANTENATAL STEROIDS",
"Give if not yet administered",
"(late-preterm steroid trial",
"supports use at 34–36wks)",
"",
"★ GBS PROPHYLAXIS",
"If +ve or unknown",
"",
"★ MONITOR: CTG, temp,",
"WBC, urine output"]),
(TEAL, TEAL_L, "≥ 37 WEEKS\nTERM PROM",
["ACTIVE MANAGEMENT",
"",
"• Oxytocin induction of labour",
"• Do NOT await spontaneous",
" labour beyond 12–18 hours",
" → chorioamnionitis risk ↑↑",
"",
"CHORIOAMNIONITIS RISK:",
"• 9% overall at term",
"• Up to 24% if rupture >24h",
"",
"★ GBS PROPHYLAXIS",
"If GBS +ve or unknown:",
"IV Penicillin G 5MU then",
"2.5MU q4h during labour",
"Alternatives: Ampicillin,",
"Cefazolin, Clindamycin",
"",
"MONITORING:",
"• FHR monitoring (CTG)",
"• Maternal temp q4h",
"• WBC if fever develops",
"",
"C-SECTION: only for standard",
"obstetric indications"]),
]
bw_ga = (PW-20*mm)/4 - 3
bh_ga = 115*mm
for i, (sc, bc, title, items) in enumerate(bands):
bx = 12*mm + i*(bw_ga+3) + bw_ga/2
by = Y1 - bh_ga/2 - 4*mm
rbox(cv, bx, by, bw_ga, bh_ga, 7, bc, sc, 1.5)
lines = title.split("\n")
txt(cv, lines[0], bx, by+bh_ga/2-8, "Helvetica-Bold", 7.5, sc, "center")
txt(cv, lines[1], bx, by+bh_ga/2-17, "Helvetica-Bold", 7.5, sc, "center")
for j, it in enumerate(items):
f = "Helvetica-Bold" if it.startswith("★") or it.startswith("OPTIONS") or it.startswith("CURRENT") or it.startswith("EVIDENCE") or it.startswith("CHORIOAMNI") or it.startswith("MONITOR") or it.startswith("C-SECTION") or it.startswith("GBS") else "Helvetica"
c_ = sc if it.startswith("★") else (RED if "⚠" in it else BLACK)
txt(cv, it, bx-bw_ga/2+5, by+bh_ga/2-27 - j*8.2, f, 6.7, c_)
# ── MONITORING DURING CONSERVATIVE MANAGEMENT ──────────────────
Y2 = Y1 - bh_ga - 14*mm
section_label(cv, "MONITORING DURING CONSERVATIVE MANAGEMENT", 12*mm, Y2+3*mm)
rbox(cv, PW/2, Y2-9*mm, PW-16*mm, 14*mm, 7, BLUE_L, BLUE, 1.4)
mon = [
["MATERNAL (daily / q4h):",
"Temp q4h · Pulse, BP · WBC + CRP daily",
"Uterine tenderness · Vaginal discharge"],
["FETAL (daily):",
"Kick count · NST/CTG q12–24h · BPP",
"USS: fluid, growth, doppler (weekly)"],
["INFECTION SCREEN:",
"Rising temp, WBC, CRP, fetal tachy",
"→ suspect IAI → deliver"],
]
col_w3 = (PW-20*mm)/3
for ci, col in enumerate(mon):
cx = 12*mm + ci*col_w3
txt(cv, col[0], cx, Y2-3.5*mm, "Helvetica-Bold", 7.5, BLUE)
for j, line in enumerate(col[1:]):
txt(cv, line, cx, Y2-3.5*mm-9-j*8.5, "Helvetica", 7, BLACK)
# ── DIAGNOSIS OF IAI ───────────────────────────────────────────
Y3 = Y2 - 26*mm
section_label(cv, "DIAGNOSIS OF INTRAAMNIOTIC INFECTION (IAI / CHORIOAMNIONITIS)", 12*mm, Y3+3*mm)
rbox(cv, PW/2, Y3-9*mm, PW-16*mm, 14*mm, 7, AMBER_L, AMBER, 1.5)
iai_1 = "CLINICAL IAI: Maternal fever ≥38°C PLUS at least ONE of:"
iai_2 = "Maternal leukocytosis >15,000 · Maternal tachycardia >100 bpm · Fetal tachycardia >160 bpm · Uterine tenderness · Purulent AF"
iai_3 = "MANAGEMENT OF IAI: Deliver regardless of GA + Broad-spectrum IV antibiotics (Ampicillin + Gentamicin; add Clindamycin for C-section)"
txt(cv, iai_1, 14*mm, Y3-3.5*mm, "Helvetica-Bold", 7.5, AMBER)
txt(cv, iai_2, 14*mm, Y3-11.5*mm, "Helvetica", 7.2, BLACK)
txt(cv, iai_3, 14*mm, Y3-19.5*mm, "Helvetica-Bold", 7.2, RED)
# ── RED FLAGS ──────────────────────────────────────────────────
Y4 = Y3 - 30*mm
rbox(cv, PW/2, Y4, PW-16*mm, 22*mm, 8, RED_L, RED, 2)
txt(cv, "⚠ IMMEDIATE DELIVERY INDICATED — REGARDLESS OF GESTATIONAL AGE",
PW/2, Y4+8.5*mm, "Helvetica-Bold", 9.5, RED, "center")
flags = [
("Clinical IAI", "Maternal fever ≥38°C + one IAI criterion above → broad-spectrum IV abx + deliver"),
("Placental abruption", "Painful bleeding + woody uterus + fetal distress → emergency delivery"),
("Non-reassuring FHR", "Persistent decelerations / bradycardia / absent variability → deliver"),
("Cord prolapse", "Visible / palpable umbilical cord → Category 1 CS — do NOT delay"),
("Active labour", "Progressive cervical change + contractions → deliver; no active tocolysis"),
]
for i, (flag, detail) in enumerate(flags):
fy = Y4 + 3*mm - i*9.5
txt(cv, f"• {flag}:", 14*mm, fy, "Helvetica-Bold", 7.5, RED)
txt(cv, detail, 62*mm, fy, "Helvetica", 7.3, BLACK)
# ── CLINICAL PEARLS ──────────────────────────────────────────
Y5 = Y4 - 32*mm
rbox(cv, PW/2, Y5, PW-16*mm, 22*mm, 8, LGREY, SLATE, 1.2)
txt(cv, "KEY CLINICAL PEARLS", PW/2, Y5+9*mm, "Helvetica-Bold", 9, SLATE, "center")
pearls = [
"1. NO digital cervical exam until labour is confirmed (shortens latency, ↑ infection risk) — speculum only.",
"2. Nitrazine FALSE POSITIVES: blood, semen, BV, antiseptic — confirm with ferning or AmniSure.",
"3. NEVER use amoxicillin-clavulanate (Augmentin) in PPROM — 4.72× increased NEC risk (ORACLE trial).",
"4. Magnesium sulfate neuroprotection at <32 weeks reduces cerebral palsy — do not omit.",
"5. Antenatal corticosteroids: ↓ RDS 21.8% vs 31.9%, ↓ IVH 4.2% vs 8.6%, ↓ neonatal death 10.4% vs 16.8%.",
"6. Term PROM: induce within 12–18h — chorioamnionitis rises significantly beyond 24h of membrane rupture.",
"7. Pulmonary hypoplasia risk: PROM before 20 wks + persistent severe oligohydramnios (AFI <2cm) for >2 wks.",
]
for i, p in enumerate(pearls):
txt(cv, p, 14*mm, Y5+5*mm - i*9.5, "Helvetica", 7, BLACK)
footer(cv, "Page 3 of 3 | Management")
cv.save()
print(f"✓ PDF saved: {OUT}")
cd /tmp/workspace/prom-full && python3 prom_full_flowchart.py 2>&1
ls -lh /tmp/workspace/prom-full/PROM_PPROM_Complete_Flowchart.pdf
PROM PPROM Complete Flowchart
PDF Document · PDF
PROM management
"premature rupture of membranes" management
| Step | Action |
|---|---|
| Duration of rupture | Estimate - helps neonatologists plan |
| Gestational age | Confirm with LMP + USS biometry (note: BPD may be distorted by oligohydramnios - use HC instead) |
| Fetal presentation | Leopold's + USS |
| Labor assessment | Contractions? Cervical dilation (speculum only - no digital exam) |
| Infection screen | Maternal temp, pulse, WBC, CRP; GBS status from swabs within 6 weeks |
| Fetal well-being | Continuous CTG at viable gestational age |
| Ultrasound | Fetal weight, growth, AFI/MVP, cord position, placenta, anomalies |
| Facility check | Can this centre provide emergent delivery + acute neonatal resuscitation? If not - transfer early |
TERMPROM trial (Hannah et al.): Oxytocin induction resulted in fewer cases of chorioamnionitis without increasing C-section rates compared to expectant management.
| Measure | Details |
|---|---|
| Setting | Inpatient at facility with emergent delivery capability + NICU. Outpatient NOT recommended after viability |
| Activity | Modified bed rest (not strict); pelvic rest |
| Monitoring | Continuous CTG initially; then daily FHR assessment (cord compression rate 32-76%) |
| Biophysical profile | If NST equivocal; a BPP ≤6 within 24h of delivery is associated with perinatal infection |
| Infection surveillance | Maternal temp q4h, pulse, WBC + CRP daily, uterine tenderness, vaginal discharge character |
| USS | Weekly: amniotic fluid, fetal growth, doppler |
| Drug | Dose | Schedule |
|---|---|---|
| Betamethasone | 12 mg IM | Two doses, 24 hours apart |
| Dexamethasone | 6 mg IM | Four doses, 12 hours apart |
| Phase | Drug | Dose | Duration |
|---|---|---|---|
| IV phase (48h) | Ampicillin | 2g IV q6h | 48 hours |
| IV phase (48h) | Erythromycin | 250mg IV q6h | 48 hours |
| Oral phase (5 days) | Amoxicillin | 250mg PO q8h | 5 days |
| Oral phase (5 days) | Erythromycin | 333mg PO q8h | 5 days |
| Parameter | Frequency |
|---|---|
| Maternal temperature | Every 4 hours |
| Pulse, BP | Every 4 hours |
| Fetal heart rate (CTG) | Daily minimum; continuous if decelerations |
| WBC + CRP | Daily |
| Uterine tenderness check | Every assessment |
| Ultrasound (fluid, growth, Doppler) | Weekly |
| BPP | If NST equivocal |
| Kick counts | Daily |
| Gestational Age | Recommendation |
|---|---|
| ≥ 37 weeks | Deliver promptly (oxytocin within 12-18h) |
| 34 0/7 - 36 6/7 weeks | Deliver at 34 weeks; individualise at 34-36 wks |
| 32 0/7 - 33 6/7 weeks | Conservative; deliver at 34 weeks |
| 24 0/7 - 31 6/7 weeks | Conservative; deliver at 34 weeks or if complications |
| < 24 weeks | Counsel; shared decision; deliver if IAI/complications |
According to Malaysia CPG
Malaysia Clinical Practice Guideline PROM premature rupture of membranes MOH CPG
Malaysia MOH CPG "prelabour rupture of membranes" OR "premature rupture of membranes" site:moh.gov.my OR site:acadmed.org.my
https://www.moh.gov.my/images/04-penerbitan/penerbitan-klini…
Malaysia MOH "handbook of obstetrics" PROM PPROM management corticosteroids antibiotics 2024
https://sites.google.com/moh.gov.my/nag/contents/section-a-a…
Malaysia MOH CPG PROM PPROM "corticosteroids" "erythromycin" OR "ampicillin" "betamethasone" gestational age management 2023 2024
https://www.moh.gov.my/images/04-penerbitan/penerbitan-klini…
| Investigation | Purpose |
|---|---|
| FBC (BUSE/FBE) | WBC for infection screening |
| MSU FEME and C&S | Exclude UTI / bacteriuria |
| Cardiotocograph (CTG) | Fetal well-being assessment |
| Ultrasound | Amniotic fluid volume, fetal presentation, exclude fetal anomaly, estimate weight |
Note: The CPG specifically states to exclude gross foetal anomaly during the initial scan.
"Administer antenatal corticosteroids to women between 24 weeks and 35 weeks 6 days of pregnancy who have preterm labour and PPROM."
| Drug | Dose | Schedule |
|---|---|---|
| Dexamethasone | 6 mg IM | Twice daily (bd) for 2 days (total 4 doses) |
⚠ Note: Malaysia uses Dexamethasone (not Betamethasone as in ACOG/RCOG), reflecting local drug availability. The total dose is 4 × 6 mg = 24 mg IM.
| Regimen | |
|---|---|
| Preferred | Erythromycin ethylsuccinate 400 mg PO q6h OR 800 mg PO q12h for 7-10 days |
| Alternative | — |
| Phase | Drug | Dose | Duration |
|---|---|---|---|
| IV phase | Ampicillin | 2g IV q6h | 48 hours |
| PLUS (on admission) | Azithromycin | 1g PO STAT | Single dose |
| Then oral phase | Amoxicillin | 500mg PO q8h | 5-7 days (or until delivery, whichever first) |
Azithromycin rationale: Covers Ureaplasma spp. — recognised as an important cause of chorioamnionitis in the Malaysian NAG — and Chlamydia trachomatis.
⚠ No amoxicillin-clavulanate for PPROM (consistent with international guidance due to NEC risk).
"Tocolysis can delay delivery by 48 hours so that it allows the completion of a course of antenatal corticosteroids and in-utero transfer."
| Agent | Route | Notes |
|---|---|---|
| Nifedipine | Oral | First-line at most hospitals |
| Atosiban (Tractocile) | IV | Oxytocin receptor antagonist; milder side effects |
| Terbutaline (Bricanyl) | SC 0.25 mg STAT | Preferred at district hospitals / peripheral clinics for in-utero transfer |
| Magnesium sulphate | IV | Also listed as tocolytic option |
| Drug | Side Effects |
|---|---|
| Nifedipine | Maternal hypotension, dizziness, tachycardia |
| Atosiban | Nausea (usually mild) |
| Terbutaline | Tachycardia, hypotension, hyperglycaemia, pulmonary oedema |
| MgSO4 | Flushing, respiratory depression, cardiac arrest |
| Gestational Age | Recommendation |
|---|---|
| < 30 weeks | Recommended |
| 30 - 33 weeks 6 days | Can be considered |
| ≥ 34 weeks | Not routinely recommended |
Evidence cited: MgSO4 substantially reduced cerebral palsy (RR 0.68; 95% CI 0.54-0.87) and substantial gross motor dysfunction (RR 0.61; 95% CI 0.44-0.85) in preterm infants.
| Scenario | Preferred | Alternative |
|---|---|---|
| Standard | Benzylpenicillin 5 MU IV loading, then 2.5-3 MU IV q4h until delivery | Ampicillin 2g IV then 1g q4h |
| Mild penicillin allergy | Cefazolin 2g IV then 1g q8h | Cefuroxime 1.5g IV then 750mg q8h |
| Severe penicillin allergy | Vancomycin 15-20 mg/kg IV q8-12h | Clindamycin 900mg IV q8h |
| Preferred | Ampicillin + Gentamicin |
|---|---|
| If C-section | Add Metronidazole or Clindamycin |
| Penicillin allergy | Clindamycin + Gentamicin |
| Intervention | Malaysia Recommendation |
|---|---|
| Corticosteroids | Dexamethasone 6 mg IM bd × 2 days (24-35+6 weeks) |
| Antibiotics (non-GBS) | Erythromycin ethylsuccinate 400 mg q6h PO × 7-10 days |
| Antibiotics (GBS+) | Ampicillin 2g IV q6h × 48h + Azithromycin 1g STAT, then Amoxicillin 500 mg q8h PO × 5-7 days |
| MgSO4 neuroprotection | Recommended <30 weeks; consider 30-33+6 weeks |
| Tocolysis | 24-35+6 weeks; terbutaline SC for peripheral transfer |
| IAP (GBS+) | Benzylpenicillin 5 MU IV then 2.5-3 MU q4h until delivery |
| Term PROM IOL | Within 24 hours; oxytocin preferred |
| Corticosteroids | Avoid amoxicillin-clavulanate (NEC risk) |