@tryvital/vital-node 3.0.7 → 3.0.9
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 +1 -0
- package/api/errors/BadRequestError.js +1 -0
- package/api/errors/UnprocessableEntityError.js +1 -0
- package/api/resources/activity/client/Client.d.ts +11 -0
- package/api/resources/activity/client/Client.js +22 -11
- package/api/resources/activity/client/requests/ActivityGetRawRequest.d.ts +6 -0
- package/api/resources/activity/client/requests/ActivityGetRequest.d.ts +6 -0
- package/api/resources/body/client/Client.d.ts +11 -0
- package/api/resources/body/client/Client.js +22 -11
- package/api/resources/body/client/requests/BodyGetRawRequest.d.ts +6 -0
- package/api/resources/body/client/requests/BodyGetRequest.d.ts +6 -0
- package/api/resources/devices/client/Client.d.ts +4 -0
- package/api/resources/devices/client/Client.js +7 -4
- package/api/resources/devices/client/requests/DevicesGetRawRequest.d.ts +4 -0
- package/api/resources/insurance/client/Client.d.ts +6 -0
- package/api/resources/insurance/client/Client.js +11 -5
- package/api/resources/insurance/client/requests/InsuranceSearchDiagnosisRequest.d.ts +6 -0
- package/api/resources/introspect/client/Client.d.ts +11 -0
- package/api/resources/introspect/client/Client.js +24 -13
- package/api/resources/introspect/client/requests/IntrospectGetUserHistoricalPullsRequest.d.ts +6 -0
- package/api/resources/introspect/client/requests/IntrospectGetUserResourcesRequest.d.ts +6 -0
- package/api/resources/labTests/client/Client.d.ts +21 -1
- package/api/resources/labTests/client/Client.js +115 -59
- package/api/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +1 -1
- package/api/resources/labTests/client/requests/LabTestsGetMarkersForLabTestRequest.d.ts +4 -0
- package/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.d.ts +4 -0
- package/api/resources/labTests/client/requests/LabTestsGetOrdersRequest.d.ts +4 -0
- package/api/resources/link/client/Client.d.ts +7 -0
- package/api/resources/link/client/Client.js +35 -17
- package/api/resources/link/client/requests/LinkGetAllProvidersRequest.d.ts +4 -0
- package/api/resources/link/client/requests/LinkTokenStateRequest.d.ts +4 -0
- package/api/resources/meal/client/Client.d.ts +6 -0
- package/api/resources/meal/client/Client.js +11 -6
- package/api/resources/meal/client/requests/MealGetRequest.d.ts +6 -0
- package/api/resources/profile/client/Client.d.ts +1 -0
- package/api/resources/profile/client/Client.js +8 -7
- package/api/resources/providers/client/Client.d.ts +4 -0
- package/api/resources/providers/client/Client.js +5 -1
- package/api/resources/sleep/client/Client.d.ts +19 -0
- package/api/resources/sleep/client/Client.js +38 -17
- package/api/resources/sleep/client/requests/SleepGetRawRequest.d.ts +6 -0
- package/api/resources/sleep/client/requests/SleepGetRequest.d.ts +6 -0
- package/api/resources/sleep/client/requests/SleepGetStreamRequest.d.ts +6 -0
- package/api/resources/team/client/Client.d.ts +18 -0
- package/api/resources/team/client/Client.js +37 -14
- package/api/resources/team/client/requests/TeamGetLinkConfigRequest.d.ts +4 -0
- package/api/resources/team/client/requests/TeamGetSourcePrioritiesRequest.d.ts +4 -0
- package/api/resources/team/client/requests/TeamGetUserByIdRequest.d.ts +4 -0
- package/api/resources/team/client/requests/TeamUpdateSourcePrioritiesRequest.d.ts +6 -0
- package/api/resources/testkit/client/Client.d.ts +1 -0
- package/api/resources/testkit/client/Client.js +4 -2
- package/api/resources/user/client/Client.d.ts +7 -0
- package/api/resources/user/client/Client.js +33 -17
- package/api/resources/user/client/requests/UserPatchBody.d.ts +4 -0
- package/api/resources/vitals/client/Client.d.ts +116 -0
- package/api/resources/vitals/client/Client.js +253 -116
- package/api/resources/vitals/client/requests/VitalsBloodOxygenRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsBloodPressureRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCaffeineRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCaloriesActiveRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCaloriesBasalRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCholesterolHdlRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCholesterolLdlRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCholesterolRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsCholesterolTotalRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsDistanceRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsElectrocardiogramVoltageRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsFloorsClimbedRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsGlucoseRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsHeartrateRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsHrvRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsHypnogramRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsIgeRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsIggRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsMindfulnessMinutesRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsRespiratoryRateRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsStepsRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsTriglyceridesRequest.d.ts +6 -0
- package/api/resources/vitals/client/requests/VitalsWaterRequest.d.ts +6 -0
- package/api/resources/workouts/client/Client.d.ts +14 -0
- package/api/resources/workouts/client/Client.js +27 -12
- package/api/resources/workouts/client/requests/WorkoutsGetRawRequest.d.ts +6 -0
- package/api/resources/workouts/client/requests/WorkoutsGetRequest.d.ts +6 -0
- package/api/types/ClientFacingDiagnosisInformation.d.ts +2 -2
- package/api/types/ClientFacingLabTest.d.ts +1 -1
- package/api/types/ClientFacingOrder.d.ts +1 -1
- package/api/types/ClientFacingPayorSearchResponse.d.ts +3 -3
- package/api/types/ClientFacingSleep.d.ts +1 -1
- package/api/types/ClientFacingTeam.d.ts +1 -0
- package/api/types/ClientFacingUser.d.ts +0 -1
- package/api/types/DeviceV2InDb.d.ts +1 -1
- package/api/types/FallbackTimeZone.d.ts +0 -1
- package/api/types/OAuthProviders.d.ts +2 -1
- package/api/types/OAuthProviders.js +1 -0
- package/api/types/Providers.d.ts +2 -1
- package/api/types/Providers.js +1 -0
- package/api/types/TeamConfig.d.ts +1 -0
- package/api/types/index.d.ts +7 -7
- package/api/types/index.js +7 -7
- package/core/fetcher/APIResponse.d.ts +1 -0
- package/core/fetcher/Fetcher.d.ts +3 -6
- package/core/fetcher/Fetcher.js +70 -26
- package/core/fetcher/getHeader.d.ts +1 -0
- package/{dist/core/streaming-fetcher → core/fetcher}/getHeader.js +2 -2
- package/core/fetcher/index.d.ts +1 -0
- package/core/fetcher/index.js +3 -1
- package/core/index.d.ts +0 -1
- package/core/index.js +0 -1
- package/core/schemas/Schema.d.ts +1 -0
- package/core/schemas/Schema.js +1 -0
- package/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/core/schemas/builders/literals/booleanLiteral.js +29 -0
- package/core/schemas/builders/literals/index.d.ts +1 -0
- package/core/schemas/builders/literals/index.js +3 -1
- package/core/schemas/builders/object/index.d.ts +2 -0
- package/core/schemas/builders/object/index.js +3 -1
- package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
- package/dist/Client.d.ts +1 -0
- package/dist/api/errors/BadRequestError.js +1 -0
- package/dist/api/errors/UnprocessableEntityError.js +1 -0
- package/dist/api/resources/activity/client/Client.d.ts +11 -0
- package/dist/api/resources/activity/client/Client.js +22 -11
- package/dist/api/resources/activity/client/requests/ActivityGetRawRequest.d.ts +6 -0
- package/dist/api/resources/activity/client/requests/ActivityGetRequest.d.ts +6 -0
- package/dist/api/resources/body/client/Client.d.ts +11 -0
- package/dist/api/resources/body/client/Client.js +22 -11
- package/dist/api/resources/body/client/requests/BodyGetRawRequest.d.ts +6 -0
- package/dist/api/resources/body/client/requests/BodyGetRequest.d.ts +6 -0
- package/dist/api/resources/devices/client/Client.d.ts +4 -0
- package/dist/api/resources/devices/client/Client.js +7 -4
- package/dist/api/resources/devices/client/requests/DevicesGetRawRequest.d.ts +4 -0
- package/dist/api/resources/insurance/client/Client.d.ts +6 -0
- package/dist/api/resources/insurance/client/Client.js +11 -5
- package/dist/api/resources/insurance/client/requests/InsuranceSearchDiagnosisRequest.d.ts +6 -0
- package/dist/api/resources/introspect/client/Client.d.ts +11 -0
- package/dist/api/resources/introspect/client/Client.js +24 -13
- package/dist/api/resources/introspect/client/requests/IntrospectGetUserHistoricalPullsRequest.d.ts +6 -0
- package/dist/api/resources/introspect/client/requests/IntrospectGetUserResourcesRequest.d.ts +6 -0
- package/dist/api/resources/labTests/client/Client.d.ts +21 -1
- package/dist/api/resources/labTests/client/Client.js +115 -59
- package/dist/api/resources/labTests/client/requests/CreateOrderRequestCompatible.d.ts +1 -1
- package/dist/api/resources/labTests/client/requests/LabTestsGetMarkersForLabTestRequest.d.ts +4 -0
- package/dist/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.d.ts +4 -0
- package/dist/api/resources/labTests/client/requests/LabTestsGetOrdersRequest.d.ts +4 -0
- package/dist/api/resources/link/client/Client.d.ts +7 -0
- package/dist/api/resources/link/client/Client.js +35 -17
- package/dist/api/resources/link/client/requests/LinkGetAllProvidersRequest.d.ts +4 -0
- package/dist/api/resources/link/client/requests/LinkTokenStateRequest.d.ts +4 -0
- package/dist/api/resources/meal/client/Client.d.ts +6 -0
- package/dist/api/resources/meal/client/Client.js +11 -6
- package/dist/api/resources/meal/client/requests/MealGetRequest.d.ts +6 -0
- package/dist/api/resources/profile/client/Client.d.ts +1 -0
- package/dist/api/resources/profile/client/Client.js +8 -7
- package/dist/api/resources/providers/client/Client.d.ts +4 -0
- package/dist/api/resources/providers/client/Client.js +5 -1
- package/dist/api/resources/sleep/client/Client.d.ts +19 -0
- package/dist/api/resources/sleep/client/Client.js +38 -17
- package/dist/api/resources/sleep/client/requests/SleepGetRawRequest.d.ts +6 -0
- package/dist/api/resources/sleep/client/requests/SleepGetRequest.d.ts +6 -0
- package/dist/api/resources/sleep/client/requests/SleepGetStreamRequest.d.ts +6 -0
- package/dist/api/resources/team/client/Client.d.ts +18 -0
- package/dist/api/resources/team/client/Client.js +37 -14
- package/dist/api/resources/team/client/requests/TeamGetLinkConfigRequest.d.ts +4 -0
- package/dist/api/resources/team/client/requests/TeamGetSourcePrioritiesRequest.d.ts +4 -0
- package/dist/api/resources/team/client/requests/TeamGetUserByIdRequest.d.ts +4 -0
- package/dist/api/resources/team/client/requests/TeamUpdateSourcePrioritiesRequest.d.ts +6 -0
- package/dist/api/resources/testkit/client/Client.d.ts +1 -0
- package/dist/api/resources/testkit/client/Client.js +4 -2
- package/dist/api/resources/user/client/Client.d.ts +7 -0
- package/dist/api/resources/user/client/Client.js +33 -17
- package/dist/api/resources/user/client/requests/UserPatchBody.d.ts +4 -0
- package/dist/api/resources/vitals/client/Client.d.ts +116 -0
- package/dist/api/resources/vitals/client/Client.js +253 -116
- package/dist/api/resources/vitals/client/requests/VitalsBloodOxygenRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsBloodPressureRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCaffeineRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCaloriesActiveRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCaloriesBasalRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCholesterolHdlRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCholesterolLdlRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCholesterolRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsCholesterolTotalRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsDistanceRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsElectrocardiogramVoltageRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsFloorsClimbedRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsGlucoseRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsHeartrateRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsHrvRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsHypnogramRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsIgeRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsIggRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsMindfulnessMinutesRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsRespiratoryRateRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsStepsRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsTriglyceridesRequest.d.ts +6 -0
- package/dist/api/resources/vitals/client/requests/VitalsWaterRequest.d.ts +6 -0
- package/dist/api/resources/workouts/client/Client.d.ts +14 -0
- package/dist/api/resources/workouts/client/Client.js +27 -12
- package/dist/api/resources/workouts/client/requests/WorkoutsGetRawRequest.d.ts +6 -0
- package/dist/api/resources/workouts/client/requests/WorkoutsGetRequest.d.ts +6 -0
- package/dist/api/types/ClientFacingDiagnosisInformation.d.ts +2 -2
- package/dist/api/types/ClientFacingLabTest.d.ts +1 -1
- package/dist/api/types/ClientFacingOrder.d.ts +1 -1
- package/dist/api/types/ClientFacingPayorSearchResponse.d.ts +3 -3
- package/dist/api/types/ClientFacingSleep.d.ts +1 -1
- package/dist/api/types/ClientFacingTeam.d.ts +1 -0
- package/dist/api/types/ClientFacingUser.d.ts +0 -1
- package/dist/api/types/DeviceV2InDb.d.ts +1 -1
- package/dist/api/types/FallbackTimeZone.d.ts +0 -1
- package/dist/api/types/OAuthProviders.d.ts +2 -1
- package/dist/api/types/OAuthProviders.js +1 -0
- package/dist/api/types/Providers.d.ts +2 -1
- package/dist/api/types/Providers.js +1 -0
- package/dist/api/types/TeamConfig.d.ts +1 -0
- package/dist/api/types/index.d.ts +7 -7
- package/dist/api/types/index.js +7 -7
- package/dist/core/fetcher/APIResponse.d.ts +1 -0
- package/dist/core/fetcher/Fetcher.d.ts +3 -6
- package/dist/core/fetcher/Fetcher.js +70 -26
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/{core/streaming-fetcher → dist/core/fetcher}/getHeader.js +2 -2
- package/dist/core/fetcher/index.d.ts +1 -0
- package/dist/core/fetcher/index.js +3 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/core/schemas/Schema.d.ts +1 -0
- package/dist/core/schemas/Schema.js +1 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.js +29 -0
- package/dist/core/schemas/builders/literals/index.d.ts +1 -0
- package/dist/core/schemas/builders/literals/index.js +3 -1
- package/dist/core/schemas/builders/object/index.d.ts +2 -0
- package/dist/core/schemas/builders/object/index.js +3 -1
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
- package/dist/serialization/types/ClientFacingTeam.d.ts +1 -0
- package/dist/serialization/types/ClientFacingTeam.js +1 -0
- package/dist/serialization/types/DeviceV2InDb.d.ts +1 -1
- package/dist/serialization/types/DeviceV2InDb.js +1 -1
- package/dist/serialization/types/OAuthProviders.d.ts +1 -1
- package/dist/serialization/types/OAuthProviders.js +1 -0
- package/dist/serialization/types/Providers.d.ts +1 -1
- package/dist/serialization/types/Providers.js +1 -0
- package/dist/serialization/types/TeamConfig.d.ts +1 -0
- package/dist/serialization/types/TeamConfig.js +1 -0
- package/dist/serialization/types/index.d.ts +7 -7
- package/dist/serialization/types/index.js +7 -7
- package/package.json +7 -4
- package/serialization/types/ClientFacingTeam.d.ts +1 -0
- package/serialization/types/ClientFacingTeam.js +1 -0
- package/serialization/types/DeviceV2InDb.d.ts +1 -1
- package/serialization/types/DeviceV2InDb.js +1 -1
- package/serialization/types/OAuthProviders.d.ts +1 -1
- package/serialization/types/OAuthProviders.js +1 -0
- package/serialization/types/Providers.d.ts +1 -1
- package/serialization/types/Providers.js +1 -0
- package/serialization/types/TeamConfig.d.ts +1 -0
- package/serialization/types/TeamConfig.js +1 -0
- package/serialization/types/index.d.ts +7 -7
- package/serialization/types/index.js +7 -7
- package/core/streaming-fetcher/StreamingFetcher.d.ts +0 -30
- package/core/streaming-fetcher/StreamingFetcher.js +0 -79
- package/core/streaming-fetcher/getHeader.d.ts +0 -2
- package/core/streaming-fetcher/index.d.ts +0 -3
- package/core/streaming-fetcher/index.js +0 -7
- package/dist/core/streaming-fetcher/StreamingFetcher.d.ts +0 -30
- package/dist/core/streaming-fetcher/StreamingFetcher.js +0 -79
- package/dist/core/streaming-fetcher/getHeader.d.ts +0 -2
- package/dist/core/streaming-fetcher/index.d.ts +0 -3
- package/dist/core/streaming-fetcher/index.js +0 -7
@@ -13,6 +13,7 @@ export declare namespace LabTests {
|
|
13
13
|
}
|
14
14
|
interface RequestOptions {
|
15
15
|
timeoutInSeconds?: number;
|
16
|
+
maxRetries?: number;
|
16
17
|
}
|
17
18
|
}
|
18
19
|
export declare class LabTests {
|
@@ -20,6 +21,9 @@ export declare class LabTests {
|
|
20
21
|
constructor(_options: LabTests.Options);
|
21
22
|
/**
|
22
23
|
* GET all the lab tests the team has access to.
|
24
|
+
*
|
25
|
+
* @example
|
26
|
+
* await vital.labTests.get()
|
23
27
|
*/
|
24
28
|
get(requestOptions?: LabTests.RequestOptions): Promise<Vital.ClientFacingLabTest[]>;
|
25
29
|
/**
|
@@ -29,10 +33,16 @@ export declare class LabTests {
|
|
29
33
|
/**
|
30
34
|
* GET all the markers for the given lab.
|
31
35
|
* @throws {@link Vital.UnprocessableEntityError}
|
36
|
+
*
|
37
|
+
* @example
|
38
|
+
* await vital.labTests.getMarkers({})
|
32
39
|
*/
|
33
40
|
getMarkers(request?: Vital.LabTestsGetMarkersRequest, requestOptions?: LabTests.RequestOptions): Promise<Vital.GetMarkersResponse>;
|
34
41
|
/**
|
35
42
|
* @throws {@link Vital.UnprocessableEntityError}
|
43
|
+
*
|
44
|
+
* @example
|
45
|
+
* await vital.labTests.getMarkersForLabTest("lab-test-id", {})
|
36
46
|
*/
|
37
47
|
getMarkersForLabTest(labTestId: string, request?: Vital.LabTestsGetMarkersForLabTestRequest, requestOptions?: LabTests.RequestOptions): Promise<Vital.GetMarkersResponse>;
|
38
48
|
/**
|
@@ -42,6 +52,9 @@ export declare class LabTests {
|
|
42
52
|
getMarkersByLabAndProviderId(providerId: string, labId: number, requestOptions?: LabTests.RequestOptions): Promise<Vital.ClientFacingMarker>;
|
43
53
|
/**
|
44
54
|
* GET all the labs.
|
55
|
+
*
|
56
|
+
* @example
|
57
|
+
* await vital.labTests.getLabs()
|
45
58
|
*/
|
46
59
|
getLabs(requestOptions?: LabTests.RequestOptions): Promise<Vital.ClientFacingLab[]>;
|
47
60
|
/**
|
@@ -77,6 +90,9 @@ export declare class LabTests {
|
|
77
90
|
cancelPhlebotomyAppointment(orderId: string, request: Vital.AppointmentCancelRequest, requestOptions?: LabTests.RequestOptions): Promise<Vital.ClientFacingAppointment>;
|
78
91
|
/**
|
79
92
|
* Get the list of reasons for cancelling an at-home phlebotomy appointment.
|
93
|
+
*
|
94
|
+
* @example
|
95
|
+
* await vital.labTests.getPhlebotomyAppointmentCancellationReason()
|
80
96
|
*/
|
81
97
|
getPhlebotomyAppointmentCancellationReason(requestOptions?: LabTests.RequestOptions): Promise<Vital.ClientFacingAppointmentCancellationReason[]>;
|
82
98
|
/**
|
@@ -88,7 +104,8 @@ export declare class LabTests {
|
|
88
104
|
* GET information about an area with respect to lab-testing.
|
89
105
|
*
|
90
106
|
* Information returned:
|
91
|
-
*
|
107
|
+
*
|
108
|
+
* - Whether a given zip code is served by our Phlebotomy network.
|
92
109
|
* @throws {@link Vital.UnprocessableEntityError}
|
93
110
|
*/
|
94
111
|
getAreaInfo(request: Vital.LabTestsGetAreaInfoRequest, requestOptions?: LabTests.RequestOptions): Promise<Vital.AreaInfo>;
|
@@ -135,6 +152,9 @@ export declare class LabTests {
|
|
135
152
|
/**
|
136
153
|
* GET many orders with filters.
|
137
154
|
* @throws {@link Vital.UnprocessableEntityError}
|
155
|
+
*
|
156
|
+
* @example
|
157
|
+
* await vital.labTests.getOrders({})
|
138
158
|
*/
|
139
159
|
getOrders(request?: Vital.LabTestsGetOrdersRequest, requestOptions?: LabTests.RequestOptions): Promise<Vital.GetOrdersResponse>;
|
140
160
|
}
|
@@ -45,13 +45,15 @@ const Vital = __importStar(require("../../.."));
|
|
45
45
|
const url_join_1 = __importDefault(require("url-join"));
|
46
46
|
const serializers = __importStar(require("../../../../serialization"));
|
47
47
|
const errors = __importStar(require("../../../../errors"));
|
48
|
-
const url_search_params_1 = __importDefault(require("@ungap/url-search-params"));
|
49
48
|
class LabTests {
|
50
49
|
constructor(_options) {
|
51
50
|
this._options = _options;
|
52
51
|
}
|
53
52
|
/**
|
54
53
|
* GET all the lab tests the team has access to.
|
54
|
+
*
|
55
|
+
* @example
|
56
|
+
* await vital.labTests.get()
|
55
57
|
*/
|
56
58
|
get(requestOptions) {
|
57
59
|
var _a;
|
@@ -63,10 +65,11 @@ class LabTests {
|
|
63
65
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
64
66
|
"X-Fern-Language": "JavaScript",
|
65
67
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
66
|
-
"X-Fern-SDK-Version": "3.0.
|
68
|
+
"X-Fern-SDK-Version": "3.0.9",
|
67
69
|
},
|
68
70
|
contentType: "application/json",
|
69
71
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
72
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
70
73
|
});
|
71
74
|
if (_response.ok) {
|
72
75
|
return yield serializers.labTests.get.Response.parseOrThrow(_response.body, {
|
@@ -110,11 +113,12 @@ class LabTests {
|
|
110
113
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
111
114
|
"X-Fern-Language": "JavaScript",
|
112
115
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
113
|
-
"X-Fern-SDK-Version": "3.0.
|
116
|
+
"X-Fern-SDK-Version": "3.0.9",
|
114
117
|
},
|
115
118
|
contentType: "application/json",
|
116
119
|
body: yield serializers.CreateLabTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
117
120
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
121
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
118
122
|
});
|
119
123
|
if (_response.ok) {
|
120
124
|
return yield serializers.ClientFacingLabTest.parseOrThrow(_response.body, {
|
@@ -158,30 +162,31 @@ class LabTests {
|
|
158
162
|
/**
|
159
163
|
* GET all the markers for the given lab.
|
160
164
|
* @throws {@link Vital.UnprocessableEntityError}
|
165
|
+
*
|
166
|
+
* @example
|
167
|
+
* await vital.labTests.getMarkers({})
|
161
168
|
*/
|
162
169
|
getMarkers(request = {}, requestOptions) {
|
163
170
|
var _a;
|
164
171
|
return __awaiter(this, void 0, void 0, function* () {
|
165
172
|
const { labId, name, page, size } = request;
|
166
|
-
const _queryParams =
|
173
|
+
const _queryParams = {};
|
167
174
|
if (labId != null) {
|
168
175
|
if (Array.isArray(labId)) {
|
169
|
-
|
170
|
-
_queryParams.append("lab_id", _item.toString());
|
171
|
-
}
|
176
|
+
_queryParams["lab_id"] = labId.map((item) => item.toString());
|
172
177
|
}
|
173
178
|
else {
|
174
|
-
_queryParams
|
179
|
+
_queryParams["lab_id"] = labId.toString();
|
175
180
|
}
|
176
181
|
}
|
177
182
|
if (name != null) {
|
178
|
-
_queryParams
|
183
|
+
_queryParams["name"] = name;
|
179
184
|
}
|
180
185
|
if (page != null) {
|
181
|
-
_queryParams
|
186
|
+
_queryParams["page"] = page.toString();
|
182
187
|
}
|
183
188
|
if (size != null) {
|
184
|
-
_queryParams
|
189
|
+
_queryParams["size"] = size.toString();
|
185
190
|
}
|
186
191
|
const _response = yield core.fetcher({
|
187
192
|
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"),
|
@@ -190,11 +195,12 @@ class LabTests {
|
|
190
195
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
191
196
|
"X-Fern-Language": "JavaScript",
|
192
197
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
193
|
-
"X-Fern-SDK-Version": "3.0.
|
198
|
+
"X-Fern-SDK-Version": "3.0.9",
|
194
199
|
},
|
195
200
|
contentType: "application/json",
|
196
201
|
queryParameters: _queryParams,
|
197
202
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
203
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
198
204
|
});
|
199
205
|
if (_response.ok) {
|
200
206
|
return yield serializers.GetMarkersResponse.parseOrThrow(_response.body, {
|
@@ -237,17 +243,20 @@ class LabTests {
|
|
237
243
|
}
|
238
244
|
/**
|
239
245
|
* @throws {@link Vital.UnprocessableEntityError}
|
246
|
+
*
|
247
|
+
* @example
|
248
|
+
* await vital.labTests.getMarkersForLabTest("lab-test-id", {})
|
240
249
|
*/
|
241
250
|
getMarkersForLabTest(labTestId, request = {}, requestOptions) {
|
242
251
|
var _a;
|
243
252
|
return __awaiter(this, void 0, void 0, function* () {
|
244
253
|
const { page, size } = request;
|
245
|
-
const _queryParams =
|
254
|
+
const _queryParams = {};
|
246
255
|
if (page != null) {
|
247
|
-
_queryParams
|
256
|
+
_queryParams["page"] = page.toString();
|
248
257
|
}
|
249
258
|
if (size != null) {
|
250
|
-
_queryParams
|
259
|
+
_queryParams["size"] = size.toString();
|
251
260
|
}
|
252
261
|
const _response = yield core.fetcher({
|
253
262
|
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/${labTestId}/markers`),
|
@@ -256,11 +265,12 @@ class LabTests {
|
|
256
265
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
257
266
|
"X-Fern-Language": "JavaScript",
|
258
267
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
259
|
-
"X-Fern-SDK-Version": "3.0.
|
268
|
+
"X-Fern-SDK-Version": "3.0.9",
|
260
269
|
},
|
261
270
|
contentType: "application/json",
|
262
271
|
queryParameters: _queryParams,
|
263
272
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
273
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
264
274
|
});
|
265
275
|
if (_response.ok) {
|
266
276
|
return yield serializers.GetMarkersResponse.parseOrThrow(_response.body, {
|
@@ -315,10 +325,11 @@ class LabTests {
|
|
315
325
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
316
326
|
"X-Fern-Language": "JavaScript",
|
317
327
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
318
|
-
"X-Fern-SDK-Version": "3.0.
|
328
|
+
"X-Fern-SDK-Version": "3.0.9",
|
319
329
|
},
|
320
330
|
contentType: "application/json",
|
321
331
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
332
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
322
333
|
});
|
323
334
|
if (_response.ok) {
|
324
335
|
return yield serializers.ClientFacingMarker.parseOrThrow(_response.body, {
|
@@ -361,6 +372,9 @@ class LabTests {
|
|
361
372
|
}
|
362
373
|
/**
|
363
374
|
* GET all the labs.
|
375
|
+
*
|
376
|
+
* @example
|
377
|
+
* await vital.labTests.getLabs()
|
364
378
|
*/
|
365
379
|
getLabs(requestOptions) {
|
366
380
|
var _a;
|
@@ -372,10 +386,11 @@ class LabTests {
|
|
372
386
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
373
387
|
"X-Fern-Language": "JavaScript",
|
374
388
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
375
|
-
"X-Fern-SDK-Version": "3.0.
|
389
|
+
"X-Fern-SDK-Version": "3.0.9",
|
376
390
|
},
|
377
391
|
contentType: "application/json",
|
378
392
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
393
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
379
394
|
});
|
380
395
|
if (_response.ok) {
|
381
396
|
return yield serializers.labTests.getLabs.Response.parseOrThrow(_response.body, {
|
@@ -420,10 +435,11 @@ class LabTests {
|
|
420
435
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
421
436
|
"X-Fern-Language": "JavaScript",
|
422
437
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
423
|
-
"X-Fern-SDK-Version": "3.0.
|
438
|
+
"X-Fern-SDK-Version": "3.0.9",
|
424
439
|
},
|
425
440
|
contentType: "application/json",
|
426
441
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
442
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
427
443
|
});
|
428
444
|
if (_response.ok) {
|
429
445
|
return yield serializers.ClientFacingLabTest.parseOrThrow(_response.body, {
|
@@ -479,11 +495,12 @@ class LabTests {
|
|
479
495
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
480
496
|
"X-Fern-Language": "JavaScript",
|
481
497
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
482
|
-
"X-Fern-SDK-Version": "3.0.
|
498
|
+
"X-Fern-SDK-Version": "3.0.9",
|
483
499
|
},
|
484
500
|
contentType: "application/json",
|
485
501
|
body: yield serializers.UsAddress.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
486
502
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
503
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
487
504
|
});
|
488
505
|
if (_response.ok) {
|
489
506
|
return yield serializers.AppointmentAvailabilitySlots.parseOrThrow(_response.body, {
|
@@ -538,11 +555,12 @@ class LabTests {
|
|
538
555
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
539
556
|
"X-Fern-Language": "JavaScript",
|
540
557
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
541
|
-
"X-Fern-SDK-Version": "3.0.
|
558
|
+
"X-Fern-SDK-Version": "3.0.9",
|
542
559
|
},
|
543
560
|
contentType: "application/json",
|
544
561
|
body: yield serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
545
562
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
563
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
546
564
|
});
|
547
565
|
if (_response.ok) {
|
548
566
|
return yield serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
@@ -597,11 +615,12 @@ class LabTests {
|
|
597
615
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
598
616
|
"X-Fern-Language": "JavaScript",
|
599
617
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
600
|
-
"X-Fern-SDK-Version": "3.0.
|
618
|
+
"X-Fern-SDK-Version": "3.0.9",
|
601
619
|
},
|
602
620
|
contentType: "application/json",
|
603
621
|
body: yield serializers.RequestAppointmentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
604
622
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
623
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
605
624
|
});
|
606
625
|
if (_response.ok) {
|
607
626
|
return yield serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
@@ -656,13 +675,14 @@ class LabTests {
|
|
656
675
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
657
676
|
"X-Fern-Language": "JavaScript",
|
658
677
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
659
|
-
"X-Fern-SDK-Version": "3.0.
|
678
|
+
"X-Fern-SDK-Version": "3.0.9",
|
660
679
|
},
|
661
680
|
contentType: "application/json",
|
662
681
|
body: yield serializers.AppointmentRescheduleRequest.jsonOrThrow(request, {
|
663
682
|
unrecognizedObjectKeys: "strip",
|
664
683
|
}),
|
665
684
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
685
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
666
686
|
});
|
667
687
|
if (_response.ok) {
|
668
688
|
return yield serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
@@ -717,11 +737,12 @@ class LabTests {
|
|
717
737
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
718
738
|
"X-Fern-Language": "JavaScript",
|
719
739
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
720
|
-
"X-Fern-SDK-Version": "3.0.
|
740
|
+
"X-Fern-SDK-Version": "3.0.9",
|
721
741
|
},
|
722
742
|
contentType: "application/json",
|
723
743
|
body: yield serializers.AppointmentCancelRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
724
744
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
745
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
725
746
|
});
|
726
747
|
if (_response.ok) {
|
727
748
|
return yield serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
@@ -764,6 +785,9 @@ class LabTests {
|
|
764
785
|
}
|
765
786
|
/**
|
766
787
|
* Get the list of reasons for cancelling an at-home phlebotomy appointment.
|
788
|
+
*
|
789
|
+
* @example
|
790
|
+
* await vital.labTests.getPhlebotomyAppointmentCancellationReason()
|
767
791
|
*/
|
768
792
|
getPhlebotomyAppointmentCancellationReason(requestOptions) {
|
769
793
|
var _a;
|
@@ -775,10 +799,11 @@ class LabTests {
|
|
775
799
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
776
800
|
"X-Fern-Language": "JavaScript",
|
777
801
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
778
|
-
"X-Fern-SDK-Version": "3.0.
|
802
|
+
"X-Fern-SDK-Version": "3.0.9",
|
779
803
|
},
|
780
804
|
contentType: "application/json",
|
781
805
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
806
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
782
807
|
});
|
783
808
|
if (_response.ok) {
|
784
809
|
return yield serializers.labTests.getPhlebotomyAppointmentCancellationReason.Response.parseOrThrow(_response.body, {
|
@@ -823,10 +848,11 @@ class LabTests {
|
|
823
848
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
824
849
|
"X-Fern-Language": "JavaScript",
|
825
850
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
826
|
-
"X-Fern-SDK-Version": "3.0.
|
851
|
+
"X-Fern-SDK-Version": "3.0.9",
|
827
852
|
},
|
828
853
|
contentType: "application/json",
|
829
854
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
855
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
830
856
|
});
|
831
857
|
if (_response.ok) {
|
832
858
|
return yield serializers.ClientFacingAppointment.parseOrThrow(_response.body, {
|
@@ -871,15 +897,16 @@ class LabTests {
|
|
871
897
|
* GET information about an area with respect to lab-testing.
|
872
898
|
*
|
873
899
|
* Information returned:
|
874
|
-
*
|
900
|
+
*
|
901
|
+
* - Whether a given zip code is served by our Phlebotomy network.
|
875
902
|
* @throws {@link Vital.UnprocessableEntityError}
|
876
903
|
*/
|
877
904
|
getAreaInfo(request, requestOptions) {
|
878
905
|
var _a;
|
879
906
|
return __awaiter(this, void 0, void 0, function* () {
|
880
907
|
const { zipCode } = request;
|
881
|
-
const _queryParams =
|
882
|
-
_queryParams
|
908
|
+
const _queryParams = {};
|
909
|
+
_queryParams["zip_code"] = zipCode;
|
883
910
|
const _response = yield core.fetcher({
|
884
911
|
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"),
|
885
912
|
method: "GET",
|
@@ -887,11 +914,12 @@ class LabTests {
|
|
887
914
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
888
915
|
"X-Fern-Language": "JavaScript",
|
889
916
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
890
|
-
"X-Fern-SDK-Version": "3.0.
|
917
|
+
"X-Fern-SDK-Version": "3.0.9",
|
891
918
|
},
|
892
919
|
contentType: "application/json",
|
893
920
|
queryParameters: _queryParams,
|
894
921
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
922
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
895
923
|
});
|
896
924
|
if (_response.ok) {
|
897
925
|
return yield serializers.AreaInfo.parseOrThrow(_response.body, {
|
@@ -938,23 +966,42 @@ class LabTests {
|
|
938
966
|
getResultPdf(orderId, requestOptions) {
|
939
967
|
var _a;
|
940
968
|
return __awaiter(this, void 0, void 0, function* () {
|
941
|
-
const _response = yield core.
|
969
|
+
const _response = yield core.fetcher({
|
942
970
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${orderId}/result/pdf`),
|
943
971
|
method: "GET",
|
944
972
|
headers: {
|
945
973
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
946
974
|
"X-Fern-Language": "JavaScript",
|
947
975
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
948
|
-
"X-Fern-SDK-Version": "3.0.
|
976
|
+
"X-Fern-SDK-Version": "3.0.9",
|
949
977
|
},
|
978
|
+
contentType: "application/json",
|
979
|
+
responseType: "streaming",
|
950
980
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
951
|
-
|
981
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
982
|
+
});
|
983
|
+
if (_response.ok) {
|
984
|
+
return _response.body;
|
985
|
+
}
|
986
|
+
if (_response.error.reason === "status-code") {
|
987
|
+
throw new errors.VitalError({
|
988
|
+
statusCode: _response.error.statusCode,
|
989
|
+
body: _response.error.body,
|
990
|
+
});
|
991
|
+
}
|
992
|
+
switch (_response.error.reason) {
|
993
|
+
case "non-json":
|
952
994
|
throw new errors.VitalError({
|
953
|
-
|
995
|
+
statusCode: _response.error.statusCode,
|
996
|
+
body: _response.error.rawBody,
|
954
997
|
});
|
955
|
-
|
956
|
-
|
957
|
-
|
998
|
+
case "timeout":
|
999
|
+
throw new errors.VitalTimeoutError();
|
1000
|
+
case "unknown":
|
1001
|
+
throw new errors.VitalError({
|
1002
|
+
message: _response.error.errorMessage,
|
1003
|
+
});
|
1004
|
+
}
|
958
1005
|
});
|
959
1006
|
}
|
960
1007
|
/**
|
@@ -972,10 +1019,11 @@ class LabTests {
|
|
972
1019
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
973
1020
|
"X-Fern-Language": "JavaScript",
|
974
1021
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
975
|
-
"X-Fern-SDK-Version": "3.0.
|
1022
|
+
"X-Fern-SDK-Version": "3.0.9",
|
976
1023
|
},
|
977
1024
|
contentType: "application/json",
|
978
1025
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1026
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
979
1027
|
});
|
980
1028
|
if (_response.ok) {
|
981
1029
|
return yield serializers.LabResultsMetadata.parseOrThrow(_response.body, {
|
@@ -1030,10 +1078,11 @@ class LabTests {
|
|
1030
1078
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
1031
1079
|
"X-Fern-Language": "JavaScript",
|
1032
1080
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
1033
|
-
"X-Fern-SDK-Version": "3.0.
|
1081
|
+
"X-Fern-SDK-Version": "3.0.9",
|
1034
1082
|
},
|
1035
1083
|
contentType: "application/json",
|
1036
1084
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1085
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1037
1086
|
});
|
1038
1087
|
if (_response.ok) {
|
1039
1088
|
return yield serializers.LabResultsRaw.parseOrThrow(_response.body, {
|
@@ -1088,10 +1137,11 @@ class LabTests {
|
|
1088
1137
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
1089
1138
|
"X-Fern-Language": "JavaScript",
|
1090
1139
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
1091
|
-
"X-Fern-SDK-Version": "3.0.
|
1140
|
+
"X-Fern-SDK-Version": "3.0.9",
|
1092
1141
|
},
|
1093
1142
|
contentType: "application/json",
|
1094
1143
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1144
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1095
1145
|
});
|
1096
1146
|
if (_response.ok) {
|
1097
1147
|
return _response.body;
|
@@ -1141,10 +1191,11 @@ class LabTests {
|
|
1141
1191
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
1142
1192
|
"X-Fern-Language": "JavaScript",
|
1143
1193
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
1144
|
-
"X-Fern-SDK-Version": "3.0.
|
1194
|
+
"X-Fern-SDK-Version": "3.0.9",
|
1145
1195
|
},
|
1146
1196
|
contentType: "application/json",
|
1147
1197
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1198
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1148
1199
|
});
|
1149
1200
|
if (_response.ok) {
|
1150
1201
|
return yield serializers.ClientFacingOrder.parseOrThrow(_response.body, {
|
@@ -1199,13 +1250,14 @@ class LabTests {
|
|
1199
1250
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
1200
1251
|
"X-Fern-Language": "JavaScript",
|
1201
1252
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
1202
|
-
"X-Fern-SDK-Version": "3.0.
|
1253
|
+
"X-Fern-SDK-Version": "3.0.9",
|
1203
1254
|
},
|
1204
1255
|
contentType: "application/json",
|
1205
1256
|
body: yield serializers.CreateOrderRequestCompatible.jsonOrThrow(request, {
|
1206
1257
|
unrecognizedObjectKeys: "strip",
|
1207
1258
|
}),
|
1208
1259
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1260
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1209
1261
|
});
|
1210
1262
|
if (_response.ok) {
|
1211
1263
|
return yield serializers.PostOrderResponse.parseOrThrow(_response.body, {
|
@@ -1260,10 +1312,11 @@ class LabTests {
|
|
1260
1312
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
1261
1313
|
"X-Fern-Language": "JavaScript",
|
1262
1314
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
1263
|
-
"X-Fern-SDK-Version": "3.0.
|
1315
|
+
"X-Fern-SDK-Version": "3.0.9",
|
1264
1316
|
},
|
1265
1317
|
contentType: "application/json",
|
1266
1318
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1319
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1267
1320
|
});
|
1268
1321
|
if (_response.ok) {
|
1269
1322
|
return yield serializers.PostOrderResponse.parseOrThrow(_response.body, {
|
@@ -1312,12 +1365,12 @@ class LabTests {
|
|
1312
1365
|
var _a;
|
1313
1366
|
return __awaiter(this, void 0, void 0, function* () {
|
1314
1367
|
const { finalStatus, delay } = request;
|
1315
|
-
const _queryParams =
|
1368
|
+
const _queryParams = {};
|
1316
1369
|
if (finalStatus != null) {
|
1317
|
-
_queryParams
|
1370
|
+
_queryParams["final_status"] = finalStatus;
|
1318
1371
|
}
|
1319
1372
|
if (delay != null) {
|
1320
|
-
_queryParams
|
1373
|
+
_queryParams["delay"] = delay.toString();
|
1321
1374
|
}
|
1322
1375
|
const _response = yield core.fetcher({
|
1323
1376
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v3/order/${orderId}/test`),
|
@@ -1326,11 +1379,12 @@ class LabTests {
|
|
1326
1379
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
1327
1380
|
"X-Fern-Language": "JavaScript",
|
1328
1381
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
1329
|
-
"X-Fern-SDK-Version": "3.0.
|
1382
|
+
"X-Fern-SDK-Version": "3.0.9",
|
1330
1383
|
},
|
1331
1384
|
contentType: "application/json",
|
1332
1385
|
queryParameters: _queryParams,
|
1333
1386
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1387
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1334
1388
|
});
|
1335
1389
|
if (_response.ok) {
|
1336
1390
|
return _response.body;
|
@@ -1369,39 +1423,40 @@ class LabTests {
|
|
1369
1423
|
/**
|
1370
1424
|
* GET many orders with filters.
|
1371
1425
|
* @throws {@link Vital.UnprocessableEntityError}
|
1426
|
+
*
|
1427
|
+
* @example
|
1428
|
+
* await vital.labTests.getOrders({})
|
1372
1429
|
*/
|
1373
1430
|
getOrders(request = {}, requestOptions) {
|
1374
1431
|
var _a;
|
1375
1432
|
return __awaiter(this, void 0, void 0, function* () {
|
1376
1433
|
const { startDate, endDate, userId, patientName, orderIds, page, size } = request;
|
1377
|
-
const _queryParams =
|
1434
|
+
const _queryParams = {};
|
1378
1435
|
if (startDate != null) {
|
1379
|
-
_queryParams
|
1436
|
+
_queryParams["start_date"] = startDate.toISOString();
|
1380
1437
|
}
|
1381
1438
|
if (endDate != null) {
|
1382
|
-
_queryParams
|
1439
|
+
_queryParams["end_date"] = endDate.toISOString();
|
1383
1440
|
}
|
1384
1441
|
if (userId != null) {
|
1385
|
-
_queryParams
|
1442
|
+
_queryParams["user_id"] = userId;
|
1386
1443
|
}
|
1387
1444
|
if (patientName != null) {
|
1388
|
-
_queryParams
|
1445
|
+
_queryParams["patient_name"] = patientName;
|
1389
1446
|
}
|
1390
1447
|
if (orderIds != null) {
|
1391
1448
|
if (Array.isArray(orderIds)) {
|
1392
|
-
|
1393
|
-
_queryParams.append("order_ids", _item);
|
1394
|
-
}
|
1449
|
+
_queryParams["order_ids"] = orderIds.map((item) => item);
|
1395
1450
|
}
|
1396
1451
|
else {
|
1397
|
-
_queryParams
|
1452
|
+
_queryParams["order_ids"] = orderIds;
|
1398
1453
|
}
|
1399
1454
|
}
|
1400
1455
|
if (page != null) {
|
1401
|
-
_queryParams
|
1456
|
+
_queryParams["page"] = page.toString();
|
1402
1457
|
}
|
1403
1458
|
if (size != null) {
|
1404
|
-
_queryParams
|
1459
|
+
_queryParams["size"] = size.toString();
|
1405
1460
|
}
|
1406
1461
|
const _response = yield core.fetcher({
|
1407
1462
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v3/orders"),
|
@@ -1410,11 +1465,12 @@ class LabTests {
|
|
1410
1465
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
1411
1466
|
"X-Fern-Language": "JavaScript",
|
1412
1467
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
1413
|
-
"X-Fern-SDK-Version": "3.0.
|
1468
|
+
"X-Fern-SDK-Version": "3.0.9",
|
1414
1469
|
},
|
1415
1470
|
contentType: "application/json",
|
1416
1471
|
queryParameters: _queryParams,
|
1417
1472
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1473
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1418
1474
|
});
|
1419
1475
|
if (_response.ok) {
|
1420
1476
|
return yield serializers.GetOrdersResponse.parseOrThrow(_response.body, {
|
@@ -7,7 +7,7 @@ export interface CreateOrderRequestCompatible {
|
|
7
7
|
labTestId: string;
|
8
8
|
physician?: Vital.PhysicianCreateRequest;
|
9
9
|
healthInsurance?: Vital.HealthInsuranceCreateRequest;
|
10
|
-
/** Defines whether order is priority or not.
|
10
|
+
/** Defines whether order is priority or not. For some labs, this refers to a STAT order. */
|
11
11
|
priority?: boolean;
|
12
12
|
consents?: Vital.Consent[];
|
13
13
|
patientDetails: Vital.PatientDetails;
|