How to take history in gyne and obs
| Element | What to explore | Why it matters |
|---|---|---|
| Menstrual history | Menarche, menopause, bleeding pattern, meds affecting bleeding | Endocrine, structural, infectious, oncologic clues |
| Obstetric history | Number of pregnancies, dates, delivery type, losses, complications | Predisposes to certain conditions (e.g., gestational trophoblastic disease), surgical risk |
| Sexual history | Partners, practices, protection, pregnancy intention | STI risk, testing sites, counseling |
| Contraceptive history | Current/past use, type, duration | Pregnancy risk during procedures, side effects |
| Cytologic screening | Frequency, results | Cervical cancer screening status |
Can you provide me some hand writin pod notes to help me in documenting my version in opd
Name/Age: Date:
C/O (Chief complaint): ______ x ___ days
MENSTRUAL Hx:
Menarche: __yrs LMP: __/__/__ Cycle: __/__ (regular/irreg)
Flow: nl/exc/scanty Clots: Y/N Dysmenorrhea: Y/N
Menopause: __yrs (if applicable)
OBS Hx: G_P_L_A_ (Gravida/Para/Living/Abortion)
Mode of delivery(s): ____ Last delivery: __ yrs ago
CONTRACEPTION: current method: ____ duration: ____
SEXUAL Hx: active/not active partners: __ dyspareunia: Y/N
PAST GYNAE Hx: Pap smear - date/result: ____
Prior surgery: ____ Infections/STI: ____
P/M Hx (Past medical): DM/HTN/Thyroid/TB - circle if present
DRUG Hx: ____ ALLERGY: ____
FAMILY Hx: ____ (breast/ovarian ca, DM, HTN)
O/E:
GC: ____ P: __ BP: __/__ Pallor: +/-
P/A: soft/tender, mass ___, organomegaly
P/S (speculum): cervix - healthy/erosion/discharge
P/V (bimanual): uterus - size/pos/mobility, adnexa - free/tender/mass
Provisional Dx: ____
Plan: Investigations / Rx / Follow-up
Name/Age: Date:
G_P_L_A_ LMP: __/__/__ EDD: __/__/__ (Naegele's rule)
POG (period of gestation) today: __ wks __ days (by dates/USG)
C/O: ____ (fetal movements, pain, leaking, bleeding, swelling)
CURRENT PREGNANCY:
Booking visit: __ wks ANC visits: __
USG dating: __ wks (if differs from LMP, use USG dates)
Complications so far: PIH/GDM/Anemia/PROM/none
Immunization: TT1/TT2 done Anti-D given (if Rh-neg): Y/N
PAST OBS Hx (for each pregnancy):
Yr | POG at delivery | Mode | Wt | Sex | Complication | Outcome
___|________________|______|____|_____|______________|________
PAST MEDICAL/SURGICAL Hx: ____
DRUG/ALLERGY Hx: ____
FAMILY Hx: ____
O/E:
GC: ____ P: __ BP: __/__ Wt: __ kg Ht: __ cm Pallor/Edema: +/-
P/A: FH (fundal height) = __ wks FHS (fetal heart sounds): +/reg __ bpm
Presentation: ceph/breech/transverse Lie: long/oblique/transverse
Engagement: __/5th Liquor: adequate/reduced (clinical)
Investigations: Hb, urine R/M, BSL, USG, others: ____
Provisional Dx: ____ (e.g., G2P1L1 at __ wks with ____)
Plan: ____
All of above
mkdir -p /tmp/workspace/opd-notes-template && ls -la /tmp/workspace/
~/opd-notes-template/make_docx.py
from docx import Document
from docx.shared import Pt, Inches, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.enum.table import WD_TABLE_ALIGNMENT
from docx.oxml.ns import qn
from docx.oxml import OxmlElement
def set_cell_border(cell):
tc = cell._tc
tcPr = tc.get_or_add_tcPr()
tcBorders = OxmlElement('w:tcBorders')
for edge in ('top', 'left', 'bottom', 'right'):
el = OxmlElement(f'w:{edge}')
el.set(qn('w:val'), 'single')
el.set(qn('w:sz'), '4')
el.set(qn('w:space'), '0')
el.set(qn('w:color'), '999999')
tcBorders.append(el)
tcPr.append(tcBorders)
doc = Document()
# margins
section = doc.sections[0]
section.top_margin = Inches(0.5)
section.bottom_margin = Inches(0.5)
section.left_margin = Inches(0.6)
section.right_margin = Inches(0.6)
style = doc.styles["Normal"]
style.font.name = "Arial"
style.font.size = Pt(10.5)
def add_title(text, subtitle=None):
h = doc.add_paragraph()
h.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = h.add_run(text)
run.bold = True
run.font.size = Pt(16)
if subtitle:
s = doc.add_paragraph()
s.alignment = WD_ALIGN_PARAGRAPH.CENTER
r2 = s.add_run(subtitle)
r2.italic = True
r2.font.size = Pt(10)
r2.font.color.rgb = RGBColor(0x55, 0x55, 0x55)
def add_section_heading(text):
p = doc.add_paragraph()
p.paragraph_format.space_before = Pt(8)
p.paragraph_format.space_after = Pt(2)
run = p.add_run(text)
run.bold = True
run.font.size = Pt(11.5)
run.font.color.rgb = RGBColor(0x1F, 0x4E, 0x79)
pPr = p._p.get_or_add_pPr()
shd = OxmlElement('w:shd')
shd.set(qn('w:val'), 'clear')
shd.set(qn('w:fill'), 'DCE6F1')
pPr.append(shd)
def blank_line(label, width_chars=28):
p = doc.add_paragraph()
p.paragraph_format.space_after = Pt(3)
r1 = p.add_run(label + ": ")
r1.bold = True
r1.font.size = Pt(10.5)
r2 = p.add_run("_" * width_chars)
r2.font.size = Pt(10.5)
return p
def two_col_blank(label1, w1, label2, w2):
p = doc.add_paragraph()
p.paragraph_format.space_after = Pt(3)
r1 = p.add_run(label1 + ": ")
r1.bold = True
r2 = p.add_run("_" * w1 + " ")
r3 = p.add_run(label2 + ": ")
r3.bold = True
r4 = p.add_run("_" * w2)
for r in (r1, r2, r3, r4):
r.font.size = Pt(10.5)
def checkbox_line(label, options):
p = doc.add_paragraph()
p.paragraph_format.space_after = Pt(3)
r1 = p.add_run(label + ": ")
r1.bold = True
r1.font.size = Pt(10.5)
r2 = p.add_run(" ".join([f"\u2610 {o}" for o in options]))
r2.font.size = Pt(10.5)
def add_table(headers, nrows, col_widths=None):
t = doc.add_table(rows=nrows+1, cols=len(headers))
t.alignment = WD_TABLE_ALIGNMENT.CENTER
for j, htext in enumerate(headers):
cell = t.rows[0].cells[j]
cell.text = ""
run = cell.paragraphs[0].add_run(htext)
run.bold = True
run.font.size = Pt(9.5)
set_cell_border(cell)
shd = OxmlElement('w:shd')
shd.set(qn('w:val'), 'clear')
shd.set(qn('w:fill'), 'F2F2F2')
cell._tc.get_or_add_tcPr().append(shd)
for i in range(1, nrows+1):
for j in range(len(headers)):
cell = t.rows[i].cells[j]
cell.text = ""
cell.paragraphs[0].add_run(" ")
set_cell_border(cell)
if col_widths:
for row in t.rows:
for j, w in enumerate(col_widths):
row.cells[j].width = Inches(w)
return t
def footer_note():
p = doc.add_paragraph()
p.paragraph_format.space_before = Pt(6)
r = p.add_run("Provisional Diagnosis: " + "_"*55)
r.bold = True
r.font.size = Pt(10.5)
p2 = doc.add_paragraph()
r2 = p2.add_run("Plan / Advice / Rx: ")
r2.bold = True
r2.font.size = Pt(10.5)
p2.add_run("_"*60).font.size = Pt(10.5)
for _ in range(3):
p3 = doc.add_paragraph("_" * 95)
p3.paragraph_format.space_after = Pt(2)
p4 = doc.add_paragraph()
r4 = p4.add_run("Doctor's Signature: " + "_"*25 + " Next visit: " + "_"*15)
r4.font.size = Pt(10.5)
# ============ PAGE 1: GYNECOLOGY OPD NOTE ============
add_title("GYNECOLOGY OPD NOTE", "Quick documentation template")
p = doc.add_paragraph()
run = p.add_run("Name: " + "_"*30 + " Age: " + "_"*6 + " Date: " + "_"*15)
run.font.size = Pt(10.5)
p2 = doc.add_paragraph()
p2.add_run("Marital status: " + "_"*10 + " Occupation: " + "_"*15 + " Reg. No: " + "_"*12).font.size = Pt(10.5)
add_section_heading("Chief Complaint(s)")
for _ in range(2):
doc.add_paragraph("_" * 100).paragraph_format.space_after = Pt(2)
add_section_heading("Menstrual History")
two_col_blank("Menarche (yrs)", 6, "LMP", 12)
two_col_blank("Cycle length/duration", 10, "Flow (nl/exc/scanty)", 10)
checkbox_line("Dysmenorrhea", ["Yes", "No"])
two_col_blank("Menopause (yrs, if any)", 10, "IMB/PMB", 12)
add_section_heading("Obstetric History")
p = doc.add_paragraph()
r1 = p.add_run("G ___ P ___ L ___ A ___ ")
r1.bold = True
r1.font.size = Pt(11)
r2 = p.add_run("(Gravida / Para / Living / Abortion)")
r2.italic = True
r2.font.size = Pt(9)
two_col_blank("Mode of last delivery", 15, "Last delivery (yrs ago)", 8)
add_section_heading("Contraception & Sexual History")
two_col_blank("Current method", 12, "Duration", 10)
checkbox_line("Sexually active", ["Yes", "No"])
blank_line("Dyspareunia / other complaints", 40)
add_section_heading("Past Gynecological History")
two_col_blank("Pap smear date/result", 20, "Prior gynae surgery", 20)
blank_line("Infections / STI history", 45)
add_section_heading("Past Medical / Surgical / Drug / Allergy History")
checkbox_line("Comorbidities", ["DM", "HTN", "Thyroid", "TB", "None"])
blank_line("Drug history", 35)
blank_line("Allergy history", 35)
blank_line("Family history", 45)
add_section_heading("On Examination")
two_col_blank("GC", 8, "Pallor", 8)
two_col_blank("Pulse", 8, "BP", 10)
add_table(["Exam", "Findings"], 4, col_widths=[1.6, 5.5])
p = doc.add_paragraph()
r = p.add_run("(P/A - per abdomen, P/S - per speculum, P/V - per vaginum, Breast)")
r.italic = True
r.font.size = Pt(8.5)
footer_note()
doc.add_page_break()
# ============ PAGE 2: OBSTETRIC (ANTENATAL) OPD NOTE ============
add_title("OBSTETRIC (ANTENATAL) OPD NOTE", "Quick documentation template")
p = doc.add_paragraph()
p.add_run("Name: " + "_"*30 + " Age: " + "_"*6 + " Date: " + "_"*15).font.size = Pt(10.5)
add_section_heading("Pregnancy Summary")
p = doc.add_paragraph()
r1 = p.add_run("G ___ P ___ L ___ A ___ ")
r1.bold = True
r1.font.size = Pt(11)
two_col_blank("LMP", 14, "EDD (Naegele's rule)", 14)
two_col_blank("POG today (by dates)", 12, "POG (by USG)", 12)
add_section_heading("Chief Complaint(s)")
checkbox_line("Symptoms", ["Fetal movements +", "Pain", "Leaking", "Bleeding", "Swelling", "None"])
doc.add_paragraph("_" * 100).paragraph_format.space_after = Pt(2)
add_section_heading("Current Pregnancy Details")
two_col_blank("Booking visit (wks)", 8, "No. of ANC visits", 8)
two_col_blank("USG dating scan (wks)", 10, "TT1 / TT2", 12)
checkbox_line("Complications", ["PIH", "GDM", "Anemia", "PROM", "None"])
checkbox_line("Rh status", ["Rh +ve", "Rh -ve -> Anti-D given: Yes/No"])
add_section_heading("Past Obstetric History")
add_table(["Yr", "POG at delivery", "Mode", "Birth wt", "Sex", "Complication", "Outcome"], 3,
col_widths=[0.6, 1.1, 0.9, 0.8, 0.6, 1.4, 1.1])
add_section_heading("Past Medical / Surgical / Drug / Allergy / Family History")
blank_line("Past medical/surgical history", 45)
blank_line("Drug / Allergy history", 45)
blank_line("Family history", 45)
add_section_heading("On Examination")
two_col_blank("GC", 8, "Pallor / Edema", 10)
two_col_blank("Pulse", 8, "BP", 10)
two_col_blank("Weight (kg)", 8, "Height (cm)", 8)
two_col_blank("Fundal Height (wks)", 10, "FHS (bpm)", 10)
two_col_blank("Presentation", 12, "Lie", 10)
two_col_blank("Engagement (/5th)", 10, "Liquor (clinical)", 12)
add_section_heading("Investigations")
checkbox_line("Sent", ["Hb", "Urine R/M", "BSL", "USG", "Others:"])
doc.add_paragraph("_" * 60)
footer_note()
# ============ PAGE 3: ABBREVIATION KEY ============
doc.add_page_break()
add_title("QUICK ABBREVIATION KEY", "Common shorthand for O&G OPD notes")
abbrevs = [
("G / P / L / A", "Gravida / Para / Living / Abortion"),
("LMP / EDD", "Last Menstrual Period / Expected Date of Delivery"),
("POG", "Period of Gestation"),
("FH / FHS", "Fundal Height / Fetal Heart Sounds"),
("P/A, P/S, P/V", "Per Abdomen, Per Speculum, Per Vaginum"),
("PIH, GDM, PROM", "Pregnancy-Induced Hypertension, Gestational Diabetes, Premature Rupture of Membranes"),
("C/O", "Complains of"),
("O/E", "On Examination"),
("Ceph / Breech", "Cephalic / Breech presentation"),
("IMB / PMB", "Intermenstrual Bleeding / Postmenopausal Bleeding"),
("TT1 / TT2", "Tetanus Toxoid dose 1 / dose 2"),
("GC", "General Condition"),
]
t = add_table(["Abbreviation", "Meaning"], len(abbrevs), col_widths=[1.8, 5.3])
for i, (a, b) in enumerate(abbrevs, start=1):
t.rows[i].cells[0].paragraphs[0].runs[0].text = a
t.rows[i].cells[1].paragraphs[0].runs[0].text = b
t.rows[i].cells[0].paragraphs[0].runs[0].bold = True
doc.save("/tmp/workspace/opd-notes-template/OG_OPD_Note_Templates.docx")
print("docx saved")
cd /tmp/workspace/opd-notes-template && python3 make_docx.py
Quick answer
OG OPD Note Templates
Word Document · DOCX
All 3
ls -la /tmp/workspace/opd-notes-template/
~/opd-notes-template/make_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, HRFlowable)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER
styles = getSampleStyleSheet()
title_style = ParagraphStyle("TitleC", parent=styles["Title"], fontSize=16, alignment=TA_CENTER, spaceAfter=2)
sub_style = ParagraphStyle("SubC", parent=styles["Normal"], fontSize=9, alignment=TA_CENTER,
textColor=colors.HexColor("#555555"), spaceAfter=10, fontName="Helvetica-Oblique")
sec_style = ParagraphStyle("Sec", parent=styles["Normal"], fontSize=11, fontName="Helvetica-Bold",
textColor=colors.HexColor("#1F4E79"), backColor=colors.HexColor("#DCE6F1"),
spaceBefore=8, spaceAfter=4, leftIndent=3, borderPadding=3)
body_style = ParagraphStyle("Body", parent=styles["Normal"], fontSize=10, spaceAfter=4, leading=14)
small_italic = ParagraphStyle("SmallItalic", parent=styles["Normal"], fontSize=8, fontName="Helvetica-Oblique",
textColor=colors.HexColor("#555555"))
def blank(label, n=30):
return Paragraph(f"<b>{label}:</b> " + "_"*n, body_style)
def two_col(label1, n1, label2, n2):
return Paragraph(f"<b>{label1}:</b> " + "_"*n1 + " <b>" + label2 + ":</b> " + "_"*n2, body_style)
def checkbox(label, options):
boxes = " ".join([f"☐ {o}" for o in options])
return Paragraph(f"<b>{label}:</b> " + boxes, body_style)
def make_table(headers, nrows, col_widths, data=None):
rows = [headers]
if data:
rows.extend(data)
for _ in range(nrows - len(data)):
rows.append([""] * len(headers))
else:
for _ in range(nrows):
rows.append([""] * len(headers))
t = Table(rows, colWidths=col_widths, rowHeights=[16] + [18]*nrows)
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#F2F2F2")),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("FONTSIZE", (0, 0), (-1, -1), 8.5),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#999999")),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
]))
return t
def footer_block():
elems = []
elems.append(blank("Provisional Diagnosis", 55))
elems.append(blank("Plan / Advice / Rx", 60))
elems.append(Spacer(1, 4))
for _ in range(3):
elems.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#AAAAAA")))
elems.append(Spacer(1, 8))
elems.append(Paragraph("Doctor's Signature: " + "_"*25 + " Next visit: " + "_"*15, body_style))
return elems
elements = []
# ============ PAGE 1: GYNECOLOGY OPD NOTE ============
elements.append(Paragraph("GYNECOLOGY OPD NOTE", title_style))
elements.append(Paragraph("Quick documentation template", sub_style))
elements.append(Paragraph("Name: " + "_"*30 + " Age: " + "_"*6 + " Date: " + "_"*15, body_style))
elements.append(Paragraph("Marital status: " + "_"*10 + " Occupation: " + "_"*15 + " Reg. No: " + "_"*12, body_style))
elements.append(Paragraph("Chief Complaint(s)", sec_style))
elements.append(Paragraph("_"*100, body_style))
elements.append(Paragraph("_"*100, body_style))
elements.append(Paragraph("Menstrual History", sec_style))
elements.append(two_col("Menarche (yrs)", 6, "LMP", 12))
elements.append(two_col("Cycle length/duration", 10, "Flow (nl/exc/scanty)", 10))
elements.append(checkbox("Dysmenorrhea", ["Yes", "No"]))
elements.append(two_col("Menopause (yrs, if any)", 10, "IMB/PMB", 12))
elements.append(Paragraph("Obstetric History", sec_style))
elements.append(Paragraph("<b>G ___ P ___ L ___ A ___</b> <i>(Gravida / Para / Living / Abortion)</i>", body_style))
elements.append(two_col("Mode of last delivery", 15, "Last delivery (yrs ago)", 8))
elements.append(Paragraph("Contraception & Sexual History", sec_style))
elements.append(two_col("Current method", 12, "Duration", 10))
elements.append(checkbox("Sexually active", ["Yes", "No"]))
elements.append(blank("Dyspareunia / other complaints", 40))
elements.append(Paragraph("Past Gynecological History", sec_style))
elements.append(two_col("Pap smear date/result", 20, "Prior gynae surgery", 20))
elements.append(blank("Infections / STI history", 45))
elements.append(Paragraph("Past Medical / Surgical / Drug / Allergy History", sec_style))
elements.append(checkbox("Comorbidities", ["DM", "HTN", "Thyroid", "TB", "None"]))
elements.append(blank("Drug history", 35))
elements.append(blank("Allergy history", 35))
elements.append(blank("Family history", 45))
elements.append(Paragraph("On Examination", sec_style))
elements.append(two_col("GC", 8, "Pallor", 8))
elements.append(two_col("Pulse", 8, "BP", 10))
elements.append(Spacer(1, 4))
elements.append(make_table(["Exam", "Findings"], 4, [1.6*inch, 5.0*inch]))
elements.append(Spacer(1, 3))
elements.append(Paragraph("(P/A - per abdomen, P/S - per speculum, P/V - per vaginum, Breast)", small_italic))
elements.append(Spacer(1, 6))
elements.extend(footer_block())
elements.append(PageBreak())
# ============ PAGE 2: OBSTETRIC (ANTENATAL) OPD NOTE ============
elements.append(Paragraph("OBSTETRIC (ANTENATAL) OPD NOTE", title_style))
elements.append(Paragraph("Quick documentation template", sub_style))
elements.append(Paragraph("Name: " + "_"*30 + " Age: " + "_"*6 + " Date: " + "_"*15, body_style))
elements.append(Paragraph("Pregnancy Summary", sec_style))
elements.append(Paragraph("<b>G ___ P ___ L ___ A ___</b>", body_style))
elements.append(two_col("LMP", 14, "EDD (Naegele's rule)", 14))
elements.append(two_col("POG today (by dates)", 12, "POG (by USG)", 12))
elements.append(Paragraph("Chief Complaint(s)", sec_style))
elements.append(checkbox("Symptoms", ["Fetal movements +", "Pain", "Leaking", "Bleeding", "Swelling", "None"]))
elements.append(Paragraph("_"*100, body_style))
elements.append(Paragraph("Current Pregnancy Details", sec_style))
elements.append(two_col("Booking visit (wks)", 8, "No. of ANC visits", 8))
elements.append(two_col("USG dating scan (wks)", 10, "TT1 / TT2", 12))
elements.append(checkbox("Complications", ["PIH", "GDM", "Anemia", "PROM", "None"]))
elements.append(checkbox("Rh status", ["Rh +ve", "Rh -ve -> Anti-D given: Yes/No"]))
elements.append(Paragraph("Past Obstetric History", sec_style))
elements.append(Spacer(1, 3))
elements.append(make_table(["Yr", "POG at delivery", "Mode", "Birth wt", "Sex", "Complication", "Outcome"], 3,
[0.5*inch, 1.0*inch, 0.8*inch, 0.75*inch, 0.55*inch, 1.3*inch, 1.1*inch]))
elements.append(Paragraph("Past Medical / Surgical / Drug / Allergy / Family History", sec_style))
elements.append(blank("Past medical/surgical history", 45))
elements.append(blank("Drug / Allergy history", 45))
elements.append(blank("Family history", 45))
elements.append(Paragraph("On Examination", sec_style))
elements.append(two_col("GC", 8, "Pallor / Edema", 10))
elements.append(two_col("Pulse", 8, "BP", 10))
elements.append(two_col("Weight (kg)", 8, "Height (cm)", 8))
elements.append(two_col("Fundal Height (wks)", 10, "FHS (bpm)", 10))
elements.append(two_col("Presentation", 12, "Lie", 10))
elements.append(two_col("Engagement (/5th)", 10, "Liquor (clinical)", 12))
elements.append(Paragraph("Investigations", sec_style))
elements.append(checkbox("Sent", ["Hb", "Urine R/M", "BSL", "USG", "Others:"]))
elements.append(Paragraph("_"*60, body_style))
elements.append(Spacer(1, 6))
elements.extend(footer_block())
elements.append(PageBreak())
# ============ PAGE 3: ABBREVIATION KEY ============
elements.append(Paragraph("QUICK ABBREVIATION KEY", title_style))
elements.append(Paragraph("Common shorthand for O&G OPD notes", sub_style))
abbrevs = [
("G / P / L / A", "Gravida / Para / Living / Abortion"),
("LMP / EDD", "Last Menstrual Period / Expected Date of Delivery"),
("POG", "Period of Gestation"),
("FH / FHS", "Fundal Height / Fetal Heart Sounds"),
("P/A, P/S, P/V", "Per Abdomen, Per Speculum, Per Vaginum"),
("PIH, GDM, PROM", "Pregnancy-Induced Hypertension, Gestational Diabetes, Premature Rupture of Membranes"),
("C/O", "Complains of"),
("O/E", "On Examination"),
("Ceph / Breech", "Cephalic / Breech presentation"),
("IMB / PMB", "Intermenstrual Bleeding / Postmenopausal Bleeding"),
("TT1 / TT2", "Tetanus Toxoid dose 1 / dose 2"),
("GC", "General Condition"),
]
data_rows = [[Paragraph(f"<b>{a}</b>", body_style), Paragraph(b, body_style)] for a, b in abbrevs]
t = Table([["Abbreviation", "Meaning"]] + data_rows, colWidths=[1.8*inch, 5.0*inch])
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#F2F2F2")),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("FONTSIZE", (0, 0), (-1, -1), 9.5),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#999999")),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
("TOPPADDING", (0, 0), (-1, -1), 4),
("BOTTOMPADDING", (0, 0), (-1, -1), 4),
]))
elements.append(t)
doc = SimpleDocTemplate("/tmp/workspace/opd-notes-template/OG_OPD_Note_Templates.pdf",
pagesize=A4,
topMargin=0.5*inch, bottomMargin=0.5*inch,
leftMargin=0.6*inch, rightMargin=0.6*inch)
doc.build(elements)
print("pdf saved")
cd /tmp/workspace/opd-notes-template && python3 make_pdf.py && ls -la
OG OPD Note Templates
PDF Document · PDF
OG OPD Note Templates
Word Document · DOCX
Can you give me the list of drugs suggestion for gyne and obs opd make a list of complains with drugs suggestions and doses
CDC 2021 PID treatment ceftriaxone doxycycline metronidazole dose
WHO recommended uterotonic dose postpartum hemorrhage prevention oxytocin misoprostol
| Complaint | Drug Suggestion | Dose |
|---|---|---|
| Dysmenorrhea | Mefenamic acid | 500 mg PO TID, start at onset of pain/menses |
| Ibuprofen | 400 mg PO TID with food | |
| Naproxen | 500 mg loading, then 250 mg q6-8h | |
| Abnormal Uterine Bleeding (AUB) / Menorrhagia | Tranexamic acid | 1000-1300 mg PO TID for up to 5 days during heavy flow (FDA-approved for ovulatory AUB) |
| NSAID (mefenamic acid) | 500 mg TID during bleeding days | |
| Combined OCP (for hormonal control) | 1 tab OD as per pack cycle | |
| Levonorgestrel IUD | Long-term option - insertion, not oral dosing | |
| Vulvovaginal Candidiasis | Fluconazole | 150 mg PO single dose |
| Clotrimazole vaginal | 1% cream/pessary OD x 6 days, or 500 mg pessary single dose | |
| Bacterial Vaginosis | Metronidazole | 500 mg PO BID x 7 days, or vaginal gel 0.75% OD x 5 days |
| Trichomoniasis | Metronidazole | 2 g PO single dose, or 500 mg BID x 7 days (treat partner too) |
| Pelvic Inflammatory Disease (PID) | Ceftriaxone + Doxycycline + Metronidazole | Ceftriaxone 500 mg IM single dose + Doxycycline 100 mg PO BID x14 days + Metronidazole 500 mg PO BID x14 days (current CDC 2021 regimen - metronidazole now routinely added) |
| Iron Deficiency Anemia (menorrhagia-related) | Ferrous sulfate | 325 mg PO BID-TID (65 mg elemental iron/dose) |
| Recurrent Vulvovaginal Candidiasis (prophylaxis) | Fluconazole | 150-200 mg PO weekly (maintenance) |
| Contraception - Emergency | Levonorgestrel | 1.5 mg PO single dose within 72 hrs (most effective <24 hrs) |
| Contraception - Regular | Combined OCP | 1 tab OD, cyclical |
| Vaginal atrophy/menopausal vaginitis | Topical estrogen cream | Low-dose applicator, 2-3x/week per product instructions |
| Vasomotor symptoms (menopause) | HRT (estrogen +/- progestin) | Lowest effective dose, individualized |
| Complaint | Drug Suggestion | Dose |
|---|---|---|
| Routine antenatal supplementation | Ferrous sulfate/fumarate + Folic acid | Elemental iron 30-60 mg/day (WHO) + Folic acid 400-800 mcg OD |
| Calcium + Vitamin D | 500-1000 mg elemental calcium OD-BID | |
| Iron Deficiency Anemia in pregnancy | Ferrous sulfate | 325 mg PO OD-BID (ACOG/WHO: at least 30 mg elemental iron/day); consider IV iron if intolerant/severe |
| Nausea and Vomiting of Pregnancy (mild) | Doxylamine + Pyridoxine (Vit B6) | 10 mg + 10 mg PO, 1-2 tabs at bedtime (first-line, safe in pregnancy) |
| Hyperemesis Gravidarum (moderate-severe) | Ondansetron | 4 mg PO/IV every 8 hours |
| Metoclopramide | 10 mg PO/IV TID (alternative) | |
| Threatened Miscarriage | (No proven effective drug per evidence) | Bed rest and progesterone are often used clinically but textbooks note no demonstrated efficacy (Berek & Novak's Gynecology) - counsel accordingly, avoid over-promising |
| Gestational Hypertension / Pre-eclampsia (non-severe, outpatient) | Labetalol | 100-200 mg PO BID-TID (titrate) |
| Nifedipine (extended release) | 10-20 mg PO BID | |
| Methyldopa | 250 mg PO BID-TID | |
| Severe Pre-eclampsia / Eclampsia (seizure prophylaxis - inpatient/emergency, not routine OPD) | Magnesium sulfate | Loading 4-6 g IV over 15-20 min, then maintenance 1-2 g/hr IV infusion (or Pritchard IM regimen) - refer/admit immediately, do not manage in OPD |
| Urinary Tract Infection in pregnancy | Cephalexin | 500 mg PO BID-QID x 5-7 days |
| Nitrofurantoin (avoid near term) | 100 mg PO BID x 5-7 days | |
| Postpartum Hemorrhage prevention (3rd stage) | Oxytocin | 10 IU IM/IV after delivery of baby (WHO first-line) |
| Misoprostol (if oxytocin unavailable) | 600 mcg PO for prevention; 800-1000 mcg sublingual/rectal for treatment | |
| PPH treatment (uterine atony, unresponsive to oxytocin) | Methylergometrine | 0.2 mg IM (avoid in hypertensive patients) |
| Carboprost | 0.25 mg IM, repeat q15min, max 2 mg total | |
| Vaginal candidiasis in pregnancy | Clotrimazole (topical only, avoid oral fluconazole in pregnancy) | 1% cream/pessary OD x 7 days |
| Threatened Preterm Labor (tocolysis - specialist referral) | Nifedipine | 20 mg PO loading, then 10-20 mg q4-6h (short-term tocolysis) |
| Fetal lung maturity (preterm risk 24-34 wks) | Betamethasone | 12 mg IM, 2 doses 24 hrs apart |
Can you make a PDF for me
ls -la /tmp/workspace/opd-notes-template/
~/opd-notes-template/make_drug_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT
styles = getSampleStyleSheet()
title_style = ParagraphStyle("TitleC", parent=styles["Title"], fontSize=16, alignment=TA_CENTER, spaceAfter=2)
sub_style = ParagraphStyle("SubC", parent=styles["Normal"], fontSize=9, alignment=TA_CENTER,
textColor=colors.HexColor("#555555"), spaceAfter=10, fontName="Helvetica-Oblique")
sec_style = ParagraphStyle("Sec", parent=styles["Normal"], fontSize=12, fontName="Helvetica-Bold",
textColor=colors.white, backColor=colors.HexColor("#1F4E79"),
spaceBefore=10, spaceAfter=6, leftIndent=4, borderPadding=4)
cell_style = ParagraphStyle("Cell", parent=styles["Normal"], fontSize=8.5, leading=10.5)
cell_bold = ParagraphStyle("CellBold", parent=cell_style, fontName="Helvetica-Bold")
note_style = ParagraphStyle("Note", parent=styles["Normal"], fontSize=8.5, leading=11,
textColor=colors.HexColor("#333333"))
warn_style = ParagraphStyle("Warn", parent=styles["Normal"], fontSize=9, leading=12,
textColor=colors.HexColor("#7A1F1F"), fontName="Helvetica-Bold")
src_style = ParagraphStyle("Src", parent=styles["Normal"], fontSize=7.5, leading=9.5,
textColor=colors.HexColor("#666666"), fontName="Helvetica-Oblique")
def P(text, style=cell_style):
return Paragraph(text, style)
def make_drug_table(rows):
header = [P("Complaint", cell_bold), P("Drug Suggestion", cell_bold), P("Dose", cell_bold)]
data = [header]
for complaint, drug, dose in rows:
data.append([P(complaint), P(drug), P(dose)])
t = Table(data, colWidths=[1.7*inch, 2.0*inch, 3.1*inch], repeatRows=1)
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#DCE6F1")),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#999999")),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 4),
("BOTTOMPADDING", (0, 0), (-1, -1), 4),
("LEFTPADDING", (0, 0), (-1, -1), 5),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.white, colors.HexColor("#F7F9FC")]),
]))
return t
elements = []
# ===== Title / Disclaimer =====
elements.append(Paragraph("GYNE & OBS OPD DRUG QUICK-REFERENCE", title_style))
elements.append(Paragraph("Complaint-wise drug suggestions and doses", sub_style))
disclaimer = ("CAUTION: Standard/common starting doses from major textbooks and guidelines "
"(CDC, WHO, ACOG-referenced sources). Always adjust for renal/hepatic function, "
"allergies, trimester of pregnancy, local resistance patterns, and institutional protocol. "
"This is a quick-reference aid, not a substitute for clinical judgment on an individual patient.")
elements.append(Paragraph(disclaimer, warn_style))
elements.append(Spacer(1, 8))
# ===== Section A: Gynecology =====
elements.append(Paragraph("A. GYNECOLOGY OPD", sec_style))
gyne_rows = [
("Dysmenorrhea", "Mefenamic acid", "500 mg PO TID, start at onset of pain/menses"),
("", "Ibuprofen", "400 mg PO TID with food"),
("", "Naproxen", "500 mg loading, then 250 mg q6-8h"),
("Abnormal Uterine Bleeding (AUB) / Menorrhagia", "Tranexamic acid", "1000-1300 mg PO TID for up to 5 days during heavy flow"),
("", "NSAID (mefenamic acid)", "500 mg TID during bleeding days"),
("", "Combined OCP", "1 tab OD as per pack cycle"),
("", "Levonorgestrel IUD", "Long-term option - insertion, not oral dosing"),
("Vulvovaginal Candidiasis", "Fluconazole", "150 mg PO single dose"),
("", "Clotrimazole vaginal", "1% cream/pessary OD x 6 days, or 500 mg pessary single dose"),
("Bacterial Vaginosis", "Metronidazole", "500 mg PO BID x 7 days, or vaginal gel 0.75% OD x 5 days"),
("Trichomoniasis", "Metronidazole", "2 g PO single dose, or 500 mg BID x 7 days (treat partner too)"),
("Pelvic Inflammatory Disease (PID)", "Ceftriaxone + Doxycycline + Metronidazole",
"Ceftriaxone 500 mg IM single dose + Doxycycline 100 mg PO BID x14 days + Metronidazole 500 mg PO BID x14 days"),
("Iron Deficiency Anemia (menorrhagia-related)", "Ferrous sulfate", "325 mg PO BID-TID (65 mg elemental iron/dose)"),
("Recurrent Vulvovaginal Candidiasis (prophylaxis)", "Fluconazole", "150-200 mg PO weekly (maintenance)"),
("Emergency Contraception", "Levonorgestrel", "1.5 mg PO single dose within 72 hrs (most effective <24 hrs)"),
("Regular Contraception", "Combined OCP", "1 tab OD, cyclical"),
("Vaginal atrophy / menopausal vaginitis", "Topical estrogen cream", "Low-dose applicator, 2-3x/week per product instructions"),
("Vasomotor symptoms (menopause)", "HRT (estrogen +/- progestin)", "Lowest effective dose, individualized"),
]
elements.append(make_drug_table(gyne_rows))
elements.append(PageBreak())
# ===== Section B: Obstetrics =====
elements.append(Paragraph("B. OBSTETRICS OPD (ANTENATAL)", sec_style))
obs_rows = [
("Routine antenatal supplementation", "Ferrous sulfate/fumarate + Folic acid",
"Elemental iron 30-60 mg/day (WHO) + Folic acid 400-800 mcg OD"),
("", "Calcium + Vitamin D", "500-1000 mg elemental calcium OD-BID"),
("Iron Deficiency Anemia in pregnancy", "Ferrous sulfate", "325 mg PO OD-BID; consider IV iron if intolerant/severe"),
("Nausea and Vomiting of Pregnancy (mild)", "Doxylamine + Pyridoxine (Vit B6)",
"10 mg + 10 mg PO, 1-2 tabs at bedtime (first-line, safe in pregnancy)"),
("Hyperemesis Gravidarum (moderate-severe)", "Ondansetron", "4 mg PO/IV every 8 hours"),
("", "Metoclopramide", "10 mg PO/IV TID (alternative)"),
("Threatened Miscarriage", "(No proven effective drug per evidence)",
"Bed rest/progesterone often used clinically but no demonstrated efficacy - counsel accordingly"),
("Gestational Hypertension / Pre-eclampsia (non-severe, outpatient)", "Labetalol", "100-200 mg PO BID-TID (titrate)"),
("", "Nifedipine (extended release)", "10-20 mg PO BID"),
("", "Methyldopa", "250 mg PO BID-TID"),
("Severe Pre-eclampsia / Eclampsia (seizure prophylaxis - admit, not OPD)", "Magnesium sulfate",
"Loading 4-6 g IV over 15-20 min, then maintenance 1-2 g/hr IV (refer/admit immediately)"),
("Urinary Tract Infection in pregnancy", "Cephalexin", "500 mg PO BID-QID x 5-7 days"),
("", "Nitrofurantoin (avoid near term)", "100 mg PO BID x 5-7 days"),
("Postpartum Hemorrhage prevention (3rd stage)", "Oxytocin", "10 IU IM/IV after delivery of baby (WHO first-line)"),
("", "Misoprostol (if oxytocin unavailable)", "600 mcg PO for prevention; 800-1000 mcg sublingual/rectal for treatment"),
("PPH treatment (uterine atony, unresponsive to oxytocin)", "Methylergometrine",
"0.2 mg IM (avoid in hypertensive patients)"),
("", "Carboprost", "0.25 mg IM, repeat q15min, max 2 mg total"),
("Vaginal candidiasis in pregnancy", "Clotrimazole (topical only, avoid oral fluconazole)", "1% cream/pessary OD x 7 days"),
("Threatened Preterm Labor (tocolysis - specialist referral)", "Nifedipine",
"20 mg PO loading, then 10-20 mg q4-6h (short-term tocolysis)"),
("Fetal lung maturity (preterm risk 24-34 wks)", "Betamethasone", "12 mg IM, 2 doses 24 hrs apart"),
]
elements.append(make_drug_table(obs_rows))
elements.append(Spacer(1, 10))
# ===== Safety notes =====
elements.append(Paragraph("Quick Safety Notes", sec_style))
notes = [
"Avoid NSAIDs (mefenamic acid, ibuprofen) after 20 weeks gestation (fetal renal effects) and near term (premature ductus closure).",
"Avoid oral fluconazole and doxycycline/tetracyclines in pregnancy.",
"MgSO4 and severe pre-eclampsia/eclampsia management belongs in an inpatient/emergency setting, not routine OPD - listed here for reference/counseling only.",
"PID and STI regimens should prompt partner treatment and STI screening (HIV, syphilis).",
"Always cross-check with local antibiotic resistance data and formulary before prescribing.",
]
for n in notes:
elements.append(Paragraph("• " + n, note_style))
elements.append(Spacer(1, 2))
elements.append(Spacer(1, 10))
elements.append(Paragraph(
"Sources referenced: CDC STI Treatment Guidelines 2021 (PID regimen), WHO uterotonic recommendations "
"(PPH prevention), Berek & Novak's Gynecology (AUB, threatened abortion), Harrison's Principles of "
"Internal Medicine 22nd ed. (dysmenorrhea), Goldman-Cecil Medicine (hyperemesis, eclampsia), Rosen's "
"Emergency Medicine (eclampsia management box).", src_style))
doc = SimpleDocTemplate("/tmp/workspace/opd-notes-template/OG_OPD_Drug_Reference.pdf",
pagesize=A4,
topMargin=0.5*inch, bottomMargin=0.5*inch,
leftMargin=0.6*inch, rightMargin=0.6*inch)
doc.build(elements)
print("drug reference pdf saved")
cd /tmp/workspace/opd-notes-template && python3 make_drug_pdf.py && ls -la
OG OPD Drug Reference
PDF Document · PDF
/tmp/workspace/opd-notes-template/:OG_OPD_Note_Templates.docx / .pdf - the history-taking OPD note proformasOG_OPD_Drug_Reference.pdf - this new drug quick-referenceDrugs that are use in Pakistan
Pakistan brand names mefenamic acid tranexamic acid fluconazole metronidazole gynecology
Pakistan brand names oxytocin misoprostol methylergometrine obstetrics drugs
Pakistan brand names doxylamine pyridoxine ferrous sulfate folic acid antenatal vitamins
https://pk.gsk.com/en-pk/products/products-a-z
| Generic | Common Pakistani Brand(s) | Manufacturer |
|---|---|---|
| Mefenamic acid | Ponstan, Mefac | Pfizer/Viatris, Various |
| Tranexamic acid | Transamin, Trapic | Getz Pharma, Various |
| Ibuprofen | Brufen | Abbott |
| Fluconazole | Zolanix, Diflucan, Flucos | GSK Pakistan, Pfizer, Various |
| Clotrimazole (vaginal) | Candid-V, Clocip | Glenmark, Various |
| Metronidazole | Flagyl, Metryl, Amrizole | Sanofi, Various |
| Doxycycline | Doxef, Vibramycin | Various, Pfizer |
| Ceftriaxone | Traxon, Rocephin | GSK Pakistan, Roche |
| Ferrous sulfate/fumarate + Folic acid | Fefol Spansule, Fefol-Vit | GSK Pakistan |
| Levonorgestrel (emergency contraception) | Postinor-2, i-Pill | Various |
| Combined OCP | Yasmin, Diane-35, Marvelon | Bayer, Organon |
| Levonorgestrel IUD | Mirena | Bayer |
| Generic | Common Pakistani Brand(s) | Manufacturer |
|---|---|---|
| Ferrous fumarate + Folic acid (antenatal) | Fefol Spansule, Folart, Obimin | GSK Pakistan, Various |
| Calcium + Vitamin D | Calcium Sandoz, Caltrate, Os-Cal | Novartis, Various |
| Doxylamine + Pyridoxine (+ Dicyclomine, morning sickness) | Navidoxine | Barrett Hodgson Pakistan |
| Ondansetron | Onset, Emeset | Getz Pharma, Various |
| Metoclopramide | Maxolon, Gastrolon | Sanofi, Various |
| Methyldopa | Aldomet, Dopamet | Organon/MSD legacy brands, Various |
| Nifedipine | Adalat, Adalat Retard, Nifecard | Bayer, Various |
| Labetalol | Less commonly stocked; Methyldopa/Nifedipine preferred first-line in most Pakistani obstetric units | - |
| Magnesium sulfate | MgSO4 injection (generic, hospital pharmacy stock) | Various local manufacturers |
| Cephalexin | Ceporex, Sporidex | GSK Pakistan, Various |
| Nitrofurantoin | Furadantin (limited availability - check local stock) | Various |
| Oxytocin | Syntocinon | Novartis |
| Misoprostol | Cytotec, Mizotec | Pfizer (legacy), Various local |
| Methylergometrine | Methergin, Ergomet | Novartis, Various |
| Betamethasone | Betnesol, Celestone | GSK Pakistan, Various |
Can you just make the presenting complain with drugs suggestions available in Pakistan and doses all in one place in pdf
ls -la /tmp/workspace/opd-notes-template/
~/opd-notes-template/make_pakistan_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER
styles = getSampleStyleSheet()
title_style = ParagraphStyle("TitleC", parent=styles["Title"], fontSize=15, alignment=TA_CENTER, spaceAfter=2)
sub_style = ParagraphStyle("SubC", parent=styles["Normal"], fontSize=9, alignment=TA_CENTER,
textColor=colors.HexColor("#555555"), spaceAfter=8, fontName="Helvetica-Oblique")
sec_style = ParagraphStyle("Sec", parent=styles["Normal"], fontSize=12, fontName="Helvetica-Bold",
textColor=colors.white, backColor=colors.HexColor("#1F4E79"),
spaceBefore=10, spaceAfter=6, leftIndent=4, borderPadding=4)
cell_style = ParagraphStyle("Cell", parent=styles["Normal"], fontSize=7.8, leading=9.6)
cell_bold = ParagraphStyle("CellBold", parent=cell_style, fontName="Helvetica-Bold")
note_style = ParagraphStyle("Note", parent=styles["Normal"], fontSize=8.3, leading=10.8,
textColor=colors.HexColor("#333333"))
warn_style = ParagraphStyle("Warn", parent=styles["Normal"], fontSize=8.8, leading=11.5,
textColor=colors.HexColor("#7A1F1F"), fontName="Helvetica-Bold")
src_style = ParagraphStyle("Src", parent=styles["Normal"], fontSize=7.2, leading=9,
textColor=colors.HexColor("#666666"), fontName="Helvetica-Oblique")
def P(text, style=cell_style):
return Paragraph(text, style)
def make_table(rows):
header = [P("Presenting Complaint", cell_bold), P("Drug (Generic)", cell_bold),
P("Pakistan Brand", cell_bold), P("Dose", cell_bold)]
data = [header]
for complaint, drug, brand, dose in rows:
data.append([P(complaint), P(drug), P(brand), P(dose)])
t = Table(data, colWidths=[1.55*inch, 1.35*inch, 1.25*inch, 2.55*inch], repeatRows=1)
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#DCE6F1")),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#999999")),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 3.5),
("BOTTOMPADDING", (0, 0), (-1, -1), 3.5),
("LEFTPADDING", (0, 0), (-1, -1), 4),
("RIGHTPADDING", (0, 0), (-1, -1), 4),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.white, colors.HexColor("#F7F9FC")]),
]))
return t
elements = []
elements.append(Paragraph("GYNE & OBS OPD DRUG REFERENCE - PAKISTAN", title_style))
elements.append(Paragraph("Presenting complaint, generic drug, Pakistani brand, and dose - all in one place", sub_style))
disclaimer = ("CAUTION: Brand availability changes and multiple manufacturers may market the same generic in "
"Pakistan. Verify current stock, DRAP registration, and price with your local pharmacy/MIMS Pakistan "
"before prescribing. Always adjust for renal/hepatic function, allergy history, trimester of pregnancy, "
"and institutional protocol. This is a quick-reference aid, not a substitute for clinical judgment.")
elements.append(Paragraph(disclaimer, warn_style))
elements.append(Spacer(1, 8))
# ===== GYNECOLOGY =====
elements.append(Paragraph("A. GYNECOLOGY OPD", sec_style))
gyne_rows = [
("Dysmenorrhea", "Mefenamic acid", "Ponstan, Mefac", "500 mg PO TID, start at onset of pain/menses"),
("", "Ibuprofen", "Brufen", "400 mg PO TID with food"),
("Abnormal Uterine Bleeding (AUB) / Menorrhagia", "Tranexamic acid", "Transamin, Trapic",
"1000-1300 mg PO TID for up to 5 days during heavy flow"),
("", "Mefenamic acid (NSAID)", "Ponstan, Mefac", "500 mg TID during bleeding days"),
("", "Combined OCP", "Yasmin, Diane-35, Marvelon", "1 tab OD as per pack cycle"),
("", "Levonorgestrel IUD", "Mirena", "Long-term option - insertion, not oral dosing"),
("Vulvovaginal Candidiasis", "Fluconazole", "Zolanix, Diflucan, Flucos", "150 mg PO single dose"),
("", "Clotrimazole vaginal", "Candid-V, Clocip", "1% cream/pessary OD x 6 days, or 500 mg pessary single dose"),
("Bacterial Vaginosis", "Metronidazole", "Flagyl, Metryl, Amrizole", "500 mg PO BID x 7 days, or vaginal gel 0.75% OD x 5 days"),
("Trichomoniasis", "Metronidazole", "Flagyl, Metryl", "2 g PO single dose, or 500 mg BID x 7 days (treat partner too)"),
("Pelvic Inflammatory Disease (PID)", "Ceftriaxone", "Traxon, Rocephin", "500 mg IM single dose"),
("", "+ Doxycycline", "Doxef, Vibramycin", "100 mg PO BID x 14 days"),
("", "+ Metronidazole", "Flagyl, Metryl", "500 mg PO BID x 14 days"),
("Iron Deficiency Anemia (menorrhagia-related)", "Ferrous sulfate/fumarate + Folic acid", "Fefol Spansule, Fefol-Vit",
"1 capsule OD-BID (150 mg iron + 0.5 mg folic acid per dose)"),
("Recurrent Vulvovaginal Candidiasis (prophylaxis)", "Fluconazole", "Zolanix, Diflucan", "150-200 mg PO weekly (maintenance)"),
("Emergency Contraception", "Levonorgestrel", "Postinor-2, i-Pill", "1.5 mg PO single dose within 72 hrs (best <24 hrs)"),
("Regular Contraception", "Combined OCP", "Yasmin, Diane-35, Marvelon", "1 tab OD, cyclical"),
("Vaginal atrophy / menopausal vaginitis", "Topical estrogen cream", "Premarin cream (where available)",
"Low-dose applicator, 2-3x/week per product instructions"),
("Vasomotor symptoms (menopause)", "HRT (estrogen +/- progestin)", "Premarin, Angeliq (where available)",
"Lowest effective dose, individualized"),
]
elements.append(make_table(gyne_rows))
elements.append(PageBreak())
# ===== OBSTETRICS =====
elements.append(Paragraph("B. OBSTETRICS OPD (ANTENATAL)", sec_style))
obs_rows = [
("Routine antenatal supplementation", "Ferrous fumarate + Folic acid", "Fefol Spansule, Folart, Obimin",
"1 capsule/tablet OD (approx. 150 mg iron + 0.5 mg folic acid)"),
("", "Calcium + Vitamin D", "Calcium Sandoz, Caltrate, Os-Cal", "500-1000 mg elemental calcium OD-BID"),
("Iron Deficiency Anemia in pregnancy", "Ferrous sulfate", "Fefol Spansule", "1 capsule OD-BID; consider IV iron if intolerant/severe"),
("Nausea and Vomiting of Pregnancy (mild)", "Doxylamine + Pyridoxine (+ Dicyclomine)", "Navidoxine",
"1 tab at bedtime, may increase to BID (first-line, safe in pregnancy)"),
("Hyperemesis Gravidarum (moderate-severe)", "Ondansetron", "Onset, Emeset", "4 mg PO/IV every 8 hours"),
("", "Metoclopramide", "Maxolon, Gastrolon", "10 mg PO/IV TID (alternative)"),
("Threatened Miscarriage", "(No proven effective drug per evidence)", "-",
"Bed rest/progesterone often used clinically but no demonstrated efficacy - counsel accordingly"),
("Gestational Hypertension / Pre-eclampsia (non-severe, outpatient)", "Methyldopa", "Aldomet, Dopamet",
"250 mg PO BID-TID"),
("", "Nifedipine (extended release)", "Adalat Retard, Nifecard", "10-20 mg PO BID"),
("", "Labetalol (less commonly stocked)", "-", "100-200 mg PO BID-TID if available"),
("Severe Pre-eclampsia / Eclampsia (admit, not OPD)", "Magnesium sulfate", "MgSO4 injection (generic)",
"Loading 4-6 g IV over 15-20 min, then maintenance 1-2 g/hr IV - refer/admit immediately"),
("Urinary Tract Infection in pregnancy", "Cephalexin", "Ceporex, Sporidex", "500 mg PO BID-QID x 5-7 days"),
("", "Nitrofurantoin (avoid near term, limited stock)", "Furadantin", "100 mg PO BID x 5-7 days"),
("Postpartum Hemorrhage prevention (3rd stage)", "Oxytocin", "Syntocinon", "10 IU IM/IV after delivery of baby"),
("", "Misoprostol (if oxytocin unavailable)", "Cytotec, Mizotec", "600 mcg PO for prevention; 800-1000 mcg sublingual/rectal for treatment"),
("PPH treatment (uterine atony, unresponsive to oxytocin)", "Methylergometrine", "Methergin, Ergomet",
"0.2 mg IM (avoid in hypertensive patients)"),
("Vaginal candidiasis in pregnancy", "Clotrimazole (topical only)", "Candid-V, Clocip", "1% cream/pessary OD x 7 days"),
("Threatened Preterm Labor (tocolysis - specialist referral)", "Nifedipine", "Adalat, Nifecard",
"20 mg PO loading, then 10-20 mg q4-6h (short-term tocolysis)"),
("Fetal lung maturity (preterm risk 24-34 wks)", "Betamethasone", "Betnesol, Celestone", "12 mg IM, 2 doses 24 hrs apart"),
]
elements.append(make_table(obs_rows))
elements.append(Spacer(1, 8))
elements.append(Paragraph("Quick Safety Notes", sec_style))
notes = [
"Avoid NSAIDs (mefenamic acid, ibuprofen) after 20 weeks gestation and near term.",
"Avoid oral fluconazole and doxycycline/tetracyclines in pregnancy - use topical antifungals and alternative antibiotics.",
"MgSO4 for severe pre-eclampsia/eclampsia is inpatient/emergency management only - refer, do not manage in OPD.",
"PID and STI regimens should prompt partner treatment and STI screening.",
"Multiple brands exist per generic in Pakistan - confirm current availability with your pharmacy before prescribing.",
]
for n in notes:
elements.append(Paragraph("• " + n, note_style))
elements.append(Spacer(1, 2))
elements.append(Spacer(1, 8))
elements.append(Paragraph(
"Sources: CDC STI Treatment Guidelines 2021, WHO uterotonic recommendations, Berek & Novak's Gynecology, "
"Harrison's Principles of Internal Medicine 22nd ed., Goldman-Cecil Medicine, Rosen's Emergency Medicine, "
"and GSK Pakistan product listings (Fefol, Zolanix, Traxon) cross-checked for local brand names.", src_style))
doc = SimpleDocTemplate("/tmp/workspace/opd-notes-template/OG_OPD_Drug_Reference_Pakistan.pdf",
pagesize=A4,
topMargin=0.5*inch, bottomMargin=0.5*inch,
leftMargin=0.5*inch, rightMargin=0.5*inch)
doc.build(elements)
print("combined Pakistan drug reference pdf saved")
cd /tmp/workspace/opd-notes-template && python3 make_pakistan_pdf.py && ls -la
OG OPD Drug Reference Pakistan
PDF Document · PDF
??
OG OPD Drug Reference Pakistan
PDF Document · PDF
1
You replied '1' - which option did you mean?
| Element | What to explore | Why it matters |
|---|---|---|
| Menstrual history | Menarche, menopause, bleeding pattern, meds affecting bleeding | Endocrine, structural, infectious, oncologic clues |
| Obstetric history | Number of pregnancies, dates, delivery type, losses, complications | Predisposes to certain conditions (e.g., gestational trophoblastic disease), surgical risk |
| Sexual history | Partners, practices, protection, pregnancy intention | STI risk, testing sites, counseling |
| Contraceptive history | Current/past use, type, duration | Pregnancy risk during procedures, side effects |
| Cytologic screening | Frequency, results | Cervical cancer screening status |
Name/Age: Date:
C/O (Chief complaint): ______ x ___ days
MENSTRUAL Hx:
Menarche: __yrs LMP: __/__/__ Cycle: __/__ (regular/irreg)
Flow: nl/exc/scanty Clots: Y/N Dysmenorrhea: Y/N
Menopause: __yrs (if applicable)
OBS Hx: G_P_L_A_ (Gravida/Para/Living/Abortion)
Mode of delivery(s): ____ Last delivery: __ yrs ago
CONTRACEPTION: current method: ____ duration: ____
SEXUAL Hx: active/not active partners: __ dyspareunia: Y/N
PAST GYNAE Hx: Pap smear - date/result: ____
Prior surgery: ____ Infections/STI: ____
P/M Hx (Past medical): DM/HTN/Thyroid/TB - circle if present
DRUG Hx: ____ ALLERGY: ____
FAMILY Hx: ____ (breast/ovarian ca, DM, HTN)
O/E:
GC: ____ P: __ BP: __/__ Pallor: +/-
P/A: soft/tender, mass ___, organomegaly
P/S (speculum): cervix - healthy/erosion/discharge
P/V (bimanual): uterus - size/pos/mobility, adnexa - free/tender/mass
Provisional Dx: ____
Plan: Investigations / Rx / Follow-up
Name/Age: Date:
G_P_L_A_ LMP: __/__/__ EDD: __/__/__ (Naegele's rule)
POG (period of gestation) today: __ wks __ days (by dates/USG)
C/O: ____ (fetal movements, pain, leaking, bleeding, swelling)
CURRENT PREGNANCY:
Booking visit: __ wks ANC visits: __
USG dating: __ wks (if differs from LMP, use USG dates)
Complications so far: PIH/GDM/Anemia/PROM/none
Immunization: TT1/TT2 done Anti-D given (if Rh-neg): Y/N
PAST OBS Hx (for each pregnancy):
Yr | POG at delivery | Mode | Wt | Sex | Complication | Outcome
___|________________|______|____|_____|______________|________
PAST MEDICAL/SURGICAL Hx: ____
DRUG/ALLERGY Hx: ____
FAMILY Hx: ____
O/E:
GC: ____ P: __ BP: __/__ Wt: __ kg Ht: __ cm Pallor/Edema: +/-
P/A: FH (fundal height) = __ wks FHS (fetal heart sounds): +/reg __ bpm
Presentation: ceph/breech/transverse Lie: long/oblique/transverse
Engagement: __/5th Liquor: adequate/reduced (clinical)
Investigations: Hb, urine R/M, BSL, USG, others: ____
Provisional Dx: ____ (e.g., G2P1L1 at __ wks with ____)
Plan: ____
OG OPD Note Templates
Word Document · DOCX
OG OPD Note Templates
PDF Document · PDF
OG OPD Note Templates
Word Document · DOCX
| Complaint | Drug Suggestion | Dose |
|---|---|---|
| Dysmenorrhea | Mefenamic acid | 500 mg PO TID, start at onset of pain/menses |
| Ibuprofen | 400 mg PO TID with food | |
| Naproxen | 500 mg loading, then 250 mg q6-8h | |
| Abnormal Uterine Bleeding (AUB) / Menorrhagia | Tranexamic acid | 1000-1300 mg PO TID for up to 5 days during heavy flow (FDA-approved for ovulatory AUB) |
| NSAID (mefenamic acid) | 500 mg TID during bleeding days | |
| Combined OCP (for hormonal control) | 1 tab OD as per pack cycle | |
| Levonorgestrel IUD | Long-term option - insertion, not oral dosing | |
| Vulvovaginal Candidiasis | Fluconazole | 150 mg PO single dose |
| Clotrimazole vaginal | 1% cream/pessary OD x 6 days, or 500 mg pessary single dose | |
| Bacterial Vaginosis | Metronidazole | 500 mg PO BID x 7 days, or vaginal gel 0.75% OD x 5 days |
| Trichomoniasis | Metronidazole | 2 g PO single dose, or 500 mg BID x 7 days (treat partner too) |
| Pelvic Inflammatory Disease (PID) | Ceftriaxone + Doxycycline + Metronidazole | Ceftriaxone 500 mg IM single dose + Doxycycline 100 mg PO BID x14 days + Metronidazole 500 mg PO BID x14 days (current CDC 2021 regimen - metronidazole now routinely added) |
| Iron Deficiency Anemia (menorrhagia-related) | Ferrous sulfate | 325 mg PO BID-TID (65 mg elemental iron/dose) |
| Recurrent Vulvovaginal Candidiasis (prophylaxis) | Fluconazole | 150-200 mg PO weekly (maintenance) |
| Contraception - Emergency | Levonorgestrel | 1.5 mg PO single dose within 72 hrs (most effective <24 hrs) |
| Contraception - Regular | Combined OCP | 1 tab OD, cyclical |
| Vaginal atrophy/menopausal vaginitis | Topical estrogen cream | Low-dose applicator, 2-3x/week per product instructions |
| Vasomotor symptoms (menopause) | HRT (estrogen +/- progestin) | Lowest effective dose, individualized |
| Complaint | Drug Suggestion | Dose |
|---|---|---|
| Routine antenatal supplementation | Ferrous sulfate/fumarate + Folic acid | Elemental iron 30-60 mg/day (WHO) + Folic acid 400-800 mcg OD |
| Calcium + Vitamin D | 500-1000 mg elemental calcium OD-BID | |
| Iron Deficiency Anemia in pregnancy | Ferrous sulfate | 325 mg PO OD-BID (ACOG/WHO: at least 30 mg elemental iron/day); consider IV iron if intolerant/severe |
| Nausea and Vomiting of Pregnancy (mild) | Doxylamine + Pyridoxine (Vit B6) | 10 mg + 10 mg PO, 1-2 tabs at bedtime (first-line, safe in pregnancy) |
| Hyperemesis Gravidarum (moderate-severe) | Ondansetron | 4 mg PO/IV every 8 hours |
| Metoclopramide | 10 mg PO/IV TID (alternative) | |
| Threatened Miscarriage | (No proven effective drug per evidence) | Bed rest and progesterone are often used clinically but textbooks note no demonstrated efficacy (Berek & Novak's Gynecology) - counsel accordingly, avoid over-promising |
| Gestational Hypertension / Pre-eclampsia (non-severe, outpatient) | Labetalol | 100-200 mg PO BID-TID (titrate) |
| Nifedipine (extended release) | 10-20 mg PO BID | |
| Methyldopa | 250 mg PO BID-TID | |
| Severe Pre-eclampsia / Eclampsia (seizure prophylaxis - inpatient/emergency, not routine OPD) | Magnesium sulfate | Loading 4-6 g IV over 15-20 min, then maintenance 1-2 g/hr IV infusion (or Pritchard IM regimen) - refer/admit immediately, do not manage in OPD |
| Urinary Tract Infection in pregnancy | Cephalexin | 500 mg PO BID-QID x 5-7 days |
| Nitrofurantoin (avoid near term) | 100 mg PO BID x 5-7 days | |
| Postpartum Hemorrhage prevention (3rd stage) | Oxytocin | 10 IU IM/IV after delivery of baby (WHO first-line) |
| Misoprostol (if oxytocin unavailable) | 600 mcg PO for prevention; 800-1000 mcg sublingual/rectal for treatment | |
| PPH treatment (uterine atony, unresponsive to oxytocin) | Methylergometrine | 0.2 mg IM (avoid in hypertensive patients) |
| Carboprost | 0.25 mg IM, repeat q15min, max 2 mg total | |
| Vaginal candidiasis in pregnancy | Clotrimazole (topical only, avoid oral fluconazole in pregnancy) | 1% cream/pessary OD x 7 days |
| Threatened Preterm Labor (tocolysis - specialist referral) | Nifedipine | 20 mg PO loading, then 10-20 mg q4-6h (short-term tocolysis) |
| Fetal lung maturity (preterm risk 24-34 wks) | Betamethasone | 12 mg IM, 2 doses 24 hrs apart |
OG OPD Drug Reference
PDF Document · PDF
/tmp/workspace/opd-notes-template/:OG_OPD_Note_Templates.docx / .pdf - the history-taking OPD note proformasOG_OPD_Drug_Reference.pdf - this new drug quick-reference| Generic | Common Pakistani Brand(s) | Manufacturer |
|---|---|---|
| Mefenamic acid | Ponstan, Mefac | Pfizer/Viatris, Various |
| Tranexamic acid | Transamin, Trapic | Getz Pharma, Various |
| Ibuprofen | Brufen | Abbott |
| Fluconazole | Zolanix, Diflucan, Flucos | GSK Pakistan, Pfizer, Various |
| Clotrimazole (vaginal) | Candid-V, Clocip | Glenmark, Various |
| Metronidazole | Flagyl, Metryl, Amrizole | Sanofi, Various |
| Doxycycline | Doxef, Vibramycin | Various, Pfizer |
| Ceftriaxone | Traxon, Rocephin | GSK Pakistan, Roche |
| Ferrous sulfate/fumarate + Folic acid | Fefol Spansule, Fefol-Vit | GSK Pakistan |
| Levonorgestrel (emergency contraception) | Postinor-2, i-Pill | Various |
| Combined OCP | Yasmin, Diane-35, Marvelon | Bayer, Organon |
| Levonorgestrel IUD | Mirena | Bayer |
| Generic | Common Pakistani Brand(s) | Manufacturer |
|---|---|---|
| Ferrous fumarate + Folic acid (antenatal) | Fefol Spansule, Folart, Obimin | GSK Pakistan, Various |
| Calcium + Vitamin D | Calcium Sandoz, Caltrate, Os-Cal | Novartis, Various |
| Doxylamine + Pyridoxine (+ Dicyclomine, morning sickness) | Navidoxine | Barrett Hodgson Pakistan |
| Ondansetron | Onset, Emeset | Getz Pharma, Various |
| Metoclopramide | Maxolon, Gastrolon | Sanofi, Various |
| Methyldopa | Aldomet, Dopamet | Organon/MSD legacy brands, Various |
| Nifedipine | Adalat, Adalat Retard, Nifecard | Bayer, Various |
| Labetalol | Less commonly stocked; Methyldopa/Nifedipine preferred first-line in most Pakistani obstetric units | - |
| Magnesium sulfate | MgSO4 injection (generic, hospital pharmacy stock) | Various local manufacturers |
| Cephalexin | Ceporex, Sporidex | GSK Pakistan, Various |
| Nitrofurantoin | Furadantin (limited availability - check local stock) | Various |
| Oxytocin | Syntocinon | Novartis |
| Misoprostol | Cytotec, Mizotec | Pfizer (legacy), Various local |
| Methylergometrine | Methergin, Ergomet | Novartis, Various |
| Betamethasone | Betnesol, Celestone | GSK Pakistan, Various |
OG OPD Drug Reference Pakistan
PDF Document · PDF
OG OPD Drug Reference Pakistan
PDF Document · PDF
The 1st one
~/opd-notes-template/make_combined_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, HRFlowable)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER
styles = getSampleStyleSheet()
title_style = ParagraphStyle("TitleC", parent=styles["Title"], fontSize=16, alignment=TA_CENTER, spaceAfter=2)
sub_style = ParagraphStyle("SubC", parent=styles["Normal"], fontSize=9, alignment=TA_CENTER,
textColor=colors.HexColor("#555555"), spaceAfter=10, fontName="Helvetica-Oblique")
sec_style = ParagraphStyle("Sec", parent=styles["Normal"], fontSize=11, fontName="Helvetica-Bold",
textColor=colors.HexColor("#1F4E79"), backColor=colors.HexColor("#DCE6F1"),
spaceBefore=8, spaceAfter=4, leftIndent=3, borderPadding=3)
sec_style2 = ParagraphStyle("Sec2", parent=styles["Normal"], fontSize=12, fontName="Helvetica-Bold",
textColor=colors.white, backColor=colors.HexColor("#1F4E79"),
spaceBefore=10, spaceAfter=6, leftIndent=4, borderPadding=4)
body_style = ParagraphStyle("Body", parent=styles["Normal"], fontSize=10, spaceAfter=4, leading=14)
small_italic = ParagraphStyle("SmallItalic", parent=styles["Normal"], fontSize=8, fontName="Helvetica-Oblique",
textColor=colors.HexColor("#555555"))
cell_style = ParagraphStyle("Cell", parent=styles["Normal"], fontSize=7.8, leading=9.6)
cell_bold = ParagraphStyle("CellBold", parent=cell_style, fontName="Helvetica-Bold")
note_style = ParagraphStyle("Note", parent=styles["Normal"], fontSize=8.3, leading=10.8,
textColor=colors.HexColor("#333333"))
warn_style = ParagraphStyle("Warn", parent=styles["Normal"], fontSize=8.8, leading=11.5,
textColor=colors.HexColor("#7A1F1F"), fontName="Helvetica-Bold")
src_style = ParagraphStyle("Src", parent=styles["Normal"], fontSize=7.2, leading=9,
textColor=colors.HexColor("#666666"), fontName="Helvetica-Oblique")
def blank(label, n=30):
return Paragraph(f"<b>{label}:</b> " + "_"*n, body_style)
def two_col(label1, n1, label2, n2):
return Paragraph(f"<b>{label1}:</b> " + "_"*n1 + " <b>" + label2 + ":</b> " + "_"*n2, body_style)
def checkbox(label, options):
boxes = " ".join([f"☐ {o}" for o in options])
return Paragraph(f"<b>{label}:</b> " + boxes, body_style)
def make_blank_table(headers, nrows, col_widths):
rows = [headers]
for _ in range(nrows):
rows.append([""] * len(headers))
t = Table(rows, colWidths=col_widths, rowHeights=[16] + [18]*nrows)
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#F2F2F2")),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("FONTSIZE", (0, 0), (-1, -1), 8.5),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#999999")),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
]))
return t
def footer_block():
elems = []
elems.append(blank("Provisional Diagnosis", 55))
elems.append(blank("Plan / Advice / Rx", 60))
elems.append(Spacer(1, 4))
for _ in range(3):
elems.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#AAAAAA")))
elems.append(Spacer(1, 8))
elems.append(Paragraph("Doctor's Signature: " + "_"*25 + " Next visit: " + "_"*15, body_style))
return elems
def P(text, style=cell_style):
return Paragraph(text, style)
def make_drug_table(rows):
header = [P("Presenting Complaint", cell_bold), P("Drug (Generic)", cell_bold),
P("Pakistan Brand", cell_bold), P("Dose", cell_bold)]
data = [header]
for complaint, drug, brand, dose in rows:
data.append([P(complaint), P(drug), P(brand), P(dose)])
t = Table(data, colWidths=[1.55*inch, 1.35*inch, 1.25*inch, 2.55*inch], repeatRows=1)
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#DCE6F1")),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#999999")),
("VALIGN", (0, 0), (-1, -1), "TOP"),
("TOPPADDING", (0, 0), (-1, -1), 3.5),
("BOTTOMPADDING", (0, 0), (-1, -1), 3.5),
("LEFTPADDING", (0, 0), (-1, -1), 4),
("RIGHTPADDING", (0, 0), (-1, -1), 4),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.white, colors.HexColor("#F7F9FC")]),
]))
return t
elements = []
# ============ PAGE 1: GYNECOLOGY OPD NOTE ============
elements.append(Paragraph("GYNECOLOGY OPD NOTE", title_style))
elements.append(Paragraph("Quick documentation template", sub_style))
elements.append(Paragraph("Name: " + "_"*30 + " Age: " + "_"*6 + " Date: " + "_"*15, body_style))
elements.append(Paragraph("Marital status: " + "_"*10 + " Occupation: " + "_"*15 + " Reg. No: " + "_"*12, body_style))
elements.append(Paragraph("Chief Complaint(s)", sec_style))
elements.append(Paragraph("_"*100, body_style))
elements.append(Paragraph("_"*100, body_style))
elements.append(Paragraph("Menstrual History", sec_style))
elements.append(two_col("Menarche (yrs)", 6, "LMP", 12))
elements.append(two_col("Cycle length/duration", 10, "Flow (nl/exc/scanty)", 10))
elements.append(checkbox("Dysmenorrhea", ["Yes", "No"]))
elements.append(two_col("Menopause (yrs, if any)", 10, "IMB/PMB", 12))
elements.append(Paragraph("Obstetric History", sec_style))
elements.append(Paragraph("<b>G ___ P ___ L ___ A ___</b> <i>(Gravida / Para / Living / Abortion)</i>", body_style))
elements.append(two_col("Mode of last delivery", 15, "Last delivery (yrs ago)", 8))
elements.append(Paragraph("Contraception & Sexual History", sec_style))
elements.append(two_col("Current method", 12, "Duration", 10))
elements.append(checkbox("Sexually active", ["Yes", "No"]))
elements.append(blank("Dyspareunia / other complaints", 40))
elements.append(Paragraph("Past Gynecological History", sec_style))
elements.append(two_col("Pap smear date/result", 20, "Prior gynae surgery", 20))
elements.append(blank("Infections / STI history", 45))
elements.append(Paragraph("Past Medical / Surgical / Drug / Allergy History", sec_style))
elements.append(checkbox("Comorbidities", ["DM", "HTN", "Thyroid", "TB", "None"]))
elements.append(blank("Drug history", 35))
elements.append(blank("Allergy history", 35))
elements.append(blank("Family history", 45))
elements.append(Paragraph("On Examination", sec_style))
elements.append(two_col("GC", 8, "Pallor", 8))
elements.append(two_col("Pulse", 8, "BP", 10))
elements.append(Spacer(1, 4))
elements.append(make_blank_table(["Exam", "Findings"], 4, [1.6*inch, 5.0*inch]))
elements.append(Spacer(1, 3))
elements.append(Paragraph("(P/A - per abdomen, P/S - per speculum, P/V - per vaginum, Breast)", small_italic))
elements.append(Spacer(1, 6))
elements.extend(footer_block())
elements.append(PageBreak())
# ============ PAGE 2: OBSTETRIC (ANTENATAL) OPD NOTE ============
elements.append(Paragraph("OBSTETRIC (ANTENATAL) OPD NOTE", title_style))
elements.append(Paragraph("Quick documentation template", sub_style))
elements.append(Paragraph("Name: " + "_"*30 + " Age: " + "_"*6 + " Date: " + "_"*15, body_style))
elements.append(Paragraph("Pregnancy Summary", sec_style))
elements.append(Paragraph("<b>G ___ P ___ L ___ A ___</b>", body_style))
elements.append(two_col("LMP", 14, "EDD (Naegele's rule)", 14))
elements.append(two_col("POG today (by dates)", 12, "POG (by USG)", 12))
elements.append(Paragraph("Chief Complaint(s)", sec_style))
elements.append(checkbox("Symptoms", ["Fetal movements +", "Pain", "Leaking", "Bleeding", "Swelling", "None"]))
elements.append(Paragraph("_"*100, body_style))
elements.append(Paragraph("Current Pregnancy Details", sec_style))
elements.append(two_col("Booking visit (wks)", 8, "No. of ANC visits", 8))
elements.append(two_col("USG dating scan (wks)", 10, "TT1 / TT2", 12))
elements.append(checkbox("Complications", ["PIH", "GDM", "Anemia", "PROM", "None"]))
elements.append(checkbox("Rh status", ["Rh +ve", "Rh -ve -> Anti-D given: Yes/No"]))
elements.append(Paragraph("Past Obstetric History", sec_style))
elements.append(Spacer(1, 3))
elements.append(make_blank_table(["Yr", "POG at delivery", "Mode", "Birth wt", "Sex", "Complication", "Outcome"], 3,
[0.6*inch, 1.1*inch, 0.9*inch, 0.8*inch, 0.6*inch, 1.4*inch, 1.1*inch]))
elements.append(Paragraph("Past Medical / Surgical / Drug / Allergy / Family History", sec_style))
elements.append(blank("Past medical/surgical history", 45))
elements.append(blank("Drug / Allergy history", 45))
elements.append(blank("Family history", 45))
elements.append(Paragraph("On Examination", sec_style))
elements.append(two_col("GC", 8, "Pallor / Edema", 10))
elements.append(two_col("Pulse", 8, "BP", 10))
elements.append(two_col("Weight (kg)", 8, "Height (cm)", 8))
elements.append(two_col("Fundal Height (wks)", 10, "FHS (bpm)", 10))
elements.append(two_col("Presentation", 12, "Lie", 10))
elements.append(two_col("Engagement (/5th)", 10, "Liquor (clinical)", 12))
elements.append(Paragraph("Investigations", sec_style))
elements.append(checkbox("Sent", ["Hb", "Urine R/M", "BSL", "USG", "Others:"]))
elements.append(Paragraph("_"*60, body_style))
elements.append(Spacer(1, 6))
elements.extend(footer_block())
elements.append(PageBreak())
# ============ PAGE 3: ABBREVIATION KEY ============
elements.append(Paragraph("QUICK ABBREVIATION KEY", title_style))
elements.append(Paragraph("Common shorthand for O&G OPD notes", sub_style))
abbrevs = [
("G / P / L / A", "Gravida / Para / Living / Abortion"),
("LMP / EDD", "Last Menstrual Period / Expected Date of Delivery"),
("POG", "Period of Gestation"),
("FH / FHS", "Fundal Height / Fetal Heart Sounds"),
("P/A, P/S, P/V", "Per Abdomen, Per Speculum, Per Vaginum"),
("PIH, GDM, PROM", "Pregnancy-Induced Hypertension, Gestational Diabetes, Premature Rupture of Membranes"),
("C/O", "Complains of"),
("O/E", "On Examination"),
("Ceph / Breech", "Cephalic / Breech presentation"),
("IMB / PMB", "Intermenstrual Bleeding / Postmenopausal Bleeding"),
("TT1 / TT2", "Tetanus Toxoid dose 1 / dose 2"),
("GC", "General Condition"),
]
data_rows = [[Paragraph(f"<b>{a}</b>", body_style), Paragraph(b, body_style)] for a, b in abbrevs]
t = Table([["Abbreviation", "Meaning"]] + data_rows, colWidths=[1.8*inch, 5.0*inch])
t.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#F2F2F2")),
("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
("FONTSIZE", (0, 0), (-1, -1), 9.5),
("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#999999")),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("ALIGN", (0, 0), (-1, 0), "CENTER"),
("TOPPADDING", (0, 0), (-1, -1), 4),
("BOTTOMPADDING", (0, 0), (-1, -1), 4),
]))
elements.append(t)
elements.append(PageBreak())
# ============ PAGE 4: DRUG REFERENCE - GYNECOLOGY ============
elements.append(Paragraph("GYNE & OBS OPD DRUG REFERENCE - PAKISTAN", title_style))
elements.append(Paragraph("Presenting complaint, generic drug, Pakistani brand, and dose - all in one place", sub_style))
disclaimer = ("CAUTION: Brand availability changes and multiple manufacturers may market the same generic in "
"Pakistan. Verify current stock, DRAP registration, and price with your local pharmacy/MIMS Pakistan "
"before prescribing. Always adjust for renal/hepatic function, allergy history, trimester of pregnancy, "
"and institutional protocol. This is a quick-reference aid, not a substitute for clinical judgment.")
elements.append(Paragraph(disclaimer, warn_style))
elements.append(Spacer(1, 8))
elements.append(Paragraph("A. GYNECOLOGY OPD", sec_style2))
gyne_rows = [
("Dysmenorrhea", "Mefenamic acid", "Ponstan, Mefac", "500 mg PO TID, start at onset of pain/menses"),
("", "Ibuprofen", "Brufen", "400 mg PO TID with food"),
("Abnormal Uterine Bleeding (AUB) / Menorrhagia", "Tranexamic acid", "Transamin, Trapic",
"1000-1300 mg PO TID for up to 5 days during heavy flow"),
("", "Mefenamic acid (NSAID)", "Ponstan, Mefac", "500 mg TID during bleeding days"),
("", "Combined OCP", "Yasmin, Diane-35, Marvelon", "1 tab OD as per pack cycle"),
("", "Levonorgestrel IUD", "Mirena", "Long-term option - insertion, not oral dosing"),
("Vulvovaginal Candidiasis", "Fluconazole", "Zolanix, Diflucan, Flucos", "150 mg PO single dose"),
("", "Clotrimazole vaginal", "Candid-V, Clocip", "1% cream/pessary OD x 6 days, or 500 mg pessary single dose"),
("Bacterial Vaginosis", "Metronidazole", "Flagyl, Metryl, Amrizole", "500 mg PO BID x 7 days, or vaginal gel 0.75% OD x 5 days"),
("Trichomoniasis", "Metronidazole", "Flagyl, Metryl", "2 g PO single dose, or 500 mg BID x 7 days (treat partner too)"),
("Pelvic Inflammatory Disease (PID)", "Ceftriaxone", "Traxon, Rocephin", "500 mg IM single dose"),
("", "+ Doxycycline", "Doxef, Vibramycin", "100 mg PO BID x 14 days"),
("", "+ Metronidazole", "Flagyl, Metryl", "500 mg PO BID x 14 days"),
("Iron Deficiency Anemia (menorrhagia-related)", "Ferrous sulfate/fumarate + Folic acid", "Fefol Spansule, Fefol-Vit",
"1 capsule OD-BID (150 mg iron + 0.5 mg folic acid per dose)"),
("Recurrent Vulvovaginal Candidiasis (prophylaxis)", "Fluconazole", "Zolanix, Diflucan", "150-200 mg PO weekly (maintenance)"),
("Emergency Contraception", "Levonorgestrel", "Postinor-2, i-Pill", "1.5 mg PO single dose within 72 hrs (best <24 hrs)"),
("Regular Contraception", "Combined OCP", "Yasmin, Diane-35, Marvelon", "1 tab OD, cyclical"),
("Vaginal atrophy / menopausal vaginitis", "Topical estrogen cream", "Premarin cream (where available)",
"Low-dose applicator, 2-3x/week per product instructions"),
("Vasomotor symptoms (menopause)", "HRT (estrogen +/- progestin)", "Premarin, Angeliq (where available)",
"Lowest effective dose, individualized"),
]
elements.append(make_drug_table(gyne_rows))
elements.append(PageBreak())
# ============ PAGE 5: DRUG REFERENCE - OBSTETRICS ============
elements.append(Paragraph("B. OBSTETRICS OPD (ANTENATAL)", sec_style2))
obs_rows = [
("Routine antenatal supplementation", "Ferrous fumarate + Folic acid", "Fefol Spansule, Folart, Obimin",
"1 capsule/tablet OD (approx. 150 mg iron + 0.5 mg folic acid)"),
("", "Calcium + Vitamin D", "Calcium Sandoz, Caltrate, Os-Cal", "500-1000 mg elemental calcium OD-BID"),
("Iron Deficiency Anemia in pregnancy", "Ferrous sulfate", "Fefol Spansule", "1 capsule OD-BID; consider IV iron if intolerant/severe"),
("Nausea and Vomiting of Pregnancy (mild)", "Doxylamine + Pyridoxine (+ Dicyclomine)", "Navidoxine",
"1 tab at bedtime, may increase to BID (first-line, safe in pregnancy)"),
("Hyperemesis Gravidarum (moderate-severe)", "Ondansetron", "Onset, Emeset", "4 mg PO/IV every 8 hours"),
("", "Metoclopramide", "Maxolon, Gastrolon", "10 mg PO/IV TID (alternative)"),
("Threatened Miscarriage", "(No proven effective drug per evidence)", "-",
"Bed rest/progesterone often used clinically but no demonstrated efficacy - counsel accordingly"),
("Gestational Hypertension / Pre-eclampsia (non-severe, outpatient)", "Methyldopa", "Aldomet, Dopamet",
"250 mg PO BID-TID"),
("", "Nifedipine (extended release)", "Adalat Retard, Nifecard", "10-20 mg PO BID"),
("", "Labetalol (less commonly stocked)", "-", "100-200 mg PO BID-TID if available"),
("Severe Pre-eclampsia / Eclampsia (admit, not OPD)", "Magnesium sulfate", "MgSO4 injection (generic)",
"Loading 4-6 g IV over 15-20 min, then maintenance 1-2 g/hr IV - refer/admit immediately"),
("Urinary Tract Infection in pregnancy", "Cephalexin", "Ceporex, Sporidex", "500 mg PO BID-QID x 5-7 days"),
("", "Nitrofurantoin (avoid near term, limited stock)", "Furadantin", "100 mg PO BID x 5-7 days"),
("Postpartum Hemorrhage prevention (3rd stage)", "Oxytocin", "Syntocinon", "10 IU IM/IV after delivery of baby"),
("", "Misoprostol (if oxytocin unavailable)", "Cytotec, Mizotec", "600 mcg PO for prevention; 800-1000 mcg sublingual/rectal for treatment"),
("PPH treatment (uterine atony, unresponsive to oxytocin)", "Methylergometrine", "Methergin, Ergomet",
"0.2 mg IM (avoid in hypertensive patients)"),
("Vaginal candidiasis in pregnancy", "Clotrimazole (topical only)", "Candid-V, Clocip", "1% cream/pessary OD x 7 days"),
("Threatened Preterm Labor (tocolysis - specialist referral)", "Nifedipine", "Adalat, Nifecard",
"20 mg PO loading, then 10-20 mg q4-6h (short-term tocolysis)"),
("Fetal lung maturity (preterm risk 24-34 wks)", "Betamethasone", "Betnesol, Celestone", "12 mg IM, 2 doses 24 hrs apart"),
]
elements.append(make_drug_table(obs_rows))
elements.append(Spacer(1, 8))
elements.append(Paragraph("Quick Safety Notes", sec_style2))
notes = [
"Avoid NSAIDs (mefenamic acid, ibuprofen) after 20 weeks gestation and near term.",
"Avoid oral fluconazole and doxycycline/tetracyclines in pregnancy - use topical antifungals and alternative antibiotics.",
"MgSO4 for severe pre-eclampsia/eclampsia is inpatient/emergency management only - refer, do not manage in OPD.",
"PID and STI regimens should prompt partner treatment and STI screening.",
"Multiple brands exist per generic in Pakistan - confirm current availability with your pharmacy before prescribing.",
]
for n in notes:
elements.append(Paragraph("• " + n, note_style))
elements.append(Spacer(1, 2))
elements.append(Spacer(1, 8))
elements.append(Paragraph(
"Sources: CDC STI Treatment Guidelines 2021, WHO uterotonic recommendations, Berek & Novak's Gynecology, "
"Harrison's Principles of Internal Medicine 22nd ed., Goldman-Cecil Medicine, Rosen's Emergency Medicine, "
"and GSK Pakistan product listings (Fefol, Zolanix, Traxon) cross-checked for local brand names.", src_style))
doc = SimpleDocTemplate("/tmp/workspace/opd-notes-template/OG_OPD_Complete_Booklet.pdf",
pagesize=A4,
topMargin=0.5*inch, bottomMargin=0.5*inch,
leftMargin=0.55*inch, rightMargin=0.55*inch)
doc.build(elements)
print("combined booklet pdf saved")
cd /tmp/workspace/opd-notes-template && python3 make_combined_pdf.py && ls -la
~/opd-notes-template/make_combined_docx.py
from docx import Document
from docx.shared import Pt, Inches, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.enum.table import WD_TABLE_ALIGNMENT
from docx.oxml.ns import qn
from docx.oxml import OxmlElement
def set_cell_border(cell):
tc = cell._tc
tcPr = tc.get_or_add_tcPr()
tcBorders = OxmlElement('w:tcBorders')
for edge in ('top', 'left', 'bottom', 'right'):
el = OxmlElement(f'w:{edge}')
el.set(qn('w:val'), 'single')
el.set(qn('w:sz'), '4')
el.set(qn('w:space'), '0')
el.set(qn('w:color'), '999999')
tcBorders.append(el)
tcPr.append(tcBorders)
def shade_cell(cell, hexcolor):
shd = OxmlElement('w:shd')
shd.set(qn('w:val'), 'clear')
shd.set(qn('w:fill'), hexcolor)
cell._tc.get_or_add_tcPr().append(shd)
doc = Document()
section = doc.sections[0]
section.top_margin = Inches(0.5)
section.bottom_margin = Inches(0.5)
section.left_margin = Inches(0.55)
section.right_margin = Inches(0.55)
style = doc.styles["Normal"]
style.font.name = "Arial"
style.font.size = Pt(10.5)
def add_title(text, subtitle=None):
h = doc.add_paragraph()
h.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = h.add_run(text)
run.bold = True
run.font.size = Pt(16)
if subtitle:
s = doc.add_paragraph()
s.alignment = WD_ALIGN_PARAGRAPH.CENTER
r2 = s.add_run(subtitle)
r2.italic = True
r2.font.size = Pt(10)
r2.font.color.rgb = RGBColor(0x55, 0x55, 0x55)
def add_section_heading(text, dark=False):
p = doc.add_paragraph()
p.paragraph_format.space_before = Pt(8)
p.paragraph_format.space_after = Pt(2)
run = p.add_run(text)
run.bold = True
run.font.size = Pt(11.5) if not dark else Pt(13)
run.font.color.rgb = RGBColor(0x1F, 0x4E, 0x79) if not dark else RGBColor(0xFF, 0xFF, 0xFF)
pPr = p._p.get_or_add_pPr()
shd = OxmlElement('w:shd')
shd.set(qn('w:val'), 'clear')
shd.set(qn('w:fill'), 'DCE6F1' if not dark else '1F4E79')
pPr.append(shd)
def blank_line(label, width_chars=28):
p = doc.add_paragraph()
p.paragraph_format.space_after = Pt(3)
r1 = p.add_run(label + ": ")
r1.bold = True
r1.font.size = Pt(10.5)
r2 = p.add_run("_" * width_chars)
r2.font.size = Pt(10.5)
def two_col_blank(label1, w1, label2, w2):
p = doc.add_paragraph()
p.paragraph_format.space_after = Pt(3)
r1 = p.add_run(label1 + ": ")
r1.bold = True
r2 = p.add_run("_" * w1 + " ")
r3 = p.add_run(label2 + ": ")
r3.bold = True
r4 = p.add_run("_" * w2)
for r in (r1, r2, r3, r4):
r.font.size = Pt(10.5)
def checkbox_line(label, options):
p = doc.add_paragraph()
p.paragraph_format.space_after = Pt(3)
r1 = p.add_run(label + ": ")
r1.bold = True
r1.font.size = Pt(10.5)
r2 = p.add_run(" ".join([f"\u2610 {o}" for o in options]))
r2.font.size = Pt(10.5)
def add_blank_table(headers, nrows, col_widths=None):
t = doc.add_table(rows=nrows+1, cols=len(headers))
t.alignment = WD_TABLE_ALIGNMENT.CENTER
for j, htext in enumerate(headers):
cell = t.rows[0].cells[j]
cell.text = ""
run = cell.paragraphs[0].add_run(htext)
run.bold = True
run.font.size = Pt(9.5)
set_cell_border(cell)
shade_cell(cell, 'F2F2F2')
for i in range(1, nrows+1):
for j in range(len(headers)):
cell = t.rows[i].cells[j]
cell.text = ""
cell.paragraphs[0].add_run(" ")
set_cell_border(cell)
if col_widths:
for row in t.rows:
for j, w in enumerate(col_widths):
row.cells[j].width = Inches(w)
return t
def footer_note():
p = doc.add_paragraph()
p.paragraph_format.space_before = Pt(6)
r = p.add_run("Provisional Diagnosis: " + "_"*55)
r.bold = True
r.font.size = Pt(10.5)
p2 = doc.add_paragraph()
r2 = p2.add_run("Plan / Advice / Rx: ")
r2.bold = True
r2.font.size = Pt(10.5)
p2.add_run("_"*60).font.size = Pt(10.5)
for _ in range(3):
p3 = doc.add_paragraph("_" * 95)
p3.paragraph_format.space_after = Pt(2)
p4 = doc.add_paragraph()
r4 = p4.add_run("Doctor's Signature: " + "_"*25 + " Next visit: " + "_"*15)
r4.font.size = Pt(10.5)
def add_drug_table(rows):
headers = ["Presenting Complaint", "Drug (Generic)", "Pakistan Brand", "Dose"]
t = doc.add_table(rows=len(rows)+1, cols=4)
t.alignment = WD_TABLE_ALIGNMENT.CENTER
widths = [1.7, 1.5, 1.4, 2.4]
for j, htext in enumerate(headers):
cell = t.rows[0].cells[j]
cell.text = ""
run = cell.paragraphs[0].add_run(htext)
run.bold = True
run.font.size = Pt(9)
set_cell_border(cell)
shade_cell(cell, 'DCE6F1')
for i, row in enumerate(rows, start=1):
for j, val in enumerate(row):
cell = t.rows[i].cells[j]
cell.text = ""
run = cell.paragraphs[0].add_run(val)
run.font.size = Pt(8.5)
set_cell_border(cell)
if i % 2 == 0:
shade_cell(cell, 'F7F9FC')
for row in t.rows:
for j, w in enumerate(widths):
row.cells[j].width = Inches(w)
return t
# ============ PAGE 1: GYNECOLOGY OPD NOTE ============
add_title("GYNECOLOGY OPD NOTE", "Quick documentation template")
p = doc.add_paragraph()
p.add_run("Name: " + "_"*30 + " Age: " + "_"*6 + " Date: " + "_"*15).font.size = Pt(10.5)
p2 = doc.add_paragraph()
p2.add_run("Marital status: " + "_"*10 + " Occupation: " + "_"*15 + " Reg. No: " + "_"*12).font.size = Pt(10.5)
add_section_heading("Chief Complaint(s)")
for _ in range(2):
doc.add_paragraph("_" * 100).paragraph_format.space_after = Pt(2)
add_section_heading("Menstrual History")
two_col_blank("Menarche (yrs)", 6, "LMP", 12)
two_col_blank("Cycle length/duration", 10, "Flow (nl/exc/scanty)", 10)
checkbox_line("Dysmenorrhea", ["Yes", "No"])
two_col_blank("Menopause (yrs, if any)", 10, "IMB/PMB", 12)
add_section_heading("Obstetric History")
p = doc.add_paragraph()
r1 = p.add_run("G ___ P ___ L ___ A ___ ")
r1.bold = True
r1.font.size = Pt(11)
r2 = p.add_run("(Gravida / Para / Living / Abortion)")
r2.italic = True
r2.font.size = Pt(9)
two_col_blank("Mode of last delivery", 15, "Last delivery (yrs ago)", 8)
add_section_heading("Contraception & Sexual History")
two_col_blank("Current method", 12, "Duration", 10)
checkbox_line("Sexually active", ["Yes", "No"])
blank_line("Dyspareunia / other complaints", 40)
add_section_heading("Past Gynecological History")
two_col_blank("Pap smear date/result", 20, "Prior gynae surgery", 20)
blank_line("Infections / STI history", 45)
add_section_heading("Past Medical / Surgical / Drug / Allergy History")
checkbox_line("Comorbidities", ["DM", "HTN", "Thyroid", "TB", "None"])
blank_line("Drug history", 35)
blank_line("Allergy history", 35)
blank_line("Family history", 45)
add_section_heading("On Examination")
two_col_blank("GC", 8, "Pallor", 8)
two_col_blank("Pulse", 8, "BP", 10)
add_blank_table(["Exam", "Findings"], 4, col_widths=[1.6, 5.5])
p = doc.add_paragraph()
r = p.add_run("(P/A - per abdomen, P/S - per speculum, P/V - per vaginum, Breast)")
r.italic = True
r.font.size = Pt(8.5)
footer_note()
doc.add_page_break()
# ============ PAGE 2: OBSTETRIC (ANTENATAL) OPD NOTE ============
add_title("OBSTETRIC (ANTENATAL) OPD NOTE", "Quick documentation template")
p = doc.add_paragraph()
p.add_run("Name: " + "_"*30 + " Age: " + "_"*6 + " Date: " + "_"*15).font.size = Pt(10.5)
add_section_heading("Pregnancy Summary")
p = doc.add_paragraph()
r1 = p.add_run("G ___ P ___ L ___ A ___ ")
r1.bold = True
r1.font.size = Pt(11)
two_col_blank("LMP", 14, "EDD (Naegele's rule)", 14)
two_col_blank("POG today (by dates)", 12, "POG (by USG)", 12)
add_section_heading("Chief Complaint(s)")
checkbox_line("Symptoms", ["Fetal movements +", "Pain", "Leaking", "Bleeding", "Swelling", "None"])
doc.add_paragraph("_" * 100).paragraph_format.space_after = Pt(2)
add_section_heading("Current Pregnancy Details")
two_col_blank("Booking visit (wks)", 8, "No. of ANC visits", 8)
two_col_blank("USG dating scan (wks)", 10, "TT1 / TT2", 12)
checkbox_line("Complications", ["PIH", "GDM", "Anemia", "PROM", "None"])
checkbox_line("Rh status", ["Rh +ve", "Rh -ve -> Anti-D given: Yes/No"])
add_section_heading("Past Obstetric History")
add_blank_table(["Yr", "POG at delivery", "Mode", "Birth wt", "Sex", "Complication", "Outcome"], 3,
col_widths=[0.6, 1.1, 0.9, 0.8, 0.6, 1.4, 1.1])
add_section_heading("Past Medical / Surgical / Drug / Allergy / Family History")
blank_line("Past medical/surgical history", 45)
blank_line("Drug / Allergy history", 45)
blank_line("Family history", 45)
add_section_heading("On Examination")
two_col_blank("GC", 8, "Pallor / Edema", 10)
two_col_blank("Pulse", 8, "BP", 10)
two_col_blank("Weight (kg)", 8, "Height (cm)", 8)
two_col_blank("Fundal Height (wks)", 10, "FHS (bpm)", 10)
two_col_blank("Presentation", 12, "Lie", 10)
two_col_blank("Engagement (/5th)", 10, "Liquor (clinical)", 12)
add_section_heading("Investigations")
checkbox_line("Sent", ["Hb", "Urine R/M", "BSL", "USG", "Others:"])
doc.add_paragraph("_" * 60)
footer_note()
doc.add_page_break()
# ============ PAGE 3: ABBREVIATION KEY ============
add_title("QUICK ABBREVIATION KEY", "Common shorthand for O&G OPD notes")
abbrevs = [
("G / P / L / A", "Gravida / Para / Living / Abortion"),
("LMP / EDD", "Last Menstrual Period / Expected Date of Delivery"),
("POG", "Period of Gestation"),
("FH / FHS", "Fundal Height / Fetal Heart Sounds"),
("P/A, P/S, P/V", "Per Abdomen, Per Speculum, Per Vaginum"),
("PIH, GDM, PROM", "Pregnancy-Induced Hypertension, Gestational Diabetes, Premature Rupture of Membranes"),
("C/O", "Complains of"),
("O/E", "On Examination"),
("Ceph / Breech", "Cephalic / Breech presentation"),
("IMB / PMB", "Intermenstrual Bleeding / Postmenopausal Bleeding"),
("TT1 / TT2", "Tetanus Toxoid dose 1 / dose 2"),
("GC", "General Condition"),
]
t = doc.add_table(rows=len(abbrevs)+1, cols=2)
t.alignment = WD_TABLE_ALIGNMENT.CENTER
for j, htext in enumerate(["Abbreviation", "Meaning"]):
cell = t.rows[0].cells[j]
run = cell.paragraphs[0].add_run(htext)
run.bold = True
set_cell_border(cell)
shade_cell(cell, 'F2F2F2')
for i, (a, b) in enumerate(abbrevs, start=1):
c0 = t.rows[i].cells[0]
r0 = c0.paragraphs[0].add_run(a)
r0.bold = True
set_cell_border(c0)
c1 = t.rows[i].cells[1]
c1.paragraphs[0].add_run(b)
set_cell_border(c1)
for row in t.rows:
row.cells[0].width = Inches(1.8)
row.cells[1].width = Inches(5.3)
doc.add_page_break()
# ============ PAGE 4: DRUG REFERENCE INTRO + GYNECOLOGY ============
add_title("GYNE & OBS OPD DRUG REFERENCE - PAKISTAN", "Presenting complaint, generic drug, Pakistani brand, and dose - all in one place")
p = doc.add_paragraph()
r = p.add_run("CAUTION: Brand availability changes and multiple manufacturers may market the same generic in "
"Pakistan. Verify current stock, DRAP registration, and price with your local pharmacy/MIMS Pakistan "
"before prescribing. Always adjust for renal/hepatic function, allergy history, trimester of pregnancy, "
"and institutional protocol. This is a quick-reference aid, not a substitute for clinical judgment.")
r.bold = True
r.font.size = Pt(9)
r.font.color.rgb = RGBColor(0x7A, 0x1F, 0x1F)
add_section_heading("A. GYNECOLOGY OPD", dark=True)
gyne_rows = [
("Dysmenorrhea", "Mefenamic acid", "Ponstan, Mefac", "500 mg PO TID, start at onset of pain/menses"),
("", "Ibuprofen", "Brufen", "400 mg PO TID with food"),
("Abnormal Uterine Bleeding (AUB) / Menorrhagia", "Tranexamic acid", "Transamin, Trapic",
"1000-1300 mg PO TID for up to 5 days during heavy flow"),
("", "Mefenamic acid (NSAID)", "Ponstan, Mefac", "500 mg TID during bleeding days"),
("", "Combined OCP", "Yasmin, Diane-35, Marvelon", "1 tab OD as per pack cycle"),
("", "Levonorgestrel IUD", "Mirena", "Long-term option - insertion, not oral dosing"),
("Vulvovaginal Candidiasis", "Fluconazole", "Zolanix, Diflucan, Flucos", "150 mg PO single dose"),
("", "Clotrimazole vaginal", "Candid-V, Clocip", "1% cream/pessary OD x 6 days, or 500 mg pessary single dose"),
("Bacterial Vaginosis", "Metronidazole", "Flagyl, Metryl, Amrizole", "500 mg PO BID x 7 days, or vaginal gel 0.75% OD x 5 days"),
("Trichomoniasis", "Metronidazole", "Flagyl, Metryl", "2 g PO single dose, or 500 mg BID x 7 days (treat partner too)"),
("Pelvic Inflammatory Disease (PID)", "Ceftriaxone", "Traxon, Rocephin", "500 mg IM single dose"),
("", "+ Doxycycline", "Doxef, Vibramycin", "100 mg PO BID x 14 days"),
("", "+ Metronidazole", "Flagyl, Metryl", "500 mg PO BID x 14 days"),
("Iron Deficiency Anemia (menorrhagia-related)", "Ferrous sulfate/fumarate + Folic acid", "Fefol Spansule, Fefol-Vit",
"1 capsule OD-BID (150 mg iron + 0.5 mg folic acid per dose)"),
("Recurrent Vulvovaginal Candidiasis (prophylaxis)", "Fluconazole", "Zolanix, Diflucan", "150-200 mg PO weekly (maintenance)"),
("Emergency Contraception", "Levonorgestrel", "Postinor-2, i-Pill", "1.5 mg PO single dose within 72 hrs (best <24 hrs)"),
("Regular Contraception", "Combined OCP", "Yasmin, Diane-35, Marvelon", "1 tab OD, cyclical"),
("Vaginal atrophy / menopausal vaginitis", "Topical estrogen cream", "Premarin cream (where available)",
"Low-dose applicator, 2-3x/week per product instructions"),
("Vasomotor symptoms (menopause)", "HRT (estrogen +/- progestin)", "Premarin, Angeliq (where available)",
"Lowest effective dose, individualized"),
]
add_drug_table(gyne_rows)
doc.add_page_break()
# ============ PAGE 5: DRUG REFERENCE - OBSTETRICS ============
add_section_heading("B. OBSTETRICS OPD (ANTENATAL)", dark=True)
obs_rows = [
("Routine antenatal supplementation", "Ferrous fumarate + Folic acid", "Fefol Spansule, Folart, Obimin",
"1 capsule/tablet OD (approx. 150 mg iron + 0.5 mg folic acid)"),
("", "Calcium + Vitamin D", "Calcium Sandoz, Caltrate, Os-Cal", "500-1000 mg elemental calcium OD-BID"),
("Iron Deficiency Anemia in pregnancy", "Ferrous sulfate", "Fefol Spansule", "1 capsule OD-BID; consider IV iron if intolerant/severe"),
("Nausea and Vomiting of Pregnancy (mild)", "Doxylamine + Pyridoxine (+ Dicyclomine)", "Navidoxine",
"1 tab at bedtime, may increase to BID (first-line, safe in pregnancy)"),
("Hyperemesis Gravidarum (moderate-severe)", "Ondansetron", "Onset, Emeset", "4 mg PO/IV every 8 hours"),
("", "Metoclopramide", "Maxolon, Gastrolon", "10 mg PO/IV TID (alternative)"),
("Threatened Miscarriage", "(No proven effective drug per evidence)", "-",
"Bed rest/progesterone often used clinically but no demonstrated efficacy - counsel accordingly"),
("Gestational Hypertension / Pre-eclampsia (non-severe, outpatient)", "Methyldopa", "Aldomet, Dopamet",
"250 mg PO BID-TID"),
("", "Nifedipine (extended release)", "Adalat Retard, Nifecard", "10-20 mg PO BID"),
("", "Labetalol (less commonly stocked)", "-", "100-200 mg PO BID-TID if available"),
("Severe Pre-eclampsia / Eclampsia (admit, not OPD)", "Magnesium sulfate", "MgSO4 injection (generic)",
"Loading 4-6 g IV over 15-20 min, then maintenance 1-2 g/hr IV - refer/admit immediately"),
("Urinary Tract Infection in pregnancy", "Cephalexin", "Ceporex, Sporidex", "500 mg PO BID-QID x 5-7 days"),
("", "Nitrofurantoin (avoid near term, limited stock)", "Furadantin", "100 mg PO BID x 5-7 days"),
("Postpartum Hemorrhage prevention (3rd stage)", "Oxytocin", "Syntocinon", "10 IU IM/IV after delivery of baby"),
("", "Misoprostol (if oxytocin unavailable)", "Cytotec, Mizotec", "600 mcg PO for prevention; 800-1000 mcg sublingual/rectal for treatment"),
("PPH treatment (uterine atony, unresponsive to oxytocin)", "Methylergometrine", "Methergin, Ergomet",
"0.2 mg IM (avoid in hypertensive patients)"),
("Vaginal candidiasis in pregnancy", "Clotrimazole (topical only)", "Candid-V, Clocip", "1% cream/pessary OD x 7 days"),
("Threatened Preterm Labor (tocolysis - specialist referral)", "Nifedipine", "Adalat, Nifecard",
"20 mg PO loading, then 10-20 mg q4-6h (short-term tocolysis)"),
("Fetal lung maturity (preterm risk 24-34 wks)", "Betamethasone", "Betnesol, Celestone", "12 mg IM, 2 doses 24 hrs apart"),
]
add_drug_table(obs_rows)
add_section_heading("Quick Safety Notes", dark=True)
notes = [
"Avoid NSAIDs (mefenamic acid, ibuprofen) after 20 weeks gestation and near term.",
"Avoid oral fluconazole and doxycycline/tetracyclines in pregnancy - use topical antifungals and alternative antibiotics.",
"MgSO4 for severe pre-eclampsia/eclampsia is inpatient/emergency management only - refer, do not manage in OPD.",
"PID and STI regimens should prompt partner treatment and STI screening.",
"Multiple brands exist per generic in Pakistan - confirm current availability with your pharmacy before prescribing.",
]
for n in notes:
p = doc.add_paragraph("\u2022 " + n)
p.paragraph_format.space_after = Pt(2)
for run in p.runs:
run.font.size = Pt(9.5)
p = doc.add_paragraph()
r = p.add_run("Sources: CDC STI Treatment Guidelines 2021, WHO uterotonic recommendations, Berek & Novak's "
"Gynecology, Harrison's Principles of Internal Medicine 22nd ed., Goldman-Cecil Medicine, Rosen's "
"Emergency Medicine, and GSK Pakistan product listings (Fefol, Zolanix, Traxon) cross-checked for "
"local brand names.")
r.italic = True
r.font.size = Pt(7.5)
r.font.color.rgb = RGBColor(0x66, 0x66, 0x66)
doc.save("/tmp/workspace/opd-notes-template/OG_OPD_Complete_Booklet.docx")
print("combined booklet docx saved")
cd /tmp/workspace/opd-notes-template && python3 make_combined_docx.py && ls -la
OG OPD Complete Booklet
PDF Document · PDF
OG OPD Complete Booklet
Word Document · DOCX