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

12th
Feb 2015
Darrell Wright
@beached
Feb 12 2015 00:08
Just offered an opportunity to go on a 5 day hike with a bunch of diabetics at Mt Assiniboine. Now to get the wife approval.
20-30km/day in the Rockies
Ross Naylor
@rnpenguin
Feb 12 2015 02:28
tbme53-2472.pdf
@beached
heard you can get some odd dynamics with that model
but good tho
Ben West
@bewest
Feb 12 2015 02:30
chiara dalla man
Ross Naylor
@rnpenguin
Feb 12 2015 02:30
basic model from back in the 90's you may like
jbe14-235.pdf
Ben West
@bewest
Feb 12 2015 02:31
is that the 4-stage thing?
4 stage gut
Ross Naylor
@rnpenguin
Feb 12 2015 02:34
4 stage gut?
Ben West
@bewest
Feb 12 2015 02:34
chiara dalla man has another paper
outlines how carbs ingested get absorbe
similar
Ross Naylor
@rnpenguin
Feb 12 2015 02:37
here all her publications
Darrell Wright
@beached
Feb 12 2015 05:00
ill give them a look over
thank you
Mikael Rinnetmäki
@mrinnetmaki
Feb 12 2015 08:58
@bewest @scottleibrand I think I might be able to justify and pay the 3k$ cost of FDA registration from our startup's budget, if it would get our name there and that would be all it takes. Would be valuable for us to tell our investors we've been part of a project passing FDA scrutiny. However, I don't think we'd be able to handle all the other costs and responsibilities the FDA process brings. Not ready to be the party responsible for everything, at this stage.
diabeticgonewild
@diabeticgonewild
Feb 12 2015 09:41
@beached , I got a copy of the article you wanted. Although it's from 2006, it's from University of Padova (aka as Padua) and you can't really go wrong with them. It has some calculus 1 and 2 (including indefinite integrals) and differential equations. I can give it to you this morning, if you want it. I will be in the hospital as outpatient today receiving my monthly intravenous immunoglobulin infusion for my rare autoimmune diseases, which will help me. I intend on bringing my laptop to the hospital this time.
You would likely want to use MATLAB, but I think Apache might have a math library in Java that is open source that can handle it. SciPy may be another option too.
Matthias Granberry
@mgranberry
Feb 12 2015 15:27
in the nightscout wip/iob-cob, where does the iobContrib come from? Is it just a piecewise curve fit to some model?
diabeticgonewild
@diabeticgonewild
Feb 12 2015 15:38
It is not a piece wise curve fit, which it may appear to you to be from the if-else statements. It is a 2nd order linear regression curve fit for short term IOB calculation. It was derived from something more complicated, I believe. I just took a look at the code
Well I guess it is piece wise as the equations change at 180 minutes and peak. But it's second order linear regression
Matthias Granberry
@mgranberry
Feb 12 2015 15:52
A System Model of Oral Glucose Absorption.pdf
@beached I had my wife grab a copy of your paper
diabeticgonewild
@diabeticgonewild
Feb 12 2015 15:53
I have a copy too. If you PM me your email I will send it your way.
nvm, it's already there. Nice, @mgranberry
diabeticgonewild
@diabeticgonewild
Feb 12 2015 16:28
Infusion started. Will be done in 4.5 hours. Also got tested for antibodies more specific for lupus. At least 1/3 of the way done with the modeling stuff mathematically. Have to do some reading on intrinsic Gaussian conditional auto regressive (CAR) stuff for the next steps with random walks (math concept), as I am trying to keep it all in MATLAB (WinBUGS does it automatically).
Sulka Haro
@sulkaharo
Feb 12 2015 18:31
Has someone seen papers that discuss the insulin management of alpha cell glycogen release combined with the carb intake and absorption time? The models I've seen seem to combine these without much consideration, while we're seeing there's a massive difference in how the BG behaves based on if the glycogen release happens or not.
If someone wants to test that, stuff yourself with a (near) zero carb salad. It should trigger the glycogen release and spike the sugars even though there's no carbs to intake.
Dana Lewis
@danamlewis
Feb 12 2015 18:34
Have you observed any difference for when there's been insulin activity in the last hour or so before the low carb meal; vs coming into the low carb meal with zero IA (like from overnight going into breakfast).
Using eating soon mode approach seems to solve that for me, regardless of whether the meal is low carb or normal carb. Wondering if anyone else has tried enough to see a similar result by focusing on getting IA going in time for meal regardless of carbs
diabeticgonewild
@diabeticgonewild
Feb 12 2015 18:37
I think with Hovorka (who has factored them all together), he uses random walks (a mathematical method/procedure) to approximate glucose excursions in the short term. From what I have read, the modelling on endogenous glucose production (which is based off of 6 healthy lean males doing an IVGTT in the 200s), could be better, but it is technically sufficient. More modelling is needed for meals and stuff though, ideally.
*2000s
Sulka Haro
@sulkaharo
Feb 12 2015 19:00
Prebolusing seems to reduce the likelihood of the spike but doesn't guarantee it won't happen.
Also if we ask the dude to continue eating after he says he's full, it increases the chance of the spike a lot. Apparently the gut and stomach stretching post meal triggers the release.
diabeticgonewild
@diabeticgonewild
Feb 12 2015 19:05
I don't worry about it much. Hovorka already modeled meals using triple tracer and double tracer (determined to be just as effective for the modelling purposes). I know that more modeling needs to be done. However, it's hard to go wrong with the work at Cambridge.
Dana Lewis
@danamlewis
Feb 12 2015 19:05
Pre bolusing based on carbs, though? Or prebolusing with a target lower bg to peak IA by the time he starts eating?
diabeticgonewild
@diabeticgonewild
Feb 12 2015 19:06
However, this is me being arrogant, but I know I found 2 mistakes in Hovorka's paper. The other mean values in a number set that are used in a paper are ln(mean), while the last 2 in the set are not, and when I corrected it I get the correct answers with my modeling.
I need to email the authors soon. Actually might as well right now since I am not doing anything right now.
Dana Lewis
@danamlewis
Feb 12 2015 19:07
Cool, let us know what they say?
Sulka Haro
@sulkaharo
Feb 12 2015 19:07
Prebolusing based on carbs, protein and fats. If the bolus is calculated taking the glycogen spike into account and it doesn't happen, Eero goes low. If we don't account for it and it does happen, he goes high and doesn't come down. Makes life more interesting. :)
We count a third of proteins and tenth of fats as carbs for the bolus.
Dana Lewis
@danamlewis
Feb 12 2015 19:09
Right. This is why for 12 years I didn't prebolus. Based on meal info, easy to end up w bad outcome. But, really hoping more ppl test early bolus based on bg in an hour. Gets IA going, handles any meal carb or no carb spike - but if you don't eat, still safe and doesn't cause low that can't be easily fixed.
Ben West
@bewest
Feb 12 2015 19:10
@danamlewis I mentioned your eating soon mode in dbmine (actually he published an email in as if it were an interview)
diabeticgonewild
@diabeticgonewild
Feb 12 2015 19:11
Yeah will do.
Dana Lewis
@danamlewis
Feb 12 2015 19:12
@bewest ya, saw that
Sulka Haro
@sulkaharo
Feb 12 2015 19:13
@dananlewis I'm slightly confused on what you mean - not prebolusing always results in a high, so unsure what your method is.
Dana Lewis
@danamlewis
Feb 12 2015 19:14
@sulkaharo - I try not to say "prebolus" because people think they know what it means based on what they do, which is usually 15 or so minute before and based on something about the makeup of the meal they're eating. I do something different, "eating soon mode". about an hour before a meal or whenever before I eat, I change my target range of BG from ~110 or whatever it is at that time down to 80. That usually gives me .5-1u of a correction bolus.
Ben West
@bewest
Feb 12 2015 19:15
correct to low end instead of presuming carbs
this sets up a descending trend just as carbs are hitting
Dana Lewis
@danamlewis
Feb 12 2015 19:16
And, that IA is usually kicking in by the time i eat 45min-1hr later. regardless of zero carb or carb meal, the IA starts working by the time any internal action and reaction to food starts working. So, IA is strong, and BGs stay flat instead of reacting
Ben West
@bewest
Feb 12 2015 19:16
which means the next dose you take will be a stacked dose
Dana Lewis
@danamlewis
Feb 12 2015 19:16
@bewest, yes sometimes, but more importantly the IA is going strong regardless of whether your BGs are descending. that's what's important.
Ben West
@bewest
Feb 12 2015 19:16
yeah, setting up the descending trend
but thats the beauty is that it sets up the right kind of trend, without having to dose for unknown carbs
it just creates that gentle nudge down to lower end of safe range
I used to think about it as appetizer mode
Dana Lewis
@danamlewis
Feb 12 2015 19:18
Well, I still think the IA inside versus seeing resulting BGs is what's important. I've seen several times where BGs haven't started dropping, but still makes a big difference in flattening BGs when I eat.
I don't want people to think they have to get their BG to 80 before eating a meal. That's not the point. the point is using that different lower (still safe, though) target to re-calc a correction bolus before a meal to get IA rolling by the time carbs start working 15 min after someone eats.
Ben West
@bewest
Feb 12 2015 19:19
ah, there's still a trend... if you had not eaten your bg would indeed decrease
you just didn't wait long enough to see it manifest
and it's not necessary to wait as you point out
that's not the point
Dana Lewis
@danamlewis
Feb 12 2015 19:20
Correct, there would be. my point is eating soon mode is effective from the IA standpoint regardless of what your bgs visualize. Yup.
Ben West
@bewest
Feb 12 2015 19:21
right, so I'm saying worse case, you don't get the carbs
Dana Lewis
@danamlewis
Feb 12 2015 19:21
Correct
Ben West
@bewest
Feb 12 2015 19:21
hypothetically you will just end up at border line low which should be relatively easy to undo/correct
and you should be able to expect, reproduce it with pretty good results
Dana Lewis
@danamlewis
Feb 12 2015 19:22
@sulkaharo does this make more sense now?
Sulka Haro
@sulkaharo
Feb 12 2015 19:29
Ah yes. We usually aim for a bolus 30 minutes before the meal, sometimes more, depending on the curve shape, so the IA and meal coincides nicely. I guess the big difference between what you and us are doing is, we're dealing with a 4 year old, which means extremely rapid BG changes when shit hits the fan, which is often unpredictable. We're seeing downward and upward curves that go more than 25 mg/dl / CGM measurement pretty regularly if we're on not on the well balanced profile which is about one week out of four. The growth basically means the insulin profile needs recalculation every 2-3 weeks. One of my wishes on the tech here is that eventually it'll be able to suggest changes to the profile.
Dana Lewis
@danamlewis
Feb 12 2015 19:30
No kidding! Speaking of though, are you using wip/iob-cob and looking at the retrospective predictions regularly? Wondering if that helps (if you watch carefully) better get an idea of when to change the profiles. Would love to hear your feedback on that & recommendations for when you decide it's time to change.
diabeticgonewild
@diabeticgonewild
Feb 12 2015 19:33
This is what I am about to send
Subject: Errors in Stochastic Virtual Population of Subjects With Type 1 Diabetes for the Assessment of Closed-Loop Glucose Controllers
Sulka Haro
@sulkaharo
Feb 12 2015 19:33
We're on iob-cob and I think it's got bugs related to mmol calculation. :) We pretty often see it predicting a rapid drop to 0 post-meal. It looks like it basically assumes the spike will happen and when it doesn't, the prediction goes wrong.
diabeticgonewild
@diabeticgonewild
Feb 12 2015 19:33

To whom it may concern:

I am an undergraduate electrical engineering student modeling your artificial pancreas models for educational purposes and I discovered errors on page 3527, where the final two values of P bar are incorrect. I noticed that all of data except for the last two values in P bar, which came from the mean values of the respective variables in Partitioning glucose distribution/transport, disposal, and endogenous production during IVGTT, were the natural logarithm of the mean value.

I believe that the final two values should be ln(9.7), which is 2.72, for F_01, and EGP_0 - F_01, should be ln(6.4), which is 1.856. If you could please correct this error, it would be appreciated.

Sincerely,

Sulka Haro
@sulkaharo
Feb 12 2015 19:35
The guy was at home for a full week on flu a couple weeks ago and we managed to get the CGM IVG average to 6.5 mmol/l (HbA1c of 5.7%) with no hypos. Go back to daycare and their meals blew the profile up again.
Ben West
@bewest
Feb 12 2015 19:35
looks good, I always prefer Howdy. you might add that you've been working through the research and may have found an error
Chris Oattes
@cjo20
Feb 12 2015 19:35
I'd suggest "I discovered what looks to me like an inconsistency" or "I discovered a potential error"
and "Your opinions on this would be appreciated" rather than asking them to correct the error
Ben West
@bewest
Feb 12 2015 19:36
right, ask if they can confirm
diabeticgonewild
@diabeticgonewild
Feb 12 2015 19:36
ok, got it
Scott Leibrand
@scottleibrand
Feb 12 2015 19:36
Monica: I would change the tone a bit to be less certain it's their error that they need correcting. Ya, what they said.
Dana Lewis
@danamlewis
Feb 12 2015 19:36
@sulkaharo hmm, interesting. Ok. Well, once that gets sorted that would be interesting to see how you end up using it. I've used it to see when I need "resistance mode" for 12-24 hours, but given kids growing (every few weeks changing profiles, yikes!), wonder how we can better automate/flag when it varies a lot over a period of time..
diabeticgonewild
@diabeticgonewild
Feb 12 2015 19:36
Will do
Chris Oattes
@cjo20
Feb 12 2015 19:37
"the final two values of P bar seem inconsistent"
Ben West
@bewest
Feb 12 2015 19:37
perfect for a gist, I always draft these types of things on gist
diabeticgonewild
@diabeticgonewild
Feb 12 2015 19:37
sorry, I forgot about that
Ben West
@bewest
Feb 12 2015 19:38
np, was nice and short, that's always good; I think if you make it clear you've been engaging with their research and have an intelligent question (like what do you think of this posssible error and this possible fix) they are going to be delighted to respond
Sulka Haro
@sulkaharo
Feb 12 2015 19:38
@diabeticgonewild Yup, I'd recommend confirming if you've found an error AND if not, them teaching you where you went wrong. Always give people a graceful way out of potentially embarrassing situations.
diabeticgonewild
@diabeticgonewild
Feb 12 2015 19:39
OK, got it. I do try to be mindful, but there is a reason why I put a copy of what I was about to send in front of another set of eyes!
I changed it per your suggestions. If you want to read it, it's here. I just replaced errors with inconsistencies and removed the last sentence and replaced it with "Your input is appreciated"
about to send
sent
Sulka Haro
@sulkaharo
Feb 12 2015 19:50
Also, i
diabeticgonewild
@diabeticgonewild
Feb 12 2015 19:52
They bumped up my infusion faster, so I am going to be done in 15 minutes. I am relieved.
Darrell Wright
@beached
Feb 12 2015 20:03
I think there might be good potential for getting the data from the food tracking apps and integrating that into a carb curve database. Seeing as with the CoB/IoB/IsF stuff you are doing an operation that looks kind of like a Fourier transform I wonder how much data one would need to be able to have a food database and estimate the delivery and timeing of insulin for a meal
diabeticgonewild
@diabeticgonewild
Feb 12 2015 20:05
yeah, it does look kind of like a Fourier transform (pronounced 4-E-A). I would agree with that. Hovorka's newest models account for a distribution based on all theoretical amounts of CHO consumed.
like a joint posterior distribution of your information
Dana Lewis
@danamlewis
Feb 12 2015 20:05
Tidepool's working on some tools that would allow you to log a meal & what you did, so theoretically if you went back you could see what you did & if it worked. (I never remember the name of which tool is which from them). But ya, love the idea of inputting the carbs and based on your IOB history and all other factors, visualizing the ideal delivery with staggered boluses, and if you end up missing one (like a half unit down the line because you're distracted), it updates and catches up and of course adjusts given your changing BGs…::dreams:: #DIYPS does the recommendations and tracking, but don't have it visualized so you can see from start to end what you'll likely end up doing.
Darrell Wright
@beached
Feb 12 2015 20:06
why keep it at one person though. people are less different than they like to think
diabeticgonewild
@diabeticgonewild
Feb 12 2015 20:07
I think I can get some of the visualization down. Like when insulin does not account to fluxes in blood glucose and instead drifts only.
with the modeling I am doing. But it's MATLAB only. It has to be MATLAB only due to the complexity.
Dana Lewis
@danamlewis
Feb 12 2015 20:07
Right. the variance is ISF, I:C, and carb absorption rate. so, based on people's factors it'll visualize similarly, but might use the same carb input from the same meal
Darrell Wright
@beached
Feb 12 2015 20:08
if it is a learning like algorithm, the initial weights could be based off a population then use personal experience to enhance it
Ben West
@bewest
Feb 12 2015 20:08
n=1 is a political tactic to avoid hitting "did you illegally distribute a medical device?" trigger
Darrell Wright
@beached
Feb 12 2015 20:09
gotcha, im ignorant of Canadian laws all togethor on this too
Ben West
@bewest
Feb 12 2015 20:10
canadian laws are better in this regard
for one thing, in canada, apparently it's illegal to say that your device gives therapy
devices don't give therapy, people give therapy ;-)
I like that quite a lot
in the US we're allowed to claim devices give therapy
so this changes the risk assessment entirely
Darrell Wright
@beached
Feb 12 2015 20:20

My interest is less the online part but the offline, not that they negate each other, determination of them and the trending. One chart I make is an aggregate basal test day by excluding periods with the influence of bolus, carb, exercise, temp basal and then charting the rate of change. Night times are easy to get too.

So I think this is what Medtronic has done with their reporting. The CDE's get suggestions from the software but the clients do not because they are licensed and using their judgement

diabeticgonewild
@diabeticgonewild
Feb 12 2015 20:21
Interesting @beached
Darrell Wright
@beached
Feb 12 2015 20:25
Without decent basal the other numbers are meaningless and using a single basal test allows for outlier's to mean too much. So sleep times are generally a given and easy to collect data for. Those are also the times when bad basal bites the most.
diabeticgonewild
@diabeticgonewild
Feb 12 2015 20:26
Agreed
Sulka Haro
@sulkaharo
Feb 12 2015 20:44
@beached based on having talked with quite a few diabetics, it seems to me that people can be split to two groups based on how likely it is that they get a high postprandial spike. Lots of people say managing the BG is pretty easy with meals and they don't get horrible spikes, likewise a lot of people say they're very sensitive to spiking and need to bolus very carefully. Given T1 is actually multiple diseases, I wouldn't be surprised that some forms of T1 have more aggressive alpha cell glycogen release and some don't do it, resulting in much more easily managed spikes.
diabeticgonewild
@diabeticgonewild
Feb 12 2015 20:45
You mean phenotypes or subsets or something
Sulka Haro
@sulkaharo
Feb 12 2015 20:45
So while I agree people are the same, remember T1 is a group of diseases, where the effects on the glucose metabolism can be pretty dramatically different based on what you have and how your body works in the first place
Chris Oattes
@cjo20
Feb 12 2015 20:46
Sometimes I stay completely flat after meals, other times I hit 15 (270)
Ben West
@bewest
Feb 12 2015 20:47
illness vs disease
Chris Oattes
@cjo20
Feb 12 2015 20:51
I'm having a "spike to 15" day today
Sulka Haro
@sulkaharo
Feb 12 2015 20:52
@cjo20 it's likely that's your alpha cells playing a joke on you. What happens is, when you eat, the beta cells release insulin and amylin to deal with the incoming glucose, but the insulin acts too fast for the absorption to happen, so alpha cells release glycogen to temporarily boost BG before the carbs do their magic. The amount of glycogen released is controlled on non-T1s by amylin and the fact that insulin is secreted right next to the alpha cells so their exposure to insulin is 100x that of other tissue, while for T1s amylin is missing altogether and the insulin concentration is much lower as it's injected subcutaneously, resulting in the glycogen release being much higher than necessary. To make thing easy, whether the release happens or not depends on various factors, like the amount of carbs eaten and how full you eat your stomach (where eating so much you stretch your small intestine increases the chances a lot).
@cjo20 Amylin's another role is to slow down the stomach emptying speed. Given no amylin, there's multiple things that cause the spike for T1s - lack on insulin to control the glycogen release and allowing the cells to capture glucose, lack of amylin to control glycogen and slow down stomach emptying (causing faster absorption).
@diabeticgonewild subtypes. there's probably better papers online, but this is pretty good: http://adc.bmj.com/content/89/12/1138.full.pdf
Sulka Haro
@sulkaharo
Feb 12 2015 20:57
@bewest apologies if I'm using wrong terms! Not native speaker, so sometimes at loss on the connotations on words I'd consider synonyms.
Darrell Wright
@beached
Feb 12 2015 21:00
There is also a huge variability in the ability to monitor and control. BG and Insulin levels going into a meal impact the postprandial rise.
Matthias Granberry
@mgranberry
Feb 12 2015 21:05
@beached what do you mean by "variability in the ability to monitor and control?"
Chris Oattes
@cjo20
Feb 12 2015 21:07
@sulkaharo thanks, bookmarked
@sulkaharo at diagnosis I was tested for antibodies, I think I had 0 of everything apart from GAD
Darrell Wright
@beached
Feb 12 2015 21:12

Not all diabetics have CGM's or pumps as a start, most do not. That limits the ability to monitor and control. Also, from my conversations with my CDE it is the norm for patients to wait for their appointments and not make changes themselves outside of something like sick day management which has to be spelled out.

So with that, I think it would be hard to say why one is spiking after a meal.

Chris Oattes
@cjo20
Feb 12 2015 21:13
Which I think was 17 (of whatever unit it was), with a reference range of <1
Sulka Haro
@sulkaharo
Feb 12 2015 21:17
@cjo20 our dude was diagnosed around two years ago and is still testing negative on every T1 marker they've looked at. Insulin use also below the WHO subtype diagnosis threshold of 0.5 units / kg / day, so I think I'll ask for the subtype diagnosis when we see the endo the next time.
Chris Oattes
@cjo20
Feb 12 2015 21:18
I was on almost no insulin for quite a long time
I'm still on less than that
definitely below 0.5u/kg/day
Matthias Granberry
@mgranberry
Feb 12 2015 21:32
@sulkaharo I am GAD and ICA negative, but also nearly completely c-peptide negative after 23 years. Same with little brother and my uncle. Right around .5 u/kg/day for me, less for them, but I sit in a chair for a living. I get a lot of "you aren't like most patients," but I've never been able to get a clear subtype diagnosis
Sulka Haro
@sulkaharo
Feb 12 2015 21:37
I get a lot of "the endo doesn't really know what's going on". :P We're at an average of 0.38 units / kg / day right now. Would be much higher doses if we'd followed the "just eat as normal an inject more insulin if needed" routine most caretakers seem to be recommending.
diabeticgonewild
@diabeticgonewild
Feb 12 2015 22:08
They think the very rare autoimmune disease I have caused my diabetes.
Dana Lewis
@danamlewis
Feb 12 2015 22:08
My car uses less fuel than all of ya'lls does :)
diabeticgonewild
@diabeticgonewild
Feb 12 2015 22:12
Like I have autoimmune autonomic neuropathy, and like it affects the islet cells, because the islet cells are innervated by the autonomic nervous system. Like I have an antibody that binds on cation channels of the nerve cells of the autonomic ganglia and it blocks signal transmission, including to the islet cells, and they think it led to diabetes-related autoimmunity.
It's called autoimmune autonomic ganglionopathy. Also my blood sugar is low so hopefully that is coherent.
The disease showed up subtly around the time when I was diagnosed too.
I have an antibody against this. http://en.wikipedia.org/wiki/Ganglion_type_nicotinic_receptor
It's called the ganglionic nicotinic acetylcholine receptor antibody. There's like one legit lab that tests for it in the country. The Mayo Clinic Labs.
Chris Oattes
@cjo20
Feb 12 2015 22:31
I've got a permanently swollen cheek due to something making my parotid swell. No idea what though
diabeticgonewild
@diabeticgonewild
Feb 12 2015 22:33
that sucks!
Chris Oattes
@cjo20
Feb 12 2015 22:35
Didn't notice it until I was 18. No idea how noone saw it before then. It's really obvious in photos from when I was 5 or 6