Class: CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderUpdateV2

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(npi: OMIT, is_rendering: OMIT, is_billing: OMIT, first_name: OMIT, last_name: OMIT, organization_name: OMIT, provider_type: OMIT, tax_id: OMIT, taxonomy_code: OMIT, license_type: OMIT, addresses: OMIT, employment_start_date: OMIT, employment_termination_date: OMIT, qualifications: OMIT, additional_properties: nil) ⇒ CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderUpdateV2

Parameters:

  • npi (String) (defaults to: OMIT)

    The NPI of the provider. This must be all digits [0-9] and exactly 10 characters long.

  • is_rendering (Boolean) (defaults to: OMIT)

    Whether the provider can be used to render services.

  • is_billing (Boolean) (defaults to: OMIT)

    Whether the provider can be used to bill services.

  • first_name (String) (defaults to: OMIT)

    The first name of the provider, if the provider is an individual.

  • last_name (String) (defaults to: OMIT)

    The last name of the provider, if the provider is an individual.

  • organization_name (String) (defaults to: OMIT)

    The name of the provider, if the provider is an organization.

  • provider_type (CandidApiClient::OrganizationProviders::V2::Types::ProviderType) (defaults to: OMIT)

    Whether the provider is an individual (NPPES Type 1) or organization (NPPES Type 2) provider.

  • tax_id (String) (defaults to: OMIT)

    If the provider has a contract with insurance, this must be the same tax ID given to the payer on an IRS W-9 form completed during contracting.

  • taxonomy_code (String) (defaults to: OMIT)

    A code designating classification and specialization.

  • license_type (CandidApiClient::OrganizationProviders::V2::Types::LicenseType) (defaults to: OMIT)

    The type of license that the provider holds.

  • addresses (Array<CandidApiClient::OrganizationProviders::V2::Types::OrganizationProviderAddress>) (defaults to: OMIT)

    The addresses associated with this provider.

  • employment_start_date (String) (defaults to: OMIT)

    The employment start date for the provider.

  • employment_termination_date (String) (defaults to: OMIT)

    The employment termination date for the provider.

  • qualifications (Array<CandidApiClient::Identifiers::Types::UpdatableIdentifier>) (defaults to: OMIT)

    Provider’s qualifications (medicare provider number, medicaid provider number, etc.)

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 75

def initialize(npi: OMIT, is_rendering: OMIT, is_billing: OMIT, first_name: OMIT, last_name: OMIT,
               organization_name: OMIT, provider_type: OMIT, tax_id: OMIT, taxonomy_code: OMIT, license_type: OMIT, addresses: OMIT, employment_start_date: OMIT, employment_termination_date: OMIT, qualifications: OMIT, additional_properties: nil)
  @npi = npi if npi != OMIT
  @is_rendering = is_rendering if is_rendering != OMIT
  @is_billing = is_billing if is_billing != OMIT
  @first_name = first_name if first_name != OMIT
  @last_name = last_name if last_name != OMIT
  @organization_name = organization_name if organization_name != OMIT
  @provider_type = provider_type if provider_type != OMIT
  @tax_id = tax_id if tax_id != OMIT
  @taxonomy_code = taxonomy_code if taxonomy_code != OMIT
  @license_type = license_type if license_type != OMIT
  @addresses = addresses if addresses != OMIT
  @employment_start_date = employment_start_date if employment_start_date != OMIT
  @employment_termination_date = employment_termination_date if employment_termination_date != OMIT
  @qualifications = qualifications if qualifications != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "npi": npi,
    "is_rendering": is_rendering,
    "is_billing": is_billing,
    "first_name": first_name,
    "last_name": last_name,
    "organization_name": organization_name,
    "provider_type": provider_type,
    "tax_id": tax_id,
    "taxonomy_code": taxonomy_code,
    "license_type": license_type,
    "addresses": addresses,
    "employment_start_date": employment_start_date,
    "employment_termination_date": employment_termination_date,
    "qualifications": qualifications
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



48
49
50
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 48

def additional_properties
  @additional_properties
end

#addressesArray<CandidApiClient::OrganizationProviders::V2::Types::OrganizationProviderAddress> (readonly)

Returns The addresses associated with this provider.

Returns:



39
40
41
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 39

def addresses
  @addresses
end

#employment_start_dateString (readonly)

Returns The employment start date for the provider.

Returns:

  • (String)

    The employment start date for the provider.



41
42
43
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 41

def employment_start_date
  @employment_start_date
end

#employment_termination_dateString (readonly)

Returns The employment termination date for the provider.

Returns:

  • (String)

    The employment termination date for the provider.



43
44
45
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 43

def employment_termination_date
  @employment_termination_date
end

#first_nameString (readonly)

Returns The first name of the provider, if the provider is an individual.

Returns:

  • (String)

    The first name of the provider, if the provider is an individual.



23
24
25
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 23

def first_name
  @first_name
end

#is_billingBoolean (readonly)

Returns Whether the provider can be used to bill services.

Returns:

  • (Boolean)

    Whether the provider can be used to bill services.



21
22
23
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 21

def is_billing
  @is_billing
end

#is_renderingBoolean (readonly)

Returns Whether the provider can be used to render services.

Returns:

  • (Boolean)

    Whether the provider can be used to render services.



19
20
21
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 19

def is_rendering
  @is_rendering
end

#last_nameString (readonly)

Returns The last name of the provider, if the provider is an individual.

Returns:

  • (String)

    The last name of the provider, if the provider is an individual.



25
26
27
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 25

def last_name
  @last_name
end

#license_typeCandidApiClient::OrganizationProviders::V2::Types::LicenseType (readonly)

Returns The type of license that the provider holds.

Returns:



37
38
39
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 37

def license_type
  @license_type
end

#npiString (readonly)

Returns The NPI of the provider. This must be all digits [0-9] and exactly 10 characters long.

Returns:

  • (String)

    The NPI of the provider. This must be all digits [0-9] and exactly 10 characters long.



17
18
19
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 17

def npi
  @npi
end

#organization_nameString (readonly)

Returns The name of the provider, if the provider is an organization.

Returns:

  • (String)

    The name of the provider, if the provider is an organization.



27
28
29
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 27

def organization_name
  @organization_name
end

#provider_typeCandidApiClient::OrganizationProviders::V2::Types::ProviderType (readonly)

Returns Whether the provider is an individual (NPPES Type 1) or organization (NPPES Type 2) provider.

Returns:



30
31
32
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 30

def provider_type
  @provider_type
end

#qualificationsArray<CandidApiClient::Identifiers::Types::UpdatableIdentifier> (readonly)

Returns Provider’s qualifications (medicare provider number, medicaid provider number, etc.).

Returns:



46
47
48
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 46

def qualifications
  @qualifications
end

#tax_idString (readonly)

Returns If the provider has a contract with insurance, this must be the same tax ID given to the payer on an IRS W-9 form completed during contracting.

Returns:

  • (String)

    If the provider has a contract with insurance, this must be the same tax ID given to the payer on an IRS W-9 form completed during contracting.



33
34
35
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 33

def tax_id
  @tax_id
end

#taxonomy_codeString (readonly)

Returns A code designating classification and specialization.

Returns:

  • (String)

    A code designating classification and specialization.



35
36
37
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 35

def taxonomy_code
  @taxonomy_code
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderUpdateV2

Deserialize a JSON object to an instance of OrganizationProviderUpdateV2



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 116

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  npi = struct["npi"]
  is_rendering = struct["is_rendering"]
  is_billing = struct["is_billing"]
  first_name = struct["first_name"]
  last_name = struct["last_name"]
  organization_name = struct["organization_name"]
  provider_type = struct["provider_type"]
  tax_id = struct["tax_id"]
  taxonomy_code = struct["taxonomy_code"]
  license_type = struct["license_type"]
  addresses = parsed_json["addresses"]&.map do |item|
    item = item.to_json
    CandidApiClient::OrganizationProviders::V2::Types::OrganizationProviderAddress.from_json(json_object: item)
  end
  employment_start_date = struct["employment_start_date"]
  employment_termination_date = struct["employment_termination_date"]
  qualifications = parsed_json["qualifications"]&.map do |item|
    item = item.to_json
    CandidApiClient::Identifiers::Types::UpdatableIdentifier.from_json(json_object: item)
  end
  new(
    npi: npi,
    is_rendering: is_rendering,
    is_billing: is_billing,
    first_name: first_name,
    last_name: last_name,
    organization_name: organization_name,
    provider_type: provider_type,
    tax_id: tax_id,
    taxonomy_code: taxonomy_code,
    license_type: license_type,
    addresses: addresses,
    employment_start_date: employment_start_date,
    employment_termination_date: employment_termination_date,
    qualifications: qualifications,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 171

def self.validate_raw(obj:)
  obj.npi&.is_a?(String) != false || raise("Passed value for field obj.npi is not the expected type, validation failed.")
  obj.is_rendering&.is_a?(Boolean) != false || raise("Passed value for field obj.is_rendering is not the expected type, validation failed.")
  obj.is_billing&.is_a?(Boolean) != false || raise("Passed value for field obj.is_billing is not the expected type, validation failed.")
  obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
  obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
  obj.organization_name&.is_a?(String) != false || raise("Passed value for field obj.organization_name is not the expected type, validation failed.")
  obj.provider_type&.is_a?(CandidApiClient::OrganizationProviders::V2::Types::ProviderType) != false || raise("Passed value for field obj.provider_type is not the expected type, validation failed.")
  obj.tax_id&.is_a?(String) != false || raise("Passed value for field obj.tax_id is not the expected type, validation failed.")
  obj.taxonomy_code&.is_a?(String) != false || raise("Passed value for field obj.taxonomy_code is not the expected type, validation failed.")
  obj.license_type&.is_a?(CandidApiClient::OrganizationProviders::V2::Types::LicenseType) != false || raise("Passed value for field obj.license_type is not the expected type, validation failed.")
  obj.addresses&.is_a?(Array) != false || raise("Passed value for field obj.addresses is not the expected type, validation failed.")
  obj.employment_start_date&.is_a?(String) != false || raise("Passed value for field obj.employment_start_date is not the expected type, validation failed.")
  obj.employment_termination_date&.is_a?(String) != false || raise("Passed value for field obj.employment_termination_date is not the expected type, validation failed.")
  obj.qualifications&.is_a?(Array) != false || raise("Passed value for field obj.qualifications is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of OrganizationProviderUpdateV2 to a JSON object

Returns:

  • (String)


161
162
163
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb', line 161

def to_json(*_args)
  @_field_set&.to_json
end