New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

insulin-calc

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

insulin-calc

Safer Insulin Project

  • 1.2.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Safer Insulin: Critical Care Insulin Calculator

npm version Build Status Coverage MIT license

This respository houses the website and underlying module code for an insulin infusion rate calculator currently being evaluated.

The website is live at https://saferinsulin.org

It is provided to medical professionals for use at their own discretion: preparing the requirements for CE marking is underway and the tool has been used successfully in the Greater Manchester Critical Care Network.

Technicals

Building and deploying a mirror

This is positively encouraged, as it gives resiliance to the availability of the calculator. To build:

  • ensure yarn installed
  • clone repository
  • run npm install
  • run npm run build
  • the website will be in the dist/ folder, the app version ready to be packaged with Phonegap Build (or other Cordova-based toolset) will be in the app/ folder
  • if using Phonegap Build, npm run zip will prepare the app for upload

NPM module for calculator component

The module can be used within a node.js project by installing from npm: npm install insulin-calc or by including the browserified module dist/js/insulin-calc.js in a web project.

The following placeholder code should demonstrate how the functions are intended to be called and their parameters:

/* Instantiate a calculator object */
var calc = require('insulin-calc')

/* Get a starting rate of insulin infusion */
var glucose = 17.2    // current glucose reading in mmol/L
var result = calc.startingRate(glucose)
console.log('New rate:', result.rate)
console.log('Advice:', result.advice)
console.log('Governance hex code:', result.hex)

/* Get a new rate of infusion when patient is already on insulin infusion */
var current = 12.1    // current glucose reading in mmol/L
var previous = 14.2   // previous glucose reading in mmol/L
var rate = 3          // current insulin infusion rate in ml/hr
var result = calc.ongoingRate(current, previous, rate)
console.log('New rate:', result.rate)
console.log('Advice:', result.advice)
console.log('Governance hex code:', result.hex)

/* Check a governance code */
var result = calc.governance('0d7-a82820')
console.log('Function ID used:', result.function)
console.log('Date generated:', result.date)
console.log('Parameter passed:', result.current)

The 'functions IDs' in the object returned by the governance code function are:

FunctionVersionname(params)
a1.x.xstartingRate(currentGlucose)
b1.x.xongoingRate(currentGlucose, previousGlucose, currentRate)

As future iterations of this project evolve, the intention is that previous versions of the algorithm are preserved to ensure governance codes can always be checked.

Keywords

FAQs

Package last updated on 12 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc