~/md-anaesthesia-guide/generate_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.pdfgen import canvas
from reportlab.platypus import BaseDocTemplate, PageTemplate, Frame
OUTPUT_PATH = "/home/daytona/workspace/md-anaesthesia-guide/MD_Anaesthesia_Quick_Revision_Guide.pdf"
# ── Color Palette ───────────────────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#1A3A5C")
MED_BLUE = colors.HexColor("#2E6DA4")
LIGHT_BLUE = colors.HexColor("#D6E8F7")
ACCENT_GOLD = colors.HexColor("#E8A020")
LIGHT_GRAY = colors.HexColor("#F5F5F5")
MED_GRAY = colors.HexColor("#DDDDDD")
TEXT_DARK = colors.HexColor("#1C1C1C")
GREEN = colors.HexColor("#1E7A3A")
RED = colors.HexColor("#C0392B")
PURPLE = colors.HexColor("#6C3483")
# ── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def make_style(name, parent_name="Normal", **kwargs):
return ParagraphStyle(name, parent=styles[parent_name], **kwargs)
title_style = make_style("DocTitle", fontSize=28, textColor=colors.white,
alignment=TA_CENTER, spaceAfter=6, fontName="Helvetica-Bold")
subtitle_style = make_style("DocSub", fontSize=14, textColor=LIGHT_BLUE,
alignment=TA_CENTER, spaceAfter=4, fontName="Helvetica")
toc_title_style = make_style("TocTitle", fontSize=16, textColor=DARK_BLUE,
alignment=TA_CENTER, spaceAfter=12, fontName="Helvetica-Bold")
toc_item_style = make_style("TocItem", fontSize=11, textColor=MED_BLUE,
spaceAfter=4, leftIndent=20, fontName="Helvetica")
chapter_style = make_style("Chapter", fontSize=18, textColor=colors.white,
spaceAfter=6, fontName="Helvetica-Bold", alignment=TA_LEFT)
section_style = make_style("Section", fontSize=13, textColor=DARK_BLUE,
spaceBefore=10, spaceAfter=4, fontName="Helvetica-Bold",
borderPad=4)
subsection_style = make_style("Subsection", fontSize=11, textColor=MED_BLUE,
spaceBefore=8, spaceAfter=3, fontName="Helvetica-Bold")
body_style = make_style("Body", fontSize=10, textColor=TEXT_DARK,
spaceAfter=4, fontName="Helvetica", leading=15,
alignment=TA_JUSTIFY)
bullet_style = make_style("Bullet", fontSize=10, textColor=TEXT_DARK,
spaceAfter=3, leftIndent=15, fontName="Helvetica",
leading=14, bulletIndent=5)
key_style = make_style("KeyPoint", fontSize=10, textColor=DARK_BLUE,
spaceAfter=3, leftIndent=15, fontName="Helvetica-Bold",
leading=14)
warn_style = make_style("Warn", fontSize=10, textColor=RED,
spaceAfter=3, leftIndent=15, fontName="Helvetica-Bold")
green_style = make_style("GreenNote", fontSize=10, textColor=GREEN,
spaceAfter=3, leftIndent=15, fontName="Helvetica-Bold")
table_header_style = make_style("TableHdr", fontSize=9, textColor=colors.white,
fontName="Helvetica-Bold", alignment=TA_CENTER)
table_body_style = make_style("TableBody", fontSize=9, textColor=TEXT_DARK,
fontName="Helvetica", alignment=TA_LEFT)
note_style = make_style("Note", fontSize=9, textColor=PURPLE,
spaceAfter=3, leftIndent=15, fontName="Helvetica-Oblique")
def B(text): return f"<b>{text}</b>"
def I(text): return f"<i>{text}</i>"
def bullet(text): return Paragraph(f"• {text}", bullet_style)
def key(text): return Paragraph(f"★ {text}", key_style)
def warn(text): return Paragraph(f"⚠ {text}", warn_style)
def green_note(text): return Paragraph(f"✔ {text}", green_style)
def note(text): return Paragraph(f"📝 {text}", note_style)
def body(text): return Paragraph(text, body_style)
def sub(text): return Paragraph(text, subsection_style)
def sec(text): return Paragraph(text, section_style)
def chapter_header(num, title, color=DARK_BLUE):
return Table(
[[Paragraph(f"CHAPTER {num} | {title}", chapter_style)]],
colWidths=[17*cm],
style=TableStyle([
("BACKGROUND", (0,0), (-1,-1), color),
("ROWBACKGROUNDS", (0,0), (-1,-1), [color]),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("LEFTPADDING", (0,0), (-1,-1), 14),
("ROUNDEDCORNERS", [6]),
])
)
def info_box(title, items, bg=LIGHT_BLUE):
content = [[Paragraph(title, make_style("IB_T", fontSize=10,
fontName="Helvetica-Bold", textColor=DARK_BLUE))]]
for item in items:
content.append([Paragraph(f"• {item}", make_style("IB_B", fontSize=9,
fontName="Helvetica", textColor=TEXT_DARK, leading=13))])
t = Table(content, colWidths=[16.5*cm],
style=TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 1, MED_BLUE),
("ROUNDEDCORNERS", [4]),
]))
return t
def make_table(headers, rows, col_widths=None):
if col_widths is None:
col_widths = [17*cm/len(headers)] * len(headers)
header_row = [Paragraph(h, table_header_style) for h in headers]
data = [header_row]
for i, row in enumerate(rows):
data.append([Paragraph(str(c), table_body_style) for c in row])
style = TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, LIGHT_GRAY]),
("GRID", (0,0), (-1,-1), 0.5, MED_GRAY),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
])
return Table(data, colWidths=col_widths, style=style, repeatRows=1)
# ═══════════════════════════════════════════════════════════════════════════
# PAGE NUMBERING
# ═══════════════════════════════════════════════════════════════════════════
def add_page_number(canvas_obj, doc):
canvas_obj.saveState()
canvas_obj.setFont("Helvetica", 8)
canvas_obj.setFillColor(colors.HexColor("#888888"))
canvas_obj.drawCentredString(A4[0]/2, 1.2*cm,
f"MD Anaesthesia Quick Revision Guide | Page {doc.page}")
canvas_obj.restoreState()
# ═══════════════════════════════════════════════════════════════════════════
# CONTENT BUILDER
# ═══════════════════════════════════════════════════════════════════════════
story = []
# ── COVER PAGE ───────────────────────────────────────────────────────────────
cover_data = [[Paragraph("MD ANAESTHESIA", title_style)],
[Paragraph("Quick Revision Study Guide", subtitle_style)],
[Paragraph("Finals Exam Preparation", make_style("CovSub2", fontSize=12,
textColor=ACCENT_GOLD, alignment=TA_CENTER, fontName="Helvetica-Oblique"))],
[Spacer(1, 0.4*cm)],
[Paragraph("Miller's Anesthesia • Morgan & Mikhail • Barash Clinical Anesthesia",
make_style("Sources", fontSize=9, textColor=LIGHT_BLUE, alignment=TA_CENTER,
fontName="Helvetica-Oblique"))],
[Spacer(1, 0.4*cm)],
[Paragraph("July 2026", make_style("Date", fontSize=10,
textColor=LIGHT_BLUE, alignment=TA_CENTER, fontName="Helvetica"))]]
cover_table = Table(cover_data, colWidths=[17*cm],
style=TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 18),
("BOTTOMPADDING", (0,0), (-1,-1), 18),
("LEFTPADDING", (0,0), (-1,-1), 20),
("RIGHTPADDING", (0,0), (-1,-1), 20),
]))
story.append(Spacer(1, 3*cm))
story.append(cover_table)
story.append(PageBreak())
# ── TABLE OF CONTENTS ────────────────────────────────────────────────────────
story.append(Paragraph("TABLE OF CONTENTS", toc_title_style))
story.append(HRFlowable(width="100%", thickness=2, color=DARK_BLUE))
story.append(Spacer(1, 0.5*cm))
toc_items = [
("1", "Inhalational Anaesthetic Agents"),
("2", "Intravenous Anaesthetic Agents"),
("3", "Neuromuscular Blocking Drugs"),
("4", "Opioid Analgesics"),
("5", "Local Anaesthetics"),
("6", "Airway Management"),
("7", "Spinal & Epidural Anaesthesia"),
("8", "Monitoring in Anaesthesia"),
("9", "Anaesthesia for Special Populations"),
("10", "Complications in Anaesthesia"),
("11", "Pain Management & Acute Pain Service"),
("12", "High-Yield Exam Points & Mnemonics"),
]
for num, item in toc_items:
story.append(Paragraph(f"Chapter {num} ............... {item}", toc_item_style))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 1 - INHALATIONAL AGENTS
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("1", "INHALATIONAL ANAESTHETIC AGENTS"))
story.append(Spacer(1, 0.3*cm))
story.append(body("Inhalational agents are volatile halogenated hydrocarbons or gases used for induction and maintenance of general anaesthesia. They act via multiple mechanisms including potentiation of GABA-A receptors, inhibition of NMDA receptors, and modulation of glycine receptors."))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Key Physical Properties & MAC Values"))
story.append(make_table(
["Agent", "MAC (%)", "Blood:Gas Coeff.", "Oil:Gas Coeff.", "Key Features"],
[
["Halothane", "0.75", "2.4 (slow)", "224", "Hepatotoxicity (Type I & II), sensitizes to catecholamines"],
["Isoflurane", "1.2", "1.4 (medium)", "91", "Coronary steal debate, good muscle relaxant"],
["Sevoflurane", "2.0", "0.65 (fast)", "47", "Compound A nephrotoxicity (theoretical), safe for inhalational induction"],
["Desflurane", "6.0", "0.45 (fastest)", "18.7", "Pungent, BP-sensitive vaporizer, rapid emergence"],
["Nitrous Oxide", "104", "0.47", "1.4", "No muscle relaxation, diffusion hypoxia, PONV, megaloblastic anemia"],
],
col_widths=[2.5*cm, 1.8*cm, 2.5*cm, 2.5*cm, 8.2*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Minimum Alveolar Concentration (MAC)"))
story.append(body("MAC is the alveolar concentration of an inhalational agent (at 1 atm) that prevents movement in 50% of patients in response to a surgical skin incision. It represents the ED50."))
story.append(info_box("Factors Altering MAC", [
"DECREASES MAC: Old age, hypothermia, hypotension, anaemia, pregnancy (30%), opioids, alpha-2 agonists, lithium, acute alcohol intoxication, hypoxia, hyponatraemia",
"INCREASES MAC: Hyperthermia, hypernatraemia, chronic alcohol use, MAO inhibitors, cocaine/amphetamines, infants (highest MAC ~6 months)",
"MAC-BAR (block adrenergic response) = 1.5 MAC | MAC-awake = 0.3 MAC | MAC-intubation = 1.3 MAC",
]))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Uptake & Distribution (FA/FI Curve)"))
story.append(body("The rate of rise of alveolar concentration (FA) toward inspired concentration (FI) determines speed of induction. Agents with LOW blood:gas solubility equilibrate faster → faster induction & emergence (desflurane > sevoflurane > nitrous oxide > isoflurane > halothane)."))
story.append(body("Factors accelerating FA/FI rise: high alveolar ventilation, low cardiac output, low blood solubility, low tissue solubility."))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Cardiovascular Effects"))
story.append(make_table(
["Effect", "Halothane", "Isoflurane", "Sevoflurane", "Desflurane"],
[
["Myocardial depression", "+++", "++", "+", "+"],
["SVR reduction", "+", "+++", "++", "+++"],
["Heart rate", "↓", "↑", "→/↑", "↑↑ (rapid increase)"],
["Catecholamine sensitization", "+++", "+", "+", "+"],
],
col_widths=[4*cm, 3.3*cm, 3.3*cm, 3.2*cm, 3.2*cm]
))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Halothane Hepatotoxicity"))
story.append(body("Type I (mild): Asymptomatic elevation of liver enzymes. Mechanism: reductive metabolism producing free radicals. Incidence ~20%."))
story.append(body("Type II (fulminant): Immune-mediated hepatic necrosis. Mechanism: oxidative metabolism → trifluoroacetyl chloride → hapten → antibody response. Incidence 1:35,000."))
story.append(warn("Repeated halothane exposure within 3 months greatly increases Type II risk."))
story.append(sub("Nitrous Oxide - Important Points"))
story.append(bullet("Inhibits methionine synthase → megaloblastic anaemia (prolonged use)"))
story.append(bullet("Expands air-containing cavities (30x more soluble than N₂) - CONTRAINDICATED in pneumothorax, bowel obstruction, middle ear surgery, air embolism"))
story.append(bullet("Diffusion hypoxia (Fink effect): 100% O₂ for 3-5 min at end of anaesthesia"))
story.append(bullet("Second gas effect and concentration effect accelerate uptake of co-administered agents"))
story.append(key("MAC = 104% - so cannot produce surgical anaesthesia alone at 1 atm"))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 2 - IV ANAESTHETIC AGENTS
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("2", "INTRAVENOUS ANAESTHETIC AGENTS", MED_BLUE))
story.append(Spacer(1, 0.3*cm))
story.append(make_table(
["Agent", "Induction Dose", "Mechanism", "Key Advantages", "Contraindications/Side Effects"],
[
["Propofol", "1.5-2.5 mg/kg", "↑ GABA-A", "Rapid recovery, antiemetic, anti-epileptic", "Pain on injection, hypotension, propofol infusion syndrome (PRIS) at >4mg/kg/h >48h"],
["Thiopentone", "3-5 mg/kg", "↑ GABA-A", "Rapid, anti-epileptic, cerebral protection", "Contraindicated in porphyria, cannot be mixed with acidic drugs, no analgesia"],
["Ketamine", "1-2 mg/kg IV, 4-6 mg/kg IM", "NMDA antagonist", "Analgesia, bronchodilation, CV stimulation, ideal in shock/asthma", "Emergence delirium (treat with midazolam), raised ICP/IOP, excess secretions"],
["Etomidate", "0.3 mg/kg", "↑ GABA-A", "Haemodynamic stability, good for cardiac patients", "Adrenocortical suppression (single dose), myoclonus, PONV, pain on injection"],
["Midazolam", "0.2 mg/kg IV", "↑ GABA-A (BZD site)", "Anxiolytic, amnesia, anticonvulsant, reversible (flumazenil)", "Respiratory depression, paradoxical excitation"],
],
col_widths=[2.4*cm, 2.6*cm, 2.6*cm, 4.2*cm, 5.2*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Propofol - Key Pharmacokinetics"))
story.append(body("Propofol is formulated in a lipid emulsion (soyabean oil, egg lecithin). It undergoes hepatic conjugation (glucuronidation) and extrahepatic metabolism. Context-sensitive half-time is short due to rapid redistribution. Protein binding: 98%. Volume of distribution: very large."))
story.append(info_box("PRIS - Propofol Infusion Syndrome", [
"Risk: infusion >4 mg/kg/h for >48 hours, especially in critically ill children or head injury patients",
"Features: metabolic acidosis, rhabdomyolysis, cardiac failure, renal failure, hyperlipidaemia, green urine",
"Mechanism: impaired mitochondrial fatty acid oxidation and direct inhibition of mitochondrial respiratory chain",
"Management: stop propofol immediately, supportive care, consider haemofiltration",
]))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Ketamine - Dissociative Anaesthesia"))
story.append(body("Ketamine produces a 'dissociative' state - eyes remain open with nystagmus, muscle tone maintained, pharyngeal-laryngeal reflexes largely preserved (but not protective). Causes catecholamine release → tachycardia, hypertension."))
story.append(bullet("Bronchodilator - drug of choice for induction in status asthmaticus"))
story.append(bullet("Ideal in haemodynamic instability, burns, field anaesthesia"))
story.append(warn("Direct myocardial depressant - in catecholamine-depleted patients (e.g., prolonged shock), hypotension can occur"))
story.append(key("S(+) ketamine is 3-4x more potent than R(-) ketamine; less emergence delirium"))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 3 - NEUROMUSCULAR BLOCKING DRUGS
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("3", "NEUROMUSCULAR BLOCKING DRUGS (NMBDs)"))
story.append(Spacer(1, 0.3*cm))
story.append(body("NMBDs act at the neuromuscular junction (NMJ) by binding to nicotinic acetylcholine receptors (nAChRs) at the motor end-plate. They are classified as depolarizing or non-depolarizing."))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Classification & Comparison"))
story.append(make_table(
["Property", "Succinylcholine (Suxamethonium)", "Non-Depolarizing NMBDs"],
[
["Mechanism", "Persistent depolarization - Phase I block", "Competitive antagonism at nAChR"],
["Train of Four (TOF)", "Fade absent in Phase I; fade present in Phase II", "Fade present (T1>T2>T3>T4)"],
["Post-tetanic facilitation", "Absent in Phase I", "Present"],
["Reversal by neostigmine", "Phase I - not reversed (may worsen); Phase II - partially reversed", "Yes - reversed by neostigmine/sugammadex"],
["Onset", "60-90 seconds (fastest)", "Rocuronium 60-90s (RSI dose 1.2mg/kg)"],
["Duration", "~10 minutes (ultra-short)", "Varies: atracurium ~25-35 min, vecuronium ~25-40 min, pancuronium ~60-90 min"],
],
col_widths=[4*cm, 6.5*cm, 6.5*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Succinylcholine - Side Effects & Contraindications"))
story.append(make_table(
["Side Effect", "Mechanism", "Clinical Notes"],
[
["Hyperkalaemia", "Muscle fasciculations release K+", "Rise of 0.5-1 mEq/L normal. Dangerous (5-10 mEq/L rise) in burns, crush injury, denervation injuries, prolonged immobility - CONTRAINDICATED"],
["Malignant hyperthermia", "Triggering agent - ryanodine receptor mutation", "Also triggered by volatile agents; treat with dantrolene 2.5 mg/kg"],
["Bradycardia/asystole", "Muscarinic stimulation (neonates, repeated doses)", "Pretreat with atropine in children for 2nd dose"],
["Raised IOP/ICP/IGP", "Fasciculations increase all pressures", "Relative contraindication in open eye injury, penetrating eye trauma"],
["Masseter spasm", "May indicate MH susceptibility", "Abandon procedure or treat as MH"],
["Pseudocholinesterase deficiency", "Prolonged block (Phase II)", "Dibucaine number: normal 80, heterozygous ~60, homozygous ~20"],
],
col_widths=[3.5*cm, 5*cm, 8.5*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Non-Depolarizing NMBDs - Individual Agents"))
story.append(make_table(
["Drug", "Class", "Onset", "Duration", "Elimination", "Key Points"],
[
["Atracurium", "Benzylisoquinoline", "3-5 min", "25-35 min", "Hofmann elimination + ester hydrolysis", "Histamine release; laudanosine (CNS stimulant) metabolite; ideal in liver/renal failure"],
["Cisatracurium", "Benzylisoquinoline", "5-7 min", "45-60 min", "Hofmann elimination (no ester hydrolysis)", "No histamine release; preferred in organ failure; less laudanosine"],
["Vecuronium", "Aminosteroidal", "3-5 min", "25-40 min", "Hepatic (3-OH metabolite active)", "Minimal CVS effects; cumulative with repeat doses"],
["Rocuronium", "Aminosteroidal", "60-90s (1.2mg/kg)", "45-70 min", "Hepatic/biliary", "Only NDNMB suitable for RSI; reversed by sugammadex"],
["Pancuronium", "Aminosteroidal", "3-5 min", "60-90 min", "Renal 80%", "Tachycardia (vagolytic), HTN; prolonged in renal failure"],
["Mivacurium", "Benzylisoquinoline", "2-3 min", "15-20 min", "Plasma cholinesterase", "Ultra-short; histamine release; prolonged in pseudocholinesterase deficiency"],
],
col_widths=[2.8*cm, 3.2*cm, 1.8*cm, 2.2*cm, 3.5*cm, 5.5*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Reversal of NMB"))
story.append(body("Traditional reversal: Neostigmine (acetylcholinesterase inhibitor) + Glycopyrrolate (muscarinic blocker). Neostigmine dose: 0.05 mg/kg. Must be given when some spontaneous recovery is present (TOF count ≥2)."))
story.append(body("Sugammadex: Modified gamma-cyclodextrin. Encapsulates and irreversibly binds rocuronium > vecuronium. Can reverse even profound block. Dose: 2 mg/kg for moderate block, 4 mg/kg for deep block, 16 mg/kg for immediate reversal of rocuronium RSI dose."))
story.append(warn("Neostigmine CANNOT reverse succinylcholine Phase I block - may deepen it."))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 4 - OPIOID ANALGESICS
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("4", "OPIOID ANALGESICS", colors.HexColor("#1E4D6B")))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Opioid Receptor Types"))
story.append(make_table(
["Receptor", "Endogenous Ligand", "Analgesic Site", "Key Effects"],
[
["μ (Mu, MOP)", "β-Endorphin", "Brain, spinal cord", "Supraspinal analgesia, euphoria, respiratory depression, miosis, constipation, bradycardia, PONV"],
["κ (Kappa, KOP)", "Dynorphin", "Spinal cord, brain", "Spinal analgesia, sedation, dysphoria, miosis, no respiratory depression"],
["δ (Delta, DOP)", "Enkephalin", "Brain, spinal cord", "Modulation of mu receptor activity, analgesia, mood"],
["NOP (ORL-1)", "Nociceptin/Orphanin FQ", "Brain", "Anti-analgesic in brain, analgesic at spinal level"],
],
col_widths=[3*cm, 3*cm, 3.5*cm, 7.5*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Commonly Used Opioids - Comparison"))
story.append(make_table(
["Opioid", "Potency vs Morphine", "Duration", "Route", "Key Features"],
[
["Morphine", "1", "4-6 hr", "IV/IM/SC/PO/IT", "Active metabolite (M6G - analgesic; M3G - neuroexcitatory); histamine release; avoid in renal failure"],
["Fentanyl", "100x", "30-60 min", "IV/transdermal/IT/buccal", "Highly lipophilic; rapid onset; chest wall rigidity (large doses); minimal histamine; context-sensitive"],
["Sufentanil", "500-1000x", "30-45 min", "IV/IT", "Most potent clinical opioid; intrathecal labour analgesia; high lipophilicity"],
["Remifentanil", "~200x", "3-5 min (esterases)", "IV infusion only", "Ultra-short; not accumulate; acute opioid tolerance; must have analgesic plan at end"],
["Alfentanil", "10-25x", "15-30 min", "IV", "Rapid onset; low Vd; good for TIVA; conscious sedation"],
["Tramadol", "0.1x", "4-6 hr", "IV/PO/IM", "Weak opioid + serotonin/noradrenaline reuptake inhibitor; avoid with MAOIs; lowers seizure threshold"],
["Methadone", "1-2x", "24-36 hr", "PO/IV", "Long-acting; QTc prolongation; drug-drug interactions; opioid maintenance therapy"],
],
col_widths=[2.8*cm, 2.8*cm, 2.2*cm, 2.5*cm, 6.7*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(key("Naloxone (opioid antagonist): 0.1-0.4 mg IV; duration 30-45 min - may need repeat dosing as it is shorter acting than most opioids"))
story.append(warn("Tramadol + SSRIs/SNRIs/MAOIs = Serotonin syndrome risk"))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 5 - LOCAL ANAESTHETICS
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("5", "LOCAL ANAESTHETICS"))
story.append(Spacer(1, 0.3*cm))
story.append(body("Local anaesthetics work by blocking voltage-gated sodium channels in the inactivated (closed) state, preventing depolarization and propagation of action potentials. They preferentially block small, unmyelinated fibres (C and Aδ) at lower concentrations."))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Classification"))
story.append(body("Esters: Cocaine, Procaine, Chloroprocaine, Tetracaine (Amethocaine) - metabolized by plasma pseudocholinesterase → PABA (allergenic)"))
story.append(body("Amides: Lidocaine, Bupivacaine, Ropivacaine, Levobupivacaine, Mepivacaine, Prilocaine - metabolized by hepatic CYP450. Rarely cause true allergy."))
story.append(sub("Key Properties & Maximum Doses"))
story.append(make_table(
["Drug", "Class", "Onset", "Duration (plain)", "Max Dose (plain)", "Max Dose (+ adrenaline)", "pKa"],
[
["Lidocaine", "Amide", "Fast", "60-120 min", "3 mg/kg (200mg)", "7 mg/kg (500mg)", "7.9"],
["Bupivacaine", "Amide", "Slow", "4-8 hrs", "2 mg/kg (150mg)", "2 mg/kg (150mg)", "8.1"],
["Levobupivacaine", "Amide", "Slow", "4-8 hrs", "2.5 mg/kg (150mg)", "2.5 mg/kg (150mg)", "8.1"],
["Ropivacaine", "Amide", "Slow-medium", "4-6 hrs", "3 mg/kg (225mg)", "3 mg/kg (225mg)", "8.1"],
["Prilocaine", "Amide", "Medium", "90-120 min", "6 mg/kg (400mg)", "8.5 mg/kg (600mg)", "7.9"],
["Cocaine", "Ester", "Fast", "45-90 min", "1.5 mg/kg (200mg)", "NEVER (vasoconstrictive)", "8.7"],
],
col_widths=[2.8*cm, 1.5*cm, 1.5*cm, 2.8*cm, 3.2*cm, 3.5*cm, 1.7*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Local Anaesthetic Systemic Toxicity (LAST)"))
story.append(body("Occurs with unintentional intravascular injection or absolute overdose. Bupivacaine is most cardiotoxic (binds cardiac Na+ channels in fast-in, slow-out manner)."))
story.append(info_box("LAST Clinical Features (CNS then CVS)", [
"EARLY CNS: perioral tingling, metallic taste, tinnitus, lightheadedness, visual disturbances",
"LATE CNS: convulsions, CNS depression, unconsciousness",
"CVS: widening QRS, ST changes, ventricular arrhythmias, cardiovascular collapse",
"MANAGEMENT: stop injection, 100% O₂, airway management, benzodiazepines for seizures",
"LIPID RESCUE: 20% Intralipid 1.5 mL/kg bolus IV over 1 min → 0.25 mL/kg/min infusion for 10 min",
"Continue CPR for at least 60 minutes; avoid vasopressin, calcium channel blockers",
]))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Additives to Local Anaesthetics"))
story.append(bullet("Adrenaline (epinephrine): prolongs action by vasoconstriction, reduces systemic absorption, reduces toxicity, marker of intravascular injection. AVOID in: digital blocks, penile blocks, ear, nose"))
story.append(bullet("Sodium bicarbonate: increases pH → more un-ionized (active) form → faster onset"))
story.append(bullet("Dexamethasone: prolongs block duration"))
story.append(bullet("Clonidine/Dexmedetomidine (alpha-2 agonists): prolong block, sedation"))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 6 - AIRWAY MANAGEMENT
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("6", "AIRWAY MANAGEMENT", colors.HexColor("#2D5016")))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Airway Assessment"))
story.append(make_table(
["Test", "Normal / Low Risk", "Abnormal / High Risk"],
[
["Mallampati Class", "Class I/II (soft palate, uvula, faucial pillars visible)", "Class III/IV (base of uvula/soft palate not visible)"],
["Mouth Opening", ">3 cm (>3 finger breadths)", "<3 cm - limited access"],
["Thyromental Distance", ">6.5 cm (>3 finger breadths)", "<6 cm - anterior larynx"],
["Sternomental Distance", ">12.5 cm", "<12 cm - limited neck extension"],
["Upper Lip Bite Test", "Class I (lower incisors bite above upper lip)", "Class III (lower incisors cannot bite upper lip)"],
["Neck extension", "Full range", "Limited - arthritic, cervical pathology"],
["3-3-2 Rule", "3 fingers mouth, 3 fingers hyoid-chin, 2 fingers hyoid-thyroid", "Any parameter <2 fingers = difficult airway"],
],
col_widths=[4.5*cm, 6.5*cm, 6*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Rapid Sequence Induction (RSI)"))
story.append(info_box("RSI Steps (COVER MAID Mnemonic expanded)", [
"Indication: full stomach, aspiration risk (emergency surgery, GORD, obesity, pregnancy)",
"Pre-oxygenation: 3-5 min tidal volume breathing OR 8 vital capacity breaths with 100% O₂",
"Cricoid pressure (Sellick): 10N awake → 30N on induction (controversial, may worsen laryngoscopy view)",
"Induction drugs: Propofol 1.5-2.5 mg/kg OR Thiopentone 3-5 mg/kg OR Ketamine 1.5-2 mg/kg",
"Muscle relaxant: Succinylcholine 1.5 mg/kg (60-90s) OR Rocuronium 1.2 mg/kg (60-90s)",
"Intubation: cuffed ETT, confirm with capnography (gold standard) + auscultation + CXR",
"Failed intubation plan: 2 attempts max, then declare 'failed intubation', proceed to CICO if needed",
]))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Laryngeal Mask Airways (LMA)"))
story.append(make_table(
["Type", "Key Feature", "Clinical Use"],
[
["Classic LMA", "Reusable, simple", "Routine GA, no aspiration risk, spontaneous/controlled ventilation"],
["ProSeal LMA", "Gastric drain port + better seal", "Allows gastric suctioning, positive pressure ventilation, reduced aspiration risk"],
["i-gel", "Gel cuff (no inflation), integrated bite block", "Rapid insertion, minimal trauma, good seal"],
["Fastrach (ILMA)", "Intubating LMA", "Blind intubation through LMA; manages difficult airway"],
["Supreme LMA", "Disposable, drain tube, bite block", "Positive pressure ventilation, gastric access"],
],
col_widths=[3.5*cm, 5.5*cm, 8*cm]
))
story.append(Spacer(1, 0.2*cm))
story.append(sub("CICO - Can't Intubate, Can't Oxygenate"))
story.append(body("Life-threatening scenario. Immediate surgical airway required."))
story.append(bullet("Needle cricothyroidotomy: 14G cannula → jet ventilation (I:E 1:4 to allow passive exhalation)"))
story.append(bullet("Surgical cricothyroidotomy: scalpel-finger-bougie technique (preferred in adults); Melker kit"))
story.append(key("DAS (Difficult Airway Society) guidelines 2015 for unanticipated difficult intubation in adults form the gold standard algorithm"))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 7 - SPINAL & EPIDURAL ANAESTHESIA
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("7", "SPINAL & EPIDURAL ANAESTHESIA", colors.HexColor("#4A1A6B")))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Anatomical Landmarks"))
story.append(make_table(
["Structure", "Key Facts"],
[
["Spinal cord termination", "Conus medullaris at L1 in adults, L3 in neonates"],
["Safe interspaces", "L3-L4 or L4-L5 for spinal/epidural in adults"],
["Layers pierced (spinal)", "Skin → Subcutaneous tissue → Supraspinous ligament → Interspinous ligament → Ligamentum flavum → Epidural space → Dura → Subarachnoid space (CSF)"],
["Epidural space", "Contains fat, blood vessels, nerve roots; distance from skin 4-6 cm (lumber)"],
["CSF characteristics", "Volume 120-150 mL; clear, colourless; pH 7.35; glucose 60-80 mg/dL; protein 15-45 mg/dL"],
],
col_widths=[4.5*cm, 12.5*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Spinal Anaesthesia"))
story.append(body("Mechanism: injection of LA into subarachnoid (intrathecal) space → diffuses in CSF → blocks nerve roots. Order of block: sympathetic (B fibres) → pain/temperature (C, Aδ) → touch/pressure (Aβ) → motor (Aα). Regression occurs in reverse."))
story.append(make_table(
["Determinant of Block Height", "Effect"],
[
["Baricity of solution", "Hyperbaric (heavy) sinks to dependent areas; hypobaric rises to non-dependent areas; isobaric stays at injection level"],
["Position of patient", "Sitting: saddle block; Lateral: unilateral block possible with hyperbaric solution"],
["Dose (volume × concentration)", "Primary determinant of block height"],
["CSF volume", "Reduced CSF volume (pregnancy, obesity, elderly) → higher block with same dose"],
["Speed of injection", "Faster injection → turbulence → higher spread (controversial)"],
["Needle direction", "Cephalad injection → higher block"],
],
col_widths=[5*cm, 12*cm]
))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Complications of Neuraxial Anaesthesia"))
story.append(make_table(
["Complication", "Mechanism", "Management"],
[
["Post-dural puncture headache (PDPH)", "CSF leak through dural hole → traction on pain-sensitive structures. Worse sitting, better lying. Bilateral frontal/occipital", "Bed rest, hydration, caffeine, paracetamol. Epidural blood patch (10-20 mL autologous blood) >90% effective if conservative measures fail"],
["Total spinal", "LA reaches brainstem → apnoea, unconsciousness, hypotension, bradycardia", "Immediate intubation, CPR if needed, supportive"],
["Hypotension", "Sympathetic blockade → vasodilation + ↓ HR → ↓ CO", "Prehydration, vasopressors (phenylephrine or noradrenaline preferred in obstetrics), ephedrine if bradycardia"],
["Urinary retention", "S2-S4 sacral blockade → detrusor dysfunction", "Catheterization until block resolves"],
["Epidural haematoma", "Anticoagulation, coagulopathy, difficult insertion", "Urgent MRI; neurosurgical decompression within 6-8 hours of symptoms"],
["Anterior spinal artery syndrome", "Hypotension → ischaemia of anterior cord → motor loss, preserved posterior column (proprioception)", "Maintain BP; no proven treatment; supportive"],
],
col_widths=[4*cm, 6.5*cm, 6.5*cm]
))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Epidural Anaesthesia vs Spinal - Key Differences"))
story.append(make_table(
["Feature", "Spinal", "Epidural"],
[
["Space", "Subarachnoid", "Epidural"],
["Drug dose", "Small (hyperbaric bupivacaine 2-3 mL)", "Large (epidural bupivacaine 15-20 mL)"],
["Onset", "Rapid (2-5 min)", "Slow (15-20 min)"],
["Predictability", "High", "Variable"],
["Catheter", "Rarely used (continuous spinal)", "Yes - continuous infusion/top-up"],
["Systemic toxicity risk", "Very low", "Higher (large volumes, vascular plexus)"],
["Test dose", "Not required", "Required (3 mL LA + adrenaline 15 mcg - 20-30% HR rise = intravascular)"],
],
col_widths=[4*cm, 6.5*cm, 6.5*cm]
))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 8 - MONITORING IN ANAESTHESIA
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("8", "MONITORING IN ANAESTHESIA"))
story.append(Spacer(1, 0.3*cm))
story.append(sub("ASA Standards of Basic Monitoring"))
story.append(info_box("ASA Basic Monitoring (must be present for ALL anaesthetics)", [
"1. Oxygenation: pulse oximetry (SpO₂), inspired O₂ concentration (FiO₂ ≥21%)",
"2. Ventilation: capnography (ETCO₂) - gold standard for confirming ETT placement and ventilation adequacy",
"3. Circulation: ECG, NIBP every 5 minutes minimum, heart rate",
"4. Temperature: core temperature monitoring for prolonged procedures",
"5. Awareness monitoring: anaesthetic agent monitoring (volatile or BIS/Entropy for TIVA)",
]))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Depth of Anaesthesia Monitoring"))
story.append(make_table(
["Monitor", "Principle", "Values/Interpretation"],
[
["BIS (Bispectral Index)", "Processed EEG parameter from frontal electrodes, 0-100 scale", "100=awake, 60-40=surgical anaesthesia, <40=deep anaesthesia/burst suppression, 0=flat EEG"],
["Entropy (State/Response Entropy)", "SE: 0-91 (fast-responding, EMG+EEG); RE: 0-100 (adds facial EMG)", "Target: SE 40-60; RE-SE difference >10 = frontal EMG activity → arousal?"],
["Auditory Evoked Potentials (AEP)", "Brainstem + cortical responses to auditory stimuli", "MLAEPs (cortical) sensitive to awareness; complex to use"],
["ETCO₂ (Capnography)", "End-tidal CO₂ concentration - reflects PaCO₂", "Normal ETCO₂ = 35-45 mmHg; gradient PaCO₂-ETCO₂ normally 2-5 mmHg"],
],
col_widths=[4*cm, 6*cm, 7*cm]
))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Neuromuscular Monitoring (Train of Four)"))
story.append(body("TOF: 4 supramaximal stimuli at 0.5-second intervals (2 Hz). Each response measured as T1-T4."))
story.append(make_table(
["TOF Ratio", "Clinical Interpretation", "Required Action"],
[
["TOF count 0", "Profound block (>95% receptors blocked)", "Do not reverse; continue to wait"],
["TOF count 1-3", "Deep-moderate block", "May use sugammadex (4 mg/kg); do not give neostigmine yet"],
["TOF count 4 (fade present)", "Moderate block (~75% receptors blocked)", "Give neostigmine + glycopyrrolate OR sugammadex 2 mg/kg"],
["TOF ratio >0.9", "Adequate recovery for extubation", "Safe to extubate"],
],
col_widths=[4*cm, 6.5*cm, 6.5*cm]
))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 9 - SPECIAL POPULATIONS
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("9", "ANAESTHESIA FOR SPECIAL POPULATIONS", MED_BLUE))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Obstetric Anaesthesia"))
story.append(body("Physiological changes in pregnancy that affect anaesthesia:"))
story.append(make_table(
["System", "Change", "Anaesthetic Implication"],
[
["Respiratory", "FRC ↓20%, O₂ consumption ↑20%, minute ventilation ↑50%, mucosal engorgement", "Faster desaturation during apnoea; difficult nasotracheal intubation; use smaller ETT (6.5-7.0)"],
["Cardiovascular", "CO ↑40%, plasma volume ↑50%, SVR ↓20%, Hb dilutional anaemia", "Supine hypotension syndrome from aortocaval compression → left lateral tilt 15°"],
["GI", "Reduced LOS tone, raised gastric pressure, delayed gastric emptying", "Full stomach from ~20 weeks → RSI mandatory for GA"],
["Pharmacology", "MAC reduced 30-40%; plasma pseudocholinesterase activity ↓25%", "Lower doses needed; prolonged succinylcholine action"],
["Haematology", "Hypercoagulable state, dilutional thrombocytopenia", "DVT risk; thromboprophylaxis; platelet count before epidural"],
],
col_widths=[2.8*cm, 4.5*cm, 9.7*cm]
))
story.append(Spacer(1, 0.2*cm))
story.append(key("Phenylephrine is first-line vasopressor for spinal-induced hypotension in obstetrics (preserves uteroplacental blood flow better than ephedrine)"))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Paediatric Anaesthesia - Key Differences"))
story.append(make_table(
["Parameter", "Neonates/Infants", "Clinical Implication"],
[
["Airway", "Large occiput, anterior/cephalad larynx, circular subglottic narrowing (cricoid), large tongue, floppy epiglottis", "Sniffing position without pillow; uncuffed ETT traditionally (now cuffed acceptable ≥2yr); ETT size = (age/4)+4"],
["Breathing", "Obligate nasal breathers, diaphragmatic breathing, high O₂ consumption, FRC same as adults relative to weight", "Rapid desaturation; prone to respiratory failure with chest splinting"],
["Circulation", "HR 120-160 bpm; CO predominantly rate-dependent; limited myocardial reserve; Patent Foramen Ovale", "Bradycardia = cardiac arrest; atropine 0.02 mg/kg IV"],
["Temperature", "Large surface area:mass ratio; poor thermoregulation; brown fat for thermogenesis", "Active warming essential; heated humidified gases"],
["Drug dosing", "Higher Vd; reduced protein binding; immature hepatic/renal function in neonates", "Weight-based dosing; toxicity at lower doses in neonates"],
],
col_widths=[2.5*cm, 5.5*cm, 9*cm]
))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Anaesthesia in Liver Disease"))
story.append(bullet("Reduced protein binding (↑ free drug concentration)"))
story.append(bullet("Prolonged drug action (halved hepatic clearance)"))
story.append(bullet("Coagulopathy (reduced clotting factors II, V, VII, IX, X, fibrinogen)"))
story.append(bullet("Risk of hepatorenal syndrome, hepatic encephalopathy post-surgery"))
story.append(bullet("Preferred agents: cisatracurium (Hofmann), morphine with caution, regional anaesthesia preferred"))
story.append(warn("Avoid halothane. Use minimal doses of benzodiazepines. Avoid NSAIDs."))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 10 - COMPLICATIONS
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("10", "COMPLICATIONS IN ANAESTHESIA", colors.HexColor("#8B2500")))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Malignant Hyperthermia (MH)"))
story.append(info_box("Malignant Hyperthermia", [
"Genetic disorder: autosomal dominant mutation in RYR1 gene (ryanodine receptor) on chromosome 19q13.2",
"Trigger agents: all volatile anaesthetics (halothane, isoflurane, sevoflurane, desflurane) + succinylcholine",
"Mechanism: uncontrolled release of Ca²⁺ from SR → sustained muscle contraction → heat generation",
"Clinical features: earliest sign = RISING ETCO₂; muscle rigidity, hyperthermia (>40°C), tachycardia, metabolic acidosis, dark urine (myoglobinuria), hyperkalaemia",
"TREATMENT: Stop trigger agents, 100% O₂, dantrolene 2.5 mg/kg IV (repeat every 5 min, max 10 mg/kg), active cooling, treat hyperkalaemia, maintain urine output >1 mL/kg/h",
"Dantrolene mechanism: blocks RYR1 → prevents Ca²⁺ release from SR",
"Non-triggering anaesthesia: propofol TIVA + non-depolarizing NMBDs + nitrous oxide (safe)",
]))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Awareness Under Anaesthesia"))
story.append(body("Incidence: ~0.1-0.2% (1-2/1000). Higher in: obstetrics (0.4%), cardiac surgery (0.3%), emergency surgery, muscle relaxant use without adequate hypnotic depth."))
story.append(bullet("Brice Questionnaire: standard tool for assessing awareness"))
story.append(bullet("Prevention: adequate pre-oxygenation, titrate anaesthetic depth, use BIS/Entropy monitoring, volatile agent monitoring (minimum 0.7 MAC)"))
story.append(bullet("Management: psychological support, debrief, refer to psychologist for potential PTSD"))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Anaphylaxis Under Anaesthesia"))
story.append(info_box("Management of Anaphylaxis During Anaesthesia (NAP6 UK guidelines)", [
"Remove causative agent, call for help, lie flat + leg elevation (if not contraindicated)",
"Adrenaline (epinephrine) IM 0.5 mg (0.5 mL of 1:1000) OR IV 50-100 mcg boluses",
"100% O₂, aggressive IV fluid resuscitation (1-2L crystalloid)",
"Maintain airway - consider early intubation before oedema develops",
"Second-line: antihistamine chlorphenamine 10 mg IV, hydrocortisone 200 mg IV (do NOT delay adrenaline)",
"Tryptase level at 15 min, 1-2 hours, 24 hours after reaction (confirms mast cell activation)",
"Most common triggers in theatre: Neuromuscular blocking drugs (NMBD) > Latex > Antibiotics",
]))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Postoperative Nausea and Vomiting (PONV)"))
story.append(body("Apfel Score (most widely used simplified risk score):"))
story.append(make_table(
["Risk Factor", "Score"],
[
["Female sex", "+1"],
["Non-smoker", "+1"],
["History of PONV or motion sickness", "+1"],
["Postoperative opioid use", "+1"],
],
col_widths=[10*cm, 7*cm]
))
story.append(body("Risk: 0 factors = 10%; 1 = 20%; 2 = 40%; 3 = 60%; 4 = 80%"))
story.append(bullet("Prophylaxis: ondansetron 4 mg IV, dexamethasone 4-8 mg IV, droperidol 0.625-1.25 mg IV"))
story.append(bullet("TIVA with propofol reduces PONV risk"))
story.append(bullet("Avoid N₂O and volatile agents in high-risk patients"))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 11 - PAIN MANAGEMENT
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("11", "PAIN MANAGEMENT & ACUTE PAIN SERVICE", colors.HexColor("#1A5276")))
story.append(Spacer(1, 0.3*cm))
story.append(sub("WHO Analgesic Ladder"))
story.append(make_table(
["Step", "Type", "Drugs"],
[
["Step 1", "Non-opioid ± adjuvants", "Paracetamol, NSAIDs (ibuprofen, diclofenac, ketorolac), COX-2 inhibitors"],
["Step 2", "Mild opioid ± non-opioid ± adjuvants", "Codeine, tramadol, dihydrocodeine, buprenorphine (low dose)"],
["Step 3", "Strong opioid ± non-opioid ± adjuvants", "Morphine, oxycodone, fentanyl, hydromorphone, methadone, alfentanil"],
],
col_widths=[2*cm, 4.5*cm, 10.5*cm]
))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Multimodal Analgesia"))
story.append(body("Combining agents from different drug classes/mechanisms to provide synergistic analgesia while minimizing side effects of individual agents at higher doses."))
story.append(info_box("Standard Multimodal Analgesia Protocol", [
"Regular paracetamol 1g IV/PO QDS (regardless of pain level)",
"Regular NSAID (if not contraindicated): diclofenac 50mg PO TDS OR ibuprofen 400mg PO TDS",
"Weak opioid: tramadol 50-100mg PO/IV QDS PRN OR codeine 30-60mg PO QDS",
"Strong opioid PRN: morphine 2.5-5mg IV/SC PRN for breakthrough OR Patient Controlled Analgesia (PCA)",
"Adjuvants: gabapentinoids (pregabalin/gabapentin), ketamine infusion, dexmedetomidine, regional blocks",
]))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Patient Controlled Analgesia (PCA) - Standard Settings"))
story.append(make_table(
["Parameter", "Morphine PCA", "Fentanyl PCA"],
[
["Bolus dose", "1-2 mg", "10-25 mcg"],
["Lockout interval", "5-10 minutes", "5-10 minutes"],
["Background infusion", "Not routinely (increases respiratory depression risk)", "Not routinely"],
["4-hour limit", "20-40 mg", "200-400 mcg"],
],
col_widths=[4.5*cm, 6.5*cm, 6*cm]
))
story.append(Spacer(1, 0.2*cm))
story.append(sub("Neuropathic Pain"))
story.append(body("Pain arising from a lesion or disease of the somatosensory nervous system. Features: burning, shooting, electric-shock, allodynia, hyperalgesia."))
story.append(bullet("First-line: Tricyclic antidepressants (amitriptyline 10-75 mg nocte), Gabapentinoids (pregabalin 75-300 mg BD, gabapentin 300-900 mg TDS)"))
story.append(bullet("Second-line: SNRIs (duloxetine 30-60 mg OD), topical lidocaine/capsaicin"))
story.append(bullet("Third-line: Tramadol, strong opioids, spinal cord stimulation"))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# CHAPTER 12 - HIGH YIELD EXAM POINTS & MNEMONICS
# ════════════════════════════════════════════════════════════════════════════
story.append(chapter_header("12", "HIGH-YIELD EXAM POINTS & MNEMONICS", ACCENT_GOLD))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Top 20 Must-Know Numbers for MD Anaesthesia"))
story.append(make_table(
["Parameter", "Value", "Clinical Relevance"],
[
["Halothane MAC", "0.75%", "Lowest MAC of volatile agents in clinical use"],
["N₂O MAC", "104%", "Cannot achieve surgical anaesthesia alone at 1 atm"],
["Bupivacaine max dose (plain)", "2 mg/kg (150 mg)", "Highest cardiotoxicity among amides"],
["Lidocaine max dose + adrenaline", "7 mg/kg (500 mg)", "Most commonly used amide LA"],
["Succinylcholine RSI dose", "1.5 mg/kg IV", "Fastest onset NMBD for RSI"],
["Rocuronium RSI dose", "1.2 mg/kg IV", "Reversed by sugammadex 16 mg/kg"],
["Sugammadex for profound reversal", "16 mg/kg", "Immediate reversal of rocuronium RSI dose"],
["Neostigmine max dose", "0.05 mg/kg (5 mg max)", "Must give with glycopyrrolate"],
["Dantrolene for MH", "2.5 mg/kg (max 10 mg/kg)", "Life-saving in malignant hyperthermia"],
["BIS target for surgical anaesthesia", "40-60", "Lower = deeper anaesthesia"],
["Spinal cord termination in adults", "L1 lower border", "L3 in neonates; safe space = L3-L4"],
["PDPH treatment: epidural blood patch", ">90% effective", "10-20 mL autologous blood"],
["Intralipid for LAST", "1.5 mL/kg 20% bolus → 0.25 mL/kg/min", "Lipid rescue for LA cardiotoxicity"],
["Adrenaline for anaphylaxis (adult)", "0.5 mg IM (0.5 mL of 1:1000)", "First-line, not second-line"],
["Tryptase timing", "15 min, 1-2 hr, 24 hr", "Confirms anaphylaxis/mast cell activation"],
["ETT size formula (child)", "(Age/4) + 4", "Uncuffed; cuffed = (Age/4) + 3.5"],
["O₂ flow rate: pre-oxygenation", "15 L/min via tight-fitting mask, 3-5 min", "8 vital capacity breaths as faster alternative"],
["Phenylephrine (obstetric hypotension)", "50-100 mcg IV bolus", "Preferred over ephedrine in caesarean section"],
["Apfel score 4", "80% PONV risk", "Requires prophylaxis with ≥2 antiemetics"],
["MAC reduction in pregnancy", "30-40%", "Also: FRC ↓20%, O₂ consumption ↑20%"],
],
col_widths=[5.5*cm, 4.5*cm, 7*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Key Mnemonics"))
story.append(make_table(
["Mnemonic", "Stands For", "Topic"],
[
["SOBA", "Solubility, Oil:gas, Blood:gas, Age → decrease MAC", "MAC determinants (or STOMP: Stimulants, Temperature, Old age, Morphine, Pregnancy)"],
["SOAP-ME", "Suction, Oxygen, Airway, Pharmacy, Monitoring, Equipment", "Pre-anaesthetic equipment check"],
["WETFLAG", "Weight, Energy, Tube, Fluids, Lorazepam, Adrenaline, Glucose", "Paediatric resuscitation doses"],
["AMPLE", "Allergies, Medications, Past history, Last meal, Events leading", "Pre-operative history in emergency"],
["STOPP/FORD", "Succinylcholine contraindications: major Burns, Hyperkalemia, Crush injury, Denervation, Myopathies, Prolonged immobility, Malignant hyperthermia, Pseudocholinesterase deficiency", "Contraindications to succinylcholine"],
["4-2-1 Rule", "Maintenance fluid: 4 mL/kg/hr for first 10kg; +2 mL/kg/hr for 10-20kg; +1 mL/kg/hr for each kg above 20", "Paediatric fluid maintenance (Holliday-Segar)"],
],
col_widths=[2.5*cm, 8*cm, 6.5*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(sub("Common Exam Question Formats & Model Answers"))
story.append(info_box("Long Answer Question Format: 'Describe the management of a patient with suspected malignant hyperthermia'", [
"Introduction: Define MH, genetics (RYR1 gene, AD inheritance), epidemiology",
"Pathophysiology: Uncontrolled Ca²⁺ release → sustained muscle contraction → thermogenesis",
"Triggering agents: All volatile anaesthetics + succinylcholine",
"Clinical features: Rising ETCO₂ (earliest), muscle rigidity, hyperthermia, metabolic acidosis",
"Immediate management: Call for help, remove triggers, hyperventilate with 100% O₂, dantrolene 2.5 mg/kg IV",
"Supportive treatment: Active cooling, correct metabolic abnormalities, maintain UO >1 mL/kg/h",
"Post-event: ICU monitoring ≥24h, genetic testing (IVCT), family screening",
]))
story.append(Spacer(1, 0.2*cm))
story.append(info_box("Short Answer Format: 'Compare spinal vs epidural anaesthesia'", [
"Table comparison: space, drug dose, onset, duration, reversibility, catheter use, complications",
"Clinical applications: spinal = single-shot surgery; epidural = labour, post-op analgesia",
"Advantages of each: spinal - reliable, fast, small dose; epidural - controllable, titratable",
"Complications specific to each: spinal - PDPH, total spinal; epidural - incomplete block, LAST, epidural haematoma",
]))
story.append(Spacer(1, 0.3*cm))
story.append(HRFlowable(width="100%", thickness=2, color=DARK_BLUE))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"Good luck with your MD Anaesthesia Finals! Remember: understanding mechanisms beats memorizing facts. "
"Sources: Miller's Anesthesia 10e, Morgan & Mikhail's Clinical Anesthesiology 7e, Barash Clinical Anesthesia 9e.",
make_style("Footer", fontSize=9, textColor=MED_BLUE, alignment=TA_CENTER,
fontName="Helvetica-Oblique", spaceAfter=6)
))
# ═══════════════════════════════════════════════════════════════════════════
# BUILD PDF
# ═══════════════════════════════════════════════════════════════════════════
doc = SimpleDocTemplate(
OUTPUT_PATH,
pagesize=A4,
rightMargin=2*cm,
leftMargin=2*cm,
topMargin=2*cm,
bottomMargin=2.5*cm,
title="MD Anaesthesia Quick Revision Guide",
author="Orris AI",
subject="Anaesthesia Finals Exam Preparation",
)
doc.build(story, onFirstPage=add_page_number, onLaterPages=add_page_number)
print(f"PDF generated: {OUTPUT_PATH}")