locked
Authorisation of multiple user on the same account to a SODA app. RRS feed

  • Question

  • Hello

     

    I am pretty new to programming with HealthVault.  I have followed the example program that can be found at the http://msdn.microsoft.com/en-us/library/ff803624.aspx, and it worked fine  and then I also downloaded the Windows Mobile 7 example program and this worked great too.

     

    BUT

    In the PC app it will only allow me to authorise a single person on an account yet the Windows Mobile example will allow me to  select all members tied to that account.

     

    And if I select any other user except the "self" user in the PC SODA app then I get the error returned 

    The person has no records that are authorized with the "self" relationship.

    I know the different App use different libraries, but is there any way I can tell the call to authorisation in the PC example that I will allow multiple users to be selected?

     

    Hope you can help

     

    Thanks


     


    Thursday, August 18, 2011 11:18 AM

Answers

  • When you pass ismra=true, the user can authorize access to multiple records, but that access is done through the account of that user, so you only see one person.

    If you look in PersonInfo.AuthorizedRecords, you should see entries for all the authorized records.

    • Marked as answer by I.Dennis Monday, August 22, 2011 8:18 AM
    Friday, August 19, 2011 4:28 PM

All replies

  • ***** UPDATE****

    I have managed to get the authorisation screen to offer multiple users at once.

     

    I did this by changing:

     

    _healthClientApplication.StartUserAuthorizationProcess();  to   _healthClientApplication.StartUserAuthorizationProcess("ismra=true");

     

     

    And although all users are now authorised on the account when I make a call to get the number of authorised users the count returns 1 even though there are 2 users authorised.

     

    Here is the line that makes the call.

    List<PersonInfo> authorizedPeople = new List<PersonInfo>(_healthClientApplication.ApplicationConnection.GetAuthorizedPeople());

     

    Is there anything I am missing?

     

    Thanks


    Thursday, August 18, 2011 2:37 PM
  • When you pass ismra=true, the user can authorize access to multiple records, but that access is done through the account of that user, so you only see one person.

    If you look in PersonInfo.AuthorizedRecords, you should see entries for all the authorized records.

    • Marked as answer by I.Dennis Monday, August 22, 2011 8:18 AM
    Friday, August 19, 2011 4:28 PM
  •  

    Thanks very much, it now all makes sense.

     

    I appreciate the time you spent answering.

     

    Sadly I am now unable to get a list of AuthorisedRecords, I am trying to use the method:

    public Collection<HealthRecordInfo> GetAuthorizedRecords(
    	IList<Guid> recordIds
    )

    But I don't know what IList I'm supposed to pass into it, and there is no code example I can find.

     

    Could you give me some help getting a list of the AuthourisedRecords

     

     

    Thanks

    Monday, August 22, 2011 8:19 AM
  • Please find the below code to obtain the AuthorizedRecords of a Person.

    Dictionary<Guid, HealthRecordInfo> authroziedRecords = PersonInfo.AuthorizedRecords;

    Guid recordID = new Guid();

    foreach (KeyValuePair<Guid, HealthRecordInfo> authorizedRecord in authroziedRecords)

    {

            recordID = authorizedRecord.Key;

            HealthRecordInfo recordInfo = new HealthRecordInfo(new ApplicationConnection(), recordID);

            recordInfo = authorizedRecord.Value;

    }

    Thank you,


    Anish Ravindran
    Tuesday, August 23, 2011 3:20 AM