Class: CandidApiClient::FeeSchedules::V3::V3Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/fee_schedules/v_3/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::FeeSchedules::V3::V3Client

Parameters:



31
32
33
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 31

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::RequestClient (readonly)



27
28
29
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 27

def request_client
  @request_client
end

Instance Method Details

#delete_rate(rate_id:, version:, request_options: nil) ⇒ Void

Soft deletes a rate from the system. Only the most recent version of a rate can

be deleted.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.delete_rate(rate_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", version: 1)

Parameters:

Returns:

  • (Void)


283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 283

def delete_rate(rate_id:, version:, request_options: nil)
  @request_client.conn.delete do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/fee-schedules/v3/#{rate_id}/#{version}"
  end
end

#get_match(service_line_id:, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchResult

Gets the rate that matches a service line. No result means no rate exists

matching the service line's dimensions.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.get_match(service_line_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 44

def get_match(service_line_id:, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/fee-schedules/v3/service-line/#{service_line_id}/match"
  end
  CandidApiClient::FeeSchedules::V3::Types::MatchResult.from_json(json_object: response.body)
end

#get_multi(page_token: nil, limit: nil, active_date: nil, payer_uuid: nil, organization_billing_provider_id: nil, states: nil, zip_codes: nil, license_types: nil, facility_type_codes: nil, network_types: nil, cpt_code: nil, modifiers: nil, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::RatesPage

Gets a list of dimensions with their rates. The rates returned will always be

the most recent versions of those rates.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.get_multi(
  page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
  limit: 1,
  active_date: DateTime.parse(2023-01-15),
  payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  organization_billing_provider_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  states: AA,
  zip_codes: "string",
  license_types: MD,
  facility_type_codes: PHARMACY,
  network_types: PPO,
  cpt_code: "string",
  modifiers: TWENTY_TWO
)

Parameters:

Returns:



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 116

def get_multi(page_token: nil, limit: nil, active_date: nil, payer_uuid: nil,
              organization_billing_provider_id: nil, states: nil, zip_codes: nil, license_types: nil, facility_type_codes: nil, network_types: nil, cpt_code: nil, modifiers: nil, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "page_token": page_token,
      "limit": limit,
      "active_date": active_date,
      "payer_uuid": payer_uuid,
      "organization_billing_provider_id": organization_billing_provider_id,
      "states": states,
      "zip_codes": zip_codes,
      "license_types": license_types,
      "facility_type_codes": facility_type_codes,
      "network_types": network_types,
      "cpt_code": cpt_code,
      "modifiers": modifiers
    }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/fee-schedules/v3"
  end
  CandidApiClient::FeeSchedules::V3::Types::RatesPage.from_json(json_object: response.body)
end

#get_payer_thresholds(payer_uuids:, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::PayerThresholdsPage

Gets a list of payers and thresholds by their uuids

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.get_payer_thresholds(payer_uuids: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 327

def get_payer_thresholds(payer_uuids:, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = { **(request_options&.additional_query_parameters || {}), "payer_uuids": payer_uuids }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/fee-schedules/v3/payer-threshold"
  end
  CandidApiClient::FeeSchedules::V3::Types::PayerThresholdsPage.from_json(json_object: response.body)
end

#get_payer_thresholds_default(request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::PayerThreshold

Gets the default payer threshold

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.get_payer_thresholds_default

Parameters:

Returns:



304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 304

def get_payer_thresholds_default(request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/fee-schedules/v3/payer-threshold/default"
  end
  CandidApiClient::FeeSchedules::V3::Types::PayerThreshold.from_json(json_object: response.body)
end

#get_rate_history(rate_id:, request_options: nil) ⇒ Array<CandidApiClient::FeeSchedules::V3::Types::Rate>

Gets every version of a rate.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.get_rate_history(rate_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 220

def get_rate_history(rate_id:, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/fee-schedules/v3/#{rate_id}/history"
  end
  parsed_json = JSON.parse(response.body)
  parsed_json&.map do |item|
    item = item.to_json
    CandidApiClient::FeeSchedules::V3::Types::Rate.from_json(json_object: item)
  end
end

#get_unique_values_for_dimension(pivot_dimension:, page_token: nil, limit: nil, payer_uuid: nil, organization_billing_provider_id: nil, states: nil, zip_codes: nil, license_types: nil, facility_type_codes: nil, network_types: nil, cpt_code: nil, modifiers: nil, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::DimensionsPage

Gets unique values for a dimension based on other selection criteria. The

response is a list of dimensions with your criteria and the unique values
populated. This API is useful for driving pivots on dimension values.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.get_unique_values_for_dimension(
  page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
  limit: 1,
  pivot_dimension: PAYER_UUID,
  payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  organization_billing_provider_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  states: AA,
  zip_codes: "string",
  license_types: MD,
  facility_type_codes: PHARMACY,
  network_types: PPO,
  cpt_code: "string",
  modifiers: TWENTY_TWO
)

Parameters:

Returns:



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 181

def get_unique_values_for_dimension(pivot_dimension:, page_token: nil, limit: nil, payer_uuid: nil,
                                    organization_billing_provider_id: nil, states: nil, zip_codes: nil, license_types: nil, facility_type_codes: nil, network_types: nil, cpt_code: nil, modifiers: nil, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "page_token": page_token,
      "limit": limit,
      "pivot_dimension": pivot_dimension,
      "payer_uuid": payer_uuid,
      "organization_billing_provider_id": organization_billing_provider_id,
      "states": states,
      "zip_codes": zip_codes,
      "license_types": license_types,
      "facility_type_codes": facility_type_codes,
      "network_types": network_types,
      "cpt_code": cpt_code,
      "modifiers": modifiers
    }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/fee-schedules/v3/unique-dimension-values"
  end
  CandidApiClient::FeeSchedules::V3::Types::DimensionsPage.from_json(json_object: response.body)
end

#set_payer_threshold(payer_uuid:, request:, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::PayerThreshold

Sets the threshold information for a payer

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.set_payer_threshold(payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { upper_threshold_cents: 1, lower_threshold_cents: 1, disable_paid_incorrectly: true })

Parameters:

  • payer_uuid (String)
  • request (Hash)

    Request of type CandidApiClient::FeeSchedules::V3::Types::PayerThreshold, as a Hash

    • :upper_threshold_cents (Integer)

    • :lower_threshold_cents (Integer)

    • :disable_paid_incorrectly (Boolean)

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 355

def set_payer_threshold(payer_uuid:, request:, request_options: nil)
  response = @request_client.conn.put do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/fee-schedules/v3/payer-threshold/#{payer_uuid}"
  end
  CandidApiClient::FeeSchedules::V3::Types::PayerThreshold.from_json(json_object: response.body)
end

#test_match(service_line_id:, rate_id:, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchTestResult

Tests a service line against a rate to see if it matches.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.test_match(service_line_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", rate_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 68

def test_match(service_line_id:, rate_id:, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/fee-schedules/v3/service-line/#{service_line_id}/match/#{rate_id}"
  end
  CandidApiClient::FeeSchedules::V3::Types::MatchTestResult.from_json(json_object: response.body)
end

#upload_fee_schedule(dry_run:, rates:, request_options: nil) ⇒ Array<CandidApiClient::FeeSchedules::V3::Types::Rate>

Uploads a new fee schedule.n Each rate may either be totally new as qualified

by it's dimensions or a new version for an existing rate.\n If adding a new
version to an existing rate, the rate must be posted with the next version
number (previous version + 1) or a EntityConflictError will be returned.\n Use
the dry run flag to discover already existing rates and to run validations. If
validations for any rate fail, no rates will be saved to the system.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.upload_fee_schedule(dry_run: true, rates: )

Parameters:

  • dry_run (Boolean)
  • rates (Array<Hash>)

    Request of type Array<CandidApiClient::FeeSchedules::V3::Types::RateUpload>, as a Hash

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 253

def upload_fee_schedule(dry_run:, rates:, request_options: nil)
  response = @request_client.conn.post do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.body = { **(request_options&.additional_body_parameters || {}), dry_run: dry_run, rates: rates }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/fee-schedules/v3"
  end
  parsed_json = JSON.parse(response.body)
  parsed_json&.map do |item|
    item = item.to_json
    CandidApiClient::FeeSchedules::V3::Types::Rate.from_json(json_object: item)
  end
end