Use Harrison 21th edition with Infective endocarditis clinical symptoms causes and treatment and basic to clinical Start basic to clinical and convert into pdf
mkdir -p /tmp/workspace/IE-harrison && ls /tmp/workspace/
~/IE-harrison/generate_ie_pdf.py
#!/usr/bin/env python3
"""
Infective Endocarditis - Harrison's Principles of Internal Medicine 22E
Comprehensive PDF: Basic to Clinical
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.platypus.tableofcontents import TableOfContents
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
# ── colour palette ──────────────────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#1a3a5c")
MID_BLUE = colors.HexColor("#2e6da4")
LIGHT_BLUE = colors.HexColor("#d6e8f7")
ACCENT_RED = colors.HexColor("#c0392b")
ACCENT_GREEN = colors.HexColor("#1e8449")
PALE_YELLOW = colors.HexColor("#fef9e7")
PALE_GREEN = colors.HexColor("#eafaf1")
PALE_RED = colors.HexColor("#fdecea")
PALE_BLUE = colors.HexColor("#eaf2fb")
BOX_BORDER = colors.HexColor("#2e6da4")
GRAY_LIGHT = colors.HexColor("#f2f2f2")
GRAY_MID = colors.HexColor("#bdc3c7")
TEXT_DARK = colors.HexColor("#1c1c1c")
W, H = A4
def build_styles():
styles = getSampleStyleSheet()
def add(name, **kw):
if name not in styles:
styles.add(ParagraphStyle(name=name, **kw))
return styles[name]
add("CoverTitle",
fontSize=30, leading=38, textColor=colors.white,
fontName="Helvetica-Bold", alignment=TA_CENTER)
add("CoverSub",
fontSize=14, leading=20, textColor=colors.HexColor("#d6e8f7"),
fontName="Helvetica", alignment=TA_CENTER)
add("CoverNote",
fontSize=10, leading=14, textColor=colors.HexColor("#aacde8"),
fontName="Helvetica-Oblique", alignment=TA_CENTER)
add("Ch1",
fontSize=18, leading=24, textColor=DARK_BLUE,
fontName="Helvetica-Bold", spaceBefore=18, spaceAfter=6,
borderPad=4)
add("Ch2",
fontSize=13, leading=18, textColor=MID_BLUE,
fontName="Helvetica-Bold", spaceBefore=12, spaceAfter=4)
add("Ch3",
fontSize=11, leading=15, textColor=DARK_BLUE,
fontName="Helvetica-BoldOblique", spaceBefore=8, spaceAfter=3)
add("Body",
fontSize=10, leading=15, textColor=TEXT_DARK,
fontName="Helvetica", alignment=TA_JUSTIFY, spaceBefore=3, spaceAfter=3)
add("BulletBody",
fontSize=10, leading=15, textColor=TEXT_DARK,
fontName="Helvetica", leftIndent=16, bulletIndent=4,
spaceBefore=2, spaceAfter=2)
add("Caption",
fontSize=8.5, leading=12, textColor=colors.HexColor("#555555"),
fontName="Helvetica-Oblique", alignment=TA_CENTER, spaceBefore=2, spaceAfter=6)
add("BoxTitle",
fontSize=11, leading=15, textColor=colors.white,
fontName="Helvetica-Bold", alignment=TA_LEFT)
add("BoxBody",
fontSize=9.5, leading=14, textColor=TEXT_DARK,
fontName="Helvetica", spaceBefore=2, spaceAfter=2)
add("TableHeader",
fontSize=9.5, leading=13, textColor=colors.white,
fontName="Helvetica-Bold", alignment=TA_CENTER)
add("TableCell",
fontSize=9, leading=13, textColor=TEXT_DARK,
fontName="Helvetica", alignment=TA_LEFT)
add("Warning",
fontSize=9.5, leading=14, textColor=ACCENT_RED,
fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=4)
add("KeyPoint",
fontSize=9.5, leading=14, textColor=ACCENT_GREEN,
fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=4)
add("Reference",
fontSize=8, leading=11, textColor=colors.HexColor("#666666"),
fontName="Helvetica-Oblique")
return styles
S = build_styles()
def hr(color=MID_BLUE, thickness=1):
return HRFlowable(width="100%", thickness=thickness, color=color, spaceAfter=6, spaceBefore=6)
def heading1(text):
return [hr(DARK_BLUE, 2), Paragraph(text, S["Ch1"]), hr(MID_BLUE, 0.5)]
def heading2(text):
return [Paragraph(text, S["Ch2"]), hr(colors.HexColor("#aacde8"), 0.5)]
def heading3(text):
return [Paragraph(text, S["Ch3"])]
def body(text):
return Paragraph(text, S["Body"])
def bullet(text, symbol="•"):
return Paragraph(f"<bullet>{symbol}</bullet>{text}", S["BulletBody"])
def spacer(n=1):
return Spacer(1, 0.25 * n * cm)
def colored_box(title, lines, bg=PALE_BLUE, title_bg=MID_BLUE):
"""Render a highlighted information box."""
title_para = Paragraph(title, S["BoxTitle"])
title_cell = Table([[title_para]], colWidths=[W - 4.5*cm])
title_cell.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), title_bg),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
]))
body_rows = []
for line in lines:
body_rows.append([Paragraph(line, S["BoxBody"])])
body_tbl = Table(body_rows, colWidths=[W - 4.5*cm])
body_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 0.5, BOX_BORDER),
]))
return KeepTogether([title_cell, body_tbl, spacer()])
def drug_table(headers, rows, col_widths=None):
data = [[Paragraph(h, S["TableHeader"]) for h in headers]]
for r in rows:
data.append([Paragraph(str(c), S["TableCell"]) for c in r])
if col_widths is None:
col_widths = [(W - 4*cm) / len(headers)] * len(headers)
tbl = Table(data, colWidths=col_widths, repeatRows=1)
style = TableStyle([
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, GRAY_LIGHT]),
("GRID", (0,0), (-1,-1), 0.4, GRAY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
])
tbl.setStyle(style)
return tbl
# ── COVER PAGE ───────────────────────────────────────────────────────────────
def cover_page():
cover_bg = Table(
[[Paragraph("INFECTIVE ENDOCARDITIS", S["CoverTitle"]),],
[Spacer(1, 0.6*cm)],
[Paragraph("Basic Science to Clinical Management", S["CoverSub"])],
[Spacer(1, 0.4*cm)],
[Paragraph("Based on Harrison's Principles of Internal Medicine, 22nd Edition (2025)", S["CoverNote"])],
[Spacer(1, 0.3*cm)],
[Paragraph("Chapter 133 | Sara E. Cosgrove, Michael T. Melia", S["CoverNote"])],
],
colWidths=[W - 4*cm]
)
cover_bg.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 40),
("BOTTOMPADDING", (0,0), (-1,-1), 40),
("LEFTPADDING", (0,0), (-1,-1), 30),
("RIGHTPADDING", (0,0), (-1,-1), 30),
("ROUNDEDCORNERS", (0,0), (-1,-1), 10),
]))
return [
Spacer(1, 2*cm),
cover_bg,
Spacer(1, 1.5*cm),
hr(MID_BLUE, 2),
body("<b>Contents:</b> Epidemiology • Pathogenesis • Microbiology • Clinical Features • "
"Diagnosis & Duke Criteria • Echocardiography • Antimicrobial Treatment • "
"Surgical Indications • Complications • Prevention"),
hr(MID_BLUE, 2),
spacer(2),
Paragraph("Orris Medical Education | Compiled August 2026", S["Reference"]),
PageBreak()
]
# ── SECTION 1: DEFINITION & OVERVIEW ─────────────────────────────────────────
def section_overview():
elems = []
elems += heading1("1. Definition & Overview")
elems.append(body(
"Infective endocarditis (IE) is a microbial infection of the endocardial surface of the heart. "
"The <b>prototypic lesion</b> is the <b>vegetation</b> — a mass of platelets, fibrin, microorganisms, "
"and scant inflammatory cells. Although most commonly affecting heart valves, IE can also involve "
"the low-pressure side of a ventricular septal defect, mural endocardium damaged by aberrant jets, "
"foreign bodies, or intracardiac devices. The analogous process involving arteriovenous/arterio-arterial "
"shunts (patent ductus arteriosus) or aortic coarctation is called <b>infective endarteritis</b>."
))
elems.append(spacer())
elems += heading2("1.1 Classification")
class_data = [
["Classification Basis", "Categories"],
["Temporal course", "Acute IE vs. Subacute IE"],
["Site of infection", "Native Valve (NVE) • Prosthetic Valve (PVE) • CIED-IE • TAVR-PVE"],
["Causative organism", "Streptococcal • Staphylococcal • Enterococcal • HACEK • Fungal"],
["Predisposing risk factor", "Injection Drug Use (IDU) • Health care-associated • Structural heart disease"],
]
elems.append(drug_table(
class_data[0], class_data[1:],
col_widths=[7*cm, 10.5*cm]
))
elems.append(spacer())
elems.append(colored_box("Acute vs. Subacute IE", [
"<b>Acute IE:</b> Hectically febrile • Rapidly damages cardiac structures • Seeds extracardiac sites • "
"Progresses to death within weeks if untreated. Caused most often by S. aureus.",
"<b>Subacute IE:</b> Indolent course • Slow or absent structural damage • Rarely metastasizes • "
"Gradually progressive unless complicated by major embolic event or ruptured mycotic aneurysm. "
"Caused by viridans streptococci, coagulase-negative staphylococci, enterococci, HACEK organisms.",
], PALE_YELLOW, colors.HexColor("#c0392b")))
elems += heading2("1.2 Epidemiology")
elems.append(body(
"In the United States, the incidence of IE is estimated at <b>15 cases per 100,000 population per year</b>, "
"with progressive increases in recent decades. Predisposing conditions have shifted from chronic rheumatic "
"heart disease (still common in developing countries) to injection drug use (IDU), degenerative valve disease, "
"and intracardiac devices."
))
elems.append(spacer(0.5))
for b_txt in [
"25–35% of NVE cases in developed countries are <b>health care-associated</b>",
"16–30% of all IE cases involve <b>prosthetic valves (PVE)</b>",
"Risk of PVE highest in the <b>first year</b> after valve replacement; greater for bioprosthetic than mechanical valves",
"TAVR-PVE incidence and rate of decline similar to surgically implanted bioprosthetic aortic valves",
"<b>CIED-IE</b>: 0.5–1.14 cases per 1,000 recipients; greater with defibrillators/resynchronization devices than pacemakers",
"Acceleration of mortality in ages <b>25–44 years</b> associated with opioid use disorder (OUD) and IDU",
]:
elems.append(bullet(b_txt))
elems.append(spacer())
return elems
# ── SECTION 2: BASIC SCIENCE — PATHOGENESIS ───────────────────────────────────
def section_pathogenesis():
elems = []
elems += heading1("2. Basic Science: Pathogenesis")
elems += heading2("2.1 Predisposing Conditions")
elems.append(body(
"IE results from the interaction between a susceptible cardiac surface, a bacteremia, and the "
"pathogen's virulence factors. The following categories outline predisposing cardiac lesions:"
))
pred_data = [
["Category", "Specific Conditions"],
["High-risk cardiac lesions", "Prosthetic heart valves (mechanical or bioprosthetic)\nPrevious IE\nUnrepaired cyanotic congenital heart disease\nRepaired CHD with residual defect at/near prosthetic patch/device"],
["Moderate-risk lesions", "Non-cyanotic congenital heart disease\nAcquired valvular dysfunction (rheumatic, degenerative)\nHypertrophic cardiomyopathy with obstruction\nMitral valve prolapse with regurgitation"],
["Elevated non-cardiac risk", "Injection drug use (IDU)\nIntravascular catheters/devices\nHemodialysis\nPoor dental hygiene\nImmunosuppression / HIV"],
]
elems.append(drug_table(pred_data[0], pred_data[1:], col_widths=[6*cm, 11.5*cm]))
elems.append(spacer())
elems += heading2("2.2 Steps in Vegetation Formation")
for i, step in enumerate([
"<b>Step 1 — Endothelial disruption:</b> Turbulent blood flow (e.g., regurgitant jets) or direct tissue "
"damage from catheters/devices causes micro-injury to the endothelium.",
"<b>Step 2 — Non-bacterial thrombotic endocarditis (NBTE):</b> Fibrin and platelets deposit on the "
"injured surface, forming a sterile thrombus — an ideal substrate for microbial attachment.",
"<b>Step 3 — Bacteremia:</b> Transient or sustained bacteremia exposes the NBTE to circulating organisms. "
"Dental, surgical, skin, or gastrointestinal procedures, or IDU, are common sources.",
"<b>Step 4 — Microbial adherence:</b> Pathogens (especially S. aureus, viridans streptococci) express "
"surface adhesins (e.g., MSCRAMM proteins, FnBP, clumping factors) that bind to fibronectin, fibrinogen, "
"and platelets in the NBTE.",
"<b>Step 5 — Vegetation growth:</b> Organisms multiply within the fibrin-platelet matrix, protected from "
"neutrophils and antibiotics. Bacterial proliferation triggers further fibrin deposition, growing the "
"vegetation. High bacterial densities (up to 10<sup>9</sup>–10<sup>10</sup> CFU/g) are achieved.",
"<b>Step 6 — Local and systemic consequences:</b> Valve leaflet destruction, chordal rupture, perivalvular "
"abscess, septic emboli, immune complex deposition (glomerulonephritis, Osler nodes), and metastatic infection.",
], start=1):
elems.append(bullet(step, "▶"))
elems.append(spacer(0.3))
elems.append(spacer())
elems += heading2("2.3 Virulence Factors")
elems.append(body(
"S. aureus is the paradigm high-virulence organism. Its ability to adhere to intact endothelium, "
"produce toxins (alpha-toxin, TSST-1, leukotoxins), and express multiple adhesins explains its "
"capacity to cause acute IE even on previously normal valves. Viridans streptococci express lower-level "
"virulence factors and primarily infect previously damaged valves (subacute IE)."
))
elems.append(spacer())
return elems
# ── SECTION 3: ETIOLOGY / MICROBIOLOGY ────────────────────────────────────────
def section_etiology():
elems = []
elems += heading1("3. Etiology & Microbiology")
elems.append(body(
"Although many species of bacteria and fungi cause sporadic episodes of IE, a few bacterial species "
"cause the majority of cases. Recent large studies from developed regions identify "
"<b>Staphylococcus aureus</b> as the most common causative organism overall."
))
elems.append(spacer())
micro_data = [
["Organism", "% of NVE (approx.)", "Key Clinical Association"],
["Staphylococcus aureus (MSSA/MRSA)", "30–35%", "IDU, health care-associated, acute IE, normal valves possible"],
["Viridans streptococci\n(S. mutans, S. sanguinis, S. mitis)", "18–20%", "Oral cavity portal, subacute IE, previously damaged valves"],
["Coagulase-negative staphylococci\n(S. epidermidis, S. lugdunensis)", "12–15%", "Prosthetic valves, intravascular catheters, CIED"],
["Streptococcus bovis (S. gallolyticus)", "5–8%", "Colon cancer / colorectal polyps (screen bowel!)"],
["Enterococcus faecalis / faecium", "8–10%", "Genitourinary/GI source; elderly; healthcare-associated"],
["HACEK organisms\n(Haemophilus, Aggregatibacter, Cardiobacterium, Eikenella, Kingella)", "3–5%", "Upper respiratory tract; subacute; large vegetations; emboli"],
["Streptococcus pneumoniae", "<1%", "Austria's syndrome (IE + meningitis + pneumonia)"],
["Fungi (Candida, Aspergillus)", "1–2%", "IDU, prolonged IV therapy, immunosuppressed, prosthetic valves; large vegetations; high mortality"],
["Culture-negative IE\n(Coxiella, Bartonella, Brucella, T. whipplei)", "5–10%", "Prior antibiotics, fastidious organisms; PCR/serology required"],
]
elems.append(drug_table(micro_data[0], micro_data[1:], col_widths=[5.5*cm, 3.5*cm, 8.5*cm]))
elems.append(spacer())
elems.append(colored_box("HACEK Organisms — Memory Aid", [
"<b>H</b> — Haemophilus species (aphrophilus, parainfluenzae)",
"<b>A</b> — Aggregatibacter (actinomycetemcomitans, aphrophilus)",
"<b>C</b> — Cardiobacterium hominis",
"<b>E</b> — Eikenella corrodens",
"<b>K</b> — Kingella kingae",
"All are slow-growing oral commensals; produce large vegetations; strong embolic tendency.",
], PALE_GREEN, ACCENT_GREEN))
elems += heading2("3.1 Prosthetic Valve Endocarditis (PVE)")
elems.append(body(
"The microbiology of PVE varies with timing after valve surgery:"
))
pve_data = [
["PVE Timing", "Definition", "Common Organisms"],
["Early PVE", "≤60 days post-surgery", "CoNS (S. epidermidis), S. aureus, gram-negative bacilli, fungi, diphtheroids"],
["Late PVE", ">60 days post-surgery", "Similar to NVE: viridans strep, CoNS, S. aureus, enterococci, HACEK"],
]
elems.append(drug_table(pve_data[0], pve_data[1:], col_widths=[4*cm, 4.5*cm, 9*cm]))
elems.append(spacer())
return elems
# ── SECTION 4: CLINICAL MANIFESTATIONS ────────────────────────────────────────
def section_clinical():
elems = []
elems += heading1("4. Clinical Manifestations")
elems.append(body(
"IE is a systemic disease with manifestations ranging from constitutional symptoms to life-threatening "
"cardiac and embolic complications. The clinical picture reflects direct infection, septic emboli, "
"metastatic infection, and immunologically mediated phenomena."
))
elems.append(spacer())
elems += heading2("4.1 Constitutional Symptoms")
for b_txt in [
"<b>Fever</b> — most common; present in 80–90%; may be low-grade (subacute) or high/hectic (acute)",
"<b>Chills, sweats</b> — especially in acute/S. aureus IE",
"<b>Anorexia, weight loss</b> — common in subacute IE",
"<b>Malaise, fatigue, myalgia</b>",
"<b>Headache</b> — may signal neurological complications",
]:
elems.append(bullet(b_txt))
elems.append(spacer())
elems += heading2("4.2 Cardiac Manifestations")
for b_txt in [
"<b>New or changing heart murmur</b> — regurgitant murmur; hallmark finding but may be absent in right-sided IE",
"<b>Congestive heart failure (CHF)</b> — most common cause of death; due to valvular destruction, "
"perivalvular abscess, intracardiac fistula, or myocarditis",
"<b>Conduction abnormalities / AV block</b> — suggests aortic valve IE with extension to conduction system "
"or ring/septal abscess; PR prolongation is a warning sign",
"<b>Pericarditis / pericardial effusion</b> — uncommon; associated with S. aureus",
"<b>Perivalvular abscess</b> — aortic valve involved in ~25% of NVE; TEE diagnostic",
]:
elems.append(bullet(b_txt))
elems.append(spacer())
elems += heading2("4.3 Peripheral / Embolic Manifestations")
elems.append(body(
"Emboli from left-sided vegetations travel to systemic circulation; right-sided IE produces pulmonary emboli:"
))
periph_data = [
["Sign", "Description", "Mechanism"],
["Petechiae", "Conjunctivae, palate, buccal mucosa, extremities", "Emboli or vasculitis"],
["Splinter hemorrhages", "Linear hemorrhages beneath nails (proximal third)", "Microemboli"],
["Osler nodes", "Tender, erythematous nodules on finger/toe pads", "Immune complex deposition"],
["Janeway lesions", "Non-tender, erythematous/hemorrhagic macular lesions on palms & soles", "Septic emboli (S. aureus)"],
["Roth spots", "Oval retinal hemorrhages with pale centers", "Immune complex vasculitis"],
["Clubbing", "Chronic IE; rare", "Chronic hypoxia/cytokines"],
["Splenomegaly", "Especially subacute IE", "Immune hyperactivation"],
["Stroke / TIA", "10–40%; most often in first 2 weeks before antibiotics", "Cerebral emboli"],
["Mycotic aneurysm", "Intracranial > visceral; may rupture", "Septic emboli to vasa vasorum"],
]
elems.append(drug_table(periph_data[0], periph_data[1:], col_widths=[4*cm, 6.5*cm, 7*cm]))
elems.append(spacer())
elems.append(colored_box("Memory: Peripheral Signs of IE", [
"<b>FROM JANE</b>:",
" F — Fever (and constitutional)",
" R — Roth spots (retinal)",
" O — Osler nodes (fingers, tender)",
" M — Murmur (new/changing)",
" J — Janeway lesions (palms/soles, painless)",
" A — Anemia (normochromic normocytic)",
" N — Nail-bed (splinter) hemorrhages",
" E — Emboli (septic, stroke, pulmonary)",
], PALE_YELLOW, colors.HexColor("#c0392b")))
elems += heading2("4.4 Right-Sided IE (IVDU)")
elems.append(body(
"In injection drug users, right-sided IE (tricuspid >> pulmonary valve) is most common. "
"S. aureus predominates. Presents with fever, pleuritic chest pain, cough, and hemoptysis "
"from multiple pulmonary septic emboli. Heart murmur may be absent. Prognosis generally "
"better than left-sided IE; medical therapy alone often sufficient."
))
elems.append(spacer())
elems += heading2("4.5 Neurological Complications (~30%)")
for b_txt in [
"Ischemic stroke — most frequent (large-vessel occlusion from emboli)",
"Hemorrhagic stroke — may result from ruptured mycotic aneurysm or septic emboli with hemorrhagic transformation",
"Mycotic aneurysm — typically at middle cerebral artery branches; may rupture weeks-months after treatment",
"Brain abscess / meningitis — especially S. aureus",
"Toxic encephalopathy — multifactorial (fever, emboli, metabolic)",
"Seizures, headache, visual loss — variable presentations",
]:
elems.append(bullet(b_txt))
elems.append(spacer())
elems += heading2("4.6 Renal Complications")
for b_txt in [
"<b>Immune complex glomerulonephritis</b> — diffuse proliferative GN in subacute IE; hematuria, proteinuria, RBC casts",
"<b>Renal infarcts</b> — from septic emboli; flank pain, hematuria",
"<b>Focal embolic nephritis</b>",
"Acute kidney injury common; worsens prognosis",
]:
elems.append(bullet(b_txt))
elems.append(spacer())
return elems
# ── SECTION 5: DIAGNOSIS ──────────────────────────────────────────────────────
def section_diagnosis():
elems = []
elems += heading1("5. Diagnosis")
elems += heading2("5.1 Blood Cultures")
elems.append(body(
"Blood cultures are the <b>cornerstone of IE diagnosis</b>. Bacteremia in IE is typically continuous "
"and low-grade. Collect <b>three sets</b> of blood cultures (aerobic + anaerobic bottles) from separate "
"venipuncture sites over 24 hours before initiating antibiotics in stable patients."
))
elems.append(spacer(0.5))
elems.append(colored_box("Blood Culture Protocol in IE", [
"• Obtain 3 sets from 3 different sites (not from existing IV lines)",
"• Each set: 1 aerobic + 1 anaerobic bottle (10 mL blood per bottle)",
"• If stable (subacute IE), withhold empirical antibiotics until cultures obtained",
"• If unstable/septic: obtain 3 sets over 1–2 hours, then start empirical therapy immediately",
"• Typical yield: >95% positivity if 3 sets drawn BEFORE antibiotics",
"• In culture-negative IE: consider Coxiella, Bartonella, Brucella, fungi, T. whipplei",
], PALE_BLUE, MID_BLUE))
elems.append(spacer())
elems += heading2("5.2 Duke-ISCVID Criteria (Updated)")
elems.append(body(
"The Duke criteria (updated to Duke-ISCVID) classify IE as Definite, Possible, or Rejected "
"based on major and minor criteria:"
))
elems.append(spacer(0.5))
duke_data = [
["Criterion Type", "Specific Items"],
["MAJOR — Microbiologic", "• Typical organism in ≥2 blood cultures: viridans strep, S. bovis, HACEK, S. aureus, "
"or enterococcus (no primary focus)\n"
"• Persistent bacteremia (≥2 cultures drawn >12 h apart, or all 3 of 3 positive)\n"
"• PCR or serology positive for C. burnetii, Bartonella, or T. whipplei from blood or vegetation"],
["MAJOR — Imaging", "• Echocardiogram: vegetation, abscess, pseudoaneurysm, intracardiac fistula, "
"new valvular regurgitation, new partial dehiscence of prosthetic valve\n"
"• PET/CT, SPECT/CT, or cardiac CT showing abnormal activity/perivalvular lesions"],
["MINOR", "• Predisposing heart condition or IDU\n"
"• Fever ≥38°C\n"
"• Vascular phenomena (arterial emboli, septic pulmonary infarcts, Janeway lesions, conjunctival hemorrhage, mycotic aneurysm)\n"
"• Immunologic phenomena (glomerulonephritis, Osler nodes, Roth spots, rheumatoid factor)\n"
"• Positive blood culture not meeting major criterion\n"
"• Positive echocardiogram not meeting major criterion (e.g., new valvular regurgitation)"],
]
elems.append(drug_table(duke_data[0], duke_data[1:], col_widths=[4.5*cm, 13*cm]))
elems.append(spacer(0.5))
elems.append(colored_box("Duke-ISCVID Classification", [
"<b>Definite IE:</b> 2 major criteria OR 1 major + 3 minor criteria OR 5 minor criteria OR "
"pathological criteria (organisms/histology from vegetation or intracardiac abscess)",
"<b>Possible IE:</b> 1 major + 1 minor OR 3 minor criteria",
"<b>Rejected:</b> Firm alternative diagnosis OR resolution of symptoms with ≤4 days antibiotics OR "
"no pathological evidence at surgery/autopsy",
], PALE_GREEN, ACCENT_GREEN))
elems.append(spacer())
elems += heading2("5.3 Echocardiography")
elems.append(body(
"Echocardiography anatomically confirms vegetations, detects intracardiac complications, and assesses "
"cardiac function. Both TTE and TEE are used:"
))
echo_data = [
["Modality", "Sensitivity for Vegetations", "Key Indications / Limitations"],
["TTE (transthoracic)", "65–80% for NVE\n(misses <2 mm vegetations)", "First-line; non-invasive; poor windows in 20% of patients; "
"not optimal for PVE or TAVR-PVE; inadequate for perivalvular extension"],
["TEE (transesophageal)", ">90% for NVE\n>85–94% for PVE", "Superior for PVE, CIED, aortic root abscesses, fistulae; "
"initial false-negative 6–18%; repeat in 7–10 days if initial negative but IE likely; "
"augmented by 3D-TEE for better visualization"],
["Cardiac CT angiogram\n(ECG-gated multislice CTA)", "Less sensitive than TEE for vegetations/perforation/paravalvular leak", "Superior for pseudoaneurysm, perivalvular extension, "
"abscess anatomy; excellent for TAVR-PVE; useful when TEE non-confirmatory"],
["PET/CT with 18F-FDG", "Adjunct modality", "Detects metabolic activity around prosthetic valve; "
"useful in PVE and CIED-IE when other imaging equivocal; major criterion in Duke-ISCVID"],
]
elems.append(drug_table(echo_data[0], echo_data[1:], col_widths=[4*cm, 4*cm, 9.5*cm]))
elems.append(spacer())
elems += heading2("5.4 Laboratory Findings")
for b_txt in [
"<b>CBC:</b> Normochromic normocytic anemia; leukocytosis (acute IE); leukopenia (subacute IE or viral)"
,
"<b>ESR / CRP:</b> Elevated; non-specific but correlate with disease activity",
"<b>Urinalysis:</b> Hematuria, proteinuria, RBC casts (immune complex GN)",
"<b>Complement (C3/C4):</b> Low in immune complex GN",
"<b>Rheumatoid factor:</b> Positive in ~50% of subacute IE (>6 weeks duration)",
"<b>Serum creatinine:</b> Elevated if renal complications",
"<b>Pro-BNP:</b> Elevated in CHF complication",
"<b>ECG:</b> Monitor for PR prolongation/AV block (abscess extending to conduction system)",
]:
elems.append(bullet(b_txt))
elems.append(spacer())
return elems
# ── SECTION 6: TREATMENT ──────────────────────────────────────────────────────
def section_treatment():
elems = []
elems += heading1("6. Antimicrobial Treatment")
elems.append(body(
"Treatment requires prolonged parenteral bactericidal antibiotics to sterilize the vegetation. "
"High bacterial density within the fibrin-platelet matrix demands agents that achieve bactericidal "
"concentrations. Duration is typically <b>4–6 weeks</b>. Therapy should be guided by blood culture "
"sensitivities, MIC values, and pharmacokinetic principles."
))
elems.append(spacer())
elems += heading2("6.1 Empirical Therapy (Before Culture Results)")
elems.append(body(
"Patients with sepsis or hemodynamic instability should receive empirical therapy immediately after "
"three sets of blood cultures are drawn. Empirical regimens:"
))
empirical_data = [
["Setting", "Empirical Regimen", "Rationale"],
["NVE (community-acquired)\nStable subacute", "Withhold until cultures available (if safe)", "Avoid masking pathogen; improves diagnostic yield"],
["NVE (acute/unstable)\nHemodynamically compromised", "Vancomycin + Gentamicin\n(± Cefepime if gram-negatives suspected)", "Covers MRSA, streptococci, enterococci, gram-negatives"],
["PVE (early, ≤60 days)", "Vancomycin + Rifampin + Gentamicin", "CoNS/S. aureus (including MRSA); biofilm penetration"],
["IDU-associated\n(right-sided, S. aureus likely)", "Vancomycin (if MRSA possible)\nOR Nafcillin/Oxacillin (if MSSA)", "Right-sided: 2-week regimen may suffice if uncomplicated"],
]
elems.append(drug_table(empirical_data[0], empirical_data[1:], col_widths=[4*cm, 5.5*cm, 8*cm]))
elems.append(spacer())
elems += heading2("6.2 Streptococcal IE")
strep_data = [
["Organism / MIC", "Preferred Regimen", "Duration"],
["Viridans strep / S. bovis\nPenicillin MIC ≤0.12 µg/mL\n(Highly susceptible)", "Penicillin G 12–18 million U/day IV continuously\nOR Ceftriaxone 2 g IV/IM q24h\n± Gentamicin 3 mg/kg/day for first 2 weeks", "4 weeks\n(2 weeks if add Gent; uncomplicated NVE)"],
["Viridans strep / S. bovis\nPenicillin MIC 0.12–0.5 µg/mL\n(Relatively resistant)", "Penicillin G 24 million U/day IV + Gentamicin 3 mg/kg/day IV/IM q8h for first 2 weeks", "4 weeks total"],
["Penicillin-resistant\nMIC >0.5 µg/mL\nOR Nutritionally variant strep\n(Abiotrophia, Granulicatella)", "Treat as enterococcal IE\n(Ampicillin + Gentamicin or Ampicillin + Ceftriaxone)", "4–6 weeks"],
["Penicillin-allergic patients", "Ceftriaxone 2 g q24h IV/IM\nOR Vancomycin 30 mg/kg/day IV in 2 doses", "4 weeks\nVancomycin for 4 weeks"],
]
elems.append(drug_table(strep_data[0], strep_data[1:], col_widths=[5*cm, 6.5*cm, 6*cm]))
elems.append(spacer())
elems += heading2("6.3 Staphylococcal IE")
staph_data = [
["Organism / Valve", "Preferred Regimen", "Duration / Notes"],
["MSSA NVE", "Nafcillin or Oxacillin 12 g/day IV in 4–6 doses\nOR Cefazolin 6 g/day IV in 3 doses", "6 weeks (4 weeks uncomplicated right-sided)\nGentamicin NOT recommended as routine adjunct (renal toxicity without benefit)"],
["MRSA NVE", "Vancomycin 30–45 mg/kg/day IV in 2–3 doses\n(Target AUC/MIC 400–600)", "6 weeks\nDaptomycin 6–10 mg/kg/day IV is alternative for right-sided or penicillin-allergy"],
["MSSA PVE", "Nafcillin/Oxacillin 12 g/day IV\n+ Rifampin 300 mg PO/IV q8h\n+ Gentamicin 3 mg/kg/day IV in 2–3 doses (first 2 weeks)", "≥6 weeks total\nRifampin added for biofilm penetration; start after 3–5 days of effective bactericidal therapy"],
["MRSA PVE", "Vancomycin 30–45 mg/kg/day IV\n+ Rifampin 300 mg PO/IV q8h\n+ Gentamicin 3 mg/kg/day IV (first 2 weeks)", "≥6 weeks total"],
["S. aureus right-sided IE\n(Tricuspid valve, IVDU)", "Nafcillin/Oxacillin (MSSA) OR Vancomycin (MRSA)\n± Daptomycin 10 mg/kg/day as monotherapy", "2-week course may be sufficient for uncomplicated right-sided NVE (MSSA only)"],
]
elems.append(drug_table(staph_data[0], staph_data[1:], col_widths=[4.5*cm, 6*cm, 7*cm]))
elems.append(spacer())
elems += heading2("6.4 Enterococcal IE")
entero_data = [
["Susceptibility", "Preferred Regimen", "Duration"],
["Ampicillin-susceptible\nHigh-level aminoglycoside susceptible (HLAS)", "Ampicillin 12 g/day IV in 6 doses\n+ Gentamicin 3 mg/kg/day IV in 3 doses", "4–6 weeks\n(4 wk if symptoms <3 mo; 6 wk if ≥3 mo or PVE)"],
["Ampicillin-susceptible\nHigh-level aminoglycoside resistant (HLAR)", "Ampicillin 12 g/day IV\n+ Ceftriaxone 4 g/day IV in 2 doses\n(Double beta-lactam synergy)", "6 weeks\nPreferred over aminoglycoside in HLAR"],
["Vancomycin-resistant\nEnterococcus (VRE)", "Linezolid 600 mg IV/PO q12h\nOR Daptomycin 8–12 mg/kg/day\n± Ampicillin (if susceptible)", "≥8 weeks (linezolid)\nConsult infectious disease"],
]
elems.append(drug_table(entero_data[0], entero_data[1:], col_widths=[5*cm, 6.5*cm, 6*cm]))
elems.append(spacer())
elems += heading2("6.5 Culture-Negative IE")
elems.append(body(
"Culture-negative IE accounts for 5–10% of cases, most often due to prior antibiotic therapy or "
"fastidious/intracellular pathogens. Empirical treatment should cover likely organisms:"
))
cneg_data = [
["Likely Organism", "Regimen", "Notes"],
["Coxiella burnetii (Q fever)\nSerodiagnosis: IgG phase I ≥1:800", "Doxycycline 100 mg PO q12h\n+ Hydroxychloroquine 200 mg PO q8h\n(Monitor QT)", "≥18 months NVE; ≥24 months PVE\nMonitor anti-phase I IgG titer"],
["Bartonella spp.\n(B. henselae, B. quintana)", "Ceftriaxone 2 g IV q24h\n+ Gentamicin 3 mg/kg/day IV\nOR Doxycycline + Gentamicin", "6 weeks\nGentamicin for 2 weeks"],
["Tropheryma whipplei", "Ceftriaxone 2 g IV q24h × 2 weeks, then\nTrimethoprim-sulfamethoxazole DS PO q12h", "1 year or longer"],
["Brucella spp.", "Doxycycline + Rifampin\n± Streptomycin", "3–6 months; surgery often required"],
["HACEK (prior antibiotics)", "Ceftriaxone 2 g IV q24h", "4 weeks NVE; 6 weeks PVE"],
]
elems.append(drug_table(cneg_data[0], cneg_data[1:], col_widths=[4.5*cm, 6*cm, 7*cm]))
elems.append(spacer())
elems.append(colored_box("Key Pharmacological Principles in IE Therapy", [
"• Use <b>bactericidal</b> agents (not bacteriostatic) — vegetation inoculum is extremely high (10⁹–10¹⁰ CFU/g)",
"• Prolonged therapy (4–6 weeks) needed to sterilize dense vegetation",
"• Gentamicin synergy useful for streptococci/enterococci (synergistic killing); nephrotoxic — avoid prolonged use with staphylococci",
"• Rifampin: do not start until bacteremia cleared (prevents resistance emergence); used for biofilm penetration in PVE",
"• Daptomycin for right-sided S. aureus IE; inactivated by pulmonary surfactant — do NOT use for left-sided IE with pulmonary involvement",
"• Vancomycin: target AUC/MIC 400–600; monitor TDM; renal toxicity; inferior to beta-lactams for MSSA",
"• Anticoagulation: continue warfarin for mechanical valve PVE; avoid if CNS embolism; aspirin not recommended routinely",
], PALE_BLUE, MID_BLUE))
elems.append(spacer())
return elems
# ── SECTION 7: SURGICAL MANAGEMENT ────────────────────────────────────────────
def section_surgery():
elems = []
elems += heading1("7. Surgical Management")
elems.append(body(
"Approximately 40–50% of IE patients require valve surgery during the acute phase. "
"Surgery removes infected tissue, drains abscesses, and repairs or replaces valves. "
"Prompt surgical consultation should occur whenever IE is diagnosed — daily assessment for "
"surgical indications is mandatory."
))
elems.append(spacer())
elems += heading2("7.1 Indications for Surgery (AHA/ESC Guidelines)")
elems.append(body(
"Surgery is indicated when the risk of continued medical therapy exceeds surgical risk. "
"Indications are classified as emergent, urgent, or elective:"
))
surg_data = [
["Indication", "Urgency"],
["Heart failure due to valve dysfunction (aortic or mitral regurgitation / fistula)", "EMERGENT / URGENT"],
["Perivalvular extension — abscess, pseudoaneurysm, fistula, destructive penetrating lesion", "URGENT"],
["New or worsening AV block (suggests aortic root abscess)", "URGENT"],
["Uncontrolled infection — persisting fever/bacteremia >5–7 days on appropriate antibiotics", "URGENT"],
["Fungal IE or highly resistant organisms (VRE, VRSA, MDR gram-negatives)", "URGENT"],
["PVE with new dehiscence, obstruction, or instability", "URGENT"],
["Recurrent emboli after adequate antibiotics + large mobile vegetations (>10 mm)", "URGENT"],
["Very large mobile vegetation (>10 mm) with high embolic risk, especially on anterior mitral leaflet", "ELECTIVE"],
["Relapse of PVE", "ELECTIVE"],
["CIED-IE: complete removal of infected device + leads", "RECOMMENDED"],
]
elems.append(drug_table(surg_data[0], surg_data[1:], col_widths=[13.5*cm, 4*cm]))
elems.append(spacer())
elems += heading2("7.2 Timing of Surgery After Neurological Complications")
elems.append(body(
"Neurological complications (ischemic stroke, intracranial hemorrhage) complicate the decision "
"to operate. General guidance based on Harrison's/AHA/ESC:"
))
for b_txt in [
"TIA or silent embolic stroke without major neurological deficit: proceed with surgery without delay",
"Ischemic stroke without hemorrhagic transformation: surgery can proceed after 2–3 weeks if neurological status stable",
"Intracranial hemorrhage: delay surgery ≥4 weeks whenever possible",
"Mycotic aneurysm: manage (coil/clip) before cardiac surgery when feasible",
"Coma or major irreversible cerebral injury: surgery associated with high mortality; individualize",
]:
elems.append(bullet(b_txt))
elems.append(spacer())
return elems
# ── SECTION 8: COMPLICATIONS ──────────────────────────────────────────────────
def section_complications():
elems = []
elems += heading1("8. Complications & Prognosis")
elems += heading2("8.1 Major Complications")
comp_data = [
["Complication", "Frequency", "Key Points"],
["Congestive Heart Failure", "50–60% (most common cause of death)", "Due to valve destruction, fistula, myocarditis; indication for surgery"],
["Systemic Emboli (left-sided)", "20–40% (highest risk in first 2 weeks)", "Stroke, renal/splenic/coronary infarcts; declines after antibiotics"],
["Intracardiac abscess", "20–30% overall; 40–50% aortic valve", "Perivalvular; spread to conduction system; TEE required"],
["Neurological complications", "25–35%", "Stroke, encephalopathy, mycotic aneurysm, meningitis"],
["Renal failure", "10–20%", "Immune GN, septic emboli, drug nephrotoxicity"],
["Mycotic aneurysm", "3–5%", "Intracranial; may rupture after treatment; follow-up MRA/CTA"],
["Metastatic infection", "Variable", "Osteomyelitis, septic arthritis, epidural abscess, psoas abscess"],
["Relapse", "2–10%", "Inadequate duration; oral bioavailability inadequate; re-treat × 4–6 weeks"],
]
elems.append(drug_table(comp_data[0], comp_data[1:], col_widths=[4.5*cm, 4*cm, 9*cm]))
elems.append(spacer())
elems += heading2("8.2 Prognosis / Predictors of Mortality")
elems.append(body(
"In-hospital mortality remains approximately 15–20% for NVE and 20–40% for PVE. "
"Predictors of poor outcome include:"
))
for b_txt in [
"Older age, multiple comorbidities (diabetes, renal failure, immunosuppression)",
"S. aureus or fungal etiology",
"Prosthetic valve involvement",
"Congestive heart failure at presentation",
"Perivalvular extension / intracardiac abscess",
"Large or mobile vegetation (>10 mm) — embolic risk",
"Neurological complications before surgery",
"Delayed diagnosis or delayed surgery when indicated",
]:
elems.append(bullet(b_txt))
elems.append(spacer())
return elems
# ── SECTION 9: PREVENTION ─────────────────────────────────────────────────────
def section_prevention():
elems = []
elems += heading1("9. Prevention (Prophylaxis)")
elems.append(body(
"Antibiotic prophylaxis targets high-risk patients undergoing procedures with a significant risk of "
"bacteremia from organisms known to cause IE. According to AHA guidelines, prophylaxis is recommended "
"for <b>high-risk cardiac conditions</b> before <b>dental procedures</b> involving manipulation of "
"gingival tissue or the periapical region or perforation of the oral mucosa."
))
elems.append(spacer(0.5))
elems += heading2("9.1 High-Risk Cardiac Conditions (AHA)")
for b_txt in [
"Prosthetic cardiac valves (mechanical or bioprosthetic)",
"Previous IE",
"Congenital heart disease: unrepaired cyanotic CHD, repaired CHD with prosthetic material (first 6 months), "
"repaired CHD with residual defects adjacent to prosthetic material",
"Cardiac transplantation recipients with valvulopathy",
]:
elems.append(bullet(b_txt))
elems.append(spacer(0.5))
elems += heading2("9.2 Prophylaxis Regimens (Dental Procedures)")
prop_data = [
["Situation", "Agent", "Dose (Adults)", "Timing"],
["Standard — oral", "Amoxicillin", "2 g PO", "30–60 min before procedure"],
["Unable to take oral", "Ampicillin OR Cefazolin/Ceftriaxone", "2 g IM/IV OR 1 g IM/IV", "30–60 min before"],
["Penicillin-allergic — oral", "Cephalexin OR Clindamycin OR Azithromycin/Clarithromycin", "2 g / 600 mg / 500 mg PO", "30–60 min before"],
["Penicillin-allergic — parenteral", "Cefazolin/Ceftriaxone OR Clindamycin", "1 g IM/IV OR 600 mg IM/IV", "30–60 min before"],
]
elems.append(drug_table(prop_data[0], prop_data[1:], col_widths=[4.5*cm, 4*cm, 4*cm, 5*cm]))
elems.append(spacer())
elems.append(colored_box("Important Note on Prophylaxis", [
"• Prophylaxis is <b>NO LONGER recommended</b> for moderate-risk cardiac lesions (mitral valve prolapse, "
"bicuspid aortic valve, rheumatic valve disease WITHOUT prosthetic valve) — major change from earlier AHA guidelines",
"• Maintain rigorous oral hygiene: poor dental hygiene → frequent bacteremia → far greater risk than "
"procedure-related bacteremia",
"• Prophylaxis is NOT indicated for GI or GU procedures in most patients (AHA 2007 guideline change)",
], PALE_YELLOW, colors.HexColor("#e67e22")))
elems.append(spacer())
return elems
# ── SECTION 10: CLINICAL PEARLS ───────────────────────────────────────────────
def section_pearls():
elems = []
elems += heading1("10. Clinical Pearls & High-Yield Summary")
pearls = [
("Think IE when...", PALE_RED, ACCENT_RED, [
"New regurgitant murmur + fever + blood cultures positive for S. aureus, streptococci, or enterococci",
"Any patient with bacteremia and prosthetic valve, CIED, or congenital heart disease",
"Stroke or TIA in a young/middle-aged patient with fever and no obvious cause",
"S. bovis bacteremia → always colonoscopy (colon cancer association)",
"Staphylococcal bacteremia from no obvious source → rule out IE with TEE",
]),
("Never miss these complications", PALE_RED, ACCENT_RED, [
"PR prolongation on ECG → abscess extending to AV node → urgent surgery",
"Sudden aortic regurgitation → left-sided heart failure → emergent valve replacement",
"Persistent fever/bacteremia >5–7 days despite antibiotics → perivalvular abscess, infected thrombus, or resistant organism",
"Headache/altered sensorium → intracranial mycotic aneurysm or embolic stroke",
]),
("Treatment pearls", PALE_GREEN, ACCENT_GREEN, [
"Bactericidal + prolonged (4–6 weeks) therapy is mandatory",
"MSSA: beta-lactam (nafcillin/cefazolin) superior to vancomycin — use it whenever susceptibility confirmed",
"Do not add gentamicin to staphylococcal regimens — no benefit, nephrotoxic",
"Rifampin: start only after bacteremia is cleared (prevent resistance); use in PVE",
"Early surgical consultation for all IE patients — daily re-evaluation for indications",
"Daptomycin NOT for left-sided IE with pulmonary involvement",
]),
("Diagnostic pearls", PALE_BLUE, MID_BLUE, [
"Draw 3 blood cultures from 3 sites before antibiotics whenever safe",
"TEE > TTE for PVE, CIED, aortic root assessment",
"Negative TEE does not exclude IE — repeat in 7–10 days if suspicion remains high",
"Duke-ISCVID criteria include PET/CT and molecular diagnostics",
"Culture-negative IE: request Coxiella and Bartonella serology, PCR of valve tissue",
]),
]
for title, bg, title_bg, items in pearls:
elems.append(colored_box(title, [f"• {i}" for i in items], bg, title_bg))
elems.append(spacer())
elems.append(hr(DARK_BLUE, 1.5))
elems.append(Paragraph(
"<b>Source:</b> Harrison's Principles of Internal Medicine, 22nd Edition (2025), "
"Chapter 133: Infective Endocarditis. Sara E. Cosgrove, Michael T. Melia. McGraw-Hill Medical.",
S["Reference"]
))
elems.append(Spacer(1, 0.3*cm))
elems.append(Paragraph(
"Compiled for medical education purposes. For clinical decisions, consult current guidelines "
"(AHA 2023, ESC 2023) and the full Harrison's textbook.",
S["Reference"]
))
return elems
# ── PAGE TEMPLATE ─────────────────────────────────────────────────────────────
def on_page(canvas, doc):
canvas.saveState()
# Header bar
canvas.setFillColor(DARK_BLUE)
canvas.rect(0, H - 1.2*cm, W, 1.2*cm, fill=1, stroke=0)
canvas.setFont("Helvetica-Bold", 8)
canvas.setFillColor(colors.white)
canvas.drawString(1.5*cm, H - 0.85*cm, "INFECTIVE ENDOCARDITIS")
canvas.drawRightString(W - 1.5*cm, H - 0.85*cm, "Harrison's Principles of Internal Medicine, 22E")
# Footer
canvas.setFillColor(GRAY_LIGHT)
canvas.rect(0, 0, W, 0.9*cm, fill=1, stroke=0)
canvas.setFillColor(colors.HexColor("#555555"))
canvas.setFont("Helvetica", 8)
canvas.drawString(1.5*cm, 0.32*cm, "Basic Science to Clinical Management | Medical Education Resource")
canvas.drawRightString(W - 1.5*cm, 0.32*cm, f"Page {doc.page}")
canvas.restoreState()
# ── MAIN BUILD ────────────────────────────────────────────────────────────────
def build_pdf(output_path):
doc = SimpleDocTemplate(
output_path,
pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=1.8*cm, bottomMargin=1.5*cm,
title="Infective Endocarditis — Harrison's 22E",
author="Orris Medical Education",
subject="Infective Endocarditis: Basic to Clinical",
)
story = []
story += cover_page()
story += section_overview()
story.append(PageBreak())
story += section_pathogenesis()
story.append(PageBreak())
story += section_etiology()
story.append(PageBreak())
story += section_clinical()
story.append(PageBreak())
story += section_diagnosis()
story.append(PageBreak())
story += section_treatment()
story.append(PageBreak())
story += section_surgery()
story += section_complications()
story.append(PageBreak())
story += section_prevention()
story += section_pearls()
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF saved to: {output_path}")
if __name__ == "__main__":
build_pdf("/tmp/workspace/IE-harrison/Infective_Endocarditis_Harrisons_22E.pdf")
cd /tmp/workspace/IE-harrison && python3 generate_ie_pdf.py 2>&1
ls -lh /tmp/workspace/IE-harrison/
python3 -c "from pypdf import PdfReader; r = PdfReader('/tmp/workspace/IE-harrison/Infective_Endocarditis_Harrisons_22E.pdf'); print(f'Pages: {len(r.pages)}')"
Infective Endocarditis Harrisons 22E
PDF Document · PDF
| Section | Content |
|---|---|
| 1. Definition & Overview | Vegetation anatomy, acute vs. subacute classification, epidemiology (15/100K/yr, IDU trends, TAVR/CIED statistics) |
| 2. Basic Science: Pathogenesis | Predisposing conditions table, 6-step vegetation formation (NBTE → adhesion → biofilm), virulence factors |
| 3. Etiology & Microbiology | All causative organisms with frequency % and clinical associations; HACEK memory aid; PVE timing-based microbiology |
| 4. Clinical Manifestations | Constitutional, cardiac (CHF, AV block, abscess), peripheral signs (Osler/Janeway/Roth/splinters) with FROM JANE mnemonic, right-sided IE (IDU), neurological complications, renal complications |
| 5. Diagnosis | Blood culture protocol, Duke-ISCVID criteria (updated with PET/CT + molecular), TTE/TEE/CT/PET comparison table, lab findings |
| 6. Antimicrobial Treatment | Empirical therapy, plus organism-specific regimens for streptococci, MSSA/MRSA (NVE + PVE), enterococci (HLAS/HLAR/VRE), culture-negative IE (Coxiella, Bartonella, T. whipplei) |
| 7. Surgical Management | AHA indications by urgency, timing after neurological complications |
| 8. Complications & Prognosis | CHF, emboli, abscess, neurological, renal, mycotic aneurysm with frequencies and mortality predictors |
| 9. Prevention | High-risk cardiac conditions, prophylaxis regimens with dosing |
| 10. Clinical Pearls | High-yield "Think IE when...", "Never miss...", treatment and diagnostic pearls |
Note: The library contains Harrison's 22nd Edition (2025) - the most current available - which supersedes the 21st. All content is sourced from Chapter 133.