MyNixOS website logo
Description

Pretest Probability for Coronary Artery Disease.

An application to calculate a patient's pretest probability (PTP) for obstructive Coronary Artery Disease (CAD) from a collection of guidelines or studies. Guidelines usually comes from the American Heart Association (AHA), American College of Cardiology (ACC) or European Society of Cardiology (ESC). Examples of PTP scores that comes from studies are the 2020 Winther et al. basic, Risk Factor-weighted Clinical Likelihood (RF-CL) and Coronary Artery Calcium Score-weighted Clinical Likelihood (CACS-CL) models <doi:10.1016/j.jacc.2020.09.585>, 2019 Reeh et al. basic and clinical models <doi:10.1093/eurheartj/ehy806> and 2017 Fordyce et al. PROMISE Minimal-Risk Tool <doi:10.1001/jamacardio.2016.5501>. As diagnosis of CAD involves a costly and invasive coronary angiography procedure for patients, having a reliable PTP for CAD helps doctors to make better decisions during patient management. This ensures high risk patients can be diagnosed and treated early for CAD while avoiding unnecessary testing for low risk patients.

pretestcad Hex logo of R package pretestcad. Logo is a picture of a coronary artery with partial blockage.

R-CMD-check Codecov testcoverage

R package used to calculate different PreTest Probability (PTP) scores for obstructive Coronary Artery Disease (CAD).

As diagnosis of CAD involves a costly and invasive coronary angiography procedure for patients, having a reliable PTP for CAD helps doctors to make better decisions during patient management. This ensures high risk patients can be diagnosed and treated early for CAD while avoiding unnecessary testing for low-risk patients.

Table of Content

:arrow_down: Installation

Install the development version from GitHub with:

# install.packages("pak")
pak::pak("JauntyJJS/pretestcad")

Back to top

:anatomical_heart: Currently available pretest probability scores

Back to top

:computer: 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"
)
[1] 0
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"
)
[1] "very low"

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)
# A tibble: 2 ร— 4
  unique_id         esc_2024_ptp_group esc_2024_ptp_numeric esc_2024_ptp_percent
  <chr>             <chr>                             <int> <chr>               
1 45 year old maleโ€ฆ moderate                             20 20%                 
2 70 year old femaโ€ฆ low                                  10 10%                 

Back to top.

Metadata

Version

1.0.2

License

Unknown

Platformsย (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows