Class: CandidApiClient::Encounters::V4::Types::VitalsUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/encounters/v_4/types/vitals_update.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(height_in: OMIT, weight_lbs: OMIT, blood_pressure_systolic_mmhg: OMIT, blood_pressure_diastolic_mmhg: OMIT, body_temperature_f: OMIT, hemoglobin_gdl: OMIT, hematocrit_pct: OMIT, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::VitalsUpdate

Parameters:

  • height_in (Integer) (defaults to: OMIT)
  • weight_lbs (Integer) (defaults to: OMIT)
  • blood_pressure_systolic_mmhg (Integer) (defaults to: OMIT)
  • blood_pressure_diastolic_mmhg (Integer) (defaults to: OMIT)
  • body_temperature_f (Float) (defaults to: OMIT)
  • hemoglobin_gdl (Float) (defaults to: OMIT)
  • hematocrit_pct (Float) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 42

def initialize(height_in: OMIT, weight_lbs: OMIT, blood_pressure_systolic_mmhg: OMIT,
               blood_pressure_diastolic_mmhg: OMIT, body_temperature_f: OMIT, hemoglobin_gdl: OMIT, hematocrit_pct: OMIT, additional_properties: nil)
  @height_in = height_in if height_in != OMIT
  @weight_lbs = weight_lbs if weight_lbs != OMIT
  @blood_pressure_systolic_mmhg = blood_pressure_systolic_mmhg if blood_pressure_systolic_mmhg != OMIT
  @blood_pressure_diastolic_mmhg = blood_pressure_diastolic_mmhg if blood_pressure_diastolic_mmhg != OMIT
  @body_temperature_f = body_temperature_f if body_temperature_f != OMIT
  @hemoglobin_gdl = hemoglobin_gdl if hemoglobin_gdl != OMIT
  @hematocrit_pct = hematocrit_pct if hematocrit_pct != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "height_in": height_in,
    "weight_lbs": weight_lbs,
    "blood_pressure_systolic_mmhg": blood_pressure_systolic_mmhg,
    "blood_pressure_diastolic_mmhg": blood_pressure_diastolic_mmhg,
    "body_temperature_f": body_temperature_f,
    "hemoglobin_gdl": hemoglobin_gdl,
    "hematocrit_pct": hematocrit_pct
  }.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



26
27
28
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 26

def additional_properties
  @additional_properties
end

#blood_pressure_diastolic_mmhgInteger (readonly)

Returns:

  • (Integer)


18
19
20
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 18

def blood_pressure_diastolic_mmhg
  @blood_pressure_diastolic_mmhg
end

#blood_pressure_systolic_mmhgInteger (readonly)

Returns:

  • (Integer)


16
17
18
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 16

def blood_pressure_systolic_mmhg
  @blood_pressure_systolic_mmhg
end

#body_temperature_fFloat (readonly)

Returns:

  • (Float)


20
21
22
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 20

def body_temperature_f
  @body_temperature_f
end

#height_inInteger (readonly)

Returns:

  • (Integer)


12
13
14
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 12

def height_in
  @height_in
end

#hematocrit_pctFloat (readonly)

Returns:

  • (Float)


24
25
26
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 24

def hematocrit_pct
  @hematocrit_pct
end

#hemoglobin_gdlFloat (readonly)

Returns:

  • (Float)


22
23
24
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 22

def hemoglobin_gdl
  @hemoglobin_gdl
end

#weight_lbsInteger (readonly)

Returns:

  • (Integer)


14
15
16
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 14

def weight_lbs
  @weight_lbs
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::VitalsUpdate

Deserialize a JSON object to an instance of VitalsUpdate

Parameters:

  • json_object (String)

Returns:



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 69

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  height_in = struct["height_in"]
  weight_lbs = struct["weight_lbs"]
  blood_pressure_systolic_mmhg = struct["blood_pressure_systolic_mmhg"]
  blood_pressure_diastolic_mmhg = struct["blood_pressure_diastolic_mmhg"]
  body_temperature_f = struct["body_temperature_f"]
  hemoglobin_gdl = struct["hemoglobin_gdl"]
  hematocrit_pct = struct["hematocrit_pct"]
  new(
    height_in: height_in,
    weight_lbs: weight_lbs,
    blood_pressure_systolic_mmhg: blood_pressure_systolic_mmhg,
    blood_pressure_diastolic_mmhg: blood_pressure_diastolic_mmhg,
    body_temperature_f: body_temperature_f,
    hemoglobin_gdl: hemoglobin_gdl,
    hematocrit_pct: hematocrit_pct,
    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)


103
104
105
106
107
108
109
110
111
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 103

def self.validate_raw(obj:)
  obj.height_in&.is_a?(Integer) != false || raise("Passed value for field obj.height_in is not the expected type, validation failed.")
  obj.weight_lbs&.is_a?(Integer) != false || raise("Passed value for field obj.weight_lbs is not the expected type, validation failed.")
  obj.blood_pressure_systolic_mmhg&.is_a?(Integer) != false || raise("Passed value for field obj.blood_pressure_systolic_mmhg is not the expected type, validation failed.")
  obj.blood_pressure_diastolic_mmhg&.is_a?(Integer) != false || raise("Passed value for field obj.blood_pressure_diastolic_mmhg is not the expected type, validation failed.")
  obj.body_temperature_f&.is_a?(Float) != false || raise("Passed value for field obj.body_temperature_f is not the expected type, validation failed.")
  obj.hemoglobin_gdl&.is_a?(Float) != false || raise("Passed value for field obj.hemoglobin_gdl is not the expected type, validation failed.")
  obj.hematocrit_pct&.is_a?(Float) != false || raise("Passed value for field obj.hematocrit_pct is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of VitalsUpdate to a JSON object

Returns:

  • (String)


93
94
95
# File 'lib/candidhealth/encounters/v_4/types/vitals_update.rb', line 93

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