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)


261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 261

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, payer_plan_group_ids: 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

Parameters:

Returns:



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 104

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, payer_plan_group_ids: 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,
      "payer_plan_group_ids": payer_plan_group_ids,
      "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:



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

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:



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

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:



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 198

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, payer_plan_group_ids: 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(pivot_dimension: PAYER_UUID)

Parameters:

Returns:



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 158

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, payer_plan_group_ids: 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,
      "payer_plan_group_ids": payer_plan_group_ids,
      "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: { 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:



333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 333

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:



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 231

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