Infective endocarditis

Reading File
Finding Sources
Searching Images

infective endocarditis vegetation heart valve

This intraoperative clinical photograph displays a macro-level view of excised cardiac vegetation, typical of infective endocarditis, resting on a white, sterile surgical gauze swab. The vegetation appears as an irregular, friable, and multi-lobulated tissue mass with a reddish-pink hue, indicating significant vascularization or associated blood clot formation. The specimen's texture is heterogeneous and rough, consistent with a collection of fibrin, platelets, and microorganisms typically found on heart valve surfaces during active infection. The surrounding white gauze shows several focal areas of bright red serosanguinous staining where the vegetation has been placed. This image is medically significant for illustrating the gross pathological morphology of a mitral valve vegetation following surgical excision and valve debridement. It serves as a visual record of the endovascular disease process, highlighting the size and friability of the mass that contributed to valvular regurgitation and potential embolic risk.

This intraoperative clinical photograph displays a macro-level view of excised cardiac vegetation, typical of infective endocarditis, resting on a white, sterile surgical gauze swab. The vegetation appears as an irregular, friable, and multi-lobulated tissue mass with a reddish-pink hue, indicating significant vascularization or associated blood clot formation. The specimen's texture is heterogeneous and rough, consistent with a collection of fibrin, platelets, and microorganisms typically found on heart valve surfaces during active infection. The surrounding white gauze shows several focal areas of bright red serosanguinous staining where the vegetation has been placed. This image is medically significant for illustrating the gross pathological morphology of a mitral valve vegetation following surgical excision and valve debridement. It serves as a visual record of the endovascular disease process, highlighting the size and friability of the mass that contributed to valvular regurgitation and potential embolic risk.

This composite educational image illustrates the macroscopic and histopathological characteristics of infective endocarditis on human heart valves. (A) Clinical photograph of an excised valve showing friable, reddish-brown vegetations (VG) contrasting against smooth, translucent normal tissue (N). (B, C) Light microscopy using Alcian blue and Nuclear Fast Red counterstain displays the interface between the septic thrombus (red-stained inflammatory cells and polylobed PMNs) and underlying valvular tissue exhibiting mucoid degeneration (blue-stained areas). The dotted line marks the clear boundary between the infected vegetation and the valve stroma. (D) TUNEL assay micrograph highlights the presence of cellular damage. Apoptotic cells (indicated by arrowheads) appear as dark, discrete nuclear spots, while extracellular fragmented DNA (indicated by arrows) shows diffuse, dark staining concentrated at the vegetation-valve interface. This visual series demonstrates the key pathological hallmarks of valvular infection, including thrombus formation, inflammatory infiltration, and programmed cell death.

This composite educational image illustrates the macroscopic and histopathological characteristics of infective endocarditis on human heart valves. (A) Clinical photograph of an excised valve showing friable, reddish-brown vegetations (VG) contrasting against smooth, translucent normal tissue (N). (B, C) Light microscopy using Alcian blue and Nuclear Fast Red counterstain displays the interface between the septic thrombus (red-stained inflammatory cells and polylobed PMNs) and underlying valvular tissue exhibiting mucoid degeneration (blue-stained areas). The dotted line marks the clear boundary between the infected vegetation and the valve stroma. (D) TUNEL assay micrograph highlights the presence of cellular damage. Apoptotic cells (indicated by arrowheads) appear as dark, discrete nuclear spots, while extracellular fragmented DNA (indicated by arrows) shows diffuse, dark staining concentrated at the vegetation-valve interface. This visual series demonstrates the key pathological hallmarks of valvular infection, including thrombus formation, inflammatory infiltration, and programmed cell death.

Two-panel diagnostic echocardiography (ultrasound) images demonstrating infective endocarditis with multiple vegetations on the left heart valves. The left panel shows a parasternal long-axis view of the bicuspid aortic valve, with hyperechoic, irregular masses (vegetations) attached to the tips of the anterior (yellow arrow) and posterior (blue arrow) leaflets. The right panel highlights the mitral valve apparatus, where another distinct hyperechoic vegetation is visible on the body of the anterior mitral valve leaflet (green arrow). These findings are highly suggestive of active infective endocarditis, illustrating the characteristic appearance of mobile, irregular echoes attached to valvular endocardial surfaces. Clinical relevance includes the high risk of systemic embolization given the size and location of these vegetations, commonly associated with pathogens such as Streptococcus gordonii. This visual serves as an educational tool for identifying valvular pathology, measuring vegetation dimensions, and assessing the risk of secondary complications like septic emboli in a cardiothoracic or infectious disease context.

Two-panel diagnostic echocardiography (ultrasound) images demonstrating infective endocarditis with multiple vegetations on the left heart valves. The left panel shows a parasternal long-axis view of the bicuspid aortic valve, with hyperechoic, irregular masses (vegetations) attached to the tips of the anterior (yellow arrow) and posterior (blue arrow) leaflets. The right panel highlights the mitral valve apparatus, where another distinct hyperechoic vegetation is visible on the body of the anterior mitral valve leaflet (green arrow). These findings are highly suggestive of active infective endocarditis, illustrating the characteristic appearance of mobile, irregular echoes attached to valvular endocardial surfaces. Clinical relevance includes the high risk of systemic embolization given the size and location of these vegetations, commonly associated with pathogens such as Streptococcus gordonii. This visual serves as an educational tool for identifying valvular pathology, measuring vegetation dimensions, and assessing the risk of secondary complications like septic emboli in a cardiothoracic or infectious disease context.

Diagnostic ultrasound montage demonstrating infective endocarditis (IE) and its surgical resolution via transthoracic echocardiography. Panels A (grayscale) and B (sepia-toned) show a parasternal long-axis view of the heart. A distinct, pedunculated, and echogenic mass labeled 'vegetation' is indicated by a white arrow, attached to the aortic valve leaflet. Panels C and D utilize color Doppler imaging in a four-chamber or modified atrial view to assess hemodynamic changes. Panel C illustrates an abnormal left-to-right atrial shunt, characterized by a high-velocity, turbulent multi-colored jet crossing the interatrial septum. Panel D, obtained postoperatively, shows the absence of this shunt and restored laminar flow (represented by stable red and blue signals), confirming successful surgical repair and removal of the infected vegetation. This image sequence serves as a clinical comparison for medical students and cardiologists to identify valvular vegetations and evaluate the efficacy of surgical intervention in congenital or acquired heart defects complicated by infection.

Diagnostic ultrasound montage demonstrating infective endocarditis (IE) and its surgical resolution via transthoracic echocardiography. Panels A (grayscale) and B (sepia-toned) show a parasternal long-axis view of the heart. A distinct, pedunculated, and echogenic mass labeled 'vegetation' is indicated by a white arrow, attached to the aortic valve leaflet. Panels C and D utilize color Doppler imaging in a four-chamber or modified atrial view to assess hemodynamic changes. Panel C illustrates an abnormal left-to-right atrial shunt, characterized by a high-velocity, turbulent multi-colored jet crossing the interatrial septum. Panel D, obtained postoperatively, shows the absence of this shunt and restored laminar flow (represented by stable red and blue signals), confirming successful surgical repair and removal of the infected vegetation. This image sequence serves as a clinical comparison for medical students and cardiologists to identify valvular vegetations and evaluate the efficacy of surgical intervention in congenital or acquired heart defects complicated by infection.

Searching PubMed

"infective endocarditis"[MeSH Terms] AND management

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Reading File
Loading Image
I now have comprehensive content from multiple authoritative textbooks. Let me compile the full detailed answer.

Infective Endocarditis (IE)

Definition

Infective endocarditis is a microbial infection of the heart valves or endocardium leading to the formation of vegetations - friable masses composed of thrombotic debris, inflammatory cells, fibrin, and microorganisms - often associated with destruction of underlying cardiac tissue. The aorta, aneurysmal sacs, other blood vessels, and prosthetic devices may also become infected. - Robbins & Kumar Basic Pathology, p. 368

Classification

FeatureAcute IESubacute IE
OnsetRapid (days)Insidious (weeks-months)
Typical organismS. aureusViridans streptococci
Valve affectedNormal or abnormalTypically abnormal/damaged
Tissue destructionHighly destructiveLess destructive
MortalityHigh even with therapyLower; most recover with antibiotics

Epidemiology

  • Annual incidence: 3-15 cases per 100,000 persons in Western countries
  • IE has become increasingly a disease of older adults (incidence rises dramatically over age 60)
  • Injection drug use (IDU): rose from 7% of cases in 2000 to >50% in some communities, driven by the opioid epidemic
  • Up to 36% of community-onset IE is healthcare-associated (nursing home residents, dialysis, chemotherapy, recent hospitalization)
  • 90-day mortality averages ~25%; predictors of poor outcome: older age, S. aureus infection, heart failure, perivalvular extension
  • Rosen's Emergency Medicine, p. 1130-1131

Pathogenesis

Development of IE requires a sequence of events:
  1. Endothelial damage or turbulent flow → sterile platelet-fibrin thrombus forms on valve surface
  2. Bacteremia → seeding of the thrombus with microorganisms
  3. Vegetation formation → organisms proliferate within the thrombus, protected from host defenses
Key predisposing cardiac conditions:
  • Mitral valve prolapse (now the leading preexistent risk factor as rheumatic disease has declined)
  • Bicuspid aortic valve
  • Calcific valvular stenosis
  • Rheumatic heart disease (still common in developing countries)
  • Prosthetic heart valves (account for 10-20% of all IE cases; risk 0.3-1.2% per patient/year)
  • Intra-cardiac device leads (pacemakers, defibrillators)
  • Prior IE (high lifelong recurrence risk)
Host risk factors: neutropenia, immunodeficiency, malignancy, diabetes, alcohol use, IV drug use. Notably, up to 50% of IE patients have no known predisposing structural heart disease at presentation. - Rosen's Emergency Medicine, p. 1131

Microbiology

The three most common causes worldwide are staphylococci, streptococci, and enterococci:
OrganismSettingNotes
Viridans streptococciCommunity-acquired, damaged valves50-60% of community IE; subacute course
Staphylococcus aureusHealthcare, IDU; attacks healthy valvesMost common cause in high-income countries; acute, aggressive
EnterococciGI/GU sourceIntermediate virulence
HACEK groupOral cavity commensalsHaemophilus, Actinobacillus, Cardiobacterium, Eikenella, Kingella; <6% of cases
FungiImmunocompromised, prosthetic valvesRare; difficult to treat
Culture-negativePrior antibiotics, Q fever (Coxiella burnetii), Chlamydia~10% of cases
  • Robbins & Kumar Basic Pathology, p. 368

Morphology / Pathology

  • Vegetations are friable, bulky masses on heart valves; most commonly aortic and mitral valves (left-sided), but the tricuspid valve is a frequent target in IDU (right-sided ~50% of IDU cases)
  • Vegetations may be single or multiple, may involve more than one valve
  • Can erode into underlying myocardium → ring abscess (perivalvular abscess)
  • Vegetation shedding leads to septic emboli → infarcts and mycotic aneurysms at sites of lodgment
The diagram below (from Robbins) shows the different vegetation patterns across types of endocarditis:
Comparison of vegetation distributions in RHD, IE, NBTE, and LSE
Valve vegetations in RHD (along leaflet closure line), IE (large, destructive, irregular), NBTE (small, sterile), and LSE (Libman-Sacks, on both surfaces). - Robbins & Kumar Basic Pathology
Gross pathology and echocardiographic appearances of vegetation:
Excised friable mitral valve vegetation - infective endocarditis gross pathology
Echocardiogram showing vegetations on aortic and mitral valves in IE
TTE apical 4-chamber view showing large mitral valve vegetation (from Rosen's Emergency Medicine)

Clinical Features

The most common symptom is fever (present in ~90% of patients). Other features span a wide spectrum:

Systemic symptoms

  • Fever, chills, malaise, weight loss, night sweats
  • Arthralgia, myalgia, back/neck pain

Cardiac signs

  • New or changing heart murmur (present in 90% with left-sided lesions)
  • Signs of heart failure (if severe valvular insufficiency develops)
  • Arrhythmia (suggests myocardial/conduction extension)

Peripheral stigmata (embolic/immunologic phenomena)

SignMechanismLocation
PetechiaeMicroemboli / vasculitisConjunctiva, mucosae, skin
Splinter hemorrhagesMicroemboli in nail bed capillariesSubungual (linear dark streaks)
Janeway lesionsSeptic emboli → microabscessesPalms/soles; painless, erythematous
Osler nodesImmune complex deposition / microemboliFingertips/toes; painful nodules
Roth spotsImmune complex vasculitisRetinal hemorrhages with pale center
SplenomegalyImmune activationCommon in subacute IE
GlomerulonephritisAntigen-antibody complex trappingHematuria, proteinuria, renal failure
Memory aid - Janeway vs Osler: Janeway - J for "Just painless" on the Junction of palms/soles; Osler - "Ouch" (painful nodules)

Embolic complications

  • Cerebral emboli are the most frequent large-vessel site → ischemic stroke ± hemorrhagic transformation
  • Left-sided: systemic emboli (brain, spleen, kidneys, extremities), mycotic aneurysms
  • Right-sided (IDU): septic pulmonary emboli, lung abscesses

Diagnosis: Modified Duke Criteria

Definite IE = 2 major, OR 1 major + 3 minor, OR 5 minor criteria

Possible IE = 1 major + 1-2 minor, OR 3 minor criteria

MAJOR Criteria

1. Positive blood cultures:
  • ≥2 sets positive with typical IE pathogen: S. aureus, viridans streptococci, S. bovis, enterococci, HACEK group
  • Persistent positive blood cultures with IE-consistent organism
  • Single blood culture or serology positive for Coxiella burnetii
2. Evidence of endocardial involvement by echocardiography:
  • Pendulum-like vegetation on valve endocardium
  • Paravalvular abscess
  • Prosthetic valve dehiscence
  • New valvular regurgitation

MINOR Criteria

  • Predisposition: predisposing heart condition or IV drug use
  • Fever: temperature >38°C (100.4°F)
  • Vascular phenomena: arterial emboli, septic pulmonary infarcts, mycotic aneurysm, conjunctival hemorrhages, Janeway lesions
  • Immunologic phenomena: glomerulonephritis, Osler nodes, Roth spots, rheumatoid factor positive
  • Microbiologic evidence: positive blood culture not meeting major criteria
  • Rosen's Emergency Medicine, p. 1130-1135

Investigations

InvestigationFindings
Blood cultures3 sets from different sites before antibiotics; most important test
TTE (transthoracic echo)Initial imaging; sensitivity ~60-70% for vegetations
TEE (transesophageal echo)Higher sensitivity (>90%); indicated if TTE negative with high suspicion, prosthetic valve, suspected perivalvular complications
CT/MRI brainAsymptomatic cerebral emboli in up to 60% of left-sided IE
FBCNormocytic anemia, leukocytosis
CRP/ESRElevated
UrinalysisHematuria (glomerulonephritis)
ECGNew heart block suggests perivalvular abscess extending to conduction system
Blood cultures should be drawn before starting antibiotics - 3 sets from 3 different venipuncture sites over 1-2 hours. Every patient with IE should be managed at a center with multidisciplinary expertise (infectious diseases, cardiovascular medicine, cardiovascular surgery). - Braunwald's Heart Disease, p. 1524

Management

Empiric Antibiotic Therapy (pending cultures)

Native valve / IDU:
  • Vancomycin 20-35 mg/kg loading dose, then 15-20 mg/kg q8-12h (not to exceed 3000 mg) - covers MRSA and most gram-positives
  • Add ceftriaxone 2 g/day to cover HACEK and gram-negative organisms if needed
Definitive therapy is pathogen-directed, selected by infectious disease specialists based on culture results and sensitivities. Treatment duration: 4-6 weeks of parenteral antibiotics (due to difficulty penetrating dense vegetations). Selected stable patients may complete IV therapy as outpatient or with partial oral therapy protocols.

Surgical Indications

Surgery is indicated in approximately 50% of left-sided IE patients during the index admission. Indications include (Box 69.4):
  • Aortic or mitral insufficiency with ventricular failure (heart failure)
  • Valve perforation or rupture
  • Perivalvular extension: abscess, fistula, associated heart block
  • Prosthetic valve dehiscence
  • Vegetation >10 mm on anterior mitral leaflet (high embolic risk)
  • Recurrent embolization or persistent bacteremia despite therapy
Rosen's Emergency Medicine, p. 1131-1132

Prevention (AHA 2021 Guidelines)

Antibiotic prophylaxis is recommended before invasive dental procedures for high-risk patients:
High-risk conditions warranting prophylaxis:
  • Prosthetic cardiac valve or valve repair with prosthetic material
  • Prior history of IE
  • Certain congenital heart defects (unrepaired cyanotic CHD; repaired CHD with residual shunt/regurgitation; CHD repaired with prosthetic material within 6 months)
  • Cardiac transplant with valvulopathy
  • Ventricular assist devices / implantable hearts (added in 2021 update)
Prophylaxis regimen: Amoxicillin 2g PO 30-60 min before procedure (preferred). In penicillin allergy: doxycycline or azithromycin (clindamycin removed from 2021 guidelines due to C. difficile risk).
  • Braunwald's Heart Disease, p. 1524-1527

Prognosis

  • Overall in-hospital mortality ~20-30%
  • Poor prognostic factors: S. aureus infection, prosthetic valve IE, perivalvular extension, heart failure, older age, renal failure, embolic stroke
  • Better prognosis: streptococcal IE, right-sided (IDU) IE
  • Left untreated, IE is generally fatal; with appropriate antibiotics ± surgery, survival is greatly improved

Key Summary Points

  1. Vegetation = fibrin + platelets + organisms on a damaged valve
  2. Most common organisms: S. aureus (healthcare/IDU), viridans streptococci (community/dental)
  3. Fever is the most consistent sign; peripheral stigmata (Osler nodes, Janeway lesions, Roth spots, splinter hemorrhages) are classic but not always present
  4. Diagnosis uses Modified Duke Criteria: blood cultures + echocardiography are the cornerstones
  5. TEE is more sensitive than TTE, especially for prosthetic valves and perivalvular complications
  6. Requires 4-6 weeks of targeted IV antibiotics; ~50% of left-sided IE need surgery
  7. Management requires a multidisciplinary team at a center with cardiac surgery capability
  8. AHA 2021: antibiotic prophylaxis for high-risk patients before invasive dental procedures; amoxicillin preferred; clindamycin removed as an option

Sources: Braunwald's Heart Disease (9780323722193); Robbins & Kumar Basic Pathology (9780323790185); Rosen's Emergency Medicine (9780323757898)

Prepare a sheet chart summarizing all this

Reading File
Running Command

ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "created"

Running Command

cat << 'PYEOF' > /tmp/workspace/ie_chart.py import openpyxl from openpyxl.styles import ( Font, PatternFill, Alignment, Border, Side, GradientFill ) from openpyxl.utils import get_column_letter wb = openpyxl.Workbook() ws = wb.active ws.title = "IE Summary" # ── Colour palette ─────────────────────────────────────────────────────────── DARK_NAVY = "1B2A4A" MED_BLUE = "2E5FA3" LIGHT_BLUE = "BDD7EE" PALE_BLUE = "DEEAF1" ACCENT_RED = "C0392B" ACCENT_GRN = "1A7A4C" ACCENT_ORG = "D35400" ACCENT_PRP = "6C3483" YELLOW_HL = "FFF2CC" WHITE = "FFFFFF" LIGHT_GREY = "F2F2F2" MID_GREY = "D9D9D9" def fill(hex_col): return PatternFill("solid", fgColor=hex_col) def font(bold=False, color="000000", size=10, italic=False): return Font(name="Arial", bold=bold, color=color, size=size, italic=italic) def align(h="left", v="center", wrap=True): return Alignment(horizontal=h, vertical=v, wrap_text=wrap) def thin_border(top=True, bottom=True, left=True, right=True): s = Side(style="thin", color="AAAAAA") n = Side(style=None) return Border( top=s if top else n, bottom=s if bottom else n, left=s if left else n, right=s if right else n, ) def thick_border(): s = Side(style="medium", color="1B2A4A") return Border(top=s, bottom=s, left=s, right=s) def set_cell(ws, row, col, value, bold=False, color="000000", bg=None, size=10, h="left", v="center", wrap=True, italic=False, border=True, merge_end_col=None): cell = ws.cell(row=row, column=col, value=value) cell.font = font(bold=bold, color=color, size=size, italic=italic) cell.alignment = align(h=h, v=v, wrap=wrap) if bg: cell.fill = fill(bg) if border: cell.border = thin_border() if merge_end_col: ws.merge_cells(start_row=row, start_column=col, end_row=row, end_column=merge_end_col) return cell # ── Column widths ──────────────────────────────────────────────────────────── col_widths = {1:28, 2:32, 3:32, 4:32, 5:32} for c, w in col_widths.items(): ws.column_dimensions[get_column_letter(c)].width = w # ── Freeze panes ───────────────────────────────────────────────────────────── ws.freeze_panes = "A4" # ══════════════════════════════════════════════════════════════════════════════ # TITLE BLOCK (rows 1-2) # ══════════════════════════════════════════════════════════════════════════════ ws.row_dimensions[1].height = 38 ws.row_dimensions[2].height = 18 set_cell(ws, 1, 1, "INFECTIVE ENDOCARDITIS — Clinical Summary Chart", bold=True, color=WHITE, bg=DARK_NAVY, size=16, h="center", merge_end_col=5) set_cell(ws, 2, 1, "Sources: Braunwald's Heart Disease | Robbins & Kumar Basic Pathology | Rosen's Emergency Medicine", italic=True, color="666666", bg=LIGHT_GREY, size=9, h="center", merge_end_col=5) # ══════════════════════════════════════════════════════════════════════════════ # Helper: section header spanning all 5 cols # ══════════════════════════════════════════════════════════════════════════════ def section_header(row, title, bg=MED_BLUE): ws.row_dimensions[row].height = 20 set_cell(ws, row, 1, title, bold=True, color=WHITE, bg=bg, size=11, h="left", merge_end_col=5) def col_header(row, texts, bgs=None): ws.row_dimensions[row].height = 18 default_bgs = [LIGHT_BLUE]*len(texts) bgs = bgs or default_bgs for i, (t, b) in enumerate(zip(texts, bgs), start=1): set_cell(ws, row, i, t, bold=True, color=DARK_NAVY, bg=b, size=9, h="center") def data_row(row, vals, alt=False): ws.row_dimensions[row].height = 45 bg = LIGHT_GREY if alt else WHITE for i, v in enumerate(vals, start=1): set_cell(ws, row, i, v, bg=bg, size=9) # ══════════════════════════════════════════════════════════════════════════════ # SECTION 1 — DEFINITION & OVERVIEW (rows 3-5) # ══════════════════════════════════════════════════════════════════════════════ r = 3 section_header(r, "1. DEFINITION & OVERVIEW") r += 1 ws.row_dimensions[r].height = 55 set_cell(ws, r, 1, "Microbial infection of heart valves or endocardium → formation of VEGETATIONS\n" "(fibrin + platelets + inflammatory cells + organisms)\n" "Can also infect aorta, aneurysmal sacs, prosthetic devices.", bold=False, color="000000", bg=PALE_BLUE, size=9, merge_end_col=5) r += 1 set_cell(ws, r, 1, "Annual incidence: 3–15 cases/100,000 | 90-day mortality ~25% | Most common in males, older adults", italic=True, color=DARK_NAVY, bg=YELLOW_HL, size=9, h="center", merge_end_col=5) # ══════════════════════════════════════════════════════════════════════════════ # SECTION 2 — CLASSIFICATION (rows 6-10) # ══════════════════════════════════════════════════════════════════════════════ r += 1 section_header(r, "2. CLASSIFICATION: ACUTE vs SUBACUTE") r += 1 col_header(r, ["Feature", "Acute IE", "Subacute IE", "Prosthetic Valve IE", "Right-sided (IDU)"]) r += 1 rows_class = [ ("Onset", "Rapid (days)", "Insidious (weeks–months)", "Variable; early (<6m) = acute", "Acute to subacute"), ("Typical organism", "S. aureus (MRSA)", "Viridans streptococci", "CoNS (early); Viridans (late)", "S. aureus, enterococci"), ("Valve status", "Normal or abnormal", "Usually abnormal/damaged", "Prosthetic material", "Tricuspid (≈50% in IDU)"), ("Destruction", "Highly destructive", "Less destructive", "Ring abscess, dehiscence", "Septic pulmonary emboli"), ("Prognosis", "High mortality", "Lower; antibiotics sufficient", "Poor (early); better (late)", "Better than left-sided"), ] for i, row_data in enumerate(rows_class): data_row(r, row_data, alt=(i % 2 == 0)) r += 1 # ══════════════════════════════════════════════════════════════════════════════ # SECTION 3 — MICROBIOLOGY (rows r onward) # ══════════════════════════════════════════════════════════════════════════════ section_header(r, "3. MICROBIOLOGY & PREDISPOSING CONDITIONS") r += 1 col_header(r, ["Organism", "Typical Setting", "Valve Affected", "Course", "Notes"]) r += 1 micro_rows = [ ("Viridans streptococci\n(e.g. S. mitis, S. sanguis)", "Community-acquired; dental bacteremia", "Damaged/abnormal valves", "Subacute", "50–60% of community IE"), ("Staphylococcus aureus\n(incl. MRSA)", "Healthcare, IV drug use; skin source", "Normal OR abnormal", "Acute, aggressive", "Most common in high-income countries"), ("Coagulase-neg. Staph (CoNS)\ne.g. S. epidermidis", "Prosthetic valves, intracardiac devices", "Prosthetic", "Subacute", "Early PVE (<60 days post-op)"), ("Enterococci\n(E. faecalis, E. faecium)", "GI/GU tract source; elderly", "Damaged valves", "Intermediate", "Difficult to treat; high relapse rate"), ("HACEK group\n(Haemophilus, Actinobacillus,\nCardiobacterium, Eikenella, Kingella)", "Oral cavity commensals", "Left-sided native valves", "Subacute", "<6% of IE; culture takes days"), ("Fungi (Candida, Aspergillus)", "Immunocompromised, prosthetic, IDU", "Prosthetic > native", "Subacute–chronic", "Large vegetations; high mortality"), ("Culture-negative (~10%)", "Prior antibiotics; Coxiella, Chlamydia", "Any", "Variable", "Coxiella: single blood culture/serology = major criterion"), ] for i, row_data in enumerate(micro_rows): data_row(r, row_data, alt=(i % 2 == 0)) r += 1 # ══════════════════════════════════════════════════════════════════════════════ # SECTION 4 — PATHOGENESIS (rows r onward) # ══════════════════════════════════════════════════════════════════════════════ section_header(r, "4. PATHOGENESIS & RISK FACTORS") r += 1 col_header(r, ["Step / Factor", "Detail", "Cardiac Predispositions", "Host Risk Factors", "Special Populations"]) r += 1 path_rows = [ ("Step 1", "Endothelial damage / turbulent flow → sterile platelet-fibrin thrombus on valve", "Mitral valve prolapse (leading risk factor in developed countries)", "Neutropenia, immunodeficiency", "IV drug users: tricuspid valve (50%)"), ("Step 2", "Bacteremia (dental, skin, GI/GU, IV injection) seeds the thrombus", "Bicuspid aortic valve", "Malignancy, diabetes, alcohol use", "Prosthetic valves: 10–20% of all IE; risk 0.3–1.2%/pt/yr"), ("Step 3", "Organisms proliferate within thrombus → full vegetation; protected from host defenses", "Calcific valvular stenosis", "IV drug use, chronic hemodialysis", "CHD: highest risk = cyanotic + residual prosthetic/shunt/regurgitation"), ("Step 4", "Vegetation fragments → septic emboli → metastatic abscesses, mycotic aneurysms", "Rheumatic heart disease (common in developing countries)", "Prior IE (high lifelong recurrence risk)", "Up to 50% of IE patients have NO known predisposing heart disease"), ] for i, row_data in enumerate(path_rows): data_row(r, row_data, alt=(i % 2 == 0)) r += 1 # ══════════════════════════════════════════════════════════════════════════════ # SECTION 5 — CLINICAL FEATURES (rows r onward) # ══════════════════════════════════════════════════════════════════════════════ section_header(r, "5. CLINICAL FEATURES") r += 1 col_header(r, ["Category", "Sign / Symptom", "Mechanism", "Location / Character", "Frequency / Note"]) r += 1 clin_rows = [ ("Systemic", "Fever", "Bacteremia / inflammatory cytokines", "Any; temperature >38°C", "Present in ~90% of patients"), ("Systemic", "Chills, malaise, weight loss, sweats, arthralgia, myalgia", "Systemic infection", "Nonspecific; often mimics flu", "May be the ONLY feature in subacute elderly patients"), ("Cardiac", "New or changing heart murmur", "Valvular regurgitation from vegetation/destruction", "Left-sided lesions", "Present in 90% of left-sided IE"), ("Cardiac", "Heart failure (dyspnoea, orthopnoea)", "Severe valve insufficiency or perforation", "Aortic > mitral", "Indication for urgent surgery"), ("Cardiac", "Arrhythmia / heart block", "Perivalvular abscess → conduction system", "PR prolongation; complete heart block", "Suggests aortic root abscess"), ("Embolic – peripheral", "Janeway lesions", "Septic emboli → microabscesses", "Palms and soles; painless flat erythema", "Acute IE (S. aureus)"), ("Embolic – peripheral", "Splinter hemorrhages", "Microemboli in nail-bed capillaries", "Subungual linear dark streaks", "Non-specific; also trauma"), ("Immune", "Osler nodes", "Immune complex deposition / microemboli", "Fingertips and toes; PAINFUL red nodules", "Subacute IE; 'Ouch = Osler'"), ("Immune", "Roth spots", "Immune complex vasculitis", "Retinal hemorrhages with pale centre", "Fundoscopy finding"), ("Immune", "Glomerulonephritis", "Antigen-antibody complex trapping in glomeruli", "Hematuria, proteinuria, renal failure", "Indicates immune activation"), ("Embolic – CNS", "Ischemic stroke / TIA", "Cerebral emboli from left-sided vegetations", "MCA territory most common", "Asymptomatic emboli in up to 60% (MRI)"), ("Embolic – pulmonary", "Septic pulmonary emboli / lung abscess", "Right-sided vegetations fragment", "Multiple bilateral nodular opacities on CT", "IDU with right-sided IE"), ("Other", "Splenomegaly", "Chronic immune activation / septic emboli", "LUQ tenderness", "Common in subacute IE"), ] for i, row_data in enumerate(clin_rows): data_row(r, row_data, alt=(i % 2 == 0)) r += 1 # ══════════════════════════════════════════════════════════════════════════════ # SECTION 6 — DUKE CRITERIA (rows r onward) # ══════════════════════════════════════════════════════════════════════════════ section_header(r, "6. MODIFIED DUKE CRITERIA FOR DIAGNOSIS") r += 1 ws.row_dimensions[r].height = 18 set_cell(ws, r, 1, "DEFINITE IE", bold=True, color=WHITE, bg=ACCENT_GRN, size=9, h="center") set_cell(ws, r, 2, "2 MAJOR OR 1 Major + 3 Minor OR 5 Minor", bold=True, color=ACCENT_GRN, bg=PALE_BLUE, size=9) set_cell(ws, r, 3, "POSSIBLE IE", bold=True, color=WHITE, bg=ACCENT_ORG, size=9, h="center") set_cell(ws, r, 4, "1 Major + 1–2 Minor OR 3 Minor criteria", bold=True, color=ACCENT_ORG, bg=PALE_BLUE, size=9, merge_end_col=5) r += 1 col_header(r, ["Criterion Type", "Criterion", "Detail / Examples", "Clinical Pearl", ""]) r += 1 duke_rows = [ ("MAJOR – Blood Cultures", "≥2 blood culture sets positive with typical IE pathogen", "S. aureus, viridans streptococci, S. bovis, enterococci, HACEK group", "Draw 3 sets from 3 sites BEFORE antibiotics", ""), ("MAJOR – Blood Cultures", "Persistent bacteremia with IE-consistent organism", "Cultures >12 h apart, or all 3 of 3 sets positive", "Persistent S. aureus bacteremia = IE until proven otherwise", ""), ("MAJOR – Blood Cultures", "Single positive culture / serology for Coxiella burnetii", "Q fever endocarditis; phase I IgG titre ≥1:800", "Culture-negative IE; serological diagnosis", ""), ("MAJOR – Echo", "Vegetation (pendulum-like mass on valve or mural endocardium)", "Mobile echodense mass attached to valve leaflet", "TEE more sensitive than TTE (>90% vs ~65%)", ""), ("MAJOR – Echo", "Paravalvular abscess", "Perivalvular echo-free space or thickening", "Associated with heart block; surgical emergency", ""), ("MAJOR – Echo", "New valvular regurgitation / prosthetic dehiscence", "New regurgitant jet on Doppler (not worsening of known)", "Change from baseline is key — repeat echo if initial negative", ""), ("MINOR", "Predisposition", "Known valve disease, IDU, prosthetic valve", "Screen for risk factors in every febrile patient", ""), ("MINOR", "Fever >38°C", "Temperature documented ≥38°C", "Most sensitive, least specific sign", ""), ("MINOR", "Vascular phenomena", "Arterial emboli, septic pulmonary infarcts, mycotic aneurysm, conjunctival hemorrhage, Janeway lesions", "Imaging often needed to detect silent emboli", ""), ("MINOR", "Immunologic phenomena", "Glomerulonephritis, Osler nodes, Roth spots, rheumatoid factor positive", "Reflect immune complex deposition", ""), ("MINOR", "Microbiologic evidence", "Positive blood culture not meeting major criteria", "Single non-typical organism", ""), ] for i, row_data in enumerate(duke_rows): ws.row_dimensions[r].height = 42 alt = (i % 2 == 0) bg = LIGHT_GREY if alt else WHITE # highlight major vs minor type_bg = PALE_BLUE if "MAJOR" in row_data[0] else YELLOW_HL type_col = DARK_NAVY if "MAJOR" in row_data[0] else "7B3F00" set_cell(ws, r, 1, row_data[0], bold=True, color=type_col, bg=type_bg, size=9) for j, v in enumerate(row_data[1:], start=2): set_cell(ws, r, j, v, bg=bg, size=9) r += 1 # ══════════════════════════════════════════════════════════════════════════════ # SECTION 7 — INVESTIGATIONS (rows r onward) # ══════════════════════════════════════════════════════════════════════════════ section_header(r, "7. INVESTIGATIONS") r += 1 col_header(r, ["Investigation", "Key Findings in IE", "Sensitivity / Notes", "When / Priority", ""]) r += 1 inv_rows = [ ("Blood cultures (×3 sets)", "IE pathogen isolated", "Most important test; positive in ~90%", "BEFORE antibiotics; 3 sites, 30–60 min apart", ""), ("Transthoracic Echo (TTE)", "Vegetation, regurgitation, LV function", "~60–70% sensitivity for vegetations", "First-line; do in ALL suspected IE", ""), ("Transesophageal Echo (TEE)", "Vegetations, abscesses, fistulae, leaflet perforation", ">90% sensitivity; better for prosthetic valves", "After negative TTE if high suspicion; all prosthetic valves; all S. aureus bacteraemia", ""), ("ECG", "New PR prolongation, AV block, bundle branch block", "Non-specific but important", "Perivalvular abscess extending to conduction system", ""), ("FBC", "Normocytic anaemia, leukocytosis, thrombocytopenia", "Non-specific; reflects chronic infection / sepsis", "Routine; serial monitoring", ""), ("CRP / ESR / Procalcitonin", "Markedly elevated inflammatory markers", "Non-specific; useful for treatment monitoring", "Baseline + weekly", ""), ("Urinalysis / renal function", "Microscopic haematuria, proteinuria, rising creatinine", "Reflects immune complex glomerulonephritis", "Baseline + monitoring for complications", ""), ("Brain MRI", "Silent cerebral emboli (diffusion restriction)", "Asymptomatic emboli in up to 60% of left-sided IE", "Consider routinely; qualifies as Duke minor criterion", ""), ("CT Chest/Abdomen/Pelvis", "Septic pulmonary emboli, splenic/renal infarcts, mycotic aneurysm", "Identifies systemic embolic burden", "When emboli suspected; PET-CT useful in prosthetic IE", ""), ] for i, row_data in enumerate(inv_rows): data_row(r, row_data, alt=(i % 2 == 0)) r += 1 # ══════════════════════════════════════════════════════════════════════════════ # SECTION 8 — MANAGEMENT (rows r onward) # ══════════════════════════════════════════════════════════════════════════════ section_header(r, "8. MANAGEMENT") r += 1 # 8a antibiotic ws.row_dimensions[r].height = 18 set_cell(ws, r, 1, "8a. ANTIBIOTIC THERAPY", bold=True, color=WHITE, bg=ACCENT_GRN, size=10, merge_end_col=5) r += 1 col_header(r, ["Situation", "Empiric / Definitive Regimen", "Duration", "Notes", ""]) r += 1 abx_rows = [ ("Empiric (native valve or IDU)\nbefore cultures return", "Vancomycin 20–35 mg/kg loading dose,\nthen 15–20 mg/kg q8–12h (≤3000 mg)\n± Ceftriaxone 2 g/day for HACEK coverage", "Until cultures return & organism identified", "Covers MRSA + most gram-positives; adjust for renal function", ""), ("Streptococcal IE\n(viridans, S. bovis)", "Penicillin G or Amoxicillin\n± Gentamicin (synergy)", "4 weeks (native)\n6 weeks (prosthetic)", "Most penicillin-susceptible; best prognosis", ""), ("S. aureus – native valve\nMSSA", "Flucloxacillin (oxacillin) 2 g q4h IV", "4–6 weeks", "Do NOT use vancomycin if MSSA – inferior outcomes", ""), ("S. aureus – MRSA or\nprosthetic valve", "Vancomycin 15–20 mg/kg q8–12h IV\n± Rifampicin (prosthetic only)", "6 weeks (prosthetic)\n4–6 weeks (native)", "Monitor vancomycin trough/AUC; add rifampicin only after bacteraemia cleared", ""), ("Enterococcal IE", "Ampicillin + Ceftriaxone (preferred)\nOR Ampicillin + Gentamicin", "4–6 weeks", "High relapse risk; ampicillin + ceftriaxone avoids aminoglycoside toxicity", ""), ("HACEK organisms", "Ceftriaxone 2 g/day IV", "4 weeks (native)\n6 weeks (prosthetic)", "Ampicillin-sulbactam as alternative", ""), ("Fungal IE", "Amphotericin B ± flucytosine\nthen step-down to azole", "Prolonged; often lifelong suppression", "Surgical valve replacement usually required", ""), ("Culture-negative IE", "Ampicillin-sulbactam + gentamicin\nOR doxycycline (Coxiella)", "4–6 weeks", "Consult ID; doxycycline for Q fever IE (lifelong)", ""), ] for i, row_data in enumerate(abx_rows): ws.row_dimensions[r].height = 48 bg = LIGHT_GREY if i % 2 == 0 else WHITE for j, v in enumerate(row_data, start=1): set_cell(ws, r, j, v, bg=bg, size=9) r += 1 # 8b Surgery ws.row_dimensions[r].height = 18 set_cell(ws, r, 1, "8b. SURGICAL INDICATIONS", bold=True, color=WHITE, bg=ACCENT_RED, size=10, merge_end_col=5) r += 1 col_header(r, ["Indication", "Urgency", "Rationale", "Notes", ""]) r += 1 surg_rows = [ ("Acute heart failure from valve insufficiency/perforation", "EMERGENCY", "Haemodynamic compromise; cannot survive medically", "Aortic > mitral; do not delay for antibiotics", ""), ("Perivalvular abscess / fistula / heart block", "URGENT", "Extension beyond valve annulus; high mortality", "Aortic root abscess → PR prolongation on ECG", ""), ("Prosthetic valve dehiscence", "URGENT", "Mechanical instability; ongoing bacteraemia", "Especially early PVE (<6m post-op)", ""), ("Vegetation >10 mm (especially anterior mitral leaflet)", "URGENT-ELECTIVE", "High embolic risk; mobile large vegetation", "Size + mobility are strongest predictors of embolism", ""), ("Recurrent embolisation on therapy", "URGENT-ELECTIVE", "Persistent embolic risk despite antibiotics", "Two or more embolic events despite therapy", ""), ("Fungal IE / highly resistant organism", "ELECTIVE", "Medical therapy rarely curative", "Lifelong azole suppression post-surgery", ""), ("Persistent bacteraemia >5–7 days despite antibiotics", "URGENT", "Source control failure", "Exclude other foci first", ""), ] for i, row_data in enumerate(surg_rows): ws.row_dimensions[r].height = 42 bg = LIGHT_GREY if i % 2 == 0 else WHITE urgency_colors = {"EMERGENCY": ACCENT_RED, "URGENT": ACCENT_ORG, "URGENT-ELECTIVE": "8B6914", "ELECTIVE": ACCENT_GRN} set_cell(ws, r, 1, row_data[0], bg=bg, size=9) urgency = row_data[1] urg_color = urgency_colors.get(urgency, "000000") set_cell(ws, r, 2, urgency, bold=True, color=WHITE, bg=urg_color, size=9, h="center") for j, v in enumerate(row_data[2:], start=3): set_cell(ws, r, j, v, bg=bg, size=9) r += 1 # ══════════════════════════════════════════════════════════════════════════════ # SECTION 9 — COMPLICATIONS (rows r onward) # ══════════════════════════════════════════════════════════════════════════════ section_header(r, "9. COMPLICATIONS") r += 1 col_header(r, ["Complication", "Mechanism", "Frequency / Valve", "Clinical Presentation", "Management"]) r += 1 comp_rows = [ ("Embolic stroke / TIA", "Left-sided vegetation fragments", "Most common large-vessel complication; up to 60% silent on MRI", "Sudden focal neurological deficit", "Neurology consult; anticoagulation controversial; surgery if indicated"), ("Mycotic aneurysm", "Septic emboli infect arterial wall", "Intracranial > splenic > mesenteric", "Headache; subarachnoid haemorrhage if rupture", "Cerebral angiography / CT angio; neurosurgery if symptomatic"), ("Perivalvular abscess", "Local spread beyond annulus", "Aortic valve > mitral; 30–40% of aortic IE", "Heart block on ECG; persistently positive cultures", "Surgical drainage + valve replacement"), ("Renal failure / GN", "Immune complex trapping in glomeruli", "Common; subclinical often", "Haematuria, proteinuria, rising creatinine", "Antibiotics; supportive; temporary dialysis if needed"), ("Septic pulmonary emboli", "Right-sided vegetations → lungs", "IDU patients; right-sided IE", "Pleuritic chest pain, haemoptysis, multiple lung nodules", "Prolonged antibiotics; surgical if persistent"), ("Splenic / renal infarction", "Left-sided emboli → spleen/kidney", "20–30% of left-sided IE", "LUQ / flank pain; fever", "Analgesics; drainage if abscess forms"), ("Heart failure", "Valve destruction → acute regurgitation", "Leading cause of death in IE", "Pulmonary oedema, hypotension", "Urgent surgery if haemodynamically unstable"), ] for i, row_data in enumerate(comp_rows): data_row(r, row_data, alt=(i % 2 == 0)) r += 1 # ══════════════════════════════════════════════════════════════════════════════ # SECTION 10 — PROPHYLAXIS (rows r onward) # ══════════════════════════════════════════════════════════════════════════════ section_header(r, "10. PROPHYLAXIS (AHA 2021 GUIDELINES)") r += 1 col_header(r, ["High-Risk Condition", "Indication", "Procedure Requiring Prophylaxis", "Regimen", "Notes"]) r += 1 prop_rows = [ ("Prosthetic cardiac valve\n(mechanical or bioprosthetic)", "Yes", "Invasive dental procedures involving gingival manipulation or oral mucosa perforation", "Amoxicillin 2 g PO 30–60 min before (preferred)", "90% of patients labelled 'penicillin allergic' are NOT — skin test first"), ("Prior history of IE", "Yes", "Same as above", "Doxycycline 100 mg PO (if true penicillin allergy)\nOR Azithromycin 500 mg PO", "Clindamycin REMOVED from 2021 guidelines — C. difficile risk"), ("Unrepaired cyanotic CHD; CHD with prosthetic material (≤6m post-repair)", "Yes", "Same as above", "If IV required: Ampicillin 2 g IV or Cefazolin 1 g IV", ""), ("Cardiac transplant + valvulopathy", "Yes", "Same as above", "Same as above", "New in 2021"), ("Ventricular assist device / total artificial heart", "Yes (new in 2021)", "Same as above", "Same as above", "Added to high-risk group in 2021 update"), ("Mitral valve prolapse WITHOUT regurgitation", "No longer recommended", "Not indicated", "None", "Prophylaxis benefit unproven in low-risk conditions"), ("Healthy individual — cutaneous abscess drainage (ED)", "Considered", "Abscess incision and drainage", "Vancomycin 15 mg/kg IV 1 hour before procedure", "Most routine ED procedures (laceration repair, ETI) do NOT require prophylaxis"), ] for i, row_data in enumerate(prop_rows): data_row(r, row_data, alt=(i % 2 == 0)) r += 1 # ══════════════════════════════════════════════════════════════════════════════ # SECTION 11 — PROGNOSIS & KEY PEARLS (rows r onward) # ══════════════════════════════════════════════════════════════════════════════ section_header(r, "11. PROGNOSIS & KEY CLINICAL PEARLS") r += 1 col_header(r, ["Poor Prognostic Factor", "Better Prognosis", "Key Pearl", "Memory Aid", "Guideline Note"]) r += 1 prog_rows = [ ("S. aureus infection", "Streptococcal IE", "Fever is most consistent sign (90%); its absence in elderly subacute IE is common", "Janeway = J for 'Just painless' on palms/soles\nOsler = 'Ouch' (painful nodules)", "Multidisciplinary team mandatory: ID + Cardiology + Cardiac Surgery"), ("Prosthetic valve IE", "Right-sided (IDU) IE", "All suspected IE: hospitalise; 3 blood cultures BEFORE antibiotics", "HACEK: Haemophilus, Actinobacillus, Cardiobacterium, Eikenella, Kingella", "TTE first; TEE in all high-suspicion, prosthetic, or negative TTE"), ("Heart failure / severe regurgitation", "Isolated right-sided IE", "~50% of left-sided IE patients require surgery during index admission", "Persistent S. aureus bacteraemia = IE until proven otherwise", "4–6 weeks parenteral antibiotics minimum; oral step-down now evidence-based for selected patients"), ("Perivalvular extension / abscess", "Penicillin-susceptible streptococcal IE", "New heart block on ECG in aortic IE = perivalvular abscess (surgical emergency)", "New PR prolongation + aortic IE = call surgery NOW", "AHA 2021: clindamycin removed; doxycycline now an alternative in penicillin allergy"), ("Older age, multiple comorbidities", "Young patients, IDU (if right-sided)", "Silent cerebral emboli found on MRI in up to 60% — brain imaging even without neurological symptoms", "Roth spots: Retinal (Roth = Retinal)\nSplinter: nails (think splinter under nail)", "Do NOT delay surgery for neurological events if cardiac indication is clear (risk of haemorrhagic transformation lower than believed)"), ] for i, row_data in enumerate(prog_rows): data_row(r, row_data, alt=(i % 2 == 0)) r += 1 # ══════════════════════════════════════════════════════════════════════════════ # FOOTER # ══════════════════════════════════════════════════════════════════════════════ ws.row_dimensions[r].height = 18 set_cell(ws, r, 1, "References: Braunwald's Heart Disease (2021 AHA guidelines) | Robbins & Kumar Basic Pathology | Rosen's Emergency Medicine", italic=True, color="888888", bg=LIGHT_GREY, size=8, h="center", merge_end_col=5) # ══════════════════════════════════════════════════════════════════════════════ # Print / page setup # ══════════════════════════════════════════════════════════════════════════════ from openpyxl.worksheet.page import PrintPageSetup ws.page_setup.orientation = "landscape" ws.page_setup.fitToWidth = 1 ws.page_setup.fitToPage = True ws.print_title_rows = "1:3" # ── Save ────────────────────────────────────────────────────────────────────── out_path = "/tmp/workspace/Infective_Endocarditis_Summary.xlsx" wb.save(out_path) print(f"Saved to {out_path}") PYEOF python3 /tmp/workspace/ie_chart.py

Your IE summary chart is ready:

Infective Endocarditis Summary

Spreadsheet · XLSX


The spreadsheet contains 11 color-coded sections on a single sheet:
SectionContent
1Definition & Overview
2Classification: Acute vs Subacute vs Prosthetic vs Right-sided
3Microbiology (7 organism groups with setting, valve, course)
4Pathogenesis & Risk Factors (step-by-step + special populations)
5Clinical Features (13 signs/symptoms with mechanism & frequency)
6Modified Duke Criteria (Major & Minor, color-coded separately)
7Investigations (9 tests with sensitivity and clinical priority)
8aAntibiotic Therapy (empiric + 8 pathogen-specific regimens + duration)
8bSurgical Indications (color-coded by urgency: Emergency/Urgent/Elective)
9Complications (7 with mechanism, frequency, and management)
10Prophylaxis - AHA 2021 Guidelines
11Prognosis & Key Clinical Pearls + Memory Aids
Formatting highlights: dark navy header bar, blue section banners, alternating row shading, urgency-coded surgery column (red/orange/green), and Major/Minor Duke criteria visually distinguished. Frozen top rows for easy scrolling.

Can u generate in pdf format

Reading File
Running Command

cat << 'PYEOF' > /tmp/workspace/ie_pdf.py from reportlab.lib.pagesizes import A4, landscape from reportlab.lib import colors from reportlab.lib.units import mm from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether ) from reportlab.platypus.flowables import HRFlowable from reportlab.lib.colors import HexColor, white, black # ── Palette ────────────────────────────────────────────────────────────────── DARK_NAVY = HexColor("#1B2A4A") MED_BLUE = HexColor("#2E5FA3") LIGHT_BLUE = HexColor("#BDD7EE") PALE_BLUE = HexColor("#DEEAF1") ACC_RED = HexColor("#C0392B") ACC_GRN = HexColor("#1A7A4C") ACC_ORG = HexColor("#D35400") ACC_PRP = HexColor("#6C3483") YELLOW_HL = HexColor("#FFF2CC") LT_GREY = HexColor("#F2F2F2") MID_GREY = HexColor("#D9D9D9") AMBER = HexColor("#8B6914") # ── Page & Doc ─────────────────────────────────────────────────────────────── PAGE = landscape(A4) L, R, T, B = 12*mm, 12*mm, 14*mm, 14*mm doc = SimpleDocTemplate( "/tmp/workspace/Infective_Endocarditis_Summary.pdf", pagesize=PAGE, leftMargin=L, rightMargin=R, topMargin=T, bottomMargin=B, title="Infective Endocarditis – Clinical Summary", author="Orris Medical" ) # ── Styles ─────────────────────────────────────────────────────────────────── def ps(name, parent="Normal", **kw): s = ParagraphStyle(name, parent=getSampleStyleSheet()[parent], **kw) return s TITLE_S = ps("Title", fontName="Helvetica-Bold", fontSize=17, textColor=white, alignment=TA_CENTER, spaceAfter=0, spaceBefore=0) SUB_S = ps("Sub", fontName="Helvetica-Oblique", fontSize=7.5,textColor=HexColor("#555555"), alignment=TA_CENTER, spaceAfter=2) SEC_S = ps("Sec", fontName="Helvetica-Bold", fontSize=10, textColor=white, alignment=TA_LEFT, spaceAfter=0, leading=14) HDRCELL_S = ps("HdrCell", fontName="Helvetica-Bold", fontSize=7.5,textColor=DARK_NAVY, alignment=TA_CENTER, leading=9) CELL_S = ps("Cell", fontName="Helvetica", fontSize=7, textColor=black, alignment=TA_LEFT, leading=9, spaceAfter=0) CELL_B_S = ps("CellB", fontName="Helvetica-Bold", fontSize=7, textColor=black, alignment=TA_LEFT, leading=9) CELL_C_S = ps("CellC", fontName="Helvetica", fontSize=7, textColor=black, alignment=TA_CENTER, leading=9) FOOT_S = ps("Foot", fontName="Helvetica-Oblique", fontSize=6.5,textColor=HexColor("#888888"), alignment=TA_CENTER) def P(text, style=None): s = style or CELL_S return Paragraph(str(text), s) def PB(text): return Paragraph(str(text), CELL_B_S) def PC(text): return Paragraph(str(text), CELL_C_S) def PH(text): return Paragraph(str(text), HDRCELL_S) # ── Table helpers ───────────────────────────────────────────────────────────── PW = PAGE[0] - L - R # usable width def section_title(text, bg=MED_BLUE): tbl = Table([[Paragraph(text, SEC_S)]], colWidths=[PW]) tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), bg), ("LEFTPADDING", (0,0), (-1,-1), 6), ("RIGHTPADDING", (0,0), (-1,-1), 4), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING",(0,0), (-1,-1), 4), ("ROWBACKGROUNDS",(0,0),(-1,-1),[bg]), ])) return tbl def make_table(headers, rows, col_widths, alt_colors=True, header_bg=LIGHT_BLUE, header_fg=DARK_NAVY, row_colors=None): data = [[PH(h) for h in headers]] for i, row in enumerate(rows): data.append([P(c) for c in row]) tbl = Table(data, colWidths=col_widths, repeatRows=1) style_cmds = [ ("BACKGROUND", (0,0), (-1,0), header_bg), ("TEXTCOLOR", (0,0), (-1,0), header_fg), ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"), ("FONTSIZE", (0,0), (-1,-1), 7), ("GRID", (0,0), (-1,-1), 0.3, MID_GREY), ("VALIGN", (0,0), (-1,-1), "TOP"), ("LEFTPADDING", (0,0), (-1,-1), 4), ("RIGHTPADDING",(0,0), (-1,-1), 4), ("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3), ] if alt_colors: for i in range(1, len(data)): bg = LT_GREY if i % 2 == 1 else white style_cmds.append(("BACKGROUND", (0,i), (-1,i), bg)) if row_colors: for (r, c, bg, fg) in row_colors: style_cmds.append(("BACKGROUND", (c,r), (c,r), bg)) style_cmds.append(("TEXTCOLOR", (c,r), (c,r), fg)) style_cmds.append(("FONTNAME", (c,r), (c,r), "Helvetica-Bold")) tbl.setStyle(TableStyle(style_cmds)) return tbl # ══════════════════════════════════════════════════════════════════════════════ # BUILD STORY # ══════════════════════════════════════════════════════════════════════════════ story = [] sp = lambda n=3: Spacer(1, n*mm) # ── TITLE ───────────────────────────────────────────────────────────────────── title_tbl = Table( [[Paragraph("INFECTIVE ENDOCARDITIS — Clinical Summary Chart", TITLE_S)]], colWidths=[PW] ) title_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), DARK_NAVY), ("TOPPADDING", (0,0),(-1,-1), 8), ("BOTTOMPADDING",(0,0),(-1,-1), 8), ])) story.append(title_tbl) sub_tbl = Table( [[Paragraph("Sources: Braunwald's Heart Disease | Robbins & Kumar Basic Pathology | Rosen's Emergency Medicine", SUB_S)]], colWidths=[PW] ) sub_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), LT_GREY), ("TOPPADDING", (0,0),(-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3), ])) story.append(sub_tbl) story.append(sp(2)) # ── SECTION 1: DEFINITION ───────────────────────────────────────────────────── story.append(section_title("1. DEFINITION & OVERVIEW")) def_tbl = Table([[P( "<b>Definition:</b> Microbial infection of heart valves or endocardium → " "<b>vegetations</b> (fibrin + platelets + inflammatory cells + organisms), " "often with destruction of underlying cardiac tissue. Can also affect aorta, aneurysmal sacs, prosthetic devices.\n" "<b>Incidence:</b> 3–15 cases/100,000/year | <b>90-day mortality:</b> ~25% | " "<b>Leading cause:</b> S. aureus (high-income countries) | " "<b>IDU proportion:</b> up to 50% of cases in some communities" )]], colWidths=[PW]) def_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), PALE_BLUE), ("LEFTPADDING",(0,0),(-1,-1), 8), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1), 5), ("GRID",(0,0),(-1,-1),0.3,MID_GREY), ])) story.append(def_tbl) story.append(sp(2)) # ── SECTION 2: CLASSIFICATION ───────────────────────────────────────────────── story.append(section_title("2. CLASSIFICATION")) cw2 = [PW*0.16, PW*0.21, PW*0.21, PW*0.21, PW*0.21] hdrs2 = ["Feature","Acute IE","Subacute IE","Prosthetic Valve IE","Right-sided (IDU)"] rows2 = [ ["Onset", "Rapid (days)", "Insidious (weeks–months)", "Variable; early (<6m) = acute", "Acute to subacute"], ["Typical organism","S. aureus (MRSA)", "Viridans streptococci", "CoNS (early); Viridans (late)", "S. aureus, enterococci"], ["Valve status", "Normal or abnormal", "Usually abnormal/damaged", "Prosthetic material", "Tricuspid (~50% in IDU)"], ["Destruction", "Highly destructive", "Less destructive", "Ring abscess, dehiscence", "Septic pulmonary emboli"], ["Prognosis", "High mortality", "Lower; ABx usually sufficient","Poor (early); better (late)", "Better than left-sided"], ] story.append(make_table(hdrs2, rows2, cw2)) story.append(sp(2)) # ── SECTION 3: MICROBIOLOGY ─────────────────────────────────────────────────── story.append(section_title("3. MICROBIOLOGY")) cw3 = [PW*0.18, PW*0.20, PW*0.16, PW*0.12, PW*0.34] hdrs3 = ["Organism","Typical Setting","Valve Affected","Course","Notes"] rows3 = [ ["Viridans streptococci\n(S. mitis, S. sanguis)", "Community-acquired; dental", "Damaged/abnormal", "Subacute","50–60% of community IE; best prognosis"], ["Staphylococcus aureus\n(incl. MRSA)", "Healthcare, IDU; skin source", "Normal or abnormal","Acute, aggressive","Most common overall in high-income countries"], ["CoNS (S. epidermidis)", "Prosthetic valves, devices","Prosthetic","Subacute","Early PVE (<60 days post-op)"], ["Enterococci\n(E. faecalis, E. faecium)", "GI/GU source; elderly","Damaged valves","Intermediate","High relapse; Ampicillin+Ceftriaxone preferred"], ["HACEK group","Oral cavity commensals","Left-sided native","Subacute","<6% of IE; H.Actino.Cardio.Eikenella.Kingella"], ["Fungi (Candida, Aspergillus)","Immunocompromised, IDU, prosthetic","Prosthetic > native","Chronic","Large vegetations; usually need surgery"], ["Culture-negative (~10%)","Prior ABx; Coxiella (Q fever)","Any","Variable","Serology for Coxiella; doxycycline long-term"], ] story.append(make_table(hdrs3, rows3, cw3)) story.append(sp(2)) # ── SECTION 4: PATHOGENESIS ─────────────────────────────────────────────────── story.append(section_title("4. PATHOGENESIS & RISK FACTORS")) cw4 = [PW*0.07, PW*0.28, PW*0.25, PW*0.20, PW*0.20] hdrs4 = ["Step","Mechanism","Cardiac Predispositions","Host Risk Factors","Special Populations"] rows4 = [ ["1","Endothelial damage / turbulent flow → sterile platelet-fibrin thrombus on valve surface", "Mitral valve prolapse (leading risk in developed countries)", "Neutropenia, immunodeficiency","IDU: tricuspid valve (~50%)"], ["2","Bacteremia seeds the thrombus (dental, skin, GI/GU, IV injection)", "Bicuspid aortic valve; calcific stenosis", "Malignancy, diabetes, alcohol use","Prosthetic valves: 10–20% of all IE"], ["3","Organisms proliferate inside thrombus → vegetation; protected from host defenses", "Rheumatic heart disease (developing countries)", "IV drug use; chronic haemodialysis","CHD: cyanotic + residual prosthetic/shunt"], ["4","Vegetation fragments → septic emboli → metastatic abscesses, mycotic aneurysms", "Prior IE (high lifelong recurrence risk)", "50% of IE patients have NO known heart disease","Healthcare-associated IE rising (pacemakers, LVAD)"], ] story.append(make_table(hdrs4, rows4, cw4)) story.append(sp(2)) # ── SECTION 5: CLINICAL FEATURES ───────────────────────────────────────────── story.append(section_title("5. CLINICAL FEATURES")) cw5 = [PW*0.14, PW*0.20, PW*0.18, PW*0.24, PW*0.24] hdrs5 = ["Category","Sign / Symptom","Mechanism","Location / Character","Frequency / Note"] rows5 = [ ["Systemic","Fever","Bacteremia / cytokines","Any; >38°C","Most consistent sign; 90% of cases"], ["Systemic","Chills, malaise, weight loss, night sweats, arthralgia","Systemic infection / inflammation","Nonspecific; flu-like","May be ONLY feature in subacute elderly IE"], ["Cardiac","New or changing murmur","Valve regurgitation from vegetation / destruction","Left-sided dominant","90% of left-sided IE; critical to detect new change"], ["Cardiac","Heart failure (dyspnoea, orthopnoea)","Severe valve insufficiency or perforation","Aortic > mitral","Indication for urgent surgery"], ["Cardiac","Heart block / arrhythmia","Perivalvular abscess → conduction system","PR prolongation → complete AV block","Aortic root abscess — call surgery"], ["Peripheral — embolic","Janeway lesions","Septic emboli → microabscesses","Palms & soles; PAINLESS flat erythema","Acute IE (S. aureus); 'J = Just painless'"], ["Peripheral — embolic","Splinter hemorrhages","Microemboli in nail-bed capillaries","Subungual linear dark streaks","Non-specific (also trauma)"], ["Peripheral — immune","Osler nodes","Immune complex + microemboli","Fingertips/toes; PAINFUL red nodules","Subacute IE; 'Ouch = Osler'"], ["Peripheral — immune","Roth spots","Immune complex vasculitis","Retinal hemorrhages with pale centre","Fundoscopy; 'Roth = Retinal'"], ["Systemic — immune","Glomerulonephritis","Antigen-antibody complex trapping","Haematuria, proteinuria, renal failure","Reflects immune complex deposition"], ["Embolic — CNS","Ischemic stroke / TIA","Left-sided emboli → cerebral vessels","MCA territory; hemorrhagic transformation common","Asymptomatic emboli in up to 60% on MRI"], ["Embolic — pulmonary","Septic pulmonary emboli","Right-sided vegetations → lungs","Multiple bilateral nodular opacities on CT","IDU with right-sided IE"], ["Other","Splenomegaly","Chronic immune activation","LUQ tenderness","Common in subacute IE"], ] story.append(make_table(hdrs5, rows5, cw5)) story.append(sp(2)) # ── SECTION 6: DUKE CRITERIA ────────────────────────────────────────────────── story.append(section_title("6. MODIFIED DUKE CRITERIA FOR DIAGNOSIS")) # Summary bar def_row = Table([[ P("<b>DEFINITE IE:</b> 2 Major OR 1 Major + 3 Minor OR 5 Minor criteria", CELL_B_S), P("<b>POSSIBLE IE:</b> 1 Major + 1–2 Minor OR 3 Minor criteria", CELL_B_S), ]], colWidths=[PW*0.5, PW*0.5]) def_row.setStyle(TableStyle([ ("BACKGROUND",(0,0),(0,0), HexColor("#D5E8D4")), ("BACKGROUND",(1,0),(1,0), YELLOW_HL), ("GRID",(0,0),(-1,-1),0.3,MID_GREY), ("LEFTPADDING",(0,0),(-1,-1),6), ("TOPPADDING",(0,0),(-1,-1),4), ("BOTTOMPADDING",(0,0),(-1,-1),4), ])) story.append(def_row) story.append(sp(1)) cw6 = [PW*0.14, PW*0.18, PW*0.30, PW*0.24, PW*0.14] hdrs6 = ["Criterion Type","Criterion","Detail / Examples","Clinical Pearl",""] rows6 = [ ["MAJOR – Blood Cultures","≥2 blood culture sets positive with typical IE pathogen", "S. aureus, viridans streptococci, S. bovis, enterococci, HACEK group", "Draw 3 sets from 3 sites BEFORE starting antibiotics",""], ["MAJOR – Blood Cultures","Persistent bacteremia with IE-consistent organism", "Cultures >12h apart, or all 3/3 sets positive", "Persistent S. aureus bacteraemia = IE until proven otherwise",""], ["MAJOR – Blood Cultures","Single positive blood culture OR serology for Coxiella burnetii", "Q fever: phase I IgG titre ≥1:800", "Culture-negative IE — serological diagnosis essential",""], ["MAJOR – Echo","Vegetation on valve or mural endocardium", "Mobile echodense mass attached to valve leaflet, chordae, or mural endocardium", "TEE >90% sensitive; TTE ~65% — always escalate if TTE negative",""], ["MAJOR – Echo","Paravalvular abscess", "Perivalvular echo-free space or thickened heterogeneous region", "Associated with heart block; surgical emergency",""], ["MAJOR – Echo","New valvular regurgitation / prosthetic dehiscence", "New regurgitant jet on Doppler (NOT worsening of pre-existing)", "Change from baseline is key — get prior echo for comparison",""], ["MINOR","Predisposition","Known valve disease, IDU, prosthetic valve, prior IE","Screen all febrile patients for risk factors",""], ["MINOR","Fever >38°C","Temperature documented ≥38°C","Most sensitive but least specific sign",""], ["MINOR","Vascular phenomena","Arterial emboli, septic pulmonary infarcts, mycotic aneurysm, conjunctival haemorrhage, Janeway lesions","Silent emboli on brain MRI also qualify",""], ["MINOR","Immunologic phenomena","Glomerulonephritis, Osler nodes, Roth spots, RF positive","Reflect immune complex deposition",""], ["MINOR","Microbiologic evidence","Positive blood culture not meeting major criteria","Single non-typical organism or serology",""], ] # Row colors: MAJOR rows get pale blue, MINOR rows get yellow row_colors = [] for i, row in enumerate(rows6, start=1): if "MAJOR" in row[0]: row_colors.append((i, 0, PALE_BLUE, DARK_NAVY)) else: row_colors.append((i, 0, YELLOW_HL, HexColor("#7B3F00"))) story.append(make_table(hdrs6, rows6, cw6, row_colors=row_colors)) story.append(sp(2)) # ── SECTION 7: INVESTIGATIONS ───────────────────────────────────────────────── story.append(section_title("7. INVESTIGATIONS")) cw7 = [PW*0.19, PW*0.22, PW*0.20, PW*0.39] hdrs7 = ["Investigation","Key Findings in IE","Sensitivity / Specificity","Clinical Notes & Priority"] rows7 = [ ["Blood cultures (×3 sets)","IE pathogen isolated","Positive ~90%; most important test","BEFORE antibiotics; 3 venipuncture sites, 30–60 min apart"], ["Transthoracic Echo (TTE)","Vegetation, regurgitation, LV function","Sensitivity ~60–70% for vegetations","First-line in ALL suspected IE; do immediately"], ["Transesophageal Echo (TEE)","Vegetations, abscess, fistula, leaflet perforation","Sensitivity >90%; better for prosthetic valves","After negative TTE with high suspicion; ALL prosthetic valves; ALL S. aureus bacteraemia"], ["ECG","New PR prolongation, AV block, BBB","Non-specific but high clinical significance","Look for perivalvular abscess extending to conduction system"], ["FBC","Normocytic anaemia, leukocytosis, thrombocytopenia","Non-specific","Reflects chronic infection/sepsis; serial monitoring"], ["CRP / ESR / Procalcitonin","Markedly elevated","Non-specific; useful for treatment monitoring","Baseline + weekly to track response"], ["Urinalysis + renal function","Haematuria, proteinuria, rising creatinine","Reflects immune complex GN","Baseline + monitoring throughout treatment"], ["Brain MRI (DWI)","Silent cerebral emboli (diffusion restriction)","Asymptomatic emboli in up to 60% of left-sided IE","Consider routinely; counts as Duke minor criterion"], ["CT Chest/Abdomen","Septic pulmonary emboli, splenic/renal infarcts","Identifies systemic embolic burden","When emboli suspected; PET-CT useful in prosthetic IE"], ] story.append(make_table(hdrs7, rows7, cw7)) story.append(sp(2)) # ── SECTION 8a: ANTIBIOTIC THERAPY ─────────────────────────────────────────── story.append(section_title("8a. ANTIBIOTIC THERAPY", bg=ACC_GRN)) cw8a = [PW*0.18, PW*0.30, PW*0.13, PW*0.39] hdrs8a = ["Situation","Empiric / Definitive Regimen","Duration","Notes"] rows8a = [ ["Empiric – native valve / IDU\n(before cultures)", "Vancomycin 20–35 mg/kg loading dose,\nthen 15–20 mg/kg q8–12h IV (≤3000 mg)\n± Ceftriaxone 2 g/day for HACEK / gram-negatives", "Until cultures & sensitivities available", "Adjust dose for renal function; covers MRSA + most gram-positives; HACEK <6% of cases"], ["Streptococcal IE\n(viridans, S. bovis)", "Penicillin G or Amoxicillin ± Gentamicin (synergy)", "4 wks (native)\n6 wks (prosthetic)", "Best prognosis; most are penicillin-susceptible"], ["S. aureus MSSA – native valve", "Flucloxacillin (oxacillin) 2 g q4h IV", "4–6 weeks", "Do NOT substitute vancomycin for MSSA — inferior outcomes demonstrated"], ["S. aureus MRSA or prosthetic valve", "Vancomycin 15–20 mg/kg q8–12h IV\n+ Rifampicin 300–600 mg q12h (prosthetic only)", "6 wks (prosthetic)\n4–6 wks (native)", "Add rifampicin ONLY after bacteraemia cleared; monitor AUC/MIC for vancomycin"], ["Enterococcal IE", "Ampicillin 2g q4h + Ceftriaxone 2g q12h IV\n(preferred)\nOR Ampicillin + Gentamicin", "4–6 weeks", "Ampicillin + Ceftriaxone avoids aminoglycoside nephrotoxicity; high relapse risk"], ["HACEK organisms", "Ceftriaxone 2 g/day IV\n(Ampicillin-sulbactam as alternative)", "4 wks (native)\n6 wks (prosthetic)", "Culture takes days (slow-growing); empiric ceftriaxone appropriate"], ["Fungal IE\n(Candida, Aspergillus)", "Amphotericin B ± flucytosine → step-down to azole", "Prolonged; often lifelong azole suppression", "Surgical valve replacement usually required; medical cure rare"], ["Culture-negative IE", "Ampicillin-sulbactam + gentamicin\nOR Doxycycline 100 mg BD (Coxiella / Q fever)", "4–6 weeks\n(Q fever: ≥18 months doxycycline)", "Consult ID; search for rare organisms; PET-CT for source"], ] story.append(make_table(hdrs8a, rows8a, cw8a, header_bg=HexColor("#A9D18E"), header_fg=DARK_NAVY)) story.append(sp(2)) # ── SECTION 8b: SURGICAL INDICATIONS ───────────────────────────────────────── story.append(section_title("8b. SURGICAL INDICATIONS", bg=ACC_RED)) cw8b = [PW*0.30, PW*0.13, PW*0.28, PW*0.29] hdrs8b = ["Indication","Urgency","Rationale","Notes"] rows8b = [ ["Acute heart failure from valve insufficiency / perforation","EMERGENCY","Haemodynamic compromise cannot be managed medically","Do NOT delay for antibiotics; aortic > mitral"], ["Perivalvular abscess / fistula / associated heart block","URGENT","Extension beyond annulus; very high mortality if untreated","Aortic root abscess → PR prolongation on ECG"], ["Prosthetic valve dehiscence","URGENT","Mechanical instability; persistent bacteraemia","Especially early PVE (<6m post-op)"], ["Vegetation >10 mm (esp. anterior mitral leaflet)","URGENT-ELECTIVE","High embolic risk; mobile large vegetation","Size + mobility = strongest embolism predictors"], ["Recurrent embolisation on therapy","URGENT-ELECTIVE","Persistent embolic risk despite antibiotic therapy","≥2 embolic events despite adequate ABx"], ["Fungal IE / highly resistant organism","ELECTIVE","Medical therapy rarely curative","Lifelong azole suppression needed post-surgery"], ["Persistent bacteraemia >5–7 days on appropriate ABx","URGENT","Source control failure","Exclude other embolic foci first (CT)"], ] URGENCY_MAP = { "EMERGENCY": (ACC_RED, white), "URGENT": (ACC_ORG, white), "URGENT-ELECTIVE": (AMBER, white), "ELECTIVE": (ACC_GRN, white), } row_colors8b = [] for i, row in enumerate(rows8b, start=1): bg, fg = URGENCY_MAP.get(row[1], (LT_GREY, black)) row_colors8b.append((i, 1, bg, fg)) story.append(make_table(hdrs8b, rows8b, cw8b, header_bg=HexColor("#F4CCCC"), header_fg=DARK_NAVY, row_colors=row_colors8b)) story.append(sp(2)) # ── SECTION 9: COMPLICATIONS ────────────────────────────────────────────────── story.append(section_title("9. COMPLICATIONS")) cw9 = [PW*0.17, PW*0.18, PW*0.17, PW*0.22, PW*0.26] hdrs9 = ["Complication","Mechanism","Frequency / Valve","Clinical Presentation","Management"] rows9 = [ ["Embolic stroke / TIA","Left-sided vegetation fragments","Most common large-vessel complication; 60% silent on MRI","Sudden focal neurological deficit","Neurology consult; anticoagulation controversial; early surgery if cardiac indication"], ["Mycotic aneurysm","Septic emboli infect arterial wall","Intracranial > splenic > mesenteric","Headache; SAH if rupture","CT/MR angiography; neurosurgery if symptomatic"], ["Perivalvular abscess","Local spread beyond annulus","30–40% of aortic IE","Heart block on ECG; persistent bacteraemia","Urgent surgical drainage + valve replacement"], ["Renal failure / GN","Immune complex trapping in glomeruli","Common; often subclinical","Haematuria, proteinuria, rising creatinine","Antibiotics; supportive; dialysis if needed"], ["Septic pulmonary emboli","Right-sided vegetations → lungs","IDU; right-sided IE","Pleuritic chest pain, haemoptysis, bilateral nodules on CT","Prolonged ABx; surgery if persistent"], ["Splenic / renal infarction","Left-sided emboli","20–30% of left-sided IE","LUQ / flank pain, fever","Analgesics; CT-guided drainage if abscess"], ["Heart failure","Valve destruction → acute regurgitation","Leading cause of death in IE","Pulmonary oedema, hypotension","Urgent surgery if haemodynamically unstable"], ] story.append(make_table(hdrs9, rows9, cw9)) story.append(sp(2)) # ── SECTION 10: PROPHYLAXIS ─────────────────────────────────────────────────── story.append(section_title("10. PROPHYLAXIS — AHA 2021 GUIDELINES")) cw10 = [PW*0.24, PW*0.10, PW*0.24, PW*0.22, PW*0.20] hdrs10 = ["High-Risk Condition","Prophylaxis?","Procedure","Regimen","Notes"] rows10 = [ ["Prosthetic cardiac valve (mechanical or bioprosthetic)","YES","Invasive dental procedures involving gingival tissue or oral mucosa perforation","Amoxicillin 2 g PO 30–60 min before (preferred)","90% of patients labelled 'penicillin allergic' will have negative skin test — re-test!"], ["Prior history of IE","YES","Same as above","If true penicillin allergy:\nDoxycycline 100 mg PO\nOR Azithromycin 500 mg PO","Clindamycin REMOVED from 2021 update — C. difficile risk"], ["Unrepaired cyanotic CHD; CHD with prosthetic material ≤6m post-repair","YES","Same as above","IV: Ampicillin 2 g IV or Cefazolin 1 g IV (1h before)",""], ["Cardiac transplant + valvulopathy","YES","Same as above","Same as above","Included in AHA 2021"], ["Ventricular assist device / total artificial heart","YES (new 2021)","Same as above","Same as above","Added to high-risk group in 2021 update"], ["Mitral valve prolapse WITHOUT regurgitation","NO","Not indicated","None","Prophylaxis benefit unproven; low-risk condition"], ["ED cutaneous abscess drainage","Consider","Incision & drainage of infected skin","Vancomycin 15 mg/kg IV 1h before","Most routine ED procedures do NOT require prophylaxis"], ] # Colour YES/NO cells rc10 = [] for i, row in enumerate(rows10, start=1): v = row[1].strip() if "NO" in v and "new" not in v.lower() and len(v)<4: rc10.append((i, 1, HexColor("#FCE4D6"), ACC_RED)) elif "YES" in v: rc10.append((i, 1, HexColor("#E2EFDA"), ACC_GRN)) story.append(make_table(hdrs10, rows10, cw10, row_colors=rc10)) story.append(sp(2)) # ── SECTION 11: PROGNOSIS & PEARLS ─────────────────────────────────────────── story.append(section_title("11. PROGNOSIS & KEY CLINICAL PEARLS")) cw11 = [PW*0.22, PW*0.20, PW*0.25, PW*0.33] hdrs11 = ["Poor Prognostic Factors","Better Prognosis","Key Clinical Pearl","Memory Aid / Guideline Note"] rows11 = [ ["S. aureus infection","Streptococcal IE","Fever is most consistent sign (90%); absence in elderly subacute IE is common", "Janeway = 'J = Just painless' (palms/soles, embolic)\nOsler = 'Ouch' (painful fingertip nodules, immune)"], ["Prosthetic valve IE","Right-sided / IDU IE","ALL suspected IE: hospitalise; 3 blood cultures BEFORE antibiotics", "HACEK: Haemophilus, Actinobacillus, Cardiobacterium, Eikenella, Kingella"], ["Heart failure / severe regurgitation","Isolated right-sided IE","~50% of left-sided IE require surgery during index admission", "Persistent S. aureus bacteraemia = IE until proven otherwise — always echo!"], ["Perivalvular extension / abscess","Penicillin-susceptible streptococcal IE","New PR prolongation on ECG in aortic IE = perivalvular abscess → call surgery", "AHA 2021: Clindamycin removed; Doxycycline now an option in penicillin allergy"], ["Older age, renal failure, multiple comorbidities","Young patients; early diagnosis","Brain MRI finds silent emboli in up to 60% — image even without neuro symptoms", "TTE first → TEE if TTE negative OR prosthetic valve OR high suspicion\n4–6 wks IV ABx; oral step-down now evidence-based for selected stable patients"], ] story.append(make_table(hdrs11, rows11, cw11)) story.append(sp(3)) # ── FOOTER ──────────────────────────────────────────────────────────────────── foot_tbl = Table([[Paragraph( "References: Braunwald's Heart Disease (AHA 2021 Guidelines) | " "Robbins & Kumar Basic Pathology | Rosen's Emergency Medicine | " "ESC Guidelines on IE — Prepared by Orris Medical", FOOT_S)]], colWidths=[PW]) foot_tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1),LT_GREY), ("TOPPADDING",(0,0),(-1,-1),4), ("BOTTOMPADDING",(0,0),(-1,-1),4), ])) story.append(foot_tbl) # ── Build ───────────────────────────────────────────────────────────────────── doc.build(story) print("PDF saved.") PYEOF python3 /tmp/workspace/ie_pdf.py

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.

Pneumonia

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.
This is a shared conversation. Sign in to Orris to start your own chat.