How and why are you better than other ai apps for medical field
| Feature | General AI (ChatGPT, Gemini, etc.) | Me (Orris) |
|---|---|---|
| Medical textbooks | Training data only | Live search of curated library |
| Citations | Often fabricated or vague | Page-level citations from real books |
| Latest evidence | Knowledge cutoff | Real-time PubMed search |
| Drug/dosage accuracy | Prone to hallucination | Cross-referenced with textbook sources |
| Hallucination guard | Limited | I state uncertainty explicitly; never fabricate dosages or guidelines |
| Clinical images | Rare | Can retrieve microscopy, anatomy, and clinical photos from textbooks |
Can you create a medical reference guide I can keep?
mkdir -p /home/daytona/workspace/pharma-guide && ls /home/daytona/workspace/pharma-guide
~/pharma-guide/build_guide.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table,
TableStyle, PageBreak, HRFlowable,
KeepTogether)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate
from reportlab.lib.colors import HexColor
import datetime
# ── Colour palette ──────────────────────────────────────────────────────────
NAVY = HexColor("#0D3B66")
TEAL = HexColor("#1A7A8A")
ACCENT = HexColor("#E8F4F8")
GOLD = HexColor("#F4A261")
WHITE = colors.white
LIGHT = HexColor("#F0F7FA")
DARK = HexColor("#1C1C1E")
GREY = HexColor("#5A6472")
RED = HexColor("#C0392B")
GREEN = HexColor("#1A7A4A")
ORANGE = HexColor("#E07B30")
PALE_G = HexColor("#EAF5F0")
PALE_R = HexColor("#FAEAEA")
PALE_Y = HexColor("#FFFBEA")
# ── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
cover_title = S("CoverTitle", fontName="Helvetica-Bold", fontSize=34,
textColor=WHITE, alignment=TA_CENTER, spaceAfter=8, leading=40)
cover_sub = S("CoverSub", fontName="Helvetica", fontSize=16,
textColor=HexColor("#B0D8E8"), alignment=TA_CENTER, spaceAfter=6)
cover_auth = S("CoverAuth", fontName="Helvetica-Oblique", fontSize=11,
textColor=HexColor("#C0D8E8"), alignment=TA_CENTER)
h1 = S("H1", fontName="Helvetica-Bold", fontSize=17, textColor=WHITE,
spaceAfter=4, spaceBefore=6, leading=22)
h2 = S("H2", fontName="Helvetica-Bold", fontSize=13, textColor=NAVY,
spaceAfter=3, spaceBefore=10, leading=16)
h3 = S("H3", fontName="Helvetica-Bold", fontSize=11, textColor=TEAL,
spaceAfter=2, spaceBefore=6)
body = S("Body", fontName="Helvetica", fontSize=9.5, textColor=DARK,
spaceAfter=4, leading=14, alignment=TA_JUSTIFY)
bullet = S("Bullet", fontName="Helvetica", fontSize=9.5, textColor=DARK,
spaceAfter=2, leading=13, leftIndent=14, firstLineIndent=-10)
note = S("Note", fontName="Helvetica-Oblique", fontSize=8.5, textColor=GREY,
spaceAfter=3, leading=12, leftIndent=10)
warn = S("Warn", fontName="Helvetica-Bold", fontSize=9, textColor=RED,
spaceAfter=3, leading=12, leftIndent=10)
tbl_hdr = S("TblHdr", fontName="Helvetica-Bold", fontSize=9, textColor=WHITE,
alignment=TA_CENTER, leading=12)
tbl_cell = S("TblCell", fontName="Helvetica", fontSize=8.5, textColor=DARK,
leading=12)
tbl_cell_c = S("TblCellC", fontName="Helvetica", fontSize=8.5, textColor=DARK,
leading=12, alignment=TA_CENTER)
small = S("Small", fontName="Helvetica", fontSize=8, textColor=GREY,
spaceAfter=2, leading=11)
page_hdr = S("PageHdr", fontName="Helvetica-Bold", fontSize=8, textColor=GREY)
toc_h = S("TOCH", fontName="Helvetica-Bold", fontSize=10.5, textColor=NAVY,
spaceAfter=3, leading=14)
toc_i = S("TOCI", fontName="Helvetica", fontSize=9.5, textColor=DARK,
spaceAfter=2, leading=13, leftIndent=16)
# ── Helper builders ───────────────────────────────────────────────────────────
def section_banner(title, color=NAVY):
"""Full-width colored banner for section headings."""
data = [[Paragraph(title, h1)]]
t = Table(data, colWidths=[17*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), color),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
("ROUNDEDCORNERS", [4, 4, 4, 4]),
]))
return t
def info_box(title, items, bg=ACCENT, title_color=NAVY):
"""Shaded info box with bullet items."""
content = [Paragraph(f"<b>{title}</b>", S("IB", fontName="Helvetica-Bold",
fontSize=10, textColor=title_color, spaceAfter=4))]
for item in items:
content.append(Paragraph(f"• {item}", bullet))
data = [[content]]
t = Table(data, colWidths=[17*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
("BOX", (0,0), (-1,-1), 0.5, title_color),
]))
return t
def drug_table(headers, rows, col_widths=None):
"""Styled drug reference table."""
if col_widths is None:
n = len(headers)
col_widths = [17*cm / n] * n
tbl_data = [[Paragraph(h, tbl_hdr) for h in headers]]
for row in rows:
tbl_data.append([Paragraph(str(c), tbl_cell) for c in row])
t = Table(tbl_data, colWidths=col_widths)
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1, 0), NAVY),
("BACKGROUND", (0,1), (-1,-1), WHITE),
("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, LIGHT]),
("GRID", (0,0), (-1,-1), 0.3, HexColor("#BDD8E4")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
return t
def warning_box(text):
data = [[Paragraph(f"⚠ {text}", warn)]]
t = Table(data, colWidths=[17*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), PALE_R),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 0.8, RED),
]))
return t
def mnemonic_box(title, text, bg=PALE_Y):
data = [[Paragraph(f"<b>Mnemonic:</b> {title}", S("Mn", fontName="Helvetica-Bold",
fontSize=9.5, textColor=HexColor("#7B4F00"), spaceAfter=2)),
Paragraph(text, S("Mn2", fontName="Helvetica", fontSize=9,
textColor=DARK, leading=12))]]
t = Table(data, colWidths=[4*cm, 13*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 0.8, GOLD),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
return t
def sp():
return Spacer(1, 6)
def sp2():
return Spacer(1, 12)
def hr():
return HRFlowable(width="100%", thickness=0.5, color=HexColor("#BDD8E4"),
spaceAfter=6, spaceBefore=4)
# ── Page layout ───────────────────────────────────────────────────────────────
OUTPUT = "/home/daytona/workspace/pharma-guide/Medical_Pharmacology_Reference.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=2.2*cm, bottomMargin=2.2*cm,
title="Medical Pharmacology Reference Guide",
author="Orris Medical AI"
)
def add_page_number(canvas, doc):
canvas.saveState()
if doc.page > 2:
canvas.setFont("Helvetica", 8)
canvas.setFillColor(GREY)
canvas.drawString(2*cm, 1.2*cm,
"Medical Pharmacology Reference Guide | Orris Medical AI | For Educational Use")
canvas.drawRightString(19*cm, 1.2*cm, f"Page {doc.page - 2}")
# top rule
canvas.setStrokeColor(HexColor("#BDD8E4"))
canvas.setLineWidth(0.5)
canvas.line(2*cm, A4[1]-1.8*cm, 19*cm, A4[1]-1.8*cm)
canvas.restoreState()
# ── Story ─────────────────────────────────────────────────────────────────────
story = []
# ── COVER ─────────────────────────────────────────────────────────────────────
cover_bg = Table([[""]], colWidths=[21*cm], rowHeights=[29.7*cm])
cover_bg.setStyle(TableStyle([("BACKGROUND", (0,0), (0,0), NAVY)]))
# We'll build cover as a single full-page table
cover_rows = [
[Spacer(1, 3.5*cm)],
[Paragraph("MEDICAL PHARMACOLOGY", cover_title)],
[Paragraph("REFERENCE GUIDE", cover_title)],
[Spacer(1, 0.3*cm)],
[HRFlowable(width="60%", thickness=1.5, color=GOLD, spaceAfter=10, spaceBefore=10)],
[Paragraph("For Medical Students", cover_sub)],
[Spacer(1, 0.5*cm)],
[Paragraph("Pharmacokinetics · Pharmacodynamics · Drug Classes", cover_auth)],
[Paragraph("Autonomic · Cardiovascular · CNS · Antimicrobials · Endocrine", cover_auth)],
[Spacer(1, 1*cm)],
[Paragraph("Sources: Katzung's Basic & Clinical Pharmacology 16e | Lippincott Illustrated Reviews Pharmacology", cover_auth)],
[Paragraph("Goodman & Gilman's Pharmacological Basis of Therapeutics", cover_auth)],
[Spacer(1, 2*cm)],
[Paragraph(f"Compiled by Orris Medical AI | {datetime.date.today().strftime('%B %Y')}", cover_auth)],
]
cover_tbl = Table([[row[0]] for row in cover_rows], colWidths=[17*cm])
cover_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
("ALIGN", (0,0), (-1,-1), "CENTER"),
]))
story.append(cover_tbl)
story.append(PageBreak())
# ── TABLE OF CONTENTS ─────────────────────────────────────────────────────────
story.append(section_banner("TABLE OF CONTENTS"))
story.append(sp())
toc_entries = [
("1", "Pharmacokinetics (ADME)", "3"),
("2", "Pharmacodynamics", "5"),
("3", "Autonomic Nervous System Drugs", "7"),
("4", "Cardiovascular Drugs", "10"),
("5", "CNS & Analgesic Drugs", "13"),
("6", "Antimicrobial Drugs", "16"),
("7", "Endocrine & Metabolic Drugs", "19"),
("8", "Quick-Reference Drug Tables", "22"),
("9", "High-Yield Mnemonics", "25"),
]
for num, title_t, pg in toc_entries:
dots = "." * (65 - len(num + title_t))
story.append(Paragraph(
f"<b>{num}.</b> {title_t} "
f"<font color='#BDD8E4'>{dots}</font> <b>{pg}</b>", toc_i))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 1 — PHARMACOKINETICS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("1. PHARMACOKINETICS (ADME)"))
story.append(sp())
story.append(Paragraph(
"Pharmacokinetics describes <b>what the body does to a drug</b>. Four processes govern "
"drug onset, intensity, and duration of action: <b>Absorption, Distribution, Metabolism, "
"Elimination</b>.", body))
story.append(sp())
story.append(Paragraph("1.1 Absorption", h2))
story.append(Paragraph(
"Absorption is the transfer of drug from the site of administration into plasma. "
"Key factors: lipid solubility, degree of ionisation, molecular weight, formulation.", body))
story.append(info_box("Routes of Administration", [
"Oral (PO) - most common; subject to first-pass hepatic metabolism",
"Sublingual / Buccal - bypasses first-pass; rapid onset (e.g. nitroglycerin)",
"Intravenous (IV) - 100% bioavailability; immediate effect",
"Intramuscular (IM) - moderate speed; suitable for depot preparations",
"Subcutaneous (SC) - slow, sustained absorption",
"Topical / Transdermal - local or slow systemic (e.g. nicotine patch)",
"Inhalation - rapid onset; useful for pulmonary/systemic (e.g. salbutamol)",
"Rectal - avoids first-pass partially; useful when oral route unavailable",
]))
story.append(sp())
story.append(Paragraph(
"<b>Bioavailability (F)</b>: Fraction of administered dose reaching systemic circulation. "
"IV = 100%. Oral bioavailability reduced by poor absorption and first-pass metabolism.", body))
story.append(sp())
story.append(Paragraph("1.2 Distribution", h2))
story.append(Paragraph(
"Distribution describes how drug moves from plasma into tissues. "
"Determined by plasma protein binding, lipid solubility, and tissue perfusion.", body))
pk_table = drug_table(
["Parameter", "Formula / Notes", "Clinical Significance"],
[
["Volume of Distribution (Vd)", "Vd = Dose / Cp (plasma conc.)",
"Large Vd = drug distributes into tissues (e.g. chloroquine ~800 L); Small Vd = stays in plasma"],
["Protein Binding", "Albumin (acidic drugs); α1-acid glycoprotein (basic drugs)",
"Only free (unbound) drug is pharmacologically active"],
["Blood-Brain Barrier", "Lipid-soluble, unionised drugs cross freely",
"Relevant for CNS drugs and encephalitis (disrupts BBB)"],
["Placental transfer", "Most drugs cross via passive diffusion",
"Teratogenicity risk; avoid warfarin, ACE-Is, tetracyclines in pregnancy"],
],
col_widths=[3.8*cm, 6.5*cm, 6.7*cm]
)
story.append(pk_table)
story.append(sp())
story.append(Paragraph("1.3 Metabolism (Biotransformation)", h2))
story.append(Paragraph(
"Primarily hepatic. Goal: convert lipophilic drugs into hydrophilic metabolites for excretion. "
"Two phases:", body))
story.append(info_box("Phase I vs Phase II Metabolism", [
"Phase I - Oxidation, reduction, hydrolysis. Mainly CYP450 enzymes (liver). "
"Products may be active, inactive, or toxic.",
"Phase II - Conjugation (glucuronidation, sulfation, acetylation). "
"Products generally inactive and water-soluble.",
"CYP3A4 metabolises ~50% of all drugs. Key enzyme for interactions.",
"CYP2D6 - Codeine→morphine activation; polymorphic (poor vs ultra-rapid metabolisers).",
"First-pass effect - Extensive hepatic metabolism after oral absorption reduces systemic bioavailability.",
]))
story.append(sp())
story.append(drug_table(
["CYP Enzyme", "Major Substrates", "Inducers", "Inhibitors"],
[
["CYP3A4", "Statins, CCBs, many immunosuppressants, HIV drugs",
"Rifampicin, carbamazepine, phenytoin, St John's Wort",
"Ketoconazole, erythromycin, grapefruit juice, ritonavir"],
["CYP2D6", "Codeine, metoprolol, antidepressants (TCAs, SSRIs)",
"None significant (genetic polymorphism)",
"Fluoxetine, paroxetine, haloperidol, quinidine"],
["CYP2C9", "Warfarin, phenytoin, NSAIDs, glipizide",
"Rifampicin, carbamazepine",
"Fluconazole, amiodarone, metronidazole"],
["CYP2C19", "PPIs, clopidogrel (activation), diazepam",
"Rifampicin",
"Omeprazole, fluoxetine, fluvoxamine"],
["CYP1A2", "Theophylline, caffeine, clozapine",
"Cigarette smoke, omeprazole",
"Ciprofloxacin, fluvoxamine"],
],
col_widths=[2.5*cm, 5*cm, 5*cm, 4.5*cm]
))
story.append(sp())
story.append(Paragraph("1.4 Elimination & Key PK Parameters", h2))
story.append(drug_table(
["Parameter", "Definition", "Formula", "Clinical Use"],
[
["Half-life (t½)", "Time for plasma conc. to fall by 50%",
"t½ = 0.693 × Vd / CL", "~5 t½ to reach steady state and to fully eliminate drug"],
["Clearance (CL)", "Volume of plasma cleared per unit time",
"CL = Dose / AUC", "Determines maintenance dose"],
["Steady State (Css)", "Drug in = Drug out (input = elimination)",
"Css = F × Dose rate / CL", "Reached after ~5 t½"],
["Loading Dose", "Rapid achievement of target concentration",
"LD = Css × Vd / F", "Used when rapid effect needed (e.g. digoxin, phenytoin)"],
["Maintenance Dose", "Maintains steady-state concentration",
"MD = Css × CL / F", "Adjusted for renal/hepatic function"],
["Renal Clearance", "Filtration + Secretion - Reabsorption",
"GFR drives most renal drug clearance",
"Reduce dose in renal impairment for renally cleared drugs"],
],
col_widths=[3*cm, 4*cm, 5*cm, 5*cm]
))
story.append(sp())
story.append(mnemonic_box("ADME", "Always Deliver Medicines Effectively - Absorption, Distribution, Metabolism, Elimination"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 2 — PHARMACODYNAMICS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("2. PHARMACODYNAMICS", color=TEAL))
story.append(sp())
story.append(Paragraph(
"Pharmacodynamics describes <b>what the drug does to the body</b>: mechanisms of action, "
"dose-response relationships, and therapeutic/toxic effects.", body))
story.append(sp())
story.append(Paragraph("2.1 Drug-Receptor Interactions", h2))
story.append(info_box("Receptor Types & Examples", [
"Ionotropic (ligand-gated ion channels) - Nicotinic ACh receptors, GABA-A, NMDA; fast response (ms)",
"G-protein coupled receptors (GPCRs) - Adrenergic, muscarinic, opioid, histamine; seconds response",
"Enzyme-linked receptors - Insulin receptor (tyrosine kinase); growth factors",
"Nuclear receptors - Glucocorticoids, thyroid hormone, sex steroids; hours-days response",
"Ion channels (voltage-gated) - Na+, K+, Ca2+ channels; target of local anaesthetics, antiarrhythmics",
]))
story.append(sp())
story.append(Paragraph("2.2 Dose-Response Concepts", h2))
story.append(drug_table(
["Term", "Definition", "Significance"],
[
["Efficacy (Emax)", "Maximum effect a drug can produce",
"Reflects intrinsic activity; agonists have high efficacy, partial agonists have intermediate"],
["Potency (EC50)", "Dose producing 50% of maximal effect",
"Lower EC50 = more potent; potency alone does not indicate clinical superiority"],
["Therapeutic Index (TI)", "TI = TD50 / ED50 (or LD50 / ED50 in animal models)",
"Narrow TI drugs require monitoring: warfarin, digoxin, lithium, theophylline, aminoglycosides"],
["Agonist", "Binds receptor and activates it (full, partial, or inverse)",
"Full agonist = max response; partial = submaximal; inverse = opposite effect"],
["Antagonist", "Binds receptor, no activation; blocks agonist",
"Competitive: reversible, overcome by high agonist dose. Non-competitive: irreversible"],
["Tolerance", "Reduced response with repeated dosing",
"Tachyphylaxis = rapid tolerance (e.g. nitrates); requires dose escalation"],
["Desensitisation", "Receptor down-regulation or uncoupling with chronic agonist exposure",
"Beta-agonist overuse in asthma reduces bronchodilator response"],
],
col_widths=[3.5*cm, 7*cm, 6.5*cm]
))
story.append(sp())
story.append(warning_box(
"NARROW THERAPEUTIC INDEX DRUGS (require monitoring): Warfarin, Digoxin, Lithium, "
"Phenytoin, Carbamazepine, Theophylline, Gentamicin/Vancomycin, Methotrexate, Cyclosporin"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 3 — AUTONOMIC NERVOUS SYSTEM DRUGS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("3. AUTONOMIC NERVOUS SYSTEM DRUGS", color=NAVY))
story.append(sp())
story.append(Paragraph(
"The ANS divides into <b>sympathetic</b> (thoracolumbar; norepinephrine/epinephrine) and "
"<b>parasympathetic</b> (craniosacral; acetylcholine) divisions. "
"Preganglionic fibres of both use ACh; postganglionic sympathetic use NE (except sweat glands - ACh).",
body))
story.append(sp())
story.append(Paragraph("3.1 Cholinergic (Parasympathomimetic) Drugs", h2))
story.append(drug_table(
["Drug", "Receptor", "Key Uses", "Adverse Effects"],
[
["Pilocarpine", "M (muscarinic)", "Glaucoma, dry mouth (Sjogren's)", "Sweating, miosis, bradycardia"],
["Bethanechol", "M (muscarinic)", "Urinary retention, postop ileus", "Bronchospasm, excess secretions"],
["Neostigmine", "AChE inhibitor (indirect)", "Myasthenia gravis reversal, postop ileus", "Cholinergic crisis - DUMBELS"],
["Physostigmine", "AChE inhibitor (indirect, CNS penetrant)", "Atropine/anticholinergic overdose", "Seizures, bradycardia"],
["Edrophonium", "AChE inhibitor (short-acting)", "Diagnosis of myasthenia gravis (Tensilon test)", "Brief cholinergic effects"],
["Nicotine", "N (nicotinic)", "Smoking cessation (patch, gum)", "Tachycardia, hypertension, addiction"],
],
col_widths=[3*cm, 3*cm, 5.5*cm, 5.5*cm]
))
story.append(sp())
story.append(mnemonic_box("DUMBELS", "Defaecation/Diarrhoea, Urination, Miosis, Bradycardia/Bronchospasm, Emesis/Excitation, Lacrimation, Salivation - signs of cholinergic excess"))
story.append(sp())
story.append(Paragraph("3.2 Anticholinergic (Antimuscarinic) Drugs", h2))
story.append(drug_table(
["Drug", "Key Uses", "Adverse Effects / Notes"],
[
["Atropine", "Bradycardia, organophosphate poisoning, pre-op to reduce secretions", "Tachycardia, dry mouth, mydriasis, urinary retention, confusion"],
["Ipratropium", "COPD, asthma (inhaled)", "Dry mouth, minimal systemic effects"],
["Tiotropium", "COPD maintenance (long-acting inhaled)", "Dry mouth, urinary retention"],
["Scopolamine", "Motion sickness (patch)", "Sedation, confusion in elderly"],
["Oxybutynin / Solifenacin", "Overactive bladder", "Dry mouth, constipation, cognitive effects (oxybutynin)"],
["Benztropine / Trihexyphenidyl", "Parkinson's disease, drug-induced EPS", "Confusion, tachycardia, urinary retention"],
],
col_widths=[3.5*cm, 7*cm, 6.5*cm]
))
story.append(sp())
story.append(mnemonic_box("Anticholinergic toxidrome",
"Hot as a hare, Blind as a bat, Dry as a bone, Red as a beet, Mad as a hatter"))
story.append(sp())
story.append(Paragraph("3.3 Adrenergic (Sympathomimetic) Drugs", h2))
story.append(info_box("Adrenergic Receptor Subtypes", [
"α1 - Vasoconstriction (arterioles), mydriasis, urinary sphincter contraction",
"α2 - Presynaptic: inhibit NE release (feedback); Central: reduce sympathetic outflow",
"β1 - Heart: increase HR, contractility, conduction (AV node)",
"β2 - Bronchodilation, vasodilation, uterine relaxation, glycogenolysis",
"β3 - Lipolysis in adipose tissue",
"D1 - Renal vasodilation (dopamine at low dose)",
]))
story.append(sp())
story.append(drug_table(
["Drug", "Receptors", "Key Uses", "Notes"],
[
["Epinephrine (Adrenaline)", "α1, α2, β1, β2", "Anaphylaxis, cardiac arrest, bronchospasm", "First-line in anaphylaxis; IM into lateral thigh"],
["Norepinephrine", "α1, α2, β1 (weak β2)", "Septic shock (vasopressor)", "Increases SVR and BP; causes reflex bradycardia"],
["Dopamine", "D1 (low dose), β1 (med), α1 (high)", "Cardiogenic shock, renal perfusion", "Dose-dependent receptor selectivity"],
["Dobutamine", "β1 > β2", "Acute heart failure, stress echo", "Increases contractility; minimal HR change"],
["Phenylephrine", "α1 selective", "Hypotension, nasal decongestant", "Pure vasoconstriction; no β effects"],
["Salbutamol (Albuterol)", "β2 selective", "Asthma, COPD, preterm labour", "Tremor, tachycardia at high doses"],
["Clonidine", "α2 agonist (central)", "Hypertension, ADHD, opioid withdrawal", "Rebound hypertension on withdrawal"],
["Pseudoephedrine", "α1, β (indirect)", "Nasal decongestant, sinusitis", "Raises BP; avoid in hypertension"],
],
col_widths=[3.5*cm, 3*cm, 5*cm, 5.5*cm]
))
story.append(sp())
story.append(Paragraph("3.4 Adrenergic Antagonists (Blockers)", h2))
story.append(drug_table(
["Drug", "Receptor", "Uses", "Adverse Effects"],
[
["Prazosin / Doxazosin", "α1 blocker", "Hypertension, BPH", "First-dose orthostatic hypotension"],
["Phentolamine", "α1 + α2 blocker", "Pheochromocytoma crisis", "Tachycardia (reflex), hypotension"],
["Propranolol", "β1 + β2 (non-selective)", "Hypertension, angina, arrhythmia, tremor, thyrotoxicosis", "Bronchoconstriction, mask hypoglycaemia, bradycardia"],
["Metoprolol / Atenolol", "β1 selective", "Hypertension, angina, post-MI, heart failure", "Less bronchospasm; fatigue, bradycardia"],
["Carvedilol", "α1 + β1 + β2", "Heart failure, hypertension", "Orthostatic hypotension, bradycardia"],
["Labetalol", "α1 + β1 + β2", "Hypertensive urgency, pre-eclampsia", "Bronchoconstriction, bradycardia"],
],
col_widths=[3.5*cm, 3*cm, 5.5*cm, 5*cm]
))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 4 — CARDIOVASCULAR DRUGS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("4. CARDIOVASCULAR DRUGS", color=HexColor("#1A5276")))
story.append(sp())
story.append(Paragraph("4.1 Antihypertensives", h2))
story.append(drug_table(
["Class", "Examples", "Mechanism", "Key Indications / Notes"],
[
["ACE Inhibitors", "Lisinopril, Ramipril, Enalapril",
"Block ACE → less Ang II → vasodilation + less aldosterone",
"HF, post-MI, diabetic nephropathy, CKD. CI: pregnancy, bilateral RAS. SE: dry cough (bradykinin), angioedema"],
["ARBs", "Losartan, Valsartan, Candesartan",
"Block AT1 receptor → same effect as ACEi without bradykinin",
"Same as ACEi; use when ACEi causes cough. CI: pregnancy"],
["Calcium Channel Blockers (DHP)", "Amlodipine, Nifedipine, Felodipine",
"Block L-type Ca2+ in vascular smooth muscle → vasodilation",
"Hypertension, angina (vasospastic). SE: peripheral oedema, flushing, headache"],
["CCBs (non-DHP)", "Verapamil, Diltiazem",
"Block L-type Ca2+ in heart + vessels → reduce HR, conduction, contractility",
"Arrhythmias, angina, hypertension. CI: heart failure with reduced EF, with β-blockers"],
["Thiazide Diuretics", "Hydrochlorothiazide, Chlorthalidone",
"Inhibit NaCl reabsorption in distal tubule",
"First-line HTN (esp. in Black patients). SE: hypokalaemia, hyperuricaemia, hyperglycaemia"],
["Loop Diuretics", "Furosemide, Bumetanide",
"Inhibit Na-K-2Cl cotransport in loop of Henle",
"Heart failure, pulmonary oedema, hypercalcaemia. SE: hypokalaemia, ototoxicity"],
["K+-sparing Diuretics", "Spironolactone, Eplerenone, Amiloride",
"Aldosterone antagonist or block Na+ channel in collecting duct",
"HF (spironolactone), hyperaldosteronism, hypokalaemia. SE: hyperkalaemia, gynaecomastia (spiro)"],
["Hydralazine", "Hydralazine",
"Direct arteriolar vasodilator (opens K+ channels)",
"HTN in pregnancy (with labetalol), HF in Black patients (+ nitrate). SE: reflex tachycardia, lupus-like syndrome"],
],
col_widths=[3*cm, 3.5*cm, 4.5*cm, 6*cm]
))
story.append(sp())
story.append(Paragraph("4.2 Antiarrhythmics (Vaughan-Williams Classification)", h2))
story.append(drug_table(
["Class", "Mechanism", "Drugs", "Uses", "Key Toxicity"],
[
["IA", "Na+ channel block + K+ block (prolong QRS + QT)",
"Quinidine, Procainamide, Disopyramide",
"AF, VT, WPW",
"Torsades de pointes (QT prolongation); procainamide → lupus"],
["IB", "Na+ channel block (shorten AP in ischaemic tissue)",
"Lidocaine, Mexiletine",
"Ventricular arrhythmias post-MI (lidocaine IV)",
"CNS toxicity: seizures, confusion"],
["IC", "Strong Na+ channel block (minimal AP change)",
"Flecainide, Propafenone",
"AF/flutter in structurally normal heart",
"Pro-arrhythmic in structural heart disease (CAST trial)"],
["II", "β-blockade → ↓phase 4 depolarisation, ↓HR, ↓AV conduction",
"Metoprolol, Esmolol, Propranolol",
"SVT, post-MI, rate control in AF",
"Bradycardia, bronchospasm, hypoglycaemia masking"],
["III", "K+ channel block → prolonged repolarisation (↑ERP)",
"Amiodarone, Sotalol, Dronedarone",
"AF/flutter, VT/VF (amiodarone)",
"Amiodarone: pulmonary toxicity, thyroid, liver, corneal deposits, photosensitivity; Sotalol: TdP"],
["IV", "Non-DHP CCB → slows AV conduction",
"Verapamil, Diltiazem",
"SVT rate control, AVNRT",
"Bradycardia, heart block; avoid in HFrEF"],
["Other", "Various",
"Adenosine, Digoxin, Ivabradine",
"Adenosine: acute SVT termination; Digoxin: AF rate control, HF; Ivabradine: HFrEF HR control",
"Adenosine: transient asystole; Digoxin: narrow TI - nausea, arrhythmia"],
],
col_widths=[1.2*cm, 3.8*cm, 3.5*cm, 3.5*cm, 5*cm]
))
story.append(sp())
story.append(warning_box("Amiodarone - most comprehensive antiarrhythmic but highest toxicity burden. "
"Monitor: TFTs, LFTs, CXR annually. Multiple drug interactions via CYP inhibition."))
story.append(sp())
story.append(Paragraph("4.3 Heart Failure Drugs", h2))
story.append(drug_table(
["Drug/Class", "Mechanism", "Benefit in HF", "Notes"],
[
["ACE inhibitors / ARBs", "↓ Ang II → reduced afterload + preload + cardiac remodelling",
"Reduces mortality", "First-line in HFrEF; titrate to max tolerated dose"],
["Beta-blockers", "Block chronic sympathetic stimulation → reverse remodelling",
"Reduces mortality", "Carvedilol, metoprolol succinate, bisoprolol. Start low, titrate up"],
["Mineralocorticoid Antagonists", "Block aldosterone → ↓Na/water retention, ↓fibrosis",
"Reduces mortality (RALES trial)", "Spironolactone, eplerenone. Monitor K+, renal function"],
["SGLT2 Inhibitors", "↓ glucose reabsorption, osmotic diuresis, metabolic benefits",
"Reduces hospitalisation and mortality", "Empagliflozin, dapagliflozin. Also used in T2DM"],
["Loop Diuretics", "Relieve congestion symptoms",
"Symptomatic relief", "Furosemide; adjust dose to clinical response and weight"],
["ARNI (Sacubitril/Valsartan)", "Neprilysin inhibitor + ARB → ↑natriuretic peptides + ↓Ang II",
"Superior to ACEi (PARADIGM-HF)", "Replace ACEi with 36-hr washout. CI: with ACEi (angioedema risk)"],
["Digoxin", "Inhibits Na/K-ATPase → ↑intracellular Ca2+ → ↑inotropy",
"Reduces hospitalisation; no mortality benefit",
"Narrow TI; monitor levels, K+, Mg2+, renal function. Toxic: bradycardia, AV block, GI"],
["Ivabradine", "Selective If channel block in SA node → ↓HR",
"Reduces hospitalisation (SHIFT trial)",
"For HFrEF in sinus rhythm with HR ≥70 despite max β-blocker"],
],
col_widths=[3.5*cm, 4.5*cm, 3*cm, 6*cm]
))
story.append(sp())
story.append(Paragraph("4.4 Anticoagulants & Antiplatelets", h2))
story.append(drug_table(
["Drug", "Mechanism", "Uses", "Reversal / Monitoring"],
[
["Warfarin", "Inhibits Vit K epoxide reductase → ↓II, VII, IX, X, Protein C&S",
"AF, VTE, prosthetic valves, PE", "Antidote: Vit K (slow), FFP/PCC (fast). Monitor: INR (target 2-3)"],
["Heparin (UFH)", "Activates antithrombin III → inactivates thrombin + Xa",
"Acute DVT/PE, ACS, perioperative", "Antidote: Protamine sulphate. Monitor: aPTT (1.5-2.5× normal)"],
["LMWH (Enoxaparin)", "Anti-Xa > anti-IIa",
"VTE prophylaxis/treatment, ACS", "Partial reversal with protamine. Monitor anti-Xa in renal failure"],
["Rivaroxaban / Apixaban", "Direct factor Xa inhibitor",
"AF stroke prevention, VTE (treatment + prophylaxis)", "Andexanet alfa (reversal). No routine monitoring needed"],
["Dabigatran", "Direct thrombin (IIa) inhibitor",
"AF, VTE", "Idarucizumab (reversal). Renal dosing required"],
["Aspirin", "Irreversible COX-1 inhibition → ↓TXA2 → ↓platelet aggregation",
"ACS, secondary CVD prevention, ischaemic stroke", "No specific antidote; platelet transfusion in bleeding"],
["Clopidogrel / Ticagrelor", "ADP receptor (P2Y12) antagonist → ↓platelet aggregation",
"ACS (dual antiplatelet with aspirin), PCI, ischaemic stroke",
"Clopidogrel: prodrug (CYP2C19 activation); Ticagrelor: direct, reversible"],
],
col_widths=[3*cm, 4.5*cm, 4.5*cm, 5*cm]
))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 5 — CNS & ANALGESIC DRUGS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("5. CNS & ANALGESIC DRUGS", color=HexColor("#4A235A")))
story.append(sp())
story.append(Paragraph("5.1 Opioid Analgesics", h2))
story.append(drug_table(
["Drug", "Type", "Potency", "Key Uses", "Notes"],
[
["Morphine", "Full μ-opioid agonist", "Reference (1×)",
"Severe pain, MI pain, acute pulmonary oedema", "Active metabolite M6G (accumulates in renal failure)"],
["Fentanyl", "Full μ-opioid agonist", "~100× morphine",
"Surgical anaesthesia, chronic pain (patch), sedation ICU", "Rapid onset; patch: 72-hr delivery; abuse potential"],
["Codeine", "Prodrug (CYP2D6 → morphine)", "~0.1× morphine",
"Mild-moderate pain, cough suppression", "Poor metabolisers: no effect; ultra-rapid: toxicity risk"],
["Tramadol", "Weak μ-agonist + NE/5-HT reuptake inhibitor", "~0.1× morphine",
"Moderate pain, neuropathic pain", "Lowers seizure threshold; serotonin syndrome risk with SSRIs"],
["Naloxone", "μ-opioid antagonist (competitive)", "N/A",
"Opioid overdose reversal (IV/IM/IN)", "Short t½ (30-90 min); may need repeat dosing; causes withdrawal"],
["Buprenorphine", "Partial μ-agonist + κ-antagonist", "~30× morphine",
"Opioid use disorder, chronic pain", "Ceiling effect on respiratory depression; sublingual/patch/implant"],
["Methadone", "Full μ-agonist + NMDA antagonist", "Variable (3-5× oral morphine)",
"Opioid use disorder (maintenance), severe pain", "Long half-life (24-36h); QT prolongation risk; accumulation risk"],
],
col_widths=[2.8*cm, 3.2*cm, 2.5*cm, 4.5*cm, 4*cm]
))
story.append(sp())
story.append(warning_box(
"Opioid overdose triad: Respiratory depression + Miosis + Decreased consciousness. "
"Treat with naloxone IV 0.4 mg; repeat every 2-3 min as needed. Monitor for re-narcotisation."))
story.append(sp())
story.append(Paragraph("5.2 Antiepileptic Drugs", h2))
story.append(drug_table(
["Drug", "Mechanism", "Seizure Types", "Key Adverse Effects"],
[
["Phenytoin", "Na+ channel block (frequency-dependent)",
"Focal, generalised tonic-clonic (GTC)", "Gingival hyperplasia, hirsutism, ataxia, nystagmus, teratogen, zero-order kinetics"],
["Carbamazepine", "Na+ channel block",
"Focal, GTC (NOT absence)", "Diplopia, ataxia, hyponatraemia (SIADH), SJS, CYP inducer"],
["Valproate", "Na+ block + GABA ↑ + T-type Ca2+ block",
"All seizure types including absence; bipolar; migraine",
"Hepatotoxicity, pancreatitis, teratogen (spina bifida), weight gain, tremor"],
["Lamotrigine", "Na+ channel block",
"Focal, GTC, absence, bipolar", "SJS (especially with valproate); dizziness; slow titration needed"],
["Levetiracetam", "Binds SV2A (synaptic vesicle protein)",
"Focal, GTC, myoclonic", "Behavioural/mood changes; minimal drug interactions; safe in pregnancy (relatively)"],
["Ethosuximide", "T-type Ca2+ channel block in thalamus",
"Absence seizures ONLY", "GI upset, headache, dizziness"],
["Benzodiazepines", "GABA-A positive allosteric modulator → ↑Cl- conductance",
"Status epilepticus (lorazepam IV), acute seizure (diazepam PR)", "Sedation, tolerance, dependence, respiratory depression"],
["Phenobarbital", "GABA-A modulator + Na+ block",
"GTC, status epilepticus, neonatal seizures", "Sedation, CYP inducer, tolerance, dependence, teratogen"],
],
col_widths=[3*cm, 4*cm, 3.5*cm, 6.5*cm]
))
story.append(sp())
story.append(Paragraph("5.3 Antidepressants", h2))
story.append(drug_table(
["Class", "Examples", "Mechanism", "Adverse Effects / Notes"],
[
["SSRIs", "Fluoxetine, Sertraline, Citalopram, Escitalopram, Paroxetine",
"Selective serotonin reuptake inhibition",
"GI upset, sexual dysfunction, insomnia, weight gain. Serotonin syndrome risk with MAOIs/tramadol. First-line for depression/anxiety."],
["SNRIs", "Venlafaxine, Duloxetine",
"Serotonin + NE reuptake inhibition",
"Hypertension, sweating. Duloxetine: also for neuropathic pain, fibromyalgia, stress urinary incontinence."],
["TCAs", "Amitriptyline, Imipramine, Nortriptyline",
"Inhibit 5-HT + NE reuptake; also block H1, α1, muscarinic",
"Anticholinergic effects, sedation, cardiac arrhythmia (QT prolongation), orthostatic hypotension. Lethal in overdose."],
["MAOIs", "Phenelzine, Tranylcypromine, Moclobemide",
"Inhibit MAO-A and/or B → ↑monoamines",
"Tyramine reaction (hypertensive crisis with aged cheese, wine). Serotonin syndrome. Drug interactions. Rarely used."],
["Mirtazapine", "α2 antagonist + H1 block + 5-HT2/3 block",
"Blocks α2 autoreceptor → ↑NE and 5-HT release",
"Sedation (useful in insomnia), weight gain, increased appetite. Fewer sexual side effects."],
["Bupropion", "NE + dopamine reuptake inhibitor",
"Antidepressant + smoking cessation",
"Lowers seizure threshold (CI in eating disorders). No sexual dysfunction. Weight loss."],
],
col_widths=[2.5*cm, 4*cm, 4*cm, 6.5*cm]
))
story.append(sp())
story.append(warning_box(
"Serotonin Syndrome: Hyperthermia + clonus/hyperreflexia + agitation. Caused by excess serotonergic activity "
"(SSRI + MAOI, or + tramadol/fentanyl/linezolid). Treat: stop offending drugs, cyproheptadine, benzos for agitation."))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 6 — ANTIMICROBIALS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("6. ANTIMICROBIAL DRUGS", color=HexColor("#1A6B3C")))
story.append(sp())
story.append(Paragraph("6.1 Antibacterial Drug Overview by Mechanism", h2))
story.append(info_box("Five Mechanisms of Antibacterial Action", [
"1. Cell wall synthesis inhibition - Beta-lactams (penicillins, cephalosporins, carbapenems), vancomycin, bacitracin",
"2. Cell membrane disruption - Polymyxins (colistin), daptomycin",
"3. Protein synthesis inhibition - Aminoglycosides (30S), tetracyclines (30S), macrolides (50S), lincosamides (50S), chloramphenicol (50S), linezolid (50S)",
"4. Nucleic acid synthesis inhibition - Fluoroquinolones (DNA gyrase/topoisomerase IV), rifampicin (RNA polymerase), metronidazole (DNA strand breaks)",
"5. Antimetabolite - Sulfonamides + trimethoprim (inhibit folate synthesis/reduction)",
]))
story.append(sp())
story.append(Paragraph("6.2 Beta-Lactams", h2))
story.append(drug_table(
["Class", "Examples", "Spectrum", "Notes"],
[
["Narrow-spectrum penicillins", "Benzylpenicillin (PCN G), Phenoxymethylpenicillin (PCN V)",
"Gram+: Streptococci, some Staphylococci, Neisseria",
"DOC for syphilis (PCN G), streptococcal pharyngitis. Destroyed by β-lactamase."],
["Anti-staphylococcal penicillins", "Flucloxacillin, Nafcillin, Oxacillin",
"Beta-lactamase producing Staph aureus (MSSA)",
"Resist β-lactamase; DOC for MSSA. NOT for MRSA."],
["Aminopenicillins", "Amoxicillin, Ampicillin",
"Gram+ + some Gram- (H. influenzae, E. coli, Listeria)",
"Amoxicillin + clavulanate (Augmentin) for β-lactamase producers. UTI, otitis media, CAP."],
["Anti-pseudomonal penicillins", "Piperacillin-tazobactam (Pip-tazo)",
"Broad including Pseudomonas, Enterobacteriaceae",
"Hospital-acquired infections, febrile neutropenia, intra-abdominal."],
["1st gen cephalosporins", "Cefalexin, Cefazolin",
"Gram+ coverage dominant",
"Cefazolin: surgical prophylaxis, MSSA. Cefalexin: skin/soft tissue infections."],
["2nd gen cephalosporins", "Cefuroxime, Cefoxitin",
"Extended Gram- including some anaerobes (cefoxitin)",
"Cefuroxime: RTI, UTI, surgical prophylaxis. Cefoxitin: intra-abdominal."],
["3rd gen cephalosporins", "Ceftriaxone, Cefotaxime, Ceftazidime",
"Excellent Gram-, good Gram+; ceftazidime covers Pseudomonas",
"Ceftriaxone: meningitis, gonorrhoea, CAP. Once daily dosing."],
["4th gen cephalosporins", "Cefepime",
"Gram+ and Gram- including Pseudomonas",
"Febrile neutropenia, hospital-acquired infections."],
["Carbapenems", "Meropenem, Imipenem, Ertapenem",
"Broadest spectrum (ESBL, anaerobes, Pseudomonas except ertapenem)",
"Reserve for MDR organisms; risk of seizures with imipenem."],
["Monobactam", "Aztreonam",
"Gram- only (including Pseudomonas)",
"Use in PCN-allergic patients for Gram- coverage."],
],
col_widths=[3.5*cm, 3.5*cm, 4.5*cm, 5.5*cm]
))
story.append(sp())
story.append(Paragraph("6.3 Non-Beta-Lactam Antibacterials", h2))
story.append(drug_table(
["Drug/Class", "Mechanism", "Key Organisms", "Notes"],
[
["Vancomycin", "Inhibits cell wall synthesis (glycopeptide; binds D-Ala-D-Ala)",
"MRSA, Enterococcus (VSE), C. difficile (oral only)",
"Red man syndrome (rate-related; not true allergy). Monitor trough/AUC. Nephrotoxic."],
["Aminoglycosides\n(Gentamicin, Amikacin)", "Irreversibly bind 30S ribosome → misreading mRNA",
"Aerobic Gram- bacilli (Pseudomonas, Enterobacteriaceae)",
"Nephrotoxic + ototoxic (irreversible). Once-daily dosing preferred. Monitor levels."],
["Macrolides\n(Azithromycin, Clarithromycin)", "Bind 50S ribosome → inhibit translocation",
"Atypical bacteria (Mycoplasma, Chlamydia, Legionella), H. pylori, MAI",
"Azithromycin: CAP, STIs, MAC prophylaxis. Clarithromycin: H. pylori triple therapy. QT prolongation."],
["Tetracyclines\n(Doxycycline, Minocycline)", "Bind 30S ribosome → block tRNA binding",
"Atypicals, Rickettsia, Lyme, MRSA (minocycline), acne, malaria prophylaxis",
"Avoid in children <8y + pregnancy (teeth/bones). Take with food. Photosensitivity."],
["Fluoroquinolones\n(Ciprofloxacin, Levofloxacin)", "Inhibit DNA gyrase (Gram-) and topoisomerase IV (Gram+)",
"Gram- UTI, GI infections, atypicals, MRSA-soft tissue (with caution)",
"Tendon rupture (Achilles); QT prolongation; avoid in children (cartilage toxicity). CI with antacids."],
["Metronidazole", "Forms reactive intermediates → DNA strand breaks",
"Anaerobes (C. difficile, Bacteroides), protozoa (Giardia, Trichomonas, amoebiasis)",
"Disulfiram reaction with alcohol. Metallic taste. DOC for C. diff (with vancomycin)."],
["Linezolid", "Bind 50S ribosome (unique site); bacteriostatic for most",
"MRSA, VRE, drug-resistant TB",
"Serotonin syndrome risk (MAO inhibitor activity). Thrombocytopenia. Expensive. Reserve for MDR."],
["TMP-SMX\n(Co-trimoxazole)", "Inhibit dihydropteroate synthase (sulfa) + DHFR (TMP) → folate block",
"UTI, PCP (Pneumocystis pneumonia), Toxoplasma, MRSA-skin",
"Hyperkalaemia (blocks ENaC). Stevens-Johnson syndrome. Avoid in pregnancy (3rd trimester)."],
["Clindamycin", "Bind 50S ribosome → inhibit peptide bond formation",
"Gram+ including MRSA-skin, anaerobes, Toxoplasma",
"C. difficile risk (high). Skin/soft tissue MRSA infections. Bacterial vaginosis."],
],
col_widths=[3*cm, 4*cm, 4*cm, 6*cm]
))
story.append(sp())
story.append(mnemonic_box("30S inhibitors", "'Buy AT 30, CELL at 50' — 30S: Aminoglycosides, Tetracyclines. 50S: Chloramphenicol, Erythromycin (macrolides), Lincosamides, Linezolid"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 7 — ENDOCRINE & METABOLIC DRUGS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("7. ENDOCRINE & METABOLIC DRUGS", color=HexColor("#7B3F00")))
story.append(sp())
story.append(Paragraph("7.1 Diabetes Mellitus Drugs", h2))
story.append(drug_table(
["Drug Class", "Examples", "Mechanism", "Key Notes"],
[
["Insulin (short)", "Regular, Aspart, Lispro, Glulisine",
"Binds insulin receptor → glucose uptake",
"Regular: IV use, onset 30 min. Aspart/lispro/glulisine: rapid-acting, with meals."],
["Insulin (long)", "Glargine, Detemir, Degludec",
"Basal insulin supply (no peak or flat profile)",
"Glargine: once daily; cannot mix with other insulins."],
["Metformin", "Metformin",
"Activates AMPK → ↓hepatic gluconeogenesis; ↑insulin sensitivity",
"First-line T2DM. GI side effects. Lactic acidosis (rare; hold in contrast/surgery). Does NOT cause hypoglycaemia."],
["Sulfonylureas", "Glibenclamide, Glipizide, Glimepiride",
"Close K+ channels on β-cells → depolarisation → ↑insulin release",
"Risk of hypoglycaemia; weight gain. Caution in elderly + renal impairment."],
["SGLT2 Inhibitors", "Empagliflozin, Dapagliflozin, Canagliflozin",
"Block glucose reabsorption in proximal tubule → glucosuria",
"Weight loss, BP reduction. CV + renal benefits. Risk: DKA (check ketones), genital mycotic infections, Fournier's gangrene."],
["GLP-1 Agonists", "Semaglutide, Liraglutide, Dulaglutide (injectable); Semaglutide (oral)",
"Mimic GLP-1 → ↑insulin, ↓glucagon, slow gastric emptying, satiety",
"Weight loss (ozempic/wegovy). CV benefit. GI side effects (nausea). Not for pancreatitis history."],
["DPP-4 Inhibitors", "Sitagliptin, Saxagliptin, Alogliptin",
"Inhibit DPP-4 → ↑endogenous GLP-1/GIP",
"Weight neutral. Generally safe in renal impairment (dose-adjust). Rare: pancreatitis."],
["Thiazolidinediones", "Pioglitazone, Rosiglitazone",
"PPARγ agonist → ↑insulin sensitivity in adipose/muscle",
"Fluid retention, weight gain, heart failure risk, fractures, bladder cancer (pioglitazone)."],
["Alpha-glucosidase inhibitors", "Acarbose, Miglitol",
"Inhibit intestinal α-glucosidase → slow carbohydrate absorption",
"GI side effects (flatulence, diarrhoea). No hypoglycaemia alone."],
],
col_widths=[3*cm, 3.5*cm, 4.5*cm, 6*cm]
))
story.append(sp())
story.append(Paragraph("7.2 Thyroid Drugs", h2))
story.append(drug_table(
["Drug", "Mechanism", "Use", "Notes"],
[
["Levothyroxine (T4)", "Exogenous thyroid hormone (T4 → T3 peripherally)",
"Hypothyroidism, TSH suppression in thyroid cancer", "Take on empty stomach. Adjust dose by TSH. Many drug interactions."],
["Carbimazole / Methimazole", "Inhibit thyroid peroxidase → block T3/T4 synthesis",
"Hyperthyroidism (Graves', toxic nodule)", "Agranulocytosis (check FBC if fever/sore throat). Methimazole: DOC. Carbimazole: prodrug."],
["Propylthiouracil (PTU)", "Inhibit peroxidase + peripheral T4→T3 conversion",
"Hyperthyroidism, thyroid storm, first trimester of pregnancy",
"Hepatotoxicity. DOC in thyroid storm and first trimester. Otherwise methimazole preferred."],
["Radioiodine (I-131)", "Selectively destroys thyroid tissue (β-emission)",
"Hyperthyroidism, thyroid cancer", "Leads to hypothyroidism in most. CI: pregnancy."],
["Potassium iodide", "Wolff-Chaikoff effect: excess iodide inhibits thyroid hormone synthesis/release",
"Thyroid storm, pre-thyroid surgery, radiation exposure prophylaxis", "Short-term use only (escape phenomenon)."],
],
col_widths=[3.5*cm, 4*cm, 4.5*cm, 5*cm]
))
story.append(sp())
story.append(Paragraph("7.3 Lipid-Lowering Drugs", h2))
story.append(drug_table(
["Class", "Examples", "Mechanism", "LDL Effect / Notes"],
[
["Statins", "Atorvastatin, Rosuvastatin, Simvastatin",
"Inhibit HMG-CoA reductase → ↓hepatic cholesterol synthesis → ↑LDL receptors",
"↓LDL 30-60%. Most important CV benefit class. SE: myopathy (rhabdomyolysis rare), raised LFTs. Rosuvastatin most potent."],
["Ezetimibe", "Ezetimibe",
"Blocks intestinal cholesterol absorption (NPC1L1 transporter)",
"↓LDL ~20%. Adjunct to statins. Well tolerated."],
["PCSK9 Inhibitors", "Evolocumab, Alirocumab",
"Monoclonal Ab → block PCSK9 → more LDL-R recycled on hepatocytes",
"↓LDL up to 60-70%. Injectable (SC). Very expensive. For FH, statin intolerance."],
["Fibrates", "Fenofibrate, Gemfibrozil",
"PPARα agonist → ↑lipoprotein lipase → ↓triglycerides, ↑HDL",
"↓TG 30-50%, modest ↑HDL. Gemfibrozil: risk of myopathy with statins (avoid combination)."],
["Niacin", "Niacin (Nicotinic acid)",
"↓VLDL secretion, ↓lipolysis in adipose",
"↑HDL most of any agent. Flushing (reduce with aspirin pretreatment). Rarely used today."],
["Bile acid sequestrants", "Cholestyramine, Colesevelam",
"Bind bile acids in gut → ↑hepatic cholesterol conversion to bile acids",
"↓LDL 15-30%. GI side effects. ↑TG (avoid in hypertriglyceridaemia). Interfere with drug absorption."],
],
col_widths=[3*cm, 3*cm, 4.5*cm, 6.5*cm]
))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 8 — QUICK-REFERENCE TABLES
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("8. QUICK-REFERENCE DRUG TABLES", color=HexColor("#2C3E50")))
story.append(sp())
story.append(Paragraph("8.1 Common Drug Toxidromes", h2))
story.append(drug_table(
["Toxidrome", "Drugs", "Signs", "Treatment"],
[
["Cholinergic (muscarinic)", "Organophosphates, physostigmine, pilocarpine",
"DUMBELS: Diarrhoea, Urination, Miosis, Bradycardia/Bronchospasm, Emesis, Lacrimation, Salivation",
"Atropine (large doses) + Pralidoxime (if organophosphate, early)"],
["Anticholinergic", "Atropine, TCAs, antihistamines, antipsychotics",
"Tachycardia, hyperthermia, dry skin, mydriasis, urinary retention, confusion ('mad as a hatter')",
"Physostigmine (if severe CNS symptoms), supportive care, benzos"],
["Serotonin syndrome", "SSRIs, MAOIs, tramadol, fentanyl, linezolid (combos)",
"Hyperthermia, clonus, hyperreflexia, agitation, diarrhoea (rapid onset)",
"Stop drugs, cyproheptadine (5-HT2 antagonist), benzos, cooling"],
["Neuroleptic malignant syndrome (NMS)", "Antipsychotics (D2 blockers)",
"Hyperthermia, muscle rigidity ('lead pipe'), altered consciousness, autonomic instability (SLOW onset days-weeks)",
"Stop antipsychotic, dantrolene, bromocriptine, supportive cooling"],
["Opioid", "Morphine, heroin, fentanyl, codeine",
"Miosis, respiratory depression, decreased consciousness",
"Naloxone IV/IM/IN; repeat as needed (short t½)"],
["Sympathomimetic", "Cocaine, amphetamines, pseudoephedrine",
"Tachycardia, hypertension, hyperthermia, diaphoresis, mydriasis",
"Benzos (first-line), cooling, phentolamine (if severe HTN)"],
["Sedative-hypnotic", "Benzodiazepines, barbiturates, alcohol",
"CNS/respiratory depression, slurred speech, ataxia; pupils normal",
"Flumazenil (benzo reversal, caution - seizures); supportive for barbiturates"],
],
col_widths=[3*cm, 3.5*cm, 5*cm, 5.5*cm]
))
story.append(sp())
story.append(Paragraph("8.2 High-Yield Drug Interactions", h2))
story.append(drug_table(
["Drug Pair", "Mechanism", "Effect", "Action"],
[
["Warfarin + Antibiotics (broad-spectrum)", "↓ gut flora → ↓ Vit K production",
"↑ INR → bleeding risk", "Monitor INR closely; adjust warfarin dose"],
["Statins + Macrolides / Azole antifungals", "CYP3A4 inhibition → ↑statin levels",
"↑ Myopathy / rhabdomyolysis risk", "Avoid combination or use non-CYP3A4 statin (rosuvastatin)"],
["SSRI + MAOI", "Excess serotonin",
"Serotonin syndrome (life-threatening)", "Mandatory 14-day washout between classes"],
["ACE inhibitor + K+-sparing diuretic / NSAID", "↑ K+ retention",
"Hyperkalaemia (dangerous arrhythmia)", "Monitor serum K+ and renal function"],
["Metformin + IV contrast / surgery", "Impaired renal clearance of metformin → accumulation",
"Lactic acidosis", "Hold metformin 48h before/after contrast; restart when renal function stable"],
["Clopidogrel + PPIs (omeprazole)", "CYP2C19 inhibition by PPI → ↓clopidogrel activation",
"Reduced antiplatelet effect", "Use pantoprazole (less CYP2C19 inhibition) if PPI needed"],
["Digoxin + Amiodarone / Verapamil", "↓ digoxin clearance / renal competition",
"Digoxin toxicity", "Reduce digoxin dose by 50% when starting amiodarone or verapamil"],
["Fluoroquinolone + antacids / Ca2+ / Mg2+", "Chelation → ↓ absorption",
"↓ antibiotic efficacy", "Separate doses by ≥2-4 hours"],
],
col_widths=[4*cm, 4*cm, 4*cm, 5*cm]
))
story.append(sp())
story.append(Paragraph("8.3 Drugs to Avoid in Special Populations", h2))
story.append(drug_table(
["Population", "Avoid", "Reason"],
[
["Pregnancy (all trimesters)", "ACE inhibitors, ARBs, warfarin (1st & 3rd trim), tetracyclines, aminoglycosides, methotrexate, misoprostol (except intended), isotretinoin, valproate",
"Teratogenicity, foetal renal toxicity, coagulopathy, dental/bone effects"],
["Pregnancy (1st trimester)", "Metronidazole (avoid high-dose), carbimazole (PTU preferred)", "Teratogenicity concerns"],
["Pregnancy (3rd trimester)", "NSAIDs (premature ductus closure), TMP-SMX (kernicterus risk)", "Foetal harm"],
["Renal impairment", "Metformin (if eGFR <30), NSAIDs, aminoglycosides, nitrofurantoin (if eGFR <30), renally-cleared drugs without dose adjustment",
"Drug accumulation, nephrotoxicity, reduced efficacy"],
["Hepatic impairment", "Statins (active liver disease), rifampicin overdose, methotrexate, azathioprine, paracetamol (high dose)",
"Impaired metabolism, hepatotoxicity"],
["Elderly", "Anticholinergic drugs (confusion), long-acting benzodiazepines, NSAIDs (GI bleed, renal), first-gen antihistamines, strong opioids without laxative",
"Falls, cognitive impairment, Beers criteria"],
["Children <8 years", "Tetracyclines", "Dental staining, bone growth impairment"],
["G6PD deficiency", "Primaquine, dapsone, rasburicase, nitrofurantoin",
"Haemolytic anaemia"],
["Myasthenia gravis", "Aminoglycosides, fluoroquinolones, beta-blockers, neuromuscular blockers",
"Worsen neuromuscular blockade"],
],
col_widths=[3.5*cm, 8*cm, 5.5*cm]
))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# SECTION 9 — HIGH-YIELD MNEMONICS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("9. HIGH-YIELD MNEMONICS & MEMORY AIDS", color=HexColor("#1A5276")))
story.append(sp())
mnemonics = [
("ADME", "Always Deliver Medicines Effectively",
"Absorption, Distribution, Metabolism, Elimination - the 4 pharmacokinetic processes"),
("DUMBELS", "Don't Urinate More - Buy Extra Large Shirts",
"Cholinergic toxidrome: Diarrhoea, Urination, Miosis, Bradycardia/Bronchospasm, Emesis, Lacrimation, Salivation"),
("Hot, Blind, Dry, Red, Mad", "-",
"Anticholinergic toxidrome: Hot as a hare, Blind as a bat, Dry as a bone, Red as a beet, Mad as a hatter"),
("SLUDGE", "Salivation Lacrimation Urination Defaecation GI-distress Emesis",
"Muscarinic excess (organophosphate poisoning, cholinergic crisis)"),
("DIMES", "D-I-M-E-S",
"Drugs causing QT prolongation: Disopyramide, I-butilide, Methadone, Erythromycin/macrolides, Sotalol/antipsychotics"),
("SAFE MOM", "-",
"Pregnancy category A/B antibiotics relatively safe: Sulfonamides (not 3rd trim), Aminopenicillins, Fluoroquinolones AVOID, Erythromycin (some safe), Metronidazole (avoid 1st trim), Other penicillins/cephalosporins, Macrolides (azithromycin ok)"),
("Narrow TI drugs - WWLL PAT DM", "-",
"Warfarin, Warfarin analogs, Lithium, Levothyroxine (narrow range), Phenytoin, Aminoglycosides, Theophylline, Digoxin, Methotrexate"),
("30S vs 50S ribosome inhibitors", "Buy AT 30, CELL at 50",
"30S: Aminoglycosides, Tetracyclines. 50S: Chloramphenicol, Erythromycin (macrolides), Lincosamides, Linezolid"),
("HF survival drugs - ABCDE", "-",
"ACE inhibitors/ARBs/ARNI, Beta-blockers, Carvedilol specifically, Diuretics (loop + MRA + SGLT2), Eplerenone/spironolactone"),
("Antihypertensive 1st line choices", "ABCD",
"A - ACEi/ARB (especially DM, proteinuria, heart failure); B - Beta-blockers (post-MI, HF, rate control); C - CCBs (elderly, angina, Black patients); D - Diuretics thiazide (Black patients, isolated systolic HTN)"),
("Beta-blocker cardioselective (β1-selective)", "A-M-E-B",
"Acebutolol, Metoprolol, Esmolol, Bisoprolol, Atenolol - relatively β1-selective (use in asthma with caution)"),
("Statins and myopathy risk", "-",
"Risk with: Simvastatin > Atorvastatin > Rosuvastatin. Increased risk when combined with CYP3A4 inhibitors (macrolides, azoles, grapefruit). Use rosuvastatin or pravastatin when interaction risk is high."),
]
for mnem, short, desc in mnemonics:
data = [
[Paragraph(f"<b>{mnem}</b>", S("MH", fontName="Helvetica-Bold", fontSize=10,
textColor=NAVY, spaceAfter=2)),
Paragraph(f"<i>{short}</i>" if short != "-" else "", S("MSh", fontName="Helvetica-Oblique",
fontSize=9, textColor=TEAL, spaceAfter=2)),
Paragraph(desc, S("MD", fontName="Helvetica", fontSize=9, textColor=DARK, leading=13))]
]
t = Table(data, colWidths=[3.5*cm, 5*cm, 8.5*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), PALE_Y),
("BACKGROUND", (0,0), (0, 0), HexColor("#FFF3CD")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 0.5, GOLD),
("VALIGN", (0,0), (-1,-1), "TOP"),
("LINEAFTER", (0,0), (0,-1), 0.5, GOLD),
("LINEAFTER", (1,0), (1,-1), 0.5, GOLD),
]))
story.append(t)
story.append(Spacer(1, 4))
story.append(sp2())
story.append(HRFlowable(width="100%", thickness=1.5, color=NAVY, spaceAfter=8))
story.append(Paragraph(
"Sources: Katzung's Basic and Clinical Pharmacology, 16th Edition (Katzung & Vanderah) | "
"Lippincott Illustrated Reviews: Pharmacology | "
"Goodman & Gilman's The Pharmacological Basis of Therapeutics, 14th Edition",
small))
story.append(Paragraph(
"Compiled by Orris Medical AI - For Educational Use Only. "
"Always verify dosing, contraindications, and clinical decisions against current guidelines "
"and local formulary. This guide does not constitute medical advice.",
note))
# ── Build PDF ─────────────────────────────────────────────────────────────────
doc.build(story, onFirstPage=add_page_number, onLaterPages=add_page_number)
print(f"PDF saved to: {OUTPUT}")
cd /home/daytona/workspace/pharma-guide && python build_guide.py 2>&1