Document corner-cases when bolusing fails.

This commit is contained in:
Johannes Mockenhaupt 2017-12-09 00:34:08 +01:00
parent f09464e5d6
commit 197c116c0b
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 16 additions and 2 deletions

View file

@ -14,7 +14,9 @@
- [ ] notification must also appear on smartwatch - [ ] notification must also appear on smartwatch
- [ ] An error during bolus must yield an error in AAPS - [ ] An error during bolus must yield an error in AAPS
- [ ] An error during bolus must yield a notification on a smartwatch - [ ] An error during bolus must yield a notification on a smartwatch
- [ ] Bolusing e.g. 4 U if reservoir has only 2 U must yield a usable error - [ ] Test bolusing a bolus bigger than what's left in the reservoir. A message to check what
was actually delivered must appear (this is a corner-case where when practically can't
check what was actually delivered).
- [ ] Pressing a button on the pump before bolus delivery started must be handled gracefully - [ ] Pressing a button on the pump before bolus delivery started must be handled gracefully
- [ ] Same as above, but moving pump out of range - [ ] Same as above, but moving pump out of range
- [ ] Pressing a button on the pump after bolus delivery has started must be handled - [ ] Pressing a button on the pump after bolus delivery has started must be handled

View file

@ -130,7 +130,19 @@ public class BolusCommand extends BaseCommand {
scripter.confirmAlert(PumpWarningCodes.BATTERY_LOW, 2000); scripter.confirmAlert(PumpWarningCodes.BATTERY_LOW, 2000);
result.forwardedWarnings.add(PumpWarningCodes.BATTERY_LOW); result.forwardedWarnings.add(PumpWarningCodes.BATTERY_LOW);
} else { } else {
throw new CommandException("Pump is showing exotic warning: " + warningCode); // all other warnings or errors;
// An occlusion error can also occur during bolus. To read the partially delivered
// bolus, we'd have to first confirm the error. But an (occlusion) **error** shall not
// be confirmed and potentially be swallowed by a bug or shaky comms, so we let
// the pump be noisy (which the user will have to interact with anyway).
// Thus, this method will terminate with an exception and display an error message.
// Ideally, sometime after the user has dealt with the situation, the partially
// delivered bolus should be read. However, ready history is tricky at this point.
// Also: with an occlusion, the amount of insulin active is in question.
// It would be safer to assume the delivered bolus results in IOB, but there's
// only so much we can do at this point, so the user shall take over here and
// add a bolus record as and if needed.
throw new CommandException("Pump is showing exotic warning/error: " + warningOrErrorCode);
} }
} }
if (bolusRemaining != null && !Objects.equals(bolusRemaining, lastBolusReported)) { if (bolusRemaining != null && !Objects.equals(bolusRemaining, lastBolusReported)) {