ResearchKit Reference
The ResearchKit™ framework is an open source framework that developers and researchers can use to create apps that let iOS users participate in medical research.
This is the API documentation for the ResearchKit framework. For an overview of framework and a more general guide to using and extending the framework, see the Programming Guide.
Constructing Tasks
ResearchKit tasks are actions to be performed by participants in a research study. Tasks are the building blocks for ResearchKit modules, which address the most common components of medical studies: surveys, consent documents, and active tasks.
Tasks are constructed using a hierarchy of model objects. At the root of the hierarchy is an ORKOrderedTask object (or another object that implements the ORKTask protocol). The task defines the order in which steps are presented, and how progress through the task is represented.
A task consists of steps, which are subclasses of ORKStep. Most steps are designed for data presentation or data entry, but the ORKActiveStep subclasses can also enable data collection. The ORKQuestionStep and ORKFormStep survey step classes describe a question to be asked. The format of the answer is modeled with subclasses of ORKAnswerFormat.
Presenting Tasks
To present a task, you create an ORKTaskViewController object and give it the task. The task view controller manages the task and returns the result through delegate methods.
For each step, ORKTaskViewController instantiates an appropriate subclass of ORKStepViewController to display the step.
Getting Results
The result
property of ORKTaskViewController provides the results of the task, both while the task is in progress, and upon completion of the task.
Results are constructed with a hierarchy that’s similar to the task model hierarchy. In the hierarchy for a result, ORKTaskResult is the root and ORKStepResult objects form the immediate children.
For survey question steps, the answers collected are reported as ORKQuestionResult objects, which are children of ORKStepResult. Active steps may include additional result objects as children, depending on the types of data that are recorded. To help you get data from various device features, such as the accelerometer or HealthKit, the ResearchKit framework provides the ORKRecorder and ORKRecorderConfiguration classes, which work together to collect and configure data into a serialized format during the duration of an active step.
Predefined Active Tasks
An active task invites users to perform activities under semi-controlled conditions, while iPhone sensors actively collect data. A category on ORKOrderedTask provides factory methods for generating ORKOrderedTask instances that correspond to ResearchKit’s predefined active tasks, such as the short walk or fitness task.
Consent
The consent features in the ResearchKit framework are implemented using three special steps that can be added to tasks:
ORKVisualConsentStep. The visual consent step presents a series of simple graphics to help participants understand the content of an consent document. The default graphics have animated transitions.
ORKConsentSharingStep. The consent sharing step has predefined transitions that can be used to establish user preferences regarding how widely personal data can be shared.
ORKConsentReviewStep. The consent review step makes the consent document available for review, and provides facilities for collecting the user’s name and signature.
Creating the visual consent step and the consent review step requires a consent document model (that is, an ORKConsentDocument object).
In addition to the consent steps, ORKPDFViewerStep
displays a PDF document. The user can search, marked up, and share the PDF document from within the step.
Programming Guides
Class References
- ORKAccelerometerRecorder
- ORKAccelerometerRecorderConfiguration
- ORKActiveStep
- ORKActiveStepViewController
- ORKAmslerGridResult
- ORKAnswerFormat
- ORKAudioLevelNavigationRule
- ORKAudioRecorder
- ORKAudioRecorderConfiguration
- ORKBarGraphChartView
- ORKBooleanAnswerFormat
- ORKBooleanQuestionResult
- ORKBorderedButton
- ORKChoiceQuestionResult
- ORKCollectionResult
- ORKCollector
- ORKCompletionStep
- ORKCompletionStepViewController
- ORKConfirmTextAnswerFormat
- ORKConsentDocument
- ORKConsentReviewStep
- ORKConsentReviewStepViewController
- ORKConsentSection
- ORKConsentSharingStep
- ORKConsentSharingStepViewController
- ORKConsentSignature
- ORKConsentSignatureResult
- ORKContinuousScaleAnswerFormat
- ORKCountdownStep
- ORKCountdownStepViewController
- ORKDataCollectionManager
- ORKDataLogger
- ORKDataLoggerManager
- ORKDateAnswerFormat
- ORKDateQuestionResult
- ORKDeviceMotionRecorder
- ORKDeviceMotionRecorderConfiguration
- ORKDirectStepNavigationRule
- ORKDiscreteGraphChartView
- ORKEmailAnswerFormat
- ORKEnvironmentSPLMeterStep
- ORKFileResult
- ORKFitnessStep
- ORKFitnessStepViewController
- ORKFormItem
- ORKFormStep
- ORKFormStepViewController
- ORKGraphChartView
- ORKHealthClinicalTypeRecorder
- ORKHealthClinicalTypeRecorderConfiguration
- ORKHealthCollector
- ORKHealthCorrelationCollector
- ORKHealthKitCharacteristicTypeAnswerFormat
- ORKHealthKitQuantityTypeAnswerFormat
- ORKHealthQuantityTypeRecorder
- ORKHealthQuantityTypeRecorderConfiguration
- ORKHeightAnswerFormat
- ORKHolePegTestResult
- ORKHolePegTestSample
- ORKImageCaptureStep
- ORKImageCaptureStepViewController
- ORKImageChoice
- ORKImageChoiceAnswerFormat
- ORKInstructionStep
- ORKInstructionStepViewController
- ORKJSONLogFormatter
- ORKKeyValueStepModifier
- ORKKeychainWrapper
- ORKLineGraphChartView
- ORKLocation
- ORKLocationAnswerFormat
- ORKLocationQuestionResult
- ORKLocationRecorder
- ORKLocationRecorderConfiguration
- ORKLogFormatter
- ORKLoginStep
- ORKLoginStepViewController
- ORKMotionActivityCollector
- ORKMultipleComponentQuestionResult
- ORKMultipleValuePickerAnswerFormat
- ORKNavigableOrderedTask
- ORKNavigablePageStep
- ORKNumericAnswerFormat
- ORKNumericQuestionResult
- ORKOrderedTask
- ORKPDFViewerStep
- ORKPSATResult
- ORKPSATSample
- ORKPageResult
- ORKPageStep
- ORKPageStepViewController
- ORKPasscodeResult
- ORKPasscodeStep
- ORKPasscodeStepViewController
- ORKPasscodeViewController
- ORKPedometerRecorder
- ORKPedometerRecorderConfiguration
- ORKPieChartView
- ORKPredicateSkipStepNavigationRule
- ORKPredicateStepNavigationRule
- ORKQuestionResult
- ORKQuestionStep
- ORKQuestionStepCustomView
- ORKQuestionStepViewController
- ORKRangeOfMotionResult
- ORKRangeOfMotionStep
- ORKReactionTimeResult
- ORKRecorder
- ORKRecorderConfiguration
- ORKRegistrationStep
- ORKResult
- ORKResultPredicate
- ORKResultSelector
- ORKReviewStep
- ORKScaleAnswerFormat
- ORKScaleQuestionResult
- ORKShoulderRangeOfMotionStep
- ORKSignatureResult
- ORKSignatureStep
- ORKSignatureStepViewController
- ORKSkipStepNavigationRule
- ORKSpatialSpanMemoryGameRecord
- ORKSpatialSpanMemoryGameTouchSample
- ORKSpatialSpanMemoryResult
- ORKSpatialSpanMemoryStep
- ORKSpatialSpanMemoryStepViewController
- ORKSpeechInNoiseStep
- ORKSpeechRecognitionStep
- ORKSpeechRecognitionStepViewController
- ORKSpeechRecognitonResult
- ORKStep
- ORKStepModifier
- ORKStepNavigationRule
- ORKStepResult
- ORKStepViewController
- ORKStreamingAudioRecorder
- ORKStreamingAudioRecorderConfiguration
- ORKStroopResult
- ORKTableStep
- ORKTableStepViewController
- ORKTappingIntervalResult
- ORKTappingSample
- ORKTaskResult
- ORKTaskViewController
- ORKTextAnswerFormat
- ORKTextButton
- ORKTextChoice
- ORKTextChoiceAnswerFormat
- ORKTextQuestionResult
- ORKTextScaleAnswerFormat
- ORKTimeIntervalAnswerFormat
- ORKTimeIntervalQuestionResult
- ORKTimeOfDayAnswerFormat
- ORKTimeOfDayQuestionResult
- ORKTimedWalkResult
- ORKToneAudiometryResult
- ORKToneAudiometrySample
- ORKTouchAnywhereStep
- ORKTouchRecorder
- ORKTouchRecorderConfiguration
- ORKTowerOfHanoiMove
- ORKTowerOfHanoiResult
- ORKTowerOfHanoiStep
- ORKTrailmakingResult
- ORKTrailmakingStep
- ORKTrailmakingTap
- ORKValuePickerAnswerFormat
- ORKValueRange
- ORKValueRangeGraphChartView
- ORKValueStack
- ORKVerificationStep
- ORKVerificationStepViewController
- ORKVideoCaptureStep
- ORKVideoInstructionStep
- ORKVideoInstructionStepResult
- ORKVideoInstructionStepViewController
- ORKVisualConsentStep
- ORKVisualConsentStepViewController
- ORKWaitStep
- ORKWaitStepViewController
- ORKWalkingTaskStep
- ORKWalkingTaskStepViewController
- ORKWebViewStep
- ORKWebViewStepResult
- ORKWebViewStepViewController
- ORKWeightAnswerFormat
Protocol References
- ORKDataCollectionManagerDelegate
- ORKDataLoggerDelegate
- ORKDataLoggerExtendedDelegate
- ORKDataLoggerManagerDelegate
- ORKGraphChartViewDataSource
- ORKGraphChartViewDelegate
- ORKPasscodeDelegate
- ORKPieChartViewDataSource
- ORKQuestionStepCustomViewDelegate
- ORKRecorderDelegate
- ORKStepViewControllerDelegate
- ORKTableStepSource
- ORKTask
- ORKTaskResultSource
- ORKTaskViewControllerDelegate
- ORKValueCollectionType
- ORKValueRangeGraphChartViewDataSource
- ORKValueStackGraphChartViewDataSource
Constant References
- ORKAmslerGridEyeSide
- ORKAudioChannel
- ORKBodySagittal
- ORKChoiceAnswerStyle
- ORKConsentSectionType
- ORKDateAnswerStyle
- ORKErrorCode
- ORKFileProtectionMode
- ORKMeasurementSystem
- ORKNavigationContainerButtonStyle
- ORKNumberFormattingStyle
- ORKNumericAnswerStyle
- ORKNumericPrecision
- ORKPDFViewerActionBarOption
- ORKPSATPresentationMode
- ORKPasscodeFlow
- ORKPasscodeType
- ORKPermissionMask
- ORKPredefinedTaskHandOption
- ORKPredefinedTaskLimbOption
- ORKPredefinedTaskOption
- ORKProgressIndicatorType
- ORKQuestionType
- ORKRegistrationStepOption
- ORKSpatialSpanMemoryGameStatus
- ORKStepViewControllerNavigationDirection
- ORKTappingButtonIdentifier
- ORKTaskViewControllerFinishReason
- ORKTremorActiveTaskOption