@tryvital/vital-node 2.1.9 → 2.1.11

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.
@@ -2,6 +2,7 @@ import { AxiosInstance } from 'axios';
2
2
  import {
3
3
  AreaInfo,
4
4
  ClientFacingLabTest,
5
+ Consent,
5
6
  HealthInsurance,
6
7
  LabResultsMetadata,
7
8
  LabResultsResponse,
@@ -10,6 +11,7 @@ import {
10
11
  PatientAdress,
11
12
  PatientDetails,
12
13
  Physician,
14
+ ShippingDetails,
13
15
  } from './models/lab_tests_model';
14
16
 
15
17
  export class OrdersApi {
@@ -20,6 +22,44 @@ export class OrdersApi {
20
22
  this.client = axios;
21
23
  }
22
24
 
25
+ public async create_unregistered_testkit_order(
26
+ user_id: string,
27
+ lab_test_id: string,
28
+ shipping_details: ShippingDetails,
29
+ ): Promise<OrderRequestResponse> {
30
+ const resp = await this.client.post(
31
+ this.baseURL.concat('/order/testkit'),
32
+ {
33
+ user_id: user_id,
34
+ lab_test_id: lab_test_id,
35
+ shipping_details: shipping_details,
36
+ }
37
+ );
38
+ return resp.data;
39
+ }
40
+
41
+ public async register_testkit_order(
42
+ user_id: string,
43
+ sample_id: string,
44
+ patient_details: PatientDetails,
45
+ patient_address: PatientAdress,
46
+ physician?: Physician,
47
+ consents?: [Consent]
48
+ ): Promise<OrderRequestResponse> {
49
+ const resp = await this.client.post(
50
+ this.baseURL.concat('/order/testkit/register'),
51
+ {
52
+ user_id: user_id,
53
+ sample_id: sample_id,
54
+ patient_details: patient_details,
55
+ patient_address: patient_address,
56
+ physician: physician ? physician : null,
57
+ consents: consents ? consents : null,
58
+ }
59
+ );
60
+ return resp.data;
61
+ }
62
+
23
63
  // Create new order
24
64
  public async create_order(
25
65
  user_id: string,
@@ -27,7 +67,9 @@ export class OrdersApi {
27
67
  patient_address: PatientAdress,
28
68
  lab_test_id: string,
29
69
  physician?: Physician,
30
- health_insurance?: HealthInsurance
70
+ health_insurance?: HealthInsurance,
71
+ priority?: boolean,
72
+ consents?: [Consent]
31
73
  ): Promise<OrderRequestResponse> {
32
74
  const resp = await this.client.post(this.baseURL.concat('/order'), {
33
75
  user_id: user_id,
@@ -36,6 +78,8 @@ export class OrdersApi {
36
78
  lab_test_id: lab_test_id,
37
79
  physician: physician ? physician : null,
38
80
  health_insurance: health_insurance ? health_insurance : null,
81
+ priority: priority ? priority : null,
82
+ consents: consents ? consents : null,
39
83
  });
40
84
  return resp.data;
41
85
  }
@@ -1,3 +1,19 @@
1
+ export type ConsentType = "terms-of-use" | "telehealth-informed-consent" | "mobile-terms-and-conditions" | "notice-of-privacy-practices" | "privacy-policy" | "hipaa-authorization";
2
+
3
+ export type Consent = {
4
+ consentType: ConsentType;
5
+ };
6
+
7
+ export interface ShippingDetails {
8
+ receiver_name: string;
9
+ city: string;
10
+ state: string;
11
+ zip: string;
12
+ country: string;
13
+ first_line: string;
14
+ second_line?: string;
15
+ phone_number: string;
16
+ }
1
17
  export interface PatientAdress {
2
18
  receiver_name: string;
3
19
  city: string;
@@ -1,10 +1,12 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { AreaInfo, ClientFacingLabTest, HealthInsurance, LabResultsMetadata, LabResultsResponse, Order, OrderRequestResponse, PatientAdress, PatientDetails, Physician } from './models/lab_tests_model';
2
+ import { AreaInfo, ClientFacingLabTest, Consent, HealthInsurance, LabResultsMetadata, LabResultsResponse, Order, OrderRequestResponse, PatientAdress, PatientDetails, Physician, ShippingDetails } from './models/lab_tests_model';
3
3
  export declare class OrdersApi {
4
4
  baseURL: string;
5
5
  client: AxiosInstance;
6
6
  constructor(baseURL: string, axios: AxiosInstance);
7
- create_order(user_id: string, patient_details: PatientDetails, patient_address: PatientAdress, lab_test_id: string, physician?: Physician, health_insurance?: HealthInsurance): Promise<OrderRequestResponse>;
7
+ create_unregistered_testkit_order(user_id: string, lab_test_id: string, shipping_details: ShippingDetails): Promise<OrderRequestResponse>;
8
+ register_testkit_order(user_id: string, sample_id: string, patient_details: PatientDetails, patient_address: PatientAdress, physician?: Physician, consents?: [Consent]): Promise<OrderRequestResponse>;
9
+ create_order(user_id: string, patient_details: PatientDetails, patient_address: PatientAdress, lab_test_id: string, physician?: Physician, health_insurance?: HealthInsurance, priority?: boolean, consents?: [Consent]): Promise<OrderRequestResponse>;
8
10
  getOrder(orderId: string): Promise<Order>;
9
11
  getOrders(page?: number, size?: number): Promise<Order[]>;
10
12
  cancelOrder(orderId: string): Promise<OrderRequestResponse>;
@@ -42,8 +42,45 @@ var OrdersApi = /** @class */ (function () {
42
42
  this.baseURL = baseURL;
43
43
  this.client = axios;
44
44
  }
45
+ OrdersApi.prototype.create_unregistered_testkit_order = function (user_id, lab_test_id, shipping_details) {
46
+ return __awaiter(this, void 0, void 0, function () {
47
+ var resp;
48
+ return __generator(this, function (_a) {
49
+ switch (_a.label) {
50
+ case 0: return [4 /*yield*/, this.client.post(this.baseURL.concat('/order/testkit'), {
51
+ user_id: user_id,
52
+ lab_test_id: lab_test_id,
53
+ shipping_details: shipping_details,
54
+ })];
55
+ case 1:
56
+ resp = _a.sent();
57
+ return [2 /*return*/, resp.data];
58
+ }
59
+ });
60
+ });
61
+ };
62
+ OrdersApi.prototype.register_testkit_order = function (user_id, sample_id, patient_details, patient_address, physician, consents) {
63
+ return __awaiter(this, void 0, void 0, function () {
64
+ var resp;
65
+ return __generator(this, function (_a) {
66
+ switch (_a.label) {
67
+ case 0: return [4 /*yield*/, this.client.post(this.baseURL.concat('/order/testkit/register'), {
68
+ user_id: user_id,
69
+ sample_id: sample_id,
70
+ patient_details: patient_details,
71
+ patient_address: patient_address,
72
+ physician: physician ? physician : null,
73
+ consents: consents ? consents : null,
74
+ })];
75
+ case 1:
76
+ resp = _a.sent();
77
+ return [2 /*return*/, resp.data];
78
+ }
79
+ });
80
+ });
81
+ };
45
82
  // Create new order
46
- OrdersApi.prototype.create_order = function (user_id, patient_details, patient_address, lab_test_id, physician, health_insurance) {
83
+ OrdersApi.prototype.create_order = function (user_id, patient_details, patient_address, lab_test_id, physician, health_insurance, priority, consents) {
47
84
  return __awaiter(this, void 0, void 0, function () {
48
85
  var resp;
49
86
  return __generator(this, function (_a) {
@@ -55,6 +92,8 @@ var OrdersApi = /** @class */ (function () {
55
92
  lab_test_id: lab_test_id,
56
93
  physician: physician ? physician : null,
57
94
  health_insurance: health_insurance ? health_insurance : null,
95
+ priority: priority ? priority : null,
96
+ consents: consents ? consents : null,
58
97
  })];
59
98
  case 1:
60
99
  resp = _a.sent();
@@ -1,3 +1,17 @@
1
+ export declare type ConsentType = "terms-of-use" | "telehealth-informed-consent" | "mobile-terms-and-conditions" | "notice-of-privacy-practices" | "privacy-policy" | "hipaa-authorization";
2
+ export declare type Consent = {
3
+ consentType: ConsentType;
4
+ };
5
+ export interface ShippingDetails {
6
+ receiver_name: string;
7
+ city: string;
8
+ state: string;
9
+ zip: string;
10
+ country: string;
11
+ first_line: string;
12
+ second_line?: string;
13
+ phone_number: string;
14
+ }
1
15
  export interface PatientAdress {
2
16
  receiver_name: string;
3
17
  city: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [