Class: CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(insurance_adjudication_id:, payer_uuid:, check_date:, claims:, post_date: OMIT, check_number: OMIT, note: OMIT, additional_properties: nil) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication

Parameters:

  • insurance_adjudication_id (String)
  • payer_uuid (String)
  • post_date (Date) (defaults to: OMIT)
  • check_number (String) (defaults to: OMIT)
  • check_date (Date)
  • note (String) (defaults to: OMIT)
  • claims (Hash{String => Array})
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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/insurance_adjudication.rb', line 43

def initialize(insurance_adjudication_id:, payer_uuid:, check_date:, claims:, post_date: OMIT, check_number: OMIT,
               note: OMIT, additional_properties: nil)
  @insurance_adjudication_id = insurance_adjudication_id
  @payer_uuid = payer_uuid
  @post_date =  if  != OMIT
  @check_number = check_number if check_number != OMIT
  @check_date = check_date
  @note = note if note != OMIT
  @claims = claims
  @additional_properties = additional_properties
  @_field_set = {
    "insurance_adjudication_id": insurance_adjudication_id,
    "payer_uuid": payer_uuid,
    "post_date": ,
    "check_number": check_number,
    "check_date": check_date,
    "note": note,
    "claims": claims
  }.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



27
28
29
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 27

def additional_properties
  @additional_properties
end

#check_dateDate (readonly)

Returns:

  • (Date)


21
22
23
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 21

def check_date
  @check_date
end

#check_numberString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 19

def check_number
  @check_number
end

#claimsHash{String => Array} (readonly)

Returns:

  • (Hash{String => Array})


25
26
27
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 25

def claims
  @claims
end

#insurance_adjudication_idString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 13

def insurance_adjudication_id
  @insurance_adjudication_id
end

#noteString (readonly)

Returns:

  • (String)


23
24
25
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 23

def note
  @note
end

#payer_uuidString (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 15

def payer_uuid
  @payer_uuid
end

#post_dateDate (readonly)

Returns:

  • (Date)


17
18
19
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 17

def 
  @post_date
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication

Deserialize a JSON object to an instance of InsuranceAdjudication



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
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 70

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  insurance_adjudication_id = struct["insurance_adjudication_id"]
  payer_uuid = struct["payer_uuid"]
   = (Date.parse(parsed_json["post_date"]) unless parsed_json["post_date"].nil?)
  check_number = struct["check_number"]
  check_date = (Date.parse(parsed_json["check_date"]) unless parsed_json["check_date"].nil?)
  note = struct["note"]
  claims = parsed_json["claims"]&.transform_values do |value|
    value&.map do |item|
      item = item.to_json
      CandidApiClient::InsuranceAdjudications::V1::Types::ClaimAdjudication.from_json(json_object: item)
    end
  end
  new(
    insurance_adjudication_id: insurance_adjudication_id,
    payer_uuid: payer_uuid,
    post_date: ,
    check_number: check_number,
    check_date: check_date,
    note: note,
    claims: claims,
    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)


110
111
112
113
114
115
116
117
118
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 110

def self.validate_raw(obj:)
  obj.insurance_adjudication_id.is_a?(String) != false || raise("Passed value for field obj.insurance_adjudication_id is not the expected type, validation failed.")
  obj.payer_uuid.is_a?(String) != false || raise("Passed value for field obj.payer_uuid is not the expected type, validation failed.")
  obj.&.is_a?(Date) != false || raise("Passed value for field obj.post_date is not the expected type, validation failed.")
  obj.check_number&.is_a?(String) != false || raise("Passed value for field obj.check_number is not the expected type, validation failed.")
  obj.check_date.is_a?(Date) != false || raise("Passed value for field obj.check_date is not the expected type, validation failed.")
  obj.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.")
  obj.claims.is_a?(Hash) != false || raise("Passed value for field obj.claims is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of InsuranceAdjudication to a JSON object

Returns:

  • (String)


100
101
102
# File 'lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb', line 100

def to_json(*_args)
  @_field_set&.to_json
end