candidhealth 1.7.0 → 1.8.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/default/client.rb +34 -6
- data/lib/candidhealth/charge_capture/v_1/client.rb +48 -48
- data/lib/candidhealth/charge_capture/v_1/types/charge_capture_data.rb +70 -56
- data/lib/candidhealth/commons/types/clearinghouse.rb +18 -0
- data/lib/candidhealth/commons/types/procedure_modifier.rb +11 -0
- data/lib/candidhealth/encounter_providers/v_2/types/billing_provider.rb +1 -1
- data/lib/candidhealth/encounter_providers/v_2/types/billing_provider_update.rb +1 -1
- data/lib/candidhealth/encounter_providers/v_2/types/billing_provider_update_with_optional_address.rb +1 -1
- data/lib/candidhealth/encounters/v_4/client.rb +3253 -2040
- data/lib/candidhealth/encounters/v_4/types/encounter.rb +111 -86
- data/lib/candidhealth/encounters/v_4/types/encounter_base.rb +39 -33
- data/lib/candidhealth/encounters/v_4/types/encounter_create.rb +796 -0
- data/lib/candidhealth/encounters/v_4/types/encounter_create_from_pre_encounter.rb +131 -117
- data/lib/candidhealth/encounters/v_4/types/encounter_deep_optional.rb +70 -56
- data/lib/candidhealth/encounters/v_4/types/encounter_optional.rb +29 -39
- data/lib/candidhealth/encounters/v_4/types/encounter_rendering_or_attending_provider_required_error.rb +55 -0
- data/lib/candidhealth/encounters/v_4/types/encounter_update.rb +736 -0
- data/lib/candidhealth/encounters_universal/types/universal_encounter_create.rb +944 -0
- data/lib/candidhealth/encounters_universal/types/universal_encounter_create_base.rb +691 -0
- data/lib/candidhealth/encounters_universal/types/universal_encounter_create_from_pre_encounter.rb +791 -0
- data/lib/candidhealth/encounters_universal/types/universal_encounter_create_from_pre_encounter_base.rb +572 -0
- data/lib/candidhealth/encounters_universal/types/universal_encounter_update.rb +872 -0
- data/lib/candidhealth/encounters_universal/types/universal_encounter_update_base.rb +700 -0
- data/lib/candidhealth/fee_schedules/v_3/client.rb +57 -0
- data/lib/candidhealth/fee_schedules/v_3/types/validation_error.rb +12 -0
- data/lib/candidhealth/financials/types/patient_transaction_source.rb +1 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/admitting_diagnosis_new.rb +206 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/condition_information_new.rb +207 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/diagnosis_related_group_new.rb +206 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/external_cause_of_injury_new.rb +245 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/health_care_code_information_create.rb +225 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/occurrence_information_new.rb +219 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/occurrence_span_information_new.rb +222 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/other_diagnosis_information_new.rb +215 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/other_procedure_information_new.rb +218 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/patient_reason_for_visit_new.rb +206 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/principal_diagnosis_new.rb +215 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/principal_procedure_information_new.rb +216 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/treatment_code_information_new.rb +206 -0
- data/lib/candidhealth/health_care_code_information/v_1/types/value_information_new.rb +215 -0
- data/lib/candidhealth/individual/types/patient.rb +6 -6
- data/lib/candidhealth/individual/types/patient_base.rb +6 -6
- data/lib/candidhealth/individual/types/patient_create.rb +6 -6
- data/lib/candidhealth/individual/types/patient_update.rb +6 -6
- data/lib/candidhealth/individual/types/patient_update_with_optional_address.rb +6 -6
- data/lib/candidhealth/organization_providers/v_2/types/license_type.rb +2 -0
- data/lib/candidhealth/payers/client.rb +7 -0
- data/lib/candidhealth/payers/v_4/client.rb +137 -0
- data/lib/candidhealth/payers/v_4/types/clearinghouse_payer_info.rb +93 -0
- data/lib/candidhealth/payers/v_4/types/payer.rb +116 -0
- data/lib/candidhealth/payers/v_4/types/payer_ids.rb +107 -0
- data/lib/candidhealth/payers/v_4/types/payer_page.rb +88 -0
- data/lib/candidhealth/payers/v_4/types/support_state.rb +15 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +4 -4
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb +3 -3
- data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +72 -6
- data/lib/candidhealth/pre_encounter/patients/v_1/types/guarantor.rb +3 -3
- data/lib/candidhealth/pre_encounter/patients/v_1/types/inferred_patient_metadata.rb +80 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +19 -5
- data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient_with_mrn.rb +19 -5
- data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +18 -4
- data/lib/candidhealth/pre_encounter/patients/v_1/types/referral_type.rb +1 -0
- data/lib/candidhealth/service_lines/v_2/client.rb +252 -10
- data/lib/candidhealth/service_lines/v_2/types/service_line.rb +28 -10
- data/lib/candidhealth/service_lines/v_2/types/service_line_create.rb +52 -40
- data/lib/candidhealth/service_lines/v_2/types/service_line_create_base.rb +251 -0
- data/lib/candidhealth/service_lines/v_2/types/service_line_create_base_base.rb +243 -0
- data/lib/candidhealth/service_lines/v_2/types/service_line_create_optional.rb +48 -24
- data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb +58 -46
- data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone_base.rb +273 -0
- data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone_base_base.rb +265 -0
- data/lib/candidhealth/service_lines/v_2/types/service_line_update.rb +64 -54
- data/lib/candidhealth/service_lines/v_2/types/service_line_update_base.rb +263 -0
- data/lib/candidhealth/service_lines/v_2/types/universal_service_line_create.rb +271 -0
- data/lib/candidhealth/service_lines/v_2/types/universal_service_line_create_standalone.rb +317 -0
- data/lib/candidhealth/service_lines/v_2/types/universal_service_line_update.rb +307 -0
- data/lib/candidhealth/x_12/v_1/types/type_of_bill_composite.rb +2 -2
- data/lib/candidhealth/x_12/v_1/types/type_of_bill_composite_base.rb +90 -0
- data/lib/candidhealth/x_12/v_1/types/type_of_bill_composite_update.rb +112 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +44 -4
- metadata +43 -2
@@ -0,0 +1,307 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../commons/types/procedure_modifier"
|
4
|
+
require_relative "drug_identification"
|
5
|
+
require_relative "service_line_denial_reason"
|
6
|
+
require_relative "../../../commons/types/facility_type_code"
|
7
|
+
require_relative "../../../commons/types/service_line_units"
|
8
|
+
require "date"
|
9
|
+
require_relative "test_result"
|
10
|
+
require "ostruct"
|
11
|
+
require "json"
|
12
|
+
|
13
|
+
module CandidApiClient
|
14
|
+
module ServiceLines
|
15
|
+
module V2
|
16
|
+
module Types
|
17
|
+
class UniversalServiceLineUpdate
|
18
|
+
# @return [String] A 4 digit code that specifies facility department or type of service arrangement
|
19
|
+
# for institutional service line items (837i). This code is not required for
|
20
|
+
# professional claim billing (837p).
|
21
|
+
attr_reader :revenue_code
|
22
|
+
# @return [String]
|
23
|
+
attr_reader :diagnosis_id_zero
|
24
|
+
# @return [String]
|
25
|
+
attr_reader :diagnosis_id_one
|
26
|
+
# @return [String]
|
27
|
+
attr_reader :diagnosis_id_two
|
28
|
+
# @return [String]
|
29
|
+
attr_reader :diagnosis_id_three
|
30
|
+
# @return [String]
|
31
|
+
attr_reader :edit_reason
|
32
|
+
# @return [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
|
33
|
+
attr_reader :modifiers
|
34
|
+
# @return [Integer] The total amount charged for this service line, factoring in quantity. If
|
35
|
+
# procedure_code is updated and this is not, the system will attempt to set it
|
36
|
+
# based on chargemasters entries and the service line’s quantity. For example, if
|
37
|
+
# a single unit has an entry of 100 cents and 2 units were rendered, the
|
38
|
+
# charge_amount_cents will be set to 200, if there is no chargemaster entry, it
|
39
|
+
# will default to the amount set in this field.
|
40
|
+
attr_reader :charge_amount_cents
|
41
|
+
# @return [CandidApiClient::ServiceLines::V2::Types::DrugIdentification]
|
42
|
+
attr_reader :drug_identification
|
43
|
+
# @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason]
|
44
|
+
attr_reader :denial_reason
|
45
|
+
# @return [CandidApiClient::Commons::Types::FacilityTypeCode] 837p Loop2300, SV105. This enum is not used or required in 837i claims. If your
|
46
|
+
# organization does not intend to submit claims with a different place of service
|
47
|
+
# at the service line level, this field should not be populated. 02 for
|
48
|
+
# 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 [CandidApiClient::Commons::Types::ServiceLineUnits]
|
52
|
+
attr_reader :units
|
53
|
+
# @return [String] If `procedure_code` is updated, and `charge_amount_cents` is not, then
|
54
|
+
# `charge_amount_cents` will be set by the system.
|
55
|
+
attr_reader :procedure_code
|
56
|
+
# @return [String] String representation of a Decimal that can be parsed by most libraries.
|
57
|
+
# For professional claims, a ServiceLine quantity cannot contain more than one
|
58
|
+
# digit of precision
|
59
|
+
# (Example: 1.1 is valid, 1.11 is not). For institutional claims, a ServiceLine
|
60
|
+
# quantity cannot contain
|
61
|
+
# more than three decimal digits of precision.
|
62
|
+
attr_reader :quantity
|
63
|
+
# @return [String] A free-form description to clarify the related data elements and their content.
|
64
|
+
# Maps to SV1-01, C003-07 on a 837-P and SV2-02, C003-07 on a 837-I form.
|
65
|
+
attr_reader :description
|
66
|
+
# @return [Date] date_of_service must be defined on either the encounter or the service lines but
|
67
|
+
# not both.
|
68
|
+
attr_reader :date_of_service
|
69
|
+
# @return [Date]
|
70
|
+
attr_reader :end_date_of_service
|
71
|
+
# @return [Array<CandidApiClient::ServiceLines::V2::Types::TestResult>] Contains a list of test results. Test result types may map to MEA-02 on the
|
72
|
+
# 837-P (ex: Hemoglobin, Hematocrit).
|
73
|
+
# This is unused by 837-i and ignored for institutional service lines.
|
74
|
+
# No more than 5 MEA-02 test results may be submitted per service line.
|
75
|
+
# Updating test results utilizes PUT semantics, so the test results on the service
|
76
|
+
# line will be set to whatever inputs are provided.
|
77
|
+
attr_reader :test_results
|
78
|
+
# @return [Boolean] Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500. If the value is true,
|
79
|
+
# the box will be populated with “Y”. Otherwise, the box will not be populated.
|
80
|
+
# This box is not used on an 837i.
|
81
|
+
attr_reader :has_epsdt_indicator
|
82
|
+
# @return [Boolean] Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500.
|
83
|
+
# If the value is true, the box will be populated with "Y". Otherwise, the box
|
84
|
+
# will not be populated.
|
85
|
+
attr_reader :has_family_planning_indicator
|
86
|
+
# @return [String] Maps to NTE02 loop 2400 on the EDI 837.
|
87
|
+
attr_reader :note
|
88
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
89
|
+
attr_reader :additional_properties
|
90
|
+
# @return [Object]
|
91
|
+
attr_reader :_field_set
|
92
|
+
protected :_field_set
|
93
|
+
|
94
|
+
OMIT = Object.new
|
95
|
+
|
96
|
+
# @param revenue_code [String] A 4 digit code that specifies facility department or type of service arrangement
|
97
|
+
# for institutional service line items (837i). This code is not required for
|
98
|
+
# professional claim billing (837p).
|
99
|
+
# @param diagnosis_id_zero [String]
|
100
|
+
# @param diagnosis_id_one [String]
|
101
|
+
# @param diagnosis_id_two [String]
|
102
|
+
# @param diagnosis_id_three [String]
|
103
|
+
# @param edit_reason [String]
|
104
|
+
# @param modifiers [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
|
105
|
+
# @param charge_amount_cents [Integer] The total amount charged for this service line, factoring in quantity. If
|
106
|
+
# procedure_code is updated and this is not, the system will attempt to set it
|
107
|
+
# based on chargemasters entries and the service line’s quantity. For example, if
|
108
|
+
# a single unit has an entry of 100 cents and 2 units were rendered, the
|
109
|
+
# charge_amount_cents will be set to 200, if there is no chargemaster entry, it
|
110
|
+
# will default to the amount set in this field.
|
111
|
+
# @param drug_identification [CandidApiClient::ServiceLines::V2::Types::DrugIdentification]
|
112
|
+
# @param denial_reason [CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason]
|
113
|
+
# @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] 837p Loop2300, SV105. This enum is not used or required in 837i claims. If your
|
114
|
+
# organization does not intend to submit claims with a different place of service
|
115
|
+
# at the service line level, this field should not be populated. 02 for
|
116
|
+
# telemedicine, 11 for in-person. Full list
|
117
|
+
# //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
|
118
|
+
# @param units [CandidApiClient::Commons::Types::ServiceLineUnits]
|
119
|
+
# @param procedure_code [String] If `procedure_code` is updated, and `charge_amount_cents` is not, then
|
120
|
+
# `charge_amount_cents` will be set by the system.
|
121
|
+
# @param quantity [String] String representation of a Decimal that can be parsed by most libraries.
|
122
|
+
# For professional claims, a ServiceLine quantity cannot contain more than one
|
123
|
+
# digit of precision
|
124
|
+
# (Example: 1.1 is valid, 1.11 is not). For institutional claims, a ServiceLine
|
125
|
+
# quantity cannot contain
|
126
|
+
# more than three decimal digits of precision.
|
127
|
+
# @param description [String] A free-form description to clarify the related data elements and their content.
|
128
|
+
# Maps to SV1-01, C003-07 on a 837-P and SV2-02, C003-07 on a 837-I form.
|
129
|
+
# @param date_of_service [Date] date_of_service must be defined on either the encounter or the service lines but
|
130
|
+
# not both.
|
131
|
+
# @param end_date_of_service [Date]
|
132
|
+
# @param test_results [Array<CandidApiClient::ServiceLines::V2::Types::TestResult>] Contains a list of test results. Test result types may map to MEA-02 on the
|
133
|
+
# 837-P (ex: Hemoglobin, Hematocrit).
|
134
|
+
# This is unused by 837-i and ignored for institutional service lines.
|
135
|
+
# No more than 5 MEA-02 test results may be submitted per service line.
|
136
|
+
# Updating test results utilizes PUT semantics, so the test results on the service
|
137
|
+
# line will be set to whatever inputs are provided.
|
138
|
+
# @param has_epsdt_indicator [Boolean] Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500. If the value is true,
|
139
|
+
# the box will be populated with “Y”. Otherwise, the box will not be populated.
|
140
|
+
# This box is not used on an 837i.
|
141
|
+
# @param has_family_planning_indicator [Boolean] Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500.
|
142
|
+
# If the value is true, the box will be populated with "Y". Otherwise, the box
|
143
|
+
# will not be populated.
|
144
|
+
# @param note [String] Maps to NTE02 loop 2400 on the EDI 837.
|
145
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
146
|
+
# @return [CandidApiClient::ServiceLines::V2::Types::UniversalServiceLineUpdate]
|
147
|
+
def initialize(revenue_code: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT, diagnosis_id_two: OMIT,
|
148
|
+
diagnosis_id_three: OMIT, edit_reason: OMIT, modifiers: OMIT, charge_amount_cents: OMIT, drug_identification: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, units: OMIT, procedure_code: OMIT, quantity: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, test_results: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, note: OMIT, additional_properties: nil)
|
149
|
+
@revenue_code = revenue_code if revenue_code != OMIT
|
150
|
+
@diagnosis_id_zero = diagnosis_id_zero if diagnosis_id_zero != OMIT
|
151
|
+
@diagnosis_id_one = diagnosis_id_one if diagnosis_id_one != OMIT
|
152
|
+
@diagnosis_id_two = diagnosis_id_two if diagnosis_id_two != OMIT
|
153
|
+
@diagnosis_id_three = diagnosis_id_three if diagnosis_id_three != OMIT
|
154
|
+
@edit_reason = edit_reason if edit_reason != OMIT
|
155
|
+
@modifiers = modifiers if modifiers != OMIT
|
156
|
+
@charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
|
157
|
+
@drug_identification = drug_identification if drug_identification != OMIT
|
158
|
+
@denial_reason = denial_reason if denial_reason != OMIT
|
159
|
+
@place_of_service_code = place_of_service_code if place_of_service_code != OMIT
|
160
|
+
@units = units if units != OMIT
|
161
|
+
@procedure_code = procedure_code if procedure_code != OMIT
|
162
|
+
@quantity = quantity if quantity != OMIT
|
163
|
+
@description = description if description != OMIT
|
164
|
+
@date_of_service = date_of_service if date_of_service != OMIT
|
165
|
+
@end_date_of_service = end_date_of_service if end_date_of_service != OMIT
|
166
|
+
@test_results = test_results if test_results != OMIT
|
167
|
+
@has_epsdt_indicator = has_epsdt_indicator if has_epsdt_indicator != OMIT
|
168
|
+
@has_family_planning_indicator = has_family_planning_indicator if has_family_planning_indicator != OMIT
|
169
|
+
@note = note if note != OMIT
|
170
|
+
@additional_properties = additional_properties
|
171
|
+
@_field_set = {
|
172
|
+
"revenue_code": revenue_code,
|
173
|
+
"diagnosis_id_zero": diagnosis_id_zero,
|
174
|
+
"diagnosis_id_one": diagnosis_id_one,
|
175
|
+
"diagnosis_id_two": diagnosis_id_two,
|
176
|
+
"diagnosis_id_three": diagnosis_id_three,
|
177
|
+
"edit_reason": edit_reason,
|
178
|
+
"modifiers": modifiers,
|
179
|
+
"charge_amount_cents": charge_amount_cents,
|
180
|
+
"drug_identification": drug_identification,
|
181
|
+
"denial_reason": denial_reason,
|
182
|
+
"place_of_service_code": place_of_service_code,
|
183
|
+
"units": units,
|
184
|
+
"procedure_code": procedure_code,
|
185
|
+
"quantity": quantity,
|
186
|
+
"description": description,
|
187
|
+
"date_of_service": date_of_service,
|
188
|
+
"end_date_of_service": end_date_of_service,
|
189
|
+
"test_results": test_results,
|
190
|
+
"has_epsdt_indicator": has_epsdt_indicator,
|
191
|
+
"has_family_planning_indicator": has_family_planning_indicator,
|
192
|
+
"note": note
|
193
|
+
}.reject do |_k, v|
|
194
|
+
v == OMIT
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# Deserialize a JSON object to an instance of UniversalServiceLineUpdate
|
199
|
+
#
|
200
|
+
# @param json_object [String]
|
201
|
+
# @return [CandidApiClient::ServiceLines::V2::Types::UniversalServiceLineUpdate]
|
202
|
+
def self.from_json(json_object:)
|
203
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
204
|
+
parsed_json = JSON.parse(json_object)
|
205
|
+
revenue_code = struct["revenue_code"]
|
206
|
+
diagnosis_id_zero = struct["diagnosis_id_zero"]
|
207
|
+
diagnosis_id_one = struct["diagnosis_id_one"]
|
208
|
+
diagnosis_id_two = struct["diagnosis_id_two"]
|
209
|
+
diagnosis_id_three = struct["diagnosis_id_three"]
|
210
|
+
edit_reason = struct["edit_reason"]
|
211
|
+
modifiers = struct["modifiers"]
|
212
|
+
charge_amount_cents = struct["charge_amount_cents"]
|
213
|
+
if parsed_json["drug_identification"].nil?
|
214
|
+
drug_identification = nil
|
215
|
+
else
|
216
|
+
drug_identification = parsed_json["drug_identification"].to_json
|
217
|
+
drug_identification = CandidApiClient::ServiceLines::V2::Types::DrugIdentification.from_json(json_object: drug_identification)
|
218
|
+
end
|
219
|
+
if parsed_json["denial_reason"].nil?
|
220
|
+
denial_reason = nil
|
221
|
+
else
|
222
|
+
denial_reason = parsed_json["denial_reason"].to_json
|
223
|
+
denial_reason = CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.from_json(json_object: denial_reason)
|
224
|
+
end
|
225
|
+
place_of_service_code = struct["place_of_service_code"]
|
226
|
+
units = struct["units"]
|
227
|
+
procedure_code = struct["procedure_code"]
|
228
|
+
quantity = struct["quantity"]
|
229
|
+
description = struct["description"]
|
230
|
+
date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
|
231
|
+
end_date_of_service = unless parsed_json["end_date_of_service"].nil?
|
232
|
+
Date.parse(parsed_json["end_date_of_service"])
|
233
|
+
end
|
234
|
+
test_results = parsed_json["test_results"]&.map do |item|
|
235
|
+
item = item.to_json
|
236
|
+
CandidApiClient::ServiceLines::V2::Types::TestResult.from_json(json_object: item)
|
237
|
+
end
|
238
|
+
has_epsdt_indicator = struct["has_epsdt_indicator"]
|
239
|
+
has_family_planning_indicator = struct["has_family_planning_indicator"]
|
240
|
+
note = struct["note"]
|
241
|
+
new(
|
242
|
+
revenue_code: revenue_code,
|
243
|
+
diagnosis_id_zero: diagnosis_id_zero,
|
244
|
+
diagnosis_id_one: diagnosis_id_one,
|
245
|
+
diagnosis_id_two: diagnosis_id_two,
|
246
|
+
diagnosis_id_three: diagnosis_id_three,
|
247
|
+
edit_reason: edit_reason,
|
248
|
+
modifiers: modifiers,
|
249
|
+
charge_amount_cents: charge_amount_cents,
|
250
|
+
drug_identification: drug_identification,
|
251
|
+
denial_reason: denial_reason,
|
252
|
+
place_of_service_code: place_of_service_code,
|
253
|
+
units: units,
|
254
|
+
procedure_code: procedure_code,
|
255
|
+
quantity: quantity,
|
256
|
+
description: description,
|
257
|
+
date_of_service: date_of_service,
|
258
|
+
end_date_of_service: end_date_of_service,
|
259
|
+
test_results: test_results,
|
260
|
+
has_epsdt_indicator: has_epsdt_indicator,
|
261
|
+
has_family_planning_indicator: has_family_planning_indicator,
|
262
|
+
note: note,
|
263
|
+
additional_properties: struct
|
264
|
+
)
|
265
|
+
end
|
266
|
+
|
267
|
+
# Serialize an instance of UniversalServiceLineUpdate to a JSON object
|
268
|
+
#
|
269
|
+
# @return [String]
|
270
|
+
def to_json(*_args)
|
271
|
+
@_field_set&.to_json
|
272
|
+
end
|
273
|
+
|
274
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
275
|
+
# hash and check each fields type against the current object's property
|
276
|
+
# definitions.
|
277
|
+
#
|
278
|
+
# @param obj [Object]
|
279
|
+
# @return [Void]
|
280
|
+
def self.validate_raw(obj:)
|
281
|
+
obj.revenue_code&.is_a?(String) != false || raise("Passed value for field obj.revenue_code is not the expected type, validation failed.")
|
282
|
+
obj.diagnosis_id_zero&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_zero is not the expected type, validation failed.")
|
283
|
+
obj.diagnosis_id_one&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_one is not the expected type, validation failed.")
|
284
|
+
obj.diagnosis_id_two&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_two is not the expected type, validation failed.")
|
285
|
+
obj.diagnosis_id_three&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_three is not the expected type, validation failed.")
|
286
|
+
obj.edit_reason&.is_a?(String) != false || raise("Passed value for field obj.edit_reason is not the expected type, validation failed.")
|
287
|
+
obj.modifiers&.is_a?(Array) != false || raise("Passed value for field obj.modifiers is not the expected type, validation failed.")
|
288
|
+
obj.charge_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.charge_amount_cents is not the expected type, validation failed.")
|
289
|
+
obj.drug_identification.nil? || CandidApiClient::ServiceLines::V2::Types::DrugIdentification.validate_raw(obj: obj.drug_identification)
|
290
|
+
obj.denial_reason.nil? || CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.validate_raw(obj: obj.denial_reason)
|
291
|
+
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.")
|
292
|
+
obj.units&.is_a?(CandidApiClient::Commons::Types::ServiceLineUnits) != false || raise("Passed value for field obj.units is not the expected type, validation failed.")
|
293
|
+
obj.procedure_code&.is_a?(String) != false || raise("Passed value for field obj.procedure_code is not the expected type, validation failed.")
|
294
|
+
obj.quantity&.is_a?(String) != false || raise("Passed value for field obj.quantity is not the expected type, validation failed.")
|
295
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
296
|
+
obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
|
297
|
+
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.")
|
298
|
+
obj.test_results&.is_a?(Array) != false || raise("Passed value for field obj.test_results is not the expected type, validation failed.")
|
299
|
+
obj.has_epsdt_indicator&.is_a?(Boolean) != false || raise("Passed value for field obj.has_epsdt_indicator is not the expected type, validation failed.")
|
300
|
+
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.")
|
301
|
+
obj.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.")
|
302
|
+
end
|
303
|
+
end
|
304
|
+
end
|
305
|
+
end
|
306
|
+
end
|
307
|
+
end
|
@@ -16,7 +16,7 @@ module CandidApiClient
|
|
16
16
|
# @return [CandidApiClient::X12::V1::Types::TypeOfFacilityCode] The FL04 Institutional type of facility code for the bill. The second digit of
|
17
17
|
# the composite code.
|
18
18
|
attr_reader :type_of_facility
|
19
|
-
# @return [CandidApiClient::X12::V1::Types::TypeOfCareCode] The FL04 Institutional type of care code for the bill. The
|
19
|
+
# @return [CandidApiClient::X12::V1::Types::TypeOfCareCode] The FL04 Institutional type of care code for the bill. The third digit of the
|
20
20
|
# composite code.
|
21
21
|
attr_reader :type_of_care
|
22
22
|
# @return [CandidApiClient::X12::V1::Types::TypeOfBillFrequencyCode] The FL04 Institutional frequency code for the bill. The fourth digit of the
|
@@ -33,7 +33,7 @@ module CandidApiClient
|
|
33
33
|
# @param code [String] The composite, 4 digit code of the composite, starting with a padding code 0.
|
34
34
|
# @param type_of_facility [CandidApiClient::X12::V1::Types::TypeOfFacilityCode] The FL04 Institutional type of facility code for the bill. The second digit of
|
35
35
|
# the composite code.
|
36
|
-
# @param type_of_care [CandidApiClient::X12::V1::Types::TypeOfCareCode] The FL04 Institutional type of care code for the bill. The
|
36
|
+
# @param type_of_care [CandidApiClient::X12::V1::Types::TypeOfCareCode] The FL04 Institutional type of care code for the bill. The third digit of the
|
37
37
|
# composite code.
|
38
38
|
# @param frequency_code [CandidApiClient::X12::V1::Types::TypeOfBillFrequencyCode] The FL04 Institutional frequency code for the bill. The fourth digit of the
|
39
39
|
# composite code.
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "type_of_facility_code"
|
4
|
+
require_relative "type_of_care_code"
|
5
|
+
require_relative "type_of_bill_frequency_code"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module CandidApiClient
|
10
|
+
module X12
|
11
|
+
module V1
|
12
|
+
module Types
|
13
|
+
class TypeOfBillCompositeBase
|
14
|
+
# @return [CandidApiClient::X12::V1::Types::TypeOfFacilityCode] The FL04 Institutional type of facility code for the bill. The second digit of
|
15
|
+
# the composite code.
|
16
|
+
attr_reader :type_of_facility
|
17
|
+
# @return [CandidApiClient::X12::V1::Types::TypeOfCareCode] The FL04 Institutional type of care code for the bill. The third digit of the
|
18
|
+
# composite code.
|
19
|
+
attr_reader :type_of_care
|
20
|
+
# @return [CandidApiClient::X12::V1::Types::TypeOfBillFrequencyCode] The FL04 Institutional frequency code for the bill. The fourth digit of the
|
21
|
+
# composite code.
|
22
|
+
attr_reader :frequency_code
|
23
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
+
attr_reader :additional_properties
|
25
|
+
# @return [Object]
|
26
|
+
attr_reader :_field_set
|
27
|
+
protected :_field_set
|
28
|
+
|
29
|
+
OMIT = Object.new
|
30
|
+
|
31
|
+
# @param type_of_facility [CandidApiClient::X12::V1::Types::TypeOfFacilityCode] The FL04 Institutional type of facility code for the bill. The second digit of
|
32
|
+
# the composite code.
|
33
|
+
# @param type_of_care [CandidApiClient::X12::V1::Types::TypeOfCareCode] The FL04 Institutional type of care code for the bill. The third digit of the
|
34
|
+
# composite code.
|
35
|
+
# @param frequency_code [CandidApiClient::X12::V1::Types::TypeOfBillFrequencyCode] The FL04 Institutional frequency code for the bill. The fourth digit of the
|
36
|
+
# composite code.
|
37
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
38
|
+
# @return [CandidApiClient::X12::V1::Types::TypeOfBillCompositeBase]
|
39
|
+
def initialize(type_of_facility:, type_of_care:, frequency_code:, additional_properties: nil)
|
40
|
+
@type_of_facility = type_of_facility
|
41
|
+
@type_of_care = type_of_care
|
42
|
+
@frequency_code = frequency_code
|
43
|
+
@additional_properties = additional_properties
|
44
|
+
@_field_set = {
|
45
|
+
"type_of_facility": type_of_facility,
|
46
|
+
"type_of_care": type_of_care,
|
47
|
+
"frequency_code": frequency_code
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Deserialize a JSON object to an instance of TypeOfBillCompositeBase
|
52
|
+
#
|
53
|
+
# @param json_object [String]
|
54
|
+
# @return [CandidApiClient::X12::V1::Types::TypeOfBillCompositeBase]
|
55
|
+
def self.from_json(json_object:)
|
56
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
57
|
+
type_of_facility = struct["type_of_facility"]
|
58
|
+
type_of_care = struct["type_of_care"]
|
59
|
+
frequency_code = struct["frequency_code"]
|
60
|
+
new(
|
61
|
+
type_of_facility: type_of_facility,
|
62
|
+
type_of_care: type_of_care,
|
63
|
+
frequency_code: frequency_code,
|
64
|
+
additional_properties: struct
|
65
|
+
)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Serialize an instance of TypeOfBillCompositeBase to a JSON object
|
69
|
+
#
|
70
|
+
# @return [String]
|
71
|
+
def to_json(*_args)
|
72
|
+
@_field_set&.to_json
|
73
|
+
end
|
74
|
+
|
75
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
76
|
+
# hash and check each fields type against the current object's property
|
77
|
+
# definitions.
|
78
|
+
#
|
79
|
+
# @param obj [Object]
|
80
|
+
# @return [Void]
|
81
|
+
def self.validate_raw(obj:)
|
82
|
+
obj.type_of_facility.is_a?(CandidApiClient::X12::V1::Types::TypeOfFacilityCode) != false || raise("Passed value for field obj.type_of_facility is not the expected type, validation failed.")
|
83
|
+
obj.type_of_care.is_a?(CandidApiClient::X12::V1::Types::TypeOfCareCode) != false || raise("Passed value for field obj.type_of_care is not the expected type, validation failed.")
|
84
|
+
obj.frequency_code.is_a?(CandidApiClient::X12::V1::Types::TypeOfBillFrequencyCode) != false || raise("Passed value for field obj.frequency_code is not the expected type, validation failed.")
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "type_of_bill_composite_base"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module X12
|
8
|
+
module V1
|
9
|
+
module Types
|
10
|
+
# A type of bill can either be seen as a compositio of structured parts, or as a
|
11
|
+
# literal string.
|
12
|
+
# This union represents the potential to express a type of bill either as one of
|
13
|
+
# those two shapes.
|
14
|
+
# Passing a string, this update will be seen as a complete 4 digit code, along
|
15
|
+
# with a padding code 0, that
|
16
|
+
# should match a valid composition.
|
17
|
+
# Passing as a structure, the update will be seen as three parts and will be
|
18
|
+
# joined together by the server
|
19
|
+
# to represent a valid composition for you.
|
20
|
+
# Which you use depends upon whether you are "passing through" coded information
|
21
|
+
# or making a decision about its
|
22
|
+
# structure explicitly.
|
23
|
+
class TypeOfBillCompositeUpdate
|
24
|
+
# @return [Object]
|
25
|
+
attr_reader :member
|
26
|
+
# @return [String]
|
27
|
+
attr_reader :discriminant
|
28
|
+
|
29
|
+
private_class_method :new
|
30
|
+
alias kind_of? is_a?
|
31
|
+
|
32
|
+
# @param member [Object]
|
33
|
+
# @param discriminant [String]
|
34
|
+
# @return [CandidApiClient::X12::V1::Types::TypeOfBillCompositeUpdate]
|
35
|
+
def initialize(member:, discriminant:)
|
36
|
+
@member = member
|
37
|
+
@discriminant = discriminant
|
38
|
+
end
|
39
|
+
|
40
|
+
# Deserialize a JSON object to an instance of TypeOfBillCompositeUpdate
|
41
|
+
#
|
42
|
+
# @param json_object [String]
|
43
|
+
# @return [CandidApiClient::X12::V1::Types::TypeOfBillCompositeUpdate]
|
44
|
+
def self.from_json(json_object:)
|
45
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
46
|
+
member = case struct.type
|
47
|
+
when "raw_code"
|
48
|
+
json_object.value
|
49
|
+
when "composite_codes"
|
50
|
+
CandidApiClient::X12::V1::Types::TypeOfBillCompositeBase.from_json(json_object: json_object)
|
51
|
+
else
|
52
|
+
json_object
|
53
|
+
end
|
54
|
+
new(member: member, discriminant: struct.type)
|
55
|
+
end
|
56
|
+
|
57
|
+
# For Union Types, to_json functionality is delegated to the wrapped member.
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
def to_json(*_args)
|
61
|
+
case @discriminant
|
62
|
+
when "raw_code"
|
63
|
+
{ "type": @discriminant, "value": @member }.to_json
|
64
|
+
when "composite_codes"
|
65
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
66
|
+
else
|
67
|
+
{ "type": @discriminant, value: @member }.to_json
|
68
|
+
end
|
69
|
+
@member.to_json
|
70
|
+
end
|
71
|
+
|
72
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
73
|
+
# hash and check each fields type against the current object's property
|
74
|
+
# definitions.
|
75
|
+
#
|
76
|
+
# @param obj [Object]
|
77
|
+
# @return [Void]
|
78
|
+
def self.validate_raw(obj:)
|
79
|
+
case obj.type
|
80
|
+
when "raw_code"
|
81
|
+
obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
82
|
+
when "composite_codes"
|
83
|
+
CandidApiClient::X12::V1::Types::TypeOfBillCompositeBase.validate_raw(obj: obj)
|
84
|
+
else
|
85
|
+
raise("Passed value matched no type within the union, validation failed.")
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# For Union Types, is_a? functionality is delegated to the wrapped member.
|
90
|
+
#
|
91
|
+
# @param obj [Object]
|
92
|
+
# @return [Boolean]
|
93
|
+
def is_a?(obj)
|
94
|
+
@member.is_a?(obj)
|
95
|
+
end
|
96
|
+
|
97
|
+
# @param member [String]
|
98
|
+
# @return [CandidApiClient::X12::V1::Types::TypeOfBillCompositeUpdate]
|
99
|
+
def self.raw_code(member:)
|
100
|
+
new(member: member, discriminant: "raw_code")
|
101
|
+
end
|
102
|
+
|
103
|
+
# @param member [CandidApiClient::X12::V1::Types::TypeOfBillCompositeBase]
|
104
|
+
# @return [CandidApiClient::X12::V1::Types::TypeOfBillCompositeUpdate]
|
105
|
+
def self.composite_codes(member:)
|
106
|
+
new(member: member, discriminant: "composite_codes")
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
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.
|
48
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "1.8.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.
|
93
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "1.8.0" }
|
94
94
|
headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless token.nil?
|
95
95
|
headers
|
96
96
|
end
|