Class: CandidApiClient::AsyncDiagnosesClient
- Inherits:
-
Object
- Object
- CandidApiClient::AsyncDiagnosesClient
- Defined in:
- lib/candidhealth/diagnoses/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(request:, request_options: nil) ⇒ CandidApiClient::Diagnoses::Types::Diagnosis
Creates a new diagnosis for an encounter.
-
#delete(diagnosis_id:, request_options: nil) ⇒ Void
Deletes the diagnosis record associated with the provided ‘diagnosis_id`.
- #initialize(request_client:) ⇒ CandidApiClient::AsyncDiagnosesClient constructor
-
#update(diagnosis_id:, name: nil, code_type: nil, code: nil, request_options: nil) ⇒ CandidApiClient::Diagnoses::Types::Diagnosis
Updates the diagnosis record matching the provided ‘diagnosis_id`.
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::AsyncDiagnosesClient
125 126 127 |
# File 'lib/candidhealth/diagnoses/client.rb', line 125 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
121 122 123 |
# File 'lib/candidhealth/diagnoses/client.rb', line 121 def request_client @request_client end |
Instance Method Details
#create(request:, request_options: nil) ⇒ CandidApiClient::Diagnoses::Types::Diagnosis
Creates a new diagnosis for an encounter
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/candidhealth/diagnoses/client.rb', line 141 def create(request:, request_options: nil) Async do response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.body = { **(request || {}), **(&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/diagnoses/v2" end CandidApiClient::Diagnoses::Types::Diagnosis.from_json(json_object: response.body) end end |
#delete(diagnosis_id:, request_options: nil) ⇒ Void
Deletes the diagnosis record associated with the provided ‘diagnosis_id`
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/candidhealth/diagnoses/client.rb', line 218 def delete(diagnosis_id:, request_options: nil) Async do @request_client.conn.delete do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/diagnoses/v2/#{diagnosis_id}" end end end |
#update(diagnosis_id:, name: nil, code_type: nil, code: nil, request_options: nil) ⇒ CandidApiClient::Diagnoses::Types::Diagnosis
Updates the diagnosis record matching the provided ‘diagnosis_id`
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/candidhealth/diagnoses/client.rb', line 187 def update(diagnosis_id:, name: nil, code_type: nil, code: nil, request_options: nil) Async do response = @request_client.conn.patch do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.body = { **(&.additional_body_parameters || {}), name: name, code_type: code_type, code: code }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/diagnoses/v2/#{diagnosis_id}" end CandidApiClient::Diagnoses::Types::Diagnosis.from_json(json_object: response.body) end end |