Kisi patient ka Widal positive aaya ho to use kon sa fluid lagana or kon se injection dalana chahiye

Reading File
Finding Sources
Searching PubMed

typhoid fever treatment antibiotics fluid management

Finding Sources
Searching PubMed

typhoid fever antibiotic treatment guidelines

Reading File
Reading File
Bahut achha content mila - Harrison's se treatment details clearly aa gaya. Ab main comprehensive answer likhta hoon:

Widal Positive (Typhoid Fever) - Fluid aur Injection Management

Pahle Yeh Samjho

Widal test sirf screening hai - iska positive aana 100% confirm typhoid nahi karta. Lekin agar clinical picture match kare (bukhar 7-10+ din se, weakness, pet dard, coated tongue), to treatment shuru karna sahi hai.

IV Fluid (Drip)

Typhoid mein dehydration hoti hai - bukhar, sweating, khaana peena kam. Is liye fluid dena zaroori hai:
FluidKab lagaye
Normal Saline (0.9% NS)Pehli choice - hydration ke liye
Ringer's Lactate (RL)Achha alternative, balanced fluid
DNS (Dextrose Normal Saline)Agar patient weak ho, khaana bilkul na kha pa raha ho
5% Dextrose (D5W)Sirf agar hypoglycemia ho
Oral fluid - Agar patient pi sakta hai to ORS/nimbu paani/soup bhi dete rahein.

Antibiotics (Main Treatment)

Harrison's Principles of Internal Medicine (2025) ke mutabiq antibiotic choose karna local resistance pattern par depend karta hai:

Case 1: Simple/Uncomplicated Typhoid (outpatient ya mild)

AntibioticDoseDuration
Tab. Azithromycin1g pehle din, phir 500mg OD7 din
Tab. Cefixime20mg/kg/day (2 doses mein) ya 400mg BD adult14 din
Tab. Ciprofloxacin500mg BD (sirf agar locally sensitive ho)10-14 din

Case 2: Severe/Hospitalized Typhoid (injection chahiye)

InjectionDoseDuration
Inj. Ceftriaxone (1st choice)2g IV OD (adult) / 60-80mg/kg/day (child)10-14 din
Inj. Ciprofloxacin400mg IV BD (sirf sensitive cases mein)10-14 din
Important (2024 update): India aur Pakistan mein Fluoroquinolone-resistant aur XDR typhoid ke cases badh rahe hain. Isliye Ceftriaxone ya Azithromycin pehli line mein behtar hai. Ciprofloxacin tab dein jab culture-sensitivity confirm ho.

Supportive Treatment (Zaroor Dein)

DawaiKaam
Tab/Syp ParacetamolBukhar ke liye - Aspirin/Ibuprofen avoid karein
Tab. Domperidone / Tab. OndansetronNausea/vomiting ke liye
Tab. Zinc (children)Recovery fast hoti hai
ProbioticAntibiotic ke saath gut protect karne ke liye

Steroid Kab Dein?

Sirf severe typhoid mein (high-grade confusion ya shock ho):
  • Inj. Dexamethasone 3mg/kg loading dose, phir 1mg/kg q6h x 48 hours
  • Yeh mortality kam karta hai severe cases mein

Kya Avoid Karein

  • NSAIDs (Ibuprofen, Diclofenac) - intestinal bleeding/perforation ka risk badh jaata hai
  • Chloramphenicol, Ampicillin, Co-trimoxazole - ab resistance aa gayi hai, pehli line nahi hain
  • Unnecessary steroids - sirf severe/toxic typhoid mein

Practical Summary (Ek Line Mein)

Admit karo + NS/RL drip lagao + Inj. Ceftriaxone 2g IV OD shuru karo + Paracetamol do + Diet (light, easily digestible food)
  • Harrison's Principles of Internal Medicine 22nd Ed. (2025), Chapter 171: Enteric (Typhoid) Fever
Note: Agar patient ambulatory (ghar pe treat ho raha) hai aur oral le sakta hai, to Azithromycin 7 din ya Cefixime 14 din de sakte hain. Culture aane par antibiotic adjust karein.

Create a clinical protocol PDF for typhoid management in outpatients

Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace does not exist"

Running Command

mkdir -p /home/daytona/workspace/typhoid-protocol && python3 -c "import reportla…

Writing File

~/typhoid-protocol/generate_protocol.py

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
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import BaseDocTemplate, PageTemplate, Frame
from reportlab.lib.colors import HexColor
import datetime

OUTPUT = "/home/daytona/workspace/typhoid-protocol/Typhoid_Outpatient_Protocol.pdf"

# ── Colour Palette ──────────────────────────────────────────────────────────
TEAL       = HexColor("#0E7490")
TEAL_LIGHT = HexColor("#CFFAFE")
AMBER      = HexColor("#D97706")
AMBER_LIGHT= HexColor("#FEF3C7")
RED        = HexColor("#DC2626")
RED_LIGHT  = HexColor("#FEE2E2")
GREEN      = HexColor("#15803D")
GREEN_LIGHT= HexColor("#DCFCE7")
GRAY_DARK  = HexColor("#1F2937")
GRAY_MED   = HexColor("#6B7280")
GRAY_LIGHT = HexColor("#F3F4F6")
WHITE      = colors.white

W, H = A4   # 595.27 x 841.89 pts

# ── Header / Footer ─────────────────────────────────────────────────────────
def draw_header_footer(canvas, doc):
    canvas.saveState()
    # Top banner
    canvas.setFillColor(TEAL)
    canvas.rect(0, H - 52, W, 52, fill=1, stroke=0)
    canvas.setFillColor(WHITE)
    canvas.setFont("Helvetica-Bold", 16)
    canvas.drawCentredString(W / 2, H - 30, "CLINICAL PROTOCOL: TYPHOID FEVER — OUTPATIENT MANAGEMENT")
    canvas.setFont("Helvetica", 9)
    canvas.drawCentredString(W / 2, H - 44, "Based on Harrison's Principles of Internal Medicine 22E (2025) | WHO Guidelines")

    # Bottom footer
    canvas.setFillColor(TEAL)
    canvas.rect(0, 0, W, 26, fill=1, stroke=0)
    canvas.setFillColor(WHITE)
    canvas.setFont("Helvetica", 8)
    canvas.drawString(18, 9, f"Generated: {datetime.date.today().strftime('%d %B %Y')}  |  For clinical guidance only — individualise to patient")
    canvas.drawRightString(W - 18, 9, f"Page {doc.page}")
    canvas.restoreState()

# ── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

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

S_TITLE    = style("S_TITLE",   fontSize=13, leading=16, textColor=TEAL,
                   fontName="Helvetica-Bold", spaceAfter=4)
S_SECTION  = style("S_SECTION", fontSize=10.5, leading=13, textColor=WHITE,
                   fontName="Helvetica-Bold")
S_BODY     = style("S_BODY",    fontSize=9.5, leading=13, textColor=GRAY_DARK,
                   fontName="Helvetica", spaceAfter=3)
S_BOLD     = style("S_BOLD",    fontSize=9.5, leading=13, textColor=GRAY_DARK,
                   fontName="Helvetica-Bold")
S_SMALL    = style("S_SMALL",   fontSize=8.5, leading=11, textColor=GRAY_MED,
                   fontName="Helvetica")
S_WARNING  = style("S_WARN",    fontSize=9.5, leading=13, textColor=RED,
                   fontName="Helvetica-Bold")
S_CENTER   = style("S_CENTER",  fontSize=9.5, leading=13, textColor=GRAY_DARK,
                   fontName="Helvetica", alignment=TA_CENTER)
S_GREEN    = style("S_GREEN",   fontSize=9.5, leading=13, textColor=GREEN,
                   fontName="Helvetica-Bold")

# ── Helper: Section Header Row ───────────────────────────────────────────────
def section_header(text, bg=TEAL):
    data = [[Paragraph(f"  {text}", S_SECTION)]]
    t = Table(data, colWidths=[W - 3.4*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), bg),
        ("TOPPADDING",  (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
    ]))
    return t

# ── Helper: Info Box ─────────────────────────────────────────────────────────
def info_box(lines, bg=TEAL_LIGHT, border=TEAL):
    paras = [Paragraph(l, S_BODY) for l in lines]
    t = Table([[p] for p in paras], colWidths=[W - 3.6*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), bg),
        ("LINEAFTER",    (0,0), (0,-1),  2, border),
        ("LINEBEFORE",   (0,0), (0,-1),  3, border),
        ("TOPPADDING",   (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0), (-1,-1), 4),
        ("LEFTPADDING",  (0,0), (-1,-1), 10),
    ]))
    return t

# ── Document ─────────────────────────────────────────────────────────────────
frame = Frame(1.5*cm, 1.2*cm, W - 3.0*cm, H - 3.6*cm, id="main")
template = PageTemplate(id="main", frames=[frame], onPage=draw_header_footer)
doc = BaseDocTemplate(OUTPUT, pagesize=A4, pageTemplates=[template],
                      topMargin=1.2*cm, bottomMargin=1.2*cm,
                      leftMargin=1.5*cm, rightMargin=1.5*cm)

story = []
sp   = lambda n=1: Spacer(1, n*4*mm)
HR   = lambda: HRFlowable(width="100%", thickness=0.5, color=GRAY_LIGHT, spaceAfter=4)

# ═══════════════════════════════════════════════════════════════════════════
# SECTION 1 – Overview
# ═══════════════════════════════════════════════════════════════════════════
story += [sp(2), section_header("1.  OVERVIEW & SCOPE"), sp()]

overview_rows = [
    ["Disease",    "Enteric (Typhoid) Fever — caused by Salmonella Typhi / S. Paratyphi"],
    ["Scope",      "Outpatient management of uncomplicated typhoid in adults & children ≥ 5 yrs"],
    ["Setting",    "Primary Health Centre / OPD / Clinic"],
    ["Version",    f"July {datetime.date.today().year}  |  Reviewed annually"],
]
ov_t = Table(overview_rows, colWidths=[3.5*cm, W - 7.2*cm])
ov_t.setStyle(TableStyle([
    ("FONTNAME",    (0,0), (0,-1), "Helvetica-Bold"),
    ("FONTNAME",    (1,0), (1,-1), "Helvetica"),
    ("FONTSIZE",    (0,0), (-1,-1), 9.5),
    ("LEADING",     (0,0), (-1,-1), 13),
    ("TEXTCOLOR",   (0,0), (0,-1), TEAL),
    ("BACKGROUND",  (0,0), (-1,-1), GRAY_LIGHT),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GRAY_LIGHT]),
    ("GRID",        (0,0), (-1,-1), 0.4, HexColor("#E5E7EB")),
    ("TOPPADDING",  (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",(0,0),(-1,-1), 5),
    ("LEFTPADDING", (0,0), (-1,-1), 8),
]))
story += [ov_t, sp()]

# ═══════════════════════════════════════════════════════════════════════════
# SECTION 2 – Diagnosis Criteria
# ═══════════════════════════════════════════════════════════════════════════
story += [section_header("2.  DIAGNOSIS CRITERIA"), sp()]

story += [Paragraph("<b>Clinical Features (required for outpatient protocol eligibility):</b>", S_BODY)]
clinical_rows = [
    ["✔", "Fever ≥ 38.5 °C, sustained/step-ladder pattern, ≥ 3 days duration"],
    ["✔", "Headache, malaise, anorexia"],
    ["✔", "Coated tongue, mild abdominal discomfort or distension"],
    ["✔", "Relative bradycardia (pulse ↑ does NOT match temperature ↑)"],
    ["✔", "No alternative diagnosis confirmed"],
]
clin_t = Table(clinical_rows, colWidths=[0.8*cm, W - 4.9*cm])
clin_t.setStyle(TableStyle([
    ("FONTNAME",     (0,0), (0,-1), "Helvetica-Bold"),
    ("TEXTCOLOR",    (0,0), (0,-1), GREEN),
    ("FONTSIZE",     (0,0), (-1,-1), 9.5),
    ("LEADING",      (0,0), (-1,-1), 13),
    ("TOPPADDING",   (0,0), (-1,-1), 3),
    ("BOTTOMPADDING",(0,0), (-1,-1), 3),
    ("LEFTPADDING",  (0,0), (-1,-1), 6),
]))
story += [clin_t, sp()]

story += [Paragraph("<b>Investigations:</b>", S_BODY)]
inv_data = [
    ["Test", "Finding", "Note"],
    ["Widal Test",      "O antigen ≥ 1:80\nH antigen ≥ 1:160",
                        "Presumptive only; false +ve in endemic areas"],
    ["CBC",             "Leukopenia / neutropenia\n(15–25% cases)",
                        "Leukocytosis → suspect complication"],
    ["Blood Culture",   "Gold standard\n(Sensitivity 40–60%)",
                        "Collect BEFORE antibiotics if possible"],
    ["LFT / SGOT/SGPT", "Mild ↑ common",
                        "Markedly raised → refer"],
    ["Urine R/M",       "Routine check",
                        "Rule out UTI as alternate diagnosis"],
]
inv_t = Table(inv_data, colWidths=[3.2*cm, 4.4*cm, W - 11.1*cm])
inv_t.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,0), TEAL),
    ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
    ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTNAME",     (0,1), (-1,-1),"Helvetica"),
    ("FONTSIZE",     (0,0), (-1,-1), 9),
    ("LEADING",      (0,0), (-1,-1), 12),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GRAY_LIGHT]),
    ("GRID",         (0,0), (-1,-1), 0.4, HexColor("#D1D5DB")),
    ("TOPPADDING",   (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",(0,0), (-1,-1), 5),
    ("LEFTPADDING",  (0,0), (-1,-1), 6),
    ("VALIGN",       (0,0), (-1,-1), "TOP"),
]))
story += [inv_t, sp()]

# ═══════════════════════════════════════════════════════════════════════════
# SECTION 3 – Outpatient Eligibility
# ═══════════════════════════════════════════════════════════════════════════
story += [section_header("3.  OUTPATIENT ELIGIBILITY CHECKLIST"), sp()]

story += [Paragraph(
    "Patient must satisfy <b>ALL</b> of the following to be managed as outpatient:", S_BODY)]

elig_rows = [
    ["☑", "<b>Tolerating oral fluids and medications</b>"],
    ["☑", "No signs of severe/complicated typhoid (see Section 6)"],
    ["☑", "Alert, oriented — no confusion or altered consciousness"],
    ["☑", "Fever controllable with paracetamol"],
    ["☑", "No active GI bleeding, peritonitis, or severe vomiting"],
    ["☑", "Responsible caregiver available at home"],
    ["☑", "Can return for follow-up within 48 hours"],
]
elig_paras = [[Paragraph(r[0], S_GREEN), Paragraph(r[1], S_BODY)] for r in elig_rows]
elig_t = Table(elig_paras, colWidths=[0.8*cm, W - 4.9*cm])
elig_t.setStyle(TableStyle([
    ("TOPPADDING",   (0,0), (-1,-1), 3),
    ("BOTTOMPADDING",(0,0), (-1,-1), 3),
    ("LEFTPADDING",  (0,0), (-1,-1), 6),
    ("BACKGROUND",   (0,0), (-1,-1), GREEN_LIGHT),
    ("LINEBEFORE",   (0,0), (0,-1),  3, GREEN),
]))
story += [elig_t, sp()]

# ═══════════════════════════════════════════════════════════════════════════
# SECTION 4 – Treatment
# ═══════════════════════════════════════════════════════════════════════════
story += [section_header("4.  ANTIBIOTIC TREATMENT"), sp()]

story += [info_box([
    "<b>⚠ Resistance Note (2024–2025):</b> Fluoroquinolone-resistant and XDR S. Typhi are prevalent "
    "in South Asia (especially Pakistan, India). Ciprofloxacin should NOT be first-line unless "
    "local susceptibility data confirm sensitivity. Ceftriaxone and Azithromycin are preferred."
], bg=AMBER_LIGHT, border=AMBER), sp()]

story += [Paragraph("<b>First-Line Options (Uncomplicated Outpatient Typhoid):</b>", S_BODY)]

abx_data = [
    ["Drug", "Adult Dose", "Paediatric Dose", "Duration", "Route"],
    ["Azithromycin\n(Preferred)",
     "1g Day 1,\nthen 500mg OD",
     "20 mg/kg/day OD\n(max 1g loading)",
     "7 days", "Oral"],
    ["Cefixime\n(Alternative)",
     "400 mg BD\n(or 200mg BD)",
     "20 mg/kg/day\nin 2 divided doses",
     "14 days", "Oral"],
    ["Ciprofloxacin\n(Only if sensitive)",
     "500 mg BD",
     "15 mg/kg BD\n(max 500 mg/dose)",
     "10–14 days", "Oral"],
]
abx_t = Table(abx_data, colWidths=[3.0*cm, 3.5*cm, 3.8*cm, 2.2*cm, 1.8*cm])
abx_t.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,0), TEAL),
    ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
    ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTNAME",     (0,1), (-1,-1),"Helvetica"),
    ("FONTSIZE",     (0,0), (-1,-1), 9),
    ("LEADING",      (0,0), (-1,-1), 12),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GRAY_LIGHT]),
    ("GRID",         (0,0), (-1,-1), 0.4, HexColor("#D1D5DB")),
    ("TOPPADDING",   (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",(0,0), (-1,-1), 5),
    ("LEFTPADDING",  (0,0), (-1,-1), 6),
    ("VALIGN",       (0,0), (-1,-1), "TOP"),
    ("BACKGROUND",   (0,1), (-1,1), HexColor("#F0FDF4")),
]))
story += [abx_t, sp()]

# ═══════════════════════════════════════════════════════════════════════════
# SECTION 5 – Supportive Treatment
# ═══════════════════════════════════════════════════════════════════════════
story += [section_header("5.  SUPPORTIVE TREATMENT"), sp()]

supp_data = [
    ["Drug / Measure", "Dose & Frequency", "Purpose"],
    ["Paracetamol (Tab/Syp)",
     "Adult: 500–1000 mg q6h PRN\nChild: 15 mg/kg/dose q6h\n(Max 4g/day adult)",
     "Antipyretic & analgesic\n(AVOID NSAIDs, Aspirin)"],
    ["Oral Rehydration\n(ORS / Fluids)",
     "Encourage liberal oral intake\n2–3 litres/day adult\n(ORS as per dehydration)",
     "Replace insensible losses;\nprevent dehydration"],
    ["Ondansetron / Domperidone",
     "Ondansetron 4mg TDS\nor Domperidone 10mg TDS",
     "Nausea / vomiting control"],
    ["Zinc (Children only)",
     "10–20 mg/day × 10–14 days",
     "Immune support, faster\nrecovery in children"],
    ["Probiotic (optional)",
     "Standard dose with meals",
     "Reduce antibiotic-associated\ndiarrhoea"],
    ["Diet",
     "Soft, easily digestible food\n(khichdi, curd, banana, rice)\nNo spicy/oily/raw food",
     "Reduce GI stress;\nmaintain nutrition"],
    ["Rest",
     "Complete bed rest during\nfebrile period",
     "Conserve energy; reduce\ncomplications"],
]
supp_t = Table(supp_data, colWidths=[3.5*cm, 5.0*cm, W - 12.2*cm])
supp_t.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,0), TEAL),
    ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
    ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTNAME",     (0,1), (-1,-1),"Helvetica"),
    ("FONTSIZE",     (0,0), (-1,-1), 9),
    ("LEADING",      (0,0), (-1,-1), 12),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GRAY_LIGHT]),
    ("GRID",         (0,0), (-1,-1), 0.4, HexColor("#D1D5DB")),
    ("TOPPADDING",   (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",(0,0), (-1,-1), 5),
    ("LEFTPADDING",  (0,0), (-1,-1), 6),
    ("VALIGN",       (0,0), (-1,-1), "TOP"),
]))
story += [supp_t, sp()]

# ═══════════════════════════════════════════════════════════════════════════
# SECTION 6 – Red Flags / Refer
# ═══════════════════════════════════════════════════════════════════════════
story += [section_header("6.  RED FLAGS — IMMEDIATE HOSPITAL REFERRAL", bg=RED), sp()]

story += [info_box([
    "Refer <b>immediately</b> if ANY of the following are present:"
], bg=RED_LIGHT, border=RED), sp(0.5)]

red_rows = [
    ["🔴", "<b>Altered consciousness / Confusion / Encephalopathy</b>"],
    ["🔴", "<b>Signs of intestinal perforation:</b> sudden severe abdominal pain, rigidity, absent bowel sounds"],
    ["🔴", "<b>GI bleeding:</b> melaena, haematochezia, haematemesis"],
    ["🔴", "<b>Shock / Hypotension:</b> SBP < 90 mmHg or signs of poor perfusion"],
    ["🔴", "<b>Severe dehydration</b> unable to tolerate oral fluids"],
    ["🔴", "<b>Persistent high fever</b> > 5 days despite correct antibiotics"],
    ["🔴", "<b>Myocarditis</b> (chest pain, arrhythmia, ECG changes)"],
    ["🔴", "<b>Hepatitis/Jaundice:</b> bilirubin > 3 mg/dL or markedly raised LFTs"],
    ["🔴", "<b>Typhoid pneumonia:</b> respiratory distress, SpO₂ < 94%"],
    ["🔴", "<b>Pregnancy</b> with typhoid — IV therapy required"],
    ["🔴", "<b>Infant < 6 months</b> or severely malnourished child"],
]
rf_paras = [[Paragraph(r[0], S_WARNING), Paragraph(r[1], S_BODY)] for r in red_rows]
rf_t = Table(rf_paras, colWidths=[0.8*cm, W - 4.9*cm])
rf_t.setStyle(TableStyle([
    ("TOPPADDING",   (0,0), (-1,-1), 3),
    ("BOTTOMPADDING",(0,0), (-1,-1), 3),
    ("LEFTPADDING",  (0,0), (-1,-1), 6),
    ("BACKGROUND",   (0,0), (-1,-1), RED_LIGHT),
    ("LINEBEFORE",   (0,0), (0,-1),  3, RED),
]))
story += [rf_t, sp()]

# ═══════════════════════════════════════════════════════════════════════════
# SECTION 7 – Follow-Up Schedule
# ═══════════════════════════════════════════════════════════════════════════
story += [section_header("7.  FOLLOW-UP SCHEDULE"), sp()]

fu_data = [
    ["Visit",     "Timing",          "Assess"],
    ["Visit 1",   "Day 0 (Today)",   "Diagnosis, baseline labs, start treatment, counselling"],
    ["Visit 2",   "Day 2 (48 hrs)",  "Fever response, tolerating meds, compliance, new symptoms"],
    ["Visit 3",   "Day 5",           "Defervescence, appetite, general condition, LFT if raised"],
    ["Visit 4",   "Day 10–14",       "Completion of antibiotics, culture result, full recovery"],
    ["Visit 5",   "Day 28–30",       "Stool culture to confirm clearance (for food handlers / HCW)"],
]
fu_t = Table(fu_data, colWidths=[2.2*cm, 2.8*cm, W - 8.7*cm])
fu_t.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,0), TEAL),
    ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
    ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTNAME",     (0,1), (-1,-1),"Helvetica"),
    ("FONTSIZE",     (0,0), (-1,-1), 9),
    ("LEADING",      (0,0), (-1,-1), 12),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GRAY_LIGHT]),
    ("GRID",         (0,0), (-1,-1), 0.4, HexColor("#D1D5DB")),
    ("TOPPADDING",   (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",(0,0), (-1,-1), 5),
    ("LEFTPADDING",  (0,0), (-1,-1), 6),
]))
story += [fu_t, sp()]

# ═══════════════════════════════════════════════════════════════════════════
# SECTION 8 – Patient Counselling
# ═══════════════════════════════════════════════════════════════════════════
story += [section_header("8.  PATIENT & CAREGIVER COUNSELLING POINTS"), sp()]

counsel_rows = [
    ["💊", "Complete the full antibiotic course even if fever subsides early."],
    ["🥤", "Drink boiled/filtered water only. Avoid street food during illness."],
    ["🚽", "Wash hands with soap after toilet use and before eating — always."],
    ["🍱", "Eat soft, easily digestible food (khichdi, curd, banana). No spicy/fried food."],
    ["🛏️", "Rest at home. Avoid school/work until fever-free for at least 48 hours."],
    ["🚫", "Do NOT take Aspirin or Ibuprofen (Brufen) for fever — risk of GI bleed."],
    ["📞", "Come to hospital IMMEDIATELY if: confusion, severe abdominal pain, blood in stool, unable to drink."],
    ["🧴", "Isolate utensils; clean bathroom regularly; no sharing of towels."],
    ["💉", "Typhoid vaccine recommended for household contacts after recovery."],
]
coun_paras = [[Paragraph(r[0], S_BODY), Paragraph(r[1], S_BODY)] for r in counsel_rows]
coun_t = Table(coun_paras, colWidths=[0.9*cm, W - 5.0*cm])
coun_t.setStyle(TableStyle([
    ("TOPPADDING",   (0,0), (-1,-1), 3),
    ("BOTTOMPADDING",(0,0), (-1,-1), 3),
    ("LEFTPADDING",  (0,0), (-1,-1), 6),
    ("BACKGROUND",   (0,0), (-1,-1), TEAL_LIGHT),
    ("LINEBEFORE",   (0,0), (0,-1),  3, TEAL),
    ("ROWBACKGROUNDS",(0,0),(-1,-1),[TEAL_LIGHT, WHITE]),
]))
story += [coun_t, sp()]

# ═══════════════════════════════════════════════════════════════════════════
# SECTION 9 – Medications to AVOID
# ═══════════════════════════════════════════════════════════════════════════
story += [section_header("9.  MEDICATIONS TO AVOID", bg=AMBER), sp()]

avoid_data = [
    ["Drug / Class", "Reason to Avoid"],
    ["NSAIDs\n(Ibuprofen, Diclofenac, Naproxen)",
     "Risk of GI bleeding & intestinal perforation in typhoid"],
    ["Aspirin",
     "GI irritation + risk of Reye's syndrome in children"],
    ["Chloramphenicol",
     "High MDR resistance (plasmid-mediated); aplastic anaemia risk"],
    ["Ampicillin / Amoxicillin",
     "Widespread resistance; ineffective in most current strains"],
    ["Co-trimoxazole (TMP-SMX)",
     "Resistance common in India/Pakistan; use only if susceptible"],
    ["Ciprofloxacin (empiric)",
     "Fluoroquinolone-resistant S. Typhi prevalent — use only if sensitivity confirmed"],
    ["Antidiarrhoeal agents\n(Loperamide)",
     "May worsen by slowing gut motility; allow natural clearance"],
    ["Steroids (empiric)",
     "Reserve strictly for severe typhoid (encephalopathy/shock) — NOT routine outpatient use"],
]
av_t = Table(avoid_data, colWidths=[4.8*cm, W - 9.0*cm])
av_t.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,0), AMBER),
    ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
    ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTNAME",     (0,1), (-1,-1),"Helvetica"),
    ("FONTSIZE",     (0,0), (-1,-1), 9),
    ("LEADING",      (0,0), (-1,-1), 12),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[AMBER_LIGHT, WHITE]),
    ("GRID",         (0,0), (-1,-1), 0.4, HexColor("#D1D5DB")),
    ("TOPPADDING",   (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",(0,0), (-1,-1), 5),
    ("LEFTPADDING",  (0,0), (-1,-1), 6),
    ("VALIGN",       (0,0), (-1,-1), "TOP"),
]))
story += [av_t, sp()]

# ═══════════════════════════════════════════════════════════════════════════
# SECTION 10 – References
# ═══════════════════════════════════════════════════════════════════════════
story += [section_header("10.  REFERENCES"), sp()]

refs = [
    "1.  Fauci AS et al. <i>Harrison's Principles of Internal Medicine</i>, 22nd Ed., Chapter 171: Enteric (Typhoid) Fever. McGraw Hill, 2025.",
    "2.  World Health Organization. <i>Typhoid vaccines: WHO position paper</i>. Weekly Epidemiological Record, 2018.",
    "3.  Radhakrishnan A et al. A 2022 systematic review of 27 RCTs for treatment of enteric fever — Ceftriaxone, Fluoroquinolones, Azithromycin comparable efficacy. <i>Lancet Infect Dis</i>.",
    "4.  Singhal L et al. Salmonella Typhi: A Review of Antibiogram Journey in Developing Countries. <i>Infect Disord Drug Targets</i>, 2024. PMID: 38265374.",
    "5.  WHO. <i>The diagnosis, prevention and management of typhoid fever</i>. Geneva: WHO, 2003 (updated guidance 2018).",
]
for r in refs:
    story.append(Paragraph(r, S_SMALL))
    story.append(Spacer(1, 2*mm))

story += [sp(), HR(), sp(0.5)]
story.append(Paragraph(
    "<b>Disclaimer:</b> This protocol is intended as a clinical guidance document for qualified healthcare professionals. "
    "It does not replace clinical judgement. Always individualise treatment to the patient's specific circumstances, "
    "local resistance patterns, and available investigations.",
    S_SMALL
))

# ── Build ────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF saved to: {OUTPUT}")
Running Command

cd /home/daytona/workspace/typhoid-protocol && python3 generate_protocol.py

Running Command

ls -lh /home/daytona/workspace/typhoid-protocol/Typhoid_Outpatient_Protocol.pdf

Your clinical protocol PDF is ready. Here's the download link:

Typhoid Outpatient Protocol

PDF Document · PDF


The PDF includes 10 structured sections on A4 with colour-coded tables and clear formatting:
  1. Overview & Scope - disease, setting, version
  2. Diagnosis Criteria - clinical features + investigation table (Widal, CBC, Blood Culture, LFT)
  3. Outpatient Eligibility Checklist - 7-point checklist in green
  4. Antibiotic Treatment - Azithromycin (1st), Cefixime (alternative), Ciprofloxacin (only if sensitive) - with adult AND paediatric doses
  5. Supportive Treatment - Paracetamol, ORS, Ondansetron, Zinc, Diet, Rest
  6. Red Flags / Refer (red section) - 11 danger signs requiring immediate hospital referral
  7. Follow-Up Schedule - Day 0, 2, 5, 10-14, 28-30
  8. Patient Counselling Points - 9 key messages for patient/caregiver
  9. Medications to AVOID (amber section) - NSAIDs, Aspirin, Chloramphenicol, Ciprofloxacin empiric, etc.
  10. References - Harrison's 22E, WHO guidelines, 2024 PubMed evidence
This is a shared conversation. Sign in to Orris to start your own chat.