Skip to content
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

Added the ability to trigger the calculator from the food tab #1106

Closed
wants to merge 2 commits into from

Conversation

erobinson
Copy link

@erobinson erobinson commented Dec 29, 2021

Added the ability to bring up the bolus calculator from the food tab. This would allow users to quickly bolus for frequently consumed foods/meals. Working on making a more robust meal calculator where you can add foods & portions, etc. Wanted to create an initial PR for the small changes to get feedback and add initial enhancements.

Screenshot_20211228-224253

Screenshot_20211228-224325

#1105

Edward Robinson added 2 commits December 27, 2021 22:47
@MilosKozak
Copy link
Contributor

code quality is very good. What I'm not sure about is that fat and protein is usually treated as eCarbs and not accounted into a bolus @AdrianLxM

@MilosKozak
Copy link
Contributor

and for easy usability we should consider adding # of portions next to calc icon

@AdrianLxM
Copy link
Contributor

I do like the idea of handling fat/protein but I think we should discuss it a bit more into detail how we should handle it.

I also like the idea of having the calculator directly accessible. 👍
Could you maybe split this into two MRs, in case out discussion how to handle fat/protein takes longer?

@erobinson
Copy link
Author

The thought for the calculator there was, for snacks rather than for meals, where you can quickly bolus. I.e. bolus for a banana or protein bar are you head out the door in the morning. So wanted to keep it quick and simple. Then to build a more robust meal process where you can add foods/portions/bolus/ecarbs/etc. For a meal.

I could add another preference to allow the user to choose whether or not to include fat/protein in the calculator shortcut and have it default to false. Then users can choose to turn it on.

Otherwise, I can just split that part out and can discuss further.

@AdrianLxM
Copy link
Contributor

The caveat I see with this calculation of fat/protein is, that it would re-define I:C ratio as many understand it (have tested it) and as their diabetes team would see it.

It would work if we define the I:C as pure carb factor. Meaning that the factor was tested on a meal only consisting of carbs or was calculated back to such a factor by subtracting the insulin needed for fat/protein when testing it.

I fear that in reality people will test their factors with say toast with a bit of cream cheese which would mean their I:C would already include some insulin for fat/protein.
Couldn't this lead to too much insulin if we now add some?
With a closed loop system I'd rather err on the low side of a bolus as the loop itself can take care of some of the fat/protein.

I personally therefore calculate with "excess fat/protein". So fat/protein exceeding my standard mixture.

I do have two proposals up for discussion - maybe there are better solutions though.

  1. Find a way to calculate the "excess fat/protein" by adding settings for the default mixture?
  2. Setting the default percentage for fat/protein to 0% as it's already covered by I:C tested on a food mixture.

To me 2) would feel like a bad workaround though as it wouldn't scale for higher amounts of fat. On the other hand, if people would go with a pure carb factor they would need to add fat/protein always - even with their default mixture. So I'm leaning towards 1).

@AdrianLxM
Copy link
Contributor

@MilosKozak: What I'm not sure about is that fat and protein is usually treated as eCarbs and not accounted into a bolus

If you have mostly fat/protein, a direct bolus might be "too fast". If there still is a larger amount of carbs it is fine in my experience to add it directly to the bolus. Even modern insulins have quite some "rat's tail" that would cover the slower food parts. In energy (kCal) I don't use eCarbs up until 2:1 (fat/protein : carbs).

@AdrianLxM
Copy link
Contributor

@erobinson are you in our discord channel? Can we do some brainstorming there?

@erobinson
Copy link
Author

Will do another PR with just the calculator shortcut & w/o the fat/protein included in the carb count.

@erobinson erobinson closed this Dec 29, 2021
@erobinson erobinson deleted the er-food-add-fat-protein branch April 3, 2022 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants