System wide common opd disease and treatment complete
common OPD diseases and treatment protocols 2025 primary care
| Intervention | Who | Frequency |
|---|---|---|
| BP check | All adults >18 | Every 1-2 years (annually if high-normal) |
| HbA1c/FBS | Adults >45, obese, family history DM | Every 3 years (annually if prediabetes) |
| Lipid profile | All adults >20 | Every 4-6 years; annually if high-risk |
| Cervical cancer (Pap smear) | Women 21-65 | Every 3 years (or 5 with HPV co-test) |
| Mammogram | Women 40-75 | Every 1-2 years |
| Colonoscopy | Adults >45 | Every 10 years |
| Influenza vaccine | All adults | Annually |
| Pneumococcal (PCV15/PPSV23) | >65 or high-risk | Per schedule |
| Hepatitis B | Unvaccinated adults | 3-dose series |
| HPV vaccine | Age 9-26 | 2-3 dose series |
| Tetanus booster | All adults | Every 10 years |
| Condition | Drug | Dose |
|---|---|---|
| Pain/fever | Paracetamol | 500-1000 mg Q4-6H |
| Inflammation | Ibuprofen | 400 mg TID with food |
| Acid reflux | Omeprazole | 20-40 mg OD before meals |
| H. pylori | PPI + Clarithromycin + Amoxicillin | 14 days |
| T2DM | Metformin | 500-1000 mg BID |
| HTN | Amlodipine | 5-10 mg OD |
| HTN + CKD | Ramipril | 2.5-10 mg OD |
| Dyslipidemia | Atorvastatin | 10-80 mg OD at night |
| Hypothyroid | Levothyroxine | 25-100 mcg OD (empty stomach) |
| Asthma (acute) | Salbutamol MDI | 2 puffs Q4-6H PRN |
| Depression | Sertraline | 50-200 mg OD |
| UTI (women) | Nitrofurantoin | 100 mg BID x 5 days |
| Gout (acute) | Colchicine | 1 mg + 0.5 mg 1h later |
| Allergic rhinitis | Mometasone nasal | 100 mcg/nostril OD |
| Scabies | Permethrin 5% | Whole body overnight x 2 |
| Fungal skin | Clotrimazole 1% | BID x 2-4 weeks |
Important: All drug doses listed are for adults with normal renal and hepatic function unless otherwise stated. Always adjust doses for age, weight, renal function, hepatic function, and comorbidities. Clinical judgment and local antibiotic resistance patterns should guide antibiotic choices.
Create a quick-reference PDF guide for OPD prescriptions and dosing
mkdir -p /home/daytona/workspace/opd-guide && ls /home/daytona/workspace/opd-gui…
~/opd-guide/generate_opd_pdf.py
#!/usr/bin/env python3
"""
OPD Quick Reference Guide - PDF Generator
Uses ReportLab to create a professional, colored, multi-page quick-reference PDF.
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.platypus import Flowable
from reportlab.pdfgen import canvas
from reportlab.lib.colors import HexColor
import datetime
OUTPUT_PATH = "/home/daytona/workspace/opd-guide/OPD_Quick_Reference_Guide.pdf"
# ── Color Palette ──────────────────────────────────────────────────────────────
C_NAVY = HexColor("#1A237E")
C_BLUE = HexColor("#1565C0")
C_LIGHT_BLUE = HexColor("#E3F2FD")
C_TEAL = HexColor("#00695C")
C_TEAL_LIGHT = HexColor("#E0F2F1")
C_RED = HexColor("#B71C1C")
C_RED_LIGHT = HexColor("#FFEBEE")
C_ORANGE = HexColor("#E65100")
C_ORANGE_LT = HexColor("#FFF3E0")
C_GREEN = HexColor("#2E7D32")
C_GREEN_LT = HexColor("#E8F5E9")
C_PURPLE = HexColor("#4A148C")
C_PURPLE_LT = HexColor("#F3E5F5")
C_GREY = HexColor("#424242")
C_GREY_LT = HexColor("#F5F5F5")
C_WHITE = colors.white
C_BLACK = colors.black
C_YELLOW_LT = HexColor("#FFFDE7")
C_AMBER = HexColor("#FF8F00")
# Section header colors by system
SYSTEM_COLORS = {
"respiratory": (HexColor("#01579B"), HexColor("#E1F5FE")),
"cardiovascular": (C_RED, C_RED_LIGHT),
"gastrointestinal": (C_ORANGE, C_ORANGE_LT),
"endocrine": (C_TEAL, C_TEAL_LIGHT),
"musculoskeletal": (HexColor("#4E342E"), HexColor("#EFEBE9")),
"neurological": (C_PURPLE, C_PURPLE_LT),
"dermatology": (HexColor("#AD1457"), HexColor("#FCE4EC")),
"urinary": (C_BLUE, C_LIGHT_BLUE),
"mental health": (HexColor("#283593"), HexColor("#E8EAF6")),
"preventive": (C_GREEN, C_GREEN_LT),
"ent": (HexColor("#006064"), HexColor("#E0F7FA")),
"ophthalmology": (HexColor("#1B5E20"), HexColor("#F1F8E9")),
"womens health": (HexColor("#880E4F"), HexColor("#FCE4EC")),
"pediatric": (HexColor("#F57F17"), HexColor("#FFFDE7")),
}
W, H = A4
PAGE_W = W - 2.5*cm
def make_styles():
base = getSampleStyleSheet()
styles = {}
styles['cover_title'] = ParagraphStyle(
'cover_title', fontName='Helvetica-Bold', fontSize=28,
textColor=C_WHITE, alignment=TA_CENTER, spaceAfter=6)
styles['cover_sub'] = ParagraphStyle(
'cover_sub', fontName='Helvetica', fontSize=13,
textColor=HexColor("#BBDEFB"), alignment=TA_CENTER, spaceAfter=4)
styles['cover_date'] = ParagraphStyle(
'cover_date', fontName='Helvetica', fontSize=10,
textColor=HexColor("#90CAF9"), alignment=TA_CENTER)
styles['sys_header'] = ParagraphStyle(
'sys_header', fontName='Helvetica-Bold', fontSize=13,
textColor=C_WHITE, alignment=TA_LEFT, leftIndent=6,
spaceAfter=2, spaceBefore=6)
styles['disease'] = ParagraphStyle(
'disease', fontName='Helvetica-Bold', fontSize=10,
textColor=C_NAVY, spaceAfter=1, spaceBefore=4, leftIndent=4)
styles['drug'] = ParagraphStyle(
'drug', fontName='Helvetica', fontSize=8.5,
textColor=C_GREY, spaceAfter=1, leftIndent=12, leading=12)
styles['note'] = ParagraphStyle(
'note', fontName='Helvetica-Oblique', fontSize=7.5,
textColor=C_ORANGE, spaceAfter=1, leftIndent=12)
styles['tbl_header'] = ParagraphStyle(
'tbl_header', fontName='Helvetica-Bold', fontSize=8,
textColor=C_WHITE, alignment=TA_CENTER)
styles['tbl_cell'] = ParagraphStyle(
'tbl_cell', fontName='Helvetica', fontSize=7.5,
textColor=C_GREY, alignment=TA_LEFT, leading=10)
styles['tbl_cell_bold'] = ParagraphStyle(
'tbl_cell_bold', fontName='Helvetica-Bold', fontSize=7.5,
textColor=C_NAVY, alignment=TA_LEFT, leading=10)
styles['warning'] = ParagraphStyle(
'warning', fontName='Helvetica-Bold', fontSize=8,
textColor=C_RED, leftIndent=6, spaceAfter=2)
styles['footer'] = ParagraphStyle(
'footer', fontName='Helvetica', fontSize=7,
textColor=HexColor("#9E9E9E"), alignment=TA_CENTER)
return styles
# ── Header/Footer Canvas ───────────────────────────────────────────────────────
class HeaderFooter:
def __init__(self, title="OPD Quick Reference Guide"):
self.title = title
def __call__(self, canvas, doc):
canvas.saveState()
# Header bar
canvas.setFillColor(C_NAVY)
canvas.rect(0, H - 1.8*cm, W, 1.8*cm, fill=1, stroke=0)
canvas.setFillColor(C_WHITE)
canvas.setFont("Helvetica-Bold", 11)
canvas.drawString(1.2*cm, H - 1.2*cm, self.title)
canvas.setFont("Helvetica", 9)
canvas.drawRightString(W - 1.2*cm, H - 1.2*cm,
f"Page {doc.page}")
# Footer bar
canvas.setFillColor(HexColor("#ECEFF1"))
canvas.rect(0, 0, W, 0.9*cm, fill=1, stroke=0)
canvas.setFillColor(HexColor("#607D8B"))
canvas.setFont("Helvetica", 7)
canvas.drawCentredString(W/2, 0.3*cm,
"For clinical use only. Doses are for adults with normal renal/hepatic function. "
"Adjust for age, weight, renal/hepatic impairment. Last updated: July 2026.")
canvas.restoreState()
# ── Helper: system section banner ─────────────────────────────────────────────
def sys_banner(text, system_key, styles):
hc, _ = SYSTEM_COLORS.get(system_key, (C_NAVY, C_LIGHT_BLUE))
p = Paragraph(f" {text}", styles['sys_header'])
t = Table([[p]], colWidths=[PAGE_W])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), hc),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 8),
('ROUNDEDCORNERS', [4, 4, 4, 4]),
]))
return t
def drug_table(headers, rows, hdr_color, alt_color, styles, col_widths=None):
"""Generic colored table for drug dosing."""
data = [[Paragraph(h, styles['tbl_header']) for h in headers]]
for i, row in enumerate(rows):
styled_row = []
for j, cell in enumerate(row):
s = styles['tbl_cell_bold'] if j == 0 else styles['tbl_cell']
styled_row.append(Paragraph(str(cell), s))
data.append(styled_row)
if col_widths is None:
n = len(headers)
col_widths = [PAGE_W / n] * n
tbl = Table(data, colWidths=col_widths, repeatRows=1)
ts = TableStyle([
('BACKGROUND', (0,0), (-1,0), hdr_color),
('ROWBACKGROUNDS', (0,1), (-1,-1), [C_WHITE, alt_color]),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 7.5),
('GRID', (0,0), (-1,-1), 0.3, HexColor("#CFD8DC")),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING', (0,0), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 5),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
])
tbl.setStyle(ts)
return tbl
# ══════════════════════════════════════════════════════════════════════════════
# CONTENT BUILDER
# ══════════════════════════════════════════════════════════════════════════════
def build_content(styles):
story = []
sp = lambda n=0.2: story.append(Spacer(1, n*cm))
hr = lambda: story.append(HRFlowable(width="100%", thickness=0.5,
color=HexColor("#B0BEC5"), spaceAfter=3))
def banner(text, key):
story.append(Spacer(1, 0.3*cm))
story.append(sys_banner(text, key, styles))
story.append(Spacer(1, 0.15*cm))
def dtbl(headers, rows, hdr_col, alt_col, widths=None):
story.append(drug_table(headers, rows, hdr_col, alt_col, styles, widths))
sp(0.15)
def disease_hdr(text):
story.append(Paragraph(f"▸ {text}", styles['disease']))
def note(text):
story.append(Paragraph(f"⚠ {text}", styles['note']))
# ──────────────────────────────────────────────────────────────────────────
# PAGE 1: COVER
# ──────────────────────────────────────────────────────────────────────────
story.append(Spacer(1, 3*cm))
# Big blue cover block
cover_inner = [
[Paragraph("OPD Quick Reference Guide", styles['cover_title'])],
[Paragraph("System-Wide Prescription & Dosing Reference", styles['cover_sub'])],
[Spacer(1, 0.4*cm)],
[Paragraph("Respiratory · Cardiovascular · GI · Endocrine · MSK · Neuro", styles['cover_sub'])],
[Paragraph("Dermatology · Urology · Mental Health · ENT · Ophthalm · Paeds", styles['cover_sub'])],
[Spacer(1, 0.6*cm)],
[Paragraph(f"July 2026 | For Adult Patients with Normal Organ Function", styles['cover_date'])],
[Paragraph("Based on Harrison's 22E · Goldman-Cecil · Washington Manual · ADA · GINA · GOLD · ACC/AHA", styles['cover_date'])],
]
cover_tbl = Table(cover_inner, colWidths=[PAGE_W])
cover_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_NAVY),
('TOPPADDING', (0,0), (-1,-1), 12),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 20),
('RIGHTPADDING', (0,0), (-1,-1), 20),
('ROUNDEDCORNERS', [8,8,8,8]),
]))
story.append(cover_tbl)
story.append(Spacer(1, 1*cm))
# Legend
legend_data = [
[Paragraph("<b>Drug Class Abbreviations</b>", styles['tbl_cell_bold']),
Paragraph("<b>Frequency Codes</b>", styles['tbl_cell_bold']),
Paragraph("<b>Route Abbreviations</b>", styles['tbl_cell_bold'])],
[Paragraph("SSRI = Selective serotonin reuptake inhibitor\nACEi = ACE inhibitor\nARB = Angiotensin receptor blocker\nCCB = Calcium channel blocker\nICS = Inhaled corticosteroid\nSABA = Short-acting beta-2 agonist\nLABA = Long-acting beta-2 agonist\nNSAID = Non-steroidal anti-inflammatory\nPPI = Proton pump inhibitor\nDMARD = Disease-modifying antirheumatic", styles['tbl_cell']),
Paragraph("OD = Once daily\nBID = Twice daily\nTID = Three times daily\nQID = Four times daily\nQ4H = Every 4 hours\nQ6H = Every 6 hours\nQ8H = Every 8 hours\nPRN = As needed\nStat = Immediately\nNocte = At night", styles['tbl_cell']),
Paragraph("PO = By mouth (oral)\nSC = Subcutaneous\nIM = Intramuscular\nIV = Intravenous\nIN = Intranasal\nTop = Topical\nMDI = Metered-dose inhaler\nSL = Sublingual", styles['tbl_cell'])],
]
leg_tbl = Table(legend_data, colWidths=[PAGE_W/3]*3)
leg_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), C_NAVY),
('BACKGROUND', (0,1), (-1,-1), HexColor("#ECEFF1")),
('FONTSIZE', (0,0), (-1,-1), 7.5),
('GRID', (0,0), (-1,-1), 0.3, HexColor("#B0BEC5")),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TEXTCOLOR', (0,0), (-1,0), C_WHITE),
]))
story.append(leg_tbl)
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────
# PAGE 2: RESPIRATORY
# ──────────────────────────────────────────────────────────────────────────
banner("1. RESPIRATORY SYSTEM", "respiratory")
hc, alt = SYSTEM_COLORS["respiratory"]
disease_hdr("Common Cold / Viral URTI")
dtbl(["Drug", "Dose", "Frequency", "Notes"],
[["Paracetamol", "500-1000 mg", "Q6H PRN", "Fever / pain"],
["Cetirizine", "10 mg", "OD", "Rhinorrhea, itching"],
["Chlorpheniramine", "4 mg", "TID", "Rhinorrhea (sedating)"],
["Oxymetazoline nasal", "2 sprays/nostril", "BID (max 5 days)", "Rebound congestion if >5d"],
["Zinc lozenges", "13 mg", "Q2H", "May reduce duration"]],
hc, alt, [PAGE_W*0.22, PAGE_W*0.22, PAGE_W*0.22, PAGE_W*0.34])
note("Antibiotics NOT indicated. Self-limiting 7-10 days.")
disease_hdr("Acute Bacterial Pharyngitis / Tonsillitis (Group A Strep)")
dtbl(["Drug", "Dose", "Frequency", "Duration"],
[["Amoxicillin (1st line)", "500 mg", "TID", "10 days"],
["Amoxicillin-clavulanate", "625 mg", "BID", "7 days"],
["Azithromycin (PCN allergy)", "500 mg", "OD", "5 days"],
["Ibuprofen / Paracetamol", "400 mg / 500 mg", "TID PRN", "Analgesic"]],
hc, alt, [PAGE_W*0.28, PAGE_W*0.2, PAGE_W*0.2, PAGE_W*0.32])
disease_hdr("Community-Acquired Pneumonia (Mild - Outpatient)")
dtbl(["Drug", "Dose", "Frequency", "Indication"],
[["Amoxicillin", "1 g", "TID x 5-7d", "No comorbidities"],
["Doxycycline", "100 mg", "BID x 5-7d", "Atypical cover"],
["Azithromycin", "500 mg", "OD x 5d", "Atypical / PCN allergy"],
["Levofloxacin", "750 mg", "OD x 5d", "Comorbidities / failure"]],
hc, alt, [PAGE_W*0.28, PAGE_W*0.15, PAGE_W*0.22, PAGE_W*0.35])
disease_hdr("Asthma - Step Therapy")
dtbl(["Step", "Controller", "Reliever", "Note"],
[["Step 1 (Intermittent)", "None", "Salbutamol MDI 100mcg 2 puffs PRN", ""],
["Step 2 (Mild persistent)", "Budesonide 200mcg BID (ICS)", "Salbutamol PRN", ""],
["Step 3 (Moderate)", "ICS + LABA (formoterol/salmeterol)", "Salbutamol PRN", ""],
["Step 4 (Severe)", "High-dose ICS + LABA ± LAMA", "Salbutamol PRN", "Add tiotropium"]],
hc, alt, [PAGE_W*0.22, PAGE_W*0.33, PAGE_W*0.28, PAGE_W*0.17])
disease_hdr("COPD - Stable (GOLD Classification)")
dtbl(["GOLD Group", "First Choice", "Alternative", "Add-on"],
[["A (low risk, few sx)", "SABA or SAMA PRN", "LAMA or LABA", ""],
["B (low risk, more sx)", "LAMA (tiotropium 18mcg OD)", "LAMA + LABA", ""],
["E (high risk)", "LAMA + LABA", "Add ICS if eos >300", "Smoking cessation!"]],
hc, alt, [PAGE_W*0.2, PAGE_W*0.3, PAGE_W*0.28, PAGE_W*0.22])
note("Vaccinations: Annual influenza, Pneumococcal (PCV15 + PPSV23), COVID-19 booster.")
disease_hdr("COPD Acute Exacerbation (Mild - Outpatient)")
dtbl(["Drug", "Dose", "Duration", "Notes"],
[["Prednisolone", "30-40 mg OD", "5 days", "All exacerbations"],
["Amoxicillin", "500 mg TID", "5-7 days", "If purulent sputum"],
["Doxycycline", "100 mg BID", "5-7 days", "Alternative antibiotic"],
["Salbutamol nebulizer", "2.5-5 mg", "Q4-6H PRN", "Bronchodilation"]],
hc, alt, [PAGE_W*0.22, PAGE_W*0.22, PAGE_W*0.22, PAGE_W*0.34])
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────
# PAGE 3: CARDIOVASCULAR
# ──────────────────────────────────────────────────────────────────────────
banner("2. CARDIOVASCULAR SYSTEM", "cardiovascular")
hc, alt = SYSTEM_COLORS["cardiovascular"]
disease_hdr("Hypertension (HTN) - Pharmacotherapy")
dtbl(["Drug Class", "Drug / Dose", "Frequency", "Preferred In"],
[["ACE Inhibitor", "Ramipril 2.5-10 mg", "OD", "DM, CKD, HF, post-MI"],
["ARB", "Losartan 50-100 mg", "OD", "ACEi cough, DM, CKD"],
["CCB (Dihydropyridine)", "Amlodipine 5-10 mg", "OD", "Elderly, angina, all stages"],
["Thiazide Diuretic", "HCTZ 12.5-25 mg", "OD", "General, with CCB/ACEi"],
["Beta-Blocker", "Bisoprolol 2.5-10 mg", "OD", "HF, post-MI, angina, tachycardia"],
["Methyldopa", "250-500 mg", "BID-TID", "Pregnancy (safe)"]],
hc, alt, [PAGE_W*0.25, PAGE_W*0.25, PAGE_W*0.15, PAGE_W*0.35])
note("Target: <130/80 mmHg (high-risk/DM); <140/90 (low-risk). Avoid ACEi/ARB in pregnancy.")
disease_hdr("Dyslipidemia")
dtbl(["Drug", "Dose", "Frequency", "LDL Reduction"],
[["Atorvastatin (high intensity)", "40-80 mg", "OD (night)", "~50%"],
["Rosuvastatin (high intensity)", "20-40 mg", "OD (night)", "~55%"],
["Atorvastatin (moderate)", "10-20 mg", "OD (night)", "~35%"],
["Ezetimibe (add-on)", "10 mg", "OD", "~18% additional"],
["Fenofibrate (hypertriglyceridemia)", "145 mg", "OD with meal", "Triglycerides"]],
hc, alt, [PAGE_W*0.32, PAGE_W*0.15, PAGE_W*0.22, PAGE_W*0.31])
note("LDL targets: Very high risk (ASCVD) <55 mg/dL | High risk <70 mg/dL | Moderate <100 mg/dL")
disease_hdr("Stable Angina / Ischemic Heart Disease")
dtbl(["Drug", "Dose", "Frequency", "Role"],
[["GTN (sublingual)", "0.5 mg tablet or 1-2 sprays", "PRN (acute)", "Acute angina relief"],
["Metoprolol succinate", "25-100 mg", "OD", "Anti-anginal, HR control"],
["Amlodipine", "5-10 mg", "OD", "Add-on or if BB contraindicated"],
["Isosorbide mononitrate", "30-120 mg", "OD (eccentric dosing)", "Nitrate tolerance prevention"],
["Aspirin", "75-100 mg", "OD", "Secondary prevention"],
["Atorvastatin", "40-80 mg", "OD", "Secondary prevention"]],
hc, alt, [PAGE_W*0.25, PAGE_W*0.25, PAGE_W*0.22, PAGE_W*0.28])
disease_hdr("Chronic Heart Failure - HFrEF (GDMT - 4 Pillars)")
dtbl(["Pillar", "Drug Example", "Starting Dose", "Target Dose"],
[["ACEi / ARNI", "Ramipril or Sacubitril-Valsartan", "2.5 mg OD / 24/26 mg BID", "10 mg OD / 97/103 mg BID"],
["Beta-Blocker", "Carvedilol or Bisoprolol", "3.125 mg BID / 1.25 mg OD", "25-50 mg BID / 10 mg OD"],
["MRA", "Spironolactone", "25 mg OD", "25-50 mg OD"],
["SGLT-2i", "Dapagliflozin or Empagliflozin", "10 mg OD", "10 mg OD (fixed)"],
["Loop Diuretic (symptom)", "Furosemide", "20-40 mg OD", "Titrate to euvolemia"]],
hc, alt, [PAGE_W*0.18, PAGE_W*0.3, PAGE_W*0.27, PAGE_W*0.25])
note("Monitor: K+, creatinine, BP with ACEi/MRA. eGFR with SGLT-2i (start if ≥20).")
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────
# PAGE 4: GI + ENDOCRINE
# ──────────────────────────────────────────────────────────────────────────
banner("3. GASTROINTESTINAL SYSTEM", "gastrointestinal")
hc, alt = SYSTEM_COLORS["gastrointestinal"]
disease_hdr("GERD / Acid Peptic Disease")
dtbl(["Drug", "Dose", "Frequency", "Notes"],
[["Omeprazole (PPI - 1st line)", "20-40 mg", "OD (30 min before breakfast)", "4-8 weeks"],
["Pantoprazole", "40 mg", "OD before meal", "Alternative PPI"],
["Rabeprazole", "20 mg", "OD", "Faster onset"],
["Famotidine (H2 blocker)", "20-40 mg", "OD/BID", "Mild/nocturnal symptoms"],
["Antacid (Mg/Al hydroxide)", "10-20 mL", "PRN after meals/bedtime", "Symptomatic relief"]],
hc, alt, [PAGE_W*0.3, PAGE_W*0.15, PAGE_W*0.3, PAGE_W*0.25])
disease_hdr("H. pylori Eradication - Triple Therapy (14 days)")
dtbl(["Regimen", "Drug 1", "Drug 2", "Drug 3"],
[["Standard (1st line)", "Omeprazole 20 mg BID", "Clarithromycin 500 mg BID", "Amoxicillin 1g BID"],
["PCN allergy", "Omeprazole 20 mg BID", "Clarithromycin 500 mg BID", "Metronidazole 400 mg BID"],
["Bismuth Quadruple (2nd)", "PPI BID", "Bismuth 120mg QID", "Tetracycline + Metro BID"]],
hc, alt, [PAGE_W*0.22, PAGE_W*0.26, PAGE_W*0.26, PAGE_W*0.26])
note("Test for eradication 4 weeks after completing treatment (urea breath test or stool antigen).")
disease_hdr("IBS and Functional Bowel Disorders")
dtbl(["Subtype", "Drug", "Dose", "Notes"],
[["IBS-D (diarrhea)", "Loperamide", "2 mg PRN (max 16 mg/day)", "Symptom relief"],
["IBS-D (diarrhea)", "Mebeverine", "135 mg TID before meals", "Antispasmodic"],
["IBS-C (constipation)", "Lactulose", "10-20 mL BID", "Osmotic"],
["IBS-C (constipation)", "Ispaghula husk", "1 sachet OD-BID", "Bulking agent"],
["IBS pain / global", "Amitriptyline", "10-25 mg OD nocte", "Low-dose neuromodulator"],
["IBS pain", "Hyoscine butylbromide", "10-20 mg TID", "Antispasmodic"]],
hc, alt, [PAGE_W*0.22, PAGE_W*0.25, PAGE_W*0.3, PAGE_W*0.23])
disease_hdr("Acute Gastroenteritis")
dtbl(["Drug", "Dose", "Frequency", "Indication"],
[["ORS (WHO formula)", "200-400 mL", "After each loose stool", "ALL cases - cornerstone"],
["Ondansetron", "4-8 mg", "Q8H PRN", "Nausea/vomiting"],
["Metoclopramide", "10 mg", "TID PRN", "Nausea/vomiting"],
["Metronidazole", "400-500 mg TID x 7d", "", "Giardia / Amebiasis"],
["Azithromycin", "500 mg OD x 3d", "", "Traveler's diarrhea (bacterial)"],
["Zinc (children)", "10-20 mg OD x 14d", "", "WHO recommendation"]],
hc, alt, [PAGE_W*0.28, PAGE_W*0.22, PAGE_W*0.2, PAGE_W*0.3])
banner("4. ENDOCRINE SYSTEM", "endocrine")
hc, alt = SYSTEM_COLORS["endocrine"]
disease_hdr("Type 2 Diabetes Mellitus - Drug Selection")
dtbl(["Drug / Class", "Dose", "Frequency", "Preferred When"],
[["Metformin (1st line)", "500-1000 mg", "BID with food", "All T2DM (if tolerated)"],
["Empagliflozin (SGLT-2i)", "10-25 mg", "OD (morning)", "CVD, HF, CKD (eGFR≥25)"],
["Dapagliflozin (SGLT-2i)", "10 mg", "OD", "HF, CKD, CVD"],
["Semaglutide SC (GLP-1 RA)", "0.5-1 mg", "Once weekly SC", "Obesity, CVD, high HbA1c"],
["Sitagliptin (DPP-4i)", "100 mg", "OD", "Elderly, renal-adjusted"],
["Glimepiride (SU)", "1-4 mg", "OD with breakfast", "Cost-constrained settings"],
["Insulin Glargine (basal)", "10 units start", "OD nocte SC", "HbA1c >9% or all oral failed"]],
hc, alt, [PAGE_W*0.28, PAGE_W*0.15, PAGE_W*0.22, PAGE_W*0.35])
note("HbA1c targets: <7% (most); <8% (elderly/hypoglycemia risk); <6.5% (young, short duration).")
disease_hdr("Thyroid Disorders")
dtbl(["Condition", "Drug", "Dose", "Notes"],
[["Hypothyroidism", "Levothyroxine (T4)", "25-100 mcg OD (empty stomach)", "Start 25-50 mcg; increase q 4-6 wks"],
["Hypothyroidism (elderly)", "Levothyroxine", "12.5-25 mcg OD", "Slow titration (cardiac risk)"],
["Hyperthyroidism (Graves)", "Methimazole (Carbimazole)", "10-40 mg OD", "Check CBC; 6-18 months"],
["Hyperthyroid (symptoms)", "Propranolol", "20-40 mg BID-TID", "Symptom control (tremor, HR)"],
["Hyperthyroid (pregnancy T1)", "Propylthiouracil (PTU)", "50-150 mg TID", "Preferred in 1st trimester"]],
hc, alt, [PAGE_W*0.2, PAGE_W*0.25, PAGE_W*0.28, PAGE_W*0.27])
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────
# PAGE 5: MSK + NEURO
# ──────────────────────────────────────────────────────────────────────────
banner("5. MUSCULOSKELETAL SYSTEM", "musculoskeletal")
hc, alt = SYSTEM_COLORS["musculoskeletal"]
disease_hdr("Osteoarthritis (OA)")
dtbl(["Drug", "Dose", "Frequency", "Notes"],
[["Paracetamol (mild)", "500-1000 mg", "Q6-8H PRN", "1st line - mild pain"],
["Ibuprofen", "400-600 mg", "TID with food", "NSAID - add PPI (omeprazole)"],
["Naproxen", "250-500 mg", "BID with food", "Longer acting NSAID"],
["Diclofenac topical gel", "1-2g to joint", "TID-QID", "Preferred in elderly"],
["Tramadol", "50-100 mg", "Q6-8H PRN", "If NSAIDs contraindicated"],
["Intra-articular methylprednisolone", "40-80 mg", "Q 3 months max", "Specialist / short relief"]],
hc, alt, [PAGE_W*0.3, PAGE_W*0.17, PAGE_W*0.22, PAGE_W*0.31])
disease_hdr("Acute Gout")
dtbl(["Drug", "Dose", "Frequency", "Duration"],
[["Colchicine (low-dose - 1st line)", "1 mg then 0.5 mg after 1h", "", "Day 1; then 0.5 mg BID x 7d"],
["Etoricoxib (NSAID)", "120 mg", "OD", "7 days"],
["Indomethacin", "50 mg", "TID", "5-7 days (GI side effects)"],
["Prednisolone (if NSAID/colchicine CI)", "30-40 mg", "OD", "5 days"]],
hc, alt, [PAGE_W*0.32, PAGE_W*0.25, PAGE_W*0.15, PAGE_W*0.28])
disease_hdr("Urate-Lowering Therapy (Gout Prevention - after acute settles)")
dtbl(["Drug", "Starting Dose", "Target Dose", "Notes"],
[["Allopurinol (1st line)", "100 mg OD", "200-300 mg OD", "Target SUA <6 mg/dL; check HLA-B*58:01"],
["Febuxostat (alternative)", "40 mg OD", "80 mg OD", "Avoid in CVD; more potent"],
["Colchicine prophylaxis", "0.5 mg OD", "0.5 mg OD", "Continue 3-6 months when starting ULT"]],
hc, alt, [PAGE_W*0.28, PAGE_W*0.2, PAGE_W*0.2, PAGE_W*0.32])
disease_hdr("Acute Low Back Pain")
dtbl(["Drug", "Dose", "Frequency", "Duration"],
[["Ibuprofen", "400 mg", "TID with food", "1-2 weeks"],
["Naproxen", "500 mg", "BID with food", "1-2 weeks"],
["Cyclobenzaprine (muscle relaxant)", "5-10 mg", "TID", "Max 2-3 weeks"],
["Diazepam (muscle spasm)", "2-5 mg", "TID PRN", "Short-term; risk of dependence"]],
hc, alt, [PAGE_W*0.28, PAGE_W*0.17, PAGE_W*0.22, PAGE_W*0.33])
note("Avoid bed rest. Physiotherapy + heat + exercise are key. 90% resolve in 6 weeks.")
banner("6. NEUROLOGICAL SYSTEM", "neurological")
hc, alt = SYSTEM_COLORS["neurological"]
disease_hdr("Headache - Tension Type")
dtbl(["Drug", "Dose", "Frequency", "Notes"],
[["Paracetamol (acute)", "1000 mg", "PRN (max 3g/day)", "1st line"],
["Ibuprofen (acute)", "400-600 mg", "PRN with food", "Alternative"],
["Aspirin (acute)", "900 mg", "Stat", "Equally effective"],
["Amitriptyline (prophylaxis)", "10-75 mg", "OD nocte", ">15 headache days/month"]],
hc, alt, [PAGE_W*0.28, PAGE_W*0.17, PAGE_W*0.27, PAGE_W*0.28])
disease_hdr("Migraine")
dtbl(["Setting", "Drug", "Dose", "Notes"],
[["Acute - mild/mod", "Ibuprofen + Metoclopramide", "400-600 mg + 10 mg", "Metoclopramide improves absorption"],
["Acute - moderate/severe", "Sumatriptan (oral)", "50-100 mg", "Repeat after 2h if partial response"],
["Acute - vomiting", "Sumatriptan (nasal/SC)", "20 mg nasal / 6 mg SC", "When oral not tolerated"],
["Prophylaxis (≥4/month)", "Propranolol", "40-80 mg BID", "1st line preventive"],
["Prophylaxis", "Amitriptyline", "25-75 mg OD nocte", "Also for tension-type"],
["Prophylaxis", "Topiramate", "25-100 mg BID", "Gradual titration needed"]],
hc, alt, [PAGE_W*0.22, PAGE_W*0.28, PAGE_W*0.22, PAGE_W*0.28])
disease_hdr("Neuropathic Pain (Diabetic / Post-herpetic)")
dtbl(["Drug", "Starting Dose", "Usual Range", "Notes"],
[["Duloxetine (1st line)", "30 mg OD x 2 weeks", "60-120 mg OD", "FDA-approved for DPN"],
["Pregabalin", "75 mg BID", "150-300 mg BID", "Also for anxiety; reduce in renal impairment"],
["Gabapentin", "300 mg nocte", "300-1200 mg TID", "Gradual titration"],
["Amitriptyline", "10-25 mg nocte", "25-75 mg OD", "Cheap; effective; anticholinergic SEs"]],
hc, alt, [PAGE_W*0.25, PAGE_W*0.25, PAGE_W*0.22, PAGE_W*0.28])
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────
# PAGE 6: DERMATOLOGY + MENTAL HEALTH
# ──────────────────────────────────────────────────────────────────────────
banner("7. DERMATOLOGY", "dermatology")
hc, alt = SYSTEM_COLORS["dermatology"]
disease_hdr("Atopic Dermatitis / Eczema")
dtbl(["Drug", "Potency / Dose", "Frequency", "Site / Notes"],
[["Hydrocortisone 1% cream (TCS)", "Mild", "BID", "Face, skin folds, infants"],
["Betamethasone 0.1% cream", "Moderate-potent", "BID", "Body trunk / limbs"],
["Clobetasol 0.05% cream", "Very potent", "OD-BID (max 2 wks)", "Thick plaques; not face"],
["Tacrolimus 0.1% ointment", "Non-steroid", "BID", "Face, intertriginous; >2 years"],
["Pimecrolimus 1% cream", "Non-steroid", "BID", "Mild-moderate; children"],
["Cetirizine / Hydroxyzine", "10 mg / 25 mg", "OD / QID", "Itch control"]],
hc, alt, [PAGE_W*0.27, PAGE_W*0.2, PAGE_W*0.15, PAGE_W*0.38])
disease_hdr("Acne Vulgaris - Step Therapy")
dtbl(["Severity", "Topical", "Systemic", "Duration"],
[["Mild (comedonal)", "Adapalene 0.1% OD + Benzoyl peroxide 2.5%", "None", "8-12 weeks"],
["Mild-Moderate (papulopustular)", "Clindamycin 1% gel BID + BPO", "None", "12 weeks"],
["Moderate (not responding)", "Topical retinoid + BPO", "Doxycycline 100 mg OD", "3-6 months"],
["Severe (nodulocystic)", "Topical retinoid", "Isotretinoin 0.5-1 mg/kg/day", "4-6 months"]],
hc, alt, [PAGE_W*0.17, PAGE_W*0.33, PAGE_W*0.25, PAGE_W*0.25])
note("Isotretinoin: teratogenic - mandatory contraception, monthly pregnancy test. Monitor LFTs, lipids.")
disease_hdr("Fungal Infections")
dtbl(["Infection", "Topical", "Systemic (if extensive)", "Duration"],
[["Tinea (skin)", "Clotrimazole 1% BID or Terbinafine 1% OD", "Terbinafine 250 mg OD", "Topical 2-4 wks / Oral 2 wks"],
["Tinea unguium (nails)", "Amorolfine nail lacquer", "Terbinafine 250 mg OD", "Fingernails 6 wks; toenails 12 wks"],
["Oral candidiasis", "Nystatin suspension", "Fluconazole 150 mg stat", "Nystatin: 4x daily"],
["Vaginal candidiasis", "Clotrimazole 500 mg pessary stat", "Fluconazole 150 mg stat", "Single dose"]],
hc, alt, [PAGE_W*0.2, PAGE_W*0.28, PAGE_W*0.28, PAGE_W*0.24])
disease_hdr("Scabies")
dtbl(["Drug", "Application", "Repeat", "Notes"],
[["Permethrin 5% cream (1st line)", "Neck to toe, leave 8-14h, wash off", "Repeat at 1 week", "Apply after bath; under nails"],
["Ivermectin 200 mcg/kg oral", "Single dose PO", "Repeat at 2 weeks", "Alternative; good for crusted scabies"]],
hc, alt, [PAGE_W*0.25, PAGE_W*0.3, PAGE_W*0.2, PAGE_W*0.25])
note("Treat ALL household contacts simultaneously. Wash clothes/bedding (60°C).")
banner("8. MENTAL HEALTH", "mental health")
hc, alt = SYSTEM_COLORS["mental health"]
disease_hdr("Depression (MDD) - Pharmacotherapy")
dtbl(["Drug", "Starting Dose", "Therapeutic Range", "Notes"],
[["Sertraline (SSRI - 1st line)", "50 mg OD", "50-200 mg OD", "General adult, post-MI safe"],
["Escitalopram (SSRI)", "10 mg OD", "10-20 mg OD", "Best tolerated SSRI"],
["Fluoxetine (SSRI)", "20 mg OD", "20-60 mg OD", "Long half-life; OD or missed doses"],
["Duloxetine (SNRI)", "30-60 mg OD", "60-120 mg OD", "Also good for pain"],
["Venlafaxine (SNRI)", "37.5 mg OD", "75-225 mg OD", "Monitor BP at higher doses"],
["Mirtazapine (NaSSA)", "15 mg nocte", "15-45 mg nocte", "Insomnia, poor appetite, elderly"]],
hc, alt, [PAGE_W*0.27, PAGE_W*0.2, PAGE_W*0.2, PAGE_W*0.33])
note("Allow 4-6 weeks for full effect. Continue 6-12 months after remission. Monitor suicidality first 2 weeks.")
disease_hdr("Anxiety (GAD / Panic Disorder)")
dtbl(["Drug", "Dose", "Frequency", "Notes"],
[["Escitalopram (1st line)", "5-10 mg starting", "OD; up to 20 mg", "SSRI; 2-4 wks to effect"],
["Sertraline", "25-50 mg starting", "OD; up to 200 mg", ""],
["Buspirone (GAD only)", "5 mg", "BID-TID; up to 30mg/day", "Non-habit forming; no sedation"],
["Clonazepam (short-term)", "0.5 mg", "BID PRN (max 4 wks)", "Dependence risk; bridge only"],
["Pregabalin (GAD)", "75 mg", "BID (up to 300 mg/day)", "Also for neuropathic pain"]],
hc, alt, [PAGE_W*0.25, PAGE_W*0.23, PAGE_W*0.27, PAGE_W*0.25])
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────
# PAGE 7: UROLOGY + ENT + OPHTHALM + WOMEN'S + PAEDS
# ──────────────────────────────────────────────────────────────────────────
banner("9. URINARY / RENAL SYSTEM", "urinary")
hc, alt = SYSTEM_COLORS["urinary"]
disease_hdr("Urinary Tract Infection (UTI)")
dtbl(["Type", "Drug", "Dose", "Duration"],
[["Uncomplicated (woman)", "Nitrofurantoin MR (1st line)", "100 mg BID", "5 days"],
["Uncomplicated (woman)", "Trimethoprim", "200 mg BID", "7 days"],
["Uncomplicated (woman)", "Fosfomycin", "3 g sachet once", "Single dose"],
["Complicated / Male / Pyelonephritis", "Ciprofloxacin", "500 mg BID", "7-14 days"],
["Recurrent UTI (prophylaxis)", "Nitrofurantoin", "50 mg OD nocte", "3-6 months"],
["Post-coital prophylaxis", "Trimethoprim", "100 mg single dose after intercourse", "PRN"]],
hc, alt, [PAGE_W*0.3, PAGE_W*0.25, PAGE_W*0.2, PAGE_W*0.25])
disease_hdr("Benign Prostatic Hyperplasia (BPH)")
dtbl(["Drug Class", "Drug", "Dose", "Notes"],
[["Alpha-blocker (symptom relief)", "Tamsulosin", "0.4 mg OD after meal", "1st line; dizziness on standing"],
["Alpha-blocker", "Alfuzosin", "10 mg OD", "Less orthostasis"],
["5-ARI (shrink prostate)", "Finasteride", "5 mg OD", ">3 months for effect; PSA halved"],
["5-ARI", "Dutasteride", "0.5 mg OD", "Larger prostate benefit"],
["Combination", "Tamsulosin + Finasteride", "Fixed dose combo", "Preferred if prostate >40g"]],
hc, alt, [PAGE_W*0.27, PAGE_W*0.2, PAGE_W*0.23, PAGE_W*0.3])
banner("10. ENT", "ent")
hc, alt = SYSTEM_COLORS["ent"]
disease_hdr("Allergic Rhinitis")
dtbl(["Drug", "Dose", "Frequency", "Notes"],
[["Mometasone furoate IN (1st line)", "100 mcg/nostril", "OD", "Most effective for nasal sx"],
["Fluticasone propionate IN", "50 mcg/nostril", "OD-BID", ""],
["Cetirizine (oral AH)", "10 mg", "OD", "Non-sedating"],
["Loratadine (oral AH)", "10 mg", "OD", "Non-sedating; less sedation than cetirizine"],
["Oxymetazoline (decongestant)", "2 sprays/nostril", "BID (max 5 days!)", "Rebound congestion if >5 days"],
["Montelukast (add-on)", "10 mg", "OD nocte", "Also for concomitant asthma"]],
hc, alt, [PAGE_W*0.3, PAGE_W*0.18, PAGE_W*0.18, PAGE_W*0.34])
banner("11. OPHTHALMOLOGY", "ophthalmology")
hc, alt = SYSTEM_COLORS["ophthalmology"]
disease_hdr("Conjunctivitis & Dry Eye")
dtbl(["Condition", "Drug", "Dose", "Notes"],
[["Bacterial conjunctivitis", "Chloramphenicol 0.5% drops", "1 drop QID x 5d", "Avoid sharing towels"],
["Bacterial conjunctivitis", "Moxifloxacin 0.5% drops", "1 drop TID x 5-7d", "Broader spectrum"],
["Allergic conjunctivitis", "Olopatadine 0.1% drops", "1 drop BID", "Antihistamine + mast cell"],
["Allergic conjunctivitis", "Sodium cromoglycate 2%", "1-2 drops QID", "Prophylactic"],
["Dry eye syndrome", "Hyaluronic acid drops", "1-2 drops QID-hourly PRN", "Preservative-free if frequent"],
["Glaucoma (open angle)", "Latanoprost 0.005% drops", "1 drop OD nocte", "1st line PGA"]],
hc, alt, [PAGE_W*0.23, PAGE_W*0.27, PAGE_W*0.22, PAGE_W*0.28])
banner("12. WOMEN'S HEALTH", "womens health")
hc, alt = SYSTEM_COLORS["womens health"]
disease_hdr("Dysmenorrhea / PCOS / Menopause")
dtbl(["Condition", "Drug", "Dose", "Notes"],
[["Primary dysmenorrhea", "Mefenamic acid", "500 mg TID (start 1-2d before menses)", "NSAIDs reduce prostaglandins"],
["Primary dysmenorrhea", "Ibuprofen", "400 mg TID with food", "Start 1-2 days before period"],
["PCOS - irregular cycles", "Combined OCP (EE+Cyproterone)", "1 tablet OD cyclically", "Also for hirsutism"],
["PCOS - insulin resistance", "Metformin", "500-1000 mg BID", "Improves ovulation"],
["PCOS - ovulation induction", "Letrozole", "2.5-5 mg OD day 3-7", "Preferred over clomiphene"],
["Menopause (vasomotor sx)", "HRT (estrogen + progestogen)", "Lowest effective dose", "Add progestogen if uterus intact"],
["Menopause (no uterus)", "Estrogen alone (patches/oral)", "Standard dose", "No progestogen needed"]],
hc, alt, [PAGE_W*0.22, PAGE_W*0.22, PAGE_W*0.28, PAGE_W*0.28])
banner("13. PEDIATRIC OPD", "pediatric")
hc, alt = SYSTEM_COLORS["pediatric"]
disease_hdr("Common Pediatric Prescriptions")
dtbl(["Condition / Drug", "Dose", "Frequency", "Notes"],
[["Fever - Paracetamol", "15 mg/kg/dose", "Q4-6H PRN", "Max 60 mg/kg/day"],
["Fever - Ibuprofen (>6 months)", "10 mg/kg/dose", "Q6-8H PRN", "With food; max 40 mg/kg/day"],
["Acute diarrhea - ORS", "50-100 mL/kg over 2-4h", "After each loose stool", "Cornerstone of management"],
["Diarrhea - Zinc", "10 mg OD (<6 months) / 20 mg OD (>6 mo)", "OD x 14 days", "WHO/UNICEF recommendation"],
["AOM - Amoxicillin", "40-90 mg/kg/day", "Divided BID-TID x 5-7d", "<2yr or bilateral: always treat"],
["CAP (outpatient) - Amoxicillin", "40-90 mg/kg/day", "Divided BID-TID x 5-7d", "Mild non-severe pneumonia"],
["URTI / viral - Saline nasal drops", "2-3 drops/nostril", "Q3-4H PRN", "Safe; no antibiotics needed"]],
hc, alt, [PAGE_W*0.3, PAGE_W*0.25, PAGE_W*0.23, PAGE_W*0.22])
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────
# PAGE 8: MASTER QUICK REFERENCE TABLE
# ──────────────────────────────────────────────────────────────────────────
banner("14. MASTER QUICK-REFERENCE DOSING TABLE", "preventive")
hc, alt = SYSTEM_COLORS["preventive"]
story.append(Spacer(1, 0.2*cm))
master = [
["Condition", "Drug (1st Line)", "Adult Dose", "Freq", "Key Caution"],
# Respiratory
["Common cold", "Cetirizine + Paracetamol", "10mg + 500-1000mg", "OD + Q6H", "No antibiotics"],
["Strep Pharyngitis", "Amoxicillin", "500 mg", "TID x 10d", "Confirm Strep"],
["Mild CAP", "Amoxicillin", "1 g", "TID x 5-7d", "Atypical: +Doxy/Azithro"],
["Asthma (acute)", "Salbutamol MDI", "2-4 puffs", "Q4H PRN", "Escalate if no response"],
["COPD (stable B)", "Tiotropium", "18 mcg inhaled", "OD", "Rinse mouth after"],
# Cardiovascular
["HTN (1st line)", "Amlodipine", "5-10 mg", "OD", "Ankle edema SE"],
["HTN + DM/CKD", "Ramipril / Losartan", "5-10 mg / 50-100 mg", "OD", "Monitor K+, creatinine"],
["Dyslipidemia", "Atorvastatin", "40-80 mg", "OD night", "CK if myalgia"],
["Stable angina", "Metoprolol + GTN SL", "25-100 mg / 0.5 mg PRN", "OD / PRN", "Titrate HR 55-65 bpm"],
# GI
["GERD", "Omeprazole", "20-40 mg", "OD before breakfast", "Review at 8 weeks"],
["H. pylori", "Triple therapy (PPI+Clari+Amox)", "Standard doses", "BID x 14d", "Test eradication at 4 wks"],
["IBS-D", "Mebeverine + Loperamide", "135 mg + 2 mg", "TID + PRN", "Low-FODMAP diet"],
["Acute gastro", "ORS + Ondansetron", "200-400 mL + 4-8 mg", "PRN", "IV fluids if severe"],
# Endocrine
["T2DM (start)", "Metformin", "500 mg", "BID with food", "eGFR <30: stop"],
["T2DM + CVD/HF", "Empagliflozin", "10 mg", "OD morning", "eGFR ≥25 required"],
["T2DM + obesity", "Semaglutide SC", "0.5-1 mg", "Once weekly", "Nausea common - titrate"],
["Hypothyroidism", "Levothyroxine", "50-100 mcg", "OD (empty stomach)", "TSH check q 6-8 wks"],
["Hyperthyroid", "Methimazole", "10-40 mg", "OD", "CBC monitoring (agranulocytosis)"],
# MSK
["OA pain", "Ibuprofen + PPI", "400-600 mg + Omeprazole 20mg", "TID + OD", "Renal/GI risk"],
["Acute gout", "Colchicine (low-dose)", "1 mg stat + 0.5 mg 1h later", "", "GI SEs; reduce in renal impairment"],
["Gout prevent.", "Allopurinol", "100-300 mg", "OD", "Start after acute settled"],
["Acute LBP", "Naproxen", "500 mg", "BID x 1-2 wks", "Physiotherapy + heat"],
["RA", "Methotrexate + Folic acid", "7.5-25 mg wkly / 5 mg wkly", "Weekly", "Avoid pregnancy; LFT monitoring"],
# Neuro
["Tension HA", "Paracetamol / Ibuprofen", "1000 mg / 400 mg", "PRN", "Avoid overuse >15d/month"],
["Migraine (acute)", "Sumatriptan", "50-100 mg PO", "PRN", "Max 2 doses/24h"],
["Migraine prevent.", "Propranolol", "40-80 mg", "BID", "Contraindicated in asthma"],
["Diabetic neuropathy", "Duloxetine", "60 mg", "OD", "FDA-approved for DPN"],
# Derma
["Eczema (mild)", "Hydrocortisone 1%", "Topical thin layer", "BID", "Not on face long-term"],
["Fungal skin", "Clotrimazole 1%", "Topical", "BID x 2-4 wks", "Keep area dry"],
["Acne (moderate)", "Doxycycline + Topical Retinoid", "100 mg + adapalene", "OD + OD", "Sun protection"],
["Scabies", "Permethrin 5%", "Whole body overnight", "x2 (1 wk apart)", "Treat all contacts"],
["Urticaria", "Cetirizine / Fexofenadine", "10 mg / 180 mg", "OD", "Non-sedating preferred"],
# Mental health
["Depression", "Sertraline", "50-200 mg", "OD", "4-6 wks for effect"],
["Anxiety (GAD)", "Escitalopram", "10-20 mg", "OD", "SSRIs preferred over BZD"],
["Insomnia (short)", "Zolpidem / Zopiclone", "5-10 mg / 3.75-7.5 mg", "OD nocte PRN", "Max 4 weeks"],
# UTI/BPH
["UTI (women)", "Nitrofurantoin MR", "100 mg", "BID x 5d", "Avoid if eGFR <30"],
["BPH", "Tamsulosin", "0.4 mg", "OD after meal", "Postural hypotension"],
# ENT
["Allergic rhinitis", "Mometasone IN + Cetirizine", "100 mcg/nostril + 10 mg", "OD + OD", "INS > oral AH"],
# Women
["Dysmenorrhea", "Mefenamic acid", "500 mg", "TID (start before period)", "With food"],
["PCOS", "Metformin + OCP", "500-1000 mg + 1 tab", "BID + OD", "Lifestyle is key"],
# Paeds
["Child fever", "Paracetamol", "15 mg/kg/dose", "Q4-6H PRN", "Max 60 mg/kg/day"],
["Child diarrhea", "ORS + Zinc", "Vol-based + 20 mg", "PRN + OD x 14d", "Breastfeeding continues"],
]
col_w = [PAGE_W*0.18, PAGE_W*0.23, PAGE_W*0.2, PAGE_W*0.14, PAGE_W*0.25]
data = []
for i, row in enumerate(master):
if i == 0:
data.append([Paragraph(f"<b>{c}</b>", styles['tbl_header']) for c in row])
else:
data.append([Paragraph(str(c), styles['tbl_cell_bold'] if j == 0 else styles['tbl_cell'])
for j, c in enumerate(row)])
tbl = Table(data, colWidths=col_w, repeatRows=1)
# Alternating rows + category separators
ts = TableStyle([
('BACKGROUND', (0,0), (-1,0), C_GREEN),
('TEXTCOLOR', (0,0), (-1,0), C_WHITE),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 7),
('ROWBACKGROUNDS', (0,1), (-1,-1), [C_WHITE, HexColor("#F1F8E9")]),
('GRID', (0,0), (-1,-1), 0.25, HexColor("#CFD8DC")),
('TOPPADDING', (0,0), (-1,-1), 2),
('BOTTOMPADDING', (0,0), (-1,-1), 2),
('LEFTPADDING', (0,0), (-1,-1), 4),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
])
tbl.setStyle(ts)
story.append(tbl)
sp(0.4)
# Disclaimer
disclaimer = Table(
[[Paragraph(
"<b>⚠ IMPORTANT DISCLAIMER:</b> This quick reference is for educational and general guidance "
"purposes only. It does not replace clinical judgment. All doses are for adults with normal "
"renal and hepatic function unless stated. Adjust for age, weight, organ impairment, "
"drug interactions, allergies, and local antibiotic resistance patterns. Always verify against "
"current guidelines and official prescribing information before prescribing. "
"Drug availability and first-line choices may vary by country.",
styles['warning'])]],
colWidths=[PAGE_W])
disclaimer.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), HexColor("#FFEBEE")),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 10),
('BOX', (0,0), (-1,-1), 1, C_RED),
]))
story.append(disclaimer)
return story
# ══════════════════════════════════════════════════════════════════════════════
# BUILD PDF
# ══════════════════════════════════════════════════════════════════════════════
def build_pdf():
doc = SimpleDocTemplate(
OUTPUT_PATH,
pagesize=A4,
topMargin=2.2*cm,
bottomMargin=1.2*cm,
leftMargin=1.2*cm,
rightMargin=1.2*cm,
title="OPD Quick Reference Guide",
author="Orris Medical AI",
subject="System-Wide OPD Prescription & Dosing Reference",
)
styles = make_styles()
story = build_content(styles)
hf = HeaderFooter("OPD Quick Reference Guide | System-Wide Prescription & Dosing")
doc.build(story, onFirstPage=hf, onLaterPages=hf)
print(f"✅ PDF generated: {OUTPUT_PATH}")
if __name__ == "__main__":
build_pdf()
cd /home/daytona/workspace/opd-guide && python3 generate_opd_pdf.py 2>&1
ls -lh /home/daytona/workspace/opd-guide/OPD_Quick_Reference_Guide.pdf
OPD Quick Reference Guide
PDF Document · PDF
| Section | Content |
|---|---|
| Cover + Legend | Abbreviations (drug classes, frequencies, routes) |
| Respiratory | Common cold, Strep pharyngitis, CAP, Asthma step therapy, COPD GOLD groups, AECOPD |
| Cardiovascular | HTN drug selection, Dyslipidemia, Stable angina, HF-rEF (4 GDMT pillars) |
| GI | GERD/PUD, H. pylori triple therapy, IBS subtypes, Acute gastroenteritis |
| Endocrine | T2DM drug selection (with comorbidity guidance), Thyroid disorders |
| MSK + Neuro | OA, Gout (acute + prevention), Low back pain, Tension HA, Migraine, Neuropathic pain |
| Dermatology + Mental Health | Eczema, Acne steps, Fungal, Scabies, Depression (SSRIs/SNRIs), Anxiety, Insomnia |
| Urology + ENT + Ophthalm + Women's + Paeds | UTI, BPH, Allergic rhinitis, Conjunctivitis, PCOS, Dysmenorrhea, Pediatric doses |
| Master Quick-Reference Table | 45+ conditions - drug, dose, frequency, key caution in one scannable table |