Write about 25+ medicine opd pt cases with their prescriptions for practice and education purposes also give reasons why are we prescribing it and make it in a pdf form

Reading File
Running Command

mkdir -p /home/daytona/workspace/medicine-opd-cases && ls /home/daytona/workspace/medicine-opd-cases/

Writing File

~/medicine-opd-cases/generate_pdf.py

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

OUTPUT = "/home/daytona/workspace/medicine-opd-cases/Medicine_OPD_Cases_Prescriptions.pdf"

# ── colour palette ──────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1a3a5c")
MED_BLUE    = colors.HexColor("#2e6da4")
LIGHT_BLUE  = colors.HexColor("#dce9f7")
ACCENT      = colors.HexColor("#e8f4f8")
GREEN_LIGHT = colors.HexColor("#e6f4ea")
YELLOW_LIGHT= colors.HexColor("#fff8e1")
RED_LIGHT   = colors.HexColor("#fdecea")
WHITE       = colors.white
GREY        = colors.HexColor("#555555")
LIGHT_GREY  = colors.HexColor("#f5f5f5")

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

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

S_TITLE = style("MyTitle", fontSize=22, leading=28, textColor=WHITE,
                fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=4)
S_SUBTITLE = style("MySubtitle", fontSize=12, leading=16, textColor=LIGHT_BLUE,
                   fontName="Helvetica", alignment=TA_CENTER, spaceAfter=2)
S_CASE_HEADER = style("CaseHeader", fontSize=13, leading=17,
                       textColor=WHITE, fontName="Helvetica-Bold",
                       alignment=TA_LEFT, leftIndent=6)
S_SECTION = style("Section", fontSize=10, leading=13, textColor=DARK_BLUE,
                  fontName="Helvetica-Bold", spaceAfter=2, spaceBefore=4)
S_BODY = style("Body", fontSize=9.5, leading=13.5, textColor=colors.black,
               fontName="Helvetica", spaceAfter=2, alignment=TA_JUSTIFY)
S_BULLET = style("Bullet", fontSize=9.5, leading=13, textColor=colors.black,
                 fontName="Helvetica", leftIndent=14, spaceAfter=1,
                 bulletIndent=4)
S_REASON = style("Reason", fontSize=9, leading=12.5,
                 textColor=colors.HexColor("#2d5a1b"),
                 fontName="Helvetica-Oblique", leftIndent=14, spaceAfter=1)
S_DRUG = style("Drug", fontSize=9.5, leading=13, textColor=DARK_BLUE,
               fontName="Helvetica-Bold", leftIndent=14, spaceAfter=1)
S_FOOT = style("Foot", fontSize=7.5, leading=10, textColor=GREY,
               fontName="Helvetica", alignment=TA_CENTER)


# ─── helper ─────────────────────────────────────────────────────────────────
def colored_box(para_text, bg, style_obj, radius=4):
    """Wrap a paragraph in a 1-cell table to simulate a coloured box."""
    t = Table([[Paragraph(para_text, style_obj)]], colWidths=["100%"])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("ROUNDEDCORNERS", [radius]),
        ("LEFTPADDING",  (0,0),(-1,-1), 8),
        ("RIGHTPADDING", (0,0),(-1,-1), 8),
        ("TOPPADDING",   (0,0),(-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
    ]))
    return t


def rx_table(drugs):
    """drugs = list of (drug_line, reason_line)"""
    data = [["Rx", "Drug / Dose / Frequency / Duration", "Rationale"]]
    for i, (drug, reason) in enumerate(drugs, 1):
        data.append([str(i), Paragraph(drug, S_DRUG), Paragraph(reason, S_REASON)])
    t = Table(data, colWidths=[0.5*cm, 9.5*cm, 7.2*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,0),  MED_BLUE),
        ("TEXTCOLOR",    (0,0),(-1,0),  WHITE),
        ("FONTNAME",     (0,0),(-1,0),  "Helvetica-Bold"),
        ("FONTSIZE",     (0,0),(-1,0),  9),
        ("ALIGN",        (0,0),(0,-1),  "CENTER"),
        ("VALIGN",       (0,0),(-1,-1), "TOP"),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, LIGHT_GREY]),
        ("GRID",         (0,0),(-1,-1), 0.4, colors.HexColor("#cccccc")),
        ("LEFTPADDING",  (0,0),(-1,-1), 5),
        ("RIGHTPADDING", (0,0),(-1,-1), 5),
        ("TOPPADDING",   (0,0),(-1,-1), 4),
        ("BOTTOMPADDING",(0,0),(-1,-1), 4),
        ("FONTSIZE",     (0,1),(-1,-1), 9),
    ]))
    return t


def case_block(number, title, patient, complaint, exam, investigations,
               diagnosis, drugs, advice, color=LIGHT_BLUE):
    elems = []
    # header bar
    header_tbl = Table(
        [[Paragraph(f"Case {number}: {title}", S_CASE_HEADER)]],
        colWidths=["100%"]
    )
    header_tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), MED_BLUE),
        ("LEFTPADDING",  (0,0),(-1,-1), 10),
        ("RIGHTPADDING", (0,0),(-1,-1), 10),
        ("TOPPADDING",   (0,0),(-1,-1), 6),
        ("BOTTOMPADDING",(0,0),(-1,-1), 6),
    ]))
    elems.append(header_tbl)

    # patient info row
    info_data = [[
        Paragraph(f"<b>Patient:</b> {patient}", S_BODY),
        Paragraph(f"<b>Chief Complaint:</b> {complaint}", S_BODY),
    ]]
    info_tbl = Table(info_data, colWidths=["50%","50%"])
    info_tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), ACCENT),
        ("LEFTPADDING",  (0,0),(-1,-1), 8),
        ("RIGHTPADDING", (0,0),(-1,-1), 8),
        ("TOPPADDING",   (0,0),(-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("VALIGN",       (0,0),(-1,-1), "TOP"),
    ]))
    elems.append(info_tbl)

    # exam & investigations
    exam_inv = Table([[
        Paragraph(f"<b>Examination:</b> {exam}", S_BODY),
        Paragraph(f"<b>Investigations:</b> {investigations}", S_BODY),
    ]], colWidths=["50%","50%"])
    exam_inv.setStyle(TableStyle([
        ("LEFTPADDING",  (0,0),(-1,-1), 8),
        ("RIGHTPADDING", (0,0),(-1,-1), 8),
        ("TOPPADDING",   (0,0),(-1,-1), 4),
        ("BOTTOMPADDING",(0,0),(-1,-1), 4),
        ("VALIGN",       (0,0),(-1,-1), "TOP"),
    ]))
    elems.append(exam_inv)

    # diagnosis
    diag_tbl = Table(
        [[Paragraph(f"<b>Diagnosis:</b> {diagnosis}", S_BODY)]],
        colWidths=["100%"]
    )
    diag_tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), YELLOW_LIGHT),
        ("LEFTPADDING",  (0,0),(-1,-1), 8),
        ("RIGHTPADDING", (0,0),(-1,-1), 8),
        ("TOPPADDING",   (0,0),(-1,-1), 4),
        ("BOTTOMPADDING",(0,0),(-1,-1), 4),
    ]))
    elems.append(diag_tbl)

    # prescription table
    elems.append(Spacer(1, 3))
    elems.append(Paragraph("PRESCRIPTION", S_SECTION))
    elems.append(rx_table(drugs))

    # advice
    elems.append(Spacer(1, 3))
    advice_tbl = Table(
        [[Paragraph(f"<b>Advice / Follow-up:</b> {advice}", S_BODY)]],
        colWidths=["100%"]
    )
    advice_tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), GREEN_LIGHT),
        ("LEFTPADDING",  (0,0),(-1,-1), 8),
        ("RIGHTPADDING", (0,0),(-1,-1), 8),
        ("TOPPADDING",   (0,0),(-1,-1), 4),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
    ]))
    elems.append(advice_tbl)
    elems.append(Spacer(1, 10))
    return elems


# ─── ALL 25 CASES ────────────────────────────────────────────────────────────
CASES = [

# 1
dict(number=1, title="Hypertension (Stage 1, Newly Diagnosed)",
patient="Mr. Ramesh Kumar, 52 M, clerk, non-smoker",
complaint="Headache and neck stiffness for 2 weeks; no chest pain",
exam="BP 152/96 mmHg (both arms), PR 82 bpm, BMI 27, fundus: grade I AV nipping",
investigations="FBS 98 mg/dL, S. creatinine 0.9, ECG: normal, Urine R/E: normal",
diagnosis="Primary (essential) hypertension, Stage 1",
drugs=[
    ("Tab. Amlodipine 5 mg – once daily (morning) × 4 weeks, then review",
     "Dihydropyridine CCB; first-line monotherapy for non-complicated HTN; well tolerated; reduces peripheral vascular resistance"),
    ("Tab. Aspirin 75 mg – once daily after food (if cardiovascular risk ≥10%)",
     "Antiplatelet prophylaxis for primary CV prevention in moderate-risk hypertensives"),
    ("Tab. Atorvastatin 10 mg – once daily at night",
     "Statins reduce CV events independent of cholesterol level in hypertensives with metabolic risk"),
],
advice="DASH diet, salt <5 g/day, 30 min brisk walk daily, weight reduction. BP check in 4 weeks. Avoid NSAIDs."),

# 2
dict(number=2, title="Type 2 Diabetes Mellitus (Newly Diagnosed)",
patient="Mrs. Sunita Devi, 48 F, housewife, BMI 29",
complaint="Polyuria, polydipsia, unexplained fatigue for 6 weeks",
exam="Weight 72 kg, BP 128/82, no neuropathy, no retinopathy on fundoscopy",
investigations="FBS 186 mg/dL, PPBS 278 mg/dL, HbA1c 8.2%, S. creatinine 0.8, urine microalbumin: negative",
diagnosis="Type 2 Diabetes Mellitus",
drugs=[
    ("Tab. Metformin 500 mg – twice daily with meals; escalate to 1000 mg BD after 2 weeks if tolerated",
     "First-line oral hypoglycaemic; reduces hepatic gluconeogenesis; weight-neutral; proven CV & mortality benefit (UKPDS)"),
    ("Tab. Glimepiride 1 mg – once daily before breakfast",
     "Sulfonylurea; stimulates pancreatic insulin secretion; useful as add-on when HbA1c >7.5% at diagnosis"),
    ("Tab. Atorvastatin 10 mg – once daily at bedtime",
     "Diabetics have high CV risk; statin therapy is standard care per ADA guidelines regardless of baseline LDL"),
    ("Cap. Vitamin B12 (Methylcobalamin) 500 mcg – once daily",
     "Metformin depletes B12; supplementation prevents/treats early peripheral neuropathy"),
],
advice="Medical nutrition therapy (low GI diet), 45 min aerobic exercise 5×/week. HbA1c every 3 months. Annual eye, foot, kidney review."),

# 3
dict(number=3, title="Community-Acquired Pneumonia (Mild–Moderate)",
patient="Mr. Vijay Singh, 35 M, teacher",
complaint="Fever, productive cough with rusty sputum, right-sided chest pain × 5 days",
exam="Temp 38.8°C, RR 22/min, SpO2 96% (room air), dullness + bronchial breath sounds right base",
investigations="CXR: right lower lobe consolidation, TLC 14,200 (neutrophilia), CRP 68 mg/L, sputum C/S pending",
diagnosis="Community-Acquired Pneumonia (CAP) – PSI Class II (outpatient eligible)",
drugs=[
    ("Tab. Amoxicillin-Clavulanate 625 mg – thrice daily × 7 days",
     "Covers typical pathogens (S. pneumoniae, H. influenzae); beta-lactamase stable; first-line for outpatient CAP"),
    ("Tab. Azithromycin 500 mg – once daily × 5 days",
     "Atypical pathogen cover (Mycoplasma, Chlamydia, Legionella); immunomodulatory anti-inflammatory effect"),
    ("Tab. Paracetamol 650 mg – thrice daily for fever/pleuritic pain",
     "Antipyretic + analgesic; safer than NSAIDs in respiratory illness"),
    ("Syp. Ambroxol 30 mg/5 mL – 10 mL TDS",
     "Mucolytic; reduces sputum viscosity and aids clearance"),
],
advice="Adequate hydration (≥2 L/day), steam inhalation, breathing exercises. Return if SpO2 <94% or worsening. Follow-up CXR at 6 weeks to confirm resolution."),

# 4
dict(number=4, title="Acute Gastroenteritis (Moderate Dehydration)",
patient="Master Arjun, 8 M (child 12 kg), referred by paediatrician",
complaint="Loose watery stools 8×/day, vomiting 4× × 2 days, decreased urine output",
exam="Sunken eyes, dry mucosa, skin turgor slightly reduced, no blood in stool, afebrile",
investigations="Stool R/E: no RBCs, few WBCs; serum Na 136, K 3.2, HCO3 18",
diagnosis="Acute Gastroenteritis with moderate dehydration (likely viral)",
drugs=[
    ("ORS (WHO low-osmolarity) – 75 mL/kg over 4 hours for rehydration, then 10 mL/kg per loose stool",
     "Glucose-coupled Na absorption; corrects dehydration without IV; reduces stool volume by 20–30%"),
    ("Zinc sulfate dispersible tab 20 mg – once daily × 14 days",
     "WHO/UNICEF recommendation; reduces stool frequency and duration; replenishes zinc lost in diarrhoea"),
    ("Probiotic (Saccharomyces boulardii) 250 mg – BD × 5 days",
     "Reduces diarrhoea duration by ~24 hrs; competes with pathogens; safe in children"),
    ("Ondansetron ODT 2 mg – every 8 hrs if vomiting (weight-based)",
     "5-HT3 antagonist; reduces vomiting, improves oral rehydration compliance; proven in paediatric AGE"),
],
advice="Continue breastfeeding/normal diet after rehydration. Return if signs of severe dehydration, blood in stool or no improvement in 48 hrs."),

# 5
dict(number=5, title="Peptic Ulcer Disease / GERD",
patient="Mr. Suresh Patel, 42 M, software engineer, heavy coffee & NSAID user",
complaint="Burning epigastric pain after meals, nocturnal pain, waterbrash × 3 months",
exam="Epigastric tenderness, no guarding, BMI 24",
investigations="H. pylori RUT test: POSITIVE, UGI endoscopy: antral ulcer 1 cm",
diagnosis="H. pylori-positive Peptic Ulcer Disease (duodenal ulcer pattern)",
drugs=[
    ("Tab. Pantoprazole 40 mg – twice daily before meals × 14 days (then 20 mg OD × 4 weeks)",
     "PPI suppresses gastric acid; creates alkaline environment needed for H. pylori eradication and ulcer healing"),
    ("Tab. Clarithromycin 500 mg – twice daily × 14 days",
     "Macrolide antibiotic; part of standard triple therapy for H. pylori eradication"),
    ("Tab. Amoxicillin 1000 mg – twice daily × 14 days",
     "Aminopenicillin; synergistic with clarithromycin in H. pylori eradication; low resistance"),
    ("Tab. Sucralfate 1 g – 4× daily 1 hr before meals & bedtime × 4 weeks",
     "Mucosal protectant; coats ulcer base; enhances prostaglandin synthesis; no systemic absorption"),
],
advice="Stop NSAIDs, coffee, alcohol, smoking. Small frequent meals. H. pylori re-testing (UBT) 4 weeks after completing antibiotics. Avoid lying down 2 hrs post meals."),

# 6
dict(number=6, title="Bronchial Asthma (Mild Persistent)",
patient="Ms. Priya Sharma, 22 F, student, known atopic",
complaint="Episodic breathlessness, wheeze, nocturnal cough >2×/week × 4 months",
exam="RR 18, SpO2 98%, bilateral expiratory wheeze, no cyanosis, no use of accessory muscles",
investigations="Spirometry: FEV1/FVC 68%, FEV1 reversibility 16% post salbutamol, IgE elevated",
diagnosis="Bronchial Asthma – Mild Persistent (GINA Step 2)",
drugs=[
    ("MDI Salbutamol 100 mcg – 2 puffs as needed (rescue)",
     "Short-acting beta-2 agonist; rapid bronchodilation (onset 5 min); first-line reliever in all asthma steps"),
    ("MDI Budesonide 200 mcg – 1 puff twice daily (controller)",
     "Inhaled corticosteroid; reduces airway inflammation; prevents exacerbations; Step 2 controller per GINA 2024"),
    ("Tab. Montelukast 10 mg – once daily at bedtime",
     "Leukotriene receptor antagonist; add-on controller; particularly effective in allergic/atopic asthma and exercise-induced bronchospasm"),
    ("Tab. Cetirizine 10 mg – once daily (for allergic rhinitis co-morbidity)",
     "H1 antihistamine; treats co-existing allergic rhinitis (unified airway concept); may reduce asthma triggers"),
],
advice="Inhaler technique training at every visit. Peak flow diary. Avoid triggers (dust, smoke, cold air). Step-up if uncontrolled after 3 months. Annual influenza vaccine."),

# 7
dict(number=7, title="Urinary Tract Infection (Uncomplicated, Female)",
patient="Mrs. Kavita Rao, 30 F, married",
complaint="Dysuria, frequency, urgency, suprapubic discomfort × 3 days; no fever, no loin pain",
exam="Suprapubic tenderness, no costovertebral angle tenderness, afebrile, BP normal",
investigations="Urine R/E: pus cells 30–40/HPF, RBCs 5–8/HPF, nitrite positive; C/S: E. coli >10^5 CFU/mL",
diagnosis="Acute uncomplicated cystitis (lower UTI)",
drugs=[
    ("Tab. Nitrofurantoin 100 mg (modified-release) – twice daily × 5 days",
     "First-line for uncomplicated cystitis; concentrated in urine; low resistance rates; narrow tissue distribution minimises gut microbiome disruption"),
    ("Tab. Phenazopyridine 200 mg – thrice daily × 2 days (only for symptom relief)",
     "Urinary analgesic/local anaesthetic effect on mucosa; relieves burning and urgency; warn patient urine turns orange"),
    ("Tab. Cranberry extract 400 mg – once daily × 1 month",
     "Type-A proanthocyanidins inhibit E. coli fimbrial adhesion to uroepithelium; reduces recurrence risk"),
],
advice="Increase fluid intake to ≥2 L/day. Void after intercourse. Wipe front to back. Repeat urine C/S 1 week after completing antibiotics. If fever or loin pain develops, attend immediately."),

# 8
dict(number=8, title="Hypothyroidism",
patient="Mrs. Meena Gupta, 38 F, office worker",
complaint="Weight gain 8 kg in 6 months, fatigue, cold intolerance, constipation, dry skin, hair loss",
exam="Puffy face, delayed ankle jerk relaxation, HR 58, thyroid: diffuse enlarged (grade I), BP 110/70",
investigations="TSH 18.4 mIU/L, Free T4 0.6 ng/dL, anti-TPO antibodies: strongly positive, lipid profile: LDL 148",
diagnosis="Hashimoto's Thyroiditis – Overt Hypothyroidism",
drugs=[
    ("Tab. Levothyroxine (T4) 50 mcg – once daily on empty stomach 30 min before breakfast",
     "Synthetic T4; gold standard for hypothyroidism replacement; converted to active T3 in peripheral tissues; dose titrated by TSH every 6–8 weeks"),
    ("Tab. Atorvastatin 10 mg – once daily at bedtime (provisional; reassess after euthyroid)",
     "Hypothyroidism causes secondary dyslipidaemia; statin initiated if LDL remains elevated after 3 months of adequate replacement"),
    ("Iron supplement (Ferrous fumarate 200 mg) – separate from levothyroxine by ≥4 hours",
     "Many hypothyroid patients have iron deficiency; taken separately to avoid chelation which reduces levothyroxine absorption"),
],
advice="Levothyroxine on empty stomach, no calcium/iron within 4 hrs. TSH recheck in 6–8 weeks. Target TSH 0.5–2.5 mIU/L. Maintain dose adjustments in pregnancy."),

# 9
dict(number=9, title="Acute Migraine",
patient="Ms. Anjali Mehta, 27 F, IT professional",
complaint="Severe throbbing unilateral headache, photophobia, nausea, preceded by visual aura × 1 day",
exam="Oriented, no neck stiffness, no papilloedema, normal neurological exam, BP 118/76",
investigations="CT brain plain: normal; ophthalmology: normal",
diagnosis="Migraine with aura (ICHD-3 criteria met)",
drugs=[
    ("Tab. Sumatriptan 50 mg – stat; repeat after 2 hours if needed (max 200 mg/day)",
     "5-HT1B/1D agonist (triptan); first-line acute treatment; causes selective cranial vasoconstriction and blocks CGRP release at trigeminal nerve endings"),
    ("Tab. Domperidone 10 mg – at onset (before sumatriptan)",
     "Peripheral D2 antagonist; treats nausea/vomiting; also improves gastric motility, enhancing absorption of oral analgesics during migraine gastroparesis"),
    ("Tab. Naproxen sodium 550 mg – at onset (alternative/adjunct if triptans contraindicated)",
     "NSAID; blocks prostaglandin-mediated neurogenic inflammation; useful in triptan non-responders"),
    ("Tab. Propranolol 40 mg – twice daily (prophylaxis, if attacks ≥4/month)",
     "Beta-blocker; first-line migraine prophylaxis; reduces frequency by ~50%; mechanism involves stabilisation of cortical spreading depression"),
],
advice="Migraine diary (identify triggers: stress, menses, sleep deprivation, certain foods). Take triptan early in attack. Avoid opioids. Dark quiet room during attack. Hydrate well."),

# 10
dict(number=10, title="Iron Deficiency Anaemia",
patient="Mrs. Rekha Verma, 32 F, homemaker, 2 children, heavy menstrual bleeding",
complaint="Exertional dyspnoea, palpitations, pallor, koilonychia, hair fall × 3 months",
exam="Pallor (conjunctival, palmar), HR 98, BP 104/70, no organomegaly, BMI 20",
investigations="Hb 7.8 g/dL, MCV 62 fL, MCH 18, serum ferritin 4 ng/mL, TIBC elevated, peripheral smear: microcytic hypochromic",
diagnosis="Iron Deficiency Anaemia (severe) secondary to menorrhagia",
drugs=[
    ("Tab. Ferrous sulfate 200 mg (elemental iron 65 mg) – twice daily empty stomach or with Vit C",
     "Oral iron is first-line; ferrous form (Fe2+) has better GI absorption; avoid tea/antacids; continue 3 months after Hb normalises to replenish stores"),
    ("Tab. Folic acid 5 mg – once daily",
     "Prevents co-existing folate deficiency; supports erythropoiesis; also important if pregnancy possible"),
    ("Tab. Vitamin C (Ascorbic acid) 500 mg – with each iron dose",
     "Reduces Fe3+ to Fe2+ in GI tract; increases iron absorption by up to 30%; also inhibits phytate-mediated iron binding"),
    ("Gynaecology referral for menorrhagia workup (Norethisterone 5 mg TDS day 5-25 if DUB)",
     "Treating the underlying cause is mandatory; progesterone therapy reduces menstrual blood loss in DUB"),
],
advice="Take iron with orange juice, not tea/milk. Expect dark stools (normal). Hb recheck in 4 weeks. Iron-rich diet (meat, leafy greens, lentils). Avoid raw tea with meals."),

# 11
dict(number=11, title="Acute Exacerbation of COPD",
patient="Mr. Bahadur Singh, 65 M, ex-smoker (40 pack-years), known COPD",
complaint="Worsening breathlessness, increased sputum (yellow-green), mild fever × 4 days",
exam="Barrel chest, RR 24, SpO2 90% (RA), bilateral rhonchi, no pedal oedema",
investigations="ABG: pH 7.38, PaO2 58, PaCO2 46, HCO3 27; CXR: hyperinflation, no consolidation; sputum: Gram+ve diplococci",
diagnosis="Acute Exacerbation of COPD (Anthonisen Type 1 – moderate severity)",
drugs=[
    ("Nebulised Ipratropium 0.5 mg + Salbutamol 2.5 mg – every 4–6 hrs",
     "Short-acting bronchodilator combination; ipratropium (anticholinergic) + salbutamol (SABA) achieve additive bronchodilation; primary treatment of acute COPD exacerbation"),
    ("Tab. Prednisolone 40 mg – once daily × 5 days",
     "Systemic corticosteroid; reduces airway inflammation, speeds FEV1 recovery, reduces treatment failure and hospital stay (GOLD guidelines)"),
    ("Tab. Amoxicillin-Clavulanate 625 mg – thrice daily × 7 days",
     "Antibiotic; indicated for purulent sputum (Anthonisen Type 1); covers H. influenzae, S. pneumoniae, Moraxella"),
    ("O2 via nasal cannula 1–2 L/min (target SpO2 88–92%)",
     "Controlled low-flow oxygen prevents hypoxic drive suppression in COPD; target saturation 88–92% to avoid CO2 narcosis"),
],
advice="Chest physiotherapy. Continue LABA+LAMA inhaler after acute phase. Smoking cessation (refer). Annual influenza + pneumococcal vaccine. Pulmonary rehabilitation referral."),

# 12
dict(number=12, title="Acute Gout",
patient="Mr. Deepak Joshi, 50 M, executive, alcohol drinker",
complaint="Sudden onset severe pain, swelling, redness, warmth of left first MTP joint since last night",
exam="Left 1st MTP: hot, red, exquisitely tender, swollen; no fever, no tophi, BP 136/88",
investigations="Serum uric acid 9.8 mg/dL, ESR 55, CRP 42, WBC 11,000; joint aspirate (if done): MSU crystals",
diagnosis="Acute Gouty Arthritis – podagra",
drugs=[
    ("Tab. Indomethacin 50 mg – thrice daily with food × 5 days (then taper)",
     "NSAID; first-line for acute gout; inhibits COX-1/2 and prostaglandin synthesis; rapid anti-inflammatory effect; most effective within first 24 hrs"),
    ("Tab. Pantoprazole 40 mg – once daily (gastro-protection with NSAID)",
     "Mandatory PPI co-prescription with NSAIDs to prevent NSAID-induced gastric ulceration"),
    ("Tab. Colchicine 0.5 mg – twice daily × 3 days (if NSAID contraindicated or as adjunct)",
     "Inhibits microtubule polymerisation, neutrophil chemotaxis and NLRP3 inflammasome activation; most effective within first 12 hrs"),
    ("Tab. Allopurinol 100 mg – once daily (start 4–6 weeks AFTER acute attack resolves)",
     "Xanthine oxidase inhibitor; urate-lowering therapy; NOT started during acute attack (may prolong or precipitate further attacks); titrate to target uric acid <6 mg/dL"),
],
advice="Rest affected joint, cold pack for 20 min TDS. Avoid alcohol, red meat, seafood, fructose drinks. Increase hydration. Start urate-lowering therapy after acute phase resolves."),

# 13
dict(number=13, title="Chronic Heart Failure (HFrEF)",
patient="Mr. Ashok Mishra, 62 M, known IHD, CABG 5 years ago",
complaint="Breathlessness on minimal exertion, orthopnoea (2 pillows), ankle swelling × 3 weeks",
exam="HR 92 irregular, BP 100/70, JVP raised, S3 gallop, bibasal crepitations, pitting pedal oedema ++",
investigations="Echo: EF 32%, dilated LV; BNP 820 pg/mL; ECG: LBBB; CXR: cardiomegaly + pulmonary congestion",
diagnosis="Chronic HFrEF (EF <40%), NYHA Class III",
drugs=[
    ("Tab. Sacubitril/Valsartan 49/51 mg – twice daily (start low, uptitrate monthly)",
     "ARNi (ARNI); inhibits neprilysin + blocks AT1 receptor; PARADIGM-HF showed 20% relative risk reduction in CV death vs enalapril; first-line in HFrEF replacing ACEi/ARB"),
    ("Tab. Carvedilol 3.125 mg – twice daily (uptitrate slowly to 25 mg BD)",
     "Non-selective beta-blocker with alpha-1 blockade; reduces sympathetic activation; COPERNICUS trial showed 35% mortality reduction in severe HFrEF"),
    ("Tab. Spironolactone 25 mg – once daily (if eGFR >30, K <5.0)",
     "Mineralocorticoid receptor antagonist; reduces aldosterone-driven fibrosis and sodium retention; RALES trial: 30% mortality reduction"),
    ("Tab. Empagliflozin 10 mg – once daily",
     "SGLT2 inhibitor; EMPEROR-Reduced: reduces HF hospitalisation by 25% regardless of DM status; reduces preload by osmotic diuresis; also cardioprotective"),
    ("Tab. Furosemide 40 mg – once daily (titrate to symptoms)",
     "Loop diuretic; relieves pulmonary and peripheral congestion; symptom relief; does not improve mortality (use minimum effective dose)"),
],
advice="Daily weight monitoring (alert if +2 kg in 2 days). Fluid restriction 1.5 L/day. Salt <2 g/day. Cardiac rehab. Cardiology follow-up monthly. ICD/CRT discussion with cardiologist."),

# 14
dict(number=14, title="Pulmonary Tuberculosis (New Case)",
patient="Mr. Rajan Tiwari, 28 M, daily wage labourer, HIV negative",
complaint="Cough with blood-tinged sputum > 3 weeks, evening fever, night sweats, weight loss 6 kg",
exam="Temp 37.9°C, thin built, dullness + amphoric breath sounds right upper zone, BMI 16",
investigations="Sputum AFB smear: 2+ positive; GeneXpert: MTB detected, Rifampicin-sensitive; CXR: right upper lobe cavitary infiltrates",
diagnosis="Sputum Smear-Positive Pulmonary Tuberculosis (New Case) – Category I",
drugs=[
    ("HRZE FDC (Rifampicin 150 mg + Isoniazid 75 mg + Pyrazinamide 400 mg + Ethambutol 275 mg) – weight-based daily dosing × 2 months (Intensive Phase)",
     "Four-drug intensive phase as per RNTCP/WHO guidelines; rapid bacterial load reduction; prevents acquired drug resistance; rifampicin is bactericidal"),
    ("HR FDC (Rifampicin 150 mg + Isoniazid 75 mg) – daily × 4 months (Continuation Phase)",
     "Two-drug continuation phase; eliminates remaining semi-dormant bacilli; 4 months is sufficient with rifampicin-containing regimen"),
    ("Tab. Pyridoxine (Vit B6) 10 mg – once daily (throughout treatment)",
     "Isoniazid competitively inhibits B6 metabolism causing peripheral neuropathy; pyridoxine supplementation is mandatory"),
    ("Tab. Vitamin D 60,000 IU – once weekly × 8 weeks",
     "Vitamin D deficiency common in TB patients; enhances macrophage antimycobacterial activity; improves treatment outcomes"),
],
advice="DOTS (Directly Observed Treatment) mandatory. Contact tracing and screening of household members. Alcohol strictly avoided (hepatotoxicity risk). Liver function test at baseline and monthly. Notify RNTCP. Sputum AFB at end of 2nd month."),

# 15
dict(number=15, title="Epilepsy (Generalised Tonic-Clonic Seizures)",
patient="Mr. Naveen Kumar, 24 M, student, no family history",
complaint="Two episodes of generalised convulsions with loss of consciousness in 3 months",
exam="Post-ictal confusion during last episode; neurological exam: normal between attacks; no focal deficit",
investigations="EEG: generalised spike-wave discharges; MRI brain: normal; CBC, LFT, RFT: normal",
diagnosis="Idiopathic Generalised Epilepsy – Generalised Tonic-Clonic Seizures",
drugs=[
    ("Tab. Sodium Valproate CR 500 mg – twice daily with food (titrate to 1000–2000 mg/day)",
     "Broad-spectrum AED; first-line for generalised epilepsy; multiple mechanisms (Na+ channel, GABA enhancement, T-type Ca2+ channel); most effective for GTC + absence + myoclonic"),
    ("Tab. Clobazam 10 mg – at bedtime (adjunct)",
     "Long-acting benzodiazepine; add-on for breakthrough seizures; also useful for catamenial epilepsy; causes less sedation than clonazepam"),
    ("Tab. Folic acid 5 mg – once daily (especially women of childbearing age)",
     "Valproate is a known folate antagonist and teratogen; folic acid supplementation mandatory; also reduces NTD risk in pregnancy"),
],
advice="Never miss doses. Avoid alcohol, sleep deprivation, flickering lights (if photosensitive). No driving for 1 year seizure-free. Carry seizure first-aid card. EEG repeat in 6 months. Women: discuss teratogenicity and contraception."),

# 16
dict(number=16, title="Acute Pyelonephritis",
patient="Mrs. Shalini Nair, 35 F, pregnant 12 weeks",
complaint="High fever (39.5°C), rigors, right loin pain, vomiting, dysuria × 2 days",
exam="Right CVA tenderness ++, temp 39.4°C, HR 108, BP 100/68, uterus not palpable above pubis",
investigations="Urine R/E: pus cells full field, casts; urine C/S: E. coli >10^5 (ESBL negative); blood culture: E. coli; CBC: WBC 16,000; creatinine: 0.9",
diagnosis="Acute Pyelonephritis in Pregnancy (1st trimester)",
drugs=[
    ("IV Ceftriaxone 1 g – once daily × 10–14 days (IV for 48–72 hrs, switch to oral if improving)",
     "Third-generation cephalosporin; safe in pregnancy; bactericidal against E. coli; achieves high urinary and renal tissue concentrations; de-escalate after C/S result"),
    ("Tab. Paracetamol 650 mg – TDS for fever/pain",
     "Only analgesic/antipyretic safe throughout pregnancy; avoid NSAIDs in 1st and 3rd trimester"),
    ("IV fluids (NS or RL) 1–2 L over 6 hrs, then oral hydration",
     "Pyelonephritis causes significant insensible losses; IV rehydration corrects hypotension and maintains urine output protecting renal function"),
],
advice="Obstetric review. Urine C/S every 4 weeks throughout pregnancy after episode. Suppressive therapy (Nitrofurantoin 100 mg nightly) for remainder of pregnancy if recurrent. Complete full antibiotic course. Avoid fluoroquinolones and tetracyclines in pregnancy."),

# 17
dict(number=17, title="Rheumatoid Arthritis (Early, Active)",
patient="Mrs. Gayatri Pillai, 44 F, teacher",
complaint="Symmetrical small joint swelling (MCP, PIP, wrists), morning stiffness >2 hrs × 8 months",
exam="Symmetrical swelling of MCPs and PIPs bilateral, warm, tender; no deformity yet; no nodules",
investigations="RF: positive (1:640), Anti-CCP: strongly positive; ESR 78, CRP 48; X-ray hands: periarticular osteopenia, no erosions yet",
diagnosis="Rheumatoid Arthritis (2010 ACR/EULAR criteria, score 9/10) – Active, Early",
drugs=[
    ("Tab. Methotrexate 7.5 mg – once weekly (escalate to 15–25 mg/week over 2 months)",
     "First-line DMARD; anchor drug for RA; inhibits dihydrofolate reductase and reduces purine synthesis in activated lymphocytes; slows radiographic progression"),
    ("Tab. Folic acid 5 mg – once weekly (24 hrs after MTX dose, or 1 mg daily on non-MTX days)",
     "Prevents MTX-related mucositis, hepatotoxicity and cytopaenia by replenishing folate without reducing efficacy"),
    ("Tab. Hydroxychloroquine 200 mg – twice daily",
     "Antimalarial DMARD; inhibits antigen presentation via toll-like receptor interference; add-on to MTX for synergistic effect; safe in pregnancy"),
    ("Tab. Prednisolone 10 mg – once daily (bridge; taper over 3–6 months)",
     "Short-term low-dose steroid; used as bridge therapy while DMARDs take effect (8–12 weeks lag); rapid anti-inflammatory relief"),
    ("Tab. Diclofenac 75 mg SR – once daily after food (for pain/stiffness)",
     "NSAID for symptomatic relief; does not modify disease; use minimum duration; add PPI cover"),
],
advice="Joint protection techniques. Regular physiotherapy. Monitor LFT, CBC, creatinine monthly on MTX. Avoid live vaccines. Rheumatology review every 3 months. Target: DAS28 <2.6 (remission)."),

# 18
dict(number=18, title="Acute Urticaria / Allergic Reaction",
patient="Mr. Farhan Khan, 29 M",
complaint="Sudden itchy wheals all over body after eating prawns 2 hrs ago; no throat swelling, no hypotension",
exam="Multiple erythematous wheals trunk and limbs, BP 118/76, no angioedema, no stridor, SpO2 99%",
investigations="Clinical diagnosis; IgE RAST: shellfish allergy (to be done electively)",
diagnosis="Acute Urticaria (IgE-mediated food allergy to shellfish)",
drugs=[
    ("Tab. Cetirizine 10 mg – once daily (or Levocetirizine 5 mg OD)",
     "Second-generation H1 antihistamine; first-line for urticaria; blocks H1 receptors; less sedating than first-generation; effective within 1 hour"),
    ("Tab. Ranitidine 150 mg – BD (or Famotidine 20 mg BD) for 5 days",
     "H2 antihistamine; H2 receptors on skin mast cells mediate vasodilatation; H1+H2 combination superior to H1 alone in acute urticaria"),
    ("Inj. Chlorpheniramine 4 mg IM – stat (if severe/multiple wheals at presentation)",
     "First-generation H1 blocker; rapid IM action for immediate relief; use only stat; avoid regular use due to sedation"),
    ("Inj. Hydrocortisone 100 mg IV – stat (if risk of progression to anaphylaxis)",
     "Systemic corticosteroid; prevents late-phase allergic reaction and biphasic anaphylaxis; acts via reducing inflammatory mediator production"),
],
advice="Strict avoidance of shellfish and related seafood. Carry Epipen (Adrenaline 0.3 mg auto-injector) and medical alert bracelet. Allergy specialist referral for desensitisation evaluation. Return immediately if lip/tongue swelling, difficulty breathing or dizziness."),

# 19
dict(number=19, title="Anxiety Disorder (Generalised)",
patient="Ms. Divya Nair, 31 F, corporate employee",
complaint="Persistent worry, restlessness, sleep disturbance, palpitations, muscle tension × 6 months; no psychosis",
exam="Alert, anxious affect, tachycardia (HR 96), BP 122/78, thyroid normal, no focal neurology",
investigations="TFT: normal; ECG: sinus tachycardia; PHQ-9: 8 (mild depression); GAD-7: 16 (severe anxiety)",
diagnosis="Generalised Anxiety Disorder (GAD-7 >15) with comorbid mild depression",
drugs=[
    ("Tab. Escitalopram 5 mg – once daily (morning) × 2 weeks; increase to 10 mg if tolerated",
     "SSRI; first-line pharmacotherapy for GAD and comorbid depression; inhibits 5-HT reuptake; takes 4–6 weeks for full anxiolytic effect; continue 6–12 months"),
    ("Tab. Clonazepam 0.25 mg – at bedtime × 4 weeks only (short course)",
     "Short-term benzodiazepine for initial symptom relief while SSRI takes effect; avoid long-term use (dependence risk); low dose reduces risk"),
    ("Tab. Propranolol 10 mg – as needed for somatic symptoms (palpitations, tremor)",
     "Peripheral beta-blockade reduces adrenergic somatic symptoms of anxiety (palpitations, sweating, tremor); no CNS addiction risk"),
],
advice="CBT referral (Cognitive Behavioural Therapy) – most effective long-term intervention. Sleep hygiene education. Regular aerobic exercise (reduces cortisol). Mindfulness practice. Avoid caffeine, alcohol. Review in 4 weeks."),

# 20
dict(number=20, title="Acute Ischaemic Stroke (Hyperacute, within 4.5 hrs)",
patient="Mr. Vikram Desai, 68 M, hypertensive, diabetic",
complaint="Sudden onset left-sided weakness + slurred speech × 2 hours (onset known)",
exam="BP 176/100, HR 80 AF, GCS 14, left hemiplegia, NIHSS 12, no papilloedema",
investigations="CT Brain plain: no haemorrhage, no early ischaemic changes; ECG: AF; INR 1.0; glucose 136",
diagnosis="Acute Ischaemic Stroke – cardioembolism (AF), NIHSS 12, within thrombolysis window",
drugs=[
    ("IV Alteplase (rt-PA) 0.9 mg/kg (max 90 mg) – 10% IV bolus, rest over 60 min",
     "Fibrinolytic; activates plasminogen to plasmin, dissolves clot; AHA/ASA guideline: IV thrombolysis within 4.5 hrs if no contraindication; every 15-min delay reduces outcome"),
    ("Tab. Aspirin 300 mg – stat (at 24 hrs post-thrombolysis, or immediately if no thrombolysis)",
     "Antiplatelet; given 24 hrs after thrombolysis to prevent early recurrence; CAST/IST trials: reduces early stroke recurrence by ~30%"),
    ("Tab. Atorvastatin 80 mg – once daily",
     "High-intensity statin; pleiotropic effects (plaque stabilisation, anti-inflammatory); SPARCL trial: reduces stroke recurrence by 16%; start within 24–48 hrs"),
    ("Tab. Apixaban 2.5 mg – BD (start 2–14 days after stroke, after haemorrhagic transformation excluded)",
     "NOAC; anticoagulation for AF-related cardioembolic stroke; ARISTOTLE trial: superior to warfarin for stroke prevention in AF with less bleeding"),
],
advice="Stroke unit admission. Swallowing assessment before oral intake. DVT prophylaxis. BP management: permissive hypertension for 24 hrs post-thrombolysis (target <180/105). Physiotherapy from day 1. Neurology follow-up. Carotid Doppler, echo."),

# 21
dict(number=21, title="Chronic Kidney Disease (Stage 3b, Diabetic Nephropathy)",
patient="Mr. Harishankar Yadav, 58 M, T2DM 15 years, HTN",
complaint="Frothy urine, early morning puffiness of face, fatigue, decreased appetite",
exam="BP 148/92, pedal oedema +, pallor +, no JVP rise, BMI 24",
investigations="Cr 2.8 mg/dL, eGFR 38 mL/min, urine ACR 480 mg/g, Hb 9.2, K 5.1, HbA1c 8.6%, Urine: protein 2+",
diagnosis="CKD Stage 3b secondary to Diabetic Nephropathy (Albuminuric phenotype)",
drugs=[
    ("Tab. Telmisartan 40 mg – once daily (or switch to Finerenone 10 mg OD if K permits)",
     "ARB is first-line for diabetic nephropathy; reduces intraglomerular pressure and proteinuria; RENAAL/IDNT trials show renoprotection independent of BP"),
    ("Tab. Empagliflozin 10 mg – once daily",
     "SGLT2i; EMPA-KIDNEY trial: 37% reduction in kidney disease progression or CV death; reduces tubular glucose reabsorption, reduces hyperfiltration; Reno- and cardioprotective"),
    ("Inj. Erythropoietin 4000 IU SC – once weekly (target Hb 10–11.5 g/dL)",
     "ESA therapy for CKD-related anaemia (reduced EPO production); avoid Hb >12 as increases CV risk; supplement iron concurrently"),
    ("Tab. Calcium carbonate 500 mg – with meals (phosphate binder)",
     "Prevents hyperphosphataemia in CKD; binds dietary phosphate in gut; also supplements calcium to reduce secondary hyperparathyroidism risk"),
    ("Dietary referral: protein 0.6–0.8 g/kg/day, K <2 g/day, phosphate restriction",
     "Low-protein diet slows GFR decline; K restriction prevents hyperkalaemia; phosphate restriction prevents renal osteodystrophy"),
],
advice="Nephrology referral for AV fistula planning. Avoid NSAIDs, contrast, nephrotoxic drugs. BP target <130/80. eGFR and ACR every 3 months. Avoid gadolinium MRI if eGFR <30."),

# 22
dict(number=22, title="Dengue Fever (Warning Signs Present)",
patient="Ms. Pooja Sharma, 19 F, college student",
complaint="High fever × 5 days, severe retro-orbital pain, myalgia, now abdominal pain, vomiting",
exam="Temp 38.6°C, HR 102, BP 100/80 (pulse pressure 20 mmHg – narrowing!), petechiae, hepatomegaly 2 cm, no plasma leakage signs yet",
investigations="NS1 antigen: positive; Dengue IgM: positive; Platelet 42,000; Hct 44% (baseline 38%); WBC 3,200",
diagnosis="Dengue Fever – Warning Signs (WHO 2009 classification, Group B)",
drugs=[
    ("IV Ringer's Lactate 5–7 mL/kg/hr for 1–2 hrs, then adjust based on clinical response",
     "Isotonic crystalloid; first-line fluid therapy for dengue warning signs; prevents hypovolaemic shock during critical phase (days 4–6); monitor urine output hourly"),
    ("Tab. Paracetamol 500 mg – every 6 hrs (max 4 g/day) for fever and myalgia",
     "ONLY antipyretic safe in dengue; NSAIDs and aspirin MUST be avoided (thrombocytopenia, platelet dysfunction, risk of haemorrhage and Reye's in children)"),
    ("Oral rehydration (ORS/electrolyte drinks) – if oral intake maintained",
     "Oral hydration with electrolytes between IV episodes; prevents dehydration and electrolyte imbalance"),
],
advice="Hospitalise for monitoring. 4-hourly vitals, daily CBC (especially haematocrit and platelets). Watch for shock (cold extremities, altered consciousness, BP fall). Platelet transfusion ONLY if <10,000 or active bleeding. Discharge criteria: afebrile 24 hrs, improving platelets, haematocrit stable, eating well."),

# 23
dict(number=23, title="Acute Appendicitis (Pre-operative Management)",
patient="Mr. Rohit Gupta, 20 M",
complaint="Central abdominal pain migrating to right iliac fossa × 18 hrs, nausea, anorexia, single vomiting",
exam="Temp 37.8°C, tenderness + guarding at McBurney's point, Rovsing's sign positive, Rebound tenderness present",
investigations="WBC 15,400 (neutrophilia), CRP 64, USG abdomen: dilated, non-compressible appendix 8 mm (+ periappendiceal fat stranding)",
diagnosis="Acute Appendicitis (Alvarado score 9/10 – high probability); Surgical emergency",
drugs=[
    ("IV Ceftriaxone 1 g + Metronidazole 500 mg – stat, then every 12 hrs",
     "Broad-spectrum pre-operative antibiotic prophylaxis covering gram-negatives (Ceftriaxone) and anaerobes (Metronidazole); reduces post-op wound infection by 70%"),
    ("Inj. Ondansetron 4 mg IV – every 8 hrs PRN for nausea",
     "5-HT3 antagonist; antiemetic; reduces aspiration risk pre-operatively; safe and effective"),
    ("Inj. Morphine 0.1 mg/kg IV – titrated for pain (do NOT withhold analgesia)",
     "IV opioid analgesia; modern evidence shows opioids do NOT mask peritoneal signs and withholding analgesia is unethical; facilitates clinical assessment"),
    ("IV Normal Saline 1 L/hr × 2 hrs (resuscitation), then maintenance",
     "Fluid resuscitation corrects relative hypovolaemia from fever, vomiting and third-space losses; optimises patient for operative anaesthesia"),
],
advice="Immediate surgical referral – appendicectomy (laparoscopic preferred). Keep NBM. Continue antibiotics post-operatively × 3–5 days if perforated. Post-op pathology of specimen."),

# 24
dict(number=24, title="Acute Diarrhoea with Cholera Suspicion",
patient="Mr. Arun Das, 40 M, fisherman from coastal area during monsoon outbreak",
complaint="Profuse watery 'rice-water' stools 15×/day, vomiting, no fever, leg cramps × 10 hrs",
exam="Severe dehydration: sunken eyes, absent skin turgor, cold clammy hands, BP 80/50 (shock), HR 130",
investigations="Stool darkfield microscopy: motile vibrios; Rapid cholera test: positive; pH 7.28, HCO3 14, K 2.9",
diagnosis="Cholera (Vibrio cholerae) – Severe Dehydration / Hypovolaemic Shock",
drugs=[
    ("IV Ringer's Lactate 100 mL/kg in 3 hrs (adults in shock: 30 mL/kg in 30 min first)",
     "Rapid IV rehydration is life-saving; cholera kills via dehydration not direct toxicity; RL preferred (replaces bicarbonate and prevents acidosis); goal: restore BP and urine output"),
    ("Tab. Doxycycline 300 mg – single dose (once rehydrated and oral tolerated)",
     "Single-dose doxycycline reduces stool volume by ~50% and shortens illness duration; reduces environmental shedding; first-line per WHO for cholera"),
    ("ORS (high-volume) – transition to oral once shock resolved",
     "WHO ORS; glucose-Na co-transport intact despite toxin; oral route once patient stable; reduces IV fluid needs"),
    ("Potassium supplement (ORS contains K; add banana, coconut water)",
     "Cholera causes profound hypokalaemia from stool losses; dietary K sources + ORS K content adequate in mild-moderate; IV KCl only if K<2.5 or paralytic ileus"),
],
advice="Isolation and barrier nursing. Notify health authorities (cholera is notifiable). Contact tracing and prophylaxis of household contacts (Doxycycline 300 mg single dose). Safe water and food hygiene education. Oral cholera vaccine for endemic area residents."),

# 25
dict(number=25, title="Acute Lower Back Pain (Musculoskeletal)",
patient="Mr. Santosh Reddy, 38 M, construction worker",
complaint="Acute onset low back pain after lifting heavy load, radiating to left buttock (not below knee), worse on movement × 3 days",
exam="Lumbar muscle spasm, restricted flexion, straight leg raise negative bilateral, no bladder/bowel dysfunction, no saddle anaesthesia",
investigations="X-ray lumbosacral spine: mild L4-L5 disc space narrowing, no fracture, no instability; no red flags",
diagnosis="Acute Mechanical Low Back Pain (non-specific, without radiculopathy)",
drugs=[
    ("Tab. Diclofenac 75 mg SR – once daily after food × 7 days (max 2 weeks)",
     "NSAID; first-line for acute LBP; inhibits COX-mediated prostaglandin synthesis reducing peripheral sensitisation and inflammation; superior to paracetamol alone for LBP"),
    ("Tab. Pantoprazole 40 mg – once daily before breakfast (GI protection)",
     "Mandatory PPI cover with NSAID to prevent gastric irritation and ulceration, especially for musculoskeletal patients on regular NSAID courses"),
    ("Tab. Cyclobenzaprine (or Methocarbamol) 500 mg – thrice daily × 5 days",
     "Centrally acting muscle relaxant; relieves painful muscle spasm in acute LBP; do not use beyond 2 weeks; causes drowsiness (evening dosing preferred)"),
    ("Tab. Paracetamol 650 mg – TDS (add-on for breakthrough pain between NSAID doses)",
     "Adjunct analgesic; mechanism via descending pain modulation; additive effect with NSAIDs; no gastric risk; can be used regularly"),
    ("Hot pack application to lumbar region 3× daily × 5 days",
     "Local heat increases blood flow, reduces muscle spasm, and improves flexibility; evidence supports short-term symptom relief in acute LBP"),
],
advice="Stay active – bed rest WORSENS outcomes. Physiotherapy referral after 2 weeks if no improvement. Ergonomic training for lifting technique. MRI ONLY if red flags or no improvement in 6 weeks. Return if bladder/bowel symptoms, saddle anaesthesia or bilateral leg weakness."),

]  # end of CASES list


# ─── BUILD PDF ───────────────────────────────────────────────────────────────
def on_page(canvas, doc):
    """Page numbers in footer."""
    canvas.saveState()
    canvas.setFont("Helvetica", 7.5)
    canvas.setFillColor(GREY)
    canvas.drawCentredString(A4[0]/2, 1.5*cm,
        f"Medicine OPD Cases – For Educational Purposes Only   |   Page {doc.page}")
    canvas.restoreState()


def build():
    doc = SimpleDocTemplate(
        OUTPUT,
        pagesize=A4,
        leftMargin=1.8*cm, rightMargin=1.8*cm,
        topMargin=2*cm,    bottomMargin=2.2*cm,
        title="Medicine OPD Cases with Prescriptions",
        author="Orris Medical Education",
    )

    story = []

    # ── Cover block ─────────────────────────────────────────────────────────
    cover = Table(
        [[Paragraph("MEDICINE OPD", S_TITLE)],
         [Paragraph("Clinical Case Studies with Prescriptions", S_SUBTITLE)],
         [Paragraph("25 Practice Cases for Students, Interns & Residents", S_SUBTITLE)],
         [Spacer(1, 4)],
         [Paragraph("Includes: Case History · Examination · Diagnosis · Prescription · Rationale · Advice", S_FOOT)],
        ],
        colWidths=["100%"]
    )
    cover.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), DARK_BLUE),
        ("TOPPADDING",   (0,0),(-1,-1), 10),
        ("BOTTOMPADDING",(0,0),(-1,-1), 10),
        ("LEFTPADDING",  (0,0),(-1,-1), 20),
        ("RIGHTPADDING", (0,0),(-1,-1), 20),
    ]))
    story.append(cover)
    story.append(Spacer(1, 14))

    disclaimer = Table(
        [[Paragraph(
            "<b>DISCLAIMER:</b> These cases are created for educational and practice purposes only. "
            "Drug doses, regimens and clinical decisions must be verified against current formularies, "
            "institutional protocols, and relevant national/international guidelines before clinical use. "
            "Always exercise independent clinical judgement.", S_BODY)]],
        colWidths=["100%"]
    )
    disclaimer.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), RED_LIGHT),
        ("LEFTPADDING",  (0,0),(-1,-1), 10),
        ("RIGHTPADDING", (0,0),(-1,-1), 10),
        ("TOPPADDING",   (0,0),(-1,-1), 7),
        ("BOTTOMPADDING",(0,0),(-1,-1), 7),
        ("BOX",          (0,0),(-1,-1), 1, colors.HexColor("#c62828")),
    ]))
    story.append(disclaimer)
    story.append(Spacer(1, 8))

    # ── Cases ───────────────────────────────────────────────────────────────
    for i, c in enumerate(CASES):
        block = case_block(**c)
        story.extend(block)
        if (i+1) % 2 == 0 and i < len(CASES)-1:
            story.append(HRFlowable(width="100%", thickness=0.5, color=MED_BLUE))
            story.append(Spacer(1, 4))

    # ── End note ────────────────────────────────────────────────────────────
    story.append(PageBreak())
    end = Table(
        [[Paragraph("End of Clinical Case Studies", S_SUBTITLE)],
         [Paragraph(
             "These 25 cases cover common presentations across internal medicine OPD: "
             "cardiovascular, respiratory, gastrointestinal, infectious, neurological, "
             "renal, endocrine and musculoskeletal conditions. "
             "Supplement with BNF, WHO Model Formulary, and local treatment guidelines.",
             S_BODY)],
        ],
        colWidths=["100%"]
    )
    end.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), DARK_BLUE),
        ("TEXTCOLOR",    (0,0),(-1,-1), WHITE),
        ("LEFTPADDING",  (0,0),(-1,-1), 20),
        ("RIGHTPADDING", (0,0),(-1,-1), 20),
        ("TOPPADDING",   (0,0),(-1,-1), 14),
        ("BOTTOMPADDING",(0,0),(-1,-1), 14),
    ]))
    story.append(end)

    doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
    print(f"PDF saved: {OUTPUT}")


build()
Running Command

cd /home/daytona/workspace/medicine-opd-cases && python generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/medicine-opd-cases/Medicine_OPD_Cases_Prescriptions.pdf

Your PDF is ready. Download it here:

Medicine OPD Cases Prescriptions

PDF Document · PDF


What's Inside (25 Cases)

The PDF contains fully formatted clinical case cards. Each case includes:
  • Patient details (age, sex, occupation, relevant history)
  • Chief complaint + examination findings
  • Investigations + diagnosis
  • Colour-coded prescription table with drug name, dose, frequency, and duration
  • Rationale for every drug (why it was chosen, mechanism, relevant trial/guideline)
  • Advice and follow-up instructions

Cases covered:

#ConditionKey Drug(s)
1Hypertension Stage 1Amlodipine, Aspirin, Atorvastatin
2Type 2 Diabetes (new)Metformin, Glimepiride, Atorvastatin, B12
3Community-Acquired PneumoniaAmoxiclav + Azithromycin
4Acute Gastroenteritis (child)ORS, Zinc, Ondansetron, Probiotic
5Peptic Ulcer + H. pyloriTriple therapy PPI + Clarithromycin + Amoxicillin
6Bronchial Asthma (mild persistent)Salbutamol MDI, Budesonide, Montelukast
7Uncomplicated UTINitrofurantoin, Phenazopyridine
8Hypothyroidism (Hashimoto's)Levothyroxine
9Acute MigraineSumatriptan, Domperidone, Propranolol
10Iron Deficiency AnaemiaFerrous sulfate, Folic acid, Vit C
11Acute COPD ExacerbationIpratropium+Salbutamol nebulisation, Prednisolone
12Acute GoutIndomethacin, Allopurinol
13Chronic Heart Failure (HFrEF)Sacubitril/Valsartan, Carvedilol, Spironolactone, Empagliflozin
14Pulmonary TuberculosisHRZE (DOTS regimen) + Pyridoxine
15Epilepsy (GTC)Sodium Valproate, Clobazam, Folic acid
16Pyelonephritis in PregnancyIV Ceftriaxone, Paracetamol
17Rheumatoid Arthritis (early)Methotrexate, HCQ, Prednisolone bridge
18Acute UrticariaCetirizine, H2 blocker, Hydrocortisone
19Generalised Anxiety DisorderEscitalopram, short-course Clonazepam
20Acute Ischaemic StrokeIV Alteplase, Aspirin 300 mg, Atorvastatin 80 mg, Apixaban
21CKD (Diabetic Nephropathy)Telmisartan, Empagliflozin, EPO
22Dengue Fever (warning signs)IV RL, Paracetamol only
23Acute Appendicitis (pre-op)IV Ceftriaxone + Metronidazole, Morphine
24Cholera (severe dehydration)Rapid IV RL, single-dose Doxycycline
25Acute Mechanical LBPDiclofenac, Muscle relaxant, Paracetamol
Note: All cases are for educational and practice purposes only. Always verify doses and regimens against current clinical guidelines (BNF, WHO Formulary, ADA, GOLD, GINA, etc.) before applying in clinical practice.
This is a shared conversation. Sign in to Orris to start your own chat.