fluent-cerner-js 0.3.2-alpha.0 → 0.3.4-alpha.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.
- package/README.md +58 -36
- package/dist/fluent-cerner-js.cjs.development.js +283 -118
- package/dist/fluent-cerner-js.cjs.development.js.map +1 -1
- package/dist/fluent-cerner-js.cjs.production.min.js +1 -1
- package/dist/fluent-cerner-js.cjs.production.min.js.map +1 -1
- package/dist/fluent-cerner-js.esm.js +279 -119
- package/dist/fluent-cerner-js.esm.js.map +1 -1
- package/dist/functional/index.d.ts +19 -0
- package/dist/functional/launchClinicalNote.d.ts +34 -0
- package/dist/functional/launchPowerForm.d.ts +30 -0
- package/dist/functional/launchPowerNote.d.ts +20 -0
- package/dist/{utils → functional}/makeCclRequest.d.ts +0 -0
- package/dist/{utils → functional}/openOrganizerTab.d.ts +0 -0
- package/dist/{utils → functional}/openPatientTab.d.ts +1 -1
- package/dist/functional/orderString.d.ts +49 -0
- package/dist/functional/submitOrders.d.ts +30 -0
- package/dist/index.d.ts +3 -3
- package/dist/utils/index.d.ts +3 -4
- package/dist/utils/outsideOfPowerChartError.d.ts +7 -0
- package/dist/utils/warnOutsideOfPowerChart.d.ts +1 -0
- package/package.json +2 -2
- package/src/MPageOrder.spec.ts +199 -0
- package/src/MPageOrder.ts +0 -1
- package/src/MPageOrderEvent.spec.ts +110 -0
- package/src/MPageOrderEvent.ts +3 -4
- package/src/functional/index.ts +56 -0
- package/src/functional/launchClinicalNote.spec.ts +51 -0
- package/src/functional/launchClinicalNote.ts +94 -0
- package/src/functional/launchPowerForm.spec.ts +69 -0
- package/src/functional/launchPowerForm.ts +73 -0
- package/src/functional/launchPowerNote.spec.ts +51 -0
- package/src/functional/launchPowerNote.ts +50 -0
- package/src/functional/makeCclRequest.spec.ts +64 -0
- package/src/{utils → functional}/makeCclRequest.ts +4 -4
- package/src/functional/openOrganizerTab.spec.ts +7 -0
- package/src/{utils → functional}/openOrganizerTab.ts +4 -2
- package/src/functional/openPatientTab.spec.ts +7 -0
- package/src/{utils → functional}/openPatientTab.ts +6 -6
- package/src/functional/orderString.spec.ts +139 -0
- package/src/functional/orderString.ts +127 -0
- package/src/functional/submitOrders.spec.ts +139 -0
- package/src/functional/submitOrders.ts +77 -0
- package/src/index.ts +44 -15
- package/src/utils/index.ts +6 -4
- package/src/utils/outsideOfPowerChartError.ts +15 -0
- package/src/utils/warnOutsideOfPowerChart.ts +5 -0
package/README.md
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
A fluent `MPAGE_EVENT` string generation library.
|
|
4
4
|
|
|
5
|
-
| Environment | CI | Publish
|
|
6
|
-
| ----------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
5
|
+
| Environment | CI | Publish |
|
|
6
|
+
| ----------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
|
|
7
7
|
| Production |  |  |
|
|
8
|
-
| Development |  | Not Applicable
|
|
8
|
+
| Development |  | Not Applicable |
|
|
9
9
|
|
|
10
10
|
## Resources
|
|
11
11
|
|
|
12
12
|
- [MPage Developer Guide - MPAGE_EVENT Orders](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT-ORDERS)
|
|
13
13
|
|
|
14
|
-
### Anatomy of an `MPAGE_EVENT` String
|
|
14
|
+
### Anatomy of an `MPAGE_EVENT` String for the `ORDER` type.
|
|
15
15
|
|
|
16
16
|
An `MPAGE_EVENT` string takes the form:
|
|
17
17
|
|
|
@@ -104,17 +104,42 @@ As:
|
|
|
104
104
|
## API In Action: Create and Send Orders to MOEW
|
|
105
105
|
|
|
106
106
|
```js
|
|
107
|
-
|
|
107
|
+
/************************************************
|
|
108
|
+
* Create and submit new orders to PowerChart
|
|
109
|
+
************************************************/
|
|
110
|
+
|
|
111
|
+
// Functional ulities
|
|
112
|
+
// ------------------
|
|
113
|
+
|
|
114
|
+
const orderStr1 = orderString('copy existing', { orderId: 12345 });
|
|
115
|
+
|
|
116
|
+
const orderStr2 = orderString('new order', {
|
|
117
|
+
newOrderOpts: {
|
|
118
|
+
synonymId: 1343,
|
|
119
|
+
origination: 'prescription',
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const orderStr3 = orderString('new order', {
|
|
124
|
+
newOrderOpts: {
|
|
125
|
+
synonymId: 3428,
|
|
126
|
+
orderSentenceId: 3,
|
|
127
|
+
nomenclatureId: 14,
|
|
128
|
+
interactionCheck: 'on sign',
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
submitOrders(123, 456, [orderStr1, orderStr2, orderStr3]);
|
|
133
|
+
|
|
134
|
+
// Class utilities
|
|
135
|
+
// ---------------
|
|
136
|
+
|
|
108
137
|
const order1 = new MPageOrder();
|
|
109
138
|
order1.willCopyExistingOrder(12345);
|
|
110
139
|
|
|
111
|
-
// Make a new order from scratch, declare that it's a prescription order.
|
|
112
140
|
const order2 = new MPageOrder();
|
|
113
141
|
order2.willMakeNewOrder(1343, { isRxOrder: true });
|
|
114
142
|
|
|
115
|
-
// Make a new order from scratch, declare that it's a non-prescription order,
|
|
116
|
-
// reference an order sentence id and a nomenclature id in addition to requesting
|
|
117
|
-
// skip interaction checks until sign.
|
|
118
143
|
const opts = {
|
|
119
144
|
orderSentenceId: 3,
|
|
120
145
|
nomenclatureId: 14,
|
|
@@ -123,51 +148,43 @@ const opts = {
|
|
|
123
148
|
const order3 = new MPageOrder();
|
|
124
149
|
order3.willMakeNewOrder(3428, opts);
|
|
125
150
|
|
|
126
|
-
// Prepare the MPage event for person 1231251 on encounter 812388.
|
|
127
151
|
const event = new MPageOrderEvent();
|
|
128
152
|
event
|
|
129
|
-
.forPerson(
|
|
130
|
-
.forEncounter(
|
|
153
|
+
.forPerson(123)
|
|
154
|
+
.forEncounter(456)
|
|
131
155
|
.addOrders([order1, order2, order3])
|
|
132
156
|
.enablePowerPlans()
|
|
133
157
|
.customizeOrderListProfile()
|
|
134
158
|
.enablePowerOrders()
|
|
135
|
-
.
|
|
159
|
+
.launchOrdersForSignature();
|
|
136
160
|
|
|
137
161
|
// Send the MPage event to the server.
|
|
138
162
|
event.send();
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
You can also invoke the `toString()` override method to confirm your order string is correct.
|
|
142
|
-
|
|
143
|
-
```js
|
|
144
|
-
console.log(`MPage Event String:\n${mpageEvent}\n`);
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Result:
|
|
148
163
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
```js
|
|
156
|
-
const cclOpts = {
|
|
164
|
+
/********************************************************
|
|
165
|
+
* Make a CCL request to the server and retrieve the data
|
|
166
|
+
********************************************************/
|
|
167
|
+
let result = undefined;
|
|
168
|
+
makeCclRequest({
|
|
157
169
|
prg: 'MP_GET_ORDER_LIST',
|
|
158
170
|
params: [
|
|
159
171
|
{ type: 'number', param: 12345 },
|
|
160
172
|
{ type: 'string', param: 'joe' },
|
|
161
173
|
],
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
let result = undefined;
|
|
165
|
-
|
|
166
|
-
makeCclRequest(cclOpts)
|
|
174
|
+
})
|
|
167
175
|
.then(data => (result = data))
|
|
168
|
-
.catch(console.error)
|
|
176
|
+
.catch(console.error)
|
|
177
|
+
.finally(() => console.log(result));
|
|
169
178
|
```
|
|
170
179
|
|
|
180
|
+
## Other Functions Not Demonstrated Above
|
|
181
|
+
|
|
182
|
+
1. `launchClinicalNote`
|
|
183
|
+
2. `launchPowerForm`
|
|
184
|
+
3. `launchPowerNote`
|
|
185
|
+
4. `openPatientTab`
|
|
186
|
+
5. `openOrganizerTab`
|
|
187
|
+
|
|
171
188
|
## TypeScript Support
|
|
172
189
|
|
|
173
190
|
This library was developedin typescript and all relevant types are exported.
|
|
@@ -202,3 +219,8 @@ const MyComponent = ({ user }) => {
|
|
|
202
219
|
);
|
|
203
220
|
};
|
|
204
221
|
```
|
|
222
|
+
|
|
223
|
+
## Contributors
|
|
224
|
+
|
|
225
|
+
- [Travis Nesbit, MD (geekmdtravis)](https://github.com/geekmdtravis/) - Primary Author
|
|
226
|
+
- [Daniel "Danny" Lara, MD(dl2github)](https://github.com/dl2github)
|