Class: CandidApiClient::OrganizationServiceFacilities::V2::V2Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/organization_service_facilities/v_2/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::V2Client

Parameters:



19
20
21
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 19

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::RequestClient (readonly)



15
16
17
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 15

def request_client
  @request_client
end

Instance Method Details

#create(request:, request_options: nil) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_service_facilities.v_2.create(request: { name: "Test Service Facility", aliases: ["Test Service Facility Alias"], description: "Test Service Facility Description", status: ACTIVE, operational_status: CLOSED, mode: INSTANCE, type: DIAGNOSTICS_OR_THERAPEUTICS_UNIT, physical_type: SITE, telecoms: ["555-555-5555"], address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } })

Parameters:

  • request (Hash)

    Request of type CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacilityCreate, as a Hash

    • :name (String)

    • :aliases (Array<String>)

    • :description (String)

    • :npi (String)

    • :status (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityStatus)

    • :operational_status (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityOperationalStatus)

    • :mode (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityMode)

    • :type (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityType)

    • :physical_type (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityPhysicalType)

    • :telecoms (Array<String>)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

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

Returns:



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 100

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-service-facilities/v2"
  end
  CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility.from_json(json_object: response.body)
end

#delete(organization_service_facility_id:, request_options: nil) ⇒ Void

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_service_facilities.v_2.delete(organization_service_facility_id: "30F55EE6-8C0E-43FC-A7FC-DAC00D5BF569")

Parameters:

Returns:

  • (Void)


162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 162

def delete(organization_service_facility_id:, 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/organization-service-facilities/v2/#{organization_service_facility_id}"
  end
end

#get(organization_service_facility_id:, request_options: nil) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_service_facilities.v_2.get(organization_service_facility_id: "30F55EE6-8C0E-43FC-A7FC-DAC00D5BF569")

Parameters:

Returns:



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

def get(organization_service_facility_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-service-facilities/v2/#{organization_service_facility_id}"
  end
  CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility.from_json(json_object: response.body)
end

#get_multi(limit: nil, name: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacilityPage

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_service_facilities.v_2.get_multi(
  limit: 100,
  name: "Test Service Facility",
  page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
)

Parameters:

  • limit (Integer) (defaults to: nil)

    Limit the number of results returned. Defaults to 100.

  • name (String) (defaults to: nil)

    Filter to a name or a part of a name.

  • page_token (String) (defaults to: nil)

    The page token to continue paging through a previous request.

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

Returns:



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 56

def get_multi(limit: nil, name: nil, page_token: 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,
      "name": name,
      "page_token": page_token
    }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/organization-service-facilities/v2"
  end
  CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacilityPage.from_json(json_object: response.body)
end

#update(organization_service_facility_id:, request:, request_options: nil) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_service_facilities.v_2.update(organization_service_facility_id: "30F55EE6-8C0E-43FC-A7FC-DAC00D5BF569", request: { name: "Test Service Facility", aliases: ["Test Service Facility Alias"], description: "Test Service Facility Description", status: ACTIVE, operational_status: CLOSED, mode: INSTANCE, type: DIAGNOSTICS_OR_THERAPEUTICS_UNIT, physical_type: SITE, telecoms: ["555-555-5555"], address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } })

Parameters:

  • organization_service_facility_id (String)
  • request (Hash)

    Request of type CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacilityUpdate, as a Hash

    • :name (String)

    • :aliases (Array<String>)

    • :description (String)

    • :npi (String)

    • :status (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityStatus)

    • :operational_status (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityOperationalStatus)

    • :mode (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityMode)

    • :type (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityType)

    • :physical_type (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityPhysicalType)

    • :telecoms (Array<String>)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

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

Returns:



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 140

def update(organization_service_facility_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-service-facilities/v2/#{organization_service_facility_id}"
  end
  CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility.from_json(json_object: response.body)
end