As announced last month, Apple has published ResearchKit, its open source framework aimed at enabling the use of mobile devices as a network of sensors for medical research.
Besides the source code for the framework proper and its documentation, ResearchKit GitHub repository also includes a sample app made by Apple and four of the apps that were initially published on the App Store by several medical research institutions.
As InfoQ already reported, ResearchKit provides three modules to address common requirements of medical research: surveys, consent, and active tasks. From a design point of view, the three modules share the same basic philosophy:
- Every operation is a collection of steps (ORKStep), such as a ORKQuestionStep, a ORKFormStep, or a ORKActiveStep.
- Steps are collected together in a task (ORKTask protocol), such as an ORKOrderedTask, that represents a sequence of steps.
- Tasks can be associated to a view controller (ORKTaskViewController) to be presented to the user.
- For each step that the user completes, the view controller generates a result object (ORKStepResult) that contains the result returned from the step and the operation timestamps. In particular, for steps that get data from any device sensors or HealthKit, two classes are provided: ORKRecorder and ORKRecorderConfiguration, which collaborate to collect and configure data into a serialized format.
Most of the code in the ResearchKit framework is written in Objective-C, while the provided sample, ORKCatalog, is written in Swift.
The four apps included within the repo are:
- GlucoSuccess: an app to study diabetes developed by Massachusetts General Hospital.
- AsthmaHealth: an app studying Asthma, developed by Mt Sinai.
- ShareTheJourney: an app studying Breast Cancer, developed by Sage Bionetworks.
- mPower: an app studying Parkinson's disease, developed by Sage Bionetworks and University of Rochester.
The four apps share a common framework called AppCore that include features that over time "will be migrated into ResearchKit," including:
- Dashboard with progress graphs.
- Data storage back end.
- JSON serialization and deserialization.
- Integration with Sage Bionetworks' Bridge service.
For further exploration, you can clone the GitHub repo, read the overview document, or the API reference. Additionally, in keeping with the tradition started with Swift blog, ResearchKit has its own blog, and a mailing list.