@healthcloudai/hc-settings-connector 0.0.5 → 0.0.6
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 +546 -68
- package/dist/index.d.cts +7 -4
- package/dist/index.d.ts +7 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
# Healthcheck Settings Connector
|
|
2
2
|
|
|
3
|
-
This library provides a client for
|
|
4
|
-
|
|
3
|
+
This library provides a client for authenticated user settings, profile image,
|
|
4
|
+
identification, insurance, and dashboard-related flows in Healthcheck.
|
|
5
5
|
It is built on top of the shared Healthcheck HTTP and Login connectors.
|
|
6
|
+
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
## Features
|
|
9
|
-
1. Retrieve patient
|
|
10
|
-
2.
|
|
11
|
-
3.
|
|
12
|
-
4.
|
|
13
|
-
5.
|
|
14
|
-
6. Submit
|
|
15
|
-
7.
|
|
16
|
-
8.
|
|
17
|
-
9.
|
|
18
|
-
10.
|
|
19
|
-
11. Update user profile image URL
|
|
20
|
-
12. Self deactivate user
|
|
21
|
-
13. Built on shared Healthcheck HttpClient and authentication layer
|
|
10
|
+
1. Retrieve the authenticated patient profile
|
|
11
|
+
2. Retrieve the authenticated patient dashboard
|
|
12
|
+
3. Generate canned upload URLs for selfie, ID, and insurance images
|
|
13
|
+
4. Capture selfie, identification, and insurance documents from uploaded file keys
|
|
14
|
+
5. Update or submit driving license data through the resolved EHR route
|
|
15
|
+
6. Submit patient insurance coverage details
|
|
16
|
+
7. Retrieve patient insurances through the resolved EHR route
|
|
17
|
+
8. Update the stored user image file reference
|
|
18
|
+
9. Deactivate the authenticated user
|
|
19
|
+
10. Built on the shared Healthcheck HttpClient and authentication layer
|
|
22
20
|
|
|
23
21
|
---
|
|
24
22
|
|
|
@@ -50,8 +48,8 @@ import { FetchClient } from "@healthcloudai/hc-http";
|
|
|
50
48
|
const httpClient = new FetchClient();
|
|
51
49
|
const authClient = new HCLoginClient(httpClient);
|
|
52
50
|
|
|
53
|
-
authClient.configure("tenant
|
|
54
|
-
await authClient.login("john.doe@
|
|
51
|
+
authClient.configure("demo-tenant", "dev");
|
|
52
|
+
await authClient.login("john.doe@example.com", "ExamplePassword123!");
|
|
55
53
|
|
|
56
54
|
const settingsClient = new HCSettingsClient(
|
|
57
55
|
httpClient,
|
|
@@ -67,24 +65,120 @@ const settingsClient = new HCSettingsClient(
|
|
|
67
65
|
|
|
68
66
|
Public signature: `settingsClient.getUserInfo()`
|
|
69
67
|
|
|
70
|
-
Returns the current patient profile
|
|
68
|
+
Returns the current authenticated patient profile.
|
|
71
69
|
|
|
72
70
|
```ts
|
|
73
71
|
const userInfo = await settingsClient.getUserInfo();
|
|
74
72
|
```
|
|
75
73
|
|
|
74
|
+
#### Full API request
|
|
75
|
+
|
|
76
|
+
This method performs an authenticated request internally and does not send a request body.
|
|
77
|
+
|
|
78
|
+
#### API response
|
|
79
|
+
|
|
80
|
+
Status:
|
|
81
|
+
|
|
82
|
+
```txt
|
|
83
|
+
200
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"Data": {
|
|
89
|
+
"Record": {
|
|
90
|
+
"ID": "record-id-example",
|
|
91
|
+
"TenantID": "demo-tenant",
|
|
92
|
+
"FirstName": "John",
|
|
93
|
+
"LastName": "Doe",
|
|
94
|
+
"Email": "john.doe@example.com",
|
|
95
|
+
"Phone": null,
|
|
96
|
+
"BirthDate": "0001-01-01T00:00:00",
|
|
97
|
+
"HasInsurance": false,
|
|
98
|
+
"HasIDCard": false,
|
|
99
|
+
"HasSelfie": true,
|
|
100
|
+
"Address": {
|
|
101
|
+
"StreetAndNumber": null,
|
|
102
|
+
"Extension": null,
|
|
103
|
+
"City": null,
|
|
104
|
+
"State": null,
|
|
105
|
+
"PostalCode": null,
|
|
106
|
+
"Country": null
|
|
107
|
+
},
|
|
108
|
+
"Attributes": {
|
|
109
|
+
"FHIRPatientID": "patient-id-example",
|
|
110
|
+
"CompositeID": "composite-id-example",
|
|
111
|
+
"PatientImageURL": "https://storage.example.com/selfie_example.jpeg"
|
|
112
|
+
},
|
|
113
|
+
"CompositeID": "composite-id-example",
|
|
114
|
+
"FHIRID": "fhir-id-example"
|
|
115
|
+
},
|
|
116
|
+
"Encounters": null,
|
|
117
|
+
"EHR": "fhir",
|
|
118
|
+
"PendingActions": [
|
|
119
|
+
"ADD_ID",
|
|
120
|
+
"IMPORT_VITALS"
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
"ErrorMessage": null,
|
|
124
|
+
"IsOK": true
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
76
128
|
---
|
|
77
129
|
|
|
78
130
|
### Get Dashboard
|
|
79
131
|
|
|
80
132
|
Public signature: `settingsClient.getDashboard()`
|
|
81
133
|
|
|
82
|
-
Returns the current patient dashboard response.
|
|
134
|
+
Returns the current authenticated patient dashboard response.
|
|
83
135
|
|
|
84
136
|
```ts
|
|
85
137
|
const dashboard = await settingsClient.getDashboard();
|
|
86
138
|
```
|
|
87
139
|
|
|
140
|
+
#### Full API request
|
|
141
|
+
|
|
142
|
+
This method performs an authenticated request internally and does not send a request body.
|
|
143
|
+
|
|
144
|
+
#### API response
|
|
145
|
+
|
|
146
|
+
Status:
|
|
147
|
+
|
|
148
|
+
```txt
|
|
149
|
+
200
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"Data": {
|
|
155
|
+
"Record": {
|
|
156
|
+
"ID": "record-id-example",
|
|
157
|
+
"TenantID": "demo-tenant",
|
|
158
|
+
"FirstName": "John",
|
|
159
|
+
"LastName": "Doe",
|
|
160
|
+
"Email": "john.doe@example.com",
|
|
161
|
+
"HasInsurance": false,
|
|
162
|
+
"HasIDCard": false,
|
|
163
|
+
"HasSelfie": true,
|
|
164
|
+
"Attributes": {
|
|
165
|
+
"FHIRPatientID": "patient-id-example",
|
|
166
|
+
"CompositeID": "composite-id-example",
|
|
167
|
+
"PatientImageURL": "https://storage.example.com/selfie_example.jpeg"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"Encounters": [],
|
|
171
|
+
"EHR": "fhir",
|
|
172
|
+
"PendingActions": [
|
|
173
|
+
"ADD_ID",
|
|
174
|
+
"IMPORT_VITALS"
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
"ErrorMessage": null,
|
|
178
|
+
"IsOK": true
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
88
182
|
---
|
|
89
183
|
|
|
90
184
|
### Submit Insurance
|
|
@@ -92,162 +186,546 @@ const dashboard = await settingsClient.getDashboard();
|
|
|
92
186
|
Public signature: `settingsClient.submitInsurance(payload)`
|
|
93
187
|
|
|
94
188
|
Submits patient insurance coverage details.
|
|
189
|
+
The client forwards the provided payload into the backend `Data` wrapper.
|
|
95
190
|
|
|
96
191
|
```ts
|
|
97
192
|
await settingsClient.submitInsurance({
|
|
98
193
|
InsurancePackageId: "693245",
|
|
99
|
-
MemberId: "
|
|
194
|
+
MemberId: "member-id-example",
|
|
100
195
|
FirstName: "John",
|
|
101
|
-
LastName: "
|
|
196
|
+
LastName: "Doe",
|
|
102
197
|
Sex: "",
|
|
103
|
-
Image: "
|
|
198
|
+
Image: "insurancecard_example.jpeg"
|
|
104
199
|
});
|
|
105
200
|
```
|
|
106
201
|
|
|
202
|
+
#### Full API request
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"Data": {
|
|
207
|
+
"InsurancePackageId": "693245",
|
|
208
|
+
"MemberId": "member-id-example",
|
|
209
|
+
"FirstName": "John",
|
|
210
|
+
"LastName": "Doe",
|
|
211
|
+
"Sex": "",
|
|
212
|
+
"Image": "insurancecard_example.jpeg"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
#### API response
|
|
218
|
+
|
|
219
|
+
Status:
|
|
220
|
+
|
|
221
|
+
```txt
|
|
222
|
+
200
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"Data": {
|
|
228
|
+
"InsuranceId": "insurance-id-example",
|
|
229
|
+
"InsurancePackageId": 693245,
|
|
230
|
+
"InsurancePolicyHolder": "John Doe",
|
|
231
|
+
"InsuranceType": "Insurance",
|
|
232
|
+
"IssueDate": "01/01/2030",
|
|
233
|
+
"MemberId": "member-id-example",
|
|
234
|
+
"Image": "insurancecard_example.jpeg"
|
|
235
|
+
},
|
|
236
|
+
"ErrorMessage": null,
|
|
237
|
+
"IsOK": true
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
107
243
|
### Get User Image Canned URL
|
|
108
244
|
|
|
109
245
|
Public signature: `settingsClient.getUserImageCannedUrl(extension)`
|
|
110
246
|
|
|
111
|
-
Generates a
|
|
247
|
+
Generates a canned upload URL for a user selfie file.
|
|
248
|
+
The connector returns the raw backend response object for the generated file.
|
|
249
|
+
The package does not upload the file bytes for you.
|
|
250
|
+
When you upload to the returned S3 URL, you must preserve any signed headers that the URL expects.
|
|
251
|
+
In live verification, uploads succeeded only when the S3 request included `x-amz-acl: public-read`.
|
|
112
252
|
|
|
113
253
|
```ts
|
|
114
|
-
const selfieUpload = await settingsClient.getUserImageCannedUrl("
|
|
254
|
+
const selfieUpload = await settingsClient.getUserImageCannedUrl("jpeg");
|
|
115
255
|
```
|
|
116
256
|
|
|
257
|
+
#### Full API request
|
|
258
|
+
|
|
259
|
+
```json
|
|
260
|
+
{
|
|
261
|
+
"Data": {
|
|
262
|
+
"Extension": "jpeg"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
#### API response
|
|
268
|
+
|
|
269
|
+
Status:
|
|
270
|
+
|
|
271
|
+
```txt
|
|
272
|
+
200
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
```json
|
|
276
|
+
{
|
|
277
|
+
"ImageURL": "https://storage.example.com/selfie_example.jpeg?signature=example",
|
|
278
|
+
"FileName": "selfie_example.jpeg",
|
|
279
|
+
"Extension": "jpeg"
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
117
285
|
### Capture User Photo
|
|
118
286
|
|
|
119
287
|
Public signature: `settingsClient.captureUserPhoto(fileKey)`
|
|
120
288
|
|
|
121
|
-
|
|
122
|
-
The client
|
|
289
|
+
Convenience wrapper around the patient capture endpoint.
|
|
290
|
+
The client sends `Type: "userphoto"` and the uploaded file key inside the backend `Data` wrapper.
|
|
291
|
+
This method expects the file to have already been uploaded to the canned URL returned by `getUserImageCannedUrl(...)`.
|
|
292
|
+
If the canned URL requires signed S3 headers, the upload must include them before capture can succeed.
|
|
123
293
|
|
|
124
294
|
```ts
|
|
125
295
|
const capturedSelfie = await settingsClient.captureUserPhoto(
|
|
126
|
-
"
|
|
296
|
+
"selfie_example.jpeg"
|
|
127
297
|
);
|
|
128
298
|
```
|
|
129
299
|
|
|
300
|
+
#### Full API request
|
|
301
|
+
|
|
302
|
+
```json
|
|
303
|
+
{
|
|
304
|
+
"Data": {
|
|
305
|
+
"Type": "userphoto",
|
|
306
|
+
"FileID": "selfie_example.jpeg"
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
#### API response
|
|
312
|
+
|
|
313
|
+
Direct success response for a selfie image was not verified in the latest live run.
|
|
314
|
+
The same upload prerequisite applies here as for the ID and insurance flows: the file must exist at the canned URL upload target, and any signed S3 headers such as `x-amz-acl: public-read` must be preserved during upload.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
130
318
|
### Get Driving License Canned URL
|
|
131
319
|
|
|
132
320
|
Public signature: `settingsClient.getDrivingLicenseCannedUrl(extension)`
|
|
133
321
|
|
|
134
|
-
Generates a
|
|
322
|
+
Generates a canned upload URL for a driving license or identification file.
|
|
323
|
+
The package does not upload the file bytes for you.
|
|
324
|
+
When you upload to the returned S3 URL, you must preserve any signed headers that the URL expects.
|
|
325
|
+
In live verification, uploads succeeded only when the S3 request included `x-amz-acl: public-read`.
|
|
135
326
|
|
|
136
327
|
```ts
|
|
137
|
-
const idUpload = await settingsClient.getDrivingLicenseCannedUrl("
|
|
328
|
+
const idUpload = await settingsClient.getDrivingLicenseCannedUrl("jpeg");
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
#### Full API request
|
|
332
|
+
|
|
333
|
+
```json
|
|
334
|
+
{
|
|
335
|
+
"Data": {
|
|
336
|
+
"Extension": "jpeg"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
138
339
|
```
|
|
139
340
|
|
|
341
|
+
#### API response
|
|
342
|
+
|
|
343
|
+
Status:
|
|
344
|
+
|
|
345
|
+
```txt
|
|
346
|
+
200
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
```json
|
|
350
|
+
{
|
|
351
|
+
"ImageURL": "https://storage.example.com/idcard_example.jpeg?signature=example",
|
|
352
|
+
"FileName": "idcard_example.jpeg",
|
|
353
|
+
"Extension": "jpeg"
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
140
359
|
### Capture Driving License
|
|
141
360
|
|
|
142
361
|
Public signature: `settingsClient.captureDrivingLicense(fileKey)`
|
|
143
362
|
|
|
144
|
-
|
|
145
|
-
The client
|
|
363
|
+
Convenience wrapper around the patient capture endpoint.
|
|
364
|
+
The client sends `Type: "identification"` and the uploaded file key inside the backend `Data` wrapper.
|
|
365
|
+
This method expects the file to have already been uploaded to the canned URL returned by `getDrivingLicenseCannedUrl(...)`.
|
|
146
366
|
|
|
147
367
|
```ts
|
|
148
368
|
const capturedLicense = await settingsClient.captureDrivingLicense(
|
|
149
|
-
"
|
|
369
|
+
"idcard_example.jpeg"
|
|
150
370
|
);
|
|
151
371
|
```
|
|
152
372
|
|
|
373
|
+
#### Full API request
|
|
374
|
+
|
|
375
|
+
```json
|
|
376
|
+
{
|
|
377
|
+
"Data": {
|
|
378
|
+
"Type": "identification",
|
|
379
|
+
"FileID": "idcard_example.jpeg"
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
#### API response
|
|
385
|
+
|
|
386
|
+
Status:
|
|
387
|
+
|
|
388
|
+
```txt
|
|
389
|
+
200
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
```json
|
|
393
|
+
{
|
|
394
|
+
"Data": {
|
|
395
|
+
"CapturedData": {
|
|
396
|
+
"FirstName": "John",
|
|
397
|
+
"LastName": "Doe",
|
|
398
|
+
"StreetAddress": "123 Main St",
|
|
399
|
+
"City": "Springfield",
|
|
400
|
+
"ZipCode": "90210",
|
|
401
|
+
"State": "California",
|
|
402
|
+
"IssuedDate": "01/01/2024",
|
|
403
|
+
"ExpiresDate": "01/01/2028",
|
|
404
|
+
"Dob": "01/01/1990",
|
|
405
|
+
"IDNumber": null
|
|
406
|
+
},
|
|
407
|
+
"IsCaptured": true,
|
|
408
|
+
"InsurancePackages": null
|
|
409
|
+
},
|
|
410
|
+
"ErrorMessage": null,
|
|
411
|
+
"IsOK": true
|
|
412
|
+
}
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
153
417
|
### Update Driving License
|
|
154
418
|
|
|
155
419
|
Public signature: `settingsClient.updateDrivingLicense(payload)`
|
|
156
420
|
|
|
157
|
-
Updates patient driving license data through the
|
|
158
|
-
The client resolves the current
|
|
159
|
-
and sends the payload inside the backend `Data` wrapper.
|
|
160
|
-
`Image` should be the uploaded file key / path, not a raw file.
|
|
421
|
+
Updates patient driving license data through the EHR-backed route.
|
|
422
|
+
The client resolves the current `EHR` internally from `authClient.getUserInfo()` and sends the payload inside the backend `Data` wrapper.
|
|
161
423
|
|
|
162
424
|
```ts
|
|
163
425
|
const response = await settingsClient.updateDrivingLicense({
|
|
164
|
-
Image: "
|
|
426
|
+
Image: "idcard_example.jpeg"
|
|
165
427
|
});
|
|
166
428
|
```
|
|
167
429
|
|
|
430
|
+
#### Full API request
|
|
431
|
+
|
|
432
|
+
```json
|
|
433
|
+
{
|
|
434
|
+
"Data": {
|
|
435
|
+
"Image": "idcard_example.jpeg"
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
#### API response
|
|
441
|
+
|
|
442
|
+
Status:
|
|
443
|
+
|
|
444
|
+
```txt
|
|
445
|
+
200
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
```json
|
|
449
|
+
{
|
|
450
|
+
"Data": "true",
|
|
451
|
+
"ErrorMessage": null,
|
|
452
|
+
"IsOK": true
|
|
453
|
+
}
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
`Data` was observed as the string `"true"` in the live test environment after a successful upload and capture flow.
|
|
457
|
+
|
|
168
458
|
`submitDrivingLicense(payload)` is still available as a backward-compatible alias.
|
|
169
459
|
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
### Submit Driving License
|
|
463
|
+
|
|
464
|
+
Public signature: `settingsClient.submitDrivingLicense(payload)`
|
|
465
|
+
|
|
466
|
+
Backward-compatible alias for `updateDrivingLicense(payload)`.
|
|
467
|
+
It sends the same request payload and currently calls the same implementation internally.
|
|
468
|
+
|
|
469
|
+
```ts
|
|
470
|
+
const response = await settingsClient.submitDrivingLicense({
|
|
471
|
+
Image: "idcard_example.jpeg"
|
|
472
|
+
});
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
#### Full API request
|
|
476
|
+
|
|
477
|
+
```json
|
|
478
|
+
{
|
|
479
|
+
"Data": {
|
|
480
|
+
"Image": "idcard_example.jpeg"
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
#### API response
|
|
486
|
+
|
|
487
|
+
Status:
|
|
488
|
+
|
|
489
|
+
```txt
|
|
490
|
+
200
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
```json
|
|
494
|
+
{
|
|
495
|
+
"Data": "true",
|
|
496
|
+
"ErrorMessage": null,
|
|
497
|
+
"IsOK": true
|
|
498
|
+
}
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
170
503
|
### Get Insurance Canned URL
|
|
171
504
|
|
|
172
505
|
Public signature: `settingsClient.getInsuranceCannedUrl(extension)`
|
|
173
506
|
|
|
174
|
-
Generates a
|
|
507
|
+
Generates a canned upload URL for an insurance file.
|
|
508
|
+
The package does not upload the file bytes for you.
|
|
509
|
+
When you upload to the returned S3 URL, you must preserve any signed headers that the URL expects.
|
|
510
|
+
In live verification, uploads succeeded only when the S3 request included `x-amz-acl: public-read`.
|
|
175
511
|
|
|
176
512
|
```ts
|
|
177
|
-
const insuranceUpload = await settingsClient.getInsuranceCannedUrl("
|
|
513
|
+
const insuranceUpload = await settingsClient.getInsuranceCannedUrl("jpeg");
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
#### Full API request
|
|
517
|
+
|
|
518
|
+
```json
|
|
519
|
+
{
|
|
520
|
+
"Data": {
|
|
521
|
+
"Extension": "jpeg"
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
#### API response
|
|
527
|
+
|
|
528
|
+
Status:
|
|
529
|
+
|
|
530
|
+
```txt
|
|
531
|
+
200
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
```json
|
|
535
|
+
{
|
|
536
|
+
"ImageURL": "https://storage.example.com/insurancecard_example.jpeg?signature=example",
|
|
537
|
+
"FileName": "insurancecard_example.jpeg",
|
|
538
|
+
"Extension": "jpeg"
|
|
539
|
+
}
|
|
178
540
|
```
|
|
179
541
|
|
|
542
|
+
---
|
|
543
|
+
|
|
180
544
|
### Capture Insurance
|
|
181
545
|
|
|
182
546
|
Public signature: `settingsClient.captureInsurance(fileKey)`
|
|
183
547
|
|
|
184
|
-
|
|
185
|
-
The client
|
|
548
|
+
Convenience wrapper around the patient capture endpoint.
|
|
549
|
+
The client sends `Type: "healthinsurance"` and the uploaded file key inside the backend `Data` wrapper.
|
|
550
|
+
This method expects the file to have already been uploaded to the canned URL returned by `getInsuranceCannedUrl(...)`.
|
|
186
551
|
|
|
187
552
|
```ts
|
|
188
553
|
const capturedInsurance = await settingsClient.captureInsurance(
|
|
189
|
-
"
|
|
554
|
+
"insurancecard_example.jpeg"
|
|
190
555
|
);
|
|
191
556
|
```
|
|
192
557
|
|
|
558
|
+
#### Full API request
|
|
559
|
+
|
|
560
|
+
```json
|
|
561
|
+
{
|
|
562
|
+
"Data": {
|
|
563
|
+
"Type": "healthinsurance",
|
|
564
|
+
"FileID": "insurancecard_example.jpeg"
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
#### API response
|
|
570
|
+
|
|
571
|
+
Status:
|
|
572
|
+
|
|
573
|
+
```txt
|
|
574
|
+
200
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
```json
|
|
578
|
+
{
|
|
579
|
+
"Data": {
|
|
580
|
+
"CapturedData": {
|
|
581
|
+
"FirstName": "John",
|
|
582
|
+
"LastName": "Doe",
|
|
583
|
+
"MemberId": "member-id-example",
|
|
584
|
+
"GroupNumber": "group-number-example",
|
|
585
|
+
"EffectiveDate": "",
|
|
586
|
+
"RxBIN": "",
|
|
587
|
+
"RxPCN": "",
|
|
588
|
+
"RxGRP": "",
|
|
589
|
+
"Carrier": "Carrier Example"
|
|
590
|
+
},
|
|
591
|
+
"IsCaptured": true,
|
|
592
|
+
"InsurancePackages": null
|
|
593
|
+
},
|
|
594
|
+
"ErrorMessage": null,
|
|
595
|
+
"IsOK": true
|
|
596
|
+
}
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
---
|
|
600
|
+
|
|
193
601
|
### Get Insurances
|
|
194
602
|
|
|
195
603
|
Public signature: `settingsClient.getInsurances()`
|
|
196
604
|
|
|
197
|
-
Returns patient insurances through the
|
|
198
|
-
The client resolves the current
|
|
605
|
+
Returns patient insurances through the EHR-backed route.
|
|
606
|
+
The client resolves the current `EHR` internally from `authClient.getUserInfo()`.
|
|
199
607
|
|
|
200
608
|
```ts
|
|
201
609
|
const insurances = await settingsClient.getInsurances();
|
|
202
610
|
```
|
|
203
611
|
|
|
612
|
+
#### Full API request
|
|
613
|
+
|
|
614
|
+
This method performs an authenticated request internally and does not send a request body.
|
|
615
|
+
|
|
616
|
+
#### API response
|
|
617
|
+
|
|
618
|
+
Status:
|
|
619
|
+
|
|
620
|
+
```txt
|
|
621
|
+
200
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
```json
|
|
625
|
+
{
|
|
626
|
+
"Data": [
|
|
627
|
+
{
|
|
628
|
+
"InsuranceId": "insurance-id-example",
|
|
629
|
+
"InsurancePackageId": 693245,
|
|
630
|
+
"InsurancePolicyHolderFirstName": "John",
|
|
631
|
+
"InsurancePolicyHolderLastName": "Doe",
|
|
632
|
+
"InsurancePolicyHolder": "John Doe",
|
|
633
|
+
"RelationshipToInsured": "Self",
|
|
634
|
+
"EligibilityStatus": "Active",
|
|
635
|
+
"InsurancePlanName": " - ",
|
|
636
|
+
"InsuranceType": "FHIR",
|
|
637
|
+
"MemberId": "member-id-example",
|
|
638
|
+
"Image": "insurancecard_example.jpeg"
|
|
639
|
+
}
|
|
640
|
+
],
|
|
641
|
+
"ErrorMessage": null,
|
|
642
|
+
"IsOK": true
|
|
643
|
+
}
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
---
|
|
647
|
+
|
|
204
648
|
### Update User Image URL
|
|
205
649
|
|
|
206
650
|
Public signature: `settingsClient.updateUserImage(fileName)`
|
|
207
651
|
|
|
208
|
-
Updates the user
|
|
652
|
+
Updates the stored user image file reference using a file name returned from `getUserImageCannedUrl(...)`.
|
|
209
653
|
|
|
210
654
|
```ts
|
|
211
|
-
await settingsClient.updateUserImage(
|
|
655
|
+
const updated = await settingsClient.updateUserImage(
|
|
656
|
+
"selfie_example.jpeg"
|
|
657
|
+
);
|
|
212
658
|
```
|
|
213
659
|
|
|
660
|
+
#### Full API request
|
|
661
|
+
|
|
662
|
+
```json
|
|
663
|
+
{
|
|
664
|
+
"Data": {
|
|
665
|
+
"FileName": "selfie_example.jpeg"
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
#### API response
|
|
671
|
+
|
|
672
|
+
Status:
|
|
673
|
+
|
|
674
|
+
```txt
|
|
675
|
+
200
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
```json
|
|
679
|
+
true
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
---
|
|
683
|
+
|
|
214
684
|
### Deactivate User
|
|
215
685
|
|
|
216
686
|
Public signature: `settingsClient.deactivateUser()`
|
|
217
687
|
|
|
218
|
-
Deactivates the current user.
|
|
688
|
+
Deactivates the current authenticated user.
|
|
219
689
|
|
|
220
690
|
```ts
|
|
221
691
|
await settingsClient.deactivateUser();
|
|
222
692
|
```
|
|
223
693
|
|
|
224
|
-
|
|
694
|
+
#### Full API request
|
|
225
695
|
|
|
226
|
-
|
|
696
|
+
```json
|
|
697
|
+
{
|
|
698
|
+
"Data": {}
|
|
699
|
+
}
|
|
700
|
+
```
|
|
227
701
|
|
|
228
|
-
|
|
229
|
-
- Handles authentication
|
|
230
|
-
- Resolves base API URL
|
|
231
|
-
- Provides authorization headers
|
|
232
|
-
- Resolves the current user's `EHR` for EHR-backed settings methods
|
|
702
|
+
#### API response
|
|
233
703
|
|
|
234
|
-
|
|
235
|
-
|
|
704
|
+
This method was not directly verified in the live environment because it would deactivate the authenticated test user.
|
|
705
|
+
The client returns the raw backend response from the authenticated `PUT` request.
|
|
236
706
|
|
|
237
|
-
|
|
238
|
-
|
|
707
|
+
---
|
|
708
|
+
|
|
709
|
+
## How It Works
|
|
710
|
+
|
|
711
|
+
- `HCLoginClient` handles tenant configuration, authentication, and authenticated headers.
|
|
712
|
+
- `HCSettingsClient` uses the authenticated login client to call patient settings and profile-related endpoints.
|
|
713
|
+
- Canned URL methods return a backend-generated upload URL and file name, but the caller is responsible for uploading the file bytes and preserving any signed S3 headers required by that URL.
|
|
714
|
+
- Capture, insurance, and EHR-backed settings methods all use the authenticated patient context from the shared login client.
|
|
715
|
+
- `getInsurances()`, `updateDrivingLicense()`, and `submitDrivingLicense()` resolve the active patient's `EHR` internally before building the final route.
|
|
239
716
|
|
|
240
717
|
---
|
|
241
718
|
|
|
242
719
|
## Notes
|
|
243
720
|
|
|
244
|
-
- `HCLoginClient` must be configured and logged in before calling settings methods
|
|
245
|
-
- `getUserImageCannedUrl()`
|
|
246
|
-
-
|
|
247
|
-
- `
|
|
248
|
-
- `captureUserPhoto()` sends `Type: "userphoto"` and `FileID` to
|
|
249
|
-
- `captureDrivingLicense()` sends `Type: "identification"` and `FileID` to
|
|
250
|
-
- `captureInsurance()` sends `Type: "healthinsurance"` and `FileID` to
|
|
251
|
-
- `updateDrivingLicense()` and `submitDrivingLicense()` send `{ Data: { Image:
|
|
252
|
-
- `
|
|
253
|
-
|
|
721
|
+
- `HCLoginClient` must be configured and logged in before calling settings methods.
|
|
722
|
+
- `getUserImageCannedUrl()`, `getDrivingLicenseCannedUrl()`, and `getInsuranceCannedUrl()` return the backend canned URL response and do not upload the file contents.
|
|
723
|
+
- After requesting a canned URL, the file must be uploaded outside this package before capture methods can succeed.
|
|
724
|
+
- Live verification showed that the S3 upload must preserve signed headers from the canned URL; when `x-amz-acl` was signed, uploads succeeded with `x-amz-acl: public-read`.
|
|
725
|
+
- `captureUserPhoto()` sends `Type: "userphoto"` and `FileID` to the patient capture endpoint.
|
|
726
|
+
- `captureDrivingLicense()` sends `Type: "identification"` and `FileID` to the patient capture endpoint.
|
|
727
|
+
- `captureInsurance()` sends `Type: "healthinsurance"` and `FileID` to the patient capture endpoint.
|
|
728
|
+
- `updateDrivingLicense()` and `submitDrivingLicense()` send `{ "Data": { "Image": "..." } }` to the resolved EHR patient route.
|
|
729
|
+
- `submitDrivingLicense()` is a backward-compatible alias of `updateDrivingLicense()`.
|
|
730
|
+
- `getInsurances()`, `updateDrivingLicense()`, and `submitDrivingLicense()` internally resolve the current patient's `EHR`.
|
|
731
|
+
- Live verification showed the canned URL methods returning `ImageURL`, `FileName`, and `Extension` keys from the backend response.
|
package/dist/index.d.cts
CHANGED
|
@@ -3,9 +3,12 @@ import { HttpClient } from '@healthcloudai/hc-http';
|
|
|
3
3
|
|
|
4
4
|
type Environment = "dev" | "uat" | "prod";
|
|
5
5
|
interface UserImage {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
ImageURL: string;
|
|
7
|
+
FileName: string;
|
|
8
|
+
Extension: string;
|
|
9
|
+
imageUrl?: string;
|
|
10
|
+
fileName?: string;
|
|
11
|
+
extension?: string;
|
|
9
12
|
}
|
|
10
13
|
interface UserInfo {
|
|
11
14
|
ID?: string;
|
|
@@ -79,7 +82,7 @@ declare class HCSettingsClient {
|
|
|
79
82
|
getInsurances(): Promise<any>;
|
|
80
83
|
updateDrivingLicense(payload: DrivingLicenseData): Promise<DrivingLicenseResponse>;
|
|
81
84
|
submitDrivingLicense(payload: DrivingLicenseData): Promise<DrivingLicenseResponse>;
|
|
82
|
-
updateUserImage(fileName: string): Promise<
|
|
85
|
+
updateUserImage(fileName: string): Promise<any>;
|
|
83
86
|
deactivateUser(): Promise<any>;
|
|
84
87
|
private buildEhrPatientUrl;
|
|
85
88
|
private getResolvedEhr;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,9 +3,12 @@ import { HttpClient } from '@healthcloudai/hc-http';
|
|
|
3
3
|
|
|
4
4
|
type Environment = "dev" | "uat" | "prod";
|
|
5
5
|
interface UserImage {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
ImageURL: string;
|
|
7
|
+
FileName: string;
|
|
8
|
+
Extension: string;
|
|
9
|
+
imageUrl?: string;
|
|
10
|
+
fileName?: string;
|
|
11
|
+
extension?: string;
|
|
9
12
|
}
|
|
10
13
|
interface UserInfo {
|
|
11
14
|
ID?: string;
|
|
@@ -79,7 +82,7 @@ declare class HCSettingsClient {
|
|
|
79
82
|
getInsurances(): Promise<any>;
|
|
80
83
|
updateDrivingLicense(payload: DrivingLicenseData): Promise<DrivingLicenseResponse>;
|
|
81
84
|
submitDrivingLicense(payload: DrivingLicenseData): Promise<DrivingLicenseResponse>;
|
|
82
|
-
updateUserImage(fileName: string): Promise<
|
|
85
|
+
updateUserImage(fileName: string): Promise<any>;
|
|
83
86
|
deactivateUser(): Promise<any>;
|
|
84
87
|
private buildEhrPatientUrl;
|
|
85
88
|
private getResolvedEhr;
|