Class: CandidApiClient::PreEncounter::Patients::V1::Types::PotentialDuplicatePatient

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(existing_patient_id:, existing_patient_mrn:, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Patients::V1::Types::PotentialDuplicatePatient

Parameters:

  • existing_patient_id (String)
  • existing_patient_mrn (String)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



28
29
30
31
32
33
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb', line 28

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



17
18
19
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb', line 17

def additional_properties
  @additional_properties
end

#existing_patient_idString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb', line 13

def existing_patient_id
  @existing_patient_id
end

#existing_patient_mrnString (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb', line 15

def existing_patient_mrn
  @existing_patient_mrn
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Patients::V1::Types::PotentialDuplicatePatient

Deserialize a JSON object to an instance of PotentialDuplicatePatient



39
40
41
42
43
44
45
46
47
48
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb', line 39

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  existing_patient_id = struct["existing_patient_id"]
  existing_patient_mrn = struct["existing_patient_mrn"]
  new(
    existing_patient_id: existing_patient_id,
    existing_patient_mrn: existing_patient_mrn,
    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)


63
64
65
66
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb', line 63

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

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of PotentialDuplicatePatient to a JSON object

Returns:

  • (String)


53
54
55
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb', line 53

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