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

OCKPatient restricted to 1 patient or an initial set of patients #438

Open
cbaker6 opened this issue May 22, 2020 · 1 comment
Open

OCKPatient restricted to 1 patient or an initial set of patients #438

cbaker6 opened this issue May 22, 2020 · 1 comment

Comments

@cbaker6
Copy link
Contributor

cbaker6 commented May 22, 2020

When using CareKit for a provider facing app, OCKStore will need to have multiple patients. Currently, OCKStore.validateNumberOfPatients() prevents this after the initial add of 1 or a set of patients. Is possible to remove this?

I can submit a PR if supporting multiple patients sounds reasonable and won't cause issues in the data store.

@cbaker6
Copy link
Contributor Author

cbaker6 commented Jun 16, 2020

Thinking more about what @erik-apple mentioned

... probably needs to be paired together with some other considerations, like updating the OCKDailyTasksPageViewController to make sure it show the tasks for 1 specific patient.

A PR for this seems much larger than I originally anticipated. In CareKit's current form, it seems supporting 1 patient allows for the assumption that all entities created in a CareKitStore belongs to the respective patient. In this manner, you don't have to worry about things like ACLs (I don't remember seeing anything related to ACLs in the CareKitStore, but for 1 patient ACLs also don't seem needed). My initial thoughts are ACLs can be handled in 1 of 2 ways:

  1. Add ACL support to all entities
  2. Leave ACLs to the vendors using OCKRemoteSynchronizable, meaning they should only allow pullRevisions or pushRevisions for entities a particular user has access to. This seems okay in my opinion as most remotes should have some notion of ACL already because they are handling user login etc..

The other item that seems important is fetching entities, essentially all fetches are able to fetch anything from the CareKitStore. If support for multiple patients are added, it seems something similar to @NSManaged var patient: OCKCDPatient? in OCKCDCarePlan could be added to the rest of the OCKCD... (except for OCKCDPatient) and all queries should add the ability to fetch by OCKPatient.uuid or OCKPatient.id (I'm thinking OCKPatient.id fetches may be used more for these types of scenarios). This will probably change up the initializers of all of the OCKStructs also as they will probably all need to accept OCKPatient as an argument.

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

1 participant