Class: CandidApiClient::Encounters::V4::Types::ClinicalNote
- Inherits:
-
Object
- Object
- CandidApiClient::Encounters::V4::Types::ClinicalNote
- Defined in:
- lib/candidhealth/encounters/v_4/types/clinical_note.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #author_name ⇒ String readonly
- #author_npi ⇒ String readonly
- #text ⇒ String readonly
- #timestamp ⇒ DateTime readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::ClinicalNote
Deserialize a JSON object to an instance of ClinicalNote.
-
.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.
Instance Method Summary collapse
- #initialize(text:, author_name:, timestamp:, author_npi: OMIT, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::ClinicalNote constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ClinicalNote to a JSON object.
Constructor Details
#initialize(text:, author_name:, timestamp:, author_npi: OMIT, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::ClinicalNote
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/candidhealth/encounters/v_4/types/clinical_note.rb', line 34 def initialize(text:, author_name:, timestamp:, author_npi: OMIT, additional_properties: nil) @text = text @author_name = @author_npi = if != OMIT @timestamp = @additional_properties = additional_properties @_field_set = { "text": text, "author_name": , "author_npi": , "timestamp": }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/candidhealth/encounters/v_4/types/clinical_note.rb', line 21 def additional_properties @additional_properties end |
#author_name ⇒ String (readonly)
15 16 17 |
# File 'lib/candidhealth/encounters/v_4/types/clinical_note.rb', line 15 def @author_name end |
#author_npi ⇒ String (readonly)
17 18 19 |
# File 'lib/candidhealth/encounters/v_4/types/clinical_note.rb', line 17 def @author_npi end |
#text ⇒ String (readonly)
13 14 15 |
# File 'lib/candidhealth/encounters/v_4/types/clinical_note.rb', line 13 def text @text end |
#timestamp ⇒ DateTime (readonly)
19 20 21 |
# File 'lib/candidhealth/encounters/v_4/types/clinical_note.rb', line 19 def @timestamp end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::ClinicalNote
Deserialize a JSON object to an instance of ClinicalNote
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/candidhealth/encounters/v_4/types/clinical_note.rb', line 54 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) text = struct["text"] = struct["author_name"] = struct["author_npi"] = (DateTime.parse(parsed_json["timestamp"]) unless parsed_json["timestamp"].nil?) new( text: text, author_name: , author_npi: , timestamp: , 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.
83 84 85 86 87 88 |
# File 'lib/candidhealth/encounters/v_4/types/clinical_note.rb', line 83 def self.validate_raw(obj:) obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.") obj..is_a?(String) != false || raise("Passed value for field obj.author_name is not the expected type, validation failed.") obj.&.is_a?(String) != false || raise("Passed value for field obj.author_npi is not the expected type, validation failed.") obj..is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ClinicalNote to a JSON object
73 74 75 |
# File 'lib/candidhealth/encounters/v_4/types/clinical_note.rb', line 73 def to_json(*_args) @_field_set&.to_json end |