@healthcloudai/hc-safe-cdx 0.1.4 → 0.2.1
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 +1368 -320
- package/dist/index.cjs +159 -244
- package/dist/index.d.cts +372 -205
- package/dist/index.d.ts +372 -205
- package/dist/index.js +159 -244
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,25 +2,151 @@ import { HCLoginClient } from '@healthcloudai/hc-login-connector';
|
|
|
2
2
|
import { HttpClient } from '@healthcloudai/hc-http';
|
|
3
3
|
|
|
4
4
|
type Environment = "dev" | "uat" | "prod";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Health Cloud request envelope.
|
|
7
|
+
*
|
|
8
|
+
* SDK consumers provide only method arguments or the inner payload.
|
|
9
|
+
* HCSafeCDXClient creates the Data wrapper internally.
|
|
10
|
+
*/
|
|
11
|
+
interface APIRequest<T> {
|
|
12
|
+
Data: T;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Standard Health Cloud API response envelope.
|
|
16
|
+
*
|
|
17
|
+
* Connector methods return this response without unwrapping or transforming it.
|
|
18
|
+
* Data may be null when the backend returns an unsuccessful response.
|
|
19
|
+
*/
|
|
20
|
+
interface APIResponse<T> {
|
|
12
21
|
Data: T | null;
|
|
22
|
+
IsOK: boolean;
|
|
13
23
|
ErrorMessage: string | null;
|
|
14
24
|
}
|
|
15
|
-
|
|
25
|
+
/**
|
|
26
|
+
* SafeCDX service response.
|
|
27
|
+
*
|
|
28
|
+
* Some SafeCDX endpoints return this response directly.
|
|
29
|
+
* Other endpoints return it inside APIResponse.Data.
|
|
30
|
+
*/
|
|
31
|
+
interface SafeAPIResponse<T> {
|
|
32
|
+
success: boolean;
|
|
33
|
+
data: T | null;
|
|
34
|
+
message: string | null;
|
|
35
|
+
code: number;
|
|
36
|
+
}
|
|
37
|
+
interface EntityReferenceData {
|
|
38
|
+
_id: string;
|
|
39
|
+
}
|
|
40
|
+
interface CaptureState {
|
|
41
|
+
retryCount: number;
|
|
42
|
+
retryLimit: number;
|
|
43
|
+
failoverEnabled: boolean;
|
|
44
|
+
lastCvmlStatus?: string | null;
|
|
45
|
+
failoverTriggered: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface QuestionnaireValidityItem {
|
|
48
|
+
display: string;
|
|
49
|
+
question: string;
|
|
50
|
+
}
|
|
51
|
+
interface QuestionnaireAnalyteResponse {
|
|
52
|
+
value: string;
|
|
53
|
+
displayOrder: number;
|
|
54
|
+
storedValue: string;
|
|
55
|
+
cvmlValue: string;
|
|
56
|
+
score: string;
|
|
57
|
+
}
|
|
58
|
+
interface QuestionnaireAnalyte {
|
|
59
|
+
_id: string;
|
|
60
|
+
displayOrder: number;
|
|
61
|
+
display: string;
|
|
62
|
+
name: string;
|
|
63
|
+
question: string;
|
|
64
|
+
image: string;
|
|
65
|
+
cvmlOrder: number;
|
|
66
|
+
responses: QuestionnaireAnalyteResponse[];
|
|
67
|
+
}
|
|
68
|
+
interface QuestionnaireSnapshot {
|
|
69
|
+
isValid: QuestionnaireValidityItem[];
|
|
70
|
+
analyte?: QuestionnaireAnalyte[];
|
|
71
|
+
}
|
|
72
|
+
interface CvmlParsedResult {
|
|
73
|
+
outcome: string;
|
|
74
|
+
responseCode: string;
|
|
75
|
+
responseMessage: string;
|
|
76
|
+
responseTitle: string;
|
|
77
|
+
}
|
|
78
|
+
interface ImageOfCaptureResult {
|
|
79
|
+
imageOfCapture: string | null;
|
|
80
|
+
uploadAt: string | null;
|
|
81
|
+
cvmlStatus: string | null;
|
|
82
|
+
parsed: CvmlParsedResult | null;
|
|
83
|
+
}
|
|
84
|
+
interface ReportedAnswerResult {
|
|
85
|
+
analyte: string;
|
|
86
|
+
reportedValue: string;
|
|
87
|
+
storedValue: string;
|
|
88
|
+
score: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Summary model returned within pending and history result collections.
|
|
92
|
+
|
|
93
|
+
*/
|
|
94
|
+
interface TestResultSummary {
|
|
95
|
+
_id: string;
|
|
96
|
+
status: string | null;
|
|
97
|
+
testName: string | null;
|
|
98
|
+
recordedDate: string | null;
|
|
99
|
+
viewed: boolean;
|
|
100
|
+
schemaVersion: number;
|
|
101
|
+
cvmlStatus?: string | null;
|
|
102
|
+
gtin?: string | null;
|
|
103
|
+
testInfoHeader?: string | null;
|
|
104
|
+
created?: string | null;
|
|
105
|
+
isCVMLBackground?: boolean;
|
|
106
|
+
isCVMLResult?: boolean;
|
|
107
|
+
isSelfReportingPostTest?: boolean;
|
|
108
|
+
isSelfReportingPreTest?: boolean;
|
|
109
|
+
capture?: CaptureState | null;
|
|
110
|
+
questionnaireSnapshot?: QuestionnaireSnapshot | null;
|
|
111
|
+
resumed?: boolean;
|
|
112
|
+
failoverEnabled?: boolean;
|
|
113
|
+
failoverTriggered?: boolean;
|
|
114
|
+
resumable?: boolean;
|
|
115
|
+
resumeNext?: string | null;
|
|
116
|
+
showValidity?: boolean;
|
|
117
|
+
showError?: boolean;
|
|
118
|
+
overallResult?: string | null;
|
|
119
|
+
positiveAnalytes?: unknown[];
|
|
120
|
+
}
|
|
121
|
+
interface TestResultDetails extends TestResultSummary {
|
|
122
|
+
cvmlUploadId: string | null;
|
|
123
|
+
userID: string | null;
|
|
124
|
+
tenantID: string | null;
|
|
125
|
+
isSelfAssessment: boolean;
|
|
126
|
+
imageOfCapture: string | null;
|
|
127
|
+
imageOfCaptureUploadAt: string | null;
|
|
128
|
+
imageOfCaptureResults: ImageOfCaptureResult[];
|
|
129
|
+
result: ReportedAnswerResult[];
|
|
130
|
+
cvmlTestName: string | null;
|
|
131
|
+
finalized: boolean;
|
|
132
|
+
language: string | null;
|
|
133
|
+
labVendor: string | null;
|
|
134
|
+
labTestType: string | null;
|
|
135
|
+
externalId: string | null;
|
|
136
|
+
modifier: string | null;
|
|
137
|
+
modified: string | null;
|
|
138
|
+
resultPDF?: string | null;
|
|
139
|
+
statusResultsText?: string | null;
|
|
140
|
+
}
|
|
141
|
+
interface TestProfileTerritory {
|
|
16
142
|
Code: string | null;
|
|
17
143
|
StateName: string | null;
|
|
18
144
|
IsEnabled: boolean;
|
|
19
145
|
}
|
|
20
|
-
interface
|
|
146
|
+
interface TestProfileScanImageDetail {
|
|
21
147
|
ImageUrl: string | null;
|
|
22
148
|
}
|
|
23
|
-
interface
|
|
149
|
+
interface TestProfileInstruction {
|
|
24
150
|
NavigationTitle: string | null;
|
|
25
151
|
Type: string | null;
|
|
26
152
|
Title: string | null;
|
|
@@ -36,19 +162,24 @@ interface ScanUpcInstruction {
|
|
|
36
162
|
VideoUrl: string | null;
|
|
37
163
|
SequenceOrder: number;
|
|
38
164
|
ResumeInstructionHere: boolean;
|
|
165
|
+
SupportButtonTitle: string | null;
|
|
166
|
+
SkipTestTimer: boolean;
|
|
167
|
+
SkipTestButtonTitle1: string | null;
|
|
168
|
+
SkipTestButtonTitle2: string | null;
|
|
169
|
+
SkipTestBody: string | null;
|
|
39
170
|
}
|
|
40
|
-
interface
|
|
171
|
+
interface TestProfileBillingInfo {
|
|
41
172
|
Taxable: boolean;
|
|
42
173
|
}
|
|
43
|
-
interface
|
|
174
|
+
interface TestProfileArticle {
|
|
44
175
|
ImageUrl: string | null;
|
|
45
176
|
Title: string | null;
|
|
46
177
|
DateCreated: string | null;
|
|
47
178
|
Owner: string | null;
|
|
48
179
|
Status: string | null;
|
|
49
|
-
Actions: unknown;
|
|
180
|
+
Actions: unknown | null;
|
|
50
181
|
}
|
|
51
|
-
interface
|
|
182
|
+
interface TestProfileResult {
|
|
52
183
|
PatientTestResult: number;
|
|
53
184
|
ResultTitle: string | null;
|
|
54
185
|
ResultDisplay: string | null;
|
|
@@ -58,47 +189,83 @@ interface ScanUpcTestResult {
|
|
|
58
189
|
IsOrderTestAllowed: boolean;
|
|
59
190
|
IsFindTestRetailerAllowed: boolean;
|
|
60
191
|
}
|
|
61
|
-
interface
|
|
192
|
+
interface TestProfileAnalyteResponse {
|
|
193
|
+
value: string;
|
|
194
|
+
displayOrder: number;
|
|
195
|
+
storedValue: string;
|
|
196
|
+
cvmlValue: string;
|
|
197
|
+
score: string;
|
|
198
|
+
}
|
|
199
|
+
interface TestProfileAnalyte {
|
|
62
200
|
_id: string | null;
|
|
63
201
|
DisplayOrder: number;
|
|
64
202
|
Display: string | null;
|
|
65
203
|
Name: string | null;
|
|
66
204
|
Question: string | null;
|
|
67
205
|
Image: string | null;
|
|
68
|
-
Responses:
|
|
69
|
-
}
|
|
70
|
-
interface
|
|
206
|
+
Responses: TestProfileAnalyteResponse[] | null;
|
|
207
|
+
}
|
|
208
|
+
interface DiagnosticProfileTestInfo {
|
|
209
|
+
gtin: string;
|
|
210
|
+
testInfoHeader: string | null;
|
|
211
|
+
productName: string | null;
|
|
212
|
+
testCategory: string | null;
|
|
213
|
+
fdaStatus: string | null;
|
|
214
|
+
cvmlTestName: string | null;
|
|
215
|
+
cvmlDuration: number;
|
|
216
|
+
isCVMLResult: boolean;
|
|
217
|
+
accountIds: string[];
|
|
218
|
+
cvmlRetryLimit: number;
|
|
219
|
+
failoverEnabled: boolean;
|
|
220
|
+
cvmlPollingPolicy: string | null;
|
|
221
|
+
}
|
|
222
|
+
interface DiagnosticProfileCta {
|
|
223
|
+
id: string;
|
|
224
|
+
title: string;
|
|
225
|
+
instructions: string;
|
|
226
|
+
linkType: string;
|
|
227
|
+
linkText: string;
|
|
228
|
+
linkValue: string;
|
|
229
|
+
}
|
|
230
|
+
interface DiagnosticProfileIndication {
|
|
231
|
+
id: string;
|
|
232
|
+
title: string;
|
|
233
|
+
text: string;
|
|
234
|
+
recommendTitle: string;
|
|
235
|
+
recommendText: string;
|
|
236
|
+
ctaId: string;
|
|
237
|
+
}
|
|
238
|
+
interface DiagnosticProfileDecisionResult {
|
|
239
|
+
indicationId: string;
|
|
240
|
+
value: string;
|
|
241
|
+
}
|
|
242
|
+
interface DiagnosticProfileDecision {
|
|
243
|
+
calculation: string;
|
|
244
|
+
results: DiagnosticProfileDecisionResult[];
|
|
245
|
+
}
|
|
246
|
+
interface DiagnosticProfileData {
|
|
71
247
|
_id: string | null;
|
|
72
|
-
ShortName: string | null;
|
|
73
|
-
CustomTestName: string | null;
|
|
74
|
-
OrderableName: string | null;
|
|
75
|
-
VendorTestID: string | null;
|
|
76
|
-
SkuId: string | null;
|
|
77
|
-
IsOrderable: boolean;
|
|
78
|
-
IsSelfAssessmentMode: boolean;
|
|
79
|
-
KitRegistrationRequired: boolean;
|
|
80
|
-
RequiresResultsVerification: boolean;
|
|
81
|
-
TestClassification: string | null;
|
|
82
|
-
IsMLDisabled: boolean;
|
|
83
|
-
IsPublicHealthReportingEnabled: boolean;
|
|
84
|
-
IsActive: boolean;
|
|
85
|
-
CaptureMethod: string | null;
|
|
86
248
|
Created: string | null;
|
|
87
249
|
Modified: string | null;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
250
|
+
TestInfo: DiagnosticProfileTestInfo;
|
|
251
|
+
Analyte: TestProfileAnalyte[] | null;
|
|
252
|
+
Cta: DiagnosticProfileCta[] | null;
|
|
253
|
+
Indication: DiagnosticProfileIndication[] | null;
|
|
254
|
+
Decision: DiagnosticProfileDecision[] | null;
|
|
255
|
+
}
|
|
256
|
+
interface ProductAssetDetail {
|
|
257
|
+
imageURL: string | null;
|
|
258
|
+
body: string | null;
|
|
259
|
+
}
|
|
260
|
+
interface DisclaimerDetail {
|
|
261
|
+
body: string | null;
|
|
262
|
+
title: string | null;
|
|
263
|
+
continueButtonTitle: string | null;
|
|
264
|
+
showDisclaimer: boolean;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Response data returned inside APIResponse.Data by getTestProfileByGTIN().
|
|
268
|
+
*/
|
|
102
269
|
interface GetTestProfileByGTINData {
|
|
103
270
|
ID: string | null;
|
|
104
271
|
FHIRID: string | null;
|
|
@@ -132,37 +299,57 @@ interface GetTestProfileByGTINData {
|
|
|
132
299
|
UnitFrequency: number;
|
|
133
300
|
ProcessingTime: number;
|
|
134
301
|
UnitProcessingTime: number;
|
|
135
|
-
DeviceDetails: unknown;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
302
|
+
DeviceDetails: unknown | null;
|
|
303
|
+
Survey: unknown | null;
|
|
304
|
+
Associations: unknown | null;
|
|
305
|
+
TestReportAsset: unknown | null;
|
|
306
|
+
LOINCCodes: unknown | null;
|
|
307
|
+
TestLOINCCodes: unknown[] | null;
|
|
308
|
+
TestSNOMEDCTCodes: unknown[] | null;
|
|
309
|
+
Territories: TestProfileTerritory[] | null;
|
|
310
|
+
DiagnosticProfile: DiagnosticProfileData | null;
|
|
311
|
+
ProductAssetDetail: ProductAssetDetail | null;
|
|
312
|
+
DisclaimerDetail: DisclaimerDetail | null;
|
|
313
|
+
ScanImageDetail: TestProfileScanImageDetail | null;
|
|
314
|
+
Instructions: TestProfileInstruction[] | null;
|
|
315
|
+
BillingInfo: TestProfileBillingInfo | null;
|
|
316
|
+
Articles: TestProfileArticle[] | null;
|
|
317
|
+
TestResults: TestProfileResult[] | null;
|
|
148
318
|
GS1GTINs: string[] | null;
|
|
149
319
|
Included: string[] | null;
|
|
150
|
-
Analytes:
|
|
151
|
-
LOINCCodes: unknown;
|
|
152
|
-
TestLOINCCodes: unknown[];
|
|
153
|
-
TestSNOMEDCTCodes: unknown[];
|
|
320
|
+
Analytes: TestProfileAnalyte[] | null;
|
|
154
321
|
Created: string | null;
|
|
155
322
|
Modified: string | null;
|
|
156
323
|
CreatedByID: string | null;
|
|
157
324
|
ModifiedByID: string | null;
|
|
158
325
|
TenantID: string | null;
|
|
159
326
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
327
|
+
/**
|
|
328
|
+
* Request data constructed internally by HCSafeCDXClient.
|
|
329
|
+
*
|
|
330
|
+
* TenantId is resolved by the backend from the authenticated patient context.
|
|
331
|
+
*/
|
|
163
332
|
interface GetTestProfilesByAccountRequest {
|
|
164
333
|
IncludeRegisterTestDetails: boolean;
|
|
165
334
|
}
|
|
335
|
+
interface RegisterTestDetail {
|
|
336
|
+
title: string | null;
|
|
337
|
+
description: string | null;
|
|
338
|
+
buttonTitle: string | null;
|
|
339
|
+
imageURL: string | null;
|
|
340
|
+
}
|
|
341
|
+
interface TestProfileByAccountItem {
|
|
342
|
+
gtin: string;
|
|
343
|
+
productName: string;
|
|
344
|
+
description: string | null;
|
|
345
|
+
testKitImageURL: string | null;
|
|
346
|
+
language: string | null;
|
|
347
|
+
registerTestDetail: RegisterTestDetail | null;
|
|
348
|
+
}
|
|
349
|
+
type GetTestProfilesByAccountData = SafeAPIResponse<TestProfileByAccountItem[]>;
|
|
350
|
+
/**
|
|
351
|
+
* Request data constructed internally by HCSafeCDXClient.
|
|
352
|
+
*/
|
|
166
353
|
interface CreateUploadUrlRequest {
|
|
167
354
|
Gtin: string;
|
|
168
355
|
UserTestResultId: string;
|
|
@@ -170,198 +357,178 @@ interface CreateUploadUrlRequest {
|
|
|
170
357
|
ImageType: string;
|
|
171
358
|
};
|
|
172
359
|
}
|
|
360
|
+
interface UploadMetadata {
|
|
361
|
+
UploadId: string | null;
|
|
362
|
+
Type: string | null;
|
|
363
|
+
File: string | null;
|
|
364
|
+
}
|
|
173
365
|
interface CreateUploadUrlData {
|
|
174
366
|
preSignedURL: string | null;
|
|
175
|
-
Metadata:
|
|
176
|
-
UploadId: string | null;
|
|
177
|
-
Type: string | null;
|
|
178
|
-
File: string | null;
|
|
179
|
-
} | null;
|
|
367
|
+
Metadata: UploadMetadata | null;
|
|
180
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* Request data constructed internally by HCSafeCDXClient.
|
|
371
|
+
*/
|
|
181
372
|
interface UpdateCvmlStatusRequest {
|
|
182
373
|
ImageOfCaptureId: string;
|
|
183
374
|
CvmlStatus: string;
|
|
184
375
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
376
|
+
type UpdateCvmlStatusResponse = SafeAPIResponse<EntityReferenceData>;
|
|
377
|
+
interface CvmlImageOfCaptureResult {
|
|
378
|
+
parsed: CvmlParsedResult | null;
|
|
379
|
+
}
|
|
380
|
+
interface CvmlResultsData {
|
|
381
|
+
_id: string;
|
|
382
|
+
userID: string | null;
|
|
383
|
+
status: string | null;
|
|
384
|
+
cvmlStatus: string | null;
|
|
385
|
+
gtin: string | null;
|
|
386
|
+
isCVMLResult: boolean;
|
|
387
|
+
isSelfReportingPostTest: boolean;
|
|
388
|
+
schemaVersion: number;
|
|
389
|
+
capture: CaptureState | null;
|
|
390
|
+
questionnaireSnapshot: QuestionnaireSnapshot | null;
|
|
391
|
+
resumed: boolean;
|
|
392
|
+
imageOfCaptureResult: CvmlImageOfCaptureResult | null;
|
|
393
|
+
failoverEnabled: boolean;
|
|
394
|
+
failoverTriggered: boolean;
|
|
395
|
+
resumable: boolean;
|
|
396
|
+
showValidity: boolean;
|
|
397
|
+
showError: boolean;
|
|
398
|
+
}
|
|
399
|
+
type GetCvmlResultsResponse = SafeAPIResponse<CvmlResultsData>;
|
|
400
|
+
/**
|
|
401
|
+
* Request data constructed internally for pending, last and history methods.
|
|
402
|
+
*/
|
|
403
|
+
interface ExcludeStatusRequest {
|
|
404
|
+
ExcludeStatus: string;
|
|
405
|
+
}
|
|
406
|
+
type GetPendingResultsRequest = ExcludeStatusRequest;
|
|
407
|
+
type GetLastResultsRequest = ExcludeStatusRequest;
|
|
408
|
+
type GetTestHistoryRequest = ExcludeStatusRequest;
|
|
409
|
+
/**
|
|
410
|
+
* Request data constructed internally for methods receiving only a result ID.
|
|
411
|
+
*/
|
|
412
|
+
interface UserTestResultIdRequest {
|
|
195
413
|
UserTestResultId: string;
|
|
196
414
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
interface
|
|
208
|
-
ExcludeStatus?: string;
|
|
209
|
-
}
|
|
210
|
-
interface ResumeFlowRequest {
|
|
211
|
-
UserTestResultId: string;
|
|
415
|
+
type GetResultDetailsRequest = UserTestResultIdRequest;
|
|
416
|
+
type GetResultPdfRequest = UserTestResultIdRequest;
|
|
417
|
+
type GetImageCaptureUrlRequest = UserTestResultIdRequest;
|
|
418
|
+
type FinalizeTestRequest = UserTestResultIdRequest;
|
|
419
|
+
type GetPendingResultsData = SafeAPIResponse<TestResultSummary[]>;
|
|
420
|
+
type GetLastResultsData = SafeAPIResponse<TestResultDetails>;
|
|
421
|
+
type GetTestHistoryData = SafeAPIResponse<TestResultSummary[]>;
|
|
422
|
+
type GetResultDetailsResponse = SafeAPIResponse<TestResultDetails>;
|
|
423
|
+
type GetResultPdfData = SafeAPIResponse<string>;
|
|
424
|
+
type GetImageCaptureUrlResponse = SafeAPIResponse<string>;
|
|
425
|
+
interface ResumeFlowRequest extends UserTestResultIdRequest {
|
|
212
426
|
Resumed: boolean;
|
|
213
427
|
}
|
|
428
|
+
interface ResumeFlowResult {
|
|
429
|
+
_id: string;
|
|
430
|
+
cvmlStatus: string | null;
|
|
431
|
+
reportType: string | null;
|
|
432
|
+
resumed: boolean;
|
|
433
|
+
failoverTriggered: boolean;
|
|
434
|
+
showValidity: boolean;
|
|
435
|
+
}
|
|
436
|
+
type ResumeFlowData = SafeAPIResponse<ResumeFlowResult>;
|
|
214
437
|
interface AnswerResult {
|
|
215
438
|
Analyte: string;
|
|
216
439
|
ReportedValue: string;
|
|
217
440
|
StoredValue: string;
|
|
218
441
|
Score: string;
|
|
219
442
|
}
|
|
220
|
-
|
|
221
|
-
|
|
443
|
+
/**
|
|
444
|
+
* Public request data accepted by submitAnswers().
|
|
445
|
+
|
|
446
|
+
*/
|
|
447
|
+
interface SubmitAnswersRequest extends UserTestResultIdRequest {
|
|
222
448
|
Result: AnswerResult[];
|
|
223
449
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
interface IndicationResult {
|
|
232
|
-
Id?: string;
|
|
233
|
-
Title?: string;
|
|
234
|
-
Text?: string;
|
|
235
|
-
RecommendTitle?: string;
|
|
236
|
-
RecommendText?: string;
|
|
237
|
-
CtaId?: string;
|
|
238
|
-
}
|
|
239
|
-
interface DecisionResultItem {
|
|
240
|
-
IndicationId: string;
|
|
241
|
-
Value: string;
|
|
242
|
-
}
|
|
243
|
-
interface DecisionResult {
|
|
244
|
-
Calculation?: string;
|
|
245
|
-
Results: DecisionResultItem[];
|
|
246
|
-
}
|
|
247
|
-
interface FinalizeTestRequest {
|
|
248
|
-
UserTestResultId: string;
|
|
249
|
-
CtaResult?: CtaResult;
|
|
250
|
-
IndicationResult?: IndicationResult;
|
|
251
|
-
DecisionResult?: DecisionResult;
|
|
252
|
-
}
|
|
450
|
+
type SubmitAnswersData = SafeAPIResponse<EntityReferenceData>;
|
|
451
|
+
/**
|
|
452
|
+
* The client sends only UserTestResultId
|
|
453
|
+
|
|
454
|
+
*/
|
|
455
|
+
type FinalizeTestData = unknown;
|
|
253
456
|
|
|
254
457
|
declare class HCSafeCDXClient {
|
|
255
458
|
private readonly http;
|
|
256
|
-
private readonly
|
|
257
|
-
private readonly
|
|
258
|
-
private readonly defaultLanguage;
|
|
259
|
-
private readonly defaultImageType;
|
|
459
|
+
private readonly loginClient;
|
|
460
|
+
private readonly baseUrl;
|
|
260
461
|
private apiKeyHeaderName?;
|
|
261
462
|
private apiKeyValue?;
|
|
262
|
-
constructor(httpClient: HttpClient,
|
|
463
|
+
constructor(httpClient: HttpClient, loginClient: HCLoginClient);
|
|
263
464
|
setApiKey(headerName: string, value: string): void;
|
|
264
|
-
private getAuthHeaders;
|
|
265
|
-
private getJsonHeaders;
|
|
266
|
-
private getApiKeyHeader;
|
|
267
|
-
private url;
|
|
268
465
|
/**
|
|
269
466
|
* GET gs1/:gtin
|
|
270
|
-
* Resolves
|
|
467
|
+
* Resolves the SafeCDX test profile associated with a GTIN barcode.
|
|
271
468
|
*/
|
|
272
|
-
getTestProfileByGTIN(gtin: string
|
|
273
|
-
/**
|
|
274
|
-
* POST test/profile
|
|
275
|
-
* Returns the full test profile for a given GTIN.
|
|
276
|
-
*/
|
|
277
|
-
getTestProfile(payload: GetTestProfileRequest): Promise<ApiResponse<GetTestProfileByGTINData>>;
|
|
469
|
+
getTestProfileByGTIN(gtin: string): Promise<APIResponse<GetTestProfileByGTINData>>;
|
|
278
470
|
/**
|
|
279
471
|
* POST test/profiles/by-account
|
|
280
|
-
* Lists
|
|
472
|
+
* Lists test profiles available to the authenticated patient account.
|
|
473
|
+
*
|
|
474
|
+
* TenantId is resolved by the backend from the authenticated patient context.
|
|
281
475
|
*/
|
|
282
|
-
getTestProfilesByAccount(
|
|
476
|
+
getTestProfilesByAccount(includeRegisterTestDetails?: boolean): Promise<APIResponse<GetTestProfilesByAccountData>>;
|
|
283
477
|
/**
|
|
284
478
|
* POST upload/url
|
|
285
|
-
* Requests a pre-signed
|
|
286
|
-
* Use the returned Data.preSignedURL and Data.Metadata.UploadId in the next steps.
|
|
479
|
+
* Requests a pre-signed URL used to upload a test image.
|
|
287
480
|
*/
|
|
288
|
-
createUploadUrl(userTestResultId: string, gtin: string, imageType?: string): Promise<
|
|
481
|
+
createUploadUrl(userTestResultId: string, gtin: string, imageType?: string): Promise<APIResponse<CreateUploadUrlData>>;
|
|
289
482
|
/**
|
|
290
|
-
* PUT preSignedURL
|
|
291
|
-
*
|
|
483
|
+
* PUT preSignedURL
|
|
484
|
+
* Uploads the image directly to the pre-signed storage URL.
|
|
292
485
|
*
|
|
293
|
-
* This
|
|
294
|
-
*
|
|
486
|
+
* This request does not call a SafeCDX API route and does not send
|
|
487
|
+
* authenticated Health Cloud headers.
|
|
295
488
|
*/
|
|
296
489
|
uploadImage(preSignedURL: string, image: BodyInit, contentType?: string): Promise<void>;
|
|
297
490
|
/**
|
|
298
491
|
* POST cvml/status
|
|
299
|
-
*
|
|
300
|
-
* NOTE: Returns raw service result — no ApiResponse wrapper on this endpoint.
|
|
492
|
+
* Returns the direct SafeCDX response without an outer APIResponse wrapper.
|
|
301
493
|
*/
|
|
302
|
-
updateCvmlStatus(imageOfCaptureId: string, cvmlStatus: string): Promise<
|
|
494
|
+
updateCvmlStatus(imageOfCaptureId: string, cvmlStatus: string): Promise<UpdateCvmlStatusResponse>;
|
|
303
495
|
/**
|
|
304
496
|
* GET cvml/results
|
|
305
|
-
*
|
|
306
|
-
* NOTE: Returns raw service result — no ApiResponse wrapper on this endpoint.
|
|
307
|
-
*/
|
|
308
|
-
getCvmlResults(imageOfCaptureId: string): Promise<unknown>;
|
|
309
|
-
/**
|
|
310
|
-
* POST test/result/pending
|
|
311
|
-
* Returns test results in a pending/incomplete state.
|
|
312
|
-
*/
|
|
313
|
-
getPendingResults(payload?: GetPendingResultsRequest): Promise<ApiResponse<unknown>>;
|
|
314
|
-
/**
|
|
315
|
-
* POST test/result/last
|
|
316
|
-
* Returns the most recent test result for the authenticated patient.
|
|
317
|
-
*/
|
|
318
|
-
getLastResults(payload?: GetLastResultsRequest): Promise<ApiResponse<unknown>>;
|
|
319
|
-
/**
|
|
320
|
-
* POST test/result/history
|
|
321
|
-
* Returns the full test history for the authenticated patient.
|
|
497
|
+
* Returns the direct SafeCDX response without an outer APIResponse wrapper.
|
|
322
498
|
*/
|
|
323
|
-
|
|
499
|
+
getCvmlResults(imageOfCaptureId: string): Promise<GetCvmlResultsResponse>;
|
|
500
|
+
/** POST test/result/pending */
|
|
501
|
+
getPendingResults(excludeStatus?: string): Promise<APIResponse<GetPendingResultsData>>;
|
|
502
|
+
/** POST test/result/last */
|
|
503
|
+
getLastResults(excludeStatus?: string): Promise<APIResponse<GetLastResultsData>>;
|
|
504
|
+
/** POST test/result/history */
|
|
505
|
+
getTestHistory(excludeStatus?: string): Promise<APIResponse<GetTestHistoryData>>;
|
|
324
506
|
/**
|
|
325
507
|
* POST test/result/details
|
|
326
|
-
* Returns
|
|
327
|
-
* NOTE: Returns raw service result — no ApiResponse wrapper on this endpoint.
|
|
328
|
-
*/
|
|
329
|
-
getResultDetails(userTestResultId: string): Promise<unknown>;
|
|
330
|
-
/**
|
|
331
|
-
* POST test/result/pdf
|
|
332
|
-
* Generates a PDF report for a specific test result.
|
|
508
|
+
* Returns the direct SafeCDX response without an outer APIResponse wrapper.
|
|
333
509
|
*/
|
|
334
|
-
|
|
510
|
+
getResultDetails(userTestResultId: string): Promise<GetResultDetailsResponse>;
|
|
511
|
+
/** POST test/result/pdf */
|
|
512
|
+
getResultPdf(userTestResultId: string): Promise<APIResponse<GetResultPdfData>>;
|
|
335
513
|
/**
|
|
336
514
|
* POST test/result/image/capture
|
|
337
|
-
* Returns the
|
|
338
|
-
* NOTE: Returns raw service result — no ApiResponse wrapper on this endpoint.
|
|
339
|
-
*/
|
|
340
|
-
getImageCaptureUrl(userTestResultId: string): Promise<unknown>;
|
|
341
|
-
/**
|
|
342
|
-
* POST test/result/analytics
|
|
343
|
-
* Returns analytics data for test results.
|
|
344
|
-
*/
|
|
345
|
-
getAnalytics(payload?: GetAnalyticsRequest): Promise<ApiResponse<unknown>>;
|
|
346
|
-
/**
|
|
347
|
-
* POST test/resume
|
|
348
|
-
* Marks a test attempt as resumed (or not).
|
|
515
|
+
* Returns the direct SafeCDX response without an outer APIResponse wrapper.
|
|
349
516
|
*/
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
517
|
+
getImageCaptureUrl(userTestResultId: string): Promise<GetImageCaptureUrlResponse>;
|
|
518
|
+
/** POST test/resume */
|
|
519
|
+
resumeFlow(userTestResultId: string, resumed?: boolean): Promise<APIResponse<ResumeFlowData>>;
|
|
520
|
+
/** POST test/answers */
|
|
521
|
+
submitAnswers(submission: SubmitAnswersRequest): Promise<APIResponse<SubmitAnswersData>>;
|
|
522
|
+
/** POST test/finalize */
|
|
523
|
+
finalizeTest(userTestResultId: string): Promise<APIResponse<FinalizeTestData>>;
|
|
524
|
+
private getAuthHeaders;
|
|
525
|
+
private getJsonHeaders;
|
|
526
|
+
private getApiKeyHeader;
|
|
527
|
+
private url;
|
|
361
528
|
}
|
|
362
529
|
|
|
363
530
|
declare class ConfigError extends Error {
|
|
364
531
|
constructor(message: string);
|
|
365
532
|
}
|
|
366
533
|
|
|
367
|
-
export { type AnswerResult, type
|
|
534
|
+
export { type APIRequest, type APIResponse, type AnswerResult, type CaptureState, ConfigError, type CreateUploadUrlData, type CreateUploadUrlRequest, type CvmlImageOfCaptureResult, type CvmlParsedResult, type CvmlResultsData, type DiagnosticProfileCta, type DiagnosticProfileData, type DiagnosticProfileDecision, type DiagnosticProfileDecisionResult, type DiagnosticProfileIndication, type DiagnosticProfileTestInfo, type DisclaimerDetail, type EntityReferenceData, type Environment, type ExcludeStatusRequest, type FinalizeTestData, type FinalizeTestRequest, type GetCvmlResultsResponse, type GetImageCaptureUrlRequest, type GetImageCaptureUrlResponse, type GetLastResultsData, type GetLastResultsRequest, type GetPendingResultsData, type GetPendingResultsRequest, type GetResultDetailsRequest, type GetResultDetailsResponse, type GetResultPdfData, type GetResultPdfRequest, type GetTestHistoryData, type GetTestHistoryRequest, type GetTestProfileByGTINData, type GetTestProfilesByAccountData, type GetTestProfilesByAccountRequest, HCSafeCDXClient, type ImageOfCaptureResult, type ProductAssetDetail, type QuestionnaireAnalyte, type QuestionnaireAnalyteResponse, type QuestionnaireSnapshot, type QuestionnaireValidityItem, type RegisterTestDetail, type ReportedAnswerResult, type ResumeFlowData, type ResumeFlowRequest, type ResumeFlowResult, type SafeAPIResponse, type SubmitAnswersData, type SubmitAnswersRequest, type TestProfileAnalyte, type TestProfileAnalyteResponse, type TestProfileArticle, type TestProfileBillingInfo, type TestProfileByAccountItem, type TestProfileInstruction, type TestProfileResult, type TestProfileScanImageDetail, type TestProfileTerritory, type TestResultDetails, type TestResultSummary, type UpdateCvmlStatusRequest, type UpdateCvmlStatusResponse, type UploadMetadata, type UserTestResultIdRequest };
|