locked
I am not able to retrieve data from healthvault RRS feed

  • Question

  • I am not able to retireve data from health-vault using Offline access,Please help any who find out where I am doing mistacks so following code I have develop for that  

     

    //Get person ID and record ID

    Guid personID;

    Guid recordID;

    personID = PersonInfo.PersonId;

    recordID = PersonInfo.SelectedRecord.Id;

     

    // Retrieve personID and recorded from Database

    // <write code to retrieve personId and recordId from database>

    // Establish an offline connection with only the person ID parameter OfflineWebApplicationConnection offlineConn = new OfflineWebApplicationConnection(personId);

    offlineConn.Authenticate();

    // Using offline access, retrieve data of selected authenticated record. 

    PersonInfo personInfo_offline = offlineConn.GetPersonInfo();

    // Retrieve last height info stored with offline access API for this person/record HealthRecordAccessor accessor = new HealthRecordAccessor(offlineConn, recordId); HealthRecordSearcher searcher = accessor.CreateSearcher();

    HealthRecordFilter filter = new HealthRecordFilter(Height.TypeId);

    searcher.Filters.Add(filter);

    HealthRecordItemCollection results = searcher.GetMatchingItems()[0]; //Here I get 0 match Items records 

    Height offline_height = (Height)results[0];

    Last_Height.Text = offline_height.ToString(); 

    Please Help 

    Tuesday, April 27, 2010 10:47 AM

Answers

  • Hello Ganesh,

    Are you using the same application ID for both the applications (one created by the SDK and the other Web Service code)? For further investigating this issue I need your application ID. Can you please specify the application ID that you are using for the Web Service code?

    Certificate issues will normally give an "Access Denied" error if there is any mismatch between the private and public keys being used, so this issue does not look like a certificate issue as of now.

    To enable the Height data type for offline access you can follow the below steps.

    1. Go to the Application Configuration Center (https://config.healthvault-ppe.com).
    2. Sign in using the application's Admin credentials.
    3. Click on the application ID to go to the application details page. If you couldn't see the application ID listed there then please click on the "submit a request " to associate the application ID with your account.
    4. Go to the "Offline rules" tab.
    5. Click on the "Create a new offline auth rule"
    6. In the rules creation (or editing) page please specify a rule name, the "Why String", the permissions as needed (READ), check the "Height Measurement" box.
    7. Save the changes. Please note that the changes made in the Configuration Center will take some time to get reflected. So please wait for half an hour and then test the changes.

    Thanks and Regards,

    Aneesh D.

    • Proposed as answer by Aneesh D Tuesday, April 27, 2010 6:03 PM
    • Marked as answer by Ganesh Bhoi Wednesday, April 28, 2010 9:26 AM
    Tuesday, April 27, 2010 6:03 PM

All replies

  • When you say you cant access, do you mean that you get no data or do you get any exceptions?

    Assuming that you dont get any exceptions , you might want to check if you specifically enabled Height data type for offline access for the application id . 

    Are you sure that there is Height data instance in the record which you are trying to access?

    Raj

     


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, April 27, 2010 2:13 PM
  • Actually, when  i am trying to use  the same code in the .NET application created by Microsoft Health Vault SDK, its working fine. but its not working when I use that code in the web service. It not giving any exceptions , but in the following line it gives 0 records.

    HealthRecordItemCollection results = searcher.GetMatchingItems()[0]; 

    Is there any issue with the certificates as i am working that code in the web service.?

    Do I need to make any more settings  in the web service application.?

    And as you suggested , how to enable Height data type for offline access for the application id?

    Your help on this will be appreciated.

    Thanks,


    Tuesday, April 27, 2010 3:14 PM
  • Hello Ganesh,

    Are you using the same application ID for both the applications (one created by the SDK and the other Web Service code)? For further investigating this issue I need your application ID. Can you please specify the application ID that you are using for the Web Service code?

    Certificate issues will normally give an "Access Denied" error if there is any mismatch between the private and public keys being used, so this issue does not look like a certificate issue as of now.

    To enable the Height data type for offline access you can follow the below steps.

    1. Go to the Application Configuration Center (https://config.healthvault-ppe.com).
    2. Sign in using the application's Admin credentials.
    3. Click on the application ID to go to the application details page. If you couldn't see the application ID listed there then please click on the "submit a request " to associate the application ID with your account.
    4. Go to the "Offline rules" tab.
    5. Click on the "Create a new offline auth rule"
    6. In the rules creation (or editing) page please specify a rule name, the "Why String", the permissions as needed (READ), check the "Height Measurement" box.
    7. Save the changes. Please note that the changes made in the Configuration Center will take some time to get reflected. So please wait for half an hour and then test the changes.

    Thanks and Regards,

    Aneesh D.

    • Proposed as answer by Aneesh D Tuesday, April 27, 2010 6:03 PM
    • Marked as answer by Ganesh Bhoi Wednesday, April 28, 2010 9:26 AM
    Tuesday, April 27, 2010 6:03 PM
  • Thanks Aneesh.

    It's working now.It was issue of data type for offline access.

    thanks
    Wednesday, April 28, 2010 9:25 AM
  • Hello Aneesh,

    Following code I have used for retrieve Blood pressure data from health vault and I can get record's also but only Systolic and Diastolic values I got, and want value of 'Pulse rate and Irregular heartbeat detected so please view this code and inform what change I have to do for get these value  

            Guid personId = new Guid("358defd1-7a5b-4023-8575-23cd6c503e52");
            Guid recordId = new Guid("e3512fa9-cfa9-4eaf-ab8f-e16722df0faa");



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

            PersonInfo obj = offlineConn.GetPersonInfo();
            HealthRecordAccessor accessor = new HealthRecordAccessor(offlineConn, recordId);



            HealthRecordSearcher searcher = obj.SelectedRecord.CreateSearcher();
            HealthRecordFilter filter = new HealthRecordFilter(BloodPressure.TypeId);
            searcher.Filters.Add(filter);       
            HealthRecordItemCollection items = searcher.GetMatchingItems()[0];
            HealthRecordItem item = items[0]; //Here I have got Systolic and Diastolic values
           
            return "";'

     

    Please Help me,

    thanks

    Wednesday, April 28, 2010 10:46 AM
  • Hello Ganesh,

    This issue seems to be similar to the one stated in the below thread,

    http://social.msdn.microsoft.com/Forums/en-US/healthvault/thread/9aafa3e7-6056-4238-8154-b5e9a893c282

    If you were mentioning any different issue, please let me know.

    Thanks and Regards,

    Aneesh D.

    Wednesday, April 28, 2010 9:19 PM