@healthcloudai/hc-settings-connector 0.0.4 → 0.0.5
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 +12 -10
- package/dist/index.cjs +4 -1
- package/dist/index.d.cts +20 -20
- package/dist/index.d.ts +20 -20
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -146,25 +146,27 @@ The client internally sends `Type: "identification"` and `FileID: fileKey`.
|
|
|
146
146
|
|
|
147
147
|
```ts
|
|
148
148
|
const capturedLicense = await settingsClient.captureDrivingLicense(
|
|
149
|
-
"
|
|
149
|
+
"idcard_639064123637965380.jpg"
|
|
150
150
|
);
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
###
|
|
153
|
+
### Update Driving License
|
|
154
154
|
|
|
155
|
-
Public signature: `settingsClient.
|
|
155
|
+
Public signature: `settingsClient.updateDrivingLicense(payload)`
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
Updates patient driving license data through the wrapper-backed EHR route.
|
|
158
158
|
The client resolves the current patient's `EHR` internally from `authClient.getUserInfo()`
|
|
159
159
|
and sends the payload inside the backend `Data` wrapper.
|
|
160
|
+
`Image` should be the uploaded file key / path, not a raw file.
|
|
160
161
|
|
|
161
162
|
```ts
|
|
162
|
-
await settingsClient.
|
|
163
|
-
|
|
164
|
-
State: "CA"
|
|
163
|
+
const response = await settingsClient.updateDrivingLicense({
|
|
164
|
+
Image: "idcard_639064123637965380.jpg"
|
|
165
165
|
});
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
`submitDrivingLicense(payload)` is still available as a backward-compatible alias.
|
|
169
|
+
|
|
168
170
|
### Get Insurance Canned URL
|
|
169
171
|
|
|
170
172
|
Public signature: `settingsClient.getInsuranceCannedUrl(extension)`
|
|
@@ -184,7 +186,7 @@ The client internally sends `Type: "healthinsurance"` and `FileID: fileKey`.
|
|
|
184
186
|
|
|
185
187
|
```ts
|
|
186
188
|
const capturedInsurance = await settingsClient.captureInsurance(
|
|
187
|
-
"
|
|
189
|
+
"insurance_639064123637965380.jpg"
|
|
188
190
|
);
|
|
189
191
|
```
|
|
190
192
|
|
|
@@ -246,6 +248,6 @@ await settingsClient.deactivateUser();
|
|
|
246
248
|
- `captureUserPhoto()` sends `Type: "userphoto"` and `FileID` to `/patient/capture`
|
|
247
249
|
- `captureDrivingLicense()` sends `Type: "identification"` and `FileID` to `/patient/capture`
|
|
248
250
|
- `captureInsurance()` sends `Type: "healthinsurance"` and `FileID` to `/patient/capture`
|
|
249
|
-
- `
|
|
250
|
-
|
|
251
|
+
- `updateDrivingLicense()` and `submitDrivingLicense()` send `{ Data: { Image: fileKey } }`
|
|
252
|
+
- `getInsurances()`, `updateDrivingLicense()` and `submitDrivingLicense()` internally resolve the current patient's `EHR`
|
|
251
253
|
|
package/dist/index.cjs
CHANGED
|
@@ -164,7 +164,7 @@ var HCSettingsClient = class {
|
|
|
164
164
|
this.auth.getAuthHeader()
|
|
165
165
|
);
|
|
166
166
|
}
|
|
167
|
-
async
|
|
167
|
+
async updateDrivingLicense(payload) {
|
|
168
168
|
const requestPayload = {
|
|
169
169
|
Data: payload
|
|
170
170
|
};
|
|
@@ -177,6 +177,9 @@ var HCSettingsClient = class {
|
|
|
177
177
|
}
|
|
178
178
|
);
|
|
179
179
|
}
|
|
180
|
+
async submitDrivingLicense(payload) {
|
|
181
|
+
return this.updateDrivingLicense(payload);
|
|
182
|
+
}
|
|
180
183
|
async updateUserImage(fileName) {
|
|
181
184
|
var _a;
|
|
182
185
|
const payload = {
|
package/dist/index.d.cts
CHANGED
|
@@ -22,6 +22,14 @@ interface UserInfoResponse {
|
|
|
22
22
|
};
|
|
23
23
|
EHR?: string;
|
|
24
24
|
}
|
|
25
|
+
interface APIRequest<T> {
|
|
26
|
+
Data: T;
|
|
27
|
+
}
|
|
28
|
+
interface APIResponse<T> {
|
|
29
|
+
Data: T;
|
|
30
|
+
IsOK: boolean;
|
|
31
|
+
ErrorMessage?: string | null;
|
|
32
|
+
}
|
|
25
33
|
interface CoverageRequest {
|
|
26
34
|
InsurancePackageId: string;
|
|
27
35
|
MemberId: string;
|
|
@@ -30,36 +38,27 @@ interface CoverageRequest {
|
|
|
30
38
|
Sex: string;
|
|
31
39
|
Image: string;
|
|
32
40
|
}
|
|
33
|
-
|
|
34
|
-
Data: CoverageRequest;
|
|
35
|
-
}
|
|
41
|
+
type CoveragePayload = APIRequest<CoverageRequest>;
|
|
36
42
|
type CaptureType = "identification" | "healthinsurance" | "userphoto";
|
|
37
43
|
interface CaptureData {
|
|
38
44
|
Type: CaptureType;
|
|
39
45
|
FileID: string;
|
|
40
46
|
}
|
|
41
|
-
|
|
42
|
-
Data: CaptureData;
|
|
43
|
-
}
|
|
47
|
+
type CaptureRequest = APIRequest<CaptureData>;
|
|
44
48
|
interface UploadImageData {
|
|
45
49
|
Extension: string;
|
|
46
50
|
}
|
|
47
|
-
|
|
48
|
-
Data: UploadImageData;
|
|
49
|
-
}
|
|
51
|
+
type UploadImageRequest = APIRequest<UploadImageData>;
|
|
50
52
|
interface UpdateImageData {
|
|
51
53
|
FileName: string;
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Data: Record<string, never>;
|
|
58
|
-
}
|
|
59
|
-
type DrivingLicenseData = Record<string, string | number | boolean | null>;
|
|
60
|
-
interface DrivingLicenseRequest {
|
|
61
|
-
Data: DrivingLicenseData;
|
|
55
|
+
type UpdateImageRequest = APIRequest<UpdateImageData>;
|
|
56
|
+
type EmptyRequest = APIRequest<Record<string, never>>;
|
|
57
|
+
interface DrivingLicenseData {
|
|
58
|
+
Image: string;
|
|
62
59
|
}
|
|
60
|
+
type DrivingLicenseRequest = APIRequest<DrivingLicenseData>;
|
|
61
|
+
type DrivingLicenseResponse = APIResponse<string>;
|
|
63
62
|
type HCUserImage = UserImage;
|
|
64
63
|
type HCUserInfo = UserInfo;
|
|
65
64
|
|
|
@@ -78,7 +77,8 @@ declare class HCSettingsClient {
|
|
|
78
77
|
captureInsurance(fileKey: string): Promise<any>;
|
|
79
78
|
submitInsurance(payload: CoverageRequest): Promise<any>;
|
|
80
79
|
getInsurances(): Promise<any>;
|
|
81
|
-
|
|
80
|
+
updateDrivingLicense(payload: DrivingLicenseData): Promise<DrivingLicenseResponse>;
|
|
81
|
+
submitDrivingLicense(payload: DrivingLicenseData): Promise<DrivingLicenseResponse>;
|
|
82
82
|
updateUserImage(fileName: string): Promise<UserImage>;
|
|
83
83
|
deactivateUser(): Promise<any>;
|
|
84
84
|
private buildEhrPatientUrl;
|
|
@@ -96,4 +96,4 @@ declare class HttpError extends Error {
|
|
|
96
96
|
constructor(status: number, message: string);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
export { AuthError, type CaptureData, type CaptureRequest, type CaptureType, ConfigError, type CoveragePayload, type CoverageRequest, type DrivingLicenseData, type DrivingLicenseRequest, type EmptyRequest, type Environment, HCSettingsClient, type HCUserImage, type HCUserInfo, HttpError, type UpdateImageData, type UpdateImageRequest, type UploadImageData, type UploadImageRequest, type UserImage, type UserInfo, type UserInfoResponse };
|
|
99
|
+
export { type APIRequest, type APIResponse, AuthError, type CaptureData, type CaptureRequest, type CaptureType, ConfigError, type CoveragePayload, type CoverageRequest, type DrivingLicenseData, type DrivingLicenseRequest, type DrivingLicenseResponse, type EmptyRequest, type Environment, HCSettingsClient, type HCUserImage, type HCUserInfo, HttpError, type UpdateImageData, type UpdateImageRequest, type UploadImageData, type UploadImageRequest, type UserImage, type UserInfo, type UserInfoResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,14 @@ interface UserInfoResponse {
|
|
|
22
22
|
};
|
|
23
23
|
EHR?: string;
|
|
24
24
|
}
|
|
25
|
+
interface APIRequest<T> {
|
|
26
|
+
Data: T;
|
|
27
|
+
}
|
|
28
|
+
interface APIResponse<T> {
|
|
29
|
+
Data: T;
|
|
30
|
+
IsOK: boolean;
|
|
31
|
+
ErrorMessage?: string | null;
|
|
32
|
+
}
|
|
25
33
|
interface CoverageRequest {
|
|
26
34
|
InsurancePackageId: string;
|
|
27
35
|
MemberId: string;
|
|
@@ -30,36 +38,27 @@ interface CoverageRequest {
|
|
|
30
38
|
Sex: string;
|
|
31
39
|
Image: string;
|
|
32
40
|
}
|
|
33
|
-
|
|
34
|
-
Data: CoverageRequest;
|
|
35
|
-
}
|
|
41
|
+
type CoveragePayload = APIRequest<CoverageRequest>;
|
|
36
42
|
type CaptureType = "identification" | "healthinsurance" | "userphoto";
|
|
37
43
|
interface CaptureData {
|
|
38
44
|
Type: CaptureType;
|
|
39
45
|
FileID: string;
|
|
40
46
|
}
|
|
41
|
-
|
|
42
|
-
Data: CaptureData;
|
|
43
|
-
}
|
|
47
|
+
type CaptureRequest = APIRequest<CaptureData>;
|
|
44
48
|
interface UploadImageData {
|
|
45
49
|
Extension: string;
|
|
46
50
|
}
|
|
47
|
-
|
|
48
|
-
Data: UploadImageData;
|
|
49
|
-
}
|
|
51
|
+
type UploadImageRequest = APIRequest<UploadImageData>;
|
|
50
52
|
interface UpdateImageData {
|
|
51
53
|
FileName: string;
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Data: Record<string, never>;
|
|
58
|
-
}
|
|
59
|
-
type DrivingLicenseData = Record<string, string | number | boolean | null>;
|
|
60
|
-
interface DrivingLicenseRequest {
|
|
61
|
-
Data: DrivingLicenseData;
|
|
55
|
+
type UpdateImageRequest = APIRequest<UpdateImageData>;
|
|
56
|
+
type EmptyRequest = APIRequest<Record<string, never>>;
|
|
57
|
+
interface DrivingLicenseData {
|
|
58
|
+
Image: string;
|
|
62
59
|
}
|
|
60
|
+
type DrivingLicenseRequest = APIRequest<DrivingLicenseData>;
|
|
61
|
+
type DrivingLicenseResponse = APIResponse<string>;
|
|
63
62
|
type HCUserImage = UserImage;
|
|
64
63
|
type HCUserInfo = UserInfo;
|
|
65
64
|
|
|
@@ -78,7 +77,8 @@ declare class HCSettingsClient {
|
|
|
78
77
|
captureInsurance(fileKey: string): Promise<any>;
|
|
79
78
|
submitInsurance(payload: CoverageRequest): Promise<any>;
|
|
80
79
|
getInsurances(): Promise<any>;
|
|
81
|
-
|
|
80
|
+
updateDrivingLicense(payload: DrivingLicenseData): Promise<DrivingLicenseResponse>;
|
|
81
|
+
submitDrivingLicense(payload: DrivingLicenseData): Promise<DrivingLicenseResponse>;
|
|
82
82
|
updateUserImage(fileName: string): Promise<UserImage>;
|
|
83
83
|
deactivateUser(): Promise<any>;
|
|
84
84
|
private buildEhrPatientUrl;
|
|
@@ -96,4 +96,4 @@ declare class HttpError extends Error {
|
|
|
96
96
|
constructor(status: number, message: string);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
export { AuthError, type CaptureData, type CaptureRequest, type CaptureType, ConfigError, type CoveragePayload, type CoverageRequest, type DrivingLicenseData, type DrivingLicenseRequest, type EmptyRequest, type Environment, HCSettingsClient, type HCUserImage, type HCUserInfo, HttpError, type UpdateImageData, type UpdateImageRequest, type UploadImageData, type UploadImageRequest, type UserImage, type UserInfo, type UserInfoResponse };
|
|
99
|
+
export { type APIRequest, type APIResponse, AuthError, type CaptureData, type CaptureRequest, type CaptureType, ConfigError, type CoveragePayload, type CoverageRequest, type DrivingLicenseData, type DrivingLicenseRequest, type DrivingLicenseResponse, type EmptyRequest, type Environment, HCSettingsClient, type HCUserImage, type HCUserInfo, HttpError, type UpdateImageData, type UpdateImageRequest, type UploadImageData, type UploadImageRequest, type UserImage, type UserInfo, type UserInfoResponse };
|
package/dist/index.js
CHANGED
|
@@ -135,7 +135,7 @@ var HCSettingsClient = class {
|
|
|
135
135
|
this.auth.getAuthHeader()
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
|
-
async
|
|
138
|
+
async updateDrivingLicense(payload) {
|
|
139
139
|
const requestPayload = {
|
|
140
140
|
Data: payload
|
|
141
141
|
};
|
|
@@ -148,6 +148,9 @@ var HCSettingsClient = class {
|
|
|
148
148
|
}
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
|
+
async submitDrivingLicense(payload) {
|
|
152
|
+
return this.updateDrivingLicense(payload);
|
|
153
|
+
}
|
|
151
154
|
async updateUserImage(fileName) {
|
|
152
155
|
var _a;
|
|
153
156
|
const payload = {
|