Meropenem
meropenem carbapenem
| Category | Coverage |
|---|---|
| Gram-positive | Streptococci, S. pneumoniae (including penicillin-resistant), Staphylococci (not MRSA), Listeria; less active than imipenem against Enterococcus |
| Gram-negative aerobes | Enterobacterales (E. coli, Klebsiella, Enterobacter, Proteus, Serratia), Pseudomonas aeruginosa, Acinetobacter spp. - more active than imipenem |
| Anaerobes | Bacteroides fragilis and other anaerobes - highly susceptible |
| Not covered | MRSA, Enterococcus faecium, Clostridioides difficile, Burkholderia cepacia, Stenotrophomonas maltophilia, carbapenemase-producing organisms |
| Indication | Dose |
|---|---|
| Standard (normal renal function) | 1-2 g IV every 8 hours |
| Mild-moderate infections | 0.5-1 g IV q8h |
| Meningitis / severe infections | 2 g IV q8h |
| Meropenem/vaborbactam | 2 g meropenem + 2 g vaborbactam IV q8h (3-hour infusion) |
| Feature | Meropenem | Imipenem | Ertapenem |
|---|---|---|---|
| Cilastatin needed | No | Yes | No |
| Gram-positive activity | + | ++ | + |
| Gram-negative activity | ++ | + | + |
| Pseudomonas coverage | Yes | Yes | No |
| Acinetobacter coverage | Yes | Yes | No |
| CNS use (meningitis) | Preferred | Avoid (seizures) | No (no CNS penetration) |
| Dosing | q8h | q6-8h | Once daily |
| t1/2 | ~1 h | ~1 h | ~4 h |
How do I remember so much info easily?
| Strategy | Application |
|---|---|
| Anki decks | Pre-made medical decks (Zanki, AnKing) cover pharmacology extensively |
| Sketchy / Picmonic | Visual story-based mnemonics for drugs and micro |
| First Aid framework | Standardized skeleton for every drug class |
| Clinical context | Attaching a drug to a real or imagined patient makes it memorable |
Gimme a quiz for meropenem for active recall
I’m not able to generate pdf from here, why?
Both
ls /home/daytona/workspace/ 2>/dev/null || mkdir -p /home/daytona/workspace/meropenem
mkdir -p /home/daytona/workspace/meropenem
~/meropenem/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
import os
OUTPUT = "/home/daytona/workspace/meropenem/Meropenem_Notes_and_Quiz.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=2*cm,
leftMargin=2*cm,
topMargin=2.2*cm,
bottomMargin=2*cm,
title="Meropenem - Full Notes & Active Recall Quiz",
author="Orris Medical"
)
styles = getSampleStyleSheet()
# Custom styles
title_style = ParagraphStyle(
"CustomTitle",
parent=styles["Title"],
fontSize=22,
textColor=colors.HexColor("#1a3a5c"),
spaceAfter=6,
alignment=TA_CENTER,
fontName="Helvetica-Bold"
)
subtitle_style = ParagraphStyle(
"Subtitle",
parent=styles["Normal"],
fontSize=11,
textColor=colors.HexColor("#4a7aab"),
spaceAfter=16,
alignment=TA_CENTER,
fontName="Helvetica"
)
h1_style = ParagraphStyle(
"H1",
parent=styles["Heading1"],
fontSize=14,
textColor=colors.white,
backColor=colors.HexColor("#1a3a5c"),
spaceBefore=14,
spaceAfter=6,
leftIndent=-0.3*cm,
rightIndent=-0.3*cm,
borderPad=5,
fontName="Helvetica-Bold"
)
h2_style = ParagraphStyle(
"H2",
parent=styles["Heading2"],
fontSize=12,
textColor=colors.HexColor("#1a3a5c"),
spaceBefore=10,
spaceAfter=4,
fontName="Helvetica-Bold",
borderPad=2
)
body_style = ParagraphStyle(
"Body",
parent=styles["Normal"],
fontSize=10,
leading=15,
spaceAfter=6,
fontName="Helvetica",
alignment=TA_JUSTIFY
)
bullet_style = ParagraphStyle(
"Bullet",
parent=styles["Normal"],
fontSize=10,
leading=14,
spaceAfter=3,
leftIndent=16,
bulletIndent=4,
fontName="Helvetica"
)
bold_bullet_style = ParagraphStyle(
"BoldBullet",
parent=bullet_style,
fontName="Helvetica-Bold"
)
note_style = ParagraphStyle(
"Note",
parent=styles["Normal"],
fontSize=9,
leading=13,
textColor=colors.HexColor("#555555"),
fontName="Helvetica-Oblique",
leftIndent=8,
spaceAfter=4
)
quiz_q_style = ParagraphStyle(
"QuizQ",
parent=styles["Normal"],
fontSize=11,
leading=15,
fontName="Helvetica-Bold",
textColor=colors.HexColor("#1a3a5c"),
spaceBefore=10,
spaceAfter=4
)
quiz_a_style = ParagraphStyle(
"QuizA",
parent=styles["Normal"],
fontSize=10,
leading=14,
fontName="Helvetica",
textColor=colors.HexColor("#1d5c1d"),
leftIndent=12,
spaceAfter=4,
backColor=colors.HexColor("#f0f8f0"),
borderPad=4
)
answer_label_style = ParagraphStyle(
"AnswerLabel",
parent=styles["Normal"],
fontSize=9,
fontName="Helvetica-Bold",
textColor=colors.HexColor("#888888"),
leftIndent=12,
spaceBefore=2,
spaceAfter=1
)
def section_header(text):
return [
Paragraph(f" {text}", h1_style),
Spacer(1, 4)
]
def sub_header(text):
return Paragraph(text, h2_style)
def body(text):
return Paragraph(text, body_style)
def bullet(text):
return Paragraph(f"• {text}", bullet_style)
def spacer(h=6):
return Spacer(1, h)
def hr():
return HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#cccccc"), spaceAfter=6, spaceBefore=6)
# ─── Build content ────────────────────────────────────────────────────────────
story = []
# Cover header
story.append(spacer(10))
story.append(Paragraph("MEROPENEM", title_style))
story.append(Paragraph("Complete Study Notes & Active Recall Quiz", subtitle_style))
story.append(HRFlowable(width="80%", thickness=2, color=colors.HexColor("#1a3a5c"), spaceAfter=18, hAlign="CENTER"))
# ══════════════════════════════════════════════════
# SECTION 1: DRUG CLASS & STRUCTURE
# ══════════════════════════════════════════════════
story += section_header("1. Drug Class & Structure")
story.append(body(
"Meropenem is a <b>carbapenem beta-lactam antibiotic</b> - a derivative of thienamycin. "
"Carbapenems contain a fused beta-lactam ring with a five-membered ring system that is <b>unsaturated</b> "
"and has a <b>carbon atom</b> (instead of sulfur as in penicillins). This structural difference confers "
"greater resistance to beta-lactamase hydrolysis compared to other beta-lactams."
))
story.append(body(
"Unlike imipenem, meropenem does <b>NOT</b> require co-administration with cilastatin because it is "
"<b>not susceptible to renal dehydropeptidase</b> degradation."
))
# ══════════════════════════════════════════════════
# SECTION 2: MECHANISM OF ACTION
# ══════════════════════════════════════════════════
story += section_header("2. Mechanism of Action")
story.append(bullet("Binds <b>Penicillin-Binding Proteins (PBPs)</b> on the bacterial cell membrane"))
story.append(bullet("Inhibits <b>transpeptidation</b> - disrupts cross-linking of peptidoglycan in the cell wall"))
story.append(bullet("Leads to <b>cell lysis and bacterial death</b>"))
story.append(bullet("Highly resistant to hydrolysis by most beta-lactamases (serine, ESBL), but IS degraded by carbapenemases (KPC, NDM, OXA)"))
# ══════════════════════════════════════════════════
# SECTION 3: SPECTRUM OF ACTIVITY
# ══════════════════════════════════════════════════
story += section_header("3. Spectrum of Activity")
spectrum_data = [
["Category", "Coverage"],
["Gram-positive", "Streptococci, S. pneumoniae (incl. pen-resistant), Staphylococci (NOT MRSA), Listeria\n— less active than imipenem vs. Enterococcus"],
["Gram-negative aerobes", "Enterobacterales (E. coli, Klebsiella, Enterobacter, Proteus, Serratia),\nPseudomonas aeruginosa, Acinetobacter spp.\n— MORE active than imipenem"],
["Anaerobes", "Bacteroides fragilis and other anaerobes — highly susceptible"],
["NOT covered", "MRSA, E. faecium, C. difficile, Burkholderia cepacia,\nStenotrophomonas maltophilia, carbapenemase-producing organisms"],
]
t = Table(spectrum_data, colWidths=[4.5*cm, 12*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("BACKGROUND", (0,1), (-1,1), colors.HexColor("#e8f0f8")),
("BACKGROUND", (0,2), (-1,2), colors.white),
("BACKGROUND", (0,3), (-1,3), colors.HexColor("#e8f0f8")),
("BACKGROUND", (0,4), (-1,4), colors.HexColor("#fce8e8")),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#aaaaaa")),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("PADDING", (0,0), (-1,-1), 6),
("ROWBACKGROUNDS", (0,0), (-1,-1), None),
]))
story.append(t)
story.append(spacer(6))
story.append(Paragraph(
"<b>Key distinction:</b> Meropenem is somewhat less active against gram-positives (especially Enterococcus) "
"but more active against gram-negatives (especially Pseudomonas) compared to imipenem.",
note_style
))
# ══════════════════════════════════════════════════
# SECTION 4: PHARMACOKINETICS
# ══════════════════════════════════════════════════
story += section_header("4. Pharmacokinetics (ADME)")
story.append(bullet("<b>Administration:</b> IV only (not orally absorbed)"))
story.append(bullet("<b>Half-life:</b> ~1 hour"))
story.append(bullet("<b>Clearance:</b> Renally cleared — dose reduction required in renal insufficiency"))
story.append(bullet("<b>CSF penetration:</b> Good — suitable for meningitis (unlike ertapenem)"))
story.append(bullet("<b>Standard infusion:</b> 30 minutes IV"))
story.append(spacer(6))
story.append(sub_header("Extended Infusion Strategy"))
story.append(body(
"Infusing over <b>3 hours</b> (instead of 30 minutes) increases the time meropenem concentrations "
"spend above the organism's MIC (<b>%T>MIC</b>) — the key pharmacodynamic parameter for beta-lactams. "
"This allows treatment of pathogens with low-level resistance without increasing total dose."
))
# ══════════════════════════════════════════════════
# SECTION 5: DOSING
# ══════════════════════════════════════════════════
story += section_header("5. Dosing (Normal Renal Function)")
dose_data = [
["Indication", "Dose"],
["Standard (hospital infections)", "1-2 g IV every 8 hours"],
["Mild-moderate infections", "0.5-1 g IV q8h"],
["Meningitis / severe infections", "2 g IV q8h"],
["Meropenem/vaborbactam (MDR organisms)", "2 g meropenem + 2 g vaborbactam IV q8h\n(3-hour infusion)"],
]
t2 = Table(dose_data, colWidths=[8*cm, 8.5*cm])
t2.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9.5),
("BACKGROUND", (0,1), (-1,1), colors.HexColor("#e8f0f8")),
("BACKGROUND", (0,2), (-1,2), colors.white),
("BACKGROUND", (0,3), (-1,3), colors.HexColor("#e8f0f8")),
("BACKGROUND", (0,4), (-1,4), colors.HexColor("#fff8e8")),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#aaaaaa")),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("PADDING", (0,0), (-1,-1), 6),
]))
story.append(t2)
story.append(Paragraph("Dose must be adjusted for renal impairment (based on CrCl).", note_style))
# ══════════════════════════════════════════════════
# SECTION 6: ADVERSE EFFECTS
# ══════════════════════════════════════════════════
story += section_header("6. Adverse Effects")
story.append(bullet("<b>Nausea and vomiting</b> (1-20%) — most common"))
story.append(bullet("<b>Seizures</b> — possible but less likely than imipenem; preferred for CNS/meningitis"))
story.append(bullet(
"<b>Valproic acid interaction (CRITICAL):</b> Meropenem significantly lowers serum valproate levels "
"— DO NOT co-administer. Risk of breakthrough seizures in epileptic patients."
))
story.append(bullet(
"<b>Hypersensitivity:</b> Generally safe in penicillin-allergic patients except those with severe "
"immediate-type reactions (consider test-dose protocol)"
))
# ══════════════════════════════════════════════════
# SECTION 7: THERAPEUTIC USES
# ══════════════════════════════════════════════════
story += section_header("7. Therapeutic Uses")
story.append(body("Reserved for serious hospital-acquired infections or MDR pathogens:"))
story.append(bullet("Nosocomial pneumonia / VAP (Pseudomonas or Acinetobacter suspected)"))
story.append(bullet("Complicated intra-abdominal infections (polymicrobial)"))
story.append(bullet("UTI / pyelonephritis caused by ESBL-producers, CRE"))
story.append(bullet("<b>CNS infections / meningitis</b> — PREFERRED carbapenem (lower seizure risk than imipenem)"))
story.append(bullet("Sepsis/bacteremia in critically ill patients at risk for MDR organisms"))
story.append(bullet("Skin, soft tissue, bone and joint infections from resistant organisms"))
story.append(bullet("Febrile neutropenia in immunocompromised patients"))
story.append(bullet("<b>ESBL-producing Enterobacterales</b> — carbapenems are treatment of choice"))
# ══════════════════════════════════════════════════
# SECTION 8: MEROPENEM/VABORBACTAM
# ══════════════════════════════════════════════════
story += section_header("8. Meropenem/Vaborbactam (Vabomere)")
story.append(body(
"Vaborbactam is a <b>boronic acid beta-lactamase inhibitor</b> co-formulated with meropenem "
"to restore activity against carbapenem-resistant organisms."
))
story.append(bullet("<b>Covers:</b> KPC-producing (Class A carbapenemase) Enterobacterales"))
story.append(bullet("<b>Does NOT cover:</b> Metallo-beta-lactamase producers (NDM, VIM, IMP — Class B)"))
story.append(bullet("Reserved for MDR gram-negative infections: CRE UTI, HAP/VAP, bacteremia"))
# ══════════════════════════════════════════════════
# SECTION 9: RESISTANCE MECHANISMS
# ══════════════════════════════════════════════════
story += section_header("9. Resistance Mechanisms")
resist_data = [
["Class", "Enzyme", "Key Examples", "Notes"],
["A", "Serine carbapenemase", "KPC (Klebsiella pneumoniae carbapenemase)", "Overcome by vaborbactam, relebactam"],
["B", "Metallo-beta-lactamase", "NDM, VIM, IMP", "Zinc-dependent; NOT overcome by current BLIs"],
["D", "OXA carbapenemase", "OXA-48 (Acinetobacter)", "Often pan-resistant"],
]
t3 = Table(resist_data, colWidths=[1.5*cm, 4*cm, 6.5*cm, 4.5*cm])
t3.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("BACKGROUND", (0,1), (-1,1), colors.HexColor("#e8f0f8")),
("BACKGROUND", (0,2), (-1,2), colors.white),
("BACKGROUND", (0,3), (-1,3), colors.HexColor("#fce8e8")),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#aaaaaa")),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("PADDING", (0,0), (-1,-1), 5),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
]))
story.append(t3)
story.append(spacer(4))
story.append(bullet("Porin loss (e.g., OmpK35/36 in Klebsiella) — reduced drug entry"))
story.append(bullet("Efflux pump overexpression (e.g., MexAB-OprM in Pseudomonas)"))
# ══════════════════════════════════════════════════
# SECTION 10: CARBAPENEM COMPARISON TABLE
# ══════════════════════════════════════════════════
story += section_header("10. Carbapenem Comparison")
comp_data = [
["Feature", "Meropenem", "Imipenem", "Ertapenem"],
["Cilastatin needed", "No", "Yes", "No"],
["Gram-positive activity", "+", "++", "+"],
["Gram-negative activity", "++", "+", "+"],
["Pseudomonas coverage", "Yes", "Yes", "NO"],
["Acinetobacter coverage", "Yes", "Yes", "NO"],
["CNS / meningitis use", "PREFERRED", "Avoid (seizures)", "No (no CNS penetration)"],
["Dosing frequency", "q8h", "q6-8h", "Once daily"],
["Half-life", "~1 h", "~1 h", "~4 h"],
]
t4 = Table(comp_data, colWidths=[5*cm, 4*cm, 3.5*cm, 4*cm])
t4.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9.5),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#f5f8fc"), colors.white]),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#aaaaaa")),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ALIGN", (1,0), (-1,-1), "CENTER"),
("PADDING", (0,0), (-1,-1), 5),
# Highlight meropenem column
("BACKGROUND", (1,0), (1,-1), colors.HexColor("#dbeafe")),
("TEXTCOLOR", (1,0), (1,0), colors.white),
# Danger cells
("TEXTCOLOR", (2,6), (2,6), colors.HexColor("#cc0000")),
("TEXTCOLOR", (3,4), (3,5), colors.HexColor("#cc0000")),
("TEXTCOLOR", (3,6), (3,6), colors.HexColor("#555555")),
("TEXTCOLOR", (1,6), (1,6), colors.HexColor("#006600")),
("FONTNAME", (1,6), (1,6), "Helvetica-Bold"),
]))
story.append(t4)
# ══════════════════════════════════════════════════
# QUIZ SECTION
# ══════════════════════════════════════════════════
story.append(PageBreak())
story.append(Paragraph("ACTIVE RECALL QUIZ", title_style))
story.append(Paragraph("Cover the answers — test yourself before looking!", subtitle_style))
story.append(HRFlowable(width="80%", thickness=2, color=colors.HexColor("#1a3a5c"), spaceAfter=16, hAlign="CENTER"))
questions = [
(
"Q1. What drug class does meropenem belong to, and what is its structural difference from penicillins?",
"Carbapenem beta-lactam. The five-membered ring is unsaturated and has a carbon atom instead of sulfur (as in penicillins)."
),
(
"Q2. Why does meropenem NOT need cilastatin, while imipenem does?",
"Meropenem is not degraded by renal dehydropeptidase (renal tubular dipeptidase), so cilastatin is unnecessary. Imipenem is rapidly inactivated by this enzyme."
),
(
"Q3. Name the mechanism of action of meropenem.",
"Binds Penicillin-Binding Proteins (PBPs) → inhibits transpeptidation → disrupts peptidoglycan cross-linking → cell wall lysis and bacterial death."
),
(
"Q4. Meropenem vs. imipenem spectrum: which is more active against gram-positives? Which against gram-negatives?",
"Imipenem = more active against gram-positives (especially Enterococcus).\nMeropenem = more active against gram-negatives (especially Pseudomonas)."
),
(
"Q5. List 4 organisms that carbapenems do NOT cover (mnemonic: Mr. BECS).",
"Mr. BECS: Burkholderia cepacia, Enterococcus faecium, C. difficile, Stenotrophomonas maltophilia. Also: MRSA, carbapenemase-producing organisms."
),
(
"Q6. What is the standard dose of meropenem in a patient with normal renal function?",
"1-2 g IV every 8 hours. (0.5-1 g q8h for mild-moderate; 2 g q8h for meningitis/severe infections)"
),
(
"Q7. Why is meropenem preferred over imipenem for treating meningitis?",
"Meropenem is less likely to cause seizures than imipenem. Both penetrate the CNS well, but imipenem carries a higher seizure risk (up to 1.5%), especially in patients with CNS lesions or renal insufficiency."
),
(
"Q8. What is the critical drug interaction with meropenem you must never forget?",
"Meropenem significantly lowers serum valproic acid levels — do NOT co-administer. This can precipitate seizures in epileptic patients."
),
(
"Q9. What is the pharmacodynamic principle behind extended infusion of meropenem (3 h instead of 30 min)?",
"Beta-lactams are time-dependent antibiotics — efficacy depends on %T>MIC (time concentration stays above MIC). Extended infusion increases time above MIC, improving bacterial killing against low-level resistant pathogens."
),
(
"Q10. What does vaborbactam do, and what does meropenem/vaborbactam NOT cover?",
"Vaborbactam is a boronic acid beta-lactamase inhibitor that restores meropenem's activity against KPC-producing (Class A carbapenemase) organisms. It does NOT cover metallo-beta-lactamase producers (NDM, VIM, IMP — Class B)."
),
(
"Q11. Name the 3 classes of carbapenemases and their key examples.",
"Class A (Serine): KPC — overcome by vaborbactam/relebactam.\nClass B (Metallo-BL): NDM, VIM, IMP — zinc-dependent, NOT overcome by current BLIs.\nClass D (OXA): primarily Acinetobacter — often pan-resistant."
),
(
"Q12. Why is ertapenem NOT used for Pseudomonas infections, and what advantage does it have over meropenem?",
"Ertapenem lacks activity against Pseudomonas aeruginosa and Acinetobacter. Its advantage: longer half-life (~4 hours) allowing once-daily dosing (1 g IV/IM q24h), useful for outpatient therapy."
),
(
"Q13. A patient on valproate for epilepsy develops a CRE UTI. You need a carbapenem-based regimen. What do you use and what must you warn about?",
"Use meropenem/vaborbactam (if KPC-producing). Warn: meropenem will drop valproate levels — risk of breakthrough seizures. Switch to an alternative antiepileptic or closely monitor and adjust valproate dose."
),
(
"Q14. What is the PK parameter that determines meropenem efficacy, and how does renal impairment affect dosing?",
"%T>MIC (time-dependent killing). Renally cleared with t½ ~1 h. Dose must be reduced in renal insufficiency (adjust based on CrCl) to avoid accumulation and toxicity (especially seizure risk)."
),
]
for i, (q, a) in enumerate(questions):
q_block = [
Paragraph(q, quiz_q_style),
Spacer(1, 2),
Paragraph("Answer:", answer_label_style),
Paragraph(a.replace("\n", "<br/>"), quiz_a_style),
hr(),
]
story.append(KeepTogether(q_block))
# Score guide
story.append(spacer(8))
score_data = [
["Score", "Verdict"],
["13-14 correct", "Solid. Move on."],
["9-12 correct", "Review the gaps and re-test tomorrow."],
["< 9 correct", "Go back to the framework, rebuild the skeleton, then retry."],
]
ts = Table(score_data, colWidths=[5*cm, 11.5*cm])
ts.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 10),
("BACKGROUND", (0,1), (-1,1), colors.HexColor("#e8f8e8")),
("BACKGROUND", (0,2), (-1,2), colors.HexColor("#fff8e8")),
("BACKGROUND", (0,3), (-1,3), colors.HexColor("#fce8e8")),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#aaaaaa")),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("PADDING", (0,0), (-1,-1), 7),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
]))
story.append(ts)
# Footer note
story.append(spacer(12))
story.append(Paragraph(
"Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics | Katzung's Basic and Clinical Pharmacology 16e | "
"Medical Microbiology 9e | The Washington Manual of Medical Therapeutics",
note_style
))
# Build
doc.build(story)
print(f"PDF created: {OUTPUT}")
python /home/daytona/workspace/meropenem/generate_pdf.py
ROWBACKGROUNDS with None caused an error. Let me fix that.~/meropenem/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/meropenem/generate_pdf.py'
python /home/daytona/workspace/meropenem/generate_pdf.py
Meropenem Notes and Quiz
PDF Document · PDF
Basically I’m trying to learn about antibiotics used in ICU, how can I learn them easily with your help?
| Class | Key ICU Drugs |
|---|---|
| Carbapenems | Meropenem, Imipenem, Ertapenem |
| Beta-lactam/BLI combos | Pip-Tazo, Meropenem/Vaborbactam, Ceftazidime/Avibactam |
| Glycopeptides | Vancomycin, Teicoplanin |
| Lipopeptides | Daptomycin |
| Oxazolidinones | Linezolid |
| Aminoglycosides | Amikacin, Gentamicin |
| Fluoroquinolones | Ciprofloxacin, Levofloxacin |
| Polymyxins | Colistin, Polymyxin B |
| Antifungals | Fluconazole, Caspofungin, Voriconazole |
| Anti-MRSA | Vancomycin, Linezolid, Daptomycin |
Class → Mechanism → Spectrum → PK → Dose → ADRs → Clinical Use
Option D
| # | Class | Why This Order |
|---|---|---|
| 1 | ✅ Carbapenems | Done - you know this |
| 2 | Glycopeptides | Vancomycin is the most used ICU drug after carbapenems |
| 3 | Beta-lactam/BLI combos | Pip-tazo, ceftazidime/avibactam - daily ICU use |
| 4 | Anti-MRSA agents | Linezolid, Daptomycin - gram-positive coverage decisions |
| 5 | Aminoglycosides | Synergy, TDM, renal toxicity - high-yield |
| 6 | Fluoroquinolones | Spectrum, resistance, atypicals |
| 7 | Polymyxins | Last-resort agents for XDR gram-negatives |
| 8 | Antifungals | Candidemia, empiric coverage in ICU |
What about ceftriaxone and augmentin? We also use that in few scenarios.
| # | Class | Key Drugs | ICU Role |
|---|---|---|---|
| 1 | ✅ Carbapenems | Meropenem, Imipenem, Ertapenem | Done |
| 2 | Cephalosporins | Ceftriaxone (3rd gen), Cefepime (4th gen), Ceftazidime (3rd gen) | Community-acquired infections, step-down, empiric coverage |
| 3 | Penicillin combos (BLI) | Augmentin (Amoxicillin-Clavulanate), Pip-Tazo | Mild-moderate infections, polymicrobial, intra-abdominal |
| 4 | Glycopeptides | Vancomycin, Teicoplanin | MRSA, gram-positive coverage |
| 5 | Advanced BLI combos | Ceftazidime/Avibactam, Meropenem/Vaborbactam | MDR/XDR gram-negatives, CRE |
| 6 | Anti-MRSA agents | Linezolid, Daptomycin | Vancomycin failure/intolerance |
| 7 | Aminoglycosides | Amikacin, Gentamicin | Synergy, TDM, resistant gram-negatives |
| 8 | Fluoroquinolones | Ciprofloxacin, Levofloxacin | Atypicals, step-down, UTI |
| 9 | Polymyxins | Colistin, Polymyxin B | Last resort - XDR Acinetobacter, CRE |
| 10 | Antifungals | Fluconazole, Caspofungin, Voriconazole | Candidemia, empiric in ICU |
Cephalosporins → Penicillin combos → Glycopeptides → Advanced BLIs → ...
I hope I remember and am able to apply the concepts in real life.
Make a complete study guide PDF for all ICU antibiotics
~/meropenem/icu_antibiotics.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
OUTPUT = "/home/daytona/workspace/meropenem/ICU_Antibiotics_Complete_Study_Guide.pdf"
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
rightMargin=1.8*cm, leftMargin=1.8*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="ICU Antibiotics - Complete Study Guide",
author="Orris Medical"
)
# ── Colour palette ──────────────────────────────────────────────────────────
NAVY = colors.HexColor("#1a3a5c")
BLUE = colors.HexColor("#2563a8")
LBLUE = colors.HexColor("#dbeafe")
TEAL = colors.HexColor("#0f766e")
LTEAL = colors.HexColor("#d1fae5")
RED = colors.HexColor("#b91c1c")
LRED = colors.HexColor("#fee2e2")
AMBER = colors.HexColor("#b45309")
LAMBER = colors.HexColor("#fef3c7")
PURPLE = colors.HexColor("#6d28d9")
LPURP = colors.HexColor("#ede9fe")
GREY = colors.HexColor("#374151")
LGREY = colors.HexColor("#f3f4f6")
WHITE = colors.white
CLASS_COLORS = [
(colors.HexColor("#1a3a5c"), colors.HexColor("#dbeafe")), # 1 Carbapenems
(colors.HexColor("#0f766e"), colors.HexColor("#d1fae5")), # 2 Cephalosporins
(colors.HexColor("#6d28d9"), colors.HexColor("#ede9fe")), # 3 Pen/BLI combos
(colors.HexColor("#b45309"), colors.HexColor("#fef3c7")), # 4 Glycopeptides
(colors.HexColor("#b91c1c"), colors.HexColor("#fee2e2")), # 5 Advanced BLI combos
(colors.HexColor("#1d4ed8"), colors.HexColor("#dbeafe")), # 6 Anti-MRSA
(colors.HexColor("#065f46"), colors.HexColor("#d1fae5")), # 7 Aminoglycosides
(colors.HexColor("#7c3aed"), colors.HexColor("#ede9fe")), # 8 Fluoroquinolones
(colors.HexColor("#9f1239"), colors.HexColor("#ffe4e6")), # 9 Polymyxins
(colors.HexColor("#166534"), colors.HexColor("#dcfce7")), # 10 Antifungals
]
s = getSampleStyleSheet()
def ps(name, **kw):
base = kw.pop("parent", s["Normal"])
p = ParagraphStyle(name, parent=base, **kw)
return p
TITLE_S = ps("T", fontSize=24, textColor=NAVY, alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=4)
SUB_S = ps("ST", fontSize=11, textColor=BLUE, alignment=TA_CENTER, fontName="Helvetica", spaceAfter=12)
BODY_S = ps("B", fontSize=9.5, leading=14, spaceAfter=5, fontName="Helvetica", alignment=TA_JUSTIFY)
BULLET_S = ps("BL", fontSize=9.5, leading=13, spaceAfter=3, leftIndent=14, fontName="Helvetica")
H2_S = ps("H2", fontSize=11, textColor=NAVY, fontName="Helvetica-Bold", spaceBefore=8, spaceAfter=3)
NOTE_S = ps("N", fontSize=8.5, textColor=GREY, fontName="Helvetica-Oblique", leftIndent=8, spaceAfter=4)
WARN_S = ps("W", fontSize=9, textColor=RED, fontName="Helvetica-Bold", leftIndent=8, spaceAfter=4)
DRUG_S = ps("D", fontSize=10, textColor=WHITE, fontName="Helvetica-Bold", spaceAfter=2, spaceBefore=2)
SCENARIO_Q = ps("SQ", fontSize=10, fontName="Helvetica-Bold", textColor=TEAL, spaceBefore=8, spaceAfter=3)
SCENARIO_A = ps("SA", fontSize=9.5, fontName="Helvetica", textColor=GREY, leftIndent=12,
backColor=colors.HexColor("#f0fdf4"), spaceAfter=4)
story = []
# ════════════════════════════════════════════════════════════════════════════
# COVER
# ════════════════════════════════════════════════════════════════════════════
story.append(Spacer(1, 30))
story.append(Paragraph("ICU ANTIBIOTICS", TITLE_S))
story.append(Paragraph("Complete Study Guide — 10 Drug Classes", SUB_S))
story.append(HRFlowable(width="90%", thickness=2.5, color=NAVY, spaceAfter=14, hAlign="CENTER"))
# TOC table
toc_data = [
["#", "Class", "Key Drugs"],
["1", "Carbapenems", "Meropenem, Imipenem, Ertapenem"],
["2", "Cephalosporins", "Ceftriaxone, Cefepime, Ceftazidime, Cefazolin"],
["3", "Penicillin/BLI Combos", "Augmentin (Amox-Clav), Piperacillin-Tazobactam"],
["4", "Glycopeptides", "Vancomycin, Teicoplanin"],
["5", "Advanced BLI Combos", "Ceftazidime/Avibactam, Meropenem/Vaborbactam"],
["6", "Anti-MRSA Agents", "Linezolid, Daptomycin"],
["7", "Aminoglycosides", "Amikacin, Gentamicin, Tobramycin"],
["8", "Fluoroquinolones", "Ciprofloxacin, Levofloxacin"],
["9", "Polymyxins", "Colistin (Polymyxin E), Polymyxin B"],
["10", "Antifungals", "Fluconazole, Caspofungin, Voriconazole"],
]
toc = Table(toc_data, colWidths=[1*cm, 5.5*cm, 10*cm])
toc.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9.5),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("ROWBACKGROUNDS", (0,1), (-1,-1), [LGREY, WHITE]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#aaaaaa")),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("PADDING", (0,0), (-1,-1), 6),
]))
story.append(toc)
story.append(Spacer(1, 10))
story.append(Paragraph(
"For each class: Class overview → Mechanism → Spectrum → Key PK → Dosing → ADRs → ICU Uses → ICU Scenarios",
NOTE_S
))
story.append(Paragraph(
"Skeleton to memorise for EVERY drug: Class → Mechanism → Spectrum → PK → Dose → ADRs → Clinical Use",
ps("SK", fontSize=9, textColor=NAVY, fontName="Helvetica-Bold", leftIndent=8, spaceAfter=4,
backColor=LBLUE, borderPad=4)
))
# ════════════════════════════════════════════════════════════════════════════
# HELPER FUNCTIONS
# ════════════════════════════════════════════════════════════════════════════
def class_header(num, title, accent, bg):
return [
PageBreak(),
Spacer(1, 6),
Table([[Paragraph(f"CLASS {num}", ps(f"CH{num}", fontSize=10, textColor=bg, fontName="Helvetica-Bold")),
Paragraph(title, ps(f"CT{num}", fontSize=16, textColor=WHITE, fontName="Helvetica-Bold"))]],
colWidths=[2*cm, 14.5*cm],
style=[("BACKGROUND", (0,0), (-1,-1), accent),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("PADDING", (0,0), (-1,-1), 10),
("BACKGROUND", (0,0), (0,0), colors.HexColor("#ffffff22"))]),
Spacer(1, 8),
]
def drug_box(name, accent, bg):
return Table(
[[Paragraph(f" {name}", ps(f"DB{name}", fontSize=11, textColor=WHITE, fontName="Helvetica-Bold"))]],
colWidths=[16.6*cm],
style=[("BACKGROUND", (0,0), (-1,-1), accent),
("PADDING", (0,0), (-1,-1), 5)]
)
def mk_table(data, col_widths, header_color=NAVY):
t = Table(data, colWidths=col_widths)
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), header_color),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS", (0,1), (-1,-1), [LGREY, WHITE]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#aaaaaa")),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("PADDING", (0,0), (-1,-1), 5),
]))
return t
def b(text): return Paragraph(f"• {text}", BULLET_S)
def body(text): return Paragraph(text, BODY_S)
def h2(text): return Paragraph(text, H2_S)
def note(text): return Paragraph(text, NOTE_S)
def warn(text): return Paragraph(text, WARN_S)
def sp(h=6): return Spacer(1, h)
def hr(): return HRFlowable(width="100%", thickness=0.4, color=colors.HexColor("#cccccc"), spaceAfter=4, spaceBefore=4)
def scenario(q, a):
return KeepTogether([
Paragraph(f"🏥 {q}", SCENARIO_Q),
Paragraph(a, SCENARIO_A),
])
# ════════════════════════════════════════════════════════════════════════════
# CLASS 1: CARBAPENEMS
# ════════════════════════════════════════════════════════════════════════════
acc, bg = CLASS_COLORS[0]
story += class_header(1, "CARBAPENEMS", acc, bg)
story.append(body("Carbapenems are the broadest-spectrum beta-lactams available. They are the backbone of ICU empiric therapy for resistant gram-negative infections. They work by binding PBPs and inhibiting cell wall synthesis, and are resistant to most beta-lactamases except carbapenemases."))
story.append(sp(4))
carb_data = [
["Drug", "Key Feature", "Dose (normal renal fn)", "Notable Gap"],
["Meropenem", "No cilastatin needed; preferred for meningitis", "1-2 g IV q8h", "Carbapenemase producers, MRSA"],
["Imipenem/Cilastatin", "Requires cilastatin (renal DHP1); broader GP coverage", "500 mg-1 g IV q6-8h", "Higher seizure risk; avoid CNS use"],
["Ertapenem", "Once daily; no Pseudomonas/Acinetobacter coverage", "1 g IV/IM q24h", "Pseudomonas, Acinetobacter"],
]
story.append(mk_table(carb_data, [3.5*cm, 5.5*cm, 4.5*cm, 4*cm], acc))
story.append(sp(4))
story.append(h2("Key Points"))
story.append(b("PD parameter: %T>MIC (time-dependent) — extended infusion (3h) improves outcomes vs. resistant pathogens"))
story.append(b("Meropenem/vaborbactam: add vaborbactam to restore activity vs. KPC-producers (NOT metallo-BL producers)"))
story.append(b("<b>Critical drug interaction:</b> All carbapenems significantly reduce valproic acid levels — never co-administer"))
story.append(b("Organisms NOT covered by ANY carbapenem: MRSA, E. faecium, C. difficile, Burkholderia, Stenotrophomonas"))
story.append(b("Resistance: KPC (Class A), NDM/VIM/IMP (Class B metallo-BL), OXA (Class D)"))
story.append(sp(4))
story.append(scenario(
"Scenario 1 — VAP in ICU day 7, Pseudomonas on BAL culture, meropenem MIC = 4 (susceptible). Seizure history on valproate. What do you do?",
"Use meropenem 2 g IV q8h as extended 3-hour infusion to maximize %T>MIC. CRITICAL: consult neurology and switch valproate to an alternative AED (e.g. levetiracetam) before starting meropenem — carbapenems will drop valproate levels by ~70%, risking breakthrough seizures."
))
story.append(scenario(
"Scenario 2 — Post-cholecystectomy patient, community-onset biliary sepsis, stable. Blood cultures growing E. coli (ESBL+). What antibiotic and why?",
"Meropenem or ertapenem. ESBL-producing Enterobacterales are best treated with carbapenems (treatment of choice). Ertapenem 1 g q24h is suitable here as the patient is stable and doesn't need Pseudomonas coverage — advantage: once-daily dosing allows step-down to outpatient IV therapy."
))
# ════════════════════════════════════════════════════════════════════════════
# CLASS 2: CEPHALOSPORINS
# ════════════════════════════════════════════════════════════════════════════
acc, bg = CLASS_COLORS[1]
story += class_header(2, "CEPHALOSPORINS", acc, bg)
story.append(body("Cephalosporins are beta-lactams divided into 5 generations. Each generation has progressively better gram-negative coverage but variable gram-positive activity. They all work by binding PBPs to inhibit cell wall synthesis. None covers MRSA (except ceftaroline, 5th gen), Enterococcus, or Listeria."))
story.append(sp(4))
ceph_gen = [
["Generation", "Key Drug(s)", "Gram-Positive", "Gram-Negative", "ICU Role"],
["1st", "Cefazolin", "Excellent (Staph, Strep)", "Limited (E.coli, Klebsiella, Proteus)", "Surgical prophylaxis; MSSA infections"],
["2nd", "Cefuroxime, Cefoxitin", "Good", "Extended (+ H. influenzae, Klebsiella)", "Rarely in ICU; community-acquired"],
["3rd", "Ceftriaxone, Ceftazidime", "Good (ceftriaxone); Poor (ceftazidime)", "Broad; ceftazidime covers Pseudomonas", "CAP, meningitis, biliary (ceftriaxone); Pseudomonas (ceftazidime)"],
["4th", "Cefepime", "Similar to ceftriaxone", "Very broad incl. Pseudomonas + AmpC stable", "Empiric nosocomial; febrile neutropenia"],
["5th", "Ceftaroline", "MRSA active!", "Similar to 3rd gen (no Pseudomonas)", "MRSA pneumonia, complicated skin infections"],
]
story.append(mk_table(ceph_gen, [2*cm, 3.5*cm, 3.5*cm, 4*cm, 4*cm], acc))
story.append(sp(4))
story.append(h2("Focus Drugs for ICU"))
story.append(drug_box("Ceftriaxone (3rd gen)", acc, bg))
story.append(sp(2))
story.append(b("Dose: 1-2 g IV q24h (half-life ~8h allows once-daily dosing)"))
story.append(b("Spectrum: Streptococci, MSSA, Enterobacterales, H. influenzae, Neisseria meningitidis"))
story.append(b("ICU uses: CAP on admission, meningitis (with vancomycin), biliary sepsis, step-down"))
story.append(b("NOT for: Pseudomonas, MRSA, Enterococcus, ESBL producers"))
story.append(b("ADRs: Biliary sludge/cholelithiasis (long courses), hypersensitivity"))
story.append(sp(4))
story.append(drug_box("Cefepime (4th gen)", acc, bg))
story.append(sp(2))
story.append(b("Dose: 1-2 g IV q8-12h"))
story.append(b("Spectrum: Broader than ceftriaxone — includes Pseudomonas, AmpC-producing organisms (Enterobacter, Serratia)"))
story.append(b("ICU uses: HAP/VAP, febrile neutropenia, nosocomial gram-negative infections"))
story.append(b("NOT for: MRSA, ESBL producers (variable), anaerobes"))
story.append(warn("⚠ Neurotoxicity warning: Cefepime can cause encephalopathy/seizures especially with renal impairment — monitor closely"))
story.append(sp(4))
story.append(drug_box("Ceftazidime (3rd gen, anti-pseudomonal)", acc, bg))
story.append(sp(2))
story.append(b("Dose: 1-2 g IV q8h"))
story.append(b("Spectrum: Strong gram-negative (incl. Pseudomonas) but poor gram-positive"))
story.append(b("ICU uses: Pseudomonas infections when carbapenems not needed; often used as ceftazidime/avibactam for MDR"))
story.append(sp(4))
story.append(scenario(
"Scenario — 58-year-old admitted with CAP (SpO2 88%, CXR: lobar consolidation), no prior antibiotics, no hospital exposure. What do you start?",
"Ceftriaxone 1-2 g IV q24h + azithromycin (for atypicals). This covers the most likely CAP pathogens (S. pneumoniae, H. influenzae, Enterobacterales). No need for anti-pseudomonal or anti-MRSA cover in community-acquired, non-immunocompromised patient."
))
story.append(scenario(
"Scenario — Febrile neutropenic patient, ANC <500, temperature 38.8°C, no obvious source. Which cephalosporin and why?",
"Cefepime 2 g IV q8h. It covers Pseudomonas (major concern in neutropenic patients), AmpC-producing gram-negatives, and has good gram-positive activity. Add vancomycin only if there is a suspected line infection, mucositis, or hemodynamic instability."
))
# ════════════════════════════════════════════════════════════════════════════
# CLASS 3: PENICILLIN / BLI COMBOS
# ════════════════════════════════════════════════════════════════════════════
acc, bg = CLASS_COLORS[2]
story += class_header(3, "PENICILLIN / BETA-LACTAMASE INHIBITOR COMBOS", acc, bg)
story.append(body("These combine a penicillin (which binds PBPs to inhibit cell wall synthesis) with a BLI that blocks beta-lactamase enzymes, thereby restoring activity against organisms that would otherwise be resistant. They offer broad-spectrum coverage including anaerobes."))
story.append(sp(4))
pen_data = [
["Drug", "Components", "Dose", "Spectrum Highlights", "ICU Use"],
["Augmentin\n(Amoxicillin-Clavulanate)", "Amoxicillin + Clavulanic acid", "625 mg PO q8h\n1.2 g IV q8h", "Gram+, Gram-, Anaerobes\n+ beta-lactamase producers;\nNOT Pseudomonas", "Step-down, mild-moderate aspiration pneumonia, diabetic foot, biliary (mild)"],
["Piperacillin-\nTazobactam\n(Pip-Tazo)", "Piperacillin + Tazobactam", "4.5 g IV q6-8h\n(3-hour extended infusion)", "Broad: Gram+, Gram-\n+ Pseudomonas, Anaerobes\nNOT MRSA, CRE", "HAP, polymicrobial sepsis, intra-abdominal, nosocomial infections"],
["Ampicillin-\nSulbactam", "Ampicillin + Sulbactam", "3 g IV q6h", "Gram+, Gram-\nGood Acinetobacter coverage", "Acinetobacter infections (sulbactam is intrinsically active vs. Acinetobacter)"],
]
story.append(mk_table(pen_data, [3*cm, 3*cm, 3*cm, 4.5*cm, 4*cm], acc))
story.append(sp(4))
story.append(h2("Key Points"))
story.append(b("Pip-Tazo: The workhorse of ICU broad-spectrum empiric cover; use extended 3-hour infusion for %T>MIC optimization"))
story.append(b("Augmentin: More of a floor/step-down drug; useful for mild-moderate aspiration, skin/soft tissue, biliary"))
story.append(b("Sulbactam in amp-sulbactam has intrinsic activity against Acinetobacter — useful when susceptible"))
story.append(warn("⚠ Pip-Tazo + Vancomycin: Associated with significantly higher risk of AKI compared to Meropenem + Vancomycin (2025 network meta-analysis, PMID 39533846). Prefer meropenem as the combination partner when using with vancomycin."))
story.append(b("None of these cover MRSA or carbapenemase-producing organisms"))
story.append(sp(4))
story.append(scenario(
"Scenario — ICU patient with aspiration pneumonia post-intubation, day 2. Clinically improving, cultures show oral flora (strep, anaerobes). MRSA screen negative. What antibiotic?",
"Piperacillin-tazobactam 4.5 g IV q6-8h covers gram-positives, gram-negatives AND anaerobes well. If patient is stable and improving, could consider step-down to IV Augmentin or even oral Augmentin once tolerating. Avoid carbapenems here — save them for resistant organisms."
))
# ════════════════════════════════════════════════════════════════════════════
# CLASS 4: GLYCOPEPTIDES
# ════════════════════════════════════════════════════════════════════════════
acc, bg = CLASS_COLORS[3]
story += class_header(4, "GLYCOPEPTIDES", acc, bg)
story.append(body("Glycopeptides inhibit cell wall synthesis by a different mechanism to beta-lactams — they bind the D-alanyl-D-alanine terminus of peptidoglycan precursors, sterically blocking both transglycosylase and transpeptidase reactions. Because of their large molecular size, they cannot penetrate gram-negative outer membranes — purely gram-positive coverage."))
story.append(sp(4))
glyco_data = [
["Drug", "Dose", "Half-life", "PK monitoring", "Key Features"],
["Vancomycin", "25-30 mg/kg/day IV\ndivided q8-12h", "~6-8 h", "AUC/MIC target 400-600\n(not trough alone)", "Most common ICU anti-MRSA agent; nephrotoxic; Red man syndrome"],
["Teicoplanin", "Loading: 6 mg/kg IV q12h x3\nMaintenance: 6 mg/kg IV q24h", "~45-70 h", "Trough >15 mg/L\n(serious infections)", "Once daily after loading; less nephrotoxic than vancomycin; NOT available in USA"],
]
story.append(mk_table(glyco_data, [3*cm, 4*cm, 2.5*cm, 3.5*cm, 4.5*cm], acc))
story.append(sp(4))
story.append(h2("Vancomycin — Detailed Notes"))
story.append(b("Mechanism: Binds D-Ala-D-Ala terminus of NAM-pentapeptide → blocks transglycosylation and transpeptidation"))
story.append(b("Spectrum: ALL gram-positive organisms including MRSA, CoNS, Enterococcus (not VRE), S. pneumoniae, C. difficile (oral only)"))
story.append(b("PK: Renally cleared; t½ 6-8h; poor CSF penetration (use high doses for meningitis)"))
story.append(b("PD parameter: AUC/MIC (target 400-600 mg·h/L) — switch from trough-only monitoring to AUC-guided dosing"))
story.append(b("Dose: Start 25-30 mg/kg/day IV divided q8-12h; adjust based on AUC monitoring and renal function"))
story.append(b("Oral vancomycin: NOT absorbed systemically — used ONLY for C. difficile colitis (local gut action)"))
story.append(sp(4))
story.append(h2("Adverse Effects"))
story.append(b("<b>Red Man Syndrome:</b> Flushing, erythema, pruritus — NOT an allergy! Caused by rapid infusion → mast cell degranulation. Treat by slowing infusion rate"))
story.append(b("<b>Nephrotoxicity:</b> Dose-dependent; risk increased with concomitant aminoglycosides, pip-tazo"))
story.append(b("<b>Ototoxicity:</b> Rare; more common with high levels or concurrent ototoxic drugs"))
story.append(b("Resistance — VRE (Vancomycin-Resistant Enterococcus): vanA gene (D-Ala-D-Lac) confers high-level resistance"))
story.append(sp(4))
story.append(scenario(
"Scenario — ICU patient, central line in-situ 8 days, fever, blood cultures growing MRSA. What antibiotic, how do you dose, and what do you monitor?",
"Vancomycin IV. Dose: 25-30 mg/kg/day in divided doses. Monitor AUC/MIC (target 400-600); do NOT rely on trough alone. Remove or replace CVC if line-associated. Check renal function daily — reduce dose if creatinine rising. Duration: minimum 2 weeks for MRSA bacteremia."
))
story.append(scenario(
"Scenario — Patient develops flushing, erythema across face and neck during first vancomycin infusion. Nurse calls you. Allergy or not?",
"Red Man Syndrome — NOT an allergic reaction. This is a rate-related infusion reaction from histamine release. Action: STOP the infusion, give antihistamine (chlorpheniramine), then restart at a SLOWER infusion rate (infuse each dose over at least 60-90 min). No need to change the antibiotic."
))
# ════════════════════════════════════════════════════════════════════════════
# CLASS 5: ADVANCED BLI COMBOS
# ════════════════════════════════════════════════════════════════════════════
acc, bg = CLASS_COLORS[4]
story += class_header(5, "ADVANCED BLI COMBINATIONS (for MDR/XDR)", acc, bg)
story.append(body("These newer combinations pair existing beta-lactams with novel beta-lactamase inhibitors designed specifically to overcome carbapenem-resistant organisms (CRE, CRPA, CRAB). They are reserved for MDR/XDR pathogens where standard carbapenems have failed or are predicted to fail."))
story.append(sp(4))
adv_data = [
["Combination", "BLI Target", "Dose", "Covers", "Does NOT cover"],
["Ceftazidime/Avibactam\n(Avycaz)", "Class A (KPC), C (AmpC), some D (OXA-48)", "2.5 g IV q8h\n(3-hour infusion)", "CRE (KPC), CRPA, OXA-48 Klebsiella", "Metallo-BL (NDM, VIM, IMP)"],
["Meropenem/Vaborbactam\n(Vabomere)", "Class A (KPC)", "4 g IV q8h\n(3-hour infusion)", "CRE (KPC)", "Metallo-BL; less OXA activity than avibactam"],
["Imipenem/Cilastatin/Relebactam\n(Recarbrio)", "Class A (KPC), C", "1.25 g IV q6h", "CRE (KPC), CRPA", "Metallo-BL"],
["Cefiderocol\n(Fetroja)", "Novel siderophore cephalosporin", "2 g IV q8h (3-hour)", "Broadest — CRE, CRPA, CRAB, metallo-BL (NDM!)", "Limited gram-positive"],
["Aztreonam/Avibactam", "Class B (metallo-BL!)", "3 g IV q6h", "NDM, VIM producers (gap filled!)", "Limited vs. non-metallo resistance"],
]
story.append(mk_table(adv_data, [4*cm, 3.5*cm, 3*cm, 3.5*cm, 3*cm], acc))
story.append(sp(4))
story.append(h2("The MDR Decision Framework"))
story.append(b("Step 1: Identify organism and resistance gene if possible (PCR for KPC, NDM, OXA, VIM/IMP)"))
story.append(b("KPC producer → Ceftazidime/avibactam or Meropenem/vaborbactam"))
story.append(b("NDM/VIM/IMP (metallo-BL) → Ceftazidime/avibactam + Aztreonam OR Cefiderocol OR Aztreonam/Avibactam"))
story.append(b("XDR Acinetobacter → Cefiderocol, Sulbactam-durlobactam, or high-dose Amp-sulbactam"))
story.append(warn("⚠ Always involve Infectious Diseases specialist for XDR/PDR organisms. These agents are expensive, have limited resistance data, and should not be used empirically."))
story.append(sp(4))
story.append(scenario(
"Scenario — CRE Klebsiella pneumoniae UTI with KPC gene detected. Patient is septic. Meropenem MIC >8 (resistant). What do you use?",
"Ceftazidime/avibactam 2.5 g IV q8h (3-hour infusion). Avibactam specifically inhibits KPC (Class A carbapenemase), restoring ceftazidime activity. Alternative: meropenem/vaborbactam. Confirm susceptibility testing. ID consult mandatory."
))
# ════════════════════════════════════════════════════════════════════════════
# CLASS 6: ANTI-MRSA AGENTS (Linezolid & Daptomycin)
# ════════════════════════════════════════════════════════════════════════════
acc, bg = CLASS_COLORS[5]
story += class_header(6, "ANTI-MRSA AGENTS — Linezolid & Daptomycin", acc, bg)
story.append(body("When vancomycin fails or is contraindicated (AKI, VRE, allergy), linezolid and daptomycin are the key alternatives. They cover gram-positive organisms including MRSA and VRE — NO gram-negative activity."))
story.append(sp(4))
mrsa_data = [
["Drug", "Class", "Mechanism", "Dose", "Key Clinical Points"],
["Linezolid", "Oxazolidinone", "Inhibits 50S ribosome (unique binding site — no cross-resistance with other antibiotics)", "600 mg IV/PO q12h\n(100% oral bioavailability!)", "VRE & MRSA; CNS penetration — good for meningitis; oral = IV (step-down advantage)"],
["Daptomycin", "Lipopeptide", "Binds bacterial cell membrane → depolarization → rapid cell death (Ca2+-dependent)", "6 mg/kg IV q24h standard\n8-12 mg/kg for bacteremia/endocarditis", "Bactericidal; concentration-dependent; CANNOT use for pneumonia (inactivated by surfactant!)"],
]
story.append(mk_table(mrsa_data, [2.5*cm, 2.5*cm, 4.5*cm, 4*cm, 4.5*cm], acc))
story.append(sp(4))
story.append(drug_box("Linezolid — Key Points", acc, bg))
story.append(sp(2))
story.append(b("Spectrum: MRSA, VRE, VISA, VRSA, Streptococci — all gram-positive"))
story.append(b("100% oral bioavailability — IV = oral; major advantage for step-down therapy"))
story.append(b("Penetrates CSF well — suitable for CNS infections caused by MRSA/VRE"))
story.append(b("<b>ADRs: Serotonin syndrome</b> — dangerous interaction with SSRIs, MAOIs, tramadol; avoid co-prescription"))
story.append(b("Myelosuppression: Thrombocytopenia (common >2 weeks use), anaemia — monitor weekly CBC"))
story.append(b("Optic and peripheral neuropathy with prolonged use (>4 weeks)"))
story.append(b("Bacteriostatic — NOT bactericidal (exception: some gram-positives)"))
story.append(sp(6))
story.append(drug_box("Daptomycin — Key Points", acc, bg))
story.append(sp(2))
story.append(b("Spectrum: All gram-positives including MRSA, VRE, VISA — bactericidal"))
story.append(b("Concentration-dependent killing — higher doses for serious infections are well-tolerated"))
story.append(warn("⚠ NEVER use daptomycin for pneumonia — it is inactivated by pulmonary surfactant"))
story.append(b("ADRs: <b>Myopathy/rhabdomyolysis</b> — monitor CK weekly; stop if CK >10x ULN or symptomatic"))
story.append(b("Caution with statins and aminoglycosides (additive muscle toxicity)"))
story.append(b("Renally cleared: dose q48h if CrCl <30 mL/min; administer after dialysis in ESRD"))
story.append(b("Resistance: Can emerge during treatment, especially in endocarditis high-inoculum infections"))
story.append(b("Trick: Beta-lactams (even if pathogen is resistant to them) can REVERSE daptomycin resistance"))
story.append(sp(4))
story.append(scenario(
"Scenario — MRSA bacteremia with right-sided endocarditis (IVDU patient). Vancomycin started but MIC is 2 (borderline). Clinical response poor at 72h. What next?",
"Switch to daptomycin 8-12 mg/kg IV q24h (higher dose for endocarditis). Daptomycin is non-inferior to vancomycin for right-sided endocarditis. Check CK weekly. If CK rises or patient develops muscle pain, stop daptomycin. Perform echocardiogram (TTE/TOE), source control, and ID consult."
))
story.append(scenario(
"Scenario — MRSA meningitis post-neurosurgery. Vancomycin levels not achieving targets. What alternative?",
"Linezolid 600 mg IV q12h. It penetrates CSF well and is active against MRSA. Daptomycin is NOT suitable for meningitis (poor CNS penetration). Check for drug interactions — linezolid is a MAO inhibitor so review all concurrent medications for serotonin syndrome risk."
))
# ════════════════════════════════════════════════════════════════════════════
# CLASS 7: AMINOGLYCOSIDES
# ════════════════════════════════════════════════════════════════════════════
acc, bg = CLASS_COLORS[6]
story += class_header(7, "AMINOGLYCOSIDES", acc, bg)
story.append(body("Aminoglycosides are bactericidal antibiotics that inhibit protein synthesis by binding the 30S ribosomal subunit, causing misreading of mRNA and premature termination. They are concentration-dependent killers with a significant post-antibiotic effect (PAE). In ICU, they are mainly used for synergy and for resistant gram-negative infections."))
story.append(sp(4))
amino_data = [
["Drug", "Dose (ODD)", "Key Spectrum", "Primary ICU Use"],
["Amikacin", "15-20 mg/kg IV q24h", "Broad gram-negative; most resistant to modifying enzymes", "MDR gram-negatives; combination therapy for CRE/CRPA"],
["Gentamicin", "5-7 mg/kg IV q24h", "Gram-negative + synergy vs. gram-positives", "Synergy with beta-lactams for enterococcal endocarditis, gram-negative bacteremia"],
["Tobramycin", "5-7 mg/kg IV q24h", "Slightly better Pseudomonas activity than gentamicin", "Pseudomonas infections; inhaled form for CF"],
]
story.append(mk_table(amino_data, [3*cm, 4*cm, 5.5*cm, 5*cm], acc))
story.append(sp(4))
story.append(h2("Key Pharmacology"))
story.append(b("PD parameter: Concentration-dependent (Cmax/MIC) + long Post-Antibiotic Effect (PAE)"))
story.append(b("Once-daily dosing (ODD) preferred: gives high Cmax/MIC peak + allows trough to fall low (reduces toxicity)"))
story.append(b("NOT absorbed orally — IV/IM only. Poor CNS and lung penetration"))
story.append(b("Amikacin: most resistant to aminoglycoside-modifying enzymes — use when resistance to gentamicin/tobramycin"))
story.append(sp(4))
story.append(h2("Toxicity — Critical"))
story.append(warn("⚠ NEPHROTOXICITY: Accumulates in proximal tubular cells → ATN. Risk ↑ with prolonged use, high trough levels, concurrent nephrotoxins"))
story.append(warn("⚠ OTOTOXICITY: Cochlear toxicity (hearing loss, often irreversible) and vestibular toxicity. Damage to hair cells in inner ear. Avoid concurrent loop diuretics"))
story.append(b("Therapeutic Drug Monitoring (TDM): ODD — measure trough before next dose (<1 mg/L for gentamicin). Use Hartford nomogram for ODD"))
story.append(b("Monitoring: Baseline and weekly audiometry for prolonged courses; daily renal function"))
story.append(sp(4))
story.append(scenario(
"Scenario — Enterococcal endocarditis, ampicillin-susceptible E. faecalis. What regimen and what role does gentamicin play?",
"Ampicillin + Gentamicin (synergistic combination). Gentamicin alone has no reliable activity against Enterococcus, but when combined with a cell-wall active agent (ampicillin/penicillin/vancomycin), it gains entry into the cell and achieves bactericidal synergy. Use low-dose gentamicin (3 mg/kg/day in divided doses) with TDM. Duration: 2-4 weeks depending on valve involved."
))
# ════════════════════════════════════════════════════════════════════════════
# CLASS 8: FLUOROQUINOLONES
# ════════════════════════════════════════════════════════════════════════════
acc, bg = CLASS_COLORS[7]
story += class_header(8, "FLUOROQUINOLONES", acc, bg)
story.append(body("Fluoroquinolones inhibit bacterial DNA gyrase (topoisomerase II) and topoisomerase IV — enzymes needed for DNA replication, transcription, and repair. They are bactericidal, concentration-dependent antibiotics with excellent oral bioavailability (~100%). They have broad-spectrum activity including atypical organisms."))
story.append(sp(4))
fq_data = [
["Drug", "Dose", "Key Spectrum Highlights", "ICU Uses"],
["Ciprofloxacin", "400 mg IV q8-12h\n750 mg PO q12h", "Best gram-negative (incl. Pseudomonas); moderate gram-positive", "UTI/pyelonephritis; gram-negative bacteremia; combination for Pseudomonas"],
["Levofloxacin", "500-750 mg IV/PO q24h", "Broader gram-positive than cipro; good Pseudomonas; best for atypicals", "CAP (respiratory FQ); HAP step-down; atypical pneumonia; step-down for gram-negatives"],
["Moxifloxacin", "400 mg IV/PO q24h", "No Pseudomonas; best anaerobic coverage; best gram-positive", "CAP with anaerobic risk; NOT for Pseudomonas infections"],
]
story.append(mk_table(fq_data, [3*cm, 4*cm, 5*cm, 4.5*cm], acc))
story.append(sp(4))
story.append(h2("Key Points"))
story.append(b("Oral bioavailability ~100% — IV and oral are clinically equivalent; major advantage for step-down"))
story.append(b("PD parameter: AUC/MIC (concentration-dependent) — higher doses better for resistant organisms"))
story.append(b("Atypical coverage: All FQs cover Legionella, Mycoplasma, Chlamydia — important in CAP"))
story.append(b("AVOID in: Tendon rupture risk (especially in elderly, steroid users, renal failure); QT prolongation"))
story.append(warn("⚠ QTc prolongation: Risk of Torsades de Pointes — check ECG, electrolytes (K+, Mg2+). Avoid with other QT-prolonging drugs"))
story.append(warn("⚠ Resistance: Fluoroquinolone resistance has risen sharply — check local antibiogram before empiric use, especially for Pseudomonas and E. coli UTIs"))
story.append(b("Drug interactions: Chelated by divalent cations (Mg2+, Ca2+, Al3+, Fe2+) — avoid co-administration with antacids, supplements within 2h"))
story.append(b("CNS effects: Seizures, confusion, hallucinations — use caution in elderly and CNS disease"))
story.append(sp(4))
story.append(scenario(
"Scenario — CAP patient improving on IV ceftriaxone + azithromycin. Day 3, tolerating PO, temp settling. Time to step down?",
"Switch to oral levofloxacin 750 mg PO q24h (or oral amoxicillin-clavulanate if atypical cover not needed). Levofloxacin has ~100% oral bioavailability and covers both typical and atypical pathogens in one drug. Earlier oral step-down reduces IV line complications, costs, and hospital stay."
))
# ════════════════════════════════════════════════════════════════════════════
# CLASS 9: POLYMYXINS
# ════════════════════════════════════════════════════════════════════════════
acc, bg = CLASS_COLORS[8]
story += class_header(9, "POLYMYXINS — Last-Resort Agents", acc, bg)
story.append(body("Polymyxins are cationic polypeptide antibiotics that disrupt the outer membrane of gram-negative bacteria by displacing Mg2+ and Ca2+ from lipopolysaccharide (LPS), causing membrane permeability, leakage of cell contents, and cell death. They are the last resort for XDR/PDR gram-negative organisms when all other options are exhausted."))
story.append(sp(4))
poly_data = [
["Drug", "Dose", "Spectrum", "Key Toxicity"],
["Colistin\n(Polymyxin E)\n[given as colistimethate]", "Loading: 9 MU IV\nMaintenance: 4.5 MU IV q12h\n(dose by CrCl)", "XDR Acinetobacter, CRE Klebsiella, CRPA — NOT Proteus, Serratia, Burkholderia, gram-positives", "NEPHROTOXICITY (major — ~50%), neurotoxicity (paresthesias, dizziness)"],
["Polymyxin B", "1.5-2.5 mg/kg/day IV divided q12h", "Same as colistin", "Less nephrotoxic than colistin (not renally converted); similar neurotoxicity"],
]
story.append(mk_table(poly_data, [3.5*cm, 4*cm, 5.5*cm, 4*cm], acc))
story.append(sp(4))
story.append(h2("Key Points"))
story.append(warn("⚠ Reserve for XDR/PDR gram-negative infections ONLY — high toxicity profile limits use"))
story.append(b("Colistin is a prodrug (colistimethate sodium, CMS) — converted to active colistin in vivo and excreted by kidneys"))
story.append(b("Polymyxin B: NOT a prodrug, directly active — less nephrotoxicity; preferred by some centres"))
story.append(b("Nephrotoxicity: ~50% incidence with colistin — monitor creatinine daily, ensure adequate hydration"))
story.append(b("Combination therapy: Polymyxins + carbapenem (even if resistant), or + rifampicin, or + fosfomycin — synergy against XDR organisms"))
story.append(b("NOT active against: Proteus mirabilis, Serratia marcescens, Burkholderia cepacia, Morganella (intrinsic resistance), gram-positives"))
story.append(b("Inhaled colistin: Used as adjunct for XDR VAP — lower systemic absorption, direct lung delivery"))
story.append(sp(4))
story.append(scenario(
"Scenario — XDR Acinetobacter baumannii VAP, resistant to all beta-lactams and carbapenems. Sensitivities show colistin MIC = 1. How do you treat?",
"Colistin (IV) + high-dose IV meropenem (even though resistant — synergistic effect) ± inhaled colistin. This combination has been shown to improve outcomes vs. colistin monotherapy. Monitor renal function daily — if creatinine doubles, discuss dose reduction with pharmacy/ID. Loading dose essential to achieve therapeutic levels quickly."
))
# ════════════════════════════════════════════════════════════════════════════
# CLASS 10: ANTIFUNGALS
# ════════════════════════════════════════════════════════════════════════════
acc, bg = CLASS_COLORS[9]
story += class_header(10, "ANTIFUNGALS", acc, bg)
story.append(body("Fungal infections (particularly candidemia) carry 30-40% mortality in ICU patients. Three main classes are used in the ICU. The choice depends on species (Candida albicans vs. non-albicans vs. Aspergillus), severity, and prior azole exposure."))
story.append(sp(4))
af_data = [
["Class", "Drug", "Mechanism", "Dose", "Spectrum / ICU Use"],
["Triazoles", "Fluconazole", "Inhibits ergosterol synthesis (lanosterol 14α-demethylase)", "400-800 mg IV/PO q24h", "C. albicans, C. tropicalis; NOT C. glabrata, C. krusei, C. auris; step-down in stable candidemia"],
["Triazoles", "Voriconazole", "Same as fluconazole (broader)", "6 mg/kg IV q12h x2 doses → 4 mg/kg q12h", "Aspergillus (treatment of choice); many Candida spp.; NOT Mucor"],
["Echinocandins", "Caspofungin", "Inhibits beta-1,3-glucan synthase → disrupts fungal cell wall", "70 mg loading → 50 mg IV q24h", "Broad Candida (incl. azole-resistant); Aspergillus; first-line empiric ICU candidemia"],
["Echinocandins", "Micafungin\nAnidulafungin", "Same as caspofungin", "Micafungin 100 mg q24h\nAnidulafungin 200 mg → 100 mg q24h", "Same as caspofungin — all echinocandins are equally active vs. Candida"],
["Polyenes", "Amphotericin B\n(AmB deoxycholate / liposomal)", "Binds ergosterol → membrane pores → fungal cell leakage", "Conventional: 0.5-1 mg/kg/day\nLiposomal: 3-5 mg/kg/day", "Broadest antifungal spectrum; Mucormycosis (liposomal AmB drug of choice); used when echinocandin fails"],
]
story.append(mk_table(af_data, [2.5*cm, 3*cm, 3.5*cm, 3.5*cm, 5*cm], acc))
story.append(sp(4))
story.append(h2("ICU Antifungal Decision Framework"))
story.append(b("<b>Empiric candidemia:</b> Start echinocandin (caspofungin/micafungin) — broadest coverage, least toxicity"))
story.append(b("<b>Step-down for C. albicans (susceptible, patient stable):</b> Fluconazole 400 mg PO/IV q24h"))
story.append(b("<b>Aspergillosis (invasive):</b> Voriconazole IV (drug of choice)"))
story.append(b("<b>Mucormycosis:</b> Liposomal Amphotericin B + surgical debridement — azoles and echinocandins NOT effective"))
story.append(b("<b>C. auris (emerging MDR Candida):</b> Echinocandin — often resistant to fluconazole and amphotericin"))
story.append(warn("⚠ Amphotericin B toxicity: Infusion reactions (fever, rigors, chills), nephrotoxicity (cumulative, dose-dependent), hypokalaemia, hypomagnesaemia. Use liposomal formulation (AmBisome) to reduce nephrotoxicity."))
story.append(b("All candidemia: Remove or replace CVC, perform ophthalmology review (endophthalmitis), echocardiogram (endocarditis risk)"))
story.append(sp(4))
story.append(scenario(
"Scenario — ICU patient, TPN via CVC, broad-spectrum antibiotics x10 days, now febrile with blood cultures positive for Candida (species pending). What do you start and why?",
"Start caspofungin 70 mg IV loading then 50 mg IV q24h immediately. Reason: echinocandins cover all Candida species including azole-resistant C. glabrata and C. krusei, and are the safest first-line choice while awaiting species identification. Remove or replace CVC. Once species confirmed as C. albicans and patient stable, step down to fluconazole 400 mg PO q24h."
))
# ════════════════════════════════════════════════════════════════════════════
# QUICK REFERENCE MASTER TABLE
# ════════════════════════════════════════════════════════════════════════════
story.append(PageBreak())
story.append(Paragraph("QUICK REFERENCE — ICU Antibiotic Master Table", TITLE_S))
story.append(HRFlowable(width="90%", thickness=2, color=NAVY, spaceAfter=10, hAlign="CENTER"))
master_data = [
["Class", "Key Drugs", "Spectrum Core", "Does NOT Cover", "PD Parameter", "Critical Toxicity"],
["Carbapenems", "Meropenem\nImipenem\nErtapenem", "Broad G+/G-/Anaerobes\nPseudomonas (not ertapenem)", "MRSA, VRE, C.diff\nCarbapenemase producers", "%T>MIC\n(time-dependent)", "Seizures (imipenem)\nValproate drug interaction"],
["Cephalosporins", "Ceftriaxone (3rd)\nCefepime (4th)\nCeftazidime (3rd)", "G+/G- (generation-dependent)\nPseudomonas: ceftazidime, cefepime", "MRSA, Enterococcus\nListeria, anaerobes", "%T>MIC", "Cefepime: neurotoxicity\nBeta-lactam allergy"],
["Pen/BLI combos", "Augmentin\nPip-Tazo\nAmp-Sulbactam", "G+/G-/Anaerobes\nPip-tazo: Pseudomonas\nSulbactam: Acinetobacter", "MRSA, CRE\n(class-dependent)", "%T>MIC", "Pip-Tazo + Vancomycin = ↑AKI risk"],
["Glycopeptides", "Vancomycin\nTeicoplanin", "Gram-positive ONLY\nMRSA, VRE (vancomycin)", "ALL gram-negatives\nVRE (teicoplanin)", "AUC/MIC\n(vancomycin)", "Nephrotoxicity\nRed Man Syndrome\nOtotoxicity"],
["Advanced BLIs", "Ceftaz/Avibactam\nMero/Vaborbactam\nCefiderocol", "MDR/XDR gram-negatives\nCRE, CRPA, CRAB", "Metallo-BL (most)\n(exception: cefiderocol)", "%T>MIC", "Reserved for MDR only"],
["Anti-MRSA", "Linezolid\nDaptomycin", "Gram-positive ONLY\nMRSA, VRE, VISA", "ALL gram-negatives", "AUC (daptomycin)\nTime (linezolid)", "Linezolid: serotonin syndrome, myelosuppression\nDaptomycin: myopathy; NOT for pneumonia"],
["Aminoglycosides", "Amikacin\nGentamicin\nTobramycin", "Gram-negative aerobes\nSynergy vs. G+", "Anaerobes, G+\n(except synergy)", "Cmax/MIC\n(conc-dependent)", "Nephrotoxicity\nOtotoxicity (irreversible)\nNMJ blockade"],
["Fluoroquinolones", "Ciprofloxacin\nLevofloxacin\nMoxifloxacin", "Broad G+/G-\nAtypicals (Legionella, etc)", "Moxifloxacin: NO Pseudomonas", "AUC/MIC\n(conc-dependent)", "QTc prolongation\nTendon rupture\nCNS effects"],
["Polymyxins", "Colistin\nPolymyxin B", "XDR gram-negative ONLY\nAcinetobacter, CRE, CRPA", "Proteus, Serratia, Morganella\nGram-positives", "AUC/MIC", "Nephrotoxicity (~50%)\nNeurotoxicity\nLAST RESORT only"],
["Antifungals", "Fluconazole\nCaspofungin\nVoriconazole\nAmphotericin B", "Candida (class-dependent)\nAspergillus (vori, AmB)\nMucor (AmB only)", "Mucor: azoles & echinocandins fail\nC. krusei: fluconazole fails", "AUC/MIC\n(azoles)\nConc-dep (polyenes)", "AmB: nephrotoxicity, infusion reactions\nVori: visual disturbances, hepatotoxicity"],
]
mt = Table(master_data, colWidths=[2.8*cm, 3*cm, 4*cm, 3*cm, 2.2*cm, 3.5*cm])
mt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 7.5),
("ROWBACKGROUNDS", (0,1), (-1,-1), [LGREY, WHITE]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#aaaaaa")),
("VALIGN", (0,0), (-1,-1), "TOP"),
("PADDING", (0,0), (-1,-1), 4),
]))
story.append(mt)
story.append(Spacer(1, 8))
story.append(Paragraph(
"Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics | Katzung's Basic & Clinical Pharmacology 16e | "
"Medical Microbiology 9e | Goldman-Cecil Medicine | Harrison's Principles of Internal Medicine 22e | The Washington Manual",
NOTE_S
))
doc.build(story)
print(f"PDF created: {OUTPUT}")
python /home/daytona/workspace/meropenem/icu_antibiotics.py
ICU Antibiotics Complete Study Guide
PDF Document · PDF
| Section | Content |
|---|---|
| Cover + TOC | Full table of contents with all 10 classes |
| Class 1 - Carbapenems | Full notes + 2 ICU scenarios (VAP with valproate interaction, ESBL biliary sepsis) |
| Class 2 - Cephalosporins | Generation-by-generation table + ceftriaxone, cefepime, ceftazidime deep dives + cefepime neurotoxicity warning + 2 scenarios |
| Class 3 - Penicillin/BLI combos | Augmentin vs. Pip-Tazo vs. Amp-Sulbactam + Pip-Tazo + Vancomycin AKI warning |
| Class 4 - Glycopeptides | Vancomycin AUC/MIC dosing, Red Man syndrome, VRE resistance + 2 scenarios |
| Class 5 - Advanced BLI combos | MDR decision framework (KPC vs. NDM vs. OXA) + cefiderocol, aztreonam/avibactam |
| Class 6 - Anti-MRSA | Linezolid (serotonin syndrome risk, oral = IV) + Daptomycin (NOT for pneumonia) + 2 scenarios |
| Class 7 - Aminoglycosides | ODD rationale, TDM, synergy concept + nephro/ototoxicity + endocarditis scenario |
| Class 8 - Fluoroquinolones | QTc risk, 100% oral bioavailability, step-down advantage + atypical coverage |
| Class 9 - Polymyxins | Last-resort framework, colistin vs. polymyxin B + XDR Acinetobacter scenario |
| Class 10 - Antifungals | Empiric candidemia algorithm, Mucormycosis = AmB only, C. auris |
| Master Quick Reference | One-page table comparing all 10 classes side by side |
Can we do one thing, move to drug’s as per ladder, first things first. Also the PDF is crowded t certain places like tables and all
~/meropenem/icu_antibiotics_v2.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
OUTPUT = "/home/daytona/workspace/meropenem/ICU_Antibiotics_Ladder_Guide_v2.pdf"
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
rightMargin=1.8*cm, leftMargin=1.8*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="ICU Antibiotics — Narrow to Broad Ladder",
author="Orris Medical"
)
# ── Colours ──────────────────────────────────────────────────────────────────
NAVY = colors.HexColor("#1a3a5c")
BLUE = colors.HexColor("#2563a8")
LBLUE = colors.HexColor("#dbeafe")
TEAL = colors.HexColor("#0f766e")
LTEAL = colors.HexColor("#d1fae5")
RED = colors.HexColor("#b91c1c")
LRED = colors.HexColor("#fee2e2")
AMBER = colors.HexColor("#b45309")
LAMBER = colors.HexColor("#fef3c7")
PURPLE = colors.HexColor("#6d28d9")
LPURP = colors.HexColor("#ede9fe")
GREY = colors.HexColor("#374151")
LGREY = colors.HexColor("#f3f4f6")
DGREY = colors.HexColor("#6b7280")
WHITE = colors.white
# Ladder step accent colours (narrow → broad → last resort)
STEP_COLORS = [
colors.HexColor("#166534"), # 1 Augmentin — dark green (narrow)
colors.HexColor("#15803d"), # 2 Cephalosporins — green
colors.HexColor("#0f766e"), # 3 Pip-Tazo — teal
colors.HexColor("#0e7490"), # 4 Fluoroquinolones — cyan-teal
colors.HexColor("#1d4ed8"), # 5 Carbapenems — blue
colors.HexColor("#6d28d9"), # 6 Glycopeptides/Anti-MRSA — purple
colors.HexColor("#7c3aed"), # 7 Aminoglycosides — violet
colors.HexColor("#b45309"), # 8 Advanced BLIs — amber
colors.HexColor("#9f1239"), # 9 Polymyxins — dark red (last resort)
colors.HexColor("#166534"), # 10 Antifungals — separate track, dark green
]
s = getSampleStyleSheet()
def ps(name, **kw):
base = kw.pop("parent", s["Normal"])
return ParagraphStyle(name, parent=base, **kw)
TITLE_S = ps("T", fontSize=22, textColor=NAVY, alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=4)
SUB_S = ps("ST", fontSize=10, textColor=BLUE, alignment=TA_CENTER, fontName="Helvetica", spaceAfter=10)
BODY_S = ps("B", fontSize=9.5, leading=14, spaceAfter=5, fontName="Helvetica", alignment=TA_JUSTIFY)
BULLET_S = ps("BL", fontSize=9.5, leading=14, spaceAfter=3, leftIndent=14, fontName="Helvetica")
H2_S = ps("H2", fontSize=11, textColor=NAVY, fontName="Helvetica-Bold", spaceBefore=8, spaceAfter=3)
NOTE_S = ps("N", fontSize=8, textColor=DGREY, fontName="Helvetica-Oblique", leftIndent=8, spaceAfter=4)
WARN_S = ps("W", fontSize=9, textColor=RED, fontName="Helvetica-Bold", leftIndent=8, spaceAfter=4,
backColor=colors.HexColor("#fff1f2"), borderPad=3)
SCENARIO_Q = ps("SQ", fontSize=10, fontName="Helvetica-Bold", textColor=TEAL, spaceBefore=8, spaceAfter=3)
SCENARIO_A = ps("SA", fontSize=9, fontName="Helvetica", textColor=GREY, leftIndent=12,
backColor=colors.HexColor("#f0fdf4"), spaceAfter=6, borderPad=4, leading=13)
story = []
# ════════════════════════════════════════════════════════════════════════════
# HELPERS
# ════════════════════════════════════════════════════════════════════════════
def class_header(step, title, subtitle, acc):
badge = Table(
[[Paragraph(f"STEP {step}", ps(f"badge{step}", fontSize=8, textColor=acc, fontName="Helvetica-Bold")),
Paragraph(title, ps(f"ct{step}", fontSize=15, textColor=WHITE, fontName="Helvetica-Bold")),
Paragraph(subtitle, ps(f"cs{step}", fontSize=8.5, textColor=colors.HexColor("#ffffffcc"), fontName="Helvetica-Oblique"))]],
colWidths=[1.8*cm, 9*cm, 5.7*cm],
style=[
("BACKGROUND", (0,0), (-1,-1), acc),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("PADDING", (0,0), (-1,-1), 9),
("TOPPADDING", (0,0), (-1,-1), 11),
("BOTTOMPADDING", (0,0), (-1,-1), 11),
]
)
return [PageBreak(), Spacer(1,4), badge, Spacer(1,10)]
def mk_table(data, col_widths, acc=NAVY, tbl_font=8, row_pad=5):
t = Table(data, colWidths=col_widths)
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), acc),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), tbl_font),
("LEADING", (0,0), (-1,-1), tbl_font + 3),
("ROWBACKGROUNDS",(0,1),(-1,-1), [LGREY, WHITE]),
("GRID", (0,0), (-1,-1), 0.35, colors.HexColor("#cccccc")),
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), row_pad),
("RIGHTPADDING", (0,0), (-1,-1), row_pad),
("TOPPADDING", (0,0), (-1,-1), row_pad + 1),
("BOTTOMPADDING",(0,0), (-1,-1), row_pad + 1),
]))
return t
def b(text): return Paragraph(f"• {text}", BULLET_S)
def body(text): return Paragraph(text, BODY_S)
def h2(text): return Paragraph(text, H2_S)
def note(text): return Paragraph(text, NOTE_S)
def warn(text): return Paragraph(text, WARN_S)
def sp(h=6): return Spacer(1, h)
def hr(): return HRFlowable(width="100%", thickness=0.4, color=colors.HexColor("#dddddd"), spaceAfter=5, spaceBefore=5)
def scenario(q, a):
return KeepTogether([
Paragraph(f"🏥 {q}", SCENARIO_Q),
Paragraph(a, SCENARIO_A),
])
# ════════════════════════════════════════════════════════════════════════════
# COVER PAGE
# ════════════════════════════════════════════════════════════════════════════
story.append(Spacer(1, 20))
story.append(Paragraph("ICU ANTIBIOTICS", TITLE_S))
story.append(Paragraph("Complete Study Guide — Narrow to Broad Ladder", SUB_S))
story.append(HRFlowable(width="85%", thickness=2.5, color=NAVY, spaceAfter=14, hAlign="CENTER"))
# Ladder visual
ladder = [
["Step", "Class", "Key Drugs", "Coverage Level"],
["1", "Penicillin/BLI Combos", "Augmentin (Amox-Clav), Amp-Sulbactam", "Narrow-Moderate"],
["2", "Cephalosporins", "Ceftriaxone, Cefepime, Ceftazidime, Cefazolin", "Moderate → Broad"],
["3", "Penicillin/BLI — Anti-Pseudomonal", "Piperacillin-Tazobactam (Pip-Tazo)", "Broad incl. Pseudomonas"],
["4", "Fluoroquinolones", "Ciprofloxacin, Levofloxacin, Moxifloxacin", "Broad + Atypicals"],
["5", "Carbapenems", "Meropenem, Imipenem, Ertapenem", "Very Broad"],
["6", "Glycopeptides / Anti-MRSA", "Vancomycin, Teicoplanin, Linezolid, Daptomycin", "Gram-positive specialists"],
["7", "Aminoglycosides", "Amikacin, Gentamicin, Tobramycin", "Gram-negative + synergy"],
["8", "Advanced BLI Combos", "Ceftaz/Avibactam, Mero/Vaborbactam, Cefiderocol", "MDR/XDR gram-negatives"],
["9", "Polymyxins", "Colistin, Polymyxin B", "XDR — Last Resort"],
["10", "Antifungals", "Fluconazole, Caspofungin, Voriconazole, AmB", "Fungal (separate track)"],
]
lt = Table(ladder, colWidths=[1.2*cm, 4.5*cm, 6.5*cm, 4.3*cm])
lt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("LEADING", (0,0), (-1,-1), 12),
("ROWBACKGROUNDS",(0,1),(-1,-1), [LGREY, WHITE]),
("GRID", (0,0), (-1,-1), 0.35, colors.HexColor("#cccccc")),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING",(0,0), (-1,-1), 6),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
# Color code step numbers
("TEXTCOLOR", (0,1), (0,2), colors.HexColor("#166534")),
("TEXTCOLOR", (0,3), (0,4), colors.HexColor("#0f766e")),
("TEXTCOLOR", (0,5), (0,5), colors.HexColor("#1d4ed8")),
("TEXTCOLOR", (0,6), (0,6), colors.HexColor("#6d28d9")),
("TEXTCOLOR", (0,7), (0,7), colors.HexColor("#7c3aed")),
("TEXTCOLOR", (0,8), (0,8), colors.HexColor("#b45309")),
("TEXTCOLOR", (0,9), (0,9), colors.HexColor("#9f1239")),
("TEXTCOLOR", (0,10),(0,10),colors.HexColor("#166534")),
]))
story.append(lt)
story.append(sp(8))
story.append(Paragraph(
"Skeleton for every drug: Class → Mechanism → Spectrum → PK → Dose → ADRs → Clinical Use",
ps("SK", fontSize=9, textColor=NAVY, fontName="Helvetica-Bold", leftIndent=6, spaceAfter=4,
backColor=LBLUE, borderPad=5)
))
story.append(sp(6))
story.append(note("For each step: Full notes → Key points → Critical warnings → ICU scenarios"))
story.append(note("Sources: Goodman & Gilman's | Katzung's 16e | Goldman-Cecil | Harrison's 22e | Washington Manual"))
# ════════════════════════════════════════════════════════════════════════════
# STEP 1: PENICILLIN/BLI COMBOS (Augmentin, Amp-Sulbactam)
# ════════════════════════════════════════════════════════════════════════════
acc = STEP_COLORS[0]
story += class_header(1, "PENICILLIN / BLI COMBOS", "Narrow-Moderate | First rung of the ladder", acc)
story.append(body(
"These combine a penicillin (binds PBPs → inhibits cell wall cross-linking) with a "
"beta-lactamase inhibitor (BLI) that blocks the enzymes bacteria use to destroy the penicillin. "
"Result: activity is restored against many beta-lactamase-producing organisms. "
"This is the <b>first step</b> on the ladder — used for community-acquired and mild-moderate hospital infections."
))
story.append(sp(6))
step1_data = [
["Drug", "Components", "Route / Dose", "Spectrum", "Primary Use", "NOT for"],
["Augmentin\n(Amoxicillin-\nClavulanate)",
"Amoxicillin\n+ Clavulanic acid",
"625 mg PO q8h\n1.2 g IV q8h",
"Gram+, many Gram-,\nAnaerobes,\nbeta-lactamase producers",
"CAP, UTI, skin/soft tissue,\nmild aspiration pneumonia,\nbiliary (mild), diabetic foot,\nstep-down oral therapy",
"Pseudomonas,\nMRSA, CRE,\nNosocomial pathogens"],
["Amp-Sulbactam\n(Unasyn)",
"Ampicillin\n+ Sulbactam",
"3 g IV q6h",
"Gram+, Gram-, Anaerobes;\nSulbactam has intrinsic\nactivity vs. Acinetobacter",
"Acinetobacter infections\n(sulbactam is intrinsically active),\naspiration pneumonia",
"Pseudomonas,\nESBL producers,\nMRSA"],
]
story.append(mk_table(step1_data, [3*cm, 3*cm, 3*cm, 4*cm, 4*cm, 3.5*cm], acc))
story.append(sp(8))
story.append(h2("Key Points"))
story.append(b("Clavulanate inhibits Class A beta-lactamases — restores activity against Staph aureus, H. influenzae, E. coli (non-ESBL), Klebsiella (non-ESBL), Moraxella, Bacteroides"))
story.append(b("Augmentin is mainly a <b>step-down / floor drug</b> in ICU — not first-line for nosocomial infections"))
story.append(b("Sulbactam has intrinsic antibacterial activity against Acinetobacter baumannii — useful when carbapenems not available"))
story.append(b("Neither covers Pseudomonas aeruginosa — escalate to Pip-Tazo or carbapenem if Pseudomonas suspected"))
story.append(warn("⚠ Augmentin: Hepatotoxicity risk with prolonged use — avoid courses >14 days if possible. Cholestatic jaundice more common with clavulanate."))
story.append(sp(6))
story.append(scenario(
"Scenario — 45-year-old, community-onset right lower lobe pneumonia, no prior antibiotics, no risk factors for resistant organisms. Mild-moderate severity. Oral route available. What do you prescribe?",
"Augmentin 625 mg PO q8h (covers S. pneumoniae, H. influenzae, Moraxella, oral flora). Add azithromycin if atypical cover needed (Legionella, Mycoplasma, Chlamydia). Augmentin is sufficient — no need to escalate to cephalosporins or carbapenems in this low-risk community-acquired case."
))
# ════════════════════════════════════════════════════════════════════════════
# STEP 2: CEPHALOSPORINS
# ════════════════════════════════════════════════════════════════════════════
acc = STEP_COLORS[1]
story += class_header(2, "CEPHALOSPORINS", "Moderate → Broad | Community & hospital infections", acc)
story.append(body(
"Cephalosporins are beta-lactams divided into 5 generations. Each generation has "
"progressively better gram-negative coverage with variable gram-positive activity. "
"They all bind PBPs to inhibit peptidoglycan cross-linking. "
"<b>None cover MRSA</b> (except ceftaroline, 5th gen), Enterococcus, Listeria, or atypical organisms."
))
story.append(sp(6))
gen_data = [
["Gen", "Drug", "Gram+", "Gram-", "ICU Role"],
["1st", "Cefazolin", "Excellent\n(Staph, Strep)", "Limited\n(E. coli, Klebsiella, Proteus)", "Surgical prophylaxis\nMSSA bacteremia"],
["2nd", "Cefuroxime\nCefoxitin", "Good", "Extended\n(+ H. influenzae, Klebsiella)", "Rarely in ICU; community-onset"],
["3rd", "Ceftriaxone\n(no Pseudomonas)\nCeftazidime\n(Pseudomonas ✓)", "Good (ceftriaxone)\nPoor (ceftazidime)", "Broad; ceftazidime\ncovers Pseudomonas", "CAP, meningitis, biliary (ceftriaxone)\nPseudomonas infections (ceftazidime)"],
["4th", "Cefepime", "Similar to ceftriaxone", "Very broad + Pseudomonas\n+ AmpC-stable", "HAP/VAP, febrile neutropenia\nNosocomial infections"],
["5th", "Ceftaroline", "MRSA active ✓", "Similar to 3rd gen\n(no Pseudomonas)", "MRSA pneumonia\nComplicated skin infections"],
]
story.append(mk_table(gen_data, [1.5*cm, 3.5*cm, 3.5*cm, 4.5*cm, 4.5*cm], acc))
story.append(sp(8))
story.append(h2("ICU Focus Drugs"))
story.append(sp(2))
# Ceftriaxone
story.append(Paragraph("<b>Ceftriaxone (3rd gen)</b>", ps("cx", fontSize=10, textColor=acc, fontName="Helvetica-Bold", spaceAfter=2)))
story.append(b("Dose: 1-2 g IV q24h (half-life ~8h — once daily convenient)"))
story.append(b("Covers: Streptococci, MSSA, Enterobacterales, H. influenzae, Neisseria meningitidis, Borrelia"))
story.append(b("ICU uses: CAP, meningitis (+ vancomycin), biliary sepsis, step-down for susceptible gram-negatives"))
story.append(b("Does NOT cover: Pseudomonas, MRSA, Enterococcus, ESBL producers, anaerobes"))
story.append(b("ADR: Biliary sludge/cholelithiasis (long courses), hypersensitivity"))
story.append(sp(6))
# Cefepime
story.append(Paragraph("<b>Cefepime (4th gen)</b>", ps("cx2", fontSize=10, textColor=acc, fontName="Helvetica-Bold", spaceAfter=2)))
story.append(b("Dose: 1-2 g IV q8-12h"))
story.append(b("Covers: Pseudomonas, AmpC-producing organisms (Enterobacter, Serratia), broader gram-positive than 3rd gen"))
story.append(b("ICU uses: HAP/VAP, febrile neutropenia, nosocomial gram-negative infections"))
story.append(warn("⚠ Cefepime neurotoxicity: Encephalopathy, myoclonus, seizures — especially with renal impairment. Reduce dose if CrCl <50 mL/min."))
story.append(sp(6))
story.append(scenario(
"Scenario — 58-year-old admitted with severe CAP (SpO2 88%, CXR lobar consolidation), no prior hospital exposure.",
"Ceftriaxone 2 g IV q24h + azithromycin 500 mg PO/IV q24h. Ceftriaxone covers typical CAP pathogens; azithromycin adds atypical cover (Legionella, Mycoplasma). No need for anti-pseudomonal cover in community-onset CAP without risk factors. Review and de-escalate once cultures available."
))
story.append(scenario(
"Scenario — Febrile neutropenic patient, ANC <500, temp 38.8°C, no obvious source. Which cephalosporin?",
"Cefepime 2 g IV q8h. Covers Pseudomonas (major threat in neutropenic patients) plus AmpC-producing gram-negatives. Add vancomycin only if suspected line infection, hemodynamic instability, or mucositis with gram-positive risk. Do NOT use ceftriaxone here — no Pseudomonas coverage."
))
# ════════════════════════════════════════════════════════════════════════════
# STEP 3: PIP-TAZO
# ════════════════════════════════════════════════════════════════════════════
acc = STEP_COLORS[2]
story += class_header(3, "PIPERACILLIN-TAZOBACTAM (Pip-Tazo)", "Broad incl. Pseudomonas | ICU empiric workhorse", acc)
story.append(body(
"Piperacillin-tazobactam is the broadest penicillin/BLI combination. Piperacillin "
"(an anti-pseudomonal penicillin) is combined with tazobactam (a BLI). Together they cover "
"gram-positive, gram-negative (including Pseudomonas), and anaerobic organisms. "
"It is one of the most commonly used empiric agents for ICU infections."
))
story.append(sp(6))
pip_data = [
["Parameter", "Details"],
["Drug", "Piperacillin 4 g + Tazobactam 0.5 g per vial"],
["Dose", "4.5 g IV q6h standard\n4.5 g IV q8h as 3-hour extended infusion (preferred in ICU for %T>MIC optimisation)"],
["Spectrum", "Gram-positive (Strep, MSSA — NOT MRSA)\nGram-negative (Enterobacterales, Pseudomonas aeruginosa)\nAnaerobes (Bacteroides fragilis)\n— Does NOT cover MRSA, CRE, carbapenemase producers"],
["PD parameter", "%T>MIC (time-dependent) — extended 3-hour infusion increases time above MIC"],
["ICU uses", "HAP/VAP (Pseudomonas risk), polymicrobial sepsis, intra-abdominal infections, complicated UTI, febrile neutropenia (combination)"],
["Does NOT cover", "MRSA, VRE, ESBL producers (variable — often breaks down), CRE, C. difficile"],
["ADRs", "Hypokalaemia (pipericillin effect), hepatotoxicity (rare), hypersensitivity"],
]
story.append(mk_table(pip_data, [5*cm, 11.5*cm], acc))
story.append(sp(8))
story.append(warn("⚠ Pip-Tazo + Vancomycin combination significantly increases risk of acute kidney injury (AKI) vs. Meropenem + Vancomycin. If vancomycin is required alongside beta-lactam therapy, prefer meropenem as the partner agent. (Network meta-analysis, PMID 39533846, 2025)"))
story.append(sp(4))
story.append(scenario(
"Scenario — ICU patient post-surgery, day 3, fever spike, hypotension. Suspected HAP vs. intra-abdominal source. No MRSA risk. Culture pending. What empiric therapy?",
"Pip-Tazo 4.5 g IV q8h as 3-hour extended infusion. Covers the most likely pathogens in post-surgical ICU infections: gram-negative rods (including Pseudomonas), gram-positive cocci (MSSA, Strep), and anaerobes. Avoid adding vancomycin unless MRSA is suspected (line infection, known MRSA colonisation) — reduces AKI risk."
))
# ════════════════════════════════════════════════════════════════════════════
# STEP 4: FLUOROQUINOLONES
# ════════════════════════════════════════════════════════════════════════════
acc = STEP_COLORS[3]
story += class_header(4, "FLUOROQUINOLONES", "Broad + Atypicals | Step-down advantage", acc)
story.append(body(
"Fluoroquinolones inhibit DNA gyrase (topoisomerase II) and topoisomerase IV — enzymes required for "
"DNA replication and repair. They are bactericidal and concentration-dependent (AUC/MIC). "
"<b>Key advantage:</b> ~100% oral bioavailability makes IV-to-oral step-down seamless. "
"They also cover atypical organisms (Legionella, Mycoplasma, Chlamydia) which beta-lactams miss."
))
story.append(sp(6))
fq_data = [
["Drug", "Dose", "Pseudomonas?", "Atypicals?", "Anaerobes?", "Best ICU Use"],
["Ciprofloxacin",
"400 mg IV q8-12h\n750 mg PO q12h",
"Yes (best)",
"Good",
"No",
"UTI/pyelonephritis, gram-negative bacteremia, combination for Pseudomonas, GI infections"],
["Levofloxacin",
"500-750 mg IV/PO q24h",
"Yes",
"Best",
"Limited",
"CAP (respiratory FQ), HAP step-down, atypical pneumonia, step-down for gram-negatives"],
["Moxifloxacin",
"400 mg IV/PO q24h",
"NO",
"Yes",
"Yes (best)",
"CAP with anaerobic risk, abdominal TB. Do NOT use if Pseudomonas suspected"],
]
story.append(mk_table(fq_data, [3*cm, 3.5*cm, 2.2*cm, 2.2*cm, 2.2*cm, 4.4*cm], acc))
story.append(sp(8))
story.append(h2("Key Points"))
story.append(b("Oral bioavailability ~100% — IV dose = oral dose; ideal for step-down and outpatient completion"))
story.append(b("PD: Concentration-dependent (AUC/MIC) — higher single doses better than low frequent doses for resistant organisms"))
story.append(warn("⚠ QTc prolongation: Risk of Torsades de Pointes. Check ECG and electrolytes (K+, Mg2+) before starting. Avoid co-administration with other QT-prolonging agents."))
story.append(warn("⚠ Resistance is rising sharply — check local antibiogram before empiric use, especially for E. coli UTIs and Pseudomonas."))
story.append(b("Tendon rupture: Particularly Achilles tendon. Risk increases with age, steroids, renal failure"))
story.append(b("CNS toxicity: Seizures, confusion, hallucinations — caution in elderly and CNS disease"))
story.append(b("Drug interaction: Chelated by Mg2+, Ca2+, Al3+, Fe2+ (antacids, supplements) — give 2h apart"))
story.append(sp(6))
story.append(scenario(
"Scenario — CAP patient improving on IV ceftriaxone + azithromycin. Day 3, tolerating orally, temp settling. Step-down time?",
"Switch to oral levofloxacin 750 mg PO q24h (single agent covers both typical and atypical pathogens). Levofloxacin's 100% oral bioavailability means the step-down is clinically equivalent to IV. Earlier step-down reduces IV line complications and hospital stay."
))
# ════════════════════════════════════════════════════════════════════════════
# STEP 5: CARBAPENEMS
# ════════════════════════════════════════════════════════════════════════════
acc = STEP_COLORS[4]
story += class_header(5, "CARBAPENEMS", "Very Broad | Resistant organisms, ESBL, nosocomial sepsis", acc)
story.append(body(
"Carbapenems are the broadest beta-lactams available. They are structurally unique: their "
"five-membered ring is unsaturated with a carbon instead of sulfur (unlike penicillins). "
"This makes them highly resistant to most beta-lactamases. They are the <b>backbone of ICU therapy "
"for resistant gram-negative infections</b> and ESBL-producing organisms."
))
story.append(sp(6))
carb_data = [
["Drug", "Cilastatin?", "Dose", "Pseudomonas?", "CNS Use?", "Key Feature"],
["Meropenem",
"No",
"1-2 g IV q8h\n(extend to 3h for resistant organisms)",
"Yes",
"Preferred",
"No renal dipeptidase degradation; lower seizure risk than imipenem; drug of choice for meningitis"],
["Imipenem/Cilastatin",
"Yes (required)",
"500mg-1g IV q6-8h",
"Yes",
"Avoid",
"Broader gram-positive coverage; higher seizure risk (up to 1.5%) — avoid CNS use"],
["Ertapenem",
"No",
"1 g IV/IM q24h",
"NO",
"No",
"Once-daily advantage; no Pseudomonas/Acinetobacter; useful for ESBL outpatient step-down"],
]
story.append(mk_table(carb_data, [2.5*cm, 2*cm, 4*cm, 2.5*cm, 2.2*cm, 4.3*cm], acc))
story.append(sp(8))
story.append(h2("Key Points"))
story.append(b("PD parameter: %T>MIC (time-dependent) — extended 3-hour infusion improves outcomes for resistant pathogens"))
story.append(b("ESBL-producing Enterobacterales: Carbapenems are the treatment of choice"))
story.append(b("Meropenem/vaborbactam: Add vaborbactam to restore activity vs. KPC-producers (NOT NDM/VIM/IMP)"))
story.append(warn("⚠ CRITICAL drug interaction: ALL carbapenems significantly lower valproic acid levels (~60-70%). Never co-administer. Switch to alternative AED (e.g., levetiracetam) before starting."))
story.append(b("NOT covered by any carbapenem: MRSA, VRE, C. difficile, Burkholderia, Stenotrophomonas, Carbapenemase producers"))
story.append(b("Resistance mechanisms: KPC (Class A), NDM/VIM/IMP (Class B metallo-BL), OXA (Class D) — escalate to advanced BLI combos"))
story.append(sp(6))
story.append(scenario(
"Scenario — ICU day 7 VAP, Pseudomonas on BAL. Meropenem MIC = 4 (susceptible). Patient on valproate for epilepsy. What do you do?",
"Meropenem 2 g IV q8h as 3-hour extended infusion. CRITICAL: Consult neurology and switch valproate to levetiracetam BEFORE starting meropenem — carbapenems drop valproate levels ~70%, risking breakthrough seizures. Document clearly in notes."
))
story.append(scenario(
"Scenario — Post-op biliary sepsis, E. coli ESBL+ on blood cultures. Patient stable. What antibiotic and why?",
"Meropenem 1 g IV q8h (or ertapenem 1 g IV q24h if stable and patient suitable for outpatient IV). ESBL producers are reliably treated with carbapenems — pip-tazo and cephalosporins should NOT be relied on even if in vitro susceptible (inoculum effect). Once stable, ertapenem's once-daily dosing enables outpatient completion."
))
# ════════════════════════════════════════════════════════════════════════════
# STEP 6: GLYCOPEPTIDES / ANTI-MRSA
# ════════════════════════════════════════════════════════════════════════════
acc = STEP_COLORS[5]
story += class_header(6, "GLYCOPEPTIDES & ANTI-MRSA AGENTS", "Gram-positive specialists | MRSA, VRE", acc)
story.append(body(
"These agents provide gram-positive cover when beta-lactams are insufficient — "
"primarily for MRSA and VRE. They work through different mechanisms and each has "
"a critical niche. They have NO gram-negative activity."
))
story.append(sp(6))
gp_data = [
["Drug", "Class", "Mechanism", "Dose", "Spectrum", "Critical Points"],
["Vancomycin",
"Glycopeptide",
"Binds D-Ala-D-Ala terminus of peptidoglycan precursors → blocks transglycosylation + transpeptidation",
"25-30 mg/kg/day IV\n÷ q8-12h\n(AUC-guided dosing)",
"ALL gram-positive:\nMRSA, CoNS, VRE (susceptible), S. pneumoniae\nOral = C. difficile ONLY",
"Red Man Syndrome (rate-related, NOT allergy)\nNephrotoxicity; Ototoxicity\nAUC/MIC target 400-600\nVRE (vanA) resistant"],
["Teicoplanin",
"Glycopeptide",
"Same as vancomycin",
"Loading: 6 mg/kg IV q12h x3\nMaintenance: 6 mg/kg IV q24h",
"Same as vancomycin;\nsome vanB VRE susceptible",
"Once-daily maintenance;\nLess nephrotoxic than vancomycin;\nNot available in USA"],
["Linezolid",
"Oxazolidinone",
"Inhibits 50S ribosomal subunit (unique binding site — no cross-resistance)",
"600 mg IV/PO q12h\n(100% oral bioavailability)",
"MRSA, VRE, VISA, Streptococci\nGood CNS penetration",
"Oral = IV (step-down advantage)\nCNS use: yes\nSerotonin syndrome with SSRIs/MAOIs\nMyelosuppression (>2 weeks use)"],
["Daptomycin",
"Lipopeptide",
"Binds cell membrane (Ca2+-dependent) → depolarisation → cell death",
"6 mg/kg IV q24h (standard)\n8-12 mg/kg for bacteremia/endocarditis",
"MRSA, VRE, VISA — bactericidal\nGram-positive ONLY",
"CANNOT use for pneumonia (inactivated by surfactant!)\nMyopathy — monitor CK weekly\nBeta-lactams can REVERSE daptomycin resistance"],
]
story.append(mk_table(gp_data, [2.5*cm, 2.5*cm, 3.8*cm, 3.5*cm, 3*cm, 4.2*cm], acc))
story.append(sp(8))
story.append(warn("⚠ Vancomycin monitoring: Use AUC/MIC-guided dosing (target 400-600 mg·h/L) — NOT trough-only monitoring. Trough-only has been shown to lead to over- and under-dosing."))
story.append(warn("⚠ Daptomycin + Pneumonia: NEVER use for lung infections — pulmonary surfactant inactivates daptomycin. Use linezolid or vancomycin for MRSA pneumonia instead."))
story.append(warn("⚠ Linezolid + SSRIs/MAOIs/Tramadol: Risk of serotonin syndrome — potentially fatal. Review all concurrent medications before prescribing."))
story.append(sp(6))
story.append(scenario(
"Scenario — MRSA bacteremia with right-sided endocarditis (IVDU). Vancomycin started; MIC = 2, AUC target not being met. Clinical response poor at 72h. What next?",
"Switch to daptomycin 8-12 mg/kg IV q24h (higher dose for endocarditis). Daptomycin is non-inferior to vancomycin for right-sided endocarditis and is bactericidal. Check CK weekly. Perform TOE, refer cardiothoracics if needed, ID consult. Monitor renal function (dose q48h if CrCl <30)."
))
story.append(scenario(
"Scenario — MRSA meningitis post-neurosurgery. Vancomycin not achieving CSF targets. Alternative?",
"Linezolid 600 mg IV q12h. Excellent CNS penetration; active against MRSA. Daptomycin is not suitable (inadequate CNS penetration). Check all drugs for serotonin syndrome risk. Monitor CBC weekly (myelosuppression risk). Oral step-down possible once improving."
))
# ════════════════════════════════════════════════════════════════════════════
# STEP 7: AMINOGLYCOSIDES
# ════════════════════════════════════════════════════════════════════════════
acc = STEP_COLORS[6]
story += class_header(7, "AMINOGLYCOSIDES", "Synergy + MDR gram-negatives | Use with extreme caution", acc)
story.append(body(
"Aminoglycosides are bactericidal agents that bind the 30S ribosomal subunit, causing "
"misreading of mRNA and premature termination of protein synthesis. They are "
"concentration-dependent killers with a significant post-antibiotic effect (PAE). "
"In ICU, they are mainly used for <b>synergy</b> and as part of combination regimens for resistant gram-negative infections."
))
story.append(sp(6))
amino_data = [
["Drug", "Dose (ODD)", "Spectrum Highlight", "Primary ICU Use"],
["Amikacin",
"15-20 mg/kg IV q24h",
"Broadest aminoglycoside; most resistant to modifying enzymes — use when gentamicin/tobramycin resistant",
"MDR gram-negatives; combination therapy for CRE/CRPA when other options exhausted"],
["Gentamicin",
"5-7 mg/kg IV q24h",
"Gram-negative coverage + synergy vs. gram-positive Enterococcus when combined with cell-wall active agents",
"Enterococcal endocarditis synergy (low-dose); gram-negative bacteremia combination therapy"],
["Tobramycin",
"5-7 mg/kg IV q24h",
"Slightly better Pseudomonas activity than gentamicin",
"Pseudomonas infections; inhaled form for CF and VAP adjunct"],
]
story.append(mk_table(amino_data, [2.5*cm, 3.5*cm, 5.5*cm, 5*cm], acc))
story.append(sp(8))
story.append(h2("Pharmacology & TDM"))
story.append(b("PD: Concentration-dependent (Cmax/MIC) + prolonged PAE → once-daily dosing (ODD) preferred"))
story.append(b("ODD: Single large dose gives high peak/MIC ratio + allows trough to fall low (reduces nephrotoxicity)"))
story.append(b("TDM (ODD): Measure trough before next dose — target <1 mg/L for gentamicin/tobramycin, <5 mg/L for amikacin"))
story.append(b("NOT absorbed orally — IV/IM only. Poor CNS penetration. Not useful for anaerobic infections"))
story.append(sp(4))
story.append(warn("⚠ NEPHROTOXICITY: Accumulates in renal tubular cells → ATN. Risk ↑ with prolonged use, high troughs, concurrent nephrotoxins (vancomycin, NSAIDs, contrast). Monitor creatinine daily."))
story.append(warn("⚠ OTOTOXICITY: Cochlear (irreversible high-frequency hearing loss) and vestibular toxicity. Avoid concurrent loop diuretics. Counsel patients on tinnitus/hearing changes."))
story.append(b("Resistance: Aminoglycoside-modifying enzymes (phosphorylation, acetylation, adenylation). Amikacin resistant to most — use when resistance pattern unclear"))
story.append(sp(6))
story.append(scenario(
"Scenario — Enterococcal endocarditis (E. faecalis, ampicillin-susceptible). What is the role of gentamicin?",
"Ampicillin + gentamicin for synergy. Gentamicin alone has no reliable bactericidal activity against Enterococcus, but when a cell-wall active drug (ampicillin) opens the bacterial cell, aminoglycosides gain entry and achieve bactericidal synergy. Use low-dose gentamicin 3 mg/kg/day ÷ q8h (NOT ODD for synergy dosing). Monitor renal function and gentamicin troughs closely. Duration: 2 weeks (native valve), 6 weeks (prosthetic valve)."
))
# ════════════════════════════════════════════════════════════════════════════
# STEP 8: ADVANCED BLI COMBOS
# ════════════════════════════════════════════════════════════════════════════
acc = STEP_COLORS[7]
story += class_header(8, "ADVANCED BLI COMBINATIONS", "MDR/XDR gram-negatives | CRE, CRPA, CRAB", acc)
story.append(body(
"These newer combinations pair existing beta-lactams with novel BLIs designed specifically "
"to overcome carbapenem-resistant organisms. They are reserved for <b>MDR/XDR pathogens</b> — "
"identify the resistance gene first if possible, then choose accordingly."
))
story.append(sp(6))
adv_data = [
["Combination", "BLI Inhibits", "Dose", "Covers", "Does NOT Cover"],
["Ceftazidime/\nAvibactam\n(Avycaz)",
"Class A (KPC)\nClass C (AmpC)\nSome Class D (OXA-48)",
"2.5 g IV q8h\n(3-hour infusion)",
"CRE (KPC), CRPA,\nOXA-48 Klebsiella",
"Metallo-BL (NDM, VIM, IMP)"],
["Meropenem/\nVaborbactam\n(Vabomere)",
"Class A (KPC)\nbest",
"4 g IV q8h\n(3-hour infusion)",
"CRE (KPC)",
"Metallo-BL; less OXA activity"],
["Imipenem/Cilastatin/\nRelebactam\n(Recarbrio)",
"Class A (KPC)\nClass C",
"1.25 g IV q6h",
"CRE (KPC), CRPA",
"Metallo-BL"],
["Cefiderocol\n(Fetroja)",
"Siderophore cephalosporin\n(novel entry mechanism)",
"2 g IV q8h\n(3-hour infusion)",
"Broadest — CRE, CRPA,\nCRAB, NDM (metallo-BL ✓)",
"Limited gram-positive"],
["Aztreonam/\nAvibactam",
"Class B metallo-BL\n(NDM, VIM, IMP ✓)",
"3 g IV q6h",
"NDM/VIM producers\n(critical gap filled!)",
"Non-metallo resistance"],
]
story.append(mk_table(adv_data, [3.5*cm, 3.5*cm, 3*cm, 4*cm, 3.5*cm], acc))
story.append(sp(8))
story.append(h2("MDR Decision Framework"))
story.append(b("Identify resistance gene first: PCR/molecular testing for KPC, NDM, VIM, OXA, IMP"))
story.append(b("KPC-producer (Class A) → Ceftazidime/avibactam OR Meropenem/vaborbactam"))
story.append(b("NDM/VIM/IMP (Class B metallo-BL) → Aztreonam/avibactam OR Cefiderocol"))
story.append(b("XDR Acinetobacter → Cefiderocol, Sulbactam-durlobactam, or high-dose Amp-sulbactam"))
story.append(b("No gene available but carbapenem-resistant → Ceftazidime/avibactam + aztreonam (covers most)"))
story.append(warn("⚠ Always involve Infectious Diseases specialist for XDR/PDR organisms. These agents are costly, have limited stewardship data, and should never be used empirically without clear indication."))
story.append(sp(6))
story.append(scenario(
"Scenario — CRE Klebsiella UTI/bacteremia, KPC gene detected, meropenem MIC >8 (resistant). Patient septic. What do you use?",
"Ceftazidime/avibactam 2.5 g IV q8h (3-hour infusion) — avibactam specifically inhibits KPC. Alternative: meropenem/vaborbactam 4 g IV q8h. Confirm susceptibility testing, mandatory ID consult, source control, repeat cultures at 72h to confirm clearance."
))
# ════════════════════════════════════════════════════════════════════════════
# STEP 9: POLYMYXINS
# ════════════════════════════════════════════════════════════════════════════
acc = STEP_COLORS[8]
story += class_header(9, "POLYMYXINS", "XDR gram-negatives — LAST RESORT | High toxicity", acc)
story.append(body(
"Polymyxins are cationic polypeptide antibiotics that disrupt the outer membrane of gram-negative "
"bacteria by displacing Mg2+ and Ca2+ from LPS, causing membrane permeability and cell death. "
"They are reserved as a last resort for XDR/PDR gram-negative infections where all other options are exhausted."
))
story.append(sp(6))
poly_data = [
["Drug", "Formulation", "Dose", "Spectrum", "Key Toxicity"],
["Colistin\n(Polymyxin E)",
"Given as prodrug Colistimethate Sodium (CMS) — converted in vivo",
"Loading: 9 MU IV stat\nMaintenance: 4.5 MU IV q12h (adjust by CrCl)",
"XDR Acinetobacter baumannii, CRE Klebsiella, CRPA\nNOT: Proteus, Serratia, Morganella, Burkholderia, gram-positive",
"Nephrotoxicity (~50%) — major\nNeurotoxicity (paresthesias, dizziness)\nLoading dose essential"],
["Polymyxin B",
"Direct active compound (not a prodrug)",
"1.5-2.5 mg/kg/day IV\ndivided q12h",
"Same as colistin",
"Less nephrotoxic than colistin (not renally converted)\nNeurotoxicity similar\nInfusion-related hyperpigmentation"],
]
story.append(mk_table(poly_data, [2.5*cm, 3.5*cm, 4.5*cm, 4.5*cm, 3.5*cm], acc))
story.append(sp(8))
story.append(h2("Key Points"))
story.append(warn("⚠ NEPHROTOXICITY: ~50% incidence with colistin. Monitor creatinine daily. Ensure adequate hydration. Consider polymyxin B instead (less nephrotoxic as not renally converted to prodrug)."))
story.append(b("Loading dose is mandatory for colistin — without it, therapeutic levels are not achieved for 48h"))
story.append(b("Combination therapy is preferred over monotherapy: Polymyxin + carbapenem (even if resistant — synergy) ± rifampicin ± fosfomycin"))
story.append(b("Inhaled colistin: Adjunct for XDR VAP — lower systemic toxicity, direct lung delivery"))
story.append(b("Intrinsically resistant: Proteus, Serratia, Morganella, Burkholderia, Stenotrophomonas, all gram-positives"))
story.append(warn("⚠ Never use polymyxins as first-line empiric therapy. Reserve strictly for documented XDR organisms with no alternatives."))
story.append(sp(6))
story.append(scenario(
"Scenario — XDR Acinetobacter baumannii VAP, resistant to all beta-lactams and carbapenems. Colistin MIC = 1. How do you treat?",
"Colistin IV (loading 9 MU, then 4.5 MU q12h adjusted for CrCl) + high-dose IV meropenem (even though resistant — synergistic membrane effect) + inhaled colistin as adjunct. Monitor creatinine daily. If creatinine doubles, discuss dose reduction with pharmacy/ID. ID specialist mandatory."
))
# ════════════════════════════════════════════════════════════════════════════
# STEP 10: ANTIFUNGALS
# ════════════════════════════════════════════════════════════════════════════
acc = STEP_COLORS[9]
story += class_header(10, "ANTIFUNGALS", "Separate track | Candidemia, Aspergillosis, Mucormycosis", acc)
story.append(body(
"Fungal infections carry 30-40% mortality in ICU patients. The most common are "
"candidemia (Candida spp.) and invasive aspergillosis (in immunocompromised patients). "
"Three main classes are used: azoles (ergosterol synthesis inhibitors), echinocandins "
"(cell wall synthesis inhibitors), and polyenes (membrane disruption). "
"<b>Choice depends on species, severity, prior azole exposure, and site of infection.</b>"
))
story.append(sp(6))
af_data = [
["Class", "Drug", "Mechanism", "Dose", "Key Spectrum", "Critical Note"],
["Triazole",
"Fluconazole",
"Inhibits lanosterol 14α-demethylase → blocks ergosterol synthesis",
"400-800 mg IV/PO q24h",
"C. albicans, C. tropicalis, C. parapsilosis\nNOT C. glabrata (variable), C. krusei, C. auris",
"Step-down once C. albicans confirmed & patient stable\n100% oral bioavailability — IV = oral"],
["Triazole",
"Voriconazole",
"Same (broader than fluconazole)",
"Loading: 6 mg/kg IV q12h x2\nMaintenance: 4 mg/kg IV q12h",
"Aspergillus (treatment of choice)\nBroad Candida spp.\nNOT Mucor/Rhizopus",
"Drug of choice for invasive aspergillosis\nVisual disturbances, photopsia (common, transient)\nHepatatoxicity — LFT monitoring"],
["Echinocandin",
"Caspofungin\nMicafungin\nAnidulafungin",
"Inhibits beta-1,3-glucan synthase → disrupts fungal cell wall (unique target — not present in mammals)",
"Caspo: 70 mg loading → 50 mg q24h\nMicafungin: 100 mg q24h\nAnidula: 200 mg → 100 mg q24h",
"ALL Candida species including azole-resistant C. glabrata and C. krusei\nSome Aspergillus activity",
"FIRST-LINE empiric candidemia in ICU\nFewer drug interactions than azoles\nSafest in liver/renal impairment"],
["Polyene",
"Liposomal\nAmphotericin B\n(AmBisome)",
"Binds ergosterol → forms pores in fungal membrane → cell leakage",
"3-5 mg/kg/day IV",
"Broadest spectrum: ALL Candida, Aspergillus, Mucor/Rhizopus (unique!), Cryptococcus",
"Drug of choice for Mucormycosis\nUse liposomal formulation (less nephrotoxic than conventional)\nInfusion reactions: premedicate with paracetamol ± hydrocortisone"],
]
story.append(mk_table(af_data, [2.2*cm, 2.5*cm, 3.5*cm, 3.5*cm, 4*cm, 4.8*cm], acc))
story.append(sp(8))
story.append(h2("ICU Antifungal Decision Algorithm"))
story.append(b("<b>Empiric candidemia (species unknown):</b> Start echinocandin — broadest Candida cover, least toxicity, fewest interactions"))
story.append(b("<b>Confirmed C. albicans, patient stable:</b> Step down to fluconazole 400 mg PO/IV q24h"))
story.append(b("<b>C. glabrata, C. krusei, C. auris:</b> Continue echinocandin — often fluconazole resistant"))
story.append(b("<b>Invasive aspergillosis:</b> Voriconazole IV (drug of choice) ± echinocandin for salvage therapy"))
story.append(b("<b>Mucormycosis:</b> Liposomal Amphotericin B + urgent surgical debridement — azoles and echinocandins NOT effective"))
story.append(warn("⚠ Conventional amphotericin B (deoxycholate): High nephrotoxicity — use liposomal formulation (AmBisome) in ICU. Monitor K+, Mg2+, and creatinine daily during therapy."))
story.append(b("All candidemia: Remove/replace CVC, ophthalmology review (endophthalmitis risk), echocardiogram (endocarditis risk)"))
story.append(sp(6))
story.append(scenario(
"Scenario — ICU patient, TPN via central line, broad-spectrum antibiotics for 12 days, now febrile with Candida on blood cultures (species pending). What do you start?",
"Caspofungin 70 mg IV loading then 50 mg IV q24h — echinocandin covers all Candida species immediately while awaiting species identification. Remove or replace CVC. Arrange ophthalmology review and echocardiogram. Once species confirmed as C. albicans and patient clinically stable (no endocarditis/endophthalmitis), step down to fluconazole 400 mg PO q24h for 14 days from last negative blood culture."
))
# ════════════════════════════════════════════════════════════════════════════
# MASTER QUICK REFERENCE
# ════════════════════════════════════════════════════════════════════════════
story.append(PageBreak())
story.append(Paragraph("QUICK REFERENCE — Antibiotic Ladder at a Glance", TITLE_S))
story.append(HRFlowable(width="90%", thickness=2, color=NAVY, spaceAfter=10, hAlign="CENTER"))
master = [
["Step", "Class", "Covers", "Does NOT Cover", "PD Param", "Critical Toxicity / Warning"],
["1", "Pen/BLI\n(Augmentin,\nAmp-Sulbactam)",
"G+, G- (non-ESBL)\nAnaerobes",
"Pseudomonas, MRSA\nCRE, ESBL",
"%T>MIC", "Hepatotoxicity (augmentin)"],
["2", "Cephalosporins\n(1st-5th gen)",
"G+/G- (gen-dependent)\nPseudomonas: cefepime, ceftazidime",
"MRSA, Enterococcus\nListeria, anaerobes",
"%T>MIC", "Cefepime: neurotoxicity with renal impairment"],
["3", "Pip-Tazo",
"G+, G-, Pseudomonas\nAnaerobes",
"MRSA, CRE\nESBL (unreliable)",
"%T>MIC", "Pip-Tazo + Vancomycin = ↑AKI risk"],
["4", "Fluoroquinolones\n(Cipro, Levo, Moxi)",
"G+/G-, Atypicals\nCipro/Levo: Pseudomonas",
"Moxi: NO Pseudomonas\nAnaerobes (cipro, levo)",
"AUC/MIC", "QTc prolongation, tendon rupture\n100% oral bioavailability — ideal step-down"],
["5", "Carbapenems\n(Mero, Imi, Erta)",
"Broad G+/G-/Anaerobes\nESBL — treatment of choice\nPseudomonas (mero, imi)",
"MRSA, VRE, C. diff\nCarbapenemase producers\nPseudomonas: NOT ertapenem",
"%T>MIC", "Valproate interaction (ALL carbapenems)\nImipenem: seizures → avoid CNS use"],
["6", "Glycopeptides\n& Anti-MRSA\n(Vanc, Teico,\nLinezolid, Dapto)",
"Gram-positive ONLY\nMRSA, VRE (most)",
"ALL gram-negatives",
"AUC/MIC (vanc)\nAUC (dapto)", "Vanc: Red Man (rate), nephrotoxicity, AUC monitoring\nDapto: NOT for pneumonia (surfactant inactivates)\nLinezolid: serotonin syndrome, myelosuppression"],
["7", "Aminoglycosides\n(Amikacin, Gent,\nTobramycin)",
"Gram-negative aerobes\nSynergy vs. G+ (endocarditis)",
"Anaerobes, G+\n(except synergy)",
"Cmax/MIC", "Nephrotoxicity (cumulative)\nOtotoxicity (irreversible!) — avoid loop diuretics\nTDM mandatory"],
["8", "Advanced BLIs\n(Ceftaz/Avi,\nMero/Vabor,\nCefiderocol)",
"CRE (KPC), CRPA, CRAB\nNDM (cefiderocol, azt/avi)",
"Most: NOT NDM\n(exception: cefiderocol)",
"%T>MIC", "ID specialist mandatory\nNever empiric — confirm resistance gene first"],
["9", "Polymyxins\n(Colistin,\nPolymyxin B)",
"XDR gram-negatives\nAcinetobacter, CRE, CRPA",
"Proteus, Serratia\nMorganella, G+",
"AUC/MIC", "Nephrotoxicity ~50% (colistin)\nLast resort ONLY — always with ID consult"],
["10","Antifungals\n(Fluconazole,\nCaspofungin,\nVoriconazole, AmB)",
"Candida (class-dependent)\nAspergillus (vori, AmB)\nMucor: AmB ONLY",
"Mucor: azoles & echino fail\nC. krusei/auris: fluconazole fails",
"AUC/MIC\n(azoles, echino)", "AmB: nephrotoxicity, infusion reactions — use liposomal\nVori: hepatotoxicity, visual disturbances"],
]
mt = Table(master, colWidths=[1.5*cm, 3.2*cm, 4*cm, 3.2*cm, 1.8*cm, 4.8*cm])
mt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 7.5),
("LEADING", (0,0), (-1,-1), 10),
("ROWBACKGROUNDS",(0,1), (-1,-1), [LGREY, WHITE]),
("GRID", (0,0), (-1,-1), 0.3, colors.HexColor("#cccccc")),
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
]))
story.append(mt)
story.append(sp(10))
story.append(Paragraph(
"Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics | Katzung's Basic & Clinical Pharmacology 16e | "
"Medical Microbiology 9e | Goldman-Cecil Medicine | Harrison's Principles 22e | The Washington Manual of Medical Therapeutics",
NOTE_S
))
doc.build(story)
print(f"PDF created: {OUTPUT}")
python /home/daytona/workspace/meropenem/icu_antibiotics_v2.py
ICU Antibiotics Ladder Guide v2
PDF Document · PDF
The tables are again overcrowded, let’s go to antibiotic classes one by one.
I want full notes with quiz and scenarios as well
~/meropenem/step1_pen_bli.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
OUTPUT = "/home/daytona/workspace/meropenem/Step1_Penicillin_BLI_Combos.pdf"
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
rightMargin=2*cm, leftMargin=2*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="Step 1 — Penicillin/BLI Combos",
author="Orris Medical"
)
GREEN = colors.HexColor("#166534")
LGREEN = colors.HexColor("#dcfce7")
MGREEN = colors.HexColor("#16a34a")
DGREY = colors.HexColor("#374151")
LGREY = colors.HexColor("#f3f4f6")
MGREY = colors.HexColor("#e5e7eb")
RED = colors.HexColor("#b91c1c")
LRED = colors.HexColor("#fee2e2")
AMBER = colors.HexColor("#b45309")
LAMBER = colors.HexColor("#fef3c7")
BLUE = colors.HexColor("#1d4ed8")
LBLUE = colors.HexColor("#dbeafe")
WHITE = colors.white
NAVY = colors.HexColor("#1a3a5c")
s = getSampleStyleSheet()
def ps(name, **kw):
base = kw.pop("parent", s["Normal"])
return ParagraphStyle(name, parent=base, **kw)
# Styles
TITLE_S = ps("TS", fontSize=22, textColor=GREEN, alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=2)
STEP_S = ps("SS", fontSize=10, textColor=MGREEN, alignment=TA_CENTER, fontName="Helvetica", spaceAfter=10)
SECTION_S = ps("SEC", fontSize=13, textColor=WHITE, fontName="Helvetica-Bold", spaceAfter=0)
H2_S = ps("H2", fontSize=11, textColor=GREEN, fontName="Helvetica-Bold", spaceBefore=10, spaceAfter=4)
H3_S = ps("H3", fontSize=10, textColor=DGREY, fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=2)
BODY_S = ps("B", fontSize=10, leading=15, spaceAfter=5, fontName="Helvetica", alignment=TA_JUSTIFY)
BULLET_S = ps("BL", fontSize=10, leading=14, spaceAfter=4, leftIndent=16, fontName="Helvetica")
NOTE_S = ps("N", fontSize=8.5, textColor=colors.HexColor("#6b7280"), fontName="Helvetica-Oblique", spaceAfter=4)
WARN_S = ps("W", fontSize=9.5, textColor=RED, fontName="Helvetica-Bold", spaceAfter=4,
backColor=LRED, borderPad=5, leading=14)
TIP_S = ps("TIP", fontSize=9.5, textColor=AMBER, fontName="Helvetica-Bold", spaceAfter=4,
backColor=LAMBER, borderPad=5, leading=14)
DRUG_TITLE = ps("DT", fontSize=12, textColor=WHITE, fontName="Helvetica-Bold")
QUIZ_Q_S = ps("QQ", fontSize=11, textColor=NAVY, fontName="Helvetica-Bold", spaceBefore=10, spaceAfter=3)
QUIZ_A_S = ps("QA", fontSize=10, textColor=GREEN, fontName="Helvetica", leftIndent=14,
backColor=LGREEN, borderPad=5, spaceAfter=4, leading=14)
ANS_LBL_S = ps("AL", fontSize=8.5, textColor=colors.HexColor("#9ca3af"), fontName="Helvetica-Bold",
leftIndent=14, spaceBefore=2, spaceAfter=1)
SCEN_Q_S = ps("SQ", fontSize=10.5, textColor=colors.HexColor("#0f766e"), fontName="Helvetica-Bold",
spaceBefore=8, spaceAfter=3)
SCEN_A_S = ps("SA", fontSize=10, textColor=DGREY, fontName="Helvetica", leftIndent=14,
backColor=colors.HexColor("#f0fdf4"), borderPad=5, spaceAfter=6, leading=14)
story = []
# ── helpers ────────────────────────────────────────────────────────────────
def sp(h=8): return Spacer(1, h)
def hr(col=colors.HexColor("#d1d5db")):
return HRFlowable(width="100%", thickness=0.5, color=col, spaceAfter=6, spaceBefore=6)
def b(text): return Paragraph(f"• {text}", BULLET_S)
def body(text): return Paragraph(text, BODY_S)
def h2(text): return Paragraph(text, H2_S)
def h3(text): return Paragraph(text, H3_S)
def note(text): return Paragraph(text, NOTE_S)
def warn(text): return Paragraph(text, WARN_S)
def tip(text): return Paragraph(text, TIP_S)
def section_banner(title, color=GREEN):
tbl = Table(
[[Paragraph(f" {title}", SECTION_S)]],
colWidths=[16.6*cm]
)
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), color),
("TOPPADDING", (0,0),(-1,-1), 10),
("BOTTOMPADDING", (0,0),(-1,-1), 10),
("LEFTPADDING", (0,0),(-1,-1), 8),
]))
return [tbl, sp(8)]
def drug_card(name, color=GREEN):
tbl = Table(
[[Paragraph(f" {name}", DRUG_TITLE)]],
colWidths=[16.6*cm]
)
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), color),
("TOPPADDING", (0,0),(-1,-1), 8),
("BOTTOMPADDING", (0,0),(-1,-1), 8),
("LEFTPADDING", (0,0),(-1,-1), 10),
]))
return [tbl, sp(6)]
def info_row(label, value, bg=LGREY):
tbl = Table(
[[Paragraph(label, ps(f"il{label}", fontSize=9.5, fontName="Helvetica-Bold", textColor=GREEN)),
Paragraph(value, ps(f"iv{label}", fontSize=9.5, fontName="Helvetica", textColor=DGREY, leading=14))]],
colWidths=[4*cm, 12.6*cm]
)
tbl.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), 8),
("RIGHTPADDING", (0,0),(-1,-1), 8),
("VALIGN", (0,0),(-1,-1), "TOP"),
("LINEBELOW", (0,0),(-1,-1), 0.3, colors.HexColor("#d1d5db")),
]))
return tbl
def scenario(q, a):
return KeepTogether([
Paragraph(f"🏥 {q}", SCEN_Q_S),
Paragraph(a, SCEN_A_S),
])
def quiz_item(q, a):
return KeepTogether([
Paragraph(q, QUIZ_Q_S),
Paragraph("Answer", ANS_LBL_S),
Paragraph(a, QUIZ_A_S),
hr(),
])
# ══════════════════════════════════════════════════════════════
# COVER
# ══════════════════════════════════════════════════════════════
story.append(sp(16))
story.append(Paragraph("STEP 1 OF THE LADDER", STEP_S))
story.append(Paragraph("Penicillin / BLI Combinations", TITLE_S))
story.append(sp(4))
story.append(HRFlowable(width="70%", thickness=2, color=GREEN, spaceAfter=12, hAlign="CENTER"))
story.append(Paragraph("Amoxicillin-Clavulanate (Augmentin) · Ampicillin-Sulbactam (Unasyn) · Piperacillin-Tazobactam (Pip-Tazo)", STEP_S))
story.append(sp(12))
# Ladder position reminder
ladder_tbl = Table(
[[Paragraph("Narrow", ps("ln", fontSize=9, textColor=GREEN, fontName="Helvetica-Bold")),
Paragraph("→ Step 1: Pen/BLI → Step 2: Cephalosporins → Step 3: FQs → Step 4: Carbapenems → Last Resort",
ps("lc", fontSize=9, textColor=DGREY, fontName="Helvetica")),
Paragraph("Broad", ps("lb", fontSize=9, textColor=RED, fontName="Helvetica-Bold"))]],
colWidths=[2*cm, 12*cm, 2*cm]
)
ladder_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), LGREY),
("PADDING", (0,0),(-1,-1), 8),
("VALIGN", (0,0),(-1,-1), "MIDDLE"),
("ALIGN", (2,0),(2,0), "RIGHT"),
]))
story.append(ladder_tbl)
story.append(sp(10))
story.append(note("Contents: Class Overview · BLI Concept · Drug-by-Drug Notes · Key Clinical Points · Warnings · Quiz · ICU Scenarios"))
# ══════════════════════════════════════════════════════════════
# SECTION 1: CLASS OVERVIEW
# ══════════════════════════════════════════════════════════════
story.append(PageBreak())
story += section_banner("1. CLASS OVERVIEW")
story.append(body(
"Penicillins are beta-lactam antibiotics that work by binding to <b>Penicillin-Binding Proteins (PBPs)</b> "
"on the bacterial cell membrane. This inhibits <b>transpeptidation</b> — the final cross-linking step in "
"peptidoglycan cell wall synthesis — leading to a weak, unstable wall and eventual bacterial cell lysis."
))
story.append(body(
"The limitation of plain penicillins is that many bacteria produce <b>beta-lactamase enzymes</b> that "
"hydrolyse the beta-lactam ring, destroying the antibiotic before it can reach its target. "
"Beta-lactamase inhibitors (BLIs) solve this problem."
))
story.append(sp(6))
story.append(h2("The Beta-Lactamase Inhibitor (BLI) Concept"))
story.append(body(
"BLIs are molecules that structurally resemble beta-lactams but have <b>very weak antibacterial activity "
"on their own</b>. Their job is to act as a <b>'suicide inhibitor'</b> — they bind irreversibly to the "
"beta-lactamase enzyme, blocking it and protecting the companion antibiotic from destruction."
))
story.append(sp(4))
story.append(b("<b>Clavulanic acid</b> (in Augmentin) — inhibits Class A beta-lactamases (TEM, SHV types); produced by Streptomyces clavuligerus"))
story.append(b("<b>Sulbactam</b> (in Unasyn) — inhibits Class A beta-lactamases; ALSO has intrinsic antibacterial activity against Acinetobacter baumannii"))
story.append(b("<b>Tazobactam</b> (in Pip-Tazo) — inhibits Class A and some Class C beta-lactamases; broadest of the three traditional BLIs"))
story.append(sp(6))
story.append(h2("What BLIs Restore vs. What They Cannot"))
story.append(body(
"BLIs work <b>only</b> when resistance is due to beta-lactamase production that the inhibitor can block. "
"They do not help if resistance is due to:"
))
story.append(b("Altered PBPs (e.g., MRSA — the PBP2a target doesn't bind beta-lactams at all)"))
story.append(b("Porin loss — drug can't enter the bacterium"))
story.append(b("Efflux pumps — drug is pumped out before it reaches the PBP"))
story.append(b("AmpC chromosomal beta-lactamases (Class C) — produced by Enterobacter, Pseudomonas, Serratia — traditional BLIs are poor inhibitors of these"))
story.append(b("Carbapenemases (Class A KPC, Class B metallo-BL, Class D OXA) — not inhibited by clavulanate, sulbactam, or tazobactam"))
story.append(sp(6))
tip("💡 Memorise this: If Pseudomonas is resistant to piperacillin, it is ALSO resistant to Pip-Tazo — because tazobactam does not inhibit the chromosomal AmpC beta-lactamase Pseudomonas uses for acquired resistance. Susceptibility to Pip-Tazo requires the piperacillin component itself to be active.")
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 2: DRUG — AUGMENTIN
# ══════════════════════════════════════════════════════════════
story += section_banner("2. AMOXICILLIN-CLAVULANATE (Augmentin)", color=MGREEN)
story.append(h2("Drug Profile"))
story.append(info_row("Class", "Aminopenicillin + BLI (Amoxicillin + Clavulanic acid)"))
story.append(info_row("Route", "Oral (PO) and IV (Intravenous)", bg=WHITE))
story.append(info_row("Oral Doses", "625 mg (500 mg amox + 125 mg clav) PO q8h\n875/125 mg PO q12h (for BID compliance)"))
story.append(info_row("IV Dose", "1.2 g (1000 mg amox + 200 mg clav) IV q8h — adults", bg=WHITE))
story.append(info_row("Half-life", "Amoxicillin ~1.3h; Clavulanate ~1h — both renally cleared"))
story.append(info_row("Renal adj.", "Yes — reduce dose if CrCl <30 mL/min", bg=WHITE))
story.append(sp(8))
story.append(h2("Mechanism of Action"))
story.append(body(
"Amoxicillin binds PBPs and inhibits transpeptidation, blocking peptidoglycan cross-linking. "
"Clavulanic acid binds irreversibly to Class A beta-lactamases, blocking the enzyme and "
"protecting amoxicillin from hydrolysis. Together they extend coverage to organisms that would "
"otherwise destroy plain amoxicillin."
))
story.append(sp(6))
story.append(h2("Spectrum of Activity"))
story.append(body("<b>Covers:</b>"))
story.append(b("Gram-positive: S. aureus (MSSA), Streptococci (S. pneumoniae, S. pyogenes), Enterococcus faecalis"))
story.append(b("Gram-negative: E. coli, Klebsiella pneumoniae, H. influenzae, Moraxella catarrhalis, Proteus mirabilis — where beta-lactamase production is the resistance mechanism"))
story.append(b("Anaerobes: Bacteroides fragilis, Fusobacterium, Prevotella spp."))
story.append(b("Others: Pasteurella multocida (animal bites), Eikenella corrodens (human bites)"))
story.append(sp(4))
story.append(body("<b>Does NOT cover:</b>"))
story.append(b("MRSA — PBP2a alteration, not beta-lactamase production"))
story.append(b("Pseudomonas aeruginosa — intrinsic resistance; chromosomal AmpC not inhibited by clavulanate"))
story.append(b("ESBL-producing organisms — clavulanate cannot inhibit ESBL (though it may appear susceptible in vitro, do not rely on this clinically)"))
story.append(b("Enterococcus faecium — intrinsically more resistant"))
story.append(b("Carbapenemase-producing Klebsiella/E. coli — CRE"))
story.append(sp(6))
story.append(h2("Pharmacokinetics"))
story.append(b("Oral bioavailability: ~90% for amoxicillin, ~75% for clavulanate — excellent oral drug"))
story.append(b("Widely distributed to most tissues; adequate penetration into lung, urinary tract, biliary system, skin/soft tissue"))
story.append(b("NOT reliable for CNS infections — does not penetrate CSF adequately"))
story.append(b("Renally excreted — both components require dose adjustment in renal impairment"))
story.append(sp(6))
story.append(h2("ICU Clinical Uses"))
story.append(b("Community-acquired pneumonia (CAP) — mild to moderate severity, oral or IV"))
story.append(b("Urinary tract infections — complicated UTI / pyelonephritis (community-acquired)"))
story.append(b("Skin and soft tissue infections — cellulitis, diabetic foot (mild-moderate)"))
story.append(b("Dental / orofacial infections — excellent coverage of oral anaerobes and streptococci"))
story.append(b("Animal and human bites — covers Pasteurella (dog/cat) and Eikenella (human)"))
story.append(b("Mild aspiration pneumonia — oral flora plus anaerobes"))
story.append(b("Biliary infections — mild cholangitis / cholecystitis (community-acquired)"))
story.append(b("<b>Step-down therapy</b> — switching from IV antibiotics to oral Augmentin to complete courses"))
story.append(sp(4))
story.append(note("In the ICU, Augmentin is mainly a step-down or floor-level drug. For nosocomial or Pseudomonas-risk infections, escalate to Pip-Tazo or a carbapenem."))
story.append(sp(6))
story.append(h2("Adverse Effects"))
story.append(b("<b>GI upset</b> — diarrhoea, nausea, vomiting (clavulanate is the main culprit — causes GI irritation). Take with food to reduce."))
story.append(b("<b>Hepatotoxicity</b> — the #1 cause of drug-induced liver injury (DILI) in the USA and Europe. Causes mixed or cholestatic hepatitis. May appear AFTER the course ends (long latency). Can rarely cause 'vanishing bile duct syndrome'. Monitor LFTs in prolonged courses."))
story.append(b("<b>Hypersensitivity</b> — rash, urticaria, anaphylaxis (as with all penicillins). Cross-reactivity with cephalosporins ~2% (much less than historically believed)."))
story.append(b("<b>Clostridioides difficile</b> — broad-spectrum coverage disrupts gut flora; C. diff risk with any antibiotic."))
story.append(sp(6))
story.append(warn("⚠ Hepatotoxicity: Augmentin is the most common cause of drug-induced liver injury in the USA. The injury can appear AFTER stopping the drug. Avoid prolonged courses (>14 days). Check LFTs if jaundice, dark urine, or abdominal pain develop."))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 3: DRUG — AMP-SULBACTAM
# ══════════════════════════════════════════════════════════════
story += section_banner("3. AMPICILLIN-SULBACTAM (Unasyn)", color=MGREEN)
story.append(h2("Drug Profile"))
story.append(info_row("Class", "Aminopenicillin + BLI (Ampicillin + Sulbactam)"))
story.append(info_row("Route", "IV only (IM possible but rarely used in ICU)", bg=WHITE))
story.append(info_row("IV Dose", "3 g (2 g ampicillin + 1 g sulbactam) IV q6h"))
story.append(info_row("Half-life", "~1h for both components — renally cleared", bg=WHITE))
story.append(info_row("Renal adj.", "Yes — dose reduce if CrCl <30 mL/min"))
story.append(sp(8))
story.append(h2("The Sulbactam Difference"))
story.append(body(
"Unlike clavulanate and tazobactam, <b>sulbactam itself has direct antibacterial activity against "
"Acinetobacter baumannii</b>. It binds PBP1 and PBP3 of Acinetobacter with high affinity, making it "
"intrinsically bactericidal against susceptible Acinetobacter strains — independent of the ampicillin component."
))
story.append(body(
"This makes amp-sulbactam (or sulbactam alone at high dose) an important option for "
"carbapenem-susceptible Acinetobacter infections, and it is sometimes used even for carbapenem-resistant "
"Acinetobacter (CRAB) as part of combination therapy."
))
story.append(sp(6))
story.append(h2("Spectrum"))
story.append(body("<b>Covers:</b>"))
story.append(b("Gram-positive: MSSA, Streptococci, Enterococcus faecalis"))
story.append(b("Gram-negative: E. coli, Klebsiella, H. influenzae, Proteus, Moraxella — where BL is the mechanism"))
story.append(b("<b>Acinetobacter baumannii</b> — sulbactam's intrinsic antibacterial target"))
story.append(b("Anaerobes: Bacteroides fragilis (reasonable coverage)"))
story.append(sp(4))
story.append(body("<b>Does NOT cover:</b>"))
story.append(b("MRSA, Pseudomonas aeruginosa, ESBL-producers, CRE"))
story.append(b("Serratia marcescens — produces a beta-lactamase that sulbactam cannot inhibit"))
story.append(sp(6))
story.append(h2("ICU Clinical Uses"))
story.append(b("Acinetobacter baumannii infections — particularly HAP/VAP and bloodstream infections where Acinetobacter is susceptible"))
story.append(b("Aspiration pneumonia — good gram-positive, gram-negative, and anaerobic cover"))
story.append(b("Intra-abdominal infections — polymicrobial cover including anaerobes"))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 4: DRUG — PIP-TAZO
# ══════════════════════════════════════════════════════════════
story += section_banner("4. PIPERACILLIN-TAZOBACTAM (Pip-Tazo, Tazocin)", color=GREEN)
story.append(h2("Drug Profile"))
story.append(info_row("Class", "Anti-pseudomonal penicillin + BLI (Piperacillin + Tazobactam)"))
story.append(info_row("Route", "IV only", bg=WHITE))
story.append(info_row("Standard dose","4.5 g (4 g pip + 0.5 g tazo) IV q6-8h"))
story.append(info_row("Extended infusion","4.5 g IV q8h over 3-4 hours (preferred in ICU — see below)", bg=WHITE))
story.append(info_row("Half-life", "~1h piperacillin; ~1h tazobactam — renally cleared"))
story.append(info_row("Renal adj.", "Yes — adjust for CrCl <40 mL/min", bg=WHITE))
story.append(sp(8))
story.append(h2("Why It's the ICU Empiric Workhorse"))
story.append(body(
"Pip-Tazo combines piperacillin — an anti-pseudomonal penicillin with the broadest gram-positive and "
"gram-negative penicillin spectrum — with tazobactam, which inhibits Class A and some Class C beta-lactamases. "
"The result is the <b>broadest-spectrum penicillin combination</b>, covering gram-positives, gram-negatives "
"including Pseudomonas, and anaerobes in a single drug."
))
story.append(sp(6))
story.append(h2("Spectrum of Activity"))
story.append(body("<b>Covers:</b>"))
story.append(b("Gram-positive: MSSA, Streptococci, Enterococcus faecalis"))
story.append(b("Gram-negative: Enterobacterales (E. coli, Klebsiella, Proteus, Enterobacter), <b>Pseudomonas aeruginosa</b>, H. influenzae"))
story.append(b("Anaerobes: Bacteroides fragilis, Fusobacterium, Clostridium spp. (good anaerobic cover)"))
story.append(sp(4))
story.append(body("<b>Does NOT cover:</b>"))
story.append(b("MRSA — PBP2a alteration"))
story.append(b("ESBL-producing organisms — in vitro susceptibility is misleading; clinical outcomes worse than carbapenems (MERINO trial showed increased mortality vs. meropenem for ESBL bacteremia)"))
story.append(b("CRE / carbapenemase producers — tazobactam cannot inhibit KPC, NDM, OXA"))
story.append(b("VRE, C. difficile"))
story.append(sp(6))
story.append(h2("The Extended Infusion Strategy — Why It Matters"))
story.append(body(
"Beta-lactams are <b>time-dependent</b> antibiotics — their killing efficacy depends on the percentage "
"of the dosing interval that the drug concentration stays above the MIC (<b>%T>MIC</b>). "
"A bolus 30-minute infusion gives a high peak then drops off rapidly."
))
story.append(body(
"Extending the infusion to <b>3-4 hours</b> keeps the concentration above the MIC for a longer "
"proportion of the dosing interval — without increasing the total daily dose. "
"This is especially important for resistant organisms with higher MICs."
))
story.append(tip("💡 In the ICU, always prescribe Pip-Tazo as a 3-4 hour extended infusion for nosocomial infections. The same dose (4.5 g q8h) is far more effective when infused slowly. Verify with pharmacy that the drug is stable for 4h in your IV bag."))
story.append(sp(6))
story.append(h2("ICU Clinical Uses"))
story.append(b("Hospital-acquired pneumonia (HAP) and ventilator-associated pneumonia (VAP) — when Pseudomonas is a risk"))
story.append(b("Complicated intra-abdominal infections — covers gram-positives, gram-negatives, and anaerobes polymicrobially"))
story.append(b("Complicated UTI and urosepsis — nosocomial gram-negative cover"))
story.append(b("Febrile neutropenia — often combined with an aminoglycoside or used as monotherapy"))
story.append(b("Bacteremia — nosocomial gram-negative bacteremia (non-ESBL)"))
story.append(b("Skin and soft tissue infections — complicated, hospital-acquired"))
story.append(sp(6))
story.append(h2("Adverse Effects"))
story.append(b("<b>Hypersensitivity</b> — as with all penicillins; cross-reactivity with cephalosporins ~2%"))
story.append(b("<b>Hypokalaemia</b> — piperacillin promotes urinary potassium wasting; monitor K+ in ICU patients on prolonged courses"))
story.append(b("<b>Hepatotoxicity</b> — transient LFT elevations; rare severe hepatitis"))
story.append(b("<b>Neurotoxicity</b> — rare seizures at very high doses; more risk with renal impairment"))
story.append(b("<b>C. difficile</b> — disruption of gut flora"))
story.append(sp(6))
story.append(warn("⚠ CRITICAL — Pip-Tazo + Vancomycin: This combination is associated with a significantly higher rate of acute kidney injury (AKI) compared to Meropenem + Vancomycin. A 2025 network meta-analysis (PMID 39533846) confirms this. If the patient needs both anti-gram-negative and anti-MRSA cover, prefer Meropenem + Vancomycin over Pip-Tazo + Vancomycin."))
story.append(sp(4))
story.append(warn("⚠ ESBL trap: Pip-Tazo may appear susceptible to ESBL-producing organisms on susceptibility testing, but clinical outcomes are worse than carbapenems. The MERINO trial (2018) showed significantly higher mortality with Pip-Tazo vs. Meropenem for ESBL bacteremia. Do NOT rely on Pip-Tazo for ESBL infections — use a carbapenem."))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 5: KEY COMPARISON
# ══════════════════════════════════════════════════════════════
story += section_banner("5. SIDE-BY-SIDE COMPARISON", color=colors.HexColor("#0f766e"))
rows = [
("Feature", "Augmentin\n(Amox-Clav)", "Amp-Sulbactam\n(Unasyn)", "Pip-Tazo"),
("Route", "PO / IV", "IV (± IM)", "IV only"),
("Pseudomonas", "No", "No", "Yes"),
("MRSA", "No", "No", "No"),
("Acinetobacter", "No", "Yes (sulbactam active)", "No"),
("Anaerobes", "Yes", "Yes", "Yes (best of 3)"),
("ESBL", "No", "No", "No (avoid despite in vitro)"),
("PD parameter", "%T>MIC", "%T>MIC", "%T>MIC"),
("Infusion", "30 min", "30 min", "3-4h extended (preferred)"),
("Key ADR", "Hepatotoxicity\n(cholestatic)", "Hypersensitivity", "AKI with vancomycin\nHypokalaemia"),
("ICU ladder position","Step-down / floor drug", "Acinetobacter-specific niche", "Empiric broad-spectrum workhorse"),
]
tbl_data = [[Paragraph(cell, ps(f"ct{i}{j}", fontSize=9, fontName="Helvetica-Bold" if j==0 else "Helvetica",
textColor=WHITE if j==0 and i==0 else (GREEN if j==0 else DGREY),
leading=12))
for j, cell in enumerate(row)]
for i, row in enumerate(rows)]
comp = Table(tbl_data, colWidths=[4.2*cm, 4*cm, 4*cm, 4.4*cm])
comp.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,0), GREEN),
("TEXTCOLOR", (0,0),(-1,0), WHITE),
("BACKGROUND", (0,1),(0,-1), LGREEN),
("ROWBACKGROUNDS",(1,1),(-1,-1), [WHITE, LGREY]),
("GRID", (0,0),(-1,-1), 0.4, colors.HexColor("#d1d5db")),
("VALIGN", (0,0),(-1,-1), "TOP"),
("TOPPADDING", (0,0),(-1,-1), 7),
("BOTTOMPADDING", (0,0),(-1,-1), 7),
("LEFTPADDING", (0,0),(-1,-1), 7),
("RIGHTPADDING", (0,0),(-1,-1), 7),
]))
story.append(comp)
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 6: ICU SCENARIOS
# ══════════════════════════════════════════════════════════════
story.append(PageBreak())
story += section_banner("6. ICU SCENARIOS", color=colors.HexColor("#0f766e"))
story.append(scenario(
"Scenario 1 — Community pneumonia, oral route available, no resistance risk",
"45-year-old, community-onset right lower lobe pneumonia, mild-moderate severity (CURB-65 score 1), "
"no prior antibiotics, no hospital exposure in past 3 months, tolerating orally.\n\n"
"Choice: Augmentin 625 mg PO q8h + azithromycin 500 mg PO q24h (if atypical cover needed). "
"Augmentin covers S. pneumoniae, H. influenzae, Moraxella, and oral flora. No need for "
"IV or anti-pseudomonal cover. Step down or discharge with oral completion."
))
story.append(scenario(
"Scenario 2 — Aspiration pneumonia, ICU admission",
"68-year-old post-cardiac arrest patient, intubated, witnessed aspiration of gastric contents. "
"CXR shows right lower lobe infiltrate. Sputum grows mixed oral flora including anaerobes.\n\n"
"Choice: Pip-Tazo 4.5 g IV q8h as 3-hour extended infusion. Covers oral streptococci, "
"gram-negative rods, and anaerobes in a single agent. No MRSA risk identified. If improving at 72h "
"and tolerating enteral route, consider step-down to Augmentin 1.2 g IV or 625 mg PO q8h."
))
story.append(scenario(
"Scenario 3 — HAP/VAP with Pseudomonas risk",
"ICU day 6, ventilated patient, fever 38.9°C, new infiltrate on CXR, purulent secretions. "
"Prior colonisation with Pseudomonas aeruginosa on tracheal swab. Culture pending.\n\n"
"Choice: Pip-Tazo 4.5 g IV q8h extended infusion (covers Pseudomonas). NOT Augmentin "
"(no Pseudomonas cover). If previous carbapenem exposure or local ESBL prevalence is high, "
"escalate to meropenem. Review and de-escalate once sensitivities return."
))
story.append(scenario(
"Scenario 4 — The ESBL trap",
"Blood cultures grow Klebsiella pneumoniae, ESBL-positive. Sensitivity report says "
"'Piperacillin-tazobactam: SUSCEPTIBLE'. Senior resident suggests using Pip-Tazo to spare "
"carbapenems. Is this safe?\n\n"
"No. Despite the in vitro susceptibility result, the MERINO trial (2018) demonstrated "
"significantly higher 30-day mortality with Pip-Tazo vs. Meropenem for ESBL-producing "
"bacteremia. The inoculum effect — where the large bacterial load in bloodstream infections "
"overwhelms the tazobactam BLI — explains this. Use Meropenem 1-2 g IV q8h."
))
story.append(scenario(
"Scenario 5 — Acinetobacter VAP, carbapenem-susceptible",
"ICU day 10 VAP, BAL cultures grow Acinetobacter baumannii. Meropenem MIC = 1 (susceptible). "
"Some colleagues suggest Pip-Tazo, others suggest amp-sulbactam.\n\n"
"Choice: Meropenem (most reliable for susceptible Acinetobacter). However, amp-sulbactam "
"is a reasonable alternative if meropenem needs to be spared, because sulbactam has "
"intrinsic PBP-binding activity against Acinetobacter. Pip-Tazo has NO special Acinetobacter "
"activity and should not be preferred here."
))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 7: ACTIVE RECALL QUIZ
# ══════════════════════════════════════════════════════════════
story.append(PageBreak())
story += section_banner("7. ACTIVE RECALL QUIZ", color=NAVY)
story.append(body("Cover the answers. Answer each question out loud or in writing before revealing. Then check."))
story.append(sp(8))
quiz_items = [
("Q1. What is the mechanism of action of the penicillin component in Augmentin?",
"Binds Penicillin-Binding Proteins (PBPs) → inhibits transpeptidation → blocks peptidoglycan cross-linking → cell wall lysis and bacterial death."),
("Q2. What does clavulanate do, and what does it NOT inhibit?",
"Clavulanate is a BLI that binds irreversibly to Class A beta-lactamases, protecting amoxicillin from destruction. It does NOT inhibit: AmpC (Class C) chromosomal beta-lactamases (Pseudomonas, Enterobacter), Class B metallo-BLs (NDM, VIM), Class D OXA carbapenemases."),
("Q3. Name 4 organisms that Augmentin does NOT cover and state why for each.",
"MRSA — PBP2a alteration, not BL-mediated\nPseudomonas — intrinsic resistance + chromosomal AmpC not inhibited by clavulanate\nESBL Klebsiella/E. coli — ESBL enzyme not reliably inhibited by clavulanate\nCRE — carbapenemases not inhibited at all"),
("Q4. What is the unique property of sulbactam compared to clavulanate and tazobactam?",
"Sulbactam has INTRINSIC antibacterial activity against Acinetobacter baumannii — it binds PBP1 and PBP3 of Acinetobacter directly, independent of the ampicillin component. The other BLIs do not have meaningful direct antibacterial activity."),
("Q5. Why is Pip-Tazo preferred over Augmentin for ICU nosocomial infections?",
"Pip-Tazo covers Pseudomonas aeruginosa (Augmentin does not). It also has broader gram-negative spectrum and better anaerobic coverage. The anti-pseudomonal coverage is essential in nosocomial/HAP/VAP settings where Pseudomonas is a major threat."),
("Q6. What is %T>MIC and why does it matter for Pip-Tazo?",
"%T>MIC = the percentage of the dosing interval that the drug concentration stays above the organism's MIC. Beta-lactams (including Pip-Tazo) are TIME-DEPENDENT killers — efficacy depends on %T>MIC, not peak concentration. Extended 3-4 hour infusions increase %T>MIC without increasing total dose, improving killing of resistant organisms."),
("Q7. The MERINO trial showed what about Pip-Tazo for ESBL bacteremia?",
"The MERINO trial (2018, JAMA) showed significantly HIGHER 30-day mortality with piperacillin-tazobactam compared to meropenem for ESBL-producing E. coli and Klebsiella bacteremia — even when in vitro susceptibility testing showed Pip-Tazo as 'susceptible'. The inoculum effect in bacteremia overcomes tazobactam. Always use a carbapenem for ESBL bacteremia."),
("Q8. What is the critical drug interaction/combination warning for Pip-Tazo in ICU?",
"Pip-Tazo + Vancomycin significantly increases the risk of acute kidney injury (AKI) compared to Meropenem + Vancomycin. If both anti-gram-negative and anti-MRSA coverage are needed simultaneously, prefer Meropenem + Vancomycin. (Network meta-analysis, PMID 39533846, 2025)"),
("Q9. What is the most common drug-induced liver injury (DILI) cause in the USA, and what type of injury does it cause?",
"Amoxicillin-clavulanate (Augmentin) is the most common cause of DILI in the USA and Europe. It causes cholestatic or mixed hepatitis. The injury can appear AFTER stopping the drug (long latency). Rarely causes 'vanishing bile duct syndrome'. Thought to be caused by amoxicillin potentiated by clavulanate."),
("Q10. A patient on Pip-Tazo for 5 days develops a K+ of 3.0 mEq/L. Why?",
"Piperacillin causes renal potassium wasting (urinary K+ loss). Monitor electrolytes regularly in ICU patients on Pip-Tazo. Replace potassium as needed. This is a class effect of anti-pseudomonal penicillins."),
("Q11. Why can't Pip-Tazo cover Pseudomonas if resistance to piperacillin develops?",
"If Pseudomonas is resistant to piperacillin (e.g., via chromosomal AmpC overexpression, efflux pumps, or porin loss), tazobactam CANNOT restore activity because it does not inhibit the chromosomal AmpC beta-lactamase that Pseudomonas uses. The BLI only helps if the resistance is due to a Class A BL that tazobactam can inhibit."),
("Q12. In which of these situations would you choose amp-sulbactam over Pip-Tazo?\na) HAP with Pseudomonas on tracheal swab\nb) Acinetobacter baumannii VAP (carbapenem-susceptible)\nc) Post-op polymicrobial intra-abdominal sepsis",
"Answer: b) Acinetobacter baumannii VAP. Sulbactam has intrinsic PBP-binding activity against Acinetobacter, making amp-sulbactam specifically useful here. For (a), Pip-Tazo is better (Pseudomonas cover). For (c), Pip-Tazo is better (broader polymicrobial and Pseudomonas cover)."),
]
for q, a in quiz_items:
story.append(quiz_item(q, a))
story.append(sp(12))
# Score box
score_tbl = Table(
[[Paragraph("12/12", ps("s1", fontSize=11, textColor=GREEN, fontName="Helvetica-Bold")),
Paragraph("Excellent — move to Step 2", ps("s1t", fontSize=10, fontName="Helvetica", textColor=DGREY))],
[Paragraph("8-11/12", ps("s2", fontSize=11, textColor=AMBER, fontName="Helvetica-Bold")),
Paragraph("Review the gaps, re-test tomorrow before Step 2", ps("s2t", fontSize=10, fontName="Helvetica", textColor=DGREY))],
[Paragraph("<8/12", ps("s3", fontSize=11, textColor=RED, fontName="Helvetica-Bold")),
Paragraph("Re-read Sections 2-4, rebuild the skeleton, then retry", ps("s3t", fontSize=10, fontName="Helvetica", textColor=DGREY))],
],
colWidths=[4*cm, 12.6*cm]
)
score_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,0), LGREEN),
("BACKGROUND", (0,1),(-1,1), LAMBER),
("BACKGROUND", (0,2),(-1,2), LRED),
("GRID", (0,0),(-1,-1), 0.4, colors.HexColor("#d1d5db")),
("PADDING", (0,0),(-1,-1), 8),
("VALIGN", (0,0),(-1,-1), "MIDDLE"),
]))
story.append(score_tbl)
story.append(sp(16))
story.append(note(
"Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics | Katzung's Basic & Clinical Pharmacology 16e | "
"Harrison's Principles of Internal Medicine 22e | MERINO Trial (JAMA 2018) | PMID 39533846 (2025 network meta-analysis)"
))
story.append(note("Next: Step 2 — Cephalosporins (1st through 5th generation, ICU focus)"))
doc.build(story)
print(f"PDF created: {OUTPUT}")
python /home/daytona/workspace/meropenem/step1_pen_bli.py
Step1 Penicillin BLI Combos
PDF Document · PDF
| Section | Content |
|---|---|
| Cover | Ladder position reminder so you always know where you are |
| 1. Class Overview | BLI concept explained clearly — what they do, what they can't do, and the key Pseudomonas trap |
| 2. Augmentin | Full drug card — mechanism, spectrum, PK, ICU uses, ADRs including the hepatotoxicity warning |
| 3. Amp-Sulbactam | Why sulbactam is unique (direct Acinetobacter activity) |
| 4. Pip-Tazo | Full notes including extended infusion rationale, ESBL trap, AKI warning with vancomycin |
| 5. Comparison | Side-by-side of all 3 drugs — no crowded tables, clean row layout |
| 6. ICU Scenarios | 5 clinical cases including the ESBL trap and the Acinetobacter decision |
| 7. Quiz | 12 active recall questions with full answers + scoring guide |
Ok
~/meropenem/step2_cephalosporins.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY
OUTPUT = "/home/daytona/workspace/meropenem/Step2_Cephalosporins.pdf"
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
rightMargin=2*cm, leftMargin=2*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="Step 2 — Cephalosporins",
author="Orris Medical"
)
TEAL = colors.HexColor("#0f766e")
LTEAL = colors.HexColor("#ccfbf1")
MTEAL = colors.HexColor("#14b8a6")
DGREY = colors.HexColor("#374151")
LGREY = colors.HexColor("#f3f4f6")
MGREY = colors.HexColor("#e5e7eb")
RED = colors.HexColor("#b91c1c")
LRED = colors.HexColor("#fee2e2")
AMBER = colors.HexColor("#b45309")
LAMBER = colors.HexColor("#fef3c7")
GREEN = colors.HexColor("#166534")
LGREEN = colors.HexColor("#dcfce7")
NAVY = colors.HexColor("#1a3a5c")
BLUE = colors.HexColor("#1d4ed8")
LBLUE = colors.HexColor("#dbeafe")
WHITE = colors.white
s = getSampleStyleSheet()
def ps(name, **kw):
base = kw.pop("parent", s["Normal"])
return ParagraphStyle(name, parent=base, **kw)
TITLE_S = ps("TS", fontSize=22, textColor=TEAL, alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=2)
STEP_S = ps("SS", fontSize=10, textColor=MTEAL, alignment=TA_CENTER, fontName="Helvetica", spaceAfter=10)
SECTION_S = ps("SEC", fontSize=13, textColor=WHITE, fontName="Helvetica-Bold")
H2_S = ps("H2", fontSize=11, textColor=TEAL, fontName="Helvetica-Bold", spaceBefore=10, spaceAfter=4)
H3_S = ps("H3", fontSize=10, textColor=DGREY, fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=2)
BODY_S = ps("B", fontSize=10, leading=15, spaceAfter=5, fontName="Helvetica", alignment=TA_JUSTIFY)
BULLET_S = ps("BL", fontSize=10, leading=14, spaceAfter=4, leftIndent=16, fontName="Helvetica")
NOTE_S = ps("N", fontSize=8.5, textColor=colors.HexColor("#6b7280"), fontName="Helvetica-Oblique", spaceAfter=4)
WARN_S = ps("W", fontSize=9.5, textColor=RED, fontName="Helvetica-Bold", spaceAfter=4,
backColor=LRED, borderPad=5, leading=14)
TIP_S = ps("TIP", fontSize=9.5, textColor=AMBER, fontName="Helvetica-Bold", spaceAfter=4,
backColor=LAMBER, borderPad=5, leading=14)
DRUG_TITLE = ps("DT", fontSize=12, textColor=WHITE, fontName="Helvetica-Bold")
QUIZ_Q_S = ps("QQ", fontSize=11, textColor=NAVY, fontName="Helvetica-Bold", spaceBefore=10, spaceAfter=3)
QUIZ_A_S = ps("QA", fontSize=10, textColor=TEAL, fontName="Helvetica", leftIndent=14,
backColor=LTEAL, borderPad=5, spaceAfter=4, leading=14)
ANS_LBL_S = ps("AL", fontSize=8.5, textColor=colors.HexColor("#9ca3af"), fontName="Helvetica-Bold",
leftIndent=14, spaceBefore=2, spaceAfter=1)
SCEN_Q_S = ps("SQ", fontSize=10.5, textColor=TEAL, fontName="Helvetica-Bold", spaceBefore=8, spaceAfter=3)
SCEN_A_S = ps("SA", fontSize=10, textColor=DGREY, fontName="Helvetica", leftIndent=14,
backColor=colors.HexColor("#f0fdfa"), borderPad=5, spaceAfter=6, leading=14)
story = []
# ── helpers ────────────────────────────────────────────────────────────────
def sp(h=8): return Spacer(1, h)
def hr(): return HRFlowable(width="100%", thickness=0.5, color=MGREY, spaceAfter=6, spaceBefore=6)
def b(text): return Paragraph(f"• {text}", BULLET_S)
def body(text): return Paragraph(text, BODY_S)
def h2(text): return Paragraph(text, H2_S)
def h3(text): return Paragraph(text, H3_S)
def note(text): return Paragraph(text, NOTE_S)
def warn(text): return Paragraph(text, WARN_S)
def tip(text): return Paragraph(text, TIP_S)
def section_banner(title, color=TEAL):
tbl = Table([[Paragraph(f" {title}", SECTION_S)]], colWidths=[16.6*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), color),
("TOPPADDING", (0,0),(-1,-1), 10),
("BOTTOMPADDING", (0,0),(-1,-1), 10),
("LEFTPADDING", (0,0),(-1,-1), 8),
]))
return [tbl, sp(8)]
def drug_card(name, gen_label="", color=TEAL):
inner = f" {name}"
if gen_label:
inner += f" <font size='9' color='#ccfbf1'>({gen_label})</font>"
tbl = Table([[Paragraph(inner, DRUG_TITLE)]], colWidths=[16.6*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), color),
("TOPPADDING", (0,0),(-1,-1), 8),
("BOTTOMPADDING", (0,0),(-1,-1), 8),
("LEFTPADDING", (0,0),(-1,-1), 10),
]))
return [tbl, sp(6)]
def info_row(label, value, bg=LGREY):
tbl = Table(
[[Paragraph(label, ps(f"il{label[:6]}", fontSize=9.5, fontName="Helvetica-Bold", textColor=TEAL)),
Paragraph(value, ps(f"iv{label[:6]}", fontSize=9.5, fontName="Helvetica", textColor=DGREY, leading=14))]],
colWidths=[4*cm, 12.6*cm]
)
tbl.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), 8),
("RIGHTPADDING", (0,0),(-1,-1), 8),
("VALIGN", (0,0),(-1,-1), "TOP"),
("LINEBELOW", (0,0),(-1,-1), 0.3, colors.HexColor("#d1d5db")),
]))
return tbl
def scenario(q, a):
return KeepTogether([
Paragraph(f"🏥 {q}", SCEN_Q_S),
Paragraph(a, SCEN_A_S),
])
def quiz_item(q, a):
return KeepTogether([
Paragraph(q, QUIZ_Q_S),
Paragraph("Answer", ANS_LBL_S),
Paragraph(a, QUIZ_A_S),
hr(),
])
# ══════════════════════════════════════════════════════════════
# COVER
# ══════════════════════════════════════════════════════════════
story.append(sp(16))
story.append(Paragraph("STEP 2 OF THE LADDER", STEP_S))
story.append(Paragraph("Cephalosporins", TITLE_S))
story.append(sp(4))
story.append(HRFlowable(width="70%", thickness=2, color=TEAL, spaceAfter=12, hAlign="CENTER"))
story.append(Paragraph(
"Cefazolin · Ceftriaxone · Ceftazidime · Cefepime · Ceftaroline",
STEP_S
))
story.append(sp(12))
ladder_tbl = Table(
[[Paragraph("Narrow", ps("ln", fontSize=9, textColor=GREEN, fontName="Helvetica-Bold")),
Paragraph("Step 1: Pen/BLI → <b>Step 2: Cephalosporins</b> → Step 3: Pip-Tazo → Step 4: FQs → Step 5: Carbapenems → Last Resort",
ps("lc", fontSize=9, textColor=DGREY, fontName="Helvetica")),
Paragraph("Broad", ps("lb", fontSize=9, textColor=RED, fontName="Helvetica-Bold"))]],
colWidths=[2*cm, 12*cm, 2*cm]
)
ladder_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), LGREY),
("PADDING", (0,0),(-1,-1), 8),
("VALIGN", (0,0),(-1,-1), "MIDDLE"),
("ALIGN", (2,0),(2,0), "RIGHT"),
]))
story.append(ladder_tbl)
story.append(sp(10))
story.append(note("Contents: Class overview · Generation concept · Drug-by-drug notes (1st–5th gen) · The AmpC trap · Cefepime neurotoxicity · Quiz · ICU Scenarios"))
# ══════════════════════════════════════════════════════════════
# SECTION 1: CLASS OVERVIEW
# ══════════════════════════════════════════════════════════════
story.append(PageBreak())
story += section_banner("1. CLASS OVERVIEW")
story.append(body(
"Cephalosporins are beta-lactam antibiotics derived from the 7-aminocephalosporanic acid (7-ACA) nucleus. "
"Like all beta-lactams, they work by binding <b>Penicillin-Binding Proteins (PBPs)</b> and "
"inhibiting <b>transpeptidation</b> — the cross-linking of peptidoglycan strands in the bacterial cell wall. "
"The result is a structurally weak wall that cannot withstand osmotic pressure → cell lysis → death."
))
story.append(body(
"What makes cephalosporins different from penicillins is their <b>dihydrothiazine ring</b> (six-membered) "
"instead of the thiazolidine ring (five-membered) fused to the beta-lactam. Modifications at the "
"R1 and R2 side chains of the 7-ACA nucleus produce the different generations — each with a "
"progressively different spectrum."
))
story.append(sp(6))
story.append(h2("The Generation Concept — The One Rule to Remember"))
story.append(body(
"As you go from 1st to 4th generation, there is a consistent trade-off:"
))
story.append(b("<b>Gram-positive activity decreases</b> (generally) — 1st gen has the best gram-positive coverage"))
story.append(b("<b>Gram-negative activity increases</b> — each generation adds broader gram-negative coverage"))
story.append(b("<b>Beta-lactamase stability increases</b> — higher generations resist more beta-lactamases"))
story.append(b("<b>5th generation breaks the rule</b> — gains MRSA activity (unique PBP2a binding) but loses Pseudomonas"))
story.append(sp(6))
story.append(h2("What NO Cephalosporin Covers (except exceptions noted)"))
story.append(b("MRSA — except ceftaroline (5th gen) and ceftobiprole"))
story.append(b("Enterococcus spp. — intrinsic resistance"))
story.append(b("Listeria monocytogenes — intrinsic resistance"))
story.append(b("Atypical organisms (Legionella, Mycoplasma, Chlamydia) — no ribosomal target"))
story.append(b("Anaerobes — poor coverage (except cefoxitin, 2nd gen cephamycin)"))
story.append(b("ESBL-producing organisms — ESBLs hydrolyse all cephalosporins"))
story.append(b("Carbapenemase-producing organisms (CRE)"))
story.append(sp(6))
story.append(h2("Resistance Mechanisms"))
story.append(b("Beta-lactamase production (TEM, SHV) — hydrolysis of the beta-lactam ring"))
story.append(b("<b>ESBL (Extended-Spectrum Beta-Lactamases)</b> — hydrolyse all cephalosporins including 3rd/4th gen; plasmid-mediated; common in E. coli and Klebsiella"))
story.append(b("<b>AmpC chromosomal beta-lactamases</b> — produced by ESKAPE organisms (Enterobacter, Serratia, Pseudomonas, Citrobacter, Acinetobacter); NOT inhibited by traditional BLIs; can be induced or derepressed; causes clinical treatment failure with 3rd gen cephalosporins"))
story.append(b("Altered PBPs (MRSA — PBP2a)"))
story.append(b("Porin loss and efflux pumps (Pseudomonas)"))
story.append(sp(6))
story.append(tip("💡 The AmpC trap: Enterobacter, Serratia, Citrobacter, Morganella, Providencia, and Pseudomonas (the ESCPM organisms + Acinetobacter) all harbour inducible chromosomal AmpC beta-lactamases. They may test susceptible to 3rd gen cephalosporins initially, but during treatment, AmpC is derepressed and resistance emerges. NEVER rely on 3rd gen cephalosporins for serious Enterobacter or Serratia infections — use cefepime (4th gen, AmpC-stable) or a carbapenem."))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 2: 1ST GENERATION — CEFAZOLIN
# ══════════════════════════════════════════════════════════════
story += section_banner("2. 1ST GENERATION — Cefazolin", color=colors.HexColor("#166534"))
story.append(h2("Drug Profile"))
story.append(info_row("Route / Dose", "1-2 g IV q8h (surgical prophylaxis: 2 g IV within 60 min of incision)"))
story.append(info_row("Half-life", "~1.8h — renally excreted", bg=WHITE))
story.append(info_row("Renal adj.", "Yes — reduce dose if CrCl <55 mL/min"))
story.append(info_row("CNS penetration","Poor — do NOT use for meningitis", bg=WHITE))
story.append(sp(8))
story.append(h2("Spectrum"))
story.append(body("<b>Covers:</b>"))
story.append(b("Gram-positive: S. aureus (MSSA — excellent), Streptococci (S. pyogenes, S. agalactiae, viridans); NOT MRSA"))
story.append(b("Gram-negative (limited): E. coli, Klebsiella pneumoniae, Proteus mirabilis"))
story.append(body("<b>Does NOT cover:</b>"))
story.append(b("MRSA, Enterococcus, Pseudomonas, Enterobacter, Serratia, H. influenzae, Bacteroides fragilis"))
story.append(sp(6))
story.append(h2("ICU Uses"))
story.append(b("<b>Surgical prophylaxis</b> — drug of choice for most surgical prophylaxis (covers MSSA, Strep, skin flora)"))
story.append(b("<b>MSSA bacteremia</b> — cefazolin is as effective as anti-staphylococcal penicillins (nafcillin/oxacillin) and better tolerated"))
story.append(b("<b>Skin and soft tissue infections</b> — cellulitis caused by MSSA/Strep"))
story.append(b("Step-down from IV in MSSA infections once susceptibilities confirmed"))
story.append(sp(6))
story.append(tip("💡 Cefazolin vs. nafcillin for MSSA bacteremia: Cefazolin is preferred in most centres now — equivalent efficacy, fewer adverse effects (nafcillin causes phlebitis, hepatotoxicity, interstitial nephritis more commonly). However, cefazolin has an inoculum effect against high-inoculum MSSA infections (e.g., meningitis) — some experts still prefer nafcillin for CNS MSSA."))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 3: 2ND GENERATION
# ══════════════════════════════════════════════════════════════
story += section_banner("3. 2ND GENERATION — Cefuroxime, Cefoxitin", color=colors.HexColor("#0d7a5e"))
story.append(body(
"Second-generation cephalosporins extend gram-negative coverage beyond 1st gen. "
"They are a heterogeneous group. The key ICU-relevant member is <b>cefoxitin</b> "
"(a cephamycin with anaerobic coverage). Rarely used as primary ICU therapy but appear in "
"surgical prophylaxis and step-down regimens."
))
story.append(sp(4))
story.append(b("<b>Cefuroxime:</b> Better H. influenzae and Klebsiella coverage; no Pseudomonas; used in CAP step-down, surgical prophylaxis for some procedures"))
story.append(b("<b>Cefoxitin:</b> Cephamycin — has anaerobic coverage including B. fragilis; used for pelvic inflammatory disease, intra-abdominal prophylaxis, mixed infections"))
story.append(b("Neither covers Pseudomonas, MRSA, or Enterococcus"))
story.append(warn("⚠ 2nd gen cephalosporins should NOT be used for Enterobacter infections — the AmpC chromosomal BL in Enterobacter is readily induced by 2nd gen cephalosporins, selecting resistant mutants rapidly."))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 4: 3RD GENERATION — CEFTRIAXONE
# ══════════════════════════════════════════════════════════════
story += section_banner("4. 3RD GENERATION — Ceftriaxone (+ Ceftazidime)", color=TEAL)
story += drug_card("Ceftriaxone", "3rd generation — ICU workhorse for community infections", TEAL)
story.append(info_row("Route / Dose", "1-2 g IV q24h (once daily — half-life ~8h)\n2 g IV q12h for meningitis"))
story.append(info_row("Half-life", "~8h — longest of standard cephalosporins; allows once-daily dosing", bg=WHITE))
story.append(info_row("Elimination", "Dual: ~50% renal, ~50% biliary — does NOT require dose reduction in renal failure alone"))
story.append(info_row("CNS penetration", "Good — adequate CSF levels for meningitis at higher doses", bg=WHITE))
story.append(info_row("Renal adj.", "Not needed for renal failure alone (biliary elimination takes over). Reduce in combined renal + hepatic failure"))
story.append(sp(8))
story.append(h2("Spectrum"))
story.append(body("<b>Covers:</b>"))
story.append(b("Gram-positive: Streptococci (excellent — S. pneumoniae including penicillin-resistant strains), MSSA (good), viridans streptococci"))
story.append(b("Gram-negative: Enterobacterales (E. coli, Klebsiella, Proteus, Providencia, Serratia — most strains), H. influenzae, Neisseria meningitidis, N. gonorrhoeae, Moraxella"))
story.append(b("Others: Borrelia burgdorferi (Lyme disease), Treponema pallidum (alternative)"))
story.append(sp(4))
story.append(body("<b>Does NOT cover:</b>"))
story.append(b("Pseudomonas aeruginosa — no anti-pseudomonal activity"))
story.append(b("MRSA, Enterococcus, Listeria"))
story.append(b("Anaerobes — poor B. fragilis coverage"))
story.append(b("ESBL-producing organisms — hydrolysed by ESBLs"))
story.append(b("AmpC-producing organisms (Enterobacter, Serratia) — inducible AmpC can emerge during therapy"))
story.append(b("Atypicals (Legionella, Mycoplasma, Chlamydia)"))
story.append(sp(6))
story.append(h2("ICU Clinical Uses"))
story.append(b("<b>Community-acquired pneumonia (CAP)</b> — standard backbone (+ macrolide for atypicals)"))
story.append(b("<b>Bacterial meningitis</b> — drug of choice for N. meningitidis, H. influenzae, susceptible S. pneumoniae; always add vancomycin empirically for S. pneumoniae (possible penicillin resistance)"))
story.append(b("<b>Biliary sepsis</b> — cholangitis, cholecystitis (community-acquired); excellent biliary penetration"))
story.append(b("<b>UTI / pyelonephritis</b> — community-acquired, susceptible organisms"))
story.append(b("<b>Typhoid fever</b> — drug of choice"))
story.append(b("<b>Gonorrhoea</b> — IM ceftriaxone (500 mg IM stat)"))
story.append(b("<b>Step-down</b> — from carbapenems once ESBL/Pseudomonas excluded and susceptibilities confirmed"))
story.append(sp(6))
story.append(h2("Adverse Effects"))
story.append(b("<b>Biliary sludge / pseudolithiasis</b> — ceftriaxone precipitates as calcium salt in bile; seen with prolonged courses or high doses; usually asymptomatic; resolves after stopping"))
story.append(b("<b>Hypersensitivity</b> — rash, urticaria, anaphylaxis"))
story.append(b("<b>C. difficile</b> — broad 3rd gen use is a major driver of C. diff in hospitals"))
story.append(warn("⚠ Ceftriaxone + Calcium: Do NOT give ceftriaxone simultaneously with IV calcium-containing solutions (e.g., Hartmann's, parenteral nutrition with calcium) — can precipitate ceftriaxone-calcium crystals in lungs and kidneys. Flush the line between infusions. This interaction is most critical in neonates but relevant in all patients."))
story.append(sp(8))
story += drug_card("Ceftazidime", "3rd generation — anti-pseudomonal", colors.HexColor("#0d7a5e"))
story.append(info_row("Route / Dose", "1-2 g IV q8h"))
story.append(info_row("Half-life", "~1.5h — renally excreted", bg=WHITE))
story.append(info_row("CNS", "Good CSF penetration — used for Pseudomonas meningitis/ventriculitis"))
story.append(sp(6))
story.append(h2("Spectrum"))
story.append(b("<b>Key feature:</b> Excellent Pseudomonas aeruginosa coverage — this is its main ICU role"))
story.append(b("Gram-negative: Broad Enterobacterales + Pseudomonas"))
story.append(b("Gram-positive: <b>Poor</b> — significantly weaker than ceftriaxone; poor Staph coverage"))
story.append(b("Does NOT cover: MRSA, Enterococcus, anaerobes, ESBL producers, AmpC-overexpressing organisms"))
story.append(sp(4))
story.append(body("<b>ICU Uses:</b>"))
story.append(b("Pseudomonas infections when a carbapenem is not available or not required"))
story.append(b("Meningitis / ventriculitis caused by Pseudomonas (neurosurgical patients)"))
story.append(b("Component of ceftazidime/avibactam combination (covered in Step 8 — Advanced BLIs)"))
story.append(warn("⚠ Ceftazidime resistance in Pseudomonas is increasing. Always check the local antibiogram. Cefepime or pip-tazo may have better activity in centres with high ceftazidime resistance rates."))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 5: 4TH GENERATION — CEFEPIME
# ══════════════════════════════════════════════════════════════
story += section_banner("5. 4TH GENERATION — Cefepime", color=colors.HexColor("#1d4ed8"))
story += drug_card("Cefepime", "4th generation — broadest standard cephalosporin", colors.HexColor("#1d4ed8"))
story.append(info_row("Route / Dose", "1-2 g IV q8-12h\n2 g IV q8h for serious infections (febrile neutropenia, meningitis)"))
story.append(info_row("Half-life", "~2h — renally excreted", bg=WHITE))
story.append(info_row("CNS", "Excellent CSF penetration — suitable for gram-negative meningitis"))
story.append(info_row("Renal adj.", "Yes — dose reduction required if CrCl <60 mL/min (critical to prevent neurotoxicity)", bg=WHITE))
story.append(sp(8))
story.append(h2("Why Cefepime is Better Than 3rd Gen Cephalosporins for ICU"))
story.append(body(
"Cefepime is classified as 4th generation because of its <b>zwitterionic structure</b> — "
"it carries both a positive and negative charge at physiological pH. This allows it to "
"<b>penetrate the outer membrane of gram-negative bacteria faster</b> and makes it "
"<b>a poor substrate for AmpC chromosomal beta-lactamases</b>."
))
story.append(body(
"This means cefepime remains active against AmpC-overexpressing organisms like "
"Enterobacter, Serratia, and Pseudomonas that are resistant to 3rd gen cephalosporins — "
"making it the preferred cephalosporin for nosocomial gram-negative infections."
))
story.append(sp(6))
story.append(h2("Spectrum"))
story.append(body("<b>Covers:</b>"))
story.append(b("Gram-positive: Similar to ceftriaxone — good Streptococci, MSSA; NOT MRSA or Enterococcus"))
story.append(b("Gram-negative (very broad): Enterobacterales, <b>Pseudomonas aeruginosa</b>, AmpC-producing organisms (Enterobacter, Serratia, Citrobacter)"))
story.append(b("CNS: Good penetration — used for gram-negative meningitis and neurosurgical infections"))
story.append(sp(4))
story.append(body("<b>Does NOT cover:</b>"))
story.append(b("MRSA, Enterococcus, Listeria, anaerobes, ESBL producers, carbapenemase producers"))
story.append(sp(6))
story.append(h2("ICU Clinical Uses"))
story.append(b("<b>Hospital-acquired pneumonia (HAP) / VAP</b> — covers Pseudomonas + AmpC gram-negatives"))
story.append(b("<b>Febrile neutropenia</b> — guideline-recommended monotherapy; covers Pseudomonas which is the main lethal pathogen"))
story.append(b("<b>Nosocomial gram-negative bacteremia</b> — empiric choice when MRSA/ESBL unlikely"))
story.append(b("<b>Gram-negative meningitis</b> — Enterobacter, Pseudomonas (neurosurgical); preferred over ceftazidime because of better gram-positive activity too"))
story.append(b("<b>Complicated UTI</b> — nosocomial, resistant organisms"))
story.append(sp(6))
story.append(h2("Cefepime Neurotoxicity — Critical Warning"))
story.append(warn("⚠ CEFEPIME NEUROTOXICITY: Cefepime can cause a spectrum of CNS toxicity: confusion, encephalopathy, myoclonus, non-convulsive status epilepticus (NCSE), and seizures. This is UNDERRECOGNISED in the ICU and can be mistaken for metabolic encephalopathy or deterioration of underlying illness.\n\nRisk factors: Renal impairment (drug accumulates), high doses, elderly patients, pre-existing CNS disease.\n\nAction: If ICU patient on cefepime develops new-onset confusion or abnormal movements — check renal function immediately, review dose, consider EEG to exclude NCSE, and consider switching to meropenem."))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 6: 5TH GENERATION — CEFTAROLINE
# ══════════════════════════════════════════════════════════════
story += section_banner("6. 5TH GENERATION — Ceftaroline", color=colors.HexColor("#6d28d9"))
story += drug_card("Ceftaroline", "5th generation — the MRSA cephalosporin", colors.HexColor("#6d28d9"))
story.append(info_row("Route / Dose", "600 mg IV q12h (can extend to q8h for severe MRSA infections)"))
story.append(info_row("Half-life", "~2.7h — renally excreted", bg=WHITE))
story.append(info_row("Renal adj.", "Yes — dose reduction if CrCl <50 mL/min"))
story.append(sp(8))
story.append(h2("The MRSA Exception — Why It's Unique"))
story.append(body(
"MRSA is resistant to ALL beta-lactams because its modified PBP (PBP2a) has an extremely "
"low affinity for standard beta-lactam antibiotics. Ceftaroline has a unique side-chain "
"modification that gives it <b>high-affinity binding to PBP2a</b> — making it the "
"<b>only beta-lactam (cephalosporin or penicillin) in clinical use that kills MRSA</b>."
))
story.append(sp(6))
story.append(h2("Spectrum"))
story.append(b("<b>Gram-positive (exceptional):</b> MRSA, VISA (vancomycin-intermediate S. aureus), MSSA, Streptococci (including penicillin-resistant S. pneumoniae)"))
story.append(b("<b>Gram-negative:</b> Similar to ceftriaxone — Enterobacterales, H. influenzae"))
story.append(sp(4))
story.append(body("<b>Does NOT cover:</b>"))
story.append(b("Pseudomonas aeruginosa — no activity"))
story.append(b("Acinetobacter — no activity"))
story.append(b("AmpC-producing organisms — not AmpC-stable"))
story.append(b("ESBL producers, CRE, VRE, anaerobes"))
story.append(sp(6))
story.append(h2("ICU Uses"))
story.append(b("<b>MRSA pneumonia</b> — alternative to vancomycin/linezolid; useful when vancomycin toxicity or inadequate levels"))
story.append(b("<b>Complicated skin and soft tissue infections (MRSA)</b> — FDA approved"))
story.append(b("<b>MRSA bacteremia</b> — evidence growing for ceftaroline as salvage therapy (combination with daptomycin for refractory MRSA bacteremia)"))
story.append(note("Ceftaroline's twice-daily dosing limits use outside hospital settings. In the ICU, vancomycin remains first-line for MRSA; ceftaroline is an important second-line or combination option."))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 7: GENERATION COMPARISON AT A GLANCE
# ══════════════════════════════════════════════════════════════
story += section_banner("7. GENERATION COMPARISON AT A GLANCE", color=colors.HexColor("#374151"))
# 5 clean separate info rows — no wide table
gen_items = [
("1st Gen\nCefazolin",
"Best gram-positive of all gens (MSSA, Strep) | Limited gram-negative (E. coli, Klebsiella, Proteus only) | No Pseudomonas | No MRSA | ICU use: Surgical prophylaxis, MSSA bacteremia"),
("2nd Gen\nCefuroxime / Cefoxitin",
"Extended gram-negative (+ H. influenzae) | Cefoxitin: anaerobes (B. fragilis) | No Pseudomonas | No MRSA | ICU use: Surgical prophylaxis, step-down"),
("3rd Gen\nCeftriaxone / Ceftazidime",
"Ceftriaxone: Broad gram-negative + CNS (meningitis) + once daily | Ceftazidime: Pseudomonas ✓ but poor gram-positive | No MRSA | Watch: AmpC trap with Enterobacter/Serratia"),
("4th Gen\nCefepime",
"Broadest standard cephalosporin | Pseudomonas ✓ | AmpC-stable ✓ | Good gram-positive (not MRSA) | CNS penetration ✓ | Critical warning: Neurotoxicity with renal impairment"),
("5th Gen\nCeftaroline",
"MRSA coverage ✓ (unique — PBP2a binding) | Similar gram-negative to ceftriaxone | NO Pseudomonas | ICU use: MRSA pneumonia, MRSA skin/soft tissue, salvage for refractory MRSA bacteremia"),
]
for i, (gen, detail) in enumerate(gen_items):
bg = LGREY if i % 2 == 0 else WHITE
tbl = Table(
[[Paragraph(gen, ps(f"gl{i}", fontSize=9.5, fontName="Helvetica-Bold", textColor=TEAL, leading=13)),
Paragraph(detail, ps(f"gd{i}", fontSize=9.5, fontName="Helvetica", textColor=DGREY, leading=14))]],
colWidths=[3.5*cm, 13.1*cm]
)
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), bg),
("TOPPADDING", (0,0),(-1,-1), 7),
("BOTTOMPADDING", (0,0),(-1,-1), 7),
("LEFTPADDING", (0,0),(-1,-1), 8),
("RIGHTPADDING", (0,0),(-1,-1), 8),
("VALIGN", (0,0),(-1,-1), "TOP"),
("LINEBELOW", (0,0),(-1,-1), 0.4, colors.HexColor("#d1d5db")),
]))
story.append(tbl)
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 8: ICU SCENARIOS
# ══════════════════════════════════════════════════════════════
story.append(PageBreak())
story += section_banner("8. ICU SCENARIOS", color=colors.HexColor("#0f766e"))
story.append(scenario(
"Scenario 1 — Community-acquired bacterial meningitis",
"35-year-old, sudden onset headache, fever, neck stiffness, photophobia. CSF: turbid, WBC 4000 (mostly neutrophils), protein 320, glucose 1.2 (serum 6.8). Gram stain: gram-negative diplococci.\n\n"
"Drug choice: Ceftriaxone 2 g IV q12h (drug of choice for N. meningitidis and H. influenzae meningitis). "
"Add vancomycin + dexamethasone empirically until sensitivities available (covers penicillin-resistant S. pneumoniae). "
"Ceftriaxone achieves excellent CSF levels and once/twice daily dosing simplifies ICU management. "
"Do NOT use cefazolin (no CNS penetration)."
))
story.append(scenario(
"Scenario 2 — Febrile neutropenia, ANC <200",
"Haematology patient, Day 8 of chemotherapy. Temperature 38.7°C, ANC 180, no obvious source. Haemodynamically stable.\n\n"
"Drug choice: Cefepime 2 g IV q8h. 4th gen cephalosporin covers Pseudomonas (the main lethal threat in febrile neutropenia), "
"AmpC-producing gram-negatives, and gram-positives. Do NOT use ceftriaxone (no Pseudomonas cover). "
"Add vancomycin only if: mucositis present, CVC infection suspected, or haemodynamically unstable. "
"Review at 72h — if not responding, escalate to carbapenem ± antifungal."
))
story.append(scenario(
"Scenario 3 — The AmpC trap",
"Patient with hospital-acquired UTI, Enterobacter cloacae on culture. Sensitivity shows ceftriaxone SUSCEPTIBLE. "
"Registrar plans to start ceftriaxone. You are the consultant — what do you advise?\n\n"
"Do NOT use ceftriaxone. Enterobacter harbours an inducible chromosomal AmpC beta-lactamase. "
"Even though it tests susceptible in vitro, 3rd gen cephalosporins can derepress AmpC production "
"during therapy, leading to treatment failure. Use cefepime (AmpC-stable, 4th gen) or meropenem "
"for serious Enterobacter infections. This is one of the most commonly tested clinical traps."
))
story.append(scenario(
"Scenario 4 — Cefepime neurotoxicity",
"ICU patient with CKD (creatinine 280 μmol/L), admitted with HAP, started on cefepime 2 g q8h "
"(standard dose — NOT adjusted for renal function). Day 3, nurse reports patient is confused, "
"making repetitive hand movements, not responding normally.\n\n"
"Suspect cefepime neurotoxicity. Action: Stop cefepime immediately. Urgently check renal function "
"(creatinine likely worse). Request EEG — non-convulsive status epilepticus (NCSE) is possible and "
"may look like 'confusion' without obvious seizure activity. Switch to meropenem (dose-adjusted for CrCl). "
"Most cases of cefepime neurotoxicity improve within 24-48h after stopping the drug."
))
story.append(scenario(
"Scenario 5 — MRSA pneumonia, vancomycin not achieving targets",
"Ventilated patient, MRSA VAP confirmed on BAL culture. Started on vancomycin; AUC monitoring shows "
"AUC/MIC of 280 (target 400-600). Renal function declining, making dose escalation risky.\n\n"
"Options: Switch to linezolid 600 mg IV q12h (good lung penetration, no nephrotoxicity) OR switch to "
"ceftaroline 600 mg IV q12h (active against MRSA via PBP2a binding, no renal toxicity). "
"Ceftaroline is an increasingly recognised option for MRSA pneumonia when vancomycin is failing or nephrotoxic."
))
story.append(scenario(
"Scenario 6 — Biliary sepsis with ceftriaxone",
"75-year-old, cholangitis, E. coli bacteremia. Started on ceftriaxone. On day 5, patient develops RUQ pain "
"and ultrasound shows echogenic material in the gallbladder. No fever. LFTs mildly elevated.\n\n"
"This is ceftriaxone-induced biliary pseudolithiasis (ceftriaxone precipitates as calcium salt in bile). "
"It is usually asymptomatic and resolves within days to weeks after stopping ceftriaxone. "
"If E. coli is susceptible and patient is improving, complete the course or switch to an "
"oral option (e.g. oral cefalexin/Augmentin for step-down). "
"Pseudolithiasis requires no specific treatment — just stop the drug."
))
story.append(sp(10))
# ══════════════════════════════════════════════════════════════
# SECTION 9: ACTIVE RECALL QUIZ
# ══════════════════════════════════════════════════════════════
story.append(PageBreak())
story += section_banner("9. ACTIVE RECALL QUIZ", color=NAVY)
story.append(body("Cover the answers. Attempt each question before looking. Be specific."))
story.append(sp(8))
quizzes = [
("Q1. What is the mechanism of action of all cephalosporins?",
"Bind Penicillin-Binding Proteins (PBPs) → inhibit transpeptidation → block peptidoglycan cross-linking → weak cell wall → cell lysis and death. Same class mechanism as all beta-lactams."),
("Q2. State the general rule about gram-positive and gram-negative coverage across cephalosporin generations.",
"As generation increases: gram-POSITIVE activity generally DECREASES, gram-NEGATIVE activity INCREASES, and beta-lactamase stability INCREASES. Exception: 5th gen (ceftaroline) gains MRSA but loses Pseudomonas coverage."),
("Q3. Name 5 organisms that NO cephalosporin covers (excluding generation-specific exceptions).",
"MRSA (except ceftaroline), Enterococcus, Listeria monocytogenes, Atypical organisms (Legionella, Mycoplasma, Chlamydia), ESBL-producing organisms, Carbapenemase-producing organisms (CRE)"),
("Q4. What is the AmpC trap? Name 4 organisms where it applies.",
"AmpC = inducible chromosomal beta-lactamase. These organisms may test SUSCEPTIBLE to 3rd gen cephalosporins in vitro, but during treatment, AmpC is derepressed and resistance emerges, causing clinical treatment failure. Organisms: Enterobacter cloacae, Serratia marcescens, Citrobacter freundii, Morganella morganii, Providencia spp., Pseudomonas aeruginosa (ESCPM organisms). Solution: use cefepime (AmpC-stable) or carbapenem."),
("Q5. Why is ceftriaxone once-daily, but cefazolin is q8h?",
"Ceftriaxone has a half-life of ~8h (due to dual biliary + renal elimination, high protein binding, and slow distribution). Cefazolin has a half-life of ~1.8h (purely renally eliminated). Like all beta-lactams, efficacy is time-dependent (%T>MIC), so cefazolin needs more frequent dosing to maintain levels above MIC."),
("Q6. Why does ceftriaxone NOT need dose reduction in renal failure (unlike other cephalosporins)?",
"Ceftriaxone is eliminated ~50% by kidneys and ~50% by biliary excretion. When renal function declines, biliary elimination compensates, maintaining adequate drug clearance. Therefore, dose adjustment is not required for renal failure alone — only in combined renal + hepatic failure."),
("Q7. What is the drug interaction between ceftriaxone and calcium-containing IV fluids?",
"Ceftriaxone can precipitate with calcium to form insoluble ceftriaxone-calcium crystals in the lungs and kidneys. Do NOT administer ceftriaxone simultaneously with calcium-containing IV solutions (Hartmann's, Ringer's lactate, TPN with calcium). Flush IV line between administrations. Most dangerous in neonates but relevant in all patients."),
("Q8. What makes cefepime structurally different from 3rd gen cephalosporins and why does it matter?",
"Cefepime is zwitterionic (carries both positive and negative charges at physiological pH). This allows it to: (1) penetrate the outer membrane of gram-negative bacteria faster, and (2) be a poor substrate for AmpC chromosomal beta-lactamases. Result: active against AmpC-overexpressing organisms (Enterobacter, Serratia, Pseudomonas) that are resistant to 3rd gen cephalosporins."),
("Q9. An ICU patient on cefepime develops new confusion and hand tremors. Creatinine has risen from 90 to 240 μmol/L over 3 days. What is your diagnosis and management?",
"Cefepime neurotoxicity (likely non-convulsive status epilepticus or encephalopathy due to drug accumulation in renal impairment). Management: Stop cefepime immediately. Request urgent EEG. Switch to meropenem (dose-adjusted for CrCl). Monitor — most cases resolve in 24-48h after stopping. This is a dose-adjustment failure and is preventable."),
("Q10. What is unique about ceftaroline's mechanism, and what does it cover that no other cephalosporin does?",
"Ceftaroline has a unique side-chain modification that gives it high-affinity binding to PBP2a — the modified PBP responsible for MRSA's resistance to all other beta-lactams. This makes it the ONLY beta-lactam with anti-MRSA activity. It also covers VISA (vancomycin-intermediate S. aureus). It does NOT cover Pseudomonas or AmpC organisms."),
("Q11. Which cephalosporin would you choose for each scenario?\na) Surgical prophylaxis\nb) Community meningitis (gram-negative diplococci)\nc) Febrile neutropenia\nd) MRSA pneumonia (vancomycin failing)\ne) Enterobacter bacteremia",
"a) Cefazolin 2 g IV pre-incision (1st gen — MSSA + Strep cover)\nb) Ceftriaxone 2 g IV q12h (3rd gen — meningeal penetration, N. meningitidis/H. influenzae)\nc) Cefepime 2 g IV q8h (4th gen — Pseudomonas cover, AmpC-stable)\nd) Ceftaroline 600 mg IV q12h (5th gen — PBP2a binding, MRSA active)\ne) Cefepime or meropenem (4th gen or carbapenem — AmpC-stable; NEVER 3rd gen cephalosporins for Enterobacter)"),
("Q12. Ceftazidime vs. cefepime for Pseudomonas VAP — which do you choose and why?",
"Cefepime is preferred. Both cover Pseudomonas, but cefepime additionally: (1) has better gram-positive coverage (important if mixed infection), (2) is AmpC-stable (Pseudomonas can co-harbour AmpC), and (3) has better CNS penetration if needed. Ceftazidime has very poor gram-positive activity and is preferred mainly when gram-positive coverage is explicitly NOT needed (e.g., targeted Pseudomonas CNS infection where the cleaner spectrum is desired)."),
]
for q, a in quizzes:
story.append(quiz_item(q, a))
story.append(sp(12))
# Score box
score_data = [
["12/12", "Excellent — move to Step 3 (Pip-Tazo)"],
["8-11/12","Good — review gaps, re-test before Step 3"],
["<8/12", "Re-read sections 2-6, rebuild generation concepts, retry"],
]
score_cols = [
[LGREEN, GREEN],
[LAMBER, AMBER],
[LRED, RED],
]
score_rows = []
for i, (score, msg) in enumerate(score_data):
score_rows.append([
Paragraph(score, ps(f"sc{i}", fontSize=11, textColor=score_cols[i][1], fontName="Helvetica-Bold")),
Paragraph(msg, ps(f"sm{i}", fontSize=10, textColor=DGREY, fontName="Helvetica")),
])
stbl = Table(score_rows, colWidths=[4*cm, 12.6*cm])
stbl.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,0), LGREEN),
("BACKGROUND", (0,1),(-1,1), LAMBER),
("BACKGROUND", (0,2),(-1,2), LRED),
("GRID", (0,0),(-1,-1), 0.4, colors.HexColor("#d1d5db")),
("PADDING", (0,0),(-1,-1), 8),
("VALIGN", (0,0),(-1,-1), "MIDDLE"),
]))
story.append(stbl)
story.append(sp(16))
story.append(note(
"Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics | "
"Katzung's Basic & Clinical Pharmacology 16e | "
"Lippincott Illustrated Reviews Pharmacology | "
"Harrison's Principles of Internal Medicine 22e | "
"The Washington Manual of Medical Therapeutics"
))
story.append(note("Next: Step 3 — Piperacillin-Tazobactam (Pip-Tazo) | Anti-pseudomonal penicillin | ICU empiric workhorse"))
doc.build(story)
print(f"PDF created: {OUTPUT}")
python /home/daytona/workspace/meropenem/step2_cephalosporins.py
Step2 Cephalosporins
PDF Document · PDF
| Section | Content |
|---|---|
| 1. Class Overview | Mechanism, the generation rule, what NO cephalosporin covers, resistance mechanisms |
| 2. 1st Gen — Cefazolin | Surgical prophylaxis, MSSA bacteremia, cefazolin vs. nafcillin tip |
| 3. 2nd Gen — Cefuroxime/Cefoxitin | Brief — rarely primary ICU drugs |
| 4. 3rd Gen — Ceftriaxone | Full drug card — once-daily dosing, meningitis, biliary use, Ca2+ interaction warning |
| 4b. Ceftazidime | Anti-pseudomonal 3rd gen, resistance warning |
| 5. 4th Gen — Cefepime | Why it's better than 3rd gen, AmpC-stability explained, neurotoxicity warning |
| 6. 5th Gen — Ceftaroline | PBP2a binding, only MRSA beta-lactam |
| 7. Generation Comparison | Clean row-by-row (no wide table) — one generation per row |
| 8. ICU Scenarios | 6 cases including the AmpC trap, cefepime neurotoxicity, MRSA pneumonia |
| 9. Quiz | 12 questions with full answers + scoring guide |