Skip to content

Commit

Permalink
if IOB covers more than 3/4 of COB, limit maxBolus to 30m of basal
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleibrand committed Aug 23, 2017
1 parent df2591b commit 412b7f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/determine-basal/determine-basal.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
if (typeof profile.maxSMBBasalMinutes == 'undefined' ) {
maxBolus = round( profile.current_basal * 30 / 60 ,1);
console.error("profile.maxSMBBasalMinutes undefined: defaulting to 30m");
// if IOB covers more than 2/3 of COB, limit maxBolus to 30m of basal
} else if (iob_data.iob > 2/3 * mealInsulinReq) {
// if IOB covers more than 3/4 of COB, limit maxBolus to 30m of basal
} else if (iob_data.iob > 3/4 * mealInsulinReq) {
console.error("IOB",iob_data.iob,"> 2/3 * COB",meal_data.mealCOB+"; mealInsulinReq =",mealInsulinReq);
maxBolus = round( profile.current_basal * 30 / 60 ,1);
} else {
Expand Down

0 comments on commit 412b7f7

Please sign in to comment.