@tryvital/vital-node 3.1.392 → 3.1.394
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 +12 -12
- package/Client.js +18 -18
- 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 +9 -9
- package/api/resources/index.js +10 -10
- 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 +122 -122
- package/api/resources/labTests/client/Client.js +788 -788
- 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/api/types/ClientFacingDeviceSourceType.d.ts +2 -1
- package/api/types/ClientFacingDeviceSourceType.js +1 -0
- package/api/types/ClientFacingElectrocardiogramSourceType.d.ts +2 -1
- package/api/types/ClientFacingElectrocardiogramSourceType.js +1 -0
- package/api/types/ClientFacingMenstrualCycleSourceType.d.ts +2 -1
- package/api/types/ClientFacingMenstrualCycleSourceType.js +1 -0
- package/api/types/ClientFacingSleepCycleSourceType.d.ts +2 -1
- package/api/types/ClientFacingSleepCycleSourceType.js +1 -0
- package/dist/Client.d.ts +12 -12
- package/dist/Client.js +18 -18
- 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 +9 -9
- package/dist/api/resources/index.js +10 -10
- 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 +122 -122
- package/dist/api/resources/labTests/client/Client.js +788 -788
- 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/api/types/ClientFacingDeviceSourceType.d.ts +2 -1
- package/dist/api/types/ClientFacingDeviceSourceType.js +1 -0
- package/dist/api/types/ClientFacingElectrocardiogramSourceType.d.ts +2 -1
- package/dist/api/types/ClientFacingElectrocardiogramSourceType.js +1 -0
- package/dist/api/types/ClientFacingMenstrualCycleSourceType.d.ts +2 -1
- package/dist/api/types/ClientFacingMenstrualCycleSourceType.js +1 -0
- package/dist/api/types/ClientFacingSleepCycleSourceType.d.ts +2 -1
- package/dist/api/types/ClientFacingSleepCycleSourceType.js +1 -0
- package/dist/serialization/resources/index.d.ts +4 -4
- package/dist/serialization/resources/index.js +5 -5
- 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/serialization/types/ClientFacingDeviceSourceType.d.ts +1 -1
- package/dist/serialization/types/ClientFacingDeviceSourceType.js +1 -0
- package/dist/serialization/types/ClientFacingElectrocardiogramSourceType.d.ts +1 -1
- package/dist/serialization/types/ClientFacingElectrocardiogramSourceType.js +1 -0
- package/dist/serialization/types/ClientFacingMenstrualCycleSourceType.d.ts +1 -1
- package/dist/serialization/types/ClientFacingMenstrualCycleSourceType.js +1 -0
- package/dist/serialization/types/ClientFacingSleepCycleSourceType.d.ts +1 -1
- package/dist/serialization/types/ClientFacingSleepCycleSourceType.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +1577 -1577
- package/serialization/resources/index.d.ts +4 -4
- package/serialization/resources/index.js +5 -5
- 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/serialization/types/ClientFacingDeviceSourceType.d.ts +1 -1
- package/serialization/types/ClientFacingDeviceSourceType.js +1 -0
- package/serialization/types/ClientFacingElectrocardiogramSourceType.d.ts +1 -1
- package/serialization/types/ClientFacingElectrocardiogramSourceType.js +1 -0
- package/serialization/types/ClientFacingMenstrualCycleSourceType.d.ts +1 -1
- package/serialization/types/ClientFacingMenstrualCycleSourceType.js +1 -0
- package/serialization/types/ClientFacingSleepCycleSourceType.d.ts +1 -1
- package/serialization/types/ClientFacingSleepCycleSourceType.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -61,99 +61,62 @@ class LabTests {
|
|
|
61
61
|
this._options = _options;
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
* GET
|
|
64
|
+
* GET all the lab tests the team has access to.
|
|
65
65
|
*
|
|
66
|
-
* @param {Vital.
|
|
66
|
+
* @param {Vital.LabTestsGetRequest} request
|
|
67
67
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
68
|
*
|
|
69
69
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
72
|
-
* await client.labTests.
|
|
72
|
+
* await client.labTests.get()
|
|
73
73
|
*/
|
|
74
|
-
|
|
74
|
+
get(request = {}, requestOptions) {
|
|
75
75
|
var _a;
|
|
76
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
const {
|
|
77
|
+
const { generationMethod, labSlug, collectionMethod, status, markerIds, providerIds, name, orderKey, orderDirection, } = request;
|
|
78
78
|
const _queryParams = {};
|
|
79
|
-
if (
|
|
80
|
-
_queryParams["
|
|
81
|
-
}
|
|
82
|
-
if (startDate != null) {
|
|
83
|
-
_queryParams["start_date"] = startDate.toISOString();
|
|
84
|
-
}
|
|
85
|
-
if (endDate != null) {
|
|
86
|
-
_queryParams["end_date"] = endDate.toISOString();
|
|
79
|
+
if (generationMethod != null) {
|
|
80
|
+
_queryParams["generation_method"] = generationMethod;
|
|
87
81
|
}
|
|
88
|
-
if (
|
|
89
|
-
_queryParams["
|
|
82
|
+
if (labSlug != null) {
|
|
83
|
+
_queryParams["lab_slug"] = labSlug;
|
|
90
84
|
}
|
|
91
|
-
if (
|
|
92
|
-
_queryParams["
|
|
85
|
+
if (collectionMethod != null) {
|
|
86
|
+
_queryParams["collection_method"] = collectionMethod;
|
|
93
87
|
}
|
|
94
88
|
if (status != null) {
|
|
95
|
-
|
|
96
|
-
_queryParams["status"] = status.map((item) => item);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
_queryParams["status"] = status;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (orderKey != null) {
|
|
103
|
-
_queryParams["order_key"] = orderKey;
|
|
104
|
-
}
|
|
105
|
-
if (orderDirection != null) {
|
|
106
|
-
_queryParams["order_direction"] = orderDirection;
|
|
89
|
+
_queryParams["status"] = status;
|
|
107
90
|
}
|
|
108
|
-
if (
|
|
109
|
-
if (Array.isArray(
|
|
110
|
-
_queryParams["
|
|
91
|
+
if (markerIds != null) {
|
|
92
|
+
if (Array.isArray(markerIds)) {
|
|
93
|
+
_queryParams["marker_ids"] = markerIds.map((item) => item.toString());
|
|
111
94
|
}
|
|
112
95
|
else {
|
|
113
|
-
_queryParams["
|
|
96
|
+
_queryParams["marker_ids"] = markerIds.toString();
|
|
114
97
|
}
|
|
115
98
|
}
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (interpretation != null) {
|
|
120
|
-
_queryParams["interpretation"] = interpretation;
|
|
121
|
-
}
|
|
122
|
-
if (orderActivationTypes != null) {
|
|
123
|
-
if (Array.isArray(orderActivationTypes)) {
|
|
124
|
-
_queryParams["order_activation_types"] = orderActivationTypes.map((item) => item);
|
|
99
|
+
if (providerIds != null) {
|
|
100
|
+
if (Array.isArray(providerIds)) {
|
|
101
|
+
_queryParams["provider_ids"] = providerIds.map((item) => item);
|
|
125
102
|
}
|
|
126
103
|
else {
|
|
127
|
-
_queryParams["
|
|
104
|
+
_queryParams["provider_ids"] = providerIds;
|
|
128
105
|
}
|
|
129
106
|
}
|
|
130
|
-
if (
|
|
131
|
-
_queryParams["
|
|
132
|
-
}
|
|
133
|
-
if (patientName != null) {
|
|
134
|
-
_queryParams["patient_name"] = patientName;
|
|
135
|
-
}
|
|
136
|
-
if (shippingRecipientName != null) {
|
|
137
|
-
_queryParams["shipping_recipient_name"] = shippingRecipientName;
|
|
138
|
-
}
|
|
139
|
-
if (orderIds != null) {
|
|
140
|
-
if (Array.isArray(orderIds)) {
|
|
141
|
-
_queryParams["order_ids"] = orderIds.map((item) => item);
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
_queryParams["order_ids"] = orderIds;
|
|
145
|
-
}
|
|
107
|
+
if (name != null) {
|
|
108
|
+
_queryParams["name"] = name;
|
|
146
109
|
}
|
|
147
|
-
if (
|
|
148
|
-
_queryParams["
|
|
110
|
+
if (orderKey != null) {
|
|
111
|
+
_queryParams["order_key"] = orderKey;
|
|
149
112
|
}
|
|
150
|
-
if (
|
|
151
|
-
_queryParams["
|
|
113
|
+
if (orderDirection != null) {
|
|
114
|
+
_queryParams["order_direction"] = orderDirection;
|
|
152
115
|
}
|
|
153
116
|
const _response = yield core.fetcher({
|
|
154
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/
|
|
117
|
+
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"),
|
|
155
118
|
method: "GET",
|
|
156
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
119
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
157
120
|
contentType: "application/json",
|
|
158
121
|
queryParameters: _queryParams,
|
|
159
122
|
requestType: "json",
|
|
@@ -162,7 +125,7 @@ class LabTests {
|
|
|
162
125
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
163
126
|
});
|
|
164
127
|
if (_response.ok) {
|
|
165
|
-
return serializers.
|
|
128
|
+
return serializers.labTests.get.Response.parseOrThrow(_response.body, {
|
|
166
129
|
unrecognizedObjectKeys: "passthrough",
|
|
167
130
|
allowUnrecognizedUnionMembers: true,
|
|
168
131
|
allowUnrecognizedEnumValues: true,
|
|
@@ -201,46 +164,34 @@ class LabTests {
|
|
|
201
164
|
});
|
|
202
165
|
}
|
|
203
166
|
/**
|
|
204
|
-
*
|
|
205
|
-
* for the given address and order.
|
|
206
|
-
*
|
|
207
|
-
* @param {Vital.LabTestsGetPhlebotomyAppointmentAvailabilityRequest} request
|
|
167
|
+
* @param {Vital.CreateLabTestRequest} request
|
|
208
168
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
209
169
|
*
|
|
210
170
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
211
171
|
*
|
|
212
172
|
* @example
|
|
213
|
-
* await client.labTests.
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* state: "state",
|
|
218
|
-
* zipCode: "zip_code"
|
|
219
|
-
* }
|
|
173
|
+
* await client.labTests.create({
|
|
174
|
+
* name: "name",
|
|
175
|
+
* method: "testkit",
|
|
176
|
+
* description: "description"
|
|
220
177
|
* })
|
|
221
178
|
*/
|
|
222
|
-
|
|
179
|
+
create(request, requestOptions) {
|
|
223
180
|
var _a;
|
|
224
181
|
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
-
const { startDate, body: _body } = request;
|
|
226
|
-
const _queryParams = {};
|
|
227
|
-
if (startDate != null) {
|
|
228
|
-
_queryParams["start_date"] = startDate;
|
|
229
|
-
}
|
|
230
182
|
const _response = yield core.fetcher({
|
|
231
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/
|
|
183
|
+
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"),
|
|
232
184
|
method: "POST",
|
|
233
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
185
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
234
186
|
contentType: "application/json",
|
|
235
|
-
queryParameters: _queryParams,
|
|
236
187
|
requestType: "json",
|
|
237
|
-
body: serializers.
|
|
188
|
+
body: serializers.CreateLabTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
238
189
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
239
190
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
240
191
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
241
192
|
});
|
|
242
193
|
if (_response.ok) {
|
|
243
|
-
return serializers.
|
|
194
|
+
return serializers.ClientFacingLabTest.parseOrThrow(_response.body, {
|
|
244
195
|
unrecognizedObjectKeys: "passthrough",
|
|
245
196
|
allowUnrecognizedUnionMembers: true,
|
|
246
197
|
allowUnrecognizedEnumValues: true,
|
|
@@ -279,35 +230,31 @@ class LabTests {
|
|
|
279
230
|
});
|
|
280
231
|
}
|
|
281
232
|
/**
|
|
282
|
-
*
|
|
233
|
+
* GET all the lab tests the team has access to.
|
|
283
234
|
*
|
|
284
|
-
* @param {string}
|
|
285
|
-
* @param {Vital.AppointmentBookingRequest} request
|
|
235
|
+
* @param {string} labTestId
|
|
286
236
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
287
237
|
*
|
|
288
238
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
289
239
|
*
|
|
290
240
|
* @example
|
|
291
|
-
* await client.labTests.
|
|
292
|
-
* bookingKey: "booking_key"
|
|
293
|
-
* })
|
|
241
|
+
* await client.labTests.getById("lab_test_id")
|
|
294
242
|
*/
|
|
295
|
-
|
|
243
|
+
getById(labTestId, requestOptions) {
|
|
296
244
|
var _a;
|
|
297
245
|
return __awaiter(this, void 0, void 0, function* () {
|
|
298
246
|
const _response = yield core.fetcher({
|
|
299
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
300
|
-
method: "
|
|
301
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
247
|
+
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)}`),
|
|
248
|
+
method: "GET",
|
|
249
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
302
250
|
contentType: "application/json",
|
|
303
251
|
requestType: "json",
|
|
304
|
-
body: serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
305
252
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
306
253
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
307
254
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
308
255
|
});
|
|
309
256
|
if (_response.ok) {
|
|
310
|
-
return serializers.
|
|
257
|
+
return serializers.ClientFacingLabTest.parseOrThrow(_response.body, {
|
|
311
258
|
unrecognizedObjectKeys: "passthrough",
|
|
312
259
|
allowUnrecognizedUnionMembers: true,
|
|
313
260
|
allowUnrecognizedEnumValues: true,
|
|
@@ -346,41 +293,31 @@ class LabTests {
|
|
|
346
293
|
});
|
|
347
294
|
}
|
|
348
295
|
/**
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
* @param {string} orderId - Your Order ID.
|
|
352
|
-
* @param {Vital.RequestAppointmentRequest} request
|
|
296
|
+
* @param {string} labTestId
|
|
297
|
+
* @param {Vital.UpdateLabTestRequest} request
|
|
353
298
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
354
299
|
*
|
|
355
300
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
356
301
|
*
|
|
357
302
|
* @example
|
|
358
|
-
* await client.labTests.
|
|
359
|
-
* address: {
|
|
360
|
-
* firstLine: "first_line",
|
|
361
|
-
* city: "city",
|
|
362
|
-
* state: "state",
|
|
363
|
-
* zipCode: "zip_code"
|
|
364
|
-
* },
|
|
365
|
-
* provider: "getlabs"
|
|
366
|
-
* })
|
|
303
|
+
* await client.labTests.updateLabTest("lab_test_id")
|
|
367
304
|
*/
|
|
368
|
-
|
|
305
|
+
updateLabTest(labTestId, request = {}, requestOptions) {
|
|
369
306
|
var _a;
|
|
370
307
|
return __awaiter(this, void 0, void 0, function* () {
|
|
371
308
|
const _response = yield core.fetcher({
|
|
372
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
373
|
-
method: "
|
|
374
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
309
|
+
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)}`),
|
|
310
|
+
method: "PATCH",
|
|
311
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
375
312
|
contentType: "application/json",
|
|
376
313
|
requestType: "json",
|
|
377
|
-
body: serializers.
|
|
314
|
+
body: serializers.UpdateLabTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
378
315
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
379
316
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
380
317
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
381
318
|
});
|
|
382
319
|
if (_response.ok) {
|
|
383
|
-
return serializers.
|
|
320
|
+
return serializers.ClientFacingLabTest.parseOrThrow(_response.body, {
|
|
384
321
|
unrecognizedObjectKeys: "passthrough",
|
|
385
322
|
allowUnrecognizedUnionMembers: true,
|
|
386
323
|
allowUnrecognizedEnumValues: true,
|
|
@@ -419,35 +356,54 @@ class LabTests {
|
|
|
419
356
|
});
|
|
420
357
|
}
|
|
421
358
|
/**
|
|
422
|
-
*
|
|
359
|
+
* GET all the markers for the given lab.
|
|
423
360
|
*
|
|
424
|
-
* @param {
|
|
425
|
-
* @param {Vital.AppointmentRescheduleRequest} request
|
|
361
|
+
* @param {Vital.LabTestsGetMarkersRequest} request
|
|
426
362
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
427
363
|
*
|
|
428
364
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
429
365
|
*
|
|
430
366
|
* @example
|
|
431
|
-
* await client.labTests.
|
|
432
|
-
* bookingKey: "booking_key"
|
|
433
|
-
* })
|
|
367
|
+
* await client.labTests.getMarkers()
|
|
434
368
|
*/
|
|
435
|
-
|
|
369
|
+
getMarkers(request = {}, requestOptions) {
|
|
436
370
|
var _a;
|
|
437
371
|
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
+
const { labId, name, aLaCarteEnabled, page, size } = request;
|
|
373
|
+
const _queryParams = {};
|
|
374
|
+
if (labId != null) {
|
|
375
|
+
if (Array.isArray(labId)) {
|
|
376
|
+
_queryParams["lab_id"] = labId.map((item) => item.toString());
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
_queryParams["lab_id"] = labId.toString();
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (name != null) {
|
|
383
|
+
_queryParams["name"] = name;
|
|
384
|
+
}
|
|
385
|
+
if (aLaCarteEnabled != null) {
|
|
386
|
+
_queryParams["a_la_carte_enabled"] = aLaCarteEnabled.toString();
|
|
387
|
+
}
|
|
388
|
+
if (page != null) {
|
|
389
|
+
_queryParams["page"] = page.toString();
|
|
390
|
+
}
|
|
391
|
+
if (size != null) {
|
|
392
|
+
_queryParams["size"] = size.toString();
|
|
393
|
+
}
|
|
438
394
|
const _response = yield core.fetcher({
|
|
439
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
440
|
-
method: "
|
|
441
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
395
|
+
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"),
|
|
396
|
+
method: "GET",
|
|
397
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
442
398
|
contentType: "application/json",
|
|
399
|
+
queryParameters: _queryParams,
|
|
443
400
|
requestType: "json",
|
|
444
|
-
body: serializers.AppointmentRescheduleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
445
401
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
446
402
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
447
403
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
448
404
|
});
|
|
449
405
|
if (_response.ok) {
|
|
450
|
-
return serializers.
|
|
406
|
+
return serializers.GetMarkersResponse.parseOrThrow(_response.body, {
|
|
451
407
|
unrecognizedObjectKeys: "passthrough",
|
|
452
408
|
allowUnrecognizedUnionMembers: true,
|
|
453
409
|
allowUnrecognizedEnumValues: true,
|
|
@@ -486,35 +442,41 @@ class LabTests {
|
|
|
486
442
|
});
|
|
487
443
|
}
|
|
488
444
|
/**
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
* @param {string} orderId - Your Order ID.
|
|
492
|
-
* @param {Vital.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest} request
|
|
445
|
+
* @param {Vital.LabTestsGetMarkersForOrderSetRequest} request
|
|
493
446
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
494
447
|
*
|
|
495
448
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
496
449
|
*
|
|
497
450
|
* @example
|
|
498
|
-
* await client.labTests.
|
|
499
|
-
*
|
|
451
|
+
* await client.labTests.getMarkersForOrderSet({
|
|
452
|
+
* body: {}
|
|
500
453
|
* })
|
|
501
454
|
*/
|
|
502
|
-
|
|
455
|
+
getMarkersForOrderSet(request, requestOptions) {
|
|
503
456
|
var _a;
|
|
504
457
|
return __awaiter(this, void 0, void 0, function* () {
|
|
458
|
+
const { page, size, body: _body } = request;
|
|
459
|
+
const _queryParams = {};
|
|
460
|
+
if (page != null) {
|
|
461
|
+
_queryParams["page"] = page.toString();
|
|
462
|
+
}
|
|
463
|
+
if (size != null) {
|
|
464
|
+
_queryParams["size"] = size.toString();
|
|
465
|
+
}
|
|
505
466
|
const _response = yield core.fetcher({
|
|
506
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
507
|
-
method: "
|
|
508
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
467
|
+
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"),
|
|
468
|
+
method: "POST",
|
|
469
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
509
470
|
contentType: "application/json",
|
|
471
|
+
queryParameters: _queryParams,
|
|
510
472
|
requestType: "json",
|
|
511
|
-
body: serializers.
|
|
473
|
+
body: serializers.OrderSetRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
512
474
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
513
475
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
514
476
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
515
477
|
});
|
|
516
478
|
if (_response.ok) {
|
|
517
|
-
return serializers.
|
|
479
|
+
return serializers.GetMarkersResponse.parseOrThrow(_response.body, {
|
|
518
480
|
unrecognizedObjectKeys: "passthrough",
|
|
519
481
|
allowUnrecognizedUnionMembers: true,
|
|
520
482
|
allowUnrecognizedEnumValues: true,
|
|
@@ -553,28 +515,39 @@ class LabTests {
|
|
|
553
515
|
});
|
|
554
516
|
}
|
|
555
517
|
/**
|
|
556
|
-
*
|
|
557
|
-
*
|
|
518
|
+
* @param {string} labTestId
|
|
519
|
+
* @param {Vital.LabTestsGetMarkersForLabTestRequest} request
|
|
558
520
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
559
521
|
*
|
|
522
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
|
523
|
+
*
|
|
560
524
|
* @example
|
|
561
|
-
* await client.labTests.
|
|
525
|
+
* await client.labTests.getMarkersForLabTest("lab_test_id")
|
|
562
526
|
*/
|
|
563
|
-
|
|
527
|
+
getMarkersForLabTest(labTestId, request = {}, requestOptions) {
|
|
564
528
|
var _a;
|
|
565
529
|
return __awaiter(this, void 0, void 0, function* () {
|
|
530
|
+
const { page, size } = request;
|
|
531
|
+
const _queryParams = {};
|
|
532
|
+
if (page != null) {
|
|
533
|
+
_queryParams["page"] = page.toString();
|
|
534
|
+
}
|
|
535
|
+
if (size != null) {
|
|
536
|
+
_queryParams["size"] = size.toString();
|
|
537
|
+
}
|
|
566
538
|
const _response = yield core.fetcher({
|
|
567
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
539
|
+
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`),
|
|
568
540
|
method: "GET",
|
|
569
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
541
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
570
542
|
contentType: "application/json",
|
|
543
|
+
queryParameters: _queryParams,
|
|
571
544
|
requestType: "json",
|
|
572
545
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
573
546
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
574
547
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
575
548
|
});
|
|
576
549
|
if (_response.ok) {
|
|
577
|
-
return serializers.
|
|
550
|
+
return serializers.GetMarkersResponse.parseOrThrow(_response.body, {
|
|
578
551
|
unrecognizedObjectKeys: "passthrough",
|
|
579
552
|
allowUnrecognizedUnionMembers: true,
|
|
580
553
|
allowUnrecognizedEnumValues: true,
|
|
@@ -582,10 +555,20 @@ class LabTests {
|
|
|
582
555
|
});
|
|
583
556
|
}
|
|
584
557
|
if (_response.error.reason === "status-code") {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
558
|
+
switch (_response.error.statusCode) {
|
|
559
|
+
case 422:
|
|
560
|
+
throw new Vital.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
561
|
+
unrecognizedObjectKeys: "passthrough",
|
|
562
|
+
allowUnrecognizedUnionMembers: true,
|
|
563
|
+
allowUnrecognizedEnumValues: true,
|
|
564
|
+
breadcrumbsPrefix: ["response"],
|
|
565
|
+
}));
|
|
566
|
+
default:
|
|
567
|
+
throw new errors.VitalError({
|
|
568
|
+
statusCode: _response.error.statusCode,
|
|
569
|
+
body: _response.error.body,
|
|
570
|
+
});
|
|
571
|
+
}
|
|
589
572
|
}
|
|
590
573
|
switch (_response.error.reason) {
|
|
591
574
|
case "non-json":
|
|
@@ -603,23 +586,24 @@ class LabTests {
|
|
|
603
586
|
});
|
|
604
587
|
}
|
|
605
588
|
/**
|
|
606
|
-
*
|
|
589
|
+
* GET a specific marker for the given lab and provider_id
|
|
607
590
|
*
|
|
608
|
-
* @param {string}
|
|
591
|
+
* @param {string} providerId
|
|
592
|
+
* @param {number} labId
|
|
609
593
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
610
594
|
*
|
|
611
595
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
612
596
|
*
|
|
613
597
|
* @example
|
|
614
|
-
* await client.labTests.
|
|
598
|
+
* await client.labTests.getMarkersByLabAndProviderId("provider_id", 1)
|
|
615
599
|
*/
|
|
616
|
-
|
|
600
|
+
getMarkersByLabAndProviderId(providerId, labId, requestOptions) {
|
|
617
601
|
var _a;
|
|
618
602
|
return __awaiter(this, void 0, void 0, function* () {
|
|
619
603
|
const _response = yield core.fetcher({
|
|
620
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
604
|
+
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)}`),
|
|
621
605
|
method: "GET",
|
|
622
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
606
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
623
607
|
contentType: "application/json",
|
|
624
608
|
requestType: "json",
|
|
625
609
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -627,7 +611,7 @@ class LabTests {
|
|
|
627
611
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
628
612
|
});
|
|
629
613
|
if (_response.ok) {
|
|
630
|
-
return serializers.
|
|
614
|
+
return serializers.ClientFacingMarker.parseOrThrow(_response.body, {
|
|
631
615
|
unrecognizedObjectKeys: "passthrough",
|
|
632
616
|
allowUnrecognizedUnionMembers: true,
|
|
633
617
|
allowUnrecognizedEnumValues: true,
|
|
@@ -666,55 +650,28 @@ class LabTests {
|
|
|
666
650
|
});
|
|
667
651
|
}
|
|
668
652
|
/**
|
|
669
|
-
* GET
|
|
670
|
-
*
|
|
671
|
-
* Information returned:
|
|
672
|
-
* * Whether a given zip code is served by our Phlebotomy network.
|
|
673
|
-
* * List of Lab locations in the area.
|
|
653
|
+
* GET all the labs.
|
|
674
654
|
*
|
|
675
|
-
* @param {Vital.LabTestsGetAreaInfoRequest} request
|
|
676
655
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
677
656
|
*
|
|
678
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
|
679
|
-
*
|
|
680
657
|
* @example
|
|
681
|
-
* await client.labTests.
|
|
682
|
-
* zipCode: "zip_code"
|
|
683
|
-
* })
|
|
658
|
+
* await client.labTests.getLabs()
|
|
684
659
|
*/
|
|
685
|
-
|
|
660
|
+
getLabs(requestOptions) {
|
|
686
661
|
var _a;
|
|
687
662
|
return __awaiter(this, void 0, void 0, function* () {
|
|
688
|
-
const { zipCode, radius, lab, labs } = request;
|
|
689
|
-
const _queryParams = {};
|
|
690
|
-
_queryParams["zip_code"] = zipCode;
|
|
691
|
-
if (radius != null) {
|
|
692
|
-
_queryParams["radius"] = radius;
|
|
693
|
-
}
|
|
694
|
-
if (lab != null) {
|
|
695
|
-
_queryParams["lab"] = lab;
|
|
696
|
-
}
|
|
697
|
-
if (labs != null) {
|
|
698
|
-
if (Array.isArray(labs)) {
|
|
699
|
-
_queryParams["labs"] = labs.map((item) => item);
|
|
700
|
-
}
|
|
701
|
-
else {
|
|
702
|
-
_queryParams["labs"] = labs;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
663
|
const _response = yield core.fetcher({
|
|
706
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/
|
|
664
|
+
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"),
|
|
707
665
|
method: "GET",
|
|
708
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
666
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
709
667
|
contentType: "application/json",
|
|
710
|
-
queryParameters: _queryParams,
|
|
711
668
|
requestType: "json",
|
|
712
669
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
713
670
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
714
671
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
715
672
|
});
|
|
716
673
|
if (_response.ok) {
|
|
717
|
-
return serializers.
|
|
674
|
+
return serializers.labTests.getLabs.Response.parseOrThrow(_response.body, {
|
|
718
675
|
unrecognizedObjectKeys: "passthrough",
|
|
719
676
|
allowUnrecognizedUnionMembers: true,
|
|
720
677
|
allowUnrecognizedEnumValues: true,
|
|
@@ -722,20 +679,10 @@ class LabTests {
|
|
|
722
679
|
});
|
|
723
680
|
}
|
|
724
681
|
if (_response.error.reason === "status-code") {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
allowUnrecognizedUnionMembers: true,
|
|
730
|
-
allowUnrecognizedEnumValues: true,
|
|
731
|
-
breadcrumbsPrefix: ["response"],
|
|
732
|
-
}));
|
|
733
|
-
default:
|
|
734
|
-
throw new errors.VitalError({
|
|
735
|
-
statusCode: _response.error.statusCode,
|
|
736
|
-
body: _response.error.body,
|
|
737
|
-
});
|
|
738
|
-
}
|
|
682
|
+
throw new errors.VitalError({
|
|
683
|
+
statusCode: _response.error.statusCode,
|
|
684
|
+
body: _response.error.body,
|
|
685
|
+
});
|
|
739
686
|
}
|
|
740
687
|
switch (_response.error.reason) {
|
|
741
688
|
case "non-json":
|
|
@@ -753,39 +700,68 @@ class LabTests {
|
|
|
753
700
|
});
|
|
754
701
|
}
|
|
755
702
|
/**
|
|
756
|
-
*
|
|
703
|
+
* GET lab tests the team has access to as a paginated list.
|
|
704
|
+
*
|
|
705
|
+
* @param {Vital.LabTestsGetPaginatedRequest} request
|
|
757
706
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
758
707
|
*
|
|
759
708
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
760
709
|
*
|
|
761
710
|
* @example
|
|
762
|
-
* await client.labTests.
|
|
763
|
-
* zipCode: "zip_code",
|
|
764
|
-
* labId: 1
|
|
765
|
-
* })
|
|
711
|
+
* await client.labTests.getPaginated()
|
|
766
712
|
*/
|
|
767
|
-
|
|
713
|
+
getPaginated(request = {}, requestOptions) {
|
|
768
714
|
var _a;
|
|
769
715
|
return __awaiter(this, void 0, void 0, function* () {
|
|
770
|
-
const {
|
|
716
|
+
const { labTestLimit, nextCursor, generationMethod, labSlug, collectionMethod, status, markerIds, providerIds, name, orderKey, orderDirection, } = request;
|
|
771
717
|
const _queryParams = {};
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
if (radius != null) {
|
|
775
|
-
_queryParams["radius"] = radius;
|
|
718
|
+
if (labTestLimit != null) {
|
|
719
|
+
_queryParams["lab_test_limit"] = labTestLimit.toString();
|
|
776
720
|
}
|
|
777
|
-
if (
|
|
778
|
-
|
|
779
|
-
|
|
721
|
+
if (nextCursor != null) {
|
|
722
|
+
_queryParams["next_cursor"] = nextCursor;
|
|
723
|
+
}
|
|
724
|
+
if (generationMethod != null) {
|
|
725
|
+
_queryParams["generation_method"] = generationMethod;
|
|
726
|
+
}
|
|
727
|
+
if (labSlug != null) {
|
|
728
|
+
_queryParams["lab_slug"] = labSlug;
|
|
729
|
+
}
|
|
730
|
+
if (collectionMethod != null) {
|
|
731
|
+
_queryParams["collection_method"] = collectionMethod;
|
|
732
|
+
}
|
|
733
|
+
if (status != null) {
|
|
734
|
+
_queryParams["status"] = status;
|
|
735
|
+
}
|
|
736
|
+
if (markerIds != null) {
|
|
737
|
+
if (Array.isArray(markerIds)) {
|
|
738
|
+
_queryParams["marker_ids"] = markerIds.map((item) => item.toString());
|
|
780
739
|
}
|
|
781
740
|
else {
|
|
782
|
-
_queryParams["
|
|
741
|
+
_queryParams["marker_ids"] = markerIds.toString();
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
if (providerIds != null) {
|
|
745
|
+
if (Array.isArray(providerIds)) {
|
|
746
|
+
_queryParams["provider_ids"] = providerIds.map((item) => item);
|
|
747
|
+
}
|
|
748
|
+
else {
|
|
749
|
+
_queryParams["provider_ids"] = providerIds;
|
|
783
750
|
}
|
|
784
751
|
}
|
|
752
|
+
if (name != null) {
|
|
753
|
+
_queryParams["name"] = name;
|
|
754
|
+
}
|
|
755
|
+
if (orderKey != null) {
|
|
756
|
+
_queryParams["order_key"] = orderKey;
|
|
757
|
+
}
|
|
758
|
+
if (orderDirection != null) {
|
|
759
|
+
_queryParams["order_direction"] = orderDirection;
|
|
760
|
+
}
|
|
785
761
|
const _response = yield core.fetcher({
|
|
786
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/
|
|
762
|
+
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"),
|
|
787
763
|
method: "GET",
|
|
788
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
764
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
789
765
|
contentType: "application/json",
|
|
790
766
|
queryParameters: _queryParams,
|
|
791
767
|
requestType: "json",
|
|
@@ -794,7 +770,7 @@ class LabTests {
|
|
|
794
770
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
795
771
|
});
|
|
796
772
|
if (_response.ok) {
|
|
797
|
-
return serializers.
|
|
773
|
+
return serializers.LabTestResourcesResponse.parseOrThrow(_response.body, {
|
|
798
774
|
unrecognizedObjectKeys: "passthrough",
|
|
799
775
|
allowUnrecognizedUnionMembers: true,
|
|
800
776
|
allowUnrecognizedEnumValues: true,
|
|
@@ -833,49 +809,24 @@ class LabTests {
|
|
|
833
809
|
});
|
|
834
810
|
}
|
|
835
811
|
/**
|
|
836
|
-
* @param {string} orderId - Your Order ID.
|
|
837
|
-
* @param {Vital.LabTestsGetOrderPscInfoRequest} request
|
|
838
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
839
|
-
*
|
|
840
812
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
841
|
-
*
|
|
842
|
-
* @example
|
|
843
|
-
* await client.labTests.getOrderPscInfo("order_id")
|
|
844
813
|
*/
|
|
845
|
-
|
|
814
|
+
getLabTestCollectionInstructionPdf(labTestId, requestOptions) {
|
|
846
815
|
var _a;
|
|
847
816
|
return __awaiter(this, void 0, void 0, function* () {
|
|
848
|
-
const { radius, capabilities } = request;
|
|
849
|
-
const _queryParams = {};
|
|
850
|
-
if (radius != null) {
|
|
851
|
-
_queryParams["radius"] = radius;
|
|
852
|
-
}
|
|
853
|
-
if (capabilities != null) {
|
|
854
|
-
if (Array.isArray(capabilities)) {
|
|
855
|
-
_queryParams["capabilities"] = capabilities.map((item) => item);
|
|
856
|
-
}
|
|
857
|
-
else {
|
|
858
|
-
_queryParams["capabilities"] = capabilities;
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
817
|
const _response = yield core.fetcher({
|
|
862
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
818
|
+
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`),
|
|
863
819
|
method: "GET",
|
|
864
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
820
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
865
821
|
contentType: "application/json",
|
|
866
|
-
queryParameters: _queryParams,
|
|
867
822
|
requestType: "json",
|
|
823
|
+
responseType: "streaming",
|
|
868
824
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
869
825
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
870
826
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
871
827
|
});
|
|
872
828
|
if (_response.ok) {
|
|
873
|
-
return
|
|
874
|
-
unrecognizedObjectKeys: "passthrough",
|
|
875
|
-
allowUnrecognizedUnionMembers: true,
|
|
876
|
-
allowUnrecognizedEnumValues: true,
|
|
877
|
-
breadcrumbsPrefix: ["response"],
|
|
878
|
-
});
|
|
829
|
+
return _response.body;
|
|
879
830
|
}
|
|
880
831
|
if (_response.error.reason === "status-code") {
|
|
881
832
|
switch (_response.error.statusCode) {
|
|
@@ -909,25 +860,113 @@ class LabTests {
|
|
|
909
860
|
});
|
|
910
861
|
}
|
|
911
862
|
/**
|
|
912
|
-
*
|
|
863
|
+
* GET many orders with filters.
|
|
864
|
+
*
|
|
865
|
+
* @param {Vital.LabTestsGetOrdersRequest} request
|
|
866
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
867
|
+
*
|
|
913
868
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
869
|
+
*
|
|
870
|
+
* @example
|
|
871
|
+
* await client.labTests.getOrders()
|
|
914
872
|
*/
|
|
915
|
-
|
|
873
|
+
getOrders(request = {}, requestOptions) {
|
|
916
874
|
var _a;
|
|
917
875
|
return __awaiter(this, void 0, void 0, function* () {
|
|
876
|
+
const { searchInput, startDate, endDate, updatedStartDate, updatedEndDate, status, orderKey, orderDirection, orderType, isCritical, interpretation, orderActivationTypes, userId, patientName, shippingRecipientName, orderIds, page, size, } = request;
|
|
877
|
+
const _queryParams = {};
|
|
878
|
+
if (searchInput != null) {
|
|
879
|
+
_queryParams["search_input"] = searchInput;
|
|
880
|
+
}
|
|
881
|
+
if (startDate != null) {
|
|
882
|
+
_queryParams["start_date"] = startDate.toISOString();
|
|
883
|
+
}
|
|
884
|
+
if (endDate != null) {
|
|
885
|
+
_queryParams["end_date"] = endDate.toISOString();
|
|
886
|
+
}
|
|
887
|
+
if (updatedStartDate != null) {
|
|
888
|
+
_queryParams["updated_start_date"] = updatedStartDate.toISOString();
|
|
889
|
+
}
|
|
890
|
+
if (updatedEndDate != null) {
|
|
891
|
+
_queryParams["updated_end_date"] = updatedEndDate.toISOString();
|
|
892
|
+
}
|
|
893
|
+
if (status != null) {
|
|
894
|
+
if (Array.isArray(status)) {
|
|
895
|
+
_queryParams["status"] = status.map((item) => item);
|
|
896
|
+
}
|
|
897
|
+
else {
|
|
898
|
+
_queryParams["status"] = status;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
if (orderKey != null) {
|
|
902
|
+
_queryParams["order_key"] = orderKey;
|
|
903
|
+
}
|
|
904
|
+
if (orderDirection != null) {
|
|
905
|
+
_queryParams["order_direction"] = orderDirection;
|
|
906
|
+
}
|
|
907
|
+
if (orderType != null) {
|
|
908
|
+
if (Array.isArray(orderType)) {
|
|
909
|
+
_queryParams["order_type"] = orderType.map((item) => item);
|
|
910
|
+
}
|
|
911
|
+
else {
|
|
912
|
+
_queryParams["order_type"] = orderType;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
if (isCritical != null) {
|
|
916
|
+
_queryParams["is_critical"] = isCritical.toString();
|
|
917
|
+
}
|
|
918
|
+
if (interpretation != null) {
|
|
919
|
+
_queryParams["interpretation"] = interpretation;
|
|
920
|
+
}
|
|
921
|
+
if (orderActivationTypes != null) {
|
|
922
|
+
if (Array.isArray(orderActivationTypes)) {
|
|
923
|
+
_queryParams["order_activation_types"] = orderActivationTypes.map((item) => item);
|
|
924
|
+
}
|
|
925
|
+
else {
|
|
926
|
+
_queryParams["order_activation_types"] = orderActivationTypes;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
if (userId != null) {
|
|
930
|
+
_queryParams["user_id"] = userId;
|
|
931
|
+
}
|
|
932
|
+
if (patientName != null) {
|
|
933
|
+
_queryParams["patient_name"] = patientName;
|
|
934
|
+
}
|
|
935
|
+
if (shippingRecipientName != null) {
|
|
936
|
+
_queryParams["shipping_recipient_name"] = shippingRecipientName;
|
|
937
|
+
}
|
|
938
|
+
if (orderIds != null) {
|
|
939
|
+
if (Array.isArray(orderIds)) {
|
|
940
|
+
_queryParams["order_ids"] = orderIds.map((item) => item);
|
|
941
|
+
}
|
|
942
|
+
else {
|
|
943
|
+
_queryParams["order_ids"] = orderIds;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
if (page != null) {
|
|
947
|
+
_queryParams["page"] = page.toString();
|
|
948
|
+
}
|
|
949
|
+
if (size != null) {
|
|
950
|
+
_queryParams["size"] = size.toString();
|
|
951
|
+
}
|
|
918
952
|
const _response = yield core.fetcher({
|
|
919
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
953
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/orders"),
|
|
920
954
|
method: "GET",
|
|
921
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
955
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
922
956
|
contentType: "application/json",
|
|
957
|
+
queryParameters: _queryParams,
|
|
923
958
|
requestType: "json",
|
|
924
|
-
responseType: "streaming",
|
|
925
959
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
926
960
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
927
961
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
928
962
|
});
|
|
929
963
|
if (_response.ok) {
|
|
930
|
-
return _response.body
|
|
964
|
+
return serializers.GetOrdersResponse.parseOrThrow(_response.body, {
|
|
965
|
+
unrecognizedObjectKeys: "passthrough",
|
|
966
|
+
allowUnrecognizedUnionMembers: true,
|
|
967
|
+
allowUnrecognizedEnumValues: true,
|
|
968
|
+
breadcrumbsPrefix: ["response"],
|
|
969
|
+
});
|
|
931
970
|
}
|
|
932
971
|
if (_response.error.reason === "status-code") {
|
|
933
972
|
switch (_response.error.statusCode) {
|
|
@@ -961,32 +1000,46 @@ class LabTests {
|
|
|
961
1000
|
});
|
|
962
1001
|
}
|
|
963
1002
|
/**
|
|
964
|
-
* Return
|
|
965
|
-
*
|
|
1003
|
+
* Return the available time slots to book an appointment with a phlebotomist
|
|
1004
|
+
* for the given address and order.
|
|
966
1005
|
*
|
|
967
|
-
* @param {
|
|
1006
|
+
* @param {Vital.LabTestsGetPhlebotomyAppointmentAvailabilityRequest} request
|
|
968
1007
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
969
1008
|
*
|
|
970
1009
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
971
1010
|
*
|
|
972
1011
|
* @example
|
|
973
|
-
* await client.labTests.
|
|
1012
|
+
* await client.labTests.getPhlebotomyAppointmentAvailability({
|
|
1013
|
+
* body: {
|
|
1014
|
+
* firstLine: "first_line",
|
|
1015
|
+
* city: "city",
|
|
1016
|
+
* state: "state",
|
|
1017
|
+
* zipCode: "zip_code"
|
|
1018
|
+
* }
|
|
1019
|
+
* })
|
|
974
1020
|
*/
|
|
975
|
-
|
|
1021
|
+
getPhlebotomyAppointmentAvailability(request, requestOptions) {
|
|
976
1022
|
var _a;
|
|
977
1023
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1024
|
+
const { startDate, body: _body } = request;
|
|
1025
|
+
const _queryParams = {};
|
|
1026
|
+
if (startDate != null) {
|
|
1027
|
+
_queryParams["start_date"] = startDate;
|
|
1028
|
+
}
|
|
978
1029
|
const _response = yield core.fetcher({
|
|
979
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
980
|
-
method: "
|
|
981
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1030
|
+
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"),
|
|
1031
|
+
method: "POST",
|
|
1032
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
982
1033
|
contentType: "application/json",
|
|
1034
|
+
queryParameters: _queryParams,
|
|
983
1035
|
requestType: "json",
|
|
1036
|
+
body: serializers.UsAddress.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
984
1037
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
985
1038
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
986
1039
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
987
1040
|
});
|
|
988
1041
|
if (_response.ok) {
|
|
989
|
-
return serializers.
|
|
1042
|
+
return serializers.AppointmentAvailabilitySlots.parseOrThrow(_response.body, {
|
|
990
1043
|
unrecognizedObjectKeys: "passthrough",
|
|
991
1044
|
allowUnrecognizedUnionMembers: true,
|
|
992
1045
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1025,31 +1078,35 @@ class LabTests {
|
|
|
1025
1078
|
});
|
|
1026
1079
|
}
|
|
1027
1080
|
/**
|
|
1028
|
-
*
|
|
1081
|
+
* Book an at-home phlebotomy appointment.
|
|
1029
1082
|
*
|
|
1030
|
-
* @param {string} orderId
|
|
1083
|
+
* @param {string} orderId - Your Order ID.
|
|
1084
|
+
* @param {Vital.AppointmentBookingRequest} request
|
|
1031
1085
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1032
1086
|
*
|
|
1033
1087
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1034
1088
|
*
|
|
1035
1089
|
* @example
|
|
1036
|
-
* await client.labTests.
|
|
1090
|
+
* await client.labTests.bookPhlebotomyAppointment("order_id", {
|
|
1091
|
+
* bookingKey: "booking_key"
|
|
1092
|
+
* })
|
|
1037
1093
|
*/
|
|
1038
|
-
|
|
1094
|
+
bookPhlebotomyAppointment(orderId, request, requestOptions) {
|
|
1039
1095
|
var _a;
|
|
1040
1096
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1041
1097
|
const _response = yield core.fetcher({
|
|
1042
|
-
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)}/
|
|
1043
|
-
method: "
|
|
1044
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1098
|
+
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`),
|
|
1099
|
+
method: "POST",
|
|
1100
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1045
1101
|
contentType: "application/json",
|
|
1046
1102
|
requestType: "json",
|
|
1103
|
+
body: serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1047
1104
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1048
1105
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1049
1106
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1050
1107
|
});
|
|
1051
1108
|
if (_response.ok) {
|
|
1052
|
-
return serializers.
|
|
1109
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
1053
1110
|
unrecognizedObjectKeys: "passthrough",
|
|
1054
1111
|
allowUnrecognizedUnionMembers: true,
|
|
1055
1112
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1088,32 +1145,46 @@ class LabTests {
|
|
|
1088
1145
|
});
|
|
1089
1146
|
}
|
|
1090
1147
|
/**
|
|
1091
|
-
*
|
|
1148
|
+
* Request an at-home phlebotomy appointment.
|
|
1149
|
+
*
|
|
1150
|
+
* @param {string} orderId - Your Order ID.
|
|
1151
|
+
* @param {Vital.RequestAppointmentRequest} request
|
|
1152
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1153
|
+
*
|
|
1092
1154
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1155
|
+
*
|
|
1156
|
+
* @example
|
|
1157
|
+
* await client.labTests.requestPhlebotomyAppointment("order_id", {
|
|
1158
|
+
* address: {
|
|
1159
|
+
* firstLine: "first_line",
|
|
1160
|
+
* city: "city",
|
|
1161
|
+
* state: "state",
|
|
1162
|
+
* zipCode: "zip_code"
|
|
1163
|
+
* },
|
|
1164
|
+
* provider: "getlabs"
|
|
1165
|
+
* })
|
|
1093
1166
|
*/
|
|
1094
|
-
|
|
1167
|
+
requestPhlebotomyAppointment(orderId, request, requestOptions) {
|
|
1095
1168
|
var _a;
|
|
1096
1169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1097
|
-
const { numberOfLabels, collectionDate } = request;
|
|
1098
|
-
const _queryParams = {};
|
|
1099
|
-
if (numberOfLabels != null) {
|
|
1100
|
-
_queryParams["number_of_labels"] = numberOfLabels.toString();
|
|
1101
|
-
}
|
|
1102
|
-
_queryParams["collection_date"] = collectionDate.toISOString();
|
|
1103
1170
|
const _response = yield core.fetcher({
|
|
1104
|
-
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)}/
|
|
1105
|
-
method: "
|
|
1106
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1171
|
+
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`),
|
|
1172
|
+
method: "POST",
|
|
1173
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1107
1174
|
contentType: "application/json",
|
|
1108
|
-
queryParameters: _queryParams,
|
|
1109
1175
|
requestType: "json",
|
|
1110
|
-
|
|
1176
|
+
body: serializers.RequestAppointmentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1111
1177
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1112
1178
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1113
1179
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1114
1180
|
});
|
|
1115
1181
|
if (_response.ok) {
|
|
1116
|
-
return _response.body
|
|
1182
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
1183
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1184
|
+
allowUnrecognizedUnionMembers: true,
|
|
1185
|
+
allowUnrecognizedEnumValues: true,
|
|
1186
|
+
breadcrumbsPrefix: ["response"],
|
|
1187
|
+
});
|
|
1117
1188
|
}
|
|
1118
1189
|
if (_response.error.reason === "status-code") {
|
|
1119
1190
|
switch (_response.error.statusCode) {
|
|
@@ -1147,52 +1218,35 @@ class LabTests {
|
|
|
1147
1218
|
});
|
|
1148
1219
|
}
|
|
1149
1220
|
/**
|
|
1150
|
-
*
|
|
1221
|
+
* Reschedule a previously booked at-home phlebotomy appointment.
|
|
1222
|
+
*
|
|
1223
|
+
* @param {string} orderId - Your Order ID.
|
|
1224
|
+
* @param {Vital.AppointmentRescheduleRequest} request
|
|
1151
1225
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1152
1226
|
*
|
|
1153
1227
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1154
1228
|
*
|
|
1155
1229
|
* @example
|
|
1156
|
-
* await client.labTests.
|
|
1157
|
-
*
|
|
1230
|
+
* await client.labTests.reschedulePhlebotomyAppointment("order_id", {
|
|
1231
|
+
* bookingKey: "booking_key"
|
|
1158
1232
|
* })
|
|
1159
1233
|
*/
|
|
1160
|
-
|
|
1234
|
+
reschedulePhlebotomyAppointment(orderId, request, requestOptions) {
|
|
1161
1235
|
var _a;
|
|
1162
1236
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1163
|
-
const { lab, startDate, siteCodes, zipCode, radius } = request;
|
|
1164
|
-
const _queryParams = {};
|
|
1165
|
-
_queryParams["lab"] = lab;
|
|
1166
|
-
if (startDate != null) {
|
|
1167
|
-
_queryParams["start_date"] = startDate;
|
|
1168
|
-
}
|
|
1169
|
-
if (siteCodes != null) {
|
|
1170
|
-
if (Array.isArray(siteCodes)) {
|
|
1171
|
-
_queryParams["site_codes"] = siteCodes.map((item) => item);
|
|
1172
|
-
}
|
|
1173
|
-
else {
|
|
1174
|
-
_queryParams["site_codes"] = siteCodes;
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
if (zipCode != null) {
|
|
1178
|
-
_queryParams["zip_code"] = zipCode;
|
|
1179
|
-
}
|
|
1180
|
-
if (radius != null) {
|
|
1181
|
-
_queryParams["radius"] = radius;
|
|
1182
|
-
}
|
|
1183
1237
|
const _response = yield core.fetcher({
|
|
1184
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1185
|
-
method: "
|
|
1186
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1238
|
+
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`),
|
|
1239
|
+
method: "PATCH",
|
|
1240
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1187
1241
|
contentType: "application/json",
|
|
1188
|
-
queryParameters: _queryParams,
|
|
1189
1242
|
requestType: "json",
|
|
1243
|
+
body: serializers.AppointmentRescheduleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1190
1244
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1191
1245
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1192
1246
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1193
1247
|
});
|
|
1194
1248
|
if (_response.ok) {
|
|
1195
|
-
return serializers.
|
|
1249
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
1196
1250
|
unrecognizedObjectKeys: "passthrough",
|
|
1197
1251
|
allowUnrecognizedUnionMembers: true,
|
|
1198
1252
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1231,27 +1285,29 @@ class LabTests {
|
|
|
1231
1285
|
});
|
|
1232
1286
|
}
|
|
1233
1287
|
/**
|
|
1288
|
+
* Cancel a previously booked at-home phlebotomy appointment.
|
|
1289
|
+
*
|
|
1234
1290
|
* @param {string} orderId - Your Order ID.
|
|
1235
|
-
* @param {Vital.
|
|
1291
|
+
* @param {Vital.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest} request
|
|
1236
1292
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1237
1293
|
*
|
|
1238
1294
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1239
1295
|
*
|
|
1240
1296
|
* @example
|
|
1241
|
-
* await client.labTests.
|
|
1242
|
-
*
|
|
1297
|
+
* await client.labTests.cancelPhlebotomyAppointment("order_id", {
|
|
1298
|
+
* cancellationReasonId: "cancellation_reason_id"
|
|
1243
1299
|
* })
|
|
1244
1300
|
*/
|
|
1245
|
-
|
|
1301
|
+
cancelPhlebotomyAppointment(orderId, request, requestOptions) {
|
|
1246
1302
|
var _a;
|
|
1247
1303
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1248
1304
|
const _response = yield core.fetcher({
|
|
1249
|
-
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)}/
|
|
1250
|
-
method: "
|
|
1251
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1305
|
+
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`),
|
|
1306
|
+
method: "PATCH",
|
|
1307
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1252
1308
|
contentType: "application/json",
|
|
1253
1309
|
requestType: "json",
|
|
1254
|
-
body: serializers.
|
|
1310
|
+
body: serializers.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1255
1311
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1256
1312
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1257
1313
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1296,33 +1352,28 @@ class LabTests {
|
|
|
1296
1352
|
});
|
|
1297
1353
|
}
|
|
1298
1354
|
/**
|
|
1299
|
-
*
|
|
1300
|
-
* @param {Vital.AppointmentRescheduleRequest} request
|
|
1301
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1355
|
+
* Get the list of reasons for cancelling an at-home phlebotomy appointment.
|
|
1302
1356
|
*
|
|
1303
|
-
* @
|
|
1357
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1304
1358
|
*
|
|
1305
1359
|
* @example
|
|
1306
|
-
* await client.labTests.
|
|
1307
|
-
* bookingKey: "booking_key"
|
|
1308
|
-
* })
|
|
1360
|
+
* await client.labTests.getPhlebotomyAppointmentCancellationReason()
|
|
1309
1361
|
*/
|
|
1310
|
-
|
|
1362
|
+
getPhlebotomyAppointmentCancellationReason(requestOptions) {
|
|
1311
1363
|
var _a;
|
|
1312
1364
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1313
1365
|
const _response = yield core.fetcher({
|
|
1314
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1315
|
-
method: "
|
|
1316
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1366
|
+
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"),
|
|
1367
|
+
method: "GET",
|
|
1368
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1317
1369
|
contentType: "application/json",
|
|
1318
1370
|
requestType: "json",
|
|
1319
|
-
body: serializers.AppointmentRescheduleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1320
1371
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1321
1372
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1322
1373
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1323
1374
|
});
|
|
1324
1375
|
if (_response.ok) {
|
|
1325
|
-
return serializers.
|
|
1376
|
+
return serializers.labTests.getPhlebotomyAppointmentCancellationReason.Response.parseOrThrow(_response.body, {
|
|
1326
1377
|
unrecognizedObjectKeys: "passthrough",
|
|
1327
1378
|
allowUnrecognizedUnionMembers: true,
|
|
1328
1379
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1330,20 +1381,10 @@ class LabTests {
|
|
|
1330
1381
|
});
|
|
1331
1382
|
}
|
|
1332
1383
|
if (_response.error.reason === "status-code") {
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
allowUnrecognizedUnionMembers: true,
|
|
1338
|
-
allowUnrecognizedEnumValues: true,
|
|
1339
|
-
breadcrumbsPrefix: ["response"],
|
|
1340
|
-
}));
|
|
1341
|
-
default:
|
|
1342
|
-
throw new errors.VitalError({
|
|
1343
|
-
statusCode: _response.error.statusCode,
|
|
1344
|
-
body: _response.error.body,
|
|
1345
|
-
});
|
|
1346
|
-
}
|
|
1384
|
+
throw new errors.VitalError({
|
|
1385
|
+
statusCode: _response.error.statusCode,
|
|
1386
|
+
body: _response.error.body,
|
|
1387
|
+
});
|
|
1347
1388
|
}
|
|
1348
1389
|
switch (_response.error.reason) {
|
|
1349
1390
|
case "non-json":
|
|
@@ -1361,29 +1402,25 @@ class LabTests {
|
|
|
1361
1402
|
});
|
|
1362
1403
|
}
|
|
1363
1404
|
/**
|
|
1405
|
+
* Get the appointment associated with an order.
|
|
1406
|
+
*
|
|
1364
1407
|
* @param {string} orderId - Your Order ID.
|
|
1365
|
-
* @param {Vital.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest} request
|
|
1366
1408
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1367
1409
|
*
|
|
1368
1410
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1369
1411
|
*
|
|
1370
1412
|
* @example
|
|
1371
|
-
* await client.labTests.
|
|
1372
|
-
* cancellationReasonId: "cancellationReasonId"
|
|
1373
|
-
* })
|
|
1413
|
+
* await client.labTests.getPhlebotomyAppointment("order_id")
|
|
1374
1414
|
*/
|
|
1375
|
-
|
|
1415
|
+
getPhlebotomyAppointment(orderId, requestOptions) {
|
|
1376
1416
|
var _a;
|
|
1377
1417
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1378
1418
|
const _response = yield core.fetcher({
|
|
1379
|
-
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)}/
|
|
1380
|
-
method: "
|
|
1381
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1419
|
+
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`),
|
|
1420
|
+
method: "GET",
|
|
1421
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1382
1422
|
contentType: "application/json",
|
|
1383
1423
|
requestType: "json",
|
|
1384
|
-
body: serializers.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest.jsonOrThrow(request, {
|
|
1385
|
-
unrecognizedObjectKeys: "strip",
|
|
1386
|
-
}),
|
|
1387
1424
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1388
1425
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1389
1426
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1428,26 +1465,55 @@ class LabTests {
|
|
|
1428
1465
|
});
|
|
1429
1466
|
}
|
|
1430
1467
|
/**
|
|
1468
|
+
* GET information about an area with respect to lab-testing.
|
|
1469
|
+
*
|
|
1470
|
+
* Information returned:
|
|
1471
|
+
* * Whether a given zip code is served by our Phlebotomy network.
|
|
1472
|
+
* * List of Lab locations in the area.
|
|
1473
|
+
*
|
|
1474
|
+
* @param {Vital.LabTestsGetAreaInfoRequest} request
|
|
1431
1475
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1432
1476
|
*
|
|
1477
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
|
1478
|
+
*
|
|
1433
1479
|
* @example
|
|
1434
|
-
* await client.labTests.
|
|
1480
|
+
* await client.labTests.getAreaInfo({
|
|
1481
|
+
* zipCode: "zip_code"
|
|
1482
|
+
* })
|
|
1435
1483
|
*/
|
|
1436
|
-
|
|
1484
|
+
getAreaInfo(request, requestOptions) {
|
|
1437
1485
|
var _a;
|
|
1438
1486
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1487
|
+
const { zipCode, radius, lab, labs } = request;
|
|
1488
|
+
const _queryParams = {};
|
|
1489
|
+
_queryParams["zip_code"] = zipCode;
|
|
1490
|
+
if (radius != null) {
|
|
1491
|
+
_queryParams["radius"] = radius;
|
|
1492
|
+
}
|
|
1493
|
+
if (lab != null) {
|
|
1494
|
+
_queryParams["lab"] = lab;
|
|
1495
|
+
}
|
|
1496
|
+
if (labs != null) {
|
|
1497
|
+
if (Array.isArray(labs)) {
|
|
1498
|
+
_queryParams["labs"] = labs.map((item) => item);
|
|
1499
|
+
}
|
|
1500
|
+
else {
|
|
1501
|
+
_queryParams["labs"] = labs;
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1439
1504
|
const _response = yield core.fetcher({
|
|
1440
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/
|
|
1505
|
+
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"),
|
|
1441
1506
|
method: "GET",
|
|
1442
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1507
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1443
1508
|
contentType: "application/json",
|
|
1509
|
+
queryParameters: _queryParams,
|
|
1444
1510
|
requestType: "json",
|
|
1445
1511
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1446
1512
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1447
1513
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1448
1514
|
});
|
|
1449
1515
|
if (_response.ok) {
|
|
1450
|
-
return serializers.
|
|
1516
|
+
return serializers.AreaInfo.parseOrThrow(_response.body, {
|
|
1451
1517
|
unrecognizedObjectKeys: "passthrough",
|
|
1452
1518
|
allowUnrecognizedUnionMembers: true,
|
|
1453
1519
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1455,10 +1521,20 @@ class LabTests {
|
|
|
1455
1521
|
});
|
|
1456
1522
|
}
|
|
1457
1523
|
if (_response.error.reason === "status-code") {
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1524
|
+
switch (_response.error.statusCode) {
|
|
1525
|
+
case 422:
|
|
1526
|
+
throw new Vital.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
1527
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1528
|
+
allowUnrecognizedUnionMembers: true,
|
|
1529
|
+
allowUnrecognizedEnumValues: true,
|
|
1530
|
+
breadcrumbsPrefix: ["response"],
|
|
1531
|
+
}));
|
|
1532
|
+
default:
|
|
1533
|
+
throw new errors.VitalError({
|
|
1534
|
+
statusCode: _response.error.statusCode,
|
|
1535
|
+
body: _response.error.body,
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1462
1538
|
}
|
|
1463
1539
|
switch (_response.error.reason) {
|
|
1464
1540
|
case "non-json":
|
|
@@ -1476,31 +1552,48 @@ class LabTests {
|
|
|
1476
1552
|
});
|
|
1477
1553
|
}
|
|
1478
1554
|
/**
|
|
1479
|
-
*
|
|
1480
|
-
*
|
|
1481
|
-
* @param {string} orderId - Your Order ID.
|
|
1555
|
+
* @param {Vital.LabTestsGetPscInfoRequest} request
|
|
1482
1556
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1483
1557
|
*
|
|
1484
1558
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1485
1559
|
*
|
|
1486
1560
|
* @example
|
|
1487
|
-
* await client.labTests.
|
|
1561
|
+
* await client.labTests.getPscInfo({
|
|
1562
|
+
* zipCode: "zip_code",
|
|
1563
|
+
* labId: 1
|
|
1564
|
+
* })
|
|
1488
1565
|
*/
|
|
1489
|
-
|
|
1566
|
+
getPscInfo(request, requestOptions) {
|
|
1490
1567
|
var _a;
|
|
1491
1568
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1569
|
+
const { zipCode, labId, radius, capabilities } = request;
|
|
1570
|
+
const _queryParams = {};
|
|
1571
|
+
_queryParams["zip_code"] = zipCode;
|
|
1572
|
+
_queryParams["lab_id"] = labId.toString();
|
|
1573
|
+
if (radius != null) {
|
|
1574
|
+
_queryParams["radius"] = radius;
|
|
1575
|
+
}
|
|
1576
|
+
if (capabilities != null) {
|
|
1577
|
+
if (Array.isArray(capabilities)) {
|
|
1578
|
+
_queryParams["capabilities"] = capabilities.map((item) => item);
|
|
1579
|
+
}
|
|
1580
|
+
else {
|
|
1581
|
+
_queryParams["capabilities"] = capabilities;
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1492
1584
|
const _response = yield core.fetcher({
|
|
1493
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1585
|
+
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"),
|
|
1494
1586
|
method: "GET",
|
|
1495
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1587
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1496
1588
|
contentType: "application/json",
|
|
1589
|
+
queryParameters: _queryParams,
|
|
1497
1590
|
requestType: "json",
|
|
1498
1591
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1499
1592
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1500
1593
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1501
1594
|
});
|
|
1502
1595
|
if (_response.ok) {
|
|
1503
|
-
return serializers.
|
|
1596
|
+
return serializers.PscInfo.parseOrThrow(_response.body, {
|
|
1504
1597
|
unrecognizedObjectKeys: "passthrough",
|
|
1505
1598
|
allowUnrecognizedUnionMembers: true,
|
|
1506
1599
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1539,25 +1632,49 @@ class LabTests {
|
|
|
1539
1632
|
});
|
|
1540
1633
|
}
|
|
1541
1634
|
/**
|
|
1542
|
-
*
|
|
1635
|
+
* @param {string} orderId - Your Order ID.
|
|
1636
|
+
* @param {Vital.LabTestsGetOrderPscInfoRequest} request
|
|
1637
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1638
|
+
*
|
|
1543
1639
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1640
|
+
*
|
|
1641
|
+
* @example
|
|
1642
|
+
* await client.labTests.getOrderPscInfo("order_id")
|
|
1544
1643
|
*/
|
|
1545
|
-
|
|
1644
|
+
getOrderPscInfo(orderId, request = {}, requestOptions) {
|
|
1546
1645
|
var _a;
|
|
1547
1646
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1647
|
+
const { radius, capabilities } = request;
|
|
1648
|
+
const _queryParams = {};
|
|
1649
|
+
if (radius != null) {
|
|
1650
|
+
_queryParams["radius"] = radius;
|
|
1651
|
+
}
|
|
1652
|
+
if (capabilities != null) {
|
|
1653
|
+
if (Array.isArray(capabilities)) {
|
|
1654
|
+
_queryParams["capabilities"] = capabilities.map((item) => item);
|
|
1655
|
+
}
|
|
1656
|
+
else {
|
|
1657
|
+
_queryParams["capabilities"] = capabilities;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1548
1660
|
const _response = yield core.fetcher({
|
|
1549
|
-
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)}/
|
|
1661
|
+
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`),
|
|
1550
1662
|
method: "GET",
|
|
1551
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1663
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1552
1664
|
contentType: "application/json",
|
|
1665
|
+
queryParameters: _queryParams,
|
|
1553
1666
|
requestType: "json",
|
|
1554
|
-
responseType: "streaming",
|
|
1555
1667
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1556
1668
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1557
1669
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1558
1670
|
});
|
|
1559
1671
|
if (_response.ok) {
|
|
1560
|
-
return _response.body
|
|
1672
|
+
return serializers.PscInfo.parseOrThrow(_response.body, {
|
|
1673
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1674
|
+
allowUnrecognizedUnionMembers: true,
|
|
1675
|
+
allowUnrecognizedEnumValues: true,
|
|
1676
|
+
breadcrumbsPrefix: ["response"],
|
|
1677
|
+
});
|
|
1561
1678
|
}
|
|
1562
1679
|
if (_response.error.reason === "status-code") {
|
|
1563
1680
|
switch (_response.error.statusCode) {
|
|
@@ -1591,16 +1708,16 @@ class LabTests {
|
|
|
1591
1708
|
});
|
|
1592
1709
|
}
|
|
1593
1710
|
/**
|
|
1594
|
-
*
|
|
1711
|
+
* This endpoint returns the lab results for the order.
|
|
1595
1712
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1596
1713
|
*/
|
|
1597
|
-
|
|
1714
|
+
getResultPdf(orderId, requestOptions) {
|
|
1598
1715
|
var _a;
|
|
1599
1716
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1600
1717
|
const _response = yield core.fetcher({
|
|
1601
|
-
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)}/
|
|
1718
|
+
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`),
|
|
1602
1719
|
method: "GET",
|
|
1603
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1720
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1604
1721
|
contentType: "application/json",
|
|
1605
1722
|
requestType: "json",
|
|
1606
1723
|
responseType: "streaming",
|
|
@@ -1643,25 +1760,37 @@ class LabTests {
|
|
|
1643
1760
|
});
|
|
1644
1761
|
}
|
|
1645
1762
|
/**
|
|
1646
|
-
*
|
|
1763
|
+
* Return metadata related to order results, such as lab metadata,
|
|
1764
|
+
* provider and sample dates.
|
|
1765
|
+
*
|
|
1766
|
+
* @param {string} orderId
|
|
1767
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1768
|
+
*
|
|
1647
1769
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1770
|
+
*
|
|
1771
|
+
* @example
|
|
1772
|
+
* await client.labTests.getResultMetadata("order_id")
|
|
1648
1773
|
*/
|
|
1649
|
-
|
|
1774
|
+
getResultMetadata(orderId, requestOptions) {
|
|
1650
1775
|
var _a;
|
|
1651
1776
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1652
1777
|
const _response = yield core.fetcher({
|
|
1653
|
-
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)}/
|
|
1778
|
+
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`),
|
|
1654
1779
|
method: "GET",
|
|
1655
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1780
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1656
1781
|
contentType: "application/json",
|
|
1657
1782
|
requestType: "json",
|
|
1658
|
-
responseType: "streaming",
|
|
1659
1783
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1660
1784
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1661
1785
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1662
1786
|
});
|
|
1663
1787
|
if (_response.ok) {
|
|
1664
|
-
return _response.body
|
|
1788
|
+
return serializers.LabResultsMetadata.parseOrThrow(_response.body, {
|
|
1789
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1790
|
+
allowUnrecognizedUnionMembers: true,
|
|
1791
|
+
allowUnrecognizedEnumValues: true,
|
|
1792
|
+
breadcrumbsPrefix: ["response"],
|
|
1793
|
+
});
|
|
1665
1794
|
}
|
|
1666
1795
|
if (_response.error.reason === "status-code") {
|
|
1667
1796
|
switch (_response.error.statusCode) {
|
|
@@ -1695,23 +1824,23 @@ class LabTests {
|
|
|
1695
1824
|
});
|
|
1696
1825
|
}
|
|
1697
1826
|
/**
|
|
1698
|
-
*
|
|
1827
|
+
* Return both metadata and raw json test data
|
|
1699
1828
|
*
|
|
1700
|
-
* @param {string} orderId
|
|
1829
|
+
* @param {string} orderId
|
|
1701
1830
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1702
1831
|
*
|
|
1703
1832
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1704
1833
|
*
|
|
1705
1834
|
* @example
|
|
1706
|
-
* await client.labTests.
|
|
1835
|
+
* await client.labTests.getResultRaw("order_id")
|
|
1707
1836
|
*/
|
|
1708
|
-
|
|
1837
|
+
getResultRaw(orderId, requestOptions) {
|
|
1709
1838
|
var _a;
|
|
1710
1839
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1711
1840
|
const _response = yield core.fetcher({
|
|
1712
|
-
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)}`),
|
|
1841
|
+
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`),
|
|
1713
1842
|
method: "GET",
|
|
1714
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1843
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1715
1844
|
contentType: "application/json",
|
|
1716
1845
|
requestType: "json",
|
|
1717
1846
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1719,7 +1848,7 @@ class LabTests {
|
|
|
1719
1848
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1720
1849
|
});
|
|
1721
1850
|
if (_response.ok) {
|
|
1722
|
-
return serializers.
|
|
1851
|
+
return serializers.LabResultsRaw.parseOrThrow(_response.body, {
|
|
1723
1852
|
unrecognizedObjectKeys: "passthrough",
|
|
1724
1853
|
allowUnrecognizedUnionMembers: true,
|
|
1725
1854
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1758,53 +1887,32 @@ class LabTests {
|
|
|
1758
1887
|
});
|
|
1759
1888
|
}
|
|
1760
1889
|
/**
|
|
1761
|
-
*
|
|
1762
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1763
|
-
*
|
|
1890
|
+
* This endpoint returns the printed labels for the order.
|
|
1764
1891
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1765
|
-
*
|
|
1766
|
-
* @example
|
|
1767
|
-
* await client.labTests.createOrder({
|
|
1768
|
-
* userId: "user_id",
|
|
1769
|
-
* patientDetails: {
|
|
1770
|
-
* firstName: "first_name",
|
|
1771
|
-
* lastName: "last_name",
|
|
1772
|
-
* dob: "dob",
|
|
1773
|
-
* gender: "female",
|
|
1774
|
-
* phoneNumber: "phone_number",
|
|
1775
|
-
* email: "email"
|
|
1776
|
-
* },
|
|
1777
|
-
* patientAddress: {
|
|
1778
|
-
* firstLine: "first_line",
|
|
1779
|
-
* city: "city",
|
|
1780
|
-
* state: "state",
|
|
1781
|
-
* zip: "zip",
|
|
1782
|
-
* country: "country"
|
|
1783
|
-
* }
|
|
1784
|
-
* })
|
|
1785
1892
|
*/
|
|
1786
|
-
|
|
1893
|
+
getLabelsPdf(orderId, request, requestOptions) {
|
|
1787
1894
|
var _a;
|
|
1788
1895
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1789
|
-
const {
|
|
1896
|
+
const { numberOfLabels, collectionDate } = request;
|
|
1897
|
+
const _queryParams = {};
|
|
1898
|
+
if (numberOfLabels != null) {
|
|
1899
|
+
_queryParams["number_of_labels"] = numberOfLabels.toString();
|
|
1900
|
+
}
|
|
1901
|
+
_queryParams["collection_date"] = collectionDate.toISOString();
|
|
1790
1902
|
const _response = yield core.fetcher({
|
|
1791
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
1792
|
-
method: "
|
|
1793
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1903
|
+
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`),
|
|
1904
|
+
method: "GET",
|
|
1905
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1794
1906
|
contentType: "application/json",
|
|
1907
|
+
queryParameters: _queryParams,
|
|
1795
1908
|
requestType: "json",
|
|
1796
|
-
|
|
1909
|
+
responseType: "streaming",
|
|
1797
1910
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1798
1911
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1799
1912
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1800
1913
|
});
|
|
1801
1914
|
if (_response.ok) {
|
|
1802
|
-
return
|
|
1803
|
-
unrecognizedObjectKeys: "passthrough",
|
|
1804
|
-
allowUnrecognizedUnionMembers: true,
|
|
1805
|
-
allowUnrecognizedEnumValues: true,
|
|
1806
|
-
breadcrumbsPrefix: ["response"],
|
|
1807
|
-
});
|
|
1915
|
+
return _response.body;
|
|
1808
1916
|
}
|
|
1809
1917
|
if (_response.error.reason === "status-code") {
|
|
1810
1918
|
switch (_response.error.statusCode) {
|
|
@@ -1838,52 +1946,52 @@ class LabTests {
|
|
|
1838
1946
|
});
|
|
1839
1947
|
}
|
|
1840
1948
|
/**
|
|
1841
|
-
* @param {Vital.
|
|
1949
|
+
* @param {Vital.LabTestsGetPscAppointmentAvailabilityRequest} request
|
|
1842
1950
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1843
1951
|
*
|
|
1844
1952
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1845
1953
|
*
|
|
1846
1954
|
* @example
|
|
1847
|
-
* await client.labTests.
|
|
1848
|
-
*
|
|
1849
|
-
* billingType: "client_bill",
|
|
1850
|
-
* orderSet: {},
|
|
1851
|
-
* collectionMethod: "testkit",
|
|
1852
|
-
* patientDetails: {
|
|
1853
|
-
* firstName: "first_name",
|
|
1854
|
-
* lastName: "last_name",
|
|
1855
|
-
* dob: "dob",
|
|
1856
|
-
* gender: "female",
|
|
1857
|
-
* phoneNumber: "phone_number",
|
|
1858
|
-
* email: "email"
|
|
1859
|
-
* },
|
|
1860
|
-
* patientAddress: {
|
|
1861
|
-
* receiverName: "receiver_name",
|
|
1862
|
-
* firstLine: "first_line",
|
|
1863
|
-
* city: "city",
|
|
1864
|
-
* state: "state",
|
|
1865
|
-
* zip: "zip",
|
|
1866
|
-
* country: "country"
|
|
1867
|
-
* },
|
|
1868
|
-
* sampleId: "sample_id"
|
|
1955
|
+
* await client.labTests.getPscAppointmentAvailability({
|
|
1956
|
+
* lab: "quest"
|
|
1869
1957
|
* })
|
|
1870
1958
|
*/
|
|
1871
|
-
|
|
1959
|
+
getPscAppointmentAvailability(request, requestOptions) {
|
|
1872
1960
|
var _a;
|
|
1873
1961
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1962
|
+
const { lab, startDate, siteCodes, zipCode, radius } = request;
|
|
1963
|
+
const _queryParams = {};
|
|
1964
|
+
_queryParams["lab"] = lab;
|
|
1965
|
+
if (startDate != null) {
|
|
1966
|
+
_queryParams["start_date"] = startDate;
|
|
1967
|
+
}
|
|
1968
|
+
if (siteCodes != null) {
|
|
1969
|
+
if (Array.isArray(siteCodes)) {
|
|
1970
|
+
_queryParams["site_codes"] = siteCodes.map((item) => item);
|
|
1971
|
+
}
|
|
1972
|
+
else {
|
|
1973
|
+
_queryParams["site_codes"] = siteCodes;
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
if (zipCode != null) {
|
|
1977
|
+
_queryParams["zip_code"] = zipCode;
|
|
1978
|
+
}
|
|
1979
|
+
if (radius != null) {
|
|
1980
|
+
_queryParams["radius"] = radius;
|
|
1981
|
+
}
|
|
1874
1982
|
const _response = yield core.fetcher({
|
|
1875
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order/
|
|
1983
|
+
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"),
|
|
1876
1984
|
method: "POST",
|
|
1877
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
1985
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1878
1986
|
contentType: "application/json",
|
|
1987
|
+
queryParameters: _queryParams,
|
|
1879
1988
|
requestType: "json",
|
|
1880
|
-
body: serializers.ImportOrderBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1881
1989
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1882
1990
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1883
1991
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1884
1992
|
});
|
|
1885
1993
|
if (_response.ok) {
|
|
1886
|
-
return serializers.
|
|
1994
|
+
return serializers.AppointmentAvailabilitySlots.parseOrThrow(_response.body, {
|
|
1887
1995
|
unrecognizedObjectKeys: "passthrough",
|
|
1888
1996
|
allowUnrecognizedUnionMembers: true,
|
|
1889
1997
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1922,31 +2030,33 @@ class LabTests {
|
|
|
1922
2030
|
});
|
|
1923
2031
|
}
|
|
1924
2032
|
/**
|
|
1925
|
-
* POST cancel order
|
|
1926
|
-
*
|
|
1927
2033
|
* @param {string} orderId - Your Order ID.
|
|
2034
|
+
* @param {Vital.AppointmentBookingRequest} request
|
|
1928
2035
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1929
2036
|
*
|
|
1930
2037
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1931
2038
|
*
|
|
1932
2039
|
* @example
|
|
1933
|
-
* await client.labTests.
|
|
2040
|
+
* await client.labTests.bookPscAppointment("order_id", {
|
|
2041
|
+
* bookingKey: "booking_key"
|
|
2042
|
+
* })
|
|
1934
2043
|
*/
|
|
1935
|
-
|
|
2044
|
+
bookPscAppointment(orderId, request, requestOptions) {
|
|
1936
2045
|
var _a;
|
|
1937
2046
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1938
2047
|
const _response = yield core.fetcher({
|
|
1939
|
-
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)}/
|
|
2048
|
+
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`),
|
|
1940
2049
|
method: "POST",
|
|
1941
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2050
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1942
2051
|
contentType: "application/json",
|
|
1943
2052
|
requestType: "json",
|
|
2053
|
+
body: serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1944
2054
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1945
2055
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1946
2056
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1947
2057
|
});
|
|
1948
2058
|
if (_response.ok) {
|
|
1949
|
-
return serializers.
|
|
2059
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
1950
2060
|
unrecognizedObjectKeys: "passthrough",
|
|
1951
2061
|
allowUnrecognizedUnionMembers: true,
|
|
1952
2062
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1985,48 +2095,38 @@ class LabTests {
|
|
|
1985
2095
|
});
|
|
1986
2096
|
}
|
|
1987
2097
|
/**
|
|
1988
|
-
*
|
|
1989
|
-
*
|
|
1990
|
-
* @param {string} orderId
|
|
1991
|
-
* @param {Vital.LabTestsSimulateOrderProcessRequest} request
|
|
2098
|
+
* @param {string} orderId - Your Order ID.
|
|
2099
|
+
* @param {Vital.AppointmentRescheduleRequest} request
|
|
1992
2100
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
1993
2101
|
*
|
|
1994
2102
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
1995
2103
|
*
|
|
1996
2104
|
* @example
|
|
1997
|
-
* await client.labTests.
|
|
1998
|
-
*
|
|
2105
|
+
* await client.labTests.reschedulePscAppointment("order_id", {
|
|
2106
|
+
* bookingKey: "booking_key"
|
|
1999
2107
|
* })
|
|
2000
2108
|
*/
|
|
2001
|
-
|
|
2109
|
+
reschedulePscAppointment(orderId, request, requestOptions) {
|
|
2002
2110
|
var _a;
|
|
2003
2111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2004
|
-
const { finalStatus, delay, body: _body } = request;
|
|
2005
|
-
const _queryParams = {};
|
|
2006
|
-
if (finalStatus != null) {
|
|
2007
|
-
_queryParams["final_status"] = finalStatus;
|
|
2008
|
-
}
|
|
2009
|
-
if (delay != null) {
|
|
2010
|
-
_queryParams["delay"] = delay.toString();
|
|
2011
|
-
}
|
|
2012
2112
|
const _response = yield core.fetcher({
|
|
2013
|
-
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)}/
|
|
2014
|
-
method: "
|
|
2015
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2113
|
+
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`),
|
|
2114
|
+
method: "PATCH",
|
|
2115
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2016
2116
|
contentType: "application/json",
|
|
2017
|
-
queryParameters: _queryParams,
|
|
2018
2117
|
requestType: "json",
|
|
2019
|
-
body:
|
|
2020
|
-
? serializers.labTests.simulateOrderProcess.Request.jsonOrThrow(_body, {
|
|
2021
|
-
unrecognizedObjectKeys: "strip",
|
|
2022
|
-
})
|
|
2023
|
-
: undefined,
|
|
2118
|
+
body: serializers.AppointmentRescheduleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
2024
2119
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2025
2120
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2026
2121
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2027
2122
|
});
|
|
2028
2123
|
if (_response.ok) {
|
|
2029
|
-
return _response.body
|
|
2124
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
2125
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2126
|
+
allowUnrecognizedUnionMembers: true,
|
|
2127
|
+
allowUnrecognizedEnumValues: true,
|
|
2128
|
+
breadcrumbsPrefix: ["response"],
|
|
2129
|
+
});
|
|
2030
2130
|
}
|
|
2031
2131
|
if (_response.error.reason === "status-code") {
|
|
2032
2132
|
switch (_response.error.statusCode) {
|
|
@@ -2060,31 +2160,35 @@ class LabTests {
|
|
|
2060
2160
|
});
|
|
2061
2161
|
}
|
|
2062
2162
|
/**
|
|
2063
|
-
* PATCH update on site collection order when draw is completed
|
|
2064
|
-
*
|
|
2065
2163
|
* @param {string} orderId - Your Order ID.
|
|
2164
|
+
* @param {Vital.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest} request
|
|
2066
2165
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2067
2166
|
*
|
|
2068
2167
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2069
2168
|
*
|
|
2070
2169
|
* @example
|
|
2071
|
-
* await client.labTests.
|
|
2170
|
+
* await client.labTests.cancelPscAppointment("order_id", {
|
|
2171
|
+
* cancellationReasonId: "cancellationReasonId"
|
|
2172
|
+
* })
|
|
2072
2173
|
*/
|
|
2073
|
-
|
|
2174
|
+
cancelPscAppointment(orderId, request, requestOptions) {
|
|
2074
2175
|
var _a;
|
|
2075
2176
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2076
2177
|
const _response = yield core.fetcher({
|
|
2077
|
-
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)}/
|
|
2178
|
+
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`),
|
|
2078
2179
|
method: "PATCH",
|
|
2079
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2180
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2080
2181
|
contentType: "application/json",
|
|
2081
2182
|
requestType: "json",
|
|
2183
|
+
body: serializers.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest.jsonOrThrow(request, {
|
|
2184
|
+
unrecognizedObjectKeys: "strip",
|
|
2185
|
+
}),
|
|
2082
2186
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2083
2187
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2084
2188
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2085
2189
|
});
|
|
2086
2190
|
if (_response.ok) {
|
|
2087
|
-
return serializers.
|
|
2191
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
2088
2192
|
unrecognizedObjectKeys: "passthrough",
|
|
2089
2193
|
allowUnrecognizedUnionMembers: true,
|
|
2090
2194
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2123,71 +2227,26 @@ class LabTests {
|
|
|
2123
2227
|
});
|
|
2124
2228
|
}
|
|
2125
2229
|
/**
|
|
2126
|
-
* GET all the lab tests the team has access to.
|
|
2127
|
-
*
|
|
2128
|
-
* @param {Vital.LabTestsGetRequest} request
|
|
2129
2230
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2130
2231
|
*
|
|
2131
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
|
2132
|
-
*
|
|
2133
2232
|
* @example
|
|
2134
|
-
* await client.labTests.
|
|
2233
|
+
* await client.labTests.getPscAppointmentCancellationReason()
|
|
2135
2234
|
*/
|
|
2136
|
-
|
|
2235
|
+
getPscAppointmentCancellationReason(requestOptions) {
|
|
2137
2236
|
var _a;
|
|
2138
2237
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2139
|
-
const { generationMethod, labSlug, collectionMethod, status, markerIds, providerIds, name, orderKey, orderDirection, } = request;
|
|
2140
|
-
const _queryParams = {};
|
|
2141
|
-
if (generationMethod != null) {
|
|
2142
|
-
_queryParams["generation_method"] = generationMethod;
|
|
2143
|
-
}
|
|
2144
|
-
if (labSlug != null) {
|
|
2145
|
-
_queryParams["lab_slug"] = labSlug;
|
|
2146
|
-
}
|
|
2147
|
-
if (collectionMethod != null) {
|
|
2148
|
-
_queryParams["collection_method"] = collectionMethod;
|
|
2149
|
-
}
|
|
2150
|
-
if (status != null) {
|
|
2151
|
-
_queryParams["status"] = status;
|
|
2152
|
-
}
|
|
2153
|
-
if (markerIds != null) {
|
|
2154
|
-
if (Array.isArray(markerIds)) {
|
|
2155
|
-
_queryParams["marker_ids"] = markerIds.map((item) => item.toString());
|
|
2156
|
-
}
|
|
2157
|
-
else {
|
|
2158
|
-
_queryParams["marker_ids"] = markerIds.toString();
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
if (providerIds != null) {
|
|
2162
|
-
if (Array.isArray(providerIds)) {
|
|
2163
|
-
_queryParams["provider_ids"] = providerIds.map((item) => item);
|
|
2164
|
-
}
|
|
2165
|
-
else {
|
|
2166
|
-
_queryParams["provider_ids"] = providerIds;
|
|
2167
|
-
}
|
|
2168
|
-
}
|
|
2169
|
-
if (name != null) {
|
|
2170
|
-
_queryParams["name"] = name;
|
|
2171
|
-
}
|
|
2172
|
-
if (orderKey != null) {
|
|
2173
|
-
_queryParams["order_key"] = orderKey;
|
|
2174
|
-
}
|
|
2175
|
-
if (orderDirection != null) {
|
|
2176
|
-
_queryParams["order_direction"] = orderDirection;
|
|
2177
|
-
}
|
|
2178
2238
|
const _response = yield core.fetcher({
|
|
2179
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/
|
|
2239
|
+
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"),
|
|
2180
2240
|
method: "GET",
|
|
2181
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2241
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2182
2242
|
contentType: "application/json",
|
|
2183
|
-
queryParameters: _queryParams,
|
|
2184
2243
|
requestType: "json",
|
|
2185
2244
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2186
2245
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2187
2246
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2188
2247
|
});
|
|
2189
2248
|
if (_response.ok) {
|
|
2190
|
-
return serializers.labTests.
|
|
2249
|
+
return serializers.labTests.getPscAppointmentCancellationReason.Response.parseOrThrow(_response.body, {
|
|
2191
2250
|
unrecognizedObjectKeys: "passthrough",
|
|
2192
2251
|
allowUnrecognizedUnionMembers: true,
|
|
2193
2252
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2195,20 +2254,10 @@ class LabTests {
|
|
|
2195
2254
|
});
|
|
2196
2255
|
}
|
|
2197
2256
|
if (_response.error.reason === "status-code") {
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
allowUnrecognizedUnionMembers: true,
|
|
2203
|
-
allowUnrecognizedEnumValues: true,
|
|
2204
|
-
breadcrumbsPrefix: ["response"],
|
|
2205
|
-
}));
|
|
2206
|
-
default:
|
|
2207
|
-
throw new errors.VitalError({
|
|
2208
|
-
statusCode: _response.error.statusCode,
|
|
2209
|
-
body: _response.error.body,
|
|
2210
|
-
});
|
|
2211
|
-
}
|
|
2257
|
+
throw new errors.VitalError({
|
|
2258
|
+
statusCode: _response.error.statusCode,
|
|
2259
|
+
body: _response.error.body,
|
|
2260
|
+
});
|
|
2212
2261
|
}
|
|
2213
2262
|
switch (_response.error.reason) {
|
|
2214
2263
|
case "non-json":
|
|
@@ -2226,34 +2275,31 @@ class LabTests {
|
|
|
2226
2275
|
});
|
|
2227
2276
|
}
|
|
2228
2277
|
/**
|
|
2229
|
-
*
|
|
2278
|
+
* Get the appointment associated with an order.
|
|
2279
|
+
*
|
|
2280
|
+
* @param {string} orderId - Your Order ID.
|
|
2230
2281
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2231
2282
|
*
|
|
2232
2283
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2233
2284
|
*
|
|
2234
2285
|
* @example
|
|
2235
|
-
* await client.labTests.
|
|
2236
|
-
* name: "name",
|
|
2237
|
-
* method: "testkit",
|
|
2238
|
-
* description: "description"
|
|
2239
|
-
* })
|
|
2286
|
+
* await client.labTests.getPscAppointment("order_id")
|
|
2240
2287
|
*/
|
|
2241
|
-
|
|
2288
|
+
getPscAppointment(orderId, requestOptions) {
|
|
2242
2289
|
var _a;
|
|
2243
2290
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2244
2291
|
const _response = yield core.fetcher({
|
|
2245
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2246
|
-
method: "
|
|
2247
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2292
|
+
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`),
|
|
2293
|
+
method: "GET",
|
|
2294
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2248
2295
|
contentType: "application/json",
|
|
2249
2296
|
requestType: "json",
|
|
2250
|
-
body: serializers.CreateLabTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
2251
2297
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2252
2298
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2253
2299
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2254
2300
|
});
|
|
2255
2301
|
if (_response.ok) {
|
|
2256
|
-
return serializers.
|
|
2302
|
+
return serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
|
2257
2303
|
unrecognizedObjectKeys: "passthrough",
|
|
2258
2304
|
allowUnrecognizedUnionMembers: true,
|
|
2259
2305
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2292,36 +2338,25 @@ class LabTests {
|
|
|
2292
2338
|
});
|
|
2293
2339
|
}
|
|
2294
2340
|
/**
|
|
2295
|
-
* GET
|
|
2296
|
-
*
|
|
2297
|
-
* @param {string} labTestId
|
|
2298
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2299
|
-
*
|
|
2341
|
+
* GET collection instructions for an order
|
|
2300
2342
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2301
|
-
*
|
|
2302
|
-
* @example
|
|
2303
|
-
* await client.labTests.getById("lab_test_id")
|
|
2304
2343
|
*/
|
|
2305
|
-
|
|
2344
|
+
getOrderCollectionInstructionPdf(orderId, requestOptions) {
|
|
2306
2345
|
var _a;
|
|
2307
2346
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2308
2347
|
const _response = yield core.fetcher({
|
|
2309
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
2348
|
+
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`),
|
|
2310
2349
|
method: "GET",
|
|
2311
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2350
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2312
2351
|
contentType: "application/json",
|
|
2313
2352
|
requestType: "json",
|
|
2353
|
+
responseType: "streaming",
|
|
2314
2354
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2315
2355
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2316
2356
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2317
2357
|
});
|
|
2318
2358
|
if (_response.ok) {
|
|
2319
|
-
return
|
|
2320
|
-
unrecognizedObjectKeys: "passthrough",
|
|
2321
|
-
allowUnrecognizedUnionMembers: true,
|
|
2322
|
-
allowUnrecognizedEnumValues: true,
|
|
2323
|
-
breadcrumbsPrefix: ["response"],
|
|
2324
|
-
});
|
|
2359
|
+
return _response.body;
|
|
2325
2360
|
}
|
|
2326
2361
|
if (_response.error.reason === "status-code") {
|
|
2327
2362
|
switch (_response.error.statusCode) {
|
|
@@ -2355,36 +2390,25 @@ class LabTests {
|
|
|
2355
2390
|
});
|
|
2356
2391
|
}
|
|
2357
2392
|
/**
|
|
2358
|
-
*
|
|
2359
|
-
* @param {Vital.UpdateLabTestRequest} request
|
|
2360
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2361
|
-
*
|
|
2393
|
+
* GET requisition pdf for an order
|
|
2362
2394
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2363
|
-
*
|
|
2364
|
-
* @example
|
|
2365
|
-
* await client.labTests.updateLabTest("lab_test_id")
|
|
2366
2395
|
*/
|
|
2367
|
-
|
|
2396
|
+
getOrderRequistionPdf(orderId, requestOptions) {
|
|
2368
2397
|
var _a;
|
|
2369
2398
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2370
2399
|
const _response = yield core.fetcher({
|
|
2371
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
2372
|
-
method: "
|
|
2373
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2400
|
+
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`),
|
|
2401
|
+
method: "GET",
|
|
2402
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2374
2403
|
contentType: "application/json",
|
|
2375
2404
|
requestType: "json",
|
|
2376
|
-
|
|
2405
|
+
responseType: "streaming",
|
|
2377
2406
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2378
2407
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2379
2408
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2380
2409
|
});
|
|
2381
2410
|
if (_response.ok) {
|
|
2382
|
-
return
|
|
2383
|
-
unrecognizedObjectKeys: "passthrough",
|
|
2384
|
-
allowUnrecognizedUnionMembers: true,
|
|
2385
|
-
allowUnrecognizedEnumValues: true,
|
|
2386
|
-
breadcrumbsPrefix: ["response"],
|
|
2387
|
-
});
|
|
2411
|
+
return _response.body;
|
|
2388
2412
|
}
|
|
2389
2413
|
if (_response.error.reason === "status-code") {
|
|
2390
2414
|
switch (_response.error.statusCode) {
|
|
@@ -2412,65 +2436,31 @@ class LabTests {
|
|
|
2412
2436
|
throw new errors.VitalTimeoutError();
|
|
2413
2437
|
case "unknown":
|
|
2414
2438
|
throw new errors.VitalError({
|
|
2415
|
-
message: _response.error.errorMessage,
|
|
2416
|
-
});
|
|
2417
|
-
}
|
|
2418
|
-
});
|
|
2419
|
-
}
|
|
2420
|
-
/**
|
|
2421
|
-
* GET all the markers for the given lab.
|
|
2422
|
-
*
|
|
2423
|
-
* @param {Vital.LabTestsGetMarkersRequest} request
|
|
2424
|
-
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2425
|
-
*
|
|
2426
|
-
* @throws {@link Vital.UnprocessableEntityError}
|
|
2427
|
-
*
|
|
2428
|
-
* @example
|
|
2429
|
-
* await client.labTests.getMarkers()
|
|
2430
|
-
*/
|
|
2431
|
-
getMarkers(request = {}, requestOptions) {
|
|
2432
|
-
var _a;
|
|
2433
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2434
|
-
const { labId, name, aLaCarteEnabled, page, size } = request;
|
|
2435
|
-
const _queryParams = {};
|
|
2436
|
-
if (labId != null) {
|
|
2437
|
-
if (Array.isArray(labId)) {
|
|
2438
|
-
_queryParams["lab_id"] = labId.map((item) => item.toString());
|
|
2439
|
-
}
|
|
2440
|
-
else {
|
|
2441
|
-
_queryParams["lab_id"] = labId.toString();
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
|
-
if (name != null) {
|
|
2445
|
-
_queryParams["name"] = name;
|
|
2446
|
-
}
|
|
2447
|
-
if (aLaCarteEnabled != null) {
|
|
2448
|
-
_queryParams["a_la_carte_enabled"] = aLaCarteEnabled.toString();
|
|
2449
|
-
}
|
|
2450
|
-
if (page != null) {
|
|
2451
|
-
_queryParams["page"] = page.toString();
|
|
2452
|
-
}
|
|
2453
|
-
if (size != null) {
|
|
2454
|
-
_queryParams["size"] = size.toString();
|
|
2439
|
+
message: _response.error.errorMessage,
|
|
2440
|
+
});
|
|
2455
2441
|
}
|
|
2442
|
+
});
|
|
2443
|
+
}
|
|
2444
|
+
/**
|
|
2445
|
+
* GET ABN pdf for an order
|
|
2446
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
|
2447
|
+
*/
|
|
2448
|
+
getOrderAbnPdf(orderId, requestOptions) {
|
|
2449
|
+
var _a;
|
|
2450
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2456
2451
|
const _response = yield core.fetcher({
|
|
2457
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2452
|
+
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`),
|
|
2458
2453
|
method: "GET",
|
|
2459
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2454
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2460
2455
|
contentType: "application/json",
|
|
2461
|
-
queryParameters: _queryParams,
|
|
2462
2456
|
requestType: "json",
|
|
2457
|
+
responseType: "streaming",
|
|
2463
2458
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2464
2459
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2465
2460
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2466
2461
|
});
|
|
2467
2462
|
if (_response.ok) {
|
|
2468
|
-
return
|
|
2469
|
-
unrecognizedObjectKeys: "passthrough",
|
|
2470
|
-
allowUnrecognizedUnionMembers: true,
|
|
2471
|
-
allowUnrecognizedEnumValues: true,
|
|
2472
|
-
breadcrumbsPrefix: ["response"],
|
|
2473
|
-
});
|
|
2463
|
+
return _response.body;
|
|
2474
2464
|
}
|
|
2475
2465
|
if (_response.error.reason === "status-code") {
|
|
2476
2466
|
switch (_response.error.statusCode) {
|
|
@@ -2504,41 +2494,31 @@ class LabTests {
|
|
|
2504
2494
|
});
|
|
2505
2495
|
}
|
|
2506
2496
|
/**
|
|
2507
|
-
*
|
|
2497
|
+
* GET individual order by ID.
|
|
2498
|
+
*
|
|
2499
|
+
* @param {string} orderId - Your Order ID.
|
|
2508
2500
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2509
2501
|
*
|
|
2510
2502
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2511
2503
|
*
|
|
2512
2504
|
* @example
|
|
2513
|
-
* await client.labTests.
|
|
2514
|
-
* body: {}
|
|
2515
|
-
* })
|
|
2505
|
+
* await client.labTests.getOrder("order_id")
|
|
2516
2506
|
*/
|
|
2517
|
-
|
|
2507
|
+
getOrder(orderId, requestOptions) {
|
|
2518
2508
|
var _a;
|
|
2519
2509
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2520
|
-
const { page, size, body: _body } = request;
|
|
2521
|
-
const _queryParams = {};
|
|
2522
|
-
if (page != null) {
|
|
2523
|
-
_queryParams["page"] = page.toString();
|
|
2524
|
-
}
|
|
2525
|
-
if (size != null) {
|
|
2526
|
-
_queryParams["size"] = size.toString();
|
|
2527
|
-
}
|
|
2528
2510
|
const _response = yield core.fetcher({
|
|
2529
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2530
|
-
method: "
|
|
2531
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2511
|
+
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)}`),
|
|
2512
|
+
method: "GET",
|
|
2513
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2532
2514
|
contentType: "application/json",
|
|
2533
|
-
queryParameters: _queryParams,
|
|
2534
2515
|
requestType: "json",
|
|
2535
|
-
body: serializers.OrderSetRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
2536
2516
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2537
2517
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2538
2518
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2539
2519
|
});
|
|
2540
2520
|
if (_response.ok) {
|
|
2541
|
-
return serializers.
|
|
2521
|
+
return serializers.ClientFacingOrder.parseOrThrow(_response.body, {
|
|
2542
2522
|
unrecognizedObjectKeys: "passthrough",
|
|
2543
2523
|
allowUnrecognizedUnionMembers: true,
|
|
2544
2524
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2577,39 +2557,48 @@ class LabTests {
|
|
|
2577
2557
|
});
|
|
2578
2558
|
}
|
|
2579
2559
|
/**
|
|
2580
|
-
* @param {
|
|
2581
|
-
* @param {Vital.LabTestsGetMarkersForLabTestRequest} request
|
|
2560
|
+
* @param {Vital.CreateOrderRequestCompatible} request
|
|
2582
2561
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2583
2562
|
*
|
|
2584
2563
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2585
2564
|
*
|
|
2586
2565
|
* @example
|
|
2587
|
-
* await client.labTests.
|
|
2566
|
+
* await client.labTests.createOrder({
|
|
2567
|
+
* userId: "user_id",
|
|
2568
|
+
* patientDetails: {
|
|
2569
|
+
* firstName: "first_name",
|
|
2570
|
+
* lastName: "last_name",
|
|
2571
|
+
* dob: "dob",
|
|
2572
|
+
* gender: "female",
|
|
2573
|
+
* phoneNumber: "phone_number",
|
|
2574
|
+
* email: "email"
|
|
2575
|
+
* },
|
|
2576
|
+
* patientAddress: {
|
|
2577
|
+
* firstLine: "first_line",
|
|
2578
|
+
* city: "city",
|
|
2579
|
+
* state: "state",
|
|
2580
|
+
* zip: "zip",
|
|
2581
|
+
* country: "country"
|
|
2582
|
+
* }
|
|
2583
|
+
* })
|
|
2588
2584
|
*/
|
|
2589
|
-
|
|
2585
|
+
createOrder(request, requestOptions) {
|
|
2590
2586
|
var _a;
|
|
2591
2587
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2592
|
-
const {
|
|
2593
|
-
const _queryParams = {};
|
|
2594
|
-
if (page != null) {
|
|
2595
|
-
_queryParams["page"] = page.toString();
|
|
2596
|
-
}
|
|
2597
|
-
if (size != null) {
|
|
2598
|
-
_queryParams["size"] = size.toString();
|
|
2599
|
-
}
|
|
2588
|
+
const { idempotencyKey } = request, _body = __rest(request, ["idempotencyKey"]);
|
|
2600
2589
|
const _response = yield core.fetcher({
|
|
2601
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2602
|
-
method: "
|
|
2603
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2590
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/order"),
|
|
2591
|
+
method: "POST",
|
|
2592
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, "X-Idempotency-Key": idempotencyKey != null ? idempotencyKey : undefined }, (yield this._getCustomAuthorizationHeaders())),
|
|
2604
2593
|
contentType: "application/json",
|
|
2605
|
-
queryParameters: _queryParams,
|
|
2606
2594
|
requestType: "json",
|
|
2595
|
+
body: serializers.CreateOrderRequestCompatible.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
2607
2596
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2608
2597
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2609
2598
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2610
2599
|
});
|
|
2611
2600
|
if (_response.ok) {
|
|
2612
|
-
return serializers.
|
|
2601
|
+
return serializers.PostOrderResponse.parseOrThrow(_response.body, {
|
|
2613
2602
|
unrecognizedObjectKeys: "passthrough",
|
|
2614
2603
|
allowUnrecognizedUnionMembers: true,
|
|
2615
2604
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2648,32 +2637,52 @@ class LabTests {
|
|
|
2648
2637
|
});
|
|
2649
2638
|
}
|
|
2650
2639
|
/**
|
|
2651
|
-
*
|
|
2652
|
-
*
|
|
2653
|
-
* @param {string} providerId
|
|
2654
|
-
* @param {number} labId
|
|
2640
|
+
* @param {Vital.ImportOrderBody} request
|
|
2655
2641
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2656
2642
|
*
|
|
2657
2643
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2658
2644
|
*
|
|
2659
2645
|
* @example
|
|
2660
|
-
* await client.labTests.
|
|
2646
|
+
* await client.labTests.importOrder({
|
|
2647
|
+
* userId: "user_id",
|
|
2648
|
+
* billingType: "client_bill",
|
|
2649
|
+
* orderSet: {},
|
|
2650
|
+
* collectionMethod: "testkit",
|
|
2651
|
+
* patientDetails: {
|
|
2652
|
+
* firstName: "first_name",
|
|
2653
|
+
* lastName: "last_name",
|
|
2654
|
+
* dob: "dob",
|
|
2655
|
+
* gender: "female",
|
|
2656
|
+
* phoneNumber: "phone_number",
|
|
2657
|
+
* email: "email"
|
|
2658
|
+
* },
|
|
2659
|
+
* patientAddress: {
|
|
2660
|
+
* receiverName: "receiver_name",
|
|
2661
|
+
* firstLine: "first_line",
|
|
2662
|
+
* city: "city",
|
|
2663
|
+
* state: "state",
|
|
2664
|
+
* zip: "zip",
|
|
2665
|
+
* country: "country"
|
|
2666
|
+
* },
|
|
2667
|
+
* sampleId: "sample_id"
|
|
2668
|
+
* })
|
|
2661
2669
|
*/
|
|
2662
|
-
|
|
2670
|
+
importOrder(request, requestOptions) {
|
|
2663
2671
|
var _a;
|
|
2664
2672
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2665
2673
|
const _response = yield core.fetcher({
|
|
2666
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2667
|
-
method: "
|
|
2668
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2674
|
+
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"),
|
|
2675
|
+
method: "POST",
|
|
2676
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2669
2677
|
contentType: "application/json",
|
|
2670
2678
|
requestType: "json",
|
|
2679
|
+
body: serializers.ImportOrderBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
2671
2680
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2672
2681
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2673
2682
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2674
2683
|
});
|
|
2675
2684
|
if (_response.ok) {
|
|
2676
|
-
return serializers.
|
|
2685
|
+
return serializers.PostOrderResponse.parseOrThrow(_response.body, {
|
|
2677
2686
|
unrecognizedObjectKeys: "passthrough",
|
|
2678
2687
|
allowUnrecognizedUnionMembers: true,
|
|
2679
2688
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2712,20 +2721,23 @@ class LabTests {
|
|
|
2712
2721
|
});
|
|
2713
2722
|
}
|
|
2714
2723
|
/**
|
|
2715
|
-
*
|
|
2724
|
+
* POST cancel order
|
|
2716
2725
|
*
|
|
2726
|
+
* @param {string} orderId - Your Order ID.
|
|
2717
2727
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2718
2728
|
*
|
|
2729
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
|
2730
|
+
*
|
|
2719
2731
|
* @example
|
|
2720
|
-
* await client.labTests.
|
|
2732
|
+
* await client.labTests.cancelOrder("order_id")
|
|
2721
2733
|
*/
|
|
2722
|
-
|
|
2734
|
+
cancelOrder(orderId, requestOptions) {
|
|
2723
2735
|
var _a;
|
|
2724
2736
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2725
2737
|
const _response = yield core.fetcher({
|
|
2726
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2727
|
-
method: "
|
|
2728
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2738
|
+
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`),
|
|
2739
|
+
method: "POST",
|
|
2740
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2729
2741
|
contentType: "application/json",
|
|
2730
2742
|
requestType: "json",
|
|
2731
2743
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -2733,7 +2745,7 @@ class LabTests {
|
|
|
2733
2745
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2734
2746
|
});
|
|
2735
2747
|
if (_response.ok) {
|
|
2736
|
-
return serializers.
|
|
2748
|
+
return serializers.PostOrderResponse.parseOrThrow(_response.body, {
|
|
2737
2749
|
unrecognizedObjectKeys: "passthrough",
|
|
2738
2750
|
allowUnrecognizedUnionMembers: true,
|
|
2739
2751
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2741,10 +2753,20 @@ class LabTests {
|
|
|
2741
2753
|
});
|
|
2742
2754
|
}
|
|
2743
2755
|
if (_response.error.reason === "status-code") {
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2756
|
+
switch (_response.error.statusCode) {
|
|
2757
|
+
case 422:
|
|
2758
|
+
throw new Vital.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
2759
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2760
|
+
allowUnrecognizedUnionMembers: true,
|
|
2761
|
+
allowUnrecognizedEnumValues: true,
|
|
2762
|
+
breadcrumbsPrefix: ["response"],
|
|
2763
|
+
}));
|
|
2764
|
+
default:
|
|
2765
|
+
throw new errors.VitalError({
|
|
2766
|
+
statusCode: _response.error.statusCode,
|
|
2767
|
+
body: _response.error.body,
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2748
2770
|
}
|
|
2749
2771
|
switch (_response.error.reason) {
|
|
2750
2772
|
case "non-json":
|
|
@@ -2762,82 +2784,48 @@ class LabTests {
|
|
|
2762
2784
|
});
|
|
2763
2785
|
}
|
|
2764
2786
|
/**
|
|
2765
|
-
*
|
|
2787
|
+
* Get available test kits.
|
|
2766
2788
|
*
|
|
2767
|
-
* @param {
|
|
2789
|
+
* @param {string} orderId
|
|
2790
|
+
* @param {Vital.LabTestsSimulateOrderProcessRequest} request
|
|
2768
2791
|
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2769
2792
|
*
|
|
2770
2793
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2771
2794
|
*
|
|
2772
2795
|
* @example
|
|
2773
|
-
* await client.labTests.
|
|
2796
|
+
* await client.labTests.simulateOrderProcess("order_id", {
|
|
2797
|
+
* body: undefined
|
|
2798
|
+
* })
|
|
2774
2799
|
*/
|
|
2775
|
-
|
|
2800
|
+
simulateOrderProcess(orderId, request = {}, requestOptions) {
|
|
2776
2801
|
var _a;
|
|
2777
2802
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2778
|
-
const {
|
|
2803
|
+
const { finalStatus, delay, body: _body } = request;
|
|
2779
2804
|
const _queryParams = {};
|
|
2780
|
-
if (
|
|
2781
|
-
_queryParams["
|
|
2782
|
-
}
|
|
2783
|
-
if (nextCursor != null) {
|
|
2784
|
-
_queryParams["next_cursor"] = nextCursor;
|
|
2785
|
-
}
|
|
2786
|
-
if (generationMethod != null) {
|
|
2787
|
-
_queryParams["generation_method"] = generationMethod;
|
|
2788
|
-
}
|
|
2789
|
-
if (labSlug != null) {
|
|
2790
|
-
_queryParams["lab_slug"] = labSlug;
|
|
2791
|
-
}
|
|
2792
|
-
if (collectionMethod != null) {
|
|
2793
|
-
_queryParams["collection_method"] = collectionMethod;
|
|
2794
|
-
}
|
|
2795
|
-
if (status != null) {
|
|
2796
|
-
_queryParams["status"] = status;
|
|
2797
|
-
}
|
|
2798
|
-
if (markerIds != null) {
|
|
2799
|
-
if (Array.isArray(markerIds)) {
|
|
2800
|
-
_queryParams["marker_ids"] = markerIds.map((item) => item.toString());
|
|
2801
|
-
}
|
|
2802
|
-
else {
|
|
2803
|
-
_queryParams["marker_ids"] = markerIds.toString();
|
|
2804
|
-
}
|
|
2805
|
-
}
|
|
2806
|
-
if (providerIds != null) {
|
|
2807
|
-
if (Array.isArray(providerIds)) {
|
|
2808
|
-
_queryParams["provider_ids"] = providerIds.map((item) => item);
|
|
2809
|
-
}
|
|
2810
|
-
else {
|
|
2811
|
-
_queryParams["provider_ids"] = providerIds;
|
|
2812
|
-
}
|
|
2813
|
-
}
|
|
2814
|
-
if (name != null) {
|
|
2815
|
-
_queryParams["name"] = name;
|
|
2816
|
-
}
|
|
2817
|
-
if (orderKey != null) {
|
|
2818
|
-
_queryParams["order_key"] = orderKey;
|
|
2805
|
+
if (finalStatus != null) {
|
|
2806
|
+
_queryParams["final_status"] = finalStatus;
|
|
2819
2807
|
}
|
|
2820
|
-
if (
|
|
2821
|
-
_queryParams["
|
|
2808
|
+
if (delay != null) {
|
|
2809
|
+
_queryParams["delay"] = delay.toString();
|
|
2822
2810
|
}
|
|
2823
2811
|
const _response = yield core.fetcher({
|
|
2824
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
|
2825
|
-
method: "
|
|
2826
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2812
|
+
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`),
|
|
2813
|
+
method: "POST",
|
|
2814
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2827
2815
|
contentType: "application/json",
|
|
2828
2816
|
queryParameters: _queryParams,
|
|
2829
2817
|
requestType: "json",
|
|
2818
|
+
body: _body != null
|
|
2819
|
+
? serializers.labTests.simulateOrderProcess.Request.jsonOrThrow(_body, {
|
|
2820
|
+
unrecognizedObjectKeys: "strip",
|
|
2821
|
+
})
|
|
2822
|
+
: undefined,
|
|
2830
2823
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2831
2824
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2832
2825
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2833
2826
|
});
|
|
2834
2827
|
if (_response.ok) {
|
|
2835
|
-
return
|
|
2836
|
-
unrecognizedObjectKeys: "passthrough",
|
|
2837
|
-
allowUnrecognizedUnionMembers: true,
|
|
2838
|
-
allowUnrecognizedEnumValues: true,
|
|
2839
|
-
breadcrumbsPrefix: ["response"],
|
|
2840
|
-
});
|
|
2828
|
+
return _response.body;
|
|
2841
2829
|
}
|
|
2842
2830
|
if (_response.error.reason === "status-code") {
|
|
2843
2831
|
switch (_response.error.statusCode) {
|
|
@@ -2871,24 +2859,36 @@ class LabTests {
|
|
|
2871
2859
|
});
|
|
2872
2860
|
}
|
|
2873
2861
|
/**
|
|
2862
|
+
* PATCH update on site collection order when draw is completed
|
|
2863
|
+
*
|
|
2864
|
+
* @param {string} orderId - Your Order ID.
|
|
2865
|
+
* @param {LabTests.RequestOptions} requestOptions - Request-specific configuration.
|
|
2866
|
+
*
|
|
2874
2867
|
* @throws {@link Vital.UnprocessableEntityError}
|
|
2868
|
+
*
|
|
2869
|
+
* @example
|
|
2870
|
+
* await client.labTests.updateOnSiteCollectionOrderDrawCompleted("order_id")
|
|
2875
2871
|
*/
|
|
2876
|
-
|
|
2872
|
+
updateOnSiteCollectionOrderDrawCompleted(orderId, requestOptions) {
|
|
2877
2873
|
var _a;
|
|
2878
2874
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2879
2875
|
const _response = yield core.fetcher({
|
|
2880
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/
|
|
2881
|
-
method: "
|
|
2882
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.
|
|
2876
|
+
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`),
|
|
2877
|
+
method: "PATCH",
|
|
2878
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@tryvital/vital-node", "X-Fern-SDK-Version": "3.1.394", "User-Agent": "@tryvital/vital-node/3.1.394", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
2883
2879
|
contentType: "application/json",
|
|
2884
2880
|
requestType: "json",
|
|
2885
|
-
responseType: "streaming",
|
|
2886
2881
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2887
2882
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2888
2883
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2889
2884
|
});
|
|
2890
2885
|
if (_response.ok) {
|
|
2891
|
-
return _response.body
|
|
2886
|
+
return serializers.PostOrderResponse.parseOrThrow(_response.body, {
|
|
2887
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2888
|
+
allowUnrecognizedUnionMembers: true,
|
|
2889
|
+
allowUnrecognizedEnumValues: true,
|
|
2890
|
+
breadcrumbsPrefix: ["response"],
|
|
2891
|
+
});
|
|
2892
2892
|
}
|
|
2893
2893
|
if (_response.error.reason === "status-code") {
|
|
2894
2894
|
switch (_response.error.statusCode) {
|