Skip to content

Commit e74f53c

Browse files
authored
Merge pull request #8367 from nightscout/wip/bewest/collaborations
Wip/bewest/collaborations
2 parents 05b8f08 + 01808b7 commit e74f53c

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ For remote overrides, the following extended settings must be configured:
752752
* `ns-info` - Plugins that generate notifications at the info level will cause this event to also be triggered. It will be sent in addition to `ns-event`.
753753
* `ns-warning` - Alarms at the warning level with cause this event to also be triggered. It will be sent in addition to `ns-event`.
754754
* `ns-urgent` - Alarms at the urgent level with cause this event to also be triggered. It will be sent in addition to `ns-event`.
755-
* see the [full list of events](lib/plugins/maker-setup.md#events)
755+
* see the [full list of events](docs/plugins/maker-setup.md#events)
756756

757757

758758
### Treatment Profile

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ x-logging:
1010
services:
1111
mongo:
1212
image: mongo:4.4
13+
restart: always
1314
volumes:
1415
- ${NS_MONGO_DATA_DIR:-./mongo-data}:/data/db:cached
1516
logging: *default-logging
@@ -65,6 +66,7 @@ services:
6566

6667
traefik:
6768
image: traefik:latest
69+
restart: always
6870
container_name: 'traefik'
6971
command:
7072
- '--providers.docker=true'

lib/constants.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"HTTP_BAD_REQUEST": 400,
88
"ENTRIES_DEFAULT_COUNT" : 10,
99
"PROFILES_DEFAULT_COUNT" : 10,
10-
"MMOL_TO_MGDL": 18.018018018,
10+
"MMOL_TO_MGDL": 18.01559,
1111
"ONE_DAY" : 86400000,
1212
"TWO_DAYS" : 172800000,
1313
"FIFTEEN_MINUTES": 900000,

lib/report_plugins/dailystats.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
var consts = require('../constants');
4+
35
var dailystats = {
46
name: 'dailystats'
57
, label: 'Daily Stats'
@@ -62,6 +64,8 @@ dailystats.report = function report_dailystats (datastorage, sorteddaystoshow, o
6264
$('<th>' + translate('25%') + '</th>').appendTo(thead);
6365
$('<th>' + translate('Median') + '</th>').appendTo(thead);
6466
$('<th>' + translate('75%') + '</th>').appendTo(thead);
67+
$('<th>' + translate('A1c est* %<sub>DCCT</sub>') + '</th>').appendTo(thead);
68+
$('<th>' + translate('A1c est* <sub>IFCC</sub>') + '</th>').appendTo(thead);
6569
thead.appendTo(table);
6670

6771
sorteddaystoshow.forEach(function(day) {
@@ -104,6 +108,8 @@ dailystats.report = function report_dailystats (datastorage, sorteddaystoshow, o
104108
, highs: 0
105109
});
106110
var average = sum / daysRecords.length;
111+
var averageA1cDCCT = (average * consts.MMOL_TO_MGDL + 46.7) / 28.7;
112+
var averageA1cIFCC = ((average * consts.MMOL_TO_MGDL + 46.7) / 28.7 - 2.15) * 10.929;
107113

108114
var bgValues = daysRecords.map(function(r) { return r.sgv; });
109115
$('<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
120126
$('<td class="tdborder">' + ss.quantile(bgValues, 0.25).toFixed(1) + '</td>').appendTo(tr);
121127
$('<td class="tdborder">' + ss.quantile(bgValues, 0.5).toFixed(1) + '</td>').appendTo(tr);
122128
$('<td class="tdborder">' + ss.quantile(bgValues, 0.75).toFixed(1) + '</td>').appendTo(tr);
129+
$('<td class="tdborder">' + averageA1cDCCT.toFixed(1) + '%</td>').appendTo(tr);
130+
$('<td class="tdborder">' + averageA1cIFCC.toFixed(0) + '</td>').appendTo(tr);
123131

124132
table.append(tr);
125133
var inrange = [

lib/storage/mongo-storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function init(env, cb, forceNewConnection) {
4242

4343
const result = await mongo.db.command({ connectionStatus: 1 });
4444
const roles = result.authInfo.authenticatedUserRoles;
45-
if (roles.length > 0 && roles[0].role == 'readAnyDatabase') {
45+
if (roles && roles.length > 0 && roles[0].role == 'readAnyDatabase') {
4646
console.error('Mongo user is read only');
4747
cb(new Error('MongoDB connection is in read only mode! Go back to MongoDB configuration and check your database user has read and write access.'), null);
4848
}

translations/fr_FR.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@
7070
"Normal": "Normal",
7171
"Median": "Médiane",
7272
"Readings": "Valeurs",
73-
"StDev": "Déviation St.",
73+
"StDev": "Dév. std.",
7474
"Daily stats report": "Rapport quotidien",
75-
"Glucose Percentile report": "Rapport percentiles Glycémie",
76-
"Glucose distribution": "Distribution glycémies",
75+
"Glucose Percentile report": "Rapport centiles glucose",
76+
"Glucose distribution": "Distribution du glucose",
7777
"days total": "jours totaux",
7878
"Total per day": "Total journalier",
7979
"Overall": "En général",

0 commit comments

Comments
 (0)