none
Offline Data Sync Example

    Question

  • Hi,

    I am a new Health Vault developer picking up an existing Health Vault application. 

    The goal is to turn this project into a Health Portal that uses offline data synchronization with Health Vault.  We currently have some data stored locally and some data stored on Health Vault.

    I am trying to setup offline data synchronization to accomplish downloading the existing data from Health Vault into our system, then to synchronize our new expanded system with Health Vault.

    Can anyone please point me to step by step instructions on how to get started with Health Vault offline data sync?

    I have found this code sample in the documentation:

    OfflineWebApplicationConnection offlineConn = new OfflineWebApplicationConnection(offlineUser);
            offlineConn.Authenticate();

            HealthRecordAccessor accessor = new HealthRecordAccessor(offlineConn, <RECORD_GUID>);

    My confusion now is 

    1.  What type of project should I place this code in?  Should it be a DLL, or a page of my website I run with a scheduled task.

    2.  All the HealthVault pages I have now are base type HealthServicePage.  Should I still use the HealthServicePage base type when creating an application for syncing?

    3.  What is supposed to be used for the value of the "OfflineUser" variable of the offlineWebApplicationConnection in the first line?

    Thank you in advance for your assistance.

    Nathan


    Nathan Saint Clair


    Wednesday, November 07, 2012 6:19 PM

Answers

  • Hi Nathan,

    Please start by taking a look at this blog post: http://blogs.msdn.com/b/healthvault/archive/2008/01/10/offlineline-sample.aspx. The SDK also has a full-fledged offline sample at \SDK\DotNet\WebSamples\OfflineAccess.

    - You could write a web app that the user authorizes once. You should then save the PersonId and RecordId after the user is authenticated.
    - Only the initial authorization page needs to be derived from HealthServicePage.
    - The value of the "OfflineUser" is the PersonID.

    If you are doing a two-way sync, you must decide on this: what if user deletes/updates an item in HealthVault shell? Your app deletes the data from your storage, or will it upload offline data to HealthVault to match it?

    Friday, November 09, 2012 7:49 PM

All replies

  • Hi Nathan,

    Please start by taking a look at this blog post: http://blogs.msdn.com/b/healthvault/archive/2008/01/10/offlineline-sample.aspx. The SDK also has a full-fledged offline sample at \SDK\DotNet\WebSamples\OfflineAccess.

    - You could write a web app that the user authorizes once. You should then save the PersonId and RecordId after the user is authenticated.
    - Only the initial authorization page needs to be derived from HealthServicePage.
    - The value of the "OfflineUser" is the PersonID.

    If you are doing a two-way sync, you must decide on this: what if user deletes/updates an item in HealthVault shell? Your app deletes the data from your storage, or will it upload offline data to HealthVault to match it?

    Friday, November 09, 2012 7:49 PM
  • Thank you Santhosh!  This is exactly what I was looking for.

    Nathan Saint Clair

    Friday, November 16, 2012 5:48 AM