HealthVault Data Types: HealthRecordItem

The type system of HealthVault is a bit different from some of the others I’ve worked with, so I thought I’d write a few posts talking about it.

The root type is HealthRecordItem. I’m going to talk about the more commonly-used properties, but there are some that I’ll skip, and I’m going to gloss over some other stuff for now. Also note that like object in the .net world, you usually don’t use it but instead use a derived type instead.

First up is the CommonData property, which contains, well, the common data that is shared across all types. Note is a textual note associated with the data item (typically from the user), source is text that described where the data came from (could be an application name, could be a device name). It’s also possible to stuff additional “custom” XML here to augment an existing data type…

EffectiveDate typically represents the date when the data was taken, though it only makes sense for some derived types (for example, AerobicSession exposes it, AerobicData doesn’t).

Key.Id is a unique key (a GUID) for this item, so that when we want to go update/delete the item, we know which one to update/delete.  Whenever an item is modified, Key.VersionStamp is updated to a new value, so that you can tell whether a specific data item has been updated or not.

OtherData is a place to store non-xml data associated with the type, such as images or other binary files.

TypeSpecificData contains the “raw XML” that is associated with the instance. It’s can be used for types that are defined in HealthVault but have no associated .NET class.

TypeId is a guid that uniquely identifies this type of data – it’s analogous to a System.Type instance in the .Net runtime.


Comments (2)

  1. HealthVault says:

    I wrote a few articles about data types on my blog: HealthRecordItem Weight, measurements, and display

  2. In my previous posts, I kindof glossed over the different kinds of data types you might have in your