Class: CandidApiClient::OrganizationProviders::V3::V3Client

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::V3Client

Parameters:



20
21
22
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 20

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::RequestClient (readonly)



16
17
18
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 16

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:



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 111

def create(request:, 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 || {}), **(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

#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:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 30

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



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 65

def get_multi(limit: nil, search_term: nil, npi: nil, is_rendering: nil, is_billing: nil, page_token: nil,
              sort: 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 || {}),
      "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

#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:



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/candidhealth/organization_providers/v_3/client.rb', line 148

def update(organization_provider_id:, request:, request_options: nil)
  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