Skip to content
Open
Changes from all commits
Commits
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
13 changes: 11 additions & 2 deletions lib/report_plugins/glucosedistribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ glucosedistribution.html = function html (client) {
translate('Out of Range RMS is calculated by squaring the distance out of range for all glucose readings for the examined period, summing them, dividing by the count and taking the square root. This metric is similar to in-range percentage but weights readings far out of range higher. Lower values are better.') + '<br/><br/>' +
translate('GVI (Glycemic Variability Index) and PGS (Patient Glycemic Status) are measures developed by Dexcom, detailed <a href="') +
'https://web.archive.org/web/20160523152519/http://www.healthline.com/diabetesmine/a-new-view-of-glycemic-variability-how-long-is-your-line' +
translate('">can be found here</a>.') + '<br/><br/>' +
translate('GMI (Glucose Management Indicator) provides an estimate of HbA1c, details <a href="') +
'https://web.archive.org/web/20250206062319/https://pmc.ncbi.nlm.nih.gov/articles/PMC6196826/pdf/dc181581.pdf' +
translate('">can be found here</a>.') + '<br/><br/>' +
translate('Revised GMI provides an improvement on the estimate of HbA1c for those with tightly controlled diabetes, details <a href="') +
'https://web.archive.org/web/20250210181811/https://pmc.ncbi.nlm.nih.gov/articles/PMC11571357/' +
translate('">can be found here</a>.') +
'</div><br/><br/>' +
translate('Filter by hours') + ':' +
Expand Down Expand Up @@ -432,6 +438,9 @@ glucosedistribution.report = function report_glucosedistribution (datastorage, s

var RMS = Math.sqrt(RMSTotal / events);

var GMI = (Math.round(10 * (3.31 + 0.02392 * glucoseMean)) / 10).toFixed(1);
var revisedGMI = (Math.round(10 * (2.879 + 0.023 * glucoseMean)) / 10).toFixed(1);

// console.log('TADC',TDC,'days',days);

var timeInT1 = Math.round(100 * t1count / events).toFixed(1);
Expand Down Expand Up @@ -464,8 +473,8 @@ glucosedistribution.report = function report_glucosedistribution (datastorage, s
$('<tr><th>' + translate('Mean Hourly Change') + '</th><th>GVI</th><th>PGS</th></tr>').appendTo(stabilitytable);
$('<tr><td class="tdborder">' + TDCHourly + unitString + '</td><td class="tdborder">' + GVI + '</td><td class="tdborder">' + PGS + '</td></tr>').appendTo(stabilitytable);

$('<tr><th>Out of Range RMS</th></tr>').appendTo(stabilitytable);
$('<tr><td class="tdborder">' + Math.round(RMS * 100) / 100 + unitString + '</td></tr>').appendTo(stabilitytable);
$('<tr><th>Out of Range RMS</th><th>GMI</th><th>Revised GMI</th></tr>').appendTo(stabilitytable);
$('<tr><td class="tdborder">' + Math.round(RMS * 100) / 100 + unitString + '</td><td class="tdborder">' + GMI + '</td><td class="tdborder">' + revisedGMI + '</td></tr>').appendTo(stabilitytable);
stabilitytable.appendTo(stability);

setTimeout(function() {
Expand Down