Skip to content

Commit

Permalink
Merge pull request #735 from marionbarker/working-docs
Browse files Browse the repository at this point in the history
Update FAQS: safety and algorithm, add delivery limits explanation
  • Loading branch information
marionbarker authored Oct 3, 2023
2 parents abc6d41 + 21ff26f commit 8afe52b
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 9,088 deletions.
52 changes: 52 additions & 0 deletions docs/faqs/algorithm-faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,58 @@ Insulin on board (IOB) is calculated from the amount of insulin delivered above

IOB is plotted on the [Active Insulin Chart](../loop-3/displays-v3.md#active-insulin-chart) in the main Loop display.

## How do Delivery Limits Affect Automatic Dosing?

With each cycle, <span translate="no">Loop</span>&nbsp;generates a glucose prediction and a recommended dose (positive or negative) to bring you to your correction range.

* The nearest 3 hours has more influence on the recommendation than the later 3 hours, but the entire 6 hours is considered
* The automated response to a negative recommended dose is to reduce basal rate, typically to zero
* The automated response to a positive recommended dose depends on your Dosing Strategy and is adjusted by your Delivery Limits

Let $\mathit{dose}$ be the amount the app thinks you need for this cycle before considering Delivery Limits. The relationship between $\mathit{dose}$, delivery limits: $\mathit{maximumBolus}$ and $\mathit{maximumBasalRate}$, and current IOB: $\mathit{currentIOB}$ are detailed in the following sections:

* [Manual Dose](#manual-dose)
* [Automatic Dose](#automatic-dose)
* [Automatic Bolus: Constant Partial Application Factor](#automatic-bolus-constant-partial-application-factor)
* [Automatic Bolus: Glucose Based Partial Application Factor](#automatic-bolus-glucose-based-partial-application-factor)
* [Temp Basal Only](#temp-basal-only)

### Manual Dose

In the case where you are manually requesting a bolus recommendation:

* If $\mathit{dose}$ > $\mathit{maximumBolus}$: app recommends $\mathit{maximumBolus}$
* If $\mathit{dose}$ < $\mathit{maximumBolus}$: app recommends $\mathit{dose}$

### Automatic Dose

Because this will be an automatic dose, the app will not provide a dose that would exceed an IOB of 2 times the $\mathit{maximumBolus}$.

$$ autoDose = minimum (dose, 2*maximumBolus - currentIOB) $$

#### Automatic Bolus: Constant Partial Application Factor

There is a new feature coming with the next release, available now with customization or the development version, called Glucose Based Partial Application Factor. This feature is disabled by default. When disabled, the Partial Application Factor is a constant 40%.

* If $\mathit{autoDose}$ > $\mathit{maximumBolus}$: app boluses 40% of $\mathit{maximumBolus}$
* If $\mathit{autoDose}$ < $\mathit{maximumBolus}$: app boluses 40% of $\mathit{autoDose}$

#### Automatic Bolus: Glucose Based Partial Application Factor

When Glucose Based Partial Application Factor is enabled, the application factor is modified based on the current glucose level. The value ranges from 20% at lower glucose to 80% at higher glucose. Let $\mathit{gbpa\%}$ represent the application factor, then:

* If $\mathit{autoDose}$ > $\mathit{maximumBolus}$: app boluses $\mathit{gbpa\%}$ of $\mathit{maximumBolus}$
* If $\mathit{autoDose}$ < $\mathit{maximumBolus}$: app boluses $\mathit{gbpa\%}$ of $\mathit{autoDose}$

#### Temp Basal Only

This automatic method uses both Delivery Limits: $\mathit{maximumBasalRate}$ and $\mathit{maximumBolus}$. As explained above, the $\mathit{maximumBolus}$ is used to calculate [$\mathit{autoDose}$](#automatic-recommendation).

The desired dose, $\mathit{autoDose}$, is multiplied by two (to get an hourly rate) and then added to the scheduled basal rate to determine the desired temporary basal rate ($\mathit{BR_temp}$) with a duration of half-an-hour to provide that amount of insulin. This calculated $\mathit{BR_temp}$ is compared to $\mathit{maximumBasalRate}$.

* If $\mathit{BR_temp}$ > $\mathit{maximumBasalRate}$: app sets rate to $\mathit{maximumBasalRate}$
* If $\mathit{BR_temp}$ < $\mathit{maximumBasalRate}$: app sets rate to $\mathit{BR_temp}$

## More Algorithm Information

There is more detail about the Loop Algorithm at the bottom of the Operate tab.
Expand Down
50 changes: 38 additions & 12 deletions docs/faqs/safety-faqs.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,49 @@
## Beware the Medtronic Easy Bolus button
## Know your settings

Medtronic's easy bolus button has been the cause of several accidental boluses when the pump has been carried in a pocket. Best practice would be to disable the Easy Bolus button since you will be doing boluses from the phone anyways.
Do not enter settings that you are unsure of. For example, if you haven't any idea what your carb ratio is, please don't enter a wild guess. Instead, test your settings and talk to your health care provider about what your appropriate settings should be.

## Health app permissions
## Understand the App Displays

Do not let other apps, such as Spike App or MyFitnessPal, on your iPhone write carbohydrates to Health app. Loop could read those carbohydrates and you could be dosed for those carbohydrates. Check your [Health](../build/health.md#loop-permissions) permissions.
If you do not understand the components displayed in the graphic below, please spend time reviewing the information at [Displays](../loop-3/displays-v3.md).

## Finish your Medtronic priming
![main loop screen when running nominally with annotation for heads-up-display, charts and toolbar](../loop-3/img/loop-3-main-annotated.png){width="450"}
{align="center"}

After a site change and reservoir rewind, Medtronic's pump will have a menu on the pump screen related to finishing your prime. Make sure you complete that screen and always return to the main menu. Medtronic's pump won't resume basal insulin delivery until that priming screen is completed.
## Carb Entry and Insulin Delivery

## Know your settings
If you configured the app with closed-loop enabled:

* Once carbohydrates are entered into&nbsp;<span translate="no">Loop</span>, the algorithm will begin to dose insulin to anticipate those carbs

If you entered carbs and then changed your mind on the amount or the time at which they were eaten, use these [instructions](../operation/features/carbs.md#edit-meals) to delete or edit them. This will make&nbsp;<span translate="no">Loop</span>&nbsp;better able to predict blood glucose and adjust insulin delivery appropriately.

## How to Cancel a Bolus

Once a bolus starts, the progress of that bolus appears in the [HUD Status Row](../loop-3/displays-v3.md#hud-status-row). Note that the phone must be held in portrait mode to see this. Simply tap on the row that shows the delivery to halt the bolus.

![bolus-in-progess message: message size is 500 x 50 pixels](../loop-3/img/status-row-bolus-in-progress.svg){width="350"}

Do not enter in settings that you are unsure of. For example, if you haven't any idea what your carb ratio is, please don't enter a zero or a wild guess. Instead, test your settings and talk to your health care provider about what your appropriate settings should be.
## Understand Delivery Limits

## How to Cancel Carbs
With each cycle, <span translate="no">Loop</span>&nbsp;generates a glucose prediction and a recommended dose (positive or negative) to bring you to your correction range.

Once carbohydrates are entered into Loop, the algorithm will begin to dose insulin to anticipate those carbs.
* The automated response to a positive recommended dose depends on your Dosing Strategy and is adjusted by your Delivery Limits

If you entered carbs and then changed your mind on the amount or the time at which they were eaten, use these [instructions](../operation/features/carbs.md#edit-meals) to delete or edit them. This will make Loop better able to predict blood glucose and adjust insulin delivery appropriately.
For more information, please read [How do Delivery Limits Affect Automatic Dosing?](algorithm-faqs.md#how-do-delivery-limits-affect-automatic-dosing).

Make sure [Health](../build/health.md#loop-permissions) permissions are set for Loop to `Write` but **not** `Read` carbs. This avoids a scenario where Loops reads entries from a third-party app. These carbs cannot be edited within Loop.
## Health app permissions

For older versions of&nbsp;<span translate="no">Loop</span>, or if you customized&nbsp;<span translate="no">Loop 3</span>&nbsp;to read carbohydrates from third-party apps, be aware that you cannot edit those entries inside the&nbsp;<span translate="no">Loop</span>&nbsp;app.

If you let other apps, such as MyFitnessPal, write carbohydrates to the Health app, <span translate="no">Loop</span>&nbsp;could read those carbohydrates and you could be dosed for those carbohydrates.

* <span translate="no">Loop 3</span>: review [Customization: Build Time Features](../build/code-customization.md#build-time-features)
* <span translate="no">Loop 2</span>: Check your [Health](../build/health.md#loop-permissions) permissions and review .

## Beware the Medtronic Easy Bolus button

Medtronic's easy bolus button has been the cause of several accidental boluses when the pump has been carried in a pocket. Best practice would be to disable the Easy Bolus button since you will be doing boluses from the phone anyways.

## Finish your Medtronic priming

After a site change and reservoir rewind, Medtronic's pump will have a menu on the pump screen related to finishing your prime. Make sure you complete that screen and always return to the main menu. Medtronic's pump won't resume basal insulin delivery until that priming screen is completed.
4 changes: 2 additions & 2 deletions docs/loop-3/displays-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ If you are running Loop v2.2.x, follow this link: [Loop v2.2.x Displays](../oper

## Main Loop Screen

The main Loop screen contains a Heads-Up Display ([HUD](#heads-up-display)) at the top (when in portrait mode) with various charts in the middle and a toolbar at the bottom.
The main Loop screen contains a Heads-Up Display ([HUD](#heads-up-display)) at the top (when in portrait mode) with various charts in the middle and a toolbar at the bottom. As part of the HUD, important messages will appear in the [Status Row](#hud-status-row) location.

![main loop screen when running nominally with annotation for heads-up-display, charts and toolbar](img/loop-3-main-annotated.svg){width="450"}
![main loop screen when running nominally with annotation for heads-up-display, charts and toolbar](img/loop-3-main-annotated.png){width="450"}
{align="center"}

#### Landscape
Expand Down
Binary file added docs/loop-3/img/loop-3-main-annotated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8afe52b

Please sign in to comment.