Skip to content
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

Detect Future Glucose #1890

Closed
marionbarker opened this issue Jan 4, 2023 · 1 comment
Closed

Detect Future Glucose #1890

marionbarker opened this issue Jan 4, 2023 · 1 comment

Comments

@marionbarker
Copy link
Contributor

Safety Issue Request

Is your feature request related to a problem? Please describe.
When a future value of glucose is entered into Loop, Loop no longer provides a prediction curve but uses that value as the eventual glucose value, reports it on the main Loop screen and continues automatic dosing of insulin. When in closed loop, this can result in an increase or decrease of delivered insulin depending on the glucose value.

  • This has happened when the Loop phone time was changed ahead manually (for example when playing a game) and then returned to automatic time later.
  • This could happen if someone entered a glucose reading into Apple Health from a finger-stick reading and got the time wrong.
    • For example, if it was 12:10 pm when entering a value taken at 11:45 am, and inadvertently entered 11:45 pm for the glucose time.

Describe the solution(s) you've thought of

  • ignore any future glucose values
  • make detection of future glucose a critical error - Loop actions will halt until the problem is resolved.

Test Case
Configuration:

  • use the version of Loop-dev with PR Use maxBolus to set automaticDosingIOBLimit #1871 applied (this clamps the automatic insulin delivery to no more than 2 times maxBolus)
  • select Dosing Strategy of Automatic Bolus
  • modify the bolusPartialApplicationFactor to 1.0 (from 0.4) to make AB delivery faster
  • test phone Therapy Settings: correction range 100 to 115, maxBolus 5 U, ISF 55, CR 10
  • use simulated CGM set to constant 110 mg/dL, start with 0 IOB on test phone
  • clamp will limit automatic dosing when IOB >= 10 U

Test High Glucose in the future:

  • enter glucose of 250 mg/dL 18 hours in the future
  • Loop begins to apply AB dosing up to 10 U IOB clamp

left graphic shows the initial AB doses to reach the IOB clamp
right graphic shows the test phone several hours later

future-glucose

Software Configuration:
LoopWorkspace: dev, commit 84afcfb
Loop: wip/max-auto-iob, commit 97b7d8d

@marionbarker
Copy link
Contributor Author

I'm closing this as included in Loop 3.

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

No branches or pull requests

1 participant