HomeOpportunistic Infection ProphylaxisOpportunistic Infection Risk Stratification Simulator

🛡️ Opportunistic Infection Risk Stratification Simulator

This simulation aids in stratifying patients based on their risk for opportunistic infections. It includes a comprehensive assessment of various factors such as immunosuppressive status, underlying conditions, and exposure risks to help healthcare providers tailor prevention strategies accordingly.

Opportunistic Infection Prophylaxis2DModerate60 FPS
opportunistic-infection-risk-stratification-simulator ↗ Open standalone

The CD4 Ladder — Why Opportunistic Infection Risk Is Staged, Not Binary

Opportunistic infection (OI) prophylaxis guidelines for HIV and other severe immunosuppression are built around a simple observation: different pathogens become clinically threatening at different, fairly predictable CD4 thresholds. Rather than memorizing PCP, toxoplasmosis, MAC, CMV, and fungal prophylaxis as five unrelated protocols, this framework treats them as five checkpoints along a single descending ladder of immune competence — each rung unlocking a specific new set of threats the clinician needs to actively defend against.

  • 5: Framework tiers (CD4 >500 down to <50 cells/mm³)
  • <200: PCP prophylaxis threshold (cells/mm³, classic trigger)
  • <50: MAC prophylaxis threshold (cells/mm³, historical trigger)
  • ↓ time at risk: ART era effect (rapid ART shrinks low-CD4 exposure)

Why CD4 count is the organizing variable

CD4+ T-helper lymphocytes coordinate both cell-mediated immunity (critical for controlling intracellular pathogens like Pneumocystis, Toxoplasma, Mycobacterium avium complex, and CMV) and, indirectly, humoral and mucosal defenses. As the CD4 count falls, immune surveillance does not degrade uniformly — different pathogens exploit different specific gaps, and those gaps open at fairly reproducible count thresholds observed across large cohort studies. This is why prophylaxis guidelines (CDC/NIH/HIVMA Opportunistic Infection Guidelines) are indexed to CD4 count rather than to time-since-diagnosis or viral load alone.

Using a single CD4 number as the primary stratifying variable lets a clinician (or a training tool) rapidly answer the question this simulator is built around: "given this level of immunosuppression, which opportunistic infections should I be worried about, and what should I be doing about it right now?"

Tier 1 — near-normal immune function (CD4 >500)

Above roughly 500 cells/mm³, CD4-dependent immune surveillance is largely intact. Opportunistic infection risk in this tier is not meaningfully different from the general population's baseline risk of community-acquired infection. No HIV-specific OI prophylaxis is indicated here — care remains focused on routine primary prevention (vaccination, TB screening where risk factors exist) rather than pathogen-specific chemoprophylaxis.

This tier is also the target state of successful antiretroviral therapy: the entire clinical purpose of ART is to move a patient's CD4 trajectory back up into this zone and keep it there, which is why the "on ART / improving trend" toggle in this simulator matters as much as the raw CD4 number itself — a CD4 of 150 climbing after 2 months of ART carries a different near-term outlook than a CD4 of 150 that has been declining for a year.

This framework deliberately does not duplicate any single pathogen's detail page (PCP, toxoplasmosis, MAC, CMV, fungal prophylaxis) — it is the connective layer that shows where each of those individual protocols sits on the same underlying CD4 ladder, and why they trigger when they do.

Early Immunosuppression — Bacterial Infections, Candidiasis, and Rising TB Risk

As CD4 count drifts below roughly 500 cells/mm³, the first cracks in host defense appear — not yet the classic AIDS-defining opportunists, but an increased frequency of bacterial infections and mucocutaneous candidiasis, alongside a climbing risk of reactivation tuberculosis in anyone with latent infection. This tier is where TB screening becomes a priority and where clinicians should start actively tracking the CD4 trend, not just the single value.

  • ↑ 2–3×: Bacterial pneumonia risk (vs. CD4-preserved population)
  • common: Oral candidiasis (thrush, angular cheilitis)
  • rising: TB reactivation risk (screen with IGRA/TST this tier)
  • not yet: PCP/MAC prophylaxis (thresholds not reached)

Bacterial infections and encapsulated organisms

Even modest CD4 decline impairs opsonization and antibody responses to encapsulated bacteria (Streptococcus pneumoniae, Haemophilus influenzae), producing a measurably higher rate of bacterial pneumonia, sinusitis, and bacteremia well before the classic AIDS-defining threshold of CD4 <200. This is a reminder that CD4-driven risk is a continuous gradient, not a step function that switches on only at 200 — the practical implication is routine pneumococcal and influenza vaccination and a lower threshold for treating suspected bacterial infection empirically in this range.

Mucocutaneous candidiasis as an early clinical signal

Oral thrush, angular cheilitis, and recurrent vulvovaginal candidiasis are frequently the first visible opportunistic manifestations clinicians see, often preceding any AIDS-defining illness by months to years. Candida overgrowth reflects impaired T-cell-mediated mucosal immunity at the epithelial surface — it is not itself dangerous, but its appearance (especially if recurrent or extending into the esophagus) should prompt CD4 testing if not already known, since esophageal candidiasis specifically is an AIDS-defining event typically seen once CD4 falls well below 200.

Tuberculosis reactivation risk begins climbing

Latent TB reactivates at a rate roughly 10-fold higher in HIV-positive individuals than in the general population, and that risk increases steadily as CD4 falls even before the classic opportunistic thresholds are reached. This tier is the recommended point to screen for latent TB infection with an interferon-gamma release assay (IGRA) or tuberculin skin test (TST) if not already done, since TB (unlike PCP, toxo, MAC, and CMV) can reactivate across a wide range of CD4 counts and remains transmissible to others.

The PCP/Toxoplasmosis Threshold — Where Prophylaxis Becomes Mandatory

CD4 falling below 200 cells/mm³ is the single most consequential threshold in the entire framework: Pneumocystis jirovecii pneumonia (PCP) risk rises sharply and PCP prophylaxis becomes a guideline-mandated intervention, not an option. Toxoplasma gondii reactivation risk in IgG-seropositive patients climbs in parallel and becomes clinically significant as CD4 approaches 100, meaning this tier is where clinicians must actively confirm serostatus and prophylaxis coverage.

  • CD4 <200: PCP prophylaxis trigger (TMP-SMX first line)
  • ~11–90%: Toxo IgG seroprevalence (varies widely by region)
  • high: PCP mortality untreated (if diagnosis delayed)
  • CD4 <100: Toxo prophylaxis trigger (if IgG-seropositive)

Pneumocystis jirovecii pneumonia — the defining threshold

PCP was, for decades, the most common AIDS-defining opportunistic infection and remains a leading cause of severe illness in patients who present late or fall out of care. It is caused by an atypical fungal organism, Pneumocystis jirovecii, that is essentially ubiquitous in the environment and controlled almost entirely by intact cell-mediated immunity. Once CD4 falls below 200 cells/mm³, that control is lost with sufficient reliability that guidelines (CDC/NIH/HIVMA) recommend starting primary prophylaxis — typically trimethoprim-sulfamethoxazole (TMP-SMX) — for essentially all patients in this range, regardless of symptoms.

Prophylaxis can be discontinued once CD4 rises durably above 200 on effective ART, which is why this simulator's ART-trend toggle changes the framing of the recommendation even at an identical CD4 number: a rising CD4 of 220 sustained for 3+ months supports stopping prophylaxis, while a falling CD4 of 220 does not.

CD4 <200 cells/mm³ is the most memorized threshold in HIV medicine for exactly this reason — it is the point at which PCP prophylaxis converts from "consider" to "indicated," and it doubles as the clinical definition of AIDS in the CDC staging system.

Toxoplasma gondii — reactivation in the seropositive host

Toxoplasmosis in this tier is a reactivation disease, not a new infection: it occurs almost exclusively in patients who are already IgG-seropositive (reflecting prior, usually asymptomatic, infection typically acquired from undercooked meat or cat feces exposure) and whose cell-mediated control of latent cysts in brain and other tissue fails as CD4 declines. Because the risk is conditional on serostatus, checking Toxoplasma IgG is a necessary step at this tier — a seronegative patient does not need toxoplasmosis-specific prophylaxis regardless of how low CD4 falls, while a seropositive patient becomes a prophylaxis candidate as CD4 approaches and falls below 100.

Conveniently, the TMP-SMX regimen already started for PCP prophylaxis at CD4 <200 also provides effective toxoplasmosis prophylaxis, so in practice the two thresholds are usually managed with a single medication rather than two separate regimens.

Severe Immunosuppression — Disseminated Fungal Infection Enters the Picture

Between CD4 50 and 100 cells/mm³, the risk profile widens further: disseminated fungal infections — histoplasmosis, coccidioidomycosis, cryptococcosis, and in some regions penicilliosis/talaromycosis — become substantially more likely, especially in patients with relevant geographic or environmental exposure. This tier layers fungal risk on top of everything from tiers 2 and 3, which is why the composite risk visualization keeps expanding rather than replacing prior threats.

  • CD4 <100: Cryptococcal risk rises (meningitis most feared)
  • endemic regions: Histoplasmosis (Ohio/Mississippi River valleys)
  • endemic regions: Coccidioidomycosis (US Southwest)
  • selective: Fungal prophylaxis (exposure/region-dependent)

Disseminated fungal infection risk broadens

Unlike PCP and toxoplasmosis, most systemic dimorphic fungal infections in this tier are geographically constrained: Histoplasma capsulatum is endemic to the Ohio and Mississippi River valleys, Coccidioides species to the arid US Southwest, and Talaromyces marneffei to parts of Southeast Asia. Cryptococcus neoformans is more globally distributed and remains one of the most feared opportunistic infections in this range because cryptococcal meningitis carries substantial mortality even with treatment, particularly in resource-limited settings.

Because the risk is exposure- and region-dependent rather than universal, routine primary antifungal prophylaxis is not recommended for all patients in this tier the way TMP-SMX is for PCP — it is a selective decision based on endemic exposure history, occupational risk, and local epidemiology, which is why "prophylaxis considerations" at this tier reads as "consider" rather than "indicated."

Why severity keeps compounding, not replacing, prior tiers

A critical feature of this framework — visualized directly in the composite risk display — is that descending a tier never retires the risks introduced at a higher CD4 level. A patient with CD4 70 remains at risk for PCP, toxoplasmosis, bacterial infection, and candidiasis exactly as much as a patient with CD4 150, plus the newly added fungal risk. This is why prophylaxis regimens accumulate rather than rotate: by the time a patient reaches this tier, they are typically maintained on PCP/toxo prophylaxis and being evaluated for fungal-specific coverage simultaneously, not switched from one to the other.

Profound Immunosuppression — Disseminated MAC, CMV Disease, and the Modern ART Context

Below 50 cells/mm³, patients enter the tier historically associated with the highest opportunistic infection burden in HIV medicine: disseminated Mycobacterium avium complex (MAC) infection and cytomegalovirus (CMV) end-organ disease, most classically CMV retinitis. This tier represents the full composite of the framework — every risk category introduced in tiers 2 through 5 is simultaneously active. Critically, in the modern rapid-ART era, fewer patients now spend extended time at this level, which changes how urgently this tier should be interpreted.

  • CD4 <50: MAC prophylaxis trigger (azithromycin historically)
  • CD4 <50: CMV retinitis risk (leading cause of AIDS blindness pre-ART)
  • shorter exposure: Rapid ART era effect (fewer patients linger at CD4 <50)
  • ART start/optimize: Priority intervention (outranks adding new prophylaxis)

Disseminated Mycobacterium avium complex

MAC is a ubiquitous environmental organism (found in water, soil, and food) that becomes capable of hematogenous dissemination once cell-mediated immunity falls below roughly 50 CD4 cells/mm³, producing fever, night sweats, weight loss, diarrhea, and cytopenias from bone marrow involvement. Primary prophylaxis with azithromycin at this threshold was, in the pre-ART and early-ART eras, one of the most impactful single interventions in reducing AIDS-related mortality among the most immunosuppressed patients.

In current practice, guidelines increasingly emphasize that primary MAC prophylaxis can often be deferred or omitted if a patient is about to start, or has just started, effective ART with an expectation of rapid CD4 recovery — reflecting the modern shift in priority described below.

CMV end-organ disease, especially retinitis

Cytomegalovirus, like Toxoplasma, is a reactivation disease in a previously infected (CMV IgG-seropositive) host — and CMV seroprevalence is very high in most adult populations. Once CD4 falls below 50, loss of CMV-specific T-cell control allows reactivation with end-organ disease, most classically CMV retinitis, which was a leading cause of blindness in AIDS patients before antiretroviral therapy became widely available. Unlike MAC, there is no standard primary drug prophylaxis for CMV disease in this tier — the mainstay of prevention is regular screening (including dilated fundoscopic exam in some protocols) and rapid immune reconstitution via ART, plus prompt treatment if retinitis is detected.

Modern rapid-ART initiation protocols mean many newly diagnosed patients now start treatment within days of diagnosis and climb out of the CD4 <50 tier within weeks to months — meaningfully shrinking the population that lingers long enough to develop MAC or CMV disease compared to the pre-ART and early-ART eras. The framework tier still describes real risk, but ART trajectory now matters as much as the raw CD4 number.

Reading the trajectory, not just the number, at profound immunosuppression

At this tier more than any other, the "on ART / improving trend" context reframes clinical urgency. A treatment-naive patient newly diagnosed at CD4 30 with a rapidly climbing count after ART initiation has a fundamentally different near-term MAC/CMV risk trajectory than a patient with CD4 30 who has been declining for months off therapy or has failed a prior regimen. This is the rationale for this simulator pairing a single CD4 slider with a single ART-trend toggle: risk stratification in modern HIV care is genuinely two-dimensional — where you are, and which direction you are moving.

⚙ Under the hood

This simulation aids in stratifying patients based on their risk for opportunistic infections. It includes a comprehensive assessment of various factors such as immunosuppressive status, underlying conditions, and exposure risks to help healthcare providers tailor prevention strategies accordingly.

CanvasBiomedicine

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)