ascvdcalc
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.528latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.528
1.0.40
1.0.30
1.0.20
1.0.10

Package Sidebar

Install

npm i ascvdcalc

Weekly Downloads

28

Version

1.0.5

License

MIT

Unpacked Size

17.7 kB

Total Files

16

Last publish

Collaborators

  • yevgeny.bulochnik