Skip to content

Add missed meal notifications to Loop#428

Merged
ps2 merged 58 commits into
LoopKit:devfrom
novalegra:aq/missed-meal-detection
Feb 20, 2023
Merged

Add missed meal notifications to Loop#428
ps2 merged 58 commits into
LoopKit:devfrom
novalegra:aq/missed-meal-detection

Conversation

@novalegra

@novalegra novalegra commented Nov 8, 2022

Copy link
Copy Markdown
Contributor

This PR and the associated Loop PR add missed meal notifications to Loop.

Motivation

It's easy to forget to log a meal, and the Loop algorithm works best when it has information about all the carbs and insulin that could affect blood glucose levels. This PR uses the insulin dosing information in Loop to automatically detect when unexpected rise in BG is so large that the only likely explanation is a missed meal, and notify the user so they can log the meal and administer insulin if needed.

Changes Made

Add helper utilities to support the MealDetectionManager in Loop.

@novalegra novalegra changed the title Aq/missed meal detection Add missed meal notifications to Loop Nov 8, 2022
@novalegra novalegra marked this pull request as ready for review November 9, 2022 00:38
novalegra and others added 2 commits November 16, 2022 19:02
…crobolus (#2)

* Add ability to estimate delivery duration of bolus

* Add tests for UAM notification delay
@novalegra novalegra force-pushed the aq/missed-meal-detection branch from 40e743e to 7d3d2b7 Compare November 21, 2022 22:44
Comment thread LoopKit/Extensions/NSUserActivity+CarbKit.swift Outdated
Comment thread LoopKit/CarbKit/CarbStore.swift Outdated
Comment thread LoopKit/LoopMath.swift Outdated
novalegra and others added 13 commits November 28, 2022 15:48
* Add ability to calculate the number of carbs in a missed meal (#3)

* Plumb a customizable carb amount through UAM notification architecture

* Refactor carb effect threshold computation into helper function

* Add first draft of dynamic carb selection for meal

* Bump max carb autofill limit from 100 -> 150

* Add tests for carb autofill

* Bump max carb threshold limit because of dynamic autofill clamping

* Lower the UAM max autofill

* Require that unannounced meals have ICE onboard that is >= the meal threshold, and only autofill observed ICE

* Lower ICE threshold for a UAM notification

* Update tests

* Improve debug info

* Update commenting

* Remove unused test

* Update test
* `dateRange` -> `simulationDateRange`

* Create `MealDetectionManager` from old UAM functions in `CarbStore`

* Add fixme
# Conflicts:
#	LoopKit.xcodeproj/project.pbxproj
@ps2 ps2 merged commit 65bf31d into LoopKit:dev Feb 20, 2023
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