candidhealth 1.0.0 → 1.3.1

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 (66) 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 +532 -484
  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/next_responsible_party.rb +16 -0
  16. data/lib/candidhealth/commons/types/phone_number_optional.rb +71 -0
  17. data/lib/candidhealth/commons/types/procedure_modifier.rb +2 -0
  18. data/lib/candidhealth/commons/types/street_address_long_zip_optional.rb +107 -0
  19. data/lib/candidhealth/contracts/v_2/client.rb +4 -4
  20. data/lib/candidhealth/custom_schemas/v_1/types/schema_instance_optional.rb +78 -0
  21. data/lib/candidhealth/diagnoses/client.rb +23 -4
  22. data/lib/candidhealth/diagnoses/types/diagnosis.rb +21 -2
  23. data/lib/candidhealth/diagnoses/types/diagnosis_create.rb +25 -2
  24. data/lib/candidhealth/diagnoses/types/diagnosis_create_optional.rb +126 -0
  25. data/lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb +22 -2
  26. data/lib/candidhealth/encounter_providers/v_2/types/ordering_provider_optional.rb +123 -0
  27. data/lib/candidhealth/encounters/v_4/client.rb +216 -208
  28. data/lib/candidhealth/encounters/v_4/types/claim_supplemental_information_optional.rb +86 -0
  29. data/lib/candidhealth/encounters/v_4/types/clinical_note_category_create_optional.rb +78 -0
  30. data/lib/candidhealth/encounters/v_4/types/clinical_note_optional.rb +93 -0
  31. data/lib/candidhealth/encounters/v_4/types/encounter.rb +27 -4
  32. data/lib/candidhealth/encounters/v_4/types/encounter_create_from_pre_encounter.rb +4 -2
  33. data/lib/candidhealth/encounters/v_4/types/encounter_deep_optional.rb +780 -0
  34. data/lib/candidhealth/encounters/v_4/types/encounter_optional.rb +1 -139
  35. data/lib/candidhealth/encounters/v_4/types/epsdt_referral_optional.rb +85 -0
  36. data/lib/candidhealth/encounters/v_4/types/intake_question_optional.rb +84 -0
  37. data/lib/candidhealth/encounters/v_4/types/intervention_optional.rb +114 -0
  38. data/lib/candidhealth/encounters/v_4/types/lab_optional.rb +80 -0
  39. data/lib/candidhealth/encounters/v_4/types/medication_optional.rb +108 -0
  40. data/lib/candidhealth/encounters/v_4/types/patient_history_category_optional.rb +78 -0
  41. data/lib/candidhealth/guarantor/v_1/types/guarantor_optional.rb +144 -0
  42. data/lib/candidhealth/individual/types/individual_base_optional.rb +78 -0
  43. data/lib/candidhealth/individual/types/patient_non_insurance_payer_info_create_optional.rb +89 -0
  44. data/lib/candidhealth/individual/types/patient_update_with_optional_address.rb +8 -8
  45. data/lib/candidhealth/individual/types/subscriber_base_optional.rb +118 -0
  46. data/lib/candidhealth/individual/types/subscriber_create_optional.rb +132 -0
  47. data/lib/candidhealth/insurance_adjudications/v_1/client.rb +2 -0
  48. data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb +9 -1
  49. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_create_optional.rb +167 -0
  50. data/lib/candidhealth/organization_providers/v_2/types/license_type.rb +1 -0
  51. data/lib/candidhealth/pre_encounter/patients/v_1/types/authorization.rb +13 -1
  52. data/lib/candidhealth/service_lines/v_2/client.rb +4 -0
  53. data/lib/candidhealth/service_lines/v_2/types/drug_identification_optional.rb +126 -0
  54. data/lib/candidhealth/service_lines/v_2/types/service_line.rb +10 -2
  55. data/lib/candidhealth/service_lines/v_2/types/service_line_create.rb +10 -2
  56. data/lib/candidhealth/service_lines/v_2/types/service_line_create_optional.rb +247 -0
  57. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb +10 -2
  58. data/lib/candidhealth/service_lines/v_2/types/service_line_update.rb +10 -2
  59. data/lib/candidhealth/service_lines/v_2/types/test_result_optional.rb +73 -0
  60. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_reason.rb +1 -0
  61. data/lib/candidhealth/write_offs/v_1/types/patient_write_off_reason.rb +1 -0
  62. data/lib/candidhealth/yes_no_indicator/types/yes_no_indicator.rb +14 -0
  63. data/lib/core/oauth.rb +2 -2
  64. data/lib/requests.rb +2 -2
  65. data/lib/types_export.rb +33 -3
  66. metadata +35 -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
@@ -112,6 +112,8 @@ module CandidApiClient
112
112
  # If the value is true, the box will be populated with "Y". Otherwise, the box
113
113
  # will not be populated.
114
114
  attr_reader :has_family_planning_indicator
115
+ # @return [String] Maps to NTE02 loop 2400 on the EDI 837.
116
+ attr_reader :note
115
117
  # @return [OpenStruct] Additional properties unmapped to the current class definition
116
118
  attr_reader :additional_properties
117
119
  # @return [Object]
@@ -172,10 +174,11 @@ module CandidApiClient
172
174
  # @param has_family_planning_indicator [Boolean] Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500.
173
175
  # If the value is true, the box will be populated with "Y". Otherwise, the box
174
176
  # will not be populated.
177
+ # @param note [String] Maps to NTE02 loop 2400 on the EDI 837.
175
178
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
176
179
  # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLine]
177
180
  def initialize(created_at:, service_line_id:, procedure_code:, quantity:, units:, claim_id:, date_of_service_range:, date_of_service:, modifiers: OMIT, charge_amount_cents: OMIT, allowed_amount_cents: OMIT,
178
- insurance_balance_cents: OMIT, patient_balance_cents: OMIT, paid_amount_cents: OMIT, primary_paid_amount_cents: OMIT, secondary_paid_amount_cents: OMIT, tertiary_paid_amount_cents: OMIT, patient_responsibility_cents: OMIT, copay_cents: OMIT, coinsurance_cents: OMIT, deductible_cents: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, drug_identification: OMIT, service_line_era_data: OMIT, service_line_manual_adjustments: OMIT, related_invoices: OMIT, related_invoice_info: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, ordering_provider: OMIT, description: OMIT, end_date_of_service: OMIT, test_results: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, additional_properties: nil)
181
+ insurance_balance_cents: OMIT, patient_balance_cents: OMIT, paid_amount_cents: OMIT, primary_paid_amount_cents: OMIT, secondary_paid_amount_cents: OMIT, tertiary_paid_amount_cents: OMIT, patient_responsibility_cents: OMIT, copay_cents: OMIT, coinsurance_cents: OMIT, deductible_cents: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, drug_identification: OMIT, service_line_era_data: OMIT, service_line_manual_adjustments: OMIT, related_invoices: OMIT, related_invoice_info: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, ordering_provider: OMIT, description: OMIT, end_date_of_service: OMIT, test_results: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, note: OMIT, additional_properties: nil)
179
182
  @created_at = created_at
180
183
  @modifiers = modifiers if modifiers != OMIT
181
184
  @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
@@ -219,6 +222,7 @@ module CandidApiClient
219
222
  @test_results = test_results if test_results != OMIT
220
223
  @has_epsdt_indicator = has_epsdt_indicator if has_epsdt_indicator != OMIT
221
224
  @has_family_planning_indicator = has_family_planning_indicator if has_family_planning_indicator != OMIT
225
+ @note = note if note != OMIT
222
226
  @additional_properties = additional_properties
223
227
  @_field_set = {
224
228
  "created_at": created_at,
@@ -259,7 +263,8 @@ module CandidApiClient
259
263
  "end_date_of_service": end_date_of_service,
260
264
  "test_results": test_results,
261
265
  "has_epsdt_indicator": has_epsdt_indicator,
262
- "has_family_planning_indicator": has_family_planning_indicator
266
+ "has_family_planning_indicator": has_family_planning_indicator,
267
+ "note": note
263
268
  }.reject do |_k, v|
264
269
  v == OMIT
265
270
  end
@@ -350,6 +355,7 @@ module CandidApiClient
350
355
  end
351
356
  has_epsdt_indicator = struct["has_epsdt_indicator"]
352
357
  has_family_planning_indicator = struct["has_family_planning_indicator"]
358
+ note = struct["note"]
353
359
  new(
354
360
  created_at: created_at,
355
361
  modifiers: modifiers,
@@ -390,6 +396,7 @@ module CandidApiClient
390
396
  test_results: test_results,
391
397
  has_epsdt_indicator: has_epsdt_indicator,
392
398
  has_family_planning_indicator: has_family_planning_indicator,
399
+ note: note,
393
400
  additional_properties: struct
394
401
  )
395
402
  end
@@ -447,6 +454,7 @@ module CandidApiClient
447
454
  obj.test_results&.is_a?(Array) != false || raise("Passed value for field obj.test_results is not the expected type, validation failed.")
448
455
  obj.has_epsdt_indicator&.is_a?(Boolean) != false || raise("Passed value for field obj.has_epsdt_indicator is not the expected type, validation failed.")
449
456
  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.")
457
+ obj.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.")
450
458
  end
451
459
  end
452
460
  end
@@ -63,6 +63,8 @@ module CandidApiClient
63
63
  # 837-P (ex: Hemoglobin, Hematocrit).
64
64
  # No more than 5 MEA-02 test results may be submitted per service line.
65
65
  attr_reader :test_results
66
+ # @return [String] Maps to NTE02 loop 2400 on the EDI 837.
67
+ attr_reader :note
66
68
  # @return [OpenStruct] Additional properties unmapped to the current class definition
67
69
  attr_reader :additional_properties
68
70
  # @return [Object]
@@ -104,10 +106,11 @@ module CandidApiClient
104
106
  # @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
105
107
  # 837-P (ex: Hemoglobin, Hematocrit).
106
108
  # No more than 5 MEA-02 test results may be submitted per service line.
109
+ # @param note [String] Maps to NTE02 loop 2400 on the EDI 837.
107
110
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
108
111
  # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineCreate]
109
112
  def initialize(procedure_code:, quantity:, units:, diagnosis_pointers:, modifiers: OMIT,
110
- has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, charge_amount_cents: 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)
113
+ has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, charge_amount_cents: 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, note: OMIT, additional_properties: nil)
111
114
  @modifiers = modifiers if modifiers != OMIT
112
115
  @has_epsdt_indicator = has_epsdt_indicator if has_epsdt_indicator != OMIT
113
116
  @has_family_planning_indicator = has_family_planning_indicator if has_family_planning_indicator != OMIT
@@ -123,6 +126,7 @@ module CandidApiClient
123
126
  @end_date_of_service = end_date_of_service if end_date_of_service != OMIT
124
127
  @ordering_provider = ordering_provider if ordering_provider != OMIT
125
128
  @test_results = test_results if test_results != OMIT
129
+ @note = note if note != OMIT
126
130
  @additional_properties = additional_properties
127
131
  @_field_set = {
128
132
  "modifiers": modifiers,
@@ -139,7 +143,8 @@ module CandidApiClient
139
143
  "date_of_service": date_of_service,
140
144
  "end_date_of_service": end_date_of_service,
141
145
  "ordering_provider": ordering_provider,
142
- "test_results": test_results
146
+ "test_results": test_results,
147
+ "note": note
143
148
  }.reject do |_k, v|
144
149
  v == OMIT
145
150
  end
@@ -182,6 +187,7 @@ module CandidApiClient
182
187
  item = item.to_json
183
188
  CandidApiClient::ServiceLines::V2::Types::TestResult.from_json(json_object: item)
184
189
  end
190
+ note = struct["note"]
185
191
  new(
186
192
  modifiers: modifiers,
187
193
  has_epsdt_indicator: has_epsdt_indicator,
@@ -198,6 +204,7 @@ module CandidApiClient
198
204
  end_date_of_service: end_date_of_service,
199
205
  ordering_provider: ordering_provider,
200
206
  test_results: test_results,
207
+ note: note,
201
208
  additional_properties: struct
202
209
  )
203
210
  end
@@ -231,6 +238,7 @@ module CandidApiClient
231
238
  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
239
  obj.ordering_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::OrderingProvider.validate_raw(obj: obj.ordering_provider)
233
240
  obj.test_results&.is_a?(Array) != false || raise("Passed value for field obj.test_results is not the expected type, validation failed.")
241
+ obj.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.")
234
242
  end
235
243
  end
236
244
  end
@@ -0,0 +1,247 @@
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 [String] Maps to NTE02 loop 2400 on the EDI 837.
67
+ attr_reader :note
68
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
69
+ attr_reader :additional_properties
70
+ # @return [Object]
71
+ attr_reader :_field_set
72
+ protected :_field_set
73
+
74
+ OMIT = Object.new
75
+
76
+ # @param modifiers [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
77
+ # @param has_epsdt_indicator [Boolean] Maps to SV1-11 on the 837-P and Box 24H on the CMS-1500.
78
+ # If the value is true, the box will be populated with "Y". Otherwise, the box
79
+ # will not be populated.
80
+ # @param has_family_planning_indicator [Boolean] Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500.
81
+ # If the value is true, the box will be populated with "Y". Otherwise, the box
82
+ # will not be populated.
83
+ # @param procedure_code [String]
84
+ # @param quantity [String] String representation of a Decimal that can be parsed by most libraries.
85
+ # A ServiceLine quantity cannot contain more than one digit of precision.
86
+ # Example: 1.1 is valid, 1.11 is not.
87
+ # @param units [CandidApiClient::Commons::Types::ServiceLineUnits]
88
+ # @param charge_amount_cents [Integer] The total amount charged for this service line taking quantity into account. For
89
+ # example, if a single unit
90
+ # costs 100 cents and 2 units were rendered, the `charge_amount_cents` should be
91
+ # 200. Should be greater than or
92
+ # equal to 0.
93
+ # @param diagnosis_pointers [Array<Integer>] Indices (zero-indexed) of all the diagnoses this service line references
94
+ # @param drug_identification [CandidApiClient::ServiceLines::V2::Types::DrugIdentificationOptional]
95
+ # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] 837p Loop2300, SV105. If your organization does not intend to submit claims with
96
+ # a different place of service at the service line level, this field should not be
97
+ # populated. 02 for telemedicine, 11 for in-person. Full list
98
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
99
+ # @param description [String] A free-form description to clarify the related data elements and their content.
100
+ # Maps to SV1-01, C003-07 on the 837-P.
101
+ # @param date_of_service [Date]
102
+ # @param end_date_of_service [Date]
103
+ # @param ordering_provider [CandidApiClient::EncounterProviders::V2::Types::OrderingProviderOptional] Required when the service or supply was ordered by a provider who is different
104
+ # than the rendering provider for this service line.
105
+ # If not required by this implementation guide, do not send.
106
+ # @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
107
+ # 837-P (ex: Hemoglobin, Hematocrit).
108
+ # No more than 5 MEA-02 test results may be submitted per service line.
109
+ # @param note [String] Maps to NTE02 loop 2400 on the EDI 837.
110
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
111
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateOptional]
112
+ def initialize(modifiers: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT,
113
+ 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, note: OMIT, additional_properties: nil)
114
+ @modifiers = modifiers if modifiers != OMIT
115
+ @has_epsdt_indicator = has_epsdt_indicator if has_epsdt_indicator != OMIT
116
+ @has_family_planning_indicator = has_family_planning_indicator if has_family_planning_indicator != OMIT
117
+ @procedure_code = procedure_code if procedure_code != OMIT
118
+ @quantity = quantity if quantity != OMIT
119
+ @units = units if units != OMIT
120
+ @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
121
+ @diagnosis_pointers = diagnosis_pointers if diagnosis_pointers != OMIT
122
+ @drug_identification = drug_identification if drug_identification != OMIT
123
+ @place_of_service_code = place_of_service_code if place_of_service_code != OMIT
124
+ @description = description if description != OMIT
125
+ @date_of_service = date_of_service if date_of_service != OMIT
126
+ @end_date_of_service = end_date_of_service if end_date_of_service != OMIT
127
+ @ordering_provider = ordering_provider if ordering_provider != OMIT
128
+ @test_results = test_results if test_results != OMIT
129
+ @note = note if note != OMIT
130
+ @additional_properties = additional_properties
131
+ @_field_set = {
132
+ "modifiers": modifiers,
133
+ "has_epsdt_indicator": has_epsdt_indicator,
134
+ "has_family_planning_indicator": has_family_planning_indicator,
135
+ "procedure_code": procedure_code,
136
+ "quantity": quantity,
137
+ "units": units,
138
+ "charge_amount_cents": charge_amount_cents,
139
+ "diagnosis_pointers": diagnosis_pointers,
140
+ "drug_identification": drug_identification,
141
+ "place_of_service_code": place_of_service_code,
142
+ "description": description,
143
+ "date_of_service": date_of_service,
144
+ "end_date_of_service": end_date_of_service,
145
+ "ordering_provider": ordering_provider,
146
+ "test_results": test_results,
147
+ "note": note
148
+ }.reject do |_k, v|
149
+ v == OMIT
150
+ end
151
+ end
152
+
153
+ # Deserialize a JSON object to an instance of ServiceLineCreateOptional
154
+ #
155
+ # @param json_object [String]
156
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateOptional]
157
+ def self.from_json(json_object:)
158
+ struct = JSON.parse(json_object, object_class: OpenStruct)
159
+ parsed_json = JSON.parse(json_object)
160
+ modifiers = struct["modifiers"]
161
+ has_epsdt_indicator = struct["has_epsdt_indicator"]
162
+ has_family_planning_indicator = struct["has_family_planning_indicator"]
163
+ procedure_code = struct["procedure_code"]
164
+ quantity = struct["quantity"]
165
+ units = struct["units"]
166
+ charge_amount_cents = struct["charge_amount_cents"]
167
+ diagnosis_pointers = struct["diagnosis_pointers"]
168
+ if parsed_json["drug_identification"].nil?
169
+ drug_identification = nil
170
+ else
171
+ drug_identification = parsed_json["drug_identification"].to_json
172
+ drug_identification = CandidApiClient::ServiceLines::V2::Types::DrugIdentificationOptional.from_json(json_object: drug_identification)
173
+ end
174
+ place_of_service_code = struct["place_of_service_code"]
175
+ description = struct["description"]
176
+ date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
177
+ end_date_of_service = unless parsed_json["end_date_of_service"].nil?
178
+ Date.parse(parsed_json["end_date_of_service"])
179
+ end
180
+ if parsed_json["ordering_provider"].nil?
181
+ ordering_provider = nil
182
+ else
183
+ ordering_provider = parsed_json["ordering_provider"].to_json
184
+ ordering_provider = CandidApiClient::EncounterProviders::V2::Types::OrderingProviderOptional.from_json(json_object: ordering_provider)
185
+ end
186
+ test_results = parsed_json["test_results"]&.map do |item|
187
+ item = item.to_json
188
+ CandidApiClient::ServiceLines::V2::Types::TestResultOptional.from_json(json_object: item)
189
+ end
190
+ note = struct["note"]
191
+ new(
192
+ modifiers: modifiers,
193
+ has_epsdt_indicator: has_epsdt_indicator,
194
+ has_family_planning_indicator: has_family_planning_indicator,
195
+ procedure_code: procedure_code,
196
+ quantity: quantity,
197
+ units: units,
198
+ charge_amount_cents: charge_amount_cents,
199
+ diagnosis_pointers: diagnosis_pointers,
200
+ drug_identification: drug_identification,
201
+ place_of_service_code: place_of_service_code,
202
+ description: description,
203
+ date_of_service: date_of_service,
204
+ end_date_of_service: end_date_of_service,
205
+ ordering_provider: ordering_provider,
206
+ test_results: test_results,
207
+ note: note,
208
+ additional_properties: struct
209
+ )
210
+ end
211
+
212
+ # Serialize an instance of ServiceLineCreateOptional to a JSON object
213
+ #
214
+ # @return [String]
215
+ def to_json(*_args)
216
+ @_field_set&.to_json
217
+ end
218
+
219
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
220
+ # hash and check each fields type against the current object's property
221
+ # definitions.
222
+ #
223
+ # @param obj [Object]
224
+ # @return [Void]
225
+ def self.validate_raw(obj:)
226
+ obj.modifiers&.is_a?(Array) != false || raise("Passed value for field obj.modifiers is not the expected type, validation failed.")
227
+ obj.has_epsdt_indicator&.is_a?(Boolean) != false || raise("Passed value for field obj.has_epsdt_indicator is not the expected type, validation failed.")
228
+ 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.")
229
+ obj.procedure_code&.is_a?(String) != false || raise("Passed value for field obj.procedure_code is not the expected type, validation failed.")
230
+ obj.quantity&.is_a?(String) != false || raise("Passed value for field obj.quantity is not the expected type, validation failed.")
231
+ obj.units&.is_a?(CandidApiClient::Commons::Types::ServiceLineUnits) != false || raise("Passed value for field obj.units is not the expected type, validation failed.")
232
+ obj.charge_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.charge_amount_cents is not the expected type, validation failed.")
233
+ obj.diagnosis_pointers&.is_a?(Array) != false || raise("Passed value for field obj.diagnosis_pointers is not the expected type, validation failed.")
234
+ obj.drug_identification.nil? || CandidApiClient::ServiceLines::V2::Types::DrugIdentificationOptional.validate_raw(obj: obj.drug_identification)
235
+ 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.")
236
+ obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
237
+ obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
238
+ 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.")
239
+ obj.ordering_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::OrderingProviderOptional.validate_raw(obj: obj.ordering_provider)
240
+ obj.test_results&.is_a?(Array) != false || raise("Passed value for field obj.test_results is not the expected type, validation failed.")
241
+ obj.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.")
242
+ end
243
+ end
244
+ end
245
+ end
246
+ end
247
+ end
@@ -74,6 +74,8 @@ module CandidApiClient
74
74
  # If the value is true, the box will be populated with "Y". Otherwise, the box
75
75
  # will not be populated.
76
76
  attr_reader :has_family_planning_indicator
77
+ # @return [String] Maps to NTE02 loop 2400 on the EDI 837.
78
+ attr_reader :note
77
79
  # @return [OpenStruct] Additional properties unmapped to the current class definition
78
80
  attr_reader :additional_properties
79
81
  # @return [Object]
@@ -120,10 +122,11 @@ module CandidApiClient
120
122
  # @param has_family_planning_indicator [Boolean] Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500.
121
123
  # If the value is true, the box will be populated with "Y". Otherwise, the box
122
124
  # will not be populated.
125
+ # @param note [String] Maps to NTE02 loop 2400 on the EDI 837.
123
126
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
124
127
  # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateStandalone]
125
128
  def initialize(procedure_code:, quantity:, units:, claim_id:, modifiers: OMIT, charge_amount_cents: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT,
126
- diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, drug_identification: OMIT, ordering_provider: OMIT, test_results: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, additional_properties: nil)
129
+ diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, drug_identification: OMIT, ordering_provider: OMIT, test_results: OMIT, has_epsdt_indicator: OMIT, has_family_planning_indicator: OMIT, note: OMIT, additional_properties: nil)
127
130
  @modifiers = modifiers if modifiers != OMIT
128
131
  @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
129
132
  @diagnosis_id_zero = diagnosis_id_zero if diagnosis_id_zero != OMIT
@@ -144,6 +147,7 @@ module CandidApiClient
144
147
  @test_results = test_results if test_results != OMIT
145
148
  @has_epsdt_indicator = has_epsdt_indicator if has_epsdt_indicator != OMIT
146
149
  @has_family_planning_indicator = has_family_planning_indicator if has_family_planning_indicator != OMIT
150
+ @note = note if note != OMIT
147
151
  @additional_properties = additional_properties
148
152
  @_field_set = {
149
153
  "modifiers": modifiers,
@@ -165,7 +169,8 @@ module CandidApiClient
165
169
  "ordering_provider": ordering_provider,
166
170
  "test_results": test_results,
167
171
  "has_epsdt_indicator": has_epsdt_indicator,
168
- "has_family_planning_indicator": has_family_planning_indicator
172
+ "has_family_planning_indicator": has_family_planning_indicator,
173
+ "note": note
169
174
  }.reject do |_k, v|
170
175
  v == OMIT
171
176
  end
@@ -218,6 +223,7 @@ module CandidApiClient
218
223
  end
219
224
  has_epsdt_indicator = struct["has_epsdt_indicator"]
220
225
  has_family_planning_indicator = struct["has_family_planning_indicator"]
226
+ note = struct["note"]
221
227
  new(
222
228
  modifiers: modifiers,
223
229
  charge_amount_cents: charge_amount_cents,
@@ -239,6 +245,7 @@ module CandidApiClient
239
245
  test_results: test_results,
240
246
  has_epsdt_indicator: has_epsdt_indicator,
241
247
  has_family_planning_indicator: has_family_planning_indicator,
248
+ note: note,
242
249
  additional_properties: struct
243
250
  )
244
251
  end
@@ -277,6 +284,7 @@ module CandidApiClient
277
284
  obj.test_results&.is_a?(Array) != false || raise("Passed value for field obj.test_results is not the expected type, validation failed.")
278
285
  obj.has_epsdt_indicator&.is_a?(Boolean) != false || raise("Passed value for field obj.has_epsdt_indicator is not the expected type, validation failed.")
279
286
  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.")
287
+ obj.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.")
280
288
  end
281
289
  end
282
290
  end
@@ -74,6 +74,8 @@ module CandidApiClient
74
74
  # If the value is true, the box will be populated with "Y". Otherwise, the box
75
75
  # will not be populated.
76
76
  attr_reader :has_family_planning_indicator
77
+ # @return [String] Maps to NTE02 loop 2400 on the EDI 837.
78
+ attr_reader :note
77
79
  # @return [OpenStruct] Additional properties unmapped to the current class definition
78
80
  attr_reader :additional_properties
79
81
  # @return [Object]
@@ -122,10 +124,11 @@ module CandidApiClient
122
124
  # @param has_family_planning_indicator [Boolean] Maps to SV1-12 on the 837-P and Box 24I on the CMS-1500.
123
125
  # If the value is true, the box will be populated with "Y". Otherwise, the box
124
126
  # will not be populated.
127
+ # @param note [String] Maps to NTE02 loop 2400 on the EDI 837.
125
128
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
126
129
  # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate]
127
130
  def initialize(edit_reason: OMIT, modifiers: OMIT, charge_amount_cents: OMIT, diagnosis_id_zero: OMIT,
128
- diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: 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, additional_properties: nil)
131
+ diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: 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)
129
132
  @edit_reason = edit_reason if edit_reason != OMIT
130
133
  @modifiers = modifiers if modifiers != OMIT
131
134
  @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
@@ -145,6 +148,7 @@ module CandidApiClient
145
148
  @test_results = test_results if test_results != OMIT
146
149
  @has_epsdt_indicator = has_epsdt_indicator if has_epsdt_indicator != OMIT
147
150
  @has_family_planning_indicator = has_family_planning_indicator if has_family_planning_indicator != OMIT
151
+ @note = note if note != OMIT
148
152
  @additional_properties = additional_properties
149
153
  @_field_set = {
150
154
  "edit_reason": edit_reason,
@@ -165,7 +169,8 @@ module CandidApiClient
165
169
  "end_date_of_service": end_date_of_service,
166
170
  "test_results": test_results,
167
171
  "has_epsdt_indicator": has_epsdt_indicator,
168
- "has_family_planning_indicator": has_family_planning_indicator
172
+ "has_family_planning_indicator": has_family_planning_indicator,
173
+ "note": note
169
174
  }.reject do |_k, v|
170
175
  v == OMIT
171
176
  end
@@ -212,6 +217,7 @@ module CandidApiClient
212
217
  end
213
218
  has_epsdt_indicator = struct["has_epsdt_indicator"]
214
219
  has_family_planning_indicator = struct["has_family_planning_indicator"]
220
+ note = struct["note"]
215
221
  new(
216
222
  edit_reason: edit_reason,
217
223
  modifiers: modifiers,
@@ -232,6 +238,7 @@ module CandidApiClient
232
238
  test_results: test_results,
233
239
  has_epsdt_indicator: has_epsdt_indicator,
234
240
  has_family_planning_indicator: has_family_planning_indicator,
241
+ note: note,
235
242
  additional_properties: struct
236
243
  )
237
244
  end
@@ -269,6 +276,7 @@ module CandidApiClient
269
276
  obj.test_results&.is_a?(Array) != false || raise("Passed value for field obj.test_results is not the expected type, validation failed.")
270
277
  obj.has_epsdt_indicator&.is_a?(Boolean) != false || raise("Passed value for field obj.has_epsdt_indicator is not the expected type, validation failed.")
271
278
  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.")
279
+ obj.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.")
272
280
  end
273
281
  end
274
282
  end