We’ve been working on a new version of the Aerobic session type. We have the following goals:

  • Split out the session sample data (such as heart rate samples) so that you only load the data that you want to use.
  • Generalize the sample data approach to allow new types of samples to be stored.
  • Reduce the amount of space taken to store the sample data.
  • Simplify the approach used by the Aerobic profile class to make it more minimal and easier to extend.
  • Generalize the type so that it can be used for more casual exercise scenarios (walking 30 minutes, playing golf, etc. )

We are proposing the following:

Exercise type

Element Type Occurrence Description
when approx-date-time 1 The date and time when the exercise occurred
activity codable value 1 The overall activity for the exercise period, using a new exercise-activities vocabulary
title string 0..1 A descriptive title for the exercise.
Examples: Hiking up Mt. Baker, 3-day walk, Memorial day triathlon.
duration positiveDouble 0..1 The duration of the exercise in minutes.
detail exercise-detail 0..N Additional information about the exercise.

The detail information typically stores information that specific to the type of exercise activity and any device used to measure it.

Examples: Average heart rate, total distance, average temperature, intensity.

segment exercise-segment 0..N Information pertaining to a portion of the overall exercise.
This is typically used to store information about separate laps in a race or individual events within a triathlon.

The big changes here are that mode has been pulled out of the aerobic profile type and promoted to the top level, and the rest of the items from aerobic profile are now stored using a general exercise-detail type.

And, of course, samples are removed from this type. The exercise samples that are related to this instance are listed on the exercise’s related items list.

Exercise Detail sub type

This type stores an single item of detail about an exercise. 

Element Type Occurrence Description
name codable value 1 The name of the information stored in this detail.

The keys are defined in the exercise-detail-name vocabulary.

The units of the information are encoded in the vocabulary key.
Example: Average heartrate uses the key AverageHeartrate_BPM.
Example: Distance uses the key Distance_meters.
value general-measurement 1 The value of the detail.

The name defines the unit to be used for the structured part of the value.

Additionally, the friendly version is stored in the display text.

For example, a distance of 5.3 miles should be stored directly in the display text, and converted to meters and stored in the structured value with a unit of meters (from the exercise-units vocabulary)

All the items that used to be stored in aerobic profile are stored using this type.

Exercise Segment sub type

This type is used to store information about a portion of an overall exercise, such as separate laps in a race or individual events in a triathlon.

Element Type Occurrence Description
title string 0..1 A descriptive title for this segment.
Examples: Lap 1, bicycle leg, first half.
activity codable value 1 The activity for this segment, using a new exercise-activities vocabulary
offset nonNegativeDouble 0..1 The offset of this segment from the start of the exercise, measured in minutes.
duration positiveDouble 0..1 The duration of the segment in minutes.
detail exercise-detail 0..N Additional information about the segment.

This is a simple refactoring of the lap session part of the aerobic session type. It stores details in the same manner as the overall exercise. Segments store both their offset and duration, which supports scenarios where segments are not contiguous.

Exercise Samples type

This type stores a collection of sample data, such as heart rate samples or position samples.

Element Type Occurrence Description
when approx-date-time 1 The date and time of the first sample.
name codable value 1 The kind of information that is stored in the samples.
Vocabulary: exercise-sample-names
unit codable value 1 The unit of measure for the samples.
Vocabulary: exercise-units.
sampling-interval positiveDouble 1 The sampling interval in seconds.

The kind of data that is stored and the units it is expressed in are defined through setting the name field. For example, if you want to store power, you would code the Power_watts key (exercise-sample-names vocab) for name, and then you would code Watts (exercise-units vocab) for the unit field.

The sample data is stored in the other-data section of the object, and stored using the HealthVault CSV data format (which will be covered in a post in the near future). HealthItemRecordSections.OtherData must be specified when fetching a sample instance to include the associated sample data. There will very likely be an SDK helper class to make it easy to read and write this data.

The HealthVault CSV data format supports escapes in the list of data values. The exercise sample type supports a single escape:

SamplingInterval=n

Which resets the sample interval to n seconds for all the samples that follow it.