/// <summary>
 /// Create Enrollment. It's a POST request and the parameters should be in JSON format in the body.
 /// https://gds.eligibleapi.com/rest#create-enrollment
 /// </summary>
 /// <param name="jsonParams">string contains required params in json format</param>
 /// <returns></returns>
 public EnrollmentNpisResponse Create(string jsonParams, RequestOptions options = null)
 {
     response = ExecuteObj.ExecutePostPut(EligibleResources.EnrollmentNpis, jsonParams, SetRequestOptionsObject(options));
     var formattedResponse = RequestProcess.ResponseValidation<EnrollmentNpisResponse, EligibleError>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
 /// <summary>
 /// Cost Estimates
 /// https://gds.eligibleapi.com/rest#cost-estimates
 /// </summary>
 /// <param name="requiredParams">Check document for required params</param>
 /// <returns>Cost estimation</returns>
 public CostEstimatesResponse Get(Hashtable requiredParams,  RequestOptions options = null)
 {
     response = ExecuteObj.Execute(EligibleResources.CostEstimates, SetRequestOptionsObject(options), requiredParams);
     var formattedResponse = RequestProcess.ResponseValidation<CostEstimatesResponse, CoverageErrorDetails>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
 /// <summary>
 /// It's a PUT request to update a Enrollment
 /// https://gds.eligibleapi.com/rest#update-enrollment
 /// </summary>
 /// <param name="enrollmentNpiId"></param>
 /// <param name="jsonParams">Required parameters in the form of json</param>
 /// <returns></returns>
 public EnrollmentNpisResponse Update(string enrollmentNpiId, string jsonParams, RequestOptions options = null)
 {
     response = ExecuteObj.ExecutePostPut(Path.Combine(EligibleResources.EnrollmentNpis, enrollmentNpiId), jsonParams, SetRequestOptionsObject(options), Method.PUT);
     var formattedResponse = RequestProcess.ResponseValidation<EnrollmentNpisResponse, EligibleError>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
Example #4
0
 /// <summary>
 /// Get Claim multiple Acknowledgements
 /// https://gds.eligibleapi.com/rest#claim_and_reports_claim_acknowledgements_retrieve_multiple
 /// </summary>
 /// <param name="referenceId"></param>
 /// <returns></returns>
 public MultipleAcknowledgementsResponse GetClaimAcknowledgements(Hashtable requiredParams = null, RequestOptions options = null)
 {
     response = ExecuteObj.Execute(Path.Combine(EligibleResources.PathToClaims, EligibleResources.ClaimAcknowledgementsPath), SetRequestOptionsObject(options), requiredParams);
     var formattedResponse = RequestProcess.ResponseValidation<MultipleAcknowledgementsResponse, EligibleError>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
Example #5
0
 /// <summary>
 /// It returns the seach options for payer.
 /// https://gds.eligibleapi.com/v1.5/payers/00001/search_options
 /// </summary>
 /// <returns>single payer search options</returns>
 public PayerSearchOptionResponse SearchOptions(string payerId, RequestOptions options = null)
 {
     response = ExecuteObj.Execute(EligibleResources.PathToPayerById + payerId + EligibleResources.SearchOptions, SetRequestOptionsObject(options));
     var formattedResponse = RequestProcess.SimpleResponseValidation<PayerSearchOptionResponse>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
Example #6
0
 /// <summary>
 /// Retrieve Single Claim Acknowledgements
 /// https://gds.eligibleapi.com/rest#claim_and_reports_claim_acknowledgements_retrieve_single
 /// </summary>
 /// <param name="referenceId"></param>
 /// <returns>It returns all acknowledgements of a claim in sorted order by creation time.</returns>
 public ClaimAcknowledgementsResponse GetClaimAcknowledgements(string referenceId, RequestOptions options = null)
 {
     response = ExecuteObj.Execute(Path.Combine(EligibleResources.PathToClaims, referenceId, EligibleResources.ClaimAcknowledgementsPath), SetRequestOptionsObject(options));
     ClaimAcknowledgementsResponse formattedResponse = RequestProcess.ResponseValidation<ClaimAcknowledgementsResponse, EligibleError>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
 /// <summary>
 /// Precertification Inquiry
 /// https://gds.eligibleapi.com/rest#precert
 /// </summary>
 /// <param name="requiredParams"></param>
 /// <returns></returns>
 public PrecertificationInquiryResponse Inquiry(Hashtable requiredParams, RequestOptions options = null)
 {
     response = ExecuteObj.Execute(Path.Combine(EligibleResources.Precert, EligibleResources.Inquiry), SetRequestOptionsObject(options), requiredParams);
     var formattedResponse = RequestProcess.ResponseValidation<PrecertificationInquiryResponse, CoverageErrorDetails>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
 /// <summary>
 /// Get Payment Status for claims
 /// https://gds.eligibleapi.com/rest#retrieve-payment-status
 /// </summary>
 /// <param name="requiredParams"></param>
 /// <returns></returns>
 public PayementStatusResponse Get(Hashtable requiredParams, RequestOptions options = null)
 {
     IRestResponse response = ExecuteObj.Execute(EligibleResources.PaymentStatus, SetRequestOptionsObject(options), requiredParams);
     var fomatedResponse = RequestProcess.ResponseValidation<PayementStatusResponse, CoverageErrorDetails>(response);
     fomatedResponse.SetJsonResponse(response.Content);
     return fomatedResponse;
 }
 /// <summary>
 /// It's a POST request to create Customer
 /// https://gds.eligibleapi.com/rest#create_customers
 /// </summary>
 /// <param name="jsonParams">Required parameters in the form of json</param>
 /// <returns></returns>
 public CustomerResponse Create(string jsonParams, RequestOptions options = null)
 {
     response = ExecuteObj.ExecutePostPut(EligibleResources.PathToCustomers, jsonParams, SetRequestOptionsObject(options), Method.POST);
     var formattedResponse = RequestProcess.ResponseValidation<CustomerResponse, EligibleError>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
        public static string FormatJson(string jsonParams, RequestOptions options)
        {
            JObject jobject = JObject.Parse(jsonParams);
            Eligible eligible = Eligible.Instance;

            return AddingOptionsToJson(options, jobject);
        }
 /// <summary>
 /// Claim submission with ClaimParam object
 /// https://gds.eligibleapi.com/rest#claim_and_reports_create_a_claim
 /// </summary>
 /// <param name="jsonParams">Please refer Eligible REST doc for claim parameter details</param>
 /// <param name="options">Please refer Eligible REST doc for claim RequestOptions</param>
 /// <returns>Realtime claims response</returns>
 public RealtimeClaimsResponse Create(string jsonParams, RequestOptions options = null)
 {
     response = ExecuteObj.ExecutePostPut(Path.Combine(EligibleResources.PathToClaims, EligibleResources.Realtime), jsonParams, SetRequestOptionsObject(options));
     var formattedResponse = RequestProcess.ResponseValidation<RealtimeClaimsResponse, RealtimeClaimError>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
        public static RequestOptions SetRequestOptionsObject(RequestOptions options)
        {
            Eligible eligible = Eligible.Instance;

            if (options != null)
            {
                if (string.IsNullOrEmpty(options.ApiKey))
                    options.ApiKey = eligible.ApiKey;

                if (!options.IsTest.HasValue)
                {
                    if (eligible.IsTest.HasValue)
                        options.IsTest = eligible.IsTest;
                    else
                        options.IsTest = false;
                }
            }
            else
            {
                options = new RequestOptions();
                options.ApiKey = eligible.ApiKey;
                options.IsTest = eligible.IsTest;
            }

            return options;
        }
Example #13
0
 /// <summary>
 /// It returns the list of seach options supported by each payer.
 /// API: https://gds.eligibleapi.com/v1.5/payers/search_options
 /// </summary>
 /// <returns>List of EligibleService.Model.PayerSearchOption</returns>
 public PayersSearchOptionResponse SearchOptions(RequestOptions options = null)
 {
     response = ExecuteObj.Execute(EligibleResources.PathToPayerSearchOptions, SetRequestOptionsObject(options));
     PayersSearchOptionResponse payersSearchOptionResponse = new PayersSearchOptionResponse();
     var formattedResponse = RequestProcess.SimpleResponseValidation<Collection<PayerSearchOptionResponse>>(response);
     payersSearchOptionResponse.SearchOptionsList = formattedResponse;
     payersSearchOptionResponse.SetJsonResponse(response.Content);
     return payersSearchOptionResponse; 
 }
Example #14
0
 /// <summary>
 /// Retrieve payer status
 /// GET https://gds.eligibleapi.com/v1.1/payers/status.json"
 /// </summary>
 /// <param name="RequestParams">Ex: transaction_type=270</param>
 /// <returns></returns>
 public StatusResponse Statusses([Optional, DefaultParameterValue("270")]string transactionType, RequestOptions options = null)
 {
     param = new Hashtable();
     param.Add("transaction_type", transactionType);
     response = ExecuteObj.Execute(EligibleResources.PathtoPayersStatus, SetRequestOptionsObject(options), param);
     var formattedResponse = RequestProcess.SimpleResponseValidation<StatusResponse>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
Example #15
0
 /// <summary>
 /// Claim submission with Json formatted string of  params
 /// https://gds.eligibleapi.com/rest#claim_and_reports_create_a_claim
 /// </summary>
 /// <param name="claimParams">Please refer Eligible REST doc for claim parameter details</param>
 /// <returns></returns>
 public ClaimResponse Create(string jsonParams, RequestOptions options = null)
 {
     response = ExecuteObj.ExecutePostPut(EligibleResources.PathToClaims, jsonParams, SetRequestOptionsObject(options));
     ClaimResponse formattedResponse = RequestProcess.ResponseValidation<ClaimResponse, ClaimErrors>(response);
     if (formattedResponse.Success == false)
         throw new EligibleException(formattedResponse);
     else
     {
         formattedResponse.SetJsonResponse(response.Content);
         return formattedResponse;
     }
 }
Example #16
0
 /// <summary>
 /// Get all the payers
 /// https://gds.eligibleapi.com/v1.5/payers.json
 /// </summary>
 /// <returns>List of EligibleService.Model.Payer</returns>
 public PayersResponse All([Optional, DefaultParameterValue("")]string endpoint, [Optional, DefaultParameterValue("")]string enrollmentRequired, RequestOptions options = null)
 {
     param = new Hashtable();
     param.Add("endpoint", endpoint);
     param.Add("enrollment_required", enrollmentRequired);
     response = ExecuteObj.Execute(EligibleResources.PathToPayers, SetRequestOptionsObject(options), param);
     var formatResponse = RequestProcess.SimpleResponseValidation<Collection<PayerResponse>>(response);
     PayersResponse payers = new PayersResponse();
     payers.Payers = formatResponse;
     payers.SetJsonResponse(response.Content);
     return payers;
 }
        public IRestResponse ExecutePostPut(string apiResource, string json, RequestOptions options, Method httpMethod)
        {
            ServicePointManager.ServerCertificateValidationCallback = this.CertificateValidation;

            json = FormatInputWithRequestOptions.FormatJson(json, options);
            var request = new RestRequest(httpMethod);
            var client = new RestClient(new Uri(EligibleResources.BaseUrl));

            request.AddParameter("application/json; charset=utf-8", json, ParameterType.RequestBody);

            this.SetHeaders(request, options);

            SetResource(apiResource, request);

            return client.Execute(request);
        }
        public IRestResponse ExecutePdf(string apiResource, string pdfPath, RequestOptions options, Method httpMethod)
        {
            ServicePointManager.ServerCertificateValidationCallback = this.CertificateValidation;

            var request = new RestRequest(httpMethod);
            var client = new RestClient(new Uri(EligibleResources.BaseUrl));

            request.AddParameter("api_key", options.ApiKey);
            request.AddParameter("test", options.IsTest);

            if (string.IsNullOrEmpty(pdfPath.Trim()))
                request.AddParameter("file", pdfPath);

            this.SetHeaders(request, options);

            SetResource(apiResource, request);

            return client.Execute(request);
        }
       /// <summary>
       /// Generic method to process all requests
       /// </summary>
       /// <param name="apiResource">/Coverage/all</param>
       /// <param name="options">request options</param>
       /// <param name="filters"></param>
       /// <returns></returns>
        public IRestResponse Execute(string apiResource, RequestOptions options, Hashtable filters)
        {
            ServicePointManager.ServerCertificateValidationCallback = this.CertificateValidation;

            var request = new RestRequest();
            var client = new RestClient(new Uri(EligibleResources.BaseUrl));

            request.AddParameter("api_key", options.ApiKey);
            request.AddParameter("test", options.IsTest);
            if (filters != null)
            {
                foreach (DictionaryEntry filter in filters)
                {
                    request.AddParameter(filter.Key.ToString(), filter.Value);
                }
            }

            this.SetHeaders(request, options);

            SetResource(apiResource, request);

            return client.Execute(request);
        }
        private static string AddingOptionsToJson(RequestOptions options, JObject jobject)
        {
            options = SetRequestOptionsObject(options);

            if (jobject.Property("api_key") == null)
            {
                jobject.Add("api_key", options.ApiKey);
            }
            else if (string.IsNullOrEmpty(jobject.Property("api_key").Value.ToString()))
            {
                jobject.Property("api_key").Value = options.ApiKey;
            }

            if (jobject.Property("test") == null)
            {
                jobject.Add("test", options.IsTest);
            }
            else if (string.IsNullOrEmpty(jobject.Property("test").Value.ToString()))
            {
                jobject.Property("test").Value = options.IsTest;
            }

            return jobject.ToString();
        }
 /// <summary>
 /// Get enrollment with enrollment_npi_id
 /// GET https://gds.eligibleapi.com/rest#retrieve-enrollment
 /// </summary>
 /// <param name="enrollmentNpiId"></param>
 /// <returns></returns>
 public EnrollmentNpisResponse GetByEnrollmentNpiId(string enrollmentNpiId, RequestOptions options = null)
 {
     response = ExecuteObj.Execute(Path.Combine(EligibleResources.EnrollmentNpis, enrollmentNpiId), SetRequestOptionsObject(options));
     var formattedResponse = RequestProcess.ResponseValidation<EnrollmentNpisResponse, EligibleError>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
 /// <summary>
 /// Create Enrollment. It's a POST request and the parameters should be in JSON format in the body.
 /// https://gds.eligibleapi.com/rest#create-enrollment
 /// </summary>
 /// <param name="enrollmentParams">object contains required params in EnrollmentParams class format</param>
 /// <returns></returns>
 public EnrollmentNpisResponse Create(EnrollmentParams enrollmentParams, RequestOptions options = null)
 {
     return this.Create(JsonSerialize(enrollmentParams), options);
 }
 private OriginalSignaturePdfResponse PdfProcess(string enrollmentNpiId, Method httpMethod, string signaturePdfFilePath, RequestOptions options = null)
 {
     response = ExecuteObj.ExecutePdf(Path.Combine(EligibleResources.EnrollmentNpis, enrollmentNpiId, EligibleResources.OriginalSignaturePdf), signaturePdfFilePath, SetRequestOptionsObject(options), httpMethod);
     var formattedResponse = RequestProcess.ResponseValidation<OriginalSignaturePdfResponse, EligibleError>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
 /// <summary>
 /// It's a PUT request to update a Enrollment
 /// https://gds.eligibleapi.com/rest#update-enrollment
 /// </summary>
 /// <param name="enrollmentNpiId"></param>
 /// <param name="jsonParams">Required parameters in the form of Hashtable</param>
 /// <returns></returns>
 public EnrollmentNpisResponse Update(string enrollmentNpiId, Hashtable enrollmentParams, RequestOptions options = null)
 {
     return Update(enrollmentNpiId, JsonSerialize(enrollmentParams), options);
 }
 /// <summary>
 /// It's a PUT request to update a Enrollment
 /// https://gds.eligibleapi.com/rest#update-enrollment
 /// </summary>
 /// <param name="enrollmentNpiId"></param>
 /// <param name="jsonParams">Required parameters in the form of EnrollmentParams object</param>
 /// <returns></returns>
 public EnrollmentNpisResponse Update(string enrollmentNpiId, EnrollmentParams enrollmentParams, RequestOptions options = null)
 {
     return Update(enrollmentNpiId, JsonConvert.SerializeObject(enrollmentParams, Formatting.Indented), options);
 }
Example #26
0
 public dynamic Inquiry(Hashtable requiredParams, RequestOptions options = null)
 {
     response = ExecuteObj.Execute(Path.Combine(EligibleResources.ReferralInquiry), SetRequestOptionsObject(options),  requiredParams);
     JsonResponse = response.Content;
     return RequestProcess.ResponseValidation<dynamic, CoverageErrorDetails>(response);
 }
Example #27
0
 /// <summary>
 /// Retrieve Single Claim Payment Report
 /// https://gds.eligibleapi.com/rest#claim_and_reports_claim_payment_reports_retrieve_single
 /// </summary>
 /// <param name="referenceId">Reference Id to get the Claim report</param>
 /// <returns>It return payment report for the claim</returns>
 public ClaimPaymentReportResponse GetClaimPaymentReport(string referenceId, RequestOptions options = null)
 {
     response = this.GetReport(Path.Combine(EligibleResources.PathToClaims, referenceId, EligibleResources.PaymentReports), options);
     var formattedResponse = RequestProcess.ResponseValidation<ClaimPaymentReportResponse, ClaimErrors>(response);
     formattedResponse.SetJsonResponse(response.Content);
     return formattedResponse;
 }
Example #28
0
 /// <summary>
 /// Claim submission with Hashtable params
 /// https://gds.eligibleapi.com/rest#claim_and_reports_create_a_claim
 /// </summary>
 /// <param name="claimParams">Please refer Eligible REST doc for claim parameter details</param>
 /// <returns></returns>
 public ClaimResponse Create(Hashtable claimParams, RequestOptions options = null)
 {
     return this.Create(JsonSerialize(claimParams), options);
 }
Example #29
0
 public dynamic Create(string jsonParams, RequestOptions options = null)
 {
     response = ExecuteObj.ExecutePdf(EligibleResources.ReferralCreate, jsonParams, SetRequestOptionsObject(options));
     JsonResponse = response.Content;
     return RequestProcess.ResponseValidation<dynamic, ClaimErrors>(response);
 }
Example #30
0
 private IRestResponse GetReport(string path, RequestOptions options)
 {
     var response = this.ExecuteObj.Execute(path, SetRequestOptionsObject(options));
     return response;
 }