This acts as a web-based CGM (Continuous Glucose Monitor) to allow multiple caregivers to remotely view a patient's glucose data in real time. The server reads a MongoDB which is intended to be data from a physical CGM, where it sends new SGV (sensor glucose values) as the data becomes available. The data is then displayed graphically and blood glucose values are predicted 0.5 hours ahead using an autoregressive second order model. Alarms are generated for high and low values, which can be cleared by any watcher of the data.
Community maintained fork of the original cgm-remote-monitor.
Requirements:
Clone this repo then install dependencies into the root of the project:
$ npm install
The data being uploaded from the server to the client is from a MongoDB server such as mongolab. In order to access the database, the appropriate credentials need to be filled into the JSON file in the root directory. SGV data from the database is assumed to have the following fields: date, sgv. Once all that is ready, just host your web app on your service of choice.
The easiest way to update your version of cgm-remote-monitor to our latest recommended version is to use the update my fork tool. It even gives out stars if you are up to date.
Try the what is my mongo string tool to get a good idea of your
mongo string. You can copy and paste the text in the gray box into your
MONGO_CONNECTION
environment variable.
Use the autoconfigure tool to sync an uploader to your config.
VARIABLE
(default) - description
MONGO_CONNECTION
- Your mongo uri, for example:mongodb://sally:sallypass@ds099999.mongolab.com:99999/nightscout
ENABLE
- Used to enable optional features, expects a space delimited list such as:careportal rawbg iob
API_SECRET
- A secret passphrase that must be at least 12 characters long, required to enablePOST
andPUT
; also required for the Care PortalBG_HIGH
(260
) - must be set using mg/dl units; the high BG outside the target range that is considered urgentBG_TARGET_TOP
(180
) - must be set using mg/dl units; the top of the target range, also used to draw the line on the chartBG_TARGET_BOTTOM
(80
) - must be set using mg/dl units; the bottom of the target range, also used to draw the line on the chartBG_LOW
(55
) - must be set using mg/dl units; the low BG outside the target range that is considered urgentALARM_TYPES
(simple
if anyBG_
* ENV's are set, otherwisepredict
) - currently 2 alarm types are supported, and can be used independently or combined. Thesimple
alarm type only compares the current BG toBG_
thresholds above, thepredict
alarm type uses highly tuned formula that forecasts where the BG is going based on it's trend.predict
DOES NOT currently use any of theBG_
* ENV'sPUSHOVER_API_TOKEN
- Used to enable pushover notifications for Care Portal treatments, this token is specific to the application you create from in PushoverPUSHOVER_USER_KEY
- Your Pushover user key, can be found in the top left of the Pushover site
DISPLAY_UNITS
(mg/dl
) - Choices:mg/dl
andmmol
. Setting tommol
puts the entire server intommol
mode by default, no further settings needed.MONGO_COLLECTION
(entries
) - The collection used to store SGV, MBG, and CAL records from your CGM deviceMONGO_TREATMENTS_COLLECTION
(treatments
) -The collection used to store treatments entered in the Care Portal, see theENABLE
env var aboveMONGO_DEVICESTATUS_COLLECTION
(devicestatus
) - The collection used to store device status information such as uploader batteryPORT
(1337
) - The port that the node.js application will listen on.SSL_KEY
- Path to your ssl key file, so that ssl(https) can be enabled directly in node.jsSSL_CERT
- Path to your ssl cert file, so that ssl(https) can be enabled directly in node.jsSSL_CA
- Path to your ssl ca file, so that ssl(https) can be enabled directly in node.js
TIME_FORMAT
(12
)- possible values12
or24
NIGHT_MODE
(off
) - possible valueson
oroff
SHOW_RAWBG
(never
) - possible valuesalways
,never
ornoise
CUSTOM_TITLE
(Nightscout
) - Usually name of T1THEME
(default
) - possible valuesdefault
orcolors
ALARM_URGENT_HIGH
(on
) - possible valueson
oroff
ALARM_HIGH
(on
) - possible valueson
oroff
ALARM_LOW
(on
) - possible valueson
oroff
ALARM_URGENT_LOW
(on
) - possible valueson
oroff
ALARM_TIMEAGO_WARN
(on
) - possible valueson
oroff
ALARM_TIMEAGO_WARN_MINS
(15
) - minutes since the last reading to trigger a warningALARM_TIMEAGO_URGENT
(on
) - possible valueson
oroff
ALARM_TIMEAGO_URGENT_MINS
(30
) - minutes since the last reading to trigger a urgent alarm
Easy to emulate on the commandline:
echo 'MONGO_CONNECTION=mongodb://sally:sallypass@ds099999.mongolab.com:99999/nightscout' >> my.env
echo 'MONGO_COLLECTION=entries' >> my.env
From now on you can run using
$ env $(cat my.env) PORT=1337 node server.js
Your hosting provider probably has a way to set these through their GUI.
Optionally, use Vagrant with the
included Vagrantfile
and setup.sh
to install OS and node packages to
a virtual machine.
host$ vagrant up
host$ vagrant ssh
vm$ setup.sh
The setup script will install OS packages then run npm install
.
The Vagrant VM serves to your host machine only on 192.168.33.10, you can access the web interface on http://192.168.33.10:1337
Feel free to post an issue, but read the wiki first.
cgm-remote-monitor - web app to broadcast cgm readings
Copyright (C) 2015 The Nightscout Foundation, http://www.nightscoutfoundation.org.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.