-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a setting to limit maximum Insulin on Board #707
Conversation
This is useful to prevent multiple bolus' to create accidentally very high insulin on board values. It is primarly a safety feature, e.g. if someone enters too many carbs by using multiple apps.
Added validation to Bolus dialog as well (similar to the MaxBolus feature). Also updated to latest dev. |
@ps2 what do you think about this? In my opinion it is a rather fundamental safety feature protecting against all kinds of algorithm and user errors. What is missing to get this merged? Thanks. |
The algorithm does not give any more insulin than the forecast components call for. We do not want to artificially hamper treatment, nor do we want to put the burden of managing yet another setting on the user. If there are specific situations that you’re concerned about, I’m happy to discus. Perhaps there are ways to mitigate those situations without the negatives listed above. |
There is a few cases where I think the current maxBolus setting is inadequate. If you are worried with too many settings, we could also replace that setting as this is a superset of that functionality.
|
All of those items are already addressed in various ways.
|
In summary I still think it isan easy win to prevent against a whole class of possible corner and failure cases. |
I won't argue those points; they're representing valid concerns. But I feel that this kind of solution a) does not work much the time, even as a fail-safe (a much lower level of IOB is dangerous if you have no carbs on board and bg is low, for instance), and b) presents a confusing burden on users in determining how high to set it. The issues above are best addressed by focusing on the individual problem directly. And in particular, wrt to code review, you are certainly welcome to help with that. :) |
This is useful to prevent multiple bolus' to create accidentally very high insulin on board values. It is primarily a safety feature, e.g. if someone enters too many carbs by using multiple apps.
For Bolus the intention is to limit the Bolus amount: "iob + bolus <= max"
For Basal the amount will also be limited by the same logic and is intentionally kept simple. It does not take iob decay over the basal interval into account. It will also not low temp if the IOB higher than the limit. If that's useful it would be pretty easy to do as well, but the goal of this patch is to prevent such a situation from happening in the first place.
Code wise, the limiting of the units could also be done in the insulinCorrection function. It's a bit less obvious in my opinion what happens in that case, but we wouldn't duplicate functionality in two places.