carekit-apple / CareKit

CareKit is an open source software framework for creating apps that help people better understand and manage their health.
https://www.researchandcare.org
Other
2.41k stars 443 forks source link

Deactivating and reactivating a task #511

Open Hatsushira opened 4 years ago

Hatsushira commented 4 years ago

I have created tasks for recording vital signs. They can be recorded throughout the day at any time and as often as needed. Usually, they don't have to be monitored all the time. I could add and delete a task for monitoring heart rate every time I need it, but then it will have a new taskid everytime I create a new one. My goal is to be able to track the vital signs over time. So, for example, all the heart rates that were ever tracked in show them in a custom report. When the task would have the same id everytime, that would be easier.

Do you plan something similar in the near future to implement? For the time being I could find a workaround with userinfo array and create a setting in it.

erik-apple commented 4 years ago

What is the goal of activating and deactivating the task? Is the goal to make it stop appearing queries until it is reactivated?

It sounds like using tags or groupIdentifier may be a good route for you. If you update your task to include, for example, a "deactivated" tag, then when you query for tasks, you can choose to return only tasks that don't have that tag. When you're ready to reactivate your task, just update it again, removing the tag/groupIdentifier.

Hatsushira commented 4 years ago

Yes, exactly. I have tasks for measuring body values like heart rate, oxygen, blood pressure. Or more general, all tasks you can measure and aren't necessary all the time. The reason why I don't want to add a new task is because I want to use the task ID to compare the values of the different time periods. When I create new tasks I have to use a different id. When I export the data it's easier to have the same id.

Thanks for your suggestion, I will go for it.