Class: CandidApiClient::Contracts::V2::Types::ContractWithProviders

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/contracts/v_2/types/contract_with_providers.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:



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 = authorized_signatory if authorized_signatory != 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": 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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_signatoryCandidApiClient::Contracts::V2::Types::AuthorizedSignatory (readonly)



39
40
41
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 39

def authorized_signatory
  @authorized_signatory
end

#commercial_insurance_typesCandidApiClient::Contracts::V2::Types::InsuranceTypes (readonly)

Returns The commercial plan insurance types this contract applies.

Returns:



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_idString (readonly)

Returns:

  • (String)


21
22
23
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 21

def contract_id
  @contract_id
end

#contract_statusCandidApiClient::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_providerCandidApiClient::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_dateString (readonly)

Returns The starting day upon which the contract is effective.

Returns:

  • (String)

    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_dateString (readonly)

Returns An optional end day upon which the contract expires.

Returns:

  • (String)

    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_typesCandidApiClient::Contracts::V2::Types::InsuranceTypes (readonly)

Returns The Medicaid plan insurance types this contract applies.

Returns:



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_typesCandidApiClient::Contracts::V2::Types::InsuranceTypes (readonly)

Returns The Medicare plan insurance types this contract applies.

Returns:



43
44
45
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 43

def medicare_insurance_types
  @medicare_insurance_types
end

#payerCandidApiClient::Payers::V3::Types::Payer (readonly)

Returns The insurance company under contract.

Returns:



28
29
30
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 28

def payer
  @payer
end

#provider_countInteger (readonly)

Returns The number of linked providers who can render medical services under this contract.

Returns:

  • (Integer)

    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

#regionsCandidApiClient::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.

Returns:



35
36
37
# File 'lib/candidhealth/contracts/v_2/types/contract_with_providers.rb', line 35

def regions
  @regions
end

#rendering_provider_idsSet<String> (readonly)

Returns The providers who can render medical services under the contract.

Returns:

  • (Set<String>)

    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

Parameters:

  • json_object (String)

Returns:



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?
    authorized_signatory = nil
  else
    authorized_signatory = parsed_json["authorized_signatory"].to_json
    authorized_signatory = CandidApiClient::Contracts::V2::Types::AuthorizedSignatory.from_json(json_object: authorized_signatory)
  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: 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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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.authorized_signatory.nil? || CandidApiClient::Contracts::V2::Types::AuthorizedSignatory.validate_raw(obj: obj.authorized_signatory)
  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

Returns:

  • (String)


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