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

Adding sports/exercise, heart rate and sleep information to the NS database #5635

Open
juehv opened this issue Apr 25, 2020 · 7 comments
Open

Comments

@juehv
Copy link

juehv commented Apr 25, 2020

Is your feature request related to a problem? Please describe.
We at Technical University Darmstadt are researching CGM prediction algorithms. We used NS Datasets in the past, and supporting people often offer NS database dumps. We figure that it's helpful to consider readings from fitness trackers such as sport, exercise, heart rate, stress, and sleep information that is sadly not available in NS. We think it would be beneficial to combine the data at one point and we think NS is the right place, as some apps (such as xDrip) already reading that information but not uploading (as it is not supported).

Describe the solution you'd like
We would like to have a plugin (or multiple depending on the design) to save the sport, exercise, heart rate, stress, and sleep information. We propose the following format for the entry table:

[
{
"type": exercise,
"dateString": ISO string,
"date": unix timestamp,
"duration": duration of exercise whereby date is the end point,
"load": [low, mid, high, null]
}
]

[
{
"type": [hr, stress],
"dateString": ISO string,
"date": unix timestamp,
"value": [heart rate in hz or stress as integer from fitness tracker usually between 0 and 100]
}
]

[
{
"type": sleep,
"dateString": ISO string,
"date": unix timestamp,
"duration": duration of sleep whereby date is the end point,
"phase": [light, deep, rem, null]
}
]

According to the developer guide, we open this issue first, to get feedback from the community and find people to help us developing the plugin.

@miriamkw
Copy link

miriamkw commented Oct 18, 2023

Hi @juehv, I see I am three years late for this post, but are you still interested in adding these features? I am willing to contribute in the development.

@bewest
Copy link
Member

bewest commented Oct 18, 2023

Howdy all, I'll add this as a project/discussion. Would anyone be interested in helping to lead a regular digital meeting for people interested in this topic? I've talked to 4 or 5 folks over the last year who are interested in this in addition to other metrics. There are three other major themes that also require some major work: profiles (make suitable for modern AID expectations), reports: reproducible and accuracy, security and authentication. This area discussing additional data is worthwhile and requires a fair amount of collaboration to make it successful.

If someone can volunteer to lead a meeting, I can make sure the variety of folks I've talked to that are interested in this are invited.

@miriamkw
Copy link

Sounds interesting, Ben! I see you (?) have already created a route for /activity in the API.

I could lead a meeting in terms of scheduling and planning an agenda. However, as I am new to the repository and not yet proficient in implementing best practices, I would prefer to follow instructions rather than giving them.

@juehv
Copy link
Author

juehv commented Nov 7, 2023

@miriamkw @bewest I'm still interested in the feature, but I thought back in the day, with the low feedback it won't have any chance to be merged to master. Let me know when you start the planning and meeting phase!

@miriamkw
Copy link

miriamkw commented Nov 7, 2023

@miriamkw @bewest I'm still interested in the feature, but I thought back in the day, with the low feedback it won't have any chance to be merged to master. Let me know when you start the planning and meeting phase!

Did you ever develop this, although it did not get merged?

I am working on some code for this. However, the purpose is only to run some experiments just for fun, to test real-time CGM prediction algorithms (on myself), not for large-scale research projects. My solution consists of (1) writing a python api defining schemas for reading and writing to the "/activity" route in NS, and (2) developing an iOS application that uploads my Apple Watch data to the NS API in real-time. Let me know if you are interested in the code.

@juehv
Copy link
Author

juehv commented Nov 8, 2023

No I didn't develop any of this. I hat some tries in AAPS which never got merged as the features where not welcome. Since then I ask first to make sure the work is not wasted.

Your plan sounds very interesting. I'd love to hear more about the cgm prediciton algorithms :)

@miriamkw
Copy link

miriamkw commented Nov 11, 2023

Your plan sounds very interesting. I'd love to hear more about the cgm prediciton algorithms :)

The prediction algorithms were just off-the-shelf models and others implemented models (for example from KDH). I created an iPhone app and tested different algorithms in my treatment, using input features also for physical activity, sleep etc. Looking forward, I want to prototype new models, based on the weaknesses I found.

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

3 participants