Class: CandidApiClient::OrganizationProviders::V2::Types::OrganizationProviderBase

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/organization_providers/v_2/types/organization_provider_base.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:, first_name: OMIT, last_name: OMIT, organization_name: OMIT, tax_id: OMIT, taxonomy_code: OMIT, ptan: OMIT, medicaid_provider_id: OMIT, addresses: OMIT, additional_properties: nil) ⇒ CandidApiClient::OrganizationProviders::V2::Types::OrganizationProviderBase

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.

  • ptan (String) (defaults to: OMIT)

    The Provider Transaction Access Number for the provider.

  • medicaid_provider_id (String) (defaults to: OMIT)

    The medicaid provider ID for the provider.

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

    The addresses associated with this provider.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



69
70
71
72
73
74
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
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 69

def initialize(npi:, is_rendering:, is_billing:, provider_type:, license_type:, first_name: OMIT,
               last_name: OMIT, organization_name: OMIT, tax_id: OMIT, taxonomy_code: OMIT, ptan: OMIT, medicaid_provider_id: OMIT, addresses: 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
  @ptan = ptan if ptan != OMIT
  @medicaid_provider_id = medicaid_provider_id if medicaid_provider_id != OMIT
  @addresses = addresses if addresses != 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,
    "ptan": ptan,
    "medicaid_provider_id": medicaid_provider_id,
    "addresses": addresses
  }.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



44
45
46
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 44

def additional_properties
  @additional_properties
end

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

Returns The addresses associated with this provider.

Returns:



42
43
44
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 42

def addresses
  @addresses
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.



22
23
24
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 22

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.



20
21
22
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 20

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.



18
19
20
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 18

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.



24
25
26
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 24

def last_name
  @last_name
end

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

Returns The type of license that the provider holds.

Returns:



36
37
38
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 36

def license_type
  @license_type
end

#medicaid_provider_idString (readonly)

Returns The medicaid provider ID for the provider.

Returns:

  • (String)

    The medicaid provider ID for the provider.



40
41
42
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 40

def medicaid_provider_id
  @medicaid_provider_id
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.



16
17
18
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 16

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.



26
27
28
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 26

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:



29
30
31
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 29

def provider_type
  @provider_type
end

#ptanString (readonly)

Returns The Provider Transaction Access Number for the provider.

Returns:

  • (String)

    The Provider Transaction Access Number for the provider.



38
39
40
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 38

def ptan
  @ptan
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.



32
33
34
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 32

def tax_id
  @tax_id
end

#taxonomy_codeString (readonly)

Returns A code designating classification and specialization.

Returns:

  • (String)

    A code designating classification and specialization.



34
35
36
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 34

def taxonomy_code
  @taxonomy_code
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::OrganizationProviders::V2::Types::OrganizationProviderBase

Deserialize a JSON object to an instance of OrganizationProviderBase



108
109
110
111
112
113
114
115
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
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 108

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"]
  ptan = struct["ptan"]
  medicaid_provider_id = struct["medicaid_provider_id"]
  addresses = parsed_json["addresses"]&.map do |item|
    item = item.to_json
    CandidApiClient::OrganizationProviders::V2::Types::OrganizationProviderAddress.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,
    ptan: ptan,
    medicaid_provider_id: medicaid_provider_id,
    addresses: addresses,
    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)


158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 158

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.ptan&.is_a?(String) != false || raise("Passed value for field obj.ptan is not the expected type, validation failed.")
  obj.medicaid_provider_id&.is_a?(String) != false || raise("Passed value for field obj.medicaid_provider_id 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.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of OrganizationProviderBase to a JSON object

Returns:

  • (String)


148
149
150
# File 'lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb', line 148

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