git clone github:CureApp/adopt-lc.git
npm install
npm install -g mocha # only for test.
and put it to "lib" directory in Titanium Alloy
ChildPughClassification = require('adopt-lc').ChildPughClassification
cpclass = new ChildPughClassification(
2 # frequency of encephalopathy
2 # degree of ascites
3.1 # total billirubin
3.0 # albumin
77 # prothrombin time
)
score = cpclass.getScore() # A|B|C
CharlsonComorbidityIndex = require('adopt-lc').CharlsonComorbidityIndex
ccindex = new CharlsonComorbidityIndex()
ccindex.hasAIDS = true
score = ccindex.getScore() # number
description = ccindex.getScoreDescription() # Low|Moderate|High|Very high
AdoptLC = require('adopt-lc').AdoptLC
adoptLC = new AdoptLC(
71 # age
'A' # Child-Pugh score
3 # score value of Charlson Comorbidity Index
400 # duration of anesthesia
)
score = adoptLC.getScore() # number
mortality = adoptLC.getMortality() # number(float)
cake test
or
npm test