Skip to content

Commit

Permalink
Merge branch 'develop' into release-1.43.0
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonium-119 authored Dec 5, 2024
2 parents 21ba99e + b987cea commit bbb5adf
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,29 @@ $ npm install

### Running locally with blip

To work on code in this repository within [blip](https://github.com/tidepool-org/blip 'Tidepool on GitHub: blip'), first do the following from your local blip repository (assuming blip/ and viz/ are sister directories):
To work on code in this repository within [blip](https://github.com/tidepool-org/blip 'Tidepool on GitHub: blip'), first run this command in your viz/ directory:

```bash
$ npm link
```

This creates a "symlink" in the global folder {prefix}/lib/node_modules/\<package\>/ that links \<package\> to the viz/ directory.

Then, go to your local blip repository (assuming blip/ and viz/ are sister directories) and run:

```bash
$ npm link ../viz/
```

This creates a symbolic link from the global folder to the node_modules/ of the blip/ directory.

In this repository, start the build in watch mode:

```bash
$ npm start
```

Finally, back in your local blip repository, follow [the instructions for starting blip locally](http://developer.tidepool.io/blip/#running-locally 'Blip README: running locally').
Finally, back in your local blip repository, follow [the instructions for starting blip locally](https://github.com/tidepool-org/blip?tab=readme-ov-file#running-locally).

### Running locally in React Storybook

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"node": "20.8.0"
},
"packageManager": "[email protected]",
"version": "1.43.0",
"version": "1.44.0-web-3083-libre-2-plus-stats.1",
"description": "Tidepool data visualization for diabetes device data.",
"keywords": [
"data visualization"
Expand Down
7 changes: 6 additions & 1 deletion src/utils/bloodglucose.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ export function weightedCGMCount(data) {

/**
* Get the CGM sample frequency in milliseconds from a CGM data point. Most devices default at a
* 5 minute interval, but others, such as the Abbot FreeStyle Libre, sample every 15 mins
* 5 minute interval, but others, such as the Abbot FreeStyle Libre, sample every 15 mins, while
* Abbot FreeStyle Libre 2, coming from a Tandem CIQ pump, samples every minute.
*
* @param {Array} datum - a cgm data point
*/
Expand All @@ -237,6 +238,10 @@ export function cgmSampleFrequency(datum) {
return 15 * MS_IN_MIN;
}

if (deviceId.indexOf('tandemCIQ') === 0 && _.get(datum, 'payload.fsl2')) {
return MS_IN_MIN;
}

return 5 * MS_IN_MIN;
}

Expand Down
19 changes: 19 additions & 0 deletions test/utils/bloodglucose.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,25 @@ describe('blood glucose utilities', () => {
deviceId: 'AbbottFreeStyleLibre3_XXXXXXX',
};
expect(bgUtils.cgmSampleFrequency(libre3Datum)).to.equal(5 * MS_IN_MIN);

const libre2CIQDatum = {
deviceId: 'tandemCIQ_XXXXX',
payload: { fsl2: true },
};

const g7CIQDatum = {
deviceId: 'tandemCIQ_XXXXX',
payload: { g7: true },
};

const g6CIQDatum = {
deviceId: 'tandemCIQ_XXXXX',
payload: { g6: true },
};

expect(bgUtils.cgmSampleFrequency(libre2CIQDatum)).to.equal(MS_IN_MIN);
expect(bgUtils.cgmSampleFrequency(g7CIQDatum)).to.equal(5 * MS_IN_MIN);
expect(bgUtils.cgmSampleFrequency(g6CIQDatum)).to.equal(5 * MS_IN_MIN);
});
});

Expand Down

0 comments on commit bbb5adf

Please sign in to comment.