CHA2DS2-VASc Calculator

basacul
6/19/2016

  1. The CHA2DS2-VASc Score
  2. The Scores and their Stroke Risk
  3. ui.R
  4. server.R

The CHA2DS2-VASc Score

  • Determines a score as well as the stroke risk per year in percent
  • Helps determine the treatment plan
  • There are 7 different inputs representing a condition
  • Each condition is worth 1 or 2 points
  • The maximum score is 9 points
  • ui.R : displays the information and outputs, and passes the inputs to server.R
  • server.R : calculates the score and provides the score and stroke risk values to ui.R as outputs

The Scores and their Stroke Risk

SCORE STROKE RISK (%)
0 0
1 1.3
2 2.2
3 3.2
4 4.0
5 6.7
6 9.8
7 9.6
8 12.5
9 15.2

source: https://en.wikipedia.org/wiki/CHA2DS2-VASc_score

ui.R

The user interface displays the necessary information and outputs and takes the following inputs:

Condition Code Points
Congestive heart failure (or Left dentricular dystolic dysfunction) C 1
Hypertension: consistently above 140/90 mmHg or treated on medication H 1
Age: > 74 years A2 2
Diabetes Mellitus D 1
Prior Stroke, TIA or thromboembolism S2 2
Vascular Disease(e.g. PAD, MI, Aortic plaque) V 1
Age: 65 - 74 years A 1
Sex category (if female) Sc 1

source : https://en.wikipedia.org/wiki/CHA2DS2-VASc_score

server.R

The inputs except gender are numerical and consist of their respective value following the ESC and NICE guidelines. An ordered list with their respective risk values is saved as 'risk'. The score is calculated and displayed as well as the value in the list 'risk' at index (score + 1). Gender and Age are evaluated in an if else statement. Here an example of the calculations and provided outputs in server.R :

risk <<- c(0,1.3,2.2,3.2,4.0,6.7,9.8,9.6,12.5,15.2)
conditions <- c(0,1,2)
score <- sum(conditions)
paste("Stroke Risk per year : ",risk[score + 1], "%")
[1] "Stroke Risk per year :  3.2 %"
paste("Score : ", score)
[1] "Score :  3"