“If you cannot measure it, you cannot improve it.”
Data is a powerful tool for changing behavior. The act of simply tracking changes one’s perception of that activity. Summarizing the data over time provides a yardstick by which to measure, and the act of tracking activity over time uncovers patterns in behavior and provides definitive answers to self-experimentation questions. The structured data in HealthVault provides such an opportunity. Moreover, the HealthVault ecosystem offers a variety of applications and devices to assist in this endeavor.
In this chapter we will explore how a consumer can use various devices to track critical health measures. We will also use common tools to explore the data stored by devices in Microsoft HealthVault. We’ll capture and view some data, then use a PowerShell plug-in to extract selected data to a CSV format and manipulate the data in that format.
Fitbit is being used in this chapter just to illustrate the ways you can use data from all kinds of devices, so long as they provide a gateway to HealthVault. If you’re not using Fitbit, I encourage you to download the sample Fitbit sleep data included as part of this book’s examples, and follow along.
Fitbit is a pedometer on steroids that enables you to monitor a number of aspects of daily living. This chapter concentrates on sleep because Fitbit has been very popular with users trying to understand and change their sleep patterns. Fitbit provides an arm band (Figure 2-1) that tracks whether you’re awake or asleep based on your activity level. Alternatively, users can select an on/off mode to indicate whether they’re asleep.
Fitbit also provides a base station that wirelessly uploads information from the device to the Fitbit web service. Not having to worry about uploading information is a great value-add provided by this product.
Fitbit enables users to sync their data automatically with HealthVault. Once you have a Fitbit account, you can choose the “Share stats” page (Figure 2-2), which becomes available after clicking on the account settings.
The “Share stats” page, among other services, enables a link to HealthVault (Figure 2-3).
Any application connecting to HealthVault has to get consent from the user for the kinds of data it will be reading from or writing to Microsoft HealthVault. The user control is a two-step process. In the first step, the user chooses the context of the record being authorized (Figure 2-4). As Figure 2-4 shows, in my case I have the option of using the application for my record or my mother’s. In the second step, the user grants access to the specific health data being shared with the application (Figure 2-5). As Figure 2-5 shows, the Fitbit application wants to access to my Exercise, Sleep Session, and other health information. We will learn in more detail about the user authentication and authorization system in Chapter 3.
Clicking on the “Information that Fitbit needs to be able to access to work as intended,” you will notice that Fitbit wants to access a user’s Custom Data, Fitness, Measurements, and Personal Profile, as shown in Figure 2-6. In the line below the heading you will notice Application-Specific Information, Exercise, Sleep Session, Personal Contact Information, and Personal Demographic Information, which are granular HealthVault data types. HealthVault has about 80+ granular data types that form the building blocks for various kinds of health information (Fitness, Measurement, etc.). The data types are optimized to work with different devices and health systems. We will learn more about HealthVault data types and vocabularies in Chapter 4.
Fitbit collects pedometer and sleep data. When the device syncs its data to HealthVault’s granular types, it stores data as detailed in Table 2-1.
Table 2-1. Fitbit HealthVault data mapping
Fitbit data | HealthVault data type | HealthVault field name |
---|---|---|
Calories Burned | Exercise | Calories burned |
Steps Taken | Exercise | Number of steps |
Daily Distance | Exercise | Distance |
Got in to bed | Sleep Session | Bed Time |
Got out of bed | Sleep Session | Wake Time |
Slept for | Sleep Session | Sleep Minutes |
Fell asleep in | Sleep Session | Settling Minutes |
Wake State | Sleep Session | Wake State |
As a user, we are interested in tracking all the information about sleep as collected by Fitbit. As you will note from Table 2-1, we should look at the HealthVault Sleep Session data type for tracking sleep and the HealthVault Exercise data type for tracking Fitbit pedometer data.