Class: CandidApiClient::Contracts::V2::Types::ContractWithProviders
- Inherits:
-
Object
- Object
- CandidApiClient::Contracts::V2::Types::ContractWithProviders
- Defined in:
- lib/candidhealth/contracts/v_2/types/contract_with_providers.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #authorized_signatory ⇒ CandidApiClient::Contracts::V2::Types::AuthorizedSignatory readonly
-
#commercial_insurance_types ⇒ CandidApiClient::Contracts::V2::Types::InsuranceTypes
readonly
The commercial plan insurance types this contract applies.
- #contract_id ⇒ String readonly
- #contract_status ⇒ CandidApiClient::Contracts::V2::Types::ContractStatus readonly
-
#contracting_provider ⇒ CandidApiClient::OrganizationProviders::V2::Types::OrganizationProvider
readonly
The provider under contract.
-
#effective_date ⇒ String
readonly
The starting day upon which the contract is effective.
-
#expiration_date ⇒ String
readonly
An optional end day upon which the contract expires.
-
#medicaid_insurance_types ⇒ CandidApiClient::Contracts::V2::Types::InsuranceTypes
readonly
The Medicaid plan insurance types this contract applies.
-
#medicare_insurance_types ⇒ CandidApiClient::Contracts::V2::Types::InsuranceTypes
readonly
The Medicare plan insurance types this contract applies.
-
#payer ⇒ CandidApiClient::Payers::V3::Types::Payer
readonly
The insurance company under contract.
-
#provider_count ⇒ Integer
readonly
The number of linked providers who can render medical services under this contract.
-
#regions ⇒ CandidApiClient::Commons::Types::Regions
readonly
The state(s) to which the contract’s coverage extends.
-
#rendering_provider_ids ⇒ Set<String>
readonly
The providers who can render medical services under the contract.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
Deserialize a JSON object to an instance of ContractWithProviders.
-
.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(rendering_provider_ids:, contract_id:, contracting_provider:, provider_count:, payer:, effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, expiration_date: OMIT, contract_status: OMIT, authorized_signatory: OMIT, additional_properties: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ContractWithProviders to a JSON object.
Constructor Details
#initialize(rendering_provider_ids:, contract_id:, contracting_provider:, provider_count:, payer:, effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, expiration_date: OMIT, contract_status: OMIT, authorized_signatory: OMIT, additional_properties: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
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 103 104 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 71 def initialize(rendering_provider_ids:, contract_id:, contracting_provider:, provider_count:, payer:, effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, expiration_date: OMIT, contract_status: OMIT, authorized_signatory: OMIT, additional_properties: nil) @rendering_provider_ids = rendering_provider_ids @contract_id = contract_id @contracting_provider = contracting_provider @provider_count = provider_count @payer = payer @effective_date = effective_date @expiration_date = expiration_date if expiration_date != OMIT @regions = regions @contract_status = contract_status if contract_status != OMIT @authorized_signatory = if != OMIT @commercial_insurance_types = commercial_insurance_types @medicare_insurance_types = medicare_insurance_types @medicaid_insurance_types = medicaid_insurance_types @additional_properties = additional_properties @_field_set = { "rendering_provider_ids": rendering_provider_ids, "contract_id": contract_id, "contracting_provider": contracting_provider, "provider_count": provider_count, "payer": payer, "effective_date": effective_date, "expiration_date": expiration_date, "regions": regions, "contract_status": contract_status, "authorized_signatory": , "commercial_insurance_types": commercial_insurance_types, "medicare_insurance_types": medicare_insurance_types, "medicaid_insurance_types": medicaid_insurance_types }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
47 48 49 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 47 def additional_properties @additional_properties end |
#authorized_signatory ⇒ CandidApiClient::Contracts::V2::Types::AuthorizedSignatory (readonly)
39 40 41 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 39 def @authorized_signatory end |
#commercial_insurance_types ⇒ CandidApiClient::Contracts::V2::Types::InsuranceTypes (readonly)
Returns The commercial plan insurance types this contract applies.
41 42 43 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 41 def commercial_insurance_types @commercial_insurance_types end |
#contract_id ⇒ String (readonly)
21 22 23 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 21 def contract_id @contract_id end |
#contract_status ⇒ CandidApiClient::Contracts::V2::Types::ContractStatus (readonly)
37 38 39 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 37 def contract_status @contract_status end |
#contracting_provider ⇒ CandidApiClient::OrganizationProviders::V2::Types::OrganizationProvider (readonly)
Returns The provider under contract.
23 24 25 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 23 def contracting_provider @contracting_provider end |
#effective_date ⇒ String (readonly)
Returns The starting day upon which the contract is effective.
30 31 32 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 30 def effective_date @effective_date end |
#expiration_date ⇒ String (readonly)
Returns An optional end day upon which the contract expires.
32 33 34 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 32 def expiration_date @expiration_date end |
#medicaid_insurance_types ⇒ CandidApiClient::Contracts::V2::Types::InsuranceTypes (readonly)
Returns The Medicaid plan insurance types this contract applies.
45 46 47 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 45 def medicaid_insurance_types @medicaid_insurance_types end |
#medicare_insurance_types ⇒ CandidApiClient::Contracts::V2::Types::InsuranceTypes (readonly)
Returns The Medicare plan insurance types this contract applies.
43 44 45 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 43 def medicare_insurance_types @medicare_insurance_types end |
#payer ⇒ CandidApiClient::Payers::V3::Types::Payer (readonly)
Returns The insurance company under contract.
28 29 30 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 28 def payer @payer end |
#provider_count ⇒ Integer (readonly)
Returns The number of linked providers who can render medical services under this contract.
26 27 28 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 26 def provider_count @provider_count end |
#regions ⇒ CandidApiClient::Commons::Types::Regions (readonly)
Returns The state(s) to which the contract’s coverage extends. It may also be set to “national” for the entirety of the US.
35 36 37 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 35 def regions @regions end |
#rendering_provider_ids ⇒ Set<String> (readonly)
Returns The providers who can render medical services under the contract.
19 20 21 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 19 def rendering_provider_ids @rendering_provider_ids end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
Deserialize a JSON object to an instance of ContractWithProviders
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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 110 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["rendering_provider_ids"].nil? rendering_provider_ids = nil else rendering_provider_ids = parsed_json["rendering_provider_ids"].to_json rendering_provider_ids = Set.new(rendering_provider_ids) end contract_id = struct["contract_id"] if parsed_json["contracting_provider"].nil? contracting_provider = nil else contracting_provider = parsed_json["contracting_provider"].to_json contracting_provider = CandidApiClient::OrganizationProviders::V2::Types::OrganizationProvider.from_json(json_object: contracting_provider) end provider_count = struct["provider_count"] if parsed_json["payer"].nil? payer = nil else payer = parsed_json["payer"].to_json payer = CandidApiClient::Payers::V3::Types::Payer.from_json(json_object: payer) end effective_date = struct["effective_date"] expiration_date = struct["expiration_date"] if parsed_json["regions"].nil? regions = nil else regions = parsed_json["regions"].to_json regions = CandidApiClient::Commons::Types::Regions.from_json(json_object: regions) end contract_status = struct["contract_status"] if parsed_json["authorized_signatory"].nil? = nil else = parsed_json["authorized_signatory"].to_json = CandidApiClient::Contracts::V2::Types::AuthorizedSignatory.from_json(json_object: ) end if parsed_json["commercial_insurance_types"].nil? commercial_insurance_types = nil else commercial_insurance_types = parsed_json["commercial_insurance_types"].to_json commercial_insurance_types = CandidApiClient::Contracts::V2::Types::InsuranceTypes.from_json(json_object: commercial_insurance_types) end if parsed_json["medicare_insurance_types"].nil? medicare_insurance_types = nil else medicare_insurance_types = parsed_json["medicare_insurance_types"].to_json medicare_insurance_types = CandidApiClient::Contracts::V2::Types::InsuranceTypes.from_json(json_object: medicare_insurance_types) end if parsed_json["medicaid_insurance_types"].nil? medicaid_insurance_types = nil else medicaid_insurance_types = parsed_json["medicaid_insurance_types"].to_json medicaid_insurance_types = CandidApiClient::Contracts::V2::Types::InsuranceTypes.from_json(json_object: medicaid_insurance_types) end new( rendering_provider_ids: rendering_provider_ids, contract_id: contract_id, contracting_provider: contracting_provider, provider_count: provider_count, payer: payer, effective_date: effective_date, expiration_date: expiration_date, regions: regions, contract_status: contract_status, authorized_signatory: , commercial_insurance_types: commercial_insurance_types, medicare_insurance_types: medicare_insurance_types, medicaid_insurance_types: medicaid_insurance_types, 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.
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 197 def self.validate_raw(obj:) obj.rendering_provider_ids.is_a?(Set) != false || raise("Passed value for field obj.rendering_provider_ids is not the expected type, validation failed.") obj.contract_id.is_a?(String) != false || raise("Passed value for field obj.contract_id is not the expected type, validation failed.") CandidApiClient::OrganizationProviders::V2::Types::OrganizationProvider.validate_raw(obj: obj.contracting_provider) obj.provider_count.is_a?(Integer) != false || raise("Passed value for field obj.provider_count is not the expected type, validation failed.") CandidApiClient::Payers::V3::Types::Payer.validate_raw(obj: obj.payer) obj.effective_date.is_a?(String) != false || raise("Passed value for field obj.effective_date is not the expected type, validation failed.") obj.expiration_date&.is_a?(String) != false || raise("Passed value for field obj.expiration_date is not the expected type, validation failed.") CandidApiClient::Commons::Types::Regions.validate_raw(obj: obj.regions) obj.contract_status&.is_a?(CandidApiClient::Contracts::V2::Types::ContractStatus) != false || raise("Passed value for field obj.contract_status is not the expected type, validation failed.") obj..nil? || CandidApiClient::Contracts::V2::Types::AuthorizedSignatory.validate_raw(obj: obj.) CandidApiClient::Contracts::V2::Types::InsuranceTypes.validate_raw(obj: obj.commercial_insurance_types) CandidApiClient::Contracts::V2::Types::InsuranceTypes.validate_raw(obj: obj.medicare_insurance_types) CandidApiClient::Contracts::V2::Types::InsuranceTypes.validate_raw(obj: obj.medicaid_insurance_types) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ContractWithProviders to a JSON object
187 188 189 |
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 187 def to_json(*_args) @_field_set&.to_json end |