@healthcloudai/hc-safe-cdx 0.2.0 → 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 +695 -409
- package/dist/index.cjs +127 -202
- package/dist/index.d.cts +385 -165
- package/dist/index.d.ts +385 -165
- package/dist/index.js +127 -202
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,114 +3,332 @@ import { HttpClient } from '@healthcloudai/hc-http';
|
|
|
3
3
|
|
|
4
4
|
type Environment = "dev" | "uat" | "prod";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Successful standard Health Cloud API response envelope.
|
|
6
|
+
* Health Cloud request envelope.
|
|
7
|
+
*
|
|
8
|
+
* SDK consumers provide only method arguments or the inner payload.
|
|
9
|
+
* HCSafeCDXClient creates the Data wrapper internally.
|
|
13
10
|
*/
|
|
14
|
-
interface
|
|
15
|
-
|
|
16
|
-
Data: TData;
|
|
17
|
-
ErrorMessage: null;
|
|
11
|
+
interface APIRequest<T> {
|
|
12
|
+
Data: T;
|
|
18
13
|
}
|
|
19
14
|
/**
|
|
20
|
-
*
|
|
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.
|
|
21
19
|
*/
|
|
22
|
-
interface
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
interface APIResponse<T> {
|
|
21
|
+
Data: T | null;
|
|
22
|
+
IsOK: boolean;
|
|
25
23
|
ErrorMessage: string | null;
|
|
26
24
|
}
|
|
27
25
|
/**
|
|
28
|
-
*
|
|
29
|
-
* response envelope.
|
|
30
|
-
*/
|
|
31
|
-
type ApiResponse<TData> = SuccessfulApiResponse<TData> | FailedApiResponse<TData>;
|
|
32
|
-
/**
|
|
33
|
-
* Successful inner/raw SafeCDX service result.
|
|
26
|
+
* SafeCDX service response.
|
|
34
27
|
*
|
|
35
|
-
* Some endpoints return this directly.
|
|
36
|
-
* Other endpoints return it inside
|
|
28
|
+
* Some SafeCDX endpoints return this response directly.
|
|
29
|
+
* Other endpoints return it inside APIResponse.Data.
|
|
37
30
|
*/
|
|
38
|
-
interface
|
|
39
|
-
success:
|
|
40
|
-
data:
|
|
31
|
+
interface SafeAPIResponse<T> {
|
|
32
|
+
success: boolean;
|
|
33
|
+
data: T | null;
|
|
41
34
|
message: string | null;
|
|
42
35
|
code: number;
|
|
43
36
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Failed inner/raw SafeCDX service result.
|
|
46
|
-
*/
|
|
47
|
-
interface FailedServiceResult<TData = unknown> {
|
|
48
|
-
success: false;
|
|
49
|
-
data: TData | null;
|
|
50
|
-
message: string | null;
|
|
51
|
-
code: number;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Service-level result used either directly or inside ApiResponse.Data.
|
|
55
|
-
*/
|
|
56
|
-
type ServiceResult<TData> = SuccessfulServiceResult<TData> | FailedServiceResult<TData>;
|
|
57
|
-
/**
|
|
58
|
-
* Minimal entity reference returned by update/submit operations.
|
|
59
|
-
*/
|
|
60
37
|
interface EntityReferenceData {
|
|
61
38
|
_id: string;
|
|
62
|
-
|
|
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;
|
|
63
89
|
}
|
|
64
90
|
/**
|
|
65
|
-
*
|
|
91
|
+
* Summary model returned within pending and history result collections.
|
|
92
|
+
|
|
66
93
|
*/
|
|
67
94
|
interface TestResultSummary {
|
|
68
95
|
_id: string;
|
|
69
96
|
status: string | null;
|
|
70
|
-
testName
|
|
71
|
-
recordedDate
|
|
72
|
-
|
|
97
|
+
testName: string | null;
|
|
98
|
+
recordedDate: string | null;
|
|
99
|
+
viewed: boolean;
|
|
100
|
+
schemaVersion: number;
|
|
73
101
|
cvmlStatus?: string | null;
|
|
74
102
|
gtin?: string | null;
|
|
75
|
-
|
|
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[];
|
|
76
120
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Detailed result object returned by last-result and result-details routes.
|
|
79
|
-
*/
|
|
80
121
|
interface TestResultDetails extends TestResultSummary {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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 {
|
|
142
|
+
Code: string | null;
|
|
143
|
+
StateName: string | null;
|
|
144
|
+
IsEnabled: boolean;
|
|
145
|
+
}
|
|
146
|
+
interface TestProfileScanImageDetail {
|
|
147
|
+
ImageUrl: string | null;
|
|
148
|
+
}
|
|
149
|
+
interface TestProfileInstruction {
|
|
150
|
+
NavigationTitle: string | null;
|
|
151
|
+
Type: string | null;
|
|
152
|
+
Title: string | null;
|
|
153
|
+
Body: string | null;
|
|
154
|
+
ButtonTitle: string | null;
|
|
155
|
+
TimeInSeconds: number;
|
|
156
|
+
AutoStartTimer: boolean;
|
|
157
|
+
AutoContinue: boolean;
|
|
158
|
+
CanContinue: boolean;
|
|
159
|
+
IsFullscreenVideo: boolean;
|
|
160
|
+
ShowBackButton: boolean;
|
|
161
|
+
ImageUrl: string | null;
|
|
162
|
+
VideoUrl: string | null;
|
|
163
|
+
SequenceOrder: number;
|
|
164
|
+
ResumeInstructionHere: boolean;
|
|
165
|
+
SupportButtonTitle: string | null;
|
|
166
|
+
SkipTestTimer: boolean;
|
|
167
|
+
SkipTestButtonTitle1: string | null;
|
|
168
|
+
SkipTestButtonTitle2: string | null;
|
|
169
|
+
SkipTestBody: string | null;
|
|
170
|
+
}
|
|
171
|
+
interface TestProfileBillingInfo {
|
|
172
|
+
Taxable: boolean;
|
|
173
|
+
}
|
|
174
|
+
interface TestProfileArticle {
|
|
175
|
+
ImageUrl: string | null;
|
|
176
|
+
Title: string | null;
|
|
177
|
+
DateCreated: string | null;
|
|
178
|
+
Owner: string | null;
|
|
179
|
+
Status: string | null;
|
|
180
|
+
Actions: unknown | null;
|
|
181
|
+
}
|
|
182
|
+
interface TestProfileResult {
|
|
183
|
+
PatientTestResult: number;
|
|
184
|
+
ResultTitle: string | null;
|
|
185
|
+
ResultDisplay: string | null;
|
|
186
|
+
ResultLongDescription: string | null;
|
|
187
|
+
TreatmentPlanDescription: string | null;
|
|
188
|
+
IsReturnToDashboardAllowed: boolean;
|
|
189
|
+
IsOrderTestAllowed: boolean;
|
|
190
|
+
IsFindTestRetailerAllowed: boolean;
|
|
191
|
+
}
|
|
192
|
+
interface TestProfileAnalyteResponse {
|
|
193
|
+
value: string;
|
|
194
|
+
displayOrder: number;
|
|
195
|
+
storedValue: string;
|
|
196
|
+
cvmlValue: string;
|
|
197
|
+
score: string;
|
|
198
|
+
}
|
|
199
|
+
interface TestProfileAnalyte {
|
|
200
|
+
_id: string | null;
|
|
201
|
+
DisplayOrder: number;
|
|
202
|
+
Display: string | null;
|
|
203
|
+
Name: string | null;
|
|
204
|
+
Question: string | null;
|
|
205
|
+
Image: string | null;
|
|
206
|
+
Responses: TestProfileAnalyteResponse[] | null;
|
|
86
207
|
}
|
|
87
|
-
/**
|
|
88
|
-
* The nested test information used by the standard scan flow.
|
|
89
|
-
*/
|
|
90
208
|
interface DiagnosticProfileTestInfo {
|
|
91
209
|
gtin: string;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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[];
|
|
95
245
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Only the nested diagnostic profile data required by SDK consumers is typed.
|
|
98
|
-
*/
|
|
99
246
|
interface DiagnosticProfileData {
|
|
247
|
+
_id: string | null;
|
|
248
|
+
Created: string | null;
|
|
249
|
+
Modified: string | null;
|
|
100
250
|
TestInfo: DiagnosticProfileTestInfo;
|
|
101
|
-
|
|
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;
|
|
102
265
|
}
|
|
103
266
|
/**
|
|
104
|
-
* Response data
|
|
105
|
-
*
|
|
267
|
+
* Response data returned inside APIResponse.Data by getTestProfileByGTIN().
|
|
106
268
|
*/
|
|
107
269
|
interface GetTestProfileByGTINData {
|
|
108
|
-
ID: string;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
270
|
+
ID: string | null;
|
|
271
|
+
FHIRID: string | null;
|
|
272
|
+
CQLID: string | null;
|
|
273
|
+
TestName: string | null;
|
|
274
|
+
CustomTestName: string | null;
|
|
275
|
+
IsDeactivated: boolean;
|
|
276
|
+
IsOrderable: boolean;
|
|
277
|
+
EnablePublicHealthReporting: boolean;
|
|
278
|
+
IsSelfAssessmentMode: boolean;
|
|
279
|
+
CaptureMethod: number;
|
|
280
|
+
IsMLDisabled: boolean;
|
|
281
|
+
ShortName: string | null;
|
|
282
|
+
DescriptionHTML: string | null;
|
|
283
|
+
OrderableName: string | null;
|
|
284
|
+
VendorName: string | null;
|
|
285
|
+
ManufactureName: string | null;
|
|
286
|
+
VendorTestID: string | null;
|
|
287
|
+
Sku: string | null;
|
|
288
|
+
LabTestType: string | null;
|
|
289
|
+
TestClassification: string | null;
|
|
290
|
+
DeviceFulfilmentPartner: string | null;
|
|
291
|
+
FulfilmentPartnerCompediumId: string | null;
|
|
292
|
+
KitRegistrationRequired: boolean;
|
|
293
|
+
RequiresProviderVerificationOfResults: boolean;
|
|
294
|
+
ShippingPartner: string | null;
|
|
295
|
+
SpecimenTypeCode: string | null;
|
|
296
|
+
SpecimenCollectionType: number;
|
|
297
|
+
SpecimenSite: string | null;
|
|
298
|
+
Frequency: number;
|
|
299
|
+
UnitFrequency: number;
|
|
300
|
+
ProcessingTime: number;
|
|
301
|
+
UnitProcessingTime: number;
|
|
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;
|
|
318
|
+
GS1GTINs: string[] | null;
|
|
319
|
+
Included: string[] | null;
|
|
320
|
+
Analytes: TestProfileAnalyte[] | null;
|
|
321
|
+
Created: string | null;
|
|
322
|
+
Modified: string | null;
|
|
323
|
+
CreatedByID: string | null;
|
|
324
|
+
ModifiedByID: string | null;
|
|
325
|
+
TenantID: string | null;
|
|
113
326
|
}
|
|
327
|
+
/**
|
|
328
|
+
* Request data constructed internally by HCSafeCDXClient.
|
|
329
|
+
*
|
|
330
|
+
* TenantId is resolved by the backend from the authenticated patient context.
|
|
331
|
+
*/
|
|
114
332
|
interface GetTestProfilesByAccountRequest {
|
|
115
333
|
IncludeRegisterTestDetails: boolean;
|
|
116
334
|
}
|
|
@@ -119,7 +337,6 @@ interface RegisterTestDetail {
|
|
|
119
337
|
description: string | null;
|
|
120
338
|
buttonTitle: string | null;
|
|
121
339
|
imageURL: string | null;
|
|
122
|
-
[key: string]: unknown;
|
|
123
340
|
}
|
|
124
341
|
interface TestProfileByAccountItem {
|
|
125
342
|
gtin: string;
|
|
@@ -128,9 +345,11 @@ interface TestProfileByAccountItem {
|
|
|
128
345
|
testKitImageURL: string | null;
|
|
129
346
|
language: string | null;
|
|
130
347
|
registerTestDetail: RegisterTestDetail | null;
|
|
131
|
-
[key: string]: unknown;
|
|
132
348
|
}
|
|
133
|
-
type GetTestProfilesByAccountData =
|
|
349
|
+
type GetTestProfilesByAccountData = SafeAPIResponse<TestProfileByAccountItem[]>;
|
|
350
|
+
/**
|
|
351
|
+
* Request data constructed internally by HCSafeCDXClient.
|
|
352
|
+
*/
|
|
134
353
|
interface CreateUploadUrlRequest {
|
|
135
354
|
Gtin: string;
|
|
136
355
|
UserTestResultId: string;
|
|
@@ -139,176 +358,177 @@ interface CreateUploadUrlRequest {
|
|
|
139
358
|
};
|
|
140
359
|
}
|
|
141
360
|
interface UploadMetadata {
|
|
142
|
-
UploadId: string;
|
|
361
|
+
UploadId: string | null;
|
|
143
362
|
Type: string | null;
|
|
144
|
-
File: string;
|
|
363
|
+
File: string | null;
|
|
145
364
|
}
|
|
146
365
|
interface CreateUploadUrlData {
|
|
147
|
-
preSignedURL: string;
|
|
148
|
-
Metadata: UploadMetadata;
|
|
366
|
+
preSignedURL: string | null;
|
|
367
|
+
Metadata: UploadMetadata | null;
|
|
149
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* Request data constructed internally by HCSafeCDXClient.
|
|
371
|
+
*/
|
|
150
372
|
interface UpdateCvmlStatusRequest {
|
|
151
373
|
ImageOfCaptureId: string;
|
|
152
374
|
CvmlStatus: string;
|
|
153
375
|
}
|
|
154
|
-
type UpdateCvmlStatusResponse =
|
|
376
|
+
type UpdateCvmlStatusResponse = SafeAPIResponse<EntityReferenceData>;
|
|
377
|
+
interface CvmlImageOfCaptureResult {
|
|
378
|
+
parsed: CvmlParsedResult | null;
|
|
379
|
+
}
|
|
155
380
|
interface CvmlResultsData {
|
|
156
381
|
_id: string;
|
|
382
|
+
userID: string | null;
|
|
157
383
|
status: string | null;
|
|
158
384
|
cvmlStatus: string | null;
|
|
159
385
|
gtin: string | null;
|
|
160
|
-
|
|
161
|
-
|
|
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;
|
|
162
398
|
}
|
|
163
|
-
type GetCvmlResultsResponse =
|
|
399
|
+
type GetCvmlResultsResponse = SafeAPIResponse<CvmlResultsData>;
|
|
400
|
+
/**
|
|
401
|
+
* Request data constructed internally for pending, last and history methods.
|
|
402
|
+
*/
|
|
164
403
|
interface ExcludeStatusRequest {
|
|
165
404
|
ExcludeStatus: string;
|
|
166
405
|
}
|
|
167
406
|
type GetPendingResultsRequest = ExcludeStatusRequest;
|
|
168
407
|
type GetLastResultsRequest = ExcludeStatusRequest;
|
|
169
408
|
type GetTestHistoryRequest = ExcludeStatusRequest;
|
|
409
|
+
/**
|
|
410
|
+
* Request data constructed internally for methods receiving only a result ID.
|
|
411
|
+
*/
|
|
170
412
|
interface UserTestResultIdRequest {
|
|
171
413
|
UserTestResultId: string;
|
|
172
414
|
}
|
|
173
415
|
type GetResultDetailsRequest = UserTestResultIdRequest;
|
|
174
416
|
type GetResultPdfRequest = UserTestResultIdRequest;
|
|
175
417
|
type GetImageCaptureUrlRequest = UserTestResultIdRequest;
|
|
176
|
-
type
|
|
177
|
-
type
|
|
178
|
-
type
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
type
|
|
183
|
-
/**
|
|
184
|
-
* Standard API envelope Data returned by getResultPdf().
|
|
185
|
-
*/
|
|
186
|
-
type GetResultPdfData = ServiceResult<string>;
|
|
187
|
-
/**
|
|
188
|
-
* Raw service result returned directly by getImageCaptureUrl().
|
|
189
|
-
*/
|
|
190
|
-
type GetImageCaptureUrlResponse = ServiceResult<string>;
|
|
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>;
|
|
191
425
|
interface ResumeFlowRequest extends UserTestResultIdRequest {
|
|
192
426
|
Resumed: boolean;
|
|
193
427
|
}
|
|
194
428
|
interface ResumeFlowResult {
|
|
195
429
|
_id: string;
|
|
430
|
+
cvmlStatus: string | null;
|
|
431
|
+
reportType: string | null;
|
|
196
432
|
resumed: boolean;
|
|
197
|
-
|
|
198
|
-
|
|
433
|
+
failoverTriggered: boolean;
|
|
434
|
+
showValidity: boolean;
|
|
199
435
|
}
|
|
200
|
-
type ResumeFlowData =
|
|
436
|
+
type ResumeFlowData = SafeAPIResponse<ResumeFlowResult>;
|
|
201
437
|
interface AnswerResult {
|
|
202
438
|
Analyte: string;
|
|
203
439
|
ReportedValue: string;
|
|
204
440
|
StoredValue: string;
|
|
205
441
|
Score: string;
|
|
206
442
|
}
|
|
443
|
+
/**
|
|
444
|
+
* Public request data accepted by submitAnswers().
|
|
445
|
+
|
|
446
|
+
*/
|
|
207
447
|
interface SubmitAnswersRequest extends UserTestResultIdRequest {
|
|
208
448
|
Result: AnswerResult[];
|
|
209
449
|
}
|
|
210
|
-
type SubmitAnswersData =
|
|
211
|
-
|
|
450
|
+
type SubmitAnswersData = SafeAPIResponse<EntityReferenceData>;
|
|
451
|
+
/**
|
|
452
|
+
* The client sends only UserTestResultId
|
|
453
|
+
|
|
454
|
+
*/
|
|
455
|
+
type FinalizeTestData = unknown;
|
|
212
456
|
|
|
213
457
|
declare class HCSafeCDXClient {
|
|
214
458
|
private readonly http;
|
|
215
|
-
private readonly
|
|
459
|
+
private readonly loginClient;
|
|
216
460
|
private readonly baseUrl;
|
|
217
461
|
private apiKeyHeaderName?;
|
|
218
462
|
private apiKeyValue?;
|
|
219
|
-
constructor(httpClient: HttpClient,
|
|
463
|
+
constructor(httpClient: HttpClient, loginClient: HCLoginClient);
|
|
220
464
|
setApiKey(headerName: string, value: string): void;
|
|
221
|
-
private getAuthHeaders;
|
|
222
|
-
private getJsonHeaders;
|
|
223
|
-
private getApiKeyHeader;
|
|
224
|
-
private url;
|
|
225
465
|
/**
|
|
226
466
|
* GET gs1/:gtin
|
|
227
|
-
* Resolves
|
|
467
|
+
* Resolves the SafeCDX test profile associated with a GTIN barcode.
|
|
228
468
|
*/
|
|
229
|
-
getTestProfileByGTIN(gtin: string): Promise<
|
|
469
|
+
getTestProfileByGTIN(gtin: string): Promise<APIResponse<GetTestProfileByGTINData>>;
|
|
230
470
|
/**
|
|
231
471
|
* POST test/profiles/by-account
|
|
232
|
-
|
|
472
|
+
|
|
473
|
+
*
|
|
474
|
+
* TenantId is resolved by the backend from the authenticated patient context.
|
|
233
475
|
*/
|
|
234
|
-
getTestProfilesByAccount(
|
|
476
|
+
getTestProfilesByAccount(includeRegisterTestDetails?: boolean): Promise<APIResponse<GetTestProfilesByAccountData>>;
|
|
235
477
|
/**
|
|
236
478
|
* POST upload/url
|
|
237
|
-
* Requests a pre-signed
|
|
238
|
-
* 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.
|
|
239
480
|
*/
|
|
240
|
-
createUploadUrl(userTestResultId: string, gtin: string, imageType?: string): Promise<
|
|
481
|
+
createUploadUrl(userTestResultId: string, gtin: string, imageType?: string): Promise<APIResponse<CreateUploadUrlData>>;
|
|
241
482
|
/**
|
|
242
|
-
* PUT preSignedURL
|
|
243
|
-
*
|
|
483
|
+
* PUT preSignedURL
|
|
484
|
+
* Uploads the image directly to the pre-signed storage URL.
|
|
244
485
|
*
|
|
245
|
-
* This
|
|
246
|
-
*
|
|
486
|
+
* This request does not call a SafeCDX API route and does not send
|
|
487
|
+
* authenticated Health Cloud headers.
|
|
247
488
|
*/
|
|
248
489
|
uploadImage(preSignedURL: string, image: BodyInit, contentType?: string): Promise<void>;
|
|
249
490
|
/**
|
|
250
491
|
* POST cvml/status
|
|
251
|
-
*
|
|
252
|
-
* NOTE: Returns raw service result — no ApiResponse wrapper on this endpoint.
|
|
492
|
+
* Returns the direct SafeCDX response without an outer APIResponse wrapper.
|
|
253
493
|
*/
|
|
254
494
|
updateCvmlStatus(imageOfCaptureId: string, cvmlStatus: string): Promise<UpdateCvmlStatusResponse>;
|
|
255
495
|
/**
|
|
256
496
|
* GET cvml/results
|
|
257
|
-
*
|
|
258
|
-
* NOTE: Returns raw service result — no ApiResponse wrapper on this endpoint.
|
|
497
|
+
* Returns the direct SafeCDX response without an outer APIResponse wrapper.
|
|
259
498
|
*/
|
|
260
499
|
getCvmlResults(imageOfCaptureId: string): Promise<GetCvmlResultsResponse>;
|
|
261
|
-
/**
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
* POST test/result/last
|
|
268
|
-
* Returns the most recent test result for the authenticated patient.
|
|
269
|
-
*/
|
|
270
|
-
getLastResults(payload?: GetLastResultsRequest): Promise<ApiResponse<GetLastResultsData>>;
|
|
271
|
-
/**
|
|
272
|
-
* POST test/result/history
|
|
273
|
-
* Returns the full test history for the authenticated patient.
|
|
274
|
-
*/
|
|
275
|
-
getTestHistory(payload?: GetTestHistoryRequest): Promise<ApiResponse<GetTestHistoryData>>;
|
|
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>>;
|
|
276
506
|
/**
|
|
277
507
|
* POST test/result/details
|
|
278
|
-
* Returns
|
|
279
|
-
* NOTE: Returns raw service result — no ApiResponse wrapper on this endpoint.
|
|
508
|
+
* Returns the direct SafeCDX response without an outer APIResponse wrapper.
|
|
280
509
|
*/
|
|
281
510
|
getResultDetails(userTestResultId: string): Promise<GetResultDetailsResponse>;
|
|
282
|
-
/**
|
|
283
|
-
|
|
284
|
-
* Requests the PDF result for a specific test result.
|
|
285
|
-
*/
|
|
286
|
-
getResultPdf(payload: GetResultPdfRequest): Promise<ApiResponse<GetResultPdfData>>;
|
|
511
|
+
/** POST test/result/pdf */
|
|
512
|
+
getResultPdf(userTestResultId: string): Promise<APIResponse<GetResultPdfData>>;
|
|
287
513
|
/**
|
|
288
514
|
* POST test/result/image/capture
|
|
289
|
-
*
|
|
290
|
-
* NOTE: Returns raw service result — no ApiResponse wrapper on this endpoint.
|
|
515
|
+
* Returns the direct SafeCDX response without an outer APIResponse wrapper.
|
|
291
516
|
*/
|
|
292
517
|
getImageCaptureUrl(userTestResultId: string): Promise<GetImageCaptureUrlResponse>;
|
|
293
|
-
/**
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* POST test/finalize
|
|
305
|
-
* Finalizes a test by UserTestResultId.
|
|
306
|
-
*/
|
|
307
|
-
finalizeTest(payload: FinalizeTestRequest): Promise<ApiResponse<unknown>>;
|
|
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;
|
|
308
528
|
}
|
|
309
529
|
|
|
310
530
|
declare class ConfigError extends Error {
|
|
311
531
|
constructor(message: string);
|
|
312
532
|
}
|
|
313
533
|
|
|
314
|
-
export { 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 };
|