candidhealth 0.43.1 → 0.45.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.
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "state"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module Commons
9
+ module Types
10
+ class StreetAddressOptionalBase
11
+ # @return [String]
12
+ attr_reader :address_1
13
+ # @return [String]
14
+ attr_reader :address_2
15
+ # @return [String]
16
+ attr_reader :city
17
+ # @return [CandidApiClient::Commons::Types::State]
18
+ attr_reader :state
19
+ # @return [String] 5-digit zip code
20
+ attr_reader :zip_code
21
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
22
+ attr_reader :additional_properties
23
+ # @return [Object]
24
+ attr_reader :_field_set
25
+ protected :_field_set
26
+
27
+ OMIT = Object.new
28
+
29
+ # @param address_1 [String]
30
+ # @param address_2 [String]
31
+ # @param city [String]
32
+ # @param state [CandidApiClient::Commons::Types::State]
33
+ # @param zip_code [String] 5-digit zip code
34
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
35
+ # @return [CandidApiClient::Commons::Types::StreetAddressOptionalBase]
36
+ def initialize(address_1: OMIT, address_2: OMIT, city: OMIT, state: OMIT, zip_code: OMIT,
37
+ additional_properties: nil)
38
+ @address_1 = address_1 if address_1 != OMIT
39
+ @address_2 = address_2 if address_2 != OMIT
40
+ @city = city if city != OMIT
41
+ @state = state if state != OMIT
42
+ @zip_code = zip_code if zip_code != OMIT
43
+ @additional_properties = additional_properties
44
+ @_field_set = {
45
+ "address1": address_1,
46
+ "address2": address_2,
47
+ "city": city,
48
+ "state": state,
49
+ "zip_code": zip_code
50
+ }.reject do |_k, v|
51
+ v == OMIT
52
+ end
53
+ end
54
+
55
+ # Deserialize a JSON object to an instance of StreetAddressOptionalBase
56
+ #
57
+ # @param json_object [String]
58
+ # @return [CandidApiClient::Commons::Types::StreetAddressOptionalBase]
59
+ def self.from_json(json_object:)
60
+ struct = JSON.parse(json_object, object_class: OpenStruct)
61
+ address_1 = struct["address1"]
62
+ address_2 = struct["address2"]
63
+ city = struct["city"]
64
+ state = struct["state"]
65
+ zip_code = struct["zip_code"]
66
+ new(
67
+ address_1: address_1,
68
+ address_2: address_2,
69
+ city: city,
70
+ state: state,
71
+ zip_code: zip_code,
72
+ additional_properties: struct
73
+ )
74
+ end
75
+
76
+ # Serialize an instance of StreetAddressOptionalBase to a JSON object
77
+ #
78
+ # @return [String]
79
+ def to_json(*_args)
80
+ @_field_set&.to_json
81
+ end
82
+
83
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
84
+ # hash and check each fields type against the current object's property
85
+ # definitions.
86
+ #
87
+ # @param obj [Object]
88
+ # @return [Void]
89
+ def self.validate_raw(obj:)
90
+ obj.address_1&.is_a?(String) != false || raise("Passed value for field obj.address_1 is not the expected type, validation failed.")
91
+ obj.address_2&.is_a?(String) != false || raise("Passed value for field obj.address_2 is not the expected type, validation failed.")
92
+ obj.city&.is_a?(String) != false || raise("Passed value for field obj.city is not the expected type, validation failed.")
93
+ obj.state&.is_a?(CandidApiClient::Commons::Types::State) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
94
+ obj.zip_code&.is_a?(String) != false || raise("Passed value for field obj.zip_code is not the expected type, validation failed.")
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "state"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module Commons
9
+ module Types
10
+ class StreetAddressShortZipOptional
11
+ # @return [String] 4-digit zip add-on code https://en.wikipedia.org/wiki/ZIP_Code#ZIP+4
12
+ attr_reader :zip_plus_four_code
13
+ # @return [String]
14
+ attr_reader :address_1
15
+ # @return [String]
16
+ attr_reader :address_2
17
+ # @return [String]
18
+ attr_reader :city
19
+ # @return [CandidApiClient::Commons::Types::State]
20
+ attr_reader :state
21
+ # @return [String] 5-digit zip code
22
+ attr_reader :zip_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 zip_plus_four_code [String] 4-digit zip add-on code https://en.wikipedia.org/wiki/ZIP_Code#ZIP+4
32
+ # @param address_1 [String]
33
+ # @param address_2 [String]
34
+ # @param city [String]
35
+ # @param state [CandidApiClient::Commons::Types::State]
36
+ # @param zip_code [String] 5-digit zip code
37
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
38
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
39
+ def initialize(zip_plus_four_code: OMIT, address_1: OMIT, address_2: OMIT, city: OMIT, state: OMIT,
40
+ zip_code: OMIT, additional_properties: nil)
41
+ @zip_plus_four_code = zip_plus_four_code if zip_plus_four_code != OMIT
42
+ @address_1 = address_1 if address_1 != OMIT
43
+ @address_2 = address_2 if address_2 != OMIT
44
+ @city = city if city != OMIT
45
+ @state = state if state != OMIT
46
+ @zip_code = zip_code if zip_code != OMIT
47
+ @additional_properties = additional_properties
48
+ @_field_set = {
49
+ "zip_plus_four_code": zip_plus_four_code,
50
+ "address1": address_1,
51
+ "address2": address_2,
52
+ "city": city,
53
+ "state": state,
54
+ "zip_code": zip_code
55
+ }.reject do |_k, v|
56
+ v == OMIT
57
+ end
58
+ end
59
+
60
+ # Deserialize a JSON object to an instance of StreetAddressShortZipOptional
61
+ #
62
+ # @param json_object [String]
63
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
64
+ def self.from_json(json_object:)
65
+ struct = JSON.parse(json_object, object_class: OpenStruct)
66
+ zip_plus_four_code = struct["zip_plus_four_code"]
67
+ address_1 = struct["address1"]
68
+ address_2 = struct["address2"]
69
+ city = struct["city"]
70
+ state = struct["state"]
71
+ zip_code = struct["zip_code"]
72
+ new(
73
+ zip_plus_four_code: zip_plus_four_code,
74
+ address_1: address_1,
75
+ address_2: address_2,
76
+ city: city,
77
+ state: state,
78
+ zip_code: zip_code,
79
+ additional_properties: struct
80
+ )
81
+ end
82
+
83
+ # Serialize an instance of StreetAddressShortZipOptional 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.zip_plus_four_code&.is_a?(String) != false || raise("Passed value for field obj.zip_plus_four_code is not the expected type, validation failed.")
98
+ obj.address_1&.is_a?(String) != false || raise("Passed value for field obj.address_1 is not the expected type, validation failed.")
99
+ obj.address_2&.is_a?(String) != false || raise("Passed value for field obj.address_2 is not the expected type, validation failed.")
100
+ obj.city&.is_a?(String) != false || raise("Passed value for field obj.city is not the expected type, validation failed.")
101
+ obj.state&.is_a?(CandidApiClient::Commons::Types::State) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
102
+ obj.zip_code&.is_a?(String) != false || raise("Passed value for field obj.zip_code is not the expected type, validation failed.")
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,160 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../commons/types/street_address_short_zip_optional"
4
+ require_relative "../../../commons/types/billing_provider_commercial_license_type"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module CandidApiClient
9
+ module EncounterProviders
10
+ module V2
11
+ module Types
12
+ # The billing provider is the provider or business entity submitting the claim.
13
+ # Billing provider may be, but is not necessarily, the same person/NPI as the
14
+ # rendering provider.
15
+ # From a payer's perspective, this represents the person or entity being
16
+ # reimbursed.
17
+ # When a contract exists with the target payer, the billing provider should be the
18
+ # entity contracted with the payer.
19
+ # In some circumstances, this will be an individual provider. In that case, submit
20
+ # that provider's NPI and the
21
+ # tax ID (TIN) that the provider gave to the payer during contracting.
22
+ # In other cases, the billing entity will be a medical group. If so, submit the
23
+ # group NPI and the group's tax ID.
24
+ # Box 33 on the CMS-1500 claim form.
25
+ # The address fields here are optional.
26
+ class BillingProviderUpdateWithOptionalAddress
27
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
28
+ attr_reader :address
29
+ # @return [String] If the provider has a contract with insurance, this must be the same tax ID
30
+ # given to the payer on an IRS W-9 form completed during contracting.
31
+ attr_reader :tax_id
32
+ # @return [String]
33
+ attr_reader :npi
34
+ # @return [String]
35
+ attr_reader :taxonomy_code
36
+ # @return [CandidApiClient::Commons::Types::BillingProviderCommercialLicenseType] 837i Loop2010BB G2
37
+ # Provider Commercial Number
38
+ attr_reader :provider_commercial_license_type
39
+ # @return [String] If the provider is an individual, this should be set instead of organization
40
+ # name
41
+ attr_reader :first_name
42
+ # @return [String] If the provider is an individual, this should be set instead of organization
43
+ # name
44
+ attr_reader :last_name
45
+ # @return [String] If the provider is an organization, this should be set instead of first + last
46
+ # name
47
+ attr_reader :organization_name
48
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
49
+ attr_reader :additional_properties
50
+ # @return [Object]
51
+ attr_reader :_field_set
52
+ protected :_field_set
53
+
54
+ OMIT = Object.new
55
+
56
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
57
+ # @param tax_id [String] If the provider has a contract with insurance, this must be the same tax ID
58
+ # given to the payer on an IRS W-9 form completed during contracting.
59
+ # @param npi [String]
60
+ # @param taxonomy_code [String]
61
+ # @param provider_commercial_license_type [CandidApiClient::Commons::Types::BillingProviderCommercialLicenseType] 837i Loop2010BB G2
62
+ # Provider Commercial Number
63
+ # @param first_name [String] If the provider is an individual, this should be set instead of organization
64
+ # name
65
+ # @param last_name [String] If the provider is an individual, this should be set instead of organization
66
+ # name
67
+ # @param organization_name [String] If the provider is an organization, this should be set instead of first + last
68
+ # name
69
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
70
+ # @return [CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdateWithOptionalAddress]
71
+ def initialize(address: OMIT, tax_id: OMIT, npi: OMIT, taxonomy_code: OMIT,
72
+ provider_commercial_license_type: OMIT, first_name: OMIT, last_name: OMIT, organization_name: OMIT, additional_properties: nil)
73
+ @address = address if address != OMIT
74
+ @tax_id = tax_id if tax_id != OMIT
75
+ @npi = npi if npi != OMIT
76
+ @taxonomy_code = taxonomy_code if taxonomy_code != OMIT
77
+ if provider_commercial_license_type != OMIT
78
+ @provider_commercial_license_type = provider_commercial_license_type
79
+ end
80
+ @first_name = first_name if first_name != OMIT
81
+ @last_name = last_name if last_name != OMIT
82
+ @organization_name = organization_name if organization_name != OMIT
83
+ @additional_properties = additional_properties
84
+ @_field_set = {
85
+ "address": address,
86
+ "tax_id": tax_id,
87
+ "npi": npi,
88
+ "taxonomy_code": taxonomy_code,
89
+ "provider_commercial_license_type": provider_commercial_license_type,
90
+ "first_name": first_name,
91
+ "last_name": last_name,
92
+ "organization_name": organization_name
93
+ }.reject do |_k, v|
94
+ v == OMIT
95
+ end
96
+ end
97
+
98
+ # Deserialize a JSON object to an instance of
99
+ # BillingProviderUpdateWithOptionalAddress
100
+ #
101
+ # @param json_object [String]
102
+ # @return [CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdateWithOptionalAddress]
103
+ def self.from_json(json_object:)
104
+ struct = JSON.parse(json_object, object_class: OpenStruct)
105
+ parsed_json = JSON.parse(json_object)
106
+ if parsed_json["address"].nil?
107
+ address = nil
108
+ else
109
+ address = parsed_json["address"].to_json
110
+ address = CandidApiClient::Commons::Types::StreetAddressShortZipOptional.from_json(json_object: address)
111
+ end
112
+ tax_id = struct["tax_id"]
113
+ npi = struct["npi"]
114
+ taxonomy_code = struct["taxonomy_code"]
115
+ provider_commercial_license_type = struct["provider_commercial_license_type"]
116
+ first_name = struct["first_name"]
117
+ last_name = struct["last_name"]
118
+ organization_name = struct["organization_name"]
119
+ new(
120
+ address: address,
121
+ tax_id: tax_id,
122
+ npi: npi,
123
+ taxonomy_code: taxonomy_code,
124
+ provider_commercial_license_type: provider_commercial_license_type,
125
+ first_name: first_name,
126
+ last_name: last_name,
127
+ organization_name: organization_name,
128
+ additional_properties: struct
129
+ )
130
+ end
131
+
132
+ # Serialize an instance of BillingProviderUpdateWithOptionalAddress to a JSON
133
+ # object
134
+ #
135
+ # @return [String]
136
+ def to_json(*_args)
137
+ @_field_set&.to_json
138
+ end
139
+
140
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
141
+ # hash and check each fields type against the current object's property
142
+ # definitions.
143
+ #
144
+ # @param obj [Object]
145
+ # @return [Void]
146
+ def self.validate_raw(obj:)
147
+ obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressShortZipOptional.validate_raw(obj: obj.address)
148
+ obj.tax_id&.is_a?(String) != false || raise("Passed value for field obj.tax_id is not the expected type, validation failed.")
149
+ obj.npi&.is_a?(String) != false || raise("Passed value for field obj.npi is not the expected type, validation failed.")
150
+ obj.taxonomy_code&.is_a?(String) != false || raise("Passed value for field obj.taxonomy_code is not the expected type, validation failed.")
151
+ obj.provider_commercial_license_type&.is_a?(CandidApiClient::Commons::Types::BillingProviderCommercialLicenseType) != false || raise("Passed value for field obj.provider_commercial_license_type is not the expected type, validation failed.")
152
+ obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
153
+ obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
154
+ obj.organization_name&.is_a?(String) != false || raise("Passed value for field obj.organization_name is not the expected type, validation failed.")
155
+ end
156
+ end
157
+ end
158
+ end
159
+ end
160
+ end
@@ -0,0 +1,134 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../commons/types/street_address_short_zip_optional"
4
+ require_relative "../../../commons/types/qualifier_code"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module CandidApiClient
9
+ module EncounterProviders
10
+ module V2
11
+ module Types
12
+ class InitialReferringProviderUpdateWithOptionalAddress
13
+ # @return [String] A National Provider Identifier is a unique 10-digit identification
14
+ # number issued to health care providers in the United States
15
+ attr_reader :npi
16
+ # @return [String]
17
+ attr_reader :taxonomy_code
18
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
19
+ attr_reader :address
20
+ # @return [CandidApiClient::Commons::Types::QualifierCode]
21
+ attr_reader :qualifier
22
+ # @return [String] If the provider is an individual, this should be set instead of organization
23
+ # name
24
+ attr_reader :first_name
25
+ # @return [String] If the provider is an individual, this should be set instead of organization
26
+ # name
27
+ attr_reader :last_name
28
+ # @return [String] If the provider is an organization, this should be set instead of first + last
29
+ # name
30
+ attr_reader :organization_name
31
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
32
+ attr_reader :additional_properties
33
+ # @return [Object]
34
+ attr_reader :_field_set
35
+ protected :_field_set
36
+
37
+ OMIT = Object.new
38
+
39
+ # @param npi [String] A National Provider Identifier is a unique 10-digit identification
40
+ # number issued to health care providers in the United States
41
+ # @param taxonomy_code [String]
42
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
43
+ # @param qualifier [CandidApiClient::Commons::Types::QualifierCode]
44
+ # @param first_name [String] If the provider is an individual, this should be set instead of organization
45
+ # name
46
+ # @param last_name [String] If the provider is an individual, this should be set instead of organization
47
+ # name
48
+ # @param organization_name [String] If the provider is an organization, this should be set instead of first + last
49
+ # name
50
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
51
+ # @return [CandidApiClient::EncounterProviders::V2::Types::InitialReferringProviderUpdateWithOptionalAddress]
52
+ def initialize(npi: OMIT, taxonomy_code: OMIT, address: OMIT, qualifier: OMIT, first_name: OMIT,
53
+ last_name: OMIT, organization_name: OMIT, additional_properties: nil)
54
+ @npi = npi if npi != OMIT
55
+ @taxonomy_code = taxonomy_code if taxonomy_code != OMIT
56
+ @address = address if address != OMIT
57
+ @qualifier = qualifier if qualifier != OMIT
58
+ @first_name = first_name if first_name != OMIT
59
+ @last_name = last_name if last_name != OMIT
60
+ @organization_name = organization_name if organization_name != OMIT
61
+ @additional_properties = additional_properties
62
+ @_field_set = {
63
+ "npi": npi,
64
+ "taxonomy_code": taxonomy_code,
65
+ "address": address,
66
+ "qualifier": qualifier,
67
+ "first_name": first_name,
68
+ "last_name": last_name,
69
+ "organization_name": organization_name
70
+ }.reject do |_k, v|
71
+ v == OMIT
72
+ end
73
+ end
74
+
75
+ # Deserialize a JSON object to an instance of
76
+ # InitialReferringProviderUpdateWithOptionalAddress
77
+ #
78
+ # @param json_object [String]
79
+ # @return [CandidApiClient::EncounterProviders::V2::Types::InitialReferringProviderUpdateWithOptionalAddress]
80
+ def self.from_json(json_object:)
81
+ struct = JSON.parse(json_object, object_class: OpenStruct)
82
+ parsed_json = JSON.parse(json_object)
83
+ npi = struct["npi"]
84
+ taxonomy_code = struct["taxonomy_code"]
85
+ if parsed_json["address"].nil?
86
+ address = nil
87
+ else
88
+ address = parsed_json["address"].to_json
89
+ address = CandidApiClient::Commons::Types::StreetAddressShortZipOptional.from_json(json_object: address)
90
+ end
91
+ qualifier = struct["qualifier"]
92
+ first_name = struct["first_name"]
93
+ last_name = struct["last_name"]
94
+ organization_name = struct["organization_name"]
95
+ new(
96
+ npi: npi,
97
+ taxonomy_code: taxonomy_code,
98
+ address: address,
99
+ qualifier: qualifier,
100
+ first_name: first_name,
101
+ last_name: last_name,
102
+ organization_name: organization_name,
103
+ additional_properties: struct
104
+ )
105
+ end
106
+
107
+ # Serialize an instance of InitialReferringProviderUpdateWithOptionalAddress to a
108
+ # JSON object
109
+ #
110
+ # @return [String]
111
+ def to_json(*_args)
112
+ @_field_set&.to_json
113
+ end
114
+
115
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
116
+ # hash and check each fields type against the current object's property
117
+ # definitions.
118
+ #
119
+ # @param obj [Object]
120
+ # @return [Void]
121
+ def self.validate_raw(obj:)
122
+ obj.npi&.is_a?(String) != false || raise("Passed value for field obj.npi is not the expected type, validation failed.")
123
+ obj.taxonomy_code&.is_a?(String) != false || raise("Passed value for field obj.taxonomy_code is not the expected type, validation failed.")
124
+ obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressShortZipOptional.validate_raw(obj: obj.address)
125
+ obj.qualifier&.is_a?(CandidApiClient::Commons::Types::QualifierCode) != false || raise("Passed value for field obj.qualifier is not the expected type, validation failed.")
126
+ obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
127
+ obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
128
+ obj.organization_name&.is_a?(String) != false || raise("Passed value for field obj.organization_name is not the expected type, validation failed.")
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
@@ -0,0 +1,125 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../commons/types/street_address_short_zip_optional"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module EncounterProviders
9
+ module V2
10
+ module Types
11
+ class ReferringProviderUpdateWithOptionalAddress
12
+ # @return [String] A National Provider Identifier is a unique 10-digit identification
13
+ # number issued to health care providers in the United States
14
+ attr_reader :npi
15
+ # @return [String]
16
+ attr_reader :taxonomy_code
17
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
18
+ attr_reader :address
19
+ # @return [String] If the provider is an individual, this should be set instead of organization
20
+ # name
21
+ attr_reader :first_name
22
+ # @return [String] If the provider is an individual, this should be set instead of organization
23
+ # name
24
+ attr_reader :last_name
25
+ # @return [String] If the provider is an organization, this should be set instead of first + last
26
+ # name
27
+ attr_reader :organization_name
28
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
29
+ attr_reader :additional_properties
30
+ # @return [Object]
31
+ attr_reader :_field_set
32
+ protected :_field_set
33
+
34
+ OMIT = Object.new
35
+
36
+ # @param npi [String] A National Provider Identifier is a unique 10-digit identification
37
+ # number issued to health care providers in the United States
38
+ # @param taxonomy_code [String]
39
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
40
+ # @param first_name [String] If the provider is an individual, this should be set instead of organization
41
+ # name
42
+ # @param last_name [String] If the provider is an individual, this should be set instead of organization
43
+ # name
44
+ # @param organization_name [String] If the provider is an organization, this should be set instead of first + last
45
+ # name
46
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
47
+ # @return [CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdateWithOptionalAddress]
48
+ def initialize(npi: OMIT, taxonomy_code: OMIT, address: OMIT, first_name: OMIT, last_name: OMIT,
49
+ organization_name: OMIT, additional_properties: nil)
50
+ @npi = npi if npi != OMIT
51
+ @taxonomy_code = taxonomy_code if taxonomy_code != OMIT
52
+ @address = address if address != OMIT
53
+ @first_name = first_name if first_name != OMIT
54
+ @last_name = last_name if last_name != OMIT
55
+ @organization_name = organization_name if organization_name != OMIT
56
+ @additional_properties = additional_properties
57
+ @_field_set = {
58
+ "npi": npi,
59
+ "taxonomy_code": taxonomy_code,
60
+ "address": address,
61
+ "first_name": first_name,
62
+ "last_name": last_name,
63
+ "organization_name": organization_name
64
+ }.reject do |_k, v|
65
+ v == OMIT
66
+ end
67
+ end
68
+
69
+ # Deserialize a JSON object to an instance of
70
+ # ReferringProviderUpdateWithOptionalAddress
71
+ #
72
+ # @param json_object [String]
73
+ # @return [CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdateWithOptionalAddress]
74
+ def self.from_json(json_object:)
75
+ struct = JSON.parse(json_object, object_class: OpenStruct)
76
+ parsed_json = JSON.parse(json_object)
77
+ npi = struct["npi"]
78
+ taxonomy_code = struct["taxonomy_code"]
79
+ if parsed_json["address"].nil?
80
+ address = nil
81
+ else
82
+ address = parsed_json["address"].to_json
83
+ address = CandidApiClient::Commons::Types::StreetAddressShortZipOptional.from_json(json_object: address)
84
+ end
85
+ first_name = struct["first_name"]
86
+ last_name = struct["last_name"]
87
+ organization_name = struct["organization_name"]
88
+ new(
89
+ npi: npi,
90
+ taxonomy_code: taxonomy_code,
91
+ address: address,
92
+ first_name: first_name,
93
+ last_name: last_name,
94
+ organization_name: organization_name,
95
+ additional_properties: struct
96
+ )
97
+ end
98
+
99
+ # Serialize an instance of ReferringProviderUpdateWithOptionalAddress to a JSON
100
+ # object
101
+ #
102
+ # @return [String]
103
+ def to_json(*_args)
104
+ @_field_set&.to_json
105
+ end
106
+
107
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
108
+ # hash and check each fields type against the current object's property
109
+ # definitions.
110
+ #
111
+ # @param obj [Object]
112
+ # @return [Void]
113
+ def self.validate_raw(obj:)
114
+ obj.npi&.is_a?(String) != false || raise("Passed value for field obj.npi is not the expected type, validation failed.")
115
+ obj.taxonomy_code&.is_a?(String) != false || raise("Passed value for field obj.taxonomy_code is not the expected type, validation failed.")
116
+ obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressShortZipOptional.validate_raw(obj: obj.address)
117
+ obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
118
+ obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
119
+ obj.organization_name&.is_a?(String) != false || raise("Passed value for field obj.organization_name is not the expected type, validation failed.")
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end