Skip to content
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

Utilize max bolus limit in Bolus module #73

Closed
wants to merge 5 commits into from

Conversation

MikePlante1
Copy link
Contributor

@MikePlante1 MikePlante1 commented Apr 9, 2024

In the bolus module, if bolus amount is set over the Max Bolus set in Pump Settings, disable the Enact bolus button, change it's text to Max Bolus exceeded!, and change alert dialog for external insulin.

If bolus amount is set over 3x Max Bolus, disable the external insulin button as well.

Max Bolus is set to 10U for this test:
underMax1
underMax2
overMax1
overMax2
3xOverMax

Cherry-picked from Artificial-Pancreas/iAPS@581e3e2 and Artificial-Pancreas/iAPS@7c7cafe but had to refactor the alert to get it to build

In the bolus module, if bolus amount is set over the `Max Bolus` set in `Pump Settings', disable the `Enact bolus` button, change it's text to `Max Bolus exceeded!`, and change alert dialog for external insulin.

If bolus amount is set over 3x Max Bolus, disable the external insulin button as well.

Cherry-picked from Artificial-Pancreas/iAPS@581e3e2 and Artificial-Pancreas/iAPS@7c7cafe but had to refactor the alert to get it to build

Co-Authored-By: Jon B Mårtensson <53905247+jon-b-m@users.noreply.github.com>
@dnzxy
Copy link
Contributor

dnzxy commented Apr 9, 2024

Great job.

What do you think about maybe adding a small hint in pump settings (where max bolus is set) that explains the magic number that is 3 x max bolus = max external insulin entry?

@Sjoerd-Bo3 is currently working on adding the external insulin dialog that is found in iAPS 3.x (so not sure if it should be added now or later or not at all).

@MikePlante1 MikePlante1 added the enhancement New feature or request label Apr 9, 2024
@MikePlante1
Copy link
Contributor Author

What do you think about maybe adding a small hint in pump settings (where max bolus is set) that explains the magic number that is 3 x max bolus = max external insulin entry?

Since popups haven't been implemented in Pump Settings, how about this instead?

Max Bolus exceeded x3!

@avouspierre
Copy link
Contributor

  • Tested on alpha branch.

Just the "i" in the suggested insulin could perhaps indicate the maxBolus constraint. Here, 7,76 * 0,7 % = 5.432

CleanShot 2024-04-10 at 08 18 26@2x

@avouspierre
Copy link
Contributor

What do you think about maybe adding a small hint in pump settings (where max bolus is set) that explains the magic number that is 3 x max bolus = max external insulin entry?

Since popups haven't been implemented in Pump Settings, how about this instead?

Max Bolus exceeded x3!

Perhaps to display a read-only text field with "Max delivery insulin" in pump settings with the calculation of *3 ?

Perhaps create a variable in maxDeliveryBolus in pumpSettings object directly defined as *3 of maxBolus avoided to have the magic variable everywhere... like this in pumpsettings struct (not tested) :
extension PumpSettings { var maxDeliveryBolus: Decimal? { return 3.0 * self.maxBolus } }

@MikePlante1
Copy link
Contributor Author

Perhaps to display a read-only text field with "Max delivery insulin" in pump settings with the calculation of *3 ?

Perhaps create a variable in maxDeliveryBolus in pumpSettings object directly defined as *3 of maxBolus avoided to have the magic variable everywhere... like this in pumpsettings struct (not tested) : extension PumpSettings { var maxDeliveryBolus: Decimal? { return 3.0 * self.maxBolus } }

It seems out of place to put external bolus settings into pump settings. What about Preferences > OPENAPS OTHER SETTINGS?

@MikePlante1
Copy link
Contributor Author

Accidentally closed this PR, so I reopened it in #100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants