1.0.5 • Published 3 years ago

ascvdcalc v1.0.5

Weekly downloads
22
License
MIT
Repository
github
Last release
3 years ago

ASCVD Calculation

This is a javascript implementation of the atherosclerotic cardiovascular disease (ASCVD) 10 year risk calculation. Designed by the American Academy of Cardiology (ACC) this risk Estimator enables health care providers and patients to estimate 10-year and lifetime risks for ASCVD, defined as coronary death or nonfatal myocardial infarction, or fatal or nonfatal stroke, based on the Pooled Cohort Equations and lifetime risk prediction tools.

References

About

This repo uses typescript for its codebase and jest for testing. Webpack is used to bundle the calculation method to a single distribution file. Along with this tsc is used to create a lib-esm dir to allow for esm consumable modules. Jest tests include the 4 base example patients used to describe the implementation of the pooled cohort equations in the ACC guidelines.

Usage

Import the calculation with either require or esm modules

Node

var { calculateASCVDEstimate } = require('ascvdcalc')

ESM

import { calculateASCVDEstimate } from 'ascvdcalc'

The calculation method takes a singe patient object which includes patient parameters needed for the calculation

Example:

var patientParams = {
  sex: 'male',
  race: 'white',
  age: 55,
  totalChol: 213,
  hdl: 50,
  systolicBp: 120,
  isDiabetic: false,
  isSmoker: false,
  treatedHTN: false,
}

var estimate = calculateASCVDEstimate(patientParams) // output 5.4%

Tests

Execute yarn test to run all test cases using jest

Build

Execute yarn build to generate dist and lib-esm directories for consuming in node or a browser setting

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago