Class: CandidApiClient::Tasks::V3::Types::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/tasks/v_3/types/task.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task_id:, encounter_id:, task_type:, description:, blocks_claim_submission:, external_id:, patient_name:, patient_external_id:, status:, notes:, created_at:, updated_at:, agg_updated_at:, date_of_service:, assignments:, payer_name: OMIT, payer_id: OMIT, category: OMIT, additional_properties: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task

Parameters:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 81

def initialize(task_id:, encounter_id:, task_type:, description:, blocks_claim_submission:, external_id:,
               patient_name:, patient_external_id:, status:, notes:, created_at:, updated_at:, agg_updated_at:, date_of_service:, assignments:, payer_name: OMIT, payer_id: OMIT, category: OMIT, additional_properties: nil)
  @task_id = task_id
  @encounter_id = encounter_id
  @task_type = task_type
  @description = description
  @blocks_claim_submission = blocks_claim_submission
  @external_id = external_id
  @patient_name = patient_name
  @patient_external_id = patient_external_id
  @payer_name = payer_name if payer_name != OMIT
  @payer_id = payer_id if payer_id != OMIT
  @status = status
  @notes = notes
  @created_at = created_at
  @updated_at = updated_at
  @agg_updated_at = agg_updated_at
  @date_of_service = date_of_service
  @assignments = assignments
  @category = category if category != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "task_id": task_id,
    "encounter_id": encounter_id,
    "task_type": task_type,
    "description": description,
    "blocks_claim_submission": blocks_claim_submission,
    "external_id": external_id,
    "patient_name": patient_name,
    "patient_external_id": patient_external_id,
    "payer_name": payer_name,
    "payer_id": payer_id,
    "status": status,
    "notes": notes,
    "created_at": created_at,
    "updated_at": updated_at,
    "agg_updated_at": agg_updated_at,
    "date_of_service": date_of_service,
    "assignments": assignments,
    "category": category
  }.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



54
55
56
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 54

def additional_properties
  @additional_properties
end

#agg_updated_atDateTime (readonly)

Returns The time of most recent update to the task or any of its notes.

Returns:

  • (DateTime)

    The time of most recent update to the task or any of its notes



46
47
48
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 46

def agg_updated_at
  @agg_updated_at
end

#assignmentsArray<CandidApiClient::Tasks::V3::Types::TaskAssignment> (readonly)



50
51
52
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 50

def assignments
  @assignments
end

#blocks_claim_submissionBoolean (readonly)

Returns:

  • (Boolean)


26
27
28
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 26

def blocks_claim_submission
  @blocks_claim_submission
end

#categoryCandidApiClient::Tasks::Commons::Types::TaskCategory (readonly)



52
53
54
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 52

def category
  @category
end

#created_atDateTime (readonly)

Returns:

  • (DateTime)


42
43
44
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 42

def created_at
  @created_at
end

#date_of_serviceDate (readonly)

Returns:

  • (Date)


48
49
50
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 48

def date_of_service
  @date_of_service
end

#descriptionString (readonly)

Returns:

  • (String)


24
25
26
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 24

def description
  @description
end

#encounter_idString (readonly)

Returns:

  • (String)


20
21
22
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 20

def encounter_id
  @encounter_id
end

#external_idString (readonly)

Returns:

  • (String)


28
29
30
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 28

def external_id
  @external_id
end

#notesArray<CandidApiClient::Tasks::V3::Types::TaskNote> (readonly)



40
41
42
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 40

def notes
  @notes
end

#patient_external_idString (readonly)

Returns:

  • (String)


32
33
34
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 32

def patient_external_id
  @patient_external_id
end

#patient_nameString (readonly)

Returns:

  • (String)


30
31
32
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 30

def patient_name
  @patient_name
end

#payer_idString (readonly)

Returns:

  • (String)


36
37
38
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 36

def payer_id
  @payer_id
end

#payer_nameString (readonly)

Returns:

  • (String)


34
35
36
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 34

def payer_name
  @payer_name
end

#statusCandidApiClient::Tasks::Commons::Types::TaskStatus (readonly)



38
39
40
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 38

def status
  @status
end

#task_idString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 18

def task_id
  @task_id
end

#task_typeCandidApiClient::Tasks::Commons::Types::TaskType (readonly)



22
23
24
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 22

def task_type
  @task_type
end

#updated_atDateTime (readonly)

Returns The time of most recent update to the task only.

Returns:

  • (DateTime)

    The time of most recent update to the task only



44
45
46
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 44

def updated_at
  @updated_at
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::Tasks::V3::Types::Task

Deserialize a JSON object to an instance of Task

Parameters:

  • json_object (String)

Returns:



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 130

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  task_id = struct["task_id"]
  encounter_id = struct["encounter_id"]
  task_type = struct["task_type"]
  description = struct["description"]
  blocks_claim_submission = struct["blocks_claim_submission"]
  external_id = struct["external_id"]
  patient_name = struct["patient_name"]
  patient_external_id = struct["patient_external_id"]
  payer_name = struct["payer_name"]
  payer_id = struct["payer_id"]
  status = struct["status"]
  notes = parsed_json["notes"]&.map do |item|
    item = item.to_json
    CandidApiClient::Tasks::V3::Types::TaskNote.from_json(json_object: item)
  end
  created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
  updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
  agg_updated_at = (DateTime.parse(parsed_json["agg_updated_at"]) unless parsed_json["agg_updated_at"].nil?)
  date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
  assignments = parsed_json["assignments"]&.map do |item|
    item = item.to_json
    CandidApiClient::Tasks::V3::Types::TaskAssignment.from_json(json_object: item)
  end
  category = struct["category"]
  new(
    task_id: task_id,
    encounter_id: encounter_id,
    task_type: task_type,
    description: description,
    blocks_claim_submission: blocks_claim_submission,
    external_id: external_id,
    patient_name: patient_name,
    patient_external_id: patient_external_id,
    payer_name: payer_name,
    payer_id: payer_id,
    status: status,
    notes: notes,
    created_at: created_at,
    updated_at: updated_at,
    agg_updated_at: agg_updated_at,
    date_of_service: date_of_service,
    assignments: assignments,
    category: category,
    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)


193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 193

def self.validate_raw(obj:)
  obj.task_id.is_a?(String) != false || raise("Passed value for field obj.task_id is not the expected type, validation failed.")
  obj.encounter_id.is_a?(String) != false || raise("Passed value for field obj.encounter_id is not the expected type, validation failed.")
  obj.task_type.is_a?(CandidApiClient::Tasks::Commons::Types::TaskType) != false || raise("Passed value for field obj.task_type is not the expected type, validation failed.")
  obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
  obj.blocks_claim_submission.is_a?(Boolean) != false || raise("Passed value for field obj.blocks_claim_submission is not the expected type, validation failed.")
  obj.external_id.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
  obj.patient_name.is_a?(String) != false || raise("Passed value for field obj.patient_name is not the expected type, validation failed.")
  obj.patient_external_id.is_a?(String) != false || raise("Passed value for field obj.patient_external_id is not the expected type, validation failed.")
  obj.payer_name&.is_a?(String) != false || raise("Passed value for field obj.payer_name is not the expected type, validation failed.")
  obj.payer_id&.is_a?(String) != false || raise("Passed value for field obj.payer_id is not the expected type, validation failed.")
  obj.status.is_a?(CandidApiClient::Tasks::Commons::Types::TaskStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
  obj.notes.is_a?(Array) != false || raise("Passed value for field obj.notes is not the expected type, validation failed.")
  obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
  obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
  obj.agg_updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.agg_updated_at is not the expected type, validation failed.")
  obj.date_of_service.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
  obj.assignments.is_a?(Array) != false || raise("Passed value for field obj.assignments is not the expected type, validation failed.")
  obj.category&.is_a?(CandidApiClient::Tasks::Commons::Types::TaskCategory) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of Task to a JSON object

Returns:

  • (String)


183
184
185
# File 'lib/candidhealth/tasks/v_3/types/task.rb', line 183

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