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

[WEB-1985] Add Sooil Dana-i pump to Device Settings #343

Open
wants to merge 32 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
86164c5
Merge pull request #337 from tidepool-org/release-1.32.0
clintonium-119 Nov 8, 2022
8e2bc73
add support for Sooil DANA-i pump settings
Dec 15, 2022
d9ff9e5
add tests for Dana pump
Dec 19, 2022
1ba28f6
add dana data files
Dec 20, 2022
380d9cb
v1.33.0-sooil-dana.1
Dec 20, 2022
8c7861c
Merge branch 'develop' into WEB-1985-sooil-dana
gniezen Dec 20, 2022
95e632e
v1.33.0-rc.1
clintonium-119 Apr 3, 2023
dfd9210
Switch to minified dist package for plotly.js
clintonium-119 Apr 3, 2023
bfe13c7
v1.33.0-rc.2
clintonium-119 Apr 3, 2023
79ae973
Trim down to basic plotly package
clintonium-119 Apr 3, 2023
ee49384
v1.33.0-rc.3
clintonium-119 Apr 3, 2023
8939f46
Fix cgm days calculation discrepancy in AGP report info
clintonium-119 Apr 10, 2023
4a864d6
v1.33.0-rc.4
clintonium-119 Apr 10, 2023
6ddcf28
Merge pull request #346 from tidepool-org/WEB-2194-cgm-days-calc-fix
clintonium-119 Apr 11, 2023
0c375b8
[RELEASE-1] v1.33.0
clintonium-119 Apr 12, 2023
51c9757
Merge branch 'master' into release-1.33.0
clintonium-119 Apr 12, 2023
8add4df
Merge pull request #347 from tidepool-org/release-1.33.0
clintonium-119 Apr 12, 2023
3b095bc
Add sensor usage storybook stat
clintonium-119 Apr 12, 2023
350a234
Return 5 min cgm sample frequency for Libre 3 datums
clintonium-119 Apr 12, 2023
1ec8c42
v1.33.1-rc.1
clintonium-119 Apr 12, 2023
47f0bf0
v1.65.1
clintonium-119 Apr 12, 2023
34a7640
Merge pull request #349 from tidepool-org/WEB-2185-libreview-3-cgm-in…
clintonium-119 Apr 12, 2023
7b9117c
v1.33.1
clintonium-119 Apr 12, 2023
567e46d
Merge branch 'master' into WEB-2185-libreview-3-cgm-intervals
clintonium-119 Apr 12, 2023
a8370fc
Merge pull request #351 from tidepool-org/WEB-2185-libreview-3-cgm-in…
clintonium-119 Apr 12, 2023
8d56eaf
Fix incorrect data path for time in target stat on daily pdf
clintonium-119 Apr 12, 2023
862f13a
v1.33.2-rc.1
clintonium-119 Apr 12, 2023
8b3aab4
[WEB-2252] v1.33.2
clintonium-119 Apr 13, 2023
ec3556e
Merge pull request #352 from tidepool-org/WEB-2252-time-in-target-dai…
clintonium-119 Apr 13, 2023
1dd5ab1
Merge branch 'master' into WEB-1985-sooil-dana
Apr 26, 2023
0bbab4b
Merge branch 'WEB-1985-sooil-dana' of github.com:tidepool-org/viz int…
Apr 26, 2023
a8669ba
v1.33.2-sooil-dana.2
Apr 26, 2023
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
68 changes: 68 additions & 0 deletions data/pumpSettings/dana/flatrate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"activeSchedule": "Profile A",
"basalSchedules": [
{
"name": "Profile C",
"value": [
{
"rate": 0,
"start": 0
}
]
},
{
"name": "Profile D",
"value": [
{
"rate": 0,
"start": 0
}
]
},
{
"name": "Profile A",
"value": [
{
"rate": 0.2,
"start": 0
}
]
},
{
"name": "Profile B",
"value": [
{
"rate": 0,
"start": 0
}
]
}
],
"bgTarget": [
{
"start": 0,
"target": 5.5
}
],
"carbRatio": [
{
"amount": 0.25,
"start": 0
}
],
"deviceId": "Dana-I5-WLL00056FI",
"deviceTime": "2022-12-14T14:05:23",
"insulinSensitivity": [
{
"amount": 2.8,
"start": 0
}
],
"time": "2022-12-14T14:05:45.876+00:00",
"timezoneOffset": 0,
"type": "pumpSettings",
"units": {
"bg": "mmol/L",
"carb": "grams"
}
}
96 changes: 96 additions & 0 deletions data/pumpSettings/dana/multirate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"activeSchedule": "Profile B",
"basalSchedules": [
{
"name": "Profile C",
"value": [
{
"rate": 0,
"start": 0
}
]
},
{
"name": "Profile D",
"value": [
{
"rate": 0,
"start": 0
}
]
},
{
"name": "Profile A",
"value": [
{
"rate": 0.2,
"start": 0
}
]
},
{
"name": "Profile B",
"value": [
{
"rate": 0.2,
"start": 0
},
{
"rate": 0.3,
"start": 14400000
},
{
"rate": 0.4,
"start": 28800000
},
{
"rate": 0.3,
"start": 32400000
},
{
"rate": 0.5,
"start": 43200000
},
{
"rate": 0.2,
"start": 50400000
},
{
"rate": 0.1,
"start": 57600000
}
]
}
],
"bgTarget": [
{
"start": 0,
"target": 5.1
}
],
"carbRatio": [
{
"amount": 0.25,
"start": 0
}
],
"deviceId": "Dana-I5-WLL00056FI",
"deviceTime": "2022-12-15T11:43:09",
"insulinSensitivity": [
{
"amount": 2.8,
"start": 0
}
],
"time": "2022-12-15T11:43:32.357+00:00",
"timezoneOffset": 0,
"type": "pumpSettings",
"units": {
"bg": "mmol/L",
"carb": "grams"
},
"uploadId": "SampleUploadId",
"guid": "5886768b-012e-453d-8e3e-2c5280995c48",
"id": "8372053933d14de3974c8d183c2a433e",
"source": "Sooil"
}
84 changes: 84 additions & 0 deletions data/pumpSettings/dana/multirate.raw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"activeSchedule": "Profile B",
"basalSchedules": {
"Profile C": [
{
"rate": 0,
"start": 0
}
],
"Profile D": [
{
"rate": 0,
"start": 0
}
],
"Profile A": [
{
"rate": 0.2,
"start": 0
}
],
"Profile B": [
{
"rate": 0.2,
"start": 0
},
{
"rate": 0.3,
"start": 14400000
},
{
"rate": 0.4,
"start": 28800000
},
{
"rate": 0.3,
"start": 32400000
},
{
"rate": 0.5,
"start": 43200000
},
{
"rate": 0.2,
"start": 50400000
},
{
"rate": 0.1,
"start": 57600000
}
]
},
"bgTarget": [
{
"start": 0,
"target": 5.1
}
],
"carbRatio": [
{
"amount": 0.25,
"start": 0
}
],
"deviceId": "Dana-I5-WLL00056FI",
"deviceTime": "2022-12-15T11:43:09",
"insulinSensitivity": [
{
"amount": 2.8,
"start": 0
}
],
"time": "2022-12-15T11:43:32.357+00:00",
"timezoneOffset": 0,
"type": "pumpSettings",
"units": {
"bg": "mmol/L",
"carb": "grams"
},
"uploadId": "SampleUploadId",
"guid": "5886768b-012e-453d-8e3e-2c5280995c48",
"id": "8372053933d14de3974c8d183c2a433e",
"source": "Sooil"
}
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tidepool/viz",
"version": "1.33.0-web-2051-agp-print-view.1",
"version": "1.33.2-sooil-dana.2",
"description": "Tidepool data visualization for diabetes device data.",
"keywords": [
"data visualization"
Expand Down Expand Up @@ -58,7 +58,7 @@
"moment": "2.29.4",
"moment-timezone": "0.5.21",
"parse-svg-path": "0.1.2",
"plotly.js": "2.17.1",
"plotly.js-basic-dist-min": "2.20.0",
"prop-types": "15.6.2",
"react": "16.12.0",
"react-clipboard.js": "2.0.16",
Expand Down Expand Up @@ -114,7 +114,6 @@
"eslint-plugin-moment-utc": "1.0.0",
"eslint-plugin-react": "7.11.1",
"gitbook-cli": "2.3.2",
"ify-loader": "1.1.0",
"jsdoc-to-markdown": "4.0.1",
"json-loader": "0.5.7",
"jsx-ast-utils": "2.0.1",
Expand All @@ -141,7 +140,6 @@
"sinon": "6.3.3",
"style-loader": "0.23.0",
"tidepool-standard-action": "0.1.1",
"transform-loader": "0.2.4",
"url-loader": "1.1.1",
"webpack": "4.18.0",
"webpack-cli": "3.1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/components/settings/NonTandem.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ const NonTandem = (props) => {
getText={nonTandemText.bind(this, user, pumpSettings, bgUnits, lookupKey)}
/>
</div>
{!_.includes(['animas', 'microtech'], lookupKey) && (
{!_.includes(['animas', 'microtech', 'sooil'], lookupKey) && (
<div className={styles.settingsContainer}>
<div className={styles.insulinSettingsContainer}>
<div className={styles.categoryTitle}>{t('Pump Settings')}</div>
Expand Down Expand Up @@ -250,7 +250,7 @@ const NonTandem = (props) => {
NonTandem.propTypes = {
bgUnits: PropTypes.oneOf([MMOLL_UNITS, MGDL_UNITS]).isRequired,
copySettingsClicked: PropTypes.func.isRequired,
deviceKey: PropTypes.oneOf(['animas', 'carelink', 'insulet', 'medtronic', 'microtech']).isRequired,
deviceKey: PropTypes.oneOf(['animas', 'carelink', 'insulet', 'medtronic', 'microtech', 'sooil']).isRequired,
openedSections: PropTypes.object.isRequired,
pumpSettings: PropTypes.shape({
activeSchedule: PropTypes.string.isRequired,
Expand Down
4 changes: 2 additions & 2 deletions src/components/settings/common/PumpSettingsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class PumpSettingsContainer extends PureComponent {
bgUnits: PropTypes.oneOf([MGDL_UNITS, MMOLL_UNITS]).isRequired,
copySettingsClicked: PropTypes.func.isRequired,
manufacturerKey: PropTypes.oneOf(
['animas', 'carelink', 'insulet', 'medtronic', 'tandem', 'microtech']
['animas', 'carelink', 'insulet', 'medtronic', 'tandem', 'microtech', 'sooil']
).isRequired,
// see more specific schema in NonTandem and Tandem components!
pumpSettings: PropTypes.shape({
Expand Down Expand Up @@ -52,7 +52,7 @@ export class PumpSettingsContainer extends PureComponent {
timePrefs,
toggleSettingsSection,
} = this.props;
const supportedNonTandemPumps = ['animas', 'carelink', 'insulet', 'medtronic', 'microtech'];
const supportedNonTandemPumps = ['animas', 'carelink', 'insulet', 'medtronic', 'microtech', 'sooil'];
const toggleFn = _.partial(toggleSettingsSection, manufacturerKey);

if (manufacturerKey === 'tandem') {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/print/DailyPrintView.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ class DailyPrintView extends PrintView {
stats[statType] = stat;
});

const { target, veryLow } = _.get(stats, 'timeInRange.data.raw', {});
const { target, veryLow } = _.get(stats, 'timeInRange.data.raw.durations', {});
const totalCbgDuration = _.get(stats, 'timeInRange.data.total.value', {});
const { averageGlucose } = _.get(stats, 'averageGlucose.data.raw', {});
const { carbs } = _.get(stats, 'carbs.data.raw', {});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/StatUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class StatUtil {
cgmDaysWorn = rawCbgData.length;
cgmMinutesWorn = rawCbgData.length === 1 ? sampleFrequency : 0;
} else {
cgmDaysWorn = Math.ceil(moment.utc(newestDatum?.time).diff(moment.utc(oldestDatum?.time), 'days', true));
cgmDaysWorn = moment.utc(newestDatum?.localDate).diff(moment.utc(oldestDatum?.localDate), 'days', true) + 1;
cgmMinutesWorn = Math.ceil(moment.utc(newestDatum?.time).diff(moment.utc(oldestDatum?.time), 'minutes', true));
}

Expand Down
3 changes: 2 additions & 1 deletion src/utils/basics/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
ANIMAS,
MEDTRONIC,
MICROTECH,
SOOIL,
pumpVocabulary,
} from '../constants';

Expand Down Expand Up @@ -192,7 +193,7 @@ export function getSiteChangeSource(patient = {}, manufacturer) {

let siteChangeSource = SITE_CHANGE_TYPE_UNDECLARED;

if (_.includes(_.map([ANIMAS, MEDTRONIC, TANDEM], _.lowerCase), manufacturer)) {
if (_.includes(_.map([ANIMAS, MEDTRONIC, TANDEM, SOOIL], _.lowerCase), manufacturer)) {
siteChangeSource = _.get(settings, 'siteChangeSource');
const allowedSources = [SITE_CHANGE_CANNULA, SITE_CHANGE_TUBING];

Expand Down
10 changes: 9 additions & 1 deletion src/utils/bloodglucose.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,15 @@ export function weightedCGMCount(data) {
*/
export function cgmSampleFrequency(datum) {
const deviceId = _.get(datum, 'deviceId', '');
return deviceId.indexOf('AbbottFreeStyleLibre') === 0 ? 15 * MS_IN_MIN : 5 * MS_IN_MIN;
if (deviceId.indexOf('AbbottFreeStyleLibre3') === 0) {
return 5 * MS_IN_MIN;
}

if (deviceId.indexOf('AbbottFreeStyleLibre') === 0) {
return 15 * MS_IN_MIN;
}

return 5 * MS_IN_MIN;
}

/**
Expand Down
6 changes: 6 additions & 0 deletions src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const TANDEM = 'Tandem';
export const ANIMAS = 'Animas';
export const MEDTRONIC = 'Medtronic';
export const MICROTECH = 'Microtech';
export const SOOIL = 'Sooil';

export const pumpVocabulary = {
[ANIMAS]: {
Expand Down Expand Up @@ -126,6 +127,11 @@ export const pumpVocabulary = {
[SITE_CHANGE_TUBING]: t('Prime Reservoir'),
[SITE_CHANGE_CANNULA]: t('Prime Cannula'),
},
[SOOIL]: {
[SITE_CHANGE_RESERVOIR]: t('Refill'),
[SITE_CHANGE_TUBING]: t('Prime'),
[SITE_CHANGE_CANNULA]: t('Prime Cannula'),
},
[TANDEM]: {
[SITE_CHANGE_RESERVOIR]: t('Change Cartridge'),
[SITE_CHANGE_TUBING]: t('Fill Tubing'),
Expand Down
Loading