Class: CandidApiClient::InsuranceAdjudications::V1::Types::ClaimAdjudication
- Inherits:
-
Object
- Object
- CandidApiClient::InsuranceAdjudications::V1::Types::ClaimAdjudication
- Defined in:
- lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #carcs ⇒ Array<CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode> readonly
- #charge_amount_cents ⇒ Integer readonly
- #claim_id ⇒ String readonly
- #insurance_allowed_amount_cents ⇒ Integer readonly
- #insurance_paid_amount_cents ⇒ Integer readonly
- #payer_claim_number ⇒ String readonly
- #service_lines ⇒ Hash{String => Array} readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::ClaimAdjudication
Deserialize a JSON object to an instance of ClaimAdjudication.
-
.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(claim_id:, service_lines:, carcs:, insurance_allowed_amount_cents: OMIT, insurance_paid_amount_cents: OMIT, charge_amount_cents: OMIT, payer_claim_number: OMIT, additional_properties: nil) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::ClaimAdjudication constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ClaimAdjudication to a JSON object.
Constructor Details
#initialize(claim_id:, service_lines:, carcs:, insurance_allowed_amount_cents: OMIT, insurance_paid_amount_cents: OMIT, charge_amount_cents: OMIT, payer_claim_number: OMIT, additional_properties: nil) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::ClaimAdjudication
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 43 def initialize(claim_id:, service_lines:, carcs:, insurance_allowed_amount_cents: OMIT, insurance_paid_amount_cents: OMIT, charge_amount_cents: OMIT, payer_claim_number: OMIT, additional_properties: nil) @claim_id = claim_id @insurance_allowed_amount_cents = insurance_allowed_amount_cents if insurance_allowed_amount_cents != OMIT @insurance_paid_amount_cents = insurance_paid_amount_cents if insurance_paid_amount_cents != OMIT @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT @service_lines = service_lines @payer_claim_number = payer_claim_number if payer_claim_number != OMIT @carcs = carcs @additional_properties = additional_properties @_field_set = { "claim_id": claim_id, "insurance_allowed_amount_cents": insurance_allowed_amount_cents, "insurance_paid_amount_cents": insurance_paid_amount_cents, "charge_amount_cents": charge_amount_cents, "service_lines": service_lines, "payer_claim_number": payer_claim_number, "carcs": carcs }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
27 28 29 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 27 def additional_properties @additional_properties end |
#carcs ⇒ Array<CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode> (readonly)
25 26 27 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 25 def carcs @carcs end |
#charge_amount_cents ⇒ Integer (readonly)
19 20 21 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 19 def charge_amount_cents @charge_amount_cents end |
#claim_id ⇒ String (readonly)
13 14 15 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 13 def claim_id @claim_id end |
#insurance_allowed_amount_cents ⇒ Integer (readonly)
15 16 17 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 15 def insurance_allowed_amount_cents @insurance_allowed_amount_cents end |
#insurance_paid_amount_cents ⇒ Integer (readonly)
17 18 19 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 17 def insurance_paid_amount_cents @insurance_paid_amount_cents end |
#payer_claim_number ⇒ String (readonly)
23 24 25 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 23 def payer_claim_number @payer_claim_number end |
#service_lines ⇒ Hash{String => Array} (readonly)
21 22 23 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 21 def service_lines @service_lines end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::ClaimAdjudication
Deserialize a JSON object to an instance of ClaimAdjudication
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 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 70 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) claim_id = struct["claim_id"] insurance_allowed_amount_cents = struct["insurance_allowed_amount_cents"] insurance_paid_amount_cents = struct["insurance_paid_amount_cents"] charge_amount_cents = struct["charge_amount_cents"] service_lines = parsed_json["service_lines"]&.transform_values do |value| value&.map do |item| item = item.to_json CandidApiClient::InsuranceAdjudications::V1::Types::ServiceLineAdjudication.from_json(json_object: item) end end payer_claim_number = struct["payer_claim_number"] carcs = parsed_json["carcs"]&.map do |item| item = item.to_json CandidApiClient::X12::V1::Types::ClaimAdjustmentReasonCode.from_json(json_object: item) end new( claim_id: claim_id, insurance_allowed_amount_cents: insurance_allowed_amount_cents, insurance_paid_amount_cents: insurance_paid_amount_cents, charge_amount_cents: charge_amount_cents, service_lines: service_lines, payer_claim_number: payer_claim_number, carcs: carcs, 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.
113 114 115 116 117 118 119 120 121 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 113 def self.validate_raw(obj:) obj.claim_id.is_a?(String) != false || raise("Passed value for field obj.claim_id is not the expected type, validation failed.") obj.insurance_allowed_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.insurance_allowed_amount_cents is not the expected type, validation failed.") obj.insurance_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.insurance_paid_amount_cents is not the expected type, validation failed.") obj.charge_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.charge_amount_cents is not the expected type, validation failed.") obj.service_lines.is_a?(Hash) != false || raise("Passed value for field obj.service_lines is not the expected type, validation failed.") obj.payer_claim_number&.is_a?(String) != false || raise("Passed value for field obj.payer_claim_number is not the expected type, validation failed.") obj.carcs.is_a?(Array) != false || raise("Passed value for field obj.carcs is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ClaimAdjudication to a JSON object
103 104 105 |
# File 'lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb', line 103 def to_json(*_args) @_field_set&.to_json end |