Septic shock and septcemia
"septic shock" AND "management"
| Criterion | Threshold |
|---|---|
| Temperature | >38°C or <36°C |
| Heart rate | >90 bpm |
| Respiratory rate | >20/min or PaCO2 <32 mmHg |
| WBC | >12,000/mm³, <4,000/mm³, or >10% bands |
| Tool | Components | Threshold for Sepsis |
|---|---|---|
| SOFA | Respiratory (PaO2/FiO2), Coagulation, Liver, Cardiovascular, CNS, Renal | ≥2 point increase |
| qSOFA | Tachypnea + Altered mentation + Hypotension (SBP <100) | ≥2 of 3 criteria |
| NEWS/MEWS | Vital signs composite | Used as screening tools |
Create a septic shock management protocol flowchart
ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"
mkdir -p /home/daytona/workspace/septic-shock && python3 -c "import matplotlib; print(matplotlib.__version__)"
~/septic-shock/flowchart.py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.patches import FancyBboxPatch, FancyArrowPatch
fig, ax = plt.subplots(figsize=(18, 28))
ax.set_xlim(0, 18)
ax.set_ylim(0, 28)
ax.axis('off')
fig.patch.set_facecolor('#F0F4F8')
# ── Color palette ──────────────────────────────────────────────────
C_TITLE = '#1A237E' # deep navy
C_TRIGGER = '#B71C1C' # dark red – danger/alert
C_STEP = '#0D47A1' # dark blue – action boxes
C_BRANCH = '#E65100' # orange – decision diamonds
C_SUBBOX = '#1565C0' # medium blue – sub-actions
C_PASS = '#1B5E20' # dark green – pass / yes
C_FAIL = '#C62828' # red – fail / no
C_SUPPORT = '#4A148C' # purple – supportive care
C_WHITE = '#FFFFFF'
C_LTBLUE = '#E3F2FD'
C_LTRED = '#FFEBEE'
C_LTGREEN = '#E8F5E9'
C_LTPURP = '#F3E5F5'
C_LTORANGE= '#FFF3E0'
ARROW_C = '#37474F'
# ── Helper functions ───────────────────────────────────────────────
def fancy_box(ax, x, y, w, h, text, facecolor, edgecolor, fontsize=9.5,
textcolor='white', bold=False, style='round,pad=0.1', alpha=1.0):
box = FancyBboxPatch((x - w/2, y - h/2), w, h,
boxstyle=style, linewidth=1.8,
edgecolor=edgecolor, facecolor=facecolor, alpha=alpha,
zorder=3)
ax.add_patch(box)
weight = 'bold' if bold else 'normal'
ax.text(x, y, text, ha='center', va='center', fontsize=fontsize,
color=textcolor, fontweight=weight, zorder=4,
wrap=True, multialignment='center',
linespacing=1.4)
def diamond(ax, x, y, w, h, text, facecolor, edgecolor, fontsize=9, textcolor='white'):
dx, dy = w/2, h/2
pts = [(x, y+dy), (x+dx, y), (x, y-dy), (x-dx, y)]
diamond_patch = plt.Polygon(pts, closed=True, facecolor=facecolor,
edgecolor=edgecolor, linewidth=1.8, zorder=3)
ax.add_patch(diamond_patch)
ax.text(x, y, text, ha='center', va='center', fontsize=fontsize,
color=textcolor, fontweight='bold', zorder=4, multialignment='center',
linespacing=1.35)
def arrow(ax, x1, y1, x2, y2, color=ARROW_C, label='', lside='right'):
ax.annotate('', xy=(x2, y2), xytext=(x1, y1),
arrowprops=dict(arrowstyle='->', color=color,
lw=1.8, connectionstyle='arc3,rad=0.0'),
zorder=5)
if label:
mx = (x1+x2)/2
my = (y1+y2)/2
offset = 0.25 if lside=='right' else -0.25
ax.text(mx+offset, my, label, ha='center', va='center', fontsize=8,
color=color, fontweight='bold', zorder=6)
def side_arrow(ax, x1, y1, x2, y2, color=ARROW_C, label='', above=True):
ax.annotate('', xy=(x2, y2), xytext=(x1, y1),
arrowprops=dict(arrowstyle='->', color=color, lw=1.8),
zorder=5)
if label:
mx = (x1+x2)/2
my = (y1+y2)/2 + (0.2 if above else -0.2)
ax.text(mx, my, label, ha='center', va='center', fontsize=8,
color=color, fontweight='bold', zorder=6)
# ══════════════════════════════════════════════════════════════════
# TITLE
# ══════════════════════════════════════════════════════════════════
title_box = FancyBboxPatch((0.5, 26.8), 17, 1.0,
boxstyle='round,pad=0.15', linewidth=2.5,
edgecolor=C_TITLE, facecolor=C_TITLE, zorder=3)
ax.add_patch(title_box)
ax.text(9, 27.35, 'SEPTIC SHOCK MANAGEMENT PROTOCOL', ha='center', va='center',
fontsize=16, color='white', fontweight='bold', zorder=4)
ax.text(9, 27.05, 'Based on Surviving Sepsis Campaign 2021 Guidelines', ha='center', va='center',
fontsize=9.5, color='#BBDEFB', zorder=4, style='italic')
# ══════════════════════════════════════════════════════════════════
# BLOCK 1 — RECOGNITION
# ══════════════════════════════════════════════════════════════════
fancy_box(ax, 9, 25.9, 16, 0.75,
'RECOGNITION: Suspected infection + signs of organ dysfunction',
C_TRIGGER, C_TRIGGER, fontsize=10, bold=True)
arrow(ax, 9, 25.52, 9, 25.1)
# qSOFA diamond
diamond(ax, 9, 24.6, 6.5, 0.9,
'qSOFA ≥ 2 ?\n(Altered mentation, RR >22, SBP <100)',
C_BRANCH, '#BF360C', fontsize=8.5)
# YES → calculate SOFA
arrow(ax, 9, 24.15, 9, 23.7, label='YES ↓')
fancy_box(ax, 9, 23.35, 12, 0.62,
'Calculate full SOFA score — Sepsis if SOFA increase ≥ 2 from baseline',
C_STEP, C_STEP, fontsize=9)
arrow(ax, 9, 23.04, 9, 22.6)
# Septic Shock criteria box
fancy_box(ax, 9, 22.25, 14, 0.62,
'SEPTIC SHOCK = Sepsis + vasopressors required to maintain MAP ≥65 mmHg + Lactate >2 mmol/L',
C_TRIGGER, C_TRIGGER, fontsize=9, bold=True)
# ══════════════════════════════════════════════════════════════════
# BLOCK 2 — IMMEDIATE ACTIONS (Hour 1 Bundle)
# ══════════════════════════════════════════════════════════════════
arrow(ax, 9, 21.94, 9, 21.55)
fancy_box(ax, 9, 21.2, 16.5, 0.62,
'⏱ HOUR-1 BUNDLE — Initiate ALL simultaneously',
'#004D40', '#004D40', fontsize=10.5, bold=True)
# 5 sub-boxes side by side
bundle_items = [
('1. Measure\nLactate', 1.8, 20.45),
('2. Blood Cultures\n× 2 sets', 4.8, 20.45),
('3. Broad-spectrum\nAntibiotics STAT', 7.9, 20.45),
('4. IV Crystalloid\n30 mL/kg ≥1 h', 11.1, 20.45),
('5. Vasopressors if\nMAP <65 mmHg', 14.3, 20.45),
]
for txt, xp, yp in bundle_items:
fancy_box(ax, xp, yp, 3.0, 0.78, txt,
C_LTBLUE, C_STEP, fontsize=8.5, textcolor='#0D47A1')
arrow(ax, 9, 20.06, 9, 19.6)
# ══════════════════════════════════════════════════════════════════
# BLOCK 3 — FLUID RESUSCITATION
# ══════════════════════════════════════════════════════════════════
fancy_box(ax, 9, 19.25, 16.5, 0.62,
'FLUID RESUSCITATION — Balanced crystalloid (Lactated Ringer preferred over 0.9% NaCl)',
C_STEP, C_STEP, fontsize=9.5, bold=True)
arrow(ax, 9, 18.94, 9, 18.5)
diamond(ax, 9, 18.0, 6.5, 0.88,
'MAP ≥65 mmHg after\n30 mL/kg crystalloid?',
C_BRANCH, '#BF360C', fontsize=8.5)
# YES → monitor
arrow(ax, 12.25, 18.0, 15.5, 18.0, color=C_PASS, label='YES →')
fancy_box(ax, 16.2, 18.0, 2.6, 0.62,
'Continue\nmonitoring',
C_LTGREEN, C_PASS, fontsize=8, textcolor='#1B5E20')
# NO → vasopressors
arrow(ax, 9, 17.56, 9, 17.1, label='NO ↓', color=C_FAIL)
# ══════════════════════════════════════════════════════════════════
# BLOCK 4 — VASOPRESSOR THERAPY
# ══════════════════════════════════════════════════════════════════
fancy_box(ax, 9, 16.75, 16.5, 0.62,
'VASOPRESSOR THERAPY — Target MAP ≥65 mmHg',
C_STEP, C_STEP, fontsize=9.5, bold=True)
vaso_items = [
('1st Line\nNorepinephrine\n1–50 μg/min', 3.8, 16.0),
('2nd Line: add\nVasopressin\n≤0.03 U/min', 9.0, 16.0),
('Refractory:\nEpinephrine\nor Ang II', 14.2, 16.0),
]
for txt, xp, yp in vaso_items:
fancy_box(ax, xp, yp, 4.8, 0.72, txt,
C_LTRED, C_FAIL, fontsize=8.5, textcolor='#B71C1C')
arrow(ax, 9, 15.64, 9, 15.2)
# Low CI / septic cardiomyopathy
diamond(ax, 9, 14.72, 7.5, 0.88,
'Low cardiac index? (↓ScvO₂ with CVP >12)',
C_BRANCH, '#BF360C', fontsize=8.5)
arrow(ax, 12.75, 14.72, 15.5, 14.72, color=C_PASS, label='YES →')
fancy_box(ax, 16.2, 14.72, 2.6, 0.62,
'Add Dobutamine\n2–20 μg/kg/min',
C_LTRED, C_FAIL, fontsize=8, textcolor='#B71C1C')
arrow(ax, 9, 14.28, 9, 13.8, label='NO ↓')
# ══════════════════════════════════════════════════════════════════
# BLOCK 5 — ANTIMICROBIAL THERAPY
# ══════════════════════════════════════════════════════════════════
fancy_box(ax, 9, 13.45, 16.5, 0.62,
'ANTIMICROBIAL THERAPY — Start within 1 hour (after blood cultures if feasible)',
C_STEP, C_STEP, fontsize=9.5, bold=True)
abx_items = [
('Empirical broad-\nspectrum IV Abx\nbased on source', 3.8, 12.7),
('De-escalate guided\nby culture &\nPCT trend', 9.0, 12.7),
('Duration guided\nby PCT + clinical\nresponse', 14.2, 12.7),
]
for txt, xp, yp in abx_items:
fancy_box(ax, xp, yp, 4.8, 0.75, txt,
'#FFF9C4', '#F57F17', fontsize=8.5, textcolor='#4E342E')
# Source control
fancy_box(ax, 9, 11.98, 12, 0.58,
'⚠ Source Control — drain abscess / debride necrosis as soon as possible',
'#FF8F00', '#E65100', fontsize=9, bold=False, textcolor='white')
arrow(ax, 9, 13.14, 9, 12.27)
arrow(ax, 9, 11.69, 9, 11.2)
# ══════════════════════════════════════════════════════════════════
# BLOCK 6 — LACTATE MONITORING
# ══════════════════════════════════════════════════════════════════
fancy_box(ax, 9, 10.85, 16.5, 0.62,
'LACTATE MONITORING — Remeasure at 2 h; target normalization (<2 mmol/L)',
C_STEP, C_STEP, fontsize=9.5, bold=True)
arrow(ax, 9, 10.54, 9, 10.1)
diamond(ax, 9, 9.62, 6.5, 0.88,
'Lactate clearance\n≥10% at 2 hours?',
C_BRANCH, '#BF360C', fontsize=8.5)
arrow(ax, 12.25, 9.62, 15.5, 9.62, color=C_PASS, label='YES →')
fancy_box(ax, 16.2, 9.62, 2.6, 0.62,
'Continue\nresuscitation\ngoals',
C_LTGREEN, C_PASS, fontsize=8, textcolor='#1B5E20')
arrow(ax, 9, 9.18, 9, 8.72, label='NO ↓', color=C_FAIL)
fancy_box(ax, 9, 8.38, 10, 0.58,
'Re-assess fluid status, vasopressor dose, cardiac function (echo)',
C_LTRED, C_FAIL, fontsize=9, textcolor='#B71C1C')
arrow(ax, 9, 8.09, 9, 7.6)
# ══════════════════════════════════════════════════════════════════
# BLOCK 7 — CORTICOSTEROIDS
# ══════════════════════════════════════════════════════════════════
diamond(ax, 9, 7.12, 8.0, 0.9,
'Refractory shock despite\nfluids + vasopressors?',
C_BRANCH, '#BF360C', fontsize=8.5)
arrow(ax, 13.0, 7.12, 15.5, 7.12, color=C_PASS, label='YES →')
fancy_box(ax, 16.2, 7.12, 2.6, 0.75,
'Hydrocortisone\n200 mg/day IV\n± Fludrocortisone\n50 μg/day × 7d',
C_LTRED, C_FAIL, fontsize=7.5, textcolor='#B71C1C')
arrow(ax, 9, 6.67, 9, 6.2, label='NO ↓')
# ══════════════════════════════════════════════════════════════════
# BLOCK 8 — SUPPORTIVE CARE
# ══════════════════════════════════════════════════════════════════
fancy_box(ax, 9, 5.85, 16.5, 0.62,
'SUPPORTIVE CARE & ONGOING MONITORING',
C_SUPPORT, C_SUPPORT, fontsize=10, bold=True)
support_items = [
('Mechanical\nVentilation\nLPV 6 mL/kg IBW', 2.4, 5.1),
('Glucose Control\n140–180 mg/dL\n(avoid hypoglycemia)', 6.2, 5.1),
('Transfusion\nHb threshold\n7 g/dL', 9.9, 5.1),
('AKI: Renal\nReplacement\nTherapy PRN', 13.7, 5.1),
('DVT / Stress\nUlcer\nProphylaxis', 16.6, 5.1),
]
for txt, xp, yp in support_items:
fancy_box(ax, xp, yp, 3.3, 0.78, txt,
C_LTPURP, C_SUPPORT, fontsize=8, textcolor='#4A148C')
arrow(ax, 9, 4.71, 9, 4.2)
# ══════════════════════════════════════════════════════════════════
# BLOCK 9 — REASSESS TARGETS
# ══════════════════════════════════════════════════════════════════
fancy_box(ax, 9, 3.85, 16.5, 0.62,
'REASSESS EVERY 1–2 h: MAP ≥65 mmHg | UO ≥0.5 mL/kg/h | Lactate normalizing | ScvO₂ ≥70%',
C_STEP, C_STEP, fontsize=9.5, bold=True)
arrow(ax, 9, 3.54, 9, 3.1)
# ══════════════════════════════════════════════════════════════════
# BLOCK 10 — OUTCOME
# ══════════════════════════════════════════════════════════════════
fancy_box(ax, 9, 2.75, 14, 0.62,
'ICU ADMISSION — Multidisciplinary care, daily sedation interruption, weaning protocols',
'#00695C', '#004D40', fontsize=9.5, bold=True)
# ══════════════════════════════════════════════════════════════════
# LEGEND
# ══════════════════════════════════════════════════════════════════
legend_patches = [
mpatches.Patch(facecolor=C_TRIGGER, edgecolor='grey', label='Critical criteria / Alert'),
mpatches.Patch(facecolor=C_STEP, edgecolor='grey', label='Action / Intervention'),
mpatches.Patch(facecolor=C_BRANCH, edgecolor='grey', label='Decision point'),
mpatches.Patch(facecolor=C_SUPPORT, edgecolor='grey', label='Supportive care'),
mpatches.Patch(facecolor='#FF8F00', edgecolor='grey', label='Source control warning'),
]
ax.legend(handles=legend_patches, loc='lower left', bbox_to_anchor=(0.01, 0.0),
fontsize=8.5, framealpha=0.92, edgecolor='grey',
title='Legend', title_fontsize=9)
# Footnote
ax.text(9, 0.35, 'Based on Surviving Sepsis Campaign International Guidelines 2021 | '
'Goldman-Cecil Medicine | Washington Manual of Medical Therapeutics | Rosen\'s Emergency Medicine',
ha='center', va='center', fontsize=7.5, color='#546E7A', style='italic', zorder=4)
plt.tight_layout(pad=0.5)
plt.savefig('/home/daytona/workspace/septic-shock/septic_shock_flowchart.png',
dpi=180, bbox_inches='tight', facecolor='#F0F4F8')
plt.close()
print("Saved successfully.")
cd /home/daytona/workspace/septic-shock && python3 flowchart.py 2>&1
~/septic-shock/flowchart.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/septic-shock/flowchart.py'
~/septic-shock/flowchart.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/septic-shock/flowchart.py'
cd /home/daytona/workspace/septic-shock && python3 flowchart.py 2>&1 && ls -lh septic_shock_flowchart.png
septic shock flowchart
Image · PNG
| Block | Content |
|---|---|
| 1 | Recognition - qSOFA screening + SOFA criteria + Septic shock definition |
| 2 | Hour-1 Bundle - all 5 actions in parallel |
| 3 | Fluid resuscitation - balanced crystalloid 30 mL/kg |
| 4 | Vasopressor ladder - Norepinephrine → Vasopressin → Epinephrine/Ang II + Dobutamine branch |
| 5 | Antimicrobial therapy + source control alert |
| 6 | Lactate monitoring - clearance decision point |
| 7 | Corticosteroids - hydrocortisone ± fludrocortisone for refractory shock |
| 8 | Supportive care - ventilation, glucose, transfusion, renal, DVT/stress ulcer prophylaxis |
| 9 | Reassessment targets every 1-2 hours |
| 10 | ICU admission pathway |