Getting Started with the Microsoft HealthVault SDKWelcome to Microsoft® HealthVault™! This Getting Started guide gives you the information you need to create and test your first HealthVault application. Revised January 30, 2009 What Is a HealthVault Application?Microsoft HealthVault is a new personal health platform that lets consumers gather, store, and share health information online. With HealthVault, users control their own health records, so they can share their health information with family, friends, and health care professionals, and have access to trustworthy online health management applications - including yours! This Getting Started guide will show you how to create a HealthVault application and connect it to the Microsoft HealthVault Pre-Production Environment (PPE). Before You BeginThere are a few things to do before you run and modify the samples: Creating a HealthVault ApplicationThere are several steps to create and start a HealthVault application: About HealthVaultMicrosoft HealthVault is a new personal health platform that lets consumers gather, store, and share health information online. With HealthVault, users control their own health records, so they can share their health information with family, friends, and health care professionals, and have access to trustworthy online health management applications - including yours! About This Getting Started GuideThis Getting Started guide will show you how to create a HealthVault application and connect it to the Microsoft HealthVault Pre-Production Environment (PPE). The PPE is a platform server environment that is just like the HealthVault web site, except that it does not provide access to any real customer data. It is provided so that developers can create and test HealthVault applications safely. More specifically, the guide tells about:
This Getting Started guide is available in the SDK installation, online in MSDN (the copy you are viewing now), and as a download from MSDN. The most recent version is always available at the MSDN locations. For information on connecting your application to the HealthVault production environment and making your application available to HealthVault users, see the Go-Live Guide. For information about the full process of becoming a HealthVault Solution Provider, see the Getting Started Guide for Potential HealthVault Solution Providers. What Is a HealthVault Application?A HealthVault application is a Web application that is available to users of the HealthVault web site. It can communicate with the HealthVault platform servers to determine data access rights, and (rights permitting) to create, read, update, and delete all types of data in the HealthVault system. Before a HealthVault application can access user data, it must pass several steps of authentication and authorization.
Exploring HealthVaultYou can explore HealthVault without needing to contact Microsoft. Taking a Look AroundTo explore HealthVault:
The Big PictureIf you decide you want to wade in and modify the sample apps, you must create an account in the HealthVault Pre-Production Environment (PPE). These accounts exist in an environment that is separate from but functionally equivalent to the Consumer HealthVault environment. Once you have a PPE account, you can alter the source code of any of the samples to explore your own ideas for HealthVault-compatible applications. When you reach a point where the sample application doesn’t have permission to do what you want to do, it's time to request or generate your own ApplicationID (see Generating an Application ID for more information). When you decide that your application is ready for consumers and you want to become a HealthVault partner, you kick off the Go Live process (see the Go-Live Guide for more information). When the Go Live process is complete, your application will be available to HealthVault users in the Consumer HealthVault environment. This diagram summarizes the end-to-end process from hearing about HealthVault to taking your application live on HealthVault.
What’s in the SDK?After you install the SDK, the following items are available from the Start menu:
The following items are created in the SDK folder at Program Files\Microsoft HealthVault\SDK:
HealthVault SDK Docs FolderThe following items are available in the Microsoft HealthVault\SDK\Docs folder:
HealthVault SDK DotNet FolderThe DotNet folder contains several sample applications. Each sample application includes:
HealthVault SDK Partner Resources FolderThe Partner Resources folder contains the framework for the application UI branding available for use in connection with Microsoft-approved HealthVault compatible applications. The primary brand elements available are buttons for the user interface. HealthVault SDK Simulators FolderSeveral simulated devices are provided. You can install, uninstall, plug/unplug, and refresh the devices using the WpdSimInstaller utility in this folder. The DeviceSimulators.xps document in this folder contains more information. Note: The device simulators provide a quick way to populate a fictional user account with data. HealthVault SDK Source FolderThe Source folder contains the source code for the following HealthVault .NET assemblies:
You are welcome to experiment with and reuse this code. HealthVault SDK Tools FolderIn the Tools folder, you can find:
Required SoftwareThe instructions in this Getting Started guide assume that you have the following software: the HealthVault Application SDK, an appropriate development environment, and a compatible Web browser. HealthVault Application SDKThis guide uses the following material from the SDK:
(Instructions for downloading and installing the SDK are provided below.) Development EnvironmentYou can create HealthVault applications in any development environment that supports Web applications and .NET 2.0. However, the sample application files in the SDK are designed to be used with Microsoft Windows and Microsoft Visual Studio.
Supported BrowsersThe HealthVault web site is fully supported by the following browsers:
HealthVault is has limited support for the following browsers (that is, data is displayed differently, but full functionality is still supported):
Create a Fictional User AccountYou will need a user ID in order to connect your application to the HealthVault PPE servers. You can use any LiveID or OpenID to create a PPE user account, but it is a good idea to avoid using the real ID of a current or potential HealthVault customer (including yourself!) Note: To create a new LiveID or OpenID, you will need an email address that is not associated with an existing ID. Download and Install the SDKYou download the Microsoft HealthVault SDK installer from the HealthVault Home tab or Downloads tab. To install the Microsoft HealthVault SDK:
Install a Sample Application CertificateYour HealthVault application will not run without an application certificate. The HealthVault SDK includes a certificate management utility, "HealthVault Application Manager", that is specifically intended to manage application certificates on a development machine. To install a sample application certificate using the HealthVault Application Manager:
To manually install a sample application certificate to your computer:
Note that the certificate now appears in the list in the Computer Certificates window. Grant Access to Network Service Accounts (IIS only)This step is required if your Web application is hosted by IIS. It is not usually required if your application is hosted by the Development Web Server that is included with Visual Studio, because the Development Web Server does not use isolated machine accounts. That said, if you are having certificate problems, there is no harm in granting certificate access to other accounts as shown below. To grant access using the HealthVault Application Manager:
To grant access manually:Before you can run the commands in this section, you need to install winhttpcertcfg.exe on your computer. Winhttpcertcfg.exe is included in the cert subdirectory of each sample in the SDK. You can also install it from the MSDN Web site as part of a server resources kit (search for "Winhttpcertcfg.exe" on MSDN). The procedure to grant access to a network service account depends on the operating system of your Web server: Windows XP To grant the necessary Windows accounts access to the application certificate on Windows XP SP2:
Windows 2003 Server To grant the necessary Windows accounts access to the application certificate on Windows 2003 Server:
Windows Vista Note: In Windows Vista, you must run the batch file in Administrator mode (which is not the same as being logged in to an Administrator account) in order to grant the necessary Windows accounts access to the application certificate. To grant the necessary Windows accounts access to the application certificate on Windows Vista using the batch file:
On Windows Vista, you can also grant certificate access to the computer (IIS) account manually. To manually grant the necessary Windows accounts access to the application certificate on Windows Vista, using the Microsoft Management Console (MMC):
Open the Sample Solution File in Visual StudioThe solution file for each sample is located in the sample application's root folder (SDK\DotNet\WebSamples\[sample app]\[sample app].sln). Double-click the solution file to open it in Visual Studio. Configure the Web Proxy ServerA HealthVault application interacts with the Microsoft HealthVault servers in two important ways:
When your ASP.NET application is running behind an organizational firewall (such as in a corporate network), it may be necessary to explicitly tell your ASP.NET application to use a specific proxy server for its Web requests. This alternative works differently from the proxy server settings in the browser, because ASP.NET runs under a different user account from the one you use (for security reasons.) If requests to the Microsoft HealthVault PPE Servers are not working properly, your application will throw an exception immediately after the user signs in to the application, when the Microsoft HealthVault account server redirects to your application. At this point, the application makes its first calls to the Microsoft HealthVault account server to get basic user information. If a proxy server is required, you can place the following sample configuration code into the web.config file of your application (you will need to specify your own proxy server’s address.)
Start the Sample ApplicationTo run the sample application:
You have created a HealthVault application! You are free to modify the application as much as you like. The sample applications in the SDK provide good starting points for adding functionality to your application. Make the Application Your OwnThe SDK provides several ways to customize your application beyond the examples provided by the sample code. Application IDAs you continue to develop your application, you will eventually notice some limits on its behavior. For instance, you cannot change its online description, or modify its data access rights. (It always has full access to all HealthVault data, or at least all the data in the PPE environment.) That is because, as far as the PPE server is concerned, it is still the sample application whose application certificate you originally used to install it. To give your application an identity of its own, you will need to create a new Application ID. With a new Application ID, you can:
For more information about creating an Application ID, see Generating an Application ID. Data TypesYou may also find that your application needs to keep track of information that does not correspond to an existing HealthVault data type. For information on adding new information to an existing HealthVault data type, see Extending HealthVault Data Types. For information on creating a completely new data type, see HealthVault Data Types: Custom Data Types. Resources Available from MSDNThe MS HealthVault Developer Center on MSDN provides links to a variety of useful resources. On the Home tab:
The Home tab also provides links to:
On the Library tab: On the Learn tab:
On the Downloads tab, you can download:
On the Support tab, you can:
On the Community tab, you can
| Not what you're looking for?This is an introductory guide for application developers. If you're not an application developer, or if you have already created a HealthVault application and are ready to introduce it to the world, try these links:
|