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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/auth/client.rb +7 -7
  3. data/lib/candidhealth/auth/{v_2 → default}/client.rb +39 -13
  4. data/lib/candidhealth/auth/{v_2 → default}/types/auth_get_token_response.rb +3 -3
  5. data/lib/candidhealth/auth/default/types/invalid_content_type_error_type.rb +60 -0
  6. data/lib/candidhealth/auth/{v_2 → default}/types/too_many_requests_error_type.rb +3 -3
  7. data/lib/candidhealth/billing_notes/v_2/types/billing_note_base_optional.rb +62 -0
  8. data/lib/candidhealth/charge_capture/v_1/client.rb +504 -482
  9. data/lib/candidhealth/charge_capture/v_1/types/charge_capture.rb +17 -1
  10. data/lib/candidhealth/charge_capture/v_1/types/charge_capture_data.rb +173 -173
  11. data/lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb +26 -2
  12. data/lib/candidhealth/charge_capture_bundles/v_1/client.rb +58 -0
  13. data/lib/candidhealth/claim_submission/v_1/types/claim_submission_record_create_optional.rb +100 -0
  14. data/lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create_optional.rb +101 -0
  15. data/lib/candidhealth/commons/types/phone_number_optional.rb +71 -0
  16. data/lib/candidhealth/commons/types/procedure_modifier.rb +2 -0
  17. data/lib/candidhealth/commons/types/street_address_long_zip_optional.rb +107 -0
  18. data/lib/candidhealth/custom_schemas/v_1/types/schema_instance_optional.rb +78 -0
  19. data/lib/candidhealth/diagnoses/client.rb +23 -4
  20. data/lib/candidhealth/diagnoses/types/diagnosis.rb +21 -2
  21. data/lib/candidhealth/diagnoses/types/diagnosis_create.rb +25 -2
  22. data/lib/candidhealth/diagnoses/types/diagnosis_create_optional.rb +126 -0
  23. data/lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb +22 -2
  24. data/lib/candidhealth/encounter_providers/v_2/types/ordering_provider_optional.rb +123 -0
  25. data/lib/candidhealth/encounters/v_4/client.rb +214 -208
  26. data/lib/candidhealth/encounters/v_4/types/claim_supplemental_information_optional.rb +86 -0
  27. data/lib/candidhealth/encounters/v_4/types/clinical_note_category_create_optional.rb +78 -0
  28. data/lib/candidhealth/encounters/v_4/types/clinical_note_optional.rb +93 -0
  29. data/lib/candidhealth/encounters/v_4/types/encounter.rb +16 -4
  30. data/lib/candidhealth/encounters/v_4/types/encounter_create_from_pre_encounter.rb +4 -2
  31. data/lib/candidhealth/encounters/v_4/types/encounter_deep_optional.rb +780 -0
  32. data/lib/candidhealth/encounters/v_4/types/encounter_optional.rb +1 -139
  33. data/lib/candidhealth/encounters/v_4/types/epsdt_referral_optional.rb +85 -0
  34. data/lib/candidhealth/encounters/v_4/types/intake_question_optional.rb +84 -0
  35. data/lib/candidhealth/encounters/v_4/types/intervention_optional.rb +114 -0
  36. data/lib/candidhealth/encounters/v_4/types/lab_optional.rb +80 -0
  37. data/lib/candidhealth/encounters/v_4/types/medication_optional.rb +108 -0
  38. data/lib/candidhealth/encounters/v_4/types/patient_history_category_optional.rb +78 -0
  39. data/lib/candidhealth/guarantor/v_1/types/guarantor_optional.rb +144 -0
  40. data/lib/candidhealth/individual/types/individual_base_optional.rb +78 -0
  41. data/lib/candidhealth/individual/types/patient_non_insurance_payer_info_create_optional.rb +89 -0
  42. data/lib/candidhealth/individual/types/patient_update_with_optional_address.rb +8 -8
  43. data/lib/candidhealth/individual/types/subscriber_base_optional.rb +118 -0
  44. data/lib/candidhealth/individual/types/subscriber_create_optional.rb +132 -0
  45. data/lib/candidhealth/insurance_adjudications/v_1/client.rb +2 -0
  46. data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb +9 -1
  47. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_create_optional.rb +167 -0
  48. data/lib/candidhealth/pre_encounter/patients/v_1/types/authorization.rb +13 -1
  49. data/lib/candidhealth/service_lines/v_2/types/drug_identification_optional.rb +126 -0
  50. data/lib/candidhealth/service_lines/v_2/types/service_line_create_optional.rb +239 -0
  51. data/lib/candidhealth/service_lines/v_2/types/test_result_optional.rb +73 -0
  52. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_reason.rb +1 -0
  53. data/lib/candidhealth/write_offs/v_1/types/patient_write_off_reason.rb +1 -0
  54. data/lib/candidhealth/yes_no_indicator/types/yes_no_indicator.rb +14 -0
  55. data/lib/core/oauth.rb +2 -2
  56. data/lib/requests.rb +2 -2
  57. data/lib/types_export.rb +32 -3
  58. metadata +34 -5
@@ -0,0 +1,126 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "service_id_qualifier"
4
+ require_relative "measurement_unit_code"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module CandidApiClient
9
+ module ServiceLines
10
+ module V2
11
+ module Types
12
+ class DrugIdentificationOptional
13
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier]
14
+ attr_reader :service_id_qualifier
15
+ # @return [String]
16
+ attr_reader :national_drug_code
17
+ # @return [String]
18
+ attr_reader :national_drug_unit_count
19
+ # @return [CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode]
20
+ attr_reader :measurement_unit_code
21
+ # @return [String]
22
+ attr_reader :link_sequence_number
23
+ # @return [String]
24
+ attr_reader :pharmacy_prescription_number
25
+ # @return [String]
26
+ attr_reader :conversion_formula
27
+ # @return [String]
28
+ attr_reader :drug_description
29
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
30
+ attr_reader :additional_properties
31
+ # @return [Object]
32
+ attr_reader :_field_set
33
+ protected :_field_set
34
+
35
+ OMIT = Object.new
36
+
37
+ # @param service_id_qualifier [CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier]
38
+ # @param national_drug_code [String]
39
+ # @param national_drug_unit_count [String]
40
+ # @param measurement_unit_code [CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode]
41
+ # @param link_sequence_number [String]
42
+ # @param pharmacy_prescription_number [String]
43
+ # @param conversion_formula [String]
44
+ # @param drug_description [String]
45
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
46
+ # @return [CandidApiClient::ServiceLines::V2::Types::DrugIdentificationOptional]
47
+ def initialize(service_id_qualifier: OMIT, national_drug_code: OMIT, national_drug_unit_count: OMIT,
48
+ measurement_unit_code: OMIT, link_sequence_number: OMIT, pharmacy_prescription_number: OMIT, conversion_formula: OMIT, drug_description: OMIT, additional_properties: nil)
49
+ @service_id_qualifier = service_id_qualifier if service_id_qualifier != OMIT
50
+ @national_drug_code = national_drug_code if national_drug_code != OMIT
51
+ @national_drug_unit_count = national_drug_unit_count if national_drug_unit_count != OMIT
52
+ @measurement_unit_code = measurement_unit_code if measurement_unit_code != OMIT
53
+ @link_sequence_number = link_sequence_number if link_sequence_number != OMIT
54
+ @pharmacy_prescription_number = pharmacy_prescription_number if pharmacy_prescription_number != OMIT
55
+ @conversion_formula = conversion_formula if conversion_formula != OMIT
56
+ @drug_description = drug_description if drug_description != OMIT
57
+ @additional_properties = additional_properties
58
+ @_field_set = {
59
+ "service_id_qualifier": service_id_qualifier,
60
+ "national_drug_code": national_drug_code,
61
+ "national_drug_unit_count": national_drug_unit_count,
62
+ "measurement_unit_code": measurement_unit_code,
63
+ "link_sequence_number": link_sequence_number,
64
+ "pharmacy_prescription_number": pharmacy_prescription_number,
65
+ "conversion_formula": conversion_formula,
66
+ "drug_description": drug_description
67
+ }.reject do |_k, v|
68
+ v == OMIT
69
+ end
70
+ end
71
+
72
+ # Deserialize a JSON object to an instance of DrugIdentificationOptional
73
+ #
74
+ # @param json_object [String]
75
+ # @return [CandidApiClient::ServiceLines::V2::Types::DrugIdentificationOptional]
76
+ def self.from_json(json_object:)
77
+ struct = JSON.parse(json_object, object_class: OpenStruct)
78
+ service_id_qualifier = struct["service_id_qualifier"]
79
+ national_drug_code = struct["national_drug_code"]
80
+ national_drug_unit_count = struct["national_drug_unit_count"]
81
+ measurement_unit_code = struct["measurement_unit_code"]
82
+ link_sequence_number = struct["link_sequence_number"]
83
+ pharmacy_prescription_number = struct["pharmacy_prescription_number"]
84
+ conversion_formula = struct["conversion_formula"]
85
+ drug_description = struct["drug_description"]
86
+ new(
87
+ service_id_qualifier: service_id_qualifier,
88
+ national_drug_code: national_drug_code,
89
+ national_drug_unit_count: national_drug_unit_count,
90
+ measurement_unit_code: measurement_unit_code,
91
+ link_sequence_number: link_sequence_number,
92
+ pharmacy_prescription_number: pharmacy_prescription_number,
93
+ conversion_formula: conversion_formula,
94
+ drug_description: drug_description,
95
+ additional_properties: struct
96
+ )
97
+ end
98
+
99
+ # Serialize an instance of DrugIdentificationOptional to a JSON object
100
+ #
101
+ # @return [String]
102
+ def to_json(*_args)
103
+ @_field_set&.to_json
104
+ end
105
+
106
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
107
+ # hash and check each fields type against the current object's property
108
+ # definitions.
109
+ #
110
+ # @param obj [Object]
111
+ # @return [Void]
112
+ def self.validate_raw(obj:)
113
+ obj.service_id_qualifier&.is_a?(CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier) != false || raise("Passed value for field obj.service_id_qualifier is not the expected type, validation failed.")
114
+ obj.national_drug_code&.is_a?(String) != false || raise("Passed value for field obj.national_drug_code is not the expected type, validation failed.")
115
+ obj.national_drug_unit_count&.is_a?(String) != false || raise("Passed value for field obj.national_drug_unit_count is not the expected type, validation failed.")
116
+ obj.measurement_unit_code&.is_a?(CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode) != false || raise("Passed value for field obj.measurement_unit_code is not the expected type, validation failed.")
117
+ obj.link_sequence_number&.is_a?(String) != false || raise("Passed value for field obj.link_sequence_number is not the expected type, validation failed.")
118
+ obj.pharmacy_prescription_number&.is_a?(String) != false || raise("Passed value for field obj.pharmacy_prescription_number is not the expected type, validation failed.")
119
+ obj.conversion_formula&.is_a?(String) != false || raise("Passed value for field obj.conversion_formula is not the expected type, validation failed.")
120
+ obj.drug_description&.is_a?(String) != false || raise("Passed value for field obj.drug_description is not the expected type, validation failed.")
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
@@ -0,0 +1,239 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../commons/types/procedure_modifier"
4
+ require_relative "../../../commons/types/service_line_units"
5
+ require_relative "drug_identification_optional"
6
+ require_relative "../../../commons/types/facility_type_code"
7
+ require "date"
8
+ require_relative "../../../encounter_providers/v_2/types/ordering_provider_optional"
9
+ require_relative "test_result_optional"
10
+ require "ostruct"
11
+ require "json"
12
+
13
+ module CandidApiClient
14
+ module ServiceLines
15
+ module V2
16
+ module Types
17
+ class ServiceLineCreateOptional
18
+ # @return [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
19
+ attr_reader :modifiers
20
+ # @return [Boolean] Maps to SV1-11 on the 837-P and Box 24H on the CMS-1500.
21
+ # If the value is true, the box will be populated with "Y". Otherwise, the box
22
+ # will not be populated.
23
+ attr_reader :has_epsdt_indicator
24
+ # @return [Boolean] Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500.
25
+ # If the value is true, the box will be populated with "Y". Otherwise, the box
26
+ # will not be populated.
27
+ attr_reader :has_family_planning_indicator
28
+ # @return [String]
29
+ attr_reader :procedure_code
30
+ # @return [String] String representation of a Decimal that can be parsed by most libraries.
31
+ # A ServiceLine quantity cannot contain more than one digit of precision.
32
+ # Example: 1.1 is valid, 1.11 is not.
33
+ attr_reader :quantity
34
+ # @return [CandidApiClient::Commons::Types::ServiceLineUnits]
35
+ attr_reader :units
36
+ # @return [Integer] The total amount charged for this service line taking quantity into account. For
37
+ # example, if a single unit
38
+ # costs 100 cents and 2 units were rendered, the `charge_amount_cents` should be
39
+ # 200. Should be greater than or
40
+ # equal to 0.
41
+ attr_reader :charge_amount_cents
42
+ # @return [Array<Integer>] Indices (zero-indexed) of all the diagnoses this service line references
43
+ attr_reader :diagnosis_pointers
44
+ # @return [CandidApiClient::ServiceLines::V2::Types::DrugIdentificationOptional]
45
+ attr_reader :drug_identification
46
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode] 837p Loop2300, SV105. If your organization does not intend to submit claims with
47
+ # a different place of service at the service line level, this field should not be
48
+ # populated. 02 for telemedicine, 11 for in-person. Full list
49
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
50
+ attr_reader :place_of_service_code
51
+ # @return [String] A free-form description to clarify the related data elements and their content.
52
+ # Maps to SV1-01, C003-07 on the 837-P.
53
+ attr_reader :description
54
+ # @return [Date]
55
+ attr_reader :date_of_service
56
+ # @return [Date]
57
+ attr_reader :end_date_of_service
58
+ # @return [CandidApiClient::EncounterProviders::V2::Types::OrderingProviderOptional] Required when the service or supply was ordered by a provider who is different
59
+ # than the rendering provider for this service line.
60
+ # If not required by this implementation guide, do not send.
61
+ attr_reader :ordering_provider
62
+ # @return [Array<CandidApiClient::ServiceLines::V2::Types::TestResultOptional>] Contains a list of test results. Test result types may map to MEA-02 on the
63
+ # 837-P (ex: Hemoglobin, Hematocrit).
64
+ # No more than 5 MEA-02 test results may be submitted per service line.
65
+ attr_reader :test_results
66
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
67
+ attr_reader :additional_properties
68
+ # @return [Object]
69
+ attr_reader :_field_set
70
+ protected :_field_set
71
+
72
+ OMIT = Object.new
73
+
74
+ # @param modifiers [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
75
+ # @param has_epsdt_indicator [Boolean] Maps to SV1-11 on the 837-P and Box 24H on the CMS-1500.
76
+ # If the value is true, the box will be populated with "Y". Otherwise, the box
77
+ # will not be populated.
78
+ # @param has_family_planning_indicator [Boolean] Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500.
79
+ # If the value is true, the box will be populated with "Y". Otherwise, the box
80
+ # will not be populated.
81
+ # @param procedure_code [String]
82
+ # @param quantity [String] String representation of a Decimal that can be parsed by most libraries.
83
+ # A ServiceLine quantity cannot contain more than one digit of precision.
84
+ # Example: 1.1 is valid, 1.11 is not.
85
+ # @param units [CandidApiClient::Commons::Types::ServiceLineUnits]
86
+ # @param charge_amount_cents [Integer] The total amount charged for this service line taking quantity into account. For
87
+ # example, if a single unit
88
+ # costs 100 cents and 2 units were rendered, the `charge_amount_cents` should be
89
+ # 200. Should be greater than or
90
+ # equal to 0.
91
+ # @param diagnosis_pointers [Array<Integer>] Indices (zero-indexed) of all the diagnoses this service line references
92
+ # @param drug_identification [CandidApiClient::ServiceLines::V2::Types::DrugIdentificationOptional]
93
+ # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] 837p Loop2300, SV105. If your organization does not intend to submit claims with
94
+ # a different place of service at the service line level, this field should not be
95
+ # populated. 02 for telemedicine, 11 for in-person. Full list
96
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
97
+ # @param description [String] A free-form description to clarify the related data elements and their content.
98
+ # Maps to SV1-01, C003-07 on the 837-P.
99
+ # @param date_of_service [Date]
100
+ # @param end_date_of_service [Date]
101
+ # @param ordering_provider [CandidApiClient::EncounterProviders::V2::Types::OrderingProviderOptional] Required when the service or supply was ordered by a provider who is different
102
+ # than the rendering provider for this service line.
103
+ # If not required by this implementation guide, do not send.
104
+ # @param test_results [Array<CandidApiClient::ServiceLines::V2::Types::TestResultOptional>] Contains a list of test results. Test result types may map to MEA-02 on the
105
+ # 837-P (ex: Hemoglobin, Hematocrit).
106
+ # No more than 5 MEA-02 test results may be submitted per service line.
107
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
108
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateOptional]
109
+ def initialize(modifiers: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT,
110
+ procedure_code: OMIT, quantity: OMIT, units: OMIT, charge_amount_cents: OMIT, diagnosis_pointers: OMIT, drug_identification: OMIT, place_of_service_code: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, ordering_provider: OMIT, test_results: OMIT, additional_properties: nil)
111
+ @modifiers = modifiers if modifiers != OMIT
112
+ @has_epsdt_indicator = has_epsdt_indicator if has_epsdt_indicator != OMIT
113
+ @has_family_planning_indicator = has_family_planning_indicator if has_family_planning_indicator != OMIT
114
+ @procedure_code = procedure_code if procedure_code != OMIT
115
+ @quantity = quantity if quantity != OMIT
116
+ @units = units if units != OMIT
117
+ @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
118
+ @diagnosis_pointers = diagnosis_pointers if diagnosis_pointers != OMIT
119
+ @drug_identification = drug_identification if drug_identification != OMIT
120
+ @place_of_service_code = place_of_service_code if place_of_service_code != OMIT
121
+ @description = description if description != OMIT
122
+ @date_of_service = date_of_service if date_of_service != OMIT
123
+ @end_date_of_service = end_date_of_service if end_date_of_service != OMIT
124
+ @ordering_provider = ordering_provider if ordering_provider != OMIT
125
+ @test_results = test_results if test_results != OMIT
126
+ @additional_properties = additional_properties
127
+ @_field_set = {
128
+ "modifiers": modifiers,
129
+ "has_epsdt_indicator": has_epsdt_indicator,
130
+ "has_family_planning_indicator": has_family_planning_indicator,
131
+ "procedure_code": procedure_code,
132
+ "quantity": quantity,
133
+ "units": units,
134
+ "charge_amount_cents": charge_amount_cents,
135
+ "diagnosis_pointers": diagnosis_pointers,
136
+ "drug_identification": drug_identification,
137
+ "place_of_service_code": place_of_service_code,
138
+ "description": description,
139
+ "date_of_service": date_of_service,
140
+ "end_date_of_service": end_date_of_service,
141
+ "ordering_provider": ordering_provider,
142
+ "test_results": test_results
143
+ }.reject do |_k, v|
144
+ v == OMIT
145
+ end
146
+ end
147
+
148
+ # Deserialize a JSON object to an instance of ServiceLineCreateOptional
149
+ #
150
+ # @param json_object [String]
151
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateOptional]
152
+ def self.from_json(json_object:)
153
+ struct = JSON.parse(json_object, object_class: OpenStruct)
154
+ parsed_json = JSON.parse(json_object)
155
+ modifiers = struct["modifiers"]
156
+ has_epsdt_indicator = struct["has_epsdt_indicator"]
157
+ has_family_planning_indicator = struct["has_family_planning_indicator"]
158
+ procedure_code = struct["procedure_code"]
159
+ quantity = struct["quantity"]
160
+ units = struct["units"]
161
+ charge_amount_cents = struct["charge_amount_cents"]
162
+ diagnosis_pointers = struct["diagnosis_pointers"]
163
+ if parsed_json["drug_identification"].nil?
164
+ drug_identification = nil
165
+ else
166
+ drug_identification = parsed_json["drug_identification"].to_json
167
+ drug_identification = CandidApiClient::ServiceLines::V2::Types::DrugIdentificationOptional.from_json(json_object: drug_identification)
168
+ end
169
+ place_of_service_code = struct["place_of_service_code"]
170
+ description = struct["description"]
171
+ date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
172
+ end_date_of_service = unless parsed_json["end_date_of_service"].nil?
173
+ Date.parse(parsed_json["end_date_of_service"])
174
+ end
175
+ if parsed_json["ordering_provider"].nil?
176
+ ordering_provider = nil
177
+ else
178
+ ordering_provider = parsed_json["ordering_provider"].to_json
179
+ ordering_provider = CandidApiClient::EncounterProviders::V2::Types::OrderingProviderOptional.from_json(json_object: ordering_provider)
180
+ end
181
+ test_results = parsed_json["test_results"]&.map do |item|
182
+ item = item.to_json
183
+ CandidApiClient::ServiceLines::V2::Types::TestResultOptional.from_json(json_object: item)
184
+ end
185
+ new(
186
+ modifiers: modifiers,
187
+ has_epsdt_indicator: has_epsdt_indicator,
188
+ has_family_planning_indicator: has_family_planning_indicator,
189
+ procedure_code: procedure_code,
190
+ quantity: quantity,
191
+ units: units,
192
+ charge_amount_cents: charge_amount_cents,
193
+ diagnosis_pointers: diagnosis_pointers,
194
+ drug_identification: drug_identification,
195
+ place_of_service_code: place_of_service_code,
196
+ description: description,
197
+ date_of_service: date_of_service,
198
+ end_date_of_service: end_date_of_service,
199
+ ordering_provider: ordering_provider,
200
+ test_results: test_results,
201
+ additional_properties: struct
202
+ )
203
+ end
204
+
205
+ # Serialize an instance of ServiceLineCreateOptional to a JSON object
206
+ #
207
+ # @return [String]
208
+ def to_json(*_args)
209
+ @_field_set&.to_json
210
+ end
211
+
212
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
213
+ # hash and check each fields type against the current object's property
214
+ # definitions.
215
+ #
216
+ # @param obj [Object]
217
+ # @return [Void]
218
+ def self.validate_raw(obj:)
219
+ obj.modifiers&.is_a?(Array) != false || raise("Passed value for field obj.modifiers is not the expected type, validation failed.")
220
+ obj.has_epsdt_indicator&.is_a?(Boolean) != false || raise("Passed value for field obj.has_epsdt_indicator is not the expected type, validation failed.")
221
+ obj.has_family_planning_indicator&.is_a?(Boolean) != false || raise("Passed value for field obj.has_family_planning_indicator is not the expected type, validation failed.")
222
+ obj.procedure_code&.is_a?(String) != false || raise("Passed value for field obj.procedure_code is not the expected type, validation failed.")
223
+ obj.quantity&.is_a?(String) != false || raise("Passed value for field obj.quantity is not the expected type, validation failed.")
224
+ obj.units&.is_a?(CandidApiClient::Commons::Types::ServiceLineUnits) != false || raise("Passed value for field obj.units is not the expected type, validation failed.")
225
+ obj.charge_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.charge_amount_cents is not the expected type, validation failed.")
226
+ obj.diagnosis_pointers&.is_a?(Array) != false || raise("Passed value for field obj.diagnosis_pointers is not the expected type, validation failed.")
227
+ obj.drug_identification.nil? || CandidApiClient::ServiceLines::V2::Types::DrugIdentificationOptional.validate_raw(obj: obj.drug_identification)
228
+ obj.place_of_service_code&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code is not the expected type, validation failed.")
229
+ obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
230
+ obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
231
+ obj.end_date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.end_date_of_service is not the expected type, validation failed.")
232
+ obj.ordering_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::OrderingProviderOptional.validate_raw(obj: obj.ordering_provider)
233
+ obj.test_results&.is_a?(Array) != false || raise("Passed value for field obj.test_results is not the expected type, validation failed.")
234
+ end
235
+ end
236
+ end
237
+ end
238
+ end
239
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_result_type"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module ServiceLines
9
+ module V2
10
+ module Types
11
+ class TestResultOptional
12
+ # @return [Float]
13
+ attr_reader :value
14
+ # @return [CandidApiClient::ServiceLines::V2::Types::TestResultType]
15
+ attr_reader :result_type
16
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
17
+ attr_reader :additional_properties
18
+ # @return [Object]
19
+ attr_reader :_field_set
20
+ protected :_field_set
21
+
22
+ OMIT = Object.new
23
+
24
+ # @param value [Float]
25
+ # @param result_type [CandidApiClient::ServiceLines::V2::Types::TestResultType]
26
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
27
+ # @return [CandidApiClient::ServiceLines::V2::Types::TestResultOptional]
28
+ def initialize(value: OMIT, result_type: OMIT, additional_properties: nil)
29
+ @value = value if value != OMIT
30
+ @result_type = result_type if result_type != OMIT
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "value": value, "result_type": result_type }.reject do |_k, v|
33
+ v == OMIT
34
+ end
35
+ end
36
+
37
+ # Deserialize a JSON object to an instance of TestResultOptional
38
+ #
39
+ # @param json_object [String]
40
+ # @return [CandidApiClient::ServiceLines::V2::Types::TestResultOptional]
41
+ def self.from_json(json_object:)
42
+ struct = JSON.parse(json_object, object_class: OpenStruct)
43
+ value = struct["value"]
44
+ result_type = struct["result_type"]
45
+ new(
46
+ value: value,
47
+ result_type: result_type,
48
+ additional_properties: struct
49
+ )
50
+ end
51
+
52
+ # Serialize an instance of TestResultOptional to a JSON object
53
+ #
54
+ # @return [String]
55
+ def to_json(*_args)
56
+ @_field_set&.to_json
57
+ end
58
+
59
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
60
+ # hash and check each fields type against the current object's property
61
+ # definitions.
62
+ #
63
+ # @param obj [Object]
64
+ # @return [Void]
65
+ def self.validate_raw(obj:)
66
+ obj.value&.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
67
+ obj.result_type&.is_a?(CandidApiClient::ServiceLines::V2::Types::TestResultType) != false || raise("Passed value for field obj.result_type is not the expected type, validation failed.")
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -21,6 +21,7 @@ module CandidApiClient
21
21
  OTHER = "OTHER"
22
22
  UNKNOWN = "UNKNOWN"
23
23
  CONTRACTUAL_ADJUSTMENT = "CONTRACTUAL_ADJUSTMENT"
24
+ PRIMARY_PAID_MAX_BENEFITS = "PRIMARY_PAID_MAX_BENEFITS"
24
25
  end
25
26
  end
26
27
  end
@@ -16,6 +16,7 @@ module CandidApiClient
16
16
  UNKNOWN = "UNKNOWN"
17
17
  UNCOLLECTIBLE_OR_NON_BILLABLE = "UNCOLLECTIBLE_OR_NON_BILLABLE"
18
18
  DECEASED = "DECEASED"
19
+ BANKRUPTCY = "BANKRUPTCY"
19
20
  end
20
21
  end
21
22
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ module YesNoIndicator
5
+ module Types
6
+ class YesNoIndicator
7
+ YES = "YES"
8
+ NO = "NO"
9
+ UNKNOWN = "UNKNOWN"
10
+ NOT_APPLICABLE = "NOT_APPLICABLE"
11
+ end
12
+ end
13
+ end
14
+ end
data/lib/core/oauth.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../requests"
4
- require_relative "../candidhealth/auth/v_2/client"
4
+ require_relative "../candidhealth/auth/default/client"
5
5
  require_relative "oauth"
6
6
 
7
7
  module CandidApiClient
@@ -38,7 +38,7 @@ module CandidApiClient
38
38
  def initialize(client_id:, client_secret:, request_client:)
39
39
  @client_id = client_id
40
40
  @client_secret = client_secret
41
- @auth_client = CandidApiClient::Auth::V2::V2Client.new(request_client: request_client)
41
+ @auth_client = CandidApiClient::Auth::Default::DefaultClient.new(request_client: request_client)
42
42
  end
43
43
 
44
44
  # Returns a cached access token retrieved from the provided client credentials,
data/lib/requests.rb CHANGED
@@ -45,7 +45,7 @@ module CandidApiClient
45
45
 
46
46
  # @return [Hash{String => String}]
47
47
  def get_headers
48
- headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "1.0.0" }
48
+ headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "1.3.0" }
49
49
  headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless token.nil?
50
50
  headers
51
51
  end
@@ -90,7 +90,7 @@ module CandidApiClient
90
90
 
91
91
  # @return [Hash{String => String}]
92
92
  def get_headers
93
- headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "1.0.0" }
93
+ headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "1.3.0" }
94
94
  headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless token.nil?
95
95
  headers
96
96
  end