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

16th
Jun 2015
diabeticgonewild
@diabeticgonewild
Jun 16 2015 01:37
Working on uploading a new and updated image...
diabeticgonewild
@diabeticgonewild
Jun 16 2015 01:55
Nooo! Dropped my iPhone on a tile floor and damaged the screen protector made out of gorilla glass that is 0.55 mm thick. Fortunately it did not damage the actual iPhone screen. The screen protector is legit and it's like using a bare screen. But it saved my iPhone (which has accidental damage protection. Good screen protector. Can't believe my phone is completely undamaged http://m.imgur.com/vtElm2s
Ben West
@bewest
Jun 16 2015 02:44
ok, I just did a round of updates on openaps and decocare
now the master branches match, and will probably match going forward
but also, it shouldn't matter
diabeticgonewild
@diabeticgonewild
Jun 16 2015 02:45
Guess I need to update the image! :D
Ben West
@bewest
Jun 16 2015 02:45
nah, just running this should update evverything:
sudo easy_install -Z openaps
that's it, should update
diabeticgonewild
@diabeticgonewild
Jun 16 2015 02:46
Well I guess whoever is using it can update it
Ben West
@bewest
Jun 16 2015 02:46
should help make updating the image faster, don't need to redo everything
diabeticgonewild
@diabeticgonewild
Jun 16 2015 02:47
No all I was going to do was put the current image back in my Pi, update OpenAPS, make a copy of the image, and reupload it...
Here's the current image that doesn't have your update, but is corrected for everyone using it otherwise: https://www.dropbox.com/s/jqogqet8gf7uo6z/OpenAPS_Final.img?dl=0
Going to make a readme on it, but it's the same settings as before...
I wanted to do a "clean install" because I messed up the previous version with respect to loading packages...I am aware that I don't have to redo everything.
@ bewest :point_up: June 14 2015 7:33 PM Did you see this? Another package that you didn't mention in your ReadMe/PyPi install directions is missing.
Would/Could you please include it?
Ben West
@bewest
Jun 16 2015 03:49
just python-dev?
diabeticgonewild
@diabeticgonewild
Jun 16 2015 09:44
yeah
Not having a good morning....I woke up HI (as in above 500 mg/dL) cause of the steroids they gave me yesterday. They gave me a ton cause I kept on itching from the medicine as it's an adverse reaction, and warned me that my BGs would probably be really high even today...
diabeticgonewild
@diabeticgonewild
Jun 16 2015 10:16
@bewest But yeah, it's just python-dev. That's the only install error that I got when installing OpenAPS via PyPi after following your instructions. I then did sudo apt-get install python-dev and reinstalled OpenAPS via easy_install or whatever.
diabeticgonewild
@diabeticgonewild
Jun 16 2015 10:23
Took like 20 units of insulin and still HI ( > 500 mg/dL). No significant BG drop yet. Should put on a sensor as soon as possible. Also rain from tropical storm Bill is coming in here in Houston.
diabeticgonewild
@diabeticgonewild
Jun 16 2015 10:44
Woohoo! 403 mg/dL
diabeticgonewild
@diabeticgonewild
Jun 16 2015 11:59
343 mg/dL...going to give myself like 12 units...
diabeticgonewild
@diabeticgonewild
Jun 16 2015 14:57
I have an idea for visualizing the actual IOB curve that has taken place on like a bolus scaled to mg/dL or mmol/L (units) based on Care Portal stats like ISF. However, it will be helpful to be able to have basal rates in Care Portal to get a full glimpse of what's going on outside of the boluses. So, in addition to learning JavaScript, I have a lot of work to do...
It involves integrals and creating a cubic spline representing the actual BG activity from the CGM in polynomial equation form...
Lori
@LoriLori
Jun 16 2015 15:08
Screenshot_2015-06-15-17-55-36s.png
diabeticgonewild
@diabeticgonewild
Jun 16 2015 15:08
But there are so many possibilities for visualization based off of this idea, and I have to do it. For everyone's sake, including mine. This includes completing IOB curves for Novolog, Humalog, Apidra, and the pumps I have, with +/- 5%, 10%, 15%, and 20% error (differences in insulin activity). This can also be used to quantitatively evaluate IOB, ISF, and DIA. Thanks to @mgranberry , I know I need to do a cubic spline on the pump IOB equations (and "recreate" the original equations, even though they are not wrong) so I can get a nice derivative and do the error and differences and so people can use the derivative in general. So many possibilities. :D
Lori
@LoriLori
Jun 16 2015 15:08
did a little with I activity, but not in JS
diabeticgonewild
@diabeticgonewild
Jun 16 2015 15:08
That's awesome @LorelaiL
Fokko Driesprong
@Fokko
Jun 16 2015 15:09
If you have any concrete ideas, just share them, I am able to implement them on (D3)JS
diabeticgonewild
@diabeticgonewild
Jun 16 2015 15:10
But yeah I can "go wild" with this idea. Definitely can get some awesome visualizations all on the same scale used for Nightscout, in mg/dL or mmol/L, so it will be intuitive
I will do a write up @Fokko
Lori
@LoriLori
Jun 16 2015 15:17
above compares dex data change in BG and calculated/expected I action BG change
I was curious, do you experience different ISF and peak for morning and evening?
diabeticgonewild
@diabeticgonewild
Jun 16 2015 15:23
Yeah you could technically use IOB % remaining times ISF and bolus dose to represent it graphically on the Nightscout interface and scale I think
I have to test out the idea
That particular idea isn't concrete
diabeticgonewild
@diabeticgonewild
Jun 16 2015 15:36
IOB, technically is the integral of the glucose infusion rate graphs represented as a cubic hermetian spline, which are in mg/dL/min, which obviously are integrated and the units are mg/dL. To get % IOB remaining it's ([1-(integral from t=0 to t=0:1:(DIA60 minutes) of the function in mg/dL)/(integral from t=0 to t=(DIA60 minutes) of the function in mg/dL)]*100) to get DIA you take the confidence intervals at 5% of when the insulin "kicks in" also you have to subtract the basal insulin of the healthy volunteers in the glucose infusion rate graphs...it's not as complicated as it sounds.
It's supposed to be DIA times 60 minutes but I can't edit this as I am on my phone
diabeticgonewild
@diabeticgonewild
Jun 16 2015 15:42
And the 0:1:DIA times 60 minutes means that you basically calculate the % IOB remaining at 1 minute intervals stating at 0 minutes to the end of the DIA represented in minutes, given the basal insulin was subtracted from the glucose infusion rate graph and the confidence interval of 5% was accounted for, for when the insulin "kicks in". So basically you have to scale everything, after the confidence intervals are accounted for. It's complicated but when I do it Based on a glucose infusion rate graph have been able to replicate very similar curves compared to the pumps I have interpolated data from
diabeticgonewild
@diabeticgonewild
Jun 16 2015 15:48
It's not as complicated as it sounds. You just have to know your math and like understand numerical methods/analysis and apply it properly.
Understanding calculus helps a lot
Fokko Driesprong
@Fokko
Jun 16 2015 15:51
Calculus is a valuable tool. For me it is not entirely clear how insulin behaves. I would say it has a half-time like caffeine or so.
diabeticgonewild
@diabeticgonewild
Jun 16 2015 15:52
Yeah so you could do ISF times bolus dose to figure out the area under the curve (integral or total displacement due to BG excursion) and you could use the % IOB function (with some basic modifications) and "fit the displacement" to the % IOB function
Of course since it's a % function units don't completely match so I have some work to do but logically it works and can be used since it is all related to mg/dL and is represented as a percentage (which actually is advantageous)
diabeticgonewild
@diabeticgonewild
Jun 16 2015 15:59
It's a matter of finding the relationship between things, particularly paying attention to units, and applying that knowledge. I have to find a way to match the displacement (integral of whatever the BG excursion from like a meal insulin dose or a correction dose from when it's delivered as a function in mg/dL or mmol/L) to the % IOB remaining function through curve fitting (or at least I think...in JavaScript)
There are other factors like renal clearance from glucose dumping from high BGs but I'm not concerned about that right now. I have a basic problem that can be solved tangibly
diabeticgonewild
@diabeticgonewild
Jun 16 2015 16:22
Actually easy peasy. I can represent the excursion in BG from a bolus as a polynomial function through curve fitting in JavaScript and do that integral to recreate a % remaining IOB function for the graph on NightScout and using Care Portal data using a cubic hermetian spline. I then have to find a way to relate it all in mg/dL properly but that shouldn't be hard given I have Nightscout data and Care Portal data plus the functions I had created. Actually using D3.js we could "fill in" the mg/dL graph in Nightscout to represent the displacement in blood glucose, and using the rate of change data as a function and integrating it from t=0 at initial bolus time to t=time elapsed, you can find the total displacement of BG versus the value of the displacement according to ISF time bolus dose for example. This can be used to find out % remaining insulin activity and insulin activity left and some other things that I am still brainstorming (I'm sure I got that right conceptually! How exciting!) However, I still haven't figured out yet what to do with the % IOB function created from Nightscout data AND the IOB function that was created either from pump data or a glucose infusion rate graph of insulin like Apidra, Novolog, or Humalog. I think taking the derivative of that function may get something useful though by using some logic but I have to test it out.
But yeah, my brain is working well today. Don't feel that great but my immune system probably can't go wild cause i got a massive dose of steroids. Hence feeling better and more energy.
diabeticgonewild
@diabeticgonewild
Jun 16 2015 16:31
I'm going to do a write up. I'm not going to flood this chat anymore. Got some more idea.
diabeticgonewild
@diabeticgonewild
Jun 16 2015 16:39
Yeah so this is useful for the IOB function. https://en.wikipedia.org/wiki/Elasticity_of_a_function
But yeah, about to do a writeup and test a bunch of stuff in MATLAB
Ben West
@bewest
Jun 16 2015 19:13
for processing the json files to extract only the info you want, you might look at re-using/patching something like this https://github.com/loudnate/openaps-mmhistorytools/blob/master/openapscontrib/mmhistorytools/historytools.py
diabeticgonewild
@diabeticgonewild
Jun 16 2015 19:14
Awesome! :D
Ian
@ianjorgensen
Jun 16 2015 21:08
@bewest ping
Ben West
@bewest
Jun 16 2015 21:25
howdy @ianjorgensen
I just implemented an openaps alias feature
this will allow logically re-assigning lots of openaps invoke report to a single openaps get command
diabeticgonewild
@diabeticgonewild
Jun 16 2015 21:26
good, cause that caused confusion, LOL
no offense
Ian
@ianjorgensen
Jun 16 2015 22:19
@bewest can we chat for a bit, just talked to toby and geof
Ben West
@bewest
Jun 16 2015 22:22
sure