Working on a program to calculate TAG - I NEED INPUT

I read about TAGing a while ago and didn’t think much about it until last weekend when I tested 82 at 12 o’clock. I ate nothing but a few sticks of string cheese and nothing else. 3 hours later when I checked I was at 219! I started to think that maybe the protein and fat in the cheese had something to do with it. Cheese has quite a bit of both but little to no carbs.
I started researching a little more and discovered that trying to calculate the values can be a real pain in the @$$. Because of this and because I did see a few posts from people asking about a program or an app that could do this and not seeing anything out there that would actually do this other than a few spreadsheets that are definitely not as portable as my phone is… I’ve attempted to create a simple program that will do the calculations for me.
I started with the Insulin Calculator program that I wrote a few months ago but am no longer using since my OmniPod PDM is now doing those calculations. OmniPod will allow for an “extension” which is perfect for TAGing.
I’d like for everyone who is interested to take a look and let me know if I am doing this correctly since there really isn’t a lot of information about how to calculate these numbers. I took a look at a couple of spreadsheets and sort of figured it out on my own. This is just my first attempt so that I can test the concept but I would love to create a version that anyone can use by entering their own information. Please take a look and let me know what you think.
Am I doing this right?
Is there anything that I forgot?
Is there anything that I could do to make this better.
I appreciate ANY input, positive or negative.

MY Internet Calculator (the original)

Free Insulin & Carbohydrate Calculator (anyone can use this one)

My first attempt at a T.A.G. Calculator

The TAG calculator only uses test values…
40% for Protein
10% for Fat
BG to Carb ratio of 35
Insulin to Carb ratio of 10
so that I can test the calculations. The final version will allow you to enter your own values just like the FREE Insulin & Carb Calculator.

I await your feedback :smiley:

Neat idea and I really like the concept. There may be more proficient TAGers out there, but I just have trouble with all the different variables and end up SWAGing. One of the big issues that I realized when I was TAGing more is that I believe ALL the ratios/numbers are slightly fluid as the day goes on (like how my I:C ratio changes throughout the day). It is likely possible, but may be difficult to understand or work? Here are some of the issues you may need to address (from my experience).



changing I:protein (40% to 60%) and I:fat rates (of course add in changing I:C ratio)

changing length of extended bolus

changing amount of extended bolus per half or whole hour (this is the difficult one for me). (I seam to vary between 0.5 and 0.8 U/hr for reasons I do not understand)

The other major hurdle I face with TAGing is re-adjusting all my I:C ratios. I did not have the patience to re-invent the wheel and adjust my I:C ratio down and figure out my I:P and I:F ratios to add as well.



That being said I think this TAGing “problem” is solveable for over half of insulin dependent diabetics. You will have to be the lab rat and experiment and count more things then I can imagine. Best of luck to you because this my be quite a “side job”, but if you get it done I would certainly be willing to reimburse you for its useage.

Thanks Capin101. If I get enough input from other TAGers who know a lot more about it than I do this may very well become the answer to your problems. You will be able to enter your own ratios and I have an idea to calculate the length of the extended bolus based on amounts of protein and fat compared to carb intake. This will take some time to figure out but if everyone is willing to share what they already know it will be a lot easier to complete.

Thanks again for your input.

I am curious why you would change the length of the extended bolus? I can understand that something with a ton of fat in will digest slower, but what would the carbs have to do with it?

I think this is a good idea. I am using a Excel spreadsheet to figure mine out. I noticed though that it has deliver now for the carbs but it doesn’t actually calculate the part for the protein & fat. I double-checked what I thought by putting protein & fat in but nothing for the carbs and it came up with zero for the bolus.

The time idea was just a thought. I haven’t actually put any real thought into it. Just a thought that the ratio of carbs to protein and fat may have something to do with the amount of time that it takes for suger to enter the bloodstream. The TAG calculator calculates the carbs that will be derived from protein and fat and adds that to the carbs that are entered into the “Carbohydrates” box. That is why the Total Carbs box has a value that is greater than the regular carbs box. If you only entered protein and fat then there would be no regular carbs to bolus for so there would be nothing to deliver now. All carbs coming from protein and fat would not enter the blood for a few hours so if you bolused for them right away you would go hypo. That is my understanding anyways. Only protein and fat without any regular carbs should not give an immediate bolus.

LoL



MY Internet Calculator (the original)



should have been



MY Insulin Calculator (the original)

You are right that in only the carbs get an immediate bolus, but your calculation isn’t using the protein or fat at all. It should have a bolus amount that gets spread over an extended time. Otherwise, why put them in at all if you are going to get the same if you only put the carbs in? When I was using my pump, I would calculate the protein & fat amount based on my percentages that worked for me then plug that in over 3.5 hours. Now I am doing it with MDI so doing it manually but still doing the calculations.






I’m not sure I understand why you are saying that it does not calculate for protein and fat but I have an idea. I am using an OmniPod. The OmniPod is my only refference which is the main reason why I posted. I need to know how others are TAGing so that I can configure a program that works with everyone. These are pictures of the regular insulin calculator and the TAG calculator all using the same ratios and calculating for the same numbers except that in the last TAG calculator I’ve taken out the regular carbohydrates. As you can see in the first TAG pic the calculator adds 10 carbs which are derived from protein and fat. You can see this in the second TAG pic where I’ve entered only the protein and fat and “Total Carbs” now says only 10 rather than 60. You will bolus for the amount of carbs in the “Total Carbs” box and deliver the amount in the “Deliver Now” box right now. The rest of the bolus would be “extended”. The reason for the calculataor was to do the calculations for you. I have only used the method that I am familiar with which is the OmniPod but it is clear by these picures that it works and is doing exactly what it is supposed to do. The OmniPod calculates a total bolus based on the “Total Carbs” entered which is taken from the program so I would bolus for 60 instead of only 50. Unless I am calculating wrong then it works. There are other categories and boxes that I could add to the program…



Units to deliver now
Percentage of total bolus to deliver now
units to extend
percentage to extend
carbs to bolus for now
carbs to bolus for later…



I only included the ones that I thought were needed. From what is shown it is possible to figure out the rest with simple math. I am fairly new to TAGing so forgive me if I don’t know how everyone else is doing it. What I need from everyone is to know how you are doing it and what you would like added.



There is so much more but I assure you it is calculating the carbs that come from protein and fat.



again, thanks for the input :smiley:

You are sort of on the right track, but let’s “assume” you are going to have a piece of steak with nothing else - so zero carbs. I put 50 grams of protein & 10 grams of fat in and your program did come up with a “carb” amount of 21 grams, which would be the formula for the protein & fat. That part is right. But it says zero for deliver now and that part is right also because it is zero. You are missing the part for the extended bolus based on those 21 grams of carbs. Using the original ratio of 10 grams of carbs per unit of insulin, you would need about 2 units to be extended. The missing piece is the main part because there is no point in putting protein & fat in if you aren’t going to tell someone they need those 2 extra units over 3.5 hours.

I assumed that you would just calculate your own bolus based on “Total Carbs”. The TAG Calculator then tells you how much to “Deliver Now”. The rest of that bolus would, of course, be extended. I think you are telling me that the calculator should do the subtraction so that it is displayed also. I’ll go ahead and add every possible calculation to the program so that there is nothing left out.



Thanks.

Yes, I am saying that the subtraction should be displayed also. If I have to do my own calculation for the TAG part, I would not bother using your program - it would be twice as much work to get the information that i could do one time on my own.

I’m still working on this but I thought this might give you an idea of my progress. GREEN is input and RED is output. If are there any input or output categories that I’ve left out?



That looks better Jared. I am not sure what the more carbs needed is though.

If you’re not eating enough carbs to get your BG back to the target the carbs needed will be listed there. There are still some issues with negative numbers that need to be delt with like that one. It will just say zero in that category when it is complete unless you need to eat more carbs.



If you tested at 30 and only wanted to eat enough to get you back to your target the program would tell you exactly how much to eat.

Its looking pretty good. I would suggest switching the names of the top two green items to the accepted terms of Insulin:carb ratio and Insulin sensitivity factor (and Insulin:protien and Insulin:fat). For simplicity sake you may want to remove some items (or hide) and highlight the important ones.

Also I would be interested in times. Such as adjusting I:C per time of day or meal like my pump does (also likely I:P and I:F). .

Thank you Capin101. That was going to be my next question since I don’t regularly use these terms I’m not sure how everyone says it. The purpose of all of my previous programs has been simplicity but this one is just going to calculate everything. I could always customize a version that only has specific things like programs I’ve done in the past. As far as calculating for time of day it would be possible but since this will be running in a web browser there wouldn’t really be a way to save information. You’ll have to enter the values into the boxes each time which isn’t exactly convenient but this is really a program now that calculates everything.

I will make the category name changes though and thank you for your input.

Added a category for Insulin on Board. Thought that might be good. Working on the code now. It also needs a name to display in the title bar of your browser. Any ideas? I was thinking of something like D-Calc.


Well, it’s certainly not finished but feel free to play with it. I’ve still got a lot of bugs to work out. If you come across anything let me know. I’ll work on the design when all of the calculations are working the way they should.


D-Calc
Insulin, Carbohydrate & T.A.G. Calculator

Well, I think this is about as complete as I can get it. I left it pretty generic and you can even use it if you are not calculating T.A.G. so it’s pretty neat. I was hoping for a little more feedback but I guess that’s just the way it is.


D-Calc:
Insulin, Carb & T.A.G. Calculator


Take a look at mine.

My personal T.A.G. Calculator


ENJOY!!! :D

Hi Jared,



That looks like about what I would picture a TAG calculator to look like. Have you tried it out?



TAGing is a great idea, but currently something I just SWAG. I would have to test so many ratios and foods again and again that it is hard for me to get the motivation to start. TAGing certainly has enough variables and ways that things can go wrong for me that I considering more of an art form rather than a science at this point.

I just tried my “go to” fast food order. Wendy’s single with a chili. and it is just barely off of how I have art-fully figured out how to TAG and SWAG it. Not bad.