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

rewind, prime and battery indicates change #1409

Merged
merged 4 commits into from
Dec 11, 2021
Merged

Conversation

Foxy7
Copy link
Contributor

@Foxy7 Foxy7 commented Sep 22, 2021

Added optional preferences to enable automatice update of Cannula, Insulin and Battery Age on Nightscout.

@Foxy7
Copy link
Contributor Author

Foxy7 commented Sep 22, 2021

updated doc too. openaps/docs#1571

@Foxy7
Copy link
Contributor Author

Foxy7 commented Sep 24, 2021

  • actually i was going to set this so it was only fixed primes that get picked up. thought i had, but will check again. therefore manual primes would be ignored by "prime indicates change".

added filter for "fixed" primes only to count as site change. therefore manual primes will be ignored.
@Foxy7
Copy link
Contributor Author

Foxy7 commented Sep 27, 2021

linke to doc update: openaps/docs#1571

@Foxy7
Copy link
Contributor Author

Foxy7 commented Sep 27, 2021

example output:

{
  "timestamp": "2021-09-27T22:10:34+01:00",
  "_type": "Prime",
  "id": "AwADAAOiShYbFQ==",
  "amount": 0.3,
  "fixed": 0.3,
  "type": "fixed",
  "medtronic": "mm://openaps/mm-format-ns-treatments/Prime",
  "created_at": "2021-09-27T21:10:34.000Z",
  "enteredBy": "openaps://medtronic/722",
  "eventType": "Site Change",
  "notes": "Prime 722 ",
  "utcOffset": 60
}
{
  "timestamp": "2021-09-27T21:57:03+01:00",
  "_type": "Prime",
  "id": "AwAAAEODeTUbFQ==",
  "amount": 6.7,
  "fixed": 0,
  "type": "manual",
  "medtronic": "mm://openaps/mm-format-ns-treatments/Prime",
  "created_at": "2021-09-27T20:57:03.000Z",
  "enteredBy": "openaps://medtronic/722",
  "eventType": "Note",
  "notes": "Prime 722 ",
  "utcOffset": 60
}
{
  "timestamp": "2021-09-27T21:54:59+01:00",
  "_type": "Rewind",
  "id": "IQC7dhUbFQ==",
  "medtronic": "mm://openaps/mm-format-ns-treatments/Rewind",
  "created_at": "2021-09-27T20:54:59.000Z",
  "enteredBy": "openaps://medtronic/722",
  "eventType": "Insulin Change",
  "notes": "Rewind 722 ",
  "utcOffset": 60
}

image

@scottleibrand
Copy link
Contributor

Can you confirm (have you tested?) that this only affects pills on Nightscout, and doesn't affect OpenAPS behavior in any way? If so, I'll probably s/cartridge/reservoir/g and then go ahead and merge it.

@jimrandomh
Copy link
Contributor

Nice, this solves a pain point for me (currently pump-site-change is the only thing I'm entering directly in Nightscout, everything else I enter through the pump).

@scottleibrand
Copy link
Contributor

@jimrandomh can you test it from this branch and confirm the intended behavior? Or would I need to merge it to dev first?

@jimrandomh
Copy link
Contributor

I'll be testing it (and don't need it merged to dev to do so).

@jimrandomh
Copy link
Contributor

I have been using this for a week and it seems to be working correctly. It updates the pills in Nightscout in the expected way.

@scottleibrand scottleibrand merged commit 1954758 into openaps:dev Dec 11, 2021
@Foxy7
Copy link
Contributor Author

Foxy7 commented Dec 15, 2021

Thanks both. yes to confirm only impacts NS pill, not OpenAPS at all.

@Foxy7 Foxy7 deleted the dev branch December 15, 2021 10:39
@szymjaw
Copy link
Contributor

szymjaw commented Dec 30, 2021

It's not working for me.
Prime tretment in 'monitor/pumphistory-24h-zoned.json'

{
"timestamp": "2021-12-30T11:15:57+01:00",
"_type": "Prime",
"id": "AwAAAEj5DyseFQ==",
"amount": 7.2,
"fixed": 0,
"type": "manual"
}

after mm-format-ns-treatments.sh format

{
"timestamp": "2021-12-30T11:15:57+01:00",
"_type": "Prime",
"id": "AwAAAEj5DyseFQ==",
"amount": 7.2,
"fixed": 0,
"type": "manual",
"medtronic": "mm://openaps//root/src/oref0/bin/oref0-log-shortcuts.sh/Prime",
"created_at": "2021-12-30T11:15:57+01:00",
"enteredBy": "openaps://medtronic/",
"eventType": "Note",
"notes": "Prime "
}

whe I remove "and .type == "fixed" " from mm-format-ns-treatments.sh

{
"timestamp": "2021-12-30T11:15:57+01:00",
"_type": "Prime",
"id": "AwAAAEj5DyseFQ==",
"amount": 7.2,
"fixed": 0,
"type": "manual",
"medtronic": "mm://openaps//root/src/oref0/bin/oref0-log-shortcuts.sh/Prime",
"created_at": "2021-12-30T11:15:57+01:00",
"enteredBy": "openaps://medtronic/",
"eventType": "Site Change",
"notes": "Prime "
},

@Foxy7
Copy link
Contributor Author

Foxy7 commented Jan 12, 2022

@szymjaw this is correct, a "manual" prime won't trigger the NS eventType change and will only be shown as a note.

This is because the usual process is that the medtronic pump is rewound, the tubing is manually primed and finally a 0.3 fixed prime (infusion set dependent) is used to fill the cannula. Hences the code only picks up two events, rewind and fixed prime.

In the past we have used manual prime to add insulin which won't be counted by OpenAPS, e.g. after the pump was disconnected for a shower, we'd do a small manual prime to make up for missed insulin without OpenAPS double counting.

@danamlewis danamlewis mentioned this pull request Jun 19, 2022
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.

4 participants