These are chat archives for nightscout/intend-to-bolus

25th
Feb 2015
diabeticgonewild
@diabeticgonewild
Feb 25 2015 00:13
87 .... eff yeah
diabeticgonewild
@diabeticgonewild
Feb 25 2015 00:43
This paper is a manuscript right now and is still going through the peer review process but you might be interested in it @scottleibrand . @danamlewis , @TC2013 , http://www.cmpbjournal.com/article/S0169-2607%2815%2900027-9/abstract
Matthias Granberry
@mgranberry
Feb 25 2015 00:57
It looks like the third component of y(t) in http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3879757/ is completely broken, not just the range
diabeticgonewild
@diabeticgonewild
Feb 25 2015 01:02
well, if you want, I can send that other paper to you. It accounts for variability (30%) in insulin absorption, but it requires cross-referencing of a Dalla Man paper that @bleached was using.
You can also interpolate and approximate the points at that interval using the graph provided, I think, and figure out the equation that way. Or just email the authors.
From figure 2, I mean, specifically. That isn't difficult to do, although it's inexact. Emailing the authors would be the best option.
Matthias Granberry
@mgranberry
Feb 25 2015 01:26
They describe how they derived it and I can probably derive it by han. I don't have fancy curve fitting tools at my disposal, but I wanted people to be aware of problems.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 01:29
that's good then. I can fix it. I have MATLAB and you know how I <3 MATLAB. It does almost everything, as far as I am concerned.
Matthias Granberry
@mgranberry
Feb 25 2015 01:29
Don't worry. I can play around with a linear approximation
diabeticgonewild
@diabeticgonewild
Feb 25 2015 01:29
kk
diabeticgonewild
@diabeticgonewild
Feb 25 2015 01:38
245 :P but started a new glucose sensor, so that's good. IDK what was so hard about starting one up and charging my Dexcom so I could take care of myself properly...
diabeticgonewild
@diabeticgonewild
Feb 25 2015 08:06
Blood sugar right now: LO, as in too low to read. Getting gummy bears. This sucks!
I'm 21 now so that's better. I ate some gummy bears. Of course I woke up to the LO.
Toby Canning
@TC2013
Feb 25 2015 08:10
Rough day for you. May the glucose monster be kind to you. Night
diabeticgonewild
@diabeticgonewild
Feb 25 2015 08:11
LOL good night. Gonna be up for awhile but that's OK.
38 ftw
diabeticgonewild
@diabeticgonewild
Feb 25 2015 08:19
33 ... Sigh
diabeticgonewild
@diabeticgonewild
Feb 25 2015 08:28
33 still ... Courtesy of gastroparesis. Using a Freestyle Freedom Lite meter, which is very consistent and accurate and I trust it even when I am this low.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 08:36
32 ... Noooo! Might have to even over treat some more as my stomach doesn't empty properly. It's been 30 minutes elapsed and only +12 increase in glucose so I have to do something.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 08:59
36 an hour after the LO reading thanks to gastroparesis. Keep in mind that lows like this are also physically distressing for me as my autonomic nervous system cannot respond appropriately to them due to inappropriate compensation. Might be calling endo in the morning, and I never do that.
50 now...
for the record:
diabeticgonewild
@diabeticgonewild
Feb 25 2015 09:05
0:00 LO, 0:04 21, 0:10 38, 0:14 33, 0:21 33, 0:25 38, 0:29 32, 0:51 36, 0:55 50
And 240 grams of CHO worth of gummy bears, because I was worried and I had to over treat. My insulin to carb ratio is 1:15 so I'm supposed to take 16 units but I am going to take 8 instead.
I have to over treat. I don't have a choice. That's what gastroparesis does. Usually I treat with around 75-120 grams of CHO when I am low like that
40 now .... No! This is insane
diabeticgonewild
@diabeticgonewild
Feb 25 2015 09:11
39 ... Probably going down.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 09:17
42 FML ... 1:09 after the LO reading. I think tonight goes high up there on the worst diabetes days ever list. I have never had a LO reading before in 20 years of diabetes. Of course the severe DKA incident with 4 days in the ICU tops the list of worst crises that have happened to me, but that wasn't on my watch as I was already in the hospital when that happened.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 09:43
52 ... 1:37 after the initial LO crisis. At least it is above 50. It could have been way more serious but it just proves that my situation is out of control.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 10:02
54 ... 2 hours after the initial crisis. Just going to disconnect from my pump and go to sleep. It's risky but I can just deal with it in the morning when I wake up.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 10:36
42 now ... 2:30 after the LO crisis and after 240 grams of CHO. Unbelievable
diabeticgonewild
@diabeticgonewild
Feb 25 2015 11:17
49 now ... 3:07 after LO crisis. Searched around for glucagon so I could give myself a half dose Via IM injection because I am nauseated from eating so much plus the low blood sugar reaction and not responding to CHO well. Didn't find it of course, but I have never had to use it. There was no antecedent bolus that precipitated the event, but the switching of insulin caused it plus gastroparesis. Calling endo in the morning.
34 now ... WTF!
diabeticgonewild
@diabeticgonewild
Feb 25 2015 11:37
46 ... 3:30 later
diabeticgonewild
@diabeticgonewild
Feb 25 2015 11:58
70 ... 3:45 later ... Victory! Going to sleep for awhile plus just took nausea medicine that makes me sleepy. Was finally able to get Dexcom calibrated too. Have an appointment near noon tomorrow that I won't want to go to cause of this but oh well. Calling endo when I get up tomorrow.
Matthias Granberry
@mgranberry
Feb 25 2015 13:13
Kg *
Matthias Granberry
@mgranberry
Feb 25 2015 15:02
I have a feeling that the stress of running on batteries is going to be a problem going forward.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 15:12
Why? is it a source of failure for you? Fwiw, I think I failed last night, diabetes-wise
Matthias Granberry
@mgranberry
Feb 25 2015 15:16
I got my parameters tuned for the iob-cob branch of nightscout yesterday and it turned out to be quite accurate, even pointing out an occasion where a corrective snack would be insufficient and clueing me in to a basal rate problem in the evening. Unfortunately, it also makes my phone run out of batteries in about 8h. I suspect I'm going to have yet another thing that I'm paranoid about maintaining now.
to go along with the feeling of unease when I don't have my meter, glucose tabs, and CGM in a pocket
diabeticgonewild
@diabeticgonewild
Feb 25 2015 15:22
That sucks man. Maybe a USB battery pack (even with a Qi charging pad on it), or a phone with dual OTG with charging features or a Qi universal charging pad (inductive charger) may be the way to go
Matthias Granberry
@mgranberry
Feb 25 2015 15:23
It will all work out once Dexcom has the new receivers out next month
diabeticgonewild
@diabeticgonewild
Feb 25 2015 15:25
Yeah, hopefully. I hope they don't change the USB upload protocol
Matthias Granberry
@mgranberry
Feb 25 2015 15:26
@StephenBlackWasAlreadyTaken said it was already pretty much working. He was having some trouble throttling commands for BLE, but that will be fairly straightforward if a bit tedious.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 15:29
Yeah I might get a new Bluetooth receiver and purchase it out of pocket. That way I can use Nightscout and connect it via Bluetooth to my iPhone, so once the Apple Watch comes out, I can get one for my mom (for mother's day or something and spoil her) so she can watch my blood sugars via her iPhone, besides just using the watch. I don't think a Pebble will "sell her" into watching my blood sugars. I really want to avoid situations like last night.
Matthias Granberry
@mgranberry
Feb 25 2015 15:32
it looks like it would be cheaper to get a Share and take advantage of the free upgrade unless you have gotten a new receiver recently
diabeticgonewild
@diabeticgonewild
Feb 25 2015 15:33
Doesn't the new receiver only cost $200
Matthias Granberry
@mgranberry
Feb 25 2015 15:33
http://dexcom.com/dexcom-fda-approval They have discounts available depending on when you got one
diabeticgonewild
@diabeticgonewild
Feb 25 2015 15:35
Yeah so it would be $200 for me plus the cost of an Apple watch for my mom. I am not getting rid of Nightscout though, because it is much more versatile with CarePortal and the Raw data.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 15:59
But I really had a crisis last night...
Matthias Granberry
@mgranberry
Feb 25 2015 16:17
Hopefully the Xeris pharmaceuticals phase-2 trials go well and a glucagon pen will be an option soon.
Toby Canning
@TC2013
Feb 25 2015 16:22
Great little gem of an equation in the paper you sent me Monica: ISF = (1960ICR) / 2.6 weight in lbs
1960 IC Ratio / 2.6 body weight in pounds
Matthias Granberry
@mgranberry
Feb 25 2015 16:31
That's the Walsh paper? If you haven't yet, buy his book and read it. It is very good at helping troubleshoot control problems, but the paper there is my go-to quick reference for adjustments as I lose weight.
Toby Canning
@TC2013
Feb 25 2015 16:59
That was: Method for Automatic Adjustment of an Insulin Bolus
Calculator: In Silico Robustness Evaluation under Intra-Day
Variability
However, I just bought Walsh's book last week!
Matthias Granberry
@mgranberry
Feb 25 2015 17:00
Ah. That formula comes from this paper: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3045234/
diabeticgonewild
@diabeticgonewild
Feb 25 2015 17:51
Yeah I just calculated my ISF was 54.8. Of course I don't know how to use my iPhone calculator but I know how to use the HP emulator calculator that used reverse Polish notation. My ICR is 16. Of course you can find out how much of a fatty I am but fwiw I am tall for a chick. I am 5'9".
It was set to 57 on my pump though so not far off
Jason Calabrese
@jasoncalabrese
Feb 25 2015 18:35
what would it take to port the scaleable IOB formula to iob-cob so we can support different DIA's
Matthias Granberry
@mgranberry
Feb 25 2015 18:36
@jasoncalabrese funny you should ask. I'm working on it right now. It's only a few lines of code.
Dana Lewis
@danamlewis
Feb 25 2015 18:36
Awesome
Jason Calabrese
@jasoncalabrese
Feb 25 2015 18:37
great
what about packaging all these little functions up
so we can just pull it into nightscout
Matthias Granberry
@mgranberry
Feb 25 2015 18:41
@jasoncalabrese I am doing most of my own work in Scala, so it isn't directly applicable (although it does compile to JS). I'd really rather spend a little time cleaning up the DIYPS nightscout stuff first before adding any complexity. If nothing else there needs to be a library that handles the IOB/COB stuff instead of having it duplicated in a few places.
Jason Calabrese
@jasoncalabrese
Feb 25 2015 18:58
I use scala at work, I could port scala code to js
just wouldn't look as nice
Matthias Granberry
@mgranberry
Feb 25 2015 19:02
I just created a PR that scales the IOB curve for arbitrary DIAs.
Matthias Granberry
@mgranberry
Feb 25 2015 19:08
Jason Calabrese
@jasoncalabrese
Feb 25 2015 19:09
I was looking at using https://www.npmjs.com/package/browserify-express to share js code between the client and server
would be nice to have all iob/cob code shared
Matthias Granberry
@mgranberry
Feb 25 2015 19:09
those are my IOB curves in Scala. They should give you an idea on the rest of it. I'm still figuring out how I want the rest the system to look.
Jason Calabrese
@jasoncalabrese
Feb 25 2015 19:10
I also want to bring IOB to the mainline, and continue cleaning up and unifying mainline/iob-cob
keeping the 2 worlds aligned is really a pain
Matthias Granberry
@mgranberry
Feb 25 2015 19:11
Branches definitely aren't free, even in the brave new world of git.
btw nightscout/cgm-remote-monitor#436
Jason Calabrese
@jasoncalabrese
Feb 25 2015 19:17
that static/iob-cob.html isn't in sync with client.js
really annoying, need to share code
need IOB on the server for the pebble endpoint too
Matthias Granberry
@mgranberry
Feb 25 2015 19:24
alright. I added a commit to bring them in line.
Jason Calabrese
@jasoncalabrese
Feb 25 2015 19:35
thanks we'll need to update pebble.js too, right now it's not even checking the profile
Matthias Granberry
@mgranberry
Feb 25 2015 19:36
oh, I didn't realize there was yet another place where the code existed
Jason Calabrese
@jasoncalabrese
Feb 25 2015 19:39
hope it's not somewhere else too
Matthias Granberry
@mgranberry
Feb 25 2015 19:40
Matthias-Granberrys-MacBook-Pro :: ~/cgm-remote-monitor/cgm-remote-monitor ‹wip/iob-cob› » grep -r 001852 .
./lib/pebble.js: iobContrib = treatment.insulin
(1-0.001852xx+0.001852x);
./static/iob-cob.html: iobContrib=treatment.insulin
(1-0.001852xx+0.001852x);
./static/js/client.js: iobContrib=treatment.insulin
(1-0.001852xx+0.001852x);
./static/js/diyps/DIYPS.js: var iobContrib=treatment.insulin
(1-0.001852xx+0.001852*x);
is DIYPS.js getting used anywhere? It didn't look like it was.
Jason Calabrese
@jasoncalabrese
Feb 25 2015 19:41
diyps.js isn't used, that was a partial attempt to unify things
Matthias Granberry
@mgranberry
Feb 25 2015 19:43
I'm not sure how to handle DIA for Pebble. The same approach will work, but there isn't a profile hanging around.
Jason Calabrese
@jasoncalabrese
Feb 25 2015 19:43
yeah, need to get it from mongo, maybe we skip that for now
seems like we need something like diyps.js or openaps.js
then it could be used outside of NS too
if there was an interface you could pick different implementations
Toby Canning
@TC2013
Feb 25 2015 20:43
So, I have included a mildly predictive low glucose suspend that forecasts not on the AR equation, but by averaging velocity for the last 4 readings. We are just running along side, not actually using, but it is performing reasonably well. I have only been running it for a couple days, but so far no false positives. Even if it does have a false positive, basal resume once the predictive threshold is no longer met. Its best catch so far is 20 minutes early, but we only had a few very mild lows.
diabeticgonewild
@diabeticgonewild
Feb 25 2015 22:37
That's awesome!