attachment
attachment

I want you to make me a pdf of 100 different drug ... based on the photo o have send you..

Reading File
Reading File
Asking for Preferences
Running Command

mkdir -p /home/daytona/workspace/drug-pdf && echo "dir ready"

For now just create 50 drugs

Writing File

~/drug-pdf/generate_drugs.py

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

# ── 50 drugs ──────────────────────────────────────────────────────────────────
drugs = [
    {
        "name": "Metformin",
        "class": "Biguanide",
        "moa": "↓ hepatic gluconeogenesis + ↑ insulin sensitivity",
        "indication": "Type 2 diabetes",
        "why_this": "First-line; weight neutral; CV safe (UKPDS)",
        "why_not": "Sulfonylureas → hypoglycemia; Insulin → not needed in mild cases",
        "adr_common": "GI upset (nausea, diarrhea)",
        "adr_serious": "Lactic acidosis (rare)",
        "contraindication": "eGFR < 30, severe hepatic failure, IV contrast (hold 48 h)",
        "monitoring": "HbA1c, creatinine/eGFR, B12 levels",
    },
    {
        "name": "Lisinopril",
        "class": "ACE Inhibitor",
        "moa": "Blocks conversion of angiotensin I → II → ↓ aldosterone → vasodilation",
        "indication": "Hypertension, heart failure (HFrEF), diabetic nephropathy",
        "why_this": "Renoprotective; reduces proteinuria; mortality benefit in HF",
        "why_not": "ARBs used if ACEi cough intolerable; CCBs if no HF/CKD",
        "adr_common": "Dry cough",
        "adr_serious": "Angioedema, hyperkalemia, acute kidney injury",
        "contraindication": "Pregnancy, bilateral renal artery stenosis, prior angioedema",
        "monitoring": "BP, K⁺, creatinine (baseline + 1–2 wks after initiation)",
    },
    {
        "name": "Atorvastatin",
        "class": "HMG-CoA reductase inhibitor (Statin)",
        "moa": "Inhibits HMG-CoA reductase → ↓ cholesterol synthesis → ↑ LDL receptors",
        "indication": "Hyperlipidemia, CV risk reduction (primary & secondary)",
        "why_this": "High-intensity statin; proven mortality reduction post-MI",
        "why_not": "Fibrates preferred for hypertriglyceridemia; bile acid sequestrants less potent",
        "adr_common": "Myalgia, GI upset",
        "adr_serious": "Rhabdomyolysis, hepatotoxicity (rare)",
        "contraindication": "Active liver disease, pregnancy",
        "monitoring": "CK (if myalgia), LFTs, fasting lipid panel",
    },
    {
        "name": "Amlodipine",
        "class": "Dihydropyridine Calcium Channel Blocker (CCB)",
        "moa": "Blocks L-type Ca²⁺ channels in vascular smooth muscle → vasodilation",
        "indication": "Hypertension, stable angina",
        "why_this": "Long-acting; no reflex tachycardia issues; safe in CKD",
        "why_not": "Non-DHP CCBs (verapamil/diltiazem) for rate control, not in HFrEF",
        "adr_common": "Peripheral edema, flushing, headache",
        "adr_serious": "Gingival hyperplasia (rare)",
        "contraindication": "Severe aortic stenosis, cardiogenic shock",
        "monitoring": "BP, HR, edema",
    },
    {
        "name": "Metoprolol",
        "class": "Cardioselective β1-blocker",
        "moa": "Blocks β1 adrenergic receptors → ↓ HR, ↓ contractility, ↓ BP",
        "indication": "Hypertension, angina, HFrEF, post-MI, AF rate control",
        "why_this": "Cardioselective; mortality benefit in HF (MERIT-HF)",
        "why_not": "Non-selective β-blockers avoided in asthma; CCBs if bronchospasm",
        "adr_common": "Fatigue, bradycardia, cold extremities",
        "adr_serious": "Bronchospasm (high doses), heart block",
        "contraindication": "Severe bradycardia, 2°/3° AV block, cardiogenic shock, decompensated HF",
        "monitoring": "HR, BP, ECG (PR interval)",
    },
    {
        "name": "Furosemide",
        "class": "Loop Diuretic",
        "moa": "Inhibits Na⁺/K⁺/2Cl⁻ cotransporter in thick ascending loop of Henle",
        "indication": "Acute pulmonary edema, CHF, cirrhosis with ascites, hypertension",
        "why_this": "Most potent diuretic; rapid onset (IV 5 min); works in low GFR",
        "why_not": "Thiazides preferred in uncomplicated HTN; aldosterone antagonists for cirrhosis",
        "adr_common": "Hypokalemia, hypomagnesemia, dehydration",
        "adr_serious": "Ototoxicity (high dose IV), gout flare",
        "contraindication": "Anuria, sulfa allergy (relative)",
        "monitoring": "Electrolytes (K⁺, Mg²⁺), renal function, urine output",
    },
    {
        "name": "Warfarin",
        "class": "Vitamin K Antagonist (anticoagulant)",
        "moa": "Inhibits vitamin K epoxide reductase → ↓ factors II, VII, IX, X, Protein C/S",
        "indication": "AF, DVT/PE, mechanical heart valves",
        "why_this": "Only anticoagulant for mechanical valves; reversible with vitamin K",
        "why_not": "DOACs preferred for non-valvular AF (easier dosing, no monitoring)",
        "adr_common": "Bleeding (minor: bruising, nosebleed)",
        "adr_serious": "Major hemorrhage, skin necrosis (early), teratogen",
        "contraindication": "Pregnancy, active major bleeding, recent CNS surgery",
        "monitoring": "INR (target 2–3 for most; 2.5–3.5 for mechanical valves)",
    },
    {
        "name": "Aspirin",
        "class": "Antiplatelet / NSAID",
        "moa": "Irreversibly inhibits COX-1/COX-2 → ↓ TXA2 → ↓ platelet aggregation",
        "indication": "ACS, MI prevention (secondary), ischemic stroke, Kawasaki disease",
        "why_this": "Irreversible platelet inhibition; cheap; proven in ACS",
        "why_not": "Clopidogrel if aspirin intolerant; DOACs for AF (not aspirin alone)",
        "adr_common": "GI upset, dyspepsia",
        "adr_serious": "GI bleeding, Reye syndrome (children + viral illness), tinnitus (overdose)",
        "contraindication": "Active peptic ulcer, children with viral illness, severe hepatic failure",
        "monitoring": "Signs of bleeding, renal function with chronic use",
    },
    {
        "name": "Clopidogrel",
        "class": "P2Y12 ADP Receptor Antagonist (antiplatelet)",
        "moa": "Irreversibly blocks ADP P2Y12 receptor → ↓ platelet aggregation",
        "indication": "ACS (with aspirin – DAPT), PCI post-stenting, ischemic stroke/TIA",
        "why_this": "Effective in high-risk vascular events; used when aspirin intolerant",
        "why_not": "Ticagrelor/prasugrel more potent in ACS (faster onset); more costly",
        "adr_common": "Bleeding, bruising",
        "adr_serious": "TTP (rare), major bleeding",
        "contraindication": "Active bleeding, CYP2C19 poor metabolizers (reduced efficacy)",
        "monitoring": "CBC, signs of bleeding; hold 5–7 days pre-surgery",
    },
    {
        "name": "Amoxicillin",
        "class": "Aminopenicillin (β-lactam antibiotic)",
        "moa": "Binds PBPs → inhibits cell wall (peptidoglycan) synthesis → bactericidal",
        "indication": "Strep pharyngitis, otitis media, H. pylori (triple therapy), Lyme disease",
        "why_this": "Broad spectrum vs. gram-positives; oral; cheap",
        "why_not": "Azithromycin for atypicals; clindamycin if penicillin allergy",
        "adr_common": "Diarrhea, rash (esp. in EBV!), GI upset",
        "adr_serious": "Anaphylaxis, C. diff",
        "contraindication": "Penicillin allergy",
        "monitoring": "Renal function in prolonged use; rash",
    },
    {
        "name": "Azithromycin",
        "class": "Macrolide Antibiotic",
        "moa": "Binds 50S ribosomal subunit → inhibits translocation → bacteriostatic",
        "indication": "CAP (atypical), STI (chlamydia), MAC prophylaxis in HIV",
        "why_this": "Covers atypicals (Mycoplasma, Legionella, Chlamydia); convenient 5-day course",
        "why_not": "Fluoroquinolones (levofloxacin) for severe CAP; doxycycline for similar spectrum",
        "adr_common": "GI upset, nausea",
        "adr_serious": "QT prolongation, hepatotoxicity, CDAD",
        "contraindication": "QT-prolonging drug combination, hepatic failure",
        "monitoring": "ECG (QTc) if cardiac risk; LFTs",
    },
    {
        "name": "Ciprofloxacin",
        "class": "Fluoroquinolone Antibiotic",
        "moa": "Inhibits DNA gyrase (topoisomerase II/IV) → blocks DNA replication",
        "indication": "UTI, traveler's diarrhea, gram-negative infections, anthrax prophylaxis",
        "why_this": "Excellent gram-negative coverage; oral bioavailability ~70%",
        "why_not": "Resistance increasing; avoid in pregnancy/children; tendon risk",
        "adr_common": "Nausea, diarrhea",
        "adr_serious": "Tendon rupture (Achilles), QT prolongation, C. diff, CNS effects",
        "contraindication": "Pregnancy, children (growing cartilage), myasthenia gravis",
        "monitoring": "Tendon pain, renal function, QTc",
    },
    {
        "name": "Vancomycin",
        "class": "Glycopeptide Antibiotic",
        "moa": "Binds D-Ala-D-Ala terminus of peptidoglycan → inhibits cell wall synthesis",
        "indication": "MRSA infections, C. diff (oral), severe gram-positive infections",
        "why_this": "Drug of choice for MRSA; not absorbed orally (ideal for C. diff colitis)",
        "why_not": "Linezolid/daptomycin for VRE; β-lactams preferred for MSSA",
        "adr_common": "Nephrotoxicity, ototoxicity",
        "adr_serious": "Red man syndrome (infusion rate), nephrotoxicity",
        "contraindication": "Allergy to vancomycin",
        "monitoring": "AUC/MIC-guided dosing, renal function, trough levels",
    },
    {
        "name": "Omeprazole",
        "class": "Proton Pump Inhibitor (PPI)",
        "moa": "Irreversibly inhibits H⁺/K⁺-ATPase on parietal cells → ↓ gastric acid",
        "indication": "GERD, peptic ulcer, H. pylori (combination), Zollinger-Ellison",
        "why_this": "Most effective acid suppression; heals erosive esophagitis faster than H2 blockers",
        "why_not": "H2 blockers (ranitidine) for milder symptoms; antacids for immediate relief",
        "adr_common": "Headache, diarrhea, nausea",
        "adr_serious": "Hypomagnesemia (chronic use), C. diff, fractures, B12 deficiency",
        "contraindication": "Concurrent atazanavir use",
        "monitoring": "Mg²⁺ (long-term), B12, renal function",
    },
    {
        "name": "Levothyroxine",
        "class": "Thyroid Hormone Replacement",
        "moa": "Synthetic T4 → converted to active T3 → acts on nuclear receptors",
        "indication": "Hypothyroidism, myxedema coma, thyroid cancer suppression",
        "why_this": "T4 has stable half-life (7 days); once-daily dosing; consistent levels",
        "why_not": "Desiccated thyroid (both T3+T4) used in some refractory cases",
        "adr_common": "Palpitations, tremor, insomnia if over-replaced",
        "adr_serious": "AF, osteoporosis, angina (if over-replaced)",
        "contraindication": "Untreated adrenal insufficiency (must give steroids first)",
        "monitoring": "TSH every 6–8 wks (adjust), then annually once stable",
    },
    {
        "name": "Prednisone",
        "class": "Systemic Corticosteroid (glucocorticoid)",
        "moa": "Binds glucocorticoid receptors → ↓ NF-κB → ↓ cytokine production → anti-inflammatory",
        "indication": "Asthma exacerbation, COPD flare, autoimmune diseases, adrenal insufficiency",
        "why_this": "Potent, fast anti-inflammatory; cheap; oral",
        "why_not": "Inhaled steroids preferred for chronic asthma; DMARDs for RA (long-term)",
        "adr_common": "Weight gain, hyperglycemia, mood changes, insomnia",
        "adr_serious": "Adrenal suppression, osteoporosis, immunosuppression, Cushing syndrome",
        "contraindication": "Systemic fungal infection (without antifungal cover), live vaccines",
        "monitoring": "Blood glucose, BP, bone density (DEXA), electrolytes, eye exam",
    },
    {
        "name": "Albuterol",
        "class": "Short-Acting β2 Agonist (SABA)",
        "moa": "Stimulates β2 receptors in bronchial smooth muscle → bronchodilation",
        "indication": "Acute asthma/COPD exacerbation, exercise-induced bronchospasm",
        "why_this": "Fastest bronchodilation; rescue inhaler of choice",
        "why_not": "LABAs (salmeterol) for maintenance; ICS for chronic inflammation",
        "adr_common": "Tremor, tachycardia, palpitations",
        "adr_serious": "Hypokalemia (high doses), paradoxical bronchospasm",
        "contraindication": "Hypersensitivity",
        "monitoring": "HR, K⁺ in high-dose IV nebulization, O2 saturation",
    },
    {
        "name": "Fluticasone",
        "class": "Inhaled Corticosteroid (ICS)",
        "moa": "Topical glucocorticoid → ↓ airway inflammation, ↓ mucosal edema",
        "indication": "Persistent asthma (maintenance), allergic rhinitis",
        "why_this": "Reduces exacerbation frequency and oral steroid need; minimal systemic absorption",
        "why_not": "SABAs for acute attack; LABAs added if ICS alone insufficient",
        "adr_common": "Oral candidiasis, hoarseness",
        "adr_serious": "Adrenal suppression (high doses), growth suppression in children",
        "contraindication": "Acute bronchospasm (not for rescue)",
        "monitoring": "Height in children, HPA axis if high dose long-term",
    },
    {
        "name": "Montelukast",
        "class": "Leukotriene Receptor Antagonist (LTRA)",
        "moa": "Blocks CysLT1 receptor → ↓ bronchoconstriction and mucus secretion",
        "indication": "Mild persistent asthma, allergic rhinitis, aspirin-exacerbated asthma",
        "why_this": "Oral; useful in exercise-induced and aspirin-sensitive asthma",
        "why_not": "ICS superior for asthma control; antihistamines preferred for pure rhinitis",
        "adr_common": "Headache, GI upset",
        "adr_serious": "Neuropsychiatric effects (nightmares, depression, suicidal ideation – Black Box)",
        "contraindication": "Hypersensitivity",
        "monitoring": "Mood/behavioral changes (esp. in children)",
    },
    {
        "name": "Sertraline",
        "class": "SSRI (Selective Serotonin Reuptake Inhibitor)",
        "moa": "Blocks SERT → ↑ synaptic serotonin",
        "indication": "MDD, OCD, panic disorder, PTSD, social anxiety, PMDD",
        "why_this": "Favorable side-effect profile; safe in pregnancy (2nd choice); widest licensed indications",
        "why_not": "SNRIs if neuropathic pain coexists; bupropion if sexual SE problematic",
        "adr_common": "Nausea, sexual dysfunction, insomnia/somnolence",
        "adr_serious": "Serotonin syndrome (+ MAOIs), suicidality (young adults – Black Box), SIADH",
        "contraindication": "MAOI within 14 days, pimozide, linezolid",
        "monitoring": "Mood, suicidal ideation (weeks 1–4), Na⁺ (elderly), weight",
    },
    {
        "name": "Fluoxetine",
        "class": "SSRI",
        "moa": "Blocks SERT → ↑ synaptic serotonin; longest half-life of all SSRIs (~6 days)",
        "indication": "MDD, bulimia nervosa, OCD, panic disorder, PMDD",
        "why_this": "Long half-life → forgiving with missed doses; least discontinuation syndrome",
        "why_not": "Avoid in elderly (activating); strong CYP2D6 inhibitor = drug interactions",
        "adr_common": "Insomnia, agitation, nausea, weight loss initially",
        "adr_serious": "Serotonin syndrome, QT prolongation (high dose), hyponatremia",
        "contraindication": "MAOIs (14-day washout), thioridazine",
        "monitoring": "Mood, suicidality (young adults), weight, Na⁺",
    },
    {
        "name": "Quetiapine",
        "class": "Atypical Antipsychotic (2nd generation)",
        "moa": "D2, 5-HT2A antagonism (also H1, α1 blockade)",
        "indication": "Schizophrenia, bipolar disorder (manic + depressive), augmentation in MDD",
        "why_this": "Low EPS risk; effective for bipolar depression; sedating (useful for insomnia)",
        "why_not": "Risperidone/haloperidol if cost is concern; olanzapine if higher potency needed",
        "adr_common": "Sedation, weight gain, orthostatic hypotension, dry mouth",
        "adr_serious": "Metabolic syndrome, QT prolongation, tardive dyskinesia, NMS",
        "contraindication": "Dementia-related psychosis (Black Box – ↑ mortality)",
        "monitoring": "Weight, fasting glucose/lipids, QTc, EPS, BP",
    },
    {
        "name": "Lithium",
        "class": "Mood Stabilizer",
        "moa": "Inhibits inositol monophosphatase → ↓ IP3 signaling; modulates GSK-3β",
        "indication": "Bipolar disorder (gold standard for mania prevention), augmentation in MDD",
        "why_this": "Only drug proven to reduce suicide risk in bipolar disorder",
        "why_not": "Valproate preferred in rapid cycling/mixed states; carbamazepine alternative",
        "adr_common": "Fine tremor, polyuria/polydipsia, hypothyroidism, weight gain",
        "adr_serious": "Lithium toxicity (coarse tremor, confusion, seizure, arrhythmia)",
        "contraindication": "Pregnancy (Ebstein's anomaly risk), severe renal failure",
        "monitoring": "Lithium level (target 0.6–1.2 mEq/L), TFTs, renal function, ECG",
    },
    {
        "name": "Valproate",
        "class": "Anticonvulsant / Mood Stabilizer",
        "moa": "↑ GABA (inhibits GABA transaminase); blocks Na⁺ and Ca²⁺ channels",
        "indication": "Epilepsy (absence, generalized), bipolar mania, migraine prophylaxis",
        "why_this": "Broad-spectrum anticonvulsant; effective in rapid cycling bipolar",
        "why_not": "Avoid in women of childbearing age (teratogen); lithium for long-term bipolar",
        "adr_common": "Weight gain, hair loss, tremor, sedation, GI upset",
        "adr_serious": "Hepatotoxicity, pancreatitis, teratogen (NTDs), thrombocytopenia",
        "contraindication": "Pregnancy (spina bifida/NTDs), hepatic disease, urea cycle disorders",
        "monitoring": "Valproate level, LFTs, CBC, ammonia",
    },
    {
        "name": "Phenytoin",
        "class": "Hydantoin Anticonvulsant",
        "moa": "Blocks voltage-gated Na⁺ channels → stabilizes neuronal membranes",
        "indication": "Generalized tonic-clonic seizures, focal seizures, status epilepticus (IV)",
        "why_this": "IV form for status epilepticus; older drug with well-understood pharmacology",
        "why_not": "Levetiracetam preferred (fewer interactions); valproate for absence",
        "adr_common": "Gingival hyperplasia, hirsutism, acne, coarsening of features",
        "adr_serious": "Stevens-Johnson syndrome, fetal hydantoin syndrome, cardiac arrhythmia (IV)",
        "contraindication": "Pregnancy, sinus bradycardia, Adams-Stokes syndrome",
        "monitoring": "Phenytoin level (target 10–20 μg/mL), ECG during IV infusion, LFTs",
    },
    {
        "name": "Levetiracetam",
        "class": "Anticonvulsant (SV2A modulator)",
        "moa": "Binds synaptic vesicle protein SV2A → modulates neurotransmitter release",
        "indication": "Focal seizures, generalized seizures, myoclonic epilepsy, status epilepticus",
        "why_this": "Few drug interactions; no hepatic induction; no monitoring required",
        "why_not": "Phenytoin/valproate if cost concern; carbamazepine for focal seizures",
        "adr_common": "Somnolence, irritability, behavioral changes",
        "adr_serious": "Psychiatric disturbances (aggression, psychosis)",
        "contraindication": "Hypersensitivity",
        "monitoring": "Renal function (dose adjust in CKD), mood/behavior",
    },
    {
        "name": "Morphine",
        "class": "Opioid Analgesic (full μ-agonist)",
        "moa": "Activates μ-opioid receptors → ↓ pain transmission + ↑ pain threshold",
        "indication": "Severe acute pain, cancer pain, acute pulmonary edema, MI pain",
        "why_this": "Gold standard for severe pain; widely available; IV/oral routes",
        "why_not": "Fentanyl for procedural pain; hydromorphone if morphine SE intolerable",
        "adr_common": "Nausea, constipation, sedation, pruritis",
        "adr_serious": "Respiratory depression, dependence, histamine release (hypotension)",
        "contraindication": "Severe respiratory depression, acute abdomen (relative), MAOI use",
        "monitoring": "RR, O2 sat, pain scores, constipation prophylaxis (stool softener)",
    },
    {
        "name": "Naloxone",
        "class": "Opioid Antagonist",
        "moa": "Competitive μ-opioid receptor antagonist → rapidly reverses opioid effects",
        "indication": "Opioid overdose reversal, postoperative opioid depression",
        "why_this": "Rapid onset (1–2 min IV); can be given IM/IN; life-saving in overdose",
        "why_not": "No alternatives for acute reversal; nalmefene longer-acting but less used",
        "adr_common": "Withdrawal symptoms in dependent patients, agitation",
        "adr_serious": "Pulmonary edema (rare), re-narcotization (short half-life vs. long opioids)",
        "contraindication": "Hypersensitivity",
        "monitoring": "RR, sedation, O2 sat (repeat dosing may be needed for long-acting opioids)",
    },
    {
        "name": "Insulin Glargine",
        "class": "Long-acting Insulin Analogue",
        "moa": "Binds insulin receptor → promotes glucose uptake, inhibits gluconeogenesis",
        "indication": "Type 1 & 2 diabetes mellitus (basal insulin component)",
        "why_this": "Peakless 24-hour coverage; once-daily dosing; predictable",
        "why_not": "Neutral protamine Hagedorn (NPH) has peaks → more hypoglycemia; shorter duration",
        "adr_common": "Hypoglycemia, injection site reactions, weight gain",
        "adr_serious": "Severe hypoglycemia, hypokalemia",
        "contraindication": "Hypoglycemia episode (hold and treat first)",
        "monitoring": "Fasting glucose, HbA1c, hypoglycemia awareness",
    },
    {
        "name": "Empagliflozin",
        "class": "SGLT-2 Inhibitor",
        "moa": "Inhibits sodium-glucose cotransporter-2 in proximal tubule → ↑ glucosuria",
        "indication": "Type 2 diabetes, HFrEF (regardless of diabetes), CKD",
        "why_this": "CV and renal protection beyond glucose lowering (EMPA-REG OUTCOME trial)",
        "why_not": "UTI-prone patients prefer alternatives; not for T1DM (DKA risk)",
        "adr_common": "Genital mycotic infections, UTI, polyuria",
        "adr_serious": "DKA (euglycemic), Fournier's gangrene, volume depletion",
        "contraindication": "eGFR < 30 (glucose-lowering), T1DM relative, recurrent UTI",
        "monitoring": "eGFR, electrolytes, BP, genital infections, HbA1c",
    },
    {
        "name": "Semaglutide",
        "class": "GLP-1 Receptor Agonist",
        "moa": "Activates GLP-1 receptors → ↑ glucose-dependent insulin, ↓ glucagon, ↓ appetite",
        "indication": "Type 2 diabetes, obesity (Wegovy), CV risk reduction",
        "why_this": "Weight loss + CV benefit (SUSTAIN-6); once-weekly SC; also oral form",
        "why_not": "GI-sensitive patients may not tolerate; DPP-4 inhibitors if GI SE concern",
        "adr_common": "Nausea, vomiting, diarrhea",
        "adr_serious": "Pancreatitis, medullary thyroid cancer (Black Box – animal data), gallstones",
        "contraindication": "Personal/family hx of MEN2 or medullary thyroid carcinoma, pancreatitis",
        "monitoring": "HbA1c, weight, HR, pancreatitis symptoms",
    },
    {
        "name": "Digoxin",
        "class": "Cardiac Glycoside",
        "moa": "Inhibits Na⁺/K⁺-ATPase → ↑ intracellular Ca²⁺ → ↑ inotropy; vagal ↑ → ↓ HR",
        "indication": "AF rate control, HFrEF (symptom control – does not ↓ mortality)",
        "why_this": "Useful when β-blockers/CCBs contraindicated; adds rate control + modest inotropy",
        "why_not": "β-blockers/diltiazem preferred for rate control; ACEI/BB/diuretics for HF mortality",
        "adr_common": "Nausea, visual disturbances (yellow-green halos), fatigue",
        "adr_serious": "Digoxin toxicity: arrhythmias (PAT + block), bradycardia, hyperkalemia",
        "contraindication": "WPW syndrome, 2°/3° AV block, hypertrophic obstructive cardiomyopathy",
        "monitoring": "Digoxin level (0.5–0.9 ng/mL for HF), K⁺, Mg²⁺, ECG",
    },
    {
        "name": "Amiodarone",
        "class": "Class III Antiarrhythmic (multi-channel blocker)",
        "moa": "Blocks K⁺ channels (primary) + Na⁺, Ca²⁺ channels, β-blockade",
        "indication": "Ventricular tachycardia/fibrillation, AF conversion and maintenance",
        "why_this": "Most effective antiarrhythmic; effective in structural heart disease",
        "why_not": "Extensive toxicity profile; reserved when others fail or in life-threatening arrhythmia",
        "adr_common": "Photosensitivity, corneal microdeposits, bradycardia",
        "adr_serious": "Pulmonary toxicity (fibrosis), hepatotoxicity, thyroid dysfunction (hypo/hyper), QT↑",
        "contraindication": "Sinus node dysfunction without pacemaker, iodine allergy (relative)",
        "monitoring": "TFTs, LFTs, CXR, PFTs, slit-lamp exam annually",
    },
    {
        "name": "Heparin (Unfractionated)",
        "class": "Anticoagulant (indirect thrombin inhibitor)",
        "moa": "Binds antithrombin III → ↑↑↑ inhibition of thrombin (IIa) and factor Xa",
        "indication": "Acute VTE, ACS (STEMI/NSTEMI), bridging therapy, CPB",
        "why_this": "Rapid onset IV; reversible with protamine; works in renal failure",
        "why_not": "LMWHs easier (SC, no monitoring); DOACs for outpatient VTE",
        "adr_common": "Bleeding, injection site hematoma",
        "adr_serious": "HIT (Heparin-Induced Thrombocytopenia) – thrombosis risk, major bleeding",
        "contraindication": "Active bleeding, HIT history, severe thrombocytopenia",
        "monitoring": "aPTT (target 60–100 sec), CBC (platelets for HIT – days 4–14)",
    },
    {
        "name": "Rivaroxaban",
        "class": "Direct Factor Xa Inhibitor (DOAC)",
        "moa": "Directly and reversibly inhibits factor Xa → ↓ thrombin generation",
        "indication": "Non-valvular AF, DVT/PE treatment and prevention, post-joint replacement",
        "why_this": "Once-daily; no routine monitoring; predictable pharmacokinetics",
        "why_not": "Warfarin for mechanical valves; heparin for bridging/acute hospitalized anticoag",
        "adr_common": "Bleeding (minor)",
        "adr_serious": "Major bleeding (andexanet alfa reversal agent available)",
        "contraindication": "Mechanical heart valves, eGFR < 15 (for most indications), pregnancy",
        "monitoring": "Renal function annually, signs of bleeding (no routine INR needed)",
    },
    {
        "name": "Atenolol",
        "class": "Cardioselective β1-blocker",
        "moa": "Selectively blocks β1 receptors → ↓ HR, ↓ BP, ↓ cardiac output",
        "indication": "Hypertension, stable angina, post-MI",
        "why_this": "Once-daily dosing; cheap; renal elimination (useful if hepatic issues)",
        "why_not": "Metoprolol succinate preferred in HFrEF (proven mortality benefit); less used in HF",
        "adr_common": "Fatigue, bradycardia, cold extremities",
        "adr_serious": "Bronchospasm (less selective at high dose), masked hypoglycemia",
        "contraindication": "Asthma, COPD (relative), 2°/3° AV block, decompensated HF",
        "monitoring": "HR, BP",
    },
    {
        "name": "Spironolactone",
        "class": "Potassium-Sparing Diuretic / Aldosterone Antagonist",
        "moa": "Competitively blocks aldosterone receptor → ↓ Na⁺ reabsorption, ↓ K⁺ excretion",
        "indication": "HFrEF (mortality benefit), primary hyperaldosteronism, cirrhotic ascites, resistant HTN",
        "why_this": "Mortality benefit in HFrEF (RALES trial); treats hyperaldosteronism directly",
        "why_not": "Loop diuretics more potent for volume overload; eplerenone if gynecomastia problematic",
        "adr_common": "Gynecomastia/mastalgia (males), hyperkalemia, menstrual irregularities",
        "adr_serious": "Severe hyperkalemia, metabolic acidosis",
        "contraindication": "Hyperkalemia (K⁺ > 5.5), Addison's disease, severe renal failure",
        "monitoring": "K⁺, renal function, BP",
    },
    {
        "name": "Hydrochlorothiazide",
        "class": "Thiazide Diuretic",
        "moa": "Inhibits Na⁺/Cl⁻ cotransporter in distal convoluted tubule → natriuresis",
        "indication": "Hypertension, edema (mild), nephrolithiasis (calcium stones)",
        "why_this": "First-line for uncomplicated HTN; ↓ Ca²⁺ excretion → useful in hypercalciuria stones",
        "why_not": "Loop diuretics if eGFR < 30; aldosterone antagonists if HF/cirrhosis",
        "adr_common": "Hypokalemia, hyponatremia, hyperglycemia, hyperuricemia",
        "adr_serious": "Hyponatremia (elderly), pancreatitis, sulfa allergy cross-reaction",
        "contraindication": "Anuria, sulfa allergy (relative), gout (relative)",
        "monitoring": "Electrolytes (K⁺, Na⁺), glucose, uric acid, BP",
    },
    {
        "name": "Losartan",
        "class": "Angiotensin Receptor Blocker (ARB)",
        "moa": "Blocks AT1 receptor → ↓ vasoconstriction, ↓ aldosterone",
        "indication": "Hypertension, HFrEF, diabetic nephropathy, hypertensive patients with LVH",
        "why_this": "ACEi equivalent efficacy; no cough (bradykinin-independent); uricosuric effect",
        "why_not": "ACEi preferred in HF/post-MI (more evidence); both ↑ K⁺ – avoid combining",
        "adr_common": "Dizziness, hyperkalemia (less than ACEi)",
        "adr_serious": "Angioedema (rare), acute kidney injury, hyperkalemia",
        "contraindication": "Pregnancy, bilateral renal artery stenosis",
        "monitoring": "BP, K⁺, creatinine",
    },
    {
        "name": "Nitroglycerin",
        "class": "Organic Nitrate (vasodilator)",
        "moa": "Releases NO → activates guanylyl cyclase → ↑ cGMP → smooth muscle relaxation",
        "indication": "Acute angina (sublingual), NSTEMI, hypertensive emergency, acute HF with pulmonary edema",
        "why_this": "Fastest relief of angina (2–3 min SL); preload reduction beneficial in acute HF",
        "why_not": "PDE-5 inhibitors CONTRAINDICATED (severe hypotension); β-blockers for angina prophylaxis",
        "adr_common": "Headache, flushing, orthostatic hypotension",
        "adr_serious": "Severe hypotension (with PDE-5 inhibitors), reflex tachycardia, tolerance",
        "contraindication": "Sildenafil/tadalafil use within 24–48h, severe hypotension, hypovolemia, RV infarction",
        "monitoring": "BP (SBP > 90 before giving), HR",
    },
    {
        "name": "Simvastatin",
        "class": "HMG-CoA Reductase Inhibitor (Statin)",
        "moa": "Inhibits HMG-CoA reductase → ↓ cholesterol synthesis → ↑ LDL receptor upregulation",
        "indication": "Hyperlipidemia, secondary CV prevention",
        "why_this": "Proven mortality benefit (4S trial); cost-effective; well-established",
        "why_not": "Atorvastatin preferred (higher intensity, fewer drug interactions); rosuvastatin for max LDL lowering",
        "adr_common": "Myalgia",
        "adr_serious": "Rhabdomyolysis (↑ risk with CYP3A4 inhibitors), hepatotoxicity",
        "contraindication": "Active liver disease, pregnancy, concurrent strong CYP3A4 inhibitors, dose cap with amiodarone",
        "monitoring": "CK (if myalgia), LFTs, fasting lipids",
    },
    {
        "name": "Allopurinol",
        "class": "Xanthine Oxidase Inhibitor",
        "moa": "Inhibits xanthine oxidase → ↓ uric acid synthesis",
        "indication": "Chronic gout (prevention), uric acid nephrolithiasis, tumor lysis syndrome prophylaxis",
        "why_this": "Gold standard for long-term gout prevention; cheap; oral",
        "why_not": "Febuxostat alternative (if allopurinol intolerant); rasburicase for acute tumor lysis",
        "adr_common": "Rash, GI upset",
        "adr_serious": "Allopurinol hypersensitivity syndrome (DRESS, SJS – esp. HLA-B*5801 carriers), hepatitis",
        "contraindication": "Acute gout attack (do not start mid-attack – worsens), 6-MP/azathioprine (toxic buildup)",
        "monitoring": "Uric acid, renal function, CBC, rash (genetic testing in high-risk Asian populations)",
    },
    {
        "name": "Colchicine",
        "class": "Anti-inflammatory (tubulin-binding)",
        "moa": "Binds β-tubulin → inhibits microtubule polymerization → ↓ neutrophil migration",
        "indication": "Acute gout, Familial Mediterranean Fever, pericarditis",
        "why_this": "Effective for acute gout if NSAIDs contraindicated; CV benefit in pericarditis (COPE trial)",
        "why_not": "NSAIDs equally effective in acute gout if no contraindications; corticosteroids if both fail",
        "adr_common": "Diarrhea, nausea, abdominal cramps",
        "adr_serious": "Myopathy, bone marrow suppression (overdose/CYP3A4 inhibitors), neuromuscular toxicity",
        "contraindication": "Severe renal or hepatic failure with concurrent P-gp or strong CYP3A4 inhibitors",
        "monitoring": "Renal function, CBC (long-term), GI symptoms",
    },
    {
        "name": "Ibuprofen",
        "class": "NSAID (non-selective COX inhibitor)",
        "moa": "Reversibly inhibits COX-1/COX-2 → ↓ prostaglandin synthesis",
        "indication": "Pain, fever, inflammation (arthritis, dysmenorrhea, pericarditis)",
        "why_this": "OTC availability; rapid onset; effective for mild-moderate pain/inflammation",
        "why_not": "Celecoxib (COX-2 selective) if GI risk; acetaminophen if no inflammation component",
        "adr_common": "GI upset, nausea",
        "adr_serious": "GI ulceration/bleeding, renal impairment, ↑ CV events (prolonged use), HTN exacerbation",
        "contraindication": "Peptic ulcer, severe CKD/GFR < 30, 3rd trimester pregnancy, aspirin-sensitive asthma",
        "monitoring": "BP, renal function, CBC (chronic use), GI symptoms",
    },
    {
        "name": "Acetaminophen (Paracetamol)",
        "class": "Analgesic / Antipyretic",
        "moa": "Inhibits COX centrally (prostaglandin synthesis) + endocannabinoid pathway (exact mechanism debated)",
        "indication": "Mild-moderate pain, fever, first-line analgesia in OA (per NICE)",
        "why_this": "Safe in pregnancy, GI-friendly; no platelet effects; OTC",
        "why_not": "NSAIDs for inflammatory conditions (acetaminophen has no anti-inflammatory effect)",
        "adr_common": "Rare at therapeutic doses",
        "adr_serious": "Hepatotoxicity in overdose (N-acetylcysteine antidote), rare agranulocytosis",
        "contraindication": "Severe hepatic impairment, chronic alcohol use (≥ 3 drinks/day)",
        "monitoring": "LFTs in chronic use or suspected overdose; paracetamol level if overdose",
    },
    {
        "name": "Ceftriaxone",
        "class": "3rd-Generation Cephalosporin (β-lactam)",
        "moa": "Binds PBPs → inhibits peptidoglycan cross-linking → bactericidal",
        "indication": "CAP, meningitis (empirical), gonorrhea, sepsis, Lyme disease (disseminated)",
        "why_this": "Excellent gram-negative coverage; long half-life (once-daily); CNS penetration",
        "why_not": "Penicillin for streptococcal infections if sensitive; azithromycin for atypicals",
        "adr_common": "Diarrhea, rash",
        "adr_serious": "C. diff, biliary sludge (ceftriaxone-calcium precipitates in neonates), anaphylaxis",
        "contraindication": "Penicillin anaphylaxis (use aztreonam instead); neonates with hyperbilirubinemia (IV)",
        "monitoring": "Renal/hepatic function in prolonged use; culture sensitivities",
    },
    {
        "name": "Trimethoprim-Sulfamethoxazole (TMP-SMX)",
        "class": "Folate Synthesis Inhibitor (antibiotic)",
        "moa": "TMP inhibits dihydrofolate reductase; SMX inhibits dihydropteroate synthase → ↓ folate",
        "indication": "Uncomplicated UTI, PCP prophylaxis/treatment, toxoplasmosis, MRSA skin infection",
        "why_this": "Synergistic dual-block of folate pathway; oral; covers PCP",
        "why_not": "Nitrofurantoin for uncomplicated UTI (avoids resistance); avoid in sulfa allergy",
        "adr_common": "Rash, GI upset, photosensitivity",
        "adr_serious": "SJS, hyperkalemia (TMP blocks K⁺ secretion), bone marrow suppression, nephrotoxicity",
        "contraindication": "Sulfa allergy, G6PD deficiency (hemolysis), 3rd trimester pregnancy, severe CKD",
        "monitoring": "K⁺, renal function, CBC, rash",
    },
    {
        "name": "Fluconazole",
        "class": "Azole Antifungal",
        "moa": "Inhibits fungal CYP51 (lanosterol 14α-demethylase) → ↓ ergosterol synthesis",
        "indication": "Candidiasis (oral, vaginal, esophageal, systemic), Cryptococcal meningitis (step-down)",
        "why_this": "Oral and IV forms; excellent CNS penetration; once-daily",
        "why_not": "Amphotericin B for severe/systemic fungal infections; echinocandins for invasive candida",
        "adr_common": "Nausea, headache",
        "adr_serious": "QT prolongation, hepatotoxicity, CYP450 drug interactions (warfarin, statins)",
        "contraindication": "Concurrent terfenadine/cisapride, severe hepatic impairment",
        "monitoring": "LFTs, QTc, drug interactions",
    },
    {
        "name": "Metronidazole",
        "class": "Nitroimidazole Antibiotic / Antiprotozoal",
        "moa": "Reduced to toxic free radicals inside anaerobic organisms → DNA strand breakage",
        "indication": "C. difficile (mild), BV, Trichomoniasis, H. pylori (triple therapy), anaerobic infections",
        "why_this": "Covers anaerobes and protozoa; excellent oral bioavailability; penetrates abscesses",
        "why_not": "Vancomycin/fidaxomicin for severe C. diff; clindamycin for anaerobes if metronidazole fails",
        "adr_common": "Metallic taste, nausea",
        "adr_serious": "Disulfiram-like reaction with alcohol, peripheral neuropathy (prolonged), encephalopathy",
        "contraindication": "Alcohol use (disulfiram reaction), 1st trimester pregnancy (relative), lithium interaction",
        "monitoring": "Neurological symptoms (long-term), CBC",
    },
    {
        "name": "Doxycycline",
        "class": "Tetracycline Antibiotic",
        "moa": "Binds 30S ribosomal subunit → blocks aminoacyl-tRNA binding → bacteriostatic",
        "indication": "CAP (atypicals), Chlamydia, Lyme disease, Rocky Mountain spotted fever, malaria prophylaxis",
        "why_this": "Broad spectrum (atypicals, intracellular, spirochetes); oral; once or twice daily",
        "why_not": "Azithromycin if doxycycline intolerant; amoxicillin for early Lyme if not allergic",
        "adr_common": "Photosensitivity, GI upset, esophageal irritation",
        "adr_serious": "Permanent tooth discoloration (children < 8 years), pseudotumor cerebri, hepatotoxicity",
        "contraindication": "Children < 8 years (tooth/bone), pregnancy (skeletal anomalies), esophageal stricture",
        "monitoring": "Signs of infection resolution, sun protection (photosensitivity)",
    },
    {
        "name": "Oseltamivir",
        "class": "Neuraminidase Inhibitor (antiviral)",
        "moa": "Inhibits influenza neuraminidase → prevents viral release from host cells",
        "indication": "Influenza A and B treatment (within 48h of symptoms), post-exposure prophylaxis",
        "why_this": "Reduces symptom duration by ~1 day; reduces complications in high-risk patients",
        "why_not": "Supportive care sufficient in healthy young adults; baloxavir (single-dose) alternative",
        "adr_common": "Nausea, vomiting, headache",
        "adr_serious": "Neuropsychiatric events (rare, esp. in children – self-injury)",
        "contraindication": "Hypersensitivity",
        "monitoring": "Renal function (dose adjust in CKD), psychiatric symptoms",
    },
    {
        "name": "Acyclovir",
        "class": "Antiviral (nucleoside analogue)",
        "moa": "Phosphorylated by viral thymidine kinase → inhibits viral DNA polymerase",
        "indication": "HSV (genital, labial, encephalitis), VZV (shingles, chickenpox), CMV (less effective)",
        "why_this": "Highly selective (only active in infected cells); IV for encephalitis",
        "why_not": "Valacyclovir (prodrug) preferred orally (better bioavailability); ganciclovir for CMV",
        "adr_common": "Nausea, headache, injection site phlebitis (IV)",
        "adr_serious": "Nephrotoxicity (IV – crystalluria), encephalopathy (IV high dose)",
        "contraindication": "Hypersensitivity; adequate hydration required for IV use",
        "monitoring": "Renal function (IV use), hydration status, CBC",
    },
    {
        "name": "Tenofovir Disoproxil Fumarate (TDF)",
        "class": "NRTI (Nucleotide Reverse Transcriptase Inhibitor) – HIV antiretroviral",
        "moa": "Incorporates into viral DNA as false nucleotide → terminates chain elongation",
        "indication": "HIV-1 infection (part of ART regimen), Hepatitis B, PrEP",
        "why_this": "Backbone of most HIV regimens; dual activity (HIV + HBV); well tolerated",
        "why_not": "TAF (tenofovir alafenamide) preferred for better renal/bone profile; abacavir if renal concerns",
        "adr_common": "GI upset, headache",
        "adr_serious": "Nephrotoxicity, Fanconi syndrome, decrease in bone mineral density",
        "contraindication": "eGFR < 50 (use TAF instead), hypersensitivity",
        "monitoring": "eGFR, phosphate, bone density, viral load, CD4 count",
    },
    {
        "name": "Prednisolone",
        "class": "Systemic Corticosteroid",
        "moa": "Active metabolite of prednisone; binds glucocorticoid receptors → anti-inflammatory/immunosuppressive",
        "indication": "Asthma exacerbation, IBD, autoimmune hepatitis, organ transplant rejection",
        "why_this": "Doesn't require hepatic activation (unlike prednisone) – preferred in liver disease",
        "why_not": "Budesonide preferred for IBD (less systemic absorption); DMARDs for long-term RA",
        "adr_common": "Hyperglycemia, weight gain, mood changes, insomnia",
        "adr_serious": "Adrenal suppression, osteoporosis, infection, Cushing syndrome",
        "contraindication": "Systemic fungal infection, live vaccines during use",
        "monitoring": "Blood glucose, BP, DEXA scan, electrolytes, weight",
    },
    {
        "name": "Mesalazine (5-ASA)",
        "class": "Aminosalicylate",
        "moa": "Inhibits COX/LOX locally in colonic mucosa → ↓ prostaglandins and leukotrienes",
        "indication": "Mild-moderate ulcerative colitis (induction + maintenance), Crohn's colitis",
        "why_this": "Topical anti-inflammatory with minimal systemic absorption; maintenance of remission",
        "why_not": "Corticosteroids for moderate-severe UC; biologics (infliximab) for refractory disease",
        "adr_common": "GI upset, headache",
        "adr_serious": "Interstitial nephritis (rare), pancreatitis, blood dyscrasias",
        "contraindication": "Salicylate hypersensitivity, severe renal impairment",
        "monitoring": "Renal function, CBC (periodically)",
    },
    {
        "name": "Methotrexate",
        "class": "Antimetabolite / DMARD / Chemotherapy",
        "moa": "Inhibits DHFR → ↓ folate → ↓ DNA/RNA synthesis; anti-inflammatory at low doses",
        "indication": "RA (DMARD), psoriasis, Crohn's disease, ectopic pregnancy, ALL, osteosarcoma",
        "why_this": "Gold standard DMARD for RA; cheap; oral/IM; well-studied",
        "why_not": "Biologic DMARDs (anti-TNF) if MTX ineffective; avoid in pregnancy",
        "adr_common": "Mucositis, nausea, fatigue",
        "adr_serious": "Hepatotoxicity, pulmonary toxicity (pneumonitis), bone marrow suppression, teratogen",
        "contraindication": "Pregnancy, breastfeeding, hepatic cirrhosis, immunodeficiency, CrCl < 30",
        "monitoring": "LFTs, CBC, creatinine (monthly initially), folic acid supplementation",
    },
    {
        "name": "Infliximab",
        "class": "Anti-TNFα Biologic (chimeric monoclonal antibody)",
        "moa": "Binds and neutralizes soluble + membrane-bound TNF-α → ↓ inflammation",
        "indication": "Crohn's disease, UC, RA, psoriasis, ankylosing spondylitis, psoriatic arthritis",
        "why_this": "Rapidly effective in TNF-driven disease; IV – suitable for induction in severe IBD",
        "why_not": "Adalimumab (SC) preferred for self-injection; vedolizumab if anti-TNF inadequate",
        "adr_common": "Infusion reactions, headache",
        "adr_serious": "Opportunistic infections (TB reactivation), hepatitis B reactivation, demyelination, lymphoma",
        "contraindication": "Active infection (inc. TB – screen with IGRA), moderate/severe HF (NYHA III/IV)",
        "monitoring": "TB screening (IGRA/TST), HBV, LFTs, CBC, signs of infection",
    },
    {
        "name": "Ondansetron",
        "class": "5-HT3 Receptor Antagonist (Antiemetic)",
        "moa": "Blocks 5-HT3 receptors in CTZ and vagal afferents → ↓ nausea/vomiting",
        "indication": "Chemotherapy-induced nausea/vomiting (CINV), postoperative nausea, hyperemesis gravidarum",
        "why_this": "Highly effective for CINV; no extrapyramidal effects (unlike metoclopramide)",
        "why_not": "Metoclopramide for gastroparesis; domperidone for dysmotility-related nausea",
        "adr_common": "Headache, constipation, flushing",
        "adr_serious": "QT prolongation (dose-dependent), serotonin syndrome (rare)",
        "contraindication": "Congenital long QT syndrome, concurrent QT-prolonging drugs, apomorphine",
        "monitoring": "QTc (IV doses), electrolytes (K⁺, Mg²⁺)",
    },
    {
        "name": "Prednisolone (ear/eye drops)",
        "class": "Topical Corticosteroid",
        "moa": "Local glucocorticoid effect → ↓ capillary permeability, ↓ cytokines",
        "indication": "Allergic conjunctivitis, anterior uveitis, otitis externa",
        "why_this": "Targeted anti-inflammatory; minimal systemic absorption",
        "why_not": "Antibiotic drops for bacterial conjunctivitis; antiviral for herpetic keratitis",
        "adr_common": "Stinging/burning on instillation",
        "adr_serious": "Raised IOP (glaucoma), posterior subcapsular cataracts, secondary infection (prolonged use)",
        "contraindication": "Fungal/viral eye infections (e.g., herpes simplex keratitis), undiagnosed red eye",
        "monitoring": "IOP (prolonged ophthalmic use)",
    },
    {
        "name": "Tamoxifen",
        "class": "Selective Estrogen Receptor Modulator (SERM)",
        "moa": "Competitive estrogen receptor antagonist in breast tissue; partial agonist in uterus/bone",
        "indication": "ER+ breast cancer (adjuvant therapy, premenopausal), DCIS, gynecomastia",
        "why_this": "Proven 10-year benefit in ER+ breast cancer; preserves bone density (unlike AIs in premenopausal)",
        "why_not": "Aromatase inhibitors (anastrozole) preferred in postmenopausal women (superior efficacy)",
        "adr_common": "Hot flashes, vaginal discharge, mood changes",
        "adr_serious": "Endometrial cancer (uterine agonism), DVT/PE (thrombogenic), cataracts",
        "contraindication": "Pregnancy, DVT/PE history (relative), CYP2D6 inhibitors (reduce efficacy)",
        "monitoring": "Annual gynecologic exam (endometrial cancer), bone density, ophthalmology",
    },
    {
        "name": "Propranolol",
        "class": "Non-selective β-blocker",
        "moa": "Blocks β1 and β2 receptors → ↓ HR, ↓ BP, ↓ renin, ↓ anxiety symptoms",
        "indication": "Hypertension, angina, essential tremor, migraine prophylaxis, hyperthyroidism (adjunct), portal HTN",
        "why_this": "Non-selective → useful for anxiety/tremor (peripheral β2); controls hyperthyroid symptoms",
        "why_not": "Cardioselective β-blockers (metoprolol) preferred in HF/asthma patients",
        "adr_common": "Fatigue, bradycardia, cold extremities, nightmares",
        "adr_serious": "Bronchospasm (β2 blockade – avoid in asthma), masking hypoglycemia, rebound angina on abrupt withdrawal",
        "contraindication": "Asthma/COPD, 2°/3° AV block, uncompensated HF, Raynaud's (relative)",
        "monitoring": "HR, BP, blood glucose in diabetics",
    },
    {
        "name": "Clonazepam",
        "class": "Benzodiazepine",
        "moa": "Enhances GABA-A receptor Cl⁻ influx → CNS depression",
        "indication": "Panic disorder, seizures (absence, myoclonic), acute mania (adjunct), restless legs",
        "why_this": "Long half-life (18–50h) → less interdose anxiety; good for seizure prophylaxis",
        "why_not": "SSRIs preferred for long-term anxiety; shorter-acting BZDs (lorazepam) for acute agitation",
        "adr_common": "Sedation, ataxia, cognitive impairment",
        "adr_serious": "Dependence/withdrawal (can be life-threatening), respiratory depression (with opioids)",
        "contraindication": "Severe hepatic impairment, respiratory depression, sleep apnea, myasthenia gravis",
        "monitoring": "Sedation, respiratory rate, signs of dependence, LFTs",
    },
    {
        "name": "Donepezil",
        "class": "Acetylcholinesterase Inhibitor",
        "moa": "Reversibly inhibits AChE → ↑ acetylcholine in synaptic cleft",
        "indication": "Alzheimer's disease (all stages), Lewy body dementia",
        "why_this": "Improves cognitive function and ADLs; once-daily; well tolerated vs. tacrine",
        "why_not": "Memantine added in moderate-severe disease (different MOA – NMDA antagonist)",
        "adr_common": "Nausea, diarrhea, insomnia, vivid dreams",
        "adr_serious": "Bradycardia, syncope, GI bleeding, muscle cramps",
        "contraindication": "Piperidine hypersensitivity, sick sinus syndrome (relative)",
        "monitoring": "HR, MMSE/MoCA (cognitive tracking), GI symptoms",
    },
    {
        "name": "Memantine",
        "class": "NMDA Receptor Antagonist",
        "moa": "Blocks NMDA glutamate receptors → prevents excitotoxic Ca²⁺ influx",
        "indication": "Moderate-severe Alzheimer's disease",
        "why_this": "Slows cognitive decline in moderate-severe AD; different MOA from AChEIs (combine)",
        "why_not": "AChEIs (donepezil) first-line in mild AD; memantine added in moderate-severe",
        "adr_common": "Dizziness, headache, confusion",
        "adr_serious": "Seizures (rare), psychosis (rare)",
        "contraindication": "Severe renal failure (CrCl < 5 mL/min)",
        "monitoring": "Renal function, cognitive assessments",
    },
]

# ── PDF Generation ─────────────────────────────────────────────────────────────
OUTPUT = "/home/daytona/workspace/drug-pdf/50_Drugs_Reference.pdf"

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

# Colour palette
BG_HEADER  = colors.HexColor("#1a1a2e")   # dark navy
ACCENT     = colors.HexColor("#e94560")   # red accent
GOLD       = colors.HexColor("#f5a623")   # gold
TEXT_WHITE = colors.white
TEXT_DARK  = colors.HexColor("#1a1a2e")
LIGHT_GRAY = colors.HexColor("#f0f0f0")
TEAL       = colors.HexColor("#0f3460")

styles = getSampleStyleSheet()

# Custom styles
drug_title = ParagraphStyle(
    "DrugTitle",
    fontName="Helvetica-Bold",
    fontSize=18,
    textColor=TEXT_WHITE,
    leading=22,
    spaceAfter=0,
    spaceBefore=0,
    leftIndent=4*mm,
    alignment=TA_LEFT,
)
class_style = ParagraphStyle(
    "ClassStyle",
    fontName="Helvetica-Oblique",
    fontSize=11,
    textColor=GOLD,
    leading=14,
    spaceBefore=0,
    spaceAfter=0,
    leftIndent=4*mm,
)
section_header = ParagraphStyle(
    "SectionHeader",
    fontName="Helvetica-Bold",
    fontSize=10,
    textColor=ACCENT,
    leading=13,
    spaceBefore=4,
    spaceAfter=1,
)
body_style = ParagraphStyle(
    "Body",
    fontName="Helvetica",
    fontSize=9.5,
    textColor=TEXT_DARK,
    leading=13,
    spaceBefore=0,
    spaceAfter=2,
    leftIndent=3*mm,
)
bullet_style = ParagraphStyle(
    "Bullet",
    fontName="Helvetica",
    fontSize=9.5,
    textColor=TEXT_DARK,
    leading=13,
    spaceBefore=0,
    spaceAfter=1,
    leftIndent=6*mm,
    bulletIndent=3*mm,
)

def section(label, content):
    """Return a list of Flowables for one section."""
    return [
        Paragraph(label, section_header),
        Paragraph(content, body_style),
    ]

def drug_card(drug, number):
    elems = []

    # ── Header block (dark bg) ──────────────────────────────────────────────
    header_data = [[
        Paragraph(f"{number}. {drug['name']}", drug_title),
    ]]
    header_table = Table(header_data, colWidths=[174*mm])
    header_table.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), BG_HEADER),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 2),
        ("LEFTPADDING",   (0,0), (-1,-1), 4),
        ("RIGHTPADDING",  (0,0), (-1,-1), 4),
        ("ROUNDEDCORNERS", [4, 4, 0, 0]),
    ]))
    elems.append(header_table)

    # ── Class ribbon ───────────────────────────────────────────────────────
    class_data = [[Paragraph(drug["class"], class_style)]]
    class_table = Table(class_data, colWidths=[174*mm])
    class_table.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), TEAL),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 4),
        ("RIGHTPADDING",  (0,0), (-1,-1), 4),
    ]))
    elems.append(class_table)

    # ── Content area ───────────────────────────────────────────────────────
    content_items = []
    content_items += section("MOA:", drug["moa"])
    content_items += section("Indication:", drug["indication"])
    content_items += section("Why this drug:", drug["why_this"])
    content_items += section("Why not others:", drug["why_not"])
    content_items += section("ADR — Common:", drug["adr_common"])
    content_items += section("ADR — Serious:", drug["adr_serious"])
    content_items += section("Contraindication:", drug["contraindication"])
    content_items += section("Monitoring:", drug["monitoring"])

    # Wrap content in a light-background table
    inner_table = Table([[content_items]], colWidths=[170*mm])
    inner_table.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), LIGHT_GRAY),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("RIGHTPADDING",  (0,0), (-1,-1), 6),
        ("ROUNDEDCORNERS", [0, 0, 4, 4]),
    ]))
    elems.append(inner_table)
    elems.append(Spacer(1, 8*mm))

    return elems

# ── Cover page ──────────────────────────────────────────────────────────────
cover_style = ParagraphStyle("Cover", fontName="Helvetica-Bold", fontSize=32,
    textColor=TEXT_WHITE, alignment=TA_CENTER, leading=40)
subtitle_style = ParagraphStyle("Sub", fontName="Helvetica", fontSize=14,
    textColor=GOLD, alignment=TA_CENTER, leading=20)
note_style = ParagraphStyle("Note", fontName="Helvetica-Oblique", fontSize=10,
    textColor=colors.lightgrey, alignment=TA_CENTER)

cover_data = [[
    Spacer(1, 40*mm),
    Paragraph("50 ESSENTIAL DRUGS", cover_style),
    Spacer(1, 6*mm),
    Paragraph("Clinical Quick Reference", subtitle_style),
    Spacer(1, 8*mm),
    HRFlowable(width="80%", thickness=1, color=ACCENT, hAlign="CENTER"),
    Spacer(1, 8*mm),
    Paragraph("Class · MOA · Indication · Why This Drug · Why Not Others<br/>ADR · Contraindications · Monitoring", note_style),
    Spacer(1, 60*mm),
    Paragraph("Mixed Categories | All Major Drug Classes", note_style),
]]

cover_table = Table([[ cover_data[0] ]], colWidths=[174*mm], rowHeights=[240*mm])
cover_table.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), BG_HEADER),
    ("TOPPADDING",    (0,0), (-1,-1), 0),
    ("BOTTOMPADDING", (0,0), (-1,-1), 0),
    ("LEFTPADDING",   (0,0), (-1,-1), 0),
    ("RIGHTPADDING",  (0,0), (-1,-1), 0),
]))

story = []
# Cover elements
story.append(Spacer(1, 30*mm))
story.append(Paragraph("50 ESSENTIAL DRUGS", cover_style))
story.append(Spacer(1, 6*mm))
story.append(Paragraph("Clinical Quick Reference", subtitle_style))
story.append(Spacer(1, 8*mm))
story.append(HRFlowable(width="80%", thickness=2, color=ACCENT, hAlign="CENTER"))
story.append(Spacer(1, 8*mm))
story.append(Paragraph("Class · MOA · Indication · Why This Drug<br/>Why Not Others · ADR · Contraindications · Monitoring", note_style))
story.append(Spacer(1, 15*mm))
story.append(Paragraph("Mixed Categories | All Major Drug Classes", note_style))
story.append(PageBreak())

# Drug cards
for i, drug in enumerate(drugs, start=1):
    story.extend(drug_card(drug, i))

doc.build(story)
print(f"PDF saved → {OUTPUT}")
print(f"Total drugs: {len(drugs)}")
You've run out of free credits. Sign up for a free account to continue using Orris.
This is a shared conversation. Sign in to Orris to start your own chat.