Write about 25+ peads 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
Reading File
Running Command

mkdir -p /home/daytona/workspace/peds-opd && ls /home/daytona/workspace/

Writing File

~/peds-opd/generate_peds_cases.py

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

# ── Colour palette ────────────────────────────────────────────────────────────
DARK_BLUE   = HexColor("#1A3A5C")
MID_BLUE    = HexColor("#2E6DA4")
LIGHT_BLUE  = HexColor("#D6E8FA")
ACCENT      = HexColor("#E8534A")
GREEN       = HexColor("#2E7D32")
LIGHT_GREEN = HexColor("#E8F5E9")
ORANGE      = HexColor("#E65100")
LIGHT_ORANGE= HexColor("#FFF3E0")
GREY        = HexColor("#F5F5F5")
DARK_GREY   = HexColor("#424242")
WHITE       = colors.white

# ── Case data ─────────────────────────────────────────────────────────────────
cases = [
    {
        "no": 1,
        "title": "Acute Otitis Media",
        "patient": "Age: 2 years | Sex: Male | Weight: 12 kg",
        "chief_complaint": "Ear pain, fever, and irritability for 2 days",
        "history": (
            "Mother reports the child has been pulling at his right ear since yesterday. "
            "Fever measured at 38.8°C at home. Decreased appetite. No ear discharge. "
            "Had a URI (runny nose, mild cough) 5 days ago."
        ),
        "examination": (
            "Temp 38.6°C, HR 118/min, RR 26/min. Right tympanic membrane bulging and "
            "erythematous on otoscopy. No perforation. Left ear normal. Throat mildly red."
        ),
        "diagnosis": "Acute Otitis Media (AOM) — right ear",
        "prescription": [
            ("Amoxicillin 40 mg/kg/day", "250 mg/5 mL syrup — 10 mL (250 mg) three times daily × 10 days"),
            ("Paracetamol 15 mg/kg/dose", "120 mg/5 mL syrup — 10 mL every 6 hours as needed for fever/pain"),
            ("Saline nasal drops", "2 drops each nostril three times daily"),
        ],
        "reasons": (
            "Amoxicillin is the first-line antibiotic for AOM in children; it covers the most "
            "common pathogens (S. pneumoniae, H. influenzae, M. catarrhalis) at high dose. "
            "Paracetamol provides analgesia and antipyresis — NSAIDs are avoided in <2-year-olds "
            "with fever of unknown duration. Saline nasal drops help decongest the Eustachian tube."
        ),
        "follow_up": "Review in 48-72 hours if no improvement; refer to ENT if recurrent (≥3 episodes/6 months).",
    },
    {
        "no": 2,
        "title": "Acute Pharyngotonsillitis (Streptococcal)",
        "patient": "Age: 6 years | Sex: Female | Weight: 20 kg",
        "chief_complaint": "Sore throat, high fever, difficulty swallowing for 3 days",
        "history": (
            "Abrupt onset high-grade fever (39.5°C). No cough, no rhinorrhoea. Siblings had "
            "similar illness last week. No prior rheumatic fever or heart disease."
        ),
        "examination": (
            "Temp 39.2°C. Pharynx markedly inflamed, bilateral tonsillar enlargement with "
            "white exudate. Tender anterior cervical lymphadenopathy. No stridor. Rapid Strep "
            "test positive. Centor score 4."
        ),
        "diagnosis": "Acute streptococcal pharyngotonsillitis",
        "prescription": [
            ("Amoxicillin 50 mg/kg/day", "250 mg/5 mL syrup — 20 mL (500 mg) twice daily × 10 days"),
            ("Paracetamol 15 mg/kg/dose", "250 mg/5 mL syrup — 12 mL every 6 hours for fever"),
            ("Benzydamine HCl throat spray", "2 sprays to throat 3-4 times daily (symptomatic relief)"),
        ],
        "reasons": (
            "Amoxicillin for 10 days eradicates Group A Streptococcus (GAS), preventing "
            "acute rheumatic fever and suppurative complications (peritonsillar abscess). "
            "Paracetamol controls fever and throat pain. Benzydamine has local anaesthetic "
            "and anti-inflammatory action on the inflamed mucosa."
        ),
        "follow_up": "If penicillin allergy: use Azithromycin 10 mg/kg OD × 5 days. Throat culture if rapid test negative.",
    },
    {
        "no": 3,
        "title": "Bronchial Asthma — Mild Intermittent Attack",
        "patient": "Age: 8 years | Sex: Male | Weight: 25 kg",
        "chief_complaint": "Episodic wheezing and shortness of breath, worse at night",
        "history": (
            "Known asthmatic on no regular medication. Wheeze triggered by exercise and cold "
            "air. No hospitalisation. Symptoms <2 days/week. FH: mother has allergic rhinitis."
        ),
        "examination": (
            "RR 24/min, SpO2 97%. Mild expiratory wheeze bilateral. No use of accessory "
            "muscles. PEFR 82% predicted. No cyanosis."
        ),
        "diagnosis": "Bronchial Asthma — Mild Intermittent (GINA Step 1)",
        "prescription": [
            ("Salbutamol MDI 100 mcg", "2 puffs via spacer as needed (reliever) — max 4 doses/day"),
            ("Montelukast 5 mg", "1 chewable tablet once daily at bedtime"),
            ("Saline nebulisation", "If acute wheeze: salbutamol 0.15 mg/kg/dose nebulised"),
        ],
        "reasons": (
            "Salbutamol (short-acting beta-2 agonist) is the universal reliever — causes "
            "rapid bronchodilation via smooth muscle relaxation. Spacer device improves lung "
            "deposition in children. Montelukast (leukotriene receptor antagonist) reduces "
            "airway inflammation and is useful in exercise- and allergen-triggered asthma. "
            "It is preferred over ICS for very mild disease or poor inhaler technique."
        ),
        "follow_up": "Inhaler technique education for child and parent. Step up to ICS if symptoms increase to >2 days/week.",
    },
    {
        "no": 4,
        "title": "Acute Gastroenteritis with Mild Dehydration",
        "patient": "Age: 18 months | Sex: Female | Weight: 10 kg",
        "chief_complaint": "Loose stools 8-10 times/day and vomiting for 2 days",
        "history": (
            "Watery, non-bloody diarrhoea. Vomiting 3-4 times/day. Fever 37.8°C. "
            "Breastfed. Drinking less than usual. Last urine 5 hours ago."
        ),
        "examination": (
            "Mild dehydration: sunken eyes, slightly dry mucous membranes, reduced skin "
            "turgor. Weight today 9.7 kg (usual 10 kg = ~3% loss). HR 120, alert and playful."
        ),
        "diagnosis": "Acute viral gastroenteritis with mild dehydration (WHO Plan B)",
        "prescription": [
            ("ORS (Oral Rehydration Salts)", "50-100 mL/kg over 4 hours = 500-1000 mL. Then maintenance 10 mL/kg per loose stool."),
            ("Zinc sulfate 20 mg/day", "Zinc syrup — 10 mg (half tab) once daily × 14 days"),
            ("Ondansetron 0.15 mg/kg", "ODT 2 mg — once if vomiting prevents ORS intake"),
            ("Paracetamol 15 mg/kg/dose", "For fever if temp >38.5°C — 120 mg/5 mL, 7.5 mL every 6h PRN"),
        ],
        "reasons": (
            "ORS corrects dehydration and electrolyte loss without the risks of IV fluids. "
            "Zinc supplementation for 14 days reduces stool frequency, duration of diarrhoea, "
            "and recurrence (WHO/UNICEF recommendation for all children in developing countries). "
            "Ondansetron (5HT3 antagonist) reduces vomiting, improving ORS tolerance. Antibiotics "
            "are NOT indicated in viral/non-bloody diarrhoea."
        ),
        "follow_up": "Continue breastfeeding. Return immediately if sunken fontanelle, no urine >8h, or blood in stool.",
    },
    {
        "no": 5,
        "title": "Iron Deficiency Anaemia",
        "patient": "Age: 3 years | Sex: Female | Weight: 14 kg",
        "chief_complaint": "Pallor, fatigue, poor appetite for 2 months",
        "history": (
            "Predominantly milk diet, poor intake of iron-rich foods. No bleeding. "
            "Born term, exclusively breastfed for 6 months, solids introduced late."
        ),
        "examination": (
            "Pallor of conjunctiva and palms. No jaundice, no hepatosplenomegaly. "
            "CBC: Hb 7.8 g/dL, MCV 62 fL, MCH 18 pg. Peripheral smear: microcytic "
            "hypochromic RBCs. Serum ferritin 5 ng/mL (low)."
        ),
        "diagnosis": "Iron Deficiency Anaemia (IDA)",
        "prescription": [
            ("Ferrous sulfate 3-6 mg elemental iron/kg/day", "Iron drops — 1.5 mL (15 mg elemental iron) twice daily between meals × 3 months"),
            ("Vitamin C (ascorbic acid) 50 mg", "1 tablet or 5 mL syrup with each iron dose to enhance absorption"),
            ("Folic acid 1 mg", "Once daily × 1 month (address any concurrent folate deficiency)"),
        ],
        "reasons": (
            "Elemental iron supplementation replenishes iron stores and restores haemoglobin. "
            "Given between meals for maximum absorption (food inhibits non-haem iron uptake). "
            "Vitamin C (ascorbic acid) converts ferric to ferrous iron, significantly enhancing "
            "GI absorption. Folic acid corrects any concurrent megaloblastic component. "
            "Response expected: reticulocytosis in 3-5 days, Hb rise ~1 g/dL/week."
        ),
        "follow_up": "Repeat CBC at 4 weeks. Continue iron for 3 months after Hb normalises to replenish stores. Dietary counselling.",
    },
    {
        "no": 6,
        "title": "Febrile Seizure (Simple)",
        "patient": "Age: 20 months | Sex: Male | Weight: 11 kg",
        "chief_complaint": "Single generalised tonic-clonic seizure during fever",
        "history": (
            "Seizure lasted ~2 minutes, self-terminating. Occurred with rapid temperature "
            "rise. Post-ictal drowsiness for 15 minutes, now alert. No prior seizures. "
            "FH: father had febrile seizures as a child."
        ),
        "examination": (
            "Temp 39.4°C. Alert and playful. Normal neurological exam. Throat mildly red. "
            "No neck stiffness, no Kernig's sign. No focal neurological deficit."
        ),
        "diagnosis": "Simple Febrile Seizure secondary to viral URTI",
        "prescription": [
            ("Paracetamol 15 mg/kg/dose", "120 mg/5 mL — 14 mL every 6 hours × 3 days for fever"),
            ("Ibuprofen 10 mg/kg/dose", "100 mg/5 mL — 5.5 mL every 8 hours for fever if paracetamol inadequate"),
            ("Diazepam rectal solution 0.5 mg/kg", "5 mg rectal tube — given at home if seizure >5 min (rescue therapy)"),
        ],
        "reasons": (
            "Paracetamol and ibuprofen are antipyretics to manage the underlying fever — though "
            "they do NOT prevent febrile seizure recurrence, they improve comfort and reduce "
            "fever burden. Diazepam (benzodiazepine — enhances GABA) as rescue rectal therapy "
            "is given to parents for home use if a prolonged seizure (>5 min) occurs. "
            "Prophylactic anticonvulsants are NOT recommended for simple febrile seizures as "
            "the recurrence risk (~30%) does not outweigh drug side effects."
        ),
        "follow_up": "Parent education: seizure first aid, recovery position. EEG only if complex features. Refer to neurology if recurrent.",
    },
    {
        "no": 7,
        "title": "Urinary Tract Infection (UTI)",
        "patient": "Age: 4 years | Sex: Female | Weight: 16 kg",
        "chief_complaint": "Dysuria, frequency, fever for 2 days",
        "history": (
            "Burning micturation, voiding every 30-45 minutes. Fever 38.5°C. No vomiting. "
            "No flank pain. First episode. No structural anomalies known."
        ),
        "examination": (
            "Temp 38.3°C. Suprapubic tenderness on palpation. No costovertebral angle "
            "tenderness. Urine dipstick: nitrites +, leukocyte esterase ++. "
            "Urine culture pending."
        ),
        "diagnosis": "Lower Urinary Tract Infection (cystitis)",
        "prescription": [
            ("Trimethoprim-sulfamethoxazole 8/40 mg/kg/day", "Syrup — 10 mL (80/400 mg) twice daily × 7 days"),
            ("Nitrofurantoin 5-7 mg/kg/day", "Alternative: 25 mg/5 mL — 8 mL three times daily × 5 days"),
            ("Paracetamol 15 mg/kg/dose", "For fever/dysuria — 16 mL syrup every 6h PRN"),
            ("Oral fluids — increase water intake", "Encourage 6-8 glasses of water/day"),
        ],
        "reasons": (
            "Co-trimoxazole covers E. coli (most common uropathogen in girls) at good urinary "
            "concentrations. Nitrofurantoin is an alternative with less resistance but NOT used "
            "if pyelonephritis is suspected (poor tissue penetration). Increased fluid intake "
            "promotes urinary flushing. Urine culture guides de-escalation or escalation of therapy."
        ),
        "follow_up": "Urine culture result in 48-72h — adjust antibiotic accordingly. Renal USS + VCUG after first UTI in child <5 years (NICE).",
    },
    {
        "no": 8,
        "title": "Chickenpox (Varicella)",
        "patient": "Age: 5 years | Sex: Male | Weight: 18 kg",
        "chief_complaint": "Widespread itchy blistering rash for 2 days",
        "history": (
            "Started as papules on trunk, now vesicles on face, scalp, and extremities. "
            "Low-grade fever. Classmate had chickenpox 2 weeks ago. No prior varicella vaccine. "
            "Not immunocompromised."
        ),
        "examination": (
            "Temp 37.9°C. Multiple vesicles on erythematous base in various stages "
            "('dew drops on a rose petal'). Lesions on scalp, trunk, face. No crusting yet. "
            "No pneumonia signs. No encephalopathy."
        ),
        "diagnosis": "Varicella (Chickenpox) — uncomplicated",
        "prescription": [
            ("Chlorphenamine (Chlorpheniramine) 0.1 mg/kg/dose", "2 mg/5 mL — 4.5 mL three times daily for pruritus"),
            ("Calamine lotion", "Apply topically to lesions four times daily — soothing, antipruritic"),
            ("Paracetamol 15 mg/kg/dose", "For fever — 15 mL (120 mg/5 mL) every 6h PRN. AVOID ASPIRIN (Reye's syndrome)"),
            ("Acyclovir 20 mg/kg/dose (max 800 mg)", "4 puffs — only if high risk: start within 24h of rash onset × 5 days. Not routinely given."),
        ],
        "reasons": (
            "Chlorphenamine (H1 antihistamine) reduces pruritus, preventing secondary bacterial "
            "infection from scratching. Calamine lotion soothes the skin and dries vesicles. "
            "Paracetamol used for fever — ASPIRIN IS ABSOLUTELY CONTRAINDICATED (risk of Reye's "
            "syndrome). Acyclovir (nucleoside analogue — inhibits VZV DNA polymerase) reserved "
            "for immunocompromised, severe disease, secondary cases, or >12 years old."
        ),
        "follow_up": "Isolate until all lesions crusted (~7 days). Vaccinate healthy contacts within 72-120h (post-exposure prophylaxis).",
    },
    {
        "no": 9,
        "title": "Allergic Rhinitis",
        "patient": "Age: 9 years | Sex: Female | Weight: 28 kg",
        "chief_complaint": "Chronic nasal discharge, sneezing, nasal itch for 6 months",
        "history": (
            "Perennial symptoms — worse with dust, pets. Watery rhinorrhoea, nasal itch, "
            "sneezing fits in the morning. Rubbing nose upward ('allergic salute'). "
            "FH: father has asthma. No nasal polyps."
        ),
        "examination": (
            "Pale, bluish nasal mucosa. Clear watery discharge. Infraorbital darkening "
            "(allergic shiners). Transverse nasal crease. Normal ears. No wheeze."
        ),
        "diagnosis": "Moderate-Severe Persistent Allergic Rhinitis",
        "prescription": [
            ("Cetirizine 5 mg", "1 tablet (5 mg) once daily at bedtime — non-sedating H1 antihistamine"),
            ("Fluticasone propionate nasal spray 50 mcg", "1 spray each nostril once daily — intranasal corticosteroid (first-line for moderate-severe AR)"),
            ("Saline nasal rinse", "Isotonic saline — 2 sprays each nostril twice daily to clear allergens"),
        ],
        "reasons": (
            "Cetirizine (2nd-gen H1 antihistamine) blocks histamine receptors, relieving "
            "sneezing, itch, and rhinorrhoea with minimal sedation. Intranasal fluticasone "
            "is the most effective treatment for moderate-severe AR — reduces all nasal symptoms "
            "including congestion (which antihistamines do poorly). Saline irrigation physically "
            "clears allergens and mucus from nasal passages."
        ),
        "follow_up": "Allergen avoidance advice (mattress covers, HEPA filters). Consider allergen immunotherapy if inadequate control after 3 months.",
    },
    {
        "no": 10,
        "title": "Acute Bronchiolitis",
        "patient": "Age: 7 months | Sex: Male | Weight: 7 kg",
        "chief_complaint": "Wheezing, rapid breathing, and difficulty feeding for 2 days",
        "history": (
            "Preceded by runny nose and mild cough for 3 days (viral prodrome). "
            "Progressive tachypnoea. Difficulty latching during feeds. "
            "No prior wheeze. November presentation. Father has a cold."
        ),
        "examination": (
            "Temp 37.5°C, RR 52/min, SpO2 93% on room air, HR 148/min. "
            "Subcostal retractions. Fine end-inspiratory crackles and wheeze bilaterally. "
            "Hyperinflated chest. RSV rapid test positive."
        ),
        "diagnosis": "Acute Viral Bronchiolitis (RSV) — moderate severity",
        "prescription": [
            ("Supplemental O2 via nasal prongs", "To maintain SpO2 ≥94%. Flow 1-2 L/min"),
            ("Nasogastric feeds / thickened feeds", "Small frequent feeds if oral feeding difficult — 100-120 mL/kg/day"),
            ("Hypertonic saline 3% nebulisation", "4 mL nebulised three times daily — reduces mucosal oedema"),
            ("Paracetamol 15 mg/kg/dose", "For fever if temp >38.5°C — 3.5 mL syrup every 6h"),
        ],
        "reasons": (
            "Bronchiolitis management is SUPPORTIVE. Bronchodilators, steroids, and antibiotics "
            "are NOT routinely recommended (no consistent benefit in RCTs). Oxygen corrects "
            "hypoxaemia from V/Q mismatch. Hypertonic saline reduces airway oedema by osmotic "
            "effect. Small NG feeds prevent fatigue from tachypnoea affecting oral feeding. "
            "Admission warranted given SpO2 <94%."
        ),
        "follow_up": "Monitor SpO2 continuously. Discharge when SpO2 ≥94% on room air and feeding adequately.",
    },
    {
        "no": 11,
        "title": "Constipation",
        "patient": "Age: 5 years | Sex: Male | Weight: 19 kg",
        "chief_complaint": "Hard, painful stools every 4-5 days for 3 months",
        "history": (
            "Withholding behaviour, stool-smearing. Painful defaecation, occasional blood-streaking "
            "from anal fissure. Poor fruit/fibre intake. No organic cause suspected. "
            "Previous episode resolved with increased fluids."
        ),
        "examination": (
            "Mild abdominal distension. Palpable faecal mass in left iliac fossa. "
            "Anal fissure at 6 o'clock. No spina bifida. No hypothyroidism signs."
        ),
        "diagnosis": "Functional Constipation with faecal loading",
        "prescription": [
            ("Macrogol (PEG 3350) — disimpaction", "6-12 sachets/day for 3-6 days (1 sachet in 62.5 mL water) to clear impaction"),
            ("Macrogol (PEG 3350) — maintenance", "Then 1-2 sachets once daily × 3-6 months (long-term maintenance)"),
            ("Lactulose 10 mL", "Osmotic laxative — twice daily if PEG not tolerated"),
            ("Petroleum jelly (Vaseline)", "Apply to anal fissure twice daily for lubrication and healing"),
        ],
        "reasons": (
            "PEG (polyethylene glycol) is an osmotic laxative — retains water in stool, "
            "making it softer and easier to pass. NICE and ESPGHAN recommend PEG as first-line "
            "for paediatric constipation. Disimpaction before maintenance is essential to "
            "break the pain-retention cycle. Maintenance for months is needed to retrain "
            "normal defaecation reflexes. Petroleum jelly soothes the fissure."
        ),
        "follow_up": "Dietary advice: increase fruit, vegetables, fluids. Toilet training schedule. Review in 4 weeks.",
    },
    {
        "no": 12,
        "title": "Scabies",
        "patient": "Age: 7 years | Sex: Female | Weight: 22 kg",
        "chief_complaint": "Intensely itchy rash, worse at night, for 3 weeks",
        "history": (
            "Itching involves web spaces of fingers, wrists, axillae. Siblings and parents "
            "also itching. School-going child. No prior treatment. Night-time itch is worse."
        ),
        "examination": (
            "Linear burrows in finger web spaces. Erythematous papules and excoriations on "
            "wrists, waistband area, axillae. Spares face. Some secondary impetiginisation."
        ),
        "diagnosis": "Scabies infestation with secondary bacterial infection",
        "prescription": [
            ("Permethrin 5% cream", "Apply from neck down to whole body, leave for 8-10 hours, wash off. Repeat after 7 days. Treat ALL household contacts simultaneously."),
            ("Chlorphenamine 0.1 mg/kg/dose", "2 mg/5 mL — 5 mL at bedtime for pruritus (itching may persist 2-4 weeks after treatment)"),
            ("Mupirocin 2% ointment", "Apply to impetiginised areas twice daily × 7 days (for secondary infection)"),
        ],
        "reasons": (
            "Permethrin 5% is the first-line scabicide — a synthetic pyrethroid that disrupts "
            "sodium channel function in Sarcoptes scabiei, causing paralysis and death. "
            "Treat whole household simultaneously to prevent reinfestation (a MUST). "
            "Itching post-treatment is due to dead mite antigens — chlorphenamine provides relief. "
            "Mupirocin covers Staph aureus secondary impetiginisation."
        ),
        "follow_up": "Wash all clothing/bedding in hot water. Oral ivermectin (200 mcg/kg) for crusted scabies or treatment failure.",
    },
    {
        "no": 13,
        "title": "Attention Deficit Hyperactivity Disorder (ADHD)",
        "patient": "Age: 8 years | Sex: Male | Weight: 26 kg",
        "chief_complaint": "Inattention, hyperactivity, and poor academic performance",
        "history": (
            "Cannot sit still in class, impulsive behaviour, easily distracted. "
            "Teachers report he does not complete tasks. Problems at home as well. "
            "DSM-5 criteria met. Developmental milestones normal. No seizures."
        ),
        "examination": (
            "Alert, fidgety, cannot maintain eye contact for long. Cognitively intact. "
            "Vanderbilt ADHD Rating Scale filled by parents and teachers — both positive. "
            "Normal neurological examination. Thyroid function normal."
        ),
        "diagnosis": "ADHD — Combined presentation",
        "prescription": [
            ("Methylphenidate IR 0.3-0.5 mg/kg/dose", "Ritalin 5 mg — 1 tablet in the morning and 1 at noon (school days). Start low, titrate up. Max 1 mg/kg/day."),
            ("Behavioural therapy", "Referral to child psychologist — parent training, cognitive behavioural therapy (CBT)"),
            ("Nutritional counselling", "Adequate breakfast before medication. Monitor growth (height, weight) monthly."),
        ],
        "reasons": (
            "Methylphenidate (CNS stimulant — blocks dopamine and noradrenaline reuptake in "
            "prefrontal cortex) is first-line pharmacological treatment for ADHD in school-age "
            "children. IR formulation given in morning and noon (not evening — causes insomnia). "
            "Combination of medication + behavioural therapy is superior to either alone. "
            "Monthly growth monitoring because stimulants can suppress appetite and growth velocity."
        ),
        "follow_up": "Annual drug holidays (summer) to assess if medication still needed. Monitor blood pressure and heart rate.",
    },
    {
        "no": 14,
        "title": "Acute Conjunctivitis (Bacterial)",
        "patient": "Age: 3 years | Sex: Female | Weight: 14 kg",
        "chief_complaint": "Red, sticky eye with yellow discharge for 3 days",
        "history": (
            "Right eye initially, now both eyes. Discharge worst in morning — 'eyes stuck shut'. "
            "No photophobia, no vision change. Sibling had same illness last week."
        ),
        "examination": (
            "Bilateral conjunctival injection. Mucopurulent discharge. Lids matted. "
            "No corneal opacity. No periorbital swelling. No proptosis."
        ),
        "diagnosis": "Acute bacterial conjunctivitis",
        "prescription": [
            ("Chloramphenicol 0.5% eye drops", "1-2 drops in each eye every 2 hours for first 2 days, then 4 times daily × 5 days total"),
            ("Tobramycin 0.3% eye drops", "Alternative — 1 drop 4 times daily × 5-7 days if chloramphenicol unavailable"),
            ("Warm water lid cleaning", "Gently clean matted lids with warm sterile gauze 2-3 times daily"),
        ],
        "reasons": (
            "Topical chloramphenicol covers the most common pathogens in paediatric bacterial "
            "conjunctivitis (S. aureus, H. influenzae, S. pneumoniae). It is broad-spectrum, "
            "well-tolerated, and the standard first-line in most paediatric guidelines. "
            "Frequent initial dosing achieves therapeutic concentrations faster. "
            "Lid hygiene removes discharge that would otherwise inactivate drops."
        ),
        "follow_up": "Exclude from school until discharge ceases. Hand hygiene education. If worsening or corneal involvement — urgent ophthalmology referral.",
    },
    {
        "no": 15,
        "title": "Worm Infestation (Intestinal Helminths)",
        "patient": "Age: 5 years | Sex: Male | Weight: 17 kg",
        "chief_complaint": "Perianal itching, irritability, disturbed sleep",
        "history": (
            "Scratching perianal area, especially at night. Mother noticed small white "
            "thread-like worms in stool. Poor weight gain. Lives in rural area with "
            "poor sanitation. Plays barefoot."
        ),
        "examination": (
            "Perianal excoriation. Mild pallor. Normal abdomen. Tape test positive "
            "for Enterobius ova. Stool examination: Enterobius + Ascaris ova."
        ),
        "diagnosis": "Mixed intestinal helminthiasis (Enterobius + Ascaris)",
        "prescription": [
            ("Mebendazole 100 mg", "1 tablet twice daily × 3 days (for Ascaris, hookworm, Trichuris). Repeat after 2 weeks."),
            ("Albendazole 400 mg", "Single dose (alternative — broad-spectrum, single dose advantage). Can use either mebendazole or albendazole."),
            ("Iron supplements", "Ferrous syrup 5 mg elemental iron/kg/day if anaemia confirmed"),
        ],
        "reasons": (
            "Mebendazole/albendazole are benzimidazoles — inhibit tubulin polymerisation in "
            "helminths, impairing glucose uptake and causing worm death. Single-dose albendazole "
            "preferred in mass drug administration campaigns. Repeat dose in 2 weeks eliminates "
            "newly hatched worms. Iron supplements correct anaemia from hookworm-related blood "
            "loss. Treat ALL household members simultaneously."
        ),
        "follow_up": "Footwear, hand hygiene, clean water. Deworm every 6 months (WHO recommendation in endemic areas).",
    },
    {
        "no": 16,
        "title": "Neonatal Jaundice (Physiological)",
        "patient": "Age: 4 days old | Sex: Male | Weight: 3.1 kg",
        "chief_complaint": "Yellow discolouration of skin and eyes since day 2",
        "history": (
            "Term neonate, vaginal delivery. Exclusively breastfed. Jaundice appeared day 2. "
            "Feeding well, active, good weight gain. Mother blood group O+, baby A+. "
            "No family history of haemolytic disease."
        ),
        "examination": (
            "Alert neonate. Jaundice extending to chest (Kramer zone 2). No lethargy, "
            "no arching. Total serum bilirubin (TSB) 14 mg/dL at 96 hours of life. "
            "Transcutaneous bilirubin confirms — above intermediate risk zone but below "
            "phototherapy threshold on AAP nomogram."
        ),
        "diagnosis": "Physiological Neonatal Jaundice — close monitoring zone",
        "prescription": [
            ("Frequent breastfeeding", "8-12 feeds per 24h — ensure adequate hydration and bilirubin elimination via stool"),
            ("Phototherapy (if threshold reached)", "Conventional or LED phototherapy — irradiance ≥30 mW/cm²/nm if TSB crosses phototherapy line"),
            ("Repeat TSB in 24 hours", "Monitor bilirubin trend — arrange follow-up TSB tomorrow"),
        ],
        "reasons": (
            "Physiological jaundice results from high neonatal haemoglobin breakdown + immature "
            "hepatic conjugation (low UGT1A1). Frequent feeds stimulate gut motility, reducing "
            "enterohepatic recirculation of bilirubin. Phototherapy converts unconjugated bilirubin "
            "to water-soluble lumirubin (via photo-isomerisation), which is excreted in bile "
            "and urine without conjugation. AAP nomogram guides phototherapy thresholds."
        ),
        "follow_up": "Return immediately if baby becomes lethargic, poor feeding, or high-pitched cry (kernicterus warning signs).",
    },
    {
        "no": 17,
        "title": "Allergic Contact Dermatitis / Eczema",
        "patient": "Age: 2 years | Sex: Female | Weight: 12 kg",
        "chief_complaint": "Dry, itchy, red skin on cheeks and flexures since 6 months",
        "history": (
            "Onset at 3 months. Worse in winter. Exacerbated by soap, synthetic fabrics. "
            "FH: mother has allergic asthma, father has hay fever (atopic triad). "
            "No food triggers identified clearly."
        ),
        "examination": (
            "Bilateral cheek erythema, lichenification of antecubital fossae, dry skin "
            "over trunk. SCORAD score 32 (moderate). No weeping or secondary infection."
        ),
        "diagnosis": "Moderate Atopic Dermatitis (Eczema)",
        "prescription": [
            ("Emollient — Cetomacrogol/Aqueous cream", "Apply liberally to whole body 2-3 times daily, especially after bathing (emollient therapy is the cornerstone)"),
            ("Hydrocortisone 1% cream", "Apply thin layer to RED/inflamed areas twice daily × 7 days (mild-potency TCS for face and flexures in children)"),
            ("Cetirizine 2.5 mg", "0.25 mg/kg/day — 0.5 mL at bedtime (reduces nocturnal itch)"),
            ("Aqueous cream bath emollient", "Add to bathwater; avoid soap/bubble bath"),
        ],
        "reasons": (
            "Emollients restore the skin barrier (filaggrin deficiency in atopic skin), reduce "
            "transepidermal water loss, and are the primary treatment for eczema. Topical "
            "corticosteroids (TCS) suppress inflammatory cytokine cascade in acute flares. "
            "Hydrocortisone 1% is the mildest potency — appropriate for sensitive areas "
            "(face, flexures) in toddlers to prevent skin atrophy. Cetirizine reduces itch "
            "at night and improves sleep quality."
        ),
        "follow_up": "Wet wrapping for severe flares. Avoid identified triggers. Refer to paediatric dermatology if SCORAD >40 or recurrent infections.",
    },
    {
        "no": 18,
        "title": "Type 1 Diabetes Mellitus — New Diagnosis",
        "patient": "Age: 10 years | Sex: Male | Weight: 30 kg",
        "chief_complaint": "Polyuria, polydipsia, weight loss for 4 weeks",
        "history": (
            "Frequent urination day and night, excessive thirst, eating well but losing weight. "
            "No family history of T1DM. No vomiting (not in DKA at presentation). "
            "Random blood glucose 22 mmol/L (396 mg/dL). HbA1c 11.2%."
        ),
        "examination": (
            "Alert, not dehydrated, not acidotic. Wt 30 kg (lost 3 kg in 4 weeks). "
            "No Kussmaul breathing. Random BG 22 mmol/L. Urine: glucose +++, ketones +. "
            "C-peptide low. GAD antibodies positive."
        ),
        "diagnosis": "New-onset Type 1 Diabetes Mellitus (without DKA)",
        "prescription": [
            ("Insulin Glargine (Lantus) 0.2-0.4 U/kg/day", "6-8 units subcutaneously at bedtime — basal insulin"),
            ("Insulin Aspart (NovoRapid) 0.1 U/kg/meal", "3-4 units SC with each main meal — bolus insulin (basal-bolus regimen)"),
            ("Glucose monitoring", "Check blood glucose 4 times daily (before each meal and at bedtime). Target 4-10 mmol/L."),
            ("Glucagon emergency kit", "Teach parents to administer 0.5 mg IM/SC if severe hypoglycaemia + unconsciousness"),
        ],
        "reasons": (
            "T1DM requires exogenous insulin as beta cells are destroyed by autoimmunity — no "
            "endogenous insulin production. Basal-bolus regimen mimics physiological insulin "
            "secretion: glargine (long-acting) provides basal coverage; aspart (rapid-acting) "
            "covers post-meal glucose spikes. Starting dose 0.5 U/kg/day is typical for honeymoon "
            "phase. Glucagon kit essential for hypoglycaemic emergencies. ISPAD guidelines "
            "recommend immediate specialist referral for all new T1DM in children."
        ),
        "follow_up": "Refer to paediatric endocrinology. Diabetes nurse educator + dietitian input essential. HbA1c every 3 months (target <7%).",
    },
    {
        "no": 19,
        "title": "Acute Epiglottitis",
        "patient": "Age: 4 years | Sex: Female | Weight: 16 kg",
        "chief_complaint": "High fever, drooling, stridor, and 'hot potato voice' for 6 hours",
        "history": (
            "Abrupt onset high fever (40°C). Prefers to sit in tripod position. "
            "Refusal to swallow. Drooling. Inspiratory stridor. Not fully vaccinated "
            "(missed Hib doses). Rapidly worsening."
        ),
        "examination": (
            "ALERT: Do NOT attempt to examine throat or lay child flat — may precipitate "
            "complete obstruction. Child sitting forward, drooling, toxic-looking. "
            "Soft inspiratory stridor. SpO2 95% on air. WBC 22,000 (neutrophilia)."
        ),
        "diagnosis": "Acute Epiglottitis (Haemophilus influenzae type b likely)",
        "prescription": [
            ("EMERGENCY: Secure airway first", "Anaesthesia + ENT present — intubation in theatre if needed. NEVER send for X-ray alone."),
            ("Ceftriaxone 100 mg/kg/day IV", "1600 mg (100 mg/kg) IV once daily × 7-10 days (covers Hib)"),
            ("Dexamethasone 0.6 mg/kg IV", "Single dose 10 mg IV — reduces supraglottic oedema"),
            ("Supplemental O2", "High-flow O2 via mask while preparing for intubation"),
        ],
        "reasons": (
            "Epiglottitis is a life-threatening emergency — the swollen epiglottis can cause "
            "complete airway obstruction within minutes. Airway management is the absolute "
            "priority BEFORE antibiotics. Ceftriaxone is a 3rd-gen cephalosporin with excellent "
            "Hib coverage. Dexamethasone reduces oedema. The 'do not disturb the child' rule "
            "prevents sudden complete obstruction from vagal stimulation. Hib vaccine has "
            "dramatically reduced incidence — unvaccinated children remain at risk."
        ),
        "follow_up": "ICU admission. Blood cultures. Complete Hib vaccination schedule after recovery.",
    },
    {
        "no": 20,
        "title": "Measles (Rubeola)",
        "patient": "Age: 3 years | Sex: Male | Weight: 13 kg",
        "chief_complaint": "High fever, cough, conjunctivitis, and rash for 3 days",
        "history": (
            "Prodrome of 3C's: Cough, Coryza, Conjunctivitis for 3 days then rash appeared "
            "behind ears, spreading downward. Not vaccinated (MMR). Sibling also unwell."
        ),
        "examination": (
            "Temp 39.8°C. Maculopapular rash from face to trunk, not reaching palms. "
            "Koplik's spots on buccal mucosa (white spots on red base). "
            "Bilateral conjunctival injection. Photophobia."
        ),
        "diagnosis": "Measles (Rubeola) — uncomplicated",
        "prescription": [
            ("Vitamin A 200,000 IU", "Day 1: 200,000 IU orally × 2 consecutive days (WHO recommendation for all children with measles in developing countries)"),
            ("Paracetamol 15 mg/kg/dose", "Syrup for fever — 10 mL every 6 hours PRN"),
            ("ORS", "Maintain hydration — 50-100 mL/kg ORS if any diarrhoea"),
            ("Antibiotic if secondary bacterial pneumonia", "Amoxicillin 40 mg/kg/day × 5 days if lower respiratory signs develop"),
        ],
        "reasons": (
            "Vitamin A supplementation reduces measles mortality by 50-80% in developing "
            "countries (WHO, Cochrane evidence) — measles causes vitamin A depletion, leading "
            "to corneal ulceration and blindness. High-dose vitamin A reduces complications "
            "(pneumonia, diarrhoea). No specific antiviral exists for measles. Supportive "
            "care (fluids, antipyretics) is the mainstay. Antibiotics only for proven "
            "secondary bacterial superinfection."
        ),
        "follow_up": "Notify public health authority. Isolate for 4 days after rash onset. Vaccinate household contacts within 72h (MMR).",
    },
    {
        "no": 21,
        "title": "Acute Appendicitis",
        "patient": "Age: 10 years | Sex: Male | Weight: 32 kg",
        "chief_complaint": "Right iliac fossa pain, fever, nausea for 24 hours",
        "history": (
            "Pain started periumbilically, migrated to RIF over 12 hours (classic migration). "
            "Nausea and one episode of vomiting. Low-grade fever. Loss of appetite. "
            "No diarrhoea. No urinary symptoms."
        ),
        "examination": (
            "Temp 38.1°C. Guarding and tenderness at McBurney's point. Rebound tenderness +. "
            "Rovsing's sign +. Psoas sign +. Alvarado score 8/10. WBC 15,000 (neutrophilia). "
            "USS: non-compressible appendix 8 mm diameter."
        ),
        "diagnosis": "Acute appendicitis (surgical emergency)",
        "prescription": [
            ("IV Cefuroxime + Metronidazole", "Cefuroxime 30 mg/kg IV every 8h + Metronidazole 7.5 mg/kg IV every 8h (pre-op and post-op)"),
            ("IV fluid resuscitation", "0.9% NaCl 20 mL/kg bolus, then maintenance Hartmann's solution"),
            ("Morphine 0.1 mg/kg IV PRN", "For pain — 3.2 mg IV. Note: adequate analgesia does NOT mask peritonitis signs in modern practice"),
            ("NBM + surgical referral", "Nil by mouth, urgent paediatric surgery for laparoscopic appendicectomy"),
        ],
        "reasons": (
            "Acute appendicitis is primarily a surgical diagnosis requiring appendicectomy. "
            "Pre-operative antibiotics (cefuroxime covers Gram-positives; metronidazole covers "
            "anaerobes and Gram-negatives) reduce post-operative wound infection and peritonitis. "
            "IV fluids correct dehydration from vomiting. Adequate morphine analgesia is now "
            "the standard of care — the old practice of withholding analgesia has been abandoned. "
            "Laparoscopic approach has less morbidity than open surgery."
        ),
        "follow_up": "Post-op IV antibiotics for 24h (uncomplicated) or 3-5 days (perforated). Wound review at 1 week.",
    },
    {
        "no": 22,
        "title": "Infantile Colic",
        "patient": "Age: 6 weeks old | Sex: Female | Weight: 4.5 kg",
        "chief_complaint": "Inconsolable crying, especially evening, for 3 weeks",
        "history": (
            "Crying >3 hours/day, >3 days/week for >3 weeks (Wessel's rule of 3). "
            "Crying starts at 6 PM, legs drawn up. Breast and formula fed. "
            "Good weight gain, normal stools. No vomiting. Parents very anxious."
        ),
        "examination": (
            "Alert, well-nourished neonate. Normal abdomen — no distension, no masses. "
            "Normal examination. Normal weight gain chart. No fever. No hernia."
        ),
        "diagnosis": "Infantile Colic — functional (Rome IV criteria)",
        "prescription": [
            ("Simethicone drops (Infacol/Mylicon)", "0.3 mL after each feed up to 3 times daily — reduces gas bubbles (limited evidence but safe)"),
            ("Probiotic — Lactobacillus reuteri", "5 drops once daily × 4 weeks — evidence supports reduction in crying time in breastfed infants"),
            ("Parental reassurance and support", "Explain the condition is benign and self-limiting (resolves by 3-4 months). Provide skin-to-skin, gentle rocking advice."),
        ],
        "reasons": (
            "Infantile colic is a functional condition — no structural or organic cause. "
            "Simethicone reduces intestinal gas surface tension (anti-flatulent). "
            "L. reuteri DSM 17938 has RCT evidence showing significant reduction in crying "
            "time in breastfed infants with colic (Savino 2010, Pärtty 2018). "
            "Parental reassurance is the most important intervention — parental anxiety "
            "and burnout are the main clinical concerns. The condition is completely self-limiting."
        ),
        "follow_up": "Rule out organic causes (intussusception, hernia, NAI) if pattern changes or exam abnormal. Reassess at 8-week check.",
    },
    {
        "no": 23,
        "title": "Vitamin D Deficiency Rickets",
        "patient": "Age: 18 months | Sex: Male | Weight: 9 kg",
        "chief_complaint": "Bowing of legs noticed when child started walking",
        "history": (
            "Exclusively breastfed beyond 6 months without supplementation. Limited sun "
            "exposure (indoors, full-body clothing). Dietary calcium adequate. No seizures. "
            "Growth faltering noted on centile chart."
        ),
        "examination": (
            "Genu varum (bow legs). Widened wrists and costochondral junctions (rachitic rosary). "
            "Frontal bossing. Delayed anterior fontanelle closure. "
            "Serum 25-OHD: 7 ng/mL. Calcium 8.1, Phosphorus low, ALP markedly elevated."
        ),
        "diagnosis": "Nutritional Vitamin D Deficiency Rickets",
        "prescription": [
            ("Vitamin D3 (Cholecalciferol) 3000-6000 IU/day", "Stoss therapy or daily: 3000 IU drops once daily for 3 months (loading dose for rickets)"),
            ("Calcium 500 mg/day", "Calcium carbonate syrup — 500 mg elemental calcium daily in divided doses (essential to prevent 'hungry bone' during healing)"),
            ("Maintenance after healing", "400-800 IU Vitamin D daily lifelong supplementation"),
        ],
        "reasons": (
            "Vitamin D3 is converted to active calcitriol (1,25-dihydroxyvitamin D) which "
            "promotes intestinal calcium and phosphate absorption, and bone mineralisation. "
            "High-dose therapy for rickets rapidly restores serum 25-OHD and allows bone "
            "remineralisation. Calcium supplementation is essential concurrently — rapid "
            "bone mineralisation ('hungry bone syndrome') can cause hypocalcaemia and seizures "
            "if calcium is not given. ALP will fall to normal as healing occurs."
        ),
        "follow_up": "Repeat 25-OHD and ALP at 3 months. X-ray wrist to document healing. Orthopaedic referral if bowing persists after biochemical cure.",
    },
    {
        "no": 24,
        "title": "Nephrotic Syndrome",
        "patient": "Age: 5 years | Sex: Male | Weight: 20 kg",
        "chief_complaint": "Facial puffiness on waking, abdominal distension, leg swelling for 2 weeks",
        "history": (
            "Periorbital oedema worse in the morning. Frothy urine. Normal urine output. "
            "No haematuria. No recent URTI. No prior episodes."
        ),
        "examination": (
            "Periorbital and pedal pitting oedema. Ascites. BP 100/60 (normal). "
            "Urine dipstick: protein ++++. Serum albumin 1.6 g/dL (low). "
            "Total cholesterol 8.2 mmol/L (high). 24h urine protein >40 mg/m²/hour."
        ),
        "diagnosis": "Nephrotic Syndrome — likely Minimal Change Disease (steroid-sensitive)",
        "prescription": [
            ("Prednisolone 60 mg/m²/day (max 80 mg)", "20 mg twice daily × 4 weeks (induction — full daily dose), then 40 mg/m² on alternate days × 4 weeks (ISKDC protocol)"),
            ("Atorvastatin / dietary restriction", "Low-salt, low-fat diet. Statin not typically used in children unless prolonged hyperlipidaemia."),
            ("Prophylactic penicillin V", "Penicillin V 125 mg twice daily while oedematous — risk of Streptococcal peritonitis"),
            ("Aspirin 3-5 mg/kg/day (low dose)", "Only if severe oedema with high thrombosis risk — hypercoagulable state due to antithrombin III loss in urine"),
        ],
        "reasons": (
            "Prednisolone is the first-line treatment for nephrotic syndrome in children — "
            "80-90% of cases are steroid-sensitive Minimal Change Disease. Full daily dose "
            "followed by alternate-day tapering is the ISKDC-recommended protocol, achieving "
            "remission in most cases within 4 weeks. Penicillin prophylaxis prevents fatal "
            "spontaneous bacterial peritonitis (Strep. pneumoniae) while the child is "
            "oedematous and immunosuppressed. Thromboprophylaxis considered for high thrombosis risk."
        ),
        "follow_up": "Daily urine dipstick monitoring at home. If no remission at 4 weeks — consider biopsy, add levamisole or cyclophosphamide.",
    },
    {
        "no": 25,
        "title": "Hand, Foot, and Mouth Disease (HFMD)",
        "patient": "Age: 2 years | Sex: Female | Weight: 12 kg",
        "chief_complaint": "Fever, mouth sores, and blisters on hands and feet for 3 days",
        "history": (
            "Fever 38.5°C for 3 days. Refusing food due to painful oral ulcers. "
            "Vesicular lesions on palms, soles, and buttocks. Nursery setting — several "
            "other children affected. Mild drooling."
        ),
        "examination": (
            "Temp 38.2°C. Multiple small painful oral ulcers on tongue, buccal mucosa, "
            "and palate. Vesiculopapular lesions on palms (non-pruritic), soles, and "
            "interdigital spaces. Not dehydrated. No neck stiffness."
        ),
        "diagnosis": "Hand, Foot, and Mouth Disease (Enterovirus — Coxsackievirus A16)",
        "prescription": [
            ("Paracetamol 15 mg/kg/dose", "120 mg/5 mL — 9 mL every 6 hours for fever and pain"),
            ("Ibuprofen 10 mg/kg/dose", "100 mg/5 mL — 6 mL every 8 hours — alternating with paracetamol for better pain control"),
            ("Xylocaine viscous 2% (lignocaine)", "Small amount applied to oral ulcers before feeds for anaesthetic effect — use sparingly in children"),
            ("Cold soft diet + ORS", "Ice cream, yoghurt, cold fluids — reduces oral pain. ORS if reduced oral intake."),
        ],
        "reasons": (
            "HFMD is a self-limiting viral illness — NO specific antiviral exists. Management "
            "is entirely supportive. Paracetamol and ibuprofen alternate for superior antipyretic "
            "and analgesic effect. Oral lignocaine gel numbs ulcers, improving ability to feed "
            "(prevent dehydration). Cold soft foods reduce oral pain through local cooling. "
            "Exclude from nursery until lesions dry. Parents reassured it resolves in 7-10 days."
        ),
        "follow_up": "Warn about EV-A71 complications: encephalitis, myocarditis, pulmonary oedema — return if seizures, drowsiness, or rapid breathing.",
    },
    {
        "no": 26,
        "title": "Dengue Fever",
        "patient": "Age: 9 years | Sex: Male | Weight: 27 kg",
        "chief_complaint": "Sudden high fever, severe headache, body aches for 4 days",
        "history": (
            "Abrupt fever 39.5°C, severe retro-orbital headache, myalgia, arthralgia. "
            "Rash appeared on day 3 — maculopapular. Lives in dengue-endemic area. "
            "No bleeding. Tolerating oral fluids."
        ),
        "examination": (
            "Temp 39°C. Alert. Maculopapular rash with islands of sparing. "
            "Mild hepatomegaly. No bleeding manifestations. Tourniquet test negative. "
            "CBC: platelets 95,000/µL, haematocrit rising (42%), WBC 3,200 (leucopenia). "
            "NS1 antigen positive."
        ),
        "diagnosis": "Dengue Fever — WHO Grade A (no warning signs)",
        "prescription": [
            ("Paracetamol 15 mg/kg/dose", "15 mL syrup every 6 hours PRN — AVOID NSAIDs and ASPIRIN (increased bleeding risk)"),
            ("Oral rehydration", "Encourage 6-8 glasses water/day + ORS to maintain urine output >0.5 mL/kg/hr"),
            ("Daily platelet monitoring", "CBC every 24 hours to track platelet trend and haematocrit"),
        ],
        "reasons": (
            "Dengue has NO specific antiviral treatment. Management is supportive. "
            "Paracetamol is the ONLY safe antipyretic — NSAIDs (ibuprofen, aspirin) are "
            "absolutely contraindicated as they inhibit platelet function and increase GI "
            "bleeding risk, which is already elevated in dengue (thrombocytopaenia + "
            "vascular fragility). Aggressive oral hydration prevents dengue shock syndrome "
            "by maintaining intravascular volume despite plasma leakage."
        ),
        "follow_up": "Hospitalise if warning signs: abdominal pain, persistent vomiting, bleeding, rapid deterioration, or platelets <50,000. WHO warning signs protocol.",
    },
    {
        "no": 27,
        "title": "Mumps",
        "patient": "Age: 7 years | Sex: Female | Weight: 23 kg",
        "chief_complaint": "Painful swelling of jaw/cheek area and fever for 3 days",
        "history": (
            "Unilateral then bilateral parotid swelling. Earache. Fever 38.5°C. "
            "Difficulty chewing. Partial vaccination history (1 dose MMR). "
            "Several classmates affected."
        ),
        "examination": (
            "Bilateral parotid swelling — lifting earlobes. Tender on palpation. "
            "Redness at Stensen's duct opening. Temp 38.3°C. "
            "No neck stiffness. No testicular swelling."
        ),
        "diagnosis": "Mumps (Epidemic Parotitis)",
        "prescription": [
            ("Paracetamol 15 mg/kg/dose", "Syrup — 14 mL every 6 hours for pain and fever"),
            ("Ibuprofen 10 mg/kg/dose", "Alternate with paracetamol for pain relief — 11 mL every 8h"),
            ("Warm/cool compress to parotid", "Apply warm or cool packs to parotid area for comfort"),
            ("Soft diet", "Avoid chewing — soft foods, fluids, cold foods for comfort"),
        ],
        "reasons": (
            "Mumps is a self-limiting viral illness (paramyxovirus) with no specific antiviral "
            "treatment. Management is entirely symptomatic. Paracetamol and ibuprofen alternate "
            "for better analgesia and fever control. Soft diet reduces masticatory pain. "
            "Warm/cool compresses reduce parotid discomfort. Monitor for complications: "
            "orchitis (post-pubertal males), meningitis, encephalitis, pancreatitis. "
            "Second MMR dose after recovery."
        ),
        "follow_up": "Exclude from school for 5 days from parotid swelling onset. Report to public health. Check hearing (sensorineural deafness is a rare complication).",
    },
    {
        "no": 28,
        "title": "Cerebral Palsy — Spastic Diplegia",
        "patient": "Age: 3 years | Sex: Male | Weight: 13 kg",
        "chief_complaint": "Not walking independently, stiff legs, toe-walking",
        "history": (
            "Preterm birth at 28 weeks, birth weight 1.1 kg. NICU stay 8 weeks. "
            "Periventricular leukomalacia (PVL) on neonatal USS. Delayed motor milestones. "
            "Scissor gait. Intellectual development relatively normal."
        ),
        "examination": (
            "Spastic lower limbs. Increased tone and brisk reflexes bilaterally. "
            "Clonus at ankles. Toe-walking. Scissor gait. GMFCS Level III. "
            "No visual or hearing concerns. MRI: PVL."
        ),
        "diagnosis": "Cerebral Palsy — Spastic Diplegia (GMFCS III)",
        "prescription": [
            ("Baclofen 5 mg", "Start 2.5 mg twice daily, titrate to 5 mg three times daily (muscle relaxant for spasticity)"),
            ("Physiotherapy referral", "Intensive physiotherapy — stretching, gait training, 3-5 sessions/week"),
            ("Botulinum toxin A injection", "4 U/kg per muscle group (gastrocnemii) — for focal lower limb spasticity, reduces tone for 3-6 months"),
            ("Ankle-foot orthoses (AFOs)", "Custom-made AFOs to maintain ankle dorsiflexion and prevent contractures"),
        ],
        "reasons": (
            "Baclofen (GABA-B agonist) reduces spasticity by inhibiting excitatory neurotransmission "
            "at spinal cord level. Physiotherapy is the cornerstone of CP management — prevents "
            "contractures and improves function. Botulinum toxin A blocks acetylcholine release "
            "at the neuromuscular junction, causing temporary focal muscle paralysis/relaxation — "
            "particularly effective for equinus deformity. AFOs maintain joint position and "
            "improve gait mechanics. Multidisciplinary team approach is essential."
        ),
        "follow_up": "MDT review quarterly. GMFCS reassessment. School inclusion support. Consider intrathecal baclofen pump if oral dose insufficient.",
    },
]

# ── PDF generation ────────────────────────────────────────────────────────────
output_path = "/home/daytona/workspace/peds-opd/Paediatric_OPD_Cases.pdf"

doc = SimpleDocTemplate(
    output_path,
    pagesize=A4,
    leftMargin=1.8*cm,
    rightMargin=1.8*cm,
    topMargin=2*cm,
    bottomMargin=2*cm,
)

styles = getSampleStyleSheet()

# Custom styles
title_style = ParagraphStyle(
    "MainTitle",
    parent=styles["Title"],
    fontSize=22,
    textColor=DARK_BLUE,
    spaceAfter=4,
    alignment=TA_CENTER,
    fontName="Helvetica-Bold",
)
sub_title_style = ParagraphStyle(
    "SubTitle",
    parent=styles["Normal"],
    fontSize=12,
    textColor=MID_BLUE,
    spaceAfter=8,
    alignment=TA_CENTER,
    fontName="Helvetica",
)
disclaimer_style = ParagraphStyle(
    "Disclaimer",
    parent=styles["Normal"],
    fontSize=8.5,
    textColor=DARK_GREY,
    spaceAfter=4,
    alignment=TA_CENTER,
    fontName="Helvetica-Oblique",
)
case_header_style = ParagraphStyle(
    "CaseHeader",
    parent=styles["Normal"],
    fontSize=13,
    textColor=WHITE,
    spaceAfter=0,
    spaceBefore=0,
    leading=16,
    fontName="Helvetica-Bold",
    leftIndent=6,
)
section_label = ParagraphStyle(
    "SectionLabel",
    parent=styles["Normal"],
    fontSize=8.5,
    textColor=MID_BLUE,
    spaceAfter=1,
    spaceBefore=6,
    fontName="Helvetica-Bold",
    leading=11,
)
body_style = ParagraphStyle(
    "BodyText",
    parent=styles["Normal"],
    fontSize=9.5,
    textColor=DARK_GREY,
    spaceAfter=4,
    leading=13,
    fontName="Helvetica",
    alignment=TA_JUSTIFY,
)
reason_style = ParagraphStyle(
    "ReasonText",
    parent=styles["Normal"],
    fontSize=9.5,
    textColor=HexColor("#1B5E20"),
    spaceAfter=4,
    leading=13,
    fontName="Helvetica",
    alignment=TA_JUSTIFY,
)
followup_style = ParagraphStyle(
    "FollowUp",
    parent=styles["Normal"],
    fontSize=9.5,
    textColor=ORANGE,
    spaceAfter=4,
    leading=13,
    fontName="Helvetica-Oblique",
)
toc_item_style = ParagraphStyle(
    "TOCItem",
    parent=styles["Normal"],
    fontSize=10,
    textColor=DARK_BLUE,
    spaceAfter=3,
    leading=14,
    fontName="Helvetica",
)

def build_header_table(case):
    """Blue banner with case number and title"""
    header_data = [[
        Paragraph(f"Case {case['no']}   |   {case['title']}", case_header_style)
    ]]
    t = Table(header_data, colWidths=[doc.width])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), MID_BLUE),
        ("ROWBACKGROUNDS", (0, 0), (-1, -1), [MID_BLUE]),
        ("TOPPADDING", (0, 0), (-1, -1), 8),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 8),
        ("LEFTPADDING", (0, 0), (-1, -1), 10),
        ("RIGHTPADDING", (0, 0), (-1, -1), 10),
        ("ROUNDEDCORNERS", [4]),
    ]))
    return t

def build_patient_table(case):
    data = [[
        Paragraph(f"<b>Patient:</b>  {case['patient']}", body_style)
    ]]
    t = Table(data, colWidths=[doc.width])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), LIGHT_BLUE),
        ("TOPPADDING", (0, 0), (-1, -1), 6),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 6),
        ("LEFTPADDING", (0, 0), (-1, -1), 10),
        ("RIGHTPADDING", (0, 0), (-1, -1), 10),
    ]))
    return t

def build_rx_table(rx_list):
    """Prescription table"""
    table_data = [
        [
            Paragraph("<b>Drug / Dose</b>", ParagraphStyle("th", parent=body_style, textColor=WHITE, fontName="Helvetica-Bold", fontSize=9)),
            Paragraph("<b>Instruction</b>", ParagraphStyle("th", parent=body_style, textColor=WHITE, fontName="Helvetica-Bold", fontSize=9)),
        ]
    ]
    for i, (drug, instruction) in enumerate(rx_list):
        bg = GREY if i % 2 == 0 else WHITE
        table_data.append([
            Paragraph(drug, ParagraphStyle("td_drug", parent=body_style, fontName="Helvetica-Bold", fontSize=9, textColor=DARK_BLUE)),
            Paragraph(instruction, ParagraphStyle("td_inst", parent=body_style, fontSize=9, textColor=DARK_GREY)),
        ])
    col_widths = [doc.width * 0.38, doc.width * 0.62]
    t = Table(table_data, colWidths=col_widths)
    style = TableStyle([
        ("BACKGROUND", (0, 0), (-1, 0), DARK_BLUE),
        ("TOPPADDING", (0, 0), (-1, -1), 5),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
        ("LEFTPADDING", (0, 0), (-1, -1), 8),
        ("RIGHTPADDING", (0, 0), (-1, -1), 8),
        ("GRID", (0, 0), (-1, -1), 0.3, colors.HexColor("#BDBDBD")),
        ("VALIGN", (0, 0), (-1, -1), "TOP"),
    ])
    for i in range(1, len(table_data)):
        bg = GREY if i % 2 == 1 else WHITE
        style.add("BACKGROUND", (0, i), (-1, i), bg)
    t.setStyle(style)
    return t

def build_case_flowable(case):
    elements = []

    # Case header banner
    elements.append(build_header_table(case))
    elements.append(Spacer(1, 0.15*cm))

    # Patient info
    elements.append(build_patient_table(case))
    elements.append(Spacer(1, 0.1*cm))

    # Chief Complaint
    elements.append(Paragraph("CHIEF COMPLAINT", section_label))
    elements.append(Paragraph(case["chief_complaint"], body_style))

    # History
    elements.append(Paragraph("HISTORY", section_label))
    elements.append(Paragraph(case["history"], body_style))

    # Examination
    elements.append(Paragraph("EXAMINATION & INVESTIGATIONS", section_label))
    elements.append(Paragraph(case["examination"], body_style))

    # Diagnosis
    diag_style = ParagraphStyle(
        "Diag",
        parent=body_style,
        textColor=ACCENT,
        fontName="Helvetica-Bold",
        fontSize=10,
    )
    elements.append(Paragraph("DIAGNOSIS", section_label))
    elements.append(Paragraph(case["diagnosis"], diag_style))

    # Prescription
    elements.append(Paragraph("PRESCRIPTION", section_label))
    elements.append(build_rx_table(case["prescription"]))
    elements.append(Spacer(1, 0.1*cm))

    # Reasons
    reason_label = ParagraphStyle(
        "ReasonLabel",
        parent=section_label,
        textColor=GREEN,
    )
    elements.append(Paragraph("CLINICAL REASONING (Why this prescription?)", reason_label))
    reason_bg = Table(
        [[Paragraph(case["reasons"], reason_style)]],
        colWidths=[doc.width],
    )
    reason_bg.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), LIGHT_GREEN),
        ("TOPPADDING", (0, 0), (-1, -1), 7),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 7),
        ("LEFTPADDING", (0, 0), (-1, -1), 10),
        ("RIGHTPADDING", (0, 0), (-1, -1), 10),
        ("LINEABOVE", (0, 0), (-1, 0), 1.5, GREEN),
        ("LINEBELOW", (0, -1), (-1, -1), 1.5, GREEN),
    ]))
    elements.append(reason_bg)

    # Follow-up
    fu_label = ParagraphStyle("FULabel", parent=section_label, textColor=ORANGE)
    elements.append(Paragraph("FOLLOW-UP / NOTES", fu_label))
    fu_bg = Table(
        [[Paragraph(case["follow_up"], followup_style)]],
        colWidths=[doc.width],
    )
    fu_bg.setStyle(TableStyle([
        ("BACKGROUND", (0, 0), (-1, -1), LIGHT_ORANGE),
        ("TOPPADDING", (0, 0), (-1, -1), 6),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 6),
        ("LEFTPADDING", (0, 0), (-1, -1), 10),
        ("RIGHTPADDING", (0, 0), (-1, -1), 10),
        ("LINEABOVE", (0, 0), (-1, 0), 1.5, ORANGE),
        ("LINEBELOW", (0, -1), (-1, -1), 1.5, ORANGE),
    ]))
    elements.append(fu_bg)
    elements.append(Spacer(1, 0.5*cm))

    return elements


# ── Assemble full document ────────────────────────────────────────────────────
story = []

# Cover page
story.append(Spacer(1, 2*cm))
story.append(Paragraph("Paediatric OPD Case Studies", title_style))
story.append(Paragraph("Prescriptions with Clinical Reasoning", sub_title_style))
story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width=doc.width, thickness=2, color=MID_BLUE))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
    "28 Practice Cases for Medical Students, Interns & Paediatric Residents",
    ParagraphStyle("CoverSub", parent=styles["Normal"], fontSize=12, textColor=DARK_GREY,
                   alignment=TA_CENTER, fontName="Helvetica", spaceAfter=4)
))
story.append(Spacer(1, 0.6*cm))

# Cover information box
cover_info = [
    ["Topics Covered"],
    ["Respiratory  |  Gastrointestinal  |  Infectious Diseases  |  Neurology"],
    ["Haematology  |  Endocrinology  |  Dermatology  |  Emergency Medicine"],
    ["Neonatology  |  Renal  |  Ophthalmology  |  ENT  |  Surgery  |  Nutrition"],
]
cover_table = Table(cover_info, colWidths=[doc.width])
cover_table.setStyle(TableStyle([
    ("BACKGROUND", (0, 0), (-1, 0), DARK_BLUE),
    ("BACKGROUND", (0, 1), (-1, -1), LIGHT_BLUE),
    ("TEXTCOLOR", (0, 0), (-1, 0), WHITE),
    ("TEXTCOLOR", (0, 1), (-1, -1), DARK_BLUE),
    ("FONTNAME", (0, 0), (-1, 0), "Helvetica-Bold"),
    ("FONTNAME", (0, 1), (-1, -1), "Helvetica"),
    ("FONTSIZE", (0, 0), (-1, 0), 12),
    ("FONTSIZE", (0, 1), (-1, -1), 10),
    ("ALIGN", (0, 0), (-1, -1), "CENTER"),
    ("TOPPADDING", (0, 0), (-1, -1), 8),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 8),
    ("GRID", (0, 0), (-1, -1), 0.5, MID_BLUE),
]))
story.append(cover_table)
story.append(Spacer(1, 0.8*cm))

story.append(Paragraph(
    "EDUCATIONAL USE ONLY — For Practice and Self-Study Purposes",
    disclaimer_style
))
story.append(Paragraph(
    "Doses are standard paediatric weight-based calculations. Always verify against current local guidelines, "
    "formularies (BNF for Children, WHO, local pharmacopoeia), and individual patient factors before prescribing. "
    "This document does not replace clinical training, supervised practice, or drug-specific prescribing information.",
    ParagraphStyle("Disc", parent=styles["Normal"], fontSize=8, textColor=HexColor("#757575"),
                   alignment=TA_JUSTIFY, fontName="Helvetica-Oblique", spaceAfter=4)
))
story.append(Spacer(1, 1*cm))

# TOC
story.append(HRFlowable(width=doc.width, thickness=1, color=LIGHT_BLUE))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("Table of Contents", ParagraphStyle(
    "TOCH", parent=styles["Heading1"], fontSize=13, textColor=DARK_BLUE,
    fontName="Helvetica-Bold", spaceAfter=6
)))
for c in cases:
    story.append(Paragraph(
        f"Case {c['no']:02d} — {c['title']}",
        toc_item_style
    ))

story.append(PageBreak())

# All cases
for case in cases:
    elems = build_case_flowable(case)
    story.extend(elems)
    story.append(HRFlowable(width=doc.width, thickness=0.5, color=LIGHT_BLUE))
    story.append(Spacer(1, 0.3*cm))

# Build
doc.build(story)
print(f"PDF generated: {output_path}")
Running Command

cd /home/daytona/workspace/peds-opd && python generate_peds_cases.py 2>&1

Running Command

ls -lh /home/daytona/workspace/peds-opd/Paediatric_OPD_Cases.pdf

The PDF has been generated successfully (72 KB). Here's your download link:

Paediatric OPD Cases

PDF Document · PDF


What's inside the PDF

The document contains 28 Paediatric OPD cases across a wide range of specialties, each structured as a full clinical encounter:
#CaseSystem
1Acute Otitis MediaENT
2Streptococcal PharyngotonsillitisENT / Infectious
3Bronchial Asthma (Mild Intermittent)Respiratory
4Acute Gastroenteritis + Mild DehydrationGIT
5Iron Deficiency AnaemiaHaematology / Nutrition
6Febrile Seizure (Simple)Neurology
7Urinary Tract InfectionRenal / Urology
8Chickenpox (Varicella)Infectious / Dermatology
9Allergic RhinitisENT / Allergy
10Acute Bronchiolitis (RSV)Respiratory
11Constipation (Functional)GIT
12ScabiesDermatology / Infectious
13ADHDNeurodevelopment
14Bacterial ConjunctivitisOphthalmology
15Intestinal Worm InfestationInfectious / GIT
16Neonatal Jaundice (Physiological)Neonatology
17Atopic Dermatitis / EczemaDermatology
18Type 1 Diabetes Mellitus (new diagnosis)Endocrinology
19Acute Epiglottitis (EMERGENCY)ENT / Emergency
20Measles (Rubeola)Infectious
21Acute AppendicitisSurgery
22Infantile ColicNeonatology / GIT
23Vitamin D Deficiency RicketsNutrition / Metabolic
24Nephrotic SyndromeRenal
25Hand, Foot & Mouth DiseaseInfectious / Dermatology
26Dengue FeverInfectious
27MumpsInfectious
28Cerebral Palsy - Spastic DiplegiaNeurology / Rehab

Each case includes:

  • Patient demographics (age, sex, weight)
  • Chief complaint & history
  • Examination & key investigation findings
  • Diagnosis (highlighted in red)
  • Prescription table with drug name, dose, and full instructions
  • Clinical Reasoning (green box) - exactly WHY each drug is prescribed, mechanism of action included
  • Follow-up / Red flags (orange box)
Disclaimer: Doses are standard weight-based paediatric calculations for educational purposes. Always verify against BNF for Children, WHO guidelines, or your local formulary before actual prescribing.
This is a shared conversation. Sign in to Orris to start your own chat.