Class: CandidApiClient::PreEncounter::Coverages::V1::AsyncV1Client

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

Parameters:



608
609
610
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 608

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



604
605
606
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 604

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)


1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 1124

def batch_update_ppg(ppg_id:, request:, request_options: nil)
  Async do
    @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
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:



1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 1158

def check_eligibility(id:, service_code:, date_of_service:, npi:, 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_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
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 }, 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:



763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 763

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



999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 999

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



1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 1190

def get_eligibility(id:, check_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: 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
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:



1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 1025

def get_history(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: 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
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:



1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 1054

def get_multi(patient_id: 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 || {}),
        "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
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:



966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 966

def get_multi_paginated(patient_id: nil, payer_plan_group_id: nil, page_token: nil, limit: 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 || {}),
        "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
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:



1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 1088

def scan(since:, 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 || {}), "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
end

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

Updates a Coverage. The path must contain the next version number to prevent

race conditions. For example, if the current version of the coverage is n, you
will need to send a request to this endpoint with `/{id}/n+1` to update the
coverage. 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 }, 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:



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
# File 'lib/candidhealth/pre_encounter/coverages/v_1/client.rb', line 937

def update(id:, version:, request:, request_options: nil)
  Async do
    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
end