Class: CandidApiClient::PreEncounter::Coverages::V1::V1Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/pre_encounter/coverages/v_1/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::V1Client

Parameters:



25
26
27
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 25

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::RequestClient (readonly)



21
22
23
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 21

def request_client
  @request_client
end

Instance Method Details

#batch_update_ppg(ppg_id:, request:, request_options: nil) ⇒ Void

Finds all coverages associated with the given ppg_id and updates the ppg_fields

for each coverage.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.coverages.v_1.batch_update_ppg(ppg_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", payer_id: "payer_id", payer_name: "payer_name", plan_type: SELF_PAY })

Parameters:

  • ppg_id (String)
  • request (Hash)

    Request of type CandidApiClient::PreEncounter::Coverages::V1::Types::PayerPlanGroupFields, as a Hash

    • :payer_plan_group_id (String)

    • :payer_id (String)

    • :payer_name (String)

    • :plan_type (CandidApiClient::PreEncounter::Coverages::V1::Types::NetworkType)

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

Returns:

  • (Void)


522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 522

def batch_update_ppg(ppg_id:, request:, request_options: nil)
  @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: PreEncounter,
                                       request_options: request_options)}/coverages/v1/batch-update-ppg/#{ppg_id}"
  end
end

#check_eligibility(id:, service_code:, date_of_service:, npi:, request_options: nil) ⇒ CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckMetadata

Initiates an eligibility check. Returns the metadata of the check if

successfully initiated.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.coverages.v_1.check_eligibility(
  id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  service_code: MEDICAL_CARE,
  date_of_service: DateTime.parse(2023-01-15),
  npi: "npi"
)

Parameters:

Returns:



554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 554

def check_eligibility(id:, service_code:, date_of_service:, npi:, 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_options&.additional_body_parameters || {}),
      service_code: service_code,
      date_of_service: date_of_service,
      npi: npi
    }.compact
    req.url "#{@request_client.get_url(environment: PreEncounter,
                                       request_options: request_options)}/coverages/v1/#{id}/eligibility"
  end
  CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::.from_json(json_object: response.body)
end

#create(request:, request_options: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage

Creates a new Coverage. A Coverage provides the high-level identifiers and

descriptors of a specific insurance plan for a specific individual - typically
the information you can find on an insurance card. Additionally a coverage will
include detailed benefits information covered by the specific plan for the
individual.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.coverages.v_1.create(request: { status: ACTIVE, subscriber: { name: { family: "family", given: ["given", "given"], use: USUAL }, date_of_birth: DateTime.parse(2023-01-15), biological_sex: FEMALE }, relationship: SELF, patient: "patient", insurance_plan: { member_id: "member_id", payer_id: "payer_id", payer_name: "payer_name" }, verified: true })

Parameters:

  • request (Hash)

    Request of type CandidApiClient::PreEncounter::Coverages::V1::Types::MutableCoverage, as a Hash

    • :status (CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageStatus)

    • :subscriber (Hash)

      • :name (Hash)

        • :family (String)

        • :given (Array<String>)

        • :use (CandidApiClient::PreEncounter::Common::Types::NameUse)

        • :period (Hash)

          • :start (Date)

          • :end_ (Date)

        • :suffix (String)

      • :date_of_birth (Date)

      • :biological_sex (CandidApiClient::PreEncounter::Common::Types::Sex)

      • :address (Hash)

        • :use (CandidApiClient::PreEncounter::Common::Types::AddressUse)

        • :line (Array<String>)

        • :city (String)

        • :state (String)

        • :postal_code (String)

        • :country (String)

        • :period (Hash)

          • :start (Date)

          • :end_ (Date)

    • :relationship (CandidApiClient::PreEncounter::Common::Types::Relationship)

    • :patient (String)

    • :insurance_plan (Hash)

      • :member_id (String)

      • :payer_id (String)

      • :payer_name (String)

      • :additional_payer_information (Hash)

        • :availity_eligibility_id (String)

        • :availity_payer_id (String)

        • :availity_payer_name (String)

        • :availity_remittance_payer_id (String)

      • :group_number (String)

      • :name (String)

      • :plan_type (CandidApiClient::PreEncounter::Coverages::V1::Types::NetworkType)

      • :type (CandidApiClient::PreEncounter::Coverages::V1::Types::InsuranceTypeCode)

      • :period (Hash)

        • :start (Date)

        • :end_ (Date)

      • :insurance_card_image_locator (String)

      • :payer_plan_group_id (String)

    • :verified (Boolean)

    • :eligibility_checks (Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckMetadata>)

    • :latest_eligibility_check (Hash)

      • :check_id (String)

      • :status (CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityStatus)

      • :initiated_at (DateTime)

    • :benefits (Hash)

      • :plan_coverage (Hash)

        • :in_network (Hash)

          • :deductible (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_contract (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_remaining (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_year_to_date (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_contract (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_remaining (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_year_to_date (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :additional_notes (String)

        • :in_network_flat (Array<CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageDetails>)

        • :out_of_network (Hash)

          • :deductible (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_contract (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_remaining (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_year_to_date (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_contract (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_remaining (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_year_to_date (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :additional_notes (String)

        • :out_of_network_flat (Array<CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageDetails>)

      • :service_specific_coverage (Array<CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceCoverage>)

      • :benefits_related_entities (Array<CandidApiClient::PreEncounter::Coverages::V1::Types::BenefitsRelatedEntity>)

      • :notes (String)

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

Returns:



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 180

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: PreEncounter,
                                       request_options: request_options)}/coverages/v1"
  end
  CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage.from_json(json_object: response.body)
end

#get(id:, request_options: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage

gets a specific Coverage

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.coverages.v_1.get(id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 408

def get(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: PreEncounter,
                                       request_options: request_options)}/coverages/v1/#{id}"
  end
  CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage.from_json(json_object: response.body)
end

#get_eligibility(id:, check_id:, request_options: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageEligibilityCheckResponse

Gets the eligibility of a patient for a specific coverage if successful.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.coverages.v_1.get_eligibility(id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", check_id: "check_id")

Parameters:

Returns:



584
585
586
587
588
589
590
591
592
593
594
595
596
597
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 584

def get_eligibility(id:, check_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: PreEncounter,
                                       request_options: request_options)}/coverages/v1/#{id}/eligibility/#{check_id}"
  end
  CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageEligibilityCheckResponse.from_json(json_object: response.body)
end

#get_history(id:, request_options: nil) ⇒ Array<CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage>

Gets a coverage along with it’s full history. The return list is ordered by

version ascending.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.coverages.v_1.get_history(id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 432

def get_history(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: PreEncounter,
                                       request_options: request_options)}/coverages/v1/#{id}/history"
  end
  parsed_json = JSON.parse(response.body)
  parsed_json&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage.from_json(json_object: item)
  end
end

#get_multi(patient_id: nil, request_options: nil) ⇒ Array<CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage>

Returns a list of Coverages based on the search criteria.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.coverages.v_1.get_multi

Parameters:

Returns:



459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 459

def get_multi(patient_id: 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 || {}), "patient_id": patient_id }.compact
    req.url "#{@request_client.get_url(environment: PreEncounter,
                                       request_options: request_options)}/coverages/v1"
  end
  parsed_json = JSON.parse(response.body)
  parsed_json&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage.from_json(json_object: item)
  end
end

#get_multi_paginated(patient_id: nil, payer_plan_group_id: nil, page_token: nil, limit: nil, request_options: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoveragesPage

Returns a page of Coverages based on the search criteria.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.coverages.v_1.get_multi_paginated

Parameters:

  • patient_id (String) (defaults to: nil)
  • payer_plan_group_id (String) (defaults to: nil)
  • page_token (String) (defaults to: nil)
  • limit (Integer) (defaults to: nil)

    Must be between 0 and 1000. Defaults to 100

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

Returns:



377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 377

def get_multi_paginated(patient_id: nil, payer_plan_group_id: nil, page_token: nil, limit: 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 || {}),
      "patient_id": patient_id,
      "payer_plan_group_id": payer_plan_group_id,
      "page_token": page_token,
      "limit": limit
    }.compact
    req.url "#{@request_client.get_url(environment: PreEncounter,
                                       request_options: request_options)}/coverages/v1/get-multi-paginated"
  end
  CandidApiClient::PreEncounter::Coverages::V1::Types::CoveragesPage.from_json(json_object: response.body)
end

#scan(since:, request_options: nil) ⇒ Array<CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage>

Scans up to 100 coverage updates. The since query parameter is inclusive, and

the result list is ordered by updatedAt ascending.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.coverages.v_1.scan(since: DateTime.parse(2024-01-15T09:30:00.000Z))

Parameters:

Returns:



488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 488

def scan(since:, 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 || {}), "since": since }.compact
    req.url "#{@request_client.get_url(environment: PreEncounter,
                                       request_options: request_options)}/coverages/v1/updates/scan"
  end
  parsed_json = JSON.parse(response.body)
  parsed_json&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage.from_json(json_object: item)
  end
end

#update(id:, version:, request:, request_options: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage

Updates a Coverage. The path must contain the most recent version to prevent

race conditions.  Updating historic versions is not supported.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.coverages.v_1.update(
  id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  version: "version",
  request: { status: ACTIVE, subscriber: { name: { family: "family", given: ["given", "given"], use: USUAL }, date_of_birth: DateTime.parse(2023-01-15), biological_sex: FEMALE }, relationship: SELF, patient: "patient", insurance_plan: { member_id: "member_id", payer_id: "payer_id", payer_name: "payer_name" }, verified: true }
)

Parameters:

  • id (String)
  • version (String)
  • request (Hash)

    Request of type CandidApiClient::PreEncounter::Coverages::V1::Types::MutableCoverage, as a Hash

    • :status (CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageStatus)

    • :subscriber (Hash)

      • :name (Hash)

        • :family (String)

        • :given (Array<String>)

        • :use (CandidApiClient::PreEncounter::Common::Types::NameUse)

        • :period (Hash)

          • :start (Date)

          • :end_ (Date)

        • :suffix (String)

      • :date_of_birth (Date)

      • :biological_sex (CandidApiClient::PreEncounter::Common::Types::Sex)

      • :address (Hash)

        • :use (CandidApiClient::PreEncounter::Common::Types::AddressUse)

        • :line (Array<String>)

        • :city (String)

        • :state (String)

        • :postal_code (String)

        • :country (String)

        • :period (Hash)

          • :start (Date)

          • :end_ (Date)

    • :relationship (CandidApiClient::PreEncounter::Common::Types::Relationship)

    • :patient (String)

    • :insurance_plan (Hash)

      • :member_id (String)

      • :payer_id (String)

      • :payer_name (String)

      • :additional_payer_information (Hash)

        • :availity_eligibility_id (String)

        • :availity_payer_id (String)

        • :availity_payer_name (String)

        • :availity_remittance_payer_id (String)

      • :group_number (String)

      • :name (String)

      • :plan_type (CandidApiClient::PreEncounter::Coverages::V1::Types::NetworkType)

      • :type (CandidApiClient::PreEncounter::Coverages::V1::Types::InsuranceTypeCode)

      • :period (Hash)

        • :start (Date)

        • :end_ (Date)

      • :insurance_card_image_locator (String)

      • :payer_plan_group_id (String)

    • :verified (Boolean)

    • :eligibility_checks (Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckMetadata>)

    • :latest_eligibility_check (Hash)

      • :check_id (String)

      • :status (CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityStatus)

      • :initiated_at (DateTime)

    • :benefits (Hash)

      • :plan_coverage (Hash)

        • :in_network (Hash)

          • :deductible (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_contract (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_remaining (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_year_to_date (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_contract (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_remaining (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_year_to_date (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :additional_notes (String)

        • :in_network_flat (Array<CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageDetails>)

        • :out_of_network (Hash)

          • :deductible (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_contract (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_remaining (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :deductible_year_to_date (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_contract (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_remaining (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :oop_max_year_to_date (Hash)

            • :family (Float)

            • :individual (Float)

            • :employee_and_spouse (Float)

            • :employee_and_children (Float)

          • :additional_notes (String)

        • :out_of_network_flat (Array<CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageDetails>)

      • :service_specific_coverage (Array<CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceCoverage>)

      • :benefits_related_entities (Array<CandidApiClient::PreEncounter::Coverages::V1::Types::BenefitsRelatedEntity>)

      • :notes (String)

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

Returns:



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 350

def update(id:, version:, request:, request_options: nil)
  response = @request_client.conn.put 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: PreEncounter,
                                       request_options: request_options)}/coverages/v1/#{id}/#{version}"
  end
  CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage.from_json(json_object: response.body)
end