Class: CandidApiClient::EncounterProviders::V2::Types::EncounterProvider
- Inherits:
-
Object
- Object
- CandidApiClient::EncounterProviders::V2::Types::EncounterProvider
- Defined in:
- lib/candidhealth/encounter_providers/v_2/types/encounter_provider.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
-
#organization_name ⇒ String
readonly
If the provider is an organization, this should be set instead of first + last name.
-
#provider_commercial_license_type ⇒ CandidApiClient::Commons::Types::BillingProviderCommercialLicenseType
readonly
837i Loop2010BB G2 Provider Commercial Number.
- #provider_id ⇒ String readonly
- #qualifier ⇒ CandidApiClient::Commons::Types::QualifierCode readonly
- #tax_id ⇒ String readonly
- #taxonomy_code ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::EncounterProviders::V2::Types::EncounterProvider
Deserialize a JSON object to an instance of EncounterProvider.
-
.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(provider_id:, address:, npi:, tax_id: OMIT, taxonomy_code: OMIT, qualifier: OMIT, provider_commercial_license_type: OMIT, first_name: OMIT, last_name: OMIT, organization_name: OMIT, additional_properties: nil) ⇒ CandidApiClient::EncounterProviders::V2::Types::EncounterProvider constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of EncounterProvider to a JSON object.
Constructor Details
#initialize(provider_id:, address:, npi:, tax_id: OMIT, taxonomy_code: OMIT, qualifier: OMIT, provider_commercial_license_type: OMIT, first_name: OMIT, last_name: OMIT, organization_name: OMIT, additional_properties: nil) ⇒ CandidApiClient::EncounterProviders::V2::Types::EncounterProvider
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 62 def initialize(provider_id:, address:, npi:, tax_id: OMIT, taxonomy_code: OMIT, qualifier: OMIT, provider_commercial_license_type: OMIT, first_name: OMIT, last_name: OMIT, organization_name: OMIT, additional_properties: nil) @provider_id = provider_id @address = address @tax_id = tax_id if tax_id != OMIT @npi = npi @taxonomy_code = taxonomy_code if taxonomy_code != OMIT @qualifier = qualifier if qualifier != OMIT if provider_commercial_license_type != OMIT @provider_commercial_license_type = provider_commercial_license_type end @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 = { "provider_id": provider_id, "address": address, "tax_id": tax_id, "npi": npi, "taxonomy_code": taxonomy_code, "qualifier": qualifier, "provider_commercial_license_type": provider_commercial_license_type, "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.
39 40 41 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 39 def additional_properties @additional_properties end |
#address ⇒ CandidApiClient::Commons::Types::StreetAddressLongZip (readonly)
17 18 19 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 17 def address @address end |
#first_name ⇒ String (readonly)
Returns If the provider is an individual, this should be set instead of organization name.
31 32 33 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 31 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.
34 35 36 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 34 def last_name @last_name end |
#npi ⇒ String (readonly)
21 22 23 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 21 def npi @npi end |
#organization_name ⇒ String (readonly)
Returns If the provider is an organization, this should be set instead of first + last name.
37 38 39 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 37 def organization_name @organization_name end |
#provider_commercial_license_type ⇒ CandidApiClient::Commons::Types::BillingProviderCommercialLicenseType (readonly)
Returns 837i Loop2010BB G2 Provider Commercial Number.
28 29 30 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 28 def provider_commercial_license_type @provider_commercial_license_type end |
#provider_id ⇒ String (readonly)
15 16 17 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 15 def provider_id @provider_id end |
#qualifier ⇒ CandidApiClient::Commons::Types::QualifierCode (readonly)
25 26 27 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 25 def qualifier @qualifier end |
#tax_id ⇒ String (readonly)
19 20 21 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 19 def tax_id @tax_id end |
#taxonomy_code ⇒ String (readonly)
23 24 25 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 23 def taxonomy_code @taxonomy_code end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::EncounterProviders::V2::Types::EncounterProvider
Deserialize a JSON object to an instance of EncounterProvider
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 97 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) provider_id = struct["provider_id"] 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 tax_id = struct["tax_id"] npi = struct["npi"] taxonomy_code = struct["taxonomy_code"] qualifier = struct["qualifier"] provider_commercial_license_type = struct["provider_commercial_license_type"] first_name = struct["first_name"] last_name = struct["last_name"] organization_name = struct["organization_name"] new( provider_id: provider_id, address: address, tax_id: tax_id, npi: npi, taxonomy_code: taxonomy_code, qualifier: qualifier, provider_commercial_license_type: provider_commercial_license_type, 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.
143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 143 def self.validate_raw(obj:) obj.provider_id.is_a?(String) != false || raise("Passed value for field obj.provider_id is not the expected type, validation failed.") CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.address) obj.tax_id&.is_a?(String) != false || raise("Passed value for field obj.tax_id is not the expected type, validation failed.") 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.qualifier&.is_a?(CandidApiClient::Commons::Types::QualifierCode) != false || raise("Passed value for field obj.qualifier is not the expected type, validation failed.") 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.") 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 EncounterProvider to a JSON object
133 134 135 |
# File 'lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb', line 133 def to_json(*_args) @_field_set&.to_json end |