factor-calculator

Determine combinations of bleeding factor product medications to find the closest combinations to the ordered dose.


Project maintained by phentnil Hosted on GitHub Pages — Theme by mattgraham

Factor Calculator

CodeQL Node.js CI

Access the online calculator here!

Because of the nature of production of bleeding factor product medications, the exact unit amount in each vial will vary. Usually each factor product has certain unit ranges which have some degree of variability. We take unit amounts available into account to calculate which combinations can make up dose amounts within ±10% of the ordered dose.

Using a list of available vials and their specific unit values, we want to calculate the most ideal dose as close to the ordered dose as possible. The allowable error margin from the ordered dose is > -10% of the ordered dose and < +10% of the ordered dose. If results are not found within this margin, it is still helpful to note the closest/best result as the pharmacist will have to contact the doctor to obtain the necessary approval for that dose.

The primary focus of this program is Kcentra, but the program can be generalized to other bleeding factor medications once it is built to be a robust, working program.

Example case

Ordered dose is 3000 units

Units available

Units Quantity
533 4
565 2
1097 4
1155 2

Possible combinations

Unit combination Sum Difference Variance
1155, 1155, 565 2,875 -125 -4.2%
1097, 1097, 1097 3,291 291 +9.7%

Getting Started

Clone this repository with

git clone https://github.com/phentnil/factor-calculator.git
cd factor-calculator

Build the project with

npm install
npm run build

Contribution

See contributing.md