@tryvital/vital-node 2.1.12 → 2.1.14

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.
@@ -21,6 +21,14 @@ export class OrdersApi {
21
21
  this.baseURL = baseURL;
22
22
  this.client = axios;
23
23
  }
24
+
25
+ public async getRequisitionPdf(orderId: string): Promise<string> {
26
+ const resp = await this.client.get(
27
+ this.baseURL.concat(`/order/${orderId}/requisition/pdf`),
28
+ { headers: { 'Accept': 'application/pdf' } }
29
+ );
30
+ return resp.data;
31
+ }
24
32
 
25
33
  public async create_unregistered_testkit_order(
26
34
  user_id: string,
@@ -54,7 +62,7 @@ export class OrdersApi {
54
62
  patient_details: patient_details,
55
63
  patient_address: patient_address,
56
64
  physician: physician ? physician : null,
57
- consents: consents ? consents : null,
65
+ consents: consents ? consents : [],
58
66
  }
59
67
  );
60
68
  return resp.data;
@@ -78,8 +86,8 @@ export class OrdersApi {
78
86
  lab_test_id: lab_test_id,
79
87
  physician: physician ? physician : null,
80
88
  health_insurance: health_insurance ? health_insurance : null,
81
- priority: priority ? priority : null,
82
- consents: consents ? consents : null,
89
+ priority: priority ? priority : false,
90
+ consents: consents ? consents : [],
83
91
  });
84
92
  return resp.data;
85
93
  }
@@ -4,6 +4,7 @@ export declare class OrdersApi {
4
4
  baseURL: string;
5
5
  client: AxiosInstance;
6
6
  constructor(baseURL: string, axios: AxiosInstance);
7
+ getRequisitionPdf(orderId: string): Promise<string>;
7
8
  create_unregistered_testkit_order(user_id: string, lab_test_id: string, shipping_details: ShippingDetails): Promise<OrderRequestResponse>;
8
9
  register_testkit_order(user_id: string, sample_id: string, patient_details: PatientDetails, patient_address: PatientAdress, physician?: Physician, consents?: [Consent]): Promise<OrderRequestResponse>;
9
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>;
@@ -42,6 +42,19 @@ var OrdersApi = /** @class */ (function () {
42
42
  this.baseURL = baseURL;
43
43
  this.client = axios;
44
44
  }
45
+ OrdersApi.prototype.getRequisitionPdf = function (orderId) {
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.get(this.baseURL.concat("/order/" + orderId + "/requisition/pdf"), { headers: { 'Accept': 'application/pdf' } })];
51
+ case 1:
52
+ resp = _a.sent();
53
+ return [2 /*return*/, resp.data];
54
+ }
55
+ });
56
+ });
57
+ };
45
58
  OrdersApi.prototype.create_unregistered_testkit_order = function (user_id, lab_test_id, shipping_details) {
46
59
  return __awaiter(this, void 0, void 0, function () {
47
60
  var resp;
@@ -70,7 +83,7 @@ var OrdersApi = /** @class */ (function () {
70
83
  patient_details: patient_details,
71
84
  patient_address: patient_address,
72
85
  physician: physician ? physician : null,
73
- consents: consents ? consents : null,
86
+ consents: consents ? consents : [],
74
87
  })];
75
88
  case 1:
76
89
  resp = _a.sent();
@@ -92,8 +105,8 @@ var OrdersApi = /** @class */ (function () {
92
105
  lab_test_id: lab_test_id,
93
106
  physician: physician ? physician : null,
94
107
  health_insurance: health_insurance ? health_insurance : null,
95
- priority: priority ? priority : null,
96
- consents: consents ? consents : null,
108
+ priority: priority ? priority : false,
109
+ consents: consents ? consents : [],
97
110
  })];
98
111
  case 1:
99
112
  resp = _a.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "2.1.12",
3
+ "version": "2.1.14",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [