Xdrip: FEATURE: Multiple Carbs profiles and other food ingredients

Created on 21 Nov 2020  路  5Comments  路  Source: NightscoutFoundation/xDrip

as follow up discussion point from #1388 i will start implementing a feature to register multiple types of carbs, fats and protein (based on the food database available on a nightscout server).
Starting with carbs and their GI / GL and continuative with fats and protein a prediction on their influence on BG will get possible and even more precise than before. @ANDREAPIPPI provided a very comprehensive collection of food ingredients.

BUT a general condition is the usage of the food entries to be defined in nightscout server. The main reason for that is, i need a food database, nightscout server still has a feature like this and it is easily usable for me. In future times we can also try to use other databases like tidepool. So i will try to create a nightscout-independent data model with reusable interfaces for integrations to come

algorithmics carbs enhancement

Most helpful comment

Looks quite useful.
But do we really need a food database? IMHO, the carbs/fats and proteins of the food intake can be binned into n categories with respect to GI/GL. It is maybe enough for the user to choose one of the GI/GL categories to get better prediction values.
All users I know of don't have time to or just don't select their food from a database during input. They just enter the amount of carbs they eat. Hence, it would be a great improvement to just enhance the existing input with GI/GL categories and the amount of fat/proteins. For experts, an enhanced model w/o a database could be provided.

All 5 comments

Looks quite useful.
But do we really need a food database? IMHO, the carbs/fats and proteins of the food intake can be binned into n categories with respect to GI/GL. It is maybe enough for the user to choose one of the GI/GL categories to get better prediction values.
All users I know of don't have time to or just don't select their food from a database during input. They just enter the amount of carbs they eat. Hence, it would be a great improvement to just enhance the existing input with GI/GL categories and the amount of fat/proteins. For experts, an enhanced model w/o a database could be provided.

Hi gruoner,

Thanks for your attention on this topic.
I can tell you a little bit from personal experience, and then some links with graphic illustration of it.
In case of proten, I normally count from 40% to 60% (higher % if not counting fats) of it "as CHO", the glucose spike occurs between 2h-3h after eating.
For fats, from 30% to 0% of it "as CHO", if fat amount is higher than 30g in the meal, then 30% of it will be considered "as CHO", the glucose spike will happen 4h-6h after meal (higher amounts of fat will generate longer glucose impacts).

Here you go with some material:

Text discussion: https://www.waltzingthedragon.ca/diabetes/nutrition-exercise/how-fat-and-protein-affect-blood-glucose/
Good graphic, it says insulin, but it's a good representation (fat glucose impact seems high in T1D though): https://www.virtahealth.com/blog/top-keto-mistakes
Another visual representation: https://www.tandemdiabetes.com/blog/post/general/2018/01/04/carb-counting-1-food-and-blood-glucose
https://wa.kaiserpermanente.org/healthAndWellness/index.jhtml?item=%2Fcommon%2FhealthAndWellness%2Fconditions%2Fdiabetes%2FfoodRates.html
https://www.diabetes-support.org.uk/info/?page_id=438
Please let me know if can I support this discussion/development in any other way, I would be glad to participate.

Additionally, also agree with @tolot27 comments.

Thanks again,
Gabriel

Hi tolot27, Gabriel
"food database" is a very heavy word. When i though about multiple carbs initially, i had a model like yours in mind.
This model would be quite enough to predict carbs influence on BG. But i had a test and this more precise estimation on carbs activity doesn't even gave me reasons for heavy BG changes 4 till 8 hour after meal. After a discussion with our diabetologist we had to accept we need to model fats and protein as well to meet our goals......

So we analyzed our meals and realized most of our food follows just a few pattern; variance is just a matter of scaling or slightly different composition. So we will need two kinds of interfaces for registering meals - one for "quick and imprecise" and one for "comprehensive and precise". The first one seems to be something you had in mind and it will be a copy of multi insulin just for carbs. The other one will be something i have in mind, leading us to a "food database".

My first step will be the extension of the current carbs registration dialog with three different GI/GL (as definable by nightscout server). The second step will be a dedicated food registration dialog with download of food entries from nightscout.....

cheers

@gruoner Okay, great. Go ahead! 馃槃

I'm for this, it would be interesting to record the data and see if it produces better predictions (I have a my own system of recording data electronically, which I've been doing for years, so I plan to throw that + my exported XDrip data together and see what I can pull out of the murk!)

So are you suggesting feeding data into XDrip from Nightscout (and elsewhere) by updating the web API? That seems to be a useful thing to add, as it would also let people develop their own food entry systems, menu planning, etc., and to have them interact with XDrip (and equally some of the big players might also add an export option if we're lucky).

My feeling is that avoiding integrating the food database system in XDrip would make life easier. If this is hosted in an external app which can send data to XDrip that would provide lots of options for customisation and reduce the internal changes needed for XDrip. I realise at least a minor change would be needed for the XDrip input system to specify the GI/GL of directly entered foods (or carb:protein:fat mix).

The other change is to the "business logic" and whether it bins GI/GL and has specific absorption data for each of those (which I think is what you were saying above with 3 bins available in Nightscout - I've never used it I'm afraid?), or whether it uses the GI/GL (and/or carb:fat:protein ratios) directly to calculate an absorption rate curve. It would be nice to let the end user select from a list of "business logic" options would give people options to experiment with new algorithms and hopefully avoid arguments about what should and shouldn't be supported :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TecMunky picture TecMunky  路  12Comments

ArkonPhoenix picture ArkonPhoenix  路  4Comments

Fohlenpower picture Fohlenpower  路  21Comments

xannasavin picture xannasavin  路  10Comments

m1st0 picture m1st0  路  10Comments