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:) ⇒ Candid::Eligibility::V2::Client



8
9
10
# File 'lib/candid/eligibility/v_2/client.rb', line 8

def initialize(client:)
  @client = client
end

Instance Method Details

#submit_eligibility_check(request_options: {}, **params) ⇒ Hash[String, Object]

<Tip>Candid is deprecating support for this endpoint. It is instead recommended to use [Candid’s Stedi passthrough endpoint](docs.joincandidhealth.com/api-reference/pre-encounter/eligibility-checks/v-1/post). For assistance with the transition, please reference the [Transitioning to Candid’s New Eligibility Endpoint](support.joincandidhealth.com/hc/en-us/articles/34918552872980) document in the Candid Support Center.</Tip>

This API is a wrapper around Change Healthcare’s eligibility API. Below are some helpful documentation links:

A schema of the response object can be found here: [Change Healthcare Docs](developers.changehealthcare.com/eligibilityandclaims/reference/medicaleligibility)

Returns:

  • (Hash[String, Object])

Raises:

  • (error_class)


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/candid/eligibility/v_2/client.rb', line 31

def submit_eligibility_check(request_options: {}, **params)
  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "POST",
    path: "/api/eligibility/v2",
    body: params
  )
  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(request_options: {}, **_params) ⇒ Hash[String, Object]

<Tip>Candid is deprecating support for this endpoint. It is instead recommended to use [Candid’s Stedi passthrough endpoint](docs.joincandidhealth.com/api-reference/pre-encounter/eligibility-checks/v-1/post). For assistance with the transition, please reference the [Transitioning to Candid’s New Eligibility Endpoint](support.joincandidhealth.com/hc/en-us/articles/34918552872980) document in the Candid Support Center.</Tip>

**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](docs.joincandidhealth.com/api-reference/eligibility/v-2/submit-eligibility-check-availity-post) 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 [email protected] 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](developer.availity.com/partner/product/191210/api/190898#/Coverages_100/operation/%2Fcoverages%2Fid/get)

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

Check connection status of Availity API and partners here:

Returns:

  • (Hash[String, Object])

Raises:

  • (error_class)


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/candid/eligibility/v_2/client.rb', line 71

def submit_eligibility_check_availity(request_options: {}, **_params)
  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "GET",
    path: "/api/eligibility/v2/availity"
  )
  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) ⇒ Hash[String, Object]

<Tip>Candid is deprecating support for this endpoint. It is instead recommended to use [Candid’s Stedi passthrough endpoint](docs.joincandidhealth.com/api-reference/pre-encounter/eligibility-checks/v-1/post). For assistance with the transition, please reference the [Transitioning to Candid’s New Eligibility Endpoint](support.joincandidhealth.com/hc/en-us/articles/34918552872980) document in the Candid Support Center.</Tip>

If you’d like access to this endpoint, please reach out to [email protected] 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](developer.availity.com/partner/product/191210/api/190898#/Coverages_100/operation/%2Fcoverages%2Fid/get)

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

Check connection status of Availity API and partners here:

Returns:

  • (Hash[String, Object])

Raises:

  • (error_class)


106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/candid/eligibility/v_2/client.rb', line 106

def submit_eligibility_check_availity_post(request_options: {}, **params)
  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "POST",
    path: "/api/eligibility/v2/availity",
    body: params
  )
  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