際際滷

際際滷Share a Scribd company logo
Health vault intro for developers
HealthVault State of the Union
II



                                      2
3
4
5
6
7
8
9
10
 80+ devices connected to HealthVault
 Devices + apps = awesome opportunity
 Device types include:
       Weight scales
       Blood pressure monitors            Withings Wi-Fi   FitBit Wireless
       Blood glucose monitors             body Scale       Personal trainer
       Pedometers and activity monitors
       Heart Rate monitors
       Pulse oximeters
       Etc.
                                                            Omron
 Device Directory:                                         blood
  http://healthvault.com/devices                            pressure
                                                            monitors



                                                                               11
12
13
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
iTriage (iOS). #1 Livescape (WP7).   HealthVault   Weight4Me       CTIS mPHR
Health app on     Daily tracking     (WP7). Our    (WP7). Weight   (iOS)
AppStore          app                native app!   management              15
myMedicalImages   bant (iOS).   Skinscan (WP7)   HealthGuard (WP7)
(WP7)             Diabetes      Mole tracking    HealthVault data
                  managment                      access
                                                                     16
17
XML API



 .NET SDK


 Open source




                          18
19
20
HealthServicePage




                    21
22
Microsoft.Health.PatientConnect



                                  23
Microsoft.Health.Package


                           24
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



    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
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
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
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



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



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
32
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
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
35
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
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
Add New Items
-(void) addWeight {

    HVItem* item = [HVWeight newItem];
    HVWeight* weight = item.weight;
    weight.inPounds = 153.34;
    weight.when = [[HVDateTime alloc] initNow];

    [[HVClient current].currentRecord putItem:item callback:^(HVTask *task) {
      @try {
             [task checkSuccess];
       }
       @catch (NSException*exception) {
        }
      } ];
}



                                                                                38
Update Existing Item
- (void) updateExistingWeight:(HVItem *) weight {

    item.weight.inPounds = 163.34;
    item.note = @Fixed typo! Havent actually lost 10 pounds !;

    [[HVClient current].currentRecord   putItem:item callback:^(HVTask *task) {
      @try {
               [task checkSuccess];
       }
       @catch (NSException*exception) {
        }
      } ];
}

                                                                                  39
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
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
42
HealthVault Developer Center on MSDN: http://msdn.microsoft.com/healthvault
HealthVault Developer Forums: http://social.msdn.microsoft.com/forums/en-US/healthvault/threads/
Application Configuration Center (ACC): https://config.healthvault-ppe.com/
Free Microsoft Developer tools: http://microsoft.com/express
HealthVault SDKs
    .NET Framework: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3418
    Java: http://healthvaultjavalib.codeplex.com/
    Windows Phone: http://healthvaultwp7.codeplex.com/
    iOS V1: https://github.com/microsoft-hsg/HealthVault-Mobile-iOS-Library
    iOS vNext: https://github.com/microsoft-hsg/HVMobile_VNext
    Android: http://healthvaultjavalib.codeplex.com/

3rd Party SDKs
     Ruby SDK 1: https://github.com/vaibhavb/HealthVault-Ruby-Library
     Ruby SDK 2: http://rubyforge.org/projects/rubyhealthvault/
     PHP: http://healthvaultphp.sourceforge.net/
Blogs
     HealthVault team blog: http://blogs.msdn.com/b/healthvault/
     FamilyHealthGuy: http://familyhealthguy.com
Samples
 Codeplex: http://www.codeplex.com/site/search?query=healthvault&ac=8
     WalkMe: http://walkme.codeplex.com/
 SDK samples: http://msdn.microsoft.com/en-us/library/ff803585.aspx

                                                                                                   43
Learn more about how HealthVault can help!
Business Development: hvbd@microsoft.com




                                             44
45
46

More Related Content

Health vault intro for developers

  • 2. HealthVault State of the Union II 2
  • 3. 3
  • 4. 4
  • 5. 5
  • 6. 6
  • 7. 7
  • 8. 8
  • 9. 9
  • 10. 10
  • 11. 80+ devices connected to HealthVault Devices + apps = awesome opportunity Device types include: Weight scales Blood pressure monitors Withings Wi-Fi FitBit Wireless Blood glucose monitors body Scale Personal trainer Pedometers and activity monitors Heart Rate monitors Pulse oximeters Etc. Omron Device Directory: blood http://healthvault.com/devices pressure monitors 11
  • 12. 12
  • 13. 13
  • 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
  • 15. iTriage (iOS). #1 Livescape (WP7). HealthVault Weight4Me CTIS mPHR Health app on Daily tracking (WP7). Our (WP7). Weight (iOS) AppStore app native app! management 15
  • 16. myMedicalImages bant (iOS). Skinscan (WP7) HealthGuard (WP7) (WP7) Diabetes Mole tracking HealthVault data managment access 16
  • 17. 17
  • 18. XML API .NET SDK Open source 18
  • 19. 19
  • 20. 20
  • 22. 22
  • 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
  • 32. 32
  • 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
  • 35. 35
  • 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
  • 38. Add New Items -(void) addWeight { HVItem* item = [HVWeight newItem]; HVWeight* weight = item.weight; weight.inPounds = 153.34; weight.when = [[HVDateTime alloc] initNow]; [[HVClient current].currentRecord putItem:item callback:^(HVTask *task) { @try { [task checkSuccess]; } @catch (NSException*exception) { } } ]; } 38
  • 39. Update Existing Item - (void) updateExistingWeight:(HVItem *) weight { item.weight.inPounds = 163.34; item.note = @Fixed typo! Havent actually lost 10 pounds !; [[HVClient current].currentRecord putItem:item callback:^(HVTask *task) { @try { [task checkSuccess]; } @catch (NSException*exception) { } } ]; } 39
  • 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
  • 42. 42
  • 43. HealthVault Developer Center on MSDN: http://msdn.microsoft.com/healthvault HealthVault Developer Forums: http://social.msdn.microsoft.com/forums/en-US/healthvault/threads/ Application Configuration Center (ACC): https://config.healthvault-ppe.com/ Free Microsoft Developer tools: http://microsoft.com/express HealthVault SDKs .NET Framework: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3418 Java: http://healthvaultjavalib.codeplex.com/ Windows Phone: http://healthvaultwp7.codeplex.com/ iOS V1: https://github.com/microsoft-hsg/HealthVault-Mobile-iOS-Library iOS vNext: https://github.com/microsoft-hsg/HVMobile_VNext Android: http://healthvaultjavalib.codeplex.com/ 3rd Party SDKs Ruby SDK 1: https://github.com/vaibhavb/HealthVault-Ruby-Library Ruby SDK 2: http://rubyforge.org/projects/rubyhealthvault/ PHP: http://healthvaultphp.sourceforge.net/ Blogs HealthVault team blog: http://blogs.msdn.com/b/healthvault/ FamilyHealthGuy: http://familyhealthguy.com Samples Codeplex: http://www.codeplex.com/site/search?query=healthvault&ac=8 WalkMe: http://walkme.codeplex.com/ SDK samples: http://msdn.microsoft.com/en-us/library/ff803585.aspx 43
  • 44. Learn more about how HealthVault can help! Business Development: hvbd@microsoft.com 44
  • 45. 45
  • 46. 46

Editor's Notes

  1. See additional methods on HVRecordReference object