“Things would have changed if I had timely access to electronic medical records.”
As a platform, HealthVault provides an innovative access management and programming interfaces for applications and devices to access a user’s health information.
In the previous chapter we discovered how to fetch and manipulate data stored in HealthVault. This chapter takes a closer look at the API offered by HealthVault to enable this interaction in a programmatic fashion. We will discuss various ways in which an application or device can interface with the HealthVault platform. The code samples will use .NET interfaces because they fit well with HealthVault, but the same interfaces are available in Java, PHP, and other languages. The chapter will introduce the elements of programming that give the programmer access to data in HealthVault. Toward the end of this chapter, we will discuss various architectural options available for interfacing an application or device with HealthVault. We’ll start by discussing accounts because the first task is to get access to your own account.
HealthVault provides innovative access management to let a family health manager access and manage the records of various family members. Mom, serving as the family health manager, can create records for her husband and children. In Figure 3-1, Jane has created accounts for her husband, Tom, and two kids, Chris and Sara. She has full access to all information in her family’s HealthVault records.
Additionally, HealthVault enables the same records to be accessed through multiple accounts. Full access can be thought of as custodial access to the record. In Figure 3-2, Jane has full access to her family’s health information. Tom has also signed up to share the responsibility of managing the health information of their kids, Chris and Sara, and also has full access to their health information.
An application gets access to HealthVault account information through an API called Get-PersonInfo. This API returns a structure called PersonInfo, which in turn consists of the records associated with a HealthVault account (Example 3-1).
Example 3-1. PersonInfo data structure
PS C:\Windows\system32> Get-Personinfo PersonId : 0ce0d6e0-cfaf-4464-abea-6d0253078df6 Name : Vaibhav Bhandari ApplicationSettings : SelectedRecord : Vaibhav Bhandari AuthorizedRecords : {[b11511c8-c30d-4ffd-8d98-f433d0b5827b, Vaibhav Bhandari]} PreferredCulture : en-US PreferredUICulture : en-US Connection : ApplicationConnection : Microsoft.Health.HealthClientAuthorizedConnection
Using the HealthVault PowerShell plug-in, you can try out the
Get-PersonInfo API using the command get-personinfo
. The structure returned
consists of a unique PersonId
for the account and a set of
record identifiers authorized to be used with the application for this
particular account. Any pertinent information for the application is
stored in ApplicationSettings
. The
user’s preferred language and display settings are stored in the
PreferredCulture
and PreferredUICulture
fields,
respectively.
An application can decide to work with only one record at a time, termed as a single record application (SRA), or provide an interface to work with multiple records associated with the signed-in user, termed as a multiple record application (MRA). Interfacing with HealthVault describes how to enable each of these record management capabilities in detail.