@healthcloudai/hc-settings-connector 0.2.1 → 0.2.2
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 +76 -3
- package/dist/index.cjs +23 -0
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +23 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,7 +13,8 @@ This connector gives authenticated patients access to account information and do
|
|
|
13
13
|
3. Submit uploaded identification and insurance images for capture.
|
|
14
14
|
4. Submit and retrieve insurance information.
|
|
15
15
|
5. Update the patient profile image.
|
|
16
|
-
6.
|
|
16
|
+
6. Capture registration documents before the patient is authenticated.
|
|
17
|
+
7. Deactivate the authenticated patient account.
|
|
17
18
|
|
|
18
19
|
---
|
|
19
20
|
|
|
@@ -59,7 +60,7 @@ const settingsClient = new HCSettingsClient(
|
|
|
59
60
|
);
|
|
60
61
|
```
|
|
61
62
|
|
|
62
|
-
`HCLoginClient` must be configured
|
|
63
|
+
`HCLoginClient` must be configured before creating the Settings client. Most Settings methods require an authenticated patient session. `captureRegistrationDocument(...)` is intended for unauthenticated registration flows and does not send the auth token.
|
|
63
64
|
|
|
64
65
|
---
|
|
65
66
|
|
|
@@ -677,6 +678,77 @@ console.log(response);
|
|
|
677
678
|
|
|
678
679
|
---
|
|
679
680
|
|
|
681
|
+
# Registration Document Capture
|
|
682
|
+
|
|
683
|
+
Registration document capture is used during registration, before the user is authenticated. It sends the same capture request shape as patient capture, but it does not attach the patient authorization token.
|
|
684
|
+
|
|
685
|
+
## Capture Registration Document
|
|
686
|
+
|
|
687
|
+
Public signature:
|
|
688
|
+
|
|
689
|
+
```ts
|
|
690
|
+
settingsClient.captureRegistrationDocument(
|
|
691
|
+
fileKey,
|
|
692
|
+
type
|
|
693
|
+
)
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
`type` must be one of:
|
|
697
|
+
|
|
698
|
+
```ts
|
|
699
|
+
"identification" | "healthinsurance"
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
Only `loginClient.configure(...)` is required for this method so the connector can resolve the API base URL.
|
|
703
|
+
|
|
704
|
+
```ts
|
|
705
|
+
const response =
|
|
706
|
+
await settingsClient.captureRegistrationDocument(
|
|
707
|
+
"idcard_example.jpeg",
|
|
708
|
+
"identification"
|
|
709
|
+
);
|
|
710
|
+
|
|
711
|
+
console.log(response);
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
### API request
|
|
715
|
+
|
|
716
|
+
```json
|
|
717
|
+
{
|
|
718
|
+
"Data": {
|
|
719
|
+
"Type": "identification",
|
|
720
|
+
"FileID": "idcard_example.jpeg"
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
### API response
|
|
726
|
+
|
|
727
|
+
```json
|
|
728
|
+
{
|
|
729
|
+
"Data": {
|
|
730
|
+
"CapturedData": {
|
|
731
|
+
"FirstName": "John",
|
|
732
|
+
"LastName": "Doe",
|
|
733
|
+
"StreetAddress": "123 Main St",
|
|
734
|
+
"City": "Springfield",
|
|
735
|
+
"ZipCode": "90210",
|
|
736
|
+
"State": "California",
|
|
737
|
+
"IssuedDate": "01/01/2024",
|
|
738
|
+
"ExpiresDate": "01/01/2028",
|
|
739
|
+
"Dob": "01/01/1990",
|
|
740
|
+
"IDNumber": null
|
|
741
|
+
},
|
|
742
|
+
"IsCaptured": true,
|
|
743
|
+
"InsurancePackages": null
|
|
744
|
+
},
|
|
745
|
+
"ErrorMessage": null,
|
|
746
|
+
"IsOK": true
|
|
747
|
+
}
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
---
|
|
751
|
+
|
|
680
752
|
# Account
|
|
681
753
|
|
|
682
754
|
## Deactivate User
|
|
@@ -726,6 +798,7 @@ console.log(response);
|
|
|
726
798
|
* `captureDrivingLicense(...)` internally sends `Type: "identification"`.
|
|
727
799
|
* `captureInsurance(...)` internally sends `Type: "healthinsurance"`.
|
|
728
800
|
* `captureUserPhoto(...)` internally sends `Type: "userphoto"`.
|
|
801
|
+
* `captureRegistrationDocument(...)` does not send the patient auth token.
|
|
729
802
|
|
|
730
803
|
```
|
|
731
804
|
```
|
|
@@ -735,7 +808,7 @@ console.log(response);
|
|
|
735
808
|
|
|
736
809
|
## Prerequisites
|
|
737
810
|
|
|
738
|
-
`HCLoginClient` must be configured
|
|
811
|
+
`HCLoginClient` must be configured before using this connector. Most methods require the patient to be logged in. `captureRegistrationDocument(...)` is the unauthenticated exception and does not send the auth token.
|
|
739
812
|
|
|
740
813
|
```ts
|
|
741
814
|
import { HCLoginClient } from "@healthcloudai/hc-login-connector";
|
package/dist/index.cjs
CHANGED
|
@@ -240,6 +240,29 @@ var HCSettingsClient = class extends import_hc_http.HCBaseConnector {
|
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
// ===========================================================================
|
|
243
|
+
// Registration document capture
|
|
244
|
+
// ===========================================================================
|
|
245
|
+
/**
|
|
246
|
+
* Submits an uploaded registration document for capture without sending
|
|
247
|
+
* an authenticated patient token.
|
|
248
|
+
* fileKey is the storage key of the uploaded image.
|
|
249
|
+
*/
|
|
250
|
+
async captureRegistrationDocument(fileKey, type) {
|
|
251
|
+
const resolvedFileKey = this.requireValue(fileKey, "File key", "fileKey");
|
|
252
|
+
const resolvedType = this.requireValue(type, "Capture type", "type");
|
|
253
|
+
const requestPayload = {
|
|
254
|
+
Data: { Type: resolvedType, FileID: resolvedFileKey }
|
|
255
|
+
};
|
|
256
|
+
return this.execute(
|
|
257
|
+
"captureRegistrationDocument",
|
|
258
|
+
() => this.http.post(
|
|
259
|
+
`${this.auth.getBaseUrl()}/api/registrationdocument/capture`,
|
|
260
|
+
requestPayload,
|
|
261
|
+
this.getHeaders()
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
// ===========================================================================
|
|
243
266
|
// Account
|
|
244
267
|
// ===========================================================================
|
|
245
268
|
/**
|
package/dist/index.d.cts
CHANGED
|
@@ -51,7 +51,7 @@ interface PatientDashboard {
|
|
|
51
51
|
EHR: string | null;
|
|
52
52
|
PendingActions: string[];
|
|
53
53
|
}
|
|
54
|
-
type CaptureType = "healthinsurance" | "identification"
|
|
54
|
+
type CaptureType = "healthinsurance" | "identification";
|
|
55
55
|
interface InsuranceCaptureData {
|
|
56
56
|
FirstName: string | null;
|
|
57
57
|
LastName: string | null;
|
|
@@ -83,6 +83,7 @@ interface CaptureResult<T> {
|
|
|
83
83
|
IsCaptured: boolean;
|
|
84
84
|
InsurancePackages: object[] | null;
|
|
85
85
|
}
|
|
86
|
+
type RegistrationDocumentCaptureResult = CaptureResult<InsuranceCaptureData | IdentificationCaptureData>;
|
|
86
87
|
interface InsuranceRecord {
|
|
87
88
|
LastUpdatedBy: string | null;
|
|
88
89
|
IrcName: string | null;
|
|
@@ -164,6 +165,12 @@ declare class HCSettingsClient extends HCBaseConnector {
|
|
|
164
165
|
* fileKey is the storage key of the uploaded image.
|
|
165
166
|
*/
|
|
166
167
|
captureUserPhoto(fileKey: string): Promise<APIResponse<CaptureResult<UserPhotoCaptureData>>>;
|
|
168
|
+
/**
|
|
169
|
+
* Submits an uploaded registration document for capture without sending
|
|
170
|
+
* an authenticated patient token.
|
|
171
|
+
* fileKey is the storage key of the uploaded image.
|
|
172
|
+
*/
|
|
173
|
+
captureRegistrationDocument(fileKey: string, type: CaptureType): Promise<APIResponse<RegistrationDocumentCaptureResult>>;
|
|
167
174
|
/**
|
|
168
175
|
* Soft-deactivates the current patient account.
|
|
169
176
|
* The patient record is not permanently deleted.
|
|
@@ -172,4 +179,4 @@ declare class HCSettingsClient extends HCBaseConnector {
|
|
|
172
179
|
private getAuthHeaders;
|
|
173
180
|
}
|
|
174
181
|
|
|
175
|
-
export { type CaptureResult, type CaptureType, type CoverageData, type Encounter, HCSettingsClient, type IdentificationCaptureData, type InsuranceCaptureData, type InsuranceRecord, type PatientDashboard, type PatientRecord, type UserImage, type UserPhotoCaptureData, UserStatus };
|
|
182
|
+
export { type CaptureResult, type CaptureType, type CoverageData, type Encounter, HCSettingsClient, type IdentificationCaptureData, type InsuranceCaptureData, type InsuranceRecord, type PatientDashboard, type PatientRecord, type RegistrationDocumentCaptureResult, type UserImage, type UserPhotoCaptureData, UserStatus };
|
package/dist/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ interface PatientDashboard {
|
|
|
51
51
|
EHR: string | null;
|
|
52
52
|
PendingActions: string[];
|
|
53
53
|
}
|
|
54
|
-
type CaptureType = "healthinsurance" | "identification"
|
|
54
|
+
type CaptureType = "healthinsurance" | "identification";
|
|
55
55
|
interface InsuranceCaptureData {
|
|
56
56
|
FirstName: string | null;
|
|
57
57
|
LastName: string | null;
|
|
@@ -83,6 +83,7 @@ interface CaptureResult<T> {
|
|
|
83
83
|
IsCaptured: boolean;
|
|
84
84
|
InsurancePackages: object[] | null;
|
|
85
85
|
}
|
|
86
|
+
type RegistrationDocumentCaptureResult = CaptureResult<InsuranceCaptureData | IdentificationCaptureData>;
|
|
86
87
|
interface InsuranceRecord {
|
|
87
88
|
LastUpdatedBy: string | null;
|
|
88
89
|
IrcName: string | null;
|
|
@@ -164,6 +165,12 @@ declare class HCSettingsClient extends HCBaseConnector {
|
|
|
164
165
|
* fileKey is the storage key of the uploaded image.
|
|
165
166
|
*/
|
|
166
167
|
captureUserPhoto(fileKey: string): Promise<APIResponse<CaptureResult<UserPhotoCaptureData>>>;
|
|
168
|
+
/**
|
|
169
|
+
* Submits an uploaded registration document for capture without sending
|
|
170
|
+
* an authenticated patient token.
|
|
171
|
+
* fileKey is the storage key of the uploaded image.
|
|
172
|
+
*/
|
|
173
|
+
captureRegistrationDocument(fileKey: string, type: CaptureType): Promise<APIResponse<RegistrationDocumentCaptureResult>>;
|
|
167
174
|
/**
|
|
168
175
|
* Soft-deactivates the current patient account.
|
|
169
176
|
* The patient record is not permanently deleted.
|
|
@@ -172,4 +179,4 @@ declare class HCSettingsClient extends HCBaseConnector {
|
|
|
172
179
|
private getAuthHeaders;
|
|
173
180
|
}
|
|
174
181
|
|
|
175
|
-
export { type CaptureResult, type CaptureType, type CoverageData, type Encounter, HCSettingsClient, type IdentificationCaptureData, type InsuranceCaptureData, type InsuranceRecord, type PatientDashboard, type PatientRecord, type UserImage, type UserPhotoCaptureData, UserStatus };
|
|
182
|
+
export { type CaptureResult, type CaptureType, type CoverageData, type Encounter, HCSettingsClient, type IdentificationCaptureData, type InsuranceCaptureData, type InsuranceRecord, type PatientDashboard, type PatientRecord, type RegistrationDocumentCaptureResult, type UserImage, type UserPhotoCaptureData, UserStatus };
|
package/dist/index.js
CHANGED
|
@@ -208,6 +208,29 @@ var HCSettingsClient = class extends HCBaseConnector {
|
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
// ===========================================================================
|
|
211
|
+
// Registration document capture
|
|
212
|
+
// ===========================================================================
|
|
213
|
+
/**
|
|
214
|
+
* Submits an uploaded registration document for capture without sending
|
|
215
|
+
* an authenticated patient token.
|
|
216
|
+
* fileKey is the storage key of the uploaded image.
|
|
217
|
+
*/
|
|
218
|
+
async captureRegistrationDocument(fileKey, type) {
|
|
219
|
+
const resolvedFileKey = this.requireValue(fileKey, "File key", "fileKey");
|
|
220
|
+
const resolvedType = this.requireValue(type, "Capture type", "type");
|
|
221
|
+
const requestPayload = {
|
|
222
|
+
Data: { Type: resolvedType, FileID: resolvedFileKey }
|
|
223
|
+
};
|
|
224
|
+
return this.execute(
|
|
225
|
+
"captureRegistrationDocument",
|
|
226
|
+
() => this.http.post(
|
|
227
|
+
`${this.auth.getBaseUrl()}/api/registrationdocument/capture`,
|
|
228
|
+
requestPayload,
|
|
229
|
+
this.getHeaders()
|
|
230
|
+
)
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
// ===========================================================================
|
|
211
234
|
// Account
|
|
212
235
|
// ===========================================================================
|
|
213
236
|
/**
|