API Method ProviderDirectorySearch

From Updox API
Jump to: navigation, search


Contents

Description

The following code samples describe the processes involved in querying the Updox Provider Directory.

Prerequisites

1 This API call requires Vendor-level credentials. The credentials should be populated into the applicationId and applicationPassword fields of the auth block:

 {
   ...
   "auth": {
     "applicationId": "vendorId",
     "applicationPassword": "vendorPassword",
     "accountId": "",
     "userId": ""
   }
 }

2 This API call requires a Practice/Account-level identifier. The identifier should be populated into the accountId field of the auth block:

 {
   ...
   "auth": {
     "applicationId": "vendorId",
     "applicationPassword": "vendorPassword",
     "accountId": "practiceId",
     "userId": ""
   }
 }
 
 

3 This API call requires a User-level identifier. The identifier should be populated into the userId field of the auth block:

 {
   ...
   "auth": {
     "applicationId": "vendorId",
     "applicationPassword": "vendorPassword",
     "accountId": "practiceId",
     "userId": "userId"
   }
 }

Code Samples

Language Source Code Examples
C#
 public void TalkToUpdox() {
   string json = new JavaScriptSerializer().Serialize(new {
     searchTerms = "test",
     startIndex = "0",
     resultQuantity = "50",
     auth = new {
       applicationId = "vendorId",
       applicationPassword = "vendorPassword",
       accountId : "accountId",
       userId: "userId"
     }
   });
   string url = "https://updoxqa.com/io/practiceCreate";
   SendReceiveJSON(json, url);
 }
 
 private void SendReceiveJSON(string json, string url)
 {
   var httpWebRequest = WebRequest.Create(url);
   httpWebRequest.ContentType = "application/json";
   httpWebRequest.Method = "POST";
   using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
   {
     streamWriter.Write(json);
     streamWriter.Flush();
     streamWriter.Close();
     var httpResponse = (HttpWebResponse) httpWebRequest.GetResponse();
     using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
     {
       var result = streamReader.ReadToEnd();
     }
   }
 }
Java


   public void TalkToUpdox() throws Exception {
       String uri = "https://updoxqa.com/io/providerDirectorySearch";
       ObjectMapper mapper = new ObjectMapper();
       Map<String,Object> messageData = BuildMessage();
       String jsonData = mapper.writeValueAsString(messageData);
       HttpResponse httpResponse = SendReceiveJSON(jsonData, uri);
       HttpEntity responseEntity = httpResponse.getEntity();
       String response = EntityUtils.toString(responseEntity);
       JsonNode actualObj = mapper.readTree(response);
 
       System.out.println(actualObj.get("responseCode"));
       System.out.println(actualObj.get("responseMessage"));
   }
 
   private Map<String,Object> BuildMessage() throws Exception
   {
       Map<String,Object> messageData = new HashMap();
       messageData.put("searchTerms","test");
       messageData.put("startIndex","0");
       messageData.put("resultQuantity","50");
 
       Map<String,Object> authData = new HashMap();
       authData.put("applicationId", "vendorId");
       authData.put("applicationPassword", "vendorPassword");
       authData.put("accountId", "accountId");
       authData.put("userId", "userId");
       messageData.put("auth", authData);
 
       return messageData;
   }
 
   private HttpResponse SendReceiveJSON(String jsonData, String uri) throws Exception {
       HttpClient httpClient = new DefaultHttpClient();
       HttpResponse response = null;
       StringEntity params = new StringEntity(jsonData);
       try {
           HttpPost request = new HttpPost(uri);
           request.addHeader("content-type", "application/json");
           request.setEntity(params);
           response = httpClient.execute(request);
       } catch (Exception ex) {
           // handle exception here
       } finally {
           httpClient.getConnectionManager().shutdown();
       }
       return response;
   }



Messages

Destination Address

 https://updoxqa.com/io/providerDirectorySearch

Request JSON

{

   "searchTerms": "test",
   "startIndex": "0",
   "resultQuantity": "50",
   "auth": {
       "applicationId": "vendorId",
       "applicationPassword": "vendorPassword",
       "accountId": "accountId",
       "userId": "userId"
   }

}

Search Terms

Listed below, are the fields available for searching. You have to specify the fully qualified field name when searching.

For example, searchTerms = “item.member.last_name:Miller" would give you providers with the last name of Miller.

Searchable fields
item.loa
item.member.direct_address
item.member.first_name
item.member.last_name
item.member.npi
item.member.specialty
item.practice.address_line_1
item.practice.address_line_2
item.practice.city
item.practice.fax
item.practice.name
item.practice.npi
item.practice.phone
item.practice.state
item.practice.zipcode

HTTP Response Status

 200 OK

Response JSON

{

   "successful": true,
   "responseMessage": "OK",
   "responseCode": 2000,
   "searchHitCount": 473,
   "searchHits": [
       {
           "firstName": "test",
           "lastName": "test",
           "taxonomyCode": null,
           "npi": null,
           "businessName": "test test",
           "city": "test",
           "state": "AK",
           "zip": null,
           "directAddress": "test_test_627@direct.myupdox.com",
           "loa": null
       },
       {
           "firstName": "TEST",
           "lastName": "TEST",
           "taxonomyCode": null,
           ...
       }
   ]

}