HealthKit is an essential framework that integrates first- and third-party health and fitness data to help people manage their personal health information. Learn about HealthKit's latest updates, which provide read access to electrocardiograms on Apple Watch and log and track over a dozen new symptoms and their severity. We'll also go through the latest mobility data types like walking speed and step length to help people monitor and understand their mobility over time.
Hello, everyone, and welcome to "What's New in HealthKit." My name is Netra, and I'm a software developer on the HealthKit team.
We have some exciting new developments in HealthKit to share with you, and we can't wait to see what you do with them.
The first thing I want to share with you is the ability to track symptoms in HealthKit.
Tracking symptoms is an important aspect of monitoring health data. Our users might want to track a wide range of symptoms. This could be shortness of breath, sleep or appetite changes, or simply a running nose.
Symptoms offer valuable insights into your health. They can also help you or your doctor make informed decisions about diagnoses or treatment. This year, we are proud to introduce 30 symptom data types to HealthKit.
We have attempted to cover a wide range of symptoms.
Developers can now read and write symptom samples in order to build virtual health experiences in their apps. We can't wait to see the amazing apps you create using these symptom data types.
We recently introduced the ECG App on Apple Watch. An ECG, or electrocardiogram, is a test that records the electrical pulses that make up a heartbeat.
By looking at an ECG, a doctor can gain critical insights about your heart rhythm, and also look for irregularities in it.
The ECG App on Apple Watch can recall heartbeat and heart rhythm using the electrical sensors on the Digital Crown.
These waveforms can be viewed in the Health app, and they can also be exported as PDFs to a doctor.
This year, we're putting the power of ECG in the hands of all you developers.
In the latest version of iOS and watchOS, ECG samples will be available for reading.
An ECG sample can be read as an HKElectrocardiogram.
An HKElectrocardiogram represents a waveform as a series of voltage values.
Now, this sample has some important properties associated with it.
When you take an ECG on Apple Watch, the recording is checked for atrial fibrillation.
Atrial fibrillation is a form of irregular rhythm.
It signifies that the upper and lower chambers of your heart are out of rhythm.
After a successful recording, Apple Watch will give you the result of the recording.
The result is in the form of a classification.
The classification can be a sinus rhythm, which means that the heart is beating in a uniform pattern.
Or it can be atrial fibrillation.
Atrial fibrillation implies an irregular heart rhythm.
It is an indication that the user should probably go see their doctor.
If Apple Watch is unable to determine the ECG result, either due to a low or a high heart rate, or due to any other reason, the result is considered inconclusive.
There are some more important properties that make up an HKElectrocardiogram sample.
The next one is the symptomsStatus.
It tells us if the user associated a symptom with this ECG.
We already saw the new symptom data types introduced this year.
When a user takes an ECG, quite often it's because they have a symptom they are experiencing. This could be heartburn or tightness in their chest.
The symptom experienced can be recorded along with the ECG.
As mentioned earlier, the HKElectrocardiogram sample is a collection of voltage measurements.
The sample is backed by more properties that describe the measurements. These include the average heart rate, the sampling frequency and the number of voltage measurements.
The number of voltage measurements refers to the individual voltage measurements that make up an ECG sample.
To retrieve the individual measurements, you can run the HKElectrocardiogramQuery.
You can fetch the ECG samples via any of the HealthKit queries and then initialize the HKElectrocardiogramQuery with the fetched sample.
When this query is executed on the health store, you get the individual voltage measurements backing the ECG in the data handler.
Electrocardiograms are an important diagnostic tool for heart health. Another important metric of the user's health is their mobility. These are metrics that gauge a user's functional exercise capacity, or their ability to do aerobic work.
Mobility is strongly tied to respiratory diseases and heart health.
Mobility is especially important for patients recovering from an injury, or aging individuals.
Mobility metrics are usually measured across a period where the user is walking without stopping on a flat surface. Your iPhone or Apple Watch can also record some of this data during bouts of walking. HealthKit is proud to introduce a new set of mobility types this year.
The first is the walking speed and step length.
Walking takes strength, fitness, balance, and coordination.
Changes in any of these areas could affect your walking speed and step length.
This may also decline with age, injury, pain, or illness.
Balance and coordination are captured by the walking asymmetry and double support percentage.
The next one is the stair ascent and descent speed.
They are an indication of your cardiovascular health, balance and coordination.
Finally, the six-minute walk test distance is a frequent clinical test for mobility.
The more mobile and fit you are, the higher this number will be.
These data types are available for reading and writing on the latest iOS and watchOS.
We have introduced some major features in HealthKit this year. These include symptoms, the HKElectrocardiogram sample and the HKElectrocardiogramQuery, and the mobility data types.
We are so excited to see how you take advantage of all these new types, and we look forward to seeing all the amazing apps that you create.
Go build great health apps, and as always, let us know if you have any feedback for us.
Thank you for watching. Have a great a WWDC.
Looking for something specific? Enter a topic above and jump straight to the good stuff.
An error occurred when submitting your query. Please check your Internet connection and try again.