Skip to content

InterconnectedSystems/prevent-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

AHA PREVENT™ Cardiovascular Risk Calculator

A standalone desktop application implementing the American Heart Association's PREVENT (Predicting Risk of cardiovascular disease EVENTs) equations for absolute cardiovascular risk assessment.

Python Platform License Guideline


Overview

The PREVENT equations represent a major advance over the older Pooled Cohort Equations (PCEs). They are race-free, incorporate kidney function (eGFR), BMI, and statin use, and predict both ASCVD and Heart Failure risk simultaneously. This calculator implements the full base model as published, with risk thresholds updated to reflect the latest clinical guidelines.

Predicted outcomes:

Outcome 10-Year 30-Year
Total CVD
ASCVD (atherosclerotic CVD)
Heart Failure

Clinical Sources

Component Source
PREVENT Equations Khan SS, Matsushita K, Sang Y, et al. Circulation 2024;149(6):430–449. doi:10.1161/CIRCULATIONAHA.123.067626
ASCVD Risk Thresholds 2026 ACC/AHA Multisociety Dyslipidemia Guideline
BP Treatment Threshold 2025 AHA/ACC High Blood Pressure Guideline (Total CVD ≥7.5%)
Coefficient Verification bcjaeger/PooledCohort · martingmayer/preventr (CRAN)

What's New vs. Pooled Cohort Equations

Feature Old PCEs PREVENT
Model type Cox PH Logistic regression
Race-specific equations Yes No (race-free)
Kidney function (eGFR) No Yes
BMI No Yes
Statin use No Yes
Heart failure prediction No Yes
Cholesterol input Total + HDL Non-HDL + HDL
Calibration slope 0.50–0.54 0.94–1.03

Risk Thresholds

10-Year ASCVD (2026 ACC/AHA Dyslipidemia Guideline)

Category Threshold Clinical Action
🟢 Low < 3% Lifestyle counselling; no routine statin
🟡 Borderline 3 – 5% Discuss risk-enhancers; statin reasonable after SDM
🟠 Intermediate 5 – 10% Moderate-intensity statin recommended
🔴 High ≥ 10% High-intensity statin; target LDL-C < 70 mg/dL

10-Year Total CVD (2025 AHA/ACC HTN Guideline)

  • ≥ 7.5% → Antihypertensive therapy indicated for Stage 1 HTN

10-Year Heart Failure

Category Threshold
Low < 2.5%
Borderline 2.5 – 5%
Intermediate 5 – 10%
High ≥ 10%

Required Inputs

Input Range Notes
Age 30 – 79 years Outside this range: not validated
Biological sex Male / Female Sex-specific equations
Total cholesterol 100 – 400 mg/dL Converted to mmol/L internally
HDL-C 20 – 100 mg/dL Non-HDL derived automatically
Systolic BP 90 – 200 mmHg Linear spline centred at 110 & 130
Antihypertensive medication Yes / No Interaction with SBP spline
BMI 15 – 60 kg/m² Enters Heart Failure models (spline at 30)
Diabetes mellitus Yes / No
Statin therapy Yes / No Interaction with non-HDL-C
Current smoker Yes / No
eGFR (CKD-EPI) 15 – 140 mL/min/1.73m² Linear spline centred at 60 & 90

Model Details

Equation form:

Risk (%) = exp(LP) / (1 + exp(LP)) × 100

Variable scaling (centred at a typical healthy person):

age_term        = (age − 55) / 10
non_hdl_term    = non_hdl_mmol − 3.5
hdl_term        = (hdl_mmol  − 1.3) / 0.3
sbp_lt110_term  = (min(SBP, 110) − 110) / 20
sbp_gte110_term = (max(SBP, 110) − 130) / 20
bmi_lt30_term   = (min(BMI, 30)  −  25) /  5
bmi_gte30_term  = (max(BMI, 30)  −  30) /  5
egfr_lt60_term  = (min(eGFR, 60) −  60) / −15
egfr_gte60_term = (max(eGFR, 60) −  90) / −15

The linear predictor also includes 9 interaction terms (age × risk factors, BP Rx × SBP, statin × non-HDL).


Application Features

  • Risk Scores tab — Semicircular gauge for 10-yr Total CVD; table of all 6 scores with colour-coded category badges
  • Interpretation tab — Full clinical guidance for ASCVD, blood pressure, and heart failure management, colour-coded by severity
  • Factor Analysis tab — Horizontal bar chart showing the percentage-point contribution of each modifiable risk factor to 10-yr ASCVD risk vs. ideal reference values
  • Load Example Patient button (58M, DM, BMI 27, statin user)
  • No internet connection required; no data transmitted

Installation

Option A — Portable Executable (Windows, no Python needed)

Download PREVENT_Calculator.exe from Releases and run it directly.

Option B — Run from source

# Requires Python 3.8+ with tkinter (included in standard Python for Windows)
git clone https://github.com/InterconnectedSystems/prevent-calculator.git
cd prevent-calculator
python prevent_calculator.py

Option C — Build the executable yourself

pip install pyinstaller
pyinstaller --onefile --windowed --name PREVENT_Calculator prevent_calculator.py
# Output: dist/PREVENT_Calculator.exe

Screenshots

Run the app and click Load Example Patient → Calculate PREVENT Score to see all three tabs populated.


Disclaimer

For use by qualified healthcare professionals only. This tool implements published prediction equations and is intended to support — not replace — clinical judgement. Risk estimates are probabilistic and apply to populations; individual patient decisions must account for clinical context, patient preferences, and factors not captured by this model. The PREVENT equations are validated for adults aged 30–79 without established cardiovascular disease (primary prevention only).


License

MIT License — see LICENSE for details.


Citation

If you use this tool in research or clinical quality improvement, please cite the original equations:

Khan SS, Matsushita K, Sang Y, et al. Development and Validation of the American Heart Association's PREVENT Equations. Circulation. 2024;149(6):430–449. doi:10.1161/CIRCULATIONAHA.123.067626

About

AHA PREVENT™ Cardiovascular Risk Calculator — standalone desktop app implementing the 2024 PREVENT equations (Khan SS et al., Circulation 2024) with 2026 ACC/AHA guideline thresholds

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages