.I am very new to 3rd year in mbbs.Tomorrow is my posteing at obstrectic and gynecology ward and i dont know anything about taking histroy of obstrectic and gynecology ward . Please help me to take histroy from this ward in wasy language

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
I now have enough information from the textbooks plus my medical knowledge to give you a very thorough, beginner-friendly guide. Let me write this up clearly.

How to Take History in the OB/GYN Ward - A Beginner's Guide for 3rd Year MBBS

Welcome to OB/GYN posting! Don't worry - history taking here follows the same general structure as any other ward, but with some special parts unique to this department. Here's everything broken down simply.

The Basic Structure (Same as Any Ward)

  1. Biodata
  2. Chief Complaint
  3. History of Present Illness
  4. Menstrual History ← OB/GYN special
  5. Obstetric History ← OB/GYN special
  6. Gynecological History ← OB/GYN special
  7. Past Medical/Surgical History
  8. Drug History
  9. Family History
  10. Personal/Social History

1. Biodata

Ask:
  • Name, Age, Address
  • Occupation (hers and husband's - important for stress, exposure, socioeconomic status)
  • Religion (relevant for blood transfusion consent, contraception choices)
  • Marital status and duration of marriage

2. Chief Complaint

Ask: "What problem has brought you to the hospital today?"
Common OB/GYN complaints you'll see:
  • Pain in the abdomen / pelvis
  • Vaginal bleeding (in pregnancy or outside pregnancy)
  • Vaginal discharge
  • Missed period / amenorrhea
  • No pregnancy after trying (infertility)
  • Swelling in abdomen
  • Urinary problems (leaking urine, burning)
  • Postmenopausal bleeding (very important - always take seriously)
  • Labor pains

3. History of Present Illness (HPI)

Ask about the chief complaint in detail using the classic SOCRATES method:
  • S - Site (where exactly?)
  • O - Onset (when did it start? sudden or gradual?)
  • C - Character (what type of pain? crampy, burning, dull?)
  • R - Radiation (does it go anywhere else?)
  • A - Associated symptoms (fever, nausea, vomiting, discharge?)
  • T - Timing (constant or comes and goes? related to periods?)
  • E - Exacerbating / Relieving factors
  • S - Severity (scale of 1-10)

4. Menstrual History (MOST IMPORTANT in OB/GYN)

This is asked in EVERY single OB/GYN patient. Ask:
a) Age of Menarche - "At what age did your periods first start?" (Normal: 10-16 years)
b) Cycle - Use this format: Duration of flow / Length of cycle
  • "How many days does bleeding last?" (Normal: 3-7 days)
  • "How many days from the first day of one period to the first day of the next?" (Normal: 21-35 days)
  • Write it as: 4-5 / 28-30 days (example)
c) Flow amount - "How many pads do you use per day?" (Normal: 3-5 pads/day)
  • Heavy = soaking through pads within an hour = abnormal
  • Ask about clots in the blood
d) Dysmenorrhea - "Do you have pain during your periods?" (Primary vs Secondary)
e) LMP (Last Menstrual Period) - "When was the first day of your LAST period?" - Write this date always
f) Regularity - Regular or irregular?
g) Intermenstrual bleeding - Any bleeding between periods?
h) Post-coital bleeding - Bleeding after sex? (Important - can suggest cervical pathology)
i) Menopause - If older patient: "Have your periods stopped? When?"
Remember: In a pregnant patient, LMP is used to calculate the Expected Date of Delivery (EDD) using Naegele's rule: Add 9 months + 7 days to LMP (or subtract 3 months and add 7 days).

5. Obstetric History (For Pregnant Patients or Those with Past Pregnancies)

Learn GPAL / GTPAL First!

LetterMeaningSimple explanation
GGravidaTotal number of pregnancies (including current one)
PParaNumber of deliveries after 28 weeks (viable babies)
AAbortionMiscarriages or terminations before 28 weeks
LLivingNumber of children alive today
Example: G3P2A1L2 = 3 pregnancies total, delivered 2 times, 1 miscarriage, 2 children alive

For EACH Previous Pregnancy, Ask:

  1. Year of delivery
  2. Duration of pregnancy (how many months/weeks at delivery?)
  3. Type of delivery - Normal vaginal / Cesarean section / Instrumental (forceps/vacuum)
  4. Where was delivery done? (hospital or home?)
  5. Baby's weight at birth (if known)
  6. Baby's sex and current health
  7. Any complications during that pregnancy? (blood pressure, diabetes, bleeding, fits/seizures)
  8. Postpartum complications? (excessive bleeding after delivery, infection, ICU admission)
  9. If miscarriage: how many weeks? Any D&C (cleaning procedure) done?

For the Current Pregnancy (Antenatal History):

  1. LMP and EDD - calculate gestational age
  2. Booking - Did she register for antenatal care? When? Where?
  3. ANC visits - How many check-ups so far?
  4. Fetal movements - "When did you first feel the baby move?" (Normal: 18-20 weeks in 1st pregnancy, 16-18 weeks in subsequent)
  5. Quickening - first feeling of fetal movement
  6. Immunizations - TT (Tetanus Toxoid) injections given?
  7. Investigations done - Blood group, hemoglobin, ultrasound scans
  8. Complications in this pregnancy - Bleeding, vomiting, swelling of feet, headache, blurred vision, reduced fetal movements, pain
  9. Medications - Iron, folic acid, calcium tablets?

6. Gynecological History

Ask about:
a) Contraception - "Are you using any family planning method?" (Pills, IUCD/copper T, injections, barrier methods, tubectomy)
b) Sexual history - Ask sensitively
  • "Are you sexually active?"
  • Any pain during intercourse (dyspareunia)?
  • Any bleeding after sex (post-coital bleeding)?
c) Vaginal discharge - Color? Smell? Amount? Associated itching? Duration?
  • White, curdy = Candida (fungal)
  • Yellow/green, frothy = Trichomonas
  • Grayish, fishy smell = Bacterial Vaginosis
d) Previous gynecological problems - Ovarian cysts, fibroids, pelvic inflammatory disease (PID)
e) Previous gynecological surgeries - Any operation on uterus, ovaries, tubes?
  • D&C (dilation and curettage)
  • Hysterectomy (removal of uterus)
  • Myomectomy (removal of fibroids)
f) Cervical smear / Pap smear - Any screening done?
g) Infertility - Primary (never conceived) or Secondary (had a pregnancy before but unable now)? Duration? Any treatment?

7. Past Medical History

Ask about:
  • Hypertension (very important - Pre-eclampsia risk)
  • Diabetes (Gestational diabetes, macrosomia risk)
  • Thyroid disease
  • Tuberculosis (can cause infertility, Asherman's syndrome)
  • Previous surgeries (especially abdominal/pelvic - adhesion risk)
  • Blood transfusions (any reactions?)
  • Epilepsy (drugs affect fetus)
  • Anemia

8. Drug History

  • Current medications (especially teratogenic drugs like thalidomide, valproate, ACE inhibitors - dangerous in pregnancy)
  • Folic acid supplementation
  • Iron tablets
  • Any allergies to medicines?

9. Family History

  • High blood pressure in family?
  • Diabetes
  • Twins (hereditary)
  • Cancer (especially breast, ovarian, endometrial - important!)
  • Congenital abnormalities / genetic disorders

10. Personal and Social History

  • Diet - vegetarian/non-vegetarian, any nutritional deficiencies?
  • Occupation - any heavy physical work, chemical exposure?
  • Smoking - very important (preterm labor, placental abruption, IUGR risk)
  • Alcohol - Fetal Alcohol Syndrome
  • Socioeconomic status - affects nutrition, access to healthcare
  • Stress levels
  • Education - affects health literacy and compliance

Quick Summary Card for the Ward

BIODATA → CHIEF COMPLAINT → HPI (SOCRATES)
    ↓
MENSTRUAL HISTORY: Menarche | Cycle | Flow | LMP | Dysmenorrhea | Regularity
    ↓
OBSTETRIC HISTORY: G__P__A__L__ → details of each pregnancy
    ↓                (current pregnancy: LMP, EDD, ANC, movements, complications)
GYNECOLOGICAL HISTORY: Contraception | Discharge | Dyspareunia | Surgeries
    ↓
PAST MEDICAL | DRUGS | FAMILY | SOCIAL HISTORY

Tips for Your First Day

  1. Always ask LMP - even before you ask anything else in OB/GYN. It orients everything.
  2. Be sensitive and non-judgmental - sexual history, infertility, and pregnancy losses are emotionally charged topics. Speak softly.
  3. Take history in the local language if English confuses the patient. Your seniors will respect this.
  4. Write G_P_A_L_ at the top of every OB/GYN case sheet clearly.
  5. Calculate gestational age from LMP on the spot - shows initiative.
  6. In a labor ward patient, focus on: current pregnancy details + previous deliveries + any complications.
  7. In a gynecology patient (non-pregnant), menstrual history and gynecological history are the main focus.

Based on Berek & Novak's Gynecology and Creasy & Resnik's Maternal-Fetal Medicine

You are going to do great tomorrow! The staff and seniors know you're a 3rd year just starting - they don't expect you to know everything, just to ask the right questions politely and systematically. Good luck! 🩺

Create a printable quick reference sheet for OB/GYN history taking

Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null || mkdir -p /home/daytona/workspace/obgyn-reference

Running Command

mkdir -p /home/daytona/workspace/obgyn-reference && ls /home/daytona/workspace/

Writing File

~/obgyn-reference/create_reference.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import PageBreak

OUTPUT = "/home/daytona/workspace/obgyn-reference/OBGYN_History_Quick_Reference.pdf"

# ── Colour palette ──────────────────────────────────────────────────────────
TEAL       = colors.HexColor("#0D7377")
TEAL_LIGHT = colors.HexColor("#C8E6E7")
TEAL_MID   = colors.HexColor("#14A085")
PINK       = colors.HexColor("#C0392B")
PINK_LIGHT = colors.HexColor("#FADBD8")
ORANGE     = colors.HexColor("#E67E22")
ORANGE_LT  = colors.HexColor("#FDEBD0")
PURPLE     = colors.HexColor("#6C3483")
PURPLE_LT  = colors.HexColor("#E8DAEF")
GREEN      = colors.HexColor("#1E8449")
GREEN_LT   = colors.HexColor("#D5F5E3")
GREY_DARK  = colors.HexColor("#2C3E50")
GREY_MID   = colors.HexColor("#5D6D7E")
GREY_LIGHT = colors.HexColor("#EAF2F8")
WHITE      = colors.white
YELLOW_LT  = colors.HexColor("#FEF9E7")

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=12*mm, rightMargin=12*mm,
    topMargin=10*mm, bottomMargin=10*mm
)

W = A4[0] - 24*mm   # usable width

styles = getSampleStyleSheet()

def S(name, **kw):
    return ParagraphStyle(name, **kw)

# ── Custom styles ────────────────────────────────────────────────────────────
title_style = S("TitleStyle",
    fontSize=20, textColor=WHITE, fontName="Helvetica-Bold",
    alignment=TA_CENTER, spaceAfter=2)

subtitle_style = S("SubTitle",
    fontSize=9, textColor=TEAL_LIGHT, fontName="Helvetica",
    alignment=TA_CENTER, spaceAfter=0)

section_h = S("SectionH",
    fontSize=8.5, textColor=WHITE, fontName="Helvetica-Bold",
    alignment=TA_LEFT, leftPadding=4, spaceAfter=0)

item_style = S("Item",
    fontSize=7.5, textColor=GREY_DARK, fontName="Helvetica",
    leading=11, leftIndent=6)

bold_item = S("BoldItem",
    fontSize=7.5, textColor=GREY_DARK, fontName="Helvetica-Bold",
    leading=11, leftIndent=6)

tip_style = S("Tip",
    fontSize=7, textColor=PURPLE, fontName="Helvetica-Oblique",
    leading=10, leftIndent=4)

note_style = S("Note",
    fontSize=7, textColor=GREEN, fontName="Helvetica-Bold",
    leading=10, leftIndent=4)

formula_style = S("Formula",
    fontSize=7.5, textColor=PINK, fontName="Helvetica-Bold",
    leading=11, leftIndent=4)

small_center = S("SmallCenter",
    fontSize=6.5, textColor=GREY_MID, fontName="Helvetica",
    alignment=TA_CENTER)

# ── Helper: coloured section header ─────────────────────────────────────────
def section_header(text, color=TEAL):
    return Table(
        [[Paragraph(text, section_h)]],
        colWidths=[W],
        style=TableStyle([
            ("BACKGROUND", (0,0), (-1,-1), color),
            ("LEFTPADDING",  (0,0), (-1,-1), 6),
            ("RIGHTPADDING", (0,0), (-1,-1), 6),
            ("TOPPADDING",   (0,0), (-1,-1), 3),
            ("BOTTOMPADDING",(0,0), (-1,-1), 3),
            ("ROUNDEDCORNERS", [3]),
        ])
    )

def bullet(text, style=item_style, symbol="▸"):
    return Paragraph(f"{symbol}  {text}", style)

def subbullet(text):
    s = S("Sub", fontSize=7, textColor=GREY_MID, fontName="Helvetica",
          leading=10, leftIndent=14)
    return Paragraph(f"–  {text}", s)

def sp(h=2):
    return Spacer(1, h*mm)

def box_table(rows, col_widths, header_color=TEAL, row_bg=GREY_LIGHT):
    """A simple two-column info table."""
    data = []
    for i, row in enumerate(rows):
        data.append([Paragraph(row[0], bold_item), Paragraph(row[1], item_style)])
    ts = TableStyle([
        ("BACKGROUND",    (0,0), (-1,0),  header_color),
        ("TEXTCOLOR",     (0,0), (-1,0),  WHITE),
        ("FONTNAME",      (0,0), (-1,0),  "Helvetica-Bold"),
        ("FONTSIZE",      (0,0), (-1,-1), 7.5),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, GREY_LIGHT]),
        ("GRID",          (0,0), (-1,-1), 0.3, colors.HexColor("#BFC9CA")),
        ("TOPPADDING",    (0,0), (-1,-1), 2),
        ("BOTTOMPADDING", (0,0), (-1,-1), 2),
        ("LEFTPADDING",   (0,0), (-1,-1), 5),
    ])
    return Table(data, colWidths=col_widths, style=ts, hAlign="LEFT")

# ════════════════════════════════════════════════════════════════════════════
# BUILD CONTENT
# ════════════════════════════════════════════════════════════════════════════
story = []

# ── TITLE BANNER ─────────────────────────────────────────────────────────────
title_table = Table(
    [[Paragraph("🩺  OB/GYN History Taking", title_style)],
     [Paragraph("Quick Reference Sheet  ·  3rd Year MBBS  ·  Obstetrics & Gynecology Posting", subtitle_style)]],
    colWidths=[W],
    style=TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), TEAL),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
        ("ROUNDEDCORNERS", [5]),
    ])
)
story.append(title_table)
story.append(sp(3))

# ── TOP OVERVIEW ROW ─────────────────────────────────────────────────────────
overview_data = [[
    Paragraph("<b>STRUCTURE OF OB/GYN HISTORY</b>", S("ov", fontSize=7.5, fontName="Helvetica-Bold", textColor=TEAL)),
]]
steps = [
    "① Biodata", "② Chief Complaint", "③ HPI (SOCRATES)",
    "④ Menstrual Hx", "⑤ Obstetric Hx", "⑥ Gynae Hx",
    "⑦ Past Medical Hx", "⑧ Drug Hx", "⑨ Family Hx", "⑩ Social Hx"
]
step_cells = [Paragraph(s, S("step", fontSize=7, fontName="Helvetica-Bold",
              textColor=WHITE, alignment=TA_CENTER)) for s in steps]

flow_table = Table(
    [step_cells],
    colWidths=[W/10]*10,
    style=TableStyle([
        ("BACKGROUND",    (0,0), (2,0),  TEAL),
        ("BACKGROUND",    (3,0), (5,0),  TEAL_MID),
        ("BACKGROUND",    (6,0), (9,0),  TEAL),
        ("TOPPADDING",    (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("GRID",          (0,0), (-1,-1), 0.5, WHITE),
    ])
)
story.append(flow_table)
story.append(sp(3))

# ── TWO-COLUMN LAYOUT ────────────────────────────────────────────────────────
# Left column width ~48%, Right ~48%, gap 4%
LW = W * 0.485
RW = W * 0.485
GAP = W * 0.03

# ════ LEFT COLUMN CONTENT ════
left = []

# 1. BIODATA
left.append(section_header("① BIODATA", TEAL))
left.append(sp(1))
for item in [
    "Name, Age, Address",
    "Occupation (patient & husband)",
    "Religion & marital status",
    "Duration of marriage",
]:
    left.append(bullet(item))
left.append(sp(2))

# 2. CHIEF COMPLAINT
left.append(section_header("② CHIEF COMPLAINT  – Common OB/GYN Complaints", TEAL_MID))
left.append(sp(1))
cc_data = [
    ["Abdominal / pelvic pain", "Vaginal bleeding"],
    ["Vaginal discharge", "Missed period (amenorrhea)"],
    ["Infertility", "Swelling in abdomen"],
    ["Leaking urine", "Post-menopausal bleeding ⚠"],
    ["Labor pains", "Nausea / vomiting in pregnancy"],
]
cc_t = Table(cc_data,
    colWidths=[LW*0.5, LW*0.5],
    style=TableStyle([
        ("FONTNAME",      (0,0), (-1,-1), "Helvetica"),
        ("FONTSIZE",      (0,0), (-1,-1), 7),
        ("TEXTCOLOR",     (0,0), (-1,-1), GREY_DARK),
        ("ROWBACKGROUNDS",(0,0), (-1,-1), [WHITE, GREY_LIGHT]),
        ("GRID",          (0,0), (-1,-1), 0.3, colors.HexColor("#BFC9CA")),
        ("TOPPADDING",    (0,0), (-1,-1), 1.5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 1.5),
        ("LEFTPADDING",   (0,0), (-1,-1), 5),
        ("TEXTCOLOR",     (1,3), (1,3),   PINK),
        ("FONTNAME",      (1,3), (1,3),   "Helvetica-Bold"),
    ])
)
left.append(cc_t)
left.append(sp(2))

# 3. HPI - SOCRATES
left.append(section_header("③ HPI — Use SOCRATES", ORANGE))
left.append(sp(1))
socrates = [
    ["S", "Site", "Where exactly is the pain/symptom?"],
    ["O", "Onset", "Sudden or gradual? When did it start?"],
    ["C", "Character", "Crampy, burning, dull, sharp?"],
    ["R", "Radiation", "Does it spread anywhere?"],
    ["A", "Associated", "Fever, vomiting, discharge, bleeding?"],
    ["T", "Timing", "Constant or intermittent? Related to cycle?"],
    ["E", "Exacerbating", "What makes it better or worse?"],
    ["S", "Severity", "Rate 1–10. Effect on daily life?"],
]
soc_style = TableStyle([
    ("FONTSIZE",      (0,0), (-1,-1), 7),
    ("FONTNAME",      (0,0), (-1,-1), "Helvetica"),
    ("FONTNAME",      (0,0), (0,-1),  "Helvetica-Bold"),
    ("TEXTCOLOR",     (0,0), (0,-1),  ORANGE),
    ("TEXTCOLOR",     (1,0), (1,-1),  GREY_DARK),
    ("TEXTCOLOR",     (2,0), (2,-1),  GREY_MID),
    ("ROWBACKGROUNDS",(0,0), (-1,-1), [ORANGE_LT, WHITE]),
    ("GRID",          (0,0), (-1,-1), 0.3, colors.HexColor("#F0D9C0")),
    ("TOPPADDING",    (0,0), (-1,-1), 1.5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 1.5),
    ("LEFTPADDING",   (0,0), (-1,-1), 4),
])
soc_table = Table(
    [[Paragraph(r[0], S("sc", fontSize=7.5, fontName="Helvetica-Bold", textColor=ORANGE)),
      Paragraph(r[1], S("sc2", fontSize=7.5, fontName="Helvetica-Bold", textColor=GREY_DARK)),
      Paragraph(r[2], S("sc3", fontSize=7, textColor=GREY_MID))] for r in socrates],
    colWidths=[LW*0.07, LW*0.23, LW*0.70],
    style=soc_style
)
left.append(soc_table)
left.append(sp(2))

# 4. MENSTRUAL HISTORY
left.append(section_header("④ MENSTRUAL HISTORY  (Ask in EVERY patient)", PINK))
left.append(sp(1))
mh_items = [
    ("<b>Age of Menarche</b>", "Normal: 10–16 years"),
    ("<b>Cycle</b> (Duration / Length)", "e.g. 4–5 days / 28 days  ← write this format"),
    ("<b>Flow amount</b>", "Pads per day (normal: 3–5). Clots? Flooding?"),
    ("<b>LMP</b> (Last Menstrual Period)", "DATE — always note this first!"),
    ("<b>Regularity</b>", "Regular or irregular?"),
    ("<b>Dysmenorrhea</b>", "Pain during periods? Primary or secondary?"),
    ("<b>Intermenstrual bleeding</b>", "Any bleeding between periods?"),
    ("<b>Post-coital bleeding</b>", "⚠ Bleeding after sex → cervical pathology"),
    ("<b>Menopause</b>", "Age of menopause? Any post-menopausal bleeding?"),
]
mh_t = Table(
    [[Paragraph(r[0], S("mhl", fontSize=7.5, fontName="Helvetica-Bold", textColor=GREY_DARK)),
      Paragraph(r[1], S("mhr", fontSize=7, textColor=GREY_MID))] for r in mh_items],
    colWidths=[LW*0.38, LW*0.62],
    style=TableStyle([
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [PINK_LIGHT, WHITE]),
        ("GRID",           (0,0), (-1,-1), 0.3, colors.HexColor("#F1B8B3")),
        ("TOPPADDING",     (0,0), (-1,-1), 2),
        ("BOTTOMPADDING",  (0,0), (-1,-1), 2),
        ("LEFTPADDING",    (0,0), (-1,-1), 5),
        ("TEXTCOLOR",      (1,5), (1,5),   PINK),
        ("FONTNAME",       (1,5), (1,5),   "Helvetica-Bold"),
    ])
)
left.append(mh_t)
left.append(sp(1))

# EDD formula box
edd_box = Table(
    [[Paragraph("📅  EDD (Naegele's Rule) = LMP  +  9 months  +  7 days   |   OR:  subtract 3 months, add 7 days to LMP",
       S("edd", fontSize=7.5, fontName="Helvetica-Bold", textColor=TEAL))]],
    colWidths=[LW],
    style=TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), TEAL_LIGHT),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("ROUNDEDCORNERS", [3]),
    ])
)
left.append(edd_box)
left.append(sp(2))

# 7. PAST MEDICAL HISTORY
left.append(section_header("⑦ PAST MEDICAL HISTORY", GREY_DARK))
left.append(sp(1))
pmh = [
    "Hypertension → Pre-eclampsia risk",
    "Diabetes → GDM, macrosomia risk",
    "Thyroid disease",
    "Tuberculosis → Infertility, Asherman's syndrome",
    "Epilepsy → Teratogenic drugs (valproate)",
    "Previous abdominal / pelvic surgeries",
    "Blood transfusions (any reactions?)",
    "Anemia",
]
for item in pmh:
    left.append(bullet(item))
left.append(sp(2))

# 8. DRUG HISTORY
left.append(section_header("⑧ DRUG HISTORY", GREY_DARK))
left.append(sp(1))
drug_box = Table([[
    Paragraph("⚠ Teratogenic Drugs to ASK about:", S("dh", fontSize=7.5, fontName="Helvetica-Bold", textColor=PINK)),
    Paragraph("Valproate  ·  ACE inhibitors  ·  Warfarin  ·  Tetracycline  ·  Thalidomide",
              S("dh2", fontSize=7, textColor=GREY_DARK))
]],
    colWidths=[LW*0.38, LW*0.62],
    style=TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), PINK_LIGHT),
        ("TOPPADDING",    (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("LEFTPADDING",   (0,0), (-1,-1), 5),
        ("GRID",          (0,0), (-1,-1), 0, WHITE),
    ])
)
left.append(drug_box)
left.append(sp(1))
for item in ["Folic acid & Iron supplementation?", "Calcium / Vitamin D?", "Any drug allergies?"]:
    left.append(bullet(item))
left.append(sp(2))

# 9 & 10. FAMILY + SOCIAL
left.append(section_header("⑨ FAMILY HISTORY", GREY_DARK))
left.append(sp(1))
for item in ["HTN, Diabetes, Twins (hereditary)", "Cancers: breast, ovarian, endometrial ⚠", "Congenital abnormalities / genetic disorders"]:
    left.append(bullet(item))
left.append(sp(2))

left.append(section_header("⑩ PERSONAL & SOCIAL HISTORY", GREY_DARK))
left.append(sp(1))
social_data = [
    ["Diet", "Veg/Non-veg, nutritional deficiencies?"],
    ["Occupation", "Heavy work, chemical exposure?"],
    ["Smoking", "⚠ Preterm labor, abruption, IUGR"],
    ["Alcohol", "Fetal Alcohol Syndrome risk"],
    ["Socioeconomic", "Affects nutrition & healthcare access"],
    ["Education", "Health literacy & compliance"],
]
soc_t = Table(
    [[Paragraph(r[0], S("sl", fontSize=7.5, fontName="Helvetica-Bold", textColor=GREY_DARK)),
      Paragraph(r[1], S("sr", fontSize=7, textColor=GREY_MID))] for r in social_data],
    colWidths=[LW*0.32, LW*0.68],
    style=TableStyle([
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [GREY_LIGHT, WHITE]),
        ("GRID",           (0,0), (-1,-1), 0.3, colors.HexColor("#BDC3C7")),
        ("TOPPADDING",     (0,0), (-1,-1), 2),
        ("BOTTOMPADDING",  (0,0), (-1,-1), 2),
        ("LEFTPADDING",    (0,0), (-1,-1), 5),
    ])
)
left.append(soc_t)

# ════ RIGHT COLUMN CONTENT ════
right = []

# 5. OBSTETRIC HISTORY
right.append(section_header("⑤ OBSTETRIC HISTORY", GREEN))
right.append(sp(1))

# GPAL box
gpal = Table([[
    Paragraph("<b>G</b>", S("gp", fontSize=11, fontName="Helvetica-Bold", textColor=TEAL, alignment=TA_CENTER)),
    Paragraph("Gravida\nAll pregnancies", S("gpd", fontSize=6.5, textColor=GREY_DARK, alignment=TA_CENTER)),
    Paragraph("<b>P</b>", S("gp", fontSize=11, fontName="Helvetica-Bold", textColor=GREEN, alignment=TA_CENTER)),
    Paragraph("Para\nDeliveries ≥28 wks", S("gpd", fontSize=6.5, textColor=GREY_DARK, alignment=TA_CENTER)),
    Paragraph("<b>A</b>", S("gp", fontSize=11, fontName="Helvetica-Bold", textColor=ORANGE, alignment=TA_CENTER)),
    Paragraph("Abortion\nLoss <28 wks", S("gpd", fontSize=6.5, textColor=GREY_DARK, alignment=TA_CENTER)),
    Paragraph("<b>L</b>", S("gp", fontSize=11, fontName="Helvetica-Bold", textColor=PURPLE, alignment=TA_CENTER)),
    Paragraph("Living\nChildren alive", S("gpd", fontSize=6.5, textColor=GREY_DARK, alignment=TA_CENTER)),
]],
    colWidths=[RW*0.07, RW*0.18, RW*0.07, RW*0.18, RW*0.07, RW*0.18, RW*0.07, RW*0.18],
    style=TableStyle([
        ("BACKGROUND",    (0,0), (1,0),  GREEN_LT),
        ("BACKGROUND",    (2,0), (3,0),  GREEN_LT),
        ("BACKGROUND",    (4,0), (5,0),  ORANGE_LT),
        ("BACKGROUND",    (6,0), (7,0),  PURPLE_LT),
        ("ALIGN",         (0,0), (-1,-1), "CENTER"),
        ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("GRID",          (0,0), (-1,-1), 0.5, WHITE),
    ])
)
right.append(gpal)
right.append(sp(1))
eg_box = Table([[
    Paragraph("Example:  <b>G3P2A1L2</b>  =  3 pregnancies total  |  2 deliveries  |  1 miscarriage  |  2 children alive",
              S("eg", fontSize=7.5, fontName="Helvetica", textColor=PURPLE))
]], colWidths=[RW],
    style=TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), PURPLE_LT),
        ("TOPPADDING",    (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
    ])
)
right.append(eg_box)
right.append(sp(2))

right.append(Paragraph("<b>For EACH previous pregnancy, ask:</b>",
    S("ph", fontSize=7.5, fontName="Helvetica-Bold", textColor=GREEN)))
right.append(sp(1))
prev_preg = [
    "Year & duration of pregnancy (weeks)",
    "Type of delivery: Normal vaginal / C-section / Instrumental (forceps / vacuum)",
    "Place: Hospital or home delivery?",
    "Baby's weight, sex, current health status",
    "Complications during pregnancy (BP, diabetes, bleeding, fits)",
    "Post-partum complications (PPH, infection, ICU admission)",
    "If miscarriage: weeks of gestation? D&C done?",
]
for item in prev_preg:
    right.append(bullet(item))
right.append(sp(2))

# Current pregnancy box
right.append(section_header("  CURRENT PREGNANCY (Antenatal History)", GREEN))
right.append(sp(1))
anc = [
    ["LMP & EDD", "Calculate gestational age right away"],
    ["Booking", "When & where was first ANC visit?"],
    ["ANC visits", "Total number of check-ups so far?"],
    ["Fetal movements", "1st pregnancy: ~20 wks  |  2nd+: ~18 wks"],
    ["Immunizations", "TT injections given?"],
    ["Investigations", "Blood group, Hb, USS scans done?"],
    ["Complications", "Bleeding, vomiting, swelling, headache, fits, ↓fetal movements"],
    ["Medications", "Iron, Folic acid, Calcium given?"],
]
anc_t = Table(
    [[Paragraph(r[0], S("al", fontSize=7.5, fontName="Helvetica-Bold", textColor=GREEN)),
      Paragraph(r[1], S("ar", fontSize=7, textColor=GREY_MID))] for r in anc],
    colWidths=[RW*0.30, RW*0.70],
    style=TableStyle([
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [GREEN_LT, WHITE]),
        ("GRID",           (0,0), (-1,-1), 0.3, colors.HexColor("#A9DFBF")),
        ("TOPPADDING",     (0,0), (-1,-1), 2),
        ("BOTTOMPADDING",  (0,0), (-1,-1), 2),
        ("LEFTPADDING",    (0,0), (-1,-1), 5),
    ])
)
right.append(anc_t)
right.append(sp(2))

# 6. GYNECOLOGICAL HISTORY
right.append(section_header("⑥ GYNECOLOGICAL HISTORY", PURPLE))
right.append(sp(1))

gynaec = [
    ("<b>Contraception</b>", "Pills / IUCD (Copper-T) / Injections / Barrier / Tubectomy"),
    ("<b>Sexual history</b>", "Sexually active? Dyspareunia (pain during sex)?"),
    ("<b>Post-coital bleeding</b>", "⚠ Bleeding after sex → think cervical pathology"),
    ("<b>Vaginal discharge</b>", "Color, smell, amount, itching, duration"),
    ("<b>Previous Gynae problems</b>", "Ovarian cysts, fibroids, PID, endometriosis"),
    ("<b>Gynae surgeries</b>", "D&C, hysterectomy, myomectomy, laparoscopy"),
    ("<b>Pap smear / HPV</b>", "Any cervical cancer screening done?"),
    ("<b>Infertility</b>", "Primary (never conceived) or Secondary? Duration? Treatment?"),
]
g_t = Table(
    [[Paragraph(r[0], S("gl", fontSize=7.5, fontName="Helvetica")),
      Paragraph(r[1], S("gr", fontSize=7, textColor=GREY_MID))] for r in gynaec],
    colWidths=[RW*0.32, RW*0.68],
    style=TableStyle([
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [PURPLE_LT, WHITE]),
        ("GRID",           (0,0), (-1,-1), 0.3, colors.HexColor("#D2B4DE")),
        ("TOPPADDING",     (0,0), (-1,-1), 2),
        ("BOTTOMPADDING",  (0,0), (-1,-1), 2),
        ("LEFTPADDING",    (0,0), (-1,-1), 5),
    ])
)
right.append(g_t)
right.append(sp(2))

# VAGINAL DISCHARGE MINI BOX
right.append(Paragraph("<b>Vaginal Discharge Quick Clues:</b>",
    S("vdh", fontSize=7.5, fontName="Helvetica-Bold", textColor=PURPLE)))
right.append(sp(1))
vd = [
    ["White, curdy, itchy", "→ Candida (Fungal)"],
    ["Yellow/green, frothy, fishy", "→ Trichomonas"],
    ["Grey, fishy smell (no itch)", "→ Bacterial Vaginosis"],
    ["Mucopurulent, cervicitis", "→ Gonorrhea / Chlamydia"],
]
vd_t = Table(
    [[Paragraph(r[0], S("vl", fontSize=7, fontName="Helvetica", textColor=GREY_DARK)),
      Paragraph(r[1], S("vr", fontSize=7, fontName="Helvetica-Bold", textColor=PURPLE))] for r in vd],
    colWidths=[RW*0.52, RW*0.48],
    style=TableStyle([
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [PURPLE_LT, WHITE]),
        ("GRID",           (0,0), (-1,-1), 0.3, colors.HexColor("#D2B4DE")),
        ("TOPPADDING",     (0,0), (-1,-1), 2),
        ("BOTTOMPADDING",  (0,0), (-1,-1), 2),
        ("LEFTPADDING",    (0,0), (-1,-1), 5),
    ])
)
right.append(vd_t)
right.append(sp(2))

# TIPS BOX
tips_box = Table([[
    Paragraph(
        "💡 WARD TIPS   ·   Always ask LMP first   ·   Write GPAL clearly at top of case sheet   "
        "·   Calculate gestational age on the spot   ·   Be gentle when asking about pregnancy losses   "
        "·   ⚠ Post-menopausal bleeding = always investigate   ·   ⚠ Post-coital bleeding = cervical cause until proven otherwise",
        S("tips", fontSize=7, fontName="Helvetica-Oblique", textColor=TEAL))
]], colWidths=[RW],
    style=TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), TEAL_LIGHT),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("ROUNDEDCORNERS", [3]),
    ])
)
right.append(tips_box)

# ── ASSEMBLE TWO COLUMNS ──────────────────────────────────────────────────────
from reportlab.platypus import Frame, BaseDocTemplate, PageTemplate
from io import BytesIO
from reportlab.platypus import FrameBreak

# Build as a single-row two-column table
left_cell  = [item for item in left]
right_cell = [item for item in right]

two_col = Table(
    [[left_cell, Spacer(GAP, 1), right_cell]],
    colWidths=[LW, GAP, RW],
    style=TableStyle([
        ("VALIGN", (0,0), (-1,-1), "TOP"),
        ("LEFTPADDING",  (0,0), (-1,-1), 0),
        ("RIGHTPADDING", (0,0), (-1,-1), 0),
        ("TOPPADDING",   (0,0), (-1,-1), 0),
        ("BOTTOMPADDING",(0,0), (-1,-1), 0),
    ])
)
story.append(two_col)
story.append(sp(3))

# FOOTER
footer_text = (
    "Based on Berek &amp; Novak's Gynecology and Creasy &amp; Resnik's Maternal-Fetal Medicine  ·  "
    "Prepared for 3rd Year MBBS OB/GYN Posting  ·  June 2026"
)
story.append(HRFlowable(width=W, thickness=0.5, color=TEAL))
story.append(sp(1))
story.append(Paragraph(footer_text, small_center))

doc.build(story)
print(f"PDF created: {OUTPUT}")
Running Command

cd /home/daytona/workspace/obgyn-reference && python create_reference.py 2>&1

Writing File

~/obgyn-reference/create_reference.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable
)
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT

OUTPUT = "/home/daytona/workspace/obgyn-reference/OBGYN_History_Quick_Reference.pdf"

# ── Colour palette ──────────────────────────────────────────────────────────
TEAL       = colors.HexColor("#0D7377")
TEAL_LIGHT = colors.HexColor("#C8E6E7")
TEAL_MID   = colors.HexColor("#14A085")
PINK       = colors.HexColor("#C0392B")
PINK_LIGHT = colors.HexColor("#FADBD8")
ORANGE     = colors.HexColor("#E67E22")
ORANGE_LT  = colors.HexColor("#FDEBD0")
PURPLE     = colors.HexColor("#6C3483")
PURPLE_LT  = colors.HexColor("#E8DAEF")
GREEN      = colors.HexColor("#1E8449")
GREEN_LT   = colors.HexColor("#D5F5E3")
GREY_DARK  = colors.HexColor("#2C3E50")
GREY_MID   = colors.HexColor("#5D6D7E")
GREY_LIGHT = colors.HexColor("#EAF2F8")
WHITE      = colors.white

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=10*mm, rightMargin=10*mm,
    topMargin=8*mm, bottomMargin=8*mm
)

W = A4[0] - 20*mm   # usable width  (~575 pt)
LW = W * 0.485
RW = W * 0.485
GAP = W * 0.03

def S(name, **kw):
    return ParagraphStyle(name, **kw)

def hdr(text, color=TEAL):
    """Coloured section header bar."""
    p = Paragraph(text, S("h", fontSize=7.5, textColor=WHITE,
                           fontName="Helvetica-Bold", leftPadding=4))
    t = Table([[p]], colWidths=[999],
              style=TableStyle([
                  ("BACKGROUND",    (0,0),(-1,-1), color),
                  ("TOPPADDING",    (0,0),(-1,-1), 2),
                  ("BOTTOMPADDING", (0,0),(-1,-1), 2),
                  ("LEFTPADDING",   (0,0),(-1,-1), 5),
              ]))
    return t

def sp(h=2):
    return Spacer(1, h*mm)

def bullet(text, clr=GREY_DARK):
    return Paragraph(f"▸  {text}",
        S("b", fontSize=6.8, textColor=clr, fontName="Helvetica", leading=10, leftIndent=5))

def two_col_table(rows, cw, row_colors, grid_color):
    data = [[Paragraph(r[0], S("L", fontSize=7, fontName="Helvetica-Bold", textColor=GREY_DARK)),
             Paragraph(r[1], S("R", fontSize=6.5, textColor=GREY_MID))] for r in rows]
    ts = TableStyle([
        ("ROWBACKGROUNDS", (0,0),(-1,-1), row_colors),
        ("GRID",           (0,0),(-1,-1), 0.3, grid_color),
        ("TOPPADDING",     (0,0),(-1,-1), 1.5),
        ("BOTTOMPADDING",  (0,0),(-1,-1), 1.5),
        ("LEFTPADDING",    (0,0),(-1,-1), 4),
    ])
    return Table(data, colWidths=cw, style=ts)

# ════════════════════════════════════════════════════════════════════════════
# TITLE BANNER
# ════════════════════════════════════════════════════════════════════════════
story = []

title_t = Table([
    [Paragraph("OB/GYN History Taking — Quick Reference Sheet",
               S("T", fontSize=16, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER))],
    [Paragraph("3rd Year MBBS  ·  Obstetrics & Gynecology Posting",
               S("ST", fontSize=8, textColor=TEAL_LIGHT, fontName="Helvetica", alignment=TA_CENTER))],
], colWidths=[W],
    style=TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), TEAL),
        ("TOPPADDING",    (0,0),(-1,-1), 5),
        ("BOTTOMPADDING", (0,0),(-1,-1), 5),
    ]))
story.append(title_t)
story.append(sp(2))

# HISTORY STRUCTURE FLOW BAR
steps = ["① Biodata","② Chief Complaint","③ HPI","④ Menstrual Hx",
         "⑤ Obstetric Hx","⑥ Gynae Hx","⑦ Past Medical","⑧ Drugs","⑨ Family","⑩ Social"]
cells = [Paragraph(s, S("fl", fontSize=6.2, fontName="Helvetica-Bold",
                         textColor=WHITE, alignment=TA_CENTER)) for s in steps]
flow_t = Table([cells], colWidths=[W/10]*10,
    style=TableStyle([
        ("BACKGROUND",    (0,0),(3,0), TEAL),
        ("BACKGROUND",    (4,0),(5,0), TEAL_MID),
        ("BACKGROUND",    (6,0),(9,0), TEAL),
        ("TOPPADDING",    (0,0),(-1,-1), 3),
        ("BOTTOMPADDING", (0,0),(-1,-1), 3),
        ("GRID",          (0,0),(-1,-1), 0.5, WHITE),
    ]))
story.append(flow_t)
story.append(sp(2))

# ════════════════════════════════════════════════════════════════════════════
# LEFT COLUMN
# ════════════════════════════════════════════════════════════════════════════
left = []

# ① BIODATA
left.append(hdr("① BIODATA", TEAL))
for item in ["Name, Age, Address",
             "Occupation (patient & husband)",
             "Religion, marital status, duration of marriage"]:
    left.append(bullet(item))
left.append(sp(1.5))

# ② CHIEF COMPLAINT
left.append(hdr("② COMMON OB/GYN COMPLAINTS", TEAL_MID))
cc = [["Abdominal/pelvic pain","Vaginal bleeding"],
      ["Vaginal discharge","Amenorrhea (missed period)"],
      ["Infertility","Swelling in abdomen"],
      ["Leaking urine","Post-menopausal bleeding ⚠"],
      ["Labor pains","Nausea/vomiting in pregnancy"]]
cc_t = Table(cc, colWidths=[LW*0.5,LW*0.5],
    style=TableStyle([
        ("FONTNAME",      (0,0),(-1,-1), "Helvetica"),
        ("FONTSIZE",      (0,0),(-1,-1), 6.5),
        ("TEXTCOLOR",     (0,0),(-1,-1), GREY_DARK),
        ("ROWBACKGROUNDS",(0,0),(-1,-1), [WHITE, GREY_LIGHT]),
        ("GRID",          (0,0),(-1,-1), 0.3, colors.HexColor("#BFC9CA")),
        ("TOPPADDING",    (0,0),(-1,-1), 1.5),
        ("BOTTOMPADDING", (0,0),(-1,-1), 1.5),
        ("LEFTPADDING",   (0,0),(-1,-1), 4),
        ("TEXTCOLOR",     (1,3),(1,3),   PINK),
        ("FONTNAME",      (1,3),(1,3),   "Helvetica-Bold"),
    ]))
left.append(cc_t)
left.append(sp(1.5))

# ③ HPI SOCRATES
left.append(hdr("③ HPI — SOCRATES", ORANGE))
soc = [["S","Site","Where exactly?"],
       ["O","Onset","Sudden or gradual?"],
       ["C","Character","Crampy / burning / dull?"],
       ["R","Radiation","Spreads anywhere?"],
       ["A","Associated","Fever, vomiting, discharge?"],
       ["T","Timing","Constant? Related to cycle?"],
       ["E","Exacerbating","Better / worse with?"],
       ["S","Severity","Rate 1-10?"]]
soc_t = Table(
    [[Paragraph(r[0], S("s1", fontSize=7.5, fontName="Helvetica-Bold", textColor=ORANGE)),
      Paragraph(r[1], S("s2", fontSize=7, fontName="Helvetica-Bold", textColor=GREY_DARK)),
      Paragraph(r[2], S("s3", fontSize=6.5, textColor=GREY_MID))] for r in soc],
    colWidths=[LW*0.07, LW*0.22, LW*0.71],
    style=TableStyle([
        ("ROWBACKGROUNDS",(0,0),(-1,-1), [ORANGE_LT, WHITE]),
        ("GRID",         (0,0),(-1,-1), 0.3, colors.HexColor("#F0D9C0")),
        ("TOPPADDING",   (0,0),(-1,-1), 1.5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 1.5),
        ("LEFTPADDING",  (0,0),(-1,-1), 4),
    ]))
left.append(soc_t)
left.append(sp(1.5))

# ④ MENSTRUAL HISTORY
left.append(hdr("④ MENSTRUAL HISTORY  (Ask in EVERY patient)", PINK))
mh = [["Age of Menarche","Normal: 10-16 years"],
      ["Cycle","Duration/Length e.g. 4-5 days / 28 days"],
      ["Flow","Pads/day (normal 3-5). Clots?"],
      ["LMP","DATE — note this FIRST always!"],
      ["Regularity","Regular or irregular?"],
      ["Dysmenorrhea","Pain with periods? Primary/secondary?"],
      ["IMB","Bleeding between periods?"],
      ["PCB","⚠ Bleeding after sex → cervical cause"],
      ["Menopause","Age? Post-menopausal bleeding?"]]
mh_t = two_col_table(mh, [LW*0.30, LW*0.70], [PINK_LIGHT, WHITE],
                     colors.HexColor("#F1B8B3"))
left.append(mh_t)
left.append(sp(1))

# EDD box
edd = Table([[Paragraph(
    "EDD (Naegele's Rule) = LMP + 9 months + 7 days   (or: subtract 3 months, add 7 days)",
    S("edd", fontSize=7, fontName="Helvetica-Bold", textColor=TEAL))]],
    colWidths=[LW],
    style=TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), TEAL_LIGHT),
        ("TOPPADDING",    (0,0),(-1,-1), 3),
        ("BOTTOMPADDING", (0,0),(-1,-1), 3),
        ("LEFTPADDING",   (0,0),(-1,-1), 5),
    ]))
left.append(edd)
left.append(sp(1.5))

# ⑦ PAST MEDICAL
left.append(hdr("⑦ PAST MEDICAL HISTORY", GREY_DARK))
pmh = ["HTN → Pre-eclampsia risk",
       "Diabetes → GDM, macrosomia",
       "Thyroid disease",
       "TB → Infertility, Asherman's syndrome",
       "Epilepsy → Teratogenic drugs (valproate!)",
       "Previous abdominal/pelvic surgeries",
       "Blood transfusions  ·  Anemia"]
for item in pmh:
    left.append(bullet(item))
left.append(sp(1.5))

# ⑧ DRUG HISTORY
left.append(hdr("⑧ DRUG HISTORY", GREY_DARK))
drug = Table([[
    Paragraph("⚠ Teratogens:", S("dh", fontSize=7, fontName="Helvetica-Bold", textColor=PINK)),
    Paragraph("Valproate · ACE inhibitors · Warfarin · Tetracycline · Thalidomide",
              S("dh2", fontSize=6.5, textColor=GREY_DARK))
]], colWidths=[LW*0.25, LW*0.75],
    style=TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), PINK_LIGHT),
        ("TOPPADDING",    (0,0),(-1,-1), 2),
        ("BOTTOMPADDING", (0,0),(-1,-1), 2),
        ("LEFTPADDING",   (0,0),(-1,-1), 4),
        ("GRID",          (0,0),(-1,-1), 0, WHITE),
    ]))
left.append(drug)
for item in ["Folic acid, Iron, Calcium supplements?", "Any drug allergies?"]:
    left.append(bullet(item))
left.append(sp(1.5))

# ⑨ FAMILY + ⑩ SOCIAL
left.append(hdr("⑨ FAMILY  +  ⑩ SOCIAL HISTORY", GREY_DARK))
fam_soc = [["Family: HTN, DM, Twins (hereditary)",""],
           ["Cancers: Breast, Ovarian, Endometrial ⚠",""],
           ["Congenital abnormalities / genetic d/o",""],
           ["Smoking ⚠ → Preterm, Abruption, IUGR",""],
           ["Alcohol → Fetal Alcohol Syndrome",""],
           ["Occupation: heavy work, chemical exposure?",""]]
fs_t = Table(
    [[Paragraph(r[0], S("fs", fontSize=6.8, textColor=GREY_DARK))] for r in fam_soc],
    colWidths=[LW],
    style=TableStyle([
        ("ROWBACKGROUNDS",(0,0),(-1,-1), [GREY_LIGHT, WHITE]),
        ("GRID",         (0,0),(-1,-1), 0.3, colors.HexColor("#BDC3C7")),
        ("TOPPADDING",   (0,0),(-1,-1), 1.5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 1.5),
        ("LEFTPADDING",  (0,0),(-1,-1), 4),
    ]))
left.append(fs_t)

# ════════════════════════════════════════════════════════════════════════════
# RIGHT COLUMN
# ════════════════════════════════════════════════════════════════════════════
right = []

# ⑤ OBSTETRIC HISTORY — GPAL
right.append(hdr("⑤ OBSTETRIC HISTORY  —  GPAL System", GREEN))
gpal = Table([[
    Paragraph("G", S("gp", fontSize=13, fontName="Helvetica-Bold", textColor=TEAL, alignment=TA_CENTER)),
    Paragraph("Gravida\nAll pregnancies", S("gpd", fontSize=6, textColor=GREY_DARK, alignment=TA_CENTER)),
    Paragraph("P", S("gp", fontSize=13, fontName="Helvetica-Bold", textColor=GREEN, alignment=TA_CENTER)),
    Paragraph("Para\nDeliveries ≥28wks", S("gpd", fontSize=6, textColor=GREY_DARK, alignment=TA_CENTER)),
    Paragraph("A", S("gp", fontSize=13, fontName="Helvetica-Bold", textColor=ORANGE, alignment=TA_CENTER)),
    Paragraph("Abortion\nLoss <28 wks", S("gpd", fontSize=6, textColor=GREY_DARK, alignment=TA_CENTER)),
    Paragraph("L", S("gp", fontSize=13, fontName="Helvetica-Bold", textColor=PURPLE, alignment=TA_CENTER)),
    Paragraph("Living\nChildren alive", S("gpd", fontSize=6, textColor=GREY_DARK, alignment=TA_CENTER)),
]], colWidths=[RW*0.07]*8,
    style=TableStyle([
        ("BACKGROUND",    (0,0),(1,0), GREEN_LT),
        ("BACKGROUND",    (2,0),(3,0), GREEN_LT),
        ("BACKGROUND",    (4,0),(5,0), ORANGE_LT),
        ("BACKGROUND",    (6,0),(7,0), PURPLE_LT),
        ("ALIGN",         (0,0),(-1,-1), "CENTER"),
        ("VALIGN",        (0,0),(-1,-1), "MIDDLE"),
        ("TOPPADDING",    (0,0),(-1,-1), 3),
        ("BOTTOMPADDING", (0,0),(-1,-1), 3),
        ("GRID",          (0,0),(-1,-1), 0.5, WHITE),
    ]))
right.append(gpal)
eg = Table([[Paragraph(
    "Example:  G3P2A1L2  =  3 pregnancies  |  2 deliveries  |  1 miscarriage  |  2 children alive",
    S("eg", fontSize=7, fontName="Helvetica-Bold", textColor=PURPLE))]],
    colWidths=[RW],
    style=TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), PURPLE_LT),
        ("TOPPADDING",    (0,0),(-1,-1), 2),
        ("BOTTOMPADDING", (0,0),(-1,-1), 2),
        ("LEFTPADDING",   (0,0),(-1,-1), 5),
    ]))
right.append(eg)
right.append(sp(1))

right.append(Paragraph("<b>For EACH previous pregnancy, ask:</b>",
    S("ph", fontSize=7, fontName="Helvetica-Bold", textColor=GREEN)))
for item in [
    "Year & duration (weeks) of pregnancy",
    "Type of delivery: Normal / C-section / Instrumental (forceps/vacuum)",
    "Place: Hospital or home?",
    "Baby's weight, sex, current health",
    "Complications: HTN, DM, bleeding, fits",
    "Postpartum: PPH, infection, ICU admission?",
    "Miscarriage: weeks? D&C done?"]:
    right.append(bullet(item, GREEN))
right.append(sp(1.5))

# CURRENT PREGNANCY
right.append(hdr("  CURRENT PREGNANCY  (Antenatal History)", GREEN))
anc = [["LMP & EDD","Calculate gestational age immediately"],
       ["Booking","When & where was first ANC visit?"],
       ["ANC visits","Total number of check-ups?"],
       ["Fetal movements","1st preg: ~20 wks  |  2nd+: ~18 wks"],
       ["TT injections","Given? How many doses?"],
       ["Investigations","Blood group, Hb, ultrasound scans?"],
       ["Complications","Bleeding, vomiting, swelling, headache, fits"],
       ["Medications","Iron, Folic acid, Calcium given?"]]
anc_t = two_col_table(anc, [RW*0.28, RW*0.72], [GREEN_LT, WHITE],
                      colors.HexColor("#A9DFBF"))
right.append(anc_t)
right.append(sp(1.5))

# ⑥ GYNECOLOGICAL HISTORY
right.append(hdr("⑥ GYNECOLOGICAL HISTORY", PURPLE))
gyn = [["Contraception","Pills / IUCD (Copper-T) / Injections / Barrier / Tubectomy"],
       ["Sexual history","Active? Dyspareunia (pain during sex)?"],
       ["Post-coital bleeding","⚠ Bleeding after sex → cervical pathology"],
       ["Vaginal discharge","Color, smell, amount, itching, duration"],
       ["Previous problems","Ovarian cysts, fibroids, PID, endometriosis"],
       ["Gynae surgeries","D&C, hysterectomy, myomectomy, laparoscopy"],
       ["Pap smear / HPV","Any cervical cancer screening done?"],
       ["Infertility","Primary or secondary? Duration? Treatment?"]]
gyn_t = two_col_table(gyn, [RW*0.30, RW*0.70], [PURPLE_LT, WHITE],
                      colors.HexColor("#D2B4DE"))
right.append(gyn_t)
right.append(sp(1.5))

# VAGINAL DISCHARGE CLUES
right.append(hdr("  VAGINAL DISCHARGE — QUICK CLUES", PURPLE))
vd = [["White, curdy, itchy","→ Candida (Fungal)"],
      ["Yellow/green, frothy, fishy","→ Trichomonas"],
      ["Grey, fishy smell (no itch)","→ Bacterial Vaginosis"],
      ["Mucopurulent, cervicitis","→ Gonorrhea / Chlamydia"]]
vd_t = Table(
    [[Paragraph(r[0], S("vl", fontSize=6.8, textColor=GREY_DARK)),
      Paragraph(r[1], S("vr", fontSize=6.8, fontName="Helvetica-Bold", textColor=PURPLE))] for r in vd],
    colWidths=[RW*0.55, RW*0.45],
    style=TableStyle([
        ("ROWBACKGROUNDS", (0,0),(-1,-1), [PURPLE_LT, WHITE]),
        ("GRID",           (0,0),(-1,-1), 0.3, colors.HexColor("#D2B4DE")),
        ("TOPPADDING",     (0,0),(-1,-1), 1.5),
        ("BOTTOMPADDING",  (0,0),(-1,-1), 1.5),
        ("LEFTPADDING",    (0,0),(-1,-1), 4),
    ]))
right.append(vd_t)
right.append(sp(1.5))

# WARD TIPS
tips = Table([[Paragraph(
    "<b>WARD TIPS:</b>  Ask LMP first in EVERY patient  ·  Write GPAL clearly at top of case sheet  "
    "·  Calculate gestational age on the spot  ·  Be sensitive about pregnancy losses  "
    "·  <b>⚠ Post-menopausal bleeding</b> = always investigate  ·  "
    "<b>⚠ Post-coital bleeding</b> = cervical cause until proven otherwise",
    S("tips", fontSize=6.5, fontName="Helvetica", textColor=TEAL))]],
    colWidths=[RW],
    style=TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), TEAL_LIGHT),
        ("TOPPADDING",    (0,0),(-1,-1), 4),
        ("BOTTOMPADDING", (0,0),(-1,-1), 4),
        ("LEFTPADDING",   (0,0),(-1,-1), 5),
    ]))
right.append(tips)

# ════════════════════════════════════════════════════════════════════════════
# ASSEMBLE TWO COLUMNS
# ════════════════════════════════════════════════════════════════════════════
two_col = Table(
    [[left, Spacer(GAP, 1), right]],
    colWidths=[LW, GAP, RW],
    style=TableStyle([
        ("VALIGN",        (0,0),(-1,-1), "TOP"),
        ("LEFTPADDING",   (0,0),(-1,-1), 0),
        ("RIGHTPADDING",  (0,0),(-1,-1), 0),
        ("TOPPADDING",    (0,0),(-1,-1), 0),
        ("BOTTOMPADDING", (0,0),(-1,-1), 0),
    ]))
story.append(two_col)
story.append(sp(2))

# FOOTER
story.append(HRFlowable(width=W, thickness=0.4, color=TEAL))
story.append(sp(0.5))
story.append(Paragraph(
    "Based on Berek &amp; Novak's Gynecology  &amp;  Creasy &amp; Resnik's Maternal-Fetal Medicine  ·  "
    "3rd Year MBBS OB/GYN Posting  ·  June 2026",
    S("ft", fontSize=6, textColor=GREY_MID, alignment=TA_CENTER)))

doc.build(story)
print(f"PDF created: {OUTPUT}")
Editing File

~/obgyn-reference/create_reference.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/obgyn-reference/create_reference.py'
Running Command

cat > /home/daytona/workspace/obgyn-reference/create_reference.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import mm from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable ) from reportlab.lib.styles import ParagraphStyle from reportlab.lib.enums import TA_CENTER OUTPUT = "/home/daytona/workspace/obgyn-reference/OBGYN_History_Quick_Reference.pdf" TEAL = colors.HexColor("#0D7377") TEAL_LIGHT = colors.HexColor("#C8E6E7") TEAL_MID = colors.HexColor("#14A085") PINK = colors.HexColor("#C0392B") PINK_LIGHT = colors.HexColor("#FADBD8") ORANGE = colors.HexColor("#E67E22") ORANGE_LT = colors.HexColor("#FDEBD0") PURPLE = colors.HexColor("#6C3483") PURPLE_LT = colors.HexColor("#E8DAEF") GREEN = colors.HexColor("#1E8449") GREEN_LT = colors.HexColor("#D5F5E3") GREY_DARK = colors.HexColor("#2C3E50") GREY_MID = colors.HexColor("#5D6D7E") GREY_LIGHT = colors.HexColor("#EAF2F8") WHITE = colors.white doc = SimpleDocTemplate( OUTPUT, pagesize=A4, leftMargin=10*mm, rightMargin=10*mm, topMargin=8*mm, bottomMargin=8*mm ) W = A4[0] - 20*mm LW = W * 0.485 RW = W * 0.485 GAP = W * 0.03 def S(name, **kw): return ParagraphStyle(name, **kw) def hdr(text, color=TEAL, width=None): p = Paragraph(text, S("h", fontSize=7.5, textColor=WHITE, fontName="Helvetica-Bold")) w = width or 999 t = Table([[p]], colWidths=[w], style=TableStyle([ ("BACKGROUND", (0,0),(-1,-1), color), ("TOPPADDING", (0,0),(-1,-1), 2), ("BOTTOMPADDING", (0,0),(-1,-1), 2), ("LEFTPADDING", (0,0),(-1,-1), 5), ])) return t def sp(h=2): return Spacer(1, h*mm) def bullet(text, clr=GREY_DARK): return Paragraph(f"<bullet>&#x25B8;</bullet> {text}", S("b", fontSize=6.8, textColor=clr, fontName="Helvetica", leading=10, leftIndent=8, bulletIndent=2)) def two_col_tbl(rows, cw, row_colors, grid_color): data = [[Paragraph(r[0], S("L", fontSize=7, fontName="Helvetica-Bold", textColor=GREY_DARK, leading=9)), Paragraph(r[1], S("R", fontSize=6.5, textColor=GREY_MID, leading=9))] for r in rows] ts = TableStyle([ ("ROWBACKGROUNDS", (0,0),(-1,-1), row_colors), ("GRID", (0,0),(-1,-1), 0.3, grid_color), ("TOPPADDING", (0,0),(-1,-1), 1.5), ("BOTTOMPADDING", (0,0),(-1,-1), 1.5), ("LEFTPADDING", (0,0),(-1,-1), 4), ]) return Table(data, colWidths=cw, style=ts) story = [] # ── TITLE ──────────────────────────────────────────────────────────────────── title_t = Table([ [Paragraph("OB/GYN History Taking — Quick Reference Sheet", S("T", fontSize=15, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER))], [Paragraph("3rd Year MBBS · Obstetrics &amp; Gynecology Posting", S("ST", fontSize=8, textColor=TEAL_LIGHT, fontName="Helvetica", alignment=TA_CENTER))], ], colWidths=[W], style=TableStyle([ ("BACKGROUND", (0,0),(-1,-1), TEAL), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ])) story.append(title_t) story.append(sp(2)) # ── FLOW BAR ───────────────────────────────────────────────────────────────── steps = ["① Biodata","② Chief Complaint","③ HPI","④ Menstrual Hx", "⑤ Obstetric Hx","⑥ Gynae Hx","⑦ Past Medical","⑧ Drugs","⑨ Family","⑩ Social"] cells = [Paragraph(s, S("fl", fontSize=6.2, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER)) for s in steps] flow_t = Table([cells], colWidths=[W/10]*10, style=TableStyle([ ("BACKGROUND", (0,0),(3,0), TEAL), ("BACKGROUND", (4,0),(5,0), TEAL_MID), ("BACKGROUND", (6,0),(9,0), TEAL), ("TOPPADDING", (0,0),(-1,-1), 3), ("BOTTOMPADDING", (0,0),(-1,-1), 3), ("GRID", (0,0),(-1,-1), 0.5, WHITE), ])) story.append(flow_t) story.append(sp(2)) # ══ LEFT COLUMN ══════════════════════════════════════════════════════════════ left = [] left.append(hdr("① BIODATA", TEAL)) for item in ["Name, Age, Address", "Occupation (patient & husband)", "Religion, marital status, duration of marriage"]: left.append(bullet(item)) left.append(sp(1.5)) left.append(hdr("② COMMON OB/GYN COMPLAINTS", TEAL_MID)) cc = [["Abdominal / pelvic pain","Vaginal bleeding"], ["Vaginal discharge","Amenorrhea (missed period)"], ["Infertility","Swelling in abdomen"], ["Leaking urine","Post-menopausal bleeding ⚠"], ["Labor pains","Nausea / vomiting in pregnancy"]] cc_t = Table(cc, colWidths=[LW*0.5,LW*0.5], style=TableStyle([ ("FONTSIZE", (0,0),(-1,-1), 6.5), ("TEXTCOLOR", (0,0),(-1,-1), GREY_DARK), ("ROWBACKGROUNDS",(0,0),(-1,-1), [WHITE, GREY_LIGHT]), ("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#BFC9CA")), ("TOPPADDING", (0,0),(-1,-1), 1.5), ("BOTTOMPADDING", (0,0),(-1,-1), 1.5), ("LEFTPADDING", (0,0),(-1,-1), 4), ("TEXTCOLOR", (1,3),(1,3), PINK), ("FONTNAME", (1,3),(1,3), "Helvetica-Bold"), ])) left.append(cc_t) left.append(sp(1.5)) left.append(hdr("③ HPI — SOCRATES", ORANGE)) soc = [["S","Site","Where exactly?"], ["O","Onset","Sudden or gradual?"], ["C","Character","Crampy / burning / dull?"], ["R","Radiation","Spreads anywhere?"], ["A","Associated","Fever, vomiting, discharge?"], ["T","Timing","Constant? Related to cycle?"], ["E","Exacerbating","Better / worse with?"], ["S","Severity","Rate 1-10?"]] soc_t = Table( [[Paragraph(r[0], S("s1", fontSize=7.5, fontName="Helvetica-Bold", textColor=ORANGE)), Paragraph(r[1], S("s2", fontSize=7, fontName="Helvetica-Bold", textColor=GREY_DARK)), Paragraph(r[2], S("s3", fontSize=6.5, textColor=GREY_MID))] for r in soc], colWidths=[LW*0.07, LW*0.22, LW*0.71], style=TableStyle([ ("ROWBACKGROUNDS",(0,0),(-1,-1), [ORANGE_LT, WHITE]), ("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#F0D9C0")), ("TOPPADDING", (0,0),(-1,-1), 1.5), ("BOTTOMPADDING",(0,0),(-1,-1), 1.5), ("LEFTPADDING", (0,0),(-1,-1), 4), ])) left.append(soc_t) left.append(sp(1.5)) left.append(hdr("④ MENSTRUAL HISTORY (Ask in EVERY patient)", PINK)) mh = [["Age of Menarche","Normal: 10–16 years"], ["Cycle","Duration / Length e.g. 4-5 days / 28 days"], ["Flow","Pads/day (normal 3-5). Clots?"], ["LMP","DATE — note this FIRST!"], ["Regularity","Regular or irregular?"], ["Dysmenorrhea","Pain with periods? Primary / secondary?"], ["IMB","Bleeding between periods?"], ["PCB","⚠ Bleeding after sex → cervical cause"], ["Menopause","Age? Post-menopausal bleeding?"]] left.append(two_col_tbl(mh, [LW*0.28, LW*0.72], [PINK_LIGHT, WHITE], colors.HexColor("#F1B8B3"))) left.append(sp(1)) edd = Table([[Paragraph( "EDD (Naegele's Rule) = LMP + 9 months + 7 days | OR: subtract 3 months, add 7 days to LMP", S("edd", fontSize=7, fontName="Helvetica-Bold", textColor=TEAL))]], colWidths=[LW], style=TableStyle([ ("BACKGROUND", (0,0),(-1,-1), TEAL_LIGHT), ("TOPPADDING", (0,0),(-1,-1), 3), ("BOTTOMPADDING", (0,0),(-1,-1), 3), ("LEFTPADDING", (0,0),(-1,-1), 5), ])) left.append(edd) left.append(sp(1.5)) left.append(hdr("⑦ PAST MEDICAL HISTORY", GREY_DARK)) for item in ["HTN → Pre-eclampsia risk", "Diabetes → GDM, macrosomia", "Thyroid disease", "TB → Infertility, Asherman's syndrome", "Epilepsy → Teratogenic drugs (valproate!)", "Previous abdominal / pelvic surgeries", "Blood transfusions · Anemia"]: left.append(bullet(item)) left.append(sp(1.5)) left.append(hdr("⑧ DRUG HISTORY", GREY_DARK)) drug = Table([[ Paragraph("⚠ Teratogens:", S("dh", fontSize=7, fontName="Helvetica-Bold", textColor=PINK)), Paragraph("Valproate · ACE inhibitors · Warfarin · Tetracycline · Thalidomide", S("dh2", fontSize=6.5, textColor=GREY_DARK)) ]], colWidths=[LW*0.25, LW*0.75], style=TableStyle([ ("BACKGROUND", (0,0),(-1,-1), PINK_LIGHT), ("TOPPADDING", (0,0),(-1,-1), 2), ("BOTTOMPADDING", (0,0),(-1,-1), 2), ("LEFTPADDING", (0,0),(-1,-1), 4), ("GRID", (0,0),(-1,-1), 0, WHITE), ])) left.append(drug) for item in ["Folic acid, Iron, Calcium supplements?", "Any drug allergies?"]: left.append(bullet(item)) left.append(sp(1.5)) left.append(hdr("⑨ FAMILY + ⑩ SOCIAL HISTORY", GREY_DARK)) fam_rows = [["HTN, DM, Twins in family"], ["Cancers: Breast, Ovarian, Endometrial ⚠"], ["Congenital abnormalities / genetic d/o"], ["Smoking ⚠ → Preterm, Abruption, IUGR"], ["Alcohol → Fetal Alcohol Syndrome"], ["Occupation: heavy work, chemical exposure?"]] fs_t = Table( [[Paragraph(r[0], S("fs", fontSize=6.8, textColor=GREY_DARK, leading=10))] for r in fam_rows], colWidths=[LW], style=TableStyle([ ("ROWBACKGROUNDS",(0,0),(-1,-1), [GREY_LIGHT, WHITE]), ("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#BDC3C7")), ("TOPPADDING", (0,0),(-1,-1), 1.5), ("BOTTOMPADDING",(0,0),(-1,-1), 1.5), ("LEFTPADDING", (0,0),(-1,-1), 5), ])) left.append(fs_t) # ══ RIGHT COLUMN ═════════════════════════════════════════════════════════════ right = [] right.append(hdr("⑤ OBSTETRIC HISTORY — GPAL System", GREEN)) gpal = Table([[ Paragraph("G", S("g1", fontSize=12, fontName="Helvetica-Bold", textColor=TEAL, alignment=TA_CENTER)), Paragraph("Gravida\nAll pregnancies", S("g2", fontSize=5.8, textColor=GREY_DARK, alignment=TA_CENTER)), Paragraph("P", S("g1", fontSize=12, fontName="Helvetica-Bold", textColor=GREEN, alignment=TA_CENTER)), Paragraph("Para\nDeliveries\n≥28 wks", S("g2", fontSize=5.8, textColor=GREY_DARK, alignment=TA_CENTER)), Paragraph("A", S("g1", fontSize=12, fontName="Helvetica-Bold", textColor=ORANGE, alignment=TA_CENTER)), Paragraph("Abortion\nLoss\n<28 wks", S("g2", fontSize=5.8, textColor=GREY_DARK, alignment=TA_CENTER)), Paragraph("L", S("g1", fontSize=12, fontName="Helvetica-Bold", textColor=PURPLE, alignment=TA_CENTER)), Paragraph("Living\nChildren\nalive", S("g2", fontSize=5.8, textColor=GREY_DARK, alignment=TA_CENTER)), ]], colWidths=[RW/8]*8, style=TableStyle([ ("BACKGROUND", (0,0),(1,0), GREEN_LT), ("BACKGROUND", (2,0),(3,0), GREEN_LT), ("BACKGROUND", (4,0),(5,0), ORANGE_LT), ("BACKGROUND", (6,0),(7,0), PURPLE_LT), ("ALIGN", (0,0),(-1,-1), "CENTER"), ("VALIGN", (0,0),(-1,-1), "MIDDLE"), ("TOPPADDING", (0,0),(-1,-1), 3), ("BOTTOMPADDING", (0,0),(-1,-1), 3), ("GRID", (0,0),(-1,-1), 0.5, WHITE), ])) right.append(gpal) right.append(Table([[Paragraph( "Example: G3P2A1L2 = 3 pregnancies | 2 deliveries | 1 miscarriage | 2 children alive", S("eg", fontSize=7, fontName="Helvetica-Bold", textColor=PURPLE))]], colWidths=[RW], style=TableStyle([ ("BACKGROUND", (0,0),(-1,-1), PURPLE_LT), ("TOPPADDING", (0,0),(-1,-1), 2), ("BOTTOMPADDING", (0,0),(-1,-1), 2), ("LEFTPADDING", (0,0),(-1,-1), 5), ]))) right.append(sp(1)) right.append(Paragraph("<b>For EACH previous pregnancy, ask:</b>", S("ph", fontSize=7, fontName="Helvetica-Bold", textColor=GREEN))) for item in [ "Year & duration (weeks)", "Type: Normal vaginal / C-section / Instrumental (forceps/vacuum)", "Place: Hospital or home?", "Baby weight, sex, current health", "Complications: HTN, DM, bleeding, fits", "Postpartum: PPH, infection, ICU admission?", "Miscarriage: weeks? D&amp;C done?"]: right.append(bullet(item, GREEN)) right.append(sp(1.5)) right.append(hdr(" CURRENT PREGNANCY (Antenatal History)", GREEN)) anc = [["LMP & EDD","Calculate gestational age immediately"], ["Booking","When & where was first ANC visit?"], ["ANC visits","Total number of check-ups?"], ["Fetal movements","1st preg: ~20 wks | 2nd+: ~18 wks"], ["TT injections","Given? How many doses?"], ["Investigations","Blood group, Hb, ultrasound scans?"], ["Complications","Bleeding, vomiting, swelling, headache, fits"], ["Medications","Iron, Folic acid, Calcium given?"]] right.append(two_col_tbl(anc, [RW*0.28, RW*0.72], [GREEN_LT, WHITE], colors.HexColor("#A9DFBF"))) right.append(sp(1.5)) right.append(hdr("⑥ GYNECOLOGICAL HISTORY", PURPLE)) gyn = [["Contraception","Pills / IUCD (Copper-T) / Injections / Barrier / Tubectomy"], ["Sexual history","Active? Dyspareunia (pain during sex)?"], ["Post-coital bleeding","⚠ Bleeding after sex → cervical pathology"], ["Vaginal discharge","Color, smell, amount, itching, duration"], ["Previous problems","Cysts, fibroids, PID, endometriosis"], ["Gynae surgeries","D&C, hysterectomy, myomectomy, laparoscopy"], ["Pap smear / HPV","Cervical cancer screening done?"], ["Infertility","Primary or secondary? Duration? Treatment?"]] right.append(two_col_tbl(gyn, [RW*0.30, RW*0.70], [PURPLE_LT, WHITE], colors.HexColor("#D2B4DE"))) right.append(sp(1.5)) right.append(hdr(" VAGINAL DISCHARGE — QUICK CLUES", PURPLE)) vd = [["White, curdy, itchy","→ Candida (Fungal)"], ["Yellow / green, frothy, fishy","→ Trichomonas"], ["Grey, fishy smell (no itch)","→ Bacterial Vaginosis"], ["Mucopurulent, cervicitis","→ Gonorrhea / Chlamydia"]] vd_t = Table( [[Paragraph(r[0], S("vl", fontSize=6.8, textColor=GREY_DARK, leading=9)), Paragraph(r[1], S("vr", fontSize=6.8, fontName="Helvetica-Bold", textColor=PURPLE, leading=9))] for r in vd], colWidths=[RW*0.55, RW*0.45], style=TableStyle([ ("ROWBACKGROUNDS", (0,0),(-1,-1), [PURPLE_LT, WHITE]), ("GRID", (0,0),(-1,-1), 0.3, colors.HexColor("#D2B4DE")), ("TOPPADDING", (0,0),(-1,-1), 1.5), ("BOTTOMPADDING", (0,0),(-1,-1), 1.5), ("LEFTPADDING", (0,0),(-1,-1), 4), ])) right.append(vd_t) right.append(sp(1.5)) right.append(Table([[Paragraph( "<b>WARD TIPS:</b> Always ask LMP first · Write GPAL clearly at top " "· Calculate gestational age on the spot · Be sensitive about pregnancy losses " "· <b>⚠ Post-menopausal bleeding</b> = always investigate " "· <b>⚠ Post-coital bleeding</b> = cervical cause until proven otherwise", S("tips", fontSize=6.5, textColor=TEAL))]], colWidths=[RW], style=TableStyle([ ("BACKGROUND", (0,0),(-1,-1), TEAL_LIGHT), ("TOPPADDING", (0,0),(-1,-1), 4), ("BOTTOMPADDING", (0,0),(-1,-1), 4), ("LEFTPADDING", (0,0),(-1,-1), 5), ]))) # ── TWO COLUMN ASSEMBLY ─────────────────────────────────────────────────────── two_col = Table([[left, Spacer(GAP,1), right]], colWidths=[LW, GAP, RW], style=TableStyle([ ("VALIGN", (0,0),(-1,-1), "TOP"), ("LEFTPADDING", (0,0),(-1,-1), 0), ("RIGHTPADDING", (0,0),(-1,-1), 0), ("TOPPADDING", (0,0),(-1,-1), 0), ("BOTTOMPADDING", (0,0),(-1,-1), 0), ])) story.append(two_col) story.append(sp(2)) story.append(HRFlowable(width=W, thickness=0.4, color=TEAL)) story.append(sp(0.5)) story.append(Paragraph( "Based on Berek &amp; Novak's Gynecology &amp; Creasy &amp; Resnik's Maternal-Fetal Medicine · " "3rd Year MBBS OB/GYN Posting · June 2026", S("ft", fontSize=6, textColor=GREY_MID, alignment=TA_CENTER))) doc.build(story) print(f"PDF created: {OUTPUT}") PYEOF echo "File written successfully"

Running Command

cd /home/daytona/workspace/obgyn-reference && python create_reference.py 2>&1

Running Command

ls -lh /home/daytona/workspace/obgyn-reference/OBGYN_History_Quick_Reference.pdf

Your printable quick reference sheet is ready!

OBGYN History Quick Reference

PDF Document · PDF


Here is what is included on the single A4 sheet:
Left column:
  • ① Biodata prompts
  • ② Common OB/GYN complaints table (with post-menopausal bleeding highlighted in red as a warning)
  • ③ SOCRATES framework for HPI
  • ④ Full Menstrual History checklist (Menarche, Cycle, LMP, IMB, PCB, Menopause) + Naegele's EDD formula box
  • ⑦ Past Medical History
  • ⑧ Drug History with teratogens listed in a red warning box
  • ⑨⑩ Family + Social History
Right column:
  • ⑤ Obstetric History with the GPAL system in a colour-coded box + worked example
  • Full checklist for each previous pregnancy
  • Current pregnancy / Antenatal history table
  • ⑥ Gynecological History table
  • Vaginal Discharge quick clue table (Candida / Trichomonas / BV / Gonorrhea)
  • Ward Tips box with the two red-flag warnings (post-menopausal and post-coital bleeding)
Print it on A4, laminate it if you can, and carry it in your white coat pocket. Good luck on your posting tomorrow!
This is a shared conversation. Sign in to Orris to start your own chat.