Closed dsnallfot closed 2 months ago
Implemented rudimentary functionality in special branch. (Use CR from device status, and show warning triangle if the lowest predicted BG is lower than set "chart low line" threshold BG in loop follow.
Example in screenshot, Min BG (2,2) in mmol/L
New implementation in special branch, improved flow when "standard-bolusing" amount calculated by CR. (UI not final design yet).
Enter carbs (and fat, protein, notes optional)
Bolus gets calculated ("Beräkning" in swedish) (Carbs/CR)
If any prediction is below low threshold, warning triangle and Min BG value is visible to alert that this might not be a good time to bolus - (the warning is shown already when you enter the remote meal view). If all predictions are above low threshold, no warning is shown.
If satisfied with the calculated bolus amount, tap on it and the bolus amount entry field will auto populate with the same amount.
If regretting the tap/autopopulate, tap again and bolus entry field gets back to 0 again
Or if not satisfied with the calculated amount, enter any other manual bolus amount or leave at 0.
The send button gets disabled and explicitly tells you why if any of the user defined security guardrails are exceeded (maxbolus, maxCarbs, maxFatOrProtein)
Send (and accept the confirmation alert + sign with faceid if bolus is part of the command)
https://github.com/dsnallfot/LoopFollowiAPS/assets/72826201/f0ca7677-ed08-4d8f-81c6-558b9e36a3ac
Bolus calculator/recommendations:
[x] Use enacted device status data to fetch CR (to use for "naive" bolus calculation of a suggested bolus amount)
[x] Use lowest BG prediction value (and/or insulinreq) from enacted and suggest 0 bolus if prediction is lower than threshold
[ ] Use enacted device status data to show latest IOB, COB, Eventual BG (as additional info for an informed bolus decision) This could maybe be displayed in the navigation bar?