Unanswered Retrieve data using Offline Acces

  • Wednesday, April 04, 2012 8:49 PM
     
      Has Code

    Hi,

    I am trying to get data from HV using Offline mode. I authenticate user and store PersonID and RecordID information in local database. I then query for data using following code

    Guid personId = new Guid("person id here");
    Guid recordGuid = new Guid("record id here");
    
    // Do the offline connection
    OfflineWebApplicationConnection offlineConn =
                    new OfflineWebApplicationConnection(personId);
    offlineConn.Authenticate();
    HealthRecordAccessor accessor =
                    new HealthRecordAccessor(offlineConn, recordGuid);
                
                
    PersonInfo p = offlineConn.GetPersonInfo();
                
    // Get offline records
    
    HealthRecordSearcher searcher = p.SelectedRecord.CreateSearcher();
    HealthRecordFilter filter = new HealthRecordFilter();
    
    filter.TypeIds.Add(Allergy.TypeId);
    filter.TypeIds.Add(Medication.TypeId);
               
    
    searcher.Filters.Add(filter);
    
    System.Xml.XPath.XPathNavigator navigator = searcher.GetMatchingItemsRaw();
    
    string xmlString = navigator.OuterXml;

    in return i am getting

    <wc:info xmlns:wc="urn:com.microsoft.wc.methods.response.GetThings3">
      <group>
        <filtered>true</filtered>
      </group>
    </wc:info>

    I need the output in the xml format, do i miss anything????

All Replies

  • Wednesday, April 04, 2012 10:44 PM
     
     

    Filtered true, means that you don't have permissions to query those types. Does your application have access to query allergies/medications for that record?

  • Thursday, April 05, 2012 2:18 PM
     
     

    Thanks Victor. I have given permission for both Online and Offline mode. Even when i try to post data to HV it is saying access denied.

    Whats is missing???
  • Thursday, April 05, 2012 4:17 PM
     
     

    Hi,

    Do i need any settings in Web.config file or on HV configuration center apart from access to data types (meds, allergies ....)?

    Thank you

  • Thursday, April 05, 2012 9:56 PM
     
     
    You don't need any special config settings.  When you sign in to HV with the account you are trying to use and click on the applications tab, do you see your application there that you had authorized?