pazaan / 600SeriesAndroidUploader

Your Medtronic 600-series pump data, direct to Nightscout
http://pazaan.github.io/600SeriesAndroidUploader/
MIT License
189 stars 312 forks source link

Treatment entries for reservoir changes and site changes appear incorrect. #234

Closed loztblaz closed 6 years ago

loztblaz commented 6 years ago

I'm using a 670g pump, and upload through 600SeriesAndroidUploader (Indra 0.6.1), via OTG USB cable connected to a Contour Next Link 2.4. NS version is 0.10.3-master-20180805, and this issue has existed in all previous versions of NS I've used, and I've only used this version of the uploader.

Originally I assumed this was due to the pump reporting differently than others, but as I've learned more about how this system of devices works it seems like it may be the uploader, instead.

I'm not familiar enough with coding or compiling android apps to test this myself, hopefully providing this information helps.

First issue: Reservoir change reporting

When the reservoir is changed, the MongoDB entry is:

"created_at": "2018-08-20T09:56:14-05:00", "eventType": "Site Change", "key600": "MISC80936B0E", "notes": "Reservoir changed"

Nightscout interprets this as a site change, and not a reservoir change. I may be completely wrong, but if the eventType for reservoir changing was "Insulin Change" it should be seen correctly by nightscout.

If line 61 of app\src\main\java\info\nightscout\android\model\medtronicNg\PumpHistoryMisc.java

type = "Site Change";

were changed to

type = "Insulin Change";

It seems like it would report it properly to Nightscout, and not interfere with the user's CAGE pill.

Second issue: Site change reporting.

The MongoDB entry for an actual site change, when the cannula is primed, is:

"absolute": 0, "created_at": "2018-08-19T22:25:36-05:00", "duration": 0, "eventType": "Temp Basal", "key600": "SUSPEND8092C930", "notes": "Pump suspended insulin delivery: Set change suspend"

But this is not something that NS reports, so the CAGE pill doesn't get updated.

Looking at app/src/main/java/info/nightscout/android/model/medtronicNg/PumpHistoryBasal.java line 78 starts to deal with reporting suspensions.

It seems that if there was a check added for the suspend reason "SET_CHANGE_SUSPEND" that would generate an "eventType": "Site Change" entry to upload, that this would correctly report site changes to Nightscout.

Severity: 2

Losing track of how old a site is can cause some minor issues, but this is not a major issue since there are manual methods of adding this information.

Finally, thank you to everyone involved with this uploader, it's a huge benefit to me and many others.

cfaagaard commented 6 years ago

I think it is the same issue as this one: https://github.com/pazaan/600SeriesAndroidUploader/issues/180

Pogman commented 6 years ago

Yeah #180 deals with this and IAGE and CAGE are being reworked for v0.7.0.

Pogman commented 6 years ago

@loztblaz feel free to add to the discussion on that issue - it turns out there are multiple ways users do their changes and these may or may not have the equivalent history events to base NS entries on.