Class: CandidApiClient::Contracts::V2::V2Client
- Inherits:
-
Object
- Object
- CandidApiClient::Contracts::V2::V2Client
- Defined in:
- lib/candidhealth/contracts/v_2/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, contracting_provider_id:, rendering_provider_ids:, payer_uuid:, expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil, _field_set: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
Creates a new contract within the user’s current organization.
- #delete(contract_id:, request_options: nil) ⇒ Void
- #get(contract_id:, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
- #get_multi(page_token: nil, limit: nil, contracting_provider_id: nil, rendering_provider_ids: nil, payer_names: nil, states: nil, contract_status: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractsPage
- #initialize(request_client:) ⇒ CandidApiClient::Contracts::V2::V2Client constructor
- #update(contract_id:, rendering_provider_ids: nil, effective_date: nil, expiration_date: nil, regions: nil, contract_status: nil, authorized_signatory: nil, commercial_insurance_types: nil, medicare_insurance_types: nil, medicaid_insurance_types: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::Contracts::V2::V2Client
27 28 29 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 27 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::RequestClient (readonly)
23 24 25 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 23 def request_client @request_client end |
Instance Method Details
#create(effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, contracting_provider_id:, rendering_provider_ids:, payer_uuid:, expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil, _field_set: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
Creates a new contract within the user’s current organization
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 131 def create(effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, contracting_provider_id:, rendering_provider_ids:, payer_uuid:, expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil, _field_set: nil, request_options: nil) 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 || {}), effective_date: effective_date, expiration_date: expiration_date, regions: regions, contract_status: contract_status, authorized_signatory: , commercial_insurance_types: commercial_insurance_types, medicare_insurance_types: medicare_insurance_types, medicaid_insurance_types: medicaid_insurance_types, additional_properties: additional_properties, _field_set: _field_set, contracting_provider_id: contracting_provider_id, rendering_provider_ids: rendering_provider_ids, payer_uuid: payer_uuid }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/contracts/v2" end CandidApiClient::Contracts::V2::Types::ContractWithProviders.from_json(json_object: response.body) end |
#delete(contract_id:, request_options: nil) ⇒ Void
169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 169 def delete(contract_id:, request_options: nil) @request_client.conn.delete 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/contracts/v2/#{contract_id}" end end |
#get(contract_id:, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 37 def get(contract_id:, request_options: nil) 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/contracts/v2/#{contract_id}" end CandidApiClient::Contracts::V2::Types::ContractWithProviders.from_json(json_object: response.body) end |
#get_multi(page_token: nil, limit: nil, contracting_provider_id: nil, rendering_provider_ids: nil, payer_names: nil, states: nil, contract_status: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractsPage
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 72 def get_multi(page_token: nil, limit: nil, contracting_provider_id: nil, rendering_provider_ids: nil, payer_names: nil, states: nil, contract_status: nil, request_options: nil) 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 || {}), "page_token": page_token, "limit": limit, "contracting_provider_id": contracting_provider_id, "rendering_provider_ids": rendering_provider_ids, "payer_names": payer_names, "states": states, "contract_status": contract_status }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/contracts/v2" end CandidApiClient::Contracts::V2::Types::ContractsPage.from_json(json_object: response.body) end |
#update(contract_id:, rendering_provider_ids: nil, effective_date: nil, expiration_date: nil, regions: nil, contract_status: nil, authorized_signatory: nil, commercial_insurance_types: nil, medicare_insurance_types: nil, medicaid_insurance_types: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 206 def update(contract_id:, rendering_provider_ids: nil, effective_date: nil, expiration_date: nil, regions: nil, contract_status: nil, authorized_signatory: nil, commercial_insurance_types: nil, medicare_insurance_types: nil, medicaid_insurance_types: nil, request_options: nil) response = @request_client.conn.patch 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 || {}), rendering_provider_ids: rendering_provider_ids, effective_date: effective_date, expiration_date: expiration_date, regions: regions, contract_status: contract_status, authorized_signatory: , commercial_insurance_types: commercial_insurance_types, medicare_insurance_types: medicare_insurance_types, medicaid_insurance_types: medicaid_insurance_types }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/contracts/v2/#{contract_id}" end CandidApiClient::Contracts::V2::Types::ContractWithProviders.from_json(json_object: response.body) end |