npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

insulin-calc

v1.2.6

Published

Safer Insulin Project

Downloads

11

Readme

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:

| Function | Version | name(params) | | -------- | ------- | ------------ | | a | 1.x.x | startingRate(currentGlucose) | | b | 1.x.x | ongoingRate(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.