Class: CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderV2

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/organization_providers/v_3/types/organization_provider_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:, is_rendering:, is_billing:, provider_type:, license_type:, organization_provider_id:, qualifications:, first_name: OMIT, last_name: OMIT, organization_name: OMIT, tax_id: OMIT, taxonomy_code: OMIT, addresses: OMIT, employment_start_date: OMIT, employment_termination_date: OMIT, additional_properties: nil) ⇒ CandidApiClient::OrganizationProviders::V3::Types::OrganizationProviderV2

Parameters:

  • npi (String)

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

  • is_rendering (Boolean)

    Whether the provider can be used to render services.

  • is_billing (Boolean)

    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)

    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)

    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 (Date) (defaults to: OMIT)

    The employment start date for the provider.

  • employment_termination_date (Date) (defaults to: OMIT)

    The employment termination date for the provider.

  • organization_provider_id (String)

    Auto-generated ID set on creation.

  • qualifications (Array<CandidApiClient::Identifiers::Types::Identifier>)

    Qualification given to a provider (PTAN, Medicaid Provider Id etc.).

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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
111
112
113
114
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 77

def initialize(npi:, is_rendering:, is_billing:, provider_type:, license_type:, organization_provider_id:,
               qualifications:, first_name: OMIT, last_name: OMIT, organization_name: OMIT, tax_id: OMIT, taxonomy_code: OMIT, addresses: OMIT, employment_start_date: OMIT, employment_termination_date: OMIT, additional_properties: nil)
  @npi = npi
  @is_rendering = is_rendering
  @is_billing = is_billing
  @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
  @tax_id = tax_id if tax_id != OMIT
  @taxonomy_code = taxonomy_code if taxonomy_code != OMIT
  @license_type = license_type
  @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
  @organization_provider_id = organization_provider_id
  @qualifications = qualifications
  @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,
    "organization_provider_id": organization_provider_id,
    "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



50
51
52
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 50

def additional_properties
  @additional_properties
end

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

Returns The addresses associated with this provider.

Returns:



40
41
42
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 40

def addresses
  @addresses
end

#employment_start_dateDate (readonly)

Returns The employment start date for the provider.

Returns:

  • (Date)

    The employment start date for the provider.



42
43
44
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 42

def employment_start_date
  @employment_start_date
end

#employment_termination_dateDate (readonly)

Returns The employment termination date for the provider.

Returns:

  • (Date)

    The employment termination date for the provider.



44
45
46
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 44

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.



24
25
26
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 24

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.



22
23
24
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 22

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.



20
21
22
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 20

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.



26
27
28
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 26

def last_name
  @last_name
end

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

Returns The type of license that the provider holds.

Returns:



38
39
40
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 38

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.



18
19
20
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 18

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.



28
29
30
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 28

def organization_name
  @organization_name
end

#organization_provider_idString (readonly)

Returns Auto-generated ID set on creation.

Returns:

  • (String)

    Auto-generated ID set on creation.



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

def organization_provider_id
  @organization_provider_id
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:



31
32
33
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 31

def provider_type
  @provider_type
end

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

Returns Qualification given to a provider (PTAN, Medicaid Provider Id etc.).

Returns:



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

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.



34
35
36
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 34

def tax_id
  @tax_id
end

#taxonomy_codeString (readonly)

Returns A code designating classification and specialization.

Returns:

  • (String)

    A code designating classification and specialization.



36
37
38
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 36

def taxonomy_code
  @taxonomy_code
end

Class Method Details

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

Deserialize a JSON object to an instance of OrganizationProviderV2



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
157
158
159
160
161
162
163
164
165
166
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 120

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 = unless parsed_json["employment_start_date"].nil?
                            Date.parse(parsed_json["employment_start_date"])
                          end
  employment_termination_date = unless parsed_json["employment_termination_date"].nil?
                                  Date.parse(parsed_json["employment_termination_date"])
                                end
  organization_provider_id = struct["organization_provider_id"]
  qualifications = parsed_json["qualifications"]&.map do |item|
    item = item.to_json
    CandidApiClient::Identifiers::Types::Identifier.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,
    organization_provider_id: organization_provider_id,
    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)


181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 181

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?(Date) != false || raise("Passed value for field obj.employment_start_date is not the expected type, validation failed.")
  obj.employment_termination_date&.is_a?(Date) != false || raise("Passed value for field obj.employment_termination_date is not the expected type, validation failed.")
  obj.organization_provider_id.is_a?(String) != false || raise("Passed value for field obj.organization_provider_id 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 OrganizationProviderV2 to a JSON object

Returns:

  • (String)


171
172
173
# File 'lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb', line 171

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