Cough drugs detail all information

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Here is a comprehensive reference on cough drugs covering all major classes, mechanisms, clinical details, and special considerations — drawn from Goodman & Gilman's, Katzung's, Murray & Nadel's Respiratory Medicine, and Textbook of Family Medicine.

Cough Drugs — Complete Pharmacological Reference

Overview: The Cough Reflex

Cough is a protective reflex triggered by airway stimulation. It involves the central and peripheral nervous systems, brainstem cough centers (medulla), and bronchial smooth muscle. Antitussive drugs act by suppressing either central (medullary) or peripheral (airway sensory) mechanisms.
"The reflex is complex, involving the central and peripheral nervous systems as well as the smooth muscle of the bronchial tree." — Goodman & Gilman's The Pharmacological Basis of Therapeutics

Classification of Cough Drugs

ClassExamplesMechanism
Opioid antitussivesCodeine, Morphine, DiamorphineCentral (medullary) suppression via opioid receptors
Non-opioid antitussivesDextromethorphan, PholcodineCentral threshold elevation; non-opioid receptor
Peripheral antitussivesLevodropropizine, BenzonatatePeripheral sensory receptor inhibition
NeuromodulatorsGabapentin, Pregabalin, AmitriptylineNeural sensitization modulation
ExpectorantsGuaifenesinIncreases/thins mucus, facilitates expectoration
MucolyticsAcetylcysteine, Carbocysteine, BromhexineReduces sputum viscosity
Aromatic/DemulcentsMenthol, EucalyptusDecongestant/mucosal protective effect

1. OPIOID ANTITUSSIVES

Mechanism

Opioids suppress cough by a direct effect on cough centers in the medulla. There is no obligatory relationship between respiratory depression and antitussive effect — antitussive doses can be achieved below analgesic doses. The specific receptors for antitussive action may differ from those for analgesia.
"Cough suppression can be achieved without altering the protective glottal function." — Goodman & Gilman's

Codeine (Methylether of Morphine)

  • Class: Opioid (μ-receptor agonist)
  • Mechanism: Central — direct depression of the medullary cough center
  • Antitussive dose: 15 mg orally (lower than analgesic doses)
  • Efficacy: Effective against pathologic cough and cough in normal volunteers; limited efficacy in COPD patients and acute cough of common cold
  • Route: Oral
  • ADRs: Sedation, respiratory depression (at higher doses), constipation, physical dependence, nausea
  • Special notes:
    • Long-standing gold standard antitussive
    • Avoid in children (variable CYP2D6 metabolism → unpredictable toxicity)
    • Contraindicated with MAO inhibitors
    • Exacerbates wheezing via histamine release (rare)

Morphine / Diamorphine

  • Class: Strong opioid
  • Use: Reserved for palliative control of cough and pain in terminal cancer patients
  • Slow-release morphine can partially control severe chronic idiopathic cough
  • ADRs: Physical dependence, sedation, respiratory depression, GI constipation
  • Note: Diamorphine is not prescribed in the United States

2. NON-OPIOID (OPIOID-RELATED STRUCTURE) ANTITUSSIVES

Dextromethorphan (DXM)

  • Full name: D-3-methoxy-N-methylmorphinan; dextrorotatory stereoisomer of a methylated levorphanol derivative
  • Class: Non-narcotic antitussive — does NOT bind μ-opioid receptors
  • Mechanism: Acts centrally to elevate the cough threshold; also inhibits neuronal serotonin uptake; at high doses acts at NMDA receptors
  • Dose: 10–20 mg every 4 hours OR 30 mg every 6–8 hours; max 120 mg/day; extended-release forms approved for twice-daily dosing
  • Efficacy: Nearly equal potency to codeine; effective in adults for upper respiratory tract infections; not effective in children
  • Onset/Duration: Antitussive effects persist 5–6 hours
  • Forms: Liquids, syrups, capsules, soluble strips, lozenges, freezer pops; widely available OTC; also found in combination products with antihistamines, expectorants, decongestants
  • ADRs:
    • At therapeutic doses: few side effects; fewer GI effects and less constipation than codeine
    • Does not inhibit ciliary activity
    • High doses: dizziness, nausea, vomiting, headaches, hallucinations, euphoria, dissociative effects, perceptual distortions, impaired motor coordination (NMDA receptor activity — "robo-tripping")
  • Drug interactions:
    • MAO inhibitors — CONTRAINDICATED: risk of CNS depression and death (serotonin syndrome)
  • FDA ban: Banned in children < 6 years of age due to deaths from OTC cold/cough formulations
  • No analgesic or addictive properties

Pholcodine [3-O-(2-morpholinoethyl)morphine]

  • Class: Opioid-related structure; does not act at opioid receptors
  • Mechanism: Non-opioid; central cough suppression
  • Efficacy: At least as effective as codeine
  • Pharmacokinetics: Long half-life → can be given once or twice daily
  • Availability: Used in many countries outside the USA; not available in the US

Levopropoxyphene

  • Stereoisomer of dextropropoxyphene (weak opioid)
  • Devoid of opioid effects; sedation is a reported side effect
  • Dose: 50–100 mg every 4 hours
  • Not available in the USA

Noscapine

  • Opioid derivative; used as antitussive in several countries
  • Not available in the USA

3. PERIPHERAL ANTITUSSIVES

Levodropropizine

  • Mechanism: Nonopioid; peripheral inhibition of sensory cough receptors in the airways
  • Efficacy: Favorable benefit/risk profile compared with dextromethorphan
  • Used especially in contexts where central side effects are undesirable

Benzonatate

  • Local anesthetic-type drug; suppresses cough by anesthetizing stretch receptors in the respiratory tract
  • Used in clinical practice as a non-opioid antitussive

4. NEUROMODULATORS (For Chronic/Refractory Cough)

Used when chronic cough is driven by neural sensitization (neuropathic cough mechanism):

Gabapentin

  • Mechanism: Acts on voltage-gated calcium channels; modulates NMDA receptors (presynaptic) → reduces transmitter release and postsynaptic excitability; may affect GABA neurotransmission in spinal cord and brain
  • Evidence: RCT showed gabapentin significantly reduced cough frequency and visual analogue scores + improved Leicester Cough quality-of-life scores in refractory cough
  • Combined therapy: Pregabalin + speech pathology therapy was more effective than speech pathology alone

Pregabalin

  • Related to gabapentin; similar mechanism
  • Used in combination with speech/respiratory physiotherapy

Amitriptyline

  • Tricyclic antidepressant; central antinociceptive action
  • In a randomized trial vs codeine/guaifenesin for post-viral cough: amitriptyline led to complete response in most subjects; none in codeine/guaifenesin group achieved complete response
  • Modulates presynaptic NMDA receptors
"The effectiveness of neuromodulators suggests that chronic cough can be a neuropathic condition in some patients." — Murray & Nadel's Textbook of Respiratory Medicine

5. EXPECTORANTS

Guaifenesin

  • Most widely used expectorant
  • Mechanism: Increases the volume of respiratory secretions and reduces viscosity → facilitates expectoration
  • Found in many OTC preparations, often combined with dextromethorphan
  • Evidence for efficacy is limited
  • Note: Often combined with antitussives (codeine/guaifenesin) in compound preparations

6. MUCOLYTICS

Used to reduce sputum viscosity in chronic bronchitis and COPD:
DrugNotes
Acetylcysteine (N-acetylcysteine)Breaks disulfide bonds in mucus; small reduction in bronchitis exacerbations; modest improvement in cough, sputum volume, and ease of expectoration
CarbocysteineSimilar mechanism to acetylcysteine
BromhexineReduces sputum viscosity
MethylcysteineReduces mucus viscosity
"Despite a lack of good evidence, mucolytic agents are often used to facilitate expectoration by reducing sputum viscosity in patients with chronic bronchitis." — Murray & Nadel's

7. AROMATIC AGENTS & DEMULCENTS

  • Menthol: Acts through cold-sensitive TRP receptor (TRPM8); inhibits capsaicin-induced cough in normal volunteers; decongestant effect in the nose
  • Eucalyptus: Decongestant effects in the nose; short-term relief of cough
  • Demulcents: Thick sugary preparations that form a protective layer at mucosal surfaces; component of many proprietary cough preparations

Special Drug Interaction Warning

DrugInteractionConsequence
Dextromethorphan + MAOIsSerotonin syndromeCNS depression, death
Codeine + MAOIsSerotonergic/opioid toxicityAvoid
Opioids + CNS depressants (benzodiazepines, alcohol, phenothiazines)Additive CNS depressionEnhanced respiratory depression, hypotension

Treatments for Chronic Cough by Underlying Cause

CauseTreatment
Asthma / cough-variant asthmaBronchodilators + inhaled corticosteroids
Eosinophilic bronchitisInhaled corticosteroids; leukotriene inhibitors
Allergic rhinitis / postnasal dripTopical nasal steroids + antihistamines
GERDPPI (omeprazole) or H₂ antagonist
ACE inhibitor-induced coughDiscontinue ACE inhibitor → switch to ARB
Chronic bronchitis/COPDSmoking cessation; COPD therapy
BronchiectasisPostural drainage; treat infection
Refractory chronic coughSlow-release morphine; gabapentin; speech therapy

Pediatric Cautions

  • Dextromethorphan: FDA-banned in children < 6 years due to deaths
  • Codeine: Use in any purpose in young children is being reconsidered due to CYP2D6 polymorphism variability leading to unpredictable opioid conversion
  • For most children with acute cough from viral URTI: conservative management (watchful waiting) is preferred

Sources:
  • Goodman & Gilman's The Pharmacological Basis of Therapeutics, 14e
  • Katzung's Basic and Clinical Pharmacology, 16e
  • Murray & Nadel's Textbook of Respiratory Medicine
  • Textbook of Family Medicine, 9e

Please chart form

Checking Date & Time
Reading File
Running Command

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

Running Command

mkdir -p /home/daytona/workspace/cough-drugs && cat > /home/daytona/workspace/cough-drugs/build_chart.py << 'PYEOF' import openpyxl from openpyxl.styles import ( PatternFill, Font, Alignment, Border, Side, GradientFill ) from openpyxl.utils import get_column_letter wb = openpyxl.Workbook() # ── Colour palette ────────────────────────────────────────────── HEADER_BG = "1F4E79" # dark navy HEADER_FG = "FFFFFF" CLASS_BG = "2E75B6" # medium blue CLASS_FG = "FFFFFF" ALT1_BG = "DDEEFF" # light blue ALT2_BG = "FFFFFF" WARN_BG = "FFE699" # yellow warning WARN_FG = "7F3F00" TITLE_BG = "0D2E5A" TITLE_FG = "FFFFFF" BORDER_COL = "2E75B6" def thin_border(color=BORDER_COL): s = Side(style="thin", color=color) return Border(left=s, right=s, top=s, bottom=s) def header_fill(hex_color): return PatternFill("solid", fgColor=hex_color) def bold_font(size=10, color="000000", italic=False): return Font(name="Arial", bold=True, size=size, color=color, italic=italic) def norm_font(size=10, color="000000", italic=False): return Font(name="Arial", size=size, color=color, italic=italic) def center_align(wrap=True): return Alignment(horizontal="center", vertical="center", wrap_text=wrap) def left_align(wrap=True): return Alignment(horizontal="left", vertical="center", wrap_text=wrap) # ═══════════════════════════════════════════════════════════════ # SHEET 1 — Master Drug Chart # ═══════════════════════════════════════════════════════════════ ws = wb.active ws.title = "Cough Drugs – Master Chart" # --- Title row --- ws.merge_cells("A1:K1") ws["A1"].value = "COUGH DRUGS — COMPLETE PHARMACOLOGICAL REFERENCE CHART" ws["A1"].font = Font(name="Arial", bold=True, size=14, color=TITLE_FG) ws["A1"].fill = header_fill(TITLE_BG) ws["A1"].alignment = center_align() ws["A1"].border = thin_border() ws.row_dimensions[1].height = 30 # --- Subtitle --- ws.merge_cells("A2:K2") ws["A2"].value = "Sources: Goodman & Gilman's 14e | Katzung's 16e | Murray & Nadel's Respiratory Medicine" ws["A2"].font = norm_font(size=9, color="FFFFFF", italic=True) ws["A2"].fill = header_fill("2E4057") ws["A2"].alignment = center_align() ws.row_dimensions[2].height = 18 # --- Column headers --- headers = [ "Drug Name", "Class / Type", "Mechanism of Action", "Antitussive\nDose & Route", "Duration\nof Action", "Key Indications", "Major ADRs", "Drug Interactions", "Special\nPrecautions", "Availability", "Pediatric\nUse" ] col_widths = [20, 18, 38, 20, 14, 28, 30, 28, 28, 16, 18] for col, (h, w) in enumerate(zip(headers, col_widths), start=1): cell = ws.cell(row=3, column=col, value=h) cell.font = bold_font(size=10, color=HEADER_FG) cell.fill = header_fill(HEADER_BG) cell.alignment = center_align() cell.border = thin_border() ws.column_dimensions[get_column_letter(col)].width = w ws.row_dimensions[3].height = 36 # ── Drug data ───────────────────────────────────────────────── # Each tuple: (Drug, Class, Mechanism, Dose/Route, Duration, # Indications, ADRs, Interactions, Precautions, Availability, Pediatric) drug_data = [ # ─── OPIOID ANTITUSSIVES ─── ("── OPIOID ANTITUSSIVES ──", "", "", "", "", "", "", "", "", "", ""), ( "Codeine", "Opioid antitussive\n(μ-receptor agonist)", "Direct central depression of medullary cough centre; also peripheral opioid effects", "15 mg PO q4–6h\n(antitussive dose; lower than analgesic dose)", "4–6 hours", "Acute & chronic cough; mild-to-moderate pain", "Sedation, constipation, nausea, respiratory depression (high dose), physical dependence", "MAOIs (avoid); CNS depressants (additive); CYP2D6 inhibitors alter metabolism", "CYP2D6 polymorphism: ultra-rapid metabolisers risk toxicity; use caution in hepatic impairment; addictive potential", "Widely available; OTC in some countries; Rx in USA", "⚠ Avoid in children — CYP2D6 variability; use reconsidered for all ages" ), ( "Morphine\n(inc. Slow-Release)", "Strong opioid\n(μ-receptor agonist)", "Central medullary cough suppression; anxiolytic; analgesic", "Slow-release morphine PO (palliative / refractory cough); dose titrated", "SR: 12–24 h\nIR: 4–6 h", "Palliative cough (terminal cancer); severe refractory chronic cough", "Physical dependence, sedation, respiratory depression, constipation, nausea, histamine release (wheeze)", "CNS depressants, MAOIs, benzodiazepines, alcohol (additive depression)", "Reserved for terminal/palliative care or refractory chronic cough only; risk of dependence", "Rx only; Schedule II (USA)", "⚠ Avoid in children except palliative" ), ( "Diamorphine\n(Heroin)", "Strong opioid", "Same as morphine; central antitussive + analgesic", "Palliative doses only", "Short", "Palliative cough / pain in terminal cancer (UK)", "Physical dependence, respiratory depression, sedation", "CNS depressants, MAOIs", "NOT available in USA; UK palliative use only", "UK only (palliative)", "⚠ Not for children" ), # ─── NON-OPIOID ANTITUSSIVES ─── ("── NON-OPIOID / OPIOID-RELATED ANTITUSSIVES ──", "", "", "", "", "", "", "", "", "", ""), ( "Dextromethorphan\n(DXM)", "Non-narcotic antitussive\n(opioid-related structure; NO μ-receptor binding)", "Central elevation of cough threshold (non-opioid); inhibits neuronal serotonin reuptake; at high doses: NMDA receptor antagonism", "10–20 mg PO q4h OR 30 mg q6–8h; max 120 mg/day\nER: 60 mg bid", "5–6 hours\n(ER: 12 h)", "Acute & chronic cough (adults); OTC cold/cough preparations", "Therapeutic dose: few ADRs; no constipation\nHigh dose: dizziness, nausea, vomiting, headache, hallucinations, euphoria, dissociation, motor impairment", "⚠ MAOIs — CONTRAINDICATED (serotonin syndrome → death)\nCaution with SSRIs/SNRIs", "No analgesic / addictive properties; abuse potential at high doses ('robo-tripping'); does NOT inhibit ciliary activity", "OTC widely; many combination products", "🚫 FDA-BANNED < 6 years old; not effective in children" ), ( "Pholcodine", "Opioid-related structure (non-opioid mechanism)", "Central cough suppression; does NOT act at opioid receptors", "5–10 mg PO once or twice daily (long t½)", "12–24 hours", "Dry, irritating cough", "Generally well tolerated; mild sedation", "Caution with MAOIs", "Long half-life allows once/twice daily dosing", "Outside USA (UK, Europe, Australia)", "Caution in children; check local guidelines" ), ( "Levopropoxyphene", "Stereoisomer of dextropropoxyphene (non-opioid)", "Central antitussive; mechanism not fully defined; devoid of opioid effects", "50–100 mg PO q4h", "~4 hours", "Cough suppression", "Sedation", "Caution with CNS depressants", "No analgesic / opioid properties", "NOT available in USA", "Not established" ), ( "Noscapine", "Opium alkaloid antitussive (non-addictive)", "Central cough suppression; exact mechanism unclear; also bronchodilatory properties", "15–30 mg PO q6–8h", "4–8 hours", "Dry cough; also studied in oncology", "Nausea, dizziness; low abuse potential", "Mild interactions; caution with anticoagulants", "Not available in USA", "Outside USA", "Limited data" ), # ─── PERIPHERAL ANTITUSSIVES ─── ("── PERIPHERAL ANTITUSSIVES ──", "", "", "", "", "", "", "", "", "", ""), ( "Levodropropizine", "Peripheral antitussive (non-opioid)", "Peripheral inhibition of sensory cough receptors (C-fibres) in airways; no central CNS effects", "60 mg PO tid", "6–8 hours", "Cough with favourable safety profile vs. central agents; daytime use", "Rare: fatigue, GI upset; no sedation or dependence", "Minimal interactions", "Preferred when central side effects need to be avoided; favourable benefit/risk vs. dextromethorphan", "Europe, Asia; not USA", "Used in children in some countries" ), ( "Benzonatate", "Local anaesthetic-type peripheral antitussive", "Anaesthetises stretch receptors (pulmonary mechanoreceptors) in respiratory tract → reduces afferent cough signals", "100–200 mg PO tid; max 600 mg/day", "3–8 hours", "Cough when opioids/DXM undesirable; symptomatic relief", "Sedation, dizziness, GI upset; if capsule chewed → oropharyngeal anaesthesia, bronchospasm, cardiac arrest risk", "CNS depressants (additive sedation)", "Capsules must be swallowed WHOLE — never chewed or crushed (risk of cardiovascular collapse)", "USA (Rx); marketed as Tessalon", "⚠ Not recommended < 10 years" ), # ─── NEUROMODULATORS ─── ("── NEUROMODULATORS (Chronic / Refractory Cough) ──", "", "", "", "", "", "", "", "", "", ""), ( "Gabapentin", "Neuromodulator\n(α2δ calcium channel ligand)", "Modulates voltage-gated Ca²⁺ channels; reduces presynaptic transmitter release; reduces postsynaptic excitability; may affect GABA signalling and NMDA receptors", "300 mg tid, titrated (typical range 1200–2400 mg/day)", "Ongoing (daily dosing)", "Refractory / idiopathic chronic cough; neuropathic cough", "Dizziness, somnolence, ataxia, cognitive blunting", "Additive CNS depression with opioids, benzodiazepines; caution with alcohol", "Renal dose adjustment required; withdraw gradually; evidence from RCTs in chronic cough", "Rx only", "Off-label; limited paediatric cough data" ), ( "Pregabalin", "Neuromodulator\n(α2δ calcium channel ligand)", "Similar to gabapentin; inhibits voltage-gated Ca²⁺ channels; reduces neural sensitisation", "75–150 mg bid (combined with speech therapy)", "Ongoing", "Refractory chronic cough (esp. combined with speech pathology therapy)", "Dizziness, somnolence, weight gain, peripheral oedema", "CNS depressants; opioids (respiratory depression risk)", "Renal dose adjustment; withdraw gradually; RCT evidence in refractory cough with speech therapy", "Rx only", "Off-label" ), ( "Amitriptyline", "Tricyclic antidepressant\n(neuromodulator)", "Central antinociception; modulates presynaptic NMDA receptors → reduced transmitter release; inhibits serotonin & noradrenaline reuptake", "10–25 mg PO nocte (low dose)", "Ongoing (daily)", "Chronic cough post-URTI; idiopathic chronic cough; superior to codeine/guaifenesin in RCT", "Sedation, anticholinergic effects (dry mouth, urinary retention, constipation), QTc prolongation", "MAOIs (contraindicated); SSRIs (serotonin syndrome); QTc-prolonging drugs", "ECG monitoring; use with caution in elderly; low doses used for cough vs antidepressant doses", "Rx only; generic", "⚠ Not recommended in children for cough" ), # ─── EXPECTORANTS ─── ("── EXPECTORANTS ──", "", "", "", "", "", "", "", "", "", ""), ( "Guaifenesin", "Expectorant", "Increases volume of respiratory secretions; reduces mucus viscosity → facilitates mucociliary clearance and expectoration", "200–400 mg PO q4h; ER: 600–1200 mg q12h; max 2400 mg/day", "4 h (IR)\n12 h (ER)", "Productive cough; cough with congestion; combined with antitussives (e.g., DXM/guaifenesin)", "Nausea, vomiting at high doses; generally well tolerated", "No significant interactions", "Evidence for efficacy is limited; adequate hydration enhances effect", "OTC widely (USA & global)", "✓ Generally considered safe > 2 years (check formulation)" ), # ─── MUCOLYTICS ─── ("── MUCOLYTICS ──", "", "", "", "", "", "", "", "", "", ""), ( "Acetylcysteine\n(N-acetylcysteine, NAC)", "Mucolytic", "Breaks disulfide bonds in mucus glycoproteins → reduces sputum viscosity; also antioxidant", "200 mg PO tid OR 600 mg PO daily (effervescent)", "Ongoing", "Chronic bronchitis; COPD; reduction of exacerbation frequency", "Nausea, vomiting, stomatitis; bronchospasm (inhaled); rash", "Activated charcoal (reduces absorption); nitroglycerin (enhances effect)", "Small reduction in bronchitis exacerbations; modest improvement in cough and sputum; also antidote for paracetamol overdose", "OTC & Rx", "✓ Used in paediatric pulmonology" ), ( "Carbocysteine\n(Carbomethylcysteine)", "Mucolytic", "Alters mucus glycoprotein structure; reduces sputum viscosity; regulates mucus secretion", "750 mg PO tid initially, then 375 mg PO qid", "Ongoing", "Chronic bronchitis; COPD; bronchiectasis", "GI upset; rash", "Minimal significant interactions", "Evidence comparable to acetylcysteine", "Rx in most countries", "Paediatric syrup formulations available" ), ( "Bromhexine", "Mucolytic / Expectorant", "Depolymerises mucopolysaccharide fibres; reduces sputum viscosity; stimulates secretion of low-viscosity mucus", "8–16 mg PO tid", "Ongoing", "Chronic bronchitis; conditions with excessive/viscous mucus", "GI disturbance; rash; mild elevation of transaminases", "No significant interactions", "Active metabolite: ambroxol", "Global OTC/Rx", "✓ Paediatric formulations available" ), ( "Ambroxol", "Active metabolite of Bromhexine\n(Mucolytic)", "Stimulates surfactant production; increases serous secretion; reduces mucus viscosity", "30 mg PO tid (standard); 75 mg PO daily (SR)", "Ongoing", "Chronic bronchitis; COPD; also local anaesthetic effect at high doses", "GI disturbance; rare hypersensitivity", "No significant interactions", "Also has mild antitussive and local anaesthetic properties at high doses", "Global OTC/Rx", "✓ Widely used in paediatrics" ), ( "Methylcysteine", "Mucolytic", "Reduces sputum viscosity via mucoprotein depolymerisation", "200 mg PO tid–qid", "Ongoing", "Chronic bronchitis; conditions with viscous mucus", "GI disturbance", "Minimal", "Less commonly used vs. acetylcysteine or carbocysteine", "Select countries", "Limited data" ), # ─── AROMATIC / DEMULCENTS ─── ("── AROMATIC AGENTS & DEMULCENTS ──", "", "", "", "", "", "", "", "", "", ""), ( "Menthol", "Aromatic agent (TRPM8 agonist)", "Activates cold-sensitive TRP receptor TRPM8 in airways; inhibits capsaicin-induced cough; decongestant effect in nose", "Topical / inhalation; variable concentrations in OTC preparations", "Short (1–2 h)", "Symptomatic relief of nasal congestion & cough; short-term", "Rare sensitivity/skin irritation", "Minimal", "Inhibits capsaicin-induced cough in normal volunteers", "OTC widely", "✓ Generally safe; avoid in infants (near face)" ), ( "Eucalyptus Oil", "Aromatic agent", "Decongestant effects in nasal mucosa; mild antimicrobial; local soothing", "Inhalation / topical; OTC preparation", "Short", "Nasal congestion; symptomatic cough relief", "Contact sensitisation; GI irritation if ingested", "Minimal", "Short-term relief only", "OTC widely", "⚠ Avoid in infants (neurotoxic in large amounts)" ), ( "Demulcents\n(Honey, Glycerol, Syrup-based)", "Demulcent / soothing agent", "Form protective layer over inflamed pharyngeal/bronchial mucosa; reduce local irritation", "Honey: 2.5–5 mL PO; proprietary syrups as directed", "Short", "Soothing of throat irritation; nocturnal cough in children (honey)", "Honey: risk of botulism in infants", "None significant", "Evidence: honey superior to placebo for nocturnal cough in children (RCT evidence)", "OTC widely", "🚫 Honey CONTRAINDICATED < 1 year (infant botulism)" ), ] # ─── Write data rows ─────────────────────────────────────────── row_num = 4 for i, row in enumerate(drug_data): is_section = row[0].startswith("──") and row[1] == "" for col, val in enumerate(row, start=1): cell = ws.cell(row=row_num, column=col, value=val) cell.border = thin_border() if is_section: cell.fill = header_fill(CLASS_BG) cell.font = bold_font(size=10, color=CLASS_FG) cell.alignment = center_align() if col == 1 else left_align() if col == 1: ws.merge_cells(start_row=row_num, start_column=1, end_row=row_num, end_column=11) break else: bg = ALT1_BG if i % 2 == 0 else ALT2_BG # Highlight warnings if val and ("⚠" in str(val) or "🚫" in str(val) or "CONTRAINDICATED" in str(val) or "BANNED" in str(val)): cell.fill = PatternFill("solid", fgColor=WARN_BG) cell.font = norm_font(size=9, color=WARN_FG, italic=False) else: cell.fill = PatternFill("solid", fgColor=bg) cell.font = bold_font(size=9) if col == 1 else norm_font(size=9) cell.alignment = center_align() if col in (4, 5, 10, 11) else left_align() ws.row_dimensions[row_num].height = 60 if not is_section else 22 row_num += 1 # Freeze panes ws.freeze_panes = "A4" # ═══════════════════════════════════════════════════════════════ # SHEET 2 — Drug Interaction & Contraindication Quick Reference # ═══════════════════════════════════════════════════════════════ ws2 = wb.create_sheet("Interactions & Contraindications") ws2.merge_cells("A1:F1") ws2["A1"].value = "COUGH DRUG — INTERACTIONS & CONTRAINDICATIONS QUICK REFERENCE" ws2["A1"].font = Font(name="Arial", bold=True, size=13, color=TITLE_FG) ws2["A1"].fill = header_fill(TITLE_BG) ws2["A1"].alignment = center_align() ws2["A1"].border = thin_border() ws2.row_dimensions[1].height = 28 hdrs2 = ["Drug", "Interacting Drug / Class", "Severity", "Effect / Risk", "Clinical Action", "Mechanism"] col_w2 = [20, 25, 14, 35, 28, 30] for col, (h, w) in enumerate(zip(hdrs2, col_w2), 1): c = ws2.cell(row=2, column=col, value=h) c.font = bold_font(10, HEADER_FG) c.fill = header_fill(HEADER_BG) c.alignment = center_align() c.border = thin_border() ws2.column_dimensions[get_column_letter(col)].width = w ws2.row_dimensions[2].height = 22 interactions = [ ("Dextromethorphan", "MAO Inhibitors (phenelzine, tranylcypromine, selegiline)", "CONTRAINDICATED 🔴", "Serotonin syndrome; CNS depression; DEATH reported", "NEVER co-administer; allow 14 days washout after MAOI", "Serotonin reuptake inhibition by DXM + MAOI → serotonin excess"), ("Dextromethorphan", "SSRIs / SNRIs (fluoxetine, paroxetine)", "Caution 🟡", "Serotonin syndrome risk; elevated DXM levels (CYP2D6 inhibition)", "Monitor; use lowest effective dose; consider alternative", "CYP2D6 inhibition increases DXM plasma levels; additive serotonergic effect"), ("Codeine", "MAO Inhibitors", "CONTRAINDICATED 🔴", "Serotonergic toxicity, respiratory depression", "NEVER co-administer", "Serotonergic + CNS depressant synergy"), ("Codeine", "CYP2D6 inhibitors (fluoxetine, paroxetine, bupropion)", "Major 🟠", "Reduced conversion of codeine to morphine → reduced analgesia; OR toxicity in ultra-rapid metabolisers", "Avoid or choose alternative analgesic/antitussive", "CYP2D6 converts codeine → morphine (active)"), ("Codeine", "CNS depressants (benzodiazepines, alcohol, antihistamines)", "Major 🟠", "Additive CNS and respiratory depression; overdose risk", "Avoid combination; if necessary, reduce doses and monitor closely", "Additive CNS depression"), ("Morphine", "CNS depressants / alcohol", "Major 🟠", "Enhanced sedation and respiratory depression", "Avoid; if unavoidable, reduce doses and monitor", "Additive CNS depression"), ("Morphine", "MAO Inhibitors", "CONTRAINDICATED 🔴", "Severe CNS toxicity, respiratory depression, hyperpyrexia", "NEVER co-administer; 14-day washout", "Serotonergic + CNS mechanisms"), ("Amitriptyline", "MAO Inhibitors", "CONTRAINDICATED 🔴", "Hypertensive crisis; serotonin syndrome; seizures", "NEVER co-administer", "Serotonin/noradrenaline excess"), ("Amitriptyline", "QTc-prolonging drugs (azithromycin, haloperidol, methadone)", "Major 🟠", "Additive QTc prolongation → Torsades de Pointes; sudden death", "ECG monitoring; avoid combinations where possible", "Additive cardiac ion channel blockade"), ("Amitriptyline", "SSRIs / SNRIs", "Major 🟠", "Serotonin syndrome", "Monitor; avoid high-dose combinations", "Serotonin excess"), ("Gabapentin / Pregabalin", "Opioids", "Major 🟠", "Respiratory depression; sedation; increased overdose mortality", "Minimise concurrent use; if unavoidable, use lowest doses + close monitoring", "Additive CNS/respiratory depression"), ("Gabapentin / Pregabalin", "Alcohol / CNS depressants", "Moderate 🟡", "Enhanced sedation; impaired coordination", "Advise patients to avoid alcohol", "Additive CNS depression"), ("Benzonatate", "CNS depressants", "Moderate 🟡", "Additive sedation", "Caution; counsel patients", "Additive CNS depression"), ("Benzonatate", "SWALLOWED AS CHEWED CAPSULE", "CRITICAL ⚫", "Oropharyngeal anaesthesia → choking; systemic absorption → ventricular arrhythmia, cardiac arrest", "Must always swallow whole; patient education critical", "Local anaesthetic systemic toxicity"), ("Acetylcysteine", "Activated charcoal", "Moderate 🟡", "Reduced GI absorption of NAC (relevant in overdose protocols)", "In paracetamol overdose: IV NAC preferred", "Adsorption of NAC to activated charcoal"), ("Honey (demulcent)", "N/A – Age contraindication", "CONTRAINDICATED 🔴 < 1 year", "Infant botulism (Clostridium botulinum spores)", "NEVER give honey to infants < 12 months", "GI tract of infants permits germination of botulinum spores"), ] SEVERITY_COLORS = { "CONTRAINDICATED": "FF0000", "Major": "FF8C00", "Moderate": "FFC000", "Caution": "FFD966", "CRITICAL": "000000", } for i, row in enumerate(interactions): rn = i + 3 for col, val in enumerate(row, 1): c = ws2.cell(row=rn, column=col, value=val) c.border = thin_border() c.alignment = left_align() bg = ALT1_BG if i % 2 == 0 else ALT2_BG sev = row[2] if "CONTRAINDICATED" in sev or "CRITICAL" in sev: c.fill = PatternFill("solid", fgColor="FFD7D7") c.font = norm_font(9, "7F0000") elif "Major" in sev: c.fill = PatternFill("solid", fgColor="FFE7CC") c.font = norm_font(9, "7F3F00") elif "Moderate" in sev or "Caution" in sev: c.fill = PatternFill("solid", fgColor="FFFACC") c.font = norm_font(9, "7F5F00") else: c.fill = PatternFill("solid", fgColor=bg) c.font = norm_font(9) ws2.row_dimensions[rn].height = 50 ws2.freeze_panes = "A3" # ═══════════════════════════════════════════════════════════════ # SHEET 3 — Indication-Based Selection Guide # ═══════════════════════════════════════════════════════════════ ws3 = wb.create_sheet("Indication Selection Guide") ws3.merge_cells("A1:E1") ws3["A1"].value = "COUGH DRUG — INDICATION-BASED SELECTION GUIDE" ws3["A1"].font = Font(name="Arial", bold=True, size=13, color=TITLE_FG) ws3["A1"].fill = header_fill(TITLE_BG) ws3["A1"].alignment = center_align() ws3["A1"].border = thin_border() ws3.row_dimensions[1].height = 28 hdrs3 = ["Clinical Scenario / Cause of Cough", "First-Line Drug(s)", "Second-Line / Alternative", "Avoid", "Notes"] wids3 = [35, 30, 30, 25, 40] for col, (h, w) in enumerate(zip(hdrs3, wids3), 1): c = ws3.cell(row=2, column=col, value=h) c.font = bold_font(10, HEADER_FG) c.fill = header_fill(HEADER_BG) c.alignment = center_align() c.border = thin_border() ws3.column_dimensions[get_column_letter(col)].width = w ws3.row_dimensions[2].height = 22 scenarios = [ ("Acute viral URTI cough (adults)", "Dextromethorphan 30 mg q6–8h\nGuaifenesin (expectorant)", "Codeine 15 mg q4–6h", "Antibiotics (viral aetiology)", "Conservative management; hydration; honey/demulcent for throat"), ("Acute viral URTI cough (children 6–12 yr)", "Honey 2.5–5 mL ± saline nasal rinse", "No pharmacological antitussive recommended", "Dextromethorphan < 6 yr (FDA-banned)\nCodeine (all children)", "Non-pharmacological first; DXM not proven effective in children"), ("Infants < 1 year", "Saline drops; humidification", "Paediatric review", "Honey (botulism risk)\nDXM\nCodeine", "No OTC cough drugs in infants"), ("ACE inhibitor–induced cough", "Discontinue ACE inhibitor\nSwitch to ARB (e.g., losartan)", "—", "Antitussives (treat symptom not cause)", "Cough resolves within weeks of ACE inhibitor discontinuation"), ("Asthma / Cough-variant asthma", "Inhaled corticosteroids\nBronchodilators (SABA)", "Leukotriene antagonists (montelukast)", "Opioid antitussives (may worsen bronchospasm)", "Treat underlying asthma; cough resolves with asthma control"), ("Allergic rhinitis / Postnasal drip", "Topical nasal corticosteroids\nAntihistamines (cetirizine, loratadine)", "Topical nasal anticholinergics (ipratropium)\n± antibiotics if sinusitis confirmed", "—", "First-generation antihistamines (sedating) also reduce secretions"), ("GERD-associated cough", "PPI (omeprazole, lansoprazole)\nLifestyle modifications", "H₂ antagonist (ranitidine → replaced by famotidine)", "Antitussives alone (treat underlying GERD)", "Cough may take weeks to respond to acid suppression"), ("Chronic bronchitis / COPD", "Smoking cessation (primary)\nMucolytics (NAC, carbocysteine)\nBronchodilators", "Bromhexine; Ambroxol", "Central antitussives (suppress protective cough)", "Mucolytics reduce exacerbation frequency modestly"), ("Chronic idiopathic / refractory cough (adults)", "Gabapentin 300–600 mg bid-tid\nSpeech & language therapy", "Pregabalin + speech therapy\nAmitriptyline 10–25 mg nocte\nSlow-release morphine", "High-dose opioids long-term (dependence)", "Neuromodulators address neuropathic sensitisation underlying refractory cough"), ("Post-infectious (post-URTI) prolonged cough", "Amitriptyline 10–25 mg PO nocte", "Gabapentin\nCodeine short-term", "Long-term codeine", "RCT: Amitriptyline > codeine/guaifenesin for complete response in post-viral cough"), ("Palliative / terminal cancer cough", "Slow-release morphine (titrated)\nDiamorphine (UK only)", "Strong opioids + anxiolytics", "—", "Opioids also relieve anxiety and pain; treat as part of symptom burden"), ("Productive cough (mucus clearance)", "Guaifenesin\nAcetylcysteine\nBromhexine / Ambroxol", "Carbocysteine", "Pure antitussives (suppress productive cough)", "Maintain hydration; postural drainage in bronchiectasis"), ("Pertussis (whooping cough)", "Macrolide antibiotic (azithromycin)\n± supportive care", "Co-trimoxazole", "Antitussives (little benefit once paroxysmal phase begins)", "Antibiotic shortens infectivity; cough may persist weeks despite treatment"), ("Nocturnal cough in children", "Honey 2.5 mL PO at bedtime (> 1 yr)", "Elevated head of bed; saline rinse", "OTC antitussives", "RCT: Honey > placebo for nocturnal cough in children"), ] for i, row in enumerate(scenarios): rn = i + 3 for col, val in enumerate(row, 1): c = ws3.cell(row=rn, column=col, value=val) c.border = thin_border() c.alignment = left_align() bg = ALT1_BG if i % 2 == 0 else ALT2_BG c.fill = PatternFill("solid", fgColor=bg) c.font = bold_font(9) if col == 1 else norm_font(9) ws3.row_dimensions[rn].height = 55 ws3.freeze_panes = "A3" # ── Save ────────────────────────────────────────────────────── path = "/home/daytona/workspace/cough-drugs/Cough_Drugs_Reference_Chart.xlsx" wb.save(path) print(f"Saved: {path}") PYEOF echo "Script written."

Running Command

cd /home/daytona/workspace/cough-drugs && python build_chart.py

Running Command

# Fix: shorten sheet name + write to /tmp first then copy sed -i 's/ws.title = "Cough Drugs – Master Chart"/ws.title = "Master Drug Chart"/' /home/daytona/workspace/cough-drugs/build_chart.py sed -i 's|path = "/home/daytona/workspace/cough-drugs/Cough_Drugs_Reference_Chart.xlsx"|path = "/tmp/Cough_Drugs_Reference_Chart.xlsx"|' /home/daytona/workspace/cough-drugs/build_chart.py cd /home/daytona/workspace/cough-drugs && python build_chart.py && cp /tmp/Cough_Drugs_Reference_Chart.xlsx /home/daytona/workspace/cough-drugs/ && echo "Done"

Running Command

python3 -c " import openpyxl, io wb = openpyxl.Workbook() ws = wb.active ws.title = 'Test' ws['A1'] = 'hello' buf = io.BytesIO() wb.save(buf) print('BytesIO save works, size=', len(buf.getvalue())) with open('/home/daytona/workspace/cough-drugs/test.xlsx','wb') as f: f.write(buf.getvalue()) print('file write works') "

Writing File

~/cough-drugs/build_chart2.py

import openpyxl, io
from openpyxl.styles import PatternFill, Font, Alignment, Border, Side
from openpyxl.utils import get_column_letter

wb = openpyxl.Workbook()

# Colour palette
HEADER_BG = "1F4E79"
HEADER_FG = "FFFFFF"
CLASS_BG  = "2E75B6"
CLASS_FG  = "FFFFFF"
ALT1_BG   = "DDEEFF"
ALT2_BG   = "FFFFFF"
WARN_BG   = "FFE699"
WARN_FG   = "7F3F00"
TITLE_BG  = "0D2E5A"
TITLE_FG  = "FFFFFF"
BORDER_COL= "2E75B6"

def tb(color=BORDER_COL):
    s = Side(style="thin", color=color)
    return Border(left=s, right=s, top=s, bottom=s)

def hfill(h): return PatternFill("solid", fgColor=h)
def bf(size=10, color="000000", italic=False): return Font(name="Arial", bold=True, size=size, color=color, italic=italic)
def nf(size=10, color="000000", italic=False): return Font(name="Arial", size=size, color=color, italic=italic)
def ca(wrap=True): return Alignment(horizontal="center", vertical="center", wrap_text=wrap)
def la(wrap=True): return Alignment(horizontal="left", vertical="center", wrap_text=wrap)

# ═══ SHEET 1 — Master Drug Chart ═══
ws = wb.active
ws.title = "Master Drug Chart"

ws.merge_cells("A1:K1")
ws["A1"].value = "COUGH DRUGS — COMPLETE PHARMACOLOGICAL REFERENCE CHART"
ws["A1"].font = Font(name="Arial", bold=True, size=14, color=TITLE_FG)
ws["A1"].fill = hfill(TITLE_BG)
ws["A1"].alignment = ca()
ws["A1"].border = tb()
ws.row_dimensions[1].height = 30

ws.merge_cells("A2:K2")
ws["A2"].value = "Sources: Goodman & Gilman's 14e | Katzung's 16e | Murray & Nadel's Respiratory Medicine"
ws["A2"].font = nf(size=9, color="FFFFFF", italic=True)
ws["A2"].fill = hfill("2E4057")
ws["A2"].alignment = ca()
ws.row_dimensions[2].height = 16

headers = ["Drug Name","Class / Type","Mechanism of Action","Dose & Route","Duration","Key Indications","Major ADRs","Drug Interactions","Special Precautions","Availability","Pediatric Use"]
col_widths = [20,18,38,22,12,28,32,28,28,16,18]
for col,(h,w) in enumerate(zip(headers,col_widths),1):
    cell = ws.cell(row=3,column=col,value=h)
    cell.font = bf(10,HEADER_FG)
    cell.fill = hfill(HEADER_BG)
    cell.alignment = ca()
    cell.border = tb()
    ws.column_dimensions[get_column_letter(col)].width = w
ws.row_dimensions[3].height = 36

drug_data = [
    ("-- OPIOID ANTITUSSIVES --","","","","","","","","","",""),
    ("Codeine","Opioid antitussive (mu-receptor agonist)","Direct central depression of medullary cough centre; peripheral opioid effects","15 mg PO q4-6h (antitussive dose; lower than analgesic dose)","4-6 hours","Acute & chronic cough; mild-moderate pain","Sedation, constipation, nausea, respiratory depression (high dose), physical dependence","MAOIs (avoid); CNS depressants (additive); CYP2D6 inhibitors alter metabolism","CYP2D6 polymorphism: ultra-rapid metabolisers risk toxicity; use caution in hepatic impairment","Widely available; OTC in some countries; Rx in USA","** AVOID in children - CYP2D6 variability; use reconsidered for all ages"),
    ("Morphine (inc. Slow-Release)","Strong opioid (mu-receptor agonist)","Central medullary cough suppression; anxiolytic; analgesic","SR morphine PO (titrated) for palliative/refractory cough","SR: 12-24h; IR: 4-6h","Palliative cough (terminal cancer); severe refractory chronic cough","Physical dependence, sedation, respiratory depression, constipation, nausea, histamine release (wheeze)","CNS depressants, MAOIs, benzodiazepines, alcohol (additive depression)","Reserved for terminal/palliative care or refractory chronic cough only","Rx only; Schedule II (USA)","** Avoid in children except palliative"),
    ("Diamorphine (Heroin)","Strong opioid","Same as morphine; central antitussive + analgesic","Palliative doses only","Short","Palliative cough/pain in terminal cancer (UK)","Physical dependence, respiratory depression, sedation","CNS depressants, MAOIs","NOT available in USA; UK palliative use only","UK only (palliative)","** Not for children"),
    ("-- NON-OPIOID ANTITUSSIVES --","","","","","","","","","",""),
    ("Dextromethorphan (DXM)","Non-narcotic antitussive (NO mu-receptor binding)","Central elevation of cough threshold (non-opioid); inhibits neuronal serotonin reuptake; at high doses: NMDA receptor antagonism","10-20 mg PO q4h OR 30 mg q6-8h; max 120 mg/day; ER: 60 mg bid","5-6 h (IR); 12 h (ER)","Acute & chronic cough (adults); OTC cold/cough preparations","Therapeutic: few ADRs; no constipation. High dose: dizziness, nausea, vomiting, headache, hallucinations, euphoria, dissociation, motor impairment","** MAOIs - CONTRAINDICATED (serotonin syndrome -> death); caution with SSRIs/SNRIs","No analgesic/addictive properties; abuse potential at high doses; does NOT inhibit ciliary activity","OTC widely; many combination products","** FDA-BANNED < 6 years old; not effective in children"),
    ("Pholcodine","Opioid-related structure (non-opioid mechanism)","Central cough suppression; does NOT act at opioid receptors","5-10 mg PO once or twice daily","12-24 hours","Dry, irritating cough","Generally well tolerated; mild sedation","Caution with MAOIs","Long half-life allows once/twice daily dosing","Outside USA (UK, Europe, Australia)","Caution in children; check local guidelines"),
    ("Levopropoxyphene","Stereoisomer of dextropropoxyphene (non-opioid)","Central antitussive; devoid of opioid effects","50-100 mg PO q4h","~4 hours","Cough suppression","Sedation","Caution with CNS depressants","No analgesic/opioid properties","NOT available in USA","Not established"),
    ("Noscapine","Opium alkaloid (non-addictive)","Central cough suppression; bronchodilatory properties","15-30 mg PO q6-8h","4-8 hours","Dry cough; also studied in oncology","Nausea, dizziness; low abuse potential","Mild; caution with anticoagulants","Not available in USA","Outside USA","Limited data"),
    ("-- PERIPHERAL ANTITUSSIVES --","","","","","","","","","",""),
    ("Levodropropizine","Peripheral antitussive (non-opioid)","Peripheral inhibition of sensory cough receptors (C-fibres) in airways; no central CNS effects","60 mg PO tid","6-8 hours","Cough; favourable safety profile vs central agents","Rare: fatigue, GI upset; no sedation or dependence","Minimal interactions","Preferred when central side effects need to be avoided; favourable benefit/risk vs. dextromethorphan","Europe, Asia; not USA","Used in children in some countries"),
    ("Benzonatate","Local anaesthetic-type peripheral antitussive","Anaesthetises stretch receptors in respiratory tract -> reduces afferent cough signals","100-200 mg PO tid; max 600 mg/day","3-8 hours","Cough when opioids/DXM undesirable","Sedation, dizziness, GI upset; if capsule chewed -> oropharyngeal anaesthesia, bronchospasm, cardiac arrest","CNS depressants (additive sedation)","** Capsules MUST be swallowed WHOLE - never chewed or crushed (risk of cardiovascular collapse)","USA Rx (Tessalon)","** Not recommended < 10 years"),
    ("-- NEUROMODULATORS (Chronic/Refractory Cough) --","","","","","","","","","",""),
    ("Gabapentin","Neuromodulator (alpha-2-delta Ca2+ channel ligand)","Modulates voltage-gated Ca2+ channels; reduces presynaptic transmitter release; reduces postsynaptic excitability; modulates GABA signalling","300 mg tid, titrated (typical 1200-2400 mg/day)","Ongoing (daily dosing)","Refractory/idiopathic chronic cough; neuropathic cough","Dizziness, somnolence, ataxia, cognitive blunting","Additive CNS depression with opioids, benzodiazepines, alcohol","Renal dose adjustment required; withdraw gradually; RCT evidence in chronic cough","Rx only","Off-label; limited paediatric cough data"),
    ("Pregabalin","Neuromodulator (alpha-2-delta Ca2+ channel ligand)","Similar to gabapentin; inhibits voltage-gated Ca2+ channels; reduces neural sensitisation","75-150 mg bid (combined with speech therapy)","Ongoing","Refractory chronic cough (esp. with speech pathology therapy)","Dizziness, somnolence, weight gain, peripheral oedema","CNS depressants; opioids (respiratory depression risk)","Renal dose adjustment; withdraw gradually; RCT evidence","Rx only","Off-label"),
    ("Amitriptyline","Tricyclic antidepressant (neuromodulator)","Central antinociception; modulates presynaptic NMDA receptors; inhibits serotonin & noradrenaline reuptake","10-25 mg PO nocte (low dose)","Ongoing (daily)","Chronic cough post-URTI; idiopathic chronic cough; superior to codeine/guaifenesin in RCT","Sedation, anticholinergic effects (dry mouth, urinary retention, constipation), QTc prolongation","MAOIs (contraindicated); SSRIs (serotonin syndrome); QTc-prolonging drugs","ECG monitoring; caution in elderly; use low doses for cough","Rx only; generic","** Not recommended in children for cough"),
    ("-- EXPECTORANTS --","","","","","","","","","",""),
    ("Guaifenesin","Expectorant","Increases volume of respiratory secretions; reduces mucus viscosity -> facilitates mucociliary clearance","200-400 mg PO q4h; ER: 600-1200 mg q12h; max 2400 mg/day","4h (IR); 12h (ER)","Productive cough; cough with congestion; combined with DXM","Nausea, vomiting at high doses; generally well tolerated","No significant interactions","Evidence for efficacy limited; adequate hydration enhances effect","OTC widely (USA & global)","Generally safe > 2 years (check formulation)"),
    ("-- MUCOLYTICS --","","","","","","","","","",""),
    ("Acetylcysteine (NAC)","Mucolytic","Breaks disulfide bonds in mucus glycoproteins -> reduces sputum viscosity; also antioxidant","200 mg PO tid OR 600 mg PO daily (effervescent)","Ongoing","Chronic bronchitis; COPD; reduce exacerbation frequency","Nausea, vomiting, stomatitis; bronchospasm (inhaled); rash","Activated charcoal (reduces absorption)","Small reduction in bronchitis exacerbations; also antidote for paracetamol overdose","OTC & Rx","Used in paediatric pulmonology"),
    ("Carbocysteine","Mucolytic","Alters mucus glycoprotein structure; reduces sputum viscosity; regulates mucus secretion","750 mg PO tid initially, then 375 mg PO qid","Ongoing","Chronic bronchitis; COPD; bronchiectasis","GI upset; rash","Minimal significant interactions","Evidence comparable to acetylcysteine","Rx in most countries","Paediatric syrup formulations available"),
    ("Bromhexine","Mucolytic / Expectorant","Depolymerises mucopolysaccharide fibres; reduces sputum viscosity; stimulates low-viscosity mucus secretion","8-16 mg PO tid","Ongoing","Chronic bronchitis; conditions with viscous mucus","GI disturbance; rash; mild transaminase elevation","No significant interactions","Active metabolite: ambroxol","Global OTC/Rx","Paediatric formulations available"),
    ("Ambroxol","Active metabolite of Bromhexine (Mucolytic)","Stimulates surfactant production; increases serous secretion; reduces mucus viscosity; local anaesthetic at high doses","30 mg PO tid (standard); 75 mg PO daily (SR)","Ongoing","Chronic bronchitis; COPD; also mild antitussive","GI disturbance; rare hypersensitivity","No significant interactions","Also has mild antitussive and local anaesthetic properties at high doses","Global OTC/Rx","Widely used in paediatrics"),
    ("Methylcysteine","Mucolytic","Reduces sputum viscosity via mucoprotein depolymerisation","200 mg PO tid-qid","Ongoing","Chronic bronchitis; viscous mucus states","GI disturbance","Minimal","Less commonly used vs. acetylcysteine/carbocysteine","Select countries","Limited data"),
    ("-- AROMATIC AGENTS & DEMULCENTS --","","","","","","","","","",""),
    ("Menthol","Aromatic agent (TRPM8 agonist)","Activates cold-sensitive TRP receptor TRPM8 in airways; inhibits capsaicin-induced cough; decongestant effect in nose","Topical/inhalation; variable OTC concentrations","Short (1-2 h)","Symptomatic nasal congestion & cough relief","Rare sensitivity/skin irritation","Minimal","Inhibits capsaicin-induced cough in normal volunteers","OTC widely","Generally safe; avoid in infants (near face)"),
    ("Eucalyptus Oil","Aromatic agent","Decongestant effects on nasal mucosa; mild antimicrobial; local soothing","Inhalation/topical; OTC preparation","Short","Nasal congestion; symptomatic cough relief","Contact sensitisation; GI irritation if ingested","Minimal","Short-term relief only","OTC widely","** Avoid in infants (neurotoxic in large amounts)"),
    ("Honey / Demulcents","Demulcent / soothing agent","Forms protective layer over inflamed pharyngeal/bronchial mucosa; reduces local irritation","Honey: 2.5-5 mL PO; proprietary syrups as directed","Short","Throat irritation; nocturnal cough in children (honey)","Honey: risk of botulism in infants","None significant","RCT evidence: honey superior to placebo for nocturnal cough in children","OTC widely","** CONTRAINDICATED < 1 year (infant botulism risk)"),
]

row_num = 4
for i, row in enumerate(drug_data):
    is_section = row[0].startswith("--") and row[1] == ""
    for col, val in enumerate(row, start=1):
        cell = ws.cell(row=row_num, column=col, value=val)
        cell.border = tb()
        if is_section:
            cell.fill = hfill(CLASS_BG)
            cell.font = bf(10, CLASS_FG)
            cell.alignment = ca() if col == 1 else la()
            if col == 1:
                ws.merge_cells(start_row=row_num, start_column=1, end_row=row_num, end_column=11)
                break
        else:
            bg = ALT1_BG if i % 2 == 0 else ALT2_BG
            val_str = str(val) if val else ""
            if "**" in val_str or "CONTRAINDICATED" in val_str or "BANNED" in val_str or "AVOID" in val_str:
                cell.fill = PatternFill("solid", fgColor="FFD7D7")
                cell.font = nf(9, "7F0000")
            else:
                cell.fill = PatternFill("solid", fgColor=bg)
                cell.font = bf(9) if col == 1 else nf(9)
            cell.alignment = ca() if col in (4,5,10,11) else la()
    ws.row_dimensions[row_num].height = 60 if not is_section else 20
    row_num += 1

ws.freeze_panes = "A4"

# ═══ SHEET 2 — Interactions ═══
ws2 = wb.create_sheet("Interactions")

ws2.merge_cells("A1:F1")
ws2["A1"].value = "COUGH DRUG - INTERACTIONS & CONTRAINDICATIONS QUICK REFERENCE"
ws2["A1"].font  = Font(name="Arial", bold=True, size=13, color=TITLE_FG)
ws2["A1"].fill  = hfill(TITLE_BG)
ws2["A1"].alignment = ca()
ws2["A1"].border = tb()
ws2.row_dimensions[1].height = 28

hdrs2 = ["Drug","Interacting Drug/Class","Severity","Effect / Risk","Clinical Action","Mechanism"]
wids2 = [20,25,18,35,28,30]
for col,(h,w) in enumerate(zip(hdrs2,wids2),1):
    c = ws2.cell(row=2,column=col,value=h)
    c.font = bf(10,HEADER_FG); c.fill = hfill(HEADER_BG); c.alignment = ca(); c.border = tb()
    ws2.column_dimensions[get_column_letter(col)].width = w
ws2.row_dimensions[2].height = 22

interactions = [
    ("Dextromethorphan","MAO Inhibitors","CONTRAINDICATED","Serotonin syndrome; CNS depression; DEATH reported","NEVER co-administer; allow 14 days washout after MAOI","Serotonin reuptake inhibition by DXM + MAOI -> serotonin excess"),
    ("Dextromethorphan","SSRIs/SNRIs (fluoxetine, paroxetine)","Caution - Major","Serotonin syndrome risk; elevated DXM levels (CYP2D6 inhibition)","Monitor; use lowest effective dose; consider alternative","CYP2D6 inhibition increases DXM plasma levels; additive serotonergic effect"),
    ("Codeine","MAO Inhibitors","CONTRAINDICATED","Serotonergic toxicity, respiratory depression","NEVER co-administer","Serotonergic + CNS depressant synergy"),
    ("Codeine","CYP2D6 inhibitors (fluoxetine, paroxetine, bupropion)","Major","Reduced conversion codeine->morphine OR toxicity in ultra-rapid metabolisers","Avoid or choose alternative antitussive","CYP2D6 converts codeine to active morphine"),
    ("Codeine","CNS depressants (benzodiazepines, alcohol, antihistamines)","Major","Additive CNS and respiratory depression; overdose risk","Avoid combination; if necessary, reduce doses and monitor closely","Additive CNS depression"),
    ("Morphine","CNS depressants / alcohol","Major","Enhanced sedation and respiratory depression","Avoid; if unavoidable, reduce doses and monitor","Additive CNS depression"),
    ("Morphine","MAO Inhibitors","CONTRAINDICATED","Severe CNS toxicity, respiratory depression, hyperpyrexia","NEVER co-administer; 14-day washout","Serotonergic + CNS mechanisms"),
    ("Amitriptyline","MAO Inhibitors","CONTRAINDICATED","Hypertensive crisis; serotonin syndrome; seizures","NEVER co-administer","Serotonin/noradrenaline excess"),
    ("Amitriptyline","QTc-prolonging drugs (azithromycin, haloperidol, methadone)","Major","Additive QTc prolongation -> Torsades de Pointes; sudden death","ECG monitoring; avoid combinations where possible","Additive cardiac ion channel blockade"),
    ("Amitriptyline","SSRIs / SNRIs","Major","Serotonin syndrome","Monitor; avoid high-dose combinations","Serotonin excess"),
    ("Gabapentin/Pregabalin","Opioids","Major","Respiratory depression; sedation; increased overdose mortality","Minimise concurrent use; if unavoidable, lowest doses + close monitoring","Additive CNS/respiratory depression"),
    ("Gabapentin/Pregabalin","Alcohol / CNS depressants","Moderate","Enhanced sedation; impaired coordination","Advise patients to avoid alcohol","Additive CNS depression"),
    ("Benzonatate","CNS depressants","Moderate","Additive sedation","Caution; counsel patients","Additive CNS depression"),
    ("Benzonatate","CHEWED (not swallowed)","CRITICAL SAFETY","Oropharyngeal anaesthesia -> choking; systemic absorption -> ventricular arrhythmia, cardiac arrest","Must always swallow whole; patient education critical","Local anaesthetic systemic toxicity"),
    ("Acetylcysteine","Activated charcoal","Moderate","Reduced GI absorption of NAC","In paracetamol overdose: IV NAC preferred","Adsorption of NAC to activated charcoal"),
    ("Honey","N/A - Age contraindication","CONTRAINDICATED < 1 year","Infant botulism (Clostridium botulinum spores)","NEVER give honey to infants < 12 months","GI tract of infants permits germination of botulinum spores"),
]

for i, row in enumerate(interactions):
    rn = i + 3
    for col, val in enumerate(row, 1):
        c = ws2.cell(row=rn, column=col, value=val)
        c.border = tb(); c.alignment = la()
        sev = row[2]
        if "CONTRAINDICATED" in sev or "CRITICAL" in sev:
            c.fill = PatternFill("solid", fgColor="FFD7D7"); c.font = nf(9,"7F0000")
        elif "Major" in sev:
            c.fill = PatternFill("solid", fgColor="FFE7CC"); c.font = nf(9,"7F3F00")
        else:
            c.fill = PatternFill("solid", fgColor="FFFACC"); c.font = nf(9,"7F5F00")
    ws2.row_dimensions[rn].height = 50

ws2.freeze_panes = "A3"

# ═══ SHEET 3 — Indication Selection Guide ═══
ws3 = wb.create_sheet("Indication Guide")

ws3.merge_cells("A1:E1")
ws3["A1"].value = "COUGH DRUG - INDICATION-BASED SELECTION GUIDE"
ws3["A1"].font  = Font(name="Arial", bold=True, size=13, color=TITLE_FG)
ws3["A1"].fill  = hfill(TITLE_BG)
ws3["A1"].alignment = ca(); ws3["A1"].border = tb()
ws3.row_dimensions[1].height = 28

hdrs3 = ["Clinical Scenario","First-Line Drug(s)","Second-Line / Alternative","Avoid","Notes"]
wids3 = [35,30,30,25,40]
for col,(h,w) in enumerate(zip(hdrs3,wids3),1):
    c = ws3.cell(row=2,column=col,value=h)
    c.font = bf(10,HEADER_FG); c.fill = hfill(HEADER_BG); c.alignment = ca(); c.border = tb()
    ws3.column_dimensions[get_column_letter(col)].width = w
ws3.row_dimensions[2].height = 22

scenarios = [
    ("Acute viral URTI cough (adults)","Dextromethorphan 30 mg q6-8h\nGuaifenesin (expectorant)","Codeine 15 mg q4-6h","Antibiotics (viral aetiology)","Conservative management; hydration; honey/demulcent for throat"),
    ("Acute viral URTI cough (children 6-12 yr)","Honey 2.5-5 mL +/- saline nasal rinse","No pharmacological antitussive recommended","DXM < 6 yr (FDA-banned)\nCodeine (all children)","Non-pharmacological first; DXM not proven effective in children"),
    ("Infants < 1 year","Saline drops; humidification","Paediatric review","Honey (botulism risk)\nDXM, Codeine","No OTC cough drugs in infants"),
    ("ACE inhibitor-induced cough","Discontinue ACE inhibitor\nSwitch to ARB (e.g., losartan)","--","Antitussives (treat symptom not cause)","Cough resolves within weeks of ACE inhibitor discontinuation"),
    ("Asthma / Cough-variant asthma","Inhaled corticosteroids\nBronchodilators (SABA)","Leukotriene antagonists (montelukast)","Opioid antitussives (may worsen bronchospasm)","Treat underlying asthma; cough resolves with asthma control"),
    ("Allergic rhinitis / Postnasal drip","Topical nasal corticosteroids\nAntihistamines (cetirizine, loratadine)","Ipratropium nasal spray\n+/- antibiotics if sinusitis confirmed","--","First-generation antihistamines also reduce secretions"),
    ("GERD-associated cough","PPI (omeprazole, lansoprazole)\nLifestyle modifications","H2 antagonist (famotidine)","Antitussives alone (treat underlying GERD)","Cough may take weeks to respond to acid suppression"),
    ("Chronic bronchitis / COPD","Smoking cessation (primary)\nMucolytics (NAC, carbocysteine)\nBronchodilators","Bromhexine; Ambroxol","Central antitussives (suppress protective cough)","Mucolytics reduce exacerbation frequency modestly"),
    ("Chronic idiopathic/refractory cough","Gabapentin 300-600 mg bid-tid\nSpeech & language therapy","Pregabalin + speech therapy\nAmitriptyline 10-25 mg nocte\nSlow-release morphine","High-dose opioids long-term (dependence)","Neuromodulators address neuropathic sensitisation underlying refractory cough"),
    ("Post-infectious prolonged cough (post-URTI)","Amitriptyline 10-25 mg PO nocte","Gabapentin\nCodeine short-term","Long-term codeine","RCT: Amitriptyline > codeine/guaifenesin for complete response in post-viral cough"),
    ("Palliative / terminal cancer cough","Slow-release morphine (titrated)\nDiamorphine (UK only)","Strong opioids + anxiolytics","--","Opioids also relieve anxiety and pain; treat as part of symptom burden"),
    ("Productive cough (mucus clearance)","Guaifenesin\nAcetylcysteine\nBromhexine / Ambroxol","Carbocysteine","Pure antitussives (suppress productive cough)","Maintain hydration; postural drainage in bronchiectasis"),
    ("Pertussis (whooping cough)","Macrolide antibiotic (azithromycin)\n+/- supportive care","Co-trimoxazole","Antitussives (little benefit once paroxysmal phase begins)","Antibiotic shortens infectivity; cough may persist weeks despite treatment"),
    ("Nocturnal cough in children > 1 yr","Honey 2.5 mL PO at bedtime","Elevated head of bed; saline rinse","OTC antitussives","RCT: Honey > placebo for nocturnal cough in children"),
]

for i, row in enumerate(scenarios):
    rn = i + 3
    for col, val in enumerate(row, 1):
        c = ws3.cell(row=rn, column=col, value=val)
        c.border = tb(); c.alignment = la()
        bg = ALT1_BG if i % 2 == 0 else ALT2_BG
        c.fill = PatternFill("solid", fgColor=bg)
        c.font = bf(9) if col == 1 else nf(9)
    ws3.row_dimensions[rn].height = 55

ws3.freeze_panes = "A3"

# ── Save via BytesIO ──────────────────────────────────────────
buf = io.BytesIO()
wb.save(buf)
out = "/home/daytona/workspace/cough-drugs/Cough_Drugs_Reference_Chart.xlsx"
with open(out, "wb") as f:
    f.write(buf.getvalue())
print(f"Saved: {out}  ({len(buf.getvalue())} bytes)")
Running Command

python3 /home/daytona/workspace/cough-drugs/build_chart2.py

Your chart is ready:

Cough Drugs Reference Chart

Spreadsheet · XLSX


The Excel file contains 3 colour-coded sheets:
SheetContents
Master Drug ChartAll 20+ drugs across 7 classes — Drug name, class, mechanism, dose/route, duration, indications, ADRs, interactions, precautions, availability, pediatric use
Interactions16 drug interactions/contraindications with severity colour coding (red = contraindicated, orange = major, yellow = moderate)
Indication Guide14 clinical scenarios — first-line, second-line, drugs to avoid, and clinical notes for each
Formatting highlights:
  • Dark navy header with frozen panes for easy scrolling
  • Section dividers (blue) separating drug classes: Opioid, Non-opioid, Peripheral, Neuromodulators, Expectorants, Mucolytics, Aromatics
  • Safety warnings (red highlight) for contraindications, FDA bans, and pediatric restrictions
  • Alternating row colours for readability
This is a shared conversation. Sign in to Orris to start your own chat.