@openmrs/esm-patient-programs-app 3.2.1-pre.119 → 3.2.1-pre.124
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/.turbo/turbo-build.log +35 -36
- package/dist/145.js +1 -1
- package/dist/186.js +1 -1
- package/dist/252.js +1 -1
- package/dist/294.js +1 -1
- package/dist/336.js +2 -0
- package/dist/{337.js.LICENSE.txt → 336.js.LICENSE.txt} +0 -0
- package/dist/373.js +1 -1
- package/dist/45.js +1 -0
- package/dist/574.js +1 -1
- package/dist/692.js +1 -1
- package/dist/701.js +1 -1
- package/dist/76.js +1 -1
- package/dist/93.js +1 -1
- package/dist/932.js +1 -1
- package/dist/openmrs-esm-patient-programs-app.js +1 -1
- package/dist/openmrs-esm-patient-programs-app.js.buildmanifest.json +31 -76
- package/dist/openmrs-esm-patient-programs-app.old +1 -1
- package/package.json +3 -3
- package/src/programs/programs-detailed-summary.component.tsx +27 -0
- package/src/programs/programs-detailed-summary.test.tsx +13 -4
- package/src/programs/programs-form.component.tsx +80 -35
- package/src/programs/programs-form.test.tsx +119 -24
- package/src/programs/programs.resource.tsx +2 -2
- package/src/types/index.ts +6 -2
- package/translations/en.json +4 -1
- package/dist/13.js +0 -1
- package/dist/337.js +0 -2
- package/dist/622.js +0 -1
- package/dist/817.js +0 -2
- package/dist/817.js.LICENSE.txt +0 -8
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"initial": false,
|
|
6
6
|
"entry": false,
|
|
7
7
|
"recorded": false,
|
|
8
|
-
"size":
|
|
8
|
+
"size": 17233,
|
|
9
9
|
"sizes": {
|
|
10
|
-
"javascript":
|
|
10
|
+
"javascript": 17233
|
|
11
11
|
},
|
|
12
12
|
"names": [],
|
|
13
13
|
"idHints": [],
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"@openmrs/esm-patient-programs-app"
|
|
16
16
|
],
|
|
17
17
|
"files": [
|
|
18
|
-
"
|
|
18
|
+
"45.js"
|
|
19
19
|
],
|
|
20
20
|
"auxiliaryFiles": [],
|
|
21
|
-
"hash": "
|
|
21
|
+
"hash": "d4bb4ac22af6d67b6413",
|
|
22
22
|
"childrenByOrder": {}
|
|
23
23
|
},
|
|
24
24
|
{
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"initial": true,
|
|
27
27
|
"entry": true,
|
|
28
28
|
"recorded": false,
|
|
29
|
-
"size":
|
|
29
|
+
"size": 23762,
|
|
30
30
|
"sizes": {
|
|
31
31
|
"javascript": 3409,
|
|
32
|
-
"share-init":
|
|
33
|
-
"runtime":
|
|
32
|
+
"share-init": 336,
|
|
33
|
+
"runtime": 20017
|
|
34
34
|
},
|
|
35
35
|
"names": [
|
|
36
36
|
"@openmrs/esm-patient-programs-app"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"openmrs-esm-patient-programs-app.js"
|
|
44
44
|
],
|
|
45
45
|
"auxiliaryFiles": [],
|
|
46
|
-
"hash": "
|
|
46
|
+
"hash": "aa5a2c6bf3e291f09e29",
|
|
47
47
|
"childrenByOrder": {}
|
|
48
48
|
},
|
|
49
49
|
{
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"76.js"
|
|
65
65
|
],
|
|
66
66
|
"auxiliaryFiles": [],
|
|
67
|
-
"hash": "
|
|
67
|
+
"hash": "7132aae5120e35260fd7",
|
|
68
68
|
"childrenByOrder": {}
|
|
69
69
|
},
|
|
70
70
|
{
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"entry": false,
|
|
74
74
|
"recorded": false,
|
|
75
75
|
"reason": "reused as split chunk (cache group: default)",
|
|
76
|
-
"size":
|
|
76
|
+
"size": 82958,
|
|
77
77
|
"sizes": {
|
|
78
|
-
"javascript":
|
|
79
|
-
"consume-shared":
|
|
78
|
+
"javascript": 82874,
|
|
79
|
+
"consume-shared": 84
|
|
80
80
|
},
|
|
81
81
|
"names": [],
|
|
82
82
|
"idHints": [],
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"93.js"
|
|
88
88
|
],
|
|
89
89
|
"auxiliaryFiles": [],
|
|
90
|
-
"hash": "
|
|
90
|
+
"hash": "4e82e0b22fe33d3ec2a7",
|
|
91
91
|
"childrenByOrder": {}
|
|
92
92
|
},
|
|
93
93
|
{
|
|
@@ -95,9 +95,9 @@
|
|
|
95
95
|
"initial": false,
|
|
96
96
|
"entry": false,
|
|
97
97
|
"recorded": false,
|
|
98
|
-
"size":
|
|
98
|
+
"size": 22007,
|
|
99
99
|
"sizes": {
|
|
100
|
-
"javascript":
|
|
100
|
+
"javascript": 21965,
|
|
101
101
|
"consume-shared": 42
|
|
102
102
|
},
|
|
103
103
|
"names": [],
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"145.js"
|
|
110
110
|
],
|
|
111
111
|
"auxiliaryFiles": [],
|
|
112
|
-
"hash": "
|
|
112
|
+
"hash": "c8ca335f2490dbbd1f2a",
|
|
113
113
|
"childrenByOrder": {}
|
|
114
114
|
},
|
|
115
115
|
{
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"186.js"
|
|
134
134
|
],
|
|
135
135
|
"auxiliaryFiles": [],
|
|
136
|
-
"hash": "
|
|
136
|
+
"hash": "0c43302b02d9be878f96",
|
|
137
137
|
"childrenByOrder": {}
|
|
138
138
|
},
|
|
139
139
|
{
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"252.js"
|
|
182
182
|
],
|
|
183
183
|
"auxiliaryFiles": [],
|
|
184
|
-
"hash": "
|
|
184
|
+
"hash": "f975d4ecefb56af161d2",
|
|
185
185
|
"childrenByOrder": {}
|
|
186
186
|
},
|
|
187
187
|
{
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
"294.js"
|
|
206
206
|
],
|
|
207
207
|
"auxiliaryFiles": [],
|
|
208
|
-
"hash": "
|
|
208
|
+
"hash": "40d0e4fca3107a3ca06e",
|
|
209
209
|
"childrenByOrder": {}
|
|
210
210
|
},
|
|
211
211
|
{
|
|
@@ -226,10 +226,10 @@
|
|
|
226
226
|
"@openmrs/esm-patient-programs-app"
|
|
227
227
|
],
|
|
228
228
|
"files": [
|
|
229
|
-
"
|
|
229
|
+
"336.js"
|
|
230
230
|
],
|
|
231
231
|
"auxiliaryFiles": [],
|
|
232
|
-
"hash": "
|
|
232
|
+
"hash": "739fd9a2504fa9d1169c",
|
|
233
233
|
"childrenByOrder": {}
|
|
234
234
|
},
|
|
235
235
|
{
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
"373.js"
|
|
251
251
|
],
|
|
252
252
|
"auxiliaryFiles": [],
|
|
253
|
-
"hash": "
|
|
253
|
+
"hash": "e41c00e01f8e331471de",
|
|
254
254
|
"childrenByOrder": {}
|
|
255
255
|
},
|
|
256
256
|
{
|
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
],
|
|
271
271
|
"files": [],
|
|
272
272
|
"auxiliaryFiles": [],
|
|
273
|
-
"hash": "
|
|
273
|
+
"hash": "c58d5d16754254afa911",
|
|
274
274
|
"childrenByOrder": {}
|
|
275
275
|
},
|
|
276
276
|
{
|
|
@@ -302,9 +302,9 @@
|
|
|
302
302
|
"initial": false,
|
|
303
303
|
"entry": false,
|
|
304
304
|
"recorded": false,
|
|
305
|
-
"size":
|
|
305
|
+
"size": 993,
|
|
306
306
|
"sizes": {
|
|
307
|
-
"javascript":
|
|
307
|
+
"javascript": 993
|
|
308
308
|
},
|
|
309
309
|
"names": [],
|
|
310
310
|
"idHints": [],
|
|
@@ -315,28 +315,7 @@
|
|
|
315
315
|
"574.js"
|
|
316
316
|
],
|
|
317
317
|
"auxiliaryFiles": [],
|
|
318
|
-
"hash": "
|
|
319
|
-
"childrenByOrder": {}
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"rendered": true,
|
|
323
|
-
"initial": false,
|
|
324
|
-
"entry": false,
|
|
325
|
-
"recorded": false,
|
|
326
|
-
"size": 3660,
|
|
327
|
-
"sizes": {
|
|
328
|
-
"javascript": 3660
|
|
329
|
-
},
|
|
330
|
-
"names": [],
|
|
331
|
-
"idHints": [],
|
|
332
|
-
"runtime": [
|
|
333
|
-
"@openmrs/esm-patient-programs-app"
|
|
334
|
-
],
|
|
335
|
-
"files": [
|
|
336
|
-
"622.js"
|
|
337
|
-
],
|
|
338
|
-
"auxiliaryFiles": [],
|
|
339
|
-
"hash": "fe1fd829fc9f2b3bcadb",
|
|
318
|
+
"hash": "f73971c4af46ef6eaa9f",
|
|
340
319
|
"childrenByOrder": {}
|
|
341
320
|
},
|
|
342
321
|
{
|
|
@@ -368,9 +347,9 @@
|
|
|
368
347
|
"initial": false,
|
|
369
348
|
"entry": false,
|
|
370
349
|
"recorded": false,
|
|
371
|
-
"size":
|
|
350
|
+
"size": 16156,
|
|
372
351
|
"sizes": {
|
|
373
|
-
"javascript":
|
|
352
|
+
"javascript": 16156
|
|
374
353
|
},
|
|
375
354
|
"names": [],
|
|
376
355
|
"idHints": [],
|
|
@@ -381,7 +360,7 @@
|
|
|
381
360
|
"692.js"
|
|
382
361
|
],
|
|
383
362
|
"auxiliaryFiles": [],
|
|
384
|
-
"hash": "
|
|
363
|
+
"hash": "8a70107b2718ae4cc801",
|
|
385
364
|
"childrenByOrder": {}
|
|
386
365
|
},
|
|
387
366
|
{
|
|
@@ -405,7 +384,7 @@
|
|
|
405
384
|
"701.js"
|
|
406
385
|
],
|
|
407
386
|
"auxiliaryFiles": [],
|
|
408
|
-
"hash": "
|
|
387
|
+
"hash": "02b264826d82b2fa6001",
|
|
409
388
|
"childrenByOrder": {}
|
|
410
389
|
},
|
|
411
390
|
{
|
|
@@ -470,30 +449,6 @@
|
|
|
470
449
|
"hash": "12d376aac82c6ec35674",
|
|
471
450
|
"childrenByOrder": {}
|
|
472
451
|
},
|
|
473
|
-
{
|
|
474
|
-
"rendered": true,
|
|
475
|
-
"initial": false,
|
|
476
|
-
"entry": false,
|
|
477
|
-
"recorded": false,
|
|
478
|
-
"reason": "reused as split chunk (cache group: defaultVendors)",
|
|
479
|
-
"size": 90248,
|
|
480
|
-
"sizes": {
|
|
481
|
-
"javascript": 90248
|
|
482
|
-
},
|
|
483
|
-
"names": [],
|
|
484
|
-
"idHints": [
|
|
485
|
-
"vendors"
|
|
486
|
-
],
|
|
487
|
-
"runtime": [
|
|
488
|
-
"@openmrs/esm-patient-programs-app"
|
|
489
|
-
],
|
|
490
|
-
"files": [
|
|
491
|
-
"817.js"
|
|
492
|
-
],
|
|
493
|
-
"auxiliaryFiles": [],
|
|
494
|
-
"hash": "485052953a024768be3f",
|
|
495
|
-
"childrenByOrder": {}
|
|
496
|
-
},
|
|
497
452
|
{
|
|
498
453
|
"rendered": true,
|
|
499
454
|
"initial": false,
|
|
@@ -577,7 +532,7 @@
|
|
|
577
532
|
"932.js"
|
|
578
533
|
],
|
|
579
534
|
"auxiliaryFiles": [],
|
|
580
|
-
"hash": "
|
|
535
|
+
"hash": "213500f7088755e047f2",
|
|
581
536
|
"childrenByOrder": {}
|
|
582
537
|
}
|
|
583
538
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register("@openmrs/esm-patient-programs-app",[],(function(e,r){return{execute:function(){e((()=>{var e,t,n,o,a,i,s,l,u,p,f,d,c,m,
|
|
1
|
+
System.register("@openmrs/esm-patient-programs-app",[],(function(e,r){return{execute:function(){e((()=>{var e,t,n,o,a,i,s,l,u,p,f,d,c,h,m,v,g,y={3959:(e,r,t)=>{(0,t(6907).s)(1)},6907:(e,r,t)=>{const n=t(3541).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)}},5384:(e,r,t)=>{t(3959)},3541:(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},9022:(e,r,t)=>{"use strict";var n={app:()=>Promise.all([t.e(383),t.e(76)]).then((()=>()=>t(3076)))},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})}},b={};function w(e){var r=b[e];if(void 0!==r)return r.exports;var t=b[e]={id:e,loaded:!1,exports:{}};return y[e].call(t.exports,t,t.exports,w),t.loaded=!0,t.exports}return w.m=y,w.c=b,w.y=r,w.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return w.d(r,{a:r}),r},w.d=(e,r)=>{for(var t in r)w.o(r,t)&&!w.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},w.f={},w.e=e=>Promise.all(Object.keys(w.f).reduce(((r,t)=>(w.f[t](e,r),r)),[])),w.u=e=>e+".js",w.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),w.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},t="@openmrs/esm-patient-programs-app:",w.l=(r,n,o,a)=>{if(e[r])e[r].push(n);else{var i,s;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var p=l[u];if(p.getAttribute("src")==r||p.getAttribute("data-webpack")==t+o){i=p;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,w.nc&&i.setAttribute("nonce",w.nc),i.setAttribute("data-webpack",t+o),i.src=r),e[r]=[n];var f=(t,n)=>{i.onerror=i.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),t)return t(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),s&&document.head.appendChild(i)}},w.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},w.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{w.S={};var e={},r={};w.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];w.o(w.S,t)||(w.S[t]={});var a=w.S[t],i="@openmrs/esm-patient-programs-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})},l=[];return"default"===t&&(s("@openmrs/esm-framework","3.4.1-pre.98",(()=>Promise.all([w.e(858),w.e(902)]).then((()=>()=>w(6858))))),s("@openmrs/esm-patient-common-lib","3.2.0",(()=>Promise.all([w.e(336),w.e(701),w.e(294),w.e(902),w.e(739),w.e(93),w.e(383)]).then((()=>()=>w(5093))))),s("carbon-components","10.40.0",(()=>w.e(635).then((()=>()=>w(9635))))),s("carbon-icons","7.0.7",(()=>w.e(402).then((()=>()=>w(5402))))),s("dayjs","1.11.3",(()=>w.e(879).then((()=>()=>w(8879))))),s("react-i18next","11.17.2",(()=>Promise.all([w.e(902),w.e(932)]).then((()=>()=>w(9932))))),s("react","16.14.0",(()=>w.e(784).then((()=>()=>w(2784))))),s("rxjs","6.6.7",(()=>w.e(206).then((()=>()=>w(5206)))))),e[t]=l.length?Promise.all(l).then((()=>e[t]=1)):1}}})(),w.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("+l()+")":1===s?"("+l()+" || "+l()+")":2===s?i.pop()+" "+i.pop():a(s))}return l();function l(){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,l=!0;;s++,a++){var u,p,f=s<e.length?(typeof e[s])[0]:"";if(a>=r.length||"o"==(p=(typeof(u=r[a]))[0]))return!l||("u"==f?s>t&&!o:""==f!=o);if("u"==p){if(!l||"u"!=f)return!1}else if(l)if(f==p)if(s<=t){if(u!=e[s])return!1}else{if(o?u>e[s]:u<e[s])return!1;u!=e[s]&&(l=!1)}else if("s"!=f&&"n"!=f){if(o||s<=t)return!1;l=!1,s--}else{if(s<=t||p<f!=o)return!1;l=!1}else"s"!=f&&"n"!=f&&(l=!1,s--)}}var d=[],c=d.pop.bind(d);for(a=1;a<e.length;a++){var h=e[a];d.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)},l=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+a(n)+")",u=(e,r,t,n)=>{var o=s(e,t);return f(e[t][o])},p=(e,r,t,n)=>{var o=s(e,t);return i(n,o)||"undefined"!=typeof console&&console.warn&&console.warn(l(e,t,o,n)),f(e[t][o])},f=e=>(e.loaded=1,e.get()),c=(d=e=>function(r,t,n,o){var a=w.I(r);return a&&a.then?a.then(e.bind(e,r,w.S[r],t,n,o)):e(r,w.S[r],t,n,o)})(((e,r,t,n)=>r&&w.o(r,t)?u(r,0,t):n())),h=d(((e,r,t,n,o)=>r&&w.o(r,t)?p(r,0,t,n):o())),m={},v={3066:()=>h("default","@openmrs/esm-framework",[1,3],(()=>Promise.all([w.e(858),w.e(902)]).then((()=>()=>w(6858))))),3771:()=>h("default","@openmrs/esm-patient-common-lib",[1,3],(()=>Promise.all([w.e(336),w.e(701),w.e(294),w.e(902),w.e(739),w.e(93)]).then((()=>()=>w(5093))))),9902:()=>h("default","react",[1,16],(()=>w.e(784).then((()=>()=>w(2784))))),4924:()=>h("default","react-i18next",[1,11],(()=>w.e(373).then((()=>()=>w(9932))))),8479:()=>h("default","carbon-components",[1,10],(()=>w.e(635).then((()=>()=>w(9635))))),2444:()=>h("default","rxjs",[1,6],(()=>w.e(206).then((()=>()=>w(5206))))),6081:()=>c("default","@openmrs/esm-framework/src/internal",(()=>w.e(858).then((()=>()=>w(6858))))),3565:()=>h("default","dayjs",[1,1],(()=>w.e(879).then((()=>()=>w(8879)))))},g={93:[2444,6081],145:[3565],383:[3066,3771],739:[4924,8479],902:[9902]},w.f.consumes=(e,r)=>{w.o(g,e)&&g[e].forEach((e=>{if(w.o(m,e))return r.push(m[e]);var t=r=>{m[e]=0,w.m[e]=t=>{delete w.c[e],t.exports=r()}},n=r=>{delete m[e],w.m[e]=t=>{throw delete w.c[e],r}};try{var o=v[e]();o.then?r.push(m[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={55:0};w.f.j=(r,t)=>{var n=w.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(383|739|902)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=w.p+w.u(r),i=new Error;w.l(a,(t=>{if(w.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,l=0;if(a.some((r=>0!==e[r]))){for(n in i)w.o(i,n)&&(w.m[n]=i[n]);s&&s(w)}for(r&&r(t);l<a.length;l++)o=a[l],w.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunk_openmrs_esm_patient_programs_app=self.webpackChunk_openmrs_esm_patient_programs_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),w.nc=void 0,w(5384),w(9022)})())}}}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-patient-programs-app",
|
|
3
|
-
"version": "3.2.1-pre.
|
|
3
|
+
"version": "3.2.1-pre.124",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Patient programs microfrontend for the OpenMRS SPA",
|
|
6
6
|
"browser": "dist/openmrs-esm-patient-programs-app.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@carbon/charts-react": "^0.49.4",
|
|
38
38
|
"@carbon/icons-react": "^10.18.0",
|
|
39
|
-
"@openmrs/esm-patient-common-lib": "^3.2.1-pre.
|
|
39
|
+
"@openmrs/esm-patient-common-lib": "^3.2.1-pre.124",
|
|
40
40
|
"carbon-components-react": "^7.25.0",
|
|
41
41
|
"d3": "^7.0.3",
|
|
42
42
|
"lodash-es": "^4.17.15"
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"react-router-dom": "5.x",
|
|
53
53
|
"rxjs": "6.x"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "6fbba531dc0375f3c79c705111b23a6f0fb48936"
|
|
56
56
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Add16 from '@carbon/icons-react/es/add/16';
|
|
3
|
+
import Edit16 from '@carbon/icons-react/es/edit/16';
|
|
3
4
|
import filter from 'lodash-es/filter';
|
|
4
5
|
import includes from 'lodash-es/includes';
|
|
5
6
|
import map from 'lodash-es/map';
|
|
@@ -59,6 +60,10 @@ const ProgramsDetailedSummary: React.FC<ProgramsDetailedSummaryProps> = ({ patie
|
|
|
59
60
|
key: 'status',
|
|
60
61
|
header: t('status', 'Status'),
|
|
61
62
|
},
|
|
63
|
+
{
|
|
64
|
+
key: 'actions',
|
|
65
|
+
header: t('actions', 'Actions'),
|
|
66
|
+
},
|
|
62
67
|
],
|
|
63
68
|
[t],
|
|
64
69
|
);
|
|
@@ -73,6 +78,7 @@ const ProgramsDetailedSummary: React.FC<ProgramsDetailedSummaryProps> = ({ patie
|
|
|
73
78
|
status: program.dateCompleted
|
|
74
79
|
? `${t('completedOn', 'Completed On')} ${formatDate(new Date(program.dateCompleted))}`
|
|
75
80
|
: t('active', 'Active'),
|
|
81
|
+
actions: <ProgramEditButton programEnrollmentId={program.uuid} />,
|
|
76
82
|
};
|
|
77
83
|
});
|
|
78
84
|
}, [enrollments, t]);
|
|
@@ -143,4 +149,25 @@ const ProgramsDetailedSummary: React.FC<ProgramsDetailedSummaryProps> = ({ patie
|
|
|
143
149
|
return <EmptyState displayText={displayText} headerTitle={headerTitle} launchForm={launchProgramsForm} />;
|
|
144
150
|
};
|
|
145
151
|
|
|
152
|
+
interface ProgramEditButtonProps {
|
|
153
|
+
programEnrollmentId: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function ProgramEditButton({ programEnrollmentId }: ProgramEditButtonProps) {
|
|
157
|
+
const launchEditProgramsForm = React.useCallback(
|
|
158
|
+
() => launchPatientWorkspace('programs-form-workspace', { programEnrollmentId }),
|
|
159
|
+
[],
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<Button
|
|
164
|
+
kind="ghost"
|
|
165
|
+
renderIcon={Edit16}
|
|
166
|
+
iconDescription="Edit Program"
|
|
167
|
+
onClick={launchEditProgramsForm}
|
|
168
|
+
hasIconOnly
|
|
169
|
+
/>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
146
173
|
export default ProgramsDetailedSummary;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { screen } from '@testing-library/react';
|
|
2
|
+
import { screen, within } from '@testing-library/react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
4
|
import { openmrsFetch, usePagination } from '@openmrs/esm-framework';
|
|
5
5
|
import { mockEnrolledProgramsResponse } from '../../../../__mocks__/programs.mock';
|
|
@@ -89,13 +89,22 @@ describe('ProgramsDetailedSummary ', () => {
|
|
|
89
89
|
|
|
90
90
|
const addButton = screen.getByRole('button', { name: /Add/ });
|
|
91
91
|
expect(addButton).toBeInTheDocument();
|
|
92
|
-
|
|
93
|
-
expect(
|
|
94
|
-
expect(
|
|
92
|
+
const row = screen.getByRole('row', { name: /hiv care and treatment/i });
|
|
93
|
+
expect(row).toBeInTheDocument();
|
|
94
|
+
expect(within(row).getByRole('cell', { name: /16-Jan-2020/i })).toBeInTheDocument();
|
|
95
|
+
expect(within(row).getByRole('cell', { name: /active$/i })).toBeInTheDocument();
|
|
96
|
+
const editButton = within(row).getByRole('button', { name: /Edit Program$/i });
|
|
97
|
+
expect(editButton).toBeInTheDocument();
|
|
95
98
|
|
|
96
99
|
// Clicking "Add" launches the programs form in a workspace
|
|
97
100
|
userEvent.click(addButton);
|
|
98
101
|
expect(launchPatientWorkspace).toHaveBeenCalledWith('programs-form-workspace');
|
|
102
|
+
|
|
103
|
+
// Clicking the edit button launches the edit form in a workspace
|
|
104
|
+
userEvent.click(editButton);
|
|
105
|
+
expect(launchPatientWorkspace).toHaveBeenCalledWith('programs-form-workspace', {
|
|
106
|
+
programEnrollmentId: mockEnrolledProgramsResponse[0].uuid,
|
|
107
|
+
});
|
|
99
108
|
});
|
|
100
109
|
});
|
|
101
110
|
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
useSession,
|
|
13
13
|
useLocations,
|
|
14
14
|
useLayoutType,
|
|
15
|
+
parseDate,
|
|
15
16
|
} from '@openmrs/esm-framework';
|
|
16
17
|
import {
|
|
17
18
|
Button,
|
|
@@ -28,11 +29,16 @@ import {
|
|
|
28
29
|
useAvailablePrograms,
|
|
29
30
|
useEnrollments,
|
|
30
31
|
customRepresentation,
|
|
32
|
+
updateProgramEnrollment,
|
|
31
33
|
} from './programs.resource';
|
|
32
34
|
import { DefaultWorkspaceProps } from '@openmrs/esm-patient-common-lib';
|
|
33
35
|
import styles from './programs-form.scss';
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
interface ProgramsFormProps extends DefaultWorkspaceProps {
|
|
38
|
+
programEnrollmentId?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const ProgramsForm: React.FC<ProgramsFormProps> = ({ closeWorkspace, patientUuid, programEnrollmentId }) => {
|
|
36
42
|
const { t } = useTranslation();
|
|
37
43
|
const isTablet = useLayoutType() === 'tablet';
|
|
38
44
|
const session = useSession();
|
|
@@ -41,16 +47,25 @@ const ProgramsForm: React.FC<DefaultWorkspaceProps> = ({ closeWorkspace, patient
|
|
|
41
47
|
|
|
42
48
|
const { data: availablePrograms } = useAvailablePrograms();
|
|
43
49
|
const { data: enrollments } = useEnrollments(patientUuid);
|
|
50
|
+
const currentEnrollment = programEnrollmentId && enrollments.filter((e) => e.uuid == programEnrollmentId)[0];
|
|
51
|
+
const currentProgram = currentEnrollment
|
|
52
|
+
? {
|
|
53
|
+
display: currentEnrollment.program.name,
|
|
54
|
+
...currentEnrollment.program,
|
|
55
|
+
}
|
|
56
|
+
: null;
|
|
44
57
|
|
|
45
|
-
const eligiblePrograms =
|
|
46
|
-
|
|
47
|
-
(program) => !includes(map(enrollments, 'program.uuid'), program.uuid)
|
|
58
|
+
const eligiblePrograms = currentProgram
|
|
59
|
+
? [currentProgram]
|
|
60
|
+
: filter(availablePrograms, (program) => !includes(map(enrollments, 'program.uuid'), program.uuid));
|
|
61
|
+
const [completionDate, setCompletionDate] = React.useState<Date>(
|
|
62
|
+
currentEnrollment?.dateCompleted ? parseDate(currentEnrollment.dateCompleted) : null,
|
|
48
63
|
);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const [selectedProgram, setSelectedProgram] = React.useState<string>('');
|
|
53
|
-
const [userLocation, setUserLocation] = React.useState('');
|
|
64
|
+
const [enrollmentDate, setEnrollmentDate] = React.useState<Date>(
|
|
65
|
+
currentEnrollment?.dateEnrolled ? parseDate(currentEnrollment.dateEnrolled) : new Date(),
|
|
66
|
+
);
|
|
67
|
+
const [selectedProgram, setSelectedProgram] = React.useState<string>(currentEnrollment?.program.uuid ?? '');
|
|
68
|
+
const [userLocation, setUserLocation] = React.useState<string>(currentEnrollment?.location.uuid ?? '');
|
|
54
69
|
|
|
55
70
|
if (!userLocation && session?.sessionLocation?.uuid) {
|
|
56
71
|
setUserLocation(session?.sessionLocation?.uuid);
|
|
@@ -71,32 +86,62 @@ const ProgramsForm: React.FC<DefaultWorkspaceProps> = ({ closeWorkspace, patient
|
|
|
71
86
|
};
|
|
72
87
|
|
|
73
88
|
const abortController = new AbortController();
|
|
74
|
-
const sub =
|
|
75
|
-
(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
89
|
+
const sub = currentEnrollment
|
|
90
|
+
? updateProgramEnrollment(currentEnrollment.uuid, payload, abortController).subscribe(
|
|
91
|
+
(response) => {
|
|
92
|
+
if (response.status === 200) {
|
|
93
|
+
closeWorkspace();
|
|
94
|
+
|
|
95
|
+
showToast({
|
|
96
|
+
critical: true,
|
|
97
|
+
kind: 'success',
|
|
98
|
+
description: t(
|
|
99
|
+
'enrollmentUpdatesNowVisible',
|
|
100
|
+
'Changes to the program are now visible in the Programs table',
|
|
101
|
+
),
|
|
102
|
+
title: t('enrollmentUpdated', 'Program enrollment updated'),
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
mutate(`/ws/rest/v1/programenrollment?patient=${patientUuid}&v=${customRepresentation}`);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
(err) => {
|
|
109
|
+
createErrorHandler();
|
|
110
|
+
|
|
111
|
+
showNotification({
|
|
112
|
+
title: t('programEnrollmentSaveError', 'Error saving program enrollment'),
|
|
113
|
+
kind: 'error',
|
|
114
|
+
critical: true,
|
|
115
|
+
description: err?.message,
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
)
|
|
119
|
+
: createProgramEnrollment(payload, abortController).subscribe(
|
|
120
|
+
(response) => {
|
|
121
|
+
if (response.status === 201) {
|
|
122
|
+
closeWorkspace();
|
|
123
|
+
|
|
124
|
+
showToast({
|
|
125
|
+
critical: true,
|
|
126
|
+
kind: 'success',
|
|
127
|
+
description: t('enrollmentNowVisible', 'It is now visible in the Programs table'),
|
|
128
|
+
title: t('enrollmentSaved', 'Program enrollment saved'),
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
mutate(`/ws/rest/v1/programenrollment?patient=${patientUuid}&v=${customRepresentation}`);
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
(err) => {
|
|
135
|
+
createErrorHandler();
|
|
136
|
+
|
|
137
|
+
showNotification({
|
|
138
|
+
title: t('programEnrollmentSaveError', 'Error saving program enrollment'),
|
|
139
|
+
kind: 'error',
|
|
140
|
+
critical: true,
|
|
141
|
+
description: err?.message,
|
|
142
|
+
});
|
|
143
|
+
},
|
|
144
|
+
);
|
|
100
145
|
return () => {
|
|
101
146
|
sub.unsubscribe();
|
|
102
147
|
};
|