Add missed meal notifications to Loop#428
Merged
Merged
Conversation
…ring false-positive UAM detections
…crobolus (#2) * Add ability to estimate delivery duration of bolus * Add tests for UAM notification delay
40e743e to
7d3d2b7
Compare
ps2
reviewed
Nov 28, 2022
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
MealDetectionManagerin Loop.