I am zero in practice knowledge and I'm going to give an interview where i have to manage icu and post op patient care So i want you to make an pdf of all the important clinical emergency in icu and it's management and dosagge of the drugs all compiled Tell me all procedures step wise in yhat pdf so i can prepare for interview Be quick i have interview in an hour
mkdir -p /tmp/workspace/icu-emergency && echo "done"
~/icu-emergency/generate_icu_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table,
TableStyle, HRFlowable, PageBreak, KeepTogether)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import ListFlowable, ListItem
doc = SimpleDocTemplate(
"/tmp/workspace/icu-emergency/ICU_Emergency_Guide.pdf",
pagesize=A4,
rightMargin=1.5*cm, leftMargin=1.5*cm,
topMargin=2*cm, bottomMargin=2*cm
)
W, H = A4
styles = getSampleStyleSheet()
# Custom styles
DARK_BLUE = colors.HexColor("#0D2E5B")
MED_BLUE = colors.HexColor("#1565C0")
LIGHT_BLUE= colors.HexColor("#E3F2FD")
RED = colors.HexColor("#C62828")
ORANGE = colors.HexColor("#E65100")
GREEN = colors.HexColor("#1B5E20")
LIGHT_RED = colors.HexColor("#FFEBEE")
LIGHT_GRN = colors.HexColor("#E8F5E9")
LIGHT_ORG = colors.HexColor("#FFF3E0")
GREY = colors.HexColor("#455A64")
LIGHT_GREY= colors.HexColor("#ECEFF1")
title_style = ParagraphStyle('TitleStyle', parent=styles['Title'],
fontSize=22, textColor=colors.white, alignment=TA_CENTER,
spaceAfter=4, fontName='Helvetica-Bold')
subtitle_style = ParagraphStyle('SubTitle', parent=styles['Normal'],
fontSize=11, textColor=colors.HexColor("#BBDEFB"), alignment=TA_CENTER,
spaceAfter=2, fontName='Helvetica')
h1 = ParagraphStyle('H1', parent=styles['Normal'],
fontSize=14, textColor=colors.white, fontName='Helvetica-Bold',
spaceBefore=6, spaceAfter=4, leftIndent=0, backColor=DARK_BLUE,
borderPad=6, leading=18)
h2 = ParagraphStyle('H2', parent=styles['Normal'],
fontSize=12, textColor=colors.white, fontName='Helvetica-Bold',
spaceBefore=4, spaceAfter=3, backColor=MED_BLUE,
borderPad=5, leading=16)
h3 = ParagraphStyle('H3', parent=styles['Normal'],
fontSize=11, textColor=DARK_BLUE, fontName='Helvetica-Bold',
spaceBefore=3, spaceAfter=2, leftIndent=0)
body = ParagraphStyle('Body', parent=styles['Normal'],
fontSize=9, textColor=colors.black, fontName='Helvetica',
spaceBefore=1, spaceAfter=1, leftIndent=8, leading=13)
bullet = ParagraphStyle('Bullet', parent=styles['Normal'],
fontSize=9, textColor=colors.black, fontName='Helvetica',
spaceBefore=1, spaceAfter=1, leftIndent=16, bulletIndent=8, leading=13)
bold_body = ParagraphStyle('BoldBody', parent=styles['Normal'],
fontSize=9, textColor=DARK_BLUE, fontName='Helvetica-Bold',
spaceBefore=1, spaceAfter=1, leftIndent=8, leading=13)
warning = ParagraphStyle('Warning', parent=styles['Normal'],
fontSize=9, textColor=RED, fontName='Helvetica-Bold',
spaceBefore=1, spaceAfter=1, leftIndent=8, leading=13)
note_style = ParagraphStyle('Note', parent=styles['Normal'],
fontSize=8.5, textColor=GREY, fontName='Helvetica-Oblique',
spaceBefore=1, spaceAfter=1, leftIndent=8, leading=12)
def section_header(text, color=DARK_BLUE):
return Table([[Paragraph(f" {text}", ParagraphStyle('SH', parent=styles['Normal'],
fontSize=13, textColor=colors.white, fontName='Helvetica-Bold', leading=18))]],
colWidths=[doc.width],
style=TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
def sub_header(text, color=MED_BLUE):
return Table([[Paragraph(f" {text}", ParagraphStyle('SSH', parent=styles['Normal'],
fontSize=11, textColor=colors.white, fontName='Helvetica-Bold', leading=16))]],
colWidths=[doc.width],
style=TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
def drug_table(data, col_widths=None):
if not col_widths:
col_widths = [5*cm, 4*cm, 4*cm, 4.5*cm]
ts = TableStyle([
('BACKGROUND', (0,0), (-1,0), DARK_BLUE),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8.5),
('BACKGROUND', (0,1), (-1,-1), colors.white),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, LIGHT_BLUE]),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#B0BEC5")),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
])
t = Table(data, colWidths=col_widths, style=ts, repeatRows=1)
return t
def alert_box(text, bg=LIGHT_RED, txt_color=RED):
return Table([[Paragraph(f"⚠ {text}", ParagraphStyle('Alert', parent=styles['Normal'],
fontSize=9, textColor=txt_color, fontName='Helvetica-Bold', leading=13))]],
colWidths=[doc.width],
style=TableStyle([
('BACKGROUND', (0,0), (-1,-1), bg),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 8),
('BOX', (0,0), (-1,-1), 1, txt_color),
]))
def info_box(text, bg=LIGHT_GRN, txt_color=GREEN):
return Table([[Paragraph(f"✔ {text}", ParagraphStyle('Info', parent=styles['Normal'],
fontSize=9, textColor=txt_color, fontName='Helvetica', leading=13))]],
colWidths=[doc.width],
style=TableStyle([
('BACKGROUND', (0,0), (-1,-1), bg),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 8),
('BOX', (0,0), (-1,-1), 1, txt_color),
]))
def steps_table(steps):
rows = []
for i, s in enumerate(steps):
rows.append([
Paragraph(str(i+1), ParagraphStyle('StepNum', parent=styles['Normal'],
fontSize=11, textColor=colors.white, fontName='Helvetica-Bold',
alignment=TA_CENTER)),
Paragraph(s, ParagraphStyle('StepTxt', parent=styles['Normal'],
fontSize=9, textColor=colors.black, fontName='Helvetica', leading=13))
])
ts = TableStyle([
('BACKGROUND', (0,0), (0,-1), MED_BLUE),
('BACKGROUND', (1,0), (1,-1), colors.white),
('ROWBACKGROUNDS', (1,0), (1,-1), [colors.white, LIGHT_BLUE]),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#B0BEC5")),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('ALIGN', (0,0), (0,-1), 'CENTER'),
('LEFTPADDING', (0,0), (-1,-1), 6),
('RIGHTPADDING', (0,0), (-1,-1), 6),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
])
return Table(rows, colWidths=[1.2*cm, doc.width - 1.2*cm], style=ts)
# ─── COVER PAGE ──────────────────────────────────────────────────────────────
story = []
# Cover
cover_bg = Table([['']], colWidths=[doc.width + 3*cm], rowHeights=[H - 4*cm],
style=TableStyle([('BACKGROUND', (0,0), (-1,-1), DARK_BLUE)]))
# Instead, just use paragraphs with colored background via a cover table
cover_data = [
[Paragraph("ICU & POST-OP EMERGENCY", ParagraphStyle('CT1',
parent=styles['Normal'], fontSize=24, textColor=colors.white,
fontName='Helvetica-Bold', alignment=TA_CENTER, leading=30))],
[Paragraph("CLINICAL MANAGEMENT GUIDE", ParagraphStyle('CT2',
parent=styles['Normal'], fontSize=18, textColor=colors.HexColor("#BBDEFB"),
fontName='Helvetica-Bold', alignment=TA_CENTER, leading=24))],
[Spacer(1, 0.5*cm)],
[Paragraph("Emergency Protocols · Drug Dosages · Step-by-Step Procedures",
ParagraphStyle('CT3', parent=styles['Normal'], fontSize=11,
textColor=colors.HexColor("#90CAF9"), fontName='Helvetica',
alignment=TA_CENTER))],
[Spacer(1, 1*cm)],
[Paragraph("For ICU & Post-Operative Patient Care",
ParagraphStyle('CT4', parent=styles['Normal'], fontSize=12,
textColor=colors.white, fontName='Helvetica-Bold', alignment=TA_CENTER))],
[Spacer(1, 0.5*cm)],
[Paragraph("Based on: Harrison's 22E · Miller's Anesthesia 10E · Tintinalli's EM · Goldman-Cecil · Washington Manual",
ParagraphStyle('CT5', parent=styles['Normal'], fontSize=8,
textColor=colors.HexColor("#B0BEC5"), fontName='Helvetica-Oblique',
alignment=TA_CENTER))],
]
cover_tbl = Table(cover_data, colWidths=[doc.width],
style=TableStyle([
('BACKGROUND', (0,0), (-1,-1), DARK_BLUE),
('TOPPADDING', (0,0), (-1,-1), 12),
('BOTTOMPADDING', (0,0), (-1,-1), 12),
('LEFTPADDING', (0,0), (-1,-1), 20),
('RIGHTPADDING', (0,0), (-1,-1), 20),
]))
story.append(cover_tbl)
story.append(PageBreak())
# ─── TABLE OF CONTENTS ───────────────────────────────────────────────────────
story.append(section_header("TABLE OF CONTENTS"))
story.append(Spacer(1, 0.3*cm))
toc_items = [
("1", "CARDIAC ARREST - ACLS Protocol", "3"),
("2", "SEPSIS & SEPTIC SHOCK", "4"),
("3", "RESPIRATORY FAILURE & MECHANICAL VENTILATION", "5"),
("4", "SHOCK - Types & Management", "6"),
("5", "HYPERTENSIVE EMERGENCY", "7"),
("6", "PULMONARY EMBOLISM (PE)", "8"),
("7", "ACUTE RESPIRATORY DISTRESS SYNDROME (ARDS)", "8"),
("8", "ACUTE KIDNEY INJURY (AKI)", "9"),
("9", "DIABETIC KETOACIDOSIS (DKA)", "9"),
("10", "POST-OP COMPLICATIONS & MANAGEMENT", "10"),
("11", "VASOPRESSORS & INOTROPES - Drug Reference", "11"),
("12", "SEDATION & ANALGESIA IN ICU", "12"),
("13", "ICU PROCEDURES - Step by Step", "13"),
("14", "QUICK DRUG DOSAGE REFERENCE TABLE", "15"),
]
toc_data = [["#", "Topic", "Page"]]
for num, topic, page in toc_items:
toc_data.append([num, topic, page])
toc_tbl = Table(toc_data, colWidths=[1*cm, 13.5*cm, 1.5*cm],
style=TableStyle([
('BACKGROUND', (0,0), (-1,0), DARK_BLUE),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 9),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, LIGHT_BLUE]),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#B0BEC5")),
('LEFTPADDING', (0,0), (-1,-1), 6),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
]))
story.append(toc_tbl)
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 1: CARDIAC ARREST
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("1. CARDIAC ARREST — ACLS PROTOCOL"))
story.append(Spacer(1, 0.2*cm))
story.append(alert_box("CALL FOR HELP IMMEDIATELY. Start CPR within 10 seconds of recognizing cardiac arrest."))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("BLS Steps (Basic Life Support)"))
bls = [
"Check for responsiveness — tap shoulder, shout 'Are you OK?'",
"Call for help / activate emergency response / get AED",
"Check carotid pulse — no more than 10 seconds",
"Start CPR: 30 chest compressions : 2 rescue breaths (30:2 ratio)",
"Compression rate: 100-120/min | Depth: at least 5 cm (2 inches)",
"Allow complete chest recoil after each compression",
"Minimize interruptions — keep pauses <10 seconds",
"As soon as AED arrives — APPLY AND USE IMMEDIATELY",
]
story.append(steps_table(bls))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("ACLS: Shockable Rhythms (VF / Pulseless VT)"))
vf_steps = [
"Continue CPR while charging defibrillator",
"Defibrillate: Biphasic 200J (or per manufacturer); Monophasic 360J",
"Resume CPR IMMEDIATELY for 2 minutes after shock — do NOT check pulse",
"Establish IV/IO access; Secure airway (ETT or supraglottic)",
"EPINEPHRINE 1 mg IV/IO every 3-5 minutes (give after 2nd shock, then every other CPR cycle)",
"If VF/pVT persists after 2nd shock: AMIODARONE 300 mg IV/IO bolus (2nd dose: 150 mg) OR LIDOCAINE 1-1.5 mg/kg IV (repeat 0.5-0.75 mg/kg every 5-10 min, max 3 mg/kg)",
"Continue 2-min CPR cycles → reassess rhythm → shock if shockable → repeat",
"Treat reversible causes (H's and T's) throughout",
]
story.append(steps_table(vf_steps))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("ACLS: Non-Shockable Rhythms (PEA / Asystole)"))
pea_steps = [
"Continue high-quality CPR — do NOT defibrillate",
"EPINEPHRINE 1 mg IV/IO every 3-5 minutes (give as soon as IV/IO available)",
"Secure airway — avoid hyperventilation (10 breaths/min once intubated)",
"Search for and treat reversible causes (H's and T's)",
"Reassess rhythm every 2 minutes",
]
story.append(steps_table(pea_steps))
story.append(Spacer(1, 0.2*cm))
ht_data = [
["H's (Reversible Causes)", "T's (Reversible Causes)"],
["Hypoxia → Oxygen, ventilate", "Tension Pneumothorax → Needle decompression"],
["Hypovolemia → IV fluids", "Tamponade (cardiac) → Pericardiocentesis"],
["Hydrogen ion (Acidosis) → Bicarbonate", "Toxins → Antidote/dialysis"],
["Hypo/Hyperkalemia → Correct electrolytes", "Thrombosis (PE) → Thrombolytics"],
["Hypothermia → Warm patient", "Thrombosis (AMI) → PCI/thrombolytics"],
]
ht_tbl = Table(ht_data, colWidths=[doc.width/2, doc.width/2],
style=TableStyle([
('BACKGROUND', (0,0), (-1,0), ORANGE),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8.5),
('ROWBACKGROUNDS', (0,1), (-1,-1), [LIGHT_ORG, colors.white]),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#B0BEC5")),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('LEFTPADDING', (0,0), (-1,-1), 6),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
]))
story.append(Paragraph("<b>H's and T's — Reversible Causes</b>", h3))
story.append(ht_tbl)
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("Post-Cardiac Arrest Care (ROSC Achieved)"))
post_arrest = [
"Maintain SpO2 92-98% — avoid hyperoxia; PaO2 target 75-100 mmHg",
"Maintain ETCO2 35-45 mmHg (PaCO2 40-45 mmHg); avoid hypocarbia",
"Target MAP ≥65 mmHg — use vasopressors if needed",
"12-lead ECG immediately — if STEMI/high suspicion → emergent coronary angiography",
"Targeted Temperature Management (TTM): Target 32-36°C for 24 hours in comatose patients",
"Avoid fever (T>37.7°C) for at least 72 hours",
"Glucose control: Target 140-180 mg/dL",
"Head CT if no obvious cardiac cause; EEG to rule out seizures",
]
story.append(steps_table(post_arrest))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 2: SEPSIS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("2. SEPSIS & SEPTIC SHOCK"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>DEFINITIONS</b>", h3))
def_data = [
["Term", "Definition", "Diagnostic Criteria"],
["SIRS", "Systemic Inflammatory Response",
"≥2 of: Temp >38°C or <36°C | HR >90 | RR >20 or PaCO2 <32 | WBC >12k or <4k"],
["Sepsis", "Life-threatening organ dysfunction due to infection",
"SOFA score ≥2 from baseline; qSOFA ≥2 (altered mentation + RR≥22 + SBP≤100)"],
["Septic Shock", "Sepsis + persistent hypotension requiring vasopressors",
"MAP <65 mmHg despite fluids + serum lactate >2 mmol/L"],
]
story.append(drug_table(def_data, [3.5*cm, 5*cm, 9*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("SEPSIS 1-HOUR BUNDLE (Surviving Sepsis Campaign)"))
bundle = [
"Measure LACTATE — if lactate >2 mmol/L, resuscitate aggressively",
"Obtain BLOOD CULTURES (x2 sets, different sites) BEFORE antibiotics",
"Administer BROAD-SPECTRUM ANTIBIOTICS within 1 HOUR of recognition",
"Begin IV FLUID RESUSCITATION: 30 mL/kg crystalloid (Normal Saline or Lactated Ringer's) for hypotension or lactate ≥4 mmol/L",
"Start VASOPRESSORS if MAP <65 mmHg despite adequate fluids",
"Reassess fluid status and tissue perfusion after initial resuscitation (CVP, urine output, lactate clearance)",
]
story.append(steps_table(bundle))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>ANTIBIOTIC SELECTION BY SOURCE</b>", h3))
abx_data = [
["Source", "First-line Antibiotics", "Duration"],
["Unknown source", "Piperacillin-Tazobactam 4.5g IV q8h + Vancomycin 25-30 mg/kg load", "7-10 days"],
["Pulmonary", "Ceftriaxone 1-2g IV q24h + Azithromycin 500mg IV/PO\nIf severe/HAP: Pip-Tazo + Vancomycin", "5-7 days"],
["UTI/Urosepsis", "Ceftriaxone 1g IV q24h or Ciprofloxacin 400mg IV q12h", "7-14 days"],
["Abdominal", "Piperacillin-Tazobactam 3.375g IV q6h or Meropenem 1g IV q8h", "7-10 days"],
["Skin/Soft Tissue", "Vancomycin 15-20 mg/kg IV q8-12h + Pip-Tazo", "7-14 days"],
["Meningitis", "Ceftriaxone 2g IV q12h + Vancomycin 15-20 mg/kg q8-12h + Dexamethasone 0.15 mg/kg q6h", "10-21 days"],
["MRSA suspected", "Vancomycin 25-30 mg/kg IV load, then 15-20 mg/kg q8-12h (target trough 15-20)", "Per source"],
]
story.append(drug_table(abx_data, [4*cm, 8*cm, 4.5*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("VASOPRESSORS IN SEPTIC SHOCK"))
vaso_data = [
["Drug", "Dose", "Route", "Notes"],
["Norepinephrine (1st line)", "0.01-3 mcg/kg/min\nStart: 0.1-0.2 mcg/kg/min", "Central IV", "Vasoconstriction (α1); first-line for septic shock"],
["Vasopressin (add-on)", "0.03-0.04 units/min (fixed dose)", "Central IV", "Add to norepinephrine; reduces norepinephrine requirements"],
["Epinephrine (2nd line)", "0.01-1 mcg/kg/min", "Central IV", "Use if norepinephrine inadequate; causes tachycardia"],
["Dopamine (not preferred)", "5-20 mcg/kg/min", "Central IV", "More arrhythmias; use only if no norepinephrine available"],
["Dobutamine (inotrope)", "2.5-20 mcg/kg/min", "IV (peripheral OK)", "Use if low cardiac output/cardiogenic component"],
["Phenylephrine", "0.4-9.1 mcg/kg/min", "Central IV", "Pure α1; use if tachycardia limits norepinephrine"],
]
story.append(drug_table(vaso_data, [4*cm, 3.5*cm, 3*cm, 6*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(info_box("TARGET: MAP ≥65 mmHg | Urine output ≥0.5 mL/kg/hr | Lactate clearance ≥10% per 2 hours | ScvO2 >70%"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>Adjuncts:</b> Hydrocortisone 200 mg/day (IV infusion) if refractory shock; Albumin 4-5% if refractory to crystalloids", body))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 3: RESPIRATORY FAILURE
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("3. RESPIRATORY FAILURE & MECHANICAL VENTILATION"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>TYPES OF RESPIRATORY FAILURE</b>", h3))
rf_data = [
["Type", "Mechanism", "PaO2", "PaCO2", "Examples"],
["Type 1 (Hypoxemic)", "V/Q mismatch, shunt", "< 60 mmHg", "Normal/Low", "ARDS, Pulmonary edema, Pneumonia"],
["Type 2 (Hypercapnic)", "Alveolar hypoventilation", "↓ or Normal", "> 45 mmHg", "COPD, Neuromuscular disease, Drug OD"],
["Type 3 (Peri-op)", "Atelectasis", "↓", "Normal/↑", "Post-op shallow breathing"],
["Type 4 (Shock)", "High metabolic demand", "↓", "Variable", "Cardiogenic/septic shock"],
]
story.append(drug_table(rf_data, [3.5*cm, 4*cm, 2.5*cm, 2.5*cm, 5*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("INDICATIONS FOR INTUBATION"))
intub_ind = [
"Respiratory rate >35/min or severe work of breathing (accessory muscles, paradoxical breathing)",
"SpO2 <90% despite high-flow O2 (15L/min non-rebreather mask)",
"PaO2/FiO2 ratio <150 mmHg despite NIV trial",
"PaCO2 >50 mmHg with pH <7.25 (acute hypercapnic failure unresponsive to NIV)",
"Airway protection (GCS ≤8, absent gag reflex, massive hemoptysis)",
"Anticipated clinical deterioration",
]
story.append(steps_table(intub_ind))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("RAPID SEQUENCE INTUBATION (RSI) — Step by Step"))
rsi_steps = [
"PREPARATION: Position patient (sniffing position), pre-oxygenate with 100% O2 for 3-5 min via NRB or BVM",
"PREMEDICATION (optional): Lidocaine 1.5 mg/kg IV (if ICP concern); Atropine 0.01 mg/kg IV for children <5 yrs",
"INDUCTION AGENT: Ketamine 1.5-2 mg/kg IV (preferred in hemodynamically unstable) OR Etomidate 0.3 mg/kg IV (preferred if hemodynamically stable, avoid in adrenal insufficiency) OR Propofol 1.5-2 mg/kg IV (avoid if hypotensive)",
"PARALYTIC AGENT: Succinylcholine 1.5 mg/kg IV (fast: 45 sec onset, contraindicated in burn/crush >24h, hyperK) OR Rocuronium 1.2 mg/kg IV (alternative if succinylcholine contraindicated; reversed by Sugammadex 16 mg/kg)",
"SELLICK MANEUVER: Apply cricoid pressure (controversial, may omit)",
"INTUBATE: Direct laryngoscopy with blade (Mac 3-4), visualize cords, pass ETT (7.0-8.0 Fr males, 6.5-7.5 Fr females), inflate cuff to 20-30 cmH2O",
"CONFIRM: Capnography (GOLD STANDARD — continuous ETCO2), bilateral chest rise, equal air entry, SpO2",
"SECURE ETT: Tape at 21-23 cm mark (men) or 19-21 cm (women) at lips; CXR to confirm position",
"POST-INTUBATION: Connect to ventilator, sedation+analgesia infusion, ABG in 20-30 min",
]
story.append(steps_table(rsi_steps))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("INITIAL VENTILATOR SETTINGS"))
vent_data = [
["Parameter", "Setting", "Rationale"],
["Mode", "Volume Control (AC/VC) initially", "Guaranteed tidal volume delivery"],
["Tidal Volume (Vt)", "6-8 mL/kg IBW (ARDS: 4-6 mL/kg)", "Lung-protective ventilation"],
["RR", "12-20 breaths/min", "Adjust to target PaCO2 35-45"],
["FiO2", "Start 100%, wean to target SpO2 92-96%", "Avoid hyperoxia"],
["PEEP", "5 cmH2O initial (ARDS: 8-15 cmH2O)", "Prevent alveolar collapse"],
["I:E ratio", "1:2 (default)", "Allow full exhalation"],
["Peak pressure alarm", "< 40 cmH2O", "Plateau <30 cmH2O for lung protection"],
["Flow rate", "60-80 L/min", "Adjust per patient effort"],
]
story.append(drug_table(vent_data, [4.5*cm, 5*cm, 7*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(alert_box("ARDS Berlin Criteria: PaO2/FiO2 <300 + Bilateral infiltrates + Not explained by cardiac failure. Prone positioning >16h/day in severe ARDS (PF <150)."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 4: SHOCK
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("4. SHOCK — TYPES & MANAGEMENT"))
story.append(Spacer(1, 0.2*cm))
shock_data = [
["Type", "Mechanism", "Hemodynamics\n(CO/SVR/CVP)", "First-line Management"],
["Hypovolemic\n(hemorrhagic)", "Volume loss", "↓CO / ↑SVR / ↓CVP", "IV fluids (NS/LR 1-2L bolus)\nPRBC if Hgb <7 (trauma <10)\nControl bleeding"],
["Distributive\n(Septic)", "Vasodilation", "↑CO / ↓SVR / ↓CVP", "30mL/kg IV fluid\nNorepinephrine (1st line)\nBroad-spectrum antibiotics"],
["Cardiogenic", "Pump failure", "↓CO / ↑SVR / ↑CVP", "Dobutamine 2.5-20 mcg/kg/min\nNorepinephrine if hypotensive\nTreat underlying cause (PCI for STEMI)"],
["Obstructive\n(PE/Tamponade)", "Outflow obstruction", "↓CO / ↑SVR / ↑CVP", "PE: Heparin ± thrombolytics\nTamponade: Pericardiocentesis\nTension PTX: Needle decompression"],
["Neurogenic", "Loss of vasomotor tone", "↓CO / ↓SVR / ↓CVP", "IV fluids + Norepinephrine\nTreat spinal injury"],
]
story.append(drug_table(shock_data, [3*cm, 3.5*cm, 4*cm, 6*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("HEMORRHAGIC SHOCK - Massive Transfusion Protocol (MTP)"))
story.append(Paragraph("<b>Activation Criteria:</b> >10 units PRBCs in 24h OR active uncontrolled hemorrhage", bold_body))
mtp_data = [
["Component", "Ratio", "Notes"],
["PRBC (Packed Red Blood Cells)", "1 unit", "Target Hgb ≥7 (trauma: ≥10)"],
["FFP (Fresh Frozen Plasma)", "1 unit", "Replace clotting factors; 10-15 mL/kg"],
["Platelets", "1 unit", "Target >50,000; >100,000 if TBI"],
["Cryoprecipitate", "1 pool (5 units)", "If fibrinogen <1.5 g/L"],
["Tranexamic Acid", "1g IV over 10 min within 3h of injury", "Then 1g IV over 8h; reduces mortality"],
["Calcium Gluconate", "1g IV after every 4 PRBCs", "Prevent hypocalcemia from citrate"],
]
story.append(drug_table(mtp_data, [5*cm, 5.5*cm, 6*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(info_box("Target: MAP ≥65 mmHg | Permissive hypotension in trauma (SBP 80-90) until hemorrhage controlled | Avoid hypothermia, acidosis, coagulopathy (lethal triad)"))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 5: HYPERTENSIVE EMERGENCY
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("5. HYPERTENSIVE EMERGENCY"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>Definition:</b> SBP >180 mmHg AND/OR DBP >120 mmHg WITH end-organ damage", bold_body))
story.append(Paragraph("<b>End-Organ Damage Signs:</b> Encephalopathy, Aortic dissection, AMI, Pulmonary edema, AKI, Retinal hemorrhage, Eclampsia", body))
story.append(Spacer(1, 0.2*cm))
story.append(alert_box("KEY RULE: Reduce MAP by no more than 10-15% in first hour, then 25% over 24 hours (EXCEPT aortic dissection — target SBP <120 in 20 min)"))
story.append(Spacer(1, 0.2*cm))
htn_data = [
["Drug", "Dose", "Onset", "Indication", "Avoid"],
["Nicardipine", "5 mg/h IV infusion, titrate by 2.5 mg/h q5-15min, max 15 mg/h", "1-5 min", "Most hypertensive emergencies, post-op hypertension", "Acute HF"],
["Labetalol", "20 mg IV bolus, then 40-80 mg q10min (max 300mg)\nOR 0.5-2 mg/min infusion", "5-10 min", "Aortic dissection, eclampsia, post-op", "Asthma, bradycardia, decompensated HF"],
["Sodium Nitroprusside", "0.3-0.5 mcg/kg/min IV, max 10 mcg/kg/min (max 10 min)", "Seconds", "Hypertensive emergency, LV failure", "Elevated ICP, renal failure (cyanide toxicity >48h)"],
["Esmolol", "500 mcg/kg IV bolus then 50-300 mcg/kg/min infusion", "1-2 min", "Aortic dissection, perioperative", "Asthma, bradycardia, heart block"],
["Hydralazine", "10-20 mg IV q4-6h", "10-30 min", "Eclampsia/pre-eclampsia", "Aortic dissection, IHD"],
["Nitroglycerin", "5-200 mcg/min IV infusion", "1-5 min", "Acute coronary syndrome, LV failure", "Hypotension, right heart failure, sildenafil use"],
["Phentolamine", "5-15 mg IV bolus", "1-2 min", "Pheochromocytoma crisis", ""],
["Clevidipine", "1-2 mg/h IV, double q90 sec to max 32 mg/h", "2-4 min", "Perioperative hypertension", "Severe aortic stenosis"],
]
story.append(drug_table(htn_data, [3.5*cm, 5*cm, 2*cm, 4*cm, 3*cm]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 6: PULMONARY EMBOLISM
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("6. PULMONARY EMBOLISM (PE)"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>RISK STRATIFICATION</b>", h3))
pe_risk = [
["Risk Category", "Criteria", "Treatment"],
["Low Risk", "Hemodynamically stable + No RV dysfunction + Troponin/BNP normal",
"DOAC (Rivaroxaban 15mg BID x21d, then 20mg OD) or LMWH → Warfarin\nConsider outpatient treatment"],
["Intermediate (Submassive)", "Hemodynamically stable + RV dysfunction OR elevated troponin/BNP",
"Anticoagulation + Monitor closely in ICU\nConsider CDT/PERT if deteriorating"],
["High Risk (Massive)", "Hemodynamic instability: SBP <90 OR MAP <65 mmHg OR need for vasopressors",
"SYSTEMIC THROMBOLYSIS (if no contraindications)\nAlteplase 100mg IV over 2h\nHeparin infusion after thrombolysis"],
]
story.append(drug_table(pe_risk, [4*cm, 6.5*cm, 6*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("ANTICOAGULATION PROTOCOL"))
ac_data = [
["Drug", "Dose", "Notes"],
["UFH (Unfractionated Heparin)", "80 units/kg IV bolus, then 18 units/kg/h infusion\nAdjust to aPTT 60-100 sec", "Preferred in massive PE, renal failure, high bleeding risk (reversible with protamine)"],
["Enoxaparin (LMWH)", "1 mg/kg SC q12h OR 1.5 mg/kg SC q24h", "Avoid if CrCl <30 mL/min; use anti-Xa levels if monitoring needed"],
["Rivaroxaban (DOAC)", "15 mg BID x21 days, then 20 mg OD with evening meal", "No bridging needed; avoid if CrCl <15"],
["Apixaban (DOAC)", "10 mg BID x7 days, then 5 mg BID", "No bridging; avoid if CrCl <25"],
["Alteplase (Thrombolysis)", "100 mg IV over 2 hours", "Use in massive PE with cardiac arrest or refractory shock"],
["Warfarin", "Start 5 mg PO OD; adjust to INR 2-3\nBridge with LMWH for ≥5 days until INR >2 for 24h", "Multiple drug interactions; slow onset"],
]
story.append(drug_table(ac_data, [4*cm, 5*cm, 7.5*cm]))
story.append(Spacer(1, 0.2*cm))
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 7: ARDS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("7. ACUTE RESPIRATORY DISTRESS SYNDROME (ARDS)"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>Berlin Definition Criteria (ALL must be met):</b>", bold_body))
for c in [
"Onset: Acute (<1 week of known insult or new/worsening symptoms)",
"Bilateral infiltrates on CXR/CT — not fully explained by effusions/collapse/nodules",
"Not fully explained by cardiac failure/fluid overload (echo may be needed)",
"PaO2/FiO2 ratio: Mild <300, Moderate <200, Severe <100 (on PEEP ≥5 cmH2O)",
]:
story.append(Paragraph(f"• {c}", bullet))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("ARDS MANAGEMENT"))
ards_steps = [
"LUNG-PROTECTIVE VENTILATION: Vt 4-6 mL/kg IBW; Plateau pressure <30 cmH2O; Driving pressure <15 cmH2O",
"PEEP: Use higher PEEP table (ARDSNet) for moderate-severe; typical 8-15 cmH2O",
"FiO2: Target SpO2 88-95% (permissive hypoxemia acceptable in severe ARDS)",
"PRONE POSITIONING: ≥16 hours/day for severe ARDS (PF <150) — reduces mortality (NNT ~11)",
"CONSERVATIVE FLUID STRATEGY: Target CVP 4-8 mmHg; use diuretics once stable",
"NEUROMUSCULAR BLOCKADE: Cisatracurium 37.5 mg/hr for first 48h in severe ARDS (controversial)",
"CORTICOSTEROIDS: Methylprednisolone 1 mg/kg/day if no improvement by day 7 or fibroproliferative phase",
"AVOID: High tidal volumes, high plateau pressures, excessive fluids, hypotension",
]
story.append(steps_table(ards_steps))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 8: AKI
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("8. ACUTE KIDNEY INJURY (AKI) IN ICU"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>KDIGO STAGING</b>", h3))
aki_stage = [
["Stage", "Serum Creatinine", "Urine Output"],
["1", "1.5-1.9x baseline OR ↑ ≥0.3 mg/dL within 48h", "<0.5 mL/kg/h for 6-12h"],
["2", "2.0-2.9x baseline", "<0.5 mL/kg/h for ≥12h"],
["3", "≥3x baseline OR ≥4 mg/dL OR initiation of RRT", "<0.3 mL/kg/h for ≥24h OR anuria ≥12h"],
]
story.append(drug_table(aki_stage, [2.5*cm, 8*cm, 6*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("AKI MANAGEMENT"))
aki_mgmt = [
"IDENTIFY & TREAT CAUSE: Pre-renal (fluids), intrinsic (nephrotoxin removal, treat GN), post-renal (catheter/stent)",
"FLUID OPTIMIZATION: 500 mL NS/LR bolus if pre-renal; reassess after each bolus",
"STOP NEPHROTOXINS: NSAIDs, aminoglycosides, contrast, ACEi/ARBs, vancomycin (dose adjust)",
"AVOID: Low-dose dopamine (no benefit); mannitol (not for prevention)",
"FUROSEMIDE: 40-200 mg IV if fluid overloaded (converts oliguric to non-oliguric); does NOT improve outcomes",
"HYPERKALEMIA: See hyperkalemia protocol (ECG if K>5.5; if peaked T waves/widened QRS → calcium gluconate)",
"RENAL REPLACEMENT THERAPY (RRT) indications: Refractory hyperkalemia K>6.5, refractory metabolic acidosis pH<7.1, uremic encephalopathy/pericarditis, fluid overload refractory to diuretics",
]
story.append(steps_table(aki_mgmt))
story.append(Spacer(1, 0.2*cm))
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 9: DKA
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("9. DIABETIC KETOACIDOSIS (DKA)"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>DIAGNOSIS: (All 3 must be present)</b>", bold_body))
for c in ["Blood glucose >250 mg/dL (>13.9 mmol/L)", "Arterial pH <7.3 OR serum bicarb <18 mEq/L", "Positive serum/urine ketones (ketonemia/ketonuria)"]:
story.append(Paragraph(f"• {c}", bullet))
story.append(Spacer(1, 0.2*cm))
dka_steps = [
"IV ACCESS: 2 large bore IVs; send: glucose, BMP, ABG, ketones, HbA1c, blood cultures (if infected)",
"FLUIDS: NS 1L over first hour (1000 mL/hr), then 500 mL/hr for 1-2h, then 250 mL/hr. Switch to D5-0.45% NS when glucose <200 mg/dL",
"INSULIN PROTOCOL: Regular Insulin 0.1 units/kg IV bolus (ONLY if K>3.5 mEq/L), then 0.1 units/kg/hr infusion. Target glucose decrease: 50-75 mg/dL/hr",
"POTASSIUM REPLACEMENT (CRITICAL): Replace before starting insulin if K<3.5. If K 3.5-5.5: add 20-40 mEq/L to IV fluid. Do NOT give insulin if K<3.3 — give KCl 40 mEq/h first",
"BICARBONATE: Give ONLY if pH <6.9 — NaHCO3 100 mEq in 400 mL sterile water over 2h (risk of paradoxical CNS acidosis)",
"MONITOR: Glucose q1h; BMP q2h; Aim anion gap <12, glucose <200, bicarbonate >18 before stopping insulin drip",
"TRANSITION TO SC INSULIN: Overlap IV insulin with SC insulin by 1-2 hours before stopping drip. Resume home regimen or start 0.5-0.8 units/kg/day split between basal and bolus",
]
story.append(steps_table(dka_steps))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 10: POST-OP COMPLICATIONS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("10. POST-OPERATIVE COMPLICATIONS & MANAGEMENT"))
story.append(Spacer(1, 0.2*cm))
postop_data = [
["Complication", "When", "Signs/Symptoms", "Management"],
["Respiratory\nDepression", "0-6h post-op", "SpO2 <90%, RR <10, drowsy", "Supplemental O2; Naloxone 0.4mg IV q2min if opioid-induced; jaw thrust/airway adjunct; intubate if needed"],
["Post-op\nAtelectasis", "0-72h", "Fever (low-grade), hypoxia, dull breath sounds, bibasal crepitations", "Deep breathing exercises, incentive spirometry, early mobilization, chest physio, CPAP if severe"],
["Wound\nInfection", "3-7 days", "Redness, warmth, swelling, purulent discharge, fever", "Wound culture, debridement, antibiotics (cover MSSA/MRSA). Cloxacillin 500mg QID or Vancomycin if MRSA"],
["Post-op\nHemorrhage", "0-24h (early), 5-10d (secondary)", "Tachycardia, hypotension, excessive drain output, falling Hgb", "IV fluids, PRBC transfusion, correct coagulopathy, surgical re-exploration if active bleeding"],
["DVT/PE", "3-7 days", "Leg swelling/pain, sudden dyspnea, pleuritic chest pain, hypoxia", "DVT: LMWH/DOAC. PE: See Section 6"],
["Urinary\nRetention", "0-24h", "Unable to void, suprapubic discomfort, bladder on scan >400 mL", "Urethral catheter; trial void without catheter after 24-48h"],
["Post-op\nIleus", "1-5 days", "Absent bowel sounds, distension, N&V, no flatus", "NPO, NG tube decompression, early ambulation, neostigmine 2mg IV if colonic ileus (Ogilvie's)"],
["Anastomotic\nLeak", "3-7 days", "Fever, abdominal pain, peritonitis, rising WBC, drain content", "CT scan, antibiotics, surgical re-exploration"],
["Post-op\nHypertension", "0-6h post-op", "SBP >160, headache, cardiac risk", "Labetalol 20mg IV or Nicardipine 5mg/h infusion; identify and treat pain/anxiety first"],
["Post-op\nHypothermia", "0-2h", "Shivering, T<36°C, coagulopathy, arrhythmias", "Warm IV fluids, forced air warming blanket, warming mattress"],
["Delirium", "2-7 days", "Acute confusion, agitation, disorientation, sleep-wake disturbance", "Non-pharmacologic first: reorientation, sleep hygiene, early mobility. If needed: Haloperidol 0.5-1 mg IV/IM q6h; Quetiapine 25-50 mg PO BID for hypoactive"],
]
story.append(drug_table(postop_data, [3*cm, 2.5*cm, 4*cm, 7*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("POST-OP PAIN MANAGEMENT — Multimodal Analgesia"))
pain_data = [
["Drug/Modality", "Dose", "Route", "Notes"],
["Paracetamol/Acetaminophen", "1g q6h (max 4g/day; 2g/day if liver disease)", "IV / PO", "Baseline analgesia — always prescribe unless contraindicated"],
["Ibuprofen/Ketorolac (NSAID)", "Ibuprofen 400mg TDS or Ketorolac 15-30mg q6h (max 5 days)", "PO / IV", "Avoid in renal impairment, peptic ulcer, post-cardiac surgery; reduces opioid requirement by 25-30%"],
["Morphine", "1-4 mg IV q4h PRN; PCA: 1mg bolus, 6-min lockout", "IV / IM / SC", "Gold standard; titrate to pain score <4; have naloxone ready"],
["Fentanyl", "25-50 mcg IV q1h PRN (ICU: 25-100 mcg/hr infusion)", "IV", "Preferred in hemodynamic instability and renal failure"],
["Tramadol", "50-100 mg PO/IV q6-8h (max 400mg/day)", "PO / IV", "Weak opioid; seizure risk; avoid with SSRIs (serotonin syndrome)"],
["Gabapentin", "300-600 mg PO TDS (reduce in renal failure)", "PO", "Opioid-sparing; useful for neuropathic pain; causes sedation"],
["Regional Analgesia", "Epidural (LA + opioid infusion); Nerve blocks (TAP, ESP)", "Epidural / IV", "Gold standard for thoracic/abdominal/lower limb surgery"],
["Ketamine (sub-dissociative)", "0.1-0.5 mg/kg/hr IV infusion", "IV", "Opioid-sparing in opioid-tolerant patients; NMDA antagonist"],
["WHO Analgesic Ladder", "Step 1: Paracetamol ± NSAIDs | Step 2: Add tramadol | Step 3: Add morphine/fentanyl", "", "Escalate based on pain score (NRS 0-10); target <4"],
]
story.append(drug_table(pain_data, [4*cm, 4.5*cm, 2*cm, 6*cm]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 11: VASOPRESSORS & INOTROPES
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("11. VASOPRESSORS & INOTROPES — COMPLETE DRUG REFERENCE"))
story.append(Spacer(1, 0.2*cm))
vi_data = [
["Drug", "Class", "Dose", "Receptor", "Effect", "Indication", "Key Side Effects"],
["Norepinephrine\n(Levophed)", "Vasopressor", "0.01-3 mcg/kg/min IV\nStart: 0.1 mcg/kg/min", "α1>>β1", "↑SVR, ↑MAP\n±↑HR", "Septic shock\n(1st line)", "Peripheral ischemia, arrhythmia"],
["Epinephrine\n(Adrenaline)", "Vasopressor\n+Inotrope", "0.01-1 mcg/kg/min\nCardiac arrest: 1mg IV q3-5min", "α1, α2, β1, β2", "↑CO, ↑SVR\n↑HR, ↑BP", "Anaphylaxis, cardiac arrest, refractory shock", "Tachycardia, lactic acidosis, arrhythmia"],
["Vasopressin", "Vasopressor", "0.03-0.04 units/min\n(fixed dose, no titration)", "V1 receptor", "↑SVR via smooth muscle\nNo inotropic effect", "Septic shock\n(adjunct)", "Hyponatremia, ischemia"],
["Dopamine", "Vasopressor\n+Inotrope", "5-10 mcg/kg/min (β)\n10-20 (α)\n<5 mcg/kg/min (dopaminergic - OBSOLETE)", "β1>α1 at high doses", "↑CO, ↑HR, ↑SVR", "Not preferred (more arrhythmias)", "Tachycardia, atrial fibrillation"],
["Dobutamine", "Inotrope", "2.5-20 mcg/kg/min", "β1>β2", "↑CO, ↓SVR\n↑HR", "Cardiogenic shock, low-output HF", "Tachycardia, hypotension"],
["Phenylephrine", "Vasopressor", "0.4-9.1 mcg/kg/min\nBolus: 50-200 mcg IV", "Pure α1", "↑SVR, reflex bradycardia\nNo change in CO", "Vasodilatory shock without tachycardia; spinal hypotension", "Reflex bradycardia, limb ischemia"],
["Milrinone", "Inodilator", "0.25-0.75 mcg/kg/min\n(omit loading in ICU)", "PDE-3 inhibitor", "↑CO, ↓SVR, ↓PVR", "Cardiogenic shock, ADHF, post-cardiac surgery", "Hypotension, arrhythmia; accumulates in renal failure"],
["Levosimendan", "Inodilator", "0.05-0.2 mcg/kg/min IV for 24h", "Ca sensitizer\n+ PDE inhibitor", "↑CO, ↓SVR\nCardioprotective", "Acute decompensated HF, cardiogenic shock", "Hypotension, arrhythmia"],
]
story.append(drug_table(vi_data, [3.5*cm, 2*cm, 3.5*cm, 2*cm, 2.5*cm, 3*cm, 3*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(alert_box("All vasopressors MUST be given via central line (except phenylephrine/low-dose dopamine which can be peripheral for <24h). Always have arterial line for continuous BP monitoring."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 12: SEDATION & ANALGESIA
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("12. SEDATION & ANALGESIA IN ICU"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>ICU SEDATION PRINCIPLES — ABCDEF Bundle</b>", h3))
for item in [
"A — Assess & manage pain (Analgesia-first approach: fentanyl/morphine before sedation)",
"B — Spontaneous Breathing Trials (SAT + SBT daily if ventilated)",
"C — Choice of analgesia and sedation (target RASS -1 to 0; CPOT pain scale)",
"D — Delirium monitoring (CAM-ICU twice daily) and management",
"E — Early mobility & Exercise (Physical therapy from day 1 if able)",
"F — Family engagement (explain procedures, include in rounds)",
]:
story.append(Paragraph(f"• {item}", bullet))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("SEDATION DRUGS"))
sed_data = [
["Drug", "Dose", "Titrate to", "Duration", "Notes"],
["Propofol", "5-50 mcg/kg/min IV infusion\nStart 5 mcg/kg/min, titrate q5-10min", "RASS -1 to 0", "Short-term (<7 days)", "Daily SAT (stop for 2h/day). Monitor TGs if >48h. Propofol infusion syndrome if >80 mcg/kg/min >48h (metabolic acidosis, lipemic plasma, rhabdomyolysis)"],
["Midazolam", "0.01-0.1 mg/kg/hr IV infusion", "RASS -2 to -1", "Short-term", "Accumulates in renal/hepatic failure; avoid in elderly (delirium); used for acute agitation: 1-5 mg IV bolus"],
["Dexmedetomidine\n(Precedex)", "0.2-1.5 mcg/kg/hr IV\n(no loading in ICU)", "RASS -1 to +1", "Short-term", "Allows interactive sedation; reduced delirium; preferred for COPD (no resp depression); bradycardia is common side effect"],
["Ketamine", "0.1-0.5 mg/kg/hr infusion\nRSI: 1.5-2 mg/kg IV bolus", "Procedural/RSI", "Short-term", "Bronchodilator; preserves airway reflexes; hemodynamic stability; causes dissociation, emergence reactions"],
["Lorazepam", "0.01-0.1 mg/kg/hr IV\nBolus: 0.02-0.04 mg/kg IV", "RASS -2 to -1", "Short-term", "Preferred in alcohol withdrawal; caution in delirium; accumulates"],
]
story.append(drug_table(sed_data, [3*cm, 4*cm, 2.5*cm, 2*cm, 6*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("RASS SCALE (Richmond Agitation-Sedation Scale)"))
rass_data = [
["Score", "Term", "Description"],
["+4", "Combative", "Overtly combative, violent, danger to staff"],
["+3", "Very Agitated", "Pulls/removes tubes, aggressive"],
["+2", "Agitated", "Frequent non-purposeful movement, fights ventilator"],
["+1", "Restless", "Anxious, but no aggression"],
["0", "Alert & Calm", "TARGET for most ICU patients"],
["-1", "Drowsy", "Not fully alert, but sustained awakening to voice (>10 sec)"],
["-2", "Light Sedation", "Briefly awakens to voice (<10 sec)"],
["-3", "Moderate Sedation", "Movement or eye opening, no sustained eye contact"],
["-4", "Deep Sedation", "No response to voice; movement to physical stimulus"],
["-5", "Unarousable", "No response to voice or physical stimulation"],
]
story.append(drug_table(rass_data, [2*cm, 4*cm, 10.5*cm]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 13: ICU PROCEDURES
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("13. ICU PROCEDURES — STEP BY STEP"))
story.append(Spacer(1, 0.2*cm))
story.append(sub_header("A. CENTRAL VENOUS CATHETER (CVC) INSERTION"))
cvc_steps = [
"INDICATION: Vasopressors, TPN, CVP monitoring, no peripheral access, frequent blood sampling",
"CONTRAINDICATIONS: Relative — thrombocytopenia (plt <50k), coagulopathy (INR >2.5), local infection at site",
"SITE SELECTION: Right Internal Jugular (1st choice, less PTX risk) OR Subclavian (higher PTX risk, lower infection) OR Femoral (highest infection, last resort)",
"PREPARATION: Informed consent; US machine; sterile gown, gloves, drapes; Central line kit; Chlorhexidine skin prep",
"POSITIONING: Trendelenburg position (head down 15°) for IJV/subclavian — distends vein",
"LANDMARK/US-GUIDED NEEDLE INSERTION: 18G needle, aspirate blood freely — confirm venous (non-pulsatile, dark blood) vs arterial",
"SELDINGER TECHNIQUE: Thread J-wire through needle → remove needle → nick skin with scalpel → dilator over wire → remove dilator → thread catheter over wire → remove wire",
"CONFIRM POSITION: Blood aspirates freely from all ports → flush with saline → CXR (tip at SVC-RA junction, no pneumothorax)",
"SUTURE & DRESS: Secure catheter at skin; apply sterile occlusive dressing",
"COMPLICATIONS TO WATCH: Pneumothorax (CXR), arterial puncture (remove, compress), air embolism (Trendelenburg, occlude port), CLABSI (sterile technique throughout)",
]
story.append(steps_table(cvc_steps))
story.append(Spacer(1, 0.3*cm))
story.append(sub_header("B. ARTERIAL LINE INSERTION"))
art_steps = [
"INDICATION: Continuous BP monitoring, frequent ABGs, titration of vasopressors/inotropes",
"SITE: Radial artery (1st choice — Allen's test first) OR Femoral OR Brachial (last resort)",
"Allen's Test: Compress both radial and ulnar arteries; patient clenches fist → blanches palm; release ulnar artery — palm should refill in <5 seconds (normal). If >10 sec — inadequate ulnar flow, choose other hand.",
"PREPARATION: Sterile gloves, chlorhexidine prep, 20G catheter-over-needle or Seldinger set, pressure transducer, heparinized flush",
"TECHNIQUE: Palpate radial pulse; insert 20G needle at 30-45° angle; flash of blood in hub → advance catheter off needle → withdraw needle → connect tubing",
"US-GUIDED: Identify artery in short axis; advance needle under direct vision into vessel lumen",
"ZERO TRANSDUCER: Level transducer at mid-axillary line (phlebostatic axis); zero to atmospheric pressure",
"CONFIRM: Good arterial waveform on monitor; flush line; secure and dress with clear dressing",
"COMPLICATIONS: Hematoma, thrombosis, distal ischemia — check distal pulse and capillary refill q4h",
]
story.append(steps_table(art_steps))
story.append(Spacer(1, 0.3*cm))
story.append(sub_header("C. NEEDLE THORACOCENTESIS (Tension Pneumothorax)"))
needle_dc = [
"IDENTIFY: Absent breath sounds + tracheal deviation + hypotension + distended neck veins + tension PTX",
"DO NOT WAIT FOR CXR — this is a CLINICAL DIAGNOSIS; IMMEDIATE decompression required",
"POSITION: Supine, head of bed flat or 30° elevated",
"LANDMARK: 2nd Intercostal Space (ICS), Midclavicular Line (MCL) — or 4th/5th ICS, Anterior Axillary Line (AAL)",
"PREP: Wipe skin with alcohol swab (no time for full sterile prep in emergency)",
"INSERT: 14-16G angiocath; insert just above upper border of 3rd rib (avoids intercostal vessels at lower rib border); hiss of air confirms tension PTX",
"FOLLOW UP: Immediate chest drain (ICC/intercostal catheter) after needle decompression",
"COMPLICATIONS: Injury to lung/vessels, failure (kinking of catheter) — clinical improvement (BP, SpO2) should be immediate",
]
story.append(steps_table(needle_dc))
story.append(Spacer(1, 0.3*cm))
story.append(sub_header("D. CHEST DRAIN / INTERCOSTAL CATHETER (ICC) INSERTION"))
icc_steps = [
"INDICATIONS: Pneumothorax (>20%), hemothorax, pleural effusion (drainage/empyema), post-op drainage",
"POSITION: Supine or semi-recumbent; arm above head to expose axilla; landmark = Triangle of Safety (anterior axillary line, lateral border of pec major, 5th ICS)",
"PREP: Full sterile technique; Local anesthesia — Lidocaine 1% 5-10mL infiltrate skin → rib periosteum → pleura (feel for give)",
"INCISION: 2-3 cm horizontal incision in 5th ICS, mid-axillary line",
"DISSECT: Curved forceps through intercostals — just above upper border of 6th rib; push through pleura with controlled pop",
"FINGER SWEEP: Insert finger to confirm pleural space (feel for lung) and break any loculations",
"INSERT DRAIN: Guide drain posterosuperiorly for pneumothorax; inferoposteriorly for effusion/hemothorax. Advance 10-15 cm; all holes must be inside chest",
"CONNECT: To underwater seal drain; no suction initially (observe swing/bubbling); clamp if needed for transport",
"SUTURE & SECURE: Mattress suture at skin; horizontal mattress for closure when removed; tape drain securely",
"CONFIRM: CXR; listen for breath sounds; drain swinging with respiration confirms correct placement",
]
story.append(steps_table(icc_steps))
story.append(PageBreak())
story.append(sub_header("E. NASOGASTRIC TUBE (NGT) INSERTION"))
ngt_steps = [
"INDICATIONS: Gastric decompression, enteral feeding, medication delivery, gastric lavage",
"CONTRAINDICATIONS: Basal skull fracture (use orogastric instead), nasal obstruction, esophageal varices (relative)",
"MEASURE: Nose-earlobe-xiphisternum = approximate insertion length (typically 55-65 cm)",
"POSITION: Sitting upright (or left lateral if intubated)",
"LUBRICATE tube tip with water-soluble gel; insert through nostril aiming toward ear (not upward); if resistance, try other nostril",
"ADVANCE: As patient swallows (sip of water if alert); advance smoothly to marked length",
"CONFIRM POSITION (mandatory before use): Aspirate gastric contents (pH <5.5) + CXR (gold standard). Do NOT rely on auscultation alone (air bubble) — proven unreliable and dangerous",
"SECURE: Tape to nose; mark insertion length at nostril; document",
]
story.append(steps_table(ngt_steps))
story.append(Spacer(1, 0.3*cm))
story.append(sub_header("F. CARDIOVERSION / DEFIBRILLATION"))
cardio_steps = [
"SYNCHRONIZED CARDIOVERSION (for unstable SVT/AF/VT with pulse): Ensure sync mode ON (synchronizes with R wave); Energy: AF 120-200J biphasic; SVT 50-100J; VT with pulse 100J. Sedate (midazolam 2-5mg + fentanyl) if not emergency.",
"DEFIBRILLATION (for pulseless VF/VT): ASYNC mode. Energy: 200J biphasic (1st shock); use same or higher if unsuccessful. Pads placement: right infraclavicular (APEX) + left lateral chest (V4-6 level).",
"Ensure no one touching patient — 'Stand clear!'",
"Post cardioversion: reassess rhythm, 12-lead ECG, treat underlying cause, anticoagulate if AF >48h",
"ENERGY GUIDE: AF 120-200J | SVT 50-100J | VT (pulse) 100-200J | VF/pVT 200J biphasic",
]
story.append(steps_table(cardio_steps))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 14: QUICK DRUG REFERENCE
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header("14. QUICK ICU DRUG DOSAGE REFERENCE TABLE"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>EMERGENCY DRUGS</b>", h3))
emg_drugs = [
["Drug", "Indication", "Adult Dose", "Route"],
["Epinephrine (Adrenaline)", "Cardiac arrest", "1 mg every 3-5 min", "IV/IO"],
["Epinephrine", "Anaphylaxis", "0.3-0.5 mg (0.3-0.5mL of 1:1000)", "IM thigh"],
["Atropine", "Symptomatic bradycardia", "0.5 mg IV; repeat q3-5min; max 3mg", "IV"],
["Adenosine", "SVT", "6 mg rapid IV push; 2nd: 12 mg; 3rd: 12 mg", "IV (fast push + flush)"],
["Amiodarone", "VF/pVT", "300 mg IV bolus; 2nd: 150 mg", "IV"],
["Amiodarone", "Stable VT/AF", "150 mg over 10 min, then 1 mg/min x6h, then 0.5 mg/min", "IV infusion"],
["Lidocaine", "VF/pVT (alt to amiodarone)", "1-1.5 mg/kg IV, then 0.5-0.75 mg/kg q5-10min (max 3 mg/kg)", "IV"],
["Magnesium Sulfate", "Torsades de Pointes", "1-2 g IV over 5-20 min", "IV"],
["Sodium Bicarbonate", "Severe acidosis pH<6.9/hyperK", "1 mEq/kg IV", "IV"],
["Calcium Gluconate", "Hyperkalemia (cardiac stabilization)", "1-2g (10-20 mL of 10%) over 5 min", "IV"],
["Calcium Chloride", "Hypocalcemia/hyperK", "500-1000 mg (5-10 mL of 10%) over 5-10 min", "Central IV only"],
["Glucose 50%", "Hypoglycemia", "50 mL IV (25g); recheck BG in 15 min", "IV"],
["Naloxone", "Opioid overdose", "0.4-2 mg IV/IM q2-3min; max 10 mg", "IV/IM/IN"],
["Flumazenil", "Benzodiazepine reversal", "0.2 mg IV over 15 sec; repeat 0.1 mg q1min; max 1 mg", "IV"],
["Sugammadex", "Rocuronium/vecuronium reversal", "Deep block: 16 mg/kg; Moderate: 4 mg/kg; Routine: 2 mg/kg", "IV"],
["Protamine Sulfate", "Heparin reversal", "1 mg per 100 units heparin given in last 2-3h; max 50 mg", "IV slow"],
]
story.append(drug_table(emg_drugs, [5*cm, 4.5*cm, 5*cm, 2*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>ELECTROLYTE REPLACEMENT IN ICU</b>", h3))
lyte_data = [
["Electrolyte", "Target", "Replacement Protocol"],
["Potassium (K+)", "3.5-5.0 mEq/L\n(cardiac: >4.0)", "K<3.0: 40 mEq in 500 mL NS over 4h (rate ≤10 mEq/hr peripheral; ≤20 mEq/hr central)\nK 3.0-3.5: 20 mEq in 100 mL over 2h"],
["Magnesium (Mg2+)", ">0.8 mmol/L\n(cardiac: >1.0)", "Mg<0.5: 4-8g MgSO4 over 4-8h\nMg 0.5-0.8: 2g MgSO4 over 2h"],
["Phosphate (PO4)", ">0.8 mmol/L", "Moderate (0.5-0.8): Sodium phosphate 15 mmol over 4h\nSevere (<0.5): 30 mmol over 6h"],
["Sodium (Na+)", "135-145 mEq/L", "Hyponatremia: Correct no faster than 8-10 mEq/L in 24h (ODS risk)\nHypernatremia: Free water replacement; correct ≤8-12 mEq/L per 24h"],
["Calcium (Ca2+)", "2.1-2.6 mmol/L\n(ionized 1.15-1.30)", "Symptomatic/severe: Calcium gluconate 1-2g IV over 10 min\nMaintenance: 1g CaCO3 TDS PO"],
]
story.append(drug_table(lyte_data, [3.5*cm, 3*cm, 10*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>DVT PROPHYLAXIS IN ICU/POST-OP</b>", h3))
dvt_data = [
["Method", "Drug/Protocol", "Notes"],
["Pharmacological (1st line)", "Enoxaparin 40 mg SC OD (if CrCl >30)\nEnoxaparin 20 mg SC OD (if CrCl 10-30)\nUFH 5000 units SC q8-12h (if CrCl <10)", "Start once hemostasis achieved (usually 24-48h post-op)"],
["Mechanical", "Graduated compression stockings (TED stockings) + Intermittent Pneumatic Compression (IPC)", "Use when pharmacological anticoagulation contraindicated"],
["High-risk surgery (orthopedic)", "Enoxaparin 40 mg SC OD or Rivaroxaban 10 mg OD x35 days (hip), x14 days (knee)", "Continue after discharge in orthopedic patients"],
]
story.append(drug_table(dvt_data, [4*cm, 7*cm, 5.5*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(alert_box("GLYCEMIC CONTROL IN ICU: Target BGL 140-180 mg/dL. Use insulin infusion protocol for tight glycemic control. Avoid hypoglycemia (<70 mg/dL) — worse outcomes than hyperglycemia."))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("<b>STRESS ULCER PROPHYLAXIS</b>", bold_body))
story.append(Paragraph("Indications: Mechanical ventilation >48h, coagulopathy, burns >35% BSA, TBI, spinal cord injury, high-dose steroids", body))
story.append(Paragraph("Drug: Pantoprazole 40 mg IV/PO OD (PPI) OR Ranitidine 50 mg IV q8h (H2 blocker — less effective). Prefer PPI in high-risk patients.", body))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("<b>NUTRITION IN ICU</b>", bold_body))
for n in [
"Start ENTERAL NUTRITION within 24-48h (if tolerating, hemodynamically stable)",
"Target: 25-30 kcal/kg/day; Protein 1.2-2 g/kg/day",
"Route: NGT (1st line) → Post-pyloric if high gastric residual → Parenteral if gut non-functional",
"Avoid gastric residual >500 mL — suggests poor tolerance; consider prokinetic (metoclopramide 10 mg IV TDS)",
]:
story.append(Paragraph(f"• {n}", bullet))
story.append(Spacer(1, 0.4*cm))
# Footer
footer_tbl = Table([[Paragraph("ICU Emergency Guide | Compiled from Harrison's 22E, Miller's Anesthesia 10E, Tintinalli's EM, Goldman-Cecil, Washington Manual | For Educational Purposes",
ParagraphStyle('Footer', parent=styles['Normal'], fontSize=7.5,
textColor=GREY, fontName='Helvetica-Oblique', alignment=TA_CENTER))]],
colWidths=[doc.width],
style=TableStyle([
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LINEABOVE', (0,0), (-1,-1), 0.5, GREY),
]))
story.append(footer_tbl)
doc.build(story)
print("PDF generated successfully!")
cd /tmp/workspace/icu-emergency && python generate_icu_pdf.py 2>&1
ls -lh /tmp/workspace/icu-emergency/ICU_Emergency_Guide.pdf
ICU Emergency Guide
PDF Document · PDF