Convulsion rx

Reading File
Finding Sources
Finding Sources
Searching PubMed

seizure management treatment guidelines

Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
I have comprehensive content. Let me now compose the full, well-structured answer.

Management of Convulsions (Seizures / Status Epilepticus)

Definitions & Timing

A single seizure that lasts >5 minutes (generalized tonic-clonic), or two or more seizures without full recovery of consciousness between them, is treated as status epilepticus (SE) - a neurological emergency. The old 30-minute threshold is no longer used clinically; most seizures terminate in 2-3 minutes, so treatment begins at 5 minutes.

Immediate General Measures (Any Convulsion)

  1. Protect the airway - position the patient on their side, suction secretions
  2. O₂ supplementation, monitor SpO₂
  3. IV access - draw blood glucose, electrolytes (Ca²⁺, Mg²⁺), lactate, AED levels, toxicology screen, pregnancy test if appropriate
  4. Treat hypoglycemia immediately with IV glucose if suspected/confirmed
  5. Continuous temperature monitoring - treat hyperthermia with passive cooling
  6. Do NOT perform lumbar puncture during active seizure
  7. If bacterial meningitis/encephalitis is clinically suspected, start empiric antibiotics/antivirals immediately
  8. If toxic ingestion is the cause, consider GI decontamination as appropriate

Stepwise Drug Treatment

PHASE 1 - First-Line: Benzodiazepines (0-5 min)

DrugDoseRouteNotes
Lorazepam2-4 mg (adults); repeat onceIVPreferred if IV access available; onset ~2-3 min, duration 12-24 h
Midazolam10 mg (adults >40 kg)IMPreferred if no IV access; non-inferior to IV lorazepam in trials; also intranasal option
Diazepam5-10 mg IV; or 0.2-0.5 mg/kg rectal gelIV / PRShorter effective duration (15-60 min) due to rapid redistribution; used if lorazepam/midazolam unavailable
Buccal midazolam0.5 mg/kg up to 10 mgBuccalSuperior to rectal diazepam in children
  • Lorazepam > diazepam for duration of action; IM midazolam = IV lorazepam when no IV access
  • Risk: respiratory depression, hypotension - especially in children, and with alcohol/barbiturates/opioids

PHASE 2 - Second-Line: Long-Acting Antiepileptics (20-40 min, after benzodiazepine)

Start within 20 minutes of diagnosis if seizures persist. The major options are equally effective - no consensus on one preferred agent:
DrugDoseRouteNotes
Fosphenytoin20 PE/kg at 150 PE/minIV / IMPreferred over phenytoin - water-soluble, fewer infusion-site reactions; can give IM
Phenytoin20 mg/kg at ≤50 mg/minIVCardiac monitoring required; risk of hypotension + arrhythmia
Levetiracetam60 mg/kg (max 4500 mg)IVWell tolerated; no cardiac effects
Valproate40 mg/kg at 6 mg/kg/minIVAvoid in known mitochondrial disease, liver disease, pregnancy
Lacosamide200-400 mgIVECG monitoring required (prolongs PR interval, risk of arrhythmia)
Phenobarbital20 mg/kg at 50-100 mg/minIVHighly effective but causes prolonged sedation, respiratory depression, hypotension

PHASE 3 - Refractory SE (30+ min despite Phase 1+2)

Defined as seizures continuing ≥30 minutes after adequate first- and second-line treatment. Requires ICU admission + intubation + continuous EEG monitoring.
DrugNotes
Pentobarbital (anesthetic dose)IV continuous infusion; titrate to burst suppression on EEG
PropofolIV continuous infusion; risk of propofol infusion syndrome with prolonged use
MidazolamIV continuous infusion
KetamineEmerging option in super-refractory SE

Special Situations

ScenarioTreatment
EclampsiaIV/IM magnesium sulfate (4 g IV loading dose) - drug of choice
Alcohol withdrawalBenzodiazepines first-line; phenobarbital adjunct
Hypoglycemia-inducedIV dextrose alone may terminate seizure
Hyponatremia-inducedHypertonic saline
Febrile convulsion (child)Rectal diazepam / buccal midazolam acutely; usually self-limiting
Isoniazid toxicityIV pyridoxine (B6) - gram for gram match to INH dose
TCA/cocaine overdoseIV sodium bicarbonate; avoid phenytoin

Maintenance / Long-Term AED Selection (After Acute Control)

Once seizures are controlled, the underlying cause is sought and maintenance AED is chosen based on seizure type:
Seizure TypeFirst-Line AEDs
Focal (partial)Carbamazepine, oxcarbazepine, lamotrigine, levetiracetam, lacosamide
Generalized tonic-clonicValproate, levetiracetam, lamotrigine
AbsenceEthosuximide, valproate, lamotrigine
Juvenile myoclonic epilepsyValproate, levetiracetam, lamotrigine

Key Monitoring Points

  • Blood pressure, HR, SpO₂ continuously
  • ECG when using phenytoin, fosphenytoin, lacosamide
  • EEG mandatory in refractory SE and after neuromuscular blockade
  • Avoid succinylcholine/paralytic agents without immediate EEG availability (masks ongoing seizure activity)

Sources:
  • Katzung's Basic and Clinical Pharmacology, 16th Ed. - Status Epilepticus section
  • Tintinalli's Emergency Medicine - Anticonvulsant Drugs in Status Epilepticus
  • Bradley and Daroff's Neurology in Clinical Practice - Seizure Clusters and Status Epilepticus
Recent evidence note: A 2024 systematic review of clinical practice guidelines for SE management in adults (PMID 38606469, Epilepsia) confirms that no single second-line agent (levetiracetam vs. valproate vs. fosphenytoin) has demonstrated superiority, consistent with what the textbooks state above.

Create a quick reference PDF of convulsion doses and timings for emergency settings

Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/convulsion-ref

Writing File

~/convulsion-ref/build_pdf.py

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

# ── colour palette ──────────────────────────────────────────────
RED      = colors.HexColor("#C0392B")
DARK_RED = colors.HexColor("#922B21")
ORANGE   = colors.HexColor("#E67E22")
GREEN    = colors.HexColor("#1E8449")
BLUE     = colors.HexColor("#154360")
LTBLUE   = colors.HexColor("#D6EAF8")
LTORANGE = colors.HexColor("#FDEBD0")
LTGREEN  = colors.HexColor("#D5F5E3")
LTGREY   = colors.HexColor("#F2F3F4")
WHITE    = colors.white
BLACK    = colors.black
MIDGREY  = colors.HexColor("#BDC3C7")

PAGE_W, PAGE_H = A4
MARGIN = 12 * mm

doc = SimpleDocTemplate(
    "/home/daytona/workspace/convulsion-ref/Convulsion_Quick_Reference.pdf",
    pagesize=A4,
    leftMargin=MARGIN, rightMargin=MARGIN,
    topMargin=MARGIN, bottomMargin=12 * mm,
)

styles = getSampleStyleSheet()

def style(name="Normal", **kw):
    return ParagraphStyle(name, parent=styles[name], **kw)

title_style   = style("Normal", fontSize=18, textColor=WHITE,
                      fontName="Helvetica-Bold", alignment=TA_CENTER,
                      leading=22, spaceAfter=0)
sub_style     = style("Normal", fontSize=9, textColor=WHITE,
                      fontName="Helvetica", alignment=TA_CENTER, leading=11)
h1_style      = style("Normal", fontSize=11, textColor=WHITE,
                      fontName="Helvetica-Bold", alignment=TA_LEFT, leading=13)
h2_style      = style("Normal", fontSize=9, textColor=BLACK,
                      fontName="Helvetica-Bold", alignment=TA_LEFT, leading=11)
cell_style    = style("Normal", fontSize=8,  textColor=BLACK,
                      fontName="Helvetica", alignment=TA_LEFT, leading=10)
cell_bold     = style("Normal", fontSize=8,  textColor=BLACK,
                      fontName="Helvetica-Bold", alignment=TA_LEFT, leading=10)
small_style   = style("Normal", fontSize=7,  textColor=colors.HexColor("#555555"),
                      fontName="Helvetica", alignment=TA_LEFT, leading=9)
note_style    = style("Normal", fontSize=7.5, textColor=DARK_RED,
                      fontName="Helvetica-BoldOblique", alignment=TA_CENTER, leading=9)
warn_style    = style("Normal", fontSize=7.5, textColor=colors.HexColor("#784212"),
                      fontName="Helvetica-Bold", alignment=TA_LEFT, leading=9)

def P(txt, s=cell_style): return Paragraph(txt, s)
def B(txt):               return Paragraph(txt, cell_bold)
def H(txt, s=h1_style):   return Paragraph(txt, s)

# ════════════════════════════════════════════════════════════════
# TITLE BANNER
# ════════════════════════════════════════════════════════════════
usable_w = PAGE_W - 2 * MARGIN

banner_data = [[H("CONVULSION / STATUS EPILEPTICUS\nQUICK REFERENCE", title_style)]]
banner_sub  = [[P("Emergency Drug Doses & Timings  |  Adults (adjust for paediatrics)  |  May 2026", sub_style)]]

banner = Table(banner_data, colWidths=[usable_w])
banner.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), DARK_RED),
    ("TOPPADDING",    (0,0), (-1,-1), 6),
    ("BOTTOMPADDING", (0,0), (-1,-1), 2),
    ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ("RIGHTPADDING",  (0,0), (-1,-1), 8),
    ("ROUNDEDCORNERS", [4]),
]))

banner_s = Table(banner_sub, colWidths=[usable_w])
banner_s.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), RED),
    ("TOPPADDING",    (0,0), (-1,-1), 3),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ("RIGHTPADDING",  (0,0), (-1,-1), 8),
]))

# ════════════════════════════════════════════════════════════════
# TIMING OVERVIEW BAR  (horizontal timeline)
# ════════════════════════════════════════════════════════════════
timeline_data = [
    [
        Table([[P("<b>0–5 min</b>\nSeizure onset\n→ General measures", small_style)]], colWidths=[45*mm],
              style=TableStyle([("BACKGROUND",(0,0),(-1,-1),colors.HexColor("#FDEDEC")),
                                ("BOX",(0,0),(-1,-1),1,RED),("TOPPADDING",(0,0),(-1,-1),4),
                                ("BOTTOMPADDING",(0,0),(-1,-1),4),("LEFTPADDING",(0,0),(-1,-1),4)])),
        Table([[P("<b>5–20 min</b>\n<font color='#C0392B'>PHASE 1</font>\nBenzodiazepine", small_style)]], colWidths=[45*mm],
              style=TableStyle([("BACKGROUND",(0,0),(-1,-1),colors.HexColor("#FDEBD0")),
                                ("BOX",(0,0),(-1,-1),1,ORANGE),("TOPPADDING",(0,0),(-1,-1),4),
                                ("BOTTOMPADDING",(0,0),(-1,-1),4),("LEFTPADDING",(0,0),(-1,-1),4)])),
        Table([[P("<b>20–40 min</b>\n<font color='#1A5276'>PHASE 2</font>\n2nd-line AED", small_style)]], colWidths=[48*mm],
              style=TableStyle([("BACKGROUND",(0,0),(-1,-1),LTBLUE),
                                ("BOX",(0,0),(-1,-1),1,BLUE),("TOPPADDING",(0,0),(-1,-1),4),
                                ("BOTTOMPADDING",(0,0),(-1,-1),4),("LEFTPADDING",(0,0),(-1,-1),4)])),
        Table([[P("<b>&gt;40 min</b>\n<font color='#1E8449'>PHASE 3</font>\nRefractory SE\n→ ICU + EEG", small_style)]], colWidths=[48*mm],
              style=TableStyle([("BACKGROUND",(0,0),(-1,-1),LTGREEN),
                                ("BOX",(0,0),(-1,-1),1,GREEN),("TOPPADDING",(0,0),(-1,-1),4),
                                ("BOTTOMPADDING",(0,0),(-1,-1),4),("LEFTPADDING",(0,0),(-1,-1),4)])),
    ]
]
timeline = Table(timeline_data, colWidths=[45*mm, 45*mm, 48*mm, 48*mm],
                 hAlign="LEFT")
timeline.setStyle(TableStyle([
    ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING", (0,0), (-1,-1), 0),
    ("RIGHTPADDING", (0,0), (-1,-1), 3),
]))

# ════════════════════════════════════════════════════════════════
# PHASE 1  –  BENZODIAZEPINES
# ════════════════════════════════════════════════════════════════
def section_header(text, bg=RED):
    t = Table([[H(text)]], colWidths=[usable_w])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0),(-1,-1), bg),
        ("TOPPADDING",(0,0),(-1,-1),4),("BOTTOMPADDING",(0,0),(-1,-1),4),
        ("LEFTPADDING",(0,0),(-1,-1),6),
    ]))
    return t

COL_DRUG   = 32*mm
COL_DOSE   = 52*mm
COL_ROUTE  = 22*mm
COL_ONSET  = 20*mm
COL_DUR    = 26*mm
COL_NOTES  = usable_w - 32 - 52 - 22 - 20 - 26

HDR_STYLE = TableStyle([
    ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#2C3E50")),
    ("TEXTCOLOR",  (0,0), (-1,0), WHITE),
    ("FONTNAME",   (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",   (0,0), (-1,0), 8),
    ("ALIGN",      (0,0), (-1,0), "CENTER"),
    ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
    ("FONTSIZE",   (0,1), (-1,-1), 8),
    ("FONTNAME",   (0,1), (-1,-1), "Helvetica"),
    ("GRID",       (0,0), (-1,-1), 0.5, MIDGREY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LTGREY]),
    ("TOPPADDING",    (0,0), (-1,-1), 3),
    ("BOTTOMPADDING", (0,0), (-1,-1), 3),
    ("LEFTPADDING",   (0,0), (-1,-1), 4),
    ("RIGHTPADDING",  (0,0), (-1,-1), 4),
])

def drug_table(data, col_widths):
    t = Table(data, colWidths=col_widths)
    t.setStyle(HDR_STYLE)
    return t

phase1_hdr = [P("DRUG", h2_style), P("ADULT DOSE", h2_style),
              P("ROUTE", h2_style), P("ONSET", h2_style),
              P("DURATION", h2_style), P("NOTES", h2_style)]

phase1_rows = [
    [B("Lorazepam\n★ PREFERRED"), P("2–4 mg; may repeat\nonce after 5 min"), P("IV"), P("2–3 min"), P("12–24 h"),
     P("1st choice if IV access; less redistribution than diazepam")],
    [B("Midazolam\n★ No IV access"), P("10 mg (>40 kg)\n5 mg (13–40 kg)\n2.5 mg (<13 kg)"), P("IM / IN\n/ Buccal"), P("3–5 min"), P("1–2 h"),
     P("IM midazolam = IV lorazepam (RAMPART trial); IN/buccal if no IV")],
    [B("Diazepam"), P("5–10 mg IV\n0.2–0.5 mg/kg rectal gel"), P("IV / PR"), P("2 min"), P("15–60 min"),
     P("Rapid redistribution → short effect; use if above unavailable")],
    [B("Clonazepam\n(outside USA)"), P("1–2 mg IV"), P("IV"), P("2–3 min"), P("6–12 h"),
     P("Alternative first-line in some countries")],
]

phase1_cws = [COL_DRUG, COL_DOSE, COL_ROUTE, COL_ONSET, COL_DUR, COL_NOTES]
p1_table = drug_table([phase1_hdr] + phase1_rows, phase1_cws)
p1_table.setStyle(TableStyle([
    ("BACKGROUND", (0,1), (-1,1), colors.HexColor("#FDEDEC")),  # lorazepam highlight
    ("BACKGROUND", (0,2), (-1,2), colors.HexColor("#FEF9E7")),  # midazolam
], parent=HDR_STYLE))

# ════════════════════════════════════════════════════════════════
# PHASE 2  –  SECOND-LINE AEDs
# ════════════════════════════════════════════════════════════════
phase2_hdr = [P("DRUG", h2_style), P("LOADING DOSE", h2_style),
              P("ROUTE", h2_style), P("INFUSION RATE", h2_style),
              P("ONSET", h2_style), P("KEY CAUTION", h2_style)]

phase2_rows = [
    [B("Fosphenytoin\n★ PREFERRED"), P("20 PE/kg\n(max 1500 PE)"), P("IV / IM"), P("≤150 PE/min\n(~10–15 min)"), P("10–20 min"),
     P("ECG monitoring; hypotension; preferred over phenytoin (no tissue necrosis)")],
    [B("Phenytoin"), P("20 mg/kg\n(max 1500 mg)"), P("IV"), P("≤50 mg/min"), P("10–20 min"),
     P("ECG + BP monitoring; extravasation → tissue necrosis; propylene glycol vehicle")],
    [B("Levetiracetam"), P("60 mg/kg\n(max 4500 mg)"), P("IV"), P("Over 15 min"), P("15–20 min"),
     P("Excellent tolerability; no cardiac effects; no interaction with other AEDs")],
    [B("Valproate\n(Valproic acid)"), P("40 mg/kg\n(max 3000 mg)"), P("IV"), P("6 mg/kg/min\n(≤10 min)"), P("5–15 min"),
     P("Avoid: pregnancy, liver disease, mitochondrial disease, <2 years old")],
    [B("Lacosamide"), P("200–400 mg"), P("IV"), P("Over 15–60 min"), P("15–30 min"),
     P("ECG required (PR prolongation/arrhythmia risk); well tolerated otherwise")],
    [B("Phenobarbital"), P("20 mg/kg\n(max 1000 mg)"), P("IV"), P("50–100 mg/min"), P("10–30 min"),
     P("Highly effective but: severe sedation, respiratory depression, hypotension")],
]

phase2_cws = [COL_DRUG, COL_DOSE, COL_ROUTE, 30*mm, COL_ONSET,
              usable_w - COL_DRUG - COL_DOSE - COL_ROUTE - 30*mm - COL_ONSET]
p2_table = drug_table([phase2_hdr] + phase2_rows, phase2_cws)
p2_table.setStyle(TableStyle([
    ("BACKGROUND", (0,1), (-1,1), colors.HexColor("#EBF5FB")),  # fosphenytoin
], parent=HDR_STYLE))

# ════════════════════════════════════════════════════════════════
# PHASE 3  –  REFRACTORY SE
# ════════════════════════════════════════════════════════════════
phase3_hdr = [P("DRUG", h2_style), P("INDUCTION DOSE", h2_style),
              P("MAINTENANCE INFUSION", h2_style), P("TARGET / NOTES", h2_style)]

phase3_rows = [
    [B("Pentobarbital\n★ Most used"), P("5–15 mg/kg IV"), P("0.5–3 mg/kg/h"), P("Titrate to burst-suppression on EEG; hypotension common → vasopressors")],
    [B("Propofol"), P("1–2 mg/kg IV bolus"), P("1–15 mg/kg/h"), P("Short-acting; monitor for propofol infusion syndrome (>48 h, >4 mg/kg/h)")],
    [B("Midazolam"), P("0.2 mg/kg IV"), P("0.05–2 mg/kg/h"), P("Tachyphylaxis common; may require dose escalation; less hemodynamic suppression")],
    [B("Ketamine"), P("1–2 mg/kg IV"), P("0.3–7.5 mg/kg/h"), P("Emerging option; NMDA antagonist; may be neuroprotective; monitor BP")],
]

phase3_cws = [COL_DRUG, COL_DOSE, 45*mm,
              usable_w - COL_DRUG - COL_DOSE - 45*mm]
p3_table = drug_table([phase3_hdr] + phase3_rows, phase3_cws)
p3_table.setStyle(TableStyle([
    ("BACKGROUND", (0,1), (-1,1), LTGREEN),
], parent=HDR_STYLE))

# ════════════════════════════════════════════════════════════════
# SPECIAL SITUATIONS
# ════════════════════════════════════════════════════════════════
spec_hdr = [P("SITUATION", h2_style), P("DRUG OF CHOICE", h2_style), P("DOSE", h2_style), P("NOTES", h2_style)]
spec_rows = [
    [B("Eclampsia"), P("Magnesium sulfate"), P("4 g IV over 15–20 min\nthen 1–2 g/h infusion"), P("Monitor reflexes, UO, RR; antidote = calcium gluconate 10 mL 10%")],
    [B("Hypoglycaemia"), P("Dextrose"), P("50 mL of 50% dextrose IV"), P("Check BGL first; may abort seizure without AEDs")],
    [B("Alcohol withdrawal"), P("Lorazepam / diazepam"), P("As Phase 1 above"), P("Phenobarbital adjunct; thiamine 100 mg IV before glucose")],
    [B("Isoniazid toxicity"), P("Pyridoxine (Vit B6)"), P("Gram-for-gram INH dose\n(max 5 g IV if dose unknown)"), P("GABA-transaminase inhibition → direct mechanism")],
    [B("Febrile convulsion\n(Paediatric)"), P("Rectal diazepam\nor buccal midazolam"), P("0.5 mg/kg PR (max 10 mg)\n0.5 mg/kg buccal (max 10 mg)"), P("Usually self-limiting <5 min; buccal > rectal in children")],
    [B("Hyponatraemia"), P("Hypertonic saline 3%"), P("1–2 mL/kg IV over 10–20 min"), P("Target Na rise 3–5 mmol/L to abort seizure; avoid rapid correction")],
    [B("TCA / cocaine OD"), P("Sodium bicarbonate"), P("1–2 mEq/kg IV"), P("Avoid phenytoin; control Na channel toxicity")],
]
spec_cws = [35*mm, 35*mm, 50*mm, usable_w - 35 - 35 - 50*mm]
spec_table = drug_table([spec_hdr] + spec_rows, spec_cws)

# ════════════════════════════════════════════════════════════════
# IMMEDIATE ACTIONS BOX
# ════════════════════════════════════════════════════════════════
actions_data = [
    [
        P("<b>IMMEDIATE ACTIONS (any convulsion)</b>\n"
          "① Airway: lateral position, suction, O₂\n"
          "② IV access → BGL, electrolytes (Na, Ca, Mg), lactate, AED levels, tox screen\n"
          "③ If hypoglycaemia: 50 mL 50% dextrose IV immediately\n"
          "④ Continuous: SpO₂, BP, HR, temperature\n"
          "⑤ Do NOT do LP during active seizure\n"
          "⑥ If meningitis/encephalitis suspected → empiric antibiotics/antivirals NOW", warn_style),
        P("<b>MONITORING REQUIREMENTS</b>\n"
          "• Phenytoin / Fosphenytoin → ECG + BP\n"
          "• Lacosamide → ECG (PR interval)\n"
          "• Phenobarbital → SpO₂, BP, resp rate\n"
          "• Refractory SE → continuous EEG\n"
          "• Propofol >48 h → watch for PRIS\n"
          "• Magnesium → reflexes, UO, RR", warn_style),
    ]
]
actions_cws = [usable_w * 0.54, usable_w * 0.46]
actions_box = Table(actions_data, colWidths=actions_cws)
actions_box.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (0,0), colors.HexColor("#FEF9E7")),
    ("BACKGROUND", (1,0), (1,0), colors.HexColor("#EBF5FB")),
    ("BOX",  (0,0), (0,0), 1, ORANGE),
    ("BOX",  (1,0), (1,0), 1, BLUE),
    ("TOPPADDING",    (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING",   (0,0), (-1,-1), 5),
    ("RIGHTPADDING",  (0,0), (-1,-1), 5),
    ("VALIGN", (0,0), (-1,-1), "TOP"),
]))

# ════════════════════════════════════════════════════════════════
# FOOTER
# ════════════════════════════════════════════════════════════════
footer_data = [[
    P("Sources: Katzung's Basic & Clinical Pharmacology 16e | Tintinalli's Emergency Medicine | "
      "Bradley & Daroff's Neurology in Clinical Practice | PMID 38606469 (Epilepsia 2024)", small_style),
    P("⚠ Always verify doses against local formulary. For clinical use only. May 2026", note_style),
]]
footer = Table(footer_data, colWidths=[usable_w * 0.65, usable_w * 0.35])
footer.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#F2F3F4")),
    ("TOPPADDING",    (0,0), (-1,-1), 3),
    ("BOTTOMPADDING", (0,0), (-1,-1), 3),
    ("LEFTPADDING",   (0,0), (-1,-1), 4),
    ("RIGHTPADDING",  (0,0), (-1,-1), 4),
    ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
    ("LINEABOVE", (0,0), (-1,0), 0.5, MIDGREY),
]))

# ════════════════════════════════════════════════════════════════
# ASSEMBLE
# ════════════════════════════════════════════════════════════════
story = [
    banner, banner_s,
    Spacer(1, 4*mm),
    timeline,
    Spacer(1, 4*mm),
    # PHASE 1
    KeepTogether([
        section_header("⚡  PHASE 1 — FIRST-LINE: BENZODIAZEPINES  (Treat at 5 min)", bg=RED),
        Spacer(1, 1*mm),
        p1_table,
    ]),
    Spacer(1, 4*mm),
    # PHASE 2
    KeepTogether([
        section_header("💊  PHASE 2 — SECOND-LINE: LONG-ACTING AEDs  (Start within 20 min; no single agent superior)", bg=BLUE),
        Spacer(1, 1*mm),
        p2_table,
    ]),
    Spacer(1, 4*mm),
    # PHASE 3
    KeepTogether([
        section_header("🚨  PHASE 3 — REFRACTORY STATUS EPILEPTICUS  (≥40 min / failed Phase 1+2 → ICU + intubate + EEG)", bg=GREEN),
        Spacer(1, 1*mm),
        p3_table,
    ]),
    Spacer(1, 4*mm),
    # SPECIAL
    KeepTogether([
        section_header("⚕  SPECIAL SITUATIONS", bg=ORANGE),
        Spacer(1, 1*mm),
        spec_table,
    ]),
    Spacer(1, 4*mm),
    actions_box,
    Spacer(1, 3*mm),
    footer,
]

doc.build(story)
print("PDF built successfully.")
Running Command

cd /home/daytona/workspace/convulsion-ref && python build_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/convulsion-ref/

Your quick reference PDF is ready:

Convulsion Quick Reference

PDF Document · PDF


What's inside (single A4 page, colour-coded):
SectionContent
Timeline barVisual 4-phase strip: 0-5 min → 5-20 min → 20-40 min → >40 min
Phase 1 - BenzodiazepinesLorazepam, midazolam, diazepam, clonazepam - doses, routes, onset, duration
Phase 2 - Second-line AEDsFosphenytoin, phenytoin, levetiracetam, valproate, lacosamide, phenobarbital - loading doses + infusion rates
Phase 3 - Refractory SEPentobarbital, propofol, midazolam, ketamine - induction + maintenance doses
Special situationsEclampsia, hypoglycaemia, alcohol withdrawal, INH toxicity, febrile convulsion, hyponatraemia, TCA OD
Immediate actions + monitoringSide-by-side checklist boxes
FooterSource citations + disclaimer
This is a shared conversation. Sign in to Orris to start your own chat.