Class: CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance

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

Overview

Information about the upstream system that owns this patient data.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(external_id:, system_name:, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance

Parameters:

  • external_id (String)
  • system_name (String)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

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



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

def additional_properties
  @additional_properties
end

#external_idString (readonly)

Returns:

  • (String)


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

def external_id
  @external_id
end

#system_nameString (readonly)

Returns:

  • (String)


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

def system_name
  @system_name
end

Class Method Details

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

Deserialize a JSON object to an instance of ExternalProvenance



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

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


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

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

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ExternalProvenance to a JSON object

Returns:

  • (String)


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

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