Class: CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(claim_created_at:, patient_control_number:, submission_records:, additional_properties: nil) ⇒ CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate

Parameters:

  • claim_created_at (DateTime)

    When the claim was created in the external system.

  • patient_control_number (String)

    The Patient Control Number sent on the claim to the payer. To guarantee compatibility with all payers, this field must consist only of uppercase letters and numbers and be no more than 14 characters long.

  • submission_records (Array<CandidApiClient::ClaimSubmission::V1::Types::ClaimSubmissionRecordCreate>)

    A successful claim submission record will be created for each value provided. An empty list may be provided for cases where the claim originated in an external system but was never submitted to a payer.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb', line 40

def initialize(claim_created_at:, patient_control_number:, submission_records:, additional_properties: nil)
  @claim_created_at = claim_created_at
  @patient_control_number = patient_control_number
  @submission_records = submission_records
  @additional_properties = additional_properties
  @_field_set = {
    "claim_created_at": claim_created_at,
    "patient_control_number": patient_control_number,
    "submission_records": submission_records
  }
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



24
25
26
# File 'lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb', line 24

def additional_properties
  @additional_properties
end

#claim_created_atDateTime (readonly)

Returns When the claim was created in the external system.

Returns:

  • (DateTime)

    When the claim was created in the external system.



14
15
16
# File 'lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb', line 14

def claim_created_at
  @claim_created_at
end

#patient_control_numberString (readonly)

Returns The Patient Control Number sent on the claim to the payer. To guarantee compatibility with all payers, this field must consist only of uppercase letters and numbers and be no more than 14 characters long.

Returns:

  • (String)

    The Patient Control Number sent on the claim to the payer. To guarantee compatibility with all payers, this field must consist only of uppercase letters and numbers and be no more than 14 characters long.



18
19
20
# File 'lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb', line 18

def patient_control_number
  @patient_control_number
end

#submission_recordsArray<CandidApiClient::ClaimSubmission::V1::Types::ClaimSubmissionRecordCreate> (readonly)

Returns A successful claim submission record will be created for each value provided. An empty list may be provided for cases where the claim originated in an external system but was never submitted to a payer.

Returns:



22
23
24
# File 'lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb', line 22

def submission_records
  @submission_records
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate

Deserialize a JSON object to an instance of ExternalClaimSubmissionCreate



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb', line 56

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  claim_created_at = unless parsed_json["claim_created_at"].nil?
                       DateTime.parse(parsed_json["claim_created_at"])
                     end
  patient_control_number = struct["patient_control_number"]
  submission_records = parsed_json["submission_records"]&.map do |item|
    item = item.to_json
    CandidApiClient::ClaimSubmission::V1::Types::ClaimSubmissionRecordCreate.from_json(json_object: item)
  end
  new(
    claim_created_at: claim_created_at,
    patient_control_number: patient_control_number,
    submission_records: submission_records,
    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)


88
89
90
91
92
# File 'lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb', line 88

def self.validate_raw(obj:)
  obj.claim_created_at.is_a?(DateTime) != false || raise("Passed value for field obj.claim_created_at is not the expected type, validation failed.")
  obj.patient_control_number.is_a?(String) != false || raise("Passed value for field obj.patient_control_number is not the expected type, validation failed.")
  obj.submission_records.is_a?(Array) != false || raise("Passed value for field obj.submission_records is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ExternalClaimSubmissionCreate to a JSON object

Returns:

  • (String)


78
79
80
# File 'lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb', line 78

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