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

Support for 'cleaned' medtronic history #66

Closed
oskarpearson opened this issue Feb 8, 2016 · 2 comments
Closed

Support for 'cleaned' medtronic history #66

oskarpearson opened this issue Feb 8, 2016 · 2 comments

Comments

@oskarpearson
Copy link
Contributor

Hi

Note: this bug could possibly lead to carb values being "doubled-up" in the meal-assist algorithm, leading to problems.*

There are apparently situations where openaps-mmhistorytools finds and removes duplicate carb values. (See below for details.)

Currently, if you supply the dev branch with a history that's been cleaned with openaps-mmhistorytools, the meal code doesn't correctly interpret carb values.

The mmhistorytools code ejects a value like this:

  {
    "amount": X, 
    "start_at": "2016-02-08T21:54:19", 
    "description": "BolusWizard: Xg", 
    "type": "Meal", 
    "unit": "g", 
    "end_at": "2016-02-08T21:54:19"
  }, 

More examples are at https://github.com/loudnate/openaps-mmhistorytools/blob/master/tests/historytools_tests.py#L970-L979 and https://github.com/loudnate/openaps-mmhistorytools/blob/master/tests/historytools_tests.py#L165 shows a case with bolus wizard duplicates.

https://github.com/openaps/oref0/blob/dev/lib/meal/history.js#L20-L34 is currently where the parsing happens in oref0.

This would need to change the oref parsing code to:

  1. Expect a 'munged' data file (ie, by removing the existing code that contains 'Bolus' or 'BolusWizard', so as to break compatibility with files that could contain duplicate information
  2. See if there are any differences in the 'munged' data for Bolus vs BolusWizard values (one expects a bolus value, one expects a carb value)
  3. Find all entries of type "Meal"
  4. Use the 'start_at' value as a replacement for timestamp
  5. Use 'amount' as the 'carbs' value
  6. Check the unit is always 'g' (in case some strange measurement is presented down the line in a different region

CC @loudnate

@scottleibrand
Copy link
Contributor

Is this still an issue? Is anyone still using openaps-mmhistorytools who could help us with a fix?

@oskarpearson
Copy link
Contributor Author

I'll check in with Nate about it - but since we're running the latest oref0 setup scripts without this (and things are working ok) I think we can close this.

I'll re-open if it turns out to still be an issue.

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