From 0c035f5537c51c04e7fe84b851640f7bd5b949a7 Mon Sep 17 00:00:00 2001 From: taylorfowler Date: Thu, 26 Jan 2017 17:01:44 -0500 Subject: [PATCH] Updated HAPP treatments parsing 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). --- lib/iob/history.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/iob/history.js b/lib/iob/history.js index 1449b678..080715c2 100644 --- a/lib/iob/history.js +++ b/lib/iob/history.js @@ -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;