Merge branch 'dev' of github.com:Foxy7/cgm-remote-monitor into wip/bewest/collaborations

This commit is contained in:
Ben West
2025-05-28 16:31:37 -07:00
+8
View File
@@ -1,5 +1,7 @@
'use strict';
var consts = require('../constants');
var dailystats = {
name: 'dailystats'
, label: 'Daily Stats'
@@ -62,6 +64,8 @@ dailystats.report = function report_dailystats (datastorage, sorteddaystoshow, o
$('<th>' + translate('25%') + '</th>').appendTo(thead);
$('<th>' + translate('Median') + '</th>').appendTo(thead);
$('<th>' + translate('75%') + '</th>').appendTo(thead);
$('<th>' + translate('A1c est* %<sub>DCCT</sub>') + '</th>').appendTo(thead);
$('<th>' + translate('A1c est* <sub>IFCC</sub>') + '</th>').appendTo(thead);
thead.appendTo(table);
sorteddaystoshow.forEach(function(day) {
@@ -104,6 +108,8 @@ dailystats.report = function report_dailystats (datastorage, sorteddaystoshow, o
, highs: 0
});
var average = sum / daysRecords.length;
var averageA1cDCCT = (average * consts.MMOL_TO_MGDL + 46.7) / 28.7;
var averageA1cIFCC = ((average * consts.MMOL_TO_MGDL + 46.7) / 28.7 - 2.15) * 10.929;
var bgValues = daysRecords.map(function(r) { return r.sgv; });
$('<td><div id="dailystat-chart-' + day.toString() + '" class="inlinepiechart"></div></td>').appendTo(tr);
@@ -120,6 +126,8 @@ dailystats.report = function report_dailystats (datastorage, sorteddaystoshow, o
$('<td class="tdborder">' + ss.quantile(bgValues, 0.25).toFixed(1) + '</td>').appendTo(tr);
$('<td class="tdborder">' + ss.quantile(bgValues, 0.5).toFixed(1) + '</td>').appendTo(tr);
$('<td class="tdborder">' + ss.quantile(bgValues, 0.75).toFixed(1) + '</td>').appendTo(tr);
$('<td class="tdborder">' + averageA1cDCCT.toFixed(1) + '%</td>').appendTo(tr);
$('<td class="tdborder">' + averageA1cIFCC.toFixed(0) + '</td>').appendTo(tr);
table.append(tr);
var inrange = [