Class: CandidApiClient::WriteOffs::V1::AsyncV1Client
- Inherits:
-
Object
- Object
- CandidApiClient::WriteOffs::V1::AsyncV1Client
- Defined in:
- lib/candidhealth/write_offs/v_1/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(write_offs:, request_options: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::CreateWriteOffsResponse
Creates one or many write-offs applied toward a specific service line, claim, or billing provider.
-
#get(write_off_id:, request_options: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::WriteOff
Retrieves a previously created write off by its ‘write_off_id`.
-
#get_multi(limit: nil, patient_external_id: nil, payer_uuid: nil, service_line_id: nil, claim_id: nil, billing_provider_id: nil, sort: nil, sort_direction: nil, page_token: nil, account_types: nil, request_options: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::WriteOffsPage
Returns all write-offs satisfying the search criteria.
- #initialize(request_client:) ⇒ CandidApiClient::WriteOffs::V1::AsyncV1Client constructor
-
#revert(write_off_id:, request_options: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::WriteOff
Reverts a write off given a ‘write_off_id`.
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::WriteOffs::V1::AsyncV1Client
161 162 163 |
# File 'lib/candidhealth/write_offs/v_1/client.rb', line 161 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
157 158 159 |
# File 'lib/candidhealth/write_offs/v_1/client.rb', line 157 def request_client @request_client end |
Instance Method Details
#create(write_offs:, request_options: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::CreateWriteOffsResponse
Creates one or many write-offs applied toward a specific service line,
claim, or billing provider.
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/candidhealth/write_offs/v_1/client.rb', line 258 def create(write_offs:, request_options: nil) Async do response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.body = { **(&.additional_body_parameters || {}), write_offs: write_offs }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/write-offs/v1" end CandidApiClient::WriteOffs::V1::Types::CreateWriteOffsResponse.from_json(json_object: response.body) end end |
#get(write_off_id:, request_options: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::WriteOff
Retrieves a previously created write off by its ‘write_off_id`.
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/candidhealth/write_offs/v_1/client.rb', line 232 def get(write_off_id:, request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/write-offs/v1/#{write_off_id}" end CandidApiClient::WriteOffs::V1::Types::WriteOff.from_json(json_object: response.body) end end |
#get_multi(limit: nil, patient_external_id: nil, payer_uuid: nil, service_line_id: nil, claim_id: nil, billing_provider_id: nil, sort: nil, sort_direction: nil, page_token: nil, account_types: nil, request_options: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::WriteOffsPage
Returns all write-offs satisfying the search criteria.
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/candidhealth/write_offs/v_1/client.rb', line 193 def get_multi(limit: nil, patient_external_id: nil, payer_uuid: nil, service_line_id: nil, claim_id: nil, billing_provider_id: nil, sort: nil, sort_direction: nil, page_token: nil, account_types: nil, request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "limit": limit, "patient_external_id": patient_external_id, "payer_uuid": payer_uuid, "service_line_id": service_line_id, "claim_id": claim_id, "billing_provider_id": billing_provider_id, "sort": sort, "sort_direction": sort_direction, "page_token": page_token, "account_types": account_types }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/write-offs/v1" end CandidApiClient::WriteOffs::V1::Types::WriteOffsPage.from_json(json_object: response.body) end end |
#revert(write_off_id:, request_options: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::WriteOff
Reverts a write off given a ‘write_off_id`.
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/candidhealth/write_offs/v_1/client.rb', line 284 def revert(write_off_id:, request_options: nil) Async do response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/write-offs/v1/#{write_off_id}/revert" end CandidApiClient::WriteOffs::V1::Types::WriteOff.from_json(json_object: response.body) end end |