Skip to content

Commit

Permalink
Updated HAPP treatments parsing (#350)
Browse files Browse the repository at this point in the history
It may also make sense to look for !(current.timestamp) && current.insulin since I believe HAPP may give you the ability to edit the "Entered by" string (need to confirm that though).
  • Loading branch information
taylorfowler authored and scottleibrand committed Jan 29, 2017
1 parent 4db2470 commit ad3d282
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/iob/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ function calcTempTreatments (inputs) {
temp.date = temp.started_at.getTime();
temp.insulin = current.insulin;
tempBoluses.push(temp);
} else if (current.enteredBy =="HAPP_App" && current.insulin) {
var temp = {};
temp.timestamp = current.created_at;
temp.started_at = new Date(tz(current.timestamp));
temp.date = temp.started_at.getTime();
temp.insulin = current.insulin;
tempBoluses.push(temp);
} else if (current.eventType == "Temp Basal") {
var temp = {};
temp.rate = current.rate;
Expand Down

0 comments on commit ad3d282

Please sign in to comment.