public Provider getProvider(String entityId) { CsdQueryClient csdQueryClient = new CsdQueryClient(); RequestParams requestParams = new RequestParams(); requestParams.setUniqueID(new Provider(entityId)); String functionId = "urn:ihe:iti:csd:2014:stored-function:provider-search"; String httpAddress = UrlUtil.PRODUCTION_OPENINFOMAN_CSR_URL + LookupUtility.getDirectory(entityId) + "/careServicesRequest"; CallOptions callOptions = new CallOptions(); CSD csd = csdQueryClient.callStandardStoredFunction( requestParams, functionId, httpAddress, callOptions); List<Provider> providers = csd.getProviderDirectory().getProviders(); if (providers.isEmpty()) { return null; } else { Provider $provider = providers.get(0); return $provider; } }