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

Fix mmol Units for Therapy Event in NS #1094

Closed
wants to merge 1 commit into from

Conversation

Philoul
Copy link
Contributor

@Philoul Philoul commented Dec 24, 2021

Fix #1085
But it's a workaround (I suppose root cause is a bug in NS or somewhere else in AAPS but I can't find it)
=> See informations below to help fix root cause (I don't like this kind of workaround...)

When BG value (glucose) associated to a therapyEvent is in mmol unit, there are 2 additional entries in json string (targetTop and targetBottom).
These 2 entries are null but when added, glucose units (mmol) is replaced by mg\/dl in json string so units is wrong for glucose value in received json string.

json string received for BG Check if units is mgdl:

{
	"_id":"61c599ee1d52ca0004ae55f7",
	"eventType":"BG Check",
	"isValid":true,
	"created_at":"2021-12-24T09:58:49.000Z",
	"enteredBy":"AndroidAPS",
	"units":"mg\/dl",
	"notes":"test bg",
	"glucose":144,
	"glucoseType":"Sensor",
	"mills":1640339929000,
	"mgdl":144
}

json string received for BG Check if units is mmol:

{
	"_id":"61c599251d52ca0004ae55f2",
	"eventType":"BG Check",
	"isValid":true,
	"created_at":"2021-12-24T09:55:28.000Z",
	"enteredBy":"AndroidAPS",
	"units":"mg\/dl",
	"notes":"test mmol",
	"glucose":8.055555555555555,
	"glucoseType":"Sensor",
	"mills":1640339728000,
	"mmol":8.055555555555555,
	"targetTop":null,
	"targetBottom":null
}

@MilosKozak
Copy link
Contributor

I analyzed the problem and it is in NS. I reported it to @sulkaharo .
We should wait for NS patch instead of making workarounds.
Thanks!

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.

2 participants