Class: CandidApiClient::OrganizationProviders::V3::AsyncV3Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::OrganizationProviders::V3::AsyncV3Client

Parameters:



171
172
173
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 171

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



167
168
169
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 167

def request_client
  @request_client
end

Instance Method Details

#create(request:, request_options: nil) ⇒ CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderV2

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_providers.v_3.create(request: { npi: "string", is_rendering: true, is_billing: true, first_name: "string", last_name: "string", organization_name: "string", provider_type: INDIVIDUAL, tax_id: "string", taxonomy_code: "string", license_type: MD, addresses: [{ address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, address_type: DEFAULT }], employment_start_date: DateTime.parse(2023-01-15), employment_termination_date: DateTime.parse(2023-01-15), qualifications: [{ period: { start_date: "string" }, identifier_code: MCR }] })

Parameters:

  • request (Hash)

    Request of type CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderCreateV2, as a Hash

    • :npi (String)

    • :is_rendering (Boolean)

    • :is_billing (Boolean)

    • :first_name (String)

    • :last_name (String)

    • :organization_name (String)

    • :provider_type (CandidApiClient::OrganizationProviders::V2::Types::ProviderType)

    • :tax_id (String)

    • :taxonomy_code (String)

    • :license_type (CandidApiClient::OrganizationProviders::V2::Types::LicenseType)

    • :addresses (Array<CandidApiClient::OrganizationProviders::V2::Types::OrganizationProviderAddress>)

    • :employment_start_date (Date)

    • :employment_termination_date (Date)

    • :qualifications (Array<CandidApiClient::Identifiers::Types::IdentifierCreate>)

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

Returns:



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 266

def create(request:, request_options: nil)
  Async do
    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 || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/organization-providers/v3"
    end
    CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderV2.from_json(json_object: response.body)
  end
end

#get(organization_provider_id:, request_options: nil) ⇒ CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderV2

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_providers.v_3.get(organization_provider_id: "965A563A-0285-4910-9569-E3739C0F6EAB")

Parameters:

Returns:



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 181

def get(organization_provider_id:, request_options: nil)
  Async do
    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/organization-providers/v3/#{organization_provider_id}"
    end
    CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderV2.from_json(json_object: response.body)
  end
end

#get_multi(limit: nil, search_term: nil, npi: nil, is_rendering: nil, is_billing: nil, page_token: nil, sort: nil, request_options: nil) ⇒ CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderPageV2

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_providers.v_3.get_multi(
  limit: 100,
  search_term: "john",
  npi: "1234567890",
  is_rendering: true,
  is_billing: true,
  page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
  sort: PROVIDER_NAME_ASC
)

Parameters:

  • limit (Integer) (defaults to: nil)

    Limit the number of results returned. Defaults to 100.

  • search_term (String) (defaults to: nil)

    Filter to a name or a part of a name.

  • npi (String) (defaults to: nil)

    Filter to a specific NPI.

  • is_rendering (Boolean) (defaults to: nil)

    Filter to only rendering providers.

  • is_billing (Boolean) (defaults to: nil)

    Filter to only billing providers.

  • page_token (String) (defaults to: nil)

    The page token to continue paging through a previous request.

  • sort (CandidApiClient::OrganizationProviders::V2::Types::OrganizationProviderSortOptions) (defaults to: nil)

    Defaults to PROVIDER_NAME_ASC.

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

Returns:



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 218

def get_multi(limit: nil, search_term: nil, npi: nil, is_rendering: nil, is_billing: nil, page_token: nil,
              sort: nil, request_options: nil)
  Async do
    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 || {}),
        "limit": limit,
        "search_term": search_term,
        "npi": npi,
        "is_rendering": is_rendering,
        "is_billing": is_billing,
        "page_token": page_token,
        "sort": sort
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/organization-providers/v3"
    end
    CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderPageV2.from_json(json_object: response.body)
  end
end

#update(organization_provider_id:, request:, request_options: nil) ⇒ CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderV2

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_providers.v_3.update(organization_provider_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { npi: "string", is_rendering: true, is_billing: true, first_name: "string", last_name: "string", organization_name: "string", provider_type: INDIVIDUAL, tax_id: "string", taxonomy_code: "string", license_type: MD, addresses: [{ address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, address_type: DEFAULT }], employment_start_date: "string", employment_termination_date: "string", qualifications:  })

Parameters:

  • organization_provider_id (String)
  • request (Hash)

    Request of type CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderUpdateV2, as a Hash

    • :npi (String)

    • :is_rendering (Boolean)

    • :is_billing (Boolean)

    • :first_name (String)

    • :last_name (String)

    • :organization_name (String)

    • :provider_type (CandidApiClient::OrganizationProviders::V2::Types::ProviderType)

    • :tax_id (String)

    • :taxonomy_code (String)

    • :license_type (CandidApiClient::OrganizationProviders::V2::Types::LicenseType)

    • :addresses (Array<CandidApiClient::OrganizationProviders::V2::Types::OrganizationProviderAddress>)

    • :employment_start_date (String)

    • :employment_termination_date (String)

    • :qualifications (Array<CandidApiClient::Identifiers::Types::UpdatableIdentifier>)

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

Returns:



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

def update(organization_provider_id:, request:, request_options: nil)
  Async do
    response = @request_client.conn.patch 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/organization-providers/v3/#{organization_provider_id}"
    end
    CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderV2.from_json(json_object: response.body)
  end
end