Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Accu-Chek meters and pumps using Smart Pix (UPLOAD-685, UPLOAD-872) #1620

Draft
wants to merge 58 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
75a5d90
Accu-Chek / Roche SmartPix model 1 support for insulin pumps.
jlaunonen Mar 3, 2021
5333f48
Merge pull request #63 from tidepool-org/master
mrinnetmaki Sep 20, 2021
75600b5
Merge branch 'master' into smartpix-on-tp-master
mrinnetmaki Oct 19, 2021
db8eae0
Merge branch 'master' into smartpix-on-tp-master
mrinnetmaki Oct 19, 2021
6365f71
Merge branch 'master' into smartpix-on-tp-master
mrinnetmaki Nov 1, 2021
97c6423
Accu-Chek / Roche SmartPix model 1 support for BG meters.
jlaunonen Jan 30, 2022
f2dfc93
Refactor Smart Pix quick report debug variable slightly.
jlaunonen Jan 30, 2022
def839e
Fix food parameter name.
jlaunonen Mar 14, 2022
008496c
Add time check to Accu-Chek / Roche SmartPix driver.
jlaunonen Feb 2, 2022
4aab490
Rename a local variable to better describe its meaning.
jlaunonen Mar 11, 2022
7ccb703
Add basic timezone handling to AccuChek SmartPix.
jlaunonen Mar 11, 2022
02e7dfb
Fix style issues.
jlaunonen Mar 14, 2022
0fdf286
Aviva meter uploads successfully
gniezen Aug 23, 2022
e0f39b2
Merge branch 'smartpix-on-tp-master' of github.com:Sensotrend/sensotr…
gniezen Aug 24, 2022
616782d
Merge commit '0fdf286778823c7918729ab35' into Sensotrend-smartpix-on-…
gniezen Aug 24, 2022
f19e09c
don't upload control solution tests; annotate HI/LO; send model to me…
gniezen Aug 25, 2022
0d65df0
Merge branch 'master' into smartpix-on-tp-master
gniezen Jan 24, 2023
974c856
parses data from pump successfully
gniezen Jan 24, 2023
bda82c4
Merge branch 'smartpix-on-tp-master' into Sensotrend-smartpix-on-tp-m…
gniezen Jan 24, 2023
6b62199
successfully uploads spirit combo pump
gniezen Jan 24, 2023
c54c521
create new checklist for pumps from smartpix
gniezen Jan 25, 2023
5eff8a6
also add suspend to basal stream
gniezen Jan 31, 2023
67d4bff
updating smart pix pump checklist
gniezen Feb 1, 2023
de5d693
handle final basal
gniezen Feb 2, 2023
2600628
Merge branch 'master' into Sensotrend-smartpix-on-tp-master
gniezen Feb 9, 2023
41f1b7c
some fixes to basals
gniezen Feb 9, 2023
5f57179
still working on time changes events
gniezen Feb 9, 2023
b3d3fc4
use File System Access browser API
gniezen Feb 14, 2023
15ae8f2
cleaning up; persisting permissions
gniezen Feb 14, 2023
162c5ce
wait in case file is still being written to disk; refactor diff; fix …
gniezen Feb 15, 2023
264d0c8
Merge branch 'master' into Sensotrend-smartpix-on-tp-master
gniezen Feb 16, 2023
b87652f
finish up checklist
gniezen Feb 16, 2023
e3c1c8b
show not mounted error
gniezen Feb 20, 2023
99d50f2
more cleanup
gniezen Feb 20, 2023
5fe68c3
v2.48.1-smartpix.1
gniezen Feb 20, 2023
b3de1d4
address review comments
gniezen Feb 23, 2023
fc96474
Merge branch 'master' into Sensotrend-smartpix-on-tp-master
gniezen Feb 23, 2023
2d0810d
Merge branch 'update-deps' into Sensotrend-smartpix-on-tp-master
gniezen Oct 11, 2023
6c5c244
bump windows build to 16.14.2
gniezen Oct 11, 2023
32c2395
bump to electron 26.3.0 and node v18.16.1
gniezen Oct 11, 2023
9acc595
make sure we're using the latest version of npm before switching node…
gniezen Oct 11, 2023
951791a
try using choco to update nvm instead
gniezen Oct 11, 2023
6deef19
try a more updated version of nvm
gniezen Oct 11, 2023
7fb912f
fixing possible syntax error
gniezen Oct 11, 2023
46b26cd
use powershell instead
gniezen Oct 11, 2023
e1346e8
yarn should be preinstalled on that image
gniezen Oct 11, 2023
922f8dd
image description lied; yarn was not installed
gniezen Oct 11, 2023
1901950
let's try cmd
gniezen Oct 16, 2023
b6c58b9
try default windows image
gniezen Oct 16, 2023
e09defa
use windows server 2022
gniezen Oct 16, 2023
997562a
try to fix webpack hash function
gniezen Oct 17, 2023
37fb9f2
use openssl-legacy-provider until we update to webpack v5
gniezen Oct 17, 2023
bfa70da
put node options in package instead
gniezen Oct 17, 2023
efc80e8
remember to use cross-env
gniezen Oct 17, 2023
7032f82
Merge branch 'master' into smartpix
gniezen Feb 8, 2024
4d86ada
Merge branch 'update-deps' into smartpix
gniezen Feb 8, 2024
bd34300
v2.56.1-smartpix.1
gniezen Feb 8, 2024
5280e5a
Merge branch 'master' into smartpix
gniezen Apr 8, 2024
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
3 changes: 2 additions & 1 deletion app/components/DeviceTimeModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export class DeviceTimeModal extends Component {
const reminder = this.getReminder();
const buttons = [];
const footnote = type.value === 'bgm' ? '*' : '';
if ( !this.isDevice('InsuletOmniPod') &&
if ( !this.isDevice('AccuChekSmartPix') &&
!this.isDevice('InsuletOmniPod') &&
!this.isDevice('Medtronic') && // these two lines should be removed
!this.isDevice('Medtronic600') && // when we can update time on Medtronic pumps
!this.isDevice('Tandem') &&
Expand Down
1 change: 1 addition & 0 deletions app/constants/errorMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
E_MEDTRONIC_UNSUPPORTED: 'Tidepool does not support Minimed pumps 522, 722 or older, or the newer 6-series pumps. Sorry...',
E_MEDTRONIC_UPLOAD: 'Make sure no other software (e.g. CareLink, OpenAPS, Loop) is talking to your pump. Otherwise, please see the error details below or contact Tidepool Support.',
E_LIBREVIEW_FORMAT: 'Please set your LibreView date format to Year-Month-Day and export the CSV again',
E_NOT_MOUNTED: 'Device not ready yet or not mounted.',
E_OFFLINE: 'Not connected to the Internet!',
E_READ_FILE: 'Error reading file ',
E_SERIAL_CONNECTION: 'Hmm, we couldn\'t detect your device',
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tidepool-uploader",
"productName": "tidepool-uploader",
"version": "2.57.0",
"version": "2.56.1-smartpix.1",
"description": "Tidepool Project Universal Uploader",
"main": "./main.prod.js",
"author": {
Expand Down
10 changes: 10 additions & 0 deletions app/reducers/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,16 @@ const devices = {
enabled: {mac: true, win: true, linux: true},
powerOnlyWarning: true, // shows warning for power-only USB cables
},
accucheksmartpix: {
instructions: [
i18n.t('Ensure the Smart Pix is mounted before starting.'),
i18n.t('Click Upload and then start the transfer from your device.'),
],
name: 'Roche Accu-Chek Smart Pix',
key: 'accucheksmartpix',
source: {type: 'device', driverId: 'AccuChekSmartPix'},
enabled: {mac: true, win: true, linux: true},
},
tandem: {
instructions: i18n.t('Plug in pump with micro-USB'),
key: 'tandem',
Expand Down
39 changes: 39 additions & 0 deletions docs/checklists/rocheSmartPix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Roche Accu-chek Smart Pix (BG Meters)

(Key:

- `[x]` available in data protocol/documented in spec and implemented
- `[-]` available in data protocol/documented in spec but *not* yet implemented
- `[?]` unknown whether available in data protocol/documented in spec; *not* yet implemented
- `*[ ]` TODO: needs implementation!
- `[ ]` unavailable in data protocol and/or not documented in spec and not yet implemented)

### Required if Present

- `[x]` smbg values
- `[x]` units of smbg values (read from device, not hard-coded)
- `[x]` out-of-range values (LO or HI)
- `[ ]` out-of-range value thresholds (e.g., often 20 for low and 600 for high on BGMs)
- `[ ]` date & time settings changes
- `[ ]` blood ketone values
- `[ ]` units of blood ketone values (read from device, not hard-coded)
- `[ ]` ketone out-of-range values
- `[ ]` ketone out-of-range value thresholds
- `[x]` use `common.checkDeviceTime(currentDeviceTime, timezone, cb)` to check against server time

### No Tidepool Data Model Yet

- `[x]` control (solution) tests (whether marked in UI or auto-detected) - until we have a data model, these should be discarded
- `[ ]` device settings, other than date & time (e.g., target blood glucose range)
- `[-]` tag/note (e.g., pre- vs. post-meal)

### Tidepool ingestion API

Choose one of the following:

- `[ ]` legacy "jellyfish" ingestion API
- `[ ]` platform ingestion API

### Known implementation issues/TODOs

Information on HI/LO out-of-range threshold values are not available in the Aviva manual, so we annotate with `bg/unknown-value`
258 changes: 258 additions & 0 deletions docs/checklists/rocheSmartPixPump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
## Roche Smart Pix (Spirit Combo insulin pump)

(Key:

- `[x]` available in data protocol/documented in spec and implemented
- `[-]` available in data protocol/documented in spec but *not* yet implemented
- `[?]` unknown whether available in data protocol/documented in spec; *not* yet implemented
- `*[ ]` TODO: needs implementation!
- `[ ]` unavailable in data protocol and/or not documented in spec and not yet implemented)

### Required if Present

#### Basals

- `[x]` scheduled basal
- `[x]` basal rate intervals with a start time, duration, and rate delivered
- `[x]` name of basal schedule on each scheduled basal rate interval
- `[x]` if basal schedule is a single (flat) rate all day, pump records a new basal rate interval every midnight
- `[ ]` manual temp basal
- `[ ]` basal rate intervals with a start time, duration, and rate delivered
- `[ ]` object representing suppressed scheduled basal *for each segment of the basal schedule that the temp basal intersects*
- `[x]` percentage temp basal
- `[x]` basal rate intervals with a start time, duration, percent
- `[x]` rate provided directly OR
- `[ ]` rate computed from percent x suppressed.rate
- `[-]` object representing suppressed scheduled basal *for each segment of the basal schedule that the temp basal intersects*
- `[x]` "suspended" basals (see [status - suspends & resumes](#device-events) below)
- `[x]` basal interval with a start time and duration but no rate (b/c suspended)
- `[-]` object representing suppressed scheduled basal *for each segment of the basal schedule that the suspension of insulin delivery intersects*
- `[x]` final (most recent) basal
- `[ ]` basal rate interval with a start time, duration "guessed" from settings, rate delivered, and an annotation re: the "guessed" duration OR
- `[x]` basal rate interval with a start time and rate, no (= zero) duration
- `[ ]` automated basal
- `[ ]` basal rate intervals with a start time, duration, and rate delivered
- `[ ]` if closed loop mode changes during basal, two separate basal entries are created
- `[ ]` if basal rate is a single (flat) rate all day, pump records a new basal rate interval every midnight

Device-specific? (Add any device-specific notes/additions here.)

- As the device needs to be suspended before uploading, we always have the final (most recent) basal and its duration.

#### Boluses

- `[x]` normal bolus
- `[x]` amount of insulin delivered
- `[ ]` amount of insulin delivery programmed (if differs from actual delivery, in case of bolus interruption, cancellation, etc.)
- `[ ]` automated bolus
- `[ ]` amount of insulin delivered
- `[ ]` amount of insulin delivery programmed (if differs from actual delivery, in case of bolus interruption, cancellation, etc.)
- `[x]` extended bolus
- `[x]` amount of insulin delivered
- `[x]` duration of insulin delivery
- `[ ]` amount of insulin delivery programmed (if differs from actual delivery, in case of bolus interruption, cancellation, etc.)
- `[ ]` duration of insulin delivery programmed (if differs from actual duration, in case of bolus interruption, cancellation, etc.)
- `[?]` extended bolus that crosses midnight is split into two records
- `[x]` combo/dual bolus
- `[x]` amount of insulin delivered - immediate (normal)
- `[x]` amount of insulin delivered - extended
- `[x]` duration of extended insulin delivery
- `[ ]` amount of immediate insulin delivery programmed (if differs from actual delivery, in case of bolus interruption, cancellation, etc.)
- `[ ]` amount of extended insulin delivery programmed (if differs from actual delivery, in case of bolus interruption, cancellation, etc.)
- `[ ]` duration of extended insulin delivery programmed (if differs from actual duration, in case of bolus interruption, cancellation, etc.)
- `[?]` extended portion of combo bolus that crosses midnight is split into two records
- bolus cancellations/interruptions
- `[ ]` represented by a separate event in the device's data log OR
- `[ ]` result in modifications to a bolus event in the device's data log
- `[ ]` link to "wizard"/calculator entry (via log entry ID or similar)

No Tidepool data model yet:

- bolus cancellations/interruptions
- `[ ]` agent/reason for bolus cancellation

Device-specific? (Add any device-specific notes/additions here.)
Boluses can only be cancelled before they are started.

#### CBG

(See [the CGM checklist](CGMChecklist.md) instead.)

#### Device Events

- alarms:
- `[x]` low insulin
- `[x]` no insulin
- `[ ]` needed to infer a suspend (stoppage of all insulin delivery)
- `[x]` low power
- `[x]` no power
- `[ ]` needed to infer a suspend (stoppage of all insulin delivery)
- `[x]` occlusion
- `[ ]` needed to infer a suspend (stoppage of all insulin delivery)
- `[ ]` no delivery
- `[ ]` needed to infer a suspend (stoppage of all insulin delivery)
- `[x]` auto-off
- `[ ]` needed to infer a suspend (stoppage of all insulin delivery)
- `[ ]` over limit (i.e., max bolus exceeded through override)
- `[x]` other alarm types (details to be provided in `payload` object)
- `[x]` prime events
- `[x]` prime target = tubing
- `[ ]` prime target = cannula
- `[ ]` prime targets not differentiated
- `[x]` prime volume in units of insulin
- `[x]` reservoir change (or reservoir rewind)
- `[ ]` needed to infer a suspend (stoppage of all insulin delivery)
- `[x]` status events (i.e., suspend & resume)
- `[x]` suspensions of insulin delivery are represented as (interval) events with a duration OR
- `[ ]` suspensions of insulin delivery are represented as pairs of point-in-time events: a suspension and a resumption
- `[x]` reason/agent of suspension (`automatic` or `manual`)
- `[x]` reason/agent of resumption (`automatic` or `manual`)
- calibrations: see [the CGM checklist](CGMChecklist.md) instead
- `*[ ]` time changes (presence of which is also in the [BtUTC section](#bootstrapping-to-utc) below)
- `[ ]` device display time `from` (before change) and `to` (result of change)
- `[ ]` agent of change (`automatic` or `manual`)
- `[ ]` timezone
- `[ ]` reason for change (read from device)
- `[ ]` pump settings override
- `[ ]` override type
- `[ ]` method = manual/automatic
- `[ ]` duration of override

Device-specific? (Add any device-specific notes/additions here.)
While time changes are provided in the data, it would appear that the Smartpix device performs its own kind of bootstrapping.

#### SMBG

- `[?]` blood glucose value
- `[?]` subType (`linked` or `manual`)
- `[?]` units of value (read from device, not hard-coded)
- `[?]` out-of-range values (LO or HI)
- `[?]` out-of-range value thresholds (e.g., often 20 for low and 600 for high on BGMs)

No Tidepool data model yet:

- `[ ]` meal tag (i.e., pre- or post-meal)
- `[ ]` other/freeform tags
- `[ ]` categorization of value according to BG target(s) from settings

Device-specific? (Add any device-specific notes/additions here.)
The Aviva Combo meter that works with the Spirit Combo pump uses coded strips, which does not appear to be available anymore.

#### Settings

- `[x]` basal schedules
- `[x]` name of basal schedule OR
- `[ ]` name of settings profile
- `[ ]` each schedule as a set of objects each with a rate and a start time
- `[x]` name of currently active basal schedule
- `[ ]` units of all blood glucose-related fields (read from device, not hard-coded)
- `[ ]` units of all carb-related fields (read from device, not hard-coded)
- `[ ]` carb ratio(s)
- `[ ]` name of settings profile
- `[ ]` (one or more) set(s) of objects each with a ratio (amount) and a start time
- `[ ]` insulin sensitivity factor(s)
- `[ ]` name of settings profile
- `[ ]` (one or more) set(s) of objects each with an amount and a start time
- `[ ]` blood glucose target(s)
- `[ ]` name of settings profile
- `[ ]` (one or more) set(s) of objects each with a target and a start time
- target shape:
- `[ ]` shape `{low: 80, high: 120}` OR
- `[ ]` shape `{target: 100}` OR
- `[ ]` shape `{target: 100, range: 20}` OR
- `[ ]` shape `{target: 100, high: 120}`
- basal features:
- `[ ]` temp basal type (`manual` or `percentage`)
- `[ ]` max basal (as a u/hr rate)
- bolus features:
- `[ ]` bolus "wizard"/calculator enabled
- `[ ]` extended boluses enabled
- `[ ]` max bolus
- `[ ]` insulin action time
- `[ ]` display BG units
- `[ ]` automated delivery
- `[ ]` firmware version

Settings history:

- `[ ]` device stores all changes to settings OR
- `[x]` device only returns current settings at time of upload

No Tidepool data model yet:

- `[ ]` low insulin alert threshold
- auto-off:
- `[ ]` enabled
- `[ ]` threshold
- `[ ]` language
- reminders:
- `[ ]` BG reminder
- `[ ]` bolus reminder
- `[ ]` alert settings (volume or vibration-only; whether enabled)
- bolus features:
- `[ ]` bolus increment for non-"quick"/manual boluses
- `[ ]` min BG to allow calculation of bolus delivery
- `[ ]` reverse correction enabled
- "quick"/manual bolus:
- `[ ]` enabled
- `[ ]` increment
- `[ ]` clock display preference (12h vs 24h format)

Device-specific? (Add any device-specific notes/additions here.)
Blood glucose targets, insulin sensitivity factors and carb ratios are set on the Combo meter, not the Combo pump. This means these settings are never transffered to the Smart Pix device. Basically the only pump settings we get are the basal schedules.

#### Wizard

- `[ ]` recommended bolus dose
- `[ ]` recommendation for carbohydrates
- `[ ]` recommendation for correction (calculation from BG input)
- net recommendation
- `[ ]` net recommendation provided directly in data OR
- `[ ]` net recommendation is just `recommended.carb` + `recommended.correction` OR
- `[ ]` method for calculating net recommendation documented in data spec OR
- `[ ]` method for calculating net recommendation reverse-engineered from pump manuals/test data
- `[ ]` input blood glucose value
- `[ ]` carbohydrate input in grams
- `[ ]` insulin on board
- `[ ]` insulin-to-carb ratio
- `[ ]` insulin sensitivity factor (with units)
- `[ ]` blood glucose target
- `[ ]` shape `{low: 80, high: 120}` OR
- `[ ]` shape `{target: 100}` OR
- `[ ]` shape `{target: 100, range: 20}` OR
- `[ ]` shape `{target: 100, high: 120}`
- `[ ]` units of BG input and related fields (read from device, not hard-coded; related fields are `bgInput`, `bgTarget`, `insulinSensitivityFactor`)
- `[ ]` link to bolus delivered as a result of wizard (via log entry ID or similar)

Device-specific? (Add any device-specific notes/additions here.)
Wizard data is calculated on the meter, not the pump, and only carb data is available when meter is uploaded.

#### "Bootstrapping" to UTC

- `[x]` index
- `[ ]` UTC timestamp (*Hey, one can dream!*) OR
- `[ ]` internal timestamp or persistent log index (across device communication sessions) to order all pump events (regardless of type), independent of device display time OR
- `[x]` ephemeral log index (does not persist across device communication sessions) to order all pump events (regardless of type), independent of device display time
- `[x]` date & time settings changes
- `[x]` use `common.checkDeviceTime(currentDeviceTime, timezone, cb)` to check against server time

Device-specific? (Add any device-specific notes/additions here.)

### No Tidepool Data Model Yet

> **NB:** You can and should add to this section if there are other data types documented in the device's data protocol specification but not part of Tidepool's data model (yet).

- `[ ]` activity/exercise
- `[ ]` food (e.g., from a food database built into the pump)
- `[ ]` notes/other events

### Tidepool ingestion API

Choose one of the following:

- `[ ]` legacy "jellyfish" ingestion API
- `[x]` platform ingestion API

### Known implementation issues/TODOs

*Use this space to describe device-specific known issues or implementation TODOs **not** contained in the above datatype-specific sections.*
6 changes: 5 additions & 1 deletion lib/core/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import medtronicDriver from '../drivers/medtronic/medtronicDriver';
import medtronic600Driver from '../drivers/medtronic600/medtronic600Driver';
import TrueMetrixDriver from '../drivers/trividia/trueMetrix';
import accuChekUSBDriver from '../drivers/roche/accuChekUSB';
import accuChekSmartPixDriver from '../drivers/roche/accuChekSmartPix';
import bluetoothLEDriver from '../drivers/bluetoothLE/bluetoothLEDriver';
import careSensDriver from '../drivers/i-sens/careSens';
import WeitaiUSB from '../drivers/weitai/weiTaiUSB';
Expand Down Expand Up @@ -97,6 +98,7 @@ device.deviceDrivers = {
Medtronic600: medtronic600Driver,
TrueMetrix: TrueMetrixDriver,
AccuChekUSB: accuChekUSBDriver,
AccuChekSmartPix: accuChekSmartPixDriver,
BluetoothLE: bluetoothLEDriver,
CareSens: careSensDriver,
Weitai: WeitaiUSB,
Expand Down Expand Up @@ -131,6 +133,7 @@ device.deviceComms = {
Medtronic600: hidDevice,
TrueMetrix: hidDevice,
AccuChekUSB: usbDevice,
AccuChekSmartPix: usbDevice,
BluetoothLE: bleDevice,
CareSens: hidDevice,
Weitai: usbDevice,
Expand Down Expand Up @@ -380,7 +383,8 @@ device.detect = (driverId, options, cb) => {
if (webUSBDevice == null && (
driverId === 'InsuletOmniPod' ||
driverId === 'OneTouchVerio' ||
driverId === 'OneTouchSelect'
driverId === 'OneTouchSelect' ||
driverId === 'AccuChekSmartPix'
)) {
// could also be block mode device
device.deviceInfoCache[driverId] = _.cloneDeep(devdata);
Expand Down
6 changes: 6 additions & 0 deletions lib/core/driverManifests.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ const driverManifests = {
{ vendorId: 4292, productId: 60032 }, // Nexus
],
},
AccuChekSmartPix: {
mode: 'usb',
usb: [
{ vendorId: 5946, productId: 2106 }, // Accu-Chek Smart Pix Model 1
],
},
ReliOnPlatinum: {
mode: 'usb',
usb: [
Expand Down
Loading