candidhealth 1.3.1 → 1.4.0
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/claim_submission/v_1/types/claim_submission_record_create.rb +4 -4
- data/lib/candidhealth/claim_submission/v_1/types/claim_submission_record_create_optional.rb +4 -4
- data/lib/candidhealth/diagnoses/types/service_lines_must_have_at_least_one_diagnosis_error.rb +77 -0
- data/lib/candidhealth/encounters/v_4/types/encounter.rb +151 -2
- data/lib/candidhealth/encounters/v_4/types/encounter_submission_expectation.rb +23 -0
- data/lib/candidhealth/exports/v_3/client.rb +16 -10
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb +205 -2
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/coordination_of_benefits_recommendation.rb +63 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_recommendation.rb +144 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_recommendation_patient_info.rb +124 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_recommendation_payload.rb +102 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/medicare_advantage_recommendation.rb +70 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/medicare_advantage_recommendation_payload.rb +87 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/payer_search_response.rb +107 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/post_eligibility_recommendation_request.rb +96 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/stedi_payer.rb +144 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/stedi_payer_item.rb +79 -0
- data/lib/candidhealth/pre_encounter/lists/v_1/types/patient_list_item.rb +28 -1
- data/lib/candidhealth/pre_encounter/tags/v_1/client.rb +8 -0
- data/lib/candidhealth/pre_encounter/tags/v_1/types/mutable_tag.rb +22 -3
- data/lib/candidhealth/pre_encounter/tags/v_1/types/tag.rb +21 -3
- data/lib/candidhealth/service_lines/v_2/types/service_line.rb +9 -1
- data/lib/candidhealth/x_12/v_1/types/patient_discharge_status_code.rb +52 -0
- data/lib/candidhealth/x_12/v_1/types/point_of_origin_for_admission_or_visit_code.rb +23 -0
- data/lib/candidhealth/x_12/v_1/types/type_of_admission_or_visit_code.rb +18 -0
- data/lib/candidhealth/x_12/v_1/types/type_of_bill_composite.rb +98 -0
- data/lib/candidhealth/x_12/v_1/types/type_of_bill_frequency_code.rb +39 -0
- data/lib/candidhealth/x_12/v_1/types/type_of_care_code.rb +21 -0
- data/lib/candidhealth/x_12/v_1/types/type_of_facility_code.rb +19 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +19 -1
- metadata +21 -3
- data/lib/candidhealth/claim_submission/v_1/types/claim_frequency_type_code.rb +0 -15
@@ -5,6 +5,10 @@ require_relative "types/eligibility_request"
|
|
5
5
|
require_relative "types/eligibility_response"
|
6
6
|
require_relative "types/batch_eligibility_response"
|
7
7
|
require_relative "types/eligibility_check_page"
|
8
|
+
require_relative "types/payer_search_response"
|
9
|
+
require_relative "types/eligibility_recommendation"
|
10
|
+
require "json"
|
11
|
+
require_relative "types/post_eligibility_recommendation_request"
|
8
12
|
require "async"
|
9
13
|
|
10
14
|
module CandidApiClient
|
@@ -111,12 +115,13 @@ module CandidApiClient
|
|
111
115
|
# path-parameters:
|
112
116
|
#
|
113
117
|
# @param batch_id [String]
|
118
|
+
# @param page_token [String]
|
114
119
|
# @param request_options [CandidApiClient::RequestOptions]
|
115
120
|
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage]
|
116
121
|
# @example
|
117
122
|
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
118
123
|
# api.pre_encounter.eligibility_checks.v_1.poll_batch(batch_id: "batch_id")
|
119
|
-
def poll_batch(batch_id:, request_options: nil)
|
124
|
+
def poll_batch(batch_id:, page_token: nil, request_options: nil)
|
120
125
|
response = @request_client.conn.get do |req|
|
121
126
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
122
127
|
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
@@ -125,11 +130,105 @@ module CandidApiClient
|
|
125
130
|
**@request_client.get_headers,
|
126
131
|
**(request_options&.additional_headers || {})
|
127
132
|
}.compact
|
133
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "page_token": page_token }.compact
|
128
134
|
req.url "#{@request_client.get_url(environment: PreEncounter,
|
129
135
|
request_options: request_options)}/eligibility-checks/v1/batch/#{batch_id}"
|
130
136
|
end
|
131
137
|
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage.from_json(json_object: response.body)
|
132
138
|
end
|
139
|
+
|
140
|
+
# Searches for payers that match the query parameters.
|
141
|
+
#
|
142
|
+
# @param page_size [Integer]
|
143
|
+
# @param page_token [String]
|
144
|
+
# @param query [String]
|
145
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
146
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::PayerSearchResponse]
|
147
|
+
# @example
|
148
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
149
|
+
# api.pre_encounter.eligibility_checks.v_1.payer_search
|
150
|
+
def payer_search(page_size: nil, page_token: nil, query: nil, request_options: nil)
|
151
|
+
response = @request_client.conn.get do |req|
|
152
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
153
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
154
|
+
req.headers = {
|
155
|
+
**(req.headers || {}),
|
156
|
+
**@request_client.get_headers,
|
157
|
+
**(request_options&.additional_headers || {})
|
158
|
+
}.compact
|
159
|
+
req.params = {
|
160
|
+
**(request_options&.additional_query_parameters || {}),
|
161
|
+
"page_size": page_size,
|
162
|
+
"page_token": page_token,
|
163
|
+
"query": query
|
164
|
+
}.compact
|
165
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
166
|
+
request_options: request_options)}/eligibility-checks/v1/payer/search"
|
167
|
+
end
|
168
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::PayerSearchResponse.from_json(json_object: response.body)
|
169
|
+
end
|
170
|
+
|
171
|
+
# Gets recommendation for eligibility checks based on the request.
|
172
|
+
#
|
173
|
+
# @param filters [String]
|
174
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
175
|
+
# @return [Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation>]
|
176
|
+
# @example
|
177
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
178
|
+
# api.pre_encounter.eligibility_checks.v_1.recommendation
|
179
|
+
def recommendation(filters: nil, request_options: nil)
|
180
|
+
response = @request_client.conn.get do |req|
|
181
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
182
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
183
|
+
req.headers = {
|
184
|
+
**(req.headers || {}),
|
185
|
+
**@request_client.get_headers,
|
186
|
+
**(request_options&.additional_headers || {})
|
187
|
+
}.compact
|
188
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "filters": filters }.compact
|
189
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
190
|
+
request_options: request_options)}/eligibility-checks/v1/recommendation"
|
191
|
+
end
|
192
|
+
parsed_json = JSON.parse(response.body)
|
193
|
+
parsed_json&.map do |item|
|
194
|
+
item = item.to_json
|
195
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation.from_json(json_object: item)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
# Create an eligibiilty recommendation based on the request.
|
200
|
+
#
|
201
|
+
# @param request [Hash] Request of type CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::PostEligibilityRecommendationRequest, as a Hash
|
202
|
+
# * :eligibility_check_id (String)
|
203
|
+
# * :patient (Hash)
|
204
|
+
# * :id (String)
|
205
|
+
# * :mrn (String)
|
206
|
+
# * :organization_id (String)
|
207
|
+
# * :last_name (String)
|
208
|
+
# * :first_name (String)
|
209
|
+
# * :date_of_birth (Date)
|
210
|
+
# * :member_id (String)
|
211
|
+
# * :recommendation (Hash)
|
212
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
213
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation]
|
214
|
+
# @example
|
215
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
216
|
+
# api.pre_encounter.eligibility_checks.v_1.create_recommendation(request: { eligibility_check_id: "eligibility_check_id", patient: { } })
|
217
|
+
def create_recommendation(request:, request_options: nil)
|
218
|
+
response = @request_client.conn.post do |req|
|
219
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
220
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
221
|
+
req.headers = {
|
222
|
+
**(req.headers || {}),
|
223
|
+
**@request_client.get_headers,
|
224
|
+
**(request_options&.additional_headers || {})
|
225
|
+
}.compact
|
226
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
227
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
228
|
+
request_options: request_options)}/eligibility-checks/v1/recommendation"
|
229
|
+
end
|
230
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation.from_json(json_object: response.body)
|
231
|
+
end
|
133
232
|
end
|
134
233
|
|
135
234
|
class AsyncV1Client
|
@@ -236,12 +335,13 @@ module CandidApiClient
|
|
236
335
|
# path-parameters:
|
237
336
|
#
|
238
337
|
# @param batch_id [String]
|
338
|
+
# @param page_token [String]
|
239
339
|
# @param request_options [CandidApiClient::RequestOptions]
|
240
340
|
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage]
|
241
341
|
# @example
|
242
342
|
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
243
343
|
# api.pre_encounter.eligibility_checks.v_1.poll_batch(batch_id: "batch_id")
|
244
|
-
def poll_batch(batch_id:, request_options: nil)
|
344
|
+
def poll_batch(batch_id:, page_token: nil, request_options: nil)
|
245
345
|
Async do
|
246
346
|
response = @request_client.conn.get do |req|
|
247
347
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
@@ -251,12 +351,115 @@ module CandidApiClient
|
|
251
351
|
**@request_client.get_headers,
|
252
352
|
**(request_options&.additional_headers || {})
|
253
353
|
}.compact
|
354
|
+
req.params = {
|
355
|
+
**(request_options&.additional_query_parameters || {}),
|
356
|
+
"page_token": page_token
|
357
|
+
}.compact
|
254
358
|
req.url "#{@request_client.get_url(environment: PreEncounter,
|
255
359
|
request_options: request_options)}/eligibility-checks/v1/batch/#{batch_id}"
|
256
360
|
end
|
257
361
|
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage.from_json(json_object: response.body)
|
258
362
|
end
|
259
363
|
end
|
364
|
+
|
365
|
+
# Searches for payers that match the query parameters.
|
366
|
+
#
|
367
|
+
# @param page_size [Integer]
|
368
|
+
# @param page_token [String]
|
369
|
+
# @param query [String]
|
370
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
371
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::PayerSearchResponse]
|
372
|
+
# @example
|
373
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
374
|
+
# api.pre_encounter.eligibility_checks.v_1.payer_search
|
375
|
+
def payer_search(page_size: nil, page_token: nil, query: nil, request_options: nil)
|
376
|
+
Async do
|
377
|
+
response = @request_client.conn.get do |req|
|
378
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
379
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
380
|
+
req.headers = {
|
381
|
+
**(req.headers || {}),
|
382
|
+
**@request_client.get_headers,
|
383
|
+
**(request_options&.additional_headers || {})
|
384
|
+
}.compact
|
385
|
+
req.params = {
|
386
|
+
**(request_options&.additional_query_parameters || {}),
|
387
|
+
"page_size": page_size,
|
388
|
+
"page_token": page_token,
|
389
|
+
"query": query
|
390
|
+
}.compact
|
391
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
392
|
+
request_options: request_options)}/eligibility-checks/v1/payer/search"
|
393
|
+
end
|
394
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::PayerSearchResponse.from_json(json_object: response.body)
|
395
|
+
end
|
396
|
+
end
|
397
|
+
|
398
|
+
# Gets recommendation for eligibility checks based on the request.
|
399
|
+
#
|
400
|
+
# @param filters [String]
|
401
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
402
|
+
# @return [Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation>]
|
403
|
+
# @example
|
404
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
405
|
+
# api.pre_encounter.eligibility_checks.v_1.recommendation
|
406
|
+
def recommendation(filters: nil, request_options: nil)
|
407
|
+
Async do
|
408
|
+
response = @request_client.conn.get do |req|
|
409
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
410
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
411
|
+
req.headers = {
|
412
|
+
**(req.headers || {}),
|
413
|
+
**@request_client.get_headers,
|
414
|
+
**(request_options&.additional_headers || {})
|
415
|
+
}.compact
|
416
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "filters": filters }.compact
|
417
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
418
|
+
request_options: request_options)}/eligibility-checks/v1/recommendation"
|
419
|
+
end
|
420
|
+
parsed_json = JSON.parse(response.body)
|
421
|
+
parsed_json&.map do |item|
|
422
|
+
item = item.to_json
|
423
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation.from_json(json_object: item)
|
424
|
+
end
|
425
|
+
end
|
426
|
+
end
|
427
|
+
|
428
|
+
# Create an eligibiilty recommendation based on the request.
|
429
|
+
#
|
430
|
+
# @param request [Hash] Request of type CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::PostEligibilityRecommendationRequest, as a Hash
|
431
|
+
# * :eligibility_check_id (String)
|
432
|
+
# * :patient (Hash)
|
433
|
+
# * :id (String)
|
434
|
+
# * :mrn (String)
|
435
|
+
# * :organization_id (String)
|
436
|
+
# * :last_name (String)
|
437
|
+
# * :first_name (String)
|
438
|
+
# * :date_of_birth (Date)
|
439
|
+
# * :member_id (String)
|
440
|
+
# * :recommendation (Hash)
|
441
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
442
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation]
|
443
|
+
# @example
|
444
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
445
|
+
# api.pre_encounter.eligibility_checks.v_1.create_recommendation(request: { eligibility_check_id: "eligibility_check_id", patient: { } })
|
446
|
+
def create_recommendation(request:, request_options: nil)
|
447
|
+
Async do
|
448
|
+
response = @request_client.conn.post do |req|
|
449
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
450
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
451
|
+
req.headers = {
|
452
|
+
**(req.headers || {}),
|
453
|
+
**@request_client.get_headers,
|
454
|
+
**(request_options&.additional_headers || {})
|
455
|
+
}.compact
|
456
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
457
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
458
|
+
request_options: request_options)}/eligibility-checks/v1/recommendation"
|
459
|
+
end
|
460
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation.from_json(json_object: response.body)
|
461
|
+
end
|
462
|
+
end
|
260
463
|
end
|
261
464
|
end
|
262
465
|
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module PreEncounter
|
8
|
+
module EligibilityChecks
|
9
|
+
module V1
|
10
|
+
module Types
|
11
|
+
# An object representing a Coordination Of Benefits recommendation.
|
12
|
+
class CoordinationOfBenefitsRecommendation
|
13
|
+
# @return [Object]
|
14
|
+
attr_reader :payload
|
15
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
16
|
+
attr_reader :additional_properties
|
17
|
+
# @return [Object]
|
18
|
+
attr_reader :_field_set
|
19
|
+
protected :_field_set
|
20
|
+
|
21
|
+
OMIT = Object.new
|
22
|
+
|
23
|
+
# @param payload [Object]
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::CoordinationOfBenefitsRecommendation]
|
26
|
+
def initialize(payload:, additional_properties: nil)
|
27
|
+
@payload = payload
|
28
|
+
@additional_properties = additional_properties
|
29
|
+
@_field_set = { "payload": payload }
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deserialize a JSON object to an instance of CoordinationOfBenefitsRecommendation
|
33
|
+
#
|
34
|
+
# @param json_object [String]
|
35
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::CoordinationOfBenefitsRecommendation]
|
36
|
+
def self.from_json(json_object:)
|
37
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
38
|
+
payload = struct["payload"]
|
39
|
+
new(payload: payload, additional_properties: struct)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Serialize an instance of CoordinationOfBenefitsRecommendation to a JSON object
|
43
|
+
#
|
44
|
+
# @return [String]
|
45
|
+
def to_json(*_args)
|
46
|
+
@_field_set&.to_json
|
47
|
+
end
|
48
|
+
|
49
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
50
|
+
# hash and check each fields type against the current object's property
|
51
|
+
# definitions.
|
52
|
+
#
|
53
|
+
# @param obj [Object]
|
54
|
+
# @return [Void]
|
55
|
+
def self.validate_raw(obj:)
|
56
|
+
obj.payload.is_a?(Object) != false || raise("Passed value for field obj.payload is not the expected type, validation failed.")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_recommendation.rb
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "eligibility_recommendation_payload"
|
4
|
+
require_relative "eligibility_recommendation_patient_info"
|
5
|
+
require "date"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module CandidApiClient
|
10
|
+
module PreEncounter
|
11
|
+
module EligibilityChecks
|
12
|
+
module V1
|
13
|
+
module Types
|
14
|
+
# An eligibility recommendation object that contains an
|
15
|
+
# EligibilityRecommendationType and a payload of data denoting the recommendation.
|
16
|
+
class EligibilityRecommendation
|
17
|
+
# @return [String] The unique UUID identifier for an EligibilityRecommendation.
|
18
|
+
attr_reader :id
|
19
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendationPayload]
|
20
|
+
attr_reader :recommendation
|
21
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendationPatientInfo]
|
22
|
+
attr_reader :patient
|
23
|
+
# @return [String] The organization that owns this object.
|
24
|
+
attr_reader :organization_id
|
25
|
+
# @return [Boolean] True if the object is deactivated. Deactivated objects are not returned in
|
26
|
+
# search results but are returned in all other endpoints including scan.
|
27
|
+
attr_reader :deactivated
|
28
|
+
# @return [Integer] The version of the object. Any update to any property of an object object will
|
29
|
+
# create a new version.
|
30
|
+
attr_reader :version
|
31
|
+
# @return [DateTime]
|
32
|
+
attr_reader :updated_at
|
33
|
+
# @return [String] The user ID of the user who last updated the object.
|
34
|
+
attr_reader :updating_user_id
|
35
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
36
|
+
attr_reader :additional_properties
|
37
|
+
# @return [Object]
|
38
|
+
attr_reader :_field_set
|
39
|
+
protected :_field_set
|
40
|
+
|
41
|
+
OMIT = Object.new
|
42
|
+
|
43
|
+
# @param id [String] The unique UUID identifier for an EligibilityRecommendation.
|
44
|
+
# @param recommendation [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendationPayload]
|
45
|
+
# @param patient [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendationPatientInfo]
|
46
|
+
# @param organization_id [String] The organization that owns this object.
|
47
|
+
# @param deactivated [Boolean] True if the object is deactivated. Deactivated objects are not returned in
|
48
|
+
# search results but are returned in all other endpoints including scan.
|
49
|
+
# @param version [Integer] The version of the object. Any update to any property of an object object will
|
50
|
+
# create a new version.
|
51
|
+
# @param updated_at [DateTime]
|
52
|
+
# @param updating_user_id [String] The user ID of the user who last updated the object.
|
53
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
54
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation]
|
55
|
+
def initialize(id:, recommendation:, patient:, organization_id:, deactivated:, version:, updated_at:,
|
56
|
+
updating_user_id:, additional_properties: nil)
|
57
|
+
@id = id
|
58
|
+
@recommendation = recommendation
|
59
|
+
@patient = patient
|
60
|
+
@organization_id = organization_id
|
61
|
+
@deactivated = deactivated
|
62
|
+
@version = version
|
63
|
+
@updated_at = updated_at
|
64
|
+
@updating_user_id = updating_user_id
|
65
|
+
@additional_properties = additional_properties
|
66
|
+
@_field_set = {
|
67
|
+
"id": id,
|
68
|
+
"recommendation": recommendation,
|
69
|
+
"patient": patient,
|
70
|
+
"organization_id": organization_id,
|
71
|
+
"deactivated": deactivated,
|
72
|
+
"version": version,
|
73
|
+
"updated_at": updated_at,
|
74
|
+
"updating_user_id": updating_user_id
|
75
|
+
}
|
76
|
+
end
|
77
|
+
|
78
|
+
# Deserialize a JSON object to an instance of EligibilityRecommendation
|
79
|
+
#
|
80
|
+
# @param json_object [String]
|
81
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation]
|
82
|
+
def self.from_json(json_object:)
|
83
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
84
|
+
parsed_json = JSON.parse(json_object)
|
85
|
+
id = struct["id"]
|
86
|
+
if parsed_json["recommendation"].nil?
|
87
|
+
recommendation = nil
|
88
|
+
else
|
89
|
+
recommendation = parsed_json["recommendation"].to_json
|
90
|
+
recommendation = CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendationPayload.from_json(json_object: recommendation)
|
91
|
+
end
|
92
|
+
if parsed_json["patient"].nil?
|
93
|
+
patient = nil
|
94
|
+
else
|
95
|
+
patient = parsed_json["patient"].to_json
|
96
|
+
patient = CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendationPatientInfo.from_json(json_object: patient)
|
97
|
+
end
|
98
|
+
organization_id = struct["organization_id"]
|
99
|
+
deactivated = struct["deactivated"]
|
100
|
+
version = struct["version"]
|
101
|
+
updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
|
102
|
+
updating_user_id = struct["updating_user_id"]
|
103
|
+
new(
|
104
|
+
id: id,
|
105
|
+
recommendation: recommendation,
|
106
|
+
patient: patient,
|
107
|
+
organization_id: organization_id,
|
108
|
+
deactivated: deactivated,
|
109
|
+
version: version,
|
110
|
+
updated_at: updated_at,
|
111
|
+
updating_user_id: updating_user_id,
|
112
|
+
additional_properties: struct
|
113
|
+
)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Serialize an instance of EligibilityRecommendation to a JSON object
|
117
|
+
#
|
118
|
+
# @return [String]
|
119
|
+
def to_json(*_args)
|
120
|
+
@_field_set&.to_json
|
121
|
+
end
|
122
|
+
|
123
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
124
|
+
# hash and check each fields type against the current object's property
|
125
|
+
# definitions.
|
126
|
+
#
|
127
|
+
# @param obj [Object]
|
128
|
+
# @return [Void]
|
129
|
+
def self.validate_raw(obj:)
|
130
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
131
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendationPayload.validate_raw(obj: obj.recommendation)
|
132
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendationPatientInfo.validate_raw(obj: obj.patient)
|
133
|
+
obj.organization_id.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
|
134
|
+
obj.deactivated.is_a?(Boolean) != false || raise("Passed value for field obj.deactivated is not the expected type, validation failed.")
|
135
|
+
obj.version.is_a?(Integer) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
|
136
|
+
obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
137
|
+
obj.updating_user_id.is_a?(String) != false || raise("Passed value for field obj.updating_user_id is not the expected type, validation failed.")
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
@@ -0,0 +1,124 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module CandidApiClient
|
8
|
+
module PreEncounter
|
9
|
+
module EligibilityChecks
|
10
|
+
module V1
|
11
|
+
module Types
|
12
|
+
# An object representing patient information for an eligibility recommendation.
|
13
|
+
# This is used to find recommendations. Each field helps us find the right
|
14
|
+
# corresponding
|
15
|
+
# eligibility recommendation for the patient.
|
16
|
+
class EligibilityRecommendationPatientInfo
|
17
|
+
# @return [String]
|
18
|
+
attr_reader :id
|
19
|
+
# @return [String]
|
20
|
+
attr_reader :mrn
|
21
|
+
# @return [String]
|
22
|
+
attr_reader :organization_id
|
23
|
+
# @return [String]
|
24
|
+
attr_reader :last_name
|
25
|
+
# @return [String]
|
26
|
+
attr_reader :first_name
|
27
|
+
# @return [Date]
|
28
|
+
attr_reader :date_of_birth
|
29
|
+
# @return [String]
|
30
|
+
attr_reader :member_id
|
31
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
32
|
+
attr_reader :additional_properties
|
33
|
+
# @return [Object]
|
34
|
+
attr_reader :_field_set
|
35
|
+
protected :_field_set
|
36
|
+
|
37
|
+
OMIT = Object.new
|
38
|
+
|
39
|
+
# @param id [String]
|
40
|
+
# @param mrn [String]
|
41
|
+
# @param organization_id [String]
|
42
|
+
# @param last_name [String]
|
43
|
+
# @param first_name [String]
|
44
|
+
# @param date_of_birth [Date]
|
45
|
+
# @param member_id [String]
|
46
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
47
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendationPatientInfo]
|
48
|
+
def initialize(id: OMIT, mrn: OMIT, organization_id: OMIT, last_name: OMIT, first_name: OMIT,
|
49
|
+
date_of_birth: OMIT, member_id: OMIT, additional_properties: nil)
|
50
|
+
@id = id if id != OMIT
|
51
|
+
@mrn = mrn if mrn != OMIT
|
52
|
+
@organization_id = organization_id if organization_id != OMIT
|
53
|
+
@last_name = last_name if last_name != OMIT
|
54
|
+
@first_name = first_name if first_name != OMIT
|
55
|
+
@date_of_birth = date_of_birth if date_of_birth != OMIT
|
56
|
+
@member_id = member_id if member_id != OMIT
|
57
|
+
@additional_properties = additional_properties
|
58
|
+
@_field_set = {
|
59
|
+
"id": id,
|
60
|
+
"mrn": mrn,
|
61
|
+
"organization_id": organization_id,
|
62
|
+
"last_name": last_name,
|
63
|
+
"first_name": first_name,
|
64
|
+
"date_of_birth": date_of_birth,
|
65
|
+
"member_id": member_id
|
66
|
+
}.reject do |_k, v|
|
67
|
+
v == OMIT
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Deserialize a JSON object to an instance of EligibilityRecommendationPatientInfo
|
72
|
+
#
|
73
|
+
# @param json_object [String]
|
74
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendationPatientInfo]
|
75
|
+
def self.from_json(json_object:)
|
76
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
77
|
+
parsed_json = JSON.parse(json_object)
|
78
|
+
id = struct["id"]
|
79
|
+
mrn = struct["mrn"]
|
80
|
+
organization_id = struct["organization_id"]
|
81
|
+
last_name = struct["last_name"]
|
82
|
+
first_name = struct["first_name"]
|
83
|
+
date_of_birth = (Date.parse(parsed_json["date_of_birth"]) unless parsed_json["date_of_birth"].nil?)
|
84
|
+
member_id = struct["member_id"]
|
85
|
+
new(
|
86
|
+
id: id,
|
87
|
+
mrn: mrn,
|
88
|
+
organization_id: organization_id,
|
89
|
+
last_name: last_name,
|
90
|
+
first_name: first_name,
|
91
|
+
date_of_birth: date_of_birth,
|
92
|
+
member_id: member_id,
|
93
|
+
additional_properties: struct
|
94
|
+
)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Serialize an instance of EligibilityRecommendationPatientInfo to a JSON object
|
98
|
+
#
|
99
|
+
# @return [String]
|
100
|
+
def to_json(*_args)
|
101
|
+
@_field_set&.to_json
|
102
|
+
end
|
103
|
+
|
104
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
105
|
+
# hash and check each fields type against the current object's property
|
106
|
+
# definitions.
|
107
|
+
#
|
108
|
+
# @param obj [Object]
|
109
|
+
# @return [Void]
|
110
|
+
def self.validate_raw(obj:)
|
111
|
+
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
112
|
+
obj.mrn&.is_a?(String) != false || raise("Passed value for field obj.mrn is not the expected type, validation failed.")
|
113
|
+
obj.organization_id&.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
|
114
|
+
obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
|
115
|
+
obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
|
116
|
+
obj.date_of_birth&.is_a?(Date) != false || raise("Passed value for field obj.date_of_birth is not the expected type, validation failed.")
|
117
|
+
obj.member_id&.is_a?(String) != false || raise("Passed value for field obj.member_id is not the expected type, validation failed.")
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|