Class: Candid::Eligibility::V2::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candid/eligibility/v_2/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:, base_url: nil, environment: nil) ⇒ void

Parameters:



12
13
14
15
16
# File 'lib/candid/eligibility/v_2/client.rb', line 12

def initialize(client:, base_url: nil, environment: nil)
  @client = client
  @base_url = base_url
  @environment = environment
end

Instance Method Details

#submit_eligibility_check_availity(request_options: {}, **params) ⇒ Object

Candid is deprecating support for this endpoint. It is instead recommended to use Candid's Stedi passthrough endpoint. For assistance with the transition, please reference the Transitioning to Candid's New Eligibility Endpoint document in the Candid Support Center.

Availity has transitioned their GET endpoint to a POST endpoint. Candid has updated their pass-through integration to enable backwards compatibility for the GET endpoint so that customers do not have to immediately update their integrations.

Candid recommends integrations with the POST endpoint to ensure the best possible integration experience. Given the transition, Availity’s documentation will be out of sync with this endpoint.

If you'd like access to this endpoint, please reach out to support@joincandidhealth.com with the subject line "Action: Activate Availity Eligibility API Endpoint

This API is a wrapper around Availity's coverages API. Below are some helpful documentation links:

A schema of the response object can be found here: Availity Docs

  • Note Availity requires a free developer account to access this documentation.

Check connection status of Availity API and partners here:

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:

  • (Object)

Raises:

  • (error_class)


60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/candid/eligibility/v_2/client.rb', line 60

def submit_eligibility_check_availity(request_options: {}, **params)
  Candid::Internal::Types::Utils.normalize_keys(params)
  request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || @base_url || @environment&.dig(:candid_api),
    method: "GET",
    path: "/api/eligibility/v2/availity",
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = response.code.to_i
  return if code.between?(200, 299)

  error_class = Candid::Errors::ResponseError.subclass_for_code(code)
  raise error_class.new(response.body, code: code)
end

#submit_eligibility_check_availity_post(request_options: {}, **params) ⇒ Object

Candid is deprecating support for this endpoint. It is instead recommended to use Candid's Stedi passthrough endpoint. For assistance with the transition, please reference the Transitioning to Candid's New Eligibility Endpoint document in the Candid Support Center.

If you'd like access to this endpoint, please reach out to support@joincandidhealth.com with the subject line "Action: Activate Availity Eligibility API Endpoint

This API is a wrapper around Availity's coverages API. Below are some helpful documentation links:

A schema of the response object can be found here: Availity Docs

  • Note Availity requires a free developer account to access this documentation.

Check connection status of Availity API and partners here:

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:

  • (Object)

Raises:

  • (error_class)


113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/candid/eligibility/v_2/client.rb', line 113

def submit_eligibility_check_availity_post(request_options: {}, **params)
  params = Candid::Internal::Types::Utils.normalize_keys(params)
  request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || @base_url || @environment&.dig(:candid_api),
    method: "POST",
    path: "/api/eligibility/v2/availity",
    body: params,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = response.code.to_i
  return if code.between?(200, 299)

  error_class = Candid::Errors::ResponseError.subclass_for_code(code)
  raise error_class.new(response.body, code: code)
end