Class: CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate
- Inherits:
-
Object
- Object
- CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate
- Defined in:
- lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #address ⇒ CandidApiClient::Commons::Types::StreetAddressLongZip readonly
-
#first_name ⇒ String
readonly
If the provider is an individual, this should be set instead of organization name.
-
#last_name ⇒ String
readonly
If the provider is an individual, this should be set instead of organization name.
-
#npi ⇒ String
readonly
A National Provider Identifier is a unique 10-digit identification number issued to health care providers in the United States.
-
#organization_name ⇒ String
readonly
If the provider is an organization, this should be set instead of first + last name.
- #taxonomy_code ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate
Deserialize a JSON object to an instance of RenderingProviderUpdate.
-
.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.
Instance Method Summary collapse
- #initialize(npi: OMIT, taxonomy_code: OMIT, address: OMIT, first_name: OMIT, last_name: OMIT, organization_name: OMIT, additional_properties: nil) ⇒ CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of RenderingProviderUpdate to a JSON object.
Constructor Details
#initialize(npi: OMIT, taxonomy_code: OMIT, address: OMIT, first_name: OMIT, last_name: OMIT, organization_name: OMIT, additional_properties: nil) ⇒ CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 48 def initialize(npi: OMIT, taxonomy_code: OMIT, address: OMIT, first_name: OMIT, last_name: OMIT, organization_name: OMIT, additional_properties: nil) @npi = npi if npi != OMIT @taxonomy_code = taxonomy_code if taxonomy_code != OMIT @address = address if address != 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 @additional_properties = additional_properties @_field_set = { "npi": npi, "taxonomy_code": taxonomy_code, "address": address, "first_name": first_name, "last_name": last_name, "organization_name": organization_name }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
29 30 31 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 29 def additional_properties @additional_properties end |
#address ⇒ CandidApiClient::Commons::Types::StreetAddressLongZip (readonly)
18 19 20 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 18 def address @address end |
#first_name ⇒ String (readonly)
Returns If the provider is an individual, this should be set instead of organization name.
21 22 23 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 21 def first_name @first_name end |
#last_name ⇒ String (readonly)
Returns If the provider is an individual, this should be set instead of organization name.
24 25 26 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 24 def last_name @last_name end |
#npi ⇒ String (readonly)
Returns A National Provider Identifier is a unique 10-digit identification number issued to health care providers in the United States.
14 15 16 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 14 def npi @npi end |
#organization_name ⇒ String (readonly)
Returns If the provider is an organization, this should be set instead of first + last name.
27 28 29 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 27 def organization_name @organization_name end |
#taxonomy_code ⇒ String (readonly)
16 17 18 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 16 def taxonomy_code @taxonomy_code end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate
Deserialize a JSON object to an instance of RenderingProviderUpdate
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 73 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) npi = struct["npi"] taxonomy_code = struct["taxonomy_code"] if parsed_json["address"].nil? address = nil else address = parsed_json["address"].to_json address = CandidApiClient::Commons::Types::StreetAddressLongZip.from_json(json_object: address) end first_name = struct["first_name"] last_name = struct["last_name"] organization_name = struct["organization_name"] new( npi: npi, taxonomy_code: taxonomy_code, address: address, first_name: first_name, last_name: last_name, organization_name: organization_name, 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.
111 112 113 114 115 116 117 118 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 111 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.taxonomy_code&.is_a?(String) != false || raise("Passed value for field obj.taxonomy_code is not the expected type, validation failed.") obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.address) 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.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of RenderingProviderUpdate to a JSON object
101 102 103 |
# File 'lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb', line 101 def to_json(*_args) @_field_set&.to_json end |