candidhealth 0.24.2 → 0.24.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/candidhealth/commons/types/primitive.rb +17 -0
- data/lib/candidhealth/custom_schemas/client.rb +30 -0
- data/lib/candidhealth/custom_schemas/v_1/client.rb +291 -0
- data/lib/candidhealth/custom_schemas/v_1/types/key_with_name_already_exists_error.rb +71 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema.rb +91 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_field.rb +71 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_get_multi_response.rb +65 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_instance.rb +76 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_validation_error.rb +100 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_validation_failure.rb +65 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_with_name_already_exists_error.rb +70 -0
- data/lib/candidhealth/encounters/v_4/client.rb +49 -12
- data/lib/candidhealth/encounters/v_4/types/encounter.rb +17 -1
- data/lib/candidhealth/encounters/v_4/types/key_does_not_exist_error.rb +70 -0
- data/lib/candidhealth/encounters/v_4/types/multiple_instances_for_schema_error.rb +60 -0
- data/lib/candidhealth/encounters/v_4/types/schema_does_not_exist_error.rb +60 -0
- data/lib/candidhealth/encounters/v_4/types/schema_instance_validation_error.rb +139 -0
- data/lib/candidhealth/encounters/v_4/types/schema_instance_validation_failure.rb +65 -0
- data/lib/candidhealth/encounters/v_4/types/schema_unauthorized_access_error.rb +60 -0
- data/lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb +90 -0
- data/lib/candidhealth/pre_encounter/common/types/disability_status.rb +14 -0
- data/lib/candidhealth/pre_encounter/common/types/ethnicity.rb +16 -0
- data/lib/candidhealth/pre_encounter/common/types/gender.rb +5 -2
- data/lib/candidhealth/pre_encounter/common/types/race.rb +21 -0
- data/lib/candidhealth/pre_encounter/common/types/sex.rb +16 -0
- data/lib/candidhealth/pre_encounter/common/types/sexual_orientation.rb +19 -0
- data/lib/candidhealth/pre_encounter/coverages/client.rb +6 -6
- data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +464 -11
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb +183 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_status.rb +20 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb +134 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb +129 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/network_type.rb +33 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb +88 -0
- data/lib/candidhealth/pre_encounter/patients/client.rb +6 -6
- data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +607 -11
- data/lib/candidhealth/pre_encounter/patients/v_1/types/contact.rb +133 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provenance.rb +73 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provider.rb +122 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/filing_order.rb +63 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/marital_status.rb +26 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +325 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +389 -0
- data/lib/candidhealth.rb +14 -7
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +34 -12
- metadata +38 -16
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/client.rb +0 -487
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage.rb +0 -185
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_status.rb +0 -22
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_type.rb +0 -18
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/insurance_plan.rb +0 -136
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/mutable_coverage.rb +0 -131
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/subscriber.rb +0 -90
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/client.rb +0 -590
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/contact.rb +0 -135
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provenance.rb +0 -75
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provider.rb +0 -116
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/marital_status.rb +0 -28
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/mutable_patient.rb +0 -242
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/patient.rb +0 -294
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: candidhealth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.24.
|
4
|
+
version: 0.24.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- lib/candidhealth/commons/types/patient_relationship_to_insured_code_all.rb
|
127
127
|
- lib/candidhealth/commons/types/phone_number.rb
|
128
128
|
- lib/candidhealth/commons/types/phone_number_type.rb
|
129
|
+
- lib/candidhealth/commons/types/primitive.rb
|
129
130
|
- lib/candidhealth/commons/types/procedure_modifier.rb
|
130
131
|
- lib/candidhealth/commons/types/qualifier_code.rb
|
131
132
|
- lib/candidhealth/commons/types/region_national.rb
|
@@ -157,6 +158,16 @@ files:
|
|
157
158
|
- lib/candidhealth/contracts/v_2/types/date_update.rb
|
158
159
|
- lib/candidhealth/contracts/v_2/types/insurance_types.rb
|
159
160
|
- lib/candidhealth/contracts/v_2/types/regions_update.rb
|
161
|
+
- lib/candidhealth/custom_schemas/client.rb
|
162
|
+
- lib/candidhealth/custom_schemas/v_1/client.rb
|
163
|
+
- lib/candidhealth/custom_schemas/v_1/types/key_with_name_already_exists_error.rb
|
164
|
+
- lib/candidhealth/custom_schemas/v_1/types/schema.rb
|
165
|
+
- lib/candidhealth/custom_schemas/v_1/types/schema_field.rb
|
166
|
+
- lib/candidhealth/custom_schemas/v_1/types/schema_get_multi_response.rb
|
167
|
+
- lib/candidhealth/custom_schemas/v_1/types/schema_instance.rb
|
168
|
+
- lib/candidhealth/custom_schemas/v_1/types/schema_validation_error.rb
|
169
|
+
- lib/candidhealth/custom_schemas/v_1/types/schema_validation_failure.rb
|
170
|
+
- lib/candidhealth/custom_schemas/v_1/types/schema_with_name_already_exists_error.rb
|
160
171
|
- lib/candidhealth/diagnoses/types/diagnosis.rb
|
161
172
|
- lib/candidhealth/diagnoses/types/diagnosis_create.rb
|
162
173
|
- lib/candidhealth/diagnoses/types/diagnosis_type_code.rb
|
@@ -193,15 +204,22 @@ files:
|
|
193
204
|
- lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb
|
194
205
|
- lib/candidhealth/encounters/v_4/types/intervention.rb
|
195
206
|
- lib/candidhealth/encounters/v_4/types/intervention_category.rb
|
207
|
+
- lib/candidhealth/encounters/v_4/types/key_does_not_exist_error.rb
|
196
208
|
- lib/candidhealth/encounters/v_4/types/lab.rb
|
197
209
|
- lib/candidhealth/encounters/v_4/types/lab_code_type.rb
|
198
210
|
- lib/candidhealth/encounters/v_4/types/medication.rb
|
211
|
+
- lib/candidhealth/encounters/v_4/types/multiple_instances_for_schema_error.rb
|
199
212
|
- lib/candidhealth/encounters/v_4/types/note_category.rb
|
200
213
|
- lib/candidhealth/encounters/v_4/types/patient_history_category.rb
|
201
214
|
- lib/candidhealth/encounters/v_4/types/patient_history_category_enum.rb
|
202
215
|
- lib/candidhealth/encounters/v_4/types/responsible_party_type.rb
|
216
|
+
- lib/candidhealth/encounters/v_4/types/schema_does_not_exist_error.rb
|
217
|
+
- lib/candidhealth/encounters/v_4/types/schema_instance_validation_error.rb
|
218
|
+
- lib/candidhealth/encounters/v_4/types/schema_instance_validation_failure.rb
|
219
|
+
- lib/candidhealth/encounters/v_4/types/schema_unauthorized_access_error.rb
|
203
220
|
- lib/candidhealth/encounters/v_4/types/service_authorization_exception_code.rb
|
204
221
|
- lib/candidhealth/encounters/v_4/types/synchronicity_type.rb
|
222
|
+
- lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb
|
205
223
|
- lib/candidhealth/encounters/v_4/types/vitals.rb
|
206
224
|
- lib/candidhealth/era/types/era.rb
|
207
225
|
- lib/candidhealth/era/types/era_base.rb
|
@@ -398,32 +416,36 @@ files:
|
|
398
416
|
- lib/candidhealth/pre_encounter/common/types/address_use.rb
|
399
417
|
- lib/candidhealth/pre_encounter/common/types/contact_point.rb
|
400
418
|
- lib/candidhealth/pre_encounter/common/types/contact_point_use.rb
|
419
|
+
- lib/candidhealth/pre_encounter/common/types/disability_status.rb
|
401
420
|
- lib/candidhealth/pre_encounter/common/types/error_base.rb
|
421
|
+
- lib/candidhealth/pre_encounter/common/types/ethnicity.rb
|
402
422
|
- lib/candidhealth/pre_encounter/common/types/gender.rb
|
403
423
|
- lib/candidhealth/pre_encounter/common/types/human_name.rb
|
404
424
|
- lib/candidhealth/pre_encounter/common/types/name_use.rb
|
405
425
|
- lib/candidhealth/pre_encounter/common/types/not_found_error_body.rb
|
406
426
|
- lib/candidhealth/pre_encounter/common/types/period.rb
|
427
|
+
- lib/candidhealth/pre_encounter/common/types/race.rb
|
407
428
|
- lib/candidhealth/pre_encounter/common/types/relationship.rb
|
429
|
+
- lib/candidhealth/pre_encounter/common/types/sex.rb
|
430
|
+
- lib/candidhealth/pre_encounter/common/types/sexual_orientation.rb
|
408
431
|
- lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb
|
409
432
|
- lib/candidhealth/pre_encounter/coverages/client.rb
|
410
433
|
- lib/candidhealth/pre_encounter/coverages/v_1/client.rb
|
411
|
-
- lib/candidhealth/pre_encounter/coverages/v_1/
|
412
|
-
- lib/candidhealth/pre_encounter/coverages/v_1/
|
413
|
-
- lib/candidhealth/pre_encounter/coverages/v_1/
|
414
|
-
- lib/candidhealth/pre_encounter/coverages/v_1/
|
415
|
-
- lib/candidhealth/pre_encounter/coverages/v_1/
|
416
|
-
- lib/candidhealth/pre_encounter/coverages/v_1/
|
417
|
-
- lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/subscriber.rb
|
434
|
+
- lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb
|
435
|
+
- lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_status.rb
|
436
|
+
- lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb
|
437
|
+
- lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb
|
438
|
+
- lib/candidhealth/pre_encounter/coverages/v_1/types/network_type.rb
|
439
|
+
- lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb
|
418
440
|
- lib/candidhealth/pre_encounter/patients/client.rb
|
419
441
|
- lib/candidhealth/pre_encounter/patients/v_1/client.rb
|
420
|
-
- lib/candidhealth/pre_encounter/patients/v_1/
|
421
|
-
- lib/candidhealth/pre_encounter/patients/v_1/
|
422
|
-
- lib/candidhealth/pre_encounter/patients/v_1/
|
423
|
-
- lib/candidhealth/pre_encounter/patients/v_1/
|
424
|
-
- lib/candidhealth/pre_encounter/patients/v_1/
|
425
|
-
- lib/candidhealth/pre_encounter/patients/v_1/
|
426
|
-
- lib/candidhealth/pre_encounter/patients/v_1/
|
442
|
+
- lib/candidhealth/pre_encounter/patients/v_1/types/contact.rb
|
443
|
+
- lib/candidhealth/pre_encounter/patients/v_1/types/external_provenance.rb
|
444
|
+
- lib/candidhealth/pre_encounter/patients/v_1/types/external_provider.rb
|
445
|
+
- lib/candidhealth/pre_encounter/patients/v_1/types/filing_order.rb
|
446
|
+
- lib/candidhealth/pre_encounter/patients/v_1/types/marital_status.rb
|
447
|
+
- lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb
|
448
|
+
- lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb
|
427
449
|
- lib/candidhealth/remits/v_1/types/payee.rb
|
428
450
|
- lib/candidhealth/remits/v_1/types/payee_identifier.rb
|
429
451
|
- lib/candidhealth/service_facility/client.rb
|
@@ -1,487 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "../../../../../requests"
|
4
|
-
require_relative "types/mutable_coverage"
|
5
|
-
require_relative "types/coverage"
|
6
|
-
require "json"
|
7
|
-
require "date"
|
8
|
-
require "async"
|
9
|
-
|
10
|
-
module CandidApiClient
|
11
|
-
module PreEncounter
|
12
|
-
module Coverages
|
13
|
-
module V1
|
14
|
-
class CoveragesClient
|
15
|
-
# @return [CandidApiClient::RequestClient]
|
16
|
-
attr_reader :request_client
|
17
|
-
|
18
|
-
# @param request_client [CandidApiClient::RequestClient]
|
19
|
-
# @return [CandidApiClient::PreEncounter::Coverages::V1::CoveragesClient]
|
20
|
-
def initialize(request_client:)
|
21
|
-
@request_client = request_client
|
22
|
-
end
|
23
|
-
|
24
|
-
# Creates a new Coverage. A Coverage provides the high-level identifiers and
|
25
|
-
# descriptors of a specific insurance plan for a specific individual - typically
|
26
|
-
# the information you can find on an insurance card. Additionally a coverage will
|
27
|
-
# include detailed benefits information covered by the specific plan for the
|
28
|
-
# individual.
|
29
|
-
#
|
30
|
-
# @param request [Hash] Request of type CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::MutableCoverage, as a Hash
|
31
|
-
# * :status (CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::CoverageStatus)
|
32
|
-
# * :subscriber (Hash)
|
33
|
-
# * :name (Hash)
|
34
|
-
# * :family (String)
|
35
|
-
# * :given (Array<String>)
|
36
|
-
# * :use (CandidApiClient::PreEncounter::Common::Types::NameUse)
|
37
|
-
# * :period (Hash)
|
38
|
-
# * :start (Date)
|
39
|
-
# * :end_ (Date)
|
40
|
-
# * :date_of_birth (Date)
|
41
|
-
# * :gender (CandidApiClient::PreEncounter::Common::Types::Gender)
|
42
|
-
# * :relationship (CandidApiClient::PreEncounter::Common::Types::Relationship)
|
43
|
-
# * :patient (String)
|
44
|
-
# * :insurance_plan (Hash)
|
45
|
-
# * :member_id (String)
|
46
|
-
# * :payer_id (String)
|
47
|
-
# * :payer_name (String)
|
48
|
-
# * :group_number (String)
|
49
|
-
# * :name (String)
|
50
|
-
# * :type (CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::CoverageType)
|
51
|
-
# * :period (Hash)
|
52
|
-
# * :start (Date)
|
53
|
-
# * :end_ (Date)
|
54
|
-
# * :insurance_card_image_locator (String)
|
55
|
-
# * :verified (Boolean)
|
56
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
57
|
-
# @return [CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage]
|
58
|
-
# @example
|
59
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
60
|
-
# api.pre_encounter.coverages.v_1.coverages.create(request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { } }, date_of_birth: DateTime.parse(2023-01-15), gender: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", type: PPO, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) }, insurance_card_image_locator: "string" }, verified: true })
|
61
|
-
def create(request:, request_options: nil)
|
62
|
-
response = @request_client.conn.post do |req|
|
63
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
64
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
65
|
-
req.headers = {
|
66
|
-
**(req.headers || {}),
|
67
|
-
**@request_client.get_headers,
|
68
|
-
**(request_options&.additional_headers || {})
|
69
|
-
}.compact
|
70
|
-
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
71
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
72
|
-
request_options: request_options)}/coverages/v1"
|
73
|
-
end
|
74
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: response.body)
|
75
|
-
end
|
76
|
-
|
77
|
-
# Updates a Coverage. The path must contain the most recent version to prevent
|
78
|
-
# races. Updating historic versions is not supported.
|
79
|
-
#
|
80
|
-
# @param id [String]
|
81
|
-
# @param version [Integer]
|
82
|
-
# @param request [Hash] Request of type CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::MutableCoverage, as a Hash
|
83
|
-
# * :status (CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::CoverageStatus)
|
84
|
-
# * :subscriber (Hash)
|
85
|
-
# * :name (Hash)
|
86
|
-
# * :family (String)
|
87
|
-
# * :given (Array<String>)
|
88
|
-
# * :use (CandidApiClient::PreEncounter::Common::Types::NameUse)
|
89
|
-
# * :period (Hash)
|
90
|
-
# * :start (Date)
|
91
|
-
# * :end_ (Date)
|
92
|
-
# * :date_of_birth (Date)
|
93
|
-
# * :gender (CandidApiClient::PreEncounter::Common::Types::Gender)
|
94
|
-
# * :relationship (CandidApiClient::PreEncounter::Common::Types::Relationship)
|
95
|
-
# * :patient (String)
|
96
|
-
# * :insurance_plan (Hash)
|
97
|
-
# * :member_id (String)
|
98
|
-
# * :payer_id (String)
|
99
|
-
# * :payer_name (String)
|
100
|
-
# * :group_number (String)
|
101
|
-
# * :name (String)
|
102
|
-
# * :type (CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::CoverageType)
|
103
|
-
# * :period (Hash)
|
104
|
-
# * :start (Date)
|
105
|
-
# * :end_ (Date)
|
106
|
-
# * :insurance_card_image_locator (String)
|
107
|
-
# * :verified (Boolean)
|
108
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
109
|
-
# @return [CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage]
|
110
|
-
# @example
|
111
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
112
|
-
# api.pre_encounter.coverages.v_1.coverages.update(
|
113
|
-
# id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
|
114
|
-
# version: 1,
|
115
|
-
# request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { } }, date_of_birth: DateTime.parse(2023-01-15), gender: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", type: PPO, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) }, insurance_card_image_locator: "string" }, verified: true }
|
116
|
-
# )
|
117
|
-
def update(id:, version:, request:, request_options: nil)
|
118
|
-
response = @request_client.conn.put do |req|
|
119
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
120
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
121
|
-
req.headers = {
|
122
|
-
**(req.headers || {}),
|
123
|
-
**@request_client.get_headers,
|
124
|
-
**(request_options&.additional_headers || {})
|
125
|
-
}.compact
|
126
|
-
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
127
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
128
|
-
request_options: request_options)}/coverages/v1/#{id}/#{version}"
|
129
|
-
end
|
130
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: response.body)
|
131
|
-
end
|
132
|
-
|
133
|
-
# gets a specific Coverage
|
134
|
-
#
|
135
|
-
# @param id [String]
|
136
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
137
|
-
# @return [CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage]
|
138
|
-
# @example
|
139
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
140
|
-
# api.pre_encounter.coverages.v_1.coverages.get(id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
141
|
-
def get(id:, request_options: nil)
|
142
|
-
response = @request_client.conn.get do |req|
|
143
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
144
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
145
|
-
req.headers = {
|
146
|
-
**(req.headers || {}),
|
147
|
-
**@request_client.get_headers,
|
148
|
-
**(request_options&.additional_headers || {})
|
149
|
-
}.compact
|
150
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
151
|
-
request_options: request_options)}/coverages/v1/#{id}"
|
152
|
-
end
|
153
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: response.body)
|
154
|
-
end
|
155
|
-
|
156
|
-
# Gets a coverage along with it's full history. The return list is ordered by
|
157
|
-
# version ascending.
|
158
|
-
#
|
159
|
-
# @param id [String]
|
160
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
161
|
-
# @return [Array<CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage>]
|
162
|
-
# @example
|
163
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
164
|
-
# api.pre_encounter.coverages.v_1.coverages.get_history(id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
165
|
-
def get_history(id:, request_options: nil)
|
166
|
-
response = @request_client.conn.get do |req|
|
167
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
168
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
169
|
-
req.headers = {
|
170
|
-
**(req.headers || {}),
|
171
|
-
**@request_client.get_headers,
|
172
|
-
**(request_options&.additional_headers || {})
|
173
|
-
}.compact
|
174
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
175
|
-
request_options: request_options)}/coverages/v1/#{id}/history"
|
176
|
-
end
|
177
|
-
parsed_json = JSON.parse(response.body)
|
178
|
-
parsed_json&.map do |item|
|
179
|
-
item = item.to_json
|
180
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: item)
|
181
|
-
end
|
182
|
-
end
|
183
|
-
|
184
|
-
# returns a list of Coverages based on the search criteria
|
185
|
-
#
|
186
|
-
# @param patient_id [String]
|
187
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
188
|
-
# @return [Array<CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage>]
|
189
|
-
# @example
|
190
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
191
|
-
# api.pre_encounter.coverages.v_1.coverages.get_multi(patient_id: "string")
|
192
|
-
def get_multi(patient_id: nil, request_options: nil)
|
193
|
-
response = @request_client.conn.get do |req|
|
194
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
195
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
196
|
-
req.headers = {
|
197
|
-
**(req.headers || {}),
|
198
|
-
**@request_client.get_headers,
|
199
|
-
**(request_options&.additional_headers || {})
|
200
|
-
}.compact
|
201
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "patient_id": patient_id }.compact
|
202
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
203
|
-
request_options: request_options)}/coverages/v1"
|
204
|
-
end
|
205
|
-
parsed_json = JSON.parse(response.body)
|
206
|
-
parsed_json&.map do |item|
|
207
|
-
item = item.to_json
|
208
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: item)
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
|
-
# Scans up to 100 coverage updates. The since query parameter is inclusive, and
|
213
|
-
# the result list is ordered by updatedAt descending.
|
214
|
-
#
|
215
|
-
# @param since [DateTime]
|
216
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
217
|
-
# @return [Array<CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage>]
|
218
|
-
# @example
|
219
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
220
|
-
# api.pre_encounter.coverages.v_1.coverages.scan(since: DateTime.parse(2024-01-15T09:30:00.000Z))
|
221
|
-
def scan(since:, request_options: nil)
|
222
|
-
response = @request_client.conn.get do |req|
|
223
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
224
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
225
|
-
req.headers = {
|
226
|
-
**(req.headers || {}),
|
227
|
-
**@request_client.get_headers,
|
228
|
-
**(request_options&.additional_headers || {})
|
229
|
-
}.compact
|
230
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "since": since }.compact
|
231
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
232
|
-
request_options: request_options)}/coverages/v1/updates/scan"
|
233
|
-
end
|
234
|
-
parsed_json = JSON.parse(response.body)
|
235
|
-
parsed_json&.map do |item|
|
236
|
-
item = item.to_json
|
237
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: item)
|
238
|
-
end
|
239
|
-
end
|
240
|
-
end
|
241
|
-
|
242
|
-
class AsyncCoveragesClient
|
243
|
-
# @return [CandidApiClient::AsyncRequestClient]
|
244
|
-
attr_reader :request_client
|
245
|
-
|
246
|
-
# @param request_client [CandidApiClient::AsyncRequestClient]
|
247
|
-
# @return [CandidApiClient::PreEncounter::Coverages::V1::AsyncCoveragesClient]
|
248
|
-
def initialize(request_client:)
|
249
|
-
@request_client = request_client
|
250
|
-
end
|
251
|
-
|
252
|
-
# Creates a new Coverage. A Coverage provides the high-level identifiers and
|
253
|
-
# descriptors of a specific insurance plan for a specific individual - typically
|
254
|
-
# the information you can find on an insurance card. Additionally a coverage will
|
255
|
-
# include detailed benefits information covered by the specific plan for the
|
256
|
-
# individual.
|
257
|
-
#
|
258
|
-
# @param request [Hash] Request of type CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::MutableCoverage, as a Hash
|
259
|
-
# * :status (CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::CoverageStatus)
|
260
|
-
# * :subscriber (Hash)
|
261
|
-
# * :name (Hash)
|
262
|
-
# * :family (String)
|
263
|
-
# * :given (Array<String>)
|
264
|
-
# * :use (CandidApiClient::PreEncounter::Common::Types::NameUse)
|
265
|
-
# * :period (Hash)
|
266
|
-
# * :start (Date)
|
267
|
-
# * :end_ (Date)
|
268
|
-
# * :date_of_birth (Date)
|
269
|
-
# * :gender (CandidApiClient::PreEncounter::Common::Types::Gender)
|
270
|
-
# * :relationship (CandidApiClient::PreEncounter::Common::Types::Relationship)
|
271
|
-
# * :patient (String)
|
272
|
-
# * :insurance_plan (Hash)
|
273
|
-
# * :member_id (String)
|
274
|
-
# * :payer_id (String)
|
275
|
-
# * :payer_name (String)
|
276
|
-
# * :group_number (String)
|
277
|
-
# * :name (String)
|
278
|
-
# * :type (CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::CoverageType)
|
279
|
-
# * :period (Hash)
|
280
|
-
# * :start (Date)
|
281
|
-
# * :end_ (Date)
|
282
|
-
# * :insurance_card_image_locator (String)
|
283
|
-
# * :verified (Boolean)
|
284
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
285
|
-
# @return [CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage]
|
286
|
-
# @example
|
287
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
288
|
-
# api.pre_encounter.coverages.v_1.coverages.create(request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { } }, date_of_birth: DateTime.parse(2023-01-15), gender: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", type: PPO, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) }, insurance_card_image_locator: "string" }, verified: true })
|
289
|
-
def create(request:, request_options: nil)
|
290
|
-
Async do
|
291
|
-
response = @request_client.conn.post do |req|
|
292
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
293
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
294
|
-
req.headers = {
|
295
|
-
**(req.headers || {}),
|
296
|
-
**@request_client.get_headers,
|
297
|
-
**(request_options&.additional_headers || {})
|
298
|
-
}.compact
|
299
|
-
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
300
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
301
|
-
request_options: request_options)}/coverages/v1"
|
302
|
-
end
|
303
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: response.body)
|
304
|
-
end
|
305
|
-
end
|
306
|
-
|
307
|
-
# Updates a Coverage. The path must contain the most recent version to prevent
|
308
|
-
# races. Updating historic versions is not supported.
|
309
|
-
#
|
310
|
-
# @param id [String]
|
311
|
-
# @param version [Integer]
|
312
|
-
# @param request [Hash] Request of type CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::MutableCoverage, as a Hash
|
313
|
-
# * :status (CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::CoverageStatus)
|
314
|
-
# * :subscriber (Hash)
|
315
|
-
# * :name (Hash)
|
316
|
-
# * :family (String)
|
317
|
-
# * :given (Array<String>)
|
318
|
-
# * :use (CandidApiClient::PreEncounter::Common::Types::NameUse)
|
319
|
-
# * :period (Hash)
|
320
|
-
# * :start (Date)
|
321
|
-
# * :end_ (Date)
|
322
|
-
# * :date_of_birth (Date)
|
323
|
-
# * :gender (CandidApiClient::PreEncounter::Common::Types::Gender)
|
324
|
-
# * :relationship (CandidApiClient::PreEncounter::Common::Types::Relationship)
|
325
|
-
# * :patient (String)
|
326
|
-
# * :insurance_plan (Hash)
|
327
|
-
# * :member_id (String)
|
328
|
-
# * :payer_id (String)
|
329
|
-
# * :payer_name (String)
|
330
|
-
# * :group_number (String)
|
331
|
-
# * :name (String)
|
332
|
-
# * :type (CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::CoverageType)
|
333
|
-
# * :period (Hash)
|
334
|
-
# * :start (Date)
|
335
|
-
# * :end_ (Date)
|
336
|
-
# * :insurance_card_image_locator (String)
|
337
|
-
# * :verified (Boolean)
|
338
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
339
|
-
# @return [CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage]
|
340
|
-
# @example
|
341
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
342
|
-
# api.pre_encounter.coverages.v_1.coverages.update(
|
343
|
-
# id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
|
344
|
-
# version: 1,
|
345
|
-
# request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { } }, date_of_birth: DateTime.parse(2023-01-15), gender: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", type: PPO, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) }, insurance_card_image_locator: "string" }, verified: true }
|
346
|
-
# )
|
347
|
-
def update(id:, version:, request:, request_options: nil)
|
348
|
-
Async do
|
349
|
-
response = @request_client.conn.put do |req|
|
350
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
351
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
352
|
-
req.headers = {
|
353
|
-
**(req.headers || {}),
|
354
|
-
**@request_client.get_headers,
|
355
|
-
**(request_options&.additional_headers || {})
|
356
|
-
}.compact
|
357
|
-
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
358
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
359
|
-
request_options: request_options)}/coverages/v1/#{id}/#{version}"
|
360
|
-
end
|
361
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: response.body)
|
362
|
-
end
|
363
|
-
end
|
364
|
-
|
365
|
-
# gets a specific Coverage
|
366
|
-
#
|
367
|
-
# @param id [String]
|
368
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
369
|
-
# @return [CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage]
|
370
|
-
# @example
|
371
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
372
|
-
# api.pre_encounter.coverages.v_1.coverages.get(id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
373
|
-
def get(id:, request_options: nil)
|
374
|
-
Async do
|
375
|
-
response = @request_client.conn.get do |req|
|
376
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
377
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
378
|
-
req.headers = {
|
379
|
-
**(req.headers || {}),
|
380
|
-
**@request_client.get_headers,
|
381
|
-
**(request_options&.additional_headers || {})
|
382
|
-
}.compact
|
383
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
384
|
-
request_options: request_options)}/coverages/v1/#{id}"
|
385
|
-
end
|
386
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: response.body)
|
387
|
-
end
|
388
|
-
end
|
389
|
-
|
390
|
-
# Gets a coverage along with it's full history. The return list is ordered by
|
391
|
-
# version ascending.
|
392
|
-
#
|
393
|
-
# @param id [String]
|
394
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
395
|
-
# @return [Array<CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage>]
|
396
|
-
# @example
|
397
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
398
|
-
# api.pre_encounter.coverages.v_1.coverages.get_history(id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
399
|
-
def get_history(id:, request_options: nil)
|
400
|
-
Async do
|
401
|
-
response = @request_client.conn.get do |req|
|
402
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
403
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
404
|
-
req.headers = {
|
405
|
-
**(req.headers || {}),
|
406
|
-
**@request_client.get_headers,
|
407
|
-
**(request_options&.additional_headers || {})
|
408
|
-
}.compact
|
409
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
410
|
-
request_options: request_options)}/coverages/v1/#{id}/history"
|
411
|
-
end
|
412
|
-
parsed_json = JSON.parse(response.body)
|
413
|
-
parsed_json&.map do |item|
|
414
|
-
item = item.to_json
|
415
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: item)
|
416
|
-
end
|
417
|
-
end
|
418
|
-
end
|
419
|
-
|
420
|
-
# returns a list of Coverages based on the search criteria
|
421
|
-
#
|
422
|
-
# @param patient_id [String]
|
423
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
424
|
-
# @return [Array<CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage>]
|
425
|
-
# @example
|
426
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
427
|
-
# api.pre_encounter.coverages.v_1.coverages.get_multi(patient_id: "string")
|
428
|
-
def get_multi(patient_id: nil, request_options: nil)
|
429
|
-
Async do
|
430
|
-
response = @request_client.conn.get do |req|
|
431
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
432
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
433
|
-
req.headers = {
|
434
|
-
**(req.headers || {}),
|
435
|
-
**@request_client.get_headers,
|
436
|
-
**(request_options&.additional_headers || {})
|
437
|
-
}.compact
|
438
|
-
req.params = {
|
439
|
-
**(request_options&.additional_query_parameters || {}),
|
440
|
-
"patient_id": patient_id
|
441
|
-
}.compact
|
442
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
443
|
-
request_options: request_options)}/coverages/v1"
|
444
|
-
end
|
445
|
-
parsed_json = JSON.parse(response.body)
|
446
|
-
parsed_json&.map do |item|
|
447
|
-
item = item.to_json
|
448
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: item)
|
449
|
-
end
|
450
|
-
end
|
451
|
-
end
|
452
|
-
|
453
|
-
# Scans up to 100 coverage updates. The since query parameter is inclusive, and
|
454
|
-
# the result list is ordered by updatedAt descending.
|
455
|
-
#
|
456
|
-
# @param since [DateTime]
|
457
|
-
# @param request_options [CandidApiClient::RequestOptions]
|
458
|
-
# @return [Array<CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage>]
|
459
|
-
# @example
|
460
|
-
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
461
|
-
# api.pre_encounter.coverages.v_1.coverages.scan(since: DateTime.parse(2024-01-15T09:30:00.000Z))
|
462
|
-
def scan(since:, request_options: nil)
|
463
|
-
Async do
|
464
|
-
response = @request_client.conn.get do |req|
|
465
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
466
|
-
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
467
|
-
req.headers = {
|
468
|
-
**(req.headers || {}),
|
469
|
-
**@request_client.get_headers,
|
470
|
-
**(request_options&.additional_headers || {})
|
471
|
-
}.compact
|
472
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "since": since }.compact
|
473
|
-
req.url "#{@request_client.get_url(environment: PreEncounter,
|
474
|
-
request_options: request_options)}/coverages/v1/updates/scan"
|
475
|
-
end
|
476
|
-
parsed_json = JSON.parse(response.body)
|
477
|
-
parsed_json&.map do |item|
|
478
|
-
item = item.to_json
|
479
|
-
CandidApiClient::PreEncounter::Coverages::V1::Coverages::Types::Coverage.from_json(json_object: item)
|
480
|
-
end
|
481
|
-
end
|
482
|
-
end
|
483
|
-
end
|
484
|
-
end
|
485
|
-
end
|
486
|
-
end
|
487
|
-
end
|