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,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lab_code_type"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module Encounters
9
+ module V4
10
+ module Types
11
+ class LabOptional
12
+ # @return [String]
13
+ attr_reader :name
14
+ # @return [String]
15
+ attr_reader :code
16
+ # @return [CandidApiClient::Encounters::V4::Types::LabCodeType]
17
+ attr_reader :code_type
18
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
19
+ attr_reader :additional_properties
20
+ # @return [Object]
21
+ attr_reader :_field_set
22
+ protected :_field_set
23
+
24
+ OMIT = Object.new
25
+
26
+ # @param name [String]
27
+ # @param code [String]
28
+ # @param code_type [CandidApiClient::Encounters::V4::Types::LabCodeType]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [CandidApiClient::Encounters::V4::Types::LabOptional]
31
+ def initialize(name: OMIT, code: OMIT, code_type: OMIT, additional_properties: nil)
32
+ @name = name if name != OMIT
33
+ @code = code if code != OMIT
34
+ @code_type = code_type if code_type != OMIT
35
+ @additional_properties = additional_properties
36
+ @_field_set = { "name": name, "code": code, "code_type": code_type }.reject do |_k, v|
37
+ v == OMIT
38
+ end
39
+ end
40
+
41
+ # Deserialize a JSON object to an instance of LabOptional
42
+ #
43
+ # @param json_object [String]
44
+ # @return [CandidApiClient::Encounters::V4::Types::LabOptional]
45
+ def self.from_json(json_object:)
46
+ struct = JSON.parse(json_object, object_class: OpenStruct)
47
+ name = struct["name"]
48
+ code = struct["code"]
49
+ code_type = struct["code_type"]
50
+ new(
51
+ name: name,
52
+ code: code,
53
+ code_type: code_type,
54
+ additional_properties: struct
55
+ )
56
+ end
57
+
58
+ # Serialize an instance of LabOptional to a JSON object
59
+ #
60
+ # @return [String]
61
+ def to_json(*_args)
62
+ @_field_set&.to_json
63
+ end
64
+
65
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
66
+ # hash and check each fields type against the current object's property
67
+ # definitions.
68
+ #
69
+ # @param obj [Object]
70
+ # @return [Void]
71
+ def self.validate_raw(obj:)
72
+ obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
73
+ obj.code&.is_a?(String) != false || raise("Passed value for field obj.code is not the expected type, validation failed.")
74
+ obj.code_type&.is_a?(CandidApiClient::Encounters::V4::Types::LabCodeType) != false || raise("Passed value for field obj.code_type is not the expected type, validation failed.")
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,108 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module CandidApiClient
7
+ module Encounters
8
+ module V4
9
+ module Types
10
+ class MedicationOptional
11
+ # @return [String]
12
+ attr_reader :name
13
+ # @return [String]
14
+ attr_reader :rx_cui
15
+ # @return [String]
16
+ attr_reader :dosage
17
+ # @return [String]
18
+ attr_reader :dosage_form
19
+ # @return [String]
20
+ attr_reader :frequency
21
+ # @return [Boolean]
22
+ attr_reader :as_needed
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 name [String]
32
+ # @param rx_cui [String]
33
+ # @param dosage [String]
34
+ # @param dosage_form [String]
35
+ # @param frequency [String]
36
+ # @param as_needed [Boolean]
37
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
38
+ # @return [CandidApiClient::Encounters::V4::Types::MedicationOptional]
39
+ def initialize(name: OMIT, rx_cui: OMIT, dosage: OMIT, dosage_form: OMIT, frequency: OMIT, as_needed: OMIT,
40
+ additional_properties: nil)
41
+ @name = name if name != OMIT
42
+ @rx_cui = rx_cui if rx_cui != OMIT
43
+ @dosage = dosage if dosage != OMIT
44
+ @dosage_form = dosage_form if dosage_form != OMIT
45
+ @frequency = frequency if frequency != OMIT
46
+ @as_needed = as_needed if as_needed != OMIT
47
+ @additional_properties = additional_properties
48
+ @_field_set = {
49
+ "name": name,
50
+ "rx_cui": rx_cui,
51
+ "dosage": dosage,
52
+ "dosage_form": dosage_form,
53
+ "frequency": frequency,
54
+ "as_needed": as_needed
55
+ }.reject do |_k, v|
56
+ v == OMIT
57
+ end
58
+ end
59
+
60
+ # Deserialize a JSON object to an instance of MedicationOptional
61
+ #
62
+ # @param json_object [String]
63
+ # @return [CandidApiClient::Encounters::V4::Types::MedicationOptional]
64
+ def self.from_json(json_object:)
65
+ struct = JSON.parse(json_object, object_class: OpenStruct)
66
+ name = struct["name"]
67
+ rx_cui = struct["rx_cui"]
68
+ dosage = struct["dosage"]
69
+ dosage_form = struct["dosage_form"]
70
+ frequency = struct["frequency"]
71
+ as_needed = struct["as_needed"]
72
+ new(
73
+ name: name,
74
+ rx_cui: rx_cui,
75
+ dosage: dosage,
76
+ dosage_form: dosage_form,
77
+ frequency: frequency,
78
+ as_needed: as_needed,
79
+ additional_properties: struct
80
+ )
81
+ end
82
+
83
+ # Serialize an instance of MedicationOptional to a JSON object
84
+ #
85
+ # @return [String]
86
+ def to_json(*_args)
87
+ @_field_set&.to_json
88
+ end
89
+
90
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
91
+ # hash and check each fields type against the current object's property
92
+ # definitions.
93
+ #
94
+ # @param obj [Object]
95
+ # @return [Void]
96
+ def self.validate_raw(obj:)
97
+ obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
98
+ obj.rx_cui&.is_a?(String) != false || raise("Passed value for field obj.rx_cui is not the expected type, validation failed.")
99
+ obj.dosage&.is_a?(String) != false || raise("Passed value for field obj.dosage is not the expected type, validation failed.")
100
+ obj.dosage_form&.is_a?(String) != false || raise("Passed value for field obj.dosage_form is not the expected type, validation failed.")
101
+ obj.frequency&.is_a?(String) != false || raise("Passed value for field obj.frequency is not the expected type, validation failed.")
102
+ obj.as_needed&.is_a?(Boolean) != false || raise("Passed value for field obj.as_needed is not the expected type, validation failed.")
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "patient_history_category_enum"
4
+ require_relative "intake_question_optional"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module CandidApiClient
9
+ module Encounters
10
+ module V4
11
+ module Types
12
+ class PatientHistoryCategoryOptional
13
+ # @return [CandidApiClient::Encounters::V4::Types::PatientHistoryCategoryEnum]
14
+ attr_reader :category
15
+ # @return [Array<CandidApiClient::Encounters::V4::Types::IntakeQuestionOptional>] Must contain at least one item.
16
+ attr_reader :questions
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param category [CandidApiClient::Encounters::V4::Types::PatientHistoryCategoryEnum]
26
+ # @param questions [Array<CandidApiClient::Encounters::V4::Types::IntakeQuestionOptional>] Must contain at least one item.
27
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
28
+ # @return [CandidApiClient::Encounters::V4::Types::PatientHistoryCategoryOptional]
29
+ def initialize(category: OMIT, questions: OMIT, additional_properties: nil)
30
+ @category = category if category != OMIT
31
+ @questions = questions if questions != OMIT
32
+ @additional_properties = additional_properties
33
+ @_field_set = { "category": category, "questions": questions }.reject do |_k, v|
34
+ v == OMIT
35
+ end
36
+ end
37
+
38
+ # Deserialize a JSON object to an instance of PatientHistoryCategoryOptional
39
+ #
40
+ # @param json_object [String]
41
+ # @return [CandidApiClient::Encounters::V4::Types::PatientHistoryCategoryOptional]
42
+ def self.from_json(json_object:)
43
+ struct = JSON.parse(json_object, object_class: OpenStruct)
44
+ parsed_json = JSON.parse(json_object)
45
+ category = struct["category"]
46
+ questions = parsed_json["questions"]&.map do |item|
47
+ item = item.to_json
48
+ CandidApiClient::Encounters::V4::Types::IntakeQuestionOptional.from_json(json_object: item)
49
+ end
50
+ new(
51
+ category: category,
52
+ questions: questions,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+
57
+ # Serialize an instance of PatientHistoryCategoryOptional to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json(*_args)
61
+ @_field_set&.to_json
62
+ end
63
+
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.category&.is_a?(CandidApiClient::Encounters::V4::Types::PatientHistoryCategoryEnum) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
72
+ obj.questions&.is_a?(Array) != false || raise("Passed value for field obj.questions is not the expected type, validation failed.")
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,144 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require_relative "../../../commons/types/street_address_short_zip_optional"
5
+ require_relative "../../../commons/types/phone_number_optional"
6
+ require "ostruct"
7
+ require "json"
8
+
9
+ module CandidApiClient
10
+ module Guarantor
11
+ module V1
12
+ module Types
13
+ class GuarantorOptional
14
+ # @return [String]
15
+ attr_reader :first_name
16
+ # @return [String]
17
+ attr_reader :last_name
18
+ # @return [String] A unique identifier for the guarantor assigned by an external system.
19
+ attr_reader :external_id
20
+ # @return [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
21
+ attr_reader :date_of_birth
22
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
23
+ attr_reader :address
24
+ # @return [Array<CandidApiClient::Commons::Types::PhoneNumberOptional>]
25
+ attr_reader :phone_numbers
26
+ # @return [Boolean]
27
+ attr_reader :phone_consent
28
+ # @return [String]
29
+ attr_reader :email
30
+ # @return [Boolean]
31
+ attr_reader :email_consent
32
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
33
+ attr_reader :additional_properties
34
+ # @return [Object]
35
+ attr_reader :_field_set
36
+ protected :_field_set
37
+
38
+ OMIT = Object.new
39
+
40
+ # @param first_name [String]
41
+ # @param last_name [String]
42
+ # @param external_id [String] A unique identifier for the guarantor assigned by an external system.
43
+ # @param date_of_birth [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
44
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
45
+ # @param phone_numbers [Array<CandidApiClient::Commons::Types::PhoneNumberOptional>]
46
+ # @param phone_consent [Boolean]
47
+ # @param email [String]
48
+ # @param email_consent [Boolean]
49
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
50
+ # @return [CandidApiClient::Guarantor::V1::Types::GuarantorOptional]
51
+ def initialize(first_name: OMIT, last_name: OMIT, external_id: OMIT, date_of_birth: OMIT, address: OMIT,
52
+ phone_numbers: OMIT, phone_consent: OMIT, email: OMIT, email_consent: OMIT, additional_properties: nil)
53
+ @first_name = first_name if first_name != OMIT
54
+ @last_name = last_name if last_name != OMIT
55
+ @external_id = external_id if external_id != OMIT
56
+ @date_of_birth = date_of_birth if date_of_birth != OMIT
57
+ @address = address if address != OMIT
58
+ @phone_numbers = phone_numbers if phone_numbers != OMIT
59
+ @phone_consent = phone_consent if phone_consent != OMIT
60
+ @email = email if email != OMIT
61
+ @email_consent = email_consent if email_consent != OMIT
62
+ @additional_properties = additional_properties
63
+ @_field_set = {
64
+ "first_name": first_name,
65
+ "last_name": last_name,
66
+ "external_id": external_id,
67
+ "date_of_birth": date_of_birth,
68
+ "address": address,
69
+ "phone_numbers": phone_numbers,
70
+ "phone_consent": phone_consent,
71
+ "email": email,
72
+ "email_consent": email_consent
73
+ }.reject do |_k, v|
74
+ v == OMIT
75
+ end
76
+ end
77
+
78
+ # Deserialize a JSON object to an instance of GuarantorOptional
79
+ #
80
+ # @param json_object [String]
81
+ # @return [CandidApiClient::Guarantor::V1::Types::GuarantorOptional]
82
+ def self.from_json(json_object:)
83
+ struct = JSON.parse(json_object, object_class: OpenStruct)
84
+ parsed_json = JSON.parse(json_object)
85
+ first_name = struct["first_name"]
86
+ last_name = struct["last_name"]
87
+ external_id = struct["external_id"]
88
+ date_of_birth = (Date.parse(parsed_json["date_of_birth"]) unless parsed_json["date_of_birth"].nil?)
89
+ if parsed_json["address"].nil?
90
+ address = nil
91
+ else
92
+ address = parsed_json["address"].to_json
93
+ address = CandidApiClient::Commons::Types::StreetAddressShortZipOptional.from_json(json_object: address)
94
+ end
95
+ phone_numbers = parsed_json["phone_numbers"]&.map do |item|
96
+ item = item.to_json
97
+ CandidApiClient::Commons::Types::PhoneNumberOptional.from_json(json_object: item)
98
+ end
99
+ phone_consent = struct["phone_consent"]
100
+ email = struct["email"]
101
+ email_consent = struct["email_consent"]
102
+ new(
103
+ first_name: first_name,
104
+ last_name: last_name,
105
+ external_id: external_id,
106
+ date_of_birth: date_of_birth,
107
+ address: address,
108
+ phone_numbers: phone_numbers,
109
+ phone_consent: phone_consent,
110
+ email: email,
111
+ email_consent: email_consent,
112
+ additional_properties: struct
113
+ )
114
+ end
115
+
116
+ # Serialize an instance of GuarantorOptional to a JSON object
117
+ #
118
+ # @return [String]
119
+ def to_json(*_args)
120
+ @_field_set&.to_json
121
+ end
122
+
123
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
124
+ # hash and check each fields type against the current object's property
125
+ # definitions.
126
+ #
127
+ # @param obj [Object]
128
+ # @return [Void]
129
+ def self.validate_raw(obj:)
130
+ obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
131
+ obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
132
+ obj.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
133
+ obj.date_of_birth&.is_a?(Date) != false || raise("Passed value for field obj.date_of_birth is not the expected type, validation failed.")
134
+ obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressShortZipOptional.validate_raw(obj: obj.address)
135
+ obj.phone_numbers&.is_a?(Array) != false || raise("Passed value for field obj.phone_numbers is not the expected type, validation failed.")
136
+ obj.phone_consent&.is_a?(Boolean) != false || raise("Passed value for field obj.phone_consent is not the expected type, validation failed.")
137
+ obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
138
+ obj.email_consent&.is_a?(Boolean) != false || raise("Passed value for field obj.email_consent is not the expected type, validation failed.")
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "gender"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module Individual
9
+ module Types
10
+ class IndividualBaseOptional
11
+ # @return [String]
12
+ attr_reader :first_name
13
+ # @return [String]
14
+ attr_reader :last_name
15
+ # @return [CandidApiClient::Individual::Types::Gender]
16
+ attr_reader :gender
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param first_name [String]
26
+ # @param last_name [String]
27
+ # @param gender [CandidApiClient::Individual::Types::Gender]
28
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
+ # @return [CandidApiClient::Individual::Types::IndividualBaseOptional]
30
+ def initialize(first_name: OMIT, last_name: OMIT, gender: OMIT, additional_properties: nil)
31
+ @first_name = first_name if first_name != OMIT
32
+ @last_name = last_name if last_name != OMIT
33
+ @gender = gender if gender != OMIT
34
+ @additional_properties = additional_properties
35
+ @_field_set = { "first_name": first_name, "last_name": last_name, "gender": gender }.reject do |_k, v|
36
+ v == OMIT
37
+ end
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of IndividualBaseOptional
41
+ #
42
+ # @param json_object [String]
43
+ # @return [CandidApiClient::Individual::Types::IndividualBaseOptional]
44
+ def self.from_json(json_object:)
45
+ struct = JSON.parse(json_object, object_class: OpenStruct)
46
+ first_name = struct["first_name"]
47
+ last_name = struct["last_name"]
48
+ gender = struct["gender"]
49
+ new(
50
+ first_name: first_name,
51
+ last_name: last_name,
52
+ gender: gender,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+
57
+ # Serialize an instance of IndividualBaseOptional to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json(*_args)
61
+ @_field_set&.to_json
62
+ end
63
+
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
72
+ obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
73
+ obj.gender&.is_a?(CandidApiClient::Individual::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.")
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "patient_clinical_trial_info_create"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module Individual
9
+ module Types
10
+ class PatientNonInsurancePayerInfoCreateOptional
11
+ # @return [String]
12
+ attr_reader :non_insurance_payer_id
13
+ # @return [String]
14
+ attr_reader :member_id
15
+ # @return [Array<CandidApiClient::Individual::Types::PatientClinicalTrialInfoCreate>]
16
+ attr_reader :clinical_trial_info
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param non_insurance_payer_id [String]
26
+ # @param member_id [String]
27
+ # @param clinical_trial_info [Array<CandidApiClient::Individual::Types::PatientClinicalTrialInfoCreate>]
28
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
+ # @return [CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreateOptional]
30
+ def initialize(non_insurance_payer_id: OMIT, member_id: OMIT, clinical_trial_info: OMIT,
31
+ additional_properties: nil)
32
+ @non_insurance_payer_id = non_insurance_payer_id if non_insurance_payer_id != OMIT
33
+ @member_id = member_id if member_id != OMIT
34
+ @clinical_trial_info = clinical_trial_info if clinical_trial_info != OMIT
35
+ @additional_properties = additional_properties
36
+ @_field_set = {
37
+ "non_insurance_payer_id": non_insurance_payer_id,
38
+ "member_id": member_id,
39
+ "clinical_trial_info": clinical_trial_info
40
+ }.reject do |_k, v|
41
+ v == OMIT
42
+ end
43
+ end
44
+
45
+ # Deserialize a JSON object to an instance of
46
+ # PatientNonInsurancePayerInfoCreateOptional
47
+ #
48
+ # @param json_object [String]
49
+ # @return [CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreateOptional]
50
+ def self.from_json(json_object:)
51
+ struct = JSON.parse(json_object, object_class: OpenStruct)
52
+ parsed_json = JSON.parse(json_object)
53
+ non_insurance_payer_id = struct["non_insurance_payer_id"]
54
+ member_id = struct["member_id"]
55
+ clinical_trial_info = parsed_json["clinical_trial_info"]&.map do |item|
56
+ item = item.to_json
57
+ CandidApiClient::Individual::Types::PatientClinicalTrialInfoCreate.from_json(json_object: item)
58
+ end
59
+ new(
60
+ non_insurance_payer_id: non_insurance_payer_id,
61
+ member_id: member_id,
62
+ clinical_trial_info: clinical_trial_info,
63
+ additional_properties: struct
64
+ )
65
+ end
66
+
67
+ # Serialize an instance of PatientNonInsurancePayerInfoCreateOptional to a JSON
68
+ # 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.non_insurance_payer_id&.is_a?(String) != false || raise("Passed value for field obj.non_insurance_payer_id is not the expected type, validation failed.")
83
+ obj.member_id&.is_a?(String) != false || raise("Passed value for field obj.member_id is not the expected type, validation failed.")
84
+ obj.clinical_trial_info&.is_a?(Array) != false || raise("Passed value for field obj.clinical_trial_info is not the expected type, validation failed.")
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -3,8 +3,8 @@
3
3
  require_relative "gender"
4
4
  require "date"
5
5
  require_relative "../../commons/types/street_address_short_zip_optional"
6
- require_relative "../../commons/types/phone_number"
7
- require_relative "patient_non_insurance_payer_info_create"
6
+ require_relative "../../commons/types/phone_number_optional"
7
+ require_relative "patient_non_insurance_payer_info_create_optional"
8
8
  require "ostruct"
9
9
  require "json"
10
10
 
@@ -26,7 +26,7 @@ module CandidApiClient
26
26
  attr_reader :date_of_birth
27
27
  # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional] Box 5 on the CMS-1500 claim form.
28
28
  attr_reader :address
29
- # @return [Array<CandidApiClient::Commons::Types::PhoneNumber>]
29
+ # @return [Array<CandidApiClient::Commons::Types::PhoneNumberOptional>]
30
30
  attr_reader :phone_numbers
31
31
  # @return [Boolean]
32
32
  attr_reader :phone_consent
@@ -37,7 +37,7 @@ module CandidApiClient
37
37
  # @return [Array<String>] On update, we will replace the existing list of non-insurance payers with the
38
38
  # new list if populated.
39
39
  attr_reader :non_insurance_payers
40
- # @return [Array<CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreate>] On update, we will replace the existing list of non-insurance payers with the
40
+ # @return [Array<CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreateOptional>] On update, we will replace the existing list of non-insurance payers with the
41
41
  # new list if populated.
42
42
  attr_reader :non_insurance_payers_info
43
43
  # @return [OpenStruct] Additional properties unmapped to the current class definition
@@ -56,13 +56,13 @@ module CandidApiClient
56
56
  # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
57
57
  # formatted YYYY-MM-DD (i.e. 2012-02-01)
58
58
  # @param address [CandidApiClient::Commons::Types::StreetAddressShortZipOptional] Box 5 on the CMS-1500 claim form.
59
- # @param phone_numbers [Array<CandidApiClient::Commons::Types::PhoneNumber>]
59
+ # @param phone_numbers [Array<CandidApiClient::Commons::Types::PhoneNumberOptional>]
60
60
  # @param phone_consent [Boolean]
61
61
  # @param email [String]
62
62
  # @param email_consent [Boolean]
63
63
  # @param non_insurance_payers [Array<String>] On update, we will replace the existing list of non-insurance payers with the
64
64
  # new list if populated.
65
- # @param non_insurance_payers_info [Array<CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreate>] On update, we will replace the existing list of non-insurance payers with the
65
+ # @param non_insurance_payers_info [Array<CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreateOptional>] On update, we will replace the existing list of non-insurance payers with the
66
66
  # new list if populated.
67
67
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
68
68
  # @return [CandidApiClient::Individual::Types::PatientUpdateWithOptionalAddress]
@@ -119,7 +119,7 @@ module CandidApiClient
119
119
  end
120
120
  phone_numbers = parsed_json["phone_numbers"]&.map do |item|
121
121
  item = item.to_json
122
- CandidApiClient::Commons::Types::PhoneNumber.from_json(json_object: item)
122
+ CandidApiClient::Commons::Types::PhoneNumberOptional.from_json(json_object: item)
123
123
  end
124
124
  phone_consent = struct["phone_consent"]
125
125
  email = struct["email"]
@@ -127,7 +127,7 @@ module CandidApiClient
127
127
  non_insurance_payers = struct["non_insurance_payers"]
128
128
  non_insurance_payers_info = parsed_json["non_insurance_payers_info"]&.map do |item|
129
129
  item = item.to_json
130
- CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreate.from_json(json_object: item)
130
+ CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreateOptional.from_json(json_object: item)
131
131
  end
132
132
  new(
133
133
  first_name: first_name,