candidhealth 0.24.3 → 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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/pre_encounter/common/types/disability_status.rb +14 -0
  3. data/lib/candidhealth/pre_encounter/common/types/ethnicity.rb +16 -0
  4. data/lib/candidhealth/pre_encounter/common/types/gender.rb +5 -2
  5. data/lib/candidhealth/pre_encounter/common/types/race.rb +21 -0
  6. data/lib/candidhealth/pre_encounter/common/types/sex.rb +16 -0
  7. data/lib/candidhealth/pre_encounter/common/types/sexual_orientation.rb +19 -0
  8. data/lib/candidhealth/pre_encounter/coverages/client.rb +6 -6
  9. data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +464 -11
  10. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb +183 -0
  11. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_status.rb +20 -0
  12. data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb +134 -0
  13. data/lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb +129 -0
  14. data/lib/candidhealth/pre_encounter/coverages/v_1/types/network_type.rb +33 -0
  15. data/lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb +88 -0
  16. data/lib/candidhealth/pre_encounter/patients/client.rb +6 -6
  17. data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +607 -11
  18. data/lib/candidhealth/pre_encounter/patients/v_1/types/contact.rb +133 -0
  19. data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provenance.rb +73 -0
  20. data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provider.rb +122 -0
  21. data/lib/candidhealth/pre_encounter/patients/v_1/types/filing_order.rb +63 -0
  22. data/lib/candidhealth/pre_encounter/patients/v_1/types/marital_status.rb +26 -0
  23. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +325 -0
  24. data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +389 -0
  25. data/lib/candidhealth.rb +7 -7
  26. data/lib/requests.rb +2 -2
  27. data/lib/types_export.rb +18 -12
  28. metadata +20 -16
  29. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/client.rb +0 -487
  30. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage.rb +0 -185
  31. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_status.rb +0 -22
  32. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_type.rb +0 -18
  33. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/insurance_plan.rb +0 -136
  34. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/mutable_coverage.rb +0 -131
  35. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/subscriber.rb +0 -90
  36. data/lib/candidhealth/pre_encounter/patients/v_1/patients/client.rb +0 -590
  37. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/contact.rb +0 -135
  38. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provenance.rb +0 -75
  39. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provider.rb +0 -116
  40. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/marital_status.rb +0 -28
  41. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/mutable_patient.rb +0 -242
  42. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/patient.rb +0 -294
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e1718f0ca0a159b22fe68ff3c74381c4d6c9f0b88748b60300f78eb21c52e77
4
- data.tar.gz: e0a6c61539217e8e38d1ebd9b681d9f53ed5b2daec264794187955f6f72228de
3
+ metadata.gz: 0cc6b4451b8313b62bce521f1a66fbb1c3fd3841179886017423caaf5ab5e741
4
+ data.tar.gz: 63a2bb039a538e78c8bc3d1ffb86e5193a9517e958e9a401714f3d907e3ae203
5
5
  SHA512:
6
- metadata.gz: 07f8bf71ea0330db01ded0a5260cf40b8af9622e3d3042e5ad3e65ceb85e8b85acd99921d76a0e33fc8543ea5405c4b39c0f7b6f1baa9ad62e864ea86bbb4b8e
7
- data.tar.gz: 2e6edda2e02c8b73e2fe30ee09d90ed73f8e23521324dd79c0a88c84c1d04af110026b72ede5e54fd2567981d599b7ae5ce2bd6512ff0da2847363d58958c663
6
+ metadata.gz: 0e22c5eacf0626bcdaff500b93bb1273d9abc5b84b6a034461be91723fc63329e827c1a6c6e46f3b785923a758f589854d28538cdf7131a904d10a858990bb67
7
+ data.tar.gz: 1abbeb8295ca1fbe2fa7bb0d00cd6bb637f7fb08cd89f3b9cc91905331654a9ba92e55df9ac491399671d86a336aa128723ad0c3b76d90101eb900fb0d0b8a95
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ module PreEncounter
5
+ module Common
6
+ module Types
7
+ class DisabilityStatus
8
+ DISABLED = "DISABLED"
9
+ NON_DISABLED = "NON_DISABLED"
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ module PreEncounter
5
+ module Common
6
+ module Types
7
+ class Ethnicity
8
+ HISPANIC_OR_LATINO = "HISPANIC_OR_LATINO"
9
+ NOT_HISPANIC_OR_LATINO = "NOT_HISPANIC_OR_LATINO"
10
+ UNKNOWN = "UNKNOWN"
11
+ REFUSED = "REFUSED"
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -5,10 +5,13 @@ module CandidApiClient
5
5
  module Common
6
6
  module Types
7
7
  class Gender
8
- FEMALE = "FEMALE"
9
- MALE = "MALE"
8
+ MAN = "MAN"
9
+ WOMAN = "WOMAN"
10
+ NON_BINARY = "NON_BINARY"
11
+ TWO_SPIRIT = "TWO_SPIRIT"
10
12
  OTHER = "OTHER"
11
13
  UNKNOWN = "UNKNOWN"
14
+ REFUSED = "REFUSED"
12
15
  end
13
16
  end
14
17
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ module PreEncounter
5
+ module Common
6
+ module Types
7
+ class Race
8
+ AMERICAN_INDIAN_OR_ALASKA_NATIVE = "AMERICAN_INDIAN_OR_ALASKA_NATIVE"
9
+ WHITE = "WHITE"
10
+ BLACK = "BLACK"
11
+ ASIAN = "ASIAN"
12
+ NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER = "NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER"
13
+ MIDDLE_EASTERN_OR_NORTH_AFRICAN = "MIDDLE_EASTERN_OR_NORTH_AFRICAN"
14
+ OTHER = "OTHER"
15
+ UNKNOWN = "UNKNOWN"
16
+ REFUSED = "REFUSED"
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ module PreEncounter
5
+ module Common
6
+ module Types
7
+ class Sex
8
+ FEMALE = "FEMALE"
9
+ MALE = "MALE"
10
+ UNKNOWN = "UNKNOWN"
11
+ REFUSED = "REFUSED"
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ module PreEncounter
5
+ module Common
6
+ module Types
7
+ class SexualOrientation
8
+ HETEROSEXUAL = "HETEROSEXUAL"
9
+ HOMOSEXUAL = "HOMOSEXUAL"
10
+ BISEXUAL = "BISEXUAL"
11
+ TWO_SPIRIT = "TWO_SPIRIT"
12
+ OTHER = "OTHER"
13
+ UNKNOWN = "UNKNOWN"
14
+ REFUSED = "REFUSED"
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -7,24 +7,24 @@ module CandidApiClient
7
7
  module PreEncounter
8
8
  module Coverages
9
9
  class Client
10
- # @return [CandidApiClient::PreEncounter::Coverages::V1::Client]
11
- attr_reader :pre_encounter
10
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::V1Client]
11
+ attr_reader :v_1
12
12
 
13
13
  # @param request_client [CandidApiClient::RequestClient]
14
14
  # @return [CandidApiClient::PreEncounter::Coverages::Client]
15
15
  def initialize(request_client:)
16
- @pre_encounter = CandidApiClient::PreEncounter::Coverages::V1::Client.new(request_client: request_client)
16
+ @v_1 = CandidApiClient::PreEncounter::Coverages::V1::V1Client.new(request_client: request_client)
17
17
  end
18
18
  end
19
19
 
20
20
  class AsyncClient
21
- # @return [CandidApiClient::PreEncounter::Coverages::V1::AsyncClient]
22
- attr_reader :pre_encounter
21
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::AsyncV1Client]
22
+ attr_reader :v_1
23
23
 
24
24
  # @param request_client [CandidApiClient::AsyncRequestClient]
25
25
  # @return [CandidApiClient::PreEncounter::Coverages::AsyncClient]
26
26
  def initialize(request_client:)
27
- @pre_encounter = CandidApiClient::PreEncounter::Coverages::V1::AsyncClient.new(request_client: request_client)
27
+ @v_1 = CandidApiClient::PreEncounter::Coverages::V1::AsyncV1Client.new(request_client: request_client)
28
28
  end
29
29
  end
30
30
  end
@@ -1,31 +1,484 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../../../../requests"
4
- require_relative "coverages/client"
4
+ require_relative "types/mutable_coverage"
5
+ require_relative "types/coverage"
6
+ require "json"
7
+ require "date"
8
+ require "async"
5
9
 
6
10
  module CandidApiClient
7
11
  module PreEncounter
8
12
  module Coverages
9
13
  module V1
10
- class Client
11
- # @return [CandidApiClient::PreEncounter::Coverages::V1::CoveragesClient]
12
- attr_reader :coverages
14
+ class V1Client
15
+ # @return [CandidApiClient::RequestClient]
16
+ attr_reader :request_client
13
17
 
14
18
  # @param request_client [CandidApiClient::RequestClient]
15
- # @return [CandidApiClient::PreEncounter::Coverages::V1::Client]
19
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::V1Client]
16
20
  def initialize(request_client:)
17
- @coverages = CandidApiClient::PreEncounter::Coverages::V1::CoveragesClient.new(request_client: 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::Types::MutableCoverage, as a Hash
31
+ # * :status (CandidApiClient::PreEncounter::Coverages::V1::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::Types::NetworkType)
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::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.create(request: { status: ACTIVE, subscriber: { name: { }, date_of_birth: DateTime.parse(2023-01-15), gender: MAN }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", type: PPO, period: { }, 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::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 [String]
82
+ # @param request [Hash] Request of type CandidApiClient::PreEncounter::Coverages::V1::Types::MutableCoverage, as a Hash
83
+ # * :status (CandidApiClient::PreEncounter::Coverages::V1::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::Types::NetworkType)
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::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.update(
113
+ # id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
114
+ # version: "string",
115
+ # request: { status: ACTIVE, subscriber: { name: { }, date_of_birth: DateTime.parse(2023-01-15), gender: MAN }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", type: PPO, period: { }, 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::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::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.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::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::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.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::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::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.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::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::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.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::Types::Coverage.from_json(json_object: item)
238
+ end
18
239
  end
19
240
  end
20
241
 
21
- class AsyncClient
22
- # @return [CandidApiClient::PreEncounter::Coverages::V1::AsyncCoveragesClient]
23
- attr_reader :coverages
242
+ class AsyncV1Client
243
+ # @return [CandidApiClient::AsyncRequestClient]
244
+ attr_reader :request_client
24
245
 
25
246
  # @param request_client [CandidApiClient::AsyncRequestClient]
26
- # @return [CandidApiClient::PreEncounter::Coverages::V1::AsyncClient]
247
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::AsyncV1Client]
27
248
  def initialize(request_client:)
28
- @coverages = CandidApiClient::PreEncounter::Coverages::V1::AsyncCoveragesClient.new(request_client: 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::Types::MutableCoverage, as a Hash
259
+ # * :status (CandidApiClient::PreEncounter::Coverages::V1::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::Types::NetworkType)
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::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.create(request: { status: ACTIVE, subscriber: { name: { }, date_of_birth: DateTime.parse(2023-01-15), gender: MAN }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", type: PPO, period: { }, 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::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 [String]
312
+ # @param request [Hash] Request of type CandidApiClient::PreEncounter::Coverages::V1::Types::MutableCoverage, as a Hash
313
+ # * :status (CandidApiClient::PreEncounter::Coverages::V1::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::Types::NetworkType)
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::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.update(
343
+ # id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
344
+ # version: "string",
345
+ # request: { status: ACTIVE, subscriber: { name: { }, date_of_birth: DateTime.parse(2023-01-15), gender: MAN }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", type: PPO, period: { }, 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::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::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.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::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::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.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::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::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.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::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::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.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::Types::Coverage.from_json(json_object: item)
480
+ end
481
+ end
29
482
  end
30
483
  end
31
484
  end