Report bolus delivered if the pump raised a warning/error during delivery.
Most likely this is due to a low cartridge warning, but might also be an occlusion alert. This lets the alarm ring and asks the user to check it. The treatment is also recorded in the db as enacted. (cherry picked from commit 6cc017a)
This commit is contained in:
parent
fea1309fa3
commit
b53db22ae1
1 changed files with 7 additions and 0 deletions
|
@ -58,9 +58,16 @@ public class BolusCommand extends BaseCommand {
|
||||||
while (bolusRemaining != null) {
|
while (bolusRemaining != null) {
|
||||||
log.debug("Delivering bolus, remaining: " + bolusRemaining);
|
log.debug("Delivering bolus, remaining: " + bolusRemaining);
|
||||||
SystemClock.sleep(200);
|
SystemClock.sleep(200);
|
||||||
|
if (scripter.getCurrentMenu().getType() == MenuType.WARNING_OR_ERROR) {
|
||||||
|
throw new CommandException().success(false).enacted(true)
|
||||||
|
.message("Warning/error raised after bolus delivery started. " +
|
||||||
|
"The treatment has been recorded, please check it against the " +
|
||||||
|
"pumps records and delete it if it hasn't finished successfully.");
|
||||||
|
}
|
||||||
bolusRemaining = (Double) scripter.getCurrentMenu().getAttribute(MenuAttribute.BOLUS_REMAINING);
|
bolusRemaining = (Double) scripter.getCurrentMenu().getAttribute(MenuAttribute.BOLUS_REMAINING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO what if we hit 'cartridge low' alert here? is it immediately displayed or after the bolus?
|
// TODO what if we hit 'cartridge low' alert here? is it immediately displayed or after the bolus?
|
||||||
// TODO how are error states reported back to the caller that occur outside of calls in genal? Low battery, low cartridge?
|
// TODO how are error states reported back to the caller that occur outside of calls in genal? Low battery, low cartridge?
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue