@tryvital/vital-node 2.1.14 → 2.1.16

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';
@@ -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?`) +
@@ -159,7 +178,7 @@ export class ResultsApi {
159
178
  // such as whether the area is served by our Phlebotomy network.
160
179
  public async getAreaInfo(zip_code: string): Promise<AreaInfo> {
161
180
  const resp = await this.client.get(
162
- this.baseURL.concat('/area/info?') +
181
+ this.baseURL.concat('/order/area/info?') +
163
182
  new URLSearchParams({ zip_code: zip_code })
164
183
  );
165
184
  return resp.data;
@@ -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
  }
@@ -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;
@@ -219,7 +250,7 @@ var ResultsApi = /** @class */ (function () {
219
250
  var resp;
220
251
  return __generator(this, function (_a) {
221
252
  switch (_a.label) {
222
- case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat('/area/info?') +
253
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat('/order/area/info?') +
223
254
  new URLSearchParams({ zip_code: zip_code }))];
224
255
  case 1:
225
256
  resp = _a.sent();
@@ -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.14",
3
+ "version": "2.1.16",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [