R package used to calculate different PreTest Probability (PTP) scores for obstructive Coronary Artery Disease (CAD).
β¬οΈ Installation
Install the development version from GitHub with:
# install.packages("pak")
pak::pak("JauntyJJS/pretestcad")
π« Currently available pretest probability scores
- 2024 ESC Guidelines PTP Score
- 2022 Local Assessment of the Heart (LAH) clinical and extended model
- 2021 Predictive Risk scorE for CAD In Southeast Asians with chEst pain (PRECISE) simple and clinical model
- 2021 AHA/ACC Guidelines PTP Score
- 2020 Winther et. al.Β Basic, RF-CL and CACS-CL PTP
- 2019 ESC Guidelines PTP Score
- 2019 Reeh et. al.Β basic and clinical model
- 2017 PROMISE Minimal-Risk Score
- 2015 CONFIRM Risk Score
- 2013 ESC Guidelines PTP Score
- 2012 CAD Consortium 2 (CAD2) Basic, Clinical and Clinical with Coronary Calcium Score (CCS) PTP
- 2012 ACCF/AHA/ACP/AATS/PCNA/SCAI/STS Guidelines PTP Score
- 2011 CAD Consortium 1 (CAD1) PTP (Updated Diamond-Forrester PTP Score)
- 1993 Duke Clinical Score for Significant CAD
- 1979 Diamond-Forrester PTP
π» Getting Started
2024 ESC Guidelines PTP Score
Here is how you can calculate the score using a single patient.
# 30 female with symptom score of 0 and 0 risk factors
calculate_esc_2024_fig_4_ptp(
age = 30,
sex = "female",
chest_pain_type = "no chest pain",
have_dyspnoea = "no",
have_family_history = "no",
have_smoking_history = "no",
have_dyslipidemia = "no",
have_hypertension = "no",
have_diabetes = "no",
output = "numeric"
)
calculate_esc_2024_fig_4_ptp(
age = 30,
sex = "female",
chest_pain_type = "no chest pain",
have_dyspnoea = "no",
have_family_history = "no",
have_smoking_history = "no",
have_dyslipidemia = "no",
have_hypertension = "no",
have_diabetes = "no",
output = "grouping"
)
Here is how you can calculate the score using for multiple patients.
patient_data <- tibble::tribble(
~unique_id,
~age, ~sex,
~chest_pain_type, ~have_dyspnoea,
~have_family_history, ~have_smoking_history, ~have_dyslipidemia, ~have_hypertension, ~have_diabetes,
"45 year old male with typical chest pain, no dyspnoea, hypertension and diabetes",
45, "male",
"typical", "no",
"no", "no", "no", "yes", "yes",
"70 year old female with no chest pain, dyspnoea, have smoking history (past or current smoker) and dyslipidemia",
70, "female",
"no chest pain", "yes",
"no", "yes", "yes", "no", "no"
)
risk_data <- patient_data |>
dplyr::mutate(
esc_2024_ptp_group = purrr::pmap_chr(
.l = list(
age = .data[["age"]],
sex = .data[["sex"]],
chest_pain_type = .data[["chest_pain_type"]],
have_dyspnoea = .data[["have_dyspnoea"]],
have_family_history = .data[["have_family_history"]],
have_smoking_history = .data[["have_smoking_history"]],
have_dyslipidemia = .data[["have_dyslipidemia"]],
have_hypertension = .data[["have_hypertension"]],
have_diabetes = .data[["have_diabetes"]],
output = "grouping"
),
.f = pretestcad::calculate_esc_2024_fig_4_ptp,
),
esc_2024_ptp_numeric = purrr::pmap_int(
.l = list(
age = .data[["age"]],
sex = .data[["sex"]],
chest_pain_type = .data[["chest_pain_type"]],
have_dyspnoea = .data[["have_dyspnoea"]],
have_family_history = .data[["have_family_history"]],
have_smoking_history = .data[["have_smoking_history"]],
have_dyslipidemia = .data[["have_dyslipidemia"]],
have_hypertension = .data[["have_hypertension"]],
have_diabetes = .data[["have_diabetes"]],
output = "numeric"
),
.f = pretestcad::calculate_esc_2024_fig_4_ptp
),
esc_2024_ptp_percent = purrr::pmap_chr(
.l = list(
age = .data[["age"]],
sex = .data[["sex"]],
chest_pain_type = .data[["chest_pain_type"]],
have_dyspnoea = .data[["have_dyspnoea"]],
have_family_history = .data[["have_family_history"]],
have_smoking_history = .data[["have_smoking_history"]],
have_dyslipidemia = .data[["have_dyslipidemia"]],
have_hypertension = .data[["have_hypertension"]],
have_diabetes = .data[["have_diabetes"]],
output = "percentage"
),
.f = pretestcad::calculate_esc_2024_fig_4_ptp
)
) |>
dplyr::select(
c("unique_id", "esc_2024_ptp_group",
"esc_2024_ptp_numeric", "esc_2024_ptp_percent")
)
print(risk_data)