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
ls -la /home/daytona/workspace/ 2>/dev/null || mkdir -p /home/daytona/workspace/opd-cases
~/opd-cases/generate_opd_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, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.pdfgen import canvas
OUTPUT = "/home/daytona/workspace/opd-cases/Medicine_OPD_Cases.pdf"
# ── colour palette ──────────────────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#1A3557")
MED_BLUE = colors.HexColor("#2E6DA4")
LIGHT_BLUE = colors.HexColor("#D6E8F7")
ACCENT = colors.HexColor("#E8941A")
PALE_GREY = colors.HexColor("#F5F7FA")
WHITE = colors.white
GREEN = colors.HexColor("#1E7C4D")
PALE_GREEN = colors.HexColor("#D4EDDA")
RED_SOFT = colors.HexColor("#C0392B")
# ── styles ───────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
TITLE = S("TITLE", fontSize=22, leading=28, textColor=WHITE,
alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=4)
SUB = S("SUB", fontSize=13, leading=17, textColor=LIGHT_BLUE,
alignment=TA_CENTER, fontName="Helvetica", spaceAfter=2)
DATE = S("DATE", fontSize=10, leading=13, textColor=LIGHT_BLUE,
alignment=TA_CENTER, fontName="Helvetica-Oblique")
CASE_H = S("CASE_H", fontSize=13, leading=17, textColor=WHITE,
fontName="Helvetica-Bold", spaceAfter=0, spaceBefore=0)
SECT = S("SECT", fontSize=10, leading=14, textColor=DARK_BLUE,
fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=2)
BODY = S("BODY", fontSize=9, leading=13, textColor=colors.HexColor("#2C2C2C"),
fontName="Helvetica", alignment=TA_JUSTIFY, spaceAfter=2)
REASON = S("REASON", fontSize=9, leading=13, textColor=colors.HexColor("#1E4D2B"),
fontName="Helvetica", alignment=TA_JUSTIFY, spaceAfter=2)
FOOT = S("FOOT", fontSize=8, leading=11, textColor=colors.grey,
fontName="Helvetica-Oblique", alignment=TA_CENTER)
TOC_H = S("TOC_H", fontSize=16, leading=20, textColor=DARK_BLUE,
fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=10)
TOC_IT = S("TOC_IT", fontSize=10, leading=15, textColor=colors.HexColor("#2C2C2C"),
fontName="Helvetica", spaceAfter=1)
# ── case data ────────────────────────────────────────────────────────────────
CASES = [
{
"id": 1,
"title": "Hypertension (Primary / Essential)",
"patient": "Mr. Ramesh Kumar, 52 M",
"chief": "Headache, dizziness, BP 158/96 mmHg on 3 readings over 4 weeks",
"history": "No prior antihypertensive use. Smoker (10 pack-years). Family H/O HTN. BMI 27.",
"exam": "BP 158/96 mmHg (both arms), HR 78/min regular, No papilloedema. S1 S2 normal.",
"ix": "FBS 98 mg/dL, S. Creatinine 0.9 mg/dL, S. Electrolytes normal, ECG normal, Urinalysis normal, Lipid profile: LDL 138 mg/dL.",
"diagnosis": "Stage 2 Essential Hypertension",
"rx": [
("Tab. Amlodipine", "5 mg", "Once daily (morning)", "30 days"),
("Tab. Telmisartan", "40 mg", "Once daily (morning)", "30 days"),
("Tab. Aspirin (EC)", "75 mg", "Once daily after food", "30 days"),
("Tab. Atorvastatin", "10 mg", "Once daily at night", "30 days"),
],
"advice": "Low-salt diet (<5 g/day), regular aerobic exercise 30 min/day, smoking cessation, weight reduction, avoid NSAIDs. Follow-up in 4 weeks with BP diary.",
"reasons": [
"Amlodipine (CCB): First-line for stage 2 HTN; reduces peripheral vascular resistance; excellent tolerability.",
"Telmisartan (ARB): Renal-protective, especially with metabolic risk; inhibits RAAS; complements CCB for additive BP reduction.",
"Aspirin 75 mg: Primary CV risk reduction given LDL elevation, smoking, and age > 50.",
"Atorvastatin: LDL 138 mg/dL with multiple CV risk factors; target LDL < 100 mg/dL per ACC/AHA guidelines.",
],
},
{
"id": 2,
"title": "Type 2 Diabetes Mellitus (Newly Diagnosed)",
"patient": "Mrs. Sunita Devi, 48 F",
"chief": "Polyuria, polydipsia, unexplained weight loss for 3 months",
"history": "No prior DM diagnosis. Family H/O DM (mother). BMI 30. Sedentary lifestyle.",
"exam": "BP 128/82 mmHg, BMI 30. No peripheral neuropathy signs. Fundus: normal.",
"ix": "FBS 186 mg/dL, PPBS 268 mg/dL, HbA1c 9.2%, S. Creatinine 0.8 mg/dL, Urine microalbumin negative, CBC normal.",
"diagnosis": "Type 2 Diabetes Mellitus, newly diagnosed, uncontrolled",
"rx": [
("Tab. Metformin", "500 mg", "Twice daily with meals (titrate to 1000 mg BD after 2 wks)", "60 days"),
("Tab. Glimepiride", "1 mg", "Once daily before breakfast", "30 days"),
("Tab. Pantoprazole", "40 mg", "Once daily empty stomach (GI protection)", "30 days"),
("Cap. Methylcobalamin", "500 mcg", "Once daily", "30 days"),
],
"advice": "ADA diabetic diet, brisk walk 45 min/day, SMBG fasting & postprandial, HbA1c recheck at 3 months, annual eye & foot exam.",
"reasons": [
"Metformin: First-line for T2DM; reduces hepatic gluconeogenesis; weight-neutral/mild weight loss; cardioprotective; low hypoglycaemia risk.",
"Glimepiride: Added for HbA1c 9.2% (dual therapy needed); sulfonylurea stimulates insulin secretion; low cost; effective.",
"Pantoprazole: GI protection as Metformin can cause GI upset initially.",
"Methylcobalamin: B12 supplementation prophylaxis as Metformin impairs B12 absorption over time.",
],
},
{
"id": 3,
"title": "Community-Acquired Pneumonia (Mild-Moderate)",
"patient": "Mr. Vijay Singh, 35 M",
"chief": "Productive cough with yellow sputum, fever 38.8°C, pleuritic chest pain x 5 days",
"history": "No prior lung disease. Non-smoker. No recent hospitalisation.",
"exam": "RR 22/min, SpO2 96% (room air), dullness & bronchial breathing right lower zone. CURB-65 score: 1.",
"ix": "CBC: WBC 14,200 (neutrophilia), CRP 78, CXR: right lower lobe consolidation, Sputum C&S pending.",
"diagnosis": "Community-Acquired Pneumonia (mild, CURB-65 = 1) - outpatient management",
"rx": [
("Tab. Amoxicillin-Clavulanate", "625 mg", "Three times daily after food", "7 days"),
("Tab. Azithromycin", "500 mg", "Once daily", "5 days"),
("Tab. Paracetamol", "650 mg", "Three times daily (for fever/pain)", "5 days"),
("Syp. Ambroxol", "30 mg/5 mL - 10 mL", "Three times daily after food", "5 days"),
],
"advice": "Adequate hydration, rest, steam inhalation. Return if SpO2 < 94%, worsening dyspnoea or no improvement in 48 hrs.",
"reasons": [
"Amoxicillin-Clavulanate: Covers typical organisms (S. pneumoniae, H. influenzae, M. catarrhalis) - BTS/IDSA first-line for outpatient CAP.",
"Azithromycin: Dual therapy covers atypical organisms (Mycoplasma, Chlamydia, Legionella) - reduces mortality in CAP.",
"Paracetamol: Safe antipyretic/analgesic; NSAIDs avoided due to pleuritic inflammation risk.",
"Ambroxol: Mucolytic - reduces sputum viscosity, facilitates expectoration.",
],
},
{
"id": 4,
"title": "Gastroesophageal Reflux Disease (GERD)",
"patient": "Mrs. Priya Sharma, 40 F",
"chief": "Heartburn, acid regurgitation, sour taste in mouth, worse after meals and at night x 6 weeks",
"history": "BMI 28. Frequent spicy food intake. No dysphagia or weight loss (no alarm features).",
"exam": "Epigastric tenderness mild. No organomegaly. No alarm signs.",
"ix": "H. pylori stool antigen: negative. UGI endoscopy deferred (no alarm features).",
"diagnosis": "GERD without alarm features",
"rx": [
("Tab. Pantoprazole", "40 mg", "Once daily, 30 min before breakfast", "4 weeks"),
("Tab. Domperidone", "10 mg", "Three times daily before meals", "4 weeks"),
("Syp. Sucralfate", "10 mL (1 g/5 mL)", "Three times daily 1 hr before meals", "4 weeks"),
],
"advice": "Avoid spicy/fatty/acidic foods, coffee, alcohol. Elevate head end of bed 15-20 cm. Small frequent meals. No lying down for 3 hrs after dinner. Weight reduction.",
"reasons": [
"Pantoprazole (PPI): Most effective class for GERD; irreversibly inhibits H+/K+-ATPase; heals esophagitis in 80-90% cases.",
"Domperidone (prokinetic): Improves lower esophageal sphincter tone and gastric emptying; reduces reflux episodes.",
"Sucralfate: Forms protective barrier over inflamed mucosa; cytoprotective; adjunct to PPI.",
],
},
{
"id": 5,
"title": "Iron Deficiency Anaemia",
"patient": "Mrs. Lakshmi Reddy, 28 F",
"chief": "Fatigue, pallor, exertional breathlessness for 2 months",
"history": "Menorrhagia since 6 months (gynaec referral given). Vegetarian diet. No GI bleed.",
"exam": "Pallor ++, koilonychia, atrophic glossitis. HR 98/min. No jaundice/splenomegaly.",
"ix": "Hb 7.8 g/dL, MCV 64 fL, MCH 19 pg, S. Ferritin 6 ng/mL, S. Iron 42 mcg/dL, TIBC 480 mcg/dL, Peripheral smear: microcytic hypochromic with pencil cells.",
"diagnosis": "Iron Deficiency Anaemia (moderate, secondary to menorrhagia)",
"rx": [
("Tab. Ferrous Sulphate", "200 mg (elemental Fe 60 mg)", "Twice daily on empty stomach", "90 days"),
("Tab. Ascorbic Acid (Vit C)", "500 mg", "Twice daily with iron tablet", "90 days"),
("Tab. Folic Acid", "5 mg", "Once daily", "90 days"),
],
"advice": "Iron-rich foods (meat, green leafy vegetables, legumes), avoid tea/coffee with iron tablets. Recheck CBC & ferritin at 4 weeks. Gynaecology referral for menorrhagia.",
"reasons": [
"Ferrous Sulphate: Ferrous (Fe2+) salts have 3x better absorption than ferric; correct iron stores over 3 months; cheapest & most effective oral iron.",
"Vitamin C: Reduces ferric to ferrous form; acidifies GI tract enhancing non-haem iron absorption by 2-3x.",
"Folic Acid: Concurrent folate deficiency common with menorrhagia; prevents megaloblastic change; supports erythropoiesis.",
],
},
{
"id": 6,
"title": "Acute Exacerbation of Bronchial Asthma (Mild-Moderate)",
"patient": "Ms. Ankita Joshi, 22 F",
"chief": "Wheeze, chest tightness, shortness of breath worsening over 2 days after cold exposure",
"history": "Known asthmatic on salbutamol inhaler PRN. Poorly adherent to ICS.",
"exam": "RR 24/min, SpO2 94% room air, bilateral expiratory wheeze, PEFR 55% predicted.",
"ix": "PEFR 210 L/min (predicted 380 L/min). SpO2 94%. ABG not done (mild case). CXR: hyperinflation.",
"diagnosis": "Acute moderate asthma exacerbation",
"rx": [
("Salbutamol MDI + Spacer", "200 mcg (2 puffs)", "Every 20 min x 3 doses, then 4-hourly", "5 days"),
("Tab. Prednisolone", "40 mg", "Once daily morning for 5 days", "5 days"),
("Budesonide-Formoterol Inhaler", "160/4.5 mcg - 2 puffs", "Twice daily (maintenance)", "Ongoing"),
("Tab. Montelukast", "10 mg", "Once daily at night", "30 days"),
],
"advice": "PEFR monitoring at home, written asthma action plan, avoid triggers (dust, cold air, allergens). Step-up ICS/LABA therapy. Adherence counselling.",
"reasons": [
"Salbutamol (SABA): Rapid bronchodilation via beta-2 agonism; first-line for acute exacerbation.",
"Prednisolone (systemic corticosteroid): Reduces airway inflammation; shortens exacerbation duration; prevents relapse.",
"Budesonide-Formoterol (ICS+LABA): Long-term control; ICS reduces eosinophilic inflammation; LABA provides sustained bronchodilation.",
"Montelukast (LTRA): Add-on controller for persistent asthma; blocks leukotriene-mediated bronchoconstriction; improves nocturnal symptoms.",
],
},
{
"id": 7,
"title": "Urinary Tract Infection (Uncomplicated)",
"patient": "Mrs. Geeta Nair, 32 F",
"chief": "Dysuria, frequency, urgency, lower abdominal pain x 3 days",
"history": "Sexually active. No fever/flank pain (no upper UTI signs). Prior UTI 1 year ago.",
"exam": "Suprapubic tenderness. No costovertebral angle tenderness. BP normal. Temp 37.1°C.",
"ix": "Urine R/M: pus cells 20-25/hpf, RBC 5-8/hpf. Urine C&S pending. Urine pregnancy test negative.",
"diagnosis": "Acute uncomplicated cystitis",
"rx": [
("Tab. Nitrofurantoin (Macrocrystals)", "100 mg", "Twice daily with food", "5 days"),
("Tab. Phenazopyridine", "200 mg", "Three times daily after food (x 2 days only)", "2 days"),
("Tab. Cranberry Extract", "500 mg", "Twice daily", "30 days"),
],
"advice": "Increased fluid intake >2 L/day, urinate after intercourse, front-to-back wiping, loose cotton underwear. Urine C&S result review in 48 hrs. Return if fever/flank pain develops.",
"reasons": [
"Nitrofurantoin: First-line for uncomplicated UTI per IDSA guidelines; concentrated in urine; low systemic absorption; minimal resistance; E. coli coverage.",
"Phenazopyridine: Urinary analgesic/anaesthetic; relieves dysuria and urgency quickly; used only 2 days (urine discolouration warning given).",
"Cranberry Extract: Reduces bacterial adherence (anti-fimbriae effect); UTI prophylaxis for recurrent cases.",
],
},
{
"id": 8,
"title": "Hypothyroidism (Primary)",
"patient": "Mrs. Anita Mehta, 38 F",
"chief": "Weight gain 8 kg/6 months, cold intolerance, fatigue, constipation, hair loss, bradycardia",
"history": "No prior thyroid treatment. Family H/O hypothyroidism.",
"exam": "HR 58/min, BP 118/76. Dry skin, puffiness of face, delayed DTRs. Goitre grade I.",
"ix": "TSH 18.4 mIU/L (N: 0.4-4.0), Free T4 0.6 ng/dL (N: 0.8-1.8), Anti-TPO antibodies: 320 IU/mL (high). CBC: mild normocytic anaemia.",
"diagnosis": "Primary Hypothyroidism (Hashimoto's thyroiditis)",
"rx": [
("Tab. Levothyroxine (T4)", "50 mcg", "Once daily, 30-60 min before breakfast on empty stomach", "6 weeks then review"),
],
"advice": "Take on empty stomach, avoid calcium/iron supplements within 4 hrs. Recheck TSH at 6 weeks (target 1-2.5 mIU/L). Annual thyroid function test once stable. Selenium-rich diet.",
"reasons": [
"Levothyroxine (T4): Standard of care for hypothyroidism; T4 is a pro-hormone converted peripherally to active T3; predictable pharmacokinetics; once-daily dosing; ATA/ETA recommended.",
"Starting dose 50 mcg (not full replacement) to avoid cardiac stress, especially if >50 yrs or cardiac history; titrate based on TSH.",
],
},
{
"id": 9,
"title": "Peptic Ulcer Disease (H. pylori positive)",
"patient": "Mr. Suresh Yadav, 45 M",
"chief": "Epigastric pain (burning), relieved by food, nausea, loss of appetite x 3 weeks",
"history": "Chronic NSAID use (Diclofenac for knee pain). H. pylori stool antigen positive.",
"exam": "Epigastric tenderness. No guarding. No alarm features. Haemoglobin 12.8 g/dL.",
"ix": "H. pylori stool antigen: positive. UGI Endoscopy: 1 cm duodenal ulcer, D1. Biopsy: H. pylori confirmed.",
"diagnosis": "Duodenal Ulcer Disease with H. pylori infection",
"rx": [
("Tab. Pantoprazole", "40 mg", "Twice daily before meals (for 14 days then OD for 4 more weeks)", "6 weeks"),
("Tab. Amoxicillin", "1 g", "Twice daily with food", "14 days"),
("Tab. Clarithromycin", "500 mg", "Twice daily with food (Triple Therapy)", "14 days"),
("Tab. Bismuth Subcitrate", "120 mg", "Four times daily (Quadruple therapy adjunct)", "14 days"),
],
"advice": "Stop NSAIDs (switch to paracetamol). Avoid smoking, alcohol. Small frequent meals. Confirm H. pylori eradication with stool antigen test 4 weeks after completing antibiotics.",
"reasons": [
"Bismuth quadruple therapy: Used given rising Clarithromycin resistance; high eradication rates >90%; Bismuth adds anti-H. pylori synergy.",
"Pantoprazole: Acid suppression heals ulcer, enhances antibiotic efficacy (antibiotics work better at higher gastric pH).",
"Amoxicillin + Clarithromycin: Core H. pylori eradication antibiotics (IASG/Maastricht V guidelines).",
],
},
{
"id": 10,
"title": "Gout (Acute Flare)",
"patient": "Mr. Pankaj Gupta, 55 M",
"chief": "Sudden onset severe pain, swelling, redness in right great toe since last night",
"history": "Alcohol drinker. High purine diet. Previous similar episode 6 months ago. On Hydrochlorothiazide for HTN.",
"exam": "Right 1st MTP joint: hot, red, swollen, extremely tender (podagra). Tophi absent.",
"ix": "S. Uric acid 9.8 mg/dL, WBC 12,000, CRP 45. Joint aspiration: needle-shaped, negatively birefringent crystals (MSU).",
"diagnosis": "Acute Gouty Arthritis",
"rx": [
("Tab. Indomethacin", "50 mg", "Three times daily with food", "5 days"),
("Tab. Pantoprazole", "40 mg", "Once daily (GI protection with NSAID)", "7 days"),
("Tab. Colchicine", "0.5 mg", "Twice daily (if NSAIDs contraindicated / add-on)", "5 days"),
("Tab. Allopurinol", "100 mg", "Once daily (START after acute flare subsides)", "Ongoing"),
],
"advice": "Increase fluid intake >3 L/day, avoid alcohol, reduce purine-rich foods (red meat, seafood). Review Hydrochlorothiazide (switch to amlodipine for HTN as thiazides raise uric acid). Start Allopurinol only after flare resolves.",
"reasons": [
"Indomethacin (NSAID): First-line for acute gout; potent anti-inflammatory; COX-1/2 inhibition; faster onset than colchicine.",
"Pantoprazole: GI protection with NSAID (reduces risk of peptic ulcer and GI bleed).",
"Colchicine: Second-line if NSAIDs contraindicated; inhibits microtubule polymerisation, blocking neutrophil migration and crystal-triggered inflammation.",
"Allopurinol (xanthine oxidase inhibitor): Urate-lowering therapy (ULT); target SUA < 6 mg/dL; NOT started during acute flare (can prolong or worsen attack).",
],
},
{
"id": 11,
"title": "Migraine (Without Aura)",
"patient": "Ms. Deepika Verma, 26 F",
"chief": "Recurrent unilateral throbbing headache 2-3 attacks/month, nausea, photophobia, lasts 12-24 hrs",
"history": "Precipitated by stress, menstruation. Relieved by sleep. No focal deficits.",
"exam": "Normal neurological exam. BP 112/72. Fundus normal.",
"ix": "MRI brain: Normal (done for first severe headache workup). Diagnosis clinical per ICHD-3.",
"diagnosis": "Migraine without aura, episodic (ICHD-3)",
"rx": [
("Tab. Sumatriptan", "50 mg", "At onset of migraine (may repeat after 2 hrs if needed; max 200 mg/day)", "PRN"),
("Tab. Naproxen Sodium", "550 mg", "At onset (adjunct to triptan)", "PRN"),
("Tab. Propranolol", "40 mg", "Twice daily (prophylaxis)", "3 months"),
("Tab. Domperidone", "10 mg", "At onset for nausea", "PRN"),
],
"advice": "Migraine diary for triggers, regular sleep schedule, stay hydrated, avoid caffeine rebound. Reassess prophylaxis response at 3 months.",
"reasons": [
"Sumatriptan (triptan): 5-HT1B/1D agonist; specific anti-migraine; causes cranial vasoconstriction; aborts attack in 60-70% cases.",
"Naproxen: NSAID adjunct; enhances triptan efficacy; anti-inflammatory effect on meningeal vessels.",
"Propranolol (beta-blocker): Prophylaxis of choice per AHS/AAN guidelines; reduces attack frequency by 50%; reduces CNS excitability.",
"Domperidone: Anti-emetic + prokinetic; treats migraine-associated nausea and gastroparesis (enhances oral drug absorption during attack).",
],
},
{
"id": 12,
"title": "Acute Gastroenteritis",
"patient": "Mr. Rahul Sharma, 24 M",
"chief": "Loose watery stools x6/day, vomiting x3, low-grade fever, cramping abdominal pain since yesterday",
"history": "Ate from street food stall 12 hrs before onset. No blood in stool. Travel to rural area.",
"exam": "Dry mucous membranes, decreased skin turgor, mild dehydration. Diffuse mild tenderness. Temp 37.6°C.",
"ix": "Stool R/M: Pus cells 2-3/hpf, No RBCs, No ova/cysts. No stool C&S done (viral aetiology suspected).",
"diagnosis": "Acute Watery Gastroenteritis with Mild Dehydration (likely viral/ETEC)",
"rx": [
("ORS (Oral Rehydration Salt)", "Sachets x 10", "1 sachet per loose stool or vomiting episode", "3 days"),
("Tab. Ondansetron", "4 mg", "Twice daily (anti-emetic)", "3 days"),
("Tab. Metronidazole", "400 mg", "Three times daily after food", "5 days"),
("Tab. Zinc Sulphate", "20 mg", "Once daily", "14 days"),
("Cap. Probiotic (Lactobacillus GG)", "2 Billion CFU", "Twice daily", "7 days"),
],
"advice": "ORS as primary rehydration. Continue feeding. Seek IV fluids if unable to tolerate orals. Wash hands, safe water. Return if blood in stool or no improvement in 48 hrs.",
"reasons": [
"ORS: WHO/UNICEF standard; corrects dehydration and electrolyte imbalance without IV access; glucose-coupled sodium absorption.",
"Ondansetron: 5-HT3 antagonist; reduces vomiting; improves ORS intake tolerance; evidence supports use over promethazine.",
"Metronidazole: Empiric coverage for Giardia/anaerobes (street food exposure); protozoal/anaerobic coverage.",
"Zinc: WHO recommends 20 mg/day x 14 days in acute diarrhoea; reduces duration and severity; replenishes zinc lost in stool.",
"Probiotics: Restore gut microbiome; Lactobacillus GG has strongest evidence for reducing diarrhoea duration by ~1 day.",
],
},
{
"id": 13,
"title": "Allergic Rhinitis (Moderate-Severe Persistent)",
"patient": "Mr. Arjun Patel, 30 M",
"chief": "Sneezing, watery nasal discharge, nasal blockage, itchy eyes, persistent for 4+ months/year",
"history": "Triggered by dust, pollen. No asthma. No nasal polyps on endoscopy. Skin prick: house dust mite positive.",
"exam": "Pale oedematous nasal mucosa, watery rhinorrhoea. Allergic shiners. No polyps.",
"ix": "Total IgE: 380 IU/mL. Eosinophils: 8%. SPT positive for HDM, cockroach.",
"diagnosis": "Allergic Rhinitis, moderate-severe persistent (ARIA classification)",
"rx": [
("Nasal Fluticasone Furoate Spray", "27.5 mcg/spray - 2 sprays each nostril", "Once daily morning", "8 weeks"),
("Tab. Cetirizine", "10 mg", "Once daily at night", "4 weeks"),
("Nasal Saline Rinse (Isotonic)", "10 mL each nostril", "Twice daily", "Ongoing"),
("Tab. Montelukast", "10 mg", "Once daily at night (add-on)", "4 weeks"),
],
"advice": "HEPA air purifier, wash bedding weekly in hot water, allergen avoidance. Consider allergen-specific immunotherapy (SCIT/SLIT) for HDM sensitisation.",
"reasons": [
"Intranasal corticosteroid: Most effective single agent for allergic rhinitis (ARIA guidelines); reduces all nasal symptoms; safe long-term.",
"Cetirizine (2nd-gen antihistamine): Non-sedating; relieves sneezing, rhinorrhoea, ocular symptoms; H1 blocker.",
"Saline rinse: Removes allergens from nasal mucosa; reduces mucosal oedema; safe, adjunctive.",
"Montelukast: Leukotriene receptor antagonist; add-on benefit especially with co-existing asthma or inadequate response.",
],
},
{
"id": 14,
"title": "Chronic Obstructive Pulmonary Disease (GOLD Group B)",
"patient": "Mr. Mohan Das, 62 M",
"chief": "Chronic productive cough, progressive exertional breathlessness, wheeze for 5+ years",
"history": "Smoker 40 pack-years. mMRC dyspnoea grade 2. 1 exacerbation in past year.",
"exam": "Barrel chest, decreased air entry bilaterally, prolonged expiration, scattered rhonchi. SpO2 91% on air.",
"ix": "Spirometry: FEV1/FVC 0.58, FEV1 48% predicted (GOLD stage 3). CXR: Hyperinflation, flat diaphragms.",
"diagnosis": "COPD GOLD Stage 3 (Severe), Group B",
"rx": [
("Tiotropium Bromide Inhaler", "18 mcg/dose - 1 capsule inhaled", "Once daily (Handihaler)", "Ongoing"),
("Salmeterol-Fluticasone Inhaler", "25/250 mcg - 2 puffs", "Twice daily", "Ongoing"),
("Tab. N-Acetylcysteine", "600 mg", "Once daily", "3 months"),
("Tab. Theophylline SR", "200 mg", "Twice daily (add-on bronchodilator)", "Ongoing"),
],
"advice": "Smoking cessation (most important intervention), influenza and pneumococcal vaccination, pulmonary rehabilitation, long-term O2 if SpO2 persistently < 88%.",
"reasons": [
"Tiotropium (LAMA): GOLD guideline first-line for COPD; reduces exacerbations by 17%; once-daily dosing; superior to ipratropium.",
"Salmeterol-Fluticasone (LABA+ICS): Added for GOLD B with FEV1 < 50%; reduces exacerbations; improves symptoms.",
"N-Acetylcysteine: Mucolytic; reduces oxidative stress; decreases exacerbation frequency in COPD.",
"Theophylline SR: Third-line bronchodilator; mild bronchodilation + anti-inflammatory; useful when LAMA+LABA+ICS insufficient.",
],
},
{
"id": 15,
"title": "Acute Pyelonephritis (Uncomplicated)",
"patient": "Mrs. Kavitha Rajan, 34 F",
"chief": "Fever 39.2°C, rigors, right flank pain, dysuria, nausea for 2 days",
"history": "H/O UTI 6 months ago (treated with Nitrofurantoin). No urological abnormality.",
"exam": "Right CVA tenderness positive, Temp 39.2°C, BP 118/76, HR 104. Suprapubic tenderness.",
"ix": "CBC: WBC 17,500 (neutrophilia), CRP 128. Urine R/M: pus cells full field, bacteria +++. Urine C&S: E. coli, sensitivity pending. Blood culture sent. USG KUB: no obstruction.",
"diagnosis": "Acute Uncomplicated Pyelonephritis",
"rx": [
("Tab. Ciprofloxacin", "500 mg", "Twice daily with food", "10 days"),
("Tab. Paracetamol", "650 mg", "Three times daily (for fever)", "5 days"),
("Tab. Tramadol", "50 mg", "Twice daily for flank pain (short course)", "3 days"),
("ORS / Oral fluids", "2-3 L/day", "Ensure adequate hydration", "10 days"),
],
"advice": "Review urine C&S at 48 hrs and adjust antibiotic if needed. Repeat urine culture 1 week after completing antibiotics. Investigate for urological abnormality if recurrent.",
"reasons": [
"Ciprofloxacin (fluoroquinolone): First-line for outpatient pyelonephritis (IDSA); excellent gram-negative coverage including E. coli; good renal tissue penetration.",
"Paracetamol: Safe antipyretic; avoids NSAIDs (nephrotoxic risk in pyelonephritis).",
"Tramadol: Opioid analgesic for severe flank pain; non-nephrotoxic; short course only.",
"Hydration: Promotes urinary flow and bacterial clearance from urinary tract.",
],
},
{
"id": 16,
"title": "Rheumatoid Arthritis (Early, Active)",
"patient": "Mrs. Pooja Mishra, 42 F",
"chief": "Symmetrical swelling and stiffness of small joints of hands and wrists, morning stiffness > 1 hour for 3 months",
"history": "No prior DMARD use. Family H/O RA.",
"exam": "Tender, swollen MCP and PIP joints bilaterally. Wrist synovitis. No nodules. DAS28 = 5.1.",
"ix": "RF positive (1:320), Anti-CCP positive (120 U/mL), CRP 64, ESR 88, X-ray hands: periarticular osteopaenia, no erosions yet.",
"diagnosis": "Rheumatoid Arthritis (early, seropositive, moderate-high activity)",
"rx": [
("Tab. Methotrexate", "7.5 mg", "Once weekly (increase to 15 mg weekly after 4 weeks)", "Ongoing"),
("Tab. Folic Acid", "5 mg", "Once daily (except on Methotrexate day)", "Ongoing"),
("Tab. Hydroxychloroquine", "200 mg", "Twice daily after food", "Ongoing"),
("Tab. Prednisolone", "10 mg", "Once daily (bridge therapy, taper over 8 weeks)", "8 weeks"),
("Tab. Calcium + Vitamin D3", "500 mg + 400 IU", "Once daily", "Ongoing"),
],
"advice": "Avoid live vaccines on MTX. Regular eye exam for HCQ (annual). LFTs + CBC monthly for 6 months then 3-monthly. Sun protection (HCQ skin photosensitivity). Physio referral.",
"reasons": [
"Methotrexate (anchor DMARD): First-line DMARD for RA (ACR/EULAR); inhibits dihydrofolate reductase, reduces inflammation; proven erosion prevention.",
"Folic Acid: Prevents MTX toxicity (mouth ulcers, cytopenias, hepatotoxicity) by replenishing folate; not given on MTX day.",
"Hydroxychloroquine (antimalarial DMARD): Combination DMARD therapy; safe, cardioprotective; reduces disease activity when combined with MTX.",
"Prednisolone: Bridge therapy while DMARDs take effect (2-3 months); rapid symptom control; taper to avoid steroid side effects.",
"Calcium + Vit D: Prevent corticosteroid-induced osteoporosis.",
],
},
{
"id": 17,
"title": "Depression (Major Depressive Disorder, Moderate)",
"patient": "Mr. Aakash Tiwari, 33 M",
"chief": "Low mood, loss of interest in all activities, poor sleep, fatigue, feeling hopeless for 6 weeks. PHQ-9 score: 16",
"history": "First episode. No psychosis. No suicidal ideation. No substance use. Work-related stress.",
"exam": "Psychomotor retardation noted. Affect flat. Oriented x3. No suicidal intent.",
"ix": "TFTs (TSH): Normal (to exclude hypothyroidism). CBC, LFTs, RFTs: Normal. PHQ-9: 16 (moderate).",
"diagnosis": "Major Depressive Disorder, single episode, moderate (DSM-5)",
"rx": [
("Tab. Escitalopram", "10 mg", "Once daily morning", "4 weeks (reassess, may increase to 20 mg)"),
("Tab. Clonazepam", "0.25 mg", "Once daily at night (short-term, 2 weeks only)", "2 weeks"),
("Psychotherapy referral", "CBT sessions x 8-12 (structured)", "Weekly", "3 months"),
],
"advice": "Inform about 2-4 week latency for antidepressant effect. Continue antidepressant for minimum 6-9 months after remission. Safety plan given. Follow-up in 2 weeks.",
"reasons": [
"Escitalopram (SSRI): First-line antidepressant (APA/NICE); selective serotonin reuptake inhibition; best tolerability profile; fewest drug interactions.",
"Clonazepam: Short-term anxiolytic/hypnotic while SSRI takes effect; addresses insomnia and anxiety component; limited to 2 weeks to prevent dependence.",
"CBT: Equal or superior to pharmacotherapy for moderate depression; prevents relapse; combined therapy most effective (BMJ meta-analysis).",
],
},
{
"id": 18,
"title": "Dengue Fever (Suspected, Outpatient Management)",
"patient": "Mr. Sandeep Roy, 28 M",
"chief": "High fever 39.8°C, severe headache, retro-orbital pain, myalgia, rash for 4 days",
"history": "Monsoon season. Mosquito exposure. No mucosal bleed, no haemorrhage signs.",
"exam": "Temp 39.8°C, HR 98, BP 112/74. Macular rash trunk/limbs. No tourniquet test positive. No organomegaly.",
"ix": "CBC: WBC 3,200, Platelets 88,000, Hb 14.2. NS1 Antigen: positive. IgM/IgG dengue: pending. LFTs: mild transaminitis.",
"diagnosis": "Dengue Fever without Warning Signs (Group A - Outpatient)",
"rx": [
("Tab. Paracetamol", "650 mg", "Three times daily (for fever/pain)", "5 days"),
("ORS / Oral fluids", "3 L/day minimum", "Maintain hydration", "5 days"),
("Tab. Cetirizine", "10 mg", "Once daily (for rash pruritus)", "5 days"),
],
"advice": "STRICT: AVOID NSAIDs (Aspirin, Ibuprofen, Diclofenac) and Injectables - risk of bleeding with thrombocytopaenia. Daily platelet count. Warning signs for immediate hospitalisation: bleeding, persistent vomiting, abdominal pain, restlessness, platelet < 20,000.",
"reasons": [
"Paracetamol ONLY: NSAIDs/Aspirin contraindicated in dengue - inhibit platelet aggregation increasing haemorrhage risk; Paracetamol is safe antipyretic.",
"ORS hydration: Dengue causes plasma leakage; oral fluids prevent haemoconcentration; haematocrit monitoring guides IV fluids.",
"Cetirizine: Symptomatic relief of dengue rash pruritis; antihistamine, safe with dengue.",
"No antibiotic/antiviral: Dengue is viral; antibiotics are unnecessary; no specific antiviral approved.",
],
},
{
"id": 19,
"title": "Osteoarthritis (Knee, Primary)",
"patient": "Mrs. Kamala Devi, 65 F",
"chief": "Bilateral knee pain worsening on walking and climbing stairs, morning stiffness < 30 min, crepitus for 2 years",
"history": "BMI 34. Menopausal. No history of inflammatory arthritis.",
"exam": "Bony swelling of bilateral knees, crepitus, restricted ROM. No warmth/redness. WOMAC score: 48.",
"ix": "X-ray knees (standing): joint space narrowing, osteophytes bilaterally. ESR/CRP normal. RF negative.",
"diagnosis": "Primary Osteoarthritis of Bilateral Knees (K-L Grade II-III)",
"rx": [
("Tab. Paracetamol", "500 mg", "Three times daily after food", "4 weeks"),
("Tab. Etoricoxib", "60 mg", "Once daily after food (if paracetamol inadequate)", "4 weeks"),
("Tab. Glucosamine + Chondroitin", "1500 mg + 1200 mg", "Once daily after food", "3 months"),
("Tab. Calcium Carbonate + Vit D3", "1000 mg + 800 IU", "Once daily", "Ongoing"),
("Topical Diclofenac Gel 1%", "Apply to knee", "Three times daily (local)", "4 weeks"),
],
"advice": "Weight loss (target BMI < 27), quadriceps strengthening exercises, physiotherapy, knee support brace. Avoid stairs/squatting. If conservative fails: consider intra-articular steroid injection or joint replacement.",
"reasons": [
"Paracetamol: First-line analgesic for OA (ACR/EULAR); minimal side effects; step-up therapy approach.",
"Etoricoxib (COX-2 inhibitor): Better GI safety than non-selective NSAIDs; effective for OA pain and inflammation; second-line.",
"Glucosamine + Chondroitin: Structural components of cartilage; may slow cartilage degradation; ESCEO guidelines recommend as symptomatic slow-acting drugs (SYSADOAs).",
"Calcium + Vit D: Prevent osteoporosis in elderly; important with reduced mobility and post-menopausal status.",
"Topical Diclofenac: Local anti-inflammatory; avoids systemic NSAID toxicity; effective for knee OA.",
],
},
{
"id": 20,
"title": "Hyperthyroidism (Graves' Disease)",
"patient": "Mrs. Rekha Soni, 35 F",
"chief": "Weight loss, palpitations, heat intolerance, sweating, tremor, anxiety, bulging eyes for 3 months",
"history": "No prior thyroid disease. No family H/O thyroid cancer.",
"exam": "HR 108/min irregular, goitre grade II, fine tremor, exophthalmos, warm moist skin. Lid lag positive.",
"ix": "TSH < 0.01 mIU/L (suppressed), Free T4 3.8 ng/dL (HIGH), Free T3 9.6 pg/mL (HIGH), TSH receptor antibodies (TRAb): positive (550%), Thyroid uptake scan: diffusely increased.",
"diagnosis": "Graves' Disease (Autoimmune Hyperthyroidism)",
"rx": [
("Tab. Carbimazole", "20 mg", "Twice daily (titration regime)", "6-18 months"),
("Tab. Propranolol", "40 mg", "Three times daily (symptom control)", "6-8 weeks then taper"),
("Tab. Selenium", "200 mcg", "Once daily (for Graves' ophthalmopathy)", "6 months"),
],
"advice": "Monitor TFTs every 4-6 weeks. CBC monitoring for agranulocytosis (carbimazole SE). Warn patient: sore throat/fever - stop carbimazole and seek urgent FBC. Discuss radioiodine or surgery if relapse after 18 months therapy.",
"reasons": [
"Carbimazole (thionamide): First-line ATD; blocks thyroid peroxidase; reduces T3/T4 synthesis; 40-60% remission rate.",
"Propranolol: Blocks sympathomimetic effects of excess thyroid hormone (palpitations, tremor, anxiety); also inhibits peripheral T4 to T3 conversion.",
"Selenium: EUGOGO guidelines recommend 200 mcg/day selenium for 6 months in mild-moderate Graves' ophthalmopathy; reduces oxidative stress; improves eye disease.",
],
},
{
"id": 21,
"title": "Acute Sinusitis (Bacterial, Subacute)",
"patient": "Mr. Ashok Kumar, 38 M",
"chief": "Facial pain (maxillary), nasal congestion, purulent nasal discharge, headache for 12 days (after initial cold)",
"history": "Post-viral; initial URTI 2 weeks ago. Fever 38.1°C. No dental pain.",
"exam": "Maxillary sinus tenderness bilaterally. Purulent PND on oropharyngeal exam. Temp 38.1°C.",
"ix": "Clinical diagnosis. CT sinuses (if refractory): not done yet. X-ray PNS: fluid levels in bilateral maxillary sinuses.",
"diagnosis": "Acute Bacterial Rhinosinusitis (ABRS) - bilateral maxillary",
"rx": [
("Tab. Amoxicillin-Clavulanate", "625 mg", "Three times daily after food", "10 days"),
("Nasal Oxymetazoline Spray", "2 sprays each nostril", "Twice daily (max 5 days)", "5 days"),
("Nasal Fluticasone Spray", "50 mcg x 2 sprays each nostril", "Once daily", "3 weeks"),
("Tab. Paracetamol", "650 mg", "Three times daily (analgesic/antipyretic)", "5 days"),
("Nasal Saline Rinse", "10 mL each nostril", "Three times daily", "3 weeks"),
],
"advice": "Steam inhalation, adequate hydration, avoid air travel during acute phase. Review at 72 hrs; if worsening consider CT sinuses and ENT referral.",
"reasons": [
"Amoxicillin-Clavulanate: AAO-HNS first-line for ABRS; covers S. pneumoniae, H. influenzae, M. catarrhalis (including beta-lactamase producers).",
"Oxymetazoline (decongestant): Reduces nasal mucosal oedema; improves sinus drainage; MAX 5 days (rhinitis medicamentosa risk).",
"Intranasal fluticasone: Anti-inflammatory; reduces mucosal oedema; decreases symptom duration.",
"Saline rinse: Clears purulent secretions; reduces bacterial load; improves mucociliary clearance.",
],
},
{
"id": 22,
"title": "Chronic Kidney Disease (Stage 3, with Anaemia)",
"patient": "Mr. Harbans Lal, 60 M",
"chief": "Known CKD, fatigue, pallor, ankle oedema, nocturia x 2/night",
"history": "DM and HTN for 15 years. On Insulin and Amlodipine.",
"exam": "BP 148/92, bilateral pitting ankle oedema, pallor +++. No asterixis.",
"ix": "S. Creatinine 2.4 mg/dL, eGFR 32 mL/min/1.73m2 (CKD-EPI), Hb 8.6 g/dL, Iron stores replete (Ferritin 280), S. Erythropoietin LOW, S. Phosphorus 5.8 mg/dL, Vit D 14 ng/mL.",
"diagnosis": "CKD Stage 3b, Anaemia of CKD (Renal Anaemia), Secondary Hyperparathyroidism",
"rx": [
("Inj. Epoetin Alpha (EPO)", "4000 IU SC", "Three times weekly (target Hb 10-11.5 g/dL)", "Ongoing"),
("Tab. Sevelamer Carbonate", "800 mg", "Three times daily with meals (phosphate binder)", "Ongoing"),
("Inj./Tab. Calcitriol", "0.25 mcg", "Once daily (active Vit D)", "Ongoing"),
("Tab. Telmisartan", "40 mg", "Once daily (RAAS blockade)", "Ongoing"),
("Tab. Furosemide", "40 mg", "Once daily morning (for oedema)", "Ongoing"),
],
"advice": "Low-potassium, low-phosphate, protein-restricted (0.6-0.8 g/kg/day) diet. Monitor BP, S. Creatinine, Hb, electrolytes monthly. Nephrology review for RRT planning.",
"reasons": [
"Epoetin Alpha (ESA): Replaces deficient erythropoietin in CKD; treats renal anaemia; avoids transfusions; KDIGO recommends target Hb 10-11.5 g/dL.",
"Sevelamer (phosphate binder): Non-calcium binder; reduces GI phosphate absorption; prevents vascular calcification (advantage over calcium binders in CKD).",
"Calcitriol (active Vit D): CKD patients cannot hydroxylate Vit D; calcitriol bypasses this; treats secondary hyperparathyroidism; improves Ca/P balance.",
"Telmisartan (ARB): Reduces intraglomerular pressure; slows CKD progression especially in DM nephropathy.",
"Furosemide: Loop diuretic for fluid overload/oedema; effective even in reduced GFR (unlike thiazides).",
],
},
{
"id": 23,
"title": "Epilepsy (Generalised Tonic-Clonic Seizures)",
"patient": "Mr. Deepak Tomar, 25 M",
"chief": "Two episodes of generalised convulsions in the past 2 months, post-ictal confusion",
"history": "No prior seizures till 2 months ago. No fever, no head injury, no family H/O epilepsy. Sleep-deprived.",
"exam": "Normal neurological exam between seizures. No focal deficits.",
"ix": "MRI brain: Normal. EEG: Generalised spike-and-wave discharges. Metabolic workup (glucose, sodium, calcium): normal.",
"diagnosis": "Idiopathic Generalised Epilepsy - Tonic-Clonic seizures (ILAE)",
"rx": [
("Tab. Sodium Valproate CR", "500 mg", "Twice daily after food", "Ongoing (min 2-3 yrs seizure-free)"),
("Tab. Folic Acid", "5 mg", "Once daily (especially if reproductive age)", "Ongoing"),
],
"advice": "Avoid sleep deprivation, alcohol, flashing lights. No driving until seizure-free for 2 years (as per law). Medic Alert bracelet. Seizure first aid training for family. Monitor LFTs, CBC every 6 months (VPA toxicity). Teratogenic risk counselling for women.",
"reasons": [
"Sodium Valproate CR: First-line for generalised tonic-clonic epilepsy (ILAE); blocks voltage-gated Na+ channels and enhances GABA; high efficacy for all generalised seizure types.",
"Folic Acid: Valproate is a potent teratogen (neural tube defects) and also reduces folate; supplementation mandatory, especially in women of reproductive age.",
"CR formulation: Controlled-release reduces peak-trough fluctuations; better tolerability; reduces GI side effects.",
],
},
{
"id": 24,
"title": "Vertigo (Benign Paroxysmal Positional Vertigo - BPPV)",
"patient": "Mrs. Nirmala Singh, 55 F",
"chief": "Sudden episodes of severe dizziness and room-spinning sensation triggered by head movement, nausea x 1 week",
"history": "Episodes last < 1 minute, triggered by rolling over in bed. No hearing loss/tinnitus. No neurological symptoms.",
"exam": "Dix-Hallpike test: positive right side (torsional nystagmus, fatigable). Neurological exam normal.",
"ix": "Dix-Hallpike test: diagnostic. MRI brain: not needed (classical BPPV). Audiometry: normal.",
"diagnosis": "BPPV - Right posterior semicircular canal",
"rx": [
("Epley Manoeuvre", "Performed in clinic", "Right side; repeat in 1 week if symptoms persist", "1-3 sessions"),
("Tab. Cinnarizine", "25 mg", "Three times daily (for acute nausea/vertigo)", "5-7 days max"),
("Tab. Betahistine", "16 mg", "Twice daily", "4 weeks"),
],
"advice": "Sleep with head elevated 45 degrees for 48 hrs after Epley. Avoid sudden head movements. Vestibular rehabilitation exercises (Brandt-Daroff). BPPV has high recurrence rate (30% per year).",
"reasons": [
"Epley Manoeuvre (CRP): First-line treatment; repositions otoliths from posterior SCC to utricle; 80% success after 1-3 sessions; avoids medication need.",
"Cinnarizine (antihistamine/CCB): Short-term vestibular suppressant; anti-nausea; helps with acute vertigo symptoms; not for long-term use.",
"Betahistine: Histamine H1 agonist/H3 antagonist; improves inner ear microcirculation; reduces endolymphatic pressure; adjunct for persistent vertigo.",
],
},
{
"id": 25,
"title": "Acute Appendicitis (Pre-operative / Referral Case)",
"patient": "Mr. Nikhil Bajaj, 19 M",
"chief": "Periumbilical pain migrating to right iliac fossa, nausea, vomiting, low-grade fever x 18 hours",
"history": "No prior abdominal surgery. Anorexia. No bowel changes.",
"exam": "McBurney's point tenderness, Rovsing's sign positive, Psoas sign positive. Temp 38.2°C. Alvarado score 9.",
"ix": "CBC: WBC 16,800, Neutrophils 88%. CRP 142 mg/L. USG abdomen: non-compressible appendix 9 mm, periappendiceal fat stranding. CT abdomen: acute appendicitis confirmed, no perforation.",
"diagnosis": "Acute Appendicitis (non-perforated) - SURGICAL EMERGENCY",
"rx": [
("Inj. Cefuroxime", "1.5 g IV", "Pre-operatively (stat dose - surgical prophylaxis)", "Single pre-op dose"),
("Inj. Metronidazole", "500 mg IV", "Pre-operatively (stat dose - covers anaerobes)", "Single pre-op dose"),
("Inj. Ondansetron", "4 mg IV", "For nausea/vomiting pre-op", "PRN"),
("Inj. Morphine", "0.1 mg/kg IV", "Titrated analgesia (does NOT mask signs in diagnosed case)", "As needed"),
],
"advice": "IMMEDIATE SURGICAL REFERRAL for laparoscopic appendicectomy. NBM (nil by mouth). IV access. Consent obtained. Anaesthesia assessment. Post-op: continue antibiotics 24-48 hrs.",
"reasons": [
"Cefuroxime (2nd gen cephalosporin): Pre-operative prophylaxis per SIGN/NICE guidelines; covers gram-positive and gram-negative organisms.",
"Metronidazole: Prophylaxis against anaerobic gut flora; reduces post-operative wound infection and intra-abdominal abscess.",
"Morphine: Pain relief in confirmed appendicitis does NOT obscure clinical diagnosis (Cochrane review evidence); withholding analgesia is unethical.",
"NBM + Surgery: Definitive treatment; laparoscopic appendicectomy is standard of care; reduces complications vs open approach.",
],
},
{
"id": 26,
"title": "Skin & Soft Tissue Infection (Cellulitis)",
"patient": "Mr. Harish Choudhary, 47 M",
"chief": "Redness, warmth, swelling, tenderness of left lower leg, fever 38.5°C for 3 days",
"history": "Diabetic. Minor scratch 5 days ago. No fluctuation (no abscess). No prior cellulitis.",
"exam": "Well-demarcated erythema (15x10 cm), warmth, oedema, tender left leg. No crepitus. Temp 38.5°C. HR 96.",
"ix": "CBC: WBC 14,600, CRP 88. Blood culture sent. Random blood sugar: 248 mg/dL. ABPI: 0.9 (no PVD).",
"diagnosis": "Non-purulent Cellulitis, left leg (Class II - Eron classification) in a Diabetic",
"rx": [
("Tab. Amoxicillin-Clavulanate", "875/125 mg", "Twice daily after food", "7-10 days"),
("Tab. Flucloxacillin", "500 mg", "Four times daily (empty stomach)", "7 days"),
("Tab. Paracetamol", "650 mg", "Three times daily (fever/pain)", "5 days"),
("Wound dressing", "Saline + Betadine", "Once daily", "Till healed"),
],
"advice": "Mark the erythema borders with skin marker to monitor spread. Elevate leg. Tight glycaemic control. Return immediately if spreading erythema, bullae, crepitus, or clinical deterioration (necrotising fasciitis signs). Review in 48 hrs.",
"reasons": [
"Amoxicillin-Clavulanate: Broad-spectrum; covers Streptococci (main cause) and Staphylococci including some MRSA; good tissue penetration.",
"Flucloxacillin: Anti-staphylococcal beta-lactam; covers MSSA; added in diabetic patient with higher MSSA risk.",
"Glycaemic control: Hyperglycaemia impairs neutrophil function; wound healing requires euglycaemia; infection worsens DM control (vicious cycle).",
"Leg elevation: Reduces oedema, improves lymphatic drainage, decreases pain and erythema.",
],
},
{
"id": 27,
"title": "Anxiety Disorder (Generalised Anxiety Disorder)",
"patient": "Ms. Shalini Kapoor, 29 F",
"chief": "Excessive worry, restlessness, muscle tension, poor concentration, insomnia for 4 months. GAD-7 score: 14",
"history": "Recent job change and family stress. No substance use. No prior psychiatric treatment.",
"exam": "Alert, anxious affect, HR 92/min, mild tremor. No thyroid enlargement. TFTs normal.",
"ix": "TFTs, CBC, FBS: All normal. GAD-7: 14 (moderate-severe).",
"diagnosis": "Generalised Anxiety Disorder (DSM-5), moderate-severe",
"rx": [
("Tab. Escitalopram", "10 mg", "Once daily morning (titrate to 20 mg after 2 weeks)", "12 weeks minimum"),
("Tab. Buspirone", "5 mg", "Twice daily (anxiolytic, non-benzodiazepine)", "8 weeks"),
("Tab. Propranolol", "10 mg", "Twice daily (somatic symptoms: palpitations, tremor)", "4 weeks"),
("CBT Referral", "Structured sessions", "Weekly for 12 sessions", "3 months"),
],
"advice": "Avoid caffeine and alcohol. Regular aerobic exercise. Mindfulness/relaxation techniques. Antidepressant takes 2-4 weeks to work. Do not stop medication abruptly. Follow-up in 2 weeks.",
"reasons": [
"Escitalopram (SSRI): First-line for GAD (NICE/APA); serotonergic modulation of anxiety circuits; long-term remission; non-addictive.",
"Buspirone: Non-benzodiazepine anxiolytic (5-HT1A partial agonist); no dependence/sedation; adjunct for residual anxiety; onset 2-4 weeks.",
"Propranolol: Beta-blocker for somatic anxiety symptoms; reduces peripheral sympathetic activation; does not address core anxiety.",
"CBT: First-line psychological treatment for GAD (NICE); restructures cognitive distortions; most durable long-term effects.",
],
},
{
"id": 28,
"title": "Vitamin D Deficiency (Severe)",
"patient": "Mrs. Fatima Khan, 45 F",
"chief": "Generalised body aches, bone pain, fatigue, muscle weakness, difficulty climbing stairs for 6 months",
"history": "Minimal sun exposure (wears full purdah). Vegetarian diet. No prior Vit D supplementation.",
"exam": "Proximal muscle weakness (3/5 quadriceps), bilateral tibial tenderness. No tetany. BP 124/80.",
"ix": "25-OH Vitamin D: 7 ng/mL (severe deficiency), S. Calcium 8.2 mg/dL (low-normal), S. Phosphorus 2.8 mg/dL, ALP 198 IU/L (elevated), PTH 112 pg/mL (secondary hyperparathyroidism), X-ray pelvis: Looser's zones (osteomalacia).",
"diagnosis": "Severe Vitamin D Deficiency / Osteomalacia with Secondary Hyperparathyroidism",
"rx": [
("Tab./Sachet Cholecalciferol (Vit D3)", "60,000 IU", "Once weekly for 8 weeks (loading dose)", "8 weeks"),
("Tab. Calcium Carbonate", "1000 mg", "Twice daily after food", "Ongoing"),
("Tab. Cholecalciferol", "1000 IU", "Once daily (maintenance after loading)", "Ongoing"),
],
"advice": "Sun exposure 15-30 min/day (forearms/face). Vit D-rich foods (fatty fish, egg yolk, fortified milk). Recheck 25-OH Vit D at 3 months. Monitor S. calcium during loading (hypercalcaemia risk).",
"reasons": [
"Cholecalciferol (D3): Superior to D2 (ergocalciferol) in raising and sustaining 25-OH Vit D levels; loading dose corrects severe deficiency rapidly.",
"Calcium supplementation: Co-treatment essential; mineralises newly formed osteoid (heals Looser's zones); Vit D alone insufficient for osteomalacia repair.",
"Maintenance dose: After loading, maintenance dose prevents re-deficiency; adjusted based on follow-up 25-OH Vit D level.",
],
},
]
# ── helper: prescription table ────────────────────────────────────────────────
def rx_table(rx_list):
data = [["Drug", "Dose", "Frequency / Instructions", "Duration"]]
for row in rx_list:
data.append(list(row))
col_widths = [5.5*cm, 2.8*cm, 6.5*cm, 3.2*cm]
t = Table(data, colWidths=col_widths)
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), 8),
("BACKGROUND", (0, 1), (-1, -1), PALE_GREY),
("ROWBACKGROUNDS",(0, 1), (-1, -1), [WHITE, PALE_GREY]),
("FONTNAME", (0, 1), (-1, -1), "Helvetica"),
("FONTSIZE", (0, 1), (-1, -1), 8),
("GRID", (0, 0), (-1, -1), 0.4, colors.HexColor("#BBBBBB")),
("VALIGN", (0, 0), (-1, -1), "MIDDLE"),
("LEFTPADDING", (0, 0), (-1, -1), 5),
("RIGHTPADDING", (0, 0), (-1, -1), 5),
("TOPPADDING", (0, 0), (-1, -1), 4),
("BOTTOMPADDING", (0, 0), (-1, -1), 4),
("WORDWRAP", (0, 0), (-1, -1), True),
]))
return t
# ── build story ───────────────────────────────────────────────────────────────
def build():
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.8*cm, rightMargin=1.8*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="Medicine OPD Cases - Clinical Practice & Education",
author="Orris Medical Education",
)
story = []
# ── Cover Page ────────────────────────────────────────────────────────────
cover_data = [[Paragraph("Medicine OPD<br/>Clinical Cases", TITLE)]]
cover_tbl = Table(cover_data, colWidths=[17.4*cm])
cover_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 32),
("BOTTOMPADDING", (0,0), (-1,-1), 32),
("LEFTPADDING", (0,0), (-1,-1), 16),
("RIGHTPADDING", (0,0), (-1,-1), 16),
("ROUNDEDCORNERS", (0,0), (0,0), [8]),
]))
story.append(Spacer(1, 3*cm))
story.append(cover_tbl)
story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("28 Real-World OPD Patient Cases with Prescriptions,<br/>Clinical Reasoning & Treatment Rationale", SUB))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("For Medical Students, Interns & Practitioners | Educational Use Only", DATE))
story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width="100%", thickness=1, color=ACCENT))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"Compiled: May 2026 | Covers: Internal Medicine, Endocrinology, Pulmonology, Neurology, Nephrology, Rheumatology, Psychiatry & more",
DATE))
story.append(PageBreak())
# ── Table of Contents ─────────────────────────────────────────────────────
story.append(Paragraph("Table of Contents", TOC_H))
story.append(HRFlowable(width="100%", thickness=1, color=MED_BLUE))
story.append(Spacer(1, 0.2*cm))
for c in CASES:
story.append(Paragraph(f"Case {c['id']:02d}: {c['title']}", TOC_IT))
story.append(PageBreak())
# ── Individual Cases ──────────────────────────────────────────────────────
for c in CASES:
# Case header bar
hdr_data = [[Paragraph(f"Case {c['id']:02d}: {c['title']}", CASE_H)]]
hdr_tbl = Table(hdr_data, colWidths=[17.4*cm])
hdr_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
]))
story.append(hdr_tbl)
story.append(Spacer(1, 0.15*cm))
# Patient / Chief complaint / History / Exam / Ix in a 2-col table
info_rows = [
("Patient", c["patient"]),
("Chief Complaint", c["chief"]),
("History", c["history"]),
("Examination", c["exam"]),
("Investigations", c["ix"]),
("Diagnosis", c["diagnosis"]),
]
for label, val in info_rows:
row_data = [[
Paragraph(label, ParagraphStyle("LBL", fontSize=8, fontName="Helvetica-Bold",
textColor=DARK_BLUE, leading=11)),
Paragraph(val, BODY),
]]
info_tbl = Table(row_data, colWidths=[3.5*cm, 13.9*cm])
info_tbl.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 4),
("RIGHTPADDING", (0,0), (-1,-1), 4),
("TOPPADDING", (0,0), (-1,-1), 2),
("BOTTOMPADDING", (0,0), (-1,-1), 2),
("LINEBELOW", (0,0), (-1,-1), 0.3, colors.HexColor("#DDDDDD")),
]))
story.append(info_tbl)
story.append(Spacer(1, 0.2*cm))
# Prescription header
rx_hdr_data = [[Paragraph("PRESCRIPTION", ParagraphStyle(
"RX_H", fontSize=9, fontName="Helvetica-Bold", textColor=DARK_BLUE,
leading=12))]]
rx_hdr_tbl = Table(rx_hdr_data, colWidths=[17.4*cm])
rx_hdr_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT_BLUE),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 10),
]))
story.append(rx_hdr_tbl)
story.append(rx_table(c["rx"]))
# Advice
story.append(Spacer(1, 0.15*cm))
adv_data = [[
Paragraph("Advice / Follow-up", ParagraphStyle("ADVL", fontSize=8,
fontName="Helvetica-Bold", textColor=GREEN, leading=11)),
Paragraph(c["advice"], REASON),
]]
adv_tbl = Table(adv_data, colWidths=[3.5*cm, 13.9*cm])
adv_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), PALE_GREEN),
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING",(0,0), (-1,-1), 5),
]))
story.append(adv_tbl)
# Reasons
story.append(Spacer(1, 0.1*cm))
reason_hdr = [[Paragraph("WHY WE PRESCRIBE THIS - Clinical Rationale",
ParagraphStyle("RR_H", fontSize=8.5, fontName="Helvetica-Bold",
textColor=ACCENT, leading=12))]]
rr_hdr_tbl = Table(reason_hdr, colWidths=[17.4*cm])
rr_hdr_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#FFF4E6")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 10),
("LINEBELOW", (0,0), (-1,-1), 0.5, ACCENT),
]))
story.append(rr_hdr_tbl)
for r in c["reasons"]:
bull_data = [[
Paragraph("•", ParagraphStyle("BULL", fontSize=9, fontName="Helvetica-Bold",
textColor=ACCENT, leading=13)),
Paragraph(r, REASON),
]]
bull_tbl = Table(bull_data, colWidths=[0.4*cm, 17.0*cm])
bull_tbl.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 2),
("RIGHTPADDING", (0,0), (-1,-1), 4),
("TOPPADDING", (0,0), (-1,-1), 1),
("BOTTOMPADDING",(0,0), (-1,-1), 1),
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#FFFBF5")),
]))
story.append(bull_tbl)
story.append(Spacer(1, 0.3*cm))
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#CCCCCC")))
story.append(Spacer(1, 0.25*cm))
# ── Disclaimer ────────────────────────────────────────────────────────────
story.append(PageBreak())
disc_data = [[Paragraph(
"<b>DISCLAIMER</b><br/><br/>"
"This document is prepared solely for medical education and practice purposes. "
"Prescriptions are illustrative and based on standard clinical guidelines (WHO, ACC/AHA, ADA, BTS, IDSA, NICE, etc.). "
"Always individualise therapy based on patient-specific factors including allergies, comorbidities, renal/hepatic function, "
"and local antibiogram data. Drug doses and regimens should be verified against current formularies before clinical use. "
"This document does not replace clinical judgment or formal medical training.",
ParagraphStyle("DISC", fontSize=9, leading=14, fontName="Helvetica",
textColor=colors.HexColor("#4A4A4A"), alignment=TA_JUSTIFY))]]
disc_tbl = Table(disc_data, colWidths=[17.4*cm])
disc_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#FFF3CD")),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#E6A817")),
("TOPPADDING", (0,0), (-1,-1), 14),
("BOTTOMPADDING", (0,0), (-1,-1), 14),
("LEFTPADDING", (0,0), (-1,-1), 16),
("RIGHTPADDING", (0,0), (-1,-1), 16),
]))
story.append(Spacer(1, 3*cm))
story.append(disc_tbl)
doc.build(story)
print(f"PDF created: {OUTPUT}")
build()
~/opd-cases/generate_opd_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/opd-cases/generate_opd_pdf.py'