@tryvital/vital-node 2.1.13 → 2.1.15

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,14 +2,14 @@ import { AxiosInstance } from 'axios';
2
2
  import {
3
3
  AreaInfo,
4
4
  ClientFacingLabTest,
5
- Consent,
5
+ Consent, Diagnosis,
6
6
  HealthInsurance,
7
7
  LabResultsMetadata,
8
8
  LabResultsResponse,
9
9
  Order,
10
10
  OrderRequestResponse,
11
11
  PatientAdress,
12
- PatientDetails,
12
+ PatientDetails, Payor,
13
13
  Physician,
14
14
  ShippingDetails,
15
15
  } from './models/lab_tests_model';
@@ -62,7 +62,7 @@ export class OrdersApi {
62
62
  patient_details: patient_details,
63
63
  patient_address: patient_address,
64
64
  physician: physician ? physician : null,
65
- consents: consents ? consents : null,
65
+ consents: consents ? consents : [],
66
66
  }
67
67
  );
68
68
  return resp.data;
@@ -86,8 +86,8 @@ export class OrdersApi {
86
86
  lab_test_id: lab_test_id,
87
87
  physician: physician ? physician : null,
88
88
  health_insurance: health_insurance ? health_insurance : null,
89
- priority: priority ? priority : null,
90
- consents: consents ? consents : null,
89
+ priority: priority ? priority : false,
90
+ consents: consents ? consents : [],
91
91
  });
92
92
  return resp.data;
93
93
  }
@@ -100,6 +100,25 @@ export class OrdersApi {
100
100
  return resp.data;
101
101
  }
102
102
 
103
+ //Get order status.
104
+ public async searchPayor(insurance_name: string, insurance_state?: string): Promise<Payor> {
105
+ const resp = await this.client.post(
106
+ this.baseURL.concat(`/insurance/search/payor`), {
107
+ insurance_name: insurance_name,
108
+ insurance_state: insurance_state ?? null
109
+ }
110
+ );
111
+ return resp.data;
112
+ }
113
+
114
+ public async searchDiagnosis(diagnosis_query: string): Promise<Diagnosis[]> {
115
+ const resp = await this.client.get(
116
+ this.baseURL.concat('/insurance/search/diagnosis?') +
117
+ new URLSearchParams({ diagnosis_query: diagnosis_query })
118
+ );
119
+ return resp.data;
120
+ }
121
+
103
122
  public async getOrders(page?: number, size?: number): Promise<Order[]> {
104
123
  const resp = await this.client.get(
105
124
  this.baseURL.concat(`/orders?`) +
@@ -1,3 +1,5 @@
1
+ import {USAddress} from "./athome_phlebotomy_models";
2
+
1
3
  export type ConsentType = "terms-of-use" | "telehealth-informed-consent" | "mobile-terms-and-conditions" | "notice-of-privacy-practices" | "privacy-policy" | "hipaa-authorization";
2
4
 
3
5
  export type Consent = {
@@ -71,6 +73,25 @@ export interface TestkitEvent {
71
73
  status: string;
72
74
  }
73
75
 
76
+ export interface PayorAddress{
77
+ city: string;
78
+ state: string;
79
+ zip: string;
80
+ country: string;
81
+ first_line: string;
82
+ }
83
+
84
+ export interface Payor {
85
+ code: string;
86
+ name: string;
87
+ org_address: PayorAddress;
88
+ }
89
+
90
+ export interface Diagnosis {
91
+ diagnosis_code: string;
92
+ description: string;
93
+ }
94
+
74
95
  export interface Order {
75
96
  user_id: string;
76
97
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { AreaInfo, ClientFacingLabTest, Consent, HealthInsurance, LabResultsMetadata, LabResultsResponse, Order, OrderRequestResponse, PatientAdress, PatientDetails, Physician, ShippingDetails } from './models/lab_tests_model';
2
+ import { AreaInfo, ClientFacingLabTest, Consent, Diagnosis, HealthInsurance, LabResultsMetadata, LabResultsResponse, Order, OrderRequestResponse, PatientAdress, PatientDetails, Payor, Physician, ShippingDetails } from './models/lab_tests_model';
3
3
  export declare class OrdersApi {
4
4
  baseURL: string;
5
5
  client: AxiosInstance;
@@ -9,6 +9,8 @@ export declare class OrdersApi {
9
9
  register_testkit_order(user_id: string, sample_id: string, patient_details: PatientDetails, patient_address: PatientAdress, physician?: Physician, consents?: [Consent]): Promise<OrderRequestResponse>;
10
10
  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>;
11
11
  getOrder(orderId: string): Promise<Order>;
12
+ searchPayor(insurance_name: string, insurance_state?: string): Promise<Payor>;
13
+ searchDiagnosis(diagnosis_query: string): Promise<Diagnosis[]>;
12
14
  getOrders(page?: number, size?: number): Promise<Order[]>;
13
15
  cancelOrder(orderId: string): Promise<OrderRequestResponse>;
14
16
  }
@@ -83,7 +83,7 @@ var OrdersApi = /** @class */ (function () {
83
83
  patient_details: patient_details,
84
84
  patient_address: patient_address,
85
85
  physician: physician ? physician : null,
86
- consents: consents ? consents : null,
86
+ consents: consents ? consents : [],
87
87
  })];
88
88
  case 1:
89
89
  resp = _a.sent();
@@ -105,8 +105,8 @@ var OrdersApi = /** @class */ (function () {
105
105
  lab_test_id: lab_test_id,
106
106
  physician: physician ? physician : null,
107
107
  health_insurance: health_insurance ? health_insurance : null,
108
- priority: priority ? priority : null,
109
- consents: consents ? consents : null,
108
+ priority: priority ? priority : false,
109
+ consents: consents ? consents : [],
110
110
  })];
111
111
  case 1:
112
112
  resp = _a.sent();
@@ -129,6 +129,37 @@ var OrdersApi = /** @class */ (function () {
129
129
  });
130
130
  });
131
131
  };
132
+ //Get order status.
133
+ OrdersApi.prototype.searchPayor = function (insurance_name, insurance_state) {
134
+ return __awaiter(this, void 0, void 0, function () {
135
+ var resp;
136
+ return __generator(this, function (_a) {
137
+ switch (_a.label) {
138
+ case 0: return [4 /*yield*/, this.client.post(this.baseURL.concat("/insurance/search/payor"), {
139
+ insurance_name: insurance_name,
140
+ insurance_state: insurance_state !== null && insurance_state !== void 0 ? insurance_state : null
141
+ })];
142
+ case 1:
143
+ resp = _a.sent();
144
+ return [2 /*return*/, resp.data];
145
+ }
146
+ });
147
+ });
148
+ };
149
+ OrdersApi.prototype.searchDiagnosis = function (diagnosis_query) {
150
+ return __awaiter(this, void 0, void 0, function () {
151
+ var resp;
152
+ return __generator(this, function (_a) {
153
+ switch (_a.label) {
154
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat('/insurance/search/diagnosis?') +
155
+ new URLSearchParams({ diagnosis_query: diagnosis_query }))];
156
+ case 1:
157
+ resp = _a.sent();
158
+ return [2 /*return*/, resp.data];
159
+ }
160
+ });
161
+ });
162
+ };
132
163
  OrdersApi.prototype.getOrders = function (page, size) {
133
164
  return __awaiter(this, void 0, void 0, function () {
134
165
  var resp;
@@ -61,6 +61,22 @@ export interface TestkitEvent {
61
61
  created_at: string;
62
62
  status: string;
63
63
  }
64
+ export interface PayorAddress {
65
+ city: string;
66
+ state: string;
67
+ zip: string;
68
+ country: string;
69
+ first_line: string;
70
+ }
71
+ export interface Payor {
72
+ code: string;
73
+ name: string;
74
+ org_address: PayorAddress;
75
+ }
76
+ export interface Diagnosis {
77
+ diagnosis_code: string;
78
+ description: string;
79
+ }
64
80
  export interface Order {
65
81
  user_id: string;
66
82
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "2.1.13",
3
+ "version": "2.1.15",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [