-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Use maxBolus to set automaticDosingIOBLimit #1871
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
Changes from 7 commits
5a4659c
b022c4c
a97e007
2afe19a
0733eaf
90b0470
74fd253
dd4ed94
34bf4cb
d6698c9
0c182a1
fc654ff
87478d8
fae59f4
659a10d
ea948df
bdbd78f
800eba0
9ac85c3
0ef5008
c902fbe
8699730
3c7c65b
97b7d8d
61bea9d
01c775c
027d5e8
c6323df
caf2709
374160f
e041840
6b83d2f
cf808a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1616,6 +1616,9 @@ extension LoopDataManager { | |
|
|
||
| let dosingRecommendation: AutomaticDoseRecommendation? | ||
|
|
||
| // automaticDosingIOBLimit calculated from the user entered maxBolus | ||
| let automaticDosingIOBLimit = maxBolus! * 2.0 | ||
|
|
||
| switch settings.automaticDosingStrategy { | ||
| case .automaticBolus: | ||
| let volumeRounder = { (_ units: Double) in | ||
|
|
@@ -1634,7 +1637,9 @@ extension LoopDataManager { | |
| lastTempBasal: lastTempBasal, | ||
| volumeRounder: volumeRounder, | ||
| rateRounder: rateRounder, | ||
| isBasalRateScheduleOverrideActive: settings.scheduleOverride?.isBasalRateScheduleOverriden(at: startDate) == true | ||
| isBasalRateScheduleOverrideActive: settings.scheduleOverride?.isBasalRateScheduleOverriden(at: startDate) == true, | ||
| insulinOnBoard: dosingDecision.insulinOnBoard?.value, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DosingDecision's responsibility is for recording the state of things during a dosing decision. I think use its value as an input here is mixing up responsibilities too much, and will make it hard to extract dosing decision if we change how that's generated. The value should probably be passed to this method (preferred, to move more towards a functional implementation of the Loop algorithm, rather than the current stateful one), or the value should be assigned to a member variable on LDM. Regardless of how this value gets here, failure to retrieve IOB should now be considered an error, as it is part of the Loop dosing algorithm. I think it was previously being treated as a warning.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preliminary modification made, awaiting review. |
||
| automaticDosingIOBLimit: automaticDosingIOBLimit | ||
| ) | ||
| case .tempBasalOnly: | ||
| let temp = predictedGlucose.recommendedTempBasal( | ||
|
|
@@ -1647,7 +1652,9 @@ extension LoopDataManager { | |
| maxBasalRate: maxBasal!, | ||
| lastTempBasal: lastTempBasal, | ||
| rateRounder: rateRounder, | ||
| isBasalRateScheduleOverrideActive: settings.scheduleOverride?.isBasalRateScheduleOverriden(at: startDate) == true | ||
| isBasalRateScheduleOverrideActive: settings.scheduleOverride?.isBasalRateScheduleOverriden(at: startDate) == true, | ||
| insulinOnBoard: dosingDecision.insulinOnBoard?.value, | ||
| automaticDosingIOBLimit: automaticDosingIOBLimit | ||
| ) | ||
| dosingRecommendation = AutomaticDoseRecommendation(basalAdjustment: temp) | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.