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

Use correct units when parsing BolusWizard & CallBGForPH records #29

Merged
merged 2 commits into from
Jul 16, 2017
Merged

Use correct units when parsing BolusWizard & CallBGForPH records #29

merged 2 commits into from
Jul 16, 2017

Conversation

SebastienLussier
Copy link

As discussed in issue #8, the processing of these record was previously hardcoded to a specific type of unit depending on the model. For the context, we own both a 722 & 522 and we are using mmol/L but these two models were hardcoded to mg/dl.

Tested on my 722, on which I issued consecutive boluses using the wizard, switching the unit in between.
"openaps use pump iter_pump" correctly displayed the different records in the unit in which they were entered.

@SebastienLussier
Copy link
Author

This also fixes #26

@scottleibrand
Copy link
Contributor

Can you add a note here with what testing (beyond what is in #26) someone could do to validate the before and after behavior of this change? Thanks.

@SebastienLussier
Copy link
Author

For me, the most noticable effect was that meals/treatments weren't showing on the BG graph in NS.

A more practical way to validate the issue is to set the pump to the "incorrect" unit based on the opposite of what is found in "decocare/models/__init__.py". You then bolus using the bolus wizard and enter the BG (ex: 6.2 mmol/L). The treatment should show up in the "Treatments" report and will look like this (incorrect BG in bold):

Time Event Type Blood Glucose Insulin Carbs Notes
19:11 Meal Bolus 62 (BolusWizard) 0.70 19 Normal bolus with wizard. Programmed bolus 0.7 Delivered bolus 0.7 Percent delivered: 100% Food estimate 0.8 Correction estimate -0.1 Bolus estimate 0.7 Target low 65 Target high 75 Hypothetical glucose delta -50.4 Glucose was: 62
19:10 BG Check 62 (Finger)

Repeating the same process with my changes should yield the following:

Time Event Type Blood Glucose Insulin Carbs Notes
10:27 Meal Bolus 5.4 (BolusWizard) 1.60 35 Normal bolus with wizard. Programmed bolus 1.6 Delivered bolus 1.6 Percent delivered: 100% Food estimate 1.7 Correction estimate -0.1 Bolus estimate 1.6 Target low 6.5 Target high 7.5 Hypothetical glucose delta -14.719999999999999 Glucose was: 5.4
10:27 BG Check 5.4 (Finger)

Thanks!

@ghost
Copy link

ghost commented Jul 15, 2017

@SebastienLussier as written in ITB I'll test the PR in about 1 week once return back from my vacation, thanks for your investigation so far!

@scottleibrand
Copy link
Contributor

To make this easier to test, I just pushed a SebastienLussier-fixes branch (https://github.com/openaps/decocare/tree/SebastienLussier-fixes), so you can just clone decocare, git checkout SebastienLussier-fixes, and install it with sudo python setup.py develop.

@ghost
Copy link

ghost commented Jul 16, 2017

@scottleibrand thanks for pushing to a separate branch

@ghost
Copy link

ghost commented Jul 16, 2017

@SebastienLussier @scottleibrand the fix is working and solves the issue, thanks very much!!!
I entered 120 as BG in BolusExpert and it's shown correctly
screenshot_20170716-083226

@Missdazzle
Copy link

Missdazzle commented Jul 16, 2017

Also checked this on an European Veo 754 with mg/dl - putting in the BG together with carbs (BolusExpert).
The fix is working perfectly! Thank you!

@PieterGit
Copy link

@SebastienLussier: It works for me for Event Type Meal Bolus, but it still fails for Event Type BG Check.
I just did a reinstall with the SebastienLussier-fixes branch, because maybe i already had a dev branch with 0.0.32-dev installed. I'll check later to see if the reinstall fixed the problem. Is there anything that would explain it to work for Meal Bolus but not for BG Check?

@Missdazzle : a European Veo with mg/dl? You sure you don't mean mmol/l?

@Missdazzle
Copy link

Missdazzle commented Jul 16, 2017

@PieterGit Oh yes, I´m sure! :)
Is that "BG Check" something that has to do with the Enlite? In that case I cant´t test it.

@scottleibrand
Copy link
Contributor

So should I merge this to dev for further testing there? Or is there anything we need to fix first?

@ghost
Copy link

ghost commented Jul 16, 2017

For me it's okay, what's about the 6.4U fix? As I understood it is not merged to dev yet...

@scottleibrand
Copy link
Contributor

The 6.4U/h fix is in decocare 0.0.31 (and in both the dev and master branches), which is available via easy_install -U decocare but not via pip.

@scottleibrand
Copy link
Contributor

@PieterGit 👍 or 👎 for merge to dev?

@PieterGit
Copy link

@scottleibrand : please merge to dev. The fix fixes at least the Meal Bolus records. I think it's a rig specfic thing because I installed dev first, and will debug later and ask @ecc1 or @SebastienLussier later or open a new issue/PR.

@scottleibrand scottleibrand merged commit 9a50725 into openaps:dev Jul 16, 2017
@lsandini
Copy link

lsandini commented Nov 4, 2017

Sorry to pop up so late about this, but using the same rig with openaps 0.6.0 dev4, the bolus wizard events are detected and reported correctly using a 754WW pump, but display to problem described above when I use a 715WW or 722WW pump, all in mmol/l.

Do I understand correctly that it should have been fixed long ago ?

My right was built last may and many times updated. Shouldn't the decocare part be up to date as well ?

@PieterGit
Copy link

PieterGit commented Dec 3, 2017

@lsandini Current oref0 0.6.0 release installs decocare-0.0.31-py2.7.egg and then a branch checkout of 0.1.0-dev branch, see https://github.com/openaps/oref0/blob/master/bin/oref0-setup.sh#L520-L538
That's because I think @scottleibrand had issues with releasing/publishing a new decocare release.

I noticed this patch is on the dev branch, see also https://github.com/openaps/decocare/network

image

Can you test on a test rig if using the dev branch of decocare fixes your problem with a 715WW and 722WW pump. If so, we should ask for a 0.1.1-dev branch, or change the oref0-setup.sh to use the dev branch.

That is, it would of course be better to create, test and release a fresh decocare release with all relevant fixes included.

@ecc1 and @scottleibrand and @bewest : thoughts?

@lsandini
Copy link

It took me some time, sorry. I had to retrieve my 722WW first.

Unfortunately the problem persists with 0.6.0 master. I didn't try the 715WW yet, but it is probably the same.

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

Successfully merging this pull request may close these issues.

5 participants