Skip to content

Commit

Permalink
consider BG predictions out to 4h now
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleibrand committed Aug 19, 2017
1 parent fc664b3 commit eb6c7b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/determine-basal/determine-basal.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,11 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
}
UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + predBGI + Math.min(0, predDev) + predUCI;
//console.error(predBGI, predCI, predUCI);
// truncate all BG predictions at 3.5 hours
if ( IOBpredBGs.length < 42) { IOBpredBGs.push(IOBpredBG); }
if ( COBpredBGs.length < 42) { COBpredBGs.push(COBpredBG); }
if ( aCOBpredBGs.length < 42) { aCOBpredBGs.push(aCOBpredBG); }
if ( UAMpredBGs.length < 42) { UAMpredBGs.push(UAMpredBG); }
// truncate all BG predictions at 4 hours
if ( IOBpredBGs.length < 48) { IOBpredBGs.push(IOBpredBG); }
if ( COBpredBGs.length < 48) { COBpredBGs.push(COBpredBG); }
if ( aCOBpredBGs.length < 48) { aCOBpredBGs.push(aCOBpredBG); }
if ( UAMpredBGs.length < 48) { UAMpredBGs.push(UAMpredBG); }
// wait 90m before setting minIOBPredBG
if ( IOBpredBGs.length > 18 && (IOBpredBG < minIOBPredBG) ) { minIOBPredBG = round(IOBpredBG); }
if ( IOBpredBG > maxIOBPredBG ) { maxIOBPredBG = IOBpredBG; }
Expand Down

0 comments on commit eb6c7b3

Please sign in to comment.