fluent-cerner-js 0.1.0

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.
@@ -0,0 +1,418 @@
1
+ var MPageOrderEvent = /*#__PURE__*/function () {
2
+ function MPageOrderEvent() {
3
+ var _this = this;
4
+
5
+ this.getOrders = function () {
6
+ return _this._orders;
7
+ };
8
+
9
+ this._tabList = {
10
+ tab: 0,
11
+ tabDisplayFlag: 0
12
+ };
13
+
14
+ this.getTabList = function () {
15
+ return _this._tabList;
16
+ };
17
+
18
+ this._personId = 0;
19
+
20
+ this.getPersonId = function () {
21
+ return _this._personId;
22
+ };
23
+
24
+ this._encounterId = 0;
25
+
26
+ this.getEncounterId = function () {
27
+ return _this._encounterId;
28
+ };
29
+
30
+ this._powerPlanFlag = 0;
31
+
32
+ this.getPowerPlanFlag = function () {
33
+ return _this._powerPlanFlag;
34
+ };
35
+
36
+ this._defaultDisplay = 0;
37
+
38
+ this.getDefaultDisplay = function () {
39
+ return _this._defaultDisplay;
40
+ };
41
+
42
+ this._silentSignFlag = 0;
43
+
44
+ this.getSilentSignFlag = function () {
45
+ return _this._silentSignFlag;
46
+ };
47
+
48
+ this._orders = [];
49
+ this._tabList = {
50
+ tab: 0,
51
+ tabDisplayFlag: 0
52
+ }; // Disable PowerPlans by default
53
+
54
+ this._powerPlanFlag = 0; // Disable PowerOrders by default
55
+
56
+ this._tabList.tabDisplayFlag = 0;
57
+ this.customizeOrderListProfile();
58
+ this.launchOrderProfile(); // Do NOT sign silently by default
59
+
60
+ this._silentSignFlag = 0;
61
+ }
62
+
63
+ var _proto = MPageOrderEvent.prototype;
64
+
65
+ _proto.forPerson = function forPerson(id) {
66
+ this._personId = id;
67
+ return this;
68
+ };
69
+
70
+ _proto.forEncounter = function forEncounter(id) {
71
+ this._encounterId = id;
72
+ return this;
73
+ };
74
+
75
+ _proto.addOrders = function addOrders(orders) {
76
+ if (!Array.isArray(orders)) {
77
+ orders = [orders];
78
+ }
79
+
80
+ this._orders = this._orders.concat(orders);
81
+ return this;
82
+ };
83
+
84
+ _proto.enablePowerPlans = function enablePowerPlans() {
85
+ this._powerPlanFlag = 24;
86
+ return this;
87
+ };
88
+
89
+ _proto.customizeOrderListProfile = function customizeOrderListProfile() {
90
+ this._tabList.tab = 2;
91
+ return this;
92
+ };
93
+
94
+ _proto.customizeMedicationListProfile = function customizeMedicationListProfile() {
95
+ this._tabList.tab = 3;
96
+ return this;
97
+ };
98
+
99
+ _proto.enablePowerOrders = function enablePowerOrders() {
100
+ this._tabList.tabDisplayFlag = 127;
101
+ return this;
102
+ };
103
+
104
+ _proto.launchOrderSearch = function launchOrderSearch() {
105
+ this._defaultDisplay = 8;
106
+ return this;
107
+ };
108
+
109
+ _proto.launchOrderProfile = function launchOrderProfile() {
110
+ this._defaultDisplay = 16;
111
+ return this;
112
+ };
113
+
114
+ _proto.launchOrdersForSignature = function launchOrdersForSignature() {
115
+ this._defaultDisplay = 32;
116
+ return this;
117
+ };
118
+
119
+ _proto.signSilently = function signSilently() {
120
+ this._silentSignFlag = 1;
121
+ return this;
122
+ };
123
+
124
+ _proto.send = function send() {
125
+ try {
126
+ // @ts-ignore
127
+ w.MPAGES_EVENT('ORDERS', this.toString());
128
+ } catch (e) {
129
+ if (e instanceof ReferenceError) {
130
+ console.warn("We're likely not inside PowerChart. The output would be an MPAGES_EVENT: " + this.toString());
131
+ } else {
132
+ throw e;
133
+ }
134
+ }
135
+ };
136
+
137
+ _proto.toString = function toString() {
138
+ var head = this._personId + "|" + this._encounterId + "|";
139
+ var body = '';
140
+
141
+ this._orders.forEach(function (order) {
142
+ body += order.toString();
143
+ });
144
+
145
+ var tail = "|" + this._powerPlanFlag + "|{" + this._tabList.tab + "|" + this._tabList.tabDisplayFlag + "}|" + this._defaultDisplay + "|" + this._silentSignFlag;
146
+ return "" + head + body + tail;
147
+ };
148
+
149
+ return MPageOrderEvent;
150
+ }();
151
+
152
+ var MPageOrder = /*#__PURE__*/function () {
153
+ function MPageOrder() {
154
+ var _this = this;
155
+
156
+ this._orderAction = '';
157
+
158
+ this.getOrderAction = function () {
159
+ return _this._orderAction;
160
+ };
161
+
162
+ this._orderId = 0;
163
+
164
+ this.getOrderId = function () {
165
+ return _this._orderId;
166
+ };
167
+
168
+ this._synonymId = 0;
169
+
170
+ this.getSynonymId = function () {
171
+ return _this._synonymId;
172
+ };
173
+
174
+ this._orderOrigination = 0;
175
+
176
+ this.getOrderOrigination = function () {
177
+ return _this._orderOrigination;
178
+ };
179
+
180
+ this._orderSentenceId = 0;
181
+
182
+ this.getOrderSentenceId = function () {
183
+ return _this._orderSentenceId;
184
+ };
185
+
186
+ this._nomenclatureId = 0;
187
+
188
+ this.getNomenclatureId = function () {
189
+ return _this._nomenclatureId;
190
+ };
191
+
192
+ this._signTimeInteraction = 0;
193
+
194
+ this.getSignTimeInteraction = function () {
195
+ return _this._signTimeInteraction;
196
+ };
197
+ }
198
+ /**
199
+ * Creates a new MPageOrder with the order action 'ACTIVATE', which is the prototype for activating an existing future order.
200
+ *
201
+ * @since 0.1.0
202
+ * @category MPage Events - Orders
203
+ * @param {number} orderId The order id value for the order to activate.
204
+ * @returns {this} Returns itself to continue chaining method calls.
205
+ */
206
+
207
+
208
+ var _proto = MPageOrder.prototype;
209
+
210
+ _proto.willActivate = function willActivate(orderId) {
211
+ this._orderAction = 'ACTIVATE';
212
+ this._orderId = orderId;
213
+ return this;
214
+ }
215
+ /**
216
+ * Creates a new MPageOrder with the order action 'CANCEL DC', which is the prototype for canceling and discontinuing an existing future order.
217
+ *
218
+ * @since 0.1.0
219
+ * @param {number} orderId The order id value for the order to activate.
220
+ * @returns {this} Returns itself to continue chaining method calls.
221
+ */
222
+ ;
223
+
224
+ _proto.willCancelDiscontinue = function willCancelDiscontinue(orderId) {
225
+ this._orderAction = 'CANCEL DC';
226
+ this._orderId = orderId;
227
+ return this;
228
+ }
229
+ /**
230
+ * Creates a new MPageOrder with the order action 'CANCEL REORD', which is the prototype for cancelling and reordering an existing future order.
231
+ *
232
+ * @since 0.1.0
233
+ * @param {number} orderId The order id value for the order to activate.
234
+ * @returns {this} Returns itself to continue chaining method calls.
235
+ */
236
+ ;
237
+
238
+ _proto.willCancelReorder = function willCancelReorder(orderId) {
239
+ this._orderAction = 'CANCEL REORD';
240
+ this._orderId = orderId;
241
+ return this;
242
+ }
243
+ /**
244
+ * Creates a new MPageOrder with the order action 'CLEAR', which is the prototype for clearing actions of an existing future order.
245
+ *
246
+ * @since 0.1.0
247
+ * @param {number} orderId The order id value for the order to activate.
248
+ * @returns {this} Returns itself to continue chaining method calls.
249
+ */
250
+ ;
251
+
252
+ _proto.willClear = function willClear(orderId) {
253
+ this._orderAction = 'CLEAR';
254
+ this._orderId = orderId;
255
+ return this;
256
+ }
257
+ /**
258
+ * Creates a new MPageOrder with the order action 'CONVERT_INPAT', which is the prototype for converting a prescription order into an inpatient order.
259
+ *
260
+ * @since 0.1.0
261
+ * @param {number} orderId The order id value for the order to activate.
262
+ * @returns {this} Returns itself to continue chaining method calls.
263
+ */
264
+ ;
265
+
266
+ _proto.willConvertInpatient = function willConvertInpatient(orderId) {
267
+ this._orderAction = 'CONVERT_INPAT';
268
+ this._orderId = orderId;
269
+ return this;
270
+ }
271
+ /**
272
+ * Creates a new MPageOrder with the order action 'CONVERT_RX', which is the prototype for converting an inpatient order into a prescription.
273
+ *
274
+ * @since 0.1.0
275
+ * @param {number} orderId The order id value for the order to activate.
276
+ * @returns {this} Returns itself to continue chaining method calls.
277
+ */
278
+ ;
279
+
280
+ _proto.willConvertToPrescriptionOrder = function willConvertToPrescriptionOrder(orderId) {
281
+ this._orderAction = 'CONVERT_RX';
282
+ this._orderId = orderId;
283
+ return this;
284
+ }
285
+ /**
286
+ * Creates a new MPageOrder with the order action 'MODIFY', which is the prototype for modifying an existing future order.
287
+ *
288
+ * @since 0.1.0
289
+ * @param {number} orderId The order id value for the order to activate.
290
+ * @returns {this} Returns itself to continue chaining method calls.
291
+ */
292
+ ;
293
+
294
+ _proto.willModify = function willModify(orderId) {
295
+ this._orderAction = 'MODIFY';
296
+ this._orderId = orderId;
297
+ return this;
298
+ }
299
+ /**
300
+ * Creates a new MPage Order with order action 'ORDER'.
301
+ *
302
+ * @since 0.1.0
303
+ * @category MPage Events - Orders
304
+ * @param {number} synonymId The Cerner synonym_id to be associated with the new order. Must be set.
305
+ * @param {NewOrderOpts} options required when making a new order
306
+ * @returns {this} Returns itself to continue chaining method calls.
307
+ * default to a normal order type.
308
+ * @throws Error if `isRxOrder` and `isSatelliteOrder` are both set to true. These two are mutually exclusive and setting
309
+ * both creates underfined behavior with respect the order origination field.
310
+ * @example
311
+ * m.willMakeNewOrder(34, true, 13, 42, true).toString() => "{'ORDER'|34|5|1342|1}"
312
+ */
313
+ ;
314
+
315
+ _proto.willMakeNewOrder = function willMakeNewOrder(synonymId, opts) {
316
+ var _ref = opts || {},
317
+ isRxOrder = _ref.isRxOrder,
318
+ isSatelliteOrder = _ref.isSatelliteOrder,
319
+ orderSentenceId = _ref.orderSentenceId,
320
+ nomenclatureId = _ref.nomenclatureId,
321
+ skipInteractionCheckUntilSign = _ref.skipInteractionCheckUntilSign;
322
+
323
+ if (isRxOrder && isSatelliteOrder) throw new Error('must select either isRxOrder or isSatelliteOrder');
324
+ this._orderAction = 'ORDER';
325
+ this._synonymId = synonymId;
326
+ this._orderSentenceId = orderSentenceId || 0;
327
+ this._nomenclatureId = nomenclatureId || 0;
328
+ this._signTimeInteraction = skipInteractionCheckUntilSign ? 1 : 0;
329
+ this._orderOrigination = isSatelliteOrder ? 5 : isRxOrder ? 1 : 0;
330
+ return this;
331
+ }
332
+ /**
333
+ * Creates a new MPageOrder with the order action 'RENEW', which is the prototype for reviewing an existing non-prescription order.
334
+ *
335
+ * @since 0.1.0
336
+ * @param {number} orderId The order id value for the order to activate.
337
+ * @returns {this} Returns itself to continue chaining method calls.
338
+ */
339
+ ;
340
+
341
+ _proto.willRenewNonPrescription = function willRenewNonPrescription(orderId) {
342
+ this._orderAction = 'RENEW';
343
+ this._orderId = orderId;
344
+ return this;
345
+ }
346
+ /**
347
+ * Creates a new MPageOrder with the order action 'RENEW_RX', which is the prototype for renewing an existing prescription order.
348
+ *
349
+ * @since 0.1.0
350
+ * @param {number} orderId The order id value for the order to activate.
351
+ * @returns {this} Returns itself to continue chaining method calls.
352
+ */
353
+ ;
354
+
355
+ _proto.willRenewPrescription = function willRenewPrescription(orderId) {
356
+ this._orderAction = 'RENEW_RX';
357
+ this._orderId = orderId;
358
+ return this;
359
+ }
360
+ /**
361
+ * Creates a new MPageOrder with the order action 'REPEAT', which is the prototype for copying an order.
362
+ *
363
+ * @since 0.1.0
364
+ * @param {number} orderId The order id value for the order to activate.
365
+ * @returns {this} Returns itself to continue chaining method calls.
366
+ */
367
+ ;
368
+
369
+ _proto.willCopyExistingOrder = function willCopyExistingOrder(orderId) {
370
+ this._orderAction = 'REPEAT';
371
+ this._orderId = orderId;
372
+ return this;
373
+ }
374
+ /**
375
+ * Creates a new MPageOrder with the order action 'RESUME', which is the prototype for resuming a suspended order.
376
+ *
377
+ * @since 0.1.0
378
+ * @param {number} orderId The order id value for the order to activate.
379
+ * @returns {this} Returns itself to continue chaining method calls.
380
+ */
381
+ ;
382
+
383
+ _proto.willResumeSuspendedOrder = function willResumeSuspendedOrder(orderId) {
384
+ this._orderAction = 'RESUME';
385
+ this._orderId = orderId;
386
+ return this;
387
+ }
388
+ /**
389
+ * Creates a new MPageOrder with the order action 'SUSPEND', which is the prototype for suspending an existing order.
390
+ *
391
+ * @since 0.1.0
392
+ * @param {number} orderId The order id value for the order to activate.
393
+ * @returns {this} Returns itself to continue chaining method calls.
394
+ */
395
+ ;
396
+
397
+ _proto.willSuspend = function willSuspend(orderId) {
398
+ this._orderAction = 'SUSPEND';
399
+ this._orderId = orderId;
400
+ return this;
401
+ }
402
+ /**
403
+ * Overrides the toString() method for representing the objects internal state as a string.
404
+ *
405
+ * @since 0.1.0
406
+ * @returns {string} string representation of MPageOrder's internal state
407
+ */
408
+ ;
409
+
410
+ _proto.toString = function toString() {
411
+ return this._orderAction === 'ORDER' ? "{" + this._orderAction + "|" + this._synonymId + "|" + this._orderOrigination + "|" + this._orderSentenceId + "|" + this._nomenclatureId + "|" + this._signTimeInteraction + "}" : "{" + this._orderAction + "|" + this._orderId + "}";
412
+ };
413
+
414
+ return MPageOrder;
415
+ }();
416
+
417
+ export { MPageOrder, MPageOrderEvent };
418
+ //# sourceMappingURL=fluent-cerner-js.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluent-cerner-js.esm.js","sources":["../src/MPageOrderEvent.ts","../src/MPageOrder.ts"],"sourcesContent":["import { MPageOrder } from '.';\n\nclass MPageOrderEvent {\n private _orders: Array<MPageOrder>;\n getOrders = () => this._orders;\n\n private _tabList: { tab: number; tabDisplayFlag: number } = {\n tab: 0,\n tabDisplayFlag: 0,\n };\n getTabList = () => this._tabList;\n\n private _personId: number = 0;\n getPersonId = () => this._personId;\n\n private _encounterId: number = 0;\n getEncounterId = () => this._encounterId;\n\n private _powerPlanFlag: number = 0;\n getPowerPlanFlag = () => this._powerPlanFlag;\n\n private _defaultDisplay: number = 0;\n getDefaultDisplay = () => this._defaultDisplay;\n\n private _silentSignFlag: number = 0;\n getSilentSignFlag = () => this._silentSignFlag;\n\n constructor() {\n this._orders = [];\n this._tabList = { tab: 0, tabDisplayFlag: 0 };\n // Disable PowerPlans by default\n this._powerPlanFlag = 0;\n // Disable PowerOrders by default\n this._tabList.tabDisplayFlag = 0;\n this.customizeOrderListProfile();\n this.launchOrderProfile();\n // Do NOT sign silently by default\n this._silentSignFlag = 0;\n }\n\n forPerson(id: number) {\n this._personId = id;\n return this;\n }\n\n forEncounter(id: number) {\n this._encounterId = id;\n return this;\n }\n\n addOrders(orders: Array<MPageOrder> | MPageOrder) {\n if (!Array.isArray(orders)) {\n orders = [orders];\n }\n this._orders = this._orders.concat(orders);\n return this;\n }\n\n enablePowerPlans() {\n this._powerPlanFlag = 24;\n return this;\n }\n\n customizeOrderListProfile() {\n this._tabList.tab = 2;\n return this;\n }\n\n customizeMedicationListProfile() {\n this._tabList.tab = 3;\n return this;\n }\n\n enablePowerOrders() {\n this._tabList.tabDisplayFlag = 127;\n return this;\n }\n\n launchOrderSearch() {\n this._defaultDisplay = 8;\n return this;\n }\n\n launchOrderProfile() {\n this._defaultDisplay = 16;\n return this;\n }\n\n launchOrdersForSignature() {\n this._defaultDisplay = 32;\n return this;\n }\n\n signSilently() {\n this._silentSignFlag = 1;\n return this;\n }\n\n send() {\n try {\n // @ts-ignore\n w.MPAGES_EVENT('ORDERS', this.toString());\n } catch (e) {\n if (e instanceof ReferenceError) {\n console.warn(\n `We're likely not inside PowerChart. The output would be an MPAGES_EVENT: ${this.toString()}`\n );\n } else {\n throw e;\n }\n }\n }\n\n toString(): string {\n const head = `${this._personId}|${this._encounterId}|`;\n let body: string = '';\n this._orders.forEach(order => {\n body += order.toString();\n });\n const tail = `|${this._powerPlanFlag}|{${this._tabList.tab}|${this._tabList.tabDisplayFlag}}|${this._defaultDisplay}|${this._silentSignFlag}`;\n\n return `${head}${body}${tail}`;\n }\n}\n\nexport { MPageOrderEvent };\n","/**\n * Options for a new order\n * @param {boolean} isRxOrder Marks the order order as a prescription. Is mutually exclusive from\n * isSatelliteOrder. Field will be set to false if left undefined; this resolves to 0 when built.\n * @param {boolean} isSatelliteOrder Moarks the order origination as satellite. Is mutually\n * exclusive from isRxOrder. Field will be set to false if left undefined; this resolves to 0 when built.\n * @param {number} orderSentenceId The optional Cerner order_sentence_id to be associated with\n * the new order. Field will be set to 0 if undefined.\n * @param {number} nomenclatureId The optional Cerner nomenclature_id to be associated with the\n * new order. Field will be set to 0 if undefined.\n * @param {boolean} skipInteractionCheckUntilSign Determines cerner sign-time interaction\n * checking. A value of true skips checking for interactions until orders are signed, false\n * will not. Field will be set to false if left undefined; this resolves to 0 when built.\n */\nexport type NewOrderOpts = {\n isRxOrder?: boolean;\n isSatelliteOrder?: boolean;\n orderSentenceId?: number;\n nomenclatureId?: number;\n skipInteractionCheckUntilSign?: boolean;\n};\n\nexport class MPageOrder {\n private _orderAction: string = '';\n getOrderAction = () => this._orderAction;\n\n private _orderId: number = 0;\n getOrderId = () => this._orderId;\n\n private _synonymId: number = 0;\n getSynonymId = () => this._synonymId;\n\n private _orderOrigination: number = 0;\n getOrderOrigination = () => this._orderOrigination;\n\n private _orderSentenceId: number = 0;\n getOrderSentenceId = () => this._orderSentenceId;\n\n private _nomenclatureId: number = 0;\n getNomenclatureId = () => this._nomenclatureId;\n\n private _signTimeInteraction: number = 0;\n getSignTimeInteraction = () => this._signTimeInteraction;\n\n /**\n * Creates a new MPageOrder with the order action 'ACTIVATE', which is the prototype for activating an existing future order.\n *\n * @since 0.1.0\n * @category MPage Events - Orders\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willActivate(orderId: number) {\n this._orderAction = 'ACTIVATE';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CANCEL DC', which is the prototype for canceling and discontinuing an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willCancelDiscontinue(orderId: number) {\n this._orderAction = 'CANCEL DC';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CANCEL REORD', which is the prototype for cancelling and reordering an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willCancelReorder(orderId: number) {\n this._orderAction = 'CANCEL REORD';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CLEAR', which is the prototype for clearing actions of an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willClear(orderId: number) {\n this._orderAction = 'CLEAR';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CONVERT_INPAT', which is the prototype for converting a prescription order into an inpatient order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willConvertInpatient(orderId: number) {\n this._orderAction = 'CONVERT_INPAT';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CONVERT_RX', which is the prototype for converting an inpatient order into a prescription.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willConvertToPrescriptionOrder(orderId: number) {\n this._orderAction = 'CONVERT_RX';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'MODIFY', which is the prototype for modifying an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willModify(orderId: number) {\n this._orderAction = 'MODIFY';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPage Order with order action 'ORDER'.\n *\n * @since 0.1.0\n * @category MPage Events - Orders\n * @param {number} synonymId The Cerner synonym_id to be associated with the new order. Must be set.\n * @param {NewOrderOpts} options required when making a new order\n * @returns {this} Returns itself to continue chaining method calls.\n * default to a normal order type.\n * @throws Error if `isRxOrder` and `isSatelliteOrder` are both set to true. These two are mutually exclusive and setting\n * both creates underfined behavior with respect the order origination field.\n * @example\n * m.willMakeNewOrder(34, true, 13, 42, true).toString() => \"{'ORDER'|34|5|1342|1}\"\n */\n\n willMakeNewOrder(synonymId: number, opts?: NewOrderOpts) {\n const {\n isRxOrder,\n isSatelliteOrder,\n orderSentenceId,\n nomenclatureId,\n skipInteractionCheckUntilSign,\n } = opts || {};\n\n if (isRxOrder && isSatelliteOrder)\n throw new Error('must select either isRxOrder or isSatelliteOrder');\n this._orderAction = 'ORDER';\n this._synonymId = synonymId;\n this._orderSentenceId = orderSentenceId || 0;\n this._nomenclatureId = nomenclatureId || 0;\n this._signTimeInteraction = skipInteractionCheckUntilSign ? 1 : 0;\n this._orderOrigination = isSatelliteOrder ? 5 : isRxOrder ? 1 : 0;\n\n return this;\n }\n\n /**\n * Creates a new MPageOrder with the order action 'RENEW', which is the prototype for reviewing an existing non-prescription order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willRenewNonPrescription(orderId: number) {\n this._orderAction = 'RENEW';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'RENEW_RX', which is the prototype for renewing an existing prescription order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willRenewPrescription(orderId: number) {\n this._orderAction = 'RENEW_RX';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'REPEAT', which is the prototype for copying an order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willCopyExistingOrder(orderId: number) {\n this._orderAction = 'REPEAT';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'RESUME', which is the prototype for resuming a suspended order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willResumeSuspendedOrder(orderId: number) {\n this._orderAction = 'RESUME';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'SUSPEND', which is the prototype for suspending an existing order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willSuspend(orderId: number) {\n this._orderAction = 'SUSPEND';\n this._orderId = orderId;\n return this;\n }\n\n /**\n * Overrides the toString() method for representing the objects internal state as a string.\n *\n * @since 0.1.0\n * @returns {string} string representation of MPageOrder's internal state\n */\n toString(): string {\n return this._orderAction === 'ORDER'\n ? `{${this._orderAction}|${this._synonymId}|${this._orderOrigination}|${this._orderSentenceId}|${this._nomenclatureId}|${this._signTimeInteraction}}`\n : `{${this._orderAction}|${this._orderId}}`;\n }\n}\n"],"names":["MPageOrderEvent","_orders","tab","tabDisplayFlag","_tabList","_personId","_encounterId","_powerPlanFlag","_defaultDisplay","_silentSignFlag","customizeOrderListProfile","launchOrderProfile","forPerson","id","forEncounter","addOrders","orders","Array","isArray","concat","enablePowerPlans","customizeMedicationListProfile","enablePowerOrders","launchOrderSearch","launchOrdersForSignature","signSilently","send","w","MPAGES_EVENT","toString","e","ReferenceError","console","warn","head","body","forEach","order","tail","MPageOrder","_orderAction","_orderId","_synonymId","_orderOrigination","_orderSentenceId","_nomenclatureId","_signTimeInteraction","willActivate","orderId","willCancelDiscontinue","willCancelReorder","willClear","willConvertInpatient","willConvertToPrescriptionOrder","willModify","willMakeNewOrder","synonymId","opts","isRxOrder","isSatelliteOrder","orderSentenceId","nomenclatureId","skipInteractionCheckUntilSign","Error","willRenewNonPrescription","willRenewPrescription","willCopyExistingOrder","willResumeSuspendedOrder","willSuspend"],"mappings":"IAEMA;AAyBJ;;;AAvBA,kBAAA,GAAY;AAAA,aAAM,KAAI,CAACC,OAAX;AAAA,KAAZ;;AAEQ,iBAAA,GAAoD;AAC1DC,MAAAA,GAAG,EAAE,CADqD;AAE1DC,MAAAA,cAAc,EAAE;AAF0C,KAApD;;AAIR,mBAAA,GAAa;AAAA,aAAM,KAAI,CAACC,QAAX;AAAA,KAAb;;AAEQ,kBAAA,GAAoB,CAApB;;AACR,oBAAA,GAAc;AAAA,aAAM,KAAI,CAACC,SAAX;AAAA,KAAd;;AAEQ,qBAAA,GAAuB,CAAvB;;AACR,uBAAA,GAAiB;AAAA,aAAM,KAAI,CAACC,YAAX;AAAA,KAAjB;;AAEQ,uBAAA,GAAyB,CAAzB;;AACR,yBAAA,GAAmB;AAAA,aAAM,KAAI,CAACC,cAAX;AAAA,KAAnB;;AAEQ,wBAAA,GAA0B,CAA1B;;AACR,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hB;AACA,WAAO,IAAP;AACD;AACD;;;;;;;AAvKF;;AAAA,SA8KEkB,qBA9KF,GA8KE,+BAAsBlB,OAAtB;AACE,SAAKR,YAAL,GAAoB,QAApB;AACA,SAAKC,QAAL,GAAgBO,OAAhB;AACA,WAAO,IAAP;AACD;AACD;;;;;;;AAnLF;;AAAA,SA0LEmB,wBA1LF,GA0LE,kCAAyBnB,OAAzB;AACE,SAAKR,YAAL,GAAoB,QAApB;AACA,SAAKC,QAAL,GAAgBO,OAAhB;AACA,WAAO,IAAP;AACD;AACD;;;;;;;AA/LF;;AAAA,SAsMEoB,WAtMF,GAsME,qBAAYpB,OAAZ;AACE,SAAKR,YAAL,GAAoB,SAApB;AACA,SAAKC,QAAL,GAAgBO,OAAhB;AACA,WAAO,IAAP;AACD;AAED;;;;;;AA5MF;;AAAA,SAkNEnB,QAlNF,GAkNE;AACE,WAAO,KAAKW,YAAL,KAAsB,OAAtB,SACC,KAAKA,YADN,SACsB,KAAKE,UAD3B,SACyC,KAAKC,iBAD9C,SACmE,KAAKC,gBADxE,SAC4F,KAAKC,eADjG,SACoH,KAAKC,oBADzH,eAEC,KAAKN,YAFN,SAEsB,KAAKC,QAF3B,MAAP;AAGD,GAtNH;;AAAA;AAAA;;;;"}
@@ -0,0 +1,3 @@
1
+ import { MPageOrderEvent } from './MPageOrderEvent';
2
+ import { MPageOrder, NewOrderOpts } from './MPageOrder';
3
+ export { MPageOrderEvent, MPageOrder, NewOrderOpts };
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./fluent-cerner-js.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./fluent-cerner-js.cjs.development.js')
8
+ }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "license": "MIT",
4
+ "main": "dist/index.js",
5
+ "typings": "dist/index.d.ts",
6
+ "files": [
7
+ "dist",
8
+ "src"
9
+ ],
10
+ "engines": {
11
+ "node": ">=10"
12
+ },
13
+ "scripts": {
14
+ "start": "tsdx watch",
15
+ "build": "tsdx build",
16
+ "test": "tsdx test",
17
+ "lint": "tsdx lint",
18
+ "prepare": "tsdx build",
19
+ "size": "size-limit",
20
+ "analyze": "size-limit --why"
21
+ },
22
+ "peerDependencies": {},
23
+ "husky": {
24
+ "hooks": {
25
+ "pre-commit": "tsdx lint"
26
+ }
27
+ },
28
+ "prettier": {
29
+ "printWidth": 80,
30
+ "semi": true,
31
+ "singleQuote": true,
32
+ "trailingComma": "es5"
33
+ },
34
+ "name": "fluent-cerner-js",
35
+ "author": "geekmdtravis",
36
+ "module": "dist/fluent-cerner-js.esm.js",
37
+ "size-limit": [
38
+ {
39
+ "path": "dist/fluent-cerner-js.cjs.production.min.js",
40
+ "limit": "10 KB"
41
+ },
42
+ {
43
+ "path": "dist/fluent-cerner-js.esm.js",
44
+ "limit": "10 KB"
45
+ }
46
+ ],
47
+ "devDependencies": {
48
+ "@size-limit/preset-small-lib": "^7.0.5",
49
+ "husky": "^7.0.4",
50
+ "size-limit": "^7.0.5",
51
+ "tsdx": "^0.14.1",
52
+ "tslib": "^2.3.1",
53
+ "typescript": "^4.5.4"
54
+ }
55
+ }