Accessing patient records via PatientConnect offline connection RRS feed

  • Question

  • I'm trying to access health records in this way:

    var _connection = new OfflineWebApplicationConnection();


    var validatedConnections = PatientConnection.GetValidatedConnections(_connection, DateTime.MinValue);

    HealthRecordAccessor hra = new HealthRecordAccessor(_connection, validatedConnections[0].RecordId);

    HealthRecordSearcher searcher = hra.CreateSearcher();

    HealthRecordFilter filter = new HealthRecordFilter(Microsoft.Health.ItemTypes.Weight.TypeId);


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

    I'm using this platform for testing: https://platform.healthvault-ppe.co.uk/platform .

    Problem is that the last line, where records suppose to be accessed, I receive this exception:

    Test method Aggregator.Tests.HealthVaultRecordAccessTest.AccessData threw exception: 
    Microsoft.Health.HealthServiceAccessDeniedException: The authentication token element of the request is required for this method.

    I suppose that this exception identifies that application doesn't have sufficient permissions to access certain record. But the application has all offline rules checked and in patient records, it's said that record (height for example) is shared with the app.

    What is supposedly the problem in this case?

    Tuesday, October 6, 2015 10:27 AM

All replies

  • Hi lpkSanta

    Can you please send me the HealthVault application id, and the contents of your web.config/app.config containing the SDK settings currently is use to hvtech@microsoft.com. I will take a look at the HealthVault app config file, and see if there is something going on.



    Tuesday, November 10, 2015 9:11 PM