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
@@ -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