Artificial-Pancreas / iAPS

MIT License
175 stars 720 forks source link

Feature Request: Additional Calculator Safeguard #732

Open macconnellk opened 5 months ago

macconnellk commented 5 months ago

The following scenario still results in large insulin recommendations for me despite improvements to the calculator in v4. 1) Eat a large meal (e.g. 150+ carbs) and bolus initial recommendation. 2) Several hours later SMBs begin delivering extra insulin due to COB that remains. 3) Enter a small snack in the calculator 4) The calculator recommends a bolus to cover all the remaining COB, bypassing the SMBs, and often this causes a low..

Additional safeguard request: Calculate insulin for COB, the latest carb entry or safety threshold and always recommend the minimum of the three.

Discussion: I have implemented this approach myself in prior versions successfully. I was hopeful the newest iteration of the calculator would make it unnecessary. Unfortunately, I ran I to the same issue again today. I realize this may be an issue with settings causing mismatch between COB and insulin required. Still the slower SMB delivery of additional insulin helps mitigate issues during times that settings are changing or off. In this approach, once any carbs are on board, new carbs entries smaller than COB are always covered and remaining COB is still handled via SMBs. There may need to be some logic to ensure insulin greater than needed for max_cob isn’t recommended.

Merkaffe commented 1 month ago

If you make a PR I can look at it