-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
High predictions: graph and notifications #441
base: master
Are you sure you want to change the base?
Conversation
As a new function it would be comfortable |
So the reason I didn't implement high prediction originally is that basically in this house it would be going off all the time and because of the delay with insulin action it is pretty normal for blood sugar to rise sharply giving a steep curve that would likely set off a prediction alert even if no action would be necessary. The treatment options are very different for low-prediction where carbs act much more quickly and its easier to predict accurately. I can see it might be useful for people who don't normally exceed the "high" thresholds for example on low carb diets and perhaps where treatment insulin doses are known like with pump integration. But even then it has the potential to encourage over-treatment. For example a late bolus for a carb heavy meal would set off an alert but administering any more insulin would result in a low unless additional carbs are taken. I'm wary of introducing anything which is going to make the settings too complex for a limited advantage but I also recognize that everyone's treatment regime is likely to be different and it might be more useful to others than I can imagine. I'm not against this idea but I'm not 100% sold on it either at the moment. I think I'd like to know how you find it performs operationally and what others think about the usefulness of having this. |
A predicted high alert would help remind me to bolus for a meal/drink. I'm often at an event and begin snaking on some pretty high glycemic index foods, engaged in conversation, completely forgetting my condition. (A condition I've had for over 35 years now and, like the rest of us, pretty f'ing sick of it.) It would be very nice to have a predicted high warning to remind me of my condition as early as possible, especially if I haven't recently logged a bolus that is anywhere close to dealing with the prediction. Bury the setting for it and toss up an "Are you sure, you know you'll risk taking too much insulin yada yada yada..." warning for those that choose to enable it if you must. But for people like me, it'll help. |
Hello! Request from Russia: Please, please make Russian in your assemblies, this is very important and necessary! |
There are situations where I also would benefit from an alarm for a high blood glucose prediction. Perhaps make the option only available in engineering mode, or create the option for a very short/unobtrusive alarm that only goes off one time so as to save on alarm fatigue for those people who often have high blood sugars. I feel the benefit would be to give enough advanced warning so the the user could then take more insulin before the bg gets high enough that large amounts of insulin are required to bring it back down - which can then start an hours-long yo-yo effect. Making that the user will have the tendency to over correct four the high bg, resulting in low bg, which the user then has the tendency to over correct again... 😉 |
Its also extremely useful for people on extremely fast insulin such as fiasp or inhaled insulins. Often if im going high its because of a mistake and its quite easy to arrest the high before it gets there with fiasp once youre used to it and have your pump dialed in well. Right now it depends on me looking at my phone at the right time to pull it off, but a predictive alert would make it easier to do successfully. The time based nature of xdrip alerts make this a very powerful option. You can have it off for times where youre commonly risking insulin stacking like at meal times. Come to think of it, the existing high alert has risk of causing double stacking so i dont see this as much more of a problem if people understand their own insulin activity curve. |
My use case is a little different. I have not been diagnosed with diabetes, but I have significant problems with low blood sugars. However, I want to receive alerts predicting high blood sugar because I like to do my workouts when I am near a high so that I actually have the energy to be productive. It really should be under the normal alarm settings so that it can be controlled on a schedule with options for whether or not to make a sound. |
Closes #432 |
@jwoglom I have a question, which is going to show how little I know about this. But, that's why I would like to ask. Does momentum only perform a numerical analysis solely based on existing data points? |
@jwoglom Please can you fix the merge conflicts? |
@tolot27 I've fixed the obvious merge conflicts from the GitHub UI. Let me know if you notice any other issues -- this PR is pretty old, thankfully it looks like not much code in these files has changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor change and my repeating and annoying request to apply code formatting at least for the code part you have contributed. 😏
app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/BgGraphBuilder.java
Outdated
Show resolved
Hide resolved
There is an open PR for lowering the FUZZER: The main concern about it is the impact of changing the FUZZER value on the predicted low alert. Is this alert also dependent on the FUZZER value? |
@tolot27 tried to code format a bit, I think recommending an autoformatter in the developer docs and enforcing a linter on any changed code might be a nice to have for the future, so that these minor code formatting things can get fixed automatically FYI I haven't tested a compiled apk with this code in it yet, but later this week I hope to have time to test it out on my secondary device |
app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/BgGraphBuilder.java
Show resolved
Hide resolved
I'm currently testing this PR and will report back any anomalies. |
I've been testing this for about a day now, and I think the feature could use some refinement. xDrip seems to be warning me of highs on the home page in situations where I don't think it should be happening. The "High predicted in: .." text on the home screen doesn't seem to go away when the trend drops back down below a level which would trigger the high prediction. Also, the lookback interval (how far back xDrip looks to try and find a linear trend) and the time before we alert (how long until the linear prediction will hit the high interval) should be configurable, I think, or at least set lower. e.g., over the last 30 minutes my BG incrementally went up from 78 mg/dl to 127, and the high prediction alert kicked in with a notification for "High predicted in 19 mins". Doing some napkin math, I was at a trend of +1.63 mg/dl/min over the entire 30 minutes, with a maximum delta peak of +2.6 mg/dl/min between two readings (from 86/dl to 99).
At 1:41pm I received a "High predicted in 19 mins" notification. I'm not incredibly familiar with the math that xDrip uses for low predictions but whatever's happening here looks totally wrong to me. Something must be messed up with the math. |
Observation: There are concerns about the concept/idea of this alert and its existence as an alert. The following is from a facebook group post: I was in favor of adding a forecast high alert, since we had a forecast low, until I read that post. It made sense. Concern: If I understand the forecast low alert behavior correctly, it is only an extrapolation, not a simulation. It completely ignores insulin on board or carbs taken. If predicted high is the same, it can be extremely dangerous predicting a high, which is never going to happen because of insulin that has already been taken but not taken into account for the prediction. Someone may assume the alert takes the insulin on board into account and go ahead and take more insulin. Question: Are treatments (insulin and carbs) taken into account for this high prediction alert? |
@jwoglom Are you planning to work on this PR again? What do you think about Navids comments? |
@jwoglom Do you have any suggestion for a linter tool or can you provide a PR to address linting and developer docs? |
@tolot27 sorry for the delayed response. I haven't had time to re-set up my xDrip testing environment recently and given both the bugs in the current implementation and some concerns as to improper use, I might end up rewriting this from scratch whenever I have the time, and try to build this in a way that will be more useful for end-users. |
As for linting, perhaps we could set up a GitHub Action to run on pull request changes which suggests formatting fixes. I haven't tried it personally, but https://github.com/marketplace/actions/checkstyle-for-java might work for this |
I would like to propose spotless as code linter, it have following advantages over actions/checkstyle-for-java:
It could be something like this |
This is something that I can benefit from. But, my worry is how this is going to affect many others who are not understanding the details. Can we do anything to address this concern? |
I suggest an option that is off by default under an advanced settings with
strong warnings?
…On Tue., Jun. 20, 2023, 18:26 Navid, ***@***.***> wrote:
This is something that I can benefit from.
I don't take my entire dinner insulin in one shot. I take half of it
first. And then, half an hour or 45 minutes after, I take the remaining
half.
And, I have forgotten the second half. This would act as a reminder for me.
But, my worry is how this is going to affect many others who are not
understanding the details.
As an example, there are many who have no idea that the existing forecast
low alert completely ignores IOB and COB.
Can you imagine the disaster if someone thinks that the forecast high
alert takes into account the IOB?
That's my main reason for not having pursued this.
Can we do anything to address this concern?
—
Reply to this email directly, view it on GitHub
<#441 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMZQGQ7ONF74AZNAPGQTIDXMIWTPANCNFSM4FAIJTDQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Uses the same algorithm as low predictions to enable high predictions, both with a red prediction line on the graph and notification options. The prediction algorithm can be sort of overly aggressive if the lookahead time is too high, so some fine-tuning can probably be done to make high predictions better -- maybe a higher highMark set by the user instead of the system-wide one so that this can better catch more gradual highs that wouldn't be picked up by "increasing fast" check?