Skip to content

Instantly share code, notes, and snippets.

View scottleibrand's full-sized avatar

Scott Leibrand scottleibrand

View GitHub Profile
Start a conversation
On /claims, ask w/in that convo about claims
On /fact:
Ask what would be a good search query to use to check if that claim is true
@scottleibrand
scottleibrand / master patch test fixes.md
Last active May 10, 2021 13:57 — forked from danamlewis/master patch test fixes.md
Clearer instructions for 0.6.3 patch fixes

1. Run an edited bootstrap

(Assuming you already have flashed jubilinux recently) Copy and paste this bootstrap script instead of the current one in the docs:

#!/bin/bash
(
dmesg -D
echo Scanning for wifi networks:
@scottleibrand
scottleibrand / pumpprofile-1u-50-10.json
Created August 13, 2018 21:31
Generic autotune pumpprofile.json
{
"carb_ratios": {
"schedule": [
{
"x": 0,
"i": 0,
"offset": 0,
"ratio": 10,
"r": 10,
"start": "00:00:00"
@scottleibrand
scottleibrand / advanced-meal-assist.json
Created March 23, 2016 19:18
Example of openaps devices, reports, and aliases you'll need to modify to run the advanced-meal-assist branch of oref0.
[
{
"extra": {
"fields": "pumphistory profile clock carbs glucose basal",
"cmd": "oref0",
"args": "meal"
},
"type": "device",
"name": "meal",
"meal": {
@scottleibrand
scottleibrand / meal-assist-setup.sh
Last active April 18, 2016 02:09
Meal Assist Setup
cd && test -d src/oref0 && cd src/oref0 && git pull && git checkout dev && git pull
npm install && sudo npm install -g && sudo npm link && sudo npm link oref0
openaps device add meal process --require "pumphistory profile clock" oref0 meal
openaps device remove get-profile
openaps device add get-profile process --require "settings bg_targets isf basal_profile max_iob carb_ratios" oref0 get-profile
openaps device remove determine-basal
openaps device add determine-basal process --require "iob temp_basal glucose profile offline meal" oref0 determine-basal
openaps report add monitor/meal.json text meal shell monitor/pumphistory-zoned.json settings/profile.json monitor/clock-zoned.json
openaps report remove settings/carb_ratios.json
openaps report add settings/carb_ratios.json JSON pump read_carb_ratios

#Proposed oref0 Meal Assist algorithm

Currently the oref0 OpenAPS implementation is designed to completely ignore carbs, on the assumption that carb entry will not be reliable, either in frequency or accuracy. However, when carb information is available from Bolus Wizard entries or from Nightscout, it seems we can do better than that, by using carb information as just one signal to decide whether it's safe to high-temp when the oref0 bolus snooze algorithm would otherwise choose to do nothing (and require the user to manually administer the remainder of their meal bolus as needed.

Below are some design goals and a proposed algorithm that should accomplish this. Feedback welcome!

#Design goals:

  • Assist with partial meal boluses if user enters carb amount
  • High-temp early but safely while BG is still rising
  • Do not require any assumptions about carb absorption profile
@scottleibrand
scottleibrand / gist:da84b4bf799592d19214
Created October 18, 2015 21:41
required non-zero non-null fields in output of decocare commands
read_bg_targets: units, targets: { high, low }
read_carb_ratios: units: "grams", schedule: { ratio }
read_insulin_sensitivies: action_type, sensitivities: { sensitivity }
read_selected_basal_profile: { rate }
read_settings: maxBasal, insulin_action_curve
read_temp_basal: temp
diff --git a/env.js b/env.js
index c063c22..9e2c0eb 100644
--- a/env.js
+++ b/env.js
@@ -43,6 +43,7 @@ function config ( ) {
env.treatments_collection = readENV('MONGO_TREATMENTS_COLLECTION', 'treatments');
env.profile_collection = readENV('MONGO_PROFILE_COLLECTION', 'profile');
env.devicestatus_collection = readENV('MONGO_DEVICESTATUS_COLLECTION', 'devicestatus');
+ env.pumphistory_collection = readENV('MONGO_PUMPHISTORY_COLLECTION', 'pump');
@scottleibrand
scottleibrand / install.sh
Last active August 29, 2015 14:20 — forked from bewest/install.sh
#!/bin/bash
git clone -b bewest/dev https://github.com/bewest/decoding-carelink.git
git clone https://github.com/bewest/dexcom_reader.git
git clone https://github.com/openaps/openaps.git
(cd decoding-carelink
sudo python setup.py develop
)
[
{
"date": 1416967408000.0,
"timestamp": "2014-11-25T18:03:28",
"_type": "TempBasalDuration",
"duration (min)": 0,
"_description": "TempBasalDuration 2014-11-25T18:03:28 head[2], body[0] op[0x16]"
},
{
"_type": "BasalProfileStart",