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

Basal pill sometimes converts mmol to mmol #5101

Closed
sulkaharo opened this issue Oct 16, 2019 · 3 comments
Closed

Basal pill sometimes converts mmol to mmol #5101

sulkaharo opened this issue Oct 16, 2019 · 3 comments

Comments

@sulkaharo
Copy link
Member

Some users are reporting that after #4923 was merged, the basal pill is showing mmol value that's divided by 18. Looking at the recent code change that was made on this code, this makes me wonder if the uploaded profiles sometimes contain an unexpected units string, so rather than just checking string equality, we should do something like what Nightscout does on start and assume that any string that contains 'mmol' after lowercasing == mmol and any other string is mg/dl.

Ping @Erin879

@ELUTE
Copy link
Contributor

ELUTE commented Oct 16, 2019

{
"_id": {
"$oid": "5da70a9ca571f8000459f92c"
},
"loopSettings": {
"preMealTargetRange": [
3.6,
3.6
],
"maximumBasalRatePerHour": 12,
"scheduleOverride": {
"insulinNeedsScaleFactor": 0.8,
"name": "80-6.0",
"targetRange": [
6,
6
],
"duration": 0,
"symbol": "⬇️"
},
"overridePresets": [
{
"targetRange": [
5.999999999999998,
5.999999999999998
],
"name": "90-6.0",
"duration": 0,
"insulinNeedsScaleFactor": 0.9,
"symbol": "😘"
},
{
"insulinNeedsScaleFactor": 0.9,
"symbol": "🏂",
"name": "90-4.5",
"duration": 0,
"targetRange": [
4.5,
4.5
]
},
{
"targetRange": [
4.5,
4.5
],
"symbol": "😰",
"duration": 3600,
"insulinNeedsScaleFactor": 1.1,
"name": "110-4.5"
},
{
"name": "120-4.5",
"symbol": "🤢",
"duration": 3600,
"targetRange": [
4.5,
4.5
],
"insulinNeedsScaleFactor": 1.2
},
{
"insulinNeedsScaleFactor": 0.6,
"duration": 7200,
"targetRange": [
6,
6
],
"name": "60 6 2hr",
"symbol": "🏹"
},
{
"targetRange": [
6,
6
],
"insulinNeedsScaleFactor": 0.8,
"duration": 0,
"symbol": "⬇️",
"name": "80-6.0"
}
],
"dosingEnabled": true,
"bundleIdentifier": "EDITED.loopkit.Loop",
"minimumBGGuard": 3.8,
"maximumBolus": 15,
"deviceToken": "538986f2e4cd72052a1c31788e0f7b00e5ff0b1bd479ba73a9d3d692b171e3f8"
},
"startDate": "2019-10-16T12:18:36Z",
"defaultProfile": "Default",
"store": {
"Default": {
"target_low": [
{
"value": 5,
"timeAsSeconds": 0,
"time": "00:00"
}
],
"carbs_hr": "0",
"target_high": [
{
"timeAsSeconds": 0,
"value": 5,
"time": "00:00"
}
],
"carbratio": [
{
"value": 5.3,
"timeAsSeconds": 0,
"time": "00:00"
},
{
"value": 5.5,
"time": "11:00",
"timeAsSeconds": 39600
},
{
"value": 5.8,
"timeAsSeconds": 52200,
"time": "14:30"
}
],
"delay": "0",
"sens": [
{
"time": "00:00",
"timeAsSeconds": 0,
"value": 3.5
}
],
"dia": 6,
"timezone": "ETC/GMT+4",
"basal": [
{
"timeAsSeconds": 0,
"time": "00:00",
"value": 1.65
},
{
"time": "03:00",
"timeAsSeconds": 10800,
"value": 1.5
},
{
"timeAsSeconds": 28800,
"time": "08:00",
"value": 1.95
},
{
"timeAsSeconds": 75600,
"time": "21:00",
"value": 1.9
}
]
}
},
"units": "mmol/L",
"mills": "1571228316923",
"enteredBy": "Loop"
}

@ELUTE
Copy link
Contributor

ELUTE commented Oct 16, 2019

Another one:
{
"_id": {
"$oid": "5da68d4ba88e4800049cc493"
},
"loopSettings": {
"minimumBGGuard": {
"units": "mmol<180.1558800000541>/L",
"value": 3.8
},
"dosingEnabled": true,
"maximumBasalRatePerHour": 4.5,
"maximumBolus": 15,
"overridePresets": [
{
"duration": {
"duration": "finite",
"interval": 3600
},
"settings": {
"targetRange": [
8,
8
]
},
"symbol": "🏉🏀🏃\u200d♂️",
"name": "exercise"
},
{
"name": "eating soon",
"settings": {
"targetRange": [
4.4,
4.4
]
},
"symbol": "🌭🌮🍔",
"duration": {
"interval": 3600,
"duration": "finite"
}
},
{
"name": "NSRemote",
"duration": {
"duration": "finite",
"interval": 3429.419142961502
},
"settings": {
"insulinNeedsScaleFactor": 1,
"targetRange": [
7.993077994454399,
7.993077994454399
]
},
"symbol": "🦉"
}
],
"version": 1,
"integralRetrospectiveCorrectionEnabled": true
},
"units": "mmol/L",
"store": {
"Default": {
"carbs_hr": "0",
"timezone": "America/Regina",
"dia": 6,
"delay": "0",
"target_high": [
{
"time": "00:00",
"value": 5.3,
"timeAsSeconds": 0
}
],
"basal": [
{
"time": "00:00",
"value": 0.9,
"timeAsSeconds": 0
},
{
"time": "01:00",
"timeAsSeconds": 3600,
"value": 0.9
},
{
"time": "02:00",
"timeAsSeconds": 7200,
"value": 0.9
},
{
"value": 0.9,
"time": "03:00",
"timeAsSeconds": 10800
},
{
"timeAsSeconds": 14400,
"value": 0.9,
"time": "04:00"
},
{
"timeAsSeconds": 18000,
"time": "05:00",
"value": 0.9
},
{
"timeAsSeconds": 21600,
"time": "06:00",
"value": 0.9
},
{
"value": 0.9,
"timeAsSeconds": 25200,
"time": "07:00"
},
{
"timeAsSeconds": 28800,
"time": "08:00",
"value": 0.9
},
{
"value": 0.9,
"time": "09:00",
"timeAsSeconds": 32400
},
{
"value": 0.9,
"timeAsSeconds": 36000,
"time": "10:00"
},
{
"value": 0.9,
"timeAsSeconds": 39600,
"time": "11:00"
},
{
"timeAsSeconds": 46800,
"value": 0.9,
"time": "13:00"
},
{
"timeAsSeconds": 57600,
"value": 1,
"time": "16:00"
},
{
"value": 1,
"timeAsSeconds": 64800,
"time": "18:00"
},
{
"value": 1,
"timeAsSeconds": 72000,
"time": "20:00"
},
{
"timeAsSeconds": 79200,
"value": 0.9,
"time": "22:00"
},
{
"time": "23:00",
"value": 0.9,
"timeAsSeconds": 82800
}
],
"carbratio": [
{
"value": 12,
"timeAsSeconds": 0,
"time": "00:00"
},
{
"timeAsSeconds": 25200,
"time": "07:00",
"value": 12
},
{
"value": 10,
"time": "11:00",
"timeAsSeconds": 39600
},
{
"time": "15:00",
"value": 10,
"timeAsSeconds": 54000
},
{
"timeAsSeconds": 72000,
"value": 10,
"time": "20:00"
}
],
"target_low": [
{
"time": "00:00",
"value": 5.3,
"timeAsSeconds": 0
}
],
"sens": [
{
"time": "00:00",
"value": 4,
"timeAsSeconds": 0
},
{
"value": 4,
"time": "03:00",
"timeAsSeconds": 10800
},
{
"time": "10:00",
"timeAsSeconds": 36000,
"value": 4
},
{
"timeAsSeconds": 61200,
"value": 4,
"time": "17:00"
}
]
}
},
"mills": "0",
"startDate": "2019-10-16T03:23:55Z",
"created_at": "2019-10-16T03:23:55Z",
"enteredBy": "loop",
"defaultProfile": "Default"
}

@sulkaharo
Copy link
Member Author

Should be fixed by #5102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants