This document provides an overview of the HealthVault platform and developer tools. It notes that over 80 devices are connected to HealthVault, including weight scales, blood pressure monitors, and activity trackers. The document outlines the HealthVault data model and types, how to access data through APIs and SDKs, and how to create apps that integrate with HealthVault. It also provides resources for HealthVault developers, including documentation, forums, and code samples.
14. Candelis and
Microsoft Team Up to
Empower Patients
Patients can access and
control their medical images
Expectant couples can share
Ultrasound images of their
baby with loved ones
14
25. Data Model Design Principles
Interoperable
o We do our best to make our data types
transformable to and from industry
standards in actual use
Inclusive
o Strike a balance between fully
structured data and unstructured
information
o Types are designed to be as inclusive as possible with the ability to capture structure
when it is available, but still take in the data when structure is missing
o Encourage the use of standard vocabularies through UI, API and JSON interfaces
Just in Time
o Our data model is growing as we work with partners fluent in various domains
Independent
o As much as possible, keep application development simple by eliminating relationships
across data items
o Allow expression of connections but never rely on their existence for data integrity
25
26. 26
HealthVault data examples
Conditions, allergies and procedures from healthvault.com
Medications from Walgreens
Lab Results from MyMedLab
EOBs from Premera
Weight measurements from the HVCC Gadget and Withings Scale
Exercise sessions from MSN RouteTracker
Blood pressure readings from Omron
Genetic SNPs and analysis from Navigenics
Family History from the Surgeon General
Providers and appointments from Mayo
Health Assessments from Navigenics and H1N1
Medical images uploaded from HVCC
Passport and drivers license scans uploaded at healthvault.com
27. HealthVault Data Model
Things in HealthVault have common data elements as well as a schematized section specific to each type of data.
The common fields include:
Version Stamp: Identifies the specific instance of a thing. When a thing is created/updated, the version stamp changes.
TypeID: Specified the data type of the schematized portion of the thing.
Audits: The source of the data, when it was created/updated, by whom, etc.
Blobs: Allows unstructured data to be associated with structured data. Medical Images are a good example.
Signature: Optional Digital Signature on an item which can be used to validate integrity and source of data.
Related Items: Allows created relationships between things. For instance a Medication used to treat a Condition could be
linked through a Related Item.
Client ID: Allows apps to define their own identifiers
Notes: Free-form text notes
Data-XML: The schematized portion of a thing.
27
28. HealthVault Data Model
The schematized portion represents health domain types. For example: Weight Measurement represents a single
weight measurement.
Explore Data Types here: http://developer.healthvault.com/pages/types/types.aspx
XML representing a Weight Measurement:
<weight>
<when>
<date>
<y>2012</y>
<m>4</m>
<d>18</d>
</date> See the following for more information on the Data Model:
<time> HealthVault Data Types Weight, measurements and display values
<h>7</h>
<m>30</m> Vocabularies and CodableValue
</time>
</when> HealthVault Data Types - Custom Data Types
<value>
<kg>74.84274105165585</kg> What data type should I use?
<display units="pounds" units-code="lb">165</display>
</value>
</weight>
28
29. Accessing Data
In the XML API, there are two key web-service methods for accessing data, GetThings and
PutThings.
In the .NET SDK this functionality is wrapped in the following classes:
Microsoft.Health.HealthRecordAccessor for reading and writing data.
Microsoft.Health.HealthRecordSearcher for more advanced data querying.
To read all instances of Weight things in a Record:
HealthRecordSearcher searcher = PersonInfo.SelectedRecord.CreateSearcher();
HealthRecordFilter filter = new HealthRecordFilter(Weight.TypeId);
searcher.Filters.Add(filter);
HealthRecordItemCollection items = searcher.GetMatchingItems()[0];
29
30. 30
Detecting Data Changes
Apps may want to detect data changes in HealthVault Records to
which theyre authorized.
Options:
o Polling
In this approach the app calls GetUpdatedRecordsForApplication to detect Records authorized to
the app that have changed since a specific time.
The app can then read the data that has changed.
o Eventing
This is an event driven approach for detecting changes.
Apps register a handler which is notified when there are changes to authorized records.
Refer to the HealthVault Eventing concept article for more information.
31. 31
Creating an app
Once youre ready to create an app, visit the Application Configuration Center (ACC): https://config.healthvault-
ppe.com/ to get an ApplicationID and configure your application properties.
Properties you will configure in ACC include:
Application Name
Description
App Type
If you are creating a mobile device app, the app type in ACC should be SODA (Software on Device Architecture).
The data types and permissions your application will request users to authorize (Online rules and Offline rules tabs)
Action URL
If your app has a user-facing website, the URL HealthVault will redirect users to upon authorization and sign-in.
The Help link in the top-right of ACC provides more detail on each individual field.
Once you have your AppID, you can start your project by copying one of the existing sample apps that are part of
the SDKs, and changing the existing AppID to the newly generated AppID for your application.
Free Microsoft Developer Tools: http://microsoft.com/express
33. HealthVault for iOS Basics
Open Source Libraries
Apache 2.0 License
HVMobile_VNext
https://github.com/microsoft-hsg/HVMobile_VNext
Hello World sample : HVLib/Samples
Pre-release of rich easy to use programming model for iOS
Built in parsing/serialization of HealthVault types
Ongoing active updates and development
HVMobile V1.0
https://github.com/microsoft-hsg/HealthVault-Mobile-iOS-Library
Production Release
This overview focuses on HVMobile_VNext
33
34. Start your app
-(void)startApp
{
[[HVClient current] startWithParentController:self andStartedCallback:^(id sender)
{
if ([HVClient current].provisionStatus == HVAppProvisionSuccess) {
// App is appropriately provisioned
}
}];
}
-(void) viewDidLoad {
[self startApp];
}
Ensures application has access to users HealthVault Record.
Provisioning is usually a one time event
User can add additional records later (such as their family member)
34
36. Get Items
-(void) getWeightsFromHealthVault {
[[HVClient current].currentRecord getItemsForClass:[HVWeight class] callback:^(HVTask *task) {
@try {
HVItemCollection* items = ((HVGetItemsTask *) task).itemsRetrieved;
HVItem* item = [items objectAtIndex:0];
HVWeight* weight = item.weight;
@catch (..
}];
}
You typically work with one record at a time - the currentRecord
Calls to HealthVault are asynchronous. Encapsulated as Task objects.
HVWeight, HVMedication, etc. - Objective-C classes for the HealthVault types
36
37. Display Item Data
-(void) displayWeight:(HVWeight *)weight inCell:(UITableViewCell *)cell
{
cell.detailTextLabel.text = [NSString stringWithFormat @%f", weight.inPounds];
cell.textLabel.text = [weight.when toStringWithFormat:@"MM/dd/YY"];
}
-(void) displayMedication:(HVMedication *)med inCell:(UITableViewCell *)cell
{
cell.detailTextLabel.text = med.name.text;
cell.textLabel.text = [med.dose toString];
}
Item data available as convenient properties
Methods to create text representations included
37
40. Get Items Advanced
-(void) getWeightsSinceDate:(NSDate *) date
{
HVItemFilter* itemFilter = [[[HVItemFilter alloc] initWithTypeClass:[HVWeight class]] autorelease];
itemFilter.effectiveDateMin = date;
HVItemQuery* query = [[[HVItemQuery alloc] initWithFilter:itemFilter] autorelease];
query.maxResults = 25;
[[HVClient current].currentRecord getItems:query callback:^(HVTask *task)
{
HVItemQueryResults* results = ((HVGetItemsTask *)task).queryResults;
}];
}
Rich querying of HealthVault data: HVItemQuery, HVItemFilter
Can query for specific items
Can query for items matching a given XPath
Multiple filters per query and multiple queries per getItems request.
40
41. Search Vocabulary
-(void) searchMedicationsFor:(NSString *)text {
[HVVocabSearchTask searchForText:text inVocabFamily:@"RxNorm" vocabName:@"RxNorm Active
Medicines" callback:^(HVTask *task) {
HVVocabSearchTask* vocabSearch = (HVVocabSearchTask *) task;
HVVocabCodeSet* result = vocabSearch.searchResult;
for (HVVocabItem* item in vocab.items) {
item.displayText
}
}
Example does a full text search - great for auto-complete
Flexible Vocabulary searching and Vocabulary download API
41