Skip to content

Detect Future Glucose #1890

Closed
Closed
@marionbarker

Description

@marionbarker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions