@openmrs/esm-fast-data-entry-app 1.0.0-pre.53 → 1.0.0-pre.59
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/dist/187.js +1 -0
- package/dist/247.js +1 -1
- package/dist/312.js +1 -0
- package/dist/412.js +1 -0
- package/dist/574.js +1 -1
- package/dist/592.js +1 -0
- package/dist/804.js +1 -1
- package/dist/880.js +2 -0
- package/dist/{120.js.LICENSE.txt → 880.js.LICENSE.txt} +0 -0
- package/dist/990.js +1 -1
- package/dist/openmrs-esm-fast-data-entry-app.js +1 -1
- package/dist/openmrs-esm-fast-data-entry-app.js.buildmanifest.json +107 -61
- package/dist/openmrs-esm-fast-data-entry-app.old +1 -1
- package/package.json +1 -1
- package/src/context/FormWorkflowContext.tsx +65 -19
- package/src/context/FormWorkflowReducer.ts +241 -43
- package/src/form-entry-workflow/FormEntryWorkflow.tsx +114 -40
- package/src/form-entry-workflow/styles.scss +0 -3
- package/src/forms-page/FormsPage.tsx +21 -2
- package/src/forms-table/FormsTable.tsx +8 -2
- package/src/patient-card/PatientCard.tsx +19 -8
- package/src/patient-card/styles.scss +13 -0
- package/src/patient-search-header/PatientSearchHeader.tsx +15 -3
- package/translations/en.json +8 -2
- package/dist/120.js +0 -2
- package/dist/61.js +0 -1
- package/dist/84.js +0 -1
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
"initial": false,
|
|
6
6
|
"entry": false,
|
|
7
7
|
"recorded": false,
|
|
8
|
-
"size":
|
|
8
|
+
"size": 4640,
|
|
9
9
|
"sizes": {
|
|
10
|
-
"
|
|
10
|
+
"consume-shared": 42,
|
|
11
|
+
"javascript": 4598
|
|
11
12
|
},
|
|
12
13
|
"names": [],
|
|
13
14
|
"idHints": [],
|
|
@@ -15,10 +16,10 @@
|
|
|
15
16
|
"@openmrs/esm-fast-data-entry-app"
|
|
16
17
|
],
|
|
17
18
|
"files": [
|
|
18
|
-
"
|
|
19
|
+
"132.js"
|
|
19
20
|
],
|
|
20
21
|
"auxiliaryFiles": [],
|
|
21
|
-
"hash": "
|
|
22
|
+
"hash": "20cd55cddce10201fde8",
|
|
22
23
|
"childrenByOrder": {}
|
|
23
24
|
},
|
|
24
25
|
{
|
|
@@ -27,9 +28,9 @@
|
|
|
27
28
|
"entry": false,
|
|
28
29
|
"recorded": false,
|
|
29
30
|
"reason": "split chunk (cache group: defaultVendors)",
|
|
30
|
-
"size":
|
|
31
|
+
"size": 1101806,
|
|
31
32
|
"sizes": {
|
|
32
|
-
"javascript":
|
|
33
|
+
"javascript": 1101806
|
|
33
34
|
},
|
|
34
35
|
"names": [],
|
|
35
36
|
"idHints": [
|
|
@@ -39,34 +40,30 @@
|
|
|
39
40
|
"@openmrs/esm-fast-data-entry-app"
|
|
40
41
|
],
|
|
41
42
|
"files": [
|
|
42
|
-
"
|
|
43
|
+
"187.js"
|
|
43
44
|
],
|
|
44
45
|
"auxiliaryFiles": [],
|
|
45
|
-
"hash": "
|
|
46
|
+
"hash": "286c15965e45ce27fdce",
|
|
46
47
|
"childrenByOrder": {}
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
|
-
"rendered":
|
|
50
|
+
"rendered": false,
|
|
50
51
|
"initial": false,
|
|
51
52
|
"entry": false,
|
|
52
53
|
"recorded": false,
|
|
53
|
-
"reason": "split chunk (cache group:
|
|
54
|
-
"size":
|
|
54
|
+
"reason": "reused as split chunk (cache group: default)",
|
|
55
|
+
"size": 42,
|
|
55
56
|
"sizes": {
|
|
56
|
-
"
|
|
57
|
+
"consume-shared": 42
|
|
57
58
|
},
|
|
58
59
|
"names": [],
|
|
59
|
-
"idHints": [
|
|
60
|
-
"vendors"
|
|
61
|
-
],
|
|
60
|
+
"idHints": [],
|
|
62
61
|
"runtime": [
|
|
63
62
|
"@openmrs/esm-fast-data-entry-app"
|
|
64
63
|
],
|
|
65
|
-
"files": [
|
|
66
|
-
"120.js"
|
|
67
|
-
],
|
|
64
|
+
"files": [],
|
|
68
65
|
"auxiliaryFiles": [],
|
|
69
|
-
"hash": "
|
|
66
|
+
"hash": "dab26d723f608869beb5",
|
|
70
67
|
"childrenByOrder": {}
|
|
71
68
|
},
|
|
72
69
|
{
|
|
@@ -74,41 +71,44 @@
|
|
|
74
71
|
"initial": false,
|
|
75
72
|
"entry": false,
|
|
76
73
|
"recorded": false,
|
|
77
|
-
"
|
|
74
|
+
"reason": "reused as split chunk (cache group: defaultVendors)",
|
|
75
|
+
"size": 39262,
|
|
78
76
|
"sizes": {
|
|
79
|
-
"
|
|
80
|
-
"javascript": 4598
|
|
77
|
+
"javascript": 39262
|
|
81
78
|
},
|
|
82
79
|
"names": [],
|
|
83
|
-
"idHints": [
|
|
80
|
+
"idHints": [
|
|
81
|
+
"vendors"
|
|
82
|
+
],
|
|
84
83
|
"runtime": [
|
|
85
84
|
"@openmrs/esm-fast-data-entry-app"
|
|
86
85
|
],
|
|
87
86
|
"files": [
|
|
88
|
-
"
|
|
87
|
+
"247.js"
|
|
89
88
|
],
|
|
90
89
|
"auxiliaryFiles": [],
|
|
91
|
-
"hash": "
|
|
90
|
+
"hash": "47ad535cde70982ebe8e",
|
|
92
91
|
"childrenByOrder": {}
|
|
93
92
|
},
|
|
94
93
|
{
|
|
95
|
-
"rendered":
|
|
94
|
+
"rendered": true,
|
|
96
95
|
"initial": false,
|
|
97
96
|
"entry": false,
|
|
98
97
|
"recorded": false,
|
|
99
|
-
"
|
|
100
|
-
"size": 42,
|
|
98
|
+
"size": 8973,
|
|
101
99
|
"sizes": {
|
|
102
|
-
"
|
|
100
|
+
"javascript": 8973
|
|
103
101
|
},
|
|
104
102
|
"names": [],
|
|
105
103
|
"idHints": [],
|
|
106
104
|
"runtime": [
|
|
107
105
|
"@openmrs/esm-fast-data-entry-app"
|
|
108
106
|
],
|
|
109
|
-
"files": [
|
|
107
|
+
"files": [
|
|
108
|
+
"294.js"
|
|
109
|
+
],
|
|
110
110
|
"auxiliaryFiles": [],
|
|
111
|
-
"hash": "
|
|
111
|
+
"hash": "ced286e1e2386fbec77d",
|
|
112
112
|
"childrenByOrder": {}
|
|
113
113
|
},
|
|
114
114
|
{
|
|
@@ -116,64 +116,64 @@
|
|
|
116
116
|
"initial": false,
|
|
117
117
|
"entry": false,
|
|
118
118
|
"recorded": false,
|
|
119
|
-
"
|
|
120
|
-
"size": 39074,
|
|
119
|
+
"size": 57724,
|
|
121
120
|
"sizes": {
|
|
122
|
-
"javascript":
|
|
121
|
+
"javascript": 57724
|
|
123
122
|
},
|
|
124
123
|
"names": [],
|
|
125
|
-
"idHints": [
|
|
126
|
-
"vendors"
|
|
127
|
-
],
|
|
124
|
+
"idHints": [],
|
|
128
125
|
"runtime": [
|
|
129
126
|
"@openmrs/esm-fast-data-entry-app"
|
|
130
127
|
],
|
|
131
128
|
"files": [
|
|
132
|
-
"
|
|
129
|
+
"312.js"
|
|
133
130
|
],
|
|
134
131
|
"auxiliaryFiles": [],
|
|
135
|
-
"hash": "
|
|
132
|
+
"hash": "ec3d9a67e6c281e6bcd4",
|
|
136
133
|
"childrenByOrder": {}
|
|
137
134
|
},
|
|
138
135
|
{
|
|
139
|
-
"rendered":
|
|
136
|
+
"rendered": false,
|
|
140
137
|
"initial": false,
|
|
141
138
|
"entry": false,
|
|
142
139
|
"recorded": false,
|
|
143
|
-
"
|
|
140
|
+
"reason": "split chunk (cache group: default)",
|
|
141
|
+
"size": 42,
|
|
144
142
|
"sizes": {
|
|
145
|
-
"
|
|
143
|
+
"consume-shared": 42
|
|
146
144
|
},
|
|
147
145
|
"names": [],
|
|
148
146
|
"idHints": [],
|
|
149
147
|
"runtime": [
|
|
150
148
|
"@openmrs/esm-fast-data-entry-app"
|
|
151
149
|
],
|
|
152
|
-
"files": [
|
|
153
|
-
"294.js"
|
|
154
|
-
],
|
|
150
|
+
"files": [],
|
|
155
151
|
"auxiliaryFiles": [],
|
|
156
|
-
"hash": "
|
|
152
|
+
"hash": "6603850deb0c49f5efc3",
|
|
157
153
|
"childrenByOrder": {}
|
|
158
154
|
},
|
|
159
155
|
{
|
|
160
|
-
"rendered":
|
|
156
|
+
"rendered": true,
|
|
161
157
|
"initial": false,
|
|
162
158
|
"entry": false,
|
|
163
159
|
"recorded": false,
|
|
164
|
-
"reason": "split chunk (cache group:
|
|
165
|
-
"size":
|
|
160
|
+
"reason": "split chunk (cache group: defaultVendors)",
|
|
161
|
+
"size": 290330,
|
|
166
162
|
"sizes": {
|
|
167
|
-
"
|
|
163
|
+
"javascript": 290330
|
|
168
164
|
},
|
|
169
165
|
"names": [],
|
|
170
|
-
"idHints": [
|
|
166
|
+
"idHints": [
|
|
167
|
+
"vendors"
|
|
168
|
+
],
|
|
171
169
|
"runtime": [
|
|
172
170
|
"@openmrs/esm-fast-data-entry-app"
|
|
173
171
|
],
|
|
174
|
-
"files": [
|
|
172
|
+
"files": [
|
|
173
|
+
"412.js"
|
|
174
|
+
],
|
|
175
175
|
"auxiliaryFiles": [],
|
|
176
|
-
"hash": "
|
|
176
|
+
"hash": "c725e1e32b2c65b8a8c1",
|
|
177
177
|
"childrenByOrder": {}
|
|
178
178
|
},
|
|
179
179
|
{
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
"openmrs-esm-fast-data-entry-app.js"
|
|
199
199
|
],
|
|
200
200
|
"auxiliaryFiles": [],
|
|
201
|
-
"hash": "
|
|
201
|
+
"hash": "be879c36cfbeb248b65b",
|
|
202
202
|
"childrenByOrder": {}
|
|
203
203
|
},
|
|
204
204
|
{
|
|
@@ -230,9 +230,9 @@
|
|
|
230
230
|
"initial": false,
|
|
231
231
|
"entry": false,
|
|
232
232
|
"recorded": false,
|
|
233
|
-
"size":
|
|
233
|
+
"size": 846,
|
|
234
234
|
"sizes": {
|
|
235
|
-
"javascript":
|
|
235
|
+
"javascript": 846
|
|
236
236
|
},
|
|
237
237
|
"names": [],
|
|
238
238
|
"idHints": [],
|
|
@@ -243,7 +243,29 @@
|
|
|
243
243
|
"574.js"
|
|
244
244
|
],
|
|
245
245
|
"auxiliaryFiles": [],
|
|
246
|
-
"hash": "
|
|
246
|
+
"hash": "18b2e4fdfe93a2925da9",
|
|
247
|
+
"childrenByOrder": {}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"rendered": true,
|
|
251
|
+
"initial": false,
|
|
252
|
+
"entry": false,
|
|
253
|
+
"recorded": false,
|
|
254
|
+
"reason": "split chunk (cache group: default)",
|
|
255
|
+
"size": 37019,
|
|
256
|
+
"sizes": {
|
|
257
|
+
"javascript": 37019
|
|
258
|
+
},
|
|
259
|
+
"names": [],
|
|
260
|
+
"idHints": [],
|
|
261
|
+
"runtime": [
|
|
262
|
+
"@openmrs/esm-fast-data-entry-app"
|
|
263
|
+
],
|
|
264
|
+
"files": [
|
|
265
|
+
"592.js"
|
|
266
|
+
],
|
|
267
|
+
"auxiliaryFiles": [],
|
|
268
|
+
"hash": "62bcb0effaa800159a01",
|
|
247
269
|
"childrenByOrder": {}
|
|
248
270
|
},
|
|
249
271
|
{
|
|
@@ -310,7 +332,31 @@
|
|
|
310
332
|
"804.js"
|
|
311
333
|
],
|
|
312
334
|
"auxiliaryFiles": [],
|
|
313
|
-
"hash": "
|
|
335
|
+
"hash": "399f1cf1f41bda6fc66d",
|
|
336
|
+
"childrenByOrder": {}
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"rendered": true,
|
|
340
|
+
"initial": false,
|
|
341
|
+
"entry": false,
|
|
342
|
+
"recorded": false,
|
|
343
|
+
"reason": "split chunk (cache group: defaultVendors)",
|
|
344
|
+
"size": 656311,
|
|
345
|
+
"sizes": {
|
|
346
|
+
"javascript": 656311
|
|
347
|
+
},
|
|
348
|
+
"names": [],
|
|
349
|
+
"idHints": [
|
|
350
|
+
"vendors"
|
|
351
|
+
],
|
|
352
|
+
"runtime": [
|
|
353
|
+
"@openmrs/esm-fast-data-entry-app"
|
|
354
|
+
],
|
|
355
|
+
"files": [
|
|
356
|
+
"880.js"
|
|
357
|
+
],
|
|
358
|
+
"auxiliaryFiles": [],
|
|
359
|
+
"hash": "f873bdee413318ec1522",
|
|
314
360
|
"childrenByOrder": {}
|
|
315
361
|
},
|
|
316
362
|
{
|
|
@@ -366,9 +412,9 @@
|
|
|
366
412
|
"initial": false,
|
|
367
413
|
"entry": false,
|
|
368
414
|
"recorded": false,
|
|
369
|
-
"size":
|
|
415
|
+
"size": 33956,
|
|
370
416
|
"sizes": {
|
|
371
|
-
"javascript":
|
|
417
|
+
"javascript": 33914,
|
|
372
418
|
"consume-shared": 42
|
|
373
419
|
},
|
|
374
420
|
"names": [],
|
|
@@ -380,7 +426,7 @@
|
|
|
380
426
|
"990.js"
|
|
381
427
|
],
|
|
382
428
|
"auxiliaryFiles": [],
|
|
383
|
-
"hash": "
|
|
429
|
+
"hash": "9a1c9d39c70cf2ecf9e6",
|
|
384
430
|
"childrenByOrder": {}
|
|
385
431
|
}
|
|
386
432
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register("@openmrs/esm-fast-data-entry-app",[],(function(e,r){return{execute:function(){e((()=>{var e,t,n,o,a,i,s,u,l,f,d,p,c,h,m={1858:(e,r,t)=>{(0,t(2722).s)(1)},2722:(e,r,t)=>{const n=t(3905).R;r.s=function(e){if(e||(e=1),!t.y.meta||!t.y.meta.url)throw console.error("__system_context__",t.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");t.p=n(t.y.meta.url,e)}},5356:(e,r,t)=>{t(1858)},3905:(e,r,t)=>{r.R=function(e,r){var t=document.createElement("a");t.href=e;for(var n="/"===t.pathname[0]?t.pathname:"/"+t.pathname,o=0,a=n.length;o!==r&&a>=0;)"/"===n[--a]&&o++;if(o!==r)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+r+") is greater than the number of directories ("+o+") in the URL path "+e);var i=n.slice(0,a+1);return t.protocol+"//"+t.host+i};Number.isInteger},6751:(e,r,t)=>{"use strict";var n={app:()=>t.e(132).then((()=>()=>t(8132)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},v={};function y(e){var r=v[e];if(void 0!==r)return r.exports;var t=v[e]={id:e,loaded:!1,exports:{}};return m[e].call(t.exports,t,t.exports,y),t.loaded=!0,t.exports}return y.m=m,y.c=v,y.y=r,y.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return y.d(r,{a:r}),r},y.d=(e,r)=>{for(var t in r)y.o(r,t)&&!y.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},y.f={},y.e=e=>Promise.all(Object.keys(y.f).reduce(((r,t)=>(y.f[t](e,r),r)),[])),y.u=e=>e+".js",y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},t="@openmrs/esm-fast-data-entry-app:",y.l=(r,n,o,a)=>{if(e[r])e[r].push(n);else{var i,s;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var f=u[l];if(f.getAttribute("src")==r||f.getAttribute("data-webpack")==t+o){i=f;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,y.nc&&i.setAttribute("nonce",y.nc),i.setAttribute("data-webpack",t+o),i.src=r),e[r]=[n];var d=(t,n)=>{i.onerror=i.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),s&&document.head.appendChild(i)}},y.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{y.S={};var e={},r={};y.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];y.o(y.S,t)||(y.S[t]={});var a=y.S[t],i="@openmrs/esm-fast-data-entry-app",s=(e,r,t,n)=>{var o=a[e]=a[e]||{},s=o[r];(!s||!s.loaded&&(!n!=!s.eager?n:i>s.from))&&(o[r]={get:t,from:i,eager:!!n})},u=[];return"default"===t&&(s("@openmrs/esm-framework","3.4.1-pre.
|
|
1
|
+
System.register("@openmrs/esm-fast-data-entry-app",[],(function(e,r){return{execute:function(){e((()=>{var e,t,n,o,a,i,s,u,l,f,d,p,c,h,m={1858:(e,r,t)=>{(0,t(2722).s)(1)},2722:(e,r,t)=>{const n=t(3905).R;r.s=function(e){if(e||(e=1),!t.y.meta||!t.y.meta.url)throw console.error("__system_context__",t.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");t.p=n(t.y.meta.url,e)}},5356:(e,r,t)=>{t(1858)},3905:(e,r,t)=>{r.R=function(e,r){var t=document.createElement("a");t.href=e;for(var n="/"===t.pathname[0]?t.pathname:"/"+t.pathname,o=0,a=n.length;o!==r&&a>=0;)"/"===n[--a]&&o++;if(o!==r)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+r+") is greater than the number of directories ("+o+") in the URL path "+e);var i=n.slice(0,a+1);return t.protocol+"//"+t.host+i};Number.isInteger},6751:(e,r,t)=>{"use strict";var n={app:()=>t.e(132).then((()=>()=>t(8132)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},v={};function y(e){var r=v[e];if(void 0!==r)return r.exports;var t=v[e]={id:e,loaded:!1,exports:{}};return m[e].call(t.exports,t,t.exports,y),t.loaded=!0,t.exports}return y.m=m,y.c=v,y.y=r,y.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return y.d(r,{a:r}),r},y.d=(e,r)=>{for(var t in r)y.o(r,t)&&!y.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},y.f={},y.e=e=>Promise.all(Object.keys(y.f).reduce(((r,t)=>(y.f[t](e,r),r)),[])),y.u=e=>e+".js",y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},t="@openmrs/esm-fast-data-entry-app:",y.l=(r,n,o,a)=>{if(e[r])e[r].push(n);else{var i,s;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var f=u[l];if(f.getAttribute("src")==r||f.getAttribute("data-webpack")==t+o){i=f;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,y.nc&&i.setAttribute("nonce",y.nc),i.setAttribute("data-webpack",t+o),i.src=r),e[r]=[n];var d=(t,n)=>{i.onerror=i.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),s&&document.head.appendChild(i)}},y.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{y.S={};var e={},r={};y.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];y.o(y.S,t)||(y.S[t]={});var a=y.S[t],i="@openmrs/esm-fast-data-entry-app",s=(e,r,t,n)=>{var o=a[e]=a[e]||{},s=o[r];(!s||!s.loaded&&(!n!=!s.eager?n:i>s.from))&&(o[r]={get:t,from:i,eager:!!n})},u=[];return"default"===t&&(s("@openmrs/esm-framework","3.4.1-pre.189",(()=>Promise.all([y.e(595),y.e(211)]).then((()=>()=>y(595))))),s("carbon-icons","7.0.7",(()=>y.e(906).then((()=>()=>y(906))))),s("react-dom","16.14.0",(()=>Promise.all([y.e(935),y.e(211)]).then((()=>()=>y(3935))))),s("react-i18next","11.18.3",(()=>Promise.all([y.e(247),y.e(211)]).then((()=>()=>y(8247))))),s("react-router-dom","5.3.3",(()=>Promise.all([y.e(536),y.e(211)]).then((()=>()=>y(536))))),s("react","16.14.0",(()=>y.e(294).then((()=>()=>y(7294)))))),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),y.p="",n=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},o=(e,r)=>{e=n(e),r=n(r);for(var t=0;;){if(t>=e.length)return t<r.length&&"u"!=(typeof r[t])[0];var o=e[t],a=(typeof o)[0];if(t>=r.length)return"u"==a;var i=r[t],s=(typeof i)[0];if(a!=s)return"o"==a&&"n"==s||"s"==s||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;t++}},a=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,o=1;o<e.length;o++)n--,t+="u"==(typeof(s=e[o]))[0]?"-":(n>0?".":"")+(n=2,s);return t}var i=[];for(o=1;o<e.length;o++){var s=e[o];i.push(0===s?"not("+u()+")":1===s?"("+u()+" || "+u()+")":2===s?i.pop()+" "+i.pop():a(s))}return u();function u(){return i.pop().replace(/^\((.+)\)$/,"$1")}},i=(e,r)=>{if(0 in e){r=n(r);var t=e[0],o=t<0;o&&(t=-t-1);for(var a=0,s=1,u=!0;;s++,a++){var l,f,d=s<e.length?(typeof e[s])[0]:"";if(a>=r.length||"o"==(f=(typeof(l=r[a]))[0]))return!u||("u"==d?s>t&&!o:""==d!=o);if("u"==f){if(!u||"u"!=d)return!1}else if(u)if(d==f)if(s<=t){if(l!=e[s])return!1}else{if(o?l>e[s]:l<e[s])return!1;l!=e[s]&&(u=!1)}else if("s"!=d&&"n"!=d){if(o||s<=t)return!1;u=!1,s--}else{if(s<=t||f<d!=o)return!1;u=!1}else"s"!=d&&"n"!=d&&(u=!1,s--)}}var p=[],c=p.pop.bind(p);for(a=1;a<e.length;a++){var h=e[a];p.push(1==h?c()|c():2==h?c()&c():h?i(h,r):!c())}return!!c()},s=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&o(e,r)?r:e),0)},u=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+a(n)+")",l=(e,r,t,n)=>{var o=s(e,t);return i(n,o)||"undefined"!=typeof console&&console.warn&&console.warn(u(e,t,o,n)),f(e[t][o])},f=e=>(e.loaded=1,e.get()),d=(e=>function(r,t,n,o){var a=y.I(r);return a&&a.then?a.then(e.bind(e,r,y.S[r],t,n,o)):e(0,y.S[r],t,n,o)})(((e,r,t,n,o)=>r&&y.o(r,t)?l(r,0,t,n):o())),p={},c={311:()=>d("default","@openmrs/esm-framework",[1,"next"],(()=>Promise.all([y.e(595),y.e(211)]).then((()=>()=>y(595))))),4211:()=>d("default","react",[1,16,14],(()=>y.e(294).then((()=>()=>y(7294))))),2221:()=>d("default","react-router-dom",[1,5,0,0],(()=>y.e(536).then((()=>()=>y(536))))),3397:()=>d("default","react-i18next",[1,11],(()=>y.e(247).then((()=>()=>y(8247))))),8408:()=>d("default","react-dom",[1,16,0],(()=>y.e(935).then((()=>()=>y(3935)))))},h={132:[311],211:[4211],397:[3397],804:[2221],990:[8408]},y.f.consumes=(e,r)=>{y.o(h,e)&&h[e].forEach((e=>{if(y.o(p,e))return r.push(p[e]);var t=r=>{p[e]=0,y.m[e]=t=>{delete y.c[e],t.exports=r()}},n=r=>{delete p[e],y.m[e]=t=>{throw delete y.c[e],r}};try{var o=c[e]();o.then?r.push(p[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={447:0};y.f.j=(r,t)=>{var n=y.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(211|397)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=y.p+y.u(r),i=new Error;y.l(a,(t=>{if(y.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,s]=t,u=0;if(a.some((r=>0!==e[r]))){for(n in i)y.o(i,n)&&(y.m[n]=i[n]);s&&s(y)}for(r&&r(t);u<a.length;u++)o=a[u],y.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),y.nc=void 0,y(5356),y(6751)})())}}}));
|
package/package.json
CHANGED
|
@@ -1,34 +1,60 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useReducer } from "react";
|
|
2
2
|
import reducer from "./FormWorkflowReducer";
|
|
3
|
-
import { useParams } from "react-router-dom";
|
|
3
|
+
import { useParams, useLocation } from "react-router-dom";
|
|
4
4
|
interface ParamTypes {
|
|
5
5
|
formUuid: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
formUuid: null,
|
|
10
|
-
patientUuids: [],
|
|
11
|
-
activePatientUuid: null,
|
|
12
|
-
activeEncounterUuid: null,
|
|
13
|
-
encounters: {},
|
|
14
|
-
workflowState: null,
|
|
8
|
+
const initialActions = {
|
|
15
9
|
addPatient: (uuid: string | number) => undefined,
|
|
16
10
|
openPatientSearch: () => undefined,
|
|
17
11
|
saveEncounter: (encounterUuid: string | number) => undefined,
|
|
18
12
|
editEncounter: (patientUuid: string | number) => undefined,
|
|
19
13
|
submitForNext: () => undefined,
|
|
20
14
|
submitForReview: () => undefined,
|
|
15
|
+
submitForComplete: () => undefined,
|
|
21
16
|
goToReview: () => undefined,
|
|
17
|
+
destroySession: () => undefined,
|
|
18
|
+
closeSession: () => undefined,
|
|
22
19
|
};
|
|
23
20
|
|
|
24
|
-
const
|
|
21
|
+
export const initialWorkflowState = {
|
|
22
|
+
// activeFormUuid and forms are the only two real values stored at state root level
|
|
23
|
+
activeFormUuid: null, // the corrently open form
|
|
24
|
+
forms: {}, // object containing all forms session data
|
|
25
|
+
// the following fields will be available in context but are not stored at the
|
|
26
|
+
// state root level, but refer to nested values for the current
|
|
27
|
+
// aciveFormUuid
|
|
28
|
+
workflowState: null, // pseudo field from state[activeFormUuid].workflowState
|
|
29
|
+
activePatientUuid: null, // pseudo field from state[activeFormUuid].activePatientUuid
|
|
30
|
+
activeEncounterUuid: null, // pseudo field from state[activeFormUuid].encounterUuid
|
|
31
|
+
patientUuids: [], // pseudo field from state[activeFormUuid].patientUuids
|
|
32
|
+
encounters: {}, // pseudo field from state[activeFormUuid].encounters
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const FormWorkflowContext = React.createContext({
|
|
36
|
+
...initialWorkflowState,
|
|
37
|
+
...initialActions,
|
|
38
|
+
});
|
|
25
39
|
|
|
26
40
|
const FormWorkflowProvider = ({ children }) => {
|
|
27
|
-
const { formUuid
|
|
28
|
-
const
|
|
41
|
+
const { formUuid } = useParams() as ParamTypes;
|
|
42
|
+
const activeFormUuid = formUuid.split("&")[0];
|
|
43
|
+
const { search } = useLocation();
|
|
44
|
+
const newPatientUuid = new URLSearchParams(search).get("patientUuid");
|
|
45
|
+
const [state, dispatch] = useReducer(reducer, {
|
|
46
|
+
...initialWorkflowState,
|
|
47
|
+
...initialActions,
|
|
48
|
+
});
|
|
29
49
|
|
|
30
50
|
const actions = useMemo(
|
|
31
51
|
() => ({
|
|
52
|
+
initializeWorkflowState: ({ activeFormUuid, newPatientUuid }) =>
|
|
53
|
+
dispatch({
|
|
54
|
+
type: "INITIALIZE_WORKFLOW_STATE",
|
|
55
|
+
activeFormUuid,
|
|
56
|
+
newPatientUuid,
|
|
57
|
+
}),
|
|
32
58
|
addPatient: (patientUuid) =>
|
|
33
59
|
dispatch({ type: "ADD_PATIENT", patientUuid }),
|
|
34
60
|
openPatientSearch: () => dispatch({ type: "OPEN_PATIENT_SEARCH" }),
|
|
@@ -39,26 +65,46 @@ const FormWorkflowProvider = ({ children }) => {
|
|
|
39
65
|
}),
|
|
40
66
|
submitForNext: () => dispatch({ type: "SUBMIT_FOR_NEXT" }),
|
|
41
67
|
submitForReview: () => dispatch({ type: "SUBMIT_FOR_REVIEW" }),
|
|
68
|
+
submitForComplete: () => dispatch({ type: "SUBMIT_FOR_COMPLETE" }),
|
|
42
69
|
editEncounter: (patientUuid) =>
|
|
43
70
|
dispatch({ type: "EDIT_ENCOUNTER", patientUuid }),
|
|
44
71
|
goToReview: () => dispatch({ type: "GO_TO_REVIEW" }),
|
|
72
|
+
destroySession: () => dispatch({ type: "DESTROY_SESSION" }),
|
|
73
|
+
closeSession: () => dispatch({ type: "CLOSE_SESSION" }),
|
|
45
74
|
}),
|
|
46
75
|
[]
|
|
47
76
|
);
|
|
48
77
|
|
|
49
78
|
// if formUuid isn't a part of state yet, grab it from the url params
|
|
79
|
+
// this is the entry into the workflow system
|
|
50
80
|
useEffect(() => {
|
|
51
|
-
if (
|
|
52
|
-
|
|
81
|
+
if (state?.workflowState === null && activeFormUuid) {
|
|
82
|
+
actions.initializeWorkflowState({ activeFormUuid, newPatientUuid });
|
|
53
83
|
}
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
actions.openPatientSearch();
|
|
58
|
-
}, [actions]);
|
|
84
|
+
}, [activeFormUuid, newPatientUuid, state?.workflowState, actions]);
|
|
59
85
|
|
|
60
86
|
return (
|
|
61
|
-
<FormWorkflowContext.Provider
|
|
87
|
+
<FormWorkflowContext.Provider
|
|
88
|
+
value={{
|
|
89
|
+
...state,
|
|
90
|
+
...actions,
|
|
91
|
+
workflowState:
|
|
92
|
+
state.forms?.[state.activeFormUuid]?.workflowState ??
|
|
93
|
+
initialWorkflowState.workflowState,
|
|
94
|
+
activePatientUuid:
|
|
95
|
+
state.forms?.[state.activeFormUuid]?.activePatientUuid ??
|
|
96
|
+
initialWorkflowState.activePatientUuid,
|
|
97
|
+
activeEncounterUuid:
|
|
98
|
+
state.forms?.[state.activeFormUuid]?.activeEncounterUuid ??
|
|
99
|
+
initialWorkflowState.activeEncounterUuid,
|
|
100
|
+
patientUuids:
|
|
101
|
+
state.forms?.[state.activeFormUuid]?.patientUuids ??
|
|
102
|
+
initialWorkflowState.patientUuids,
|
|
103
|
+
encounters:
|
|
104
|
+
state.forms?.[state.activeFormUuid]?.encounters ??
|
|
105
|
+
initialWorkflowState.encounters,
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
62
108
|
{children}
|
|
63
109
|
</FormWorkflowContext.Provider>
|
|
64
110
|
);
|