topic - Barbiturates. anesthesia exam answer. pdf format

Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/barbiturates-anesthesia && ls /tmp/workspace/barbiturates-anesthesia/

Writing File

~/barbiturates-anesthesia/generate_pdf.py

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

OUTPUT = "/tmp/workspace/barbiturates-anesthesia/Barbiturates_Anesthesia_Exam.pdf"

# ── Colour palette ────────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1a3a5c")
MID_BLUE    = colors.HexColor("#2563a8")
LIGHT_BLUE  = colors.HexColor("#dbeafe")
ACCENT      = colors.HexColor("#e74c3c")
ACCENT2     = colors.HexColor("#1a7a4a")
GREY_BG     = colors.HexColor("#f4f6f8")
GREY_LINE   = colors.HexColor("#bdc3c7")
WHITE       = colors.white
BLACK       = colors.black
YELLOW_BG   = colors.HexColor("#fffbeb")
YELLOW_LINE = colors.HexColor("#f59e0b")

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=2*cm, leftMargin=2*cm,
    topMargin=2*cm, bottomMargin=2*cm,
    title="Barbiturates – Anesthesia Exam Answer",
    author="Orris Medical"
)

styles = getSampleStyleSheet()

# ── Custom styles ─────────────────────────────────────────────────────────────
COVER_TITLE = ParagraphStyle("CoverTitle",
    fontSize=28, textColor=WHITE, alignment=TA_CENTER,
    fontName="Helvetica-Bold", spaceAfter=6, leading=34)

COVER_SUB = ParagraphStyle("CoverSub",
    fontSize=14, textColor=colors.HexColor("#d0e8ff"),
    alignment=TA_CENTER, fontName="Helvetica", spaceAfter=4, leading=18)

H1 = ParagraphStyle("H1",
    fontSize=14, textColor=WHITE, fontName="Helvetica-Bold",
    spaceBefore=10, spaceAfter=4, leading=18,
    backColor=DARK_BLUE, borderPad=(5,5,5,8), leftIndent=0)

H2 = ParagraphStyle("H2",
    fontSize=11, textColor=DARK_BLUE, fontName="Helvetica-Bold",
    spaceBefore=8, spaceAfter=3, leading=15,
    borderPad=2, leftIndent=0, borderColor=MID_BLUE)

H3 = ParagraphStyle("H3",
    fontSize=10, textColor=MID_BLUE, fontName="Helvetica-BoldOblique",
    spaceBefore=5, spaceAfter=2, leading=13)

BODY = ParagraphStyle("Body",
    fontSize=9.5, textColor=BLACK, fontName="Helvetica",
    spaceBefore=2, spaceAfter=2, leading=14, alignment=TA_JUSTIFY)

BULLET = ParagraphStyle("Bullet",
    fontSize=9.5, textColor=BLACK, fontName="Helvetica",
    spaceBefore=1, spaceAfter=1, leading=13,
    leftIndent=14, bulletIndent=4, bulletText="\u2022")

BOLD_BULLET = ParagraphStyle("BoldBullet",
    fontSize=9.5, textColor=BLACK, fontName="Helvetica-Bold",
    spaceBefore=1, spaceAfter=1, leading=13,
    leftIndent=14, bulletIndent=4, bulletText="\u2022")

NOTE = ParagraphStyle("Note",
    fontSize=9, textColor=colors.HexColor("#7c3d12"),
    fontName="Helvetica-Oblique", backColor=YELLOW_BG,
    borderPad=5, spaceBefore=4, spaceAfter=4,
    leftIndent=6, rightIndent=6, leading=13)

WARN = ParagraphStyle("Warn",
    fontSize=9, textColor=colors.HexColor("#991b1b"),
    fontName="Helvetica-Bold", backColor=colors.HexColor("#fee2e2"),
    borderPad=5, spaceBefore=4, spaceAfter=4,
    leftIndent=6, rightIndent=6, leading=13)

REF = ParagraphStyle("Ref",
    fontSize=8, textColor=colors.HexColor("#555555"),
    fontName="Helvetica-Oblique", spaceBefore=1, spaceAfter=1, leading=11)

story = []

# ═══════════════════════════════════════════════════════════════════════════════
#  COVER  
# ═══════════════════════════════════════════════════════════════════════════════

cover_data = [[
    Paragraph("BARBITURATES", COVER_TITLE),
    Paragraph("Anesthesia Pharmacology – Exam Answer", COVER_SUB),
    Paragraph("Intravenous Induction Agents Series", COVER_SUB),
]]
cover_table = Table(cover_data, colWidths=[17*cm])
cover_table.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
    ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
    ("ALIGN",      (0,0), (-1,-1), "CENTER"),
    ("TOPPADDING", (0,0), (-1,-1), 28),
    ("BOTTOMPADDING", (0,0), (-1,-1), 28),
    ("ROUNDEDCORNERS", [8]),
]))
story.append(cover_table)
story.append(Spacer(1, 0.4*cm))

# Quick-glance key facts box
key_facts = [
    ["KEY FACTS AT A GLANCE"],
    ["Prototype drug: Thiopental (thiobarbiturate)   |   Others: Thiamylal, Methohexital"],
    ["Route: IV   |   Onset: <30 sec   |   Duration (single dose): 5–8 min"],
    ["Mechanism: GABA-A receptor positive allosteric modulator (↑ Cl⁻ channel open time)"],
    ["Eliminated by: Hepatic oxidation (redistribution terminates single-dose effect)"],
    ["Contraindicated in: Acute intermittent porphyria (AIP)"],
]
kf_style = TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), MID_BLUE),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,0), 10),
    ("BACKGROUND",    (0,1), (-1,-1), LIGHT_BLUE),
    ("TEXTCOLOR",     (0,1), (-1,-1), DARK_BLUE),
    ("FONTNAME",      (0,1), (-1,-1), "Helvetica"),
    ("FONTSIZE",      (0,1), (-1,-1), 9),
    ("ALIGN",         (0,0), (-1,-1), "CENTER"),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("GRID",          (0,0), (-1,-1), 0.5, MID_BLUE),
    ("ROUNDEDCORNERS", [6]),
])
kf_table = Table(key_facts, colWidths=[17*cm])
kf_table.setStyle(kf_style)
story.append(kf_table)
story.append(Spacer(1, 0.5*cm))
story.append(HRFlowable(width="100%", thickness=1, color=GREY_LINE))

# ═══════════════════════════════════════════════════════════════════════════════
# 1. HISTORY
# ═══════════════════════════════════════════════════════════════════════════════
def h1(text):
    return Table([[Paragraph(text, H1)]], colWidths=[17*cm],
                 style=TableStyle([
                     ("BACKGROUND",(0,0),(-1,-1),DARK_BLUE),
                     ("TOPPADDING",(0,0),(-1,-1),6),
                     ("BOTTOMPADDING",(0,0),(-1,-1),6),
                     ("LEFTPADDING",(0,0),(-1,-1),10),
                 ]))

def h2(text): return Paragraph(text, H2)
def h3(text): return Paragraph(text, H3)
def body(text): return Paragraph(text, BODY)
def bul(text): return Paragraph(text, BULLET)
def note(text): return Paragraph(f"\u2139\ufe0f  {text}", NOTE)
def warn(text): return Paragraph(f"\u26a0\ufe0f  {text}", WARN)
def sp(n=0.2): return Spacer(1, n*cm)

story += [
    h1("1. HISTORY"),
    sp(),
    body("Barbiturates are derivatives of barbituric acid (2,4,6-trioxohexahydropyrimidine), first synthesised in the early 20th century. The first barbiturate used to produce loss of consciousness was <b>hexobarbital</b>. Following its introduction by <b>Waters and Lundy in 1934</b>, <b>thiopental</b> rapidly became the preferred clinical agent due to its rapid onset and short duration, without the excitatory phenomena seen with hexobarbital."),
    body("Although branded \"the cause of more fatal casualties among the servicemen at Pearl Harbor than the enemy bombs,\" barbiturates remained widely used for decades. Among the many derivatives synthesised, none rivalled the clinical popularity of thiopental."),
    sp(),
]

# ═══════════════════════════════════════════════════════════════════════════════
# 2. CHEMISTRY & CLASSIFICATION
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    h1("2. CHEMISTRY & CLASSIFICATION"),
    sp(),
    body("Barbiturates derive from barbituric acid — a pyrimidine nucleus formed by condensation of malonic acid and urea. The nucleus itself is pharmacologically inactive. Hypnotic activity is conferred by substitutions at positions 1, 2, and 5."),
    sp(0.15),
]

# Classification table
class_data = [
    ["Class", "Position 2", "Clinical Examples", "Key Feature"],
    ["Thiobarbiturates", "Sulfur (–S–)", "Thiopental, Thiamylal", "Rapid onset; high lipid solubility"],
    ["Oxybarbiturates", "Oxygen (–O–)", "Methohexital, Phenobarbital", "Methohexital: shortest acting IV barbiturate"],
]
ct = Table(class_data, colWidths=[4*cm, 3.5*cm, 4.5*cm, 5*cm])
ct.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), MID_BLUE),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 9),
    ("BACKGROUND",    (0,1), (-1,-1), GREY_BG),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0), (-1,-1), 0.5, GREY_LINE),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
story += [ct, sp()]

story += [
    h2("Structure-Activity Relationships"),
    bul("<b>Position 5 alkyl/aryl substitution</b>: Confers hypnotic and sedative activity; longer alkyl chains → greater potency"),
    bul("<b>Position 5 phenyl substitution</b>: Confers anticonvulsant activity (e.g. phenobarbital)"),
    bul("<b>Position 2 sulfur</b>: Produces thiobarbiturates — more rapid onset (e.g. thiopental)"),
    bul("<b>Position 1 methyl group</b>: Accelerates onset (methohexital) but may cause excitatory side effects (tremor, involuntary movement)"),
    sp(),
    h2("Formulation"),
    body("Barbiturates are prepared as <b>sodium salts</b> mixed with 6% anhydrous sodium carbonate (pH 10–11), then reconstituted to yield:"),
    bul("Thiopental 2.5% solution"),
    bul("Thiamylal 2% solution"),
    bul("Methohexital 1% solution"),
    warn("NEVER mix barbiturates with acidic solutions (Ringer's lactate, atracurium, vecuronium, rocuronium, succinylcholine, midazolam, alfentanil, sufentanil, dopamine, dobutamine) — precipitate forms and may occlude IV lines!"),
    bul("Thiobarbiturates: stable 1 week after reconstitution (refrigerated)"),
    bul("Methohexital: stable 6 weeks after reconstitution"),
    sp(),
]

# ═══════════════════════════════════════════════════════════════════════════════
# 3. MECHANISM OF ACTION
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    h1("3. MECHANISM OF ACTION"),
    sp(),
    body("Barbiturates exert their CNS depressant effects through <b>two principal mechanisms</b>:"),
    sp(0.15),
]

mech_data = [
    ["Mechanism", "Details"],
    ["GABA-A Receptor Potentiation\n(Primary — at clinical doses)",
     "Positive allosteric modulators of GABA-A receptors. At low concentrations they enhance GABA-mediated Cl⁻ influx by increasing the duration of Cl⁻ channel opening (not frequency — unlike benzodiazepines). At high concentrations, they can directly activate the GABA-A receptor in the absence of GABA (GABA-mimetic effect). The GABA-mimetic effect is responsible for barbiturate anesthesia at higher concentrations."],
    ["Inhibition of Excitatory Neurotransmission\n(Secondary)",
     "Inhibit glutamate (AMPA/kainate receptor-mediated) and other excitatory synaptic transmission. Less clearly understood but contributes to CNS depression."],
]
mt = Table(mech_data, colWidths=[5*cm, 12*cm])
mt.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), MID_BLUE),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 9),
    ("BACKGROUND",    (0,1), (0,-1), LIGHT_BLUE),
    ("FONTNAME",      (0,1), (0,-1), "Helvetica-Bold"),
    ("TEXTCOLOR",     (0,1), (0,-1), DARK_BLUE),
    ("ROWBACKGROUNDS",(1,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0), (-1,-1), 0.5, GREY_LINE),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ("TOPPADDING",    (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
story += [mt, sp(),
    note("Key distinction: Barbiturates ↑ duration of Cl⁻ channel opening; Benzodiazepines ↑ frequency of Cl⁻ channel opening — both act on GABA-A but at different binding sites."),
    sp()
]

# ═══════════════════════════════════════════════════════════════════════════════
# 4. PHARMACOKINETICS
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    h1("4. PHARMACOKINETICS"),
    sp(),
    h2("Absorption and Distribution"),
    body("Following IV injection, barbiturates are rapidly distributed to highly perfused tissues (brain, heart, kidneys). The <b>rapid onset</b> of thiopental (~1 arm-brain circulation time, ~10–15 sec) is due to:"),
    bul("High lipid solubility (especially thiobarbiturates)"),
    bul("High degree of un-ionised drug at physiologic pH"),
    bul("Rapid CNS penetration"),
    body("Recovery after a <b>single bolus dose</b> is due to <b>redistribution</b> from the brain to muscle and then to fat — NOT metabolism. This explains the short apparent duration despite slow elimination."),
    note("Context-sensitive half-time: After prolonged infusions, thiopental accumulates in adipose tissue. Recovery is then dependent on elimination (not redistribution), producing markedly prolonged effects. Methohexital has shorter context-sensitive half-time due to higher hepatic clearance."),
    sp(0.2),
]

# PK comparison table
pk_data = [
    ["Parameter", "Thiopental", "Methohexital", "Phenobarbital"],
    ["Class", "Thiobarbiturate", "Oxybarbiturate", "Oxybarbiturate"],
    ["Induction dose (IV)", "3–5 mg/kg", "1–1.5 mg/kg", "Not used for induction"],
    ["Onset", "< 30 sec", "< 30 sec", "Slow"],
    ["Duration (single dose)", "5–8 min", "4–7 min", "Hours–days"],
    ["Protein binding", "~80%", "~73%", "~50%"],
    ["Volume of distribution", "Large (fat)", "Large", "Large"],
    ["Hepatic clearance", "Low (slow)", "Higher (faster)", "Moderate"],
    ["Elimination t½", "~11 hours", "~4 hours", "~100 hours"],
    ["Metabolism", "Hepatic oxidation, desulfuration", "Hepatic oxidation, N-dealkylation", "Renal (60–90% unchanged)"],
    ["Active metabolites", "None (clinically)", "None (clinically)", "None"],
]
pkt = Table(pk_data, colWidths=[4.5*cm, 4*cm, 4*cm, 4.5*cm])
pkt.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 8.5),
    ("FONTNAME",      (0,1), (0,-1), "Helvetica-Bold"),
    ("TEXTCOLOR",     (0,1), (0,-1), DARK_BLUE),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0), (-1,-1), 0.5, GREY_LINE),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
]))
story += [pkt, sp(),
    body("<b>Metabolism pathway for thiobarbiturates:</b> (1) Oxidation of aryl/alkyl groups at C5 (principal pathway); (2) N-dealkylation; (3) Desulfuration at C2; (4) Barbituric acid ring destruction (minor)."),
    body("Metabolites are water-soluble (polar alcohols, ketones, phenols, carboxylic acids) and excreted in urine or as glucuronide conjugates in bile."),
    body("Phenobarbital is unique: 60–90% excreted unchanged renally. Alkalinisation of urine accelerates its renal clearance."),
    sp(),
]

# ═══════════════════════════════════════════════════════════════════════════════
# 5. PHARMACODYNAMICS / ORGAN SYSTEM EFFECTS
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    h1("5. PHARMACODYNAMICS – ORGAN SYSTEM EFFECTS"),
    sp(),
    h2("A. CNS Effects"),
    body("Barbiturates produce <b>dose-dependent CNS depression</b>: sedation → hypnosis → anesthesia → coma. Key CNS properties:"),
]

cns_data = [
    ["CNS Effect", "Details"],
    ["No analgesia", "Barbiturates are NOT analgesic. Some evidence suggests they may reduce pain threshold → hyperalgesia. Supplementary analgesics required."],
    ["Cerebral vasoconstriction", "Potent cerebral vasoconstrictors → ↓ CBF, ↓ cerebral blood volume, ↓ ICP"],
    ["↓ CMRO₂", "Reduce cerebral metabolic rate for O₂ (CMRO₂) dose-dependently, until isoelectric EEG"],
    ["EEG suppression", "Dose-dependent EEG depression → burst suppression → isoelectric (flat) EEG"],
    ["Neuroprotection", "Effective against focal ischemia (retraction, clips during aneurysm surgery). NOT effective for global ischemia (cardiac arrest)."],
    ["Anticonvulsant", "All barbiturates EXCEPT methohexital suppress seizures. Phenobarbital is a first-line anticonvulsant."],
    ["Methohexital — exception", "Activates epileptic foci → useful for ECT and identifying epileptic foci during surgery"],
]
cnst = Table(cns_data, colWidths=[4.5*cm, 12.5*cm])
cnst.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), MID_BLUE),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 9),
    ("FONTNAME",      (0,1), (0,-1), "Helvetica-Bold"),
    ("TEXTCOLOR",     (0,1), (0,-1), DARK_BLUE),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0), (-1,-1), 0.5, GREY_LINE),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
story += [cnst, sp(),
    h2("B. Cardiovascular Effects"),
    body("Induction doses of thiopental cause:"),
    bul("<b>↓ Blood pressure</b> — primarily due to peripheral vasodilation (venous pooling)"),
    bul("<b>Direct negative inotropy</b> — direct cardiac depressant effect"),
    bul("<b>Compensatory ↑ heart rate</b> — baroreceptor reflex less blunted than with propofol, so BP fall is usually transient"),
    body("Haemodynamic depression is <b>more severe</b> in:"),
    bul("Hypovolaemia"),
    bul("Cardiac tamponade"),
    bul("Cardiomyopathy"),
    bul("Coronary artery disease"),
    bul("Valvular heart disease"),
    body("Effects amplified by large doses and rapid injection."),
    warn("Thiopental is RELATIVELY contraindicated in haemodynamically unstable patients. Use ketamine or etomidate instead."),
    sp(),
    h2("C. Respiratory Effects"),
    bul("Respiratory depressant — induction doses produce <b>transient apnoea</b>"),
    bul("↓ Minute ventilation via ↓ tidal volume AND ↓ respiratory rate"),
    bul("Blunted ventilatory response to hypercapnia and hypoxia"),
    bul("Laryngeal and cough reflex suppression is <b>less complete</b> than propofol → barbiturates are inferior for airway instrumentation without neuromuscular blockade"),
    warn("Inadequate suppression of airway reflexes with laryngeal stimulation → LARYNGOSPASM or BRONCHOSPASM. Use adequate doses or add neuromuscular blocker."),
    sp(),
    h2("D. Other Effects"),
]

other_data = [
    ["Effect", "Description"],
    ["Intra-arterial injection", "Causes excruciating pain and intense vasoconstriction → tissue necrosis, gangrene. Treatment: sympathetic blockade (stellate ganglion block), local dilute lidocaine (0.5%, 5–10 mL)."],
    ["Histamine release", "Occasionally observed. Life-threatening anaphylaxis rare (~1:30,000)."],
    ["Porphyria", "ABSOLUTE CONTRAINDICATION in acute intermittent porphyria. Barbiturates stimulate δ-aminolevulinic acid (ALA) synthetase → ↑ porphyrin synthesis → acute porphyric crisis."],
    ["Enzyme induction", "Chronic use induces hepatic microsomal enzymes → accelerates metabolism of many drugs including warfarin, steroids, phenytoin."],
    ["Taste", "Patients may report garlic or onion taste after IV administration."],
]
ot = Table(other_data, colWidths=[4.5*cm, 12.5*cm])
ot.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), MID_BLUE),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 9),
    ("FONTNAME",      (0,1), (0,-1), "Helvetica-Bold"),
    ("TEXTCOLOR",     (0,1), (0,-1), DARK_BLUE),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0), (-1,-1), 0.5, GREY_LINE),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
story += [ot, sp()]

# ═══════════════════════════════════════════════════════════════════════════════
# 6. CLINICAL USES & DOSAGE
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    PageBreak(),
    h1("6. CLINICAL USES & DOSAGE"),
    sp(),
]

cu_data = [
    ["Indication", "Drug", "Dose", "Notes"],
    ["Induction of anesthesia\n(principal use)", "Thiopental\nMethohexital", "3–5 mg/kg IV\n1–1.5 mg/kg IV", "Onset < 30 sec. Reduce dose in elderly/compromised patients."],
    ["Rectal induction\n(paediatric/uncooperative patients)", "Methohexital", "20–30 mg/kg PR", "Useful for children/special needs patients"],
    ["ECT facilitation", "Methohexital (preferred)\nThiopental", "0.5–1 mg/kg IV\n1.5–3 mg/kg IV", "Methohexital lowers seizure threshold; thiopental raises it"],
    ["Raised ICP management /\nBarbiturate coma", "Thiopental\nPentobarbital", "Titrated to burst suppression EEG", "Target: isoelectric EEG = maximum CMRO₂ reduction. Watch for hypotension."],
    ["Neuroprotection\n(focal ischemia)", "Thiopental", "Titrated", "Effective for focal (not global) ischemia during neurosurgery"],
    ["Anticonvulsant\n(refractory SE)", "Phenobarbital\nThiopental/Pentobarbital", "15–20 mg/kg slow IV\nTitrated", "Phenobarbital: first-line for neonatal seizures. Barbiturate coma for refractory status epilepticus."],
    ["Procedural sedation", "Methohexital", "0.5–1 mg/kg IV", "Now largely replaced by propofol"],
]
cut = Table(cu_data, colWidths=[4.5*cm, 3.5*cm, 3.5*cm, 5.5*cm])
cut.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 8.5),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0), (-1,-1), 0.5, GREY_LINE),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
]))
story += [cut, sp()]

# ═══════════════════════════════════════════════════════════════════════════════
# 7. CONTRAINDICATIONS
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    h1("7. CONTRAINDICATIONS"),
    sp(),
]

ci_data = [
    ["Contraindication", "Reason"],
    ["Acute Intermittent Porphyria (AIP)", "ABSOLUTE. Barbiturates induce ALA synthetase → ↑ porphyrin synthesis → porphyric crisis (abdominal pain, neuropsychiatric symptoms, respiratory paralysis)"],
    ["Hypovolaemia / Haemodynamic instability", "Peripheral vasodilation + negative inotropy → severe hypotension/cardiovascular collapse"],
    ["Known barbiturate allergy", "Anaphylaxis (rare ~1:30,000 but potentially fatal)"],
    ["Obstructive airways disease (relative)", "Histamine release may trigger bronchospasm; inadequate depth → laryngospasm"],
    ["Known status asthmaticus", "Risk of bronchospasm"],
]
cit = Table(ci_data, colWidths=[5*cm, 12*cm])
cit.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), colors.HexColor("#991b1b")),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 9),
    ("FONTNAME",      (0,1), (0,-1), "Helvetica-Bold"),
    ("TEXTCOLOR",     (0,1), (0,-1), colors.HexColor("#991b1b")),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, colors.HexColor("#fff1f1")]),
    ("GRID",          (0,0), (-1,-1), 0.5, colors.HexColor("#fca5a5")),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
]))
story += [cit, sp()]

# ═══════════════════════════════════════════════════════════════════════════════
# 8. COMPARISON WITH OTHER IV INDUCTION AGENTS
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    h1("8. COMPARISON WITH OTHER IV INDUCTION AGENTS"),
    sp(),
]

comp_data = [
    ["Property", "Thiopental", "Propofol", "Ketamine", "Etomidate"],
    ["Class", "Thiobarbiturate", "Phenol", "Phencyclidine derivative", "Imidazole carboxylate"],
    ["Onset", "< 30 sec", "< 30 sec", "< 30 sec", "< 30 sec"],
    ["Analgesia", "No (hyperalgesia)", "No", "Yes (dissociative)", "No"],
    ["BP effect", "↓ (moderate)", "↓↓ (marked)", "↑ (usually)", "Minimal"],
    ["ICP", "↓↓↓", "↓↓", "↑ (traditionally)", "↓"],
    ["CMRO₂", "↓↓↓", "↓↓", "↑", "↓↓"],
    ["Bronchospasm risk", "Yes (histamine)", "Minimal", "No (bronchodilator)", "No"],
    ["PONV", "Low", "Low", "Moderate-High", "Low"],
    ["Pain on injection", "Occasional", "Common", "Rare", "Rare"],
    ["Anticonvulsant", "Yes", "Yes", "No", "Yes"],
    ["Porphyria safe?", "NO (contraindicated)", "Yes (safe)", "Yes (safe)", "Yes (safe)"],
    ["Adrenal suppression", "No", "No", "No", "YES (single dose)"],
]
compt = Table(comp_data, colWidths=[3.5*cm, 3*cm, 3*cm, 3.5*cm, 4*cm])
compt.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 8.5),
    ("FONTNAME",      (0,1), (0,-1), "Helvetica-Bold"),
    ("TEXTCOLOR",     (0,1), (0,-1), DARK_BLUE),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY_BG]),
    ("GRID",          (0,0), (-1,-1), 0.5, GREY_LINE),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 3),
    ("BOTTOMPADDING", (0,0), (-1,-1), 3),
    ("LEFTPADDING",   (0,0), (-1,-1), 4),
]))
story += [compt, sp()]

# ═══════════════════════════════════════════════════════════════════════════════
# 9. SPECIAL POPULATIONS & CLINICAL CONSIDERATIONS
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    h1("9. SPECIAL POPULATIONS & CLINICAL CONSIDERATIONS"),
    sp(),
    h2("Neurosurgery / Raised ICP"),
    body("Thiopental is a preferred agent for rapid sequence intubation (RSI) in patients with raised ICP due to its potent reduction in CBF, CMRO₂, and ICP. However, the associated haemodynamic depression may compromise cerebral perfusion pressure (CPP = MAP – ICP). Balance is essential."),
    sp(0.15),
    h2("Electroconvulsive Therapy (ECT)"),
    body("Methohexital (not thiopental) is preferred for ECT because it <b>lowers</b> the seizure threshold, facilitating an adequate therapeutic seizure. Thiopental and propofol raise the seizure threshold and may blunt ECT efficacy."),
    sp(0.15),
    h2("Paediatric Patients"),
    body("Methohexital 20–30 mg/kg per rectum can be used for induction in uncooperative children or those with developmental delays where IV access is difficult."),
    sp(0.15),
    h2("Elderly Patients"),
    body("Reduced doses required. Elderly patients have reduced cardiac reserve, lower protein binding (lower albumin), and reduced hepatic clearance → increased sensitivity and haemodynamic instability."),
    sp(0.15),
    h2("Rapid Sequence Induction (RSI)"),
    body("Thiopental (4–5 mg/kg) was historically the gold standard for RSI in patients with full stomach and raised ICP. Now largely replaced by propofol, but thiopental retains a role where propofol is unavailable or cerebral protection is needed."),
    note("Caution: Do NOT mix thiopental in the same syringe as vecuronium or succinylcholine — precipitation occurs and may block the IV cannula during RSI."),
    sp(),
]

# ═══════════════════════════════════════════════════════════════════════════════
# 10. BARBITURATE COMA
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    h1("10. BARBITURATE COMA"),
    sp(),
    body("Barbiturate coma is the induction of a medically managed coma using high-dose barbiturates to treat <b>refractory intracranial hypertension</b> or <b>refractory status epilepticus</b>."),
    h2("Indications"),
    bul("Refractory raised ICP (after failed conventional measures: osmotherapy, hyperventilation, surgery)"),
    bul("Refractory status epilepticus (pentobarbital coma)"),
    h2("Agents Used"),
    bul("<b>Thiopental</b> or <b>Pentobarbital</b> (most commonly)"),
    h2("Monitoring"),
    bul("Continuous EEG monitoring: target <b>burst suppression pattern</b>"),
    bul("ICP monitoring: target ICP < 20 mmHg, CPP > 60 mmHg"),
    bul("Haemodynamic monitoring: vasopressors frequently required"),
    h2("Adverse Effects of Barbiturate Coma"),
    bul("Hypotension (often requires vasopressor support)"),
    bul("Immunosuppression (increased infection risk)"),
    bul("Hepatic dysfunction"),
    bul("Prolonged sedation/coma on withdrawal"),
    bul("Hypothermia"),
    sp(),
]

# ═══════════════════════════════════════════════════════════════════════════════
# 11. ACUTE BARBITURATE TOXICITY / OVERDOSE
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    h1("11. ACUTE BARBITURATE TOXICITY & OVERDOSE"),
    sp(),
    body("Barbiturate overdose presents with progressive CNS and respiratory depression. There is no specific antidote."),
    h2("Clinical Features"),
    bul("CNS: Drowsiness → confusion → coma; absent corneal/gag reflexes in severe cases; hypothermia"),
    bul("Respiratory: Respiratory depression, apnoea, pulmonary oedema"),
    bul("Cardiovascular: Hypotension, bradycardia, cardiovascular collapse"),
    bul("Skin: Bullous skin lesions (\"barbiturate blisters\") — pathognomonic"),
    bul("EEG: Burst suppression → isoelectric EEG (does NOT indicate brain death)"),
    h2("Management"),
    bul("Airway protection and mechanical ventilation"),
    bul("IV fluids and vasopressors for haemodynamic support"),
    bul("Alkalinisation of urine (sodium bicarbonate) for phenobarbital elimination"),
    bul("Activated charcoal if recent ingestion and airway protected"),
    bul("Haemodialysis / haemoperfusion in severe phenobarbital poisoning"),
    note("Important: Flat EEG during barbiturate overdose does NOT confirm brain death. Barbiturate levels must be assessed and the drug must be cleared before brain death testing."),
    sp(),
]

# ═══════════════════════════════════════════════════════════════════════════════
# 12. HIGH-YIELD EXAM POINTS
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    h1("12. HIGH-YIELD EXAM POINTS"),
    sp(),
]

hy_data = [
    ["#", "High-Yield Point"],
    ["1", "Barbiturates are GABA-A positive allosteric modulators → ↑ duration of Cl⁻ channel opening (BZDs ↑ frequency)"],
    ["2", "Thiopental is a thiobarbiturate; methohexital is an oxybarbiturate"],
    ["3", "Recovery from single-dose thiopental = REDISTRIBUTION (not metabolism)"],
    ["4", "After infusion/repeated doses, recovery depends on metabolism → prolonged awakening (context-sensitive)"],
    ["5", "ABSOLUTE contraindication = Acute Intermittent Porphyria (AIP)"],
    ["6", "Methohexital preferred for ECT (lowers seizure threshold); thiopental raises it"],
    ["7", "Barbiturates are NOT analgesic — may cause hyperalgesia"],
    ["8", "Barbiturates precipitate with acidic solutions — never mix with succinylcholine, vecuronium, midazolam, etc."],
    ["9", "Intra-arterial injection → excruciating pain, vasoconstriction → gangrene. Tx: stellate ganglion block"],
    ["10", "Barbiturate coma: flat EEG ≠ brain death (drug must be cleared first)"],
    ["11", "Neuroprotection: effective against focal (not global) cerebral ischemia"],
    ["12", "Phenobarbital: mainly renally excreted; urinary alkalinisation accelerates elimination"],
    ["13", "Rectal methohexital (20–30 mg/kg) for uncooperative paediatric patients"],
    ["14", "First barbiturate = hexobarbital; first widely used = thiopental (Waters & Lundy, 1934)"],
    ["15", "Barbiturate-induced enzyme induction → drug interactions (warfarin, steroids, phenytoin levels fall)"],
]
hyt = Table(hy_data, colWidths=[0.8*cm, 16.2*cm])
hyt.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), colors.HexColor("#1a7a4a")),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",      (0,0), (-1,-1), 9),
    ("FONTNAME",      (0,1), (0,-1), "Helvetica-Bold"),
    ("TEXTCOLOR",     (0,1), (0,-1), colors.HexColor("#1a7a4a")),
    ("ALIGN",         (0,0), (0,-1), "CENTER"),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, colors.HexColor("#f0fdf4")]),
    ("GRID",          (0,0), (-1,-1), 0.5, colors.HexColor("#86efac")),
    ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
]))
story += [hyt, sp()]

# ═══════════════════════════════════════════════════════════════════════════════
# REFERENCES
# ═══════════════════════════════════════════════════════════════════════════════
story += [
    HRFlowable(width="100%", thickness=1, color=GREY_LINE),
    sp(0.2),
    Paragraph("<b>References</b>", H2),
    Paragraph("1. Miller RD, et al. <i>Miller's Anesthesia, 10th Edition</i>. Elsevier, 2023. Chapter 21: Intravenous Nonopioid Anesthetics (Barbiturates section, pp. 2491–2505).", REF),
    Paragraph("2. Pardo MC, Miller RD (eds). <i>Basics of Anesthesia, 8th Edition</i>. Elsevier.", REF),
    Paragraph("3. Brunton LL, et al. <i>Goodman & Gilman's The Pharmacological Basis of Therapeutics, 14th Edition</i>. McGraw-Hill, 2023. Chapter: Barbiturates.", REF),
    Paragraph("4. Katzung BG. <i>Basic and Clinical Pharmacology, 16th Edition</i>. McGraw-Hill, 2022. Chapter 25: Barbiturates (Anesthetic Use), pp. 710–711.", REF),
    Paragraph("5. Barash PG, et al. <i>Clinical Anesthesia, 9th Edition</i>. Wolters Kluwer, 2022.", REF),
    Paragraph("6. Morgan GE, Mikhail MS. <i>Clinical Anesthesiology, 7th Edition</i>. McGraw-Hill, 2022.", REF),
    sp(0.3),
    Paragraph("Generated by Orris Medical AI · August 2026", REF),
]

# ── Build ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF written to: {OUTPUT}")
Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.
This is a shared conversation. Sign in to Orris to start your own chat.