Skip to content

Prevent Automatic Dosing with Future Glucose #1894

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

Merged
merged 7 commits into from
Jan 11, 2023
Merged

Prevent Automatic Dosing with Future Glucose #1894

merged 7 commits into from
Jan 11, 2023

Conversation

marionbarker
Copy link
Contributor

@marionbarker marionbarker commented Jan 9, 2023

This is a work-in-progress PR is in response to Issue #1890.

Configuration

  • Test phone configured with future glucose and dosing strategy set to automatic bolus.
  • Running dev, phone automatically boluses every 5 minutes, creating undesirable levels of IOB.
  • With commit (updated to) fffcf50 of this branch, tested that the future glucose is detected and automated dosing stops

Display to User:

  • Loop goes red over next 15 minutes, but need to add a better alerting system
  • Tapping on glucose leads to the CGM
  • Main screen continues to show the future glucose value (not CGM value)
  • Tapping on bolus shows no recommendation with the new "Glucose in Future: Check for data in the future on phone" warning
  • Tapping on meal entry allows the meal entry, but meal bolus screen is set for Save without Bolusing (no recommended bolus) with Glucose in Future warning
  • In both cases, can bolus successfully if bolus value is added

Edited to change figure to that displayed with commit: ffbdc46

IMG_F8750773B91E-1

Debug log message:

  • 2023-01-09 08:01:34.624572-0800 Loop[47592:5278115] [LoopDataManager] glucoseInFuture(date: 2023-01-10 14:11:00 +0000)

@marionbarker
Copy link
Contributor Author

Updated - not sure about translation request.
Edited original comment with updated figure.

@marionbarker
Copy link
Contributor Author

Tests all passed, but I wonder if one should be added to: LoopTests/ViewModels/BolusEntryViewModelTests.swift

@marionbarker
Copy link
Contributor Author

Added two tests to LoopTests/ViewModels/BolusEntryViewModelTests.swift.

Copy link
Collaborator

@ps2 ps2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed a typo, and made an optional name change recommendation.

@marionbarker
Copy link
Contributor Author

All test cases succeeded in Xcode.
Built and tested on test phone (after last changes), commit 3038bc7.

  • Saved carbs with no bolus

    • It was not planned, but glucose was below low end of correction range, therefore no autobolus, which is expected behavior
    • Lowered low end of correction range and modified simulated CGM entry so Loop should give an autobolus and it did
  • At 15:57, add single glucose 13 minutes in the future (16:10)

    • Main screen shows the glucose, no trend is visible
    • Got automatic dose at 15:58, might have been 15:58 by the time I hit save on glucose in health
    • Invalid Future Glucose when tap on Manual Bolus until time is 16:05
    • Next automatic dose given when next CGM reading comes in 16:06

@ps2 ps2 merged commit 0d9ed87 into LoopKit:dev Jan 11, 2023
@ps2
Copy link
Collaborator

ps2 commented Jan 11, 2023

Thanks!

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.

2 participants