@healthcloudai/hc-settings-connector 0.0.13 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +280 -236
- package/dist/index.cjs +274 -100
- package/dist/index.d.cts +123 -57
- package/dist/index.d.ts +123 -57
- package/dist/index.js +280 -98
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
+
````md
|
|
1
2
|
# Healthcheck Settings Connector
|
|
2
3
|
|
|
3
|
-
This
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
This connector gives authenticated patients access to account information and document flows used in your application. It includes dashboard information, profile image management, identification document processing, insurance information, and account deactivation.
|
|
5
|
+
|
|
6
|
+
`HCSettingsClient` reuses the configured and authenticated `HCLoginClient` for the API base URL and authorization context.
|
|
6
7
|
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
## Features
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
8. Deactivate the authenticated user
|
|
18
|
-
9. Built on the shared Healthcheck HttpClient and authentication layer
|
|
11
|
+
|
|
12
|
+
1. Retrieve dashboard information for the authenticated patient.
|
|
13
|
+
2. Request upload information for patient profile and document images.
|
|
14
|
+
3. Submit uploaded identification and insurance images for capture.
|
|
15
|
+
4. Submit and retrieve insurance information.
|
|
16
|
+
5. Update the patient profile image.
|
|
17
|
+
6. Deactivate the authenticated patient account.
|
|
19
18
|
|
|
20
19
|
---
|
|
21
20
|
|
|
@@ -23,16 +22,16 @@ It is built on top of the shared Healthcheck HTTP and Login connectors.
|
|
|
23
22
|
|
|
24
23
|
```sh
|
|
25
24
|
npm install @healthcloudai/hc-settings-connector \
|
|
26
|
-
@healthcloudai/hc-login-connector \
|
|
27
|
-
@healthcloudai/hc-http
|
|
28
|
-
|
|
25
|
+
@healthcloudai/hc-login-connector \
|
|
26
|
+
@healthcloudai/hc-http
|
|
27
|
+
````
|
|
29
28
|
|
|
30
29
|
---
|
|
31
30
|
|
|
32
31
|
## Import
|
|
33
32
|
|
|
34
33
|
```ts
|
|
35
|
-
import {
|
|
34
|
+
import { HCSupportClient } from "@healthcloudai/hc-settings-connector";
|
|
36
35
|
import { HCLoginClient } from "@healthcloudai/hc-login-connector";
|
|
37
36
|
import { FetchClient } from "@healthcloudai/hc-http";
|
|
38
37
|
```
|
|
@@ -45,72 +44,72 @@ import { FetchClient } from "@healthcloudai/hc-http";
|
|
|
45
44
|
|
|
46
45
|
```ts
|
|
47
46
|
const httpClient = new FetchClient();
|
|
48
|
-
const authClient = new HCLoginClient(httpClient);
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
const loginClient = new HCLoginClient(httpClient);
|
|
49
|
+
|
|
50
|
+
loginClient.configure("demo-tenant", "dev");
|
|
51
|
+
|
|
52
|
+
await loginClient.login(
|
|
53
|
+
"john.doe@example.com",
|
|
54
|
+
"ExamplePassword123!"
|
|
55
|
+
);
|
|
52
56
|
|
|
53
57
|
const settingsClient = new HCSettingsClient(
|
|
54
58
|
httpClient,
|
|
55
|
-
|
|
59
|
+
loginClient
|
|
56
60
|
);
|
|
57
61
|
```
|
|
58
62
|
|
|
59
|
-
|
|
63
|
+
`HCLoginClient` must be configured and authenticated before calling Settings methods.
|
|
60
64
|
|
|
65
|
+
---
|
|
61
66
|
|
|
62
67
|
## API Key
|
|
63
68
|
|
|
64
|
-
Use `setApiKey(...)`
|
|
69
|
+
Use `setApiKey(...)` when the configured environment requires an API key for Settings requests.
|
|
65
70
|
|
|
66
71
|
```ts
|
|
67
72
|
const apiKey = process.env.HEALTHCLOUD_API_KEY;
|
|
68
73
|
|
|
69
74
|
if (!apiKey) {
|
|
70
|
-
throw new Error(
|
|
75
|
+
throw new Error(
|
|
76
|
+
"HEALTHCLOUD_API_KEY is required."
|
|
77
|
+
);
|
|
71
78
|
}
|
|
72
79
|
|
|
73
|
-
settingsClient.setApiKey(
|
|
80
|
+
settingsClient.setApiKey(
|
|
81
|
+
"x-api-key",
|
|
82
|
+
apiKey
|
|
83
|
+
);
|
|
74
84
|
```
|
|
75
85
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
## Methods
|
|
79
|
-
|
|
80
|
-
The Settings connector methods are grouped by the main usage flow:
|
|
81
|
-
|
|
82
|
-
1. Dashboard
|
|
83
|
-
2. Profile image upload and update
|
|
84
|
-
3. ID document upload, capture, and submit
|
|
85
|
-
4. Insurance upload, capture, submit, and retrieval
|
|
86
|
-
5. Account actions
|
|
86
|
+
The API key header name should be `x-api-key`.
|
|
87
87
|
|
|
88
88
|
---
|
|
89
89
|
|
|
90
|
-
##
|
|
90
|
+
## Methods
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
# Dashboard
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
## Get Dashboard
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
Public signature:
|
|
97
97
|
|
|
98
98
|
```ts
|
|
99
|
-
|
|
99
|
+
settingsClient.getDashboard()
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
Returns dashboard information associated with the authenticated patient.
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
Status:
|
|
104
|
+
```ts
|
|
105
|
+
const dashboard =
|
|
106
|
+
await settingsClient.getDashboard();
|
|
109
107
|
|
|
110
|
-
|
|
111
|
-
200
|
|
108
|
+
console.log(dashboard);
|
|
112
109
|
```
|
|
113
110
|
|
|
111
|
+
### API response
|
|
112
|
+
|
|
114
113
|
```json
|
|
115
114
|
{
|
|
116
115
|
"Data": {
|
|
@@ -158,41 +157,32 @@ Status:
|
|
|
158
157
|
|
|
159
158
|
---
|
|
160
159
|
|
|
161
|
-
|
|
160
|
+
# User Image
|
|
162
161
|
|
|
163
|
-
|
|
162
|
+
User image methods allow the patient to upload and update the profile image associated with their account.
|
|
164
163
|
|
|
165
|
-
|
|
166
|
-
2. Upload the file bytes to the returned upload URL outside this package.
|
|
167
|
-
3. Include any signed headers required by the upload URL, such as `x-amz-acl: public-read` when provided.
|
|
168
|
-
4. Submit the returned file name or file key through the matching capture or update method.
|
|
164
|
+
## Get User Image Canned URL
|
|
169
165
|
|
|
170
|
-
|
|
166
|
+
Public signature:
|
|
171
167
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
1. Call `getUserImageCannedUrl(extension)` to request upload information.
|
|
179
|
-
2. Upload the image file to the returned `ImageURL` outside this package.
|
|
180
|
-
3. Include any signed headers required by the upload URL, such as `x-amz-acl: public-read` when provided.
|
|
181
|
-
4. Call `updateUserImage(fileName)` using the returned `FileName`.
|
|
182
|
-
|
|
183
|
-
### Get User Image Canned URL
|
|
184
|
-
|
|
185
|
-
Public signature: `settingsClient.getUserImageCannedUrl(extension)`
|
|
186
|
-
|
|
187
|
-
Generates upload information for a user profile image.
|
|
168
|
+
```ts
|
|
169
|
+
settingsClient.getUserImageCannedUrl(
|
|
170
|
+
extension
|
|
171
|
+
)
|
|
172
|
+
```
|
|
188
173
|
|
|
189
|
-
|
|
174
|
+
Returns upload information for a patient profile image.
|
|
190
175
|
|
|
191
176
|
```ts
|
|
192
|
-
const
|
|
177
|
+
const upload =
|
|
178
|
+
await settingsClient.getUserImageCannedUrl(
|
|
179
|
+
"jpeg"
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
console.log(upload);
|
|
193
183
|
```
|
|
194
184
|
|
|
195
|
-
|
|
185
|
+
### API request
|
|
196
186
|
|
|
197
187
|
```json
|
|
198
188
|
{
|
|
@@ -202,13 +192,7 @@ const selfieUpload = await settingsClient.getUserImageCannedUrl("jpeg");
|
|
|
202
192
|
}
|
|
203
193
|
```
|
|
204
194
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
Status:
|
|
208
|
-
|
|
209
|
-
```txt
|
|
210
|
-
200
|
|
211
|
-
```
|
|
195
|
+
### API response
|
|
212
196
|
|
|
213
197
|
```json
|
|
214
198
|
{
|
|
@@ -222,23 +206,28 @@ Status:
|
|
|
222
206
|
}
|
|
223
207
|
```
|
|
224
208
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
### Update User Image URL
|
|
209
|
+
## Update User Image
|
|
228
210
|
|
|
229
|
-
Public signature:
|
|
211
|
+
Public signature:
|
|
230
212
|
|
|
231
|
-
|
|
213
|
+
```ts
|
|
214
|
+
settingsClient.updateUserImage(
|
|
215
|
+
fileName
|
|
216
|
+
)
|
|
217
|
+
```
|
|
232
218
|
|
|
233
|
-
|
|
219
|
+
Updates the patient profile image using the uploaded image reference.
|
|
234
220
|
|
|
235
221
|
```ts
|
|
236
|
-
const updated =
|
|
237
|
-
|
|
238
|
-
|
|
222
|
+
const updated =
|
|
223
|
+
await settingsClient.updateUserImage(
|
|
224
|
+
"selfie_example.jpeg"
|
|
225
|
+
);
|
|
226
|
+
|
|
227
|
+
console.log(updated);
|
|
239
228
|
```
|
|
240
229
|
|
|
241
|
-
|
|
230
|
+
### API request
|
|
242
231
|
|
|
243
232
|
```json
|
|
244
233
|
{
|
|
@@ -248,35 +237,44 @@ const updated = await settingsClient.updateUserImage(
|
|
|
248
237
|
}
|
|
249
238
|
```
|
|
250
239
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
Status:
|
|
254
|
-
|
|
255
|
-
```txt
|
|
256
|
-
200
|
|
257
|
-
```
|
|
240
|
+
### API response
|
|
258
241
|
|
|
259
242
|
```json
|
|
260
|
-
|
|
243
|
+
{
|
|
244
|
+
"Data": true,
|
|
245
|
+
"IsOK": true,
|
|
246
|
+
"ErrorMessage": null
|
|
247
|
+
}
|
|
261
248
|
```
|
|
262
249
|
|
|
263
250
|
---
|
|
264
251
|
|
|
265
|
-
|
|
252
|
+
# Identification
|
|
266
253
|
|
|
267
|
-
|
|
254
|
+
Identification methods allow the patient to upload and process identification document images.
|
|
268
255
|
|
|
269
|
-
|
|
256
|
+
## Get Driving License Canned URL
|
|
270
257
|
|
|
271
|
-
|
|
258
|
+
Public signature:
|
|
272
259
|
|
|
273
|
-
|
|
260
|
+
```ts
|
|
261
|
+
settingsClient.getDrivingLicenseCannedUrl(
|
|
262
|
+
extension
|
|
263
|
+
)
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Returns upload information for an identification document image.
|
|
274
267
|
|
|
275
268
|
```ts
|
|
276
|
-
const
|
|
269
|
+
const upload =
|
|
270
|
+
await settingsClient.getDrivingLicenseCannedUrl(
|
|
271
|
+
"jpeg"
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
console.log(upload);
|
|
277
275
|
```
|
|
278
276
|
|
|
279
|
-
|
|
277
|
+
### API request
|
|
280
278
|
|
|
281
279
|
```json
|
|
282
280
|
{
|
|
@@ -286,13 +284,7 @@ const idUpload = await settingsClient.getDrivingLicenseCannedUrl("jpeg");
|
|
|
286
284
|
}
|
|
287
285
|
```
|
|
288
286
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
Status:
|
|
292
|
-
|
|
293
|
-
```txt
|
|
294
|
-
200
|
|
295
|
-
```
|
|
287
|
+
### API response
|
|
296
288
|
|
|
297
289
|
```json
|
|
298
290
|
{
|
|
@@ -306,23 +298,28 @@ Status:
|
|
|
306
298
|
}
|
|
307
299
|
```
|
|
308
300
|
|
|
309
|
-
|
|
301
|
+
## Capture Driving License
|
|
310
302
|
|
|
311
|
-
|
|
303
|
+
Public signature:
|
|
312
304
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
305
|
+
```ts
|
|
306
|
+
settingsClient.captureDrivingLicense(
|
|
307
|
+
fileKey
|
|
308
|
+
)
|
|
309
|
+
```
|
|
316
310
|
|
|
317
|
-
|
|
311
|
+
Processes the uploaded identification image and returns captured information.
|
|
318
312
|
|
|
319
313
|
```ts
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
314
|
+
const captured =
|
|
315
|
+
await settingsClient.captureDrivingLicense(
|
|
316
|
+
"idcard_example.jpeg"
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
console.log(captured);
|
|
323
320
|
```
|
|
324
321
|
|
|
325
|
-
|
|
322
|
+
### API request
|
|
326
323
|
|
|
327
324
|
```json
|
|
328
325
|
{
|
|
@@ -333,13 +330,7 @@ const capturedLicense = await settingsClient.captureDrivingLicense(
|
|
|
333
330
|
}
|
|
334
331
|
```
|
|
335
332
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
Status:
|
|
339
|
-
|
|
340
|
-
```txt
|
|
341
|
-
200
|
|
342
|
-
```
|
|
333
|
+
### API response
|
|
343
334
|
|
|
344
335
|
```json
|
|
345
336
|
{
|
|
@@ -364,21 +355,28 @@ Status:
|
|
|
364
355
|
}
|
|
365
356
|
```
|
|
366
357
|
|
|
367
|
-
|
|
358
|
+
## Submit Driving License
|
|
368
359
|
|
|
369
|
-
|
|
360
|
+
Public signature:
|
|
370
361
|
|
|
371
|
-
|
|
362
|
+
```ts
|
|
363
|
+
settingsClient.submitDrivingLicense(
|
|
364
|
+
image
|
|
365
|
+
)
|
|
366
|
+
```
|
|
372
367
|
|
|
373
|
-
Submits
|
|
368
|
+
Submits the uploaded identification image reference.
|
|
374
369
|
|
|
375
370
|
```ts
|
|
376
|
-
const response =
|
|
377
|
-
|
|
378
|
-
|
|
371
|
+
const response =
|
|
372
|
+
await settingsClient.submitDrivingLicense(
|
|
373
|
+
"idcard_example.jpeg"
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
console.log(response);
|
|
379
377
|
```
|
|
380
378
|
|
|
381
|
-
|
|
379
|
+
### API request
|
|
382
380
|
|
|
383
381
|
```json
|
|
384
382
|
{
|
|
@@ -388,13 +386,7 @@ const response = await settingsClient.submitDrivingLicense({
|
|
|
388
386
|
}
|
|
389
387
|
```
|
|
390
388
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
Status:
|
|
394
|
-
|
|
395
|
-
```txt
|
|
396
|
-
200
|
|
397
|
-
```
|
|
389
|
+
### API response
|
|
398
390
|
|
|
399
391
|
```json
|
|
400
392
|
{
|
|
@@ -405,21 +397,33 @@ Status:
|
|
|
405
397
|
```
|
|
406
398
|
|
|
407
399
|
---
|
|
408
|
-
## Insurance methods
|
|
409
400
|
|
|
410
|
-
|
|
401
|
+
# Insurance
|
|
411
402
|
|
|
412
|
-
|
|
403
|
+
Insurance methods allow the patient to upload insurance images, process insurance information, and retrieve insurance records.
|
|
413
404
|
|
|
414
|
-
|
|
405
|
+
## Get Insurance Canned URL
|
|
415
406
|
|
|
416
|
-
|
|
407
|
+
Public signature:
|
|
417
408
|
|
|
418
409
|
```ts
|
|
419
|
-
|
|
410
|
+
settingsClient.getInsuranceCannedUrl(
|
|
411
|
+
extension
|
|
412
|
+
)
|
|
420
413
|
```
|
|
421
414
|
|
|
422
|
-
|
|
415
|
+
Returns upload information for an insurance image.
|
|
416
|
+
|
|
417
|
+
```ts
|
|
418
|
+
const upload =
|
|
419
|
+
await settingsClient.getInsuranceCannedUrl(
|
|
420
|
+
"jpeg"
|
|
421
|
+
);
|
|
422
|
+
|
|
423
|
+
console.log(upload);
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### API request
|
|
423
427
|
|
|
424
428
|
```json
|
|
425
429
|
{
|
|
@@ -429,13 +433,7 @@ const insuranceUpload = await settingsClient.getInsuranceCannedUrl("jpeg");
|
|
|
429
433
|
}
|
|
430
434
|
```
|
|
431
435
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
Status:
|
|
435
|
-
|
|
436
|
-
```txt
|
|
437
|
-
200
|
|
438
|
-
```
|
|
436
|
+
### API response
|
|
439
437
|
|
|
440
438
|
```json
|
|
441
439
|
{
|
|
@@ -449,23 +447,28 @@ Status:
|
|
|
449
447
|
}
|
|
450
448
|
```
|
|
451
449
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
### Capture Insurance
|
|
450
|
+
## Capture Insurance
|
|
455
451
|
|
|
456
|
-
Public signature:
|
|
452
|
+
Public signature:
|
|
457
453
|
|
|
458
|
-
|
|
454
|
+
```ts
|
|
455
|
+
settingsClient.captureInsurance(
|
|
456
|
+
fileKey
|
|
457
|
+
)
|
|
458
|
+
```
|
|
459
459
|
|
|
460
|
-
|
|
460
|
+
Processes the uploaded insurance image and returns captured information.
|
|
461
461
|
|
|
462
462
|
```ts
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
const captured =
|
|
464
|
+
await settingsClient.captureInsurance(
|
|
465
|
+
"insurancecard_example.jpeg"
|
|
466
|
+
);
|
|
467
|
+
|
|
468
|
+
console.log(captured);
|
|
466
469
|
```
|
|
467
470
|
|
|
468
|
-
|
|
471
|
+
### API request
|
|
469
472
|
|
|
470
473
|
```json
|
|
471
474
|
{
|
|
@@ -476,13 +479,7 @@ const capturedInsurance = await settingsClient.captureInsurance(
|
|
|
476
479
|
}
|
|
477
480
|
```
|
|
478
481
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
Status:
|
|
482
|
-
|
|
483
|
-
```txt
|
|
484
|
-
200
|
|
485
|
-
```
|
|
482
|
+
### API response
|
|
486
483
|
|
|
487
484
|
```json
|
|
488
485
|
{
|
|
@@ -506,26 +503,33 @@ Status:
|
|
|
506
503
|
}
|
|
507
504
|
```
|
|
508
505
|
|
|
509
|
-
|
|
506
|
+
## Submit Insurance
|
|
510
507
|
|
|
511
|
-
|
|
508
|
+
Public signature:
|
|
512
509
|
|
|
513
|
-
|
|
510
|
+
```ts
|
|
511
|
+
settingsClient.submitInsurance(
|
|
512
|
+
coverage
|
|
513
|
+
)
|
|
514
|
+
```
|
|
514
515
|
|
|
515
|
-
Submits
|
|
516
|
+
Submits insurance coverage information for the authenticated patient.
|
|
516
517
|
|
|
517
518
|
```ts
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
519
|
+
const response =
|
|
520
|
+
await settingsClient.submitInsurance({
|
|
521
|
+
InsurancePackageId: "693245",
|
|
522
|
+
MemberId: "member-id-example",
|
|
523
|
+
FirstName: "John",
|
|
524
|
+
LastName: "Doe",
|
|
525
|
+
Sex: "",
|
|
526
|
+
Image: "insurancecard_example.jpeg"
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
console.log(response);
|
|
526
530
|
```
|
|
527
531
|
|
|
528
|
-
|
|
532
|
+
### API request
|
|
529
533
|
|
|
530
534
|
```json
|
|
531
535
|
{
|
|
@@ -540,13 +544,7 @@ await settingsClient.submitInsurance({
|
|
|
540
544
|
}
|
|
541
545
|
```
|
|
542
546
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
Status:
|
|
546
|
-
|
|
547
|
-
```txt
|
|
548
|
-
200
|
|
549
|
-
```
|
|
547
|
+
### API response
|
|
550
548
|
|
|
551
549
|
```json
|
|
552
550
|
{
|
|
@@ -564,30 +562,25 @@ Status:
|
|
|
564
562
|
}
|
|
565
563
|
```
|
|
566
564
|
|
|
567
|
-
|
|
565
|
+
## Get Insurances
|
|
568
566
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
Public signature: `settingsClient.getInsurances()`
|
|
572
|
-
|
|
573
|
-
Returns patient insurances.
|
|
567
|
+
Public signature:
|
|
574
568
|
|
|
575
569
|
```ts
|
|
576
|
-
|
|
570
|
+
settingsClient.getInsurances()
|
|
577
571
|
```
|
|
578
572
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
This method performs an authenticated request internally and does not send a request body.
|
|
582
|
-
|
|
583
|
-
#### API response
|
|
573
|
+
Returns insurance records associated with the authenticated patient.
|
|
584
574
|
|
|
585
|
-
|
|
575
|
+
```ts
|
|
576
|
+
const insurances =
|
|
577
|
+
await settingsClient.getInsurances();
|
|
586
578
|
|
|
587
|
-
|
|
588
|
-
200
|
|
579
|
+
console.log(insurances);
|
|
589
580
|
```
|
|
590
581
|
|
|
582
|
+
### API response
|
|
583
|
+
|
|
591
584
|
```json
|
|
592
585
|
{
|
|
593
586
|
"Data": [
|
|
@@ -612,33 +605,53 @@ Status:
|
|
|
612
605
|
|
|
613
606
|
---
|
|
614
607
|
|
|
615
|
-
|
|
608
|
+
# User Photo Capture
|
|
609
|
+
|
|
610
|
+
User photo capture methods process uploaded patient profile images.
|
|
611
|
+
|
|
612
|
+
## Capture User Photo
|
|
616
613
|
|
|
617
|
-
|
|
614
|
+
Public signature:
|
|
618
615
|
|
|
619
|
-
|
|
616
|
+
```ts
|
|
617
|
+
settingsClient.captureUserPhoto(
|
|
618
|
+
fileKey
|
|
619
|
+
)
|
|
620
|
+
```
|
|
620
621
|
|
|
621
|
-
|
|
622
|
+
Processes the uploaded patient profile image and stores it as the patient user image.
|
|
622
623
|
|
|
623
624
|
```ts
|
|
624
|
-
|
|
625
|
+
const response =
|
|
626
|
+
await settingsClient.captureUserPhoto(
|
|
627
|
+
"selfie_example.jpeg"
|
|
628
|
+
);
|
|
629
|
+
|
|
630
|
+
console.log(response);
|
|
625
631
|
```
|
|
626
632
|
|
|
627
|
-
|
|
633
|
+
### API request
|
|
628
634
|
|
|
629
635
|
```json
|
|
630
636
|
{
|
|
631
|
-
"Data": {
|
|
637
|
+
"Data": {
|
|
638
|
+
"Type": "userphoto",
|
|
639
|
+
"FileID": "selfie_example.jpeg"
|
|
640
|
+
}
|
|
632
641
|
}
|
|
633
642
|
```
|
|
634
643
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
The client returns the backend response from the authenticated request.
|
|
644
|
+
### API response
|
|
638
645
|
|
|
639
646
|
```json
|
|
640
647
|
{
|
|
641
|
-
"Data":
|
|
648
|
+
"Data": {
|
|
649
|
+
"CapturedData": {
|
|
650
|
+
"ImageKey": "patient-image-example.jpeg"
|
|
651
|
+
},
|
|
652
|
+
"IsCaptured": true,
|
|
653
|
+
"InsurancePackages": null
|
|
654
|
+
},
|
|
642
655
|
"ErrorMessage": null,
|
|
643
656
|
"IsOK": true
|
|
644
657
|
}
|
|
@@ -646,24 +659,55 @@ The client returns the backend response from the authenticated request.
|
|
|
646
659
|
|
|
647
660
|
---
|
|
648
661
|
|
|
662
|
+
# Account
|
|
663
|
+
|
|
664
|
+
## Deactivate User
|
|
665
|
+
|
|
666
|
+
Public signature:
|
|
667
|
+
|
|
668
|
+
```ts
|
|
669
|
+
settingsClient.deactivateUser()
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
Deactivates the authenticated patient account.
|
|
673
|
+
|
|
674
|
+
```ts
|
|
675
|
+
const response =
|
|
676
|
+
await settingsClient.deactivateUser();
|
|
677
|
+
|
|
678
|
+
console.log(response);
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
### API response
|
|
682
|
+
|
|
683
|
+
```json
|
|
684
|
+
{
|
|
685
|
+
"Data": true,
|
|
686
|
+
"IsOK": true,
|
|
687
|
+
"ErrorMessage": null
|
|
688
|
+
}
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
---
|
|
692
|
+
|
|
649
693
|
## How It Works
|
|
650
694
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
- Driver license and insurance capture methods submit the uploaded file key after the file has already been uploaded.
|
|
695
|
+
* `HCSettingsClient` uses the configured `HCLoginClient` for the API base URL and authorization context.
|
|
696
|
+
* Public methods only accept the values required from the application.
|
|
697
|
+
* The connector internally creates the backend `APIRequest<T>` request envelope.
|
|
698
|
+
* Image upload methods return upload information only. File uploads are performed outside the connector.
|
|
699
|
+
* Capture methods internally attach the required capture type before sending the request.
|
|
657
700
|
|
|
658
701
|
---
|
|
659
702
|
|
|
660
703
|
## Notes
|
|
661
704
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
705
|
+
* Configure and authenticate `HCLoginClient` before calling Settings methods.
|
|
706
|
+
* Do not pass authorization headers or base URLs manually.
|
|
707
|
+
* Upload image files outside the connector using the returned upload URL.
|
|
708
|
+
* `captureDrivingLicense(...)` internally sends `Type: "identification"`.
|
|
709
|
+
* `captureInsurance(...)` internally sends `Type: "healthinsurance"`.
|
|
710
|
+
* `captureUserPhoto(...)` internally sends `Type: "userphoto"`.
|
|
711
|
+
|
|
712
|
+
```
|
|
713
|
+
```
|