candidhealth 1.0.0 → 1.3.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/auth/client.rb +7 -7
- data/lib/candidhealth/auth/{v_2 → default}/client.rb +39 -13
- data/lib/candidhealth/auth/{v_2 → default}/types/auth_get_token_response.rb +3 -3
- data/lib/candidhealth/auth/default/types/invalid_content_type_error_type.rb +60 -0
- data/lib/candidhealth/auth/{v_2 → default}/types/too_many_requests_error_type.rb +3 -3
- data/lib/candidhealth/billing_notes/v_2/types/billing_note_base_optional.rb +62 -0
- data/lib/candidhealth/charge_capture/v_1/client.rb +504 -482
- data/lib/candidhealth/charge_capture/v_1/types/charge_capture.rb +17 -1
- data/lib/candidhealth/charge_capture/v_1/types/charge_capture_data.rb +173 -173
- data/lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb +26 -2
- data/lib/candidhealth/charge_capture_bundles/v_1/client.rb +58 -0
- data/lib/candidhealth/claim_submission/v_1/types/claim_submission_record_create_optional.rb +100 -0
- data/lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create_optional.rb +101 -0
- data/lib/candidhealth/commons/types/phone_number_optional.rb +71 -0
- data/lib/candidhealth/commons/types/procedure_modifier.rb +2 -0
- data/lib/candidhealth/commons/types/street_address_long_zip_optional.rb +107 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_instance_optional.rb +78 -0
- data/lib/candidhealth/diagnoses/client.rb +23 -4
- data/lib/candidhealth/diagnoses/types/diagnosis.rb +21 -2
- data/lib/candidhealth/diagnoses/types/diagnosis_create.rb +25 -2
- data/lib/candidhealth/diagnoses/types/diagnosis_create_optional.rb +126 -0
- data/lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb +22 -2
- data/lib/candidhealth/encounter_providers/v_2/types/ordering_provider_optional.rb +123 -0
- data/lib/candidhealth/encounters/v_4/client.rb +214 -208
- data/lib/candidhealth/encounters/v_4/types/claim_supplemental_information_optional.rb +86 -0
- data/lib/candidhealth/encounters/v_4/types/clinical_note_category_create_optional.rb +78 -0
- data/lib/candidhealth/encounters/v_4/types/clinical_note_optional.rb +93 -0
- data/lib/candidhealth/encounters/v_4/types/encounter.rb +16 -4
- data/lib/candidhealth/encounters/v_4/types/encounter_create_from_pre_encounter.rb +4 -2
- data/lib/candidhealth/encounters/v_4/types/encounter_deep_optional.rb +780 -0
- data/lib/candidhealth/encounters/v_4/types/encounter_optional.rb +1 -139
- data/lib/candidhealth/encounters/v_4/types/epsdt_referral_optional.rb +85 -0
- data/lib/candidhealth/encounters/v_4/types/intake_question_optional.rb +84 -0
- data/lib/candidhealth/encounters/v_4/types/intervention_optional.rb +114 -0
- data/lib/candidhealth/encounters/v_4/types/lab_optional.rb +80 -0
- data/lib/candidhealth/encounters/v_4/types/medication_optional.rb +108 -0
- data/lib/candidhealth/encounters/v_4/types/patient_history_category_optional.rb +78 -0
- data/lib/candidhealth/guarantor/v_1/types/guarantor_optional.rb +144 -0
- data/lib/candidhealth/individual/types/individual_base_optional.rb +78 -0
- data/lib/candidhealth/individual/types/patient_non_insurance_payer_info_create_optional.rb +89 -0
- data/lib/candidhealth/individual/types/patient_update_with_optional_address.rb +8 -8
- data/lib/candidhealth/individual/types/subscriber_base_optional.rb +118 -0
- data/lib/candidhealth/individual/types/subscriber_create_optional.rb +132 -0
- data/lib/candidhealth/insurance_adjudications/v_1/client.rb +2 -0
- data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb +9 -1
- data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_create_optional.rb +167 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/authorization.rb +13 -1
- data/lib/candidhealth/service_lines/v_2/types/drug_identification_optional.rb +126 -0
- data/lib/candidhealth/service_lines/v_2/types/service_line_create_optional.rb +239 -0
- data/lib/candidhealth/service_lines/v_2/types/test_result_optional.rb +73 -0
- data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_reason.rb +1 -0
- data/lib/candidhealth/write_offs/v_1/types/patient_write_off_reason.rb +1 -0
- data/lib/candidhealth/yes_no_indicator/types/yes_no_indicator.rb +14 -0
- data/lib/core/oauth.rb +2 -2
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +32 -3
- metadata +34 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07f5fe75faed59459559e52d586fdfbdb5e7b3c58e52ecfd9b4987dc2ed6f09e
|
4
|
+
data.tar.gz: 676a4aafede9210e6a84ec351f37b08a96386b3e523579175d287244f74f1157
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3c2fb523f098a25fbf1e4e24c1de9f117af1efeae359465c27890bedb3dec1e49f8a34854ccd0b5ffe4f7eeb68aec770252ca08b328604d4048117414a955ca
|
7
|
+
data.tar.gz: 0b0b3bfe03474e403da0e51ec017939cd30462573f223f9d3e775f8b8160a0d0c8ebb5eb0897700d3524f0a5b987175345aa5278ed2c07a9de5b798260a6f995
|
@@ -1,29 +1,29 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "../../requests"
|
4
|
-
require_relative "
|
4
|
+
require_relative "default/client"
|
5
5
|
|
6
6
|
module CandidApiClient
|
7
7
|
module Auth
|
8
8
|
class Client
|
9
|
-
# @return [CandidApiClient::Auth::
|
10
|
-
attr_reader :
|
9
|
+
# @return [CandidApiClient::Auth::Default::DefaultClient]
|
10
|
+
attr_reader :default
|
11
11
|
|
12
12
|
# @param request_client [CandidApiClient::RequestClient]
|
13
13
|
# @return [CandidApiClient::Auth::Client]
|
14
14
|
def initialize(request_client:)
|
15
|
-
@
|
15
|
+
@default = CandidApiClient::Auth::Default::DefaultClient.new(request_client: request_client)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
class AsyncClient
|
20
|
-
# @return [CandidApiClient::Auth::
|
21
|
-
attr_reader :
|
20
|
+
# @return [CandidApiClient::Auth::Default::AsyncDefaultClient]
|
21
|
+
attr_reader :default
|
22
22
|
|
23
23
|
# @param request_client [CandidApiClient::AsyncRequestClient]
|
24
24
|
# @return [CandidApiClient::Auth::AsyncClient]
|
25
25
|
def initialize(request_client:)
|
26
|
-
@
|
26
|
+
@default = CandidApiClient::Auth::Default::AsyncDefaultClient.new(request_client: request_client)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -6,13 +6,13 @@ require "async"
|
|
6
6
|
|
7
7
|
module CandidApiClient
|
8
8
|
module Auth
|
9
|
-
module
|
10
|
-
class
|
9
|
+
module Default
|
10
|
+
class DefaultClient
|
11
11
|
# @return [CandidApiClient::RequestClient]
|
12
12
|
attr_reader :request_client
|
13
13
|
|
14
14
|
# @param request_client [CandidApiClient::RequestClient]
|
15
|
-
# @return [CandidApiClient::Auth::
|
15
|
+
# @return [CandidApiClient::Auth::Default::DefaultClient]
|
16
16
|
def initialize(request_client:)
|
17
17
|
@request_client = request_client
|
18
18
|
end
|
@@ -25,11 +25,24 @@ module CandidApiClient
|
|
25
25
|
# Candid Health utilizes the [OAuth 2.0 bearer token authentication
|
26
26
|
# scheme](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication) in our
|
27
27
|
# auth flow. You obtain the bearer token for all
|
28
|
-
# subsequent API requests via the `/auth/token` endpoint defined below, which
|
28
|
+
# subsequent API requests via the `/auth/v2/token` endpoint defined below, which
|
29
29
|
# requires you to provide your `client_id` and `client_secret`. Your `client_id`
|
30
30
|
# and `client_secret` can be
|
31
31
|
# incandidhealth.com/hc/en-us/articles/23065219476244--Generating-Candid-API-Keys)
|
32
32
|
# from the "Users & Credentials" tab by your org admin.
|
33
|
+
# The `/auth/v2/token` endpoint accepts both `Content-Type: application/json` and
|
34
|
+
# `Content-Type: application/x-www-form-urlencoded`. The request body should
|
35
|
+
# contain the `client_id` and `client_secret` as follows:
|
36
|
+
# ```json
|
37
|
+
# {
|
38
|
+
# "client_id": "YOUR_CLIENT_ID",
|
39
|
+
# "client_secret": "YOUR_CLIENT_SECRET"
|
40
|
+
# }
|
41
|
+
# ```
|
42
|
+
# or as URL-encoded form data:
|
43
|
+
# ```
|
44
|
+
# client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET
|
45
|
+
# ```
|
33
46
|
# The bearer token is a signed [JWT](https://jwt.io/). The public key for the JWT
|
34
47
|
# can be found [here](https://candidhealth.auth0.com/pem) for any verification
|
35
48
|
# workflows.
|
@@ -47,10 +60,10 @@ module CandidApiClient
|
|
47
60
|
# @param client_id [String] Your application's Client ID.
|
48
61
|
# @param client_secret [String] Your application's Client Secret.
|
49
62
|
# @param request_options [CandidApiClient::RequestOptions]
|
50
|
-
# @return [CandidApiClient::Auth::
|
63
|
+
# @return [CandidApiClient::Auth::Default::Types::AuthGetTokenResponse]
|
51
64
|
# @example
|
52
65
|
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
53
|
-
# api.auth.
|
66
|
+
# api.auth.default.get_token(client_id: "YOUR_CLIENT_ID", client_secret: "YOUR_CLIENT_SECRET")
|
54
67
|
def get_token(client_id:, client_secret:, request_options: nil)
|
55
68
|
response = @request_client.conn.post do |req|
|
56
69
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
@@ -68,16 +81,16 @@ module CandidApiClient
|
|
68
81
|
req.url "#{@request_client.get_url(environment: CandidApi,
|
69
82
|
request_options: request_options)}/api/auth/v2/token"
|
70
83
|
end
|
71
|
-
CandidApiClient::Auth::
|
84
|
+
CandidApiClient::Auth::Default::Types::AuthGetTokenResponse.from_json(json_object: response.body)
|
72
85
|
end
|
73
86
|
end
|
74
87
|
|
75
|
-
class
|
88
|
+
class AsyncDefaultClient
|
76
89
|
# @return [CandidApiClient::AsyncRequestClient]
|
77
90
|
attr_reader :request_client
|
78
91
|
|
79
92
|
# @param request_client [CandidApiClient::AsyncRequestClient]
|
80
|
-
# @return [CandidApiClient::Auth::
|
93
|
+
# @return [CandidApiClient::Auth::Default::AsyncDefaultClient]
|
81
94
|
def initialize(request_client:)
|
82
95
|
@request_client = request_client
|
83
96
|
end
|
@@ -90,11 +103,24 @@ module CandidApiClient
|
|
90
103
|
# Candid Health utilizes the [OAuth 2.0 bearer token authentication
|
91
104
|
# scheme](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication) in our
|
92
105
|
# auth flow. You obtain the bearer token for all
|
93
|
-
# subsequent API requests via the `/auth/token` endpoint defined below, which
|
106
|
+
# subsequent API requests via the `/auth/v2/token` endpoint defined below, which
|
94
107
|
# requires you to provide your `client_id` and `client_secret`. Your `client_id`
|
95
108
|
# and `client_secret` can be
|
96
109
|
# incandidhealth.com/hc/en-us/articles/23065219476244--Generating-Candid-API-Keys)
|
97
110
|
# from the "Users & Credentials" tab by your org admin.
|
111
|
+
# The `/auth/v2/token` endpoint accepts both `Content-Type: application/json` and
|
112
|
+
# `Content-Type: application/x-www-form-urlencoded`. The request body should
|
113
|
+
# contain the `client_id` and `client_secret` as follows:
|
114
|
+
# ```json
|
115
|
+
# {
|
116
|
+
# "client_id": "YOUR_CLIENT_ID",
|
117
|
+
# "client_secret": "YOUR_CLIENT_SECRET"
|
118
|
+
# }
|
119
|
+
# ```
|
120
|
+
# or as URL-encoded form data:
|
121
|
+
# ```
|
122
|
+
# client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET
|
123
|
+
# ```
|
98
124
|
# The bearer token is a signed [JWT](https://jwt.io/). The public key for the JWT
|
99
125
|
# can be found [here](https://candidhealth.auth0.com/pem) for any verification
|
100
126
|
# workflows.
|
@@ -112,10 +138,10 @@ module CandidApiClient
|
|
112
138
|
# @param client_id [String] Your application's Client ID.
|
113
139
|
# @param client_secret [String] Your application's Client Secret.
|
114
140
|
# @param request_options [CandidApiClient::RequestOptions]
|
115
|
-
# @return [CandidApiClient::Auth::
|
141
|
+
# @return [CandidApiClient::Auth::Default::Types::AuthGetTokenResponse]
|
116
142
|
# @example
|
117
143
|
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
118
|
-
# api.auth.
|
144
|
+
# api.auth.default.get_token(client_id: "YOUR_CLIENT_ID", client_secret: "YOUR_CLIENT_SECRET")
|
119
145
|
def get_token(client_id:, client_secret:, request_options: nil)
|
120
146
|
Async do
|
121
147
|
response = @request_client.conn.post do |req|
|
@@ -134,7 +160,7 @@ module CandidApiClient
|
|
134
160
|
req.url "#{@request_client.get_url(environment: CandidApi,
|
135
161
|
request_options: request_options)}/api/auth/v2/token"
|
136
162
|
end
|
137
|
-
CandidApiClient::Auth::
|
163
|
+
CandidApiClient::Auth::Default::Types::AuthGetTokenResponse.from_json(json_object: response.body)
|
138
164
|
end
|
139
165
|
end
|
140
166
|
end
|
@@ -5,7 +5,7 @@ require "json"
|
|
5
5
|
|
6
6
|
module CandidApiClient
|
7
7
|
module Auth
|
8
|
-
module
|
8
|
+
module Default
|
9
9
|
module Types
|
10
10
|
class AuthGetTokenResponse
|
11
11
|
# @return [String]
|
@@ -26,7 +26,7 @@ module CandidApiClient
|
|
26
26
|
# @param expires_in [Integer] Time in seconds.
|
27
27
|
# @param token_type [String]
|
28
28
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
-
# @return [CandidApiClient::Auth::
|
29
|
+
# @return [CandidApiClient::Auth::Default::Types::AuthGetTokenResponse]
|
30
30
|
def initialize(access_token:, expires_in:, token_type:, additional_properties: nil)
|
31
31
|
@access_token = access_token
|
32
32
|
@expires_in = expires_in
|
@@ -38,7 +38,7 @@ module CandidApiClient
|
|
38
38
|
# Deserialize a JSON object to an instance of AuthGetTokenResponse
|
39
39
|
#
|
40
40
|
# @param json_object [String]
|
41
|
-
# @return [CandidApiClient::Auth::
|
41
|
+
# @return [CandidApiClient::Auth::Default::Types::AuthGetTokenResponse]
|
42
42
|
def self.from_json(json_object:)
|
43
43
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
44
44
|
access_token = struct["access_token"]
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Auth
|
8
|
+
module Default
|
9
|
+
module Types
|
10
|
+
class InvalidContentTypeErrorType
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :message
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
attr_reader :additional_properties
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :_field_set
|
17
|
+
protected :_field_set
|
18
|
+
|
19
|
+
OMIT = Object.new
|
20
|
+
|
21
|
+
# @param message [String]
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [CandidApiClient::Auth::Default::Types::InvalidContentTypeErrorType]
|
24
|
+
def initialize(message:, additional_properties: nil)
|
25
|
+
@message = message
|
26
|
+
@additional_properties = additional_properties
|
27
|
+
@_field_set = { "message": message }
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of InvalidContentTypeErrorType
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [CandidApiClient::Auth::Default::Types::InvalidContentTypeErrorType]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
message = struct["message"]
|
37
|
+
new(message: message, additional_properties: struct)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Serialize an instance of InvalidContentTypeErrorType to a JSON object
|
41
|
+
#
|
42
|
+
# @return [String]
|
43
|
+
def to_json(*_args)
|
44
|
+
@_field_set&.to_json
|
45
|
+
end
|
46
|
+
|
47
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
48
|
+
# hash and check each fields type against the current object's property
|
49
|
+
# definitions.
|
50
|
+
#
|
51
|
+
# @param obj [Object]
|
52
|
+
# @return [Void]
|
53
|
+
def self.validate_raw(obj:)
|
54
|
+
obj.message.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -5,7 +5,7 @@ require "json"
|
|
5
5
|
|
6
6
|
module CandidApiClient
|
7
7
|
module Auth
|
8
|
-
module
|
8
|
+
module Default
|
9
9
|
module Types
|
10
10
|
class TooManyRequestsErrorType
|
11
11
|
# @return [String]
|
@@ -20,7 +20,7 @@ module CandidApiClient
|
|
20
20
|
|
21
21
|
# @param message [String]
|
22
22
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
-
# @return [CandidApiClient::Auth::
|
23
|
+
# @return [CandidApiClient::Auth::Default::Types::TooManyRequestsErrorType]
|
24
24
|
def initialize(message:, additional_properties: nil)
|
25
25
|
@message = message
|
26
26
|
@additional_properties = additional_properties
|
@@ -30,7 +30,7 @@ module CandidApiClient
|
|
30
30
|
# Deserialize a JSON object to an instance of TooManyRequestsErrorType
|
31
31
|
#
|
32
32
|
# @param json_object [String]
|
33
|
-
# @return [CandidApiClient::Auth::
|
33
|
+
# @return [CandidApiClient::Auth::Default::Types::TooManyRequestsErrorType]
|
34
34
|
def self.from_json(json_object:)
|
35
35
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
36
|
message = struct["message"]
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module BillingNotes
|
8
|
+
module V2
|
9
|
+
module Types
|
10
|
+
class BillingNoteBaseOptional
|
11
|
+
# @return [String] Empty string not allowed.
|
12
|
+
attr_reader :text
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
attr_reader :additional_properties
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :_field_set
|
17
|
+
protected :_field_set
|
18
|
+
|
19
|
+
OMIT = Object.new
|
20
|
+
|
21
|
+
# @param text [String] Empty string not allowed.
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [CandidApiClient::BillingNotes::V2::Types::BillingNoteBaseOptional]
|
24
|
+
def initialize(text: OMIT, additional_properties: nil)
|
25
|
+
@text = text if text != OMIT
|
26
|
+
@additional_properties = additional_properties
|
27
|
+
@_field_set = { "text": text }.reject do |_k, v|
|
28
|
+
v == OMIT
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deserialize a JSON object to an instance of BillingNoteBaseOptional
|
33
|
+
#
|
34
|
+
# @param json_object [String]
|
35
|
+
# @return [CandidApiClient::BillingNotes::V2::Types::BillingNoteBaseOptional]
|
36
|
+
def self.from_json(json_object:)
|
37
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
38
|
+
text = struct["text"]
|
39
|
+
new(text: text, additional_properties: struct)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Serialize an instance of BillingNoteBaseOptional 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.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|