Getting movement disorder symptom data
Retrieve data from the Apple Watch’s movement disorder manager.
Overview
The CMMovementDisorderManager class provides a power-efficient approach for you to continuously measure and record tremors and dyskinetic symptoms for Parkinson’s disease for your app.
When you begin retrieving data from the movement disorder manager, Apple Watch starts to gather motion data. To preserve battery life, the manager doesn’t perform calculations in real time. Instead, it periodically and opportunistically analyzes the raw data, saving the results on the user’s device. To preserve disk space, the manager only keeps results for seven days. During this time, you can use the manager to query for the results.
For more information about the scientific validation and algorithms behind disorder detection and recording, see Smartwatch inertial sensors continuously monitor real-world motor fluctuations in Parkinson’s disease, or download a PDF from Science Translational Medicine Magazine.
Apps that use the CMMovementDisorderManager must:
Confirm the user’s diagnosis of Parkinson’s disease.
Only report on symptoms diagnosed by a clinician or self-reported by the user.
Remind the user to wear Apple Watch on their most affected arm in order to collect the most useful data.
To retrieve Parkinson’s tremors or dyskinetic symptoms data from a watchOS app:
Provide a motion usage description in your WatchKit extension’s
Info.plistfile.Instantiate a CMMovementDisorderManager object.
Ensure that movement disorder monitoring is available on the current device.
Begin monitoring the user.
Query for tremors or dyskinetic symptoms.
Provide the motion usage description
Your watchOS app must provide an NSMotionUsageDescription key with a String value in the WatchKit extension’s Info.plist file. The system displays the motion usage description whenever it asks a user for permission to record their data. The description string appears in the Motion and Fitness authorization prompt.
At a minimum, your description must contain the following text: “In addition, this app would like to access your tremor and dyskinetic symptom data. This is only intended for use in those already diagnosed with Parkinson’s disease.”
You can include additional information explaining why the user should grant your app permission, and what your app intends to do with the data after this text.
Monitor and query for results
The following example shows how to set up your movement disorder manager, and begin monitoring the user’s symptoms:
// Check to see if the movement disorder manager is available.
guard CMMovementDisorderManager.isAvailable() else {
// The movement disorder manager is not availble on this device.
return
}
// Instantiate the Movement Disorder Manager
movementDisorderManager = CMMovementDisorderManager()
// Start monitoring the user. The maximum duration is seven days.
movementDisorderManager.monitorKinesias(forDuration: 60.0 * 60.0 * 24.0 * 7.0)After you start monitoring, the manager leverages the CMSensorRecorder to record high-rate accelerometer data passively. When enabled, the CMSensorRecorder records 100 Hz samples. The movement disorder algorithms then periodically and opportunistically use this data to calculate tremors and dyskinetic symptoms.
The movement disorder manager stores the results of these calculations on the device for seven days. To access the results, use the manager to query for the desired results, as shown in this example:
// Get the end date for the last batch of results.
guard let endDate = movementDisorderManager.lastProcessedDate() else {
// The manager has not processed any results yet.
return
}
// Get the last batch of tremor results.
movementDisorderManager.queryTremor(from: previousDate, to: endDate) { (tremorResults, error) in
// Check for errors.
if let error = error {
// Handle the error here.
print("*** An error occurred: \(error.localizedDescription) ***")
return
}
// Do something with the tremor results here.
}
// Get the last batch of dyskinetic symptom results.
movementDisorderManager.queryDyskineticSymptom(from: previousDate, to: endDate) { (dyskineticSymptomResults, error) in
// Check for errors.
if let error = error {
// Handle the error here.
print("*** An error occurred: \(error.localizedDescription) ***")
return
}
// Do something with the dyskinetic symptom results here.
}
previousDate = endDateTo extend the monitoring past the initial expiration date, call the monitorKinesias(forDuration:) method again.
Understand the manager’s limitations
CMMovementDisorderManager measures resting tremors from Parkinson’s disease in the 3-7 Hz range. It returns metrics about the presence and relative severity of resting tremor as a CMTremorResult object. The CMMovementDisorderManager also computes metrics about choreiform dyskinetic symptoms, measuring the likely presence or absence of dyskinetic symptoms as observed at the wrist where the user wears their Apple Watch. It returns the results as CMDyskineticSymptomResult objects.
CMMovementDisorderManager operates under the following constraints:
The user should wear Apple Watch on the most affected arm.
Employ dyskinetic symptom tracking only for users who have chorea on the affected arm, either self-reported or diagnosed by a clinician.
There are many types of tremors. The movement disorder manager explicitly tracks resting tremor; it doesn’t track action tremor or postural tremor, and it may not track finger tremor.
The manager doesn’t explicitly track dystonia.
The results may include false positives and false negatives. The user’s activity, watch band fit, and concomitant conditions (such as restless legs syndrome and non-Parkinsonian tremor) can affect the quality of the results.
The manager only explicitly measures symptoms from the wrist wearing Apple Watch. However, Apple Watch may sense symptoms transmitted through the body from other affected body parts, possibly resulting in misleading or false metrics.