~/emergency-cheatsheet/build_pdf.py
#!/usr/bin/env python3
"""
Emergency Quick-Reference Cheat Sheet PDF
NCLEX & NORCET AIIMS Exam Preparation
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import mm, cm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate
OUTPUT = "/home/daytona/workspace/emergency-cheatsheet/Emergency_CheatSheet_NCLEX_NORCET.pdf"
# ─── Colour Palette ────────────────────────────────────────────────────────────
C_RED = colors.HexColor("#C0392B")
C_DARK_RED = colors.HexColor("#922B21")
C_ORANGE = colors.HexColor("#E67E22")
C_BLUE = colors.HexColor("#1A5276")
C_TEAL = colors.HexColor("#117A65")
C_PURPLE = colors.HexColor("#6C3483")
C_DARK_GRAY = colors.HexColor("#2C3E50")
C_MID_GRAY = colors.HexColor("#5D6D7E")
C_LIGHT_BG = colors.HexColor("#EBF5FB")
C_HEADER_BG = colors.HexColor("#1A5276")
C_ROW1 = colors.HexColor("#D6EAF8")
C_ROW2 = colors.HexColor("#EBF5FB")
C_GREEN = colors.HexColor("#1E8449")
C_YELLOW_BG = colors.HexColor("#FEF9E7")
C_RED_BG = colors.HexColor("#FDEDEC")
C_WHITE = colors.white
C_BLACK = colors.black
C_AMBER = colors.HexColor("#F39C12")
# ─── Styles ────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
COVER_TITLE = S("CoverTitle",
fontName="Helvetica-Bold", fontSize=26, textColor=C_WHITE,
alignment=TA_CENTER, spaceAfter=6, leading=32)
COVER_SUB = S("CoverSub",
fontName="Helvetica", fontSize=13, textColor=colors.HexColor("#AED6F1"),
alignment=TA_CENTER, spaceAfter=4, leading=18)
COVER_NOTE = S("CoverNote",
fontName="Helvetica-Oblique", fontSize=10, textColor=colors.HexColor("#D6EAF8"),
alignment=TA_CENTER, spaceAfter=2)
SEC_HEADING = S("SecHeading",
fontName="Helvetica-Bold", fontSize=11, textColor=C_WHITE,
alignment=TA_LEFT, spaceBefore=4, spaceAfter=2, leading=14,
leftIndent=4)
BODY = S("Body",
fontName="Helvetica", fontSize=8.5, textColor=C_DARK_GRAY,
spaceAfter=2, leading=12, alignment=TA_LEFT)
BODY_BOLD = S("BodyBold",
fontName="Helvetica-Bold", fontSize=8.5, textColor=C_DARK_GRAY,
spaceAfter=2, leading=12)
SMALL = S("Small",
fontName="Helvetica", fontSize=7.5, textColor=C_MID_GRAY,
spaceAfter=1, leading=10)
NOTE_STYLE = S("Note",
fontName="Helvetica-Oblique", fontSize=8, textColor=C_TEAL,
spaceAfter=3, leading=11, leftIndent=6)
MNEM_STYLE = S("Mnem",
fontName="Helvetica-Bold", fontSize=8.5, textColor=C_PURPLE,
spaceAfter=2, leading=12, leftIndent=6)
FOOTER_STYLE = S("Footer",
fontName="Helvetica", fontSize=7, textColor=C_MID_GRAY,
alignment=TA_CENTER)
TABLE_HEADER = S("TblHdr",
fontName="Helvetica-Bold", fontSize=8, textColor=C_WHITE,
alignment=TA_CENTER, leading=10)
TABLE_CELL = S("TblCell",
fontName="Helvetica", fontSize=8, textColor=C_DARK_GRAY,
leading=10, alignment=TA_LEFT)
TABLE_CELL_BOLD = S("TblCellBold",
fontName="Helvetica-Bold", fontSize=8, textColor=C_DARK_RED,
leading=10, alignment=TA_LEFT)
PAGE_W, PAGE_H = A4
MARGIN = 1.4 * cm
USABLE_W = PAGE_W - 2 * MARGIN
# ─── Helpers ──────────────────────────────────────────────────────────────────
def section_header(title, color=C_HEADER_BG, icon=""):
"""Coloured banner heading."""
t = Table([[Paragraph(f"{icon} {title}", SEC_HEADING)]],
colWidths=[USABLE_W])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), color),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("ROUNDEDCORNERS", [4, 4, 4, 4]),
]))
return t
def steps_table(rows, col_widths=None):
"""Step → Action two-column table."""
if col_widths is None:
col_widths = [2.2*cm, USABLE_W - 2.2*cm]
data = []
for i, (step, action, *rest) in enumerate(rows):
bg = C_ROW1 if i % 2 == 0 else C_ROW2
note_txt = rest[0] if rest else ""
cell_action = Paragraph(f"<b>{action}</b>" + (f"<br/><font color='#117A65' size='7.5'><i>{note_txt}</i></font>" if note_txt else ""), TABLE_CELL)
data.append([Paragraph(f"<b>{step}</b>", TABLE_CELL_BOLD), cell_action])
t = Table(data, colWidths=col_widths)
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,-1), colors.HexColor("#FDFEFE")),
("ROWBACKGROUNDS",(0,0), (-1,-1), [C_ROW1, C_ROW2]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#BFC9CA")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
return t
def antidote_table(rows):
hdr = [Paragraph("Drug / Toxin", TABLE_HEADER), Paragraph("Antidote", TABLE_HEADER)]
data = [hdr]
for toxin, antidote in rows:
data.append([Paragraph(toxin, TABLE_CELL), Paragraph(f"<b>{antidote}</b>", TABLE_CELL_BOLD)])
col_w = [USABLE_W/2, USABLE_W/2]
t = Table(data, colWidths=col_w)
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), C_RED),
("ROWBACKGROUNDS",(0,1), (-1,-1), [C_ROW2, C_RED_BG]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#BFC9CA")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
return t
def mnemonic_table(rows, bg_color=C_YELLOW_BG):
data = []
for m, meaning in rows:
data.append([Paragraph(f"<b>{m}</b>", MNEM_STYLE), Paragraph(meaning, BODY)])
t = Table(data, colWidths=[3.5*cm, USABLE_W - 3.5*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg_color),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#D4E6F1")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
return t
def highlight_box(text, bg=C_RED_BG, text_color=C_DARK_RED):
p = Paragraph(text, ParagraphStyle("hb", fontName="Helvetica-Bold", fontSize=8.5,
textColor=text_color, leading=12, alignment=TA_LEFT))
t = Table([[p]], colWidths=[USABLE_W])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 1, text_color),
]))
return t
def sp(h=4):
return Spacer(1, h)
def hr():
return HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#AED6F1"), spaceAfter=4)
# ─── Page callback ────────────────────────────────────────────────────────────
def on_page(canvas, doc):
canvas.saveState()
# Footer
canvas.setFont("Helvetica", 7)
canvas.setFillColor(C_MID_GRAY)
canvas.drawCentredString(PAGE_W/2, 1.1*cm,
f"NCLEX & NORCET AIIMS Emergency Quick-Reference • Page {doc.page}")
canvas.drawString(MARGIN, 1.1*cm, "For educational use only")
canvas.drawRightString(PAGE_W - MARGIN, 1.1*cm, "Orris Medical Assistant 2026")
# Top rule
canvas.setStrokeColor(C_HEADER_BG)
canvas.setLineWidth(2)
canvas.line(MARGIN, PAGE_H - 1.2*cm, PAGE_W - MARGIN, PAGE_H - 1.2*cm)
canvas.restoreState()
def on_first_page(canvas, doc):
# Full-bleed cover gradient simulation via rectangles
canvas.saveState()
canvas.setFillColor(C_HEADER_BG)
canvas.rect(0, 0, PAGE_W, PAGE_H, fill=1, stroke=0)
canvas.setFillColor(colors.HexColor("#0D2B45"))
canvas.rect(0, 0, PAGE_W, PAGE_H * 0.35, fill=1, stroke=0)
canvas.restoreState()
# ─── Content builder ──────────────────────────────────────────────────────────
def build():
doc = BaseDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=MARGIN, rightMargin=MARGIN,
topMargin=2.0*cm, bottomMargin=1.8*cm,
title="Emergency Quick-Reference — NCLEX & NORCET AIIMS",
author="Orris Medical Assistant",
subject="Emergency Nursing & Medical Management"
)
frame = Frame(MARGIN, 1.8*cm, USABLE_W, PAGE_H - 3.8*cm, id="main")
cover_frame = Frame(MARGIN, 1.8*cm, USABLE_W, PAGE_H - 3.8*cm, id="cover")
doc.addPageTemplates([
PageTemplate(id="cover", frames=[cover_frame], onPage=on_first_page),
PageTemplate(id="body", frames=[frame], onPage=on_page),
])
story = []
# ── COVER ──────────────────────────────────────────────────────────────────
story.append(Spacer(1, 3.5*cm))
story.append(Paragraph("🚨 EMERGENCY QUICK-REFERENCE", COVER_TITLE))
story.append(Paragraph("CHEAT SHEET", COVER_TITLE))
story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("NCLEX • NORCET AIIMS • Nursing & Medical Exams", COVER_SUB))
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("18 Critical Emergencies — First & Second Priority Actions", COVER_SUB))
story.append(Spacer(1, 1.0*cm))
# Cover summary boxes
cover_items = [
["01 Cardiac Arrest", "02 Respiratory Distress", "03 Shock (All Types)"],
["04 Stroke / CVA", "05 Myocardial Infarction", "06 Pulmonary Embolism"],
["07 Diabetic Emergencies", "08 Status Epilepticus", "09 Raised ICP"],
["10 Burns", "11 Obstetric Emergencies", "12 Poisoning / Overdose"],
["13 Heat Stroke / Hypothermia", "14 Hypertensive Emergency", "15 Acute Pulmonary Edema"],
["16 Drowning", "17 Spinal Cord Injury", "18 Polytrauma (ATLS)"],
]
cover_cell_style = ParagraphStyle("cs", fontName="Helvetica-Bold", fontSize=8.5,
textColor=C_DARK_GRAY, alignment=TA_CENTER, leading=11)
cover_data = []
for row in cover_items:
cover_data.append([Paragraph(c, cover_cell_style) for c in row])
ct = Table(cover_data, colWidths=[USABLE_W/3]*3)
ct.setStyle(TableStyle([
("ROWBACKGROUNDS", (0,0), (-1,-1), [colors.HexColor("#EBF5FB"), colors.HexColor("#D6EAF8")]),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#85C1E9")),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 4),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(ct)
story.append(Spacer(1, 0.8*cm))
story.append(Paragraph("+ Antidotes Reference • Key Mnemonics • High-Yield Exam Points", COVER_NOTE))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("Based on: ROSEN's Emergency Medicine • Goldman-Cecil Medicine • ACLS/ATLS Guidelines", COVER_NOTE))
story.append(PageBreak())
# ── Switch to body template ────────────────────────────────────────────────
from reportlab.platypus import NextPageTemplate
story.append(NextPageTemplate("body"))
# ── PAGE 2: Universal Framework + Emergency 1 & 2 ─────────────────────────
story.append(section_header("UNIVERSAL PRIORITY FRAMEWORK — Always Apply First", C_DARK_GRAY, "🔑"))
story.append(sp(4))
abc_data = [
[Paragraph("<b>A — Airway</b>", TABLE_CELL_BOLD), Paragraph("Establish/maintain patency; jaw thrust or chin-lift; suction; intubate if needed", TABLE_CELL)],
[Paragraph("<b>B — Breathing</b>", TABLE_CELL_BOLD), Paragraph("Assess RR, depth, SpO₂; O₂ therapy; bag-valve-mask if apneic", TABLE_CELL)],
[Paragraph("<b>C — Circulation</b>", TABLE_CELL_BOLD), Paragraph("HR, BP, skin perfusion; 2 large-bore IVs; IV fluids; stop bleeding", TABLE_CELL)],
[Paragraph("<b>D — Disability</b>", TABLE_CELL_BOLD), Paragraph("GCS, pupils (PERRLA), glucose check, neurological status", TABLE_CELL)],
[Paragraph("<b>E — Exposure</b>", TABLE_CELL_BOLD), Paragraph("Full body exam; vital signs; prevent hypothermia", TABLE_CELL)],
]
abct = Table(abc_data, colWidths=[3.2*cm, USABLE_W - 3.2*cm])
abct.setStyle(TableStyle([
("ROWBACKGROUNDS", (0,0), (-1,-1), [colors.HexColor("#EAFAF1"), colors.HexColor("#F9FBE7")]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#A9DFBF")),
("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(abct)
story.append(sp(6))
story.append(highlight_box(
"NURSING PRIORITY RULE: Physiological needs ALWAYS first (Maslow). "
"Acute > Chronic | Unstable > Stable | Life-threatening > Comfort",
bg=colors.HexColor("#EAFAF1"), text_color=C_TEAL))
story.append(sp(8))
# ── Emergency 1: Cardiac Arrest ───────────────────────────────────────────
story.append(section_header("1. CARDIAC ARREST (Cardiopulmonary Arrest)", C_RED, "🫀"))
story.append(sp(3))
story.append(steps_table([
("1st", "Confirm unresponsiveness; shout for help; ACTIVATE CODE BLUE", ""),
("2nd", "Check carotid pulse ≤10 sec → absent → START CPR immediately", ""),
("3rd", "Chest compressions: 30:2, rate 100–120/min, depth 5–6 cm, hard & fast — MINIMIZE INTERRUPTIONS (<10 sec)", ""),
("4th", "Attach defibrillator; analyze rhythm → VF/pulseless VT (shockable) → SHOCK 200J biphasic", ""),
("5th", "Resume CPR 2 min immediately post-shock; establish IV/IO access", ""),
("6th", "Epinephrine 1 mg IV/IO every 3–5 min; Amiodarone 300 mg IV (VF/VT)", "Vasopressor + antiarrhythmic"),
("7th", "Identify & treat reversible causes: 4H's + 4T's (see below)", ""),
("8th", "Post-ROSC: 12-lead ECG; Targeted Temperature Management 32–36°C; ICU", ""),
]))
story.append(sp(4))
story.append(highlight_box(
"4H's: Hypoxia | Hypovolemia | Hypo/Hyperkalemia | Hypothermia "
"4T's: Tension pneumothorax | Tamponade | Toxins | Thrombosis (PE/MI)",
bg=colors.HexColor("#FDEDEC"), text_color=C_DARK_RED))
story.append(sp(4))
story.append(Paragraph(
"<b>CPR Ratios:</b> Adults 30:2 | Child (1-rescuer) 30:2 | Child (2-rescuer) 15:2 | Infant 15:2",
NOTE_STYLE))
story.append(sp(8))
# ── Emergency 2: Respiratory Distress ─────────────────────────────────────
story.append(section_header("2. RESPIRATORY DISTRESS / ARREST", C_BLUE, "😮💨"))
story.append(sp(3))
story.append(steps_table([
("1st", "POSITION: High Fowler's / orthopneic (sit upright); O₂ via face mask 10–15 L/min", ""),
("2nd", "Assess: SpO₂, RR, breath sounds (auscultation), ABG, peak flow", ""),
("3rd", "If apneic: jaw-thrust/chin-lift; BVM (bag-valve-mask) ventilation", ""),
("4th", "Prepare RSI (Rapid Sequence Intubation) → Endotracheal intubation (ETT)", ""),
("5th", "Confirm ETT: ETCO₂ capnography + bilateral breath sounds + CXR", ""),
("6th", "Mechanical ventilation: FiO₂, PEEP, tidal volume 6–8 mL/kg IBW", ""),
]))
story.append(sp(4))
asthma_data = [
[Paragraph("<b>Asthma Attack Steps</b>", TABLE_HEADER)],
[Paragraph("1st: Salbutamol (Albuterol) 2.5–5 mg nebulization + Ipratropium bromide", TABLE_CELL)],
[Paragraph("2nd: IV/oral Corticosteroids (Prednisolone / Methylprednisolone)", TABLE_CELL)],
[Paragraph("3rd: IV Magnesium sulfate 2g over 20 min (severe/refractory)", TABLE_CELL)],
[Paragraph("Monitor: PEFR, SpO₂, use of accessory muscles, RR, LOC", TABLE_CELL)],
]
at = Table(asthma_data, colWidths=[USABLE_W])
at.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), C_BLUE),
("BACKGROUND", (0,1), (-1,-1), colors.HexColor("#EBF5FB")),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#AED6F1")),
("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 8), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(at)
story.append(PageBreak())
# ── Emergency 3: SHOCK ────────────────────────────────────────────────────
story.append(section_header("3. SHOCK — All Types & Management", C_ORANGE, "🩸"))
story.append(sp(3))
shock_types = [
("Hypovolemic\n(Hemorrhagic)", "1st: Control bleeding (direct pressure/tourniquet)\n2nd: 2 large-bore IVs; NS/LR 1–2L rapid bolus\n3rd: Type & cross-match; pRBCs if Hgb <7 g/dL\n4th: Balanced transfusion pRBCs:FFP:Platelets = 1:1:1\n5th: Monitor UO >0.5 mL/kg/hr, lactate, base deficit"),
("Septic\n(Distributive)", "1st: Blood cultures ×2 BEFORE antibiotics; lactate level\n2nd: Broad-spectrum IV antibiotics WITHIN 1 HOUR\n3rd: Crystalloid 30 mL/kg IV within 3 hours\n4th: Norepinephrine (1st-line vasopressor) if MAP <65 mmHg\n5th: Hydrocortisone 200 mg/day if vasopressor-refractory"),
("Anaphylactic\n(Distributive)", "1st: EPINEPHRINE 0.3–0.5 mg IM (anterolateral thigh) — FIRST LINE!\n2nd: Supine + legs elevated; O₂; IV access; NS bolus\n3rd: Repeat epinephrine q5–15 min if needed\n4th: Diphenhydramine IV + Ranitidine (H2 blocker)\n5th: Methylprednisolone 125 mg IV; monitor biphasic (4–12 hrs)"),
("Cardiogenic", "1st: O₂, monitor, IV access; 12-lead ECG for AMI\n2nd: Dobutamine (inotrope); Dopamine if severe hypotension\n3rd: CAUTIOUS fluids (avoid overload); Furosemide if pulm. edema\n4th: Urgent PCI if AMI-related (door-to-balloon ≤90 min)\n5th: IABP / mechanical circulatory support"),
]
shock_data = [[Paragraph("<b>Type</b>", TABLE_HEADER), Paragraph("<b>Priority Steps</b>", TABLE_HEADER)]]
bgs = [colors.HexColor("#FDEBD0"), colors.HexColor("#FFF9C4"),
colors.HexColor("#FDEDEC"), colors.HexColor("#EBF5FB")]
for i, (stype, ssteps) in enumerate(shock_types):
shock_data.append([
Paragraph(f"<b>{stype}</b>", ParagraphStyle("st", fontName="Helvetica-Bold", fontSize=8,
textColor=C_DARK_RED, leading=11, alignment=TA_CENTER)),
Paragraph(ssteps.replace("\n", "<br/>"), TABLE_CELL)
])
st = Table(shock_data, colWidths=[2.8*cm, USABLE_W - 2.8*cm])
st.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), C_ORANGE),
("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.HexColor("#FFF3E0"), colors.HexColor("#FFF9C4"),
colors.HexColor("#FDEDEC"), colors.HexColor("#EBF5FB")]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#F0B27A")),
("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(st)
story.append(sp(4))
story.append(highlight_box(
"KEY LAB: Lactate >4 mmol/L OR Base Deficit < −4 mEq/L = SHOCK | "
"UO <0.5 mL/kg/hr = severe renal hypoperfusion | "
"EPINEPHRINE = 1st in anaphylaxis (NOT antihistamine!)",
bg=colors.HexColor("#FEF9E7"), text_color=C_AMBER))
story.append(sp(8))
# ── Emergency 4: Stroke ───────────────────────────────────────────────────
story.append(section_header("4. STROKE / CVA (Cerebrovascular Accident)", C_PURPLE, "🧠"))
story.append(sp(3))
story.append(highlight_box(
'FAST: Face drooping | Arm weakness | Speech difficulty | Time to call — "Time is Brain!"',
bg=colors.HexColor("#F5EEF8"), text_color=C_PURPLE))
story.append(sp(4))
story.append(steps_table([
("1st", "Activate stroke team; NOTE exact time of symptom onset", ""),
("2nd", "ABC stabilization; O₂ if SpO₂ <94%; IV access; NPO (nil per os)", ""),
("3rd", "STAT non-contrast CT brain — rule out hemorrhagic stroke FIRST", ""),
("4th", "Blood glucose check (hypoglycemia mimics stroke — correct BGL first)", ""),
("5th", "Ischemic stroke ≤4.5 hrs: IV tPA (Alteplase) 0.9 mg/kg (max 90 mg)", "10% as bolus, rest over 60 min"),
("6th", "Large vessel occlusion ≤24 hrs: Mechanical Thrombectomy", ""),
("7th", "BP: allow ≤220/120 pre-tPA; keep <180/105 mmHg post-tPA", ""),
("8th", "Aspirin 325 mg (after hemorrhage excluded); Statin therapy", ""),
]))
story.append(sp(3))
story.append(Paragraph(
"<b>Nursing:</b> HOB 30° | Swallow screen before oral intake | Neuro checks q1h | "
"Hemorrhagic stroke: reverse anticoagulation; target SBP <140 mmHg",
NOTE_STYLE))
story.append(PageBreak())
# ── Emergency 5: MI ────────────────────────────────────────────────────────
story.append(section_header("5. MYOCARDIAL INFARCTION — STEMI / NSTEMI", C_RED, "💉"))
story.append(sp(3))
story.append(steps_table([
("1st", "12-lead ECG within 10 min of arrival — ST elevation ≥1mm in ≥2 contiguous leads = STEMI", ""),
("2nd", "Aspirin 325 mg (chewed) + P2Y12 inhibitor (Clopidogrel / Ticagrelor) — Dual antiplatelet therapy", ""),
("3rd", "Nitroglycerin SL 0.4 mg q5 min ×3 (if SBP >90, NO RV infarct)", "Vasodilator — reduces preload"),
("4th", "O₂ ONLY if SpO₂ <90% (avoid hyperoxia); Morphine 2–4 mg IV if refractory pain", ""),
("5th", "IV Heparin (unfractionated) or Enoxaparin — Anticoagulation", ""),
("6th", "PRIMARY PCI within 90 min (door-to-balloon) — PREFERRED reperfusion", ""),
("7th", "If PCI unavailable: IV Fibrinolysis (Streptokinase / tPA) within 30 min", "Contraindicated if hemorrhagic stroke, recent surgery"),
]))
story.append(sp(4))
story.append(highlight_box(
"MONA Mnemonic: Morphine | O₂ (if SpO₂ <90%) | Nitroglycerin | Aspirin — "
"Continuous cardiac monitoring + defibrillator ready + restrict activity + NPO for procedure",
bg=colors.HexColor("#FDEDEC"), text_color=C_DARK_RED))
story.append(sp(8))
# ── Emergency 6: PE ────────────────────────────────────────────────────────
story.append(section_header("6. PULMONARY EMBOLISM (PE)", C_BLUE, "🫁"))
story.append(sp(3))
story.append(steps_table([
("1st", "O₂ high flow; IV access; continuous monitoring of SpO₂, BP, HR", ""),
("2nd", "12-lead ECG (classic: S1Q3T3); D-dimer; ABG; Wells Score pre-test probability", ""),
("3rd", "CT Pulmonary Angiography (CTPA) — GOLD STANDARD imaging", ""),
("4th", "Anticoagulation: IV Unfractionated Heparin 80 U/kg bolus → 18 U/kg/hr infusion", ""),
("5th", "MASSIVE PE (hemodynamic instability): Thrombolysis tPA 100 mg IV over 2 hrs", ""),
("6th", "Surgical embolectomy if thrombolysis contraindicated", ""),
]))
story.append(sp(8))
# ── Emergency 7: Diabetic ─────────────────────────────────────────────────
story.append(section_header("7. DIABETIC EMERGENCIES", C_TEAL, "🔋"))
story.append(sp(3))
dka_hypo_data = [
[Paragraph("<b>DKA (Diabetic Ketoacidosis)</b>", TABLE_HEADER),
Paragraph("<b>Hypoglycemia (BGL <70 mg/dL)</b>", TABLE_HEADER)],
[Paragraph("Criteria: BGL >250 mg/dL + pH <7.3 + HCO₃ <18 + ketonemia", SMALL),
Paragraph("Rule of 15: 15g fast carbs → recheck in 15 min (conscious)", SMALL)],
[Paragraph("1st: IV NS 1L/hr for 1–2 hrs (fluid resuscitation)", TABLE_CELL),
Paragraph("1st: 15g fast-acting carbs PO if conscious", TABLE_CELL)],
[Paragraph("2nd: IV Regular Insulin 0.1 U/kg/hr (ONLY if K⁺ ≥3.5 mEq/L)", TABLE_CELL),
Paragraph("2nd: If unconscious/no IV: Glucagon 1 mg IM/SC", TABLE_CELL)],
[Paragraph("3rd: K⁺ replacement 20–40 mEq/hr if K⁺ <5.5 mEq/L", TABLE_CELL),
Paragraph("3rd: If IV access: Dextrose 25–50g (50% dextrose) IV bolus", TABLE_CELL)],
[Paragraph("4th: Switch to D5 when BGL <200 mg/dL", TABLE_CELL),
Paragraph("4th: Identify cause; monitor BGL q15–30 min", TABLE_CELL)],
[Paragraph("5th: Monitor ABG, electrolytes, UO q2–4h", TABLE_CELL),
Paragraph("⚠ Potassium must be ≥3.5 before insulin in DKA!", TABLE_CELL_BOLD)],
]
dka_t = Table(dka_hypo_data, colWidths=[USABLE_W/2, USABLE_W/2])
dka_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), C_TEAL),
("BACKGROUND", (1,0), (1,0), C_GREEN),
("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.HexColor("#E8F8F5"), colors.HexColor("#EAFAF1")]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#A2D9CE")),
("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(dka_t)
story.append(PageBreak())
# ── Emergency 8: Status Epilepticus ───────────────────────────────────────
story.append(section_header("8. STATUS EPILEPTICUS (Seizure >5 min or recurrent without recovery)", C_PURPLE, "⚡"))
story.append(sp(3))
story.append(steps_table([
("1st", "Protect from injury; lateral position (recovery); TIME the seizure; do NOT restrain or insert objects in mouth", ""),
("2nd", "O₂ via face mask; suction secretions; IV access; BGL, electrolytes, drug levels", ""),
("3rd", "Thiamine 100 mg IV BEFORE glucose in alcoholic patients (prevents Wernicke's encephalopathy)", ""),
("4th (0–5 min)", "Benzodiazepine: Lorazepam 0.1 mg/kg IV OR Diazepam 0.2 mg/kg IV/rectal OR Midazolam IM", "1st-line anticonvulsant"),
("5th (5–20 min)", "2nd-line: Levetiracetam 60 mg/kg IV OR Phenytoin/Fosphenytoin 20 mg/kg IV", ""),
("6th (>30 min)", "Refractory: Propofol / Midazolam / Phenobarbital infusion → ICU + continuous EEG monitoring", ""),
]))
story.append(sp(3))
story.append(Paragraph(
"<b>Nursing seizure precautions:</b> Padded side rails | O₂ at bedside | Suction ready | NPO during seizure | Privacy",
NOTE_STYLE))
story.append(sp(8))
# ── Emergency 9: Raised ICP ───────────────────────────────────────────────
story.append(section_header("9. INCREASED INTRACRANIAL PRESSURE (Raised ICP)", C_DARK_GRAY, "🧊"))
story.append(sp(3))
story.append(steps_table([
("1st", "HOB 30° elevation (neutral head position — avoid jugular compression)", ""),
("2nd", "O₂ to maintain SpO₂ >95%; target PaCO₂ 35–40 mmHg (avoid hypercarbia)", ""),
("3rd", "Mannitol 0.25–1 g/kg IV (osmotic diuretic — 1st line); monitor serum osmolality <320 mOsm/kg", ""),
("4th", "3% Hypertonic Saline (alternative to mannitol; preferred if hypotensive)", ""),
("5th", "Controlled hyperventilation (PCO₂ 30–35 mmHg) — TEMPORARY bridge only", ""),
("6th", "Neurosurgical consult; ICP monitoring; Decompressive craniectomy if refractory", ""),
]))
story.append(sp(4))
story.append(highlight_box(
"CUSHING'S TRIAD (late sign of herniation): Hypertension + Bradycardia + Irregular Respirations | "
"⚠ NEVER do LP before CT if raised ICP suspected (herniation risk!)",
bg=colors.HexColor("#F4ECF7"), text_color=C_PURPLE))
story.append(sp(8))
# ── Emergency 10: Burns ───────────────────────────────────────────────────
story.append(section_header("10. BURNS", C_ORANGE, "🔥"))
story.append(sp(3))
story.append(steps_table([
("1st", "STOP burning process; remove clothing & jewelry (not stuck to skin)", ""),
("2nd", "Airway assessment for INHALATION INJURY: hoarseness, singed nasal hairs, stridor, carbonaceous sputum → EARLY intubation", ""),
("3rd", "Calculate TBSA (Total Body Surface Area) — Rule of Nines", ""),
("4th", "PARKLAND FORMULA: 4 mL × weight(kg) × %TBSA = Lactated Ringer's (½ in first 8 hrs, ½ in next 16 hrs)", ""),
("5th", "Target UO: 0.5–1.0 mL/kg/hr adults; 1 mL/kg/hr children", ""),
("6th", "Tetanus prophylaxis; pain management (IV Morphine); wound care", ""),
("7th", "Transfer to burn unit: >10% TBSA, face/hands/genitalia, circumferential, chemical/electrical burns", ""),
]))
story.append(sp(3))
story.append(highlight_box(
"RULE OF NINES: Head 9% | Each Arm 9% | Chest 9% | Abdomen 9% | Each Thigh 9% | Each Lower Leg 9% | Perineum 1%",
bg=colors.HexColor("#FEF9E7"), text_color=C_ORANGE))
story.append(PageBreak())
# ── Emergency 11: Obstetric ───────────────────────────────────────────────
story.append(section_header("11. OBSTETRIC EMERGENCIES", C_PURPLE, "🤰"))
story.append(sp(3))
obs_data = [
[Paragraph("<b>Eclampsia</b>", TABLE_HEADER),
Paragraph("<b>Postpartum Hemorrhage (PPH)</b>", TABLE_HEADER)],
[Paragraph("1st: Protect airway; LEFT LATERAL decubitus (uterine displacement)", TABLE_CELL),
Paragraph("1st: Bimanual uterine massage; assess 4T's cause", TABLE_CELL)],
[Paragraph("2nd: Magnesium Sulfate 4–6g IV loading → 1–2g/hr maintenance", TABLE_CELL_BOLD),
Paragraph("2nd: Oxytocin 20–40 units in 1L NS IV — 1st-line uterotonic", TABLE_CELL_BOLD)],
[Paragraph("3rd: Antihypertensive: Hydralazine 5–10 mg IV OR Labetalol 20 mg IV (target BP <160/110)", TABLE_CELL),
Paragraph("3rd: Misoprostol 800–1000 mcg rectal/sublingual", TABLE_CELL)],
[Paragraph("4th: Fetal monitoring; plan for delivery", TABLE_CELL),
Paragraph("4th: Tranexamic acid 1g IV within 3 hrs of delivery", TABLE_CELL)],
[Paragraph("5th: ANTIDOTE FOR Mg TOXICITY = Calcium Gluconate (keep at bedside!)", TABLE_CELL_BOLD),
Paragraph("5th: Blood transfusion; surgical (B-Lynch suture / hysterectomy)", TABLE_CELL)],
]
obs_t = Table(obs_data, colWidths=[USABLE_W/2, USABLE_W/2])
obs_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), C_PURPLE),
("BACKGROUND", (1,0), (1,0), colors.HexColor("#922B21")),
("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.HexColor("#F5EEF8"), colors.HexColor("#FDEDEC")]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#D7BDE2")),
("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(obs_t)
story.append(sp(4))
story.append(highlight_box(
"PPH — 4T's Causes: Tone (atony, most common) | Tissue (retained placenta) | Trauma (laceration) | Thrombin (coagulopathy)",
bg=colors.HexColor("#FDEDEC"), text_color=C_DARK_RED))
story.append(sp(8))
# ── Emergency 12: Poisoning ───────────────────────────────────────────────
story.append(section_header("12. POISONING / OVERDOSE", C_DARK_GRAY, "☠️"))
story.append(sp(3))
story.append(Paragraph("<b>Universal Approach:</b> ABCDE → Activated charcoal (if <1 hr, alert, non-caustic) → Specific antidote → Supportive care", BODY_BOLD))
story.append(sp(4))
story.append(antidote_table([
("Opioids (Morphine, Heroin, Fentanyl)", "Naloxone (Narcan) 0.4–2 mg IV/IM/IN"),
("Organophosphates (Nerve agents, Pesticides)", "Atropine IV (repeat until dry) + Pralidoxime (2-PAM)"),
("Acetaminophen / Paracetamol", "N-Acetylcysteine (NAC) IV/oral — start within 8–10 hrs"),
("Benzodiazepines", "Flumazenil 0.2 mg IV (use cautiously — seizure risk)"),
("Warfarin / Coumadin", "Vitamin K IV + FFP or Prothrombin Complex Concentrate (PCC)"),
("Heparin", "Protamine Sulfate"),
("Digoxin toxicity", "Digoxin-specific Fab fragments (Digibind)"),
("Beta-blocker overdose", "Glucagon IV + high-dose insulin therapy"),
("Calcium channel blocker", "Calcium Gluconate IV + Glucagon"),
("Tricyclic Antidepressant (TCA)", "Sodium Bicarbonate IV (QRS narrowing)"),
("Carbon Monoxide (CO)", "100% O₂ (NRB mask); Hyperbaric O₂ if severe"),
("Cyanide poisoning", "Hydroxocobalamin (Cyanokit) IV"),
("Iron overdose", "Deferoxamine IV/IM"),
("Methanol / Ethylene glycol", "Fomepizole (4-MP) IV; dialysis if severe"),
("Magnesium toxicity", "Calcium Gluconate 1g IV (ANTIDOTE)"),
]))
story.append(PageBreak())
# ── Emergency 13: Heat Stroke / Hypothermia ───────────────────────────────
story.append(section_header("13. HEAT STROKE & HYPOTHERMIA", C_RED, "🌡️"))
story.append(sp(3))
temp_data = [
[Paragraph("<b>Heat Stroke (Core temp >40°C + CNS dysfunction)</b>", TABLE_HEADER),
Paragraph("<b>Hypothermia (Core temp <35°C)</b>", TABLE_HEADER)],
[Paragraph("1st: Remove from heat; ABC stabilization", TABLE_CELL),
Paragraph("1st: Remove wet clothing; prevent further heat loss", TABLE_CELL)],
[Paragraph("2nd: RAPID COOLING — target 39°C within 30 min: ice water immersion OR evaporative cooling + fans", TABLE_CELL_BOLD),
Paragraph("2nd: Passive (mild) → Active external (moderate) → Active internal/ECMO (severe <30°C)", TABLE_CELL)],
[Paragraph("3rd: IV cold NS; DO NOT give antipyretics (not effective)", TABLE_CELL),
Paragraph("3rd: Warm IV fluids 39–42°C; warmed humidified O₂", TABLE_CELL)],
[Paragraph("4th: Monitor: rhabdomyolysis (CK, urine myoglobin), renal function, electrolytes", TABLE_CELL),
Paragraph("4th: ECG monitoring — Osborn (J) waves; VF risk; DO NOT pronounce dead until warm >32°C", TABLE_CELL_BOLD)],
]
temp_t = Table(temp_data, colWidths=[USABLE_W/2, USABLE_W/2])
temp_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), C_RED),
("BACKGROUND", (1,0), (1,0), C_BLUE),
("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.HexColor("#FFF3E0"), colors.HexColor("#EBF5FB")]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#BFC9CA")),
("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(temp_t)
story.append(sp(4))
story.append(highlight_box(
'"Not dead until WARM and dead" — continue CPR/resuscitation until core temp >32°C in hypothermia',
bg=colors.HexColor("#EBF5FB"), text_color=C_BLUE))
story.append(sp(8))
# ── Emergency 14: Hypertensive Emergency ─────────────────────────────────
story.append(section_header("14. HYPERTENSIVE EMERGENCY (BP >180/120 + End-Organ Damage)", C_RED, "🩺"))
story.append(sp(3))
story.append(steps_table([
("1st", "IV access; continuous BP monitoring (arterial line preferred); ECG; labs (Cr, UA, troponin, CXR)", ""),
("2nd", "Target: Reduce MAP by ≤25% in FIRST HOUR — NOT to normal (risk of ischemic injury)", ""),
("3rd", "IV antihypertensives: Nicardipine / Labetalol / Clevidipine / Nitroprusside infusion", ""),
("4th (Aortic Dissection)", "Esmolol + Nitroprusside; target SBP <120 mmHg URGENTLY", ""),
("5th (Eclampsia)", "Magnesium Sulfate + Labetalol / Hydralazine", ""),
("6th (Hypertensive Encephalopathy)", "Reduce BP 30–40%; IV Labetalol or Nicardipine", "Fully reversible with prompt treatment"),
]))
story.append(sp(4))
story.append(highlight_box(
"End-organ damage targets: Heart (ACS/HF) | Brain (Stroke/Encephalopathy) | Kidney (AKI) | Aorta (Dissection) | Eyes (Retinopathy) | Eclampsia",
bg=colors.HexColor("#FDEDEC"), text_color=C_DARK_RED))
story.append(sp(8))
# ── Emergency 15: Acute Pulmonary Edema ───────────────────────────────────
story.append(section_header("15. ACUTE PULMONARY EDEMA (Cardiogenic)", C_BLUE, "🫀"))
story.append(sp(3))
story.append(steps_table([
("1st", "POSITION: High Fowler's (90°) / sit upright; legs dangling; O₂ via NRB mask OR BiPAP/CPAP", ""),
("2nd", "IV Furosemide 40–80 mg — DIURETIC (1st line); monitor UO", ""),
("3rd", "IV Nitroglycerin infusion — vasodilator (reduces preload); monitor BP closely", ""),
("4th", "Morphine 2–4 mg IV (reduces anxiety/preload — use cautiously; monitor RR)", ""),
("5th", "Identify & treat cause: STEMI → PCI | HTN → antihypertensives | Arrhythmia → cardioversion", ""),
]))
story.append(sp(4))
story.append(highlight_box(
"LMNOP Mnemonic: Lasix (Furosemide) | Morphine | Nitrates | O₂ | Position (upright)",
bg=colors.HexColor("#EBF5FB"), text_color=C_BLUE))
story.append(PageBreak())
# ── Emergency 16: Drowning ────────────────────────────────────────────────
story.append(section_header("16. DROWNING / NEAR-DROWNING", C_BLUE, "🌊"))
story.append(sp(3))
story.append(steps_table([
("1st", "Safely remove from water; ensure rescuer safety", ""),
("2nd", "Do NOT delay CPR for water drainage — begin immediately if unresponsive/apneic", ""),
("3rd", "5 RESCUE BREATHS first (if apneic), then standard CPR 30:2", "Different from standard adult CPR"),
("4th", "Remove wet clothes; warm blankets; prevent hypothermia", ""),
("5th", "O₂ high flow; prepare for ETT intubation (pulmonary injury/edema likely)", ""),
("6th", "Monitor for secondary drowning up to 24 hrs — admit for observation even if asymptomatic", ""),
]))
story.append(sp(8))
# ── Emergency 17: Spinal Cord Injury ─────────────────────────────────────
story.append(section_header("17. SPINAL CORD INJURY", C_DARK_GRAY, "⚡"))
story.append(sp(3))
story.append(steps_table([
("1st", "IMMOBILIZE SPINE immediately — cervical collar + log-roll technique (maintain neutral alignment)", ""),
("2nd", "Airway: JAW THRUST ONLY (no head-tilt-chin-lift in cervical spine injury)", ""),
("3rd", "Neurogenic shock (vasodilation + bradycardia): IV fluids + Norepinephrine + Atropine", ""),
("4th", "MRI spine STAT; Neurosurgical consultation for decompression", ""),
("5th", "Foley catheter (urinary retention); Bowel management; Pressure ulcer prevention", ""),
("6th", "DVT prophylaxis (LMWH); respiratory support; skin care; psychological support", ""),
]))
story.append(sp(4))
story.append(highlight_box(
"Neurogenic shock ≠ Spinal shock: Neurogenic = hemodynamic (hypotension + bradycardia). "
"Spinal shock = flaccid paralysis below injury level (temporary).",
bg=colors.HexColor("#F2F3F4"), text_color=C_DARK_GRAY))
story.append(sp(8))
# ── Emergency 18: Polytrauma ──────────────────────────────────────────────
story.append(section_header("18. POLYTRAUMA — ATLS Primary Survey", C_DARK_RED, "🩹"))
story.append(sp(3))
atls_data = [
[Paragraph("<b>Survey</b>", TABLE_HEADER),
Paragraph("<b>Assessment</b>", TABLE_HEADER),
Paragraph("<b>Priority Actions</b>", TABLE_HEADER)],
[Paragraph("A — Airway\n+ C-spine", TABLE_CELL_BOLD),
Paragraph("Obstruction, stridor, LOC", TABLE_CELL),
Paragraph("Jaw thrust; suction; oropharyngeal airway; intubate", TABLE_CELL)],
[Paragraph("B — Breathing", TABLE_CELL_BOLD),
Paragraph("Tension pneumothorax, open chest, flail chest", TABLE_CELL),
Paragraph("Needle decompression (2nd ICS MCL); chest seal; O₂", TABLE_CELL)],
[Paragraph("C — Circulation", TABLE_CELL_BOLD),
Paragraph("Active hemorrhage, BP, HR, skin perfusion", TABLE_CELL),
Paragraph("Direct pressure; tourniquet; 2 large-bore IVs; blood products 1:1:1", TABLE_CELL)],
[Paragraph("D — Disability", TABLE_CELL_BOLD),
Paragraph("GCS, pupils, motor/sensory", TABLE_CELL),
Paragraph("GCS calculation; C-spine precautions; glucose check", TABLE_CELL)],
[Paragraph("E — Exposure", TABLE_CELL_BOLD),
Paragraph("Hidden wounds, fractures, temperature", TABLE_CELL),
Paragraph("Log roll; full-body exam; warm blankets (hypothermia prevention)", TABLE_CELL)],
]
atls_t = Table(atls_data, colWidths=[2.5*cm, 4.5*cm, USABLE_W - 7.0*cm])
atls_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), C_DARK_RED),
("ROWBACKGROUNDS",(0,1), (-1,-1), [C_ROW1, C_ROW2]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#BFC9CA")),
("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(atls_t)
story.append(sp(4))
story.append(highlight_box(
"TENSION PNEUMOTHORAX: Absent breath sounds + tracheal deviation + hypotension + JVD → "
"IMMEDIATE needle decompression (2nd intercostal space, midclavicular line) — DO NOT wait for X-ray!",
bg=colors.HexColor("#FDEDEC"), text_color=C_DARK_RED))
story.append(PageBreak())
# ── KEY MNEMONICS PAGE ─────────────────────────────────────────────────────
story.append(section_header("KEY MNEMONICS FOR NCLEX & NORCET AIIMS", C_TEAL, "📝"))
story.append(sp(5))
story.append(mnemonic_table([
("ABCDE", "Airway | Breathing | Circulation | Disability | Exposure — Universal primary survey"),
("FAST", "Face drooping | Arm weakness | Speech difficulty | Time → Stroke recognition"),
("MONA", "Morphine | O₂ (if SpO₂ <90%) | Nitroglycerin | Aspirin — Myocardial Infarction"),
("LMNOP", "Lasix | Morphine | Nitrates | O₂ | Position (upright) — Acute pulmonary edema"),
("4H 4T", "Reversible causes of cardiac arrest (see Emergency #1)"),
("SBAR", "Situation | Background | Assessment | Recommendation — Handoff communication"),
("SAMPLE", "Signs/Symptoms | Allergies | Medications | Past history | Last oral intake | Events"),
("PPH 4T's", "Tone (atony) | Tissue (retained placenta) | Trauma (laceration) | Thrombin (coagulopathy)"),
("RICE", "Rest | Ice | Compression | Elevation — Musculoskeletal injury"),
("Parkland", "4 × weight(kg) × %TBSA = mL Lactated Ringer's (½ in first 8 hrs; ½ in next 16 hrs)"),
("Rule of 9s", "Head 9% | Each arm 9% | Chest 9% | Abd 9% | Each thigh 9% | Each lower leg 9% | Perineum 1%"),
("Rule of 15", "Hypoglycemia: 15g carbs PO → recheck BGL in 15 min → repeat if still <70 mg/dL"),
]))
story.append(sp(10))
# ── HIGH-YIELD EXAM POINTS ────────────────────────────────────────────────
story.append(section_header("TOP 15 HIGH-YIELD EXAM POINTS", C_RED, "🔺"))
story.append(sp(5))
hiyield = [
("1", "EPINEPHRINE is ALWAYS 1st in anaphylaxis — NOT antihistamine (diphenhydramine)"),
("2", "tPA is CONTRAINDICATED in hemorrhagic stroke — always confirm with CT first"),
("3", "No ASPIRIN in children <18 years (Reye's syndrome risk)"),
("4", "Potassium must be ≥3.5 mEq/L BEFORE starting insulin in DKA"),
("5", "Thiamine 100 mg IV BEFORE glucose in alcoholics (prevents Wernicke's encephalopathy)"),
("6", "NEVER perform LP before CT scan if raised ICP is suspected (herniation risk)"),
("7", "CPR ratio: 30:2 adults | 30:2 child (1 rescuer) | 15:2 child (2 rescuers)"),
("8", "JAW THRUST (not head-tilt) is used in suspected cervical spine injury"),
("9", "Magnesium antidote = Calcium Gluconate — MUST keep at bedside during Mg infusion"),
("10", "Urine output target in shock: >0.5 mL/kg/hr | In burns: 0.5–1.0 mL/kg/hr"),
("11", "Primary PCI within 90 minutes (door-to-balloon time) for STEMI"),
("12", "Oxygen NOT given in COPD if SpO₂ >88–92% (hypercapnic respiratory drive)"),
("13", "Trendelenburg is NOT recommended in most shock types (current evidence-based update)"),
("14", "Stroke ischemic window: tPA ≤4.5 hrs | Thrombectomy ≤24 hrs (large vessel)"),
("15", '"Not dead until WARM and dead" — continue CPR in hypothermia until core temp >32°C'),
]
hy_data = []
for num, point in hiyield:
hy_data.append([
Paragraph(f"<b>{num}</b>", ParagraphStyle("num", fontName="Helvetica-Bold",
fontSize=9, textColor=C_WHITE, alignment=TA_CENTER, leading=11)),
Paragraph(point, TABLE_CELL)
])
hy_t = Table(hy_data, colWidths=[0.9*cm, USABLE_W - 0.9*cm])
hy_t.setStyle(TableStyle([
("ROWBACKGROUNDS", (0,0), (-1,-1), [colors.HexColor("#FDEDEC"), colors.HexColor("#FFF3E0")]),
("BACKGROUND", (0,0), (0,-1), C_RED),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#F1948A")),
("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(hy_t)
story.append(sp(8))
# ── Nursing Priority Rules ─────────────────────────────────────────────────
story.append(section_header("NURSING DELEGATION & PRIORITY RULES", C_TEAL, "🏥"))
story.append(sp(4))
story.append(mnemonic_table([
("Maslow First", "Physiological needs (airway > breathing > circulation) always before safety or psychological needs"),
("ABC Rule", "Airway is ALWAYS first — unless DNR (Do Not Resuscitate) order exists"),
("Assess First", "ASSESS before intervening — except cardiac arrest (act immediately)"),
("Delegation", "RN: Assessment, teaching, unstable pts | LPN/LVN: Stable, routine care | UAP: Bathing, stable vitals"),
("Priority", "Acute > Chronic | Unstable > Stable | Life-threatening > Comfort needs"),
("Safety", "Seizure precautions | Fall precautions | Infection control (hand hygiene)"),
], bg_color=colors.HexColor("#E8F8F5")))
story.append(sp(6))
story.append(Paragraph(
"<i>Sources: ROSEN's Emergency Medicine • Goldman-Cecil Medicine • Miller's Anesthesia • "
"ACLS/ATLS/Sepsis Surviving Sepsis Campaign Guidelines • Sabiston Textbook of Surgery</i>",
SMALL))
doc.build(story)
print(f"PDF created: {OUTPUT}")
if __name__ == "__main__":
build()