Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
9abcdd7
Update dev version to 0.11.1
sulkaharo Feb 7, 2019
f8410ab
remove + from version, make way for 0.11.1, upgrade webpack (#4277)
PieterGit Feb 7, 2019
42feacc
Improvement: causes client to say Ok Ok when the alarm test button is…
sulkaharo Feb 17, 2019
6532dac
Merge pull request #4371 from nightscout/wip/allow_speech_on_ios
sulkaharo Feb 17, 2019
3ee22d4
Added janrpn as maintainer of the Danish language (#4379)
janrpn Feb 21, 2019
83a8dea
Changed base image to node:10-alpine (#4409)
m-a-v Feb 24, 2019
762fec6
Wrong Korean translation update (#4407)
jungsomyeong Feb 24, 2019
219aea1
@diabetlum added in the list (#4328)
XP2025A Feb 24, 2019
9445996
Turkish language updates (#4271)
XP2025A Feb 24, 2019
546b0f6
Testing if recent changes have fixed builds in Linux-based Travis ins…
sulkaharo Mar 3, 2019
59e79b1
Make sure NPM is up to date
sulkaharo Mar 3, 2019
4f8f428
Merge pull request #4434 from nightscout/wip/travis_test
sulkaharo Mar 3, 2019
ad338bf
Protein and Fat logging support (#3830)
sulkaharo Mar 3, 2019
d437b56
Node and npm update (#4412)
PieterGit Mar 5, 2019
654be7b
Croatian translation (#4349)
OpossumGit Mar 5, 2019
83321fa
Remove profile toggle and always show Profile Editor link (#4448)
unsoluble Mar 5, 2019
55b11bc
Add support for rendering Triple Up and Triple Down Direction (#4458)
sulkaharo Mar 14, 2019
d7185bc
release candiate for 0.11.2 with Minimed EU Server and Guardian Conne…
PieterGit Mar 20, 2019
db5d8fe
cover request.secure in HTTPS redirect exemption (#4483)
thecubic Mar 25, 2019
d73958d
Fix CSP handling (#4449)
sulkaharo Apr 6, 2019
6223212
Enable id query with no date (#4481)
jpcunningh Apr 6, 2019
3e4b45b
Fix stale data alarms on latest iOS (#4542)
sulkaharo Apr 20, 2019
98d8eba
Wip/ios springboard app fixes (#4543)
sulkaharo Apr 20, 2019
bbcd3c5
Moved to braces module, which is maintained and doesn't have vulnerab…
sulkaharo Apr 23, 2019
9cf02e8
Wip/libre reporting fixes (#4502)
rob-andy Apr 28, 2019
3ea590d
Add display_units as a required variable (#4559)
unsoluble Apr 28, 2019
32b61b1
re-add out of range RMS (#4450)
mitchellhenke Apr 28, 2019
4efc799
Allow framing in Helmet, as many users have setups like monitoring tw…
sulkaharo Apr 28, 2019
2574f90
Fixed alexa doc link. (#4423)
tanja3981 Apr 28, 2019
9e090e0
uncomment the rest of rms
jasoncalabrese May 5, 2019
585882e
display '50+ U', when there's no reservoir value for an Eros pod
jasoncalabrese May 5, 2019
9d88a37
display Loop override in a new pill
jasoncalabrese May 7, 2019
1c7b480
css tweaks so the pills align better
jasoncalabrese May 7, 2019
7c2f67f
Merge pull request #4577 from jasoncalabrese/uncomment-rms
jasoncalabrese May 8, 2019
3c41724
another CSS tweak that allows the pills on the right side to wrap
jasoncalabrese May 8, 2019
1c4bc54
Merge pull request #4578 from jasoncalabrese/pump-status-manufacturer…
jasoncalabrese May 9, 2019
a4f9b52
update readme to include the override plugin and resole TODO
jasoncalabrese May 9, 2019
3ffc005
Merge pull request #4587 from jasoncalabrese/override-mode
jasoncalabrese May 9, 2019
99800c8
fix loop test to expect evBG in the pill value
jasoncalabrese May 10, 2019
b139151
Merge pull request #4601 from jasoncalabrese/fix-loop-test
jasoncalabrese May 10, 2019
2ac89d2
Add try/catch blocks to around plugin calls, which should in most cas…
sulkaharo May 19, 2019
0bac2b5
add triple-arrow svgs (#4640)
unsoluble May 24, 2019
5ac49cd
Fix BG data wrapping issue with Chrome (#4667)
sulkaharo May 30, 2019
6ed5ee0
feat: clock view code refactor (#4639)
sulkaharo Jun 20, 2019
5953613
move BG span style to css and include rawbg (#4670)
jasoncalabrese Jun 20, 2019
fa28b0c
Fix distribution report totals (#4691)
sulkaharo Jun 20, 2019
a6787b5
Clamp treatments & load less data (#4697)
sulkaharo Jun 20, 2019
8653d49
* Package reporting plugins separately into another bundle to reduce …
sulkaharo Jun 30, 2019
ca04cc2
Run code through a linter when in dev mode
sulkaharo Jul 1, 2019
76d103f
Remove a couple unnecessary logging lines
sulkaharo Jul 1, 2019
8959287
Calculate a has for treatments for deduplication (type + timestamp) (…
sulkaharo Jul 14, 2019
dfe9d1b
Fix tests
sulkaharo Jul 14, 2019
e9576df
Add documentation
sulkaharo Jul 15, 2019
f9d59c4
Packaging / development improvements (#4710)
sulkaharo Jul 15, 2019
b04476e
Normalize Treatment, Entry and Device Status object dates to be all i…
sulkaharo Jul 17, 2019
8f25a6e
Fix all issues from ESLint (#4730)
sulkaharo Jul 17, 2019
b933da2
* Merge branch 'master' into dev
sulkaharo Jul 17, 2019
9380557
Add eslint ignores to a false positive
sulkaharo Jul 19, 2019
851b08f
Fix issues found with linting in the server code & update module vers…
sulkaharo Jul 19, 2019
ad19131
* Bump version to 0.12.0 for release
sulkaharo Jul 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix distribution report totals (#4691)
* Distribution totals were miscalculated due to data interpolation. This also adds filtering for non-sgv dexcom entries - we need a new feature so user can define what CGM system she's on and set the lower bound of acceptable CGM values appropriately

* Remove debug logging
  • Loading branch information
sulkaharo authored Jun 20, 2019
commit fa28b0cd05fe1424b9c2b649faab6e9f44daa82d
23 changes: 14 additions & 9 deletions lib/report_plugins/glucosedistribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,25 @@ glucosedistribution.report = function report_glucosedistribution(datastorage, so
enabledHours[i] = $('#glucosedistribution-' + i).is(':checked');
}

//console.log(enabledHours);

var result = {};

// Filter data for noise

var glucose_data = [data[0]];

// data cleaning pass 0 - remove duplicates and sort
// data cleaning pass 0 - remove duplicates and non-sgv entries, sort
var seen = {};
data = data.filter(function(item) {
if (!item.sgv || !item.bgValue || !item.displayTime || item.bgValue < 39) {
console.log(item);
return false;
}
return seen.hasOwnProperty(item.displayTime) ? false : (seen[item.displayTime] = true);
});

data.sort(function(a, b) {
return a.displayTime.getTime() - b.displayTime.getTime();
});

var glucose_data = [data[0]];

// data cleaning pass 1 - add interpolated missing points
for (var i = 0; i <= data.length - 2; i++) {
var entry = data[i];
Expand All @@ -169,7 +170,8 @@ glucosedistribution.report = function report_glucosedistribution(datastorage, so
var bg = Math.floor(entry.bgValue + bgDelta * j);
var t = new Date(entry.displayTime.getTime() + j * timePatch);
var newEntry = {
bgValue: bg
sgv: displayUnits === 'mmol' ? bg / 18 : bg
, bgValue: bg
, displayTime: t
};
glucose_data.push(newEntry);
Expand Down Expand Up @@ -207,9 +209,12 @@ glucosedistribution.report = function report_glucosedistribution(datastorage, so
}

if ((delta1 > 0 && delta2 < 0) || (delta1 < 0 && delta2 > 0)) {
var d = (nextEntry.bgValue - prevEntry.bgValue) / 2;
const d = (nextEntry.bgValue - prevEntry.bgValue) / 2;
const interpolatedValue = prevEntry.bgValue + d;

var newEntry = {
bgValue: prevEntry.bgValue + d
sgv: displayUnits === 'mmol' ? interpolatedValue/18 : interpolatedValue
, bgValue: interpolatedValue
, displayTime: entry.displayTime
};
glucose_data2.push(newEntry);
Expand Down