@tryvital/vital-node 3.1.384 → 3.1.386
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/Client.d.ts +6 -6
- package/Client.js +36 -36
- package/api/resources/activity/client/Client.js +2 -2
- package/api/resources/aggregate/client/Client.js +3 -3
- package/api/resources/body/client/Client.js +2 -2
- package/api/resources/devices/client/Client.js +1 -1
- package/api/resources/electrocardiogram/client/Client.js +1 -1
- package/api/resources/index.d.ts +3 -3
- package/api/resources/index.js +4 -4
- package/api/resources/insurance/client/Client.js +3 -3
- package/api/resources/introspect/client/Client.js +2 -2
- package/api/resources/labTests/client/Client.d.ts +102 -102
- package/api/resources/labTests/client/Client.js +736 -736
- package/api/resources/labTests/client/requests/index.d.ts +7 -7
- package/api/resources/labTests/types/index.d.ts +2 -2
- package/api/resources/labTests/types/index.js +2 -2
- package/api/resources/link/client/Client.js +19 -19
- package/api/resources/meal/client/Client.js +1 -1
- package/api/resources/menstrualCycle/client/Client.js +1 -1
- package/api/resources/order/client/Client.js +1 -1
- package/api/resources/payor/client/Client.js +1 -1
- package/api/resources/profile/client/Client.js +2 -2
- package/api/resources/providers/client/Client.js +1 -1
- package/api/resources/sleep/client/Client.js +3 -3
- package/api/resources/sleepCycle/client/Client.js +1 -1
- package/api/resources/team/client/Client.js +7 -7
- package/api/resources/testkit/client/Client.js +2 -2
- package/api/resources/user/client/Client.js +18 -18
- package/api/resources/vitals/client/Client.js +78 -78
- package/api/resources/workouts/client/Client.js +3 -3
- package/dist/Client.d.ts +6 -6
- package/dist/Client.js +36 -36
- package/dist/api/resources/activity/client/Client.js +2 -2
- package/dist/api/resources/aggregate/client/Client.js +3 -3
- package/dist/api/resources/body/client/Client.js +2 -2
- package/dist/api/resources/devices/client/Client.js +1 -1
- package/dist/api/resources/electrocardiogram/client/Client.js +1 -1
- package/dist/api/resources/index.d.ts +3 -3
- package/dist/api/resources/index.js +4 -4
- package/dist/api/resources/insurance/client/Client.js +3 -3
- package/dist/api/resources/introspect/client/Client.js +2 -2
- package/dist/api/resources/labTests/client/Client.d.ts +102 -102
- package/dist/api/resources/labTests/client/Client.js +736 -736
- package/dist/api/resources/labTests/client/requests/index.d.ts +7 -7
- package/dist/api/resources/labTests/types/index.d.ts +2 -2
- package/dist/api/resources/labTests/types/index.js +2 -2
- package/dist/api/resources/link/client/Client.js +19 -19
- package/dist/api/resources/meal/client/Client.js +1 -1
- package/dist/api/resources/menstrualCycle/client/Client.js +1 -1
- package/dist/api/resources/order/client/Client.js +1 -1
- package/dist/api/resources/payor/client/Client.js +1 -1
- package/dist/api/resources/profile/client/Client.js +2 -2
- package/dist/api/resources/providers/client/Client.js +1 -1
- package/dist/api/resources/sleep/client/Client.js +3 -3
- package/dist/api/resources/sleepCycle/client/Client.js +1 -1
- package/dist/api/resources/team/client/Client.js +7 -7
- package/dist/api/resources/testkit/client/Client.js +2 -2
- package/dist/api/resources/user/client/Client.js +18 -18
- package/dist/api/resources/vitals/client/Client.js +78 -78
- package/dist/api/resources/workouts/client/Client.js +3 -3
- package/dist/serialization/resources/labTests/client/index.d.ts +2 -2
- package/dist/serialization/resources/labTests/client/index.js +3 -3
- package/dist/serialization/resources/labTests/client/requests/index.d.ts +2 -2
- package/dist/serialization/resources/labTests/client/requests/index.js +5 -5
- package/dist/serialization/resources/labTests/types/index.d.ts +2 -2
- package/dist/serialization/resources/labTests/types/index.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +1374 -1374
- package/serialization/resources/labTests/client/index.d.ts +2 -2
- package/serialization/resources/labTests/client/index.js +3 -3
- package/serialization/resources/labTests/client/requests/index.d.ts +2 -2
- package/serialization/resources/labTests/client/requests/index.js +5 -5
- package/serialization/resources/labTests/types/index.d.ts +2 -2
- package/serialization/resources/labTests/types/index.js +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -50,99 +50,62 @@ class LabTests {
|
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* GET
|
|
53
|
+
* GET all the lab tests the team has access to.
|
|
54
54
|
*
|
|
55
|
-
* @param {Vital.
|
|
55
|
+
* @param {Vital.LabTestsGetRequest} request
|
|
56
56
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
57
|
*
|
|
58
58
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
59
59
|
*
|
|
60
60
|
* @example
|
|
61
|
-
* await client.labTests.
|
|
61
|
+
* await client.labTests.get()
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
get(request = {}, requestOptions) {
|
|
64
64
|
var _a;
|
|
65
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
const {
|
|
66
|
+
const { generationMethod, labSlug, collectionMethod, status, markerIds, providerIds, name, orderKey, orderDirection, } = request;
|
|
67
67
|
const _queryParams = {};
|
|
68
|
-
if (
|
|
69
|
-
_queryParams["
|
|
70
|
-
}
|
|
71
|
-
if (startDate != null) {
|
|
72
|
-
_queryParams["start_date"] = startDate.toISOString();
|
|
73
|
-
}
|
|
74
|
-
if (endDate != null) {
|
|
75
|
-
_queryParams["end_date"] = endDate.toISOString();
|
|
68
|
+
if (generationMethod != null) {
|
|
69
|
+
_queryParams["generation_method"] = generationMethod;
|
|
76
70
|
}
|
|
77
|
-
if (
|
|
78
|
-
_queryParams["
|
|
71
|
+
if (labSlug != null) {
|
|
72
|
+
_queryParams["lab_slug"] = labSlug;
|
|
79
73
|
}
|
|
80
|
-
if (
|
|
81
|
-
_queryParams["
|
|
74
|
+
if (collectionMethod != null) {
|
|
75
|
+
_queryParams["collection_method"] = collectionMethod;
|
|
82
76
|
}
|
|
83
77
|
if (status != null) {
|
|
84
|
-
|
|
85
|
-
_queryParams["status"] = status.map((item) => item);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
_queryParams["status"] = status;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (orderKey != null) {
|
|
92
|
-
_queryParams["order_key"] = orderKey;
|
|
93
|
-
}
|
|
94
|
-
if (orderDirection != null) {
|
|
95
|
-
_queryParams["order_direction"] = orderDirection;
|
|
78
|
+
_queryParams["status"] = status;
|
|
96
79
|
}
|
|
97
|
-
if (
|
|
98
|
-
if (Array.isArray(
|
|
99
|
-
_queryParams["
|
|
80
|
+
if (markerIds != null) {
|
|
81
|
+
if (Array.isArray(markerIds)) {
|
|
82
|
+
_queryParams["marker_ids"] = markerIds.map((item) => item.toString());
|
|
100
83
|
}
|
|
101
84
|
else {
|
|
102
|
-
_queryParams["
|
|
85
|
+
_queryParams["marker_ids"] = markerIds.toString();
|
|
103
86
|
}
|
|
104
87
|
}
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (interpretation != null) {
|
|
109
|
-
_queryParams["interpretation"] = interpretation;
|
|
110
|
-
}
|
|
111
|
-
if (orderActivationTypes != null) {
|
|
112
|
-
if (Array.isArray(orderActivationTypes)) {
|
|
113
|
-
_queryParams["order_activation_types"] = orderActivationTypes.map((item) => item);
|
|
88
|
+
if (providerIds != null) {
|
|
89
|
+
if (Array.isArray(providerIds)) {
|
|
90
|
+
_queryParams["provider_ids"] = providerIds.map((item) => item);
|
|
114
91
|
}
|
|
115
92
|
else {
|
|
116
|
-
_queryParams["
|
|
93
|
+
_queryParams["provider_ids"] = providerIds;
|
|
117
94
|
}
|
|
118
95
|
}
|
|
119
|
-
if (
|
|
120
|
-
_queryParams["
|
|
121
|
-
}
|
|
122
|
-
if (patientName != null) {
|
|
123
|
-
_queryParams["patient_name"] = patientName;
|
|
124
|
-
}
|
|
125
|
-
if (shippingRecipientName != null) {
|
|
126
|
-
_queryParams["shipping_recipient_name"] = shippingRecipientName;
|
|
127
|
-
}
|
|
128
|
-
if (orderIds != null) {
|
|
129
|
-
if (Array.isArray(orderIds)) {
|
|
130
|
-
_queryParams["order_ids"] = orderIds.map((item) => item);
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
_queryParams["order_ids"] = orderIds;
|
|
134
|
-
}
|
|
96
|
+
if (name != null) {
|
|
97
|
+
_queryParams["name"] = name;
|
|
135
98
|
}
|
|
136
|
-
if (
|
|
137
|
-
_queryParams["
|
|
99
|
+
if (orderKey != null) {
|
|
100
|
+
_queryParams["order_key"] = orderKey;
|
|
138
101
|
}
|
|
139
|
-
if (
|
|
140
|
-
_queryParams["
|
|
102
|
+
if (orderDirection != null) {
|
|
103
|
+
_queryParams["order_direction"] = orderDirection;
|
|
141
104
|
}
|
|
142
105
|
const _response = yield core.fetcher({
|
|
143
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/
|
|
106
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests"),
|
|
144
107
|
method: "GET",
|
|
145
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
108
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
146
109
|
contentType: "application/json",
|
|
147
110
|
queryParameters: _queryParams,
|
|
148
111
|
requestType: "json",
|
|
@@ -151,7 +114,7 @@ class LabTests {
|
|
|
151
114
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
152
115
|
});
|
|
153
116
|
if (_response.ok) {
|
|
154
|
-
return serializers.
|
|
117
|
+
return serializers.labTests.get.Response.parseOrThrow(_response.body, {
|
|
155
118
|
unrecognizedObjectKeys: "passthrough",
|
|
156
119
|
allowUnrecognizedUnionMembers: true,
|
|
157
120
|
allowUnrecognizedEnumValues: true,
|
|
@@ -190,46 +153,34 @@ class LabTests {
|
|
|
190
153
|
});
|
|
191
154
|
}
|
|
192
155
|
/**
|
|
193
|
-
*
|
|
194
|
-
* for the given address and order.
|
|
195
|
-
*
|
|
196
|
-
* @param {Vital.LabTestsGetPhlebotomyAppointmentAvailabilityRequest} request
|
|
156
|
+
* @param {Vital.CreateLabTestRequest} request
|
|
197
157
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
158
|
*
|
|
199
159
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
200
160
|
*
|
|
201
161
|
* @example
|
|
202
|
-
* await client.labTests.
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* state: "state",
|
|
207
|
-
* zipCode: "zip_code"
|
|
208
|
-
* }
|
|
162
|
+
* await client.labTests.create({
|
|
163
|
+
* name: "name",
|
|
164
|
+
* method: "testkit",
|
|
165
|
+
* description: "description"
|
|
209
166
|
* })
|
|
210
167
|
*/
|
|
211
|
-
|
|
168
|
+
create(request, requestOptions) {
|
|
212
169
|
var _a;
|
|
213
170
|
return __awaiter(this, void 0, void 0, function* () {
|
|
214
|
-
const { startDate, body: _body } = request;
|
|
215
|
-
const _queryParams = {};
|
|
216
|
-
if (startDate != null) {
|
|
217
|
-
_queryParams["start_date"] = startDate;
|
|
218
|
-
}
|
|
219
171
|
const _response = yield core.fetcher({
|
|
220
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/
|
|
172
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests"),
|
|
221
173
|
method: "POST",
|
|
222
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
174
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
223
175
|
contentType: "application/json",
|
|
224
|
-
queryParameters: _queryParams,
|
|
225
176
|
requestType: "json",
|
|
226
|
-
body: serializers.
|
|
177
|
+
body: serializers.CreateLabTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
227
178
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
228
179
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
229
180
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
230
181
|
});
|
|
231
182
|
if (_response.ok) {
|
|
232
|
-
return serializers.
|
|
183
|
+
return serializers.ClientFacingLabTest.parseOrThrow(_response.body, {
|
|
233
184
|
unrecognizedObjectKeys: "passthrough",
|
|
234
185
|
allowUnrecognizedUnionMembers: true,
|
|
235
186
|
allowUnrecognizedEnumValues: true,
|
|
@@ -268,35 +219,31 @@ class LabTests {
|
|
|
268
219
|
});
|
|
269
220
|
}
|
|
270
221
|
/**
|
|
271
|
-
*
|
|
222
|
+
* GET all the lab tests the team has access to.
|
|
272
223
|
*
|
|
273
|
-
* @param {string}
|
|
274
|
-
* @param {Vital.AppointmentBookingRequest} request
|
|
224
|
+
* @param {string} labTestId
|
|
275
225
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
276
226
|
*
|
|
277
227
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
278
228
|
*
|
|
279
229
|
* @example
|
|
280
|
-
* await client.labTests.
|
|
281
|
-
* bookingKey: "booking_key"
|
|
282
|
-
* })
|
|
230
|
+
* await client.labTests.getById("lab_test_id")
|
|
283
231
|
*/
|
|
284
|
-
|
|
232
|
+
getById(labTestId, requestOptions) {
|
|
285
233
|
var _a;
|
|
286
234
|
return __awaiter(this, void 0, void 0, function* () {
|
|
287
235
|
const _response = yield core.fetcher({
|
|
288
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
289
|
-
method: "
|
|
290
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
236
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_tests/${encodeURIComponent(labTestId)}`),
|
|
237
|
+
method: "GET",
|
|
238
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
291
239
|
contentType: "application/json",
|
|
292
240
|
requestType: "json",
|
|
293
|
-
body: serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
294
241
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
295
242
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
296
243
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
297
244
|
});
|
|
298
245
|
if (_response.ok) {
|
|
299
|
-
return serializers.
|
|
246
|
+
return serializers.ClientFacingLabTest.parseOrThrow(_response.body, {
|
|
300
247
|
unrecognizedObjectKeys: "passthrough",
|
|
301
248
|
allowUnrecognizedUnionMembers: true,
|
|
302
249
|
allowUnrecognizedEnumValues: true,
|
|
@@ -335,41 +282,31 @@ class LabTests {
|
|
|
335
282
|
});
|
|
336
283
|
}
|
|
337
284
|
/**
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
* @param {string} orderId - Your Order ID.
|
|
341
|
-
* @param {Vital.RequestAppointmentRequest} request
|
|
285
|
+
* @param {string} labTestId
|
|
286
|
+
* @param {Vital.UpdateLabTestRequest} request
|
|
342
287
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
343
288
|
*
|
|
344
289
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
345
290
|
*
|
|
346
291
|
* @example
|
|
347
|
-
* await client.labTests.
|
|
348
|
-
* address: {
|
|
349
|
-
* firstLine: "first_line",
|
|
350
|
-
* city: "city",
|
|
351
|
-
* state: "state",
|
|
352
|
-
* zipCode: "zip_code"
|
|
353
|
-
* },
|
|
354
|
-
* provider: "getlabs"
|
|
355
|
-
* })
|
|
292
|
+
* await client.labTests.updateLabTest("lab_test_id")
|
|
356
293
|
*/
|
|
357
|
-
|
|
294
|
+
updateLabTest(labTestId, request = {}, requestOptions) {
|
|
358
295
|
var _a;
|
|
359
296
|
return __awaiter(this, void 0, void 0, function* () {
|
|
360
297
|
const _response = yield core.fetcher({
|
|
361
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
362
|
-
method: "
|
|
363
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
298
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_tests/${encodeURIComponent(labTestId)}`),
|
|
299
|
+
method: "PATCH",
|
|
300
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
364
301
|
contentType: "application/json",
|
|
365
302
|
requestType: "json",
|
|
366
|
-
body: serializers.
|
|
303
|
+
body: serializers.UpdateLabTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
367
304
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
368
305
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
369
306
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
370
307
|
});
|
|
371
308
|
if (_response.ok) {
|
|
372
|
-
return serializers.
|
|
309
|
+
return serializers.ClientFacingLabTest.parseOrThrow(_response.body, {
|
|
373
310
|
unrecognizedObjectKeys: "passthrough",
|
|
374
311
|
allowUnrecognizedUnionMembers: true,
|
|
375
312
|
allowUnrecognizedEnumValues: true,
|
|
@@ -408,35 +345,54 @@ class LabTests {
|
|
|
408
345
|
});
|
|
409
346
|
}
|
|
410
347
|
/**
|
|
411
|
-
*
|
|
348
|
+
* GET all the markers for the given lab.
|
|
412
349
|
*
|
|
413
|
-
* @param {
|
|
414
|
-
* @param {Vital.AppointmentRescheduleRequest} request
|
|
350
|
+
* @param {Vital.LabTestsGetMarkersRequest} request
|
|
415
351
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
416
352
|
*
|
|
417
353
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
418
354
|
*
|
|
419
355
|
* @example
|
|
420
|
-
* await client.labTests.
|
|
421
|
-
* bookingKey: "booking_key"
|
|
422
|
-
* })
|
|
356
|
+
* await client.labTests.getMarkers()
|
|
423
357
|
*/
|
|
424
|
-
|
|
358
|
+
getMarkers(request = {}, requestOptions) {
|
|
425
359
|
var _a;
|
|
426
360
|
return __awaiter(this, void 0, void 0, function* () {
|
|
361
|
+
const { labId, name, aLaCarteEnabled, page, size } = request;
|
|
362
|
+
const _queryParams = {};
|
|
363
|
+
if (labId != null) {
|
|
364
|
+
if (Array.isArray(labId)) {
|
|
365
|
+
_queryParams["lab_id"] = labId.map((item) => item.toString());
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
_queryParams["lab_id"] = labId.toString();
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (name != null) {
|
|
372
|
+
_queryParams["name"] = name;
|
|
373
|
+
}
|
|
374
|
+
if (aLaCarteEnabled != null) {
|
|
375
|
+
_queryParams["a_la_carte_enabled"] = aLaCarteEnabled.toString();
|
|
376
|
+
}
|
|
377
|
+
if (page != null) {
|
|
378
|
+
_queryParams["page"] = page.toString();
|
|
379
|
+
}
|
|
380
|
+
if (size != null) {
|
|
381
|
+
_queryParams["size"] = size.toString();
|
|
382
|
+
}
|
|
427
383
|
const _response = yield core.fetcher({
|
|
428
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
429
|
-
method: "
|
|
430
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
384
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests/markers"),
|
|
385
|
+
method: "GET",
|
|
386
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
431
387
|
contentType: "application/json",
|
|
388
|
+
queryParameters: _queryParams,
|
|
432
389
|
requestType: "json",
|
|
433
|
-
body: serializers.AppointmentRescheduleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
434
390
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
435
391
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
436
392
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
437
393
|
});
|
|
438
394
|
if (_response.ok) {
|
|
439
|
-
return serializers.
|
|
395
|
+
return serializers.GetMarkersResponse.parseOrThrow(_response.body, {
|
|
440
396
|
unrecognizedObjectKeys: "passthrough",
|
|
441
397
|
allowUnrecognizedUnionMembers: true,
|
|
442
398
|
allowUnrecognizedEnumValues: true,
|
|
@@ -475,35 +431,41 @@ class LabTests {
|
|
|
475
431
|
});
|
|
476
432
|
}
|
|
477
433
|
/**
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
* @param {string} orderId - Your Order ID.
|
|
481
|
-
* @param {Vital.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest} request
|
|
434
|
+
* @param {Vital.LabTestsGetMarkersForOrderSetRequest} request
|
|
482
435
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
483
436
|
*
|
|
484
437
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
485
438
|
*
|
|
486
439
|
* @example
|
|
487
|
-
* await client.labTests.
|
|
488
|
-
*
|
|
440
|
+
* await client.labTests.getMarkersForOrderSet({
|
|
441
|
+
* body: {}
|
|
489
442
|
* })
|
|
490
443
|
*/
|
|
491
|
-
|
|
444
|
+
getMarkersForOrderSet(request, requestOptions) {
|
|
492
445
|
var _a;
|
|
493
446
|
return __awaiter(this, void 0, void 0, function* () {
|
|
447
|
+
const { page, size, body: _body } = request;
|
|
448
|
+
const _queryParams = {};
|
|
449
|
+
if (page != null) {
|
|
450
|
+
_queryParams["page"] = page.toString();
|
|
451
|
+
}
|
|
452
|
+
if (size != null) {
|
|
453
|
+
_queryParams["size"] = size.toString();
|
|
454
|
+
}
|
|
494
455
|
const _response = yield core.fetcher({
|
|
495
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
496
|
-
method: "
|
|
497
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
456
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests/list_order_set_markers"),
|
|
457
|
+
method: "POST",
|
|
458
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
498
459
|
contentType: "application/json",
|
|
460
|
+
queryParameters: _queryParams,
|
|
499
461
|
requestType: "json",
|
|
500
|
-
body: serializers.
|
|
462
|
+
body: serializers.OrderSetRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
501
463
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
502
464
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
503
465
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
504
466
|
});
|
|
505
467
|
if (_response.ok) {
|
|
506
|
-
return serializers.
|
|
468
|
+
return serializers.GetMarkersResponse.parseOrThrow(_response.body, {
|
|
507
469
|
unrecognizedObjectKeys: "passthrough",
|
|
508
470
|
allowUnrecognizedUnionMembers: true,
|
|
509
471
|
allowUnrecognizedEnumValues: true,
|
|
@@ -542,28 +504,39 @@ class LabTests {
|
|
|
542
504
|
});
|
|
543
505
|
}
|
|
544
506
|
/**
|
|
545
|
-
*
|
|
546
|
-
*
|
|
507
|
+
* @param {string} labTestId
|
|
508
|
+
* @param {Vital.LabTestsGetMarkersForLabTestRequest} request
|
|
547
509
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
548
510
|
*
|
|
511
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
|
512
|
+
*
|
|
549
513
|
* @example
|
|
550
|
-
* await client.labTests.
|
|
514
|
+
* await client.labTests.getMarkersForLabTest("lab_test_id")
|
|
551
515
|
*/
|
|
552
|
-
|
|
516
|
+
getMarkersForLabTest(labTestId, request = {}, requestOptions) {
|
|
553
517
|
var _a;
|
|
554
518
|
return __awaiter(this, void 0, void 0, function* () {
|
|
519
|
+
const { page, size } = request;
|
|
520
|
+
const _queryParams = {};
|
|
521
|
+
if (page != null) {
|
|
522
|
+
_queryParams["page"] = page.toString();
|
|
523
|
+
}
|
|
524
|
+
if (size != null) {
|
|
525
|
+
_queryParams["size"] = size.toString();
|
|
526
|
+
}
|
|
555
527
|
const _response = yield core.fetcher({
|
|
556
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
528
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_tests/${encodeURIComponent(labTestId)}/markers`),
|
|
557
529
|
method: "GET",
|
|
558
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
530
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
559
531
|
contentType: "application/json",
|
|
532
|
+
queryParameters: _queryParams,
|
|
560
533
|
requestType: "json",
|
|
561
534
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
562
535
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
563
536
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
564
537
|
});
|
|
565
538
|
if (_response.ok) {
|
|
566
|
-
return serializers.
|
|
539
|
+
return serializers.GetMarkersResponse.parseOrThrow(_response.body, {
|
|
567
540
|
unrecognizedObjectKeys: "passthrough",
|
|
568
541
|
allowUnrecognizedUnionMembers: true,
|
|
569
542
|
allowUnrecognizedEnumValues: true,
|
|
@@ -571,10 +544,20 @@ class LabTests {
|
|
|
571
544
|
});
|
|
572
545
|
}
|
|
573
546
|
if (_response.error.reason === "status-code") {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
547
|
+
switch (_response.error.statusCode) {
|
|
548
|
+
case 422:
|
|
549
|
+
throw new Vital.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
550
|
+
unrecognizedObjectKeys: "passthrough",
|
|
551
|
+
allowUnrecognizedUnionMembers: true,
|
|
552
|
+
allowUnrecognizedEnumValues: true,
|
|
553
|
+
breadcrumbsPrefix: ["response"],
|
|
554
|
+
}));
|
|
555
|
+
default:
|
|
556
|
+
throw new errors.VitalError({
|
|
557
|
+
statusCode: _response.error.statusCode,
|
|
558
|
+
body: _response.error.body,
|
|
559
|
+
});
|
|
560
|
+
}
|
|
578
561
|
}
|
|
579
562
|
switch (_response.error.reason) {
|
|
580
563
|
case "non-json":
|
|
@@ -592,23 +575,24 @@ class LabTests {
|
|
|
592
575
|
});
|
|
593
576
|
}
|
|
594
577
|
/**
|
|
595
|
-
*
|
|
578
|
+
* GET a specific marker for the given lab and provider_id
|
|
596
579
|
*
|
|
597
|
-
* @param {string}
|
|
580
|
+
* @param {string} providerId
|
|
581
|
+
* @param {number} labId
|
|
598
582
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
599
583
|
*
|
|
600
584
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
601
585
|
*
|
|
602
586
|
* @example
|
|
603
|
-
* await client.labTests.
|
|
587
|
+
* await client.labTests.getMarkersByLabAndProviderId("provider_id", 1)
|
|
604
588
|
*/
|
|
605
|
-
|
|
589
|
+
getMarkersByLabAndProviderId(providerId, labId, requestOptions) {
|
|
606
590
|
var _a;
|
|
607
591
|
return __awaiter(this, void 0, void 0, function* () {
|
|
608
592
|
const _response = yield core.fetcher({
|
|
609
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
593
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_tests/${encodeURIComponent(labId)}/markers/${encodeURIComponent(providerId)}`),
|
|
610
594
|
method: "GET",
|
|
611
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
595
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
612
596
|
contentType: "application/json",
|
|
613
597
|
requestType: "json",
|
|
614
598
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -616,7 +600,7 @@ class LabTests {
|
|
|
616
600
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
617
601
|
});
|
|
618
602
|
if (_response.ok) {
|
|
619
|
-
return serializers.
|
|
603
|
+
return serializers.ClientFacingMarker.parseOrThrow(_response.body, {
|
|
620
604
|
unrecognizedObjectKeys: "passthrough",
|
|
621
605
|
allowUnrecognizedUnionMembers: true,
|
|
622
606
|
allowUnrecognizedEnumValues: true,
|
|
@@ -655,55 +639,28 @@ class LabTests {
|
|
|
655
639
|
});
|
|
656
640
|
}
|
|
657
641
|
/**
|
|
658
|
-
* GET
|
|
659
|
-
*
|
|
660
|
-
* Information returned:
|
|
661
|
-
* * Whether a given zip code is served by our Phlebotomy network.
|
|
662
|
-
* * List of Lab locations in the area.
|
|
642
|
+
* GET all the labs.
|
|
663
643
|
*
|
|
664
|
-
* @param {Vital.LabTestsGetAreaInfoRequest} request
|
|
665
644
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
666
645
|
*
|
|
667
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
|
668
|
-
*
|
|
669
646
|
* @example
|
|
670
|
-
* await client.labTests.
|
|
671
|
-
* zipCode: "zip_code"
|
|
672
|
-
* })
|
|
647
|
+
* await client.labTests.getLabs()
|
|
673
648
|
*/
|
|
674
|
-
|
|
649
|
+
getLabs(requestOptions) {
|
|
675
650
|
var _a;
|
|
676
651
|
return __awaiter(this, void 0, void 0, function* () {
|
|
677
|
-
const { zipCode, radius, lab, labs } = request;
|
|
678
|
-
const _queryParams = {};
|
|
679
|
-
_queryParams["zip_code"] = zipCode;
|
|
680
|
-
if (radius != null) {
|
|
681
|
-
_queryParams["radius"] = radius;
|
|
682
|
-
}
|
|
683
|
-
if (lab != null) {
|
|
684
|
-
_queryParams["lab"] = lab;
|
|
685
|
-
}
|
|
686
|
-
if (labs != null) {
|
|
687
|
-
if (Array.isArray(labs)) {
|
|
688
|
-
_queryParams["labs"] = labs.map((item) => item);
|
|
689
|
-
}
|
|
690
|
-
else {
|
|
691
|
-
_queryParams["labs"] = labs;
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
652
|
const _response = yield core.fetcher({
|
|
695
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/
|
|
653
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests/labs"),
|
|
696
654
|
method: "GET",
|
|
697
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
655
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
698
656
|
contentType: "application/json",
|
|
699
|
-
queryParameters: _queryParams,
|
|
700
657
|
requestType: "json",
|
|
701
658
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
702
659
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
703
660
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
704
661
|
});
|
|
705
662
|
if (_response.ok) {
|
|
706
|
-
return serializers.
|
|
663
|
+
return serializers.labTests.getLabs.Response.parseOrThrow(_response.body, {
|
|
707
664
|
unrecognizedObjectKeys: "passthrough",
|
|
708
665
|
allowUnrecognizedUnionMembers: true,
|
|
709
666
|
allowUnrecognizedEnumValues: true,
|
|
@@ -711,20 +668,10 @@ class LabTests {
|
|
|
711
668
|
});
|
|
712
669
|
}
|
|
713
670
|
if (_response.error.reason === "status-code") {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
allowUnrecognizedUnionMembers: true,
|
|
719
|
-
allowUnrecognizedEnumValues: true,
|
|
720
|
-
breadcrumbsPrefix: ["response"],
|
|
721
|
-
}));
|
|
722
|
-
default:
|
|
723
|
-
throw new errors.VitalError({
|
|
724
|
-
statusCode: _response.error.statusCode,
|
|
725
|
-
body: _response.error.body,
|
|
726
|
-
});
|
|
727
|
-
}
|
|
671
|
+
throw new errors.VitalError({
|
|
672
|
+
statusCode: _response.error.statusCode,
|
|
673
|
+
body: _response.error.body,
|
|
674
|
+
});
|
|
728
675
|
}
|
|
729
676
|
switch (_response.error.reason) {
|
|
730
677
|
case "non-json":
|
|
@@ -742,48 +689,46 @@ class LabTests {
|
|
|
742
689
|
});
|
|
743
690
|
}
|
|
744
691
|
/**
|
|
745
|
-
*
|
|
692
|
+
* Return the available time slots to book an appointment with a phlebotomist
|
|
693
|
+
* for the given address and order.
|
|
694
|
+
*
|
|
695
|
+
* @param {Vital.LabTestsGetPhlebotomyAppointmentAvailabilityRequest} request
|
|
746
696
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
747
697
|
*
|
|
748
698
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
749
699
|
*
|
|
750
700
|
* @example
|
|
751
|
-
* await client.labTests.
|
|
752
|
-
*
|
|
753
|
-
*
|
|
701
|
+
* await client.labTests.getPhlebotomyAppointmentAvailability({
|
|
702
|
+
* body: {
|
|
703
|
+
* firstLine: "first_line",
|
|
704
|
+
* city: "city",
|
|
705
|
+
* state: "state",
|
|
706
|
+
* zipCode: "zip_code"
|
|
707
|
+
* }
|
|
754
708
|
* })
|
|
755
709
|
*/
|
|
756
|
-
|
|
710
|
+
getPhlebotomyAppointmentAvailability(request, requestOptions) {
|
|
757
711
|
var _a;
|
|
758
712
|
return __awaiter(this, void 0, void 0, function* () {
|
|
759
|
-
const {
|
|
713
|
+
const { startDate, body: _body } = request;
|
|
760
714
|
const _queryParams = {};
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
if (radius != null) {
|
|
764
|
-
_queryParams["radius"] = radius;
|
|
765
|
-
}
|
|
766
|
-
if (capabilities != null) {
|
|
767
|
-
if (Array.isArray(capabilities)) {
|
|
768
|
-
_queryParams["capabilities"] = capabilities.map((item) => item);
|
|
769
|
-
}
|
|
770
|
-
else {
|
|
771
|
-
_queryParams["capabilities"] = capabilities;
|
|
772
|
-
}
|
|
715
|
+
if (startDate != null) {
|
|
716
|
+
_queryParams["start_date"] = startDate;
|
|
773
717
|
}
|
|
774
718
|
const _response = yield core.fetcher({
|
|
775
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/
|
|
776
|
-
method: "
|
|
777
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
719
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/phlebotomy/appointment/availability"),
|
|
720
|
+
method: "POST",
|
|
721
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
778
722
|
contentType: "application/json",
|
|
779
723
|
queryParameters: _queryParams,
|
|
780
724
|
requestType: "json",
|
|
725
|
+
body: serializers.UsAddress.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
781
726
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
782
727
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
783
728
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
784
729
|
});
|
|
785
730
|
if (_response.ok) {
|
|
786
|
-
return serializers.
|
|
731
|
+
return serializers.AppointmentAvailabilitySlots.parseOrThrow(_response.body, {
|
|
787
732
|
unrecognizedObjectKeys: "passthrough",
|
|
788
733
|
allowUnrecognizedUnionMembers: true,
|
|
789
734
|
allowUnrecognizedEnumValues: true,
|
|
@@ -822,44 +767,35 @@ class LabTests {
|
|
|
822
767
|
});
|
|
823
768
|
}
|
|
824
769
|
/**
|
|
770
|
+
* Book an at-home phlebotomy appointment.
|
|
771
|
+
*
|
|
825
772
|
* @param {string} orderId - Your Order ID.
|
|
826
|
-
* @param {Vital.
|
|
773
|
+
* @param {Vital.AppointmentBookingRequest} request
|
|
827
774
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
828
775
|
*
|
|
829
776
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
830
777
|
*
|
|
831
778
|
* @example
|
|
832
|
-
* await client.labTests.
|
|
779
|
+
* await client.labTests.bookPhlebotomyAppointment("order_id", {
|
|
780
|
+
* bookingKey: "booking_key"
|
|
781
|
+
* })
|
|
833
782
|
*/
|
|
834
|
-
|
|
783
|
+
bookPhlebotomyAppointment(orderId, request, requestOptions) {
|
|
835
784
|
var _a;
|
|
836
785
|
return __awaiter(this, void 0, void 0, function* () {
|
|
837
|
-
const { radius, capabilities } = request;
|
|
838
|
-
const _queryParams = {};
|
|
839
|
-
if (radius != null) {
|
|
840
|
-
_queryParams["radius"] = radius;
|
|
841
|
-
}
|
|
842
|
-
if (capabilities != null) {
|
|
843
|
-
if (Array.isArray(capabilities)) {
|
|
844
|
-
_queryParams["capabilities"] = capabilities.map((item) => item);
|
|
845
|
-
}
|
|
846
|
-
else {
|
|
847
|
-
_queryParams["capabilities"] = capabilities;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
786
|
const _response = yield core.fetcher({
|
|
851
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/
|
|
852
|
-
method: "
|
|
853
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
787
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/phlebotomy/appointment/book`),
|
|
788
|
+
method: "POST",
|
|
789
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
854
790
|
contentType: "application/json",
|
|
855
|
-
queryParameters: _queryParams,
|
|
856
791
|
requestType: "json",
|
|
792
|
+
body: serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
857
793
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
858
794
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
859
795
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
860
796
|
});
|
|
861
797
|
if (_response.ok) {
|
|
862
|
-
return serializers.
|
|
798
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
863
799
|
unrecognizedObjectKeys: "passthrough",
|
|
864
800
|
allowUnrecognizedUnionMembers: true,
|
|
865
801
|
allowUnrecognizedEnumValues: true,
|
|
@@ -898,25 +834,46 @@ class LabTests {
|
|
|
898
834
|
});
|
|
899
835
|
}
|
|
900
836
|
/**
|
|
901
|
-
*
|
|
837
|
+
* Request an at-home phlebotomy appointment.
|
|
838
|
+
*
|
|
839
|
+
* @param {string} orderId - Your Order ID.
|
|
840
|
+
* @param {Vital.RequestAppointmentRequest} request
|
|
841
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
842
|
+
*
|
|
902
843
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
844
|
+
*
|
|
845
|
+
* @example
|
|
846
|
+
* await client.labTests.requestPhlebotomyAppointment("order_id", {
|
|
847
|
+
* address: {
|
|
848
|
+
* firstLine: "first_line",
|
|
849
|
+
* city: "city",
|
|
850
|
+
* state: "state",
|
|
851
|
+
* zipCode: "zip_code"
|
|
852
|
+
* },
|
|
853
|
+
* provider: "getlabs"
|
|
854
|
+
* })
|
|
903
855
|
*/
|
|
904
|
-
|
|
856
|
+
requestPhlebotomyAppointment(orderId, request, requestOptions) {
|
|
905
857
|
var _a;
|
|
906
858
|
return __awaiter(this, void 0, void 0, function* () {
|
|
907
859
|
const _response = yield core.fetcher({
|
|
908
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/
|
|
909
|
-
method: "
|
|
910
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
860
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/phlebotomy/appointment/request`),
|
|
861
|
+
method: "POST",
|
|
862
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
911
863
|
contentType: "application/json",
|
|
912
864
|
requestType: "json",
|
|
913
|
-
|
|
865
|
+
body: serializers.RequestAppointmentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
914
866
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
915
867
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
916
868
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
917
869
|
});
|
|
918
870
|
if (_response.ok) {
|
|
919
|
-
return _response.body
|
|
871
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
872
|
+
unrecognizedObjectKeys: "passthrough",
|
|
873
|
+
allowUnrecognizedUnionMembers: true,
|
|
874
|
+
allowUnrecognizedEnumValues: true,
|
|
875
|
+
breadcrumbsPrefix: ["response"],
|
|
876
|
+
});
|
|
920
877
|
}
|
|
921
878
|
if (_response.error.reason === "status-code") {
|
|
922
879
|
switch (_response.error.statusCode) {
|
|
@@ -950,32 +907,35 @@ class LabTests {
|
|
|
950
907
|
});
|
|
951
908
|
}
|
|
952
909
|
/**
|
|
953
|
-
*
|
|
954
|
-
* provider and sample dates.
|
|
910
|
+
* Reschedule a previously booked at-home phlebotomy appointment.
|
|
955
911
|
*
|
|
956
|
-
* @param {string} orderId
|
|
912
|
+
* @param {string} orderId - Your Order ID.
|
|
913
|
+
* @param {Vital.AppointmentRescheduleRequest} request
|
|
957
914
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
958
915
|
*
|
|
959
916
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
960
917
|
*
|
|
961
918
|
* @example
|
|
962
|
-
* await client.labTests.
|
|
919
|
+
* await client.labTests.reschedulePhlebotomyAppointment("order_id", {
|
|
920
|
+
* bookingKey: "booking_key"
|
|
921
|
+
* })
|
|
963
922
|
*/
|
|
964
|
-
|
|
923
|
+
reschedulePhlebotomyAppointment(orderId, request, requestOptions) {
|
|
965
924
|
var _a;
|
|
966
925
|
return __awaiter(this, void 0, void 0, function* () {
|
|
967
926
|
const _response = yield core.fetcher({
|
|
968
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/
|
|
969
|
-
method: "
|
|
970
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
927
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/phlebotomy/appointment/reschedule`),
|
|
928
|
+
method: "PATCH",
|
|
929
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
971
930
|
contentType: "application/json",
|
|
972
931
|
requestType: "json",
|
|
932
|
+
body: serializers.AppointmentRescheduleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
973
933
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
974
934
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
975
935
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
976
936
|
});
|
|
977
937
|
if (_response.ok) {
|
|
978
|
-
return serializers.
|
|
938
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
979
939
|
unrecognizedObjectKeys: "passthrough",
|
|
980
940
|
allowUnrecognizedUnionMembers: true,
|
|
981
941
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1014,31 +974,35 @@ class LabTests {
|
|
|
1014
974
|
});
|
|
1015
975
|
}
|
|
1016
976
|
/**
|
|
1017
|
-
*
|
|
977
|
+
* Cancel a previously booked at-home phlebotomy appointment.
|
|
1018
978
|
*
|
|
1019
|
-
* @param {string} orderId
|
|
979
|
+
* @param {string} orderId - Your Order ID.
|
|
980
|
+
* @param {Vital.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest} request
|
|
1020
981
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1021
982
|
*
|
|
1022
983
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1023
984
|
*
|
|
1024
985
|
* @example
|
|
1025
|
-
* await client.labTests.
|
|
986
|
+
* await client.labTests.cancelPhlebotomyAppointment("order_id", {
|
|
987
|
+
* cancellationReasonId: "cancellation_reason_id"
|
|
988
|
+
* })
|
|
1026
989
|
*/
|
|
1027
|
-
|
|
990
|
+
cancelPhlebotomyAppointment(orderId, request, requestOptions) {
|
|
1028
991
|
var _a;
|
|
1029
992
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1030
993
|
const _response = yield core.fetcher({
|
|
1031
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/
|
|
1032
|
-
method: "
|
|
1033
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
994
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/phlebotomy/appointment/cancel`),
|
|
995
|
+
method: "PATCH",
|
|
996
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1034
997
|
contentType: "application/json",
|
|
1035
998
|
requestType: "json",
|
|
999
|
+
body: serializers.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1036
1000
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1037
1001
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1038
1002
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1039
1003
|
});
|
|
1040
1004
|
if (_response.ok) {
|
|
1041
|
-
return serializers.
|
|
1005
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
1042
1006
|
unrecognizedObjectKeys: "passthrough",
|
|
1043
1007
|
allowUnrecognizedUnionMembers: true,
|
|
1044
1008
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1077,48 +1041,39 @@ class LabTests {
|
|
|
1077
1041
|
});
|
|
1078
1042
|
}
|
|
1079
1043
|
/**
|
|
1080
|
-
*
|
|
1081
|
-
*
|
|
1044
|
+
* Get the list of reasons for cancelling an at-home phlebotomy appointment.
|
|
1045
|
+
*
|
|
1046
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1047
|
+
*
|
|
1048
|
+
* @example
|
|
1049
|
+
* await client.labTests.getPhlebotomyAppointmentCancellationReason()
|
|
1082
1050
|
*/
|
|
1083
|
-
|
|
1051
|
+
getPhlebotomyAppointmentCancellationReason(requestOptions) {
|
|
1084
1052
|
var _a;
|
|
1085
1053
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1086
|
-
const { numberOfLabels, collectionDate } = request;
|
|
1087
|
-
const _queryParams = {};
|
|
1088
|
-
if (numberOfLabels != null) {
|
|
1089
|
-
_queryParams["number_of_labels"] = numberOfLabels.toString();
|
|
1090
|
-
}
|
|
1091
|
-
_queryParams["collection_date"] = collectionDate.toISOString();
|
|
1092
1054
|
const _response = yield core.fetcher({
|
|
1093
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1055
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/phlebotomy/appointment/cancellation-reasons"),
|
|
1094
1056
|
method: "GET",
|
|
1095
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1057
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1096
1058
|
contentType: "application/json",
|
|
1097
|
-
queryParameters: _queryParams,
|
|
1098
1059
|
requestType: "json",
|
|
1099
|
-
responseType: "streaming",
|
|
1100
1060
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1101
1061
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1102
1062
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1103
1063
|
});
|
|
1104
1064
|
if (_response.ok) {
|
|
1105
|
-
return _response.body
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
throw new errors.VitalError({
|
|
1118
|
-
statusCode: _response.error.statusCode,
|
|
1119
|
-
body: _response.error.body,
|
|
1120
|
-
});
|
|
1121
|
-
}
|
|
1065
|
+
return serializers.labTests.getPhlebotomyAppointmentCancellationReason.Response.parseOrThrow(_response.body, {
|
|
1066
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1067
|
+
allowUnrecognizedUnionMembers: true,
|
|
1068
|
+
allowUnrecognizedEnumValues: true,
|
|
1069
|
+
breadcrumbsPrefix: ["response"],
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
if (_response.error.reason === "status-code") {
|
|
1073
|
+
throw new errors.VitalError({
|
|
1074
|
+
statusCode: _response.error.statusCode,
|
|
1075
|
+
body: _response.error.body,
|
|
1076
|
+
});
|
|
1122
1077
|
}
|
|
1123
1078
|
switch (_response.error.reason) {
|
|
1124
1079
|
case "non-json":
|
|
@@ -1136,52 +1091,31 @@ class LabTests {
|
|
|
1136
1091
|
});
|
|
1137
1092
|
}
|
|
1138
1093
|
/**
|
|
1139
|
-
*
|
|
1094
|
+
* Get the appointment associated with an order.
|
|
1095
|
+
*
|
|
1096
|
+
* @param {string} orderId - Your Order ID.
|
|
1140
1097
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1141
1098
|
*
|
|
1142
1099
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1143
1100
|
*
|
|
1144
1101
|
* @example
|
|
1145
|
-
* await client.labTests.
|
|
1146
|
-
* lab: "quest"
|
|
1147
|
-
* })
|
|
1102
|
+
* await client.labTests.getPhlebotomyAppointment("order_id")
|
|
1148
1103
|
*/
|
|
1149
|
-
|
|
1104
|
+
getPhlebotomyAppointment(orderId, requestOptions) {
|
|
1150
1105
|
var _a;
|
|
1151
1106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1152
|
-
const { lab, startDate, siteCodes, zipCode, radius } = request;
|
|
1153
|
-
const _queryParams = {};
|
|
1154
|
-
_queryParams["lab"] = lab;
|
|
1155
|
-
if (startDate != null) {
|
|
1156
|
-
_queryParams["start_date"] = startDate;
|
|
1157
|
-
}
|
|
1158
|
-
if (siteCodes != null) {
|
|
1159
|
-
if (Array.isArray(siteCodes)) {
|
|
1160
|
-
_queryParams["site_codes"] = siteCodes.map((item) => item);
|
|
1161
|
-
}
|
|
1162
|
-
else {
|
|
1163
|
-
_queryParams["site_codes"] = siteCodes;
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
if (zipCode != null) {
|
|
1167
|
-
_queryParams["zip_code"] = zipCode;
|
|
1168
|
-
}
|
|
1169
|
-
if (radius != null) {
|
|
1170
|
-
_queryParams["radius"] = radius;
|
|
1171
|
-
}
|
|
1172
1107
|
const _response = yield core.fetcher({
|
|
1173
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1174
|
-
method: "
|
|
1175
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1108
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/phlebotomy/appointment`),
|
|
1109
|
+
method: "GET",
|
|
1110
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1176
1111
|
contentType: "application/json",
|
|
1177
|
-
queryParameters: _queryParams,
|
|
1178
1112
|
requestType: "json",
|
|
1179
1113
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1180
1114
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1181
1115
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1182
1116
|
});
|
|
1183
1117
|
if (_response.ok) {
|
|
1184
|
-
return serializers.
|
|
1118
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
1185
1119
|
unrecognizedObjectKeys: "passthrough",
|
|
1186
1120
|
allowUnrecognizedUnionMembers: true,
|
|
1187
1121
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1220,33 +1154,55 @@ class LabTests {
|
|
|
1220
1154
|
});
|
|
1221
1155
|
}
|
|
1222
1156
|
/**
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1157
|
+
* GET information about an area with respect to lab-testing.
|
|
1158
|
+
*
|
|
1159
|
+
* Information returned:
|
|
1160
|
+
* * Whether a given zip code is served by our Phlebotomy network.
|
|
1161
|
+
* * List of Lab locations in the area.
|
|
1162
|
+
*
|
|
1163
|
+
* @param {Vital.LabTestsGetAreaInfoRequest} request
|
|
1225
1164
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1226
1165
|
*
|
|
1227
1166
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1228
1167
|
*
|
|
1229
1168
|
* @example
|
|
1230
|
-
* await client.labTests.
|
|
1231
|
-
*
|
|
1169
|
+
* await client.labTests.getAreaInfo({
|
|
1170
|
+
* zipCode: "zip_code"
|
|
1232
1171
|
* })
|
|
1233
1172
|
*/
|
|
1234
|
-
|
|
1173
|
+
getAreaInfo(request, requestOptions) {
|
|
1235
1174
|
var _a;
|
|
1236
1175
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1176
|
+
const { zipCode, radius, lab, labs } = request;
|
|
1177
|
+
const _queryParams = {};
|
|
1178
|
+
_queryParams["zip_code"] = zipCode;
|
|
1179
|
+
if (radius != null) {
|
|
1180
|
+
_queryParams["radius"] = radius;
|
|
1181
|
+
}
|
|
1182
|
+
if (lab != null) {
|
|
1183
|
+
_queryParams["lab"] = lab;
|
|
1184
|
+
}
|
|
1185
|
+
if (labs != null) {
|
|
1186
|
+
if (Array.isArray(labs)) {
|
|
1187
|
+
_queryParams["labs"] = labs.map((item) => item);
|
|
1188
|
+
}
|
|
1189
|
+
else {
|
|
1190
|
+
_queryParams["labs"] = labs;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1237
1193
|
const _response = yield core.fetcher({
|
|
1238
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1239
|
-
method: "
|
|
1240
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1194
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/area/info"),
|
|
1195
|
+
method: "GET",
|
|
1196
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1241
1197
|
contentType: "application/json",
|
|
1198
|
+
queryParameters: _queryParams,
|
|
1242
1199
|
requestType: "json",
|
|
1243
|
-
body: serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1244
1200
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1245
1201
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1246
1202
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1247
1203
|
});
|
|
1248
1204
|
if (_response.ok) {
|
|
1249
|
-
return serializers.
|
|
1205
|
+
return serializers.AreaInfo.parseOrThrow(_response.body, {
|
|
1250
1206
|
unrecognizedObjectKeys: "passthrough",
|
|
1251
1207
|
allowUnrecognizedUnionMembers: true,
|
|
1252
1208
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1285,33 +1241,48 @@ class LabTests {
|
|
|
1285
1241
|
});
|
|
1286
1242
|
}
|
|
1287
1243
|
/**
|
|
1288
|
-
* @param {
|
|
1289
|
-
* @param {Vital.AppointmentRescheduleRequest} request
|
|
1244
|
+
* @param {Vital.LabTestsGetPscInfoRequest} request
|
|
1290
1245
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1291
1246
|
*
|
|
1292
1247
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1293
1248
|
*
|
|
1294
1249
|
* @example
|
|
1295
|
-
* await client.labTests.
|
|
1296
|
-
*
|
|
1250
|
+
* await client.labTests.getPscInfo({
|
|
1251
|
+
* zipCode: "zip_code",
|
|
1252
|
+
* labId: 1
|
|
1297
1253
|
* })
|
|
1298
1254
|
*/
|
|
1299
|
-
|
|
1255
|
+
getPscInfo(request, requestOptions) {
|
|
1300
1256
|
var _a;
|
|
1301
1257
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1258
|
+
const { zipCode, labId, radius, capabilities } = request;
|
|
1259
|
+
const _queryParams = {};
|
|
1260
|
+
_queryParams["zip_code"] = zipCode;
|
|
1261
|
+
_queryParams["lab_id"] = labId.toString();
|
|
1262
|
+
if (radius != null) {
|
|
1263
|
+
_queryParams["radius"] = radius;
|
|
1264
|
+
}
|
|
1265
|
+
if (capabilities != null) {
|
|
1266
|
+
if (Array.isArray(capabilities)) {
|
|
1267
|
+
_queryParams["capabilities"] = capabilities.map((item) => item);
|
|
1268
|
+
}
|
|
1269
|
+
else {
|
|
1270
|
+
_queryParams["capabilities"] = capabilities;
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1302
1273
|
const _response = yield core.fetcher({
|
|
1303
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1304
|
-
method: "
|
|
1305
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1274
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/psc/info"),
|
|
1275
|
+
method: "GET",
|
|
1276
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1306
1277
|
contentType: "application/json",
|
|
1278
|
+
queryParameters: _queryParams,
|
|
1307
1279
|
requestType: "json",
|
|
1308
|
-
body: serializers.AppointmentRescheduleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1309
1280
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1310
1281
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1311
1282
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1312
1283
|
});
|
|
1313
1284
|
if (_response.ok) {
|
|
1314
|
-
return serializers.
|
|
1285
|
+
return serializers.PscInfo.parseOrThrow(_response.body, {
|
|
1315
1286
|
unrecognizedObjectKeys: "passthrough",
|
|
1316
1287
|
allowUnrecognizedUnionMembers: true,
|
|
1317
1288
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1351,34 +1322,43 @@ class LabTests {
|
|
|
1351
1322
|
}
|
|
1352
1323
|
/**
|
|
1353
1324
|
* @param {string} orderId - Your Order ID.
|
|
1354
|
-
* @param {Vital.
|
|
1325
|
+
* @param {Vital.LabTestsGetOrderPscInfoRequest} request
|
|
1355
1326
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1356
1327
|
*
|
|
1357
1328
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1358
1329
|
*
|
|
1359
1330
|
* @example
|
|
1360
|
-
* await client.labTests.
|
|
1361
|
-
* cancellationReasonId: "cancellationReasonId"
|
|
1362
|
-
* })
|
|
1331
|
+
* await client.labTests.getOrderPscInfo("order_id")
|
|
1363
1332
|
*/
|
|
1364
|
-
|
|
1333
|
+
getOrderPscInfo(orderId, request = {}, requestOptions) {
|
|
1365
1334
|
var _a;
|
|
1366
1335
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1336
|
+
const { radius, capabilities } = request;
|
|
1337
|
+
const _queryParams = {};
|
|
1338
|
+
if (radius != null) {
|
|
1339
|
+
_queryParams["radius"] = radius;
|
|
1340
|
+
}
|
|
1341
|
+
if (capabilities != null) {
|
|
1342
|
+
if (Array.isArray(capabilities)) {
|
|
1343
|
+
_queryParams["capabilities"] = capabilities.map((item) => item);
|
|
1344
|
+
}
|
|
1345
|
+
else {
|
|
1346
|
+
_queryParams["capabilities"] = capabilities;
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1367
1349
|
const _response = yield core.fetcher({
|
|
1368
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/
|
|
1369
|
-
method: "
|
|
1370
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1350
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/info`),
|
|
1351
|
+
method: "GET",
|
|
1352
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1371
1353
|
contentType: "application/json",
|
|
1354
|
+
queryParameters: _queryParams,
|
|
1372
1355
|
requestType: "json",
|
|
1373
|
-
body: serializers.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest.jsonOrThrow(request, {
|
|
1374
|
-
unrecognizedObjectKeys: "strip",
|
|
1375
|
-
}),
|
|
1376
1356
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1377
1357
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1378
1358
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1379
1359
|
});
|
|
1380
1360
|
if (_response.ok) {
|
|
1381
|
-
return serializers.
|
|
1361
|
+
return serializers.PscInfo.parseOrThrow(_response.body, {
|
|
1382
1362
|
unrecognizedObjectKeys: "passthrough",
|
|
1383
1363
|
allowUnrecognizedUnionMembers: true,
|
|
1384
1364
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1417,37 +1397,41 @@ class LabTests {
|
|
|
1417
1397
|
});
|
|
1418
1398
|
}
|
|
1419
1399
|
/**
|
|
1420
|
-
*
|
|
1421
|
-
*
|
|
1422
|
-
* @example
|
|
1423
|
-
* await client.labTests.getPscAppointmentCancellationReason()
|
|
1400
|
+
* This endpoint returns the lab results for the order.
|
|
1401
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
|
1424
1402
|
*/
|
|
1425
|
-
|
|
1403
|
+
getResultPdf(orderId, requestOptions) {
|
|
1426
1404
|
var _a;
|
|
1427
1405
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1428
1406
|
const _response = yield core.fetcher({
|
|
1429
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1407
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/result/pdf`),
|
|
1430
1408
|
method: "GET",
|
|
1431
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1409
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1432
1410
|
contentType: "application/json",
|
|
1433
1411
|
requestType: "json",
|
|
1412
|
+
responseType: "streaming",
|
|
1434
1413
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1435
1414
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1436
1415
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1437
1416
|
});
|
|
1438
1417
|
if (_response.ok) {
|
|
1439
|
-
return
|
|
1440
|
-
unrecognizedObjectKeys: "passthrough",
|
|
1441
|
-
allowUnrecognizedUnionMembers: true,
|
|
1442
|
-
allowUnrecognizedEnumValues: true,
|
|
1443
|
-
breadcrumbsPrefix: ["response"],
|
|
1444
|
-
});
|
|
1418
|
+
return _response.body;
|
|
1445
1419
|
}
|
|
1446
1420
|
if (_response.error.reason === "status-code") {
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1421
|
+
switch (_response.error.statusCode) {
|
|
1422
|
+
case 422:
|
|
1423
|
+
throw new Vital.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
1424
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1425
|
+
allowUnrecognizedUnionMembers: true,
|
|
1426
|
+
allowUnrecognizedEnumValues: true,
|
|
1427
|
+
breadcrumbsPrefix: ["response"],
|
|
1428
|
+
}));
|
|
1429
|
+
default:
|
|
1430
|
+
throw new errors.VitalError({
|
|
1431
|
+
statusCode: _response.error.statusCode,
|
|
1432
|
+
body: _response.error.body,
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1451
1435
|
}
|
|
1452
1436
|
switch (_response.error.reason) {
|
|
1453
1437
|
case "non-json":
|
|
@@ -1465,23 +1449,24 @@ class LabTests {
|
|
|
1465
1449
|
});
|
|
1466
1450
|
}
|
|
1467
1451
|
/**
|
|
1468
|
-
*
|
|
1452
|
+
* Return metadata related to order results, such as lab metadata,
|
|
1453
|
+
* provider and sample dates.
|
|
1469
1454
|
*
|
|
1470
|
-
* @param {string} orderId
|
|
1455
|
+
* @param {string} orderId
|
|
1471
1456
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1472
1457
|
*
|
|
1473
1458
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1474
1459
|
*
|
|
1475
1460
|
* @example
|
|
1476
|
-
* await client.labTests.
|
|
1461
|
+
* await client.labTests.getResultMetadata("order_id")
|
|
1477
1462
|
*/
|
|
1478
|
-
|
|
1463
|
+
getResultMetadata(orderId, requestOptions) {
|
|
1479
1464
|
var _a;
|
|
1480
1465
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1481
1466
|
const _response = yield core.fetcher({
|
|
1482
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/
|
|
1467
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/result/metadata`),
|
|
1483
1468
|
method: "GET",
|
|
1484
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1469
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1485
1470
|
contentType: "application/json",
|
|
1486
1471
|
requestType: "json",
|
|
1487
1472
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1489,7 +1474,7 @@ class LabTests {
|
|
|
1489
1474
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1490
1475
|
});
|
|
1491
1476
|
if (_response.ok) {
|
|
1492
|
-
return serializers.
|
|
1477
|
+
return serializers.LabResultsMetadata.parseOrThrow(_response.body, {
|
|
1493
1478
|
unrecognizedObjectKeys: "passthrough",
|
|
1494
1479
|
allowUnrecognizedUnionMembers: true,
|
|
1495
1480
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1528,25 +1513,36 @@ class LabTests {
|
|
|
1528
1513
|
});
|
|
1529
1514
|
}
|
|
1530
1515
|
/**
|
|
1531
|
-
*
|
|
1516
|
+
* Return both metadata and raw json test data
|
|
1517
|
+
*
|
|
1518
|
+
* @param {string} orderId
|
|
1519
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1520
|
+
*
|
|
1532
1521
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1522
|
+
*
|
|
1523
|
+
* @example
|
|
1524
|
+
* await client.labTests.getResultRaw("order_id")
|
|
1533
1525
|
*/
|
|
1534
|
-
|
|
1526
|
+
getResultRaw(orderId, requestOptions) {
|
|
1535
1527
|
var _a;
|
|
1536
1528
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1537
1529
|
const _response = yield core.fetcher({
|
|
1538
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/
|
|
1530
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/result`),
|
|
1539
1531
|
method: "GET",
|
|
1540
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1532
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1541
1533
|
contentType: "application/json",
|
|
1542
1534
|
requestType: "json",
|
|
1543
|
-
responseType: "streaming",
|
|
1544
1535
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1545
1536
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1546
1537
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1547
1538
|
});
|
|
1548
1539
|
if (_response.ok) {
|
|
1549
|
-
return _response.body
|
|
1540
|
+
return serializers.LabResultsRaw.parseOrThrow(_response.body, {
|
|
1541
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1542
|
+
allowUnrecognizedUnionMembers: true,
|
|
1543
|
+
allowUnrecognizedEnumValues: true,
|
|
1544
|
+
breadcrumbsPrefix: ["response"],
|
|
1545
|
+
});
|
|
1550
1546
|
}
|
|
1551
1547
|
if (_response.error.reason === "status-code") {
|
|
1552
1548
|
switch (_response.error.statusCode) {
|
|
@@ -1580,17 +1576,24 @@ class LabTests {
|
|
|
1580
1576
|
});
|
|
1581
1577
|
}
|
|
1582
1578
|
/**
|
|
1583
|
-
*
|
|
1579
|
+
* This endpoint returns the printed labels for the order.
|
|
1584
1580
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1585
1581
|
*/
|
|
1586
|
-
|
|
1582
|
+
getLabelsPdf(orderId, request, requestOptions) {
|
|
1587
1583
|
var _a;
|
|
1588
1584
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1585
|
+
const { numberOfLabels, collectionDate } = request;
|
|
1586
|
+
const _queryParams = {};
|
|
1587
|
+
if (numberOfLabels != null) {
|
|
1588
|
+
_queryParams["number_of_labels"] = numberOfLabels.toString();
|
|
1589
|
+
}
|
|
1590
|
+
_queryParams["collection_date"] = collectionDate.toISOString();
|
|
1589
1591
|
const _response = yield core.fetcher({
|
|
1590
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/
|
|
1592
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/labels/pdf`),
|
|
1591
1593
|
method: "GET",
|
|
1592
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1594
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1593
1595
|
contentType: "application/json",
|
|
1596
|
+
queryParameters: _queryParams,
|
|
1594
1597
|
requestType: "json",
|
|
1595
1598
|
responseType: "streaming",
|
|
1596
1599
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1632,25 +1635,57 @@ class LabTests {
|
|
|
1632
1635
|
});
|
|
1633
1636
|
}
|
|
1634
1637
|
/**
|
|
1635
|
-
*
|
|
1638
|
+
* @param {Vital.LabTestsGetPscAppointmentAvailabilityRequest} request
|
|
1639
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1640
|
+
*
|
|
1636
1641
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1642
|
+
*
|
|
1643
|
+
* @example
|
|
1644
|
+
* await client.labTests.getPscAppointmentAvailability({
|
|
1645
|
+
* lab: "quest"
|
|
1646
|
+
* })
|
|
1637
1647
|
*/
|
|
1638
|
-
|
|
1648
|
+
getPscAppointmentAvailability(request, requestOptions) {
|
|
1639
1649
|
var _a;
|
|
1640
1650
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1651
|
+
const { lab, startDate, siteCodes, zipCode, radius } = request;
|
|
1652
|
+
const _queryParams = {};
|
|
1653
|
+
_queryParams["lab"] = lab;
|
|
1654
|
+
if (startDate != null) {
|
|
1655
|
+
_queryParams["start_date"] = startDate;
|
|
1656
|
+
}
|
|
1657
|
+
if (siteCodes != null) {
|
|
1658
|
+
if (Array.isArray(siteCodes)) {
|
|
1659
|
+
_queryParams["site_codes"] = siteCodes.map((item) => item);
|
|
1660
|
+
}
|
|
1661
|
+
else {
|
|
1662
|
+
_queryParams["site_codes"] = siteCodes;
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
if (zipCode != null) {
|
|
1666
|
+
_queryParams["zip_code"] = zipCode;
|
|
1667
|
+
}
|
|
1668
|
+
if (radius != null) {
|
|
1669
|
+
_queryParams["radius"] = radius;
|
|
1670
|
+
}
|
|
1641
1671
|
const _response = yield core.fetcher({
|
|
1642
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1643
|
-
method: "
|
|
1644
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1672
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/psc/appointment/availability"),
|
|
1673
|
+
method: "POST",
|
|
1674
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1645
1675
|
contentType: "application/json",
|
|
1676
|
+
queryParameters: _queryParams,
|
|
1646
1677
|
requestType: "json",
|
|
1647
|
-
responseType: "streaming",
|
|
1648
1678
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1649
1679
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1650
1680
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1651
1681
|
});
|
|
1652
1682
|
if (_response.ok) {
|
|
1653
|
-
return _response.body
|
|
1683
|
+
return serializers.AppointmentAvailabilitySlots.parseOrThrow(_response.body, {
|
|
1684
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1685
|
+
allowUnrecognizedUnionMembers: true,
|
|
1686
|
+
allowUnrecognizedEnumValues: true,
|
|
1687
|
+
breadcrumbsPrefix: ["response"],
|
|
1688
|
+
});
|
|
1654
1689
|
}
|
|
1655
1690
|
if (_response.error.reason === "status-code") {
|
|
1656
1691
|
switch (_response.error.statusCode) {
|
|
@@ -1684,31 +1719,33 @@ class LabTests {
|
|
|
1684
1719
|
});
|
|
1685
1720
|
}
|
|
1686
1721
|
/**
|
|
1687
|
-
* GET individual order by ID.
|
|
1688
|
-
*
|
|
1689
1722
|
* @param {string} orderId - Your Order ID.
|
|
1723
|
+
* @param {Vital.AppointmentBookingRequest} request
|
|
1690
1724
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1691
1725
|
*
|
|
1692
1726
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1693
1727
|
*
|
|
1694
1728
|
* @example
|
|
1695
|
-
* await client.labTests.
|
|
1729
|
+
* await client.labTests.bookPscAppointment("order_id", {
|
|
1730
|
+
* bookingKey: "booking_key"
|
|
1731
|
+
* })
|
|
1696
1732
|
*/
|
|
1697
|
-
|
|
1733
|
+
bookPscAppointment(orderId, request, requestOptions) {
|
|
1698
1734
|
var _a;
|
|
1699
1735
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1700
1736
|
const _response = yield core.fetcher({
|
|
1701
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}`),
|
|
1702
|
-
method: "
|
|
1703
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1737
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/appointment/book`),
|
|
1738
|
+
method: "POST",
|
|
1739
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1704
1740
|
contentType: "application/json",
|
|
1705
1741
|
requestType: "json",
|
|
1742
|
+
body: serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1706
1743
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1707
1744
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1708
1745
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1709
1746
|
});
|
|
1710
1747
|
if (_response.ok) {
|
|
1711
|
-
return serializers.
|
|
1748
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
1712
1749
|
unrecognizedObjectKeys: "passthrough",
|
|
1713
1750
|
allowUnrecognizedUnionMembers: true,
|
|
1714
1751
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1747,47 +1784,33 @@ class LabTests {
|
|
|
1747
1784
|
});
|
|
1748
1785
|
}
|
|
1749
1786
|
/**
|
|
1750
|
-
* @param {
|
|
1787
|
+
* @param {string} orderId - Your Order ID.
|
|
1788
|
+
* @param {Vital.AppointmentRescheduleRequest} request
|
|
1751
1789
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1752
1790
|
*
|
|
1753
1791
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1754
1792
|
*
|
|
1755
1793
|
* @example
|
|
1756
|
-
* await client.labTests.
|
|
1757
|
-
*
|
|
1758
|
-
* patientDetails: {
|
|
1759
|
-
* firstName: "first_name",
|
|
1760
|
-
* lastName: "last_name",
|
|
1761
|
-
* dob: "dob",
|
|
1762
|
-
* gender: "female",
|
|
1763
|
-
* phoneNumber: "phone_number",
|
|
1764
|
-
* email: "email"
|
|
1765
|
-
* },
|
|
1766
|
-
* patientAddress: {
|
|
1767
|
-
* firstLine: "first_line",
|
|
1768
|
-
* city: "city",
|
|
1769
|
-
* state: "state",
|
|
1770
|
-
* zip: "zip",
|
|
1771
|
-
* country: "country"
|
|
1772
|
-
* }
|
|
1794
|
+
* await client.labTests.reschedulePscAppointment("order_id", {
|
|
1795
|
+
* bookingKey: "booking_key"
|
|
1773
1796
|
* })
|
|
1774
1797
|
*/
|
|
1775
|
-
|
|
1798
|
+
reschedulePscAppointment(orderId, request, requestOptions) {
|
|
1776
1799
|
var _a;
|
|
1777
1800
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1778
1801
|
const _response = yield core.fetcher({
|
|
1779
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1780
|
-
method: "
|
|
1781
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1802
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/appointment/reschedule`),
|
|
1803
|
+
method: "PATCH",
|
|
1804
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1782
1805
|
contentType: "application/json",
|
|
1783
1806
|
requestType: "json",
|
|
1784
|
-
body: serializers.
|
|
1807
|
+
body: serializers.AppointmentRescheduleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1785
1808
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1786
1809
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1787
1810
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1788
1811
|
});
|
|
1789
1812
|
if (_response.ok) {
|
|
1790
|
-
return serializers.
|
|
1813
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
1791
1814
|
unrecognizedObjectKeys: "passthrough",
|
|
1792
1815
|
allowUnrecognizedUnionMembers: true,
|
|
1793
1816
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1826,52 +1849,35 @@ class LabTests {
|
|
|
1826
1849
|
});
|
|
1827
1850
|
}
|
|
1828
1851
|
/**
|
|
1829
|
-
* @param {
|
|
1852
|
+
* @param {string} orderId - Your Order ID.
|
|
1853
|
+
* @param {Vital.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest} request
|
|
1830
1854
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1831
1855
|
*
|
|
1832
1856
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1833
1857
|
*
|
|
1834
1858
|
* @example
|
|
1835
|
-
* await client.labTests.
|
|
1836
|
-
*
|
|
1837
|
-
* billingType: "client_bill",
|
|
1838
|
-
* orderSet: {},
|
|
1839
|
-
* collectionMethod: "testkit",
|
|
1840
|
-
* patientDetails: {
|
|
1841
|
-
* firstName: "first_name",
|
|
1842
|
-
* lastName: "last_name",
|
|
1843
|
-
* dob: "dob",
|
|
1844
|
-
* gender: "female",
|
|
1845
|
-
* phoneNumber: "phone_number",
|
|
1846
|
-
* email: "email"
|
|
1847
|
-
* },
|
|
1848
|
-
* patientAddress: {
|
|
1849
|
-
* receiverName: "receiver_name",
|
|
1850
|
-
* firstLine: "first_line",
|
|
1851
|
-
* city: "city",
|
|
1852
|
-
* state: "state",
|
|
1853
|
-
* zip: "zip",
|
|
1854
|
-
* country: "country"
|
|
1855
|
-
* },
|
|
1856
|
-
* sampleId: "sample_id"
|
|
1859
|
+
* await client.labTests.cancelPscAppointment("order_id", {
|
|
1860
|
+
* cancellationReasonId: "cancellationReasonId"
|
|
1857
1861
|
* })
|
|
1858
1862
|
*/
|
|
1859
|
-
|
|
1863
|
+
cancelPscAppointment(orderId, request, requestOptions) {
|
|
1860
1864
|
var _a;
|
|
1861
1865
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1862
1866
|
const _response = yield core.fetcher({
|
|
1863
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1864
|
-
method: "
|
|
1865
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1867
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/appointment/cancel`),
|
|
1868
|
+
method: "PATCH",
|
|
1869
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1866
1870
|
contentType: "application/json",
|
|
1867
1871
|
requestType: "json",
|
|
1868
|
-
body: serializers.
|
|
1872
|
+
body: serializers.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest.jsonOrThrow(request, {
|
|
1873
|
+
unrecognizedObjectKeys: "strip",
|
|
1874
|
+
}),
|
|
1869
1875
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1870
1876
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1871
1877
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1872
1878
|
});
|
|
1873
1879
|
if (_response.ok) {
|
|
1874
|
-
return serializers.
|
|
1880
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
1875
1881
|
unrecognizedObjectKeys: "passthrough",
|
|
1876
1882
|
allowUnrecognizedUnionMembers: true,
|
|
1877
1883
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1910,7 +1916,55 @@ class LabTests {
|
|
|
1910
1916
|
});
|
|
1911
1917
|
}
|
|
1912
1918
|
/**
|
|
1913
|
-
*
|
|
1919
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1920
|
+
*
|
|
1921
|
+
* @example
|
|
1922
|
+
* await client.labTests.getPscAppointmentCancellationReason()
|
|
1923
|
+
*/
|
|
1924
|
+
getPscAppointmentCancellationReason(requestOptions) {
|
|
1925
|
+
var _a;
|
|
1926
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1927
|
+
const _response = yield core.fetcher({
|
|
1928
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/psc/appointment/cancellation-reasons"),
|
|
1929
|
+
method: "GET",
|
|
1930
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1931
|
+
contentType: "application/json",
|
|
1932
|
+
requestType: "json",
|
|
1933
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1934
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1935
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1936
|
+
});
|
|
1937
|
+
if (_response.ok) {
|
|
1938
|
+
return serializers.labTests.getPscAppointmentCancellationReason.Response.parseOrThrow(_response.body, {
|
|
1939
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1940
|
+
allowUnrecognizedUnionMembers: true,
|
|
1941
|
+
allowUnrecognizedEnumValues: true,
|
|
1942
|
+
breadcrumbsPrefix: ["response"],
|
|
1943
|
+
});
|
|
1944
|
+
}
|
|
1945
|
+
if (_response.error.reason === "status-code") {
|
|
1946
|
+
throw new errors.VitalError({
|
|
1947
|
+
statusCode: _response.error.statusCode,
|
|
1948
|
+
body: _response.error.body,
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
switch (_response.error.reason) {
|
|
1952
|
+
case "non-json":
|
|
1953
|
+
throw new errors.VitalError({
|
|
1954
|
+
statusCode: _response.error.statusCode,
|
|
1955
|
+
body: _response.error.rawBody,
|
|
1956
|
+
});
|
|
1957
|
+
case "timeout":
|
|
1958
|
+
throw new errors.VitalTimeoutError();
|
|
1959
|
+
case "unknown":
|
|
1960
|
+
throw new errors.VitalError({
|
|
1961
|
+
message: _response.error.errorMessage,
|
|
1962
|
+
});
|
|
1963
|
+
}
|
|
1964
|
+
});
|
|
1965
|
+
}
|
|
1966
|
+
/**
|
|
1967
|
+
* Get the appointment associated with an order.
|
|
1914
1968
|
*
|
|
1915
1969
|
* @param {string} orderId - Your Order ID.
|
|
1916
1970
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -1918,15 +1972,15 @@ class LabTests {
|
|
|
1918
1972
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1919
1973
|
*
|
|
1920
1974
|
* @example
|
|
1921
|
-
* await client.labTests.
|
|
1975
|
+
* await client.labTests.getPscAppointment("order_id")
|
|
1922
1976
|
*/
|
|
1923
|
-
|
|
1977
|
+
getPscAppointment(orderId, requestOptions) {
|
|
1924
1978
|
var _a;
|
|
1925
1979
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1926
1980
|
const _response = yield core.fetcher({
|
|
1927
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/
|
|
1928
|
-
method: "
|
|
1929
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1981
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/psc/appointment`),
|
|
1982
|
+
method: "GET",
|
|
1983
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1930
1984
|
contentType: "application/json",
|
|
1931
1985
|
requestType: "json",
|
|
1932
1986
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1934,7 +1988,7 @@ class LabTests {
|
|
|
1934
1988
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1935
1989
|
});
|
|
1936
1990
|
if (_response.ok) {
|
|
1937
|
-
return serializers.
|
|
1991
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
1938
1992
|
unrecognizedObjectKeys: "passthrough",
|
|
1939
1993
|
allowUnrecognizedUnionMembers: true,
|
|
1940
1994
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1973,42 +2027,19 @@ class LabTests {
|
|
|
1973
2027
|
});
|
|
1974
2028
|
}
|
|
1975
2029
|
/**
|
|
1976
|
-
*
|
|
1977
|
-
*
|
|
1978
|
-
* @param {string} orderId
|
|
1979
|
-
* @param {Vital.LabTestsSimulateOrderProcessRequest} request
|
|
1980
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1981
|
-
*
|
|
2030
|
+
* GET collection instructions for an order
|
|
1982
2031
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1983
|
-
*
|
|
1984
|
-
* @example
|
|
1985
|
-
* await client.labTests.simulateOrderProcess("order_id", {
|
|
1986
|
-
* body: undefined
|
|
1987
|
-
* })
|
|
1988
2032
|
*/
|
|
1989
|
-
|
|
2033
|
+
getOrderCollectionInstructionPdf(orderId, requestOptions) {
|
|
1990
2034
|
var _a;
|
|
1991
2035
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1992
|
-
const { finalStatus, delay, body: _body } = request;
|
|
1993
|
-
const _queryParams = {};
|
|
1994
|
-
if (finalStatus != null) {
|
|
1995
|
-
_queryParams["final_status"] = finalStatus;
|
|
1996
|
-
}
|
|
1997
|
-
if (delay != null) {
|
|
1998
|
-
_queryParams["delay"] = delay.toString();
|
|
1999
|
-
}
|
|
2000
2036
|
const _response = yield core.fetcher({
|
|
2001
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/
|
|
2002
|
-
method: "
|
|
2003
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2037
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/collection_instruction_pdf`),
|
|
2038
|
+
method: "GET",
|
|
2039
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2004
2040
|
contentType: "application/json",
|
|
2005
|
-
queryParameters: _queryParams,
|
|
2006
2041
|
requestType: "json",
|
|
2007
|
-
|
|
2008
|
-
? serializers.labTests.simulateOrderProcess.Request.jsonOrThrow(_body, {
|
|
2009
|
-
unrecognizedObjectKeys: "strip",
|
|
2010
|
-
})
|
|
2011
|
-
: undefined,
|
|
2042
|
+
responseType: "streaming",
|
|
2012
2043
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2013
2044
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2014
2045
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2048,36 +2079,25 @@ class LabTests {
|
|
|
2048
2079
|
});
|
|
2049
2080
|
}
|
|
2050
2081
|
/**
|
|
2051
|
-
*
|
|
2052
|
-
*
|
|
2053
|
-
* @param {string} orderId - Your Order ID.
|
|
2054
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2055
|
-
*
|
|
2082
|
+
* GET requisition pdf for an order
|
|
2056
2083
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2057
|
-
*
|
|
2058
|
-
* @example
|
|
2059
|
-
* await client.labTests.updateOnSiteCollectionOrderDrawCompleted("order_id")
|
|
2060
2084
|
*/
|
|
2061
|
-
|
|
2085
|
+
getOrderRequistionPdf(orderId, requestOptions) {
|
|
2062
2086
|
var _a;
|
|
2063
2087
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2064
2088
|
const _response = yield core.fetcher({
|
|
2065
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/
|
|
2066
|
-
method: "
|
|
2067
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2089
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/requisition/pdf`),
|
|
2090
|
+
method: "GET",
|
|
2091
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2068
2092
|
contentType: "application/json",
|
|
2069
2093
|
requestType: "json",
|
|
2094
|
+
responseType: "streaming",
|
|
2070
2095
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2071
2096
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2072
2097
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2073
2098
|
});
|
|
2074
2099
|
if (_response.ok) {
|
|
2075
|
-
return
|
|
2076
|
-
unrecognizedObjectKeys: "passthrough",
|
|
2077
|
-
allowUnrecognizedUnionMembers: true,
|
|
2078
|
-
allowUnrecognizedEnumValues: true,
|
|
2079
|
-
breadcrumbsPrefix: ["response"],
|
|
2080
|
-
});
|
|
2100
|
+
return _response.body;
|
|
2081
2101
|
}
|
|
2082
2102
|
if (_response.error.reason === "status-code") {
|
|
2083
2103
|
switch (_response.error.statusCode) {
|
|
@@ -2111,76 +2131,25 @@ class LabTests {
|
|
|
2111
2131
|
});
|
|
2112
2132
|
}
|
|
2113
2133
|
/**
|
|
2114
|
-
* GET
|
|
2115
|
-
*
|
|
2116
|
-
* @param {Vital.LabTestsGetRequest} request
|
|
2117
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2118
|
-
*
|
|
2134
|
+
* GET ABN pdf for an order
|
|
2119
2135
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2120
|
-
*
|
|
2121
|
-
* @example
|
|
2122
|
-
* await client.labTests.get()
|
|
2123
2136
|
*/
|
|
2124
|
-
|
|
2137
|
+
getOrderAbnPdf(orderId, requestOptions) {
|
|
2125
2138
|
var _a;
|
|
2126
2139
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2127
|
-
const { generationMethod, labSlug, collectionMethod, status, markerIds, providerIds, name, orderKey, orderDirection, } = request;
|
|
2128
|
-
const _queryParams = {};
|
|
2129
|
-
if (generationMethod != null) {
|
|
2130
|
-
_queryParams["generation_method"] = generationMethod;
|
|
2131
|
-
}
|
|
2132
|
-
if (labSlug != null) {
|
|
2133
|
-
_queryParams["lab_slug"] = labSlug;
|
|
2134
|
-
}
|
|
2135
|
-
if (collectionMethod != null) {
|
|
2136
|
-
_queryParams["collection_method"] = collectionMethod;
|
|
2137
|
-
}
|
|
2138
|
-
if (status != null) {
|
|
2139
|
-
_queryParams["status"] = status;
|
|
2140
|
-
}
|
|
2141
|
-
if (markerIds != null) {
|
|
2142
|
-
if (Array.isArray(markerIds)) {
|
|
2143
|
-
_queryParams["marker_ids"] = markerIds.map((item) => item.toString());
|
|
2144
|
-
}
|
|
2145
|
-
else {
|
|
2146
|
-
_queryParams["marker_ids"] = markerIds.toString();
|
|
2147
|
-
}
|
|
2148
|
-
}
|
|
2149
|
-
if (providerIds != null) {
|
|
2150
|
-
if (Array.isArray(providerIds)) {
|
|
2151
|
-
_queryParams["provider_ids"] = providerIds.map((item) => item);
|
|
2152
|
-
}
|
|
2153
|
-
else {
|
|
2154
|
-
_queryParams["provider_ids"] = providerIds;
|
|
2155
|
-
}
|
|
2156
|
-
}
|
|
2157
|
-
if (name != null) {
|
|
2158
|
-
_queryParams["name"] = name;
|
|
2159
|
-
}
|
|
2160
|
-
if (orderKey != null) {
|
|
2161
|
-
_queryParams["order_key"] = orderKey;
|
|
2162
|
-
}
|
|
2163
|
-
if (orderDirection != null) {
|
|
2164
|
-
_queryParams["order_direction"] = orderDirection;
|
|
2165
|
-
}
|
|
2166
2140
|
const _response = yield core.fetcher({
|
|
2167
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2141
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/abn_pdf`),
|
|
2168
2142
|
method: "GET",
|
|
2169
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2143
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2170
2144
|
contentType: "application/json",
|
|
2171
|
-
queryParameters: _queryParams,
|
|
2172
2145
|
requestType: "json",
|
|
2146
|
+
responseType: "streaming",
|
|
2173
2147
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2174
2148
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2175
2149
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2176
2150
|
});
|
|
2177
2151
|
if (_response.ok) {
|
|
2178
|
-
return
|
|
2179
|
-
unrecognizedObjectKeys: "passthrough",
|
|
2180
|
-
allowUnrecognizedUnionMembers: true,
|
|
2181
|
-
allowUnrecognizedEnumValues: true,
|
|
2182
|
-
breadcrumbsPrefix: ["response"],
|
|
2183
|
-
});
|
|
2152
|
+
return _response.body;
|
|
2184
2153
|
}
|
|
2185
2154
|
if (_response.error.reason === "status-code") {
|
|
2186
2155
|
switch (_response.error.statusCode) {
|
|
@@ -2214,34 +2183,31 @@ class LabTests {
|
|
|
2214
2183
|
});
|
|
2215
2184
|
}
|
|
2216
2185
|
/**
|
|
2217
|
-
*
|
|
2186
|
+
* GET individual order by ID.
|
|
2187
|
+
*
|
|
2188
|
+
* @param {string} orderId - Your Order ID.
|
|
2218
2189
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2219
2190
|
*
|
|
2220
2191
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2221
2192
|
*
|
|
2222
2193
|
* @example
|
|
2223
|
-
* await client.labTests.
|
|
2224
|
-
* name: "name",
|
|
2225
|
-
* method: "testkit",
|
|
2226
|
-
* description: "description"
|
|
2227
|
-
* })
|
|
2194
|
+
* await client.labTests.getOrder("order_id")
|
|
2228
2195
|
*/
|
|
2229
|
-
|
|
2196
|
+
getOrder(orderId, requestOptions) {
|
|
2230
2197
|
var _a;
|
|
2231
2198
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2232
2199
|
const _response = yield core.fetcher({
|
|
2233
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2234
|
-
method: "
|
|
2235
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2200
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}`),
|
|
2201
|
+
method: "GET",
|
|
2202
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2236
2203
|
contentType: "application/json",
|
|
2237
2204
|
requestType: "json",
|
|
2238
|
-
body: serializers.CreateLabTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
2239
2205
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2240
2206
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2241
2207
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2242
2208
|
});
|
|
2243
2209
|
if (_response.ok) {
|
|
2244
|
-
return serializers.
|
|
2210
|
+
return serializers.ClientFacingOrder.parseOrThrow(_response.body, {
|
|
2245
2211
|
unrecognizedObjectKeys: "passthrough",
|
|
2246
2212
|
allowUnrecognizedUnionMembers: true,
|
|
2247
2213
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2280,31 +2246,47 @@ class LabTests {
|
|
|
2280
2246
|
});
|
|
2281
2247
|
}
|
|
2282
2248
|
/**
|
|
2283
|
-
*
|
|
2284
|
-
*
|
|
2285
|
-
* @param {string} labTestId
|
|
2249
|
+
* @param {Vital.CreateOrderRequestCompatible} request
|
|
2286
2250
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2287
2251
|
*
|
|
2288
2252
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2289
2253
|
*
|
|
2290
2254
|
* @example
|
|
2291
|
-
* await client.labTests.
|
|
2255
|
+
* await client.labTests.createOrder({
|
|
2256
|
+
* userId: "user_id",
|
|
2257
|
+
* patientDetails: {
|
|
2258
|
+
* firstName: "first_name",
|
|
2259
|
+
* lastName: "last_name",
|
|
2260
|
+
* dob: "dob",
|
|
2261
|
+
* gender: "female",
|
|
2262
|
+
* phoneNumber: "phone_number",
|
|
2263
|
+
* email: "email"
|
|
2264
|
+
* },
|
|
2265
|
+
* patientAddress: {
|
|
2266
|
+
* firstLine: "first_line",
|
|
2267
|
+
* city: "city",
|
|
2268
|
+
* state: "state",
|
|
2269
|
+
* zip: "zip",
|
|
2270
|
+
* country: "country"
|
|
2271
|
+
* }
|
|
2272
|
+
* })
|
|
2292
2273
|
*/
|
|
2293
|
-
|
|
2274
|
+
createOrder(request, requestOptions) {
|
|
2294
2275
|
var _a;
|
|
2295
2276
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2296
2277
|
const _response = yield core.fetcher({
|
|
2297
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2298
|
-
method: "
|
|
2299
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2278
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order"),
|
|
2279
|
+
method: "POST",
|
|
2280
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2300
2281
|
contentType: "application/json",
|
|
2301
2282
|
requestType: "json",
|
|
2283
|
+
body: serializers.CreateOrderRequestCompatible.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
2302
2284
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2303
2285
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2304
2286
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2305
2287
|
});
|
|
2306
2288
|
if (_response.ok) {
|
|
2307
|
-
return serializers.
|
|
2289
|
+
return serializers.PostOrderResponse.parseOrThrow(_response.body, {
|
|
2308
2290
|
unrecognizedObjectKeys: "passthrough",
|
|
2309
2291
|
allowUnrecognizedUnionMembers: true,
|
|
2310
2292
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2343,31 +2325,52 @@ class LabTests {
|
|
|
2343
2325
|
});
|
|
2344
2326
|
}
|
|
2345
2327
|
/**
|
|
2346
|
-
* @param {
|
|
2347
|
-
* @param {Vital.UpdateLabTestRequest} request
|
|
2328
|
+
* @param {Vital.ImportOrderBody} request
|
|
2348
2329
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2349
2330
|
*
|
|
2350
2331
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2351
2332
|
*
|
|
2352
2333
|
* @example
|
|
2353
|
-
* await client.labTests.
|
|
2334
|
+
* await client.labTests.importOrder({
|
|
2335
|
+
* userId: "user_id",
|
|
2336
|
+
* billingType: "client_bill",
|
|
2337
|
+
* orderSet: {},
|
|
2338
|
+
* collectionMethod: "testkit",
|
|
2339
|
+
* patientDetails: {
|
|
2340
|
+
* firstName: "first_name",
|
|
2341
|
+
* lastName: "last_name",
|
|
2342
|
+
* dob: "dob",
|
|
2343
|
+
* gender: "female",
|
|
2344
|
+
* phoneNumber: "phone_number",
|
|
2345
|
+
* email: "email"
|
|
2346
|
+
* },
|
|
2347
|
+
* patientAddress: {
|
|
2348
|
+
* receiverName: "receiver_name",
|
|
2349
|
+
* firstLine: "first_line",
|
|
2350
|
+
* city: "city",
|
|
2351
|
+
* state: "state",
|
|
2352
|
+
* zip: "zip",
|
|
2353
|
+
* country: "country"
|
|
2354
|
+
* },
|
|
2355
|
+
* sampleId: "sample_id"
|
|
2356
|
+
* })
|
|
2354
2357
|
*/
|
|
2355
|
-
|
|
2358
|
+
importOrder(request, requestOptions) {
|
|
2356
2359
|
var _a;
|
|
2357
2360
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2358
2361
|
const _response = yield core.fetcher({
|
|
2359
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2360
|
-
method: "
|
|
2361
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2362
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/import"),
|
|
2363
|
+
method: "POST",
|
|
2364
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2362
2365
|
contentType: "application/json",
|
|
2363
2366
|
requestType: "json",
|
|
2364
|
-
body: serializers.
|
|
2367
|
+
body: serializers.ImportOrderBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
2365
2368
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2366
2369
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2367
2370
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2368
2371
|
});
|
|
2369
2372
|
if (_response.ok) {
|
|
2370
|
-
return serializers.
|
|
2373
|
+
return serializers.PostOrderResponse.parseOrThrow(_response.body, {
|
|
2371
2374
|
unrecognizedObjectKeys: "passthrough",
|
|
2372
2375
|
allowUnrecognizedUnionMembers: true,
|
|
2373
2376
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2406,54 +2409,31 @@ class LabTests {
|
|
|
2406
2409
|
});
|
|
2407
2410
|
}
|
|
2408
2411
|
/**
|
|
2409
|
-
*
|
|
2412
|
+
* POST cancel order
|
|
2410
2413
|
*
|
|
2411
|
-
* @param {
|
|
2414
|
+
* @param {string} orderId - Your Order ID.
|
|
2412
2415
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2413
2416
|
*
|
|
2414
2417
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2415
2418
|
*
|
|
2416
2419
|
* @example
|
|
2417
|
-
* await client.labTests.
|
|
2420
|
+
* await client.labTests.cancelOrder("order_id")
|
|
2418
2421
|
*/
|
|
2419
|
-
|
|
2422
|
+
cancelOrder(orderId, requestOptions) {
|
|
2420
2423
|
var _a;
|
|
2421
2424
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2422
|
-
const { labId, name, aLaCarteEnabled, page, size } = request;
|
|
2423
|
-
const _queryParams = {};
|
|
2424
|
-
if (labId != null) {
|
|
2425
|
-
if (Array.isArray(labId)) {
|
|
2426
|
-
_queryParams["lab_id"] = labId.map((item) => item.toString());
|
|
2427
|
-
}
|
|
2428
|
-
else {
|
|
2429
|
-
_queryParams["lab_id"] = labId.toString();
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
if (name != null) {
|
|
2433
|
-
_queryParams["name"] = name;
|
|
2434
|
-
}
|
|
2435
|
-
if (aLaCarteEnabled != null) {
|
|
2436
|
-
_queryParams["a_la_carte_enabled"] = aLaCarteEnabled.toString();
|
|
2437
|
-
}
|
|
2438
|
-
if (page != null) {
|
|
2439
|
-
_queryParams["page"] = page.toString();
|
|
2440
|
-
}
|
|
2441
|
-
if (size != null) {
|
|
2442
|
-
_queryParams["size"] = size.toString();
|
|
2443
|
-
}
|
|
2444
2425
|
const _response = yield core.fetcher({
|
|
2445
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2446
|
-
method: "
|
|
2447
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2426
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/cancel`),
|
|
2427
|
+
method: "POST",
|
|
2428
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2448
2429
|
contentType: "application/json",
|
|
2449
|
-
queryParameters: _queryParams,
|
|
2450
2430
|
requestType: "json",
|
|
2451
2431
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2452
2432
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2453
2433
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2454
2434
|
});
|
|
2455
2435
|
if (_response.ok) {
|
|
2456
|
-
return serializers.
|
|
2436
|
+
return serializers.PostOrderResponse.parseOrThrow(_response.body, {
|
|
2457
2437
|
unrecognizedObjectKeys: "passthrough",
|
|
2458
2438
|
allowUnrecognizedUnionMembers: true,
|
|
2459
2439
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2492,46 +2472,48 @@ class LabTests {
|
|
|
2492
2472
|
});
|
|
2493
2473
|
}
|
|
2494
2474
|
/**
|
|
2495
|
-
*
|
|
2475
|
+
* Get available test kits.
|
|
2476
|
+
*
|
|
2477
|
+
* @param {string} orderId
|
|
2478
|
+
* @param {Vital.LabTestsSimulateOrderProcessRequest} request
|
|
2496
2479
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2497
2480
|
*
|
|
2498
2481
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2499
2482
|
*
|
|
2500
2483
|
* @example
|
|
2501
|
-
* await client.labTests.
|
|
2502
|
-
* body:
|
|
2484
|
+
* await client.labTests.simulateOrderProcess("order_id", {
|
|
2485
|
+
* body: undefined
|
|
2503
2486
|
* })
|
|
2504
2487
|
*/
|
|
2505
|
-
|
|
2488
|
+
simulateOrderProcess(orderId, request = {}, requestOptions) {
|
|
2506
2489
|
var _a;
|
|
2507
2490
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2508
|
-
const {
|
|
2491
|
+
const { finalStatus, delay, body: _body } = request;
|
|
2509
2492
|
const _queryParams = {};
|
|
2510
|
-
if (
|
|
2511
|
-
_queryParams["
|
|
2493
|
+
if (finalStatus != null) {
|
|
2494
|
+
_queryParams["final_status"] = finalStatus;
|
|
2512
2495
|
}
|
|
2513
|
-
if (
|
|
2514
|
-
_queryParams["
|
|
2496
|
+
if (delay != null) {
|
|
2497
|
+
_queryParams["delay"] = delay.toString();
|
|
2515
2498
|
}
|
|
2516
2499
|
const _response = yield core.fetcher({
|
|
2517
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2500
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/test`),
|
|
2518
2501
|
method: "POST",
|
|
2519
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2502
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2520
2503
|
contentType: "application/json",
|
|
2521
2504
|
queryParameters: _queryParams,
|
|
2522
2505
|
requestType: "json",
|
|
2523
|
-
body:
|
|
2506
|
+
body: _body != null
|
|
2507
|
+
? serializers.labTests.simulateOrderProcess.Request.jsonOrThrow(_body, {
|
|
2508
|
+
unrecognizedObjectKeys: "strip",
|
|
2509
|
+
})
|
|
2510
|
+
: undefined,
|
|
2524
2511
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2525
2512
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2526
2513
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2527
2514
|
});
|
|
2528
2515
|
if (_response.ok) {
|
|
2529
|
-
return
|
|
2530
|
-
unrecognizedObjectKeys: "passthrough",
|
|
2531
|
-
allowUnrecognizedUnionMembers: true,
|
|
2532
|
-
allowUnrecognizedEnumValues: true,
|
|
2533
|
-
breadcrumbsPrefix: ["response"],
|
|
2534
|
-
});
|
|
2516
|
+
return _response.body;
|
|
2535
2517
|
}
|
|
2536
2518
|
if (_response.error.reason === "status-code") {
|
|
2537
2519
|
switch (_response.error.statusCode) {
|
|
@@ -2565,39 +2547,31 @@ class LabTests {
|
|
|
2565
2547
|
});
|
|
2566
2548
|
}
|
|
2567
2549
|
/**
|
|
2568
|
-
*
|
|
2569
|
-
*
|
|
2550
|
+
* PATCH update on site collection order when draw is completed
|
|
2551
|
+
*
|
|
2552
|
+
* @param {string} orderId - Your Order ID.
|
|
2570
2553
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2571
2554
|
*
|
|
2572
2555
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2573
2556
|
*
|
|
2574
2557
|
* @example
|
|
2575
|
-
* await client.labTests.
|
|
2558
|
+
* await client.labTests.updateOnSiteCollectionOrderDrawCompleted("order_id")
|
|
2576
2559
|
*/
|
|
2577
|
-
|
|
2560
|
+
updateOnSiteCollectionOrderDrawCompleted(orderId, requestOptions) {
|
|
2578
2561
|
var _a;
|
|
2579
2562
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2580
|
-
const { page, size } = request;
|
|
2581
|
-
const _queryParams = {};
|
|
2582
|
-
if (page != null) {
|
|
2583
|
-
_queryParams["page"] = page.toString();
|
|
2584
|
-
}
|
|
2585
|
-
if (size != null) {
|
|
2586
|
-
_queryParams["size"] = size.toString();
|
|
2587
|
-
}
|
|
2588
2563
|
const _response = yield core.fetcher({
|
|
2589
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
2590
|
-
method: "
|
|
2591
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2564
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${encodeURIComponent(orderId)}/draw_completed`),
|
|
2565
|
+
method: "PATCH",
|
|
2566
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2592
2567
|
contentType: "application/json",
|
|
2593
|
-
queryParameters: _queryParams,
|
|
2594
2568
|
requestType: "json",
|
|
2595
2569
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2596
2570
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2597
2571
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2598
2572
|
});
|
|
2599
2573
|
if (_response.ok) {
|
|
2600
|
-
return serializers.
|
|
2574
|
+
return serializers.PostOrderResponse.parseOrThrow(_response.body, {
|
|
2601
2575
|
unrecognizedObjectKeys: "passthrough",
|
|
2602
2576
|
allowUnrecognizedUnionMembers: true,
|
|
2603
2577
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2636,32 +2610,108 @@ class LabTests {
|
|
|
2636
2610
|
});
|
|
2637
2611
|
}
|
|
2638
2612
|
/**
|
|
2639
|
-
* GET
|
|
2613
|
+
* GET many orders with filters.
|
|
2640
2614
|
*
|
|
2641
|
-
* @param {
|
|
2642
|
-
* @param {number} labId
|
|
2615
|
+
* @param {Vital.LabTestsGetOrdersRequest} request
|
|
2643
2616
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2644
2617
|
*
|
|
2645
2618
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2646
2619
|
*
|
|
2647
2620
|
* @example
|
|
2648
|
-
* await client.labTests.
|
|
2621
|
+
* await client.labTests.getOrders()
|
|
2649
2622
|
*/
|
|
2650
|
-
|
|
2623
|
+
getOrders(request = {}, requestOptions) {
|
|
2651
2624
|
var _a;
|
|
2652
2625
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2626
|
+
const { searchInput, startDate, endDate, updatedStartDate, updatedEndDate, status, orderKey, orderDirection, orderType, isCritical, interpretation, orderActivationTypes, userId, patientName, shippingRecipientName, orderIds, page, size, } = request;
|
|
2627
|
+
const _queryParams = {};
|
|
2628
|
+
if (searchInput != null) {
|
|
2629
|
+
_queryParams["search_input"] = searchInput;
|
|
2630
|
+
}
|
|
2631
|
+
if (startDate != null) {
|
|
2632
|
+
_queryParams["start_date"] = startDate.toISOString();
|
|
2633
|
+
}
|
|
2634
|
+
if (endDate != null) {
|
|
2635
|
+
_queryParams["end_date"] = endDate.toISOString();
|
|
2636
|
+
}
|
|
2637
|
+
if (updatedStartDate != null) {
|
|
2638
|
+
_queryParams["updated_start_date"] = updatedStartDate.toISOString();
|
|
2639
|
+
}
|
|
2640
|
+
if (updatedEndDate != null) {
|
|
2641
|
+
_queryParams["updated_end_date"] = updatedEndDate.toISOString();
|
|
2642
|
+
}
|
|
2643
|
+
if (status != null) {
|
|
2644
|
+
if (Array.isArray(status)) {
|
|
2645
|
+
_queryParams["status"] = status.map((item) => item);
|
|
2646
|
+
}
|
|
2647
|
+
else {
|
|
2648
|
+
_queryParams["status"] = status;
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
if (orderKey != null) {
|
|
2652
|
+
_queryParams["order_key"] = orderKey;
|
|
2653
|
+
}
|
|
2654
|
+
if (orderDirection != null) {
|
|
2655
|
+
_queryParams["order_direction"] = orderDirection;
|
|
2656
|
+
}
|
|
2657
|
+
if (orderType != null) {
|
|
2658
|
+
if (Array.isArray(orderType)) {
|
|
2659
|
+
_queryParams["order_type"] = orderType.map((item) => item);
|
|
2660
|
+
}
|
|
2661
|
+
else {
|
|
2662
|
+
_queryParams["order_type"] = orderType;
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
if (isCritical != null) {
|
|
2666
|
+
_queryParams["is_critical"] = isCritical.toString();
|
|
2667
|
+
}
|
|
2668
|
+
if (interpretation != null) {
|
|
2669
|
+
_queryParams["interpretation"] = interpretation;
|
|
2670
|
+
}
|
|
2671
|
+
if (orderActivationTypes != null) {
|
|
2672
|
+
if (Array.isArray(orderActivationTypes)) {
|
|
2673
|
+
_queryParams["order_activation_types"] = orderActivationTypes.map((item) => item);
|
|
2674
|
+
}
|
|
2675
|
+
else {
|
|
2676
|
+
_queryParams["order_activation_types"] = orderActivationTypes;
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
if (userId != null) {
|
|
2680
|
+
_queryParams["user_id"] = userId;
|
|
2681
|
+
}
|
|
2682
|
+
if (patientName != null) {
|
|
2683
|
+
_queryParams["patient_name"] = patientName;
|
|
2684
|
+
}
|
|
2685
|
+
if (shippingRecipientName != null) {
|
|
2686
|
+
_queryParams["shipping_recipient_name"] = shippingRecipientName;
|
|
2687
|
+
}
|
|
2688
|
+
if (orderIds != null) {
|
|
2689
|
+
if (Array.isArray(orderIds)) {
|
|
2690
|
+
_queryParams["order_ids"] = orderIds.map((item) => item);
|
|
2691
|
+
}
|
|
2692
|
+
else {
|
|
2693
|
+
_queryParams["order_ids"] = orderIds;
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
if (page != null) {
|
|
2697
|
+
_queryParams["page"] = page.toString();
|
|
2698
|
+
}
|
|
2699
|
+
if (size != null) {
|
|
2700
|
+
_queryParams["size"] = size.toString();
|
|
2701
|
+
}
|
|
2653
2702
|
const _response = yield core.fetcher({
|
|
2654
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2703
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/orders"),
|
|
2655
2704
|
method: "GET",
|
|
2656
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2705
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2657
2706
|
contentType: "application/json",
|
|
2707
|
+
queryParameters: _queryParams,
|
|
2658
2708
|
requestType: "json",
|
|
2659
2709
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2660
2710
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2661
2711
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2662
2712
|
});
|
|
2663
2713
|
if (_response.ok) {
|
|
2664
|
-
return serializers.
|
|
2714
|
+
return serializers.GetOrdersResponse.parseOrThrow(_response.body, {
|
|
2665
2715
|
unrecognizedObjectKeys: "passthrough",
|
|
2666
2716
|
allowUnrecognizedUnionMembers: true,
|
|
2667
2717
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2699,56 +2749,6 @@ class LabTests {
|
|
|
2699
2749
|
}
|
|
2700
2750
|
});
|
|
2701
2751
|
}
|
|
2702
|
-
/**
|
|
2703
|
-
* GET all the labs.
|
|
2704
|
-
*
|
|
2705
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2706
|
-
*
|
|
2707
|
-
* @example
|
|
2708
|
-
* await client.labTests.getLabs()
|
|
2709
|
-
*/
|
|
2710
|
-
getLabs(requestOptions) {
|
|
2711
|
-
var _a;
|
|
2712
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2713
|
-
const _response = yield core.fetcher({
|
|
2714
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_tests/labs"),
|
|
2715
|
-
method: "GET",
|
|
2716
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.384", "User-Agent": "@tryvital/vital-node/3.1.384", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2717
|
-
contentType: "application/json",
|
|
2718
|
-
requestType: "json",
|
|
2719
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2720
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2721
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2722
|
-
});
|
|
2723
|
-
if (_response.ok) {
|
|
2724
|
-
return serializers.labTests.getLabs.Response.parseOrThrow(_response.body, {
|
|
2725
|
-
unrecognizedObjectKeys: "passthrough",
|
|
2726
|
-
allowUnrecognizedUnionMembers: true,
|
|
2727
|
-
allowUnrecognizedEnumValues: true,
|
|
2728
|
-
breadcrumbsPrefix: ["response"],
|
|
2729
|
-
});
|
|
2730
|
-
}
|
|
2731
|
-
if (_response.error.reason === "status-code") {
|
|
2732
|
-
throw new errors.VitalError({
|
|
2733
|
-
statusCode: _response.error.statusCode,
|
|
2734
|
-
body: _response.error.body,
|
|
2735
|
-
});
|
|
2736
|
-
}
|
|
2737
|
-
switch (_response.error.reason) {
|
|
2738
|
-
case "non-json":
|
|
2739
|
-
throw new errors.VitalError({
|
|
2740
|
-
statusCode: _response.error.statusCode,
|
|
2741
|
-
body: _response.error.rawBody,
|
|
2742
|
-
});
|
|
2743
|
-
case "timeout":
|
|
2744
|
-
throw new errors.VitalTimeoutError();
|
|
2745
|
-
case "unknown":
|
|
2746
|
-
throw new errors.VitalError({
|
|
2747
|
-
message: _response.error.errorMessage,
|
|
2748
|
-
});
|
|
2749
|
-
}
|
|
2750
|
-
});
|
|
2751
|
-
}
|
|
2752
2752
|
/**
|
|
2753
2753
|
* GET lab tests the team has access to as a paginated list.
|
|
2754
2754
|
*
|
|
@@ -2811,7 +2811,7 @@ class LabTests {
|
|
|
2811
2811
|
const _response = yield core.fetcher({
|
|
2812
2812
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/lab_test"),
|
|
2813
2813
|
method: "GET",
|
|
2814
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2814
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2815
2815
|
contentType: "application/json",
|
|
2816
2816
|
queryParameters: _queryParams,
|
|
2817
2817
|
requestType: "json",
|
|
@@ -2867,7 +2867,7 @@ class LabTests {
|
|
|
2867
2867
|
const _response = yield core.fetcher({
|
|
2868
2868
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/lab_test/${encodeURIComponent(labTestId)}/collection_instruction_pdf`),
|
|
2869
2869
|
method: "GET",
|
|
2870
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2870
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.386", "User-Agent": "@tryvital/vital-node/3.1.386", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2871
2871
|
contentType: "application/json",
|
|
2872
2872
|
requestType: "json",
|
|
2873
2873
|
responseType: "streaming",
|