NightscoutFoundation / xDrip

Nightscout version of xDrip+
https://jamorham.github.io/#xdrip-plus
GNU General Public License v3.0
1.39k stars 1.14k forks source link

Feature Request: Improved Treatment dialog with Bolus calculator, events and bolus types #833

Open xannasavin opened 5 years ago

xannasavin commented 5 years ago

So my request has several parts, some already covered also in other requests.

Nightscout offers a pretty nice bolus wizard (boluscalc), where you can enter your carbs and based on active insulin, bg, momentum and insulin/carbs ratio it calculates how much insulin you should give for this. It would be awesome if the treatment dialog would also feature such thing.

Moreover, the treatment dialog could be a bit improved. New 'Add Treatment' Dialog #112 already took a good step into that direction. It would be helpfull to

It would be also great to have the possibility to enter instead of carbs the in Germany used "Broteinheiten" (1BE = 12 carbs) to make it a bit easier. Shouldn't be a very big deal, since this only would affect the treatment dialog, all the other points, display and calculations could still rely on carbs.

Having the options to set events like "changing catheter", "sport" and others that are also able to be displayed in nightscout would be a plus.

And last but not least, as also stated in Extended Bolus #152 / Multi-wave Bolus options #429 it would be great to enter if the bolus is a split bolus or is given over a certain time, e.g. 5 units over the next 3hrs.

I know those are quite a lot of requests in one, but maybe some others might find it usefull too :)

doc77 commented 5 years ago

The treatment dialogue does have a timepicker. It is the watch face icon.

Carbs and insulin can be entered simultaneously, carbs under the knife and fork icon and insulin under the syringe icon.

If you simply look at the top of the home page screen, you will see the bolus calculator, the correction bolus calculator, and the carb correction calculator.

You can add a note from the treatment applet by tapping the microphone icon and speaking the note.

According to @jamorham the treatment dialogue is a simple calculator to enter treatment, not a full blown diabetes app to take into account everyone's individual protocols. There is elegance in it's simplicity and ease of use. With complexity comes confusion.

xannasavin commented 5 years ago

Hi @doc77, thanks for your reply. You are not really into ux, are you? :D Yes I know there are several - let's call it "tabs" - to enter treatments. But there is absolutely no need to split this into several views. E.g. it happens very often that I want to enter carbs but the unit screen is still preselected an I need to undo and redo the Submission.

Also there is no need for the numberpad within the tabs. You can call the keyboard in number Mode directly.

To call the number pad in the time tab a timepicker is simply wrong. Did you have a look at the linked issue and maybe the video? There you have everything I mentioned: All treatment entries in the same view and a timepicker.

And last but not least: I know you can see on top the suggestion about carbs or units (if you enabled the feature) but AFTER I entered and closed the treatment adding screen. Why not showing exactly this suggestion right after I entered carbs or units directly within the treatment screen?!

This does not add complexity at all, it simplifies the whole treatment process.

ahaverty commented 5 years ago

Hi all, I was the author of that issue with the suggestion https://github.com/NightscoutFoundation/xDrip/issues/112 (here's a simple video demo: https://www.youtube.com/watch?v=MKpDlzaXHOU)

I had been using xDrip+ from @jamorham 's other repository back then, and branched off that. I'm back using xDrip full time with the Freestyle Libre, MiaoMiao, and a Fossil Explorist Wear OS Watch.

I went with the official builds this time around and haven't made any modifications, but I will have a bit more free time to work on something like this. I actually discussed this with @jamorham a couple of years ago over email, and he brought up some good points to consider:

The current input treatment mechanism is aligned with the one on android wear with a tabbed style interface and voice and text input options.

Any alternative to this would need to be something like a configurable option, such that the user can choose the input style and done in a way that it doesn't significantly increase the complexity of choosing the input method or the overall code base. Also that nothing else is likely to get broken by introducing the feature.

Updating the Bolus Wizard Preview data dynamically based on any inputted carbs data is complex because of the graph based trend data for predictive inertia and treatment profiles for insulin sensitivity/carbohydrate ratios and how these can span multiple time blocks etc which effects the overall "final" number that the treatment prediction might end up with. I have been doing some work on this already but haven't committed any code yet due to some other priorities.

One other thing to bear in mind is that although xDrip+ can show the difference between a desired glucose value and the model output of a simulated treatment, it does this based on data inputted by the user and never actually makes any recommendations. Presenting any data as a recommendation for treatment could be construed to be medical advice and should be avoided.

Also @JonnyJohnson brought up a good point about units in Germany. We'd need to build this with localisation in mind, including the clock and keyboard.

I'd love to get @jamorham 's latest opinion on something like this, as I am also getting a bit sick of how many clicks and errors I make with the current input, on both the phone and wear os.

  1. Thoughts on how we should plan this
  2. Is this repository the best one to PR into?
  3. The best approach for making this configurable by the user
  4. Whether we can get around the medical advice issue, as it is something a lot of us seem to be doing manually anyway (explicit opt-in and red warnings perhaps?)
  5. Any other localisation or issues/suggestions you can think of
xannasavin commented 5 years ago

great to have you aboard, since the other thread died a long time ago I did not expect you will be back :)

I see your point in "Presenting any data as a recommendation for treatment could be construed to be medical advice and should be avoided" - however, the number of carbs or units xDrip would recommend to add are shown on top of the overview screen if enabled. So adding this to the treatment dialog would just be another place, showing the very same numbers. Right? It would just save a few clicks, since you don't have to add e.g. carbs, save, see what xDrip would recommend and then add the units. The recommendation was pretty good in most of the cases. And that neither xDrip nor Nighscout are giving actual treatment advice is already declined in both terms of usage.

Really looking forward to where this is going!

ghost commented 5 years ago

I downloaded NS and xdrip about a week ago and so far I love it. Takes some time to understand the setup and download

With that said I did subscribe to one month of predictmybgl just because he has a bolus calculator, but I didn't renew. I'd really like to know is there a way that I can add my own to xdrip. i have all the settings correct but the only thing i can't figure out is where it will tell me what my bolus should be based on IOB, current glucose reading, and number of carbs.

Again sorry for dumb question. I googled and found one YouTube video but still no answer. Perhaps I'm just missing something

Edited. I realized now you are talking about NS only.

mk886714 commented 5 years ago

Hierzu möchte ich hinzufügen: Ich habe vor xdrip+ mein Tagebuch in mySugr geführt auch dort wird im bolusrechner ein Vorschlag der Behandlung in Abhängigkeit zum eingegebenen Blutzucker Wert gegeben, diese app hat eine medizinische Zulassung. Außerdem ist es doch dem Benutzer überlassen den Vorschlag zu benutzen oder ihn abzuändern. Screenshot_20190413-075433_mySugr

mk886714 commented 5 years ago

Es ist die Verantwortung des benutzers/Diabetikers, welche bolusgabe er durchführt, egal ob die werte vom bolusrechner, vom falschbedienten Taschenrechner oder aus der Kopfberechnung kommen!!!

xannasavin commented 5 years ago

Looks like this is getting lost. As @mk886714 said: The user is responsible for what he is doing - if he is doing a wrong calculation on its own or if the data in xDrip is not correct hence showing a wrong bolus recommendation. That's btw what it is: a recommendation. The whole project everywhere tells: Guys, don't use this whole stuff as medical advice, just as experimental.

However, my request was not only about the bolus calculator but also about other improvements to the UI/UX of this important part.

  1. changing the Treatment dialog to something that is better usable (timepicker, carbs and insulin in the same view (not in different tabs), bolus calculator)
  2. adding the treatment options (types) from nightscout (such thing is completely missing, e.g. to track sensor starts, sports, catether changes etc.)
  3. adding the possibility to enter the carbs as "BE"
  4. multiwave/split bolus option
  5. (new) telling also that the 60 carbs I'm not entering are for the next 2 hrs since I bought a big popcorn bag for the movie
xannasavin commented 5 years ago

wanted to push this once more...

ahaverty commented 4 years ago

@jamorham this seems a bit messy to PR. Is there anyway I could build this as an unofficial standalone app that locally broadcasts the treatment to xDrip? I had a quick look at NSClient, but I'm not sure what it does exactly.

Navid200 commented 3 years ago

Please choose one of the two threads to keep active and close the other. If you disagree with that action, please explain why. If I don't hear back, I will make a link from this one to the old one and close the old one.

xannasavin commented 3 years ago

Which other thread are you refering to? If #1098 then I would not agree, since that one goes in a different direction of adding notes through the dialogue, wheras this thread (see my last comment) is about adding new and enhanced features to the treatment dialogue + improving the UI

xannasavin commented 3 years ago

if you refer to #112 or #152 - this thread here combines (at least from my point of view) the best of those and adds some new stuff...

Navid200 commented 3 years ago

It's this: https://github.com/NightscoutFoundation/xDrip/issues/112

I would like to close that one if this one covers everything. If that one has something that this issue does not address, then, there is a reason to have both issues open.

There is no reason to have redundant issues open. So, I am just asking for clarification.

Navid200 commented 3 years ago

The rule I have to follow is to close duplicates and ask people to post in the original.
However, there is a difference this time. The person who opened #112 stated multiple times that he had no time to work on the issue any longer. And this started. So, I understand if the person starting this one would like to carry on with this one.

xannasavin commented 3 years ago

I appreciate your housecleaning :) So from what I see the old #112 already had something "in the pipeline" which was abandoned 2 or 3 years ago. Not sure if that code base is even worth anymore to be continued or if it should be done from scratch with the latest code base and maybe the points I added in this ticket. From this point of view, I'd rather close the old thread.

I'm going to copy over my latest comment here:

However, my request was not only about the bolus calculator but also about other improvements to the UI/UX of this important part.

  1. changing the Treatment dialog to something that is better usable (timepicker, carbs and insulin in the same view (not in different tabs), bolus calculator) (as in #112)
  2. adding the treatment options (types) from nightscout (such thing is completely missing, e.g. to track sensor starts, sports, catether changes etc.)
  3. adding the possibility to enter the carbs as "BE" (optional; 12 carbs = 1 BE)
  4. multiwave/split bolus option (as in #152 / #429)
  5. setting also carbs to be consumed over a certain period, e.g. 60carbs over the next two hours (e.g. since I bought a big popcorn bag for the movie)
tolot27 commented 2 years ago

For the records: We can start with the commits from @ahaverty at https://github.com/ahaverty/xDrip-plus/commits/master

ahaverty commented 2 years ago

I'm actually back on xDrip since moving to a dexcom, but my android skills are quite rusty since. Likely best to start from scratch. One big thing I didn't consider originally is the multiple insulin treatments feature that's in the current treatment dialog. And as @jamorham mentioned awhile ago, how this would fit in with android wear devices. Id still really like to see the UX improved for realtime carb inputs personally. I'm constantly adding in a carb treatment first, to see what the insulin suggestion is, and then have to undo and input again to get the correct treatment.

xannasavin commented 2 years ago

It looks like nothing has really changed here since I last visited this thread. I'm not sure, if I can add some thoughts about the treatment dialogue on the watch here too, or if this should be a new "discussion"?

Please let me know if this should be added here or needs a new thread, quickly what I am talking about:

I have a big watch but also big fingers. The treatment entry is quite a pain, since you have this super tiny digits that I always misstype, especially at night. I understand the treatment input uses somehow the same style and/or code like the one on the phone, but I think this could be improved in terms of UI/UX ;) I could add some scribbles on how I imagine the treatment dialogue on the watch could be improved.

asavageiv commented 2 years ago

I wonder if we could scale it to the available space. That way it keeps it the same size for watches today but can be a bit bigger on phone screens. I fat finger the numbers a lot too

On Fri, Aug 26, 2022, 1:39 AM xannasavin @.***> wrote:

It looks like nothing has really changed here since I last visited this thread. I'm not sure, if I can add some thoughts about the treatment dialogue on the watch here too, or if this should be a new "discussion"?

Please let me know if this should be added here or needs a new thread, quickly what I am talking about:

I have a big watch but also big fingers. The treatment entry is quite a pain, since you have this super tiny digits that I always misstype, especially at night. I understand the treatment input uses somehow the same style and/or code like the one on the phone, but I think this could be improved in terms of UI/UX ;) I could add some scribbles on how I imagine the treatment dialogue on the watch could be improved.

— Reply to this email directly, view it on GitHub https://github.com/NightscoutFoundation/xDrip/issues/833#issuecomment-1228222462, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXDJ3LATFXPF725XCOOIX3V3B7CZANCNFSM4G7UWKLQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>