Prescription format of case of fever + burning sensation

Reading File
Finding Sources
Finding Sources
Searching the Web

prescription format fever burning sensation UTI sample India

Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
I now have all the information needed to write a complete, well-structured prescription format. Here it is:

Prescription Format: Fever + Burning Sensation (Presumed UTI / Dysuria)

Clinical Impression: Acute Uncomplicated Cystitis (UTI) - Fever + Dysuria/Burning Micturition

🩺 Prescription

Dr. [Name], MBBS/MD
Reg. No.: [Registration Number]
[Clinic/Hospital Name, Address]
Date: __ / __ / ______

Patient Name: ___________________   Age: ___   Sex: M / F
Weight: ___ kg                       IP/OP No.: _________

Dx / Clinical Impression: Acute Urinary Tract Infection (Cystitis)
Symptoms: Fever, Dysuria (Burning Micturition), Frequency

─────────────────────────────────────────────────────
β„ž
─────────────────────────────────────────────────────

1. Tab. Paracetamol 500 mg
   1 tab orally TDS (three times daily) Γ— 5 days
   (Take after food. For fever & pain relief.)

2. Tab. Norfloxacin 400 mg + Tinidazole 600 mg
   1 tab orally BD (twice daily) Γ— 5–7 days
   (Take on empty stomach or as directed.)
   ── OR ──
   Tab. Ciprofloxacin 500 mg
   1 tab orally BD Γ— 3–5 days
   (Preferred if local resistance pattern allows)
   ── OR ──
   Tab. Nitrofurantoin (Macrobid) 100 mg
   1 tab orally BD Γ— 7 days
   (Good choice in uncomplicated UTI; avoid if CrCl < 30)

3. Tab. Phenazopyridine 200 mg
   1 tab orally TDS Γ— 2–3 days
   (Urinary analgesic for burning relief; urine will turn orange)

4. Sachet ORS / Electrolyte Oral Solution
   1 sachet in 200 mL water, TDS Γ— 3 days
   (For hydration with fever)

─────────────────────────────────────────────────────
Investigations Advised:
  β€’ Urine Routine & Microscopy (Urine R/M)
  β€’ Urine Culture & Sensitivity (C/S) β€” if recurrent or not improving in 48 hrs
  β€’ CBC + CRP (if high-grade fever / pyelonephritis suspected)

─────────────────────────────────────────────────────
Advice / Instructions:
  β€’ Increase fluid intake (water β‰₯ 2–3 L/day)
  β€’ Avoid spicy/oily food
  β€’ Maintain perineal hygiene
  β€’ Complete the antibiotic course even if symptoms improve
  β€’ Return immediately if: high-grade fever (>39Β°C), chills, loin/flank pain, vomiting
    (these may suggest upper UTI / pyelonephritis β€” needs parenteral therapy)

─────────────────────────────────────────────────────
Follow-up: After 3–5 days, or earlier if not improving

                           Signature: _______________
                           Stamp & Reg. No.

Key Drug Notes

DrugDoseDurationNotes
Paracetamol500–1000 mg TDS3–5 daysAntipyretic + analgesic
Ciprofloxacin250–500 mg BD3 daysFirst-line fluoroquinolone
Nitrofurantoin100 mg BD7 daysGood for uncomplicated bladder UTI only
TMP-SMX (Cotrimoxazole)160/800 mg BD3 daysUse if local resistance <20%
Norfloxacin400 mg BD3–5 daysUrinary tract specific quinolone
Fosfomycin3 g single doseSingle doseConvenient; useful in pregnancy
Phenazopyridine200 mg TDSMax 2 daysSymptom relief only, not antibiotic

Differential Diagnosis to Keep in Mind

  • Fever + Burning micturition (dysuria) = most likely Cystitis (lower UTI)
  • Fever + Flank pain + Rigors = Pyelonephritis (upper UTI) - needs IV antibiotics + hospitalization
  • Burning without fever in women = may be Vaginitis - different management
  • Burning sensation not urinary (e.g., skin, GERD, neuropathy) = different prescription entirely

Sources:
  • Textbook of Family Medicine 9e, Table 40-18 - Treatment Options for Acute Uncomplicated UTI
  • Goldman-Cecil Medicine, Table 263-5 - Cystitis vs. Pyelonephritis diagnosis & treatment
  • Schwartz's Principles of Surgery - UTI/Cystitis treatment protocols
Note: Always adjust antibiotic choice based on local antibiogram/resistance patterns. Quinolone resistance is rising in many regions (especially South Asia). Culture-guided therapy is preferred for recurrent or complicated UTI.

Create a quick reference PDF of antibiotic dosages for UTI/dysuria

Reading File
Running Command

mkdir -p /home/daytona/workspace/uti-pdf && ls /home/daytona/workspace/uti-pdf/

Writing File

~/uti-pdf/generate_uti_pdf.py

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

OUTPUT = "/home/daytona/workspace/uti-pdf/UTI_Antibiotic_Quick_Reference.pdf"

# ── Colour palette ──────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1A3A5C")
MED_BLUE    = colors.HexColor("#2E6DA4")
LIGHT_BLUE  = colors.HexColor("#D6E8F7")
TEAL        = colors.HexColor("#0D7377")
LIGHT_TEAL  = colors.HexColor("#D0EFEF")
ORANGE      = colors.HexColor("#E07B30")
LIGHT_ORANGE= colors.HexColor("#FDEBD0")
RED         = colors.HexColor("#C0392B")
LIGHT_RED   = colors.HexColor("#FADBD8")
GREEN       = colors.HexColor("#1E8449")
LIGHT_GREEN = colors.HexColor("#D5F5E3")
YELLOW_BG   = colors.HexColor("#FDFAE3")
GREY_BG     = colors.HexColor("#F2F2F2")
WHITE       = colors.white
BLACK       = colors.black

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

W, H = A4
usable_w = W - 30*mm

styles = getSampleStyleSheet()

def S(name, **kw):
    base = styles[name] if name in styles else styles["Normal"]
    return ParagraphStyle(name + str(id(kw)), parent=base, **kw)

title_style   = S("Normal", fontSize=20, textColor=WHITE, fontName="Helvetica-Bold",
                  alignment=TA_CENTER, spaceAfter=2)
sub_style     = S("Normal", fontSize=10, textColor=LIGHT_BLUE, fontName="Helvetica",
                  alignment=TA_CENTER, spaceAfter=0)
date_style    = S("Normal", fontSize=8, textColor=LIGHT_BLUE, fontName="Helvetica-Oblique",
                  alignment=TA_RIGHT)

section_style = S("Normal", fontSize=11, textColor=WHITE, fontName="Helvetica-Bold",
                  alignment=TA_LEFT, leftPadding=6)
body_style    = S("Normal", fontSize=8.5, fontName="Helvetica", textColor=BLACK,
                  leading=13, spaceAfter=3)
bold_style    = S("Normal", fontSize=8.5, fontName="Helvetica-Bold", textColor=BLACK)
small_style   = S("Normal", fontSize=7.5, fontName="Helvetica", textColor=colors.grey)
note_style    = S("Normal", fontSize=8, fontName="Helvetica-Oblique",
                  textColor=colors.HexColor("#5D4037"), leading=11)
warn_style    = S("Normal", fontSize=8, fontName="Helvetica-Bold",
                  textColor=RED)
green_style   = S("Normal", fontSize=8, fontName="Helvetica-Bold", textColor=GREEN)
cell_style    = S("Normal", fontSize=8, fontName="Helvetica", textColor=BLACK,
                  leading=11)
cell_bold     = S("Normal", fontSize=8, fontName="Helvetica-Bold", textColor=BLACK,
                  leading=11)
cell_hdr      = S("Normal", fontSize=8.5, fontName="Helvetica-Bold", textColor=WHITE,
                  alignment=TA_CENTER, leading=12)

elements = []

# ── HEADER BANNER ────────────────────────────────────────────────────────────
header_data = [[
    Paragraph("UTI / DYSURIA", title_style),
    Paragraph("Antibiotic Quick Reference Card", sub_style),
    Paragraph("Date: July 2026", date_style),
]]
header_table = Table([[
    Paragraph("UTI / DYSURIA β€” Antibiotic Quick Reference", title_style),
]], colWidths=[usable_w])
header_table.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,-1), DARK_BLUE),
    ("TOPPADDING",   (0,0), (-1,-1), 10),
    ("BOTTOMPADDING",(0,0), (-1,-1), 8),
    ("LEFTPADDING",  (0,0), (-1,-1), 12),
    ("ROUNDEDCORNERS", [6]),
]))
elements.append(header_table)

sub_banner = Table([[
    Paragraph("Based on IDSA/ESCMID guidelines &amp; Family Medicine evidence | For uncomplicated UTI in non-pregnant adults", sub_style),
]], colWidths=[usable_w])
sub_banner.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,-1), MED_BLUE),
    ("TOPPADDING",   (0,0), (-1,-1), 4),
    ("BOTTOMPADDING",(0,0), (-1,-1), 4),
]))
elements.append(sub_banner)
elements.append(Spacer(1, 6))

# ── SECTION HEADER helper ────────────────────────────────────────────────────
def section_header(text, color=MED_BLUE):
    t = Table([[Paragraph(text, section_style)]], colWidths=[usable_w])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), color),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ]))
    return t

# ── 1. CLINICAL DIFFERENTIATION TABLE ────────────────────────────────────────
elements.append(section_header("1.  CLINICAL DIFFERENTIATION: Cystitis vs Pyelonephritis"))
elements.append(Spacer(1, 3))

diff_headers = [
    Paragraph("Feature", cell_hdr),
    Paragraph("Cystitis (Lower UTI)", cell_hdr),
    Paragraph("Pyelonephritis (Upper UTI)", cell_hdr),
]
diff_rows = [
    ["Fever",          "Absent / low-grade",    "Present (>38.5Β°C), chills"],
    ["Dysuria",        "Yes (hallmark)",         "May be present"],
    ["Frequency",      "Yes",                    "May be present"],
    ["Flank / Loin pain","No",                   "Yes (hallmark)"],
    ["Nausea / vomiting","Absent",               "Common"],
    ["CRP",            "Normal",                 "Elevated"],
    ["Blood cultures", "Negative",               "Positive in 10-30%"],
    ["Route of Rx",    "Oral antibiotics",       "IV then oral step-down"],
]

diff_table_data = [diff_headers]
for r in diff_rows:
    diff_table_data.append([
        Paragraph(r[0], cell_bold),
        Paragraph(r[1], cell_style),
        Paragraph(r[2], cell_style),
    ])

col1 = usable_w * 0.26
col2 = usable_w * 0.37
col3 = usable_w * 0.37

diff_table = Table(diff_table_data, colWidths=[col1, col2, col3])
diff_table.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), TEAL),
    ("BACKGROUND",    (0,1), (-1,1), LIGHT_TEAL),
    ("BACKGROUND",    (0,2), (-1,2), WHITE),
    ("BACKGROUND",    (0,3), (-1,3), LIGHT_TEAL),
    ("BACKGROUND",    (0,4), (-1,4), WHITE),
    ("BACKGROUND",    (0,5), (-1,5), LIGHT_TEAL),
    ("BACKGROUND",    (0,6), (-1,6), WHITE),
    ("BACKGROUND",    (0,7), (-1,7), LIGHT_TEAL),
    ("BACKGROUND",    (0,8), (-1,8), WHITE),
    ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [LIGHT_TEAL, WHITE]),
    ("ALIGN",         (0,0), (-1,-1), "LEFT"),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
elements.append(diff_table)
elements.append(Spacer(1, 8))

# ── 2. UNCOMPLICATED CYSTITIS (First-Line) ───────────────────────────────────
elements.append(section_header("2.  UNCOMPLICATED CYSTITIS β€” First-Line Antibiotics", TEAL))
elements.append(Spacer(1, 3))

unc_headers = [
    Paragraph("Drug", cell_hdr),
    Paragraph("Dose", cell_hdr),
    Paragraph("Frequency", cell_hdr),
    Paragraph("Duration", cell_hdr),
    Paragraph("Notes", cell_hdr),
]
unc_rows = [
    ["Nitrofurantoin\n(Macrobid / Macrocrystals)", "100 mg", "BD (twice daily)", "7 days",
     "Preferred 1st-line. Avoid if CrCl <30 or pyelonephritis suspected."],
    ["Trimethoprim-\nSulfamethoxazole (TMP-SMX DS)", "160/800 mg", "BD", "3 days",
     "Use only if local resistance <20%. Avoid in late pregnancy."],
    ["Fosfomycin Trometamol", "3 g sachet", "Single dose", "1 day",
     "Convenient. Good in pregnancy. Not effective for pyelonephritis."],
    ["Pivmecillinam", "400 mg loading,\nthen 200 mg", "TDS", "3–7 days",
     "Low resistance; not widely available in all regions."],
]

unc_col = [usable_w*0.20, usable_w*0.15, usable_w*0.14, usable_w*0.12, usable_w*0.39]
unc_table_data = [unc_headers]
for r in unc_rows:
    unc_table_data.append([
        Paragraph(r[0], cell_bold),
        Paragraph(r[1], cell_style),
        Paragraph(r[2], cell_style),
        Paragraph(r[3], cell_style),
        Paragraph(r[4], cell_style),
    ])

unc_table = Table(unc_table_data, colWidths=unc_col)
unc_table.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), TEAL),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [LIGHT_TEAL, WHITE]),
    ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
    ("ALIGN",         (0,0), (-1,-1), "LEFT"),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
elements.append(unc_table)
elements.append(Spacer(1, 8))

# ── 3. ALTERNATIVE / 2ND-LINE (Fluoroquinolones) ────────────────────────────
elements.append(section_header("3.  ALTERNATIVE / SECOND-LINE β€” Fluoroquinolones (use judiciously)", ORANGE))
elements.append(Spacer(1, 3))

fq_headers = [
    Paragraph("Drug", cell_hdr),
    Paragraph("Dose", cell_hdr),
    Paragraph("Frequency", cell_hdr),
    Paragraph("Duration (Cystitis)", cell_hdr),
    Paragraph("Duration (Pyelonephritis)", cell_hdr),
]
fq_rows = [
    ["Ciprofloxacin",     "250–500 mg", "BD",          "3 days",  "7–14 days IV/oral"],
    ["Levofloxacin",      "250–750 mg", "OD (once daily)","3 days","5–7 days"],
    ["Norfloxacin",       "400 mg",     "BD",           "3–5 days","Not recommended"],
    ["Ofloxacin",         "200 mg",     "BD",           "3 days",  "10–14 days"],
]
fq_col = [usable_w*0.20, usable_w*0.14, usable_w*0.16, usable_w*0.20, usable_w*0.30]
fq_table_data = [fq_headers]
for r in fq_rows:
    fq_table_data.append([
        Paragraph(r[0], cell_bold),
        Paragraph(r[1], cell_style),
        Paragraph(r[2], cell_style),
        Paragraph(r[3], cell_style),
        Paragraph(r[4], cell_style),
    ])

fq_table = Table(fq_table_data, colWidths=fq_col)
fq_table.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), ORANGE),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [LIGHT_ORANGE, WHITE]),
    ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
    ("ALIGN",         (0,0), (-1,-1), "LEFT"),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
elements.append(fq_table)

fq_warn = Table([[
    Paragraph("⚠  Fluoroquinolones are NOT recommended as first-line for uncomplicated cystitis due to rising resistance and side-effect profile (tendinopathy, QT prolongation). Reserve for complicated UTI or pyelonephritis.", warn_style)
]], colWidths=[usable_w])
fq_warn.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,-1), LIGHT_RED),
    ("TOPPADDING",    (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ("BOX",           (0,0), (-1,-1), 1, RED),
]))
elements.append(Spacer(1, 3))
elements.append(fq_warn)
elements.append(Spacer(1, 8))

# ── 4. SPECIAL POPULATIONS ───────────────────────────────────────────────────
elements.append(section_header("4.  SPECIAL POPULATIONS", colors.HexColor("#6C3483")))
elements.append(Spacer(1, 3))

sp_headers = [
    Paragraph("Population", cell_hdr),
    Paragraph("Preferred Drug", cell_hdr),
    Paragraph("Dose & Duration", cell_hdr),
    Paragraph("Avoid", cell_hdr),
]
sp_rows = [
    ["Pregnant women",
     "Nitrofurantoin or\nCephalosporin (e.g., Cefuroxime)",
     "Nitrofurantoin 100mg BD Γ— 5–7d\nCefuroxime 250mg BD Γ— 7d",
     "Fluoroquinolones, TMP-SMX in 3rd trimester, Nitrofurantoin near term"],
    ["Men (uncomplicated)",
     "TMP-SMX or Fluoroquinolone",
     "TMP-SMX 160/800mg BD Γ— 7d\nor Ciprofloxacin 500mg BD Γ— 7d",
     "Nitrofurantoin (poor tissue penetration in prostate)"],
    ["Elderly (>65 yrs)",
     "Nitrofurantoin or\nCephalosporin",
     "Same dose; 7 days\n(culture-guided preferred)",
     "Fluoroquinolones (CNS side effects, delirium risk)"],
    ["Recurrent UTI (β‰₯3/yr)",
     "Based on culture/sensitivity",
     "C&S-guided; consider low-dose\nprophylaxis (Nitrofurantoin 50mg OD HS)",
     "Empiric fluoroquinolones"],
    ["Complicated UTI\n(catheter, obstruction, DM)",
     "IV Ceftriaxone 1g OD\nor IV Ciprofloxacin 400mg BD",
     "7–14 days; switch oral once afebrile",
     "Nitrofurantoin, Fosfomycin"],
]

sp_col = [usable_w*0.18, usable_w*0.24, usable_w*0.30, usable_w*0.28]
sp_bg  = colors.HexColor("#EDE7F6")
sp_hdr_color = colors.HexColor("#6C3483")

sp_table_data = [sp_headers]
for r in sp_rows:
    sp_table_data.append([
        Paragraph(r[0], cell_bold),
        Paragraph(r[1], cell_style),
        Paragraph(r[2], cell_style),
        Paragraph(r[3], cell_style),
    ])

sp_table = Table(sp_table_data, colWidths=sp_col)
sp_table.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), sp_hdr_color),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [sp_bg, WHITE]),
    ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
    ("ALIGN",         (0,0), (-1,-1), "LEFT"),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
elements.append(sp_table)
elements.append(Spacer(1, 8))

# ── 5. SYMPTOM RELIEF / ADJUNCTS ─────────────────────────────────────────────
elements.append(section_header("5.  SYMPTOMATIC / ADJUNCT THERAPY", GREEN))
elements.append(Spacer(1, 3))

adj_data = [
    [Paragraph("Drug", cell_hdr), Paragraph("Dose", cell_hdr),
     Paragraph("Indication", cell_hdr), Paragraph("Notes", cell_hdr)],
    [Paragraph("Paracetamol", cell_bold), Paragraph("500–1000 mg TDS", cell_style),
     Paragraph("Fever & pain", cell_style), Paragraph("After food. Max 4g/day.", cell_style)],
    [Paragraph("Ibuprofen", cell_bold), Paragraph("400 mg TDS", cell_style),
     Paragraph("Fever, dysuria", cell_style), Paragraph("Avoid if renal impairment or GI issues.", cell_style)],
    [Paragraph("Phenazopyridine", cell_bold), Paragraph("200 mg TDS Γ— 2 days", cell_style),
     Paragraph("Burning micturition (urinary analgesic)", cell_style),
     Paragraph("NOT an antibiotic. Turns urine orange. Max 2 days.", cell_style)],
    [Paragraph("ORS / Oral fluids", cell_bold), Paragraph("β‰₯ 2–3 L water/day", cell_style),
     Paragraph("Hydration with fever", cell_style), Paragraph("Flushes bacteria from urinary tract.", cell_style)],
]

adj_col = [usable_w*0.22, usable_w*0.20, usable_w*0.26, usable_w*0.32]
adj_table = Table(adj_data, colWidths=adj_col)
adj_table.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), GREEN),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [LIGHT_GREEN, WHITE]),
    ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
    ("ALIGN",         (0,0), (-1,-1), "LEFT"),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
elements.append(adj_table)
elements.append(Spacer(1, 8))

# ── 6. RED FLAGS ─────────────────────────────────────────────────────────────
elements.append(section_header("6.  RED FLAGS β€” Refer / Escalate Immediately", RED))
elements.append(Spacer(1, 3))

flags = [
    ("High-grade fever >39Β°C with rigors/chills",          "Consider pyelonephritis β†’ IV antibiotics"),
    ("Loin / flank / costovertebral angle (CVA) tenderness","Upper UTI β€” needs parenteral therapy"),
    ("Persistent vomiting β€” cannot take oral meds",        "IV fluids + IV antibiotics"),
    ("Haematuria (frank blood in urine)",                  "Rule out malignancy / stones / TB"),
    ("No response to antibiotics after 48–72 hours",       "Repeat urine C&S, reassess diagnosis"),
    ("Immunocompromised / Diabetic / Transplant patient",  "Treat as complicated UTI"),
    ("Pregnancy with UTI symptoms",                        "Treat promptly, urine culture mandatory"),
]

flag_col = [usable_w*0.45, usable_w*0.55]
flag_data = []
for f in flags:
    flag_data.append([
        Paragraph("πŸ”΄  " + f[0], warn_style),
        Paragraph("➜  " + f[1], cell_style),
    ])
flag_table = Table(flag_data, colWidths=flag_col)
flag_table.setStyle(TableStyle([
    ("ROWBACKGROUNDS", (0,0), (-1,-1), [LIGHT_RED, WHITE]),
    ("GRID",           (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
    ("ALIGN",          (0,0), (-1,-1), "LEFT"),
    ("VALIGN",         (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",     (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",  (0,0), (-1,-1), 5),
    ("LEFTPADDING",    (0,0), (-1,-1), 7),
]))
elements.append(flag_table)
elements.append(Spacer(1, 8))

# ── 7. INVESTIGATIONS ────────────────────────────────────────────────────────
elements.append(section_header("7.  INVESTIGATIONS", colors.HexColor("#1A5276")))
elements.append(Spacer(1, 3))

inv_data = [
    [Paragraph("Investigation", cell_hdr), Paragraph("When to Order", cell_hdr),
     Paragraph("Key Finding", cell_hdr)],
    [Paragraph("Urine Routine & Microscopy (R/M)", cell_bold),
     Paragraph("All suspected UTI cases", cell_style),
     Paragraph("Pyuria (>10 WBC/hpf), nitrites, bacteria", cell_style)],
    [Paragraph("Urine Culture & Sensitivity (C/S)", cell_bold),
     Paragraph("Recurrent UTI, failure to respond, complicated UTI, pregnancy", cell_style),
     Paragraph("Identifies organism + guides antibiotic choice", cell_style)],
    [Paragraph("CBC + CRP", cell_bold),
     Paragraph("If fever present or pyelonephritis suspected", cell_style),
     Paragraph("Elevated WBC & CRP β†’ upper UTI / sepsis", cell_style)],
    [Paragraph("Serum Creatinine / eGFR", cell_bold),
     Paragraph("Before prescribing Nitrofurantoin or aminoglycosides", cell_style),
     Paragraph("Contraindicated if CrCl <30 mL/min", cell_style)],
    [Paragraph("Ultrasound KUB", cell_bold),
     Paragraph("Recurrent UTI, haematuria, suspected stones/abscess", cell_style),
     Paragraph("Rules out obstruction, stones, renal abscess", cell_style)],
]

inv_col = [usable_w*0.28, usable_w*0.38, usable_w*0.34]
inv_table = Table(inv_data, colWidths=inv_col)
inv_table.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), colors.HexColor("#1A5276")),
    ("ROWBACKGROUNDS",(0,1), (-1,-1), [LIGHT_BLUE, WHITE]),
    ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
    ("ALIGN",         (0,0), (-1,-1), "LEFT"),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
elements.append(inv_table)
elements.append(Spacer(1, 8))

# ── FOOTER ───────────────────────────────────────────────────────────────────
footer_note = Table([[
    Paragraph(
        "πŸ“Œ  DISCLAIMER: This quick reference is for educational purposes only. Always adjust antibiotic choice based on local antibiogram / resistance patterns. "
        "Culture-guided therapy is preferred for recurrent or complicated UTI. This card does NOT replace clinical judgment.  "
        "Sources: IDSA/ESCMID 2010 guidelines | Textbook of Family Medicine 9e | Goldman-Cecil Medicine | Schwartz's Principles of Surgery.",
        note_style
    )
]], colWidths=[usable_w])
footer_note.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,-1), YELLOW_BG),
    ("TOPPADDING",    (0,0), (-1,-1), 6),
    ("BOTTOMPADDING", (0,0), (-1,-1), 6),
    ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ("BOX",           (0,0), (-1,-1), 0.8, ORANGE),
]))
elements.append(footer_note)

# ── BUILD ────────────────────────────────────────────────────────────────────
doc.build(elements)
print(f"PDF saved: {OUTPUT}")
Running Command

cd /home/daytona/workspace/uti-pdf && python generate_uti_pdf.py

Your quick reference PDF is ready. Here's what's inside:

UTI Antibiotic Quick Reference

PDF Document Β· PDF


The PDF covers 7 color-coded sections on a single A4 page:
SectionContent
1. Clinical DifferentiationCystitis vs Pyelonephritis - signs, labs, treatment route
2. First-Line AntibioticsNitrofurantoin, TMP-SMX, Fosfomycin, Pivmecillinam with doses & durations
3. FluoroquinolonesCiprofloxacin, Levofloxacin, Norfloxacin, Ofloxacin - cystitis vs pyelonephritis durations + resistance warning
4. Special PopulationsPregnant, elderly, men, recurrent UTI, complicated UTI
5. Adjunct TherapyParacetamol, Phenazopyridine, ORS - doses & notes
6. Red Flags7 escalation triggers (pyelonephritis, haematuria, sepsis, etc.)
7. InvestigationsUrine R/M, C&S, CBC, creatinine, USG KUB - when and why
Sources: IDSA/ESCMID guidelines, Textbook of Family Medicine 9e, Goldman-Cecil Medicine.
This is a shared conversation. Sign in to Orris to start your own chat.