@kenyaemr/esm-bed-management-app 1.0.1-pre.11 → 1.0.1-pre.13
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/227.js +1 -0
- package/dist/227.js.map +1 -0
- package/dist/283.js +1 -1
- package/dist/404.js +1 -1
- package/dist/404.js.map +1 -1
- package/dist/691.js +1 -0
- package/dist/691.js.map +1 -0
- package/dist/esm-kenyaemr-bed-management-app.js.buildmanifest.json +51 -51
- package/dist/main.js +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/bed-administration/bed-administration-table.scss +3 -0
- package/src/bed-admission/bed-tag/bed-tag-administration-table.component.tsx +32 -9
- package/src/bed-admission/bed-tag/bed-tags-admin-form.component.tsx +16 -1
- package/src/bed-admission/bed-tag/delete-bed-tag.component.tsx +69 -0
- package/src/bed-admission/bed-tag/delete-bedForm.component.tsx +108 -0
- package/src/bed-admission/bed-tag/edit-tag-form.component.tsx +1 -1
- package/src/bed-admission/bed-type/bed-type-admin-form.component.tsx +33 -3
- package/src/bed-admission/bed-type/bed-type-administration-table.component.tsx +31 -7
- package/src/bed-admission/bed-type/delete-bed-type.component.tsx +69 -0
- package/src/bed-admission/bed-type/deleteBedtypeForm.component.tsx +108 -0
- package/src/bed-admission/bed-type/edit-bed-type.component.tsx +1 -1
- package/src/summary/summary.resource.ts +138 -30
- package/dist/637.js +0 -1
- package/dist/637.js.map +0 -1
- package/dist/850.js +0 -1
- package/dist/850.js.map +0 -1
- /package/.yarn/versions/{3d353a50.yml → bd5b71b3.yml} +0 -0
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"auxiliaryFiles": [
|
|
80
80
|
"main.js.map"
|
|
81
81
|
],
|
|
82
|
-
"hash": "
|
|
82
|
+
"hash": "f55059f8db8af610",
|
|
83
83
|
"childrenByOrder": {}
|
|
84
84
|
},
|
|
85
85
|
{
|
|
@@ -109,6 +109,33 @@
|
|
|
109
109
|
"hash": "7a0dcd0ac64ec089",
|
|
110
110
|
"childrenByOrder": {}
|
|
111
111
|
},
|
|
112
|
+
{
|
|
113
|
+
"rendered": true,
|
|
114
|
+
"initial": false,
|
|
115
|
+
"entry": false,
|
|
116
|
+
"recorded": false,
|
|
117
|
+
"reason": "split chunk (cache group: defaultVendors)",
|
|
118
|
+
"size": 373970,
|
|
119
|
+
"sizes": {
|
|
120
|
+
"javascript": 373970
|
|
121
|
+
},
|
|
122
|
+
"names": [],
|
|
123
|
+
"idHints": [
|
|
124
|
+
"vendors"
|
|
125
|
+
],
|
|
126
|
+
"runtime": [
|
|
127
|
+
"@kenyaemr/esm-bed-management-app",
|
|
128
|
+
"main"
|
|
129
|
+
],
|
|
130
|
+
"files": [
|
|
131
|
+
"227.js"
|
|
132
|
+
],
|
|
133
|
+
"auxiliaryFiles": [
|
|
134
|
+
"227.js.map"
|
|
135
|
+
],
|
|
136
|
+
"hash": "3f2be277ca3af45a",
|
|
137
|
+
"childrenByOrder": {}
|
|
138
|
+
},
|
|
112
139
|
{
|
|
113
140
|
"rendered": true,
|
|
114
141
|
"initial": false,
|
|
@@ -130,7 +157,7 @@
|
|
|
130
157
|
"auxiliaryFiles": [
|
|
131
158
|
"283.js.map"
|
|
132
159
|
],
|
|
133
|
-
"hash": "
|
|
160
|
+
"hash": "8fea021a7c2f3b73",
|
|
134
161
|
"childrenByOrder": {}
|
|
135
162
|
},
|
|
136
163
|
{
|
|
@@ -211,9 +238,9 @@
|
|
|
211
238
|
"entry": false,
|
|
212
239
|
"recorded": false,
|
|
213
240
|
"reason": "split chunk (cache group: default)",
|
|
214
|
-
"size":
|
|
241
|
+
"size": 46766,
|
|
215
242
|
"sizes": {
|
|
216
|
-
"javascript":
|
|
243
|
+
"javascript": 46682,
|
|
217
244
|
"consume-shared": 84
|
|
218
245
|
},
|
|
219
246
|
"names": [],
|
|
@@ -228,7 +255,7 @@
|
|
|
228
255
|
"auxiliaryFiles": [
|
|
229
256
|
"404.js.map"
|
|
230
257
|
],
|
|
231
|
-
"hash": "
|
|
258
|
+
"hash": "714f21b035881ce2",
|
|
232
259
|
"childrenByOrder": {}
|
|
233
260
|
},
|
|
234
261
|
{
|
|
@@ -332,41 +359,34 @@
|
|
|
332
359
|
"childrenByOrder": {}
|
|
333
360
|
},
|
|
334
361
|
{
|
|
335
|
-
"rendered":
|
|
362
|
+
"rendered": false,
|
|
336
363
|
"initial": false,
|
|
337
364
|
"entry": false,
|
|
338
365
|
"recorded": false,
|
|
339
|
-
"reason": "split chunk (cache group:
|
|
340
|
-
"size":
|
|
366
|
+
"reason": "reused as split chunk (cache group: default)",
|
|
367
|
+
"size": 42,
|
|
341
368
|
"sizes": {
|
|
342
|
-
"
|
|
369
|
+
"consume-shared": 42
|
|
343
370
|
},
|
|
344
371
|
"names": [],
|
|
345
|
-
"idHints": [
|
|
346
|
-
"vendors"
|
|
347
|
-
],
|
|
372
|
+
"idHints": [],
|
|
348
373
|
"runtime": [
|
|
349
374
|
"@kenyaemr/esm-bed-management-app",
|
|
350
375
|
"main"
|
|
351
376
|
],
|
|
352
|
-
"files": [
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
"auxiliaryFiles": [
|
|
356
|
-
"637.js.map"
|
|
357
|
-
],
|
|
358
|
-
"hash": "e99cc39930c69a06",
|
|
377
|
+
"files": [],
|
|
378
|
+
"auxiliaryFiles": [],
|
|
379
|
+
"hash": "149360c311de5385",
|
|
359
380
|
"childrenByOrder": {}
|
|
360
381
|
},
|
|
361
382
|
{
|
|
362
|
-
"rendered":
|
|
383
|
+
"rendered": true,
|
|
363
384
|
"initial": false,
|
|
364
385
|
"entry": false,
|
|
365
386
|
"recorded": false,
|
|
366
|
-
"
|
|
367
|
-
"size": 42,
|
|
387
|
+
"size": 158623,
|
|
368
388
|
"sizes": {
|
|
369
|
-
"
|
|
389
|
+
"javascript": 158623
|
|
370
390
|
},
|
|
371
391
|
"names": [],
|
|
372
392
|
"idHints": [],
|
|
@@ -374,9 +394,13 @@
|
|
|
374
394
|
"@kenyaemr/esm-bed-management-app",
|
|
375
395
|
"main"
|
|
376
396
|
],
|
|
377
|
-
"files": [
|
|
378
|
-
|
|
379
|
-
|
|
397
|
+
"files": [
|
|
398
|
+
"691.js"
|
|
399
|
+
],
|
|
400
|
+
"auxiliaryFiles": [
|
|
401
|
+
"691.js.map"
|
|
402
|
+
],
|
|
403
|
+
"hash": "00d0babe6e131558",
|
|
380
404
|
"childrenByOrder": {}
|
|
381
405
|
},
|
|
382
406
|
{
|
|
@@ -430,30 +454,6 @@
|
|
|
430
454
|
"hash": "c06ec4cd95bfb29b",
|
|
431
455
|
"childrenByOrder": {}
|
|
432
456
|
},
|
|
433
|
-
{
|
|
434
|
-
"rendered": true,
|
|
435
|
-
"initial": false,
|
|
436
|
-
"entry": false,
|
|
437
|
-
"recorded": false,
|
|
438
|
-
"size": 141893,
|
|
439
|
-
"sizes": {
|
|
440
|
-
"javascript": 141893
|
|
441
|
-
},
|
|
442
|
-
"names": [],
|
|
443
|
-
"idHints": [],
|
|
444
|
-
"runtime": [
|
|
445
|
-
"@kenyaemr/esm-bed-management-app",
|
|
446
|
-
"main"
|
|
447
|
-
],
|
|
448
|
-
"files": [
|
|
449
|
-
"850.js"
|
|
450
|
-
],
|
|
451
|
-
"auxiliaryFiles": [
|
|
452
|
-
"850.js.map"
|
|
453
|
-
],
|
|
454
|
-
"hash": "053427f058eeabed",
|
|
455
|
-
"childrenByOrder": {}
|
|
456
|
-
},
|
|
457
457
|
{
|
|
458
458
|
"rendered": true,
|
|
459
459
|
"initial": false,
|
|
@@ -499,7 +499,7 @@
|
|
|
499
499
|
"auxiliaryFiles": [
|
|
500
500
|
"933.js.map"
|
|
501
501
|
],
|
|
502
|
-
"hash": "
|
|
502
|
+
"hash": "22d3749d1d077f8f",
|
|
503
503
|
"childrenByOrder": {}
|
|
504
504
|
}
|
|
505
505
|
]
|
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e,t,r={1283:(e,t,r)=>{"use strict";var n=r(1132),a=(n.Type.UUID,n.Type.UUID,n.Type.Boolean,n.Type.String,n.Type.String,r(1672)),o=r.n(a),i=r(935),l=r(1914);function c(e){var t=e.config,r=t.name,c=t.title,u=(0,l.useLocation)(),s=(0,a.useMemo)((function(){return decodeURIComponent((0,i.Z)(u.pathname.split("/")))}),[u.pathname]);return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/.test(s)&&(s="summary"),o().createElement(n.ConfigurableLink,{to:"".concat(window.getOpenmrsSpaBase(),"bed-management").concat(r&&"bed-management"!==r?"/".concat(r):""),className:"cds--side-nav__link ".concat(r===s&&"active-left-nav-link")},c)}var u=function(e){return function(){return o().createElement(l.BrowserRouter,null,o().createElement(c,{config:e}))}};function s(e){var t=e.config,r=t.name,c=t.title,u=(0,l.useLocation)(),s=(0,a.useMemo)((function(){return decodeURIComponent((0,i.Z)(u.pathname.split("/")))}),[u.pathname]);return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/.test(s)&&(s="summary"),o().createElement(n.ConfigurableLink,{to:"".concat(window.getOpenmrsSpaBase(),"home").concat(r?"/".concat(r):""),className:"cds--side-nav__link ".concat(r===s&&"active-left-nav-link")},c)}var f,m={featureName:"bed-management",moduleName:"@kenyaemr/esm-bed-management-app"};r(3979),(0,n.getAsyncLifecycle)((function(){return Promise.all([r.e(330),r.e(455),r.e(
|
|
1
|
+
(()=>{var e,t,r={1283:(e,t,r)=>{"use strict";var n=r(1132),a=(n.Type.UUID,n.Type.UUID,n.Type.Boolean,n.Type.String,n.Type.String,r(1672)),o=r.n(a),i=r(935),l=r(1914);function c(e){var t=e.config,r=t.name,c=t.title,u=(0,l.useLocation)(),s=(0,a.useMemo)((function(){return decodeURIComponent((0,i.Z)(u.pathname.split("/")))}),[u.pathname]);return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/.test(s)&&(s="summary"),o().createElement(n.ConfigurableLink,{to:"".concat(window.getOpenmrsSpaBase(),"bed-management").concat(r&&"bed-management"!==r?"/".concat(r):""),className:"cds--side-nav__link ".concat(r===s&&"active-left-nav-link")},c)}var u=function(e){return function(){return o().createElement(l.BrowserRouter,null,o().createElement(c,{config:e}))}};function s(e){var t=e.config,r=t.name,c=t.title,u=(0,l.useLocation)(),s=(0,a.useMemo)((function(){return decodeURIComponent((0,i.Z)(u.pathname.split("/")))}),[u.pathname]);return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/.test(s)&&(s="summary"),o().createElement(n.ConfigurableLink,{to:"".concat(window.getOpenmrsSpaBase(),"home").concat(r?"/".concat(r):""),className:"cds--side-nav__link ".concat(r===s&&"active-left-nav-link")},c)}var f,m={featureName:"bed-management",moduleName:"@kenyaemr/esm-bed-management-app"};r(3979),(0,n.getAsyncLifecycle)((function(){return Promise.all([r.e(330),r.e(455),r.e(227),r.e(397),r.e(404),r.e(691)]).then(r.bind(r,9691))}),m),(0,n.getAsyncLifecycle)((function(){return Promise.all([r.e(330),r.e(455),r.e(207),r.e(397),r.e(404),r.e(933)]).then(r.bind(r,3933))}),m),(0,n.getAsyncLifecycle)((function(){return Promise.all([r.e(330),r.e(397),r.e(884)]).then(r.bind(r,3884))}),m),(0,n.getSyncLifecycle)(u({name:"bed-management",title:"Summary"}),m),(0,n.getSyncLifecycle)(u({name:"administration",title:"Ward Allocation"}),m),(0,n.getSyncLifecycle)(u({name:"bed-type",title:"Bed Type"}),m),(0,n.getSyncLifecycle)(u({name:"bed-tag",title:"Bed Tag"}),m),(0,n.getSyncLifecycle)((f={name:"bed-admission",title:"In Patient"},function(){return o().createElement(l.BrowserRouter,null,o().createElement(s,{config:f}))}),m)},3979:(e,t,r)=>{var n={"./en.json":[3574,574]};function a(e){if(!r.o(n,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],a=t[0];return r.e(t[1]).then((()=>r(a)))}a.keys=()=>Object.keys(n),a.id=3979,e.exports=a},935:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return r[e].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.m=r,a.c=n,a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>e+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@kenyaemr/esm-bed-management-app:",a.l=(r,n,o,i)=>{if(e[r])e[r].push(n);else{var l,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),s=0;s<u.length;s++){var f=u[s];if(f.getAttribute("src")==r||f.getAttribute("data-webpack")==t+o){l=f;break}}l||(c=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,a.nc&&l.setAttribute("nonce",a.nc),l.setAttribute("data-webpack",t+o),l.src=r),e[r]=[n];var m=(t,n)=>{l.onerror=l.onload=null,clearTimeout(d);var a=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(n))),t)return t(n)},d=setTimeout(m.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=m.bind(null,l.onerror),l.onload=m.bind(null,l.onload),c&&document.head.appendChild(l)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{a.S={};var e={},t={};a.I=(r,n)=>{n||(n=[]);var o=t[r];if(o||(o=t[r]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[r])return e[r];a.o(a.S,r)||(a.S[r]={});var i=a.S[r],l="@kenyaemr/esm-bed-management-app",c=(e,t,r,n)=>{var a=i[e]=i[e]||{},o=a[t];(!o||!o.loaded&&(!n!=!o.eager?n:l>o.from))&&(a[t]={get:r,from:l,eager:!!n})},u=[];return"default"===r&&(c("@openmrs/esm-framework","5.1.1-pre.986",(()=>Promise.all([a.e(800),a.e(672)]).then((()=>()=>a(4800))))),c("react-i18next","11.18.6",(()=>Promise.all([a.e(672),a.e(629)]).then((()=>()=>a(707))))),c("react-router-dom","6.15.0",(()=>Promise.all([a.e(26),a.e(672)]).then((()=>()=>a(8026))))),c("react","18.2.0",(()=>a.e(294).then((()=>()=>a(7294))))),c("rxjs","6.6.7",(()=>a.e(558).then((()=>()=>a(8558)))))),e[r]=u.length?Promise.all(u).then((()=>e[r]=1)):1}}})(),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&!e;)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e=e=>{var t=e=>e.split(".").map((e=>+e==e?+e:e)),r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=r[1]?t(r[1]):[];return r[2]&&(n.length++,n.push.apply(n,t(r[2]))),r[3]&&(n.push([]),n.push.apply(n,t(r[3]))),n},t=e=>{var r=e[0],n="";if(1===e.length)return"*";if(r+.5){n+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var a=1,o=1;o<e.length;o++)a--,n+="u"==(typeof(l=e[o]))[0]?"-":(a>0?".":"")+(a=2,l);return n}var i=[];for(o=1;o<e.length;o++){var l=e[o];i.push(0===l?"not("+c()+")":1===l?"("+c()+" || "+c()+")":2===l?i.pop()+" "+i.pop():t(l))}return c();function c(){return i.pop().replace(/^\((.+)\)$/,"$1")}},r=(t,n)=>{if(0 in t){n=e(n);var a=t[0],o=a<0;o&&(a=-a-1);for(var i=0,l=1,c=!0;;l++,i++){var u,s,f=l<t.length?(typeof t[l])[0]:"";if(i>=n.length||"o"==(s=(typeof(u=n[i]))[0]))return!c||("u"==f?l>a&&!o:""==f!=o);if("u"==s){if(!c||"u"!=f)return!1}else if(c)if(f==s)if(l<=a){if(u!=t[l])return!1}else{if(o?u>t[l]:u<t[l])return!1;u!=t[l]&&(c=!1)}else if("s"!=f&&"n"!=f){if(o||l<=a)return!1;c=!1,l--}else{if(l<=a||s<f!=o)return!1;c=!1}else"s"!=f&&"n"!=f&&(c=!1,l--)}}var m=[],d=m.pop.bind(m);for(i=1;i<t.length;i++){var p=t[i];m.push(1==p?d()|d():2==p?d()&d():p?r(p,n):!d())}return!!d()},n=(t,r)=>{var n=t[r];return Object.keys(n).reduce(((t,r)=>!t||!n[t].loaded&&((t,r)=>{t=e(t),r=e(r);for(var n=0;;){if(n>=t.length)return n<r.length&&"u"!=(typeof r[n])[0];var a=t[n],o=(typeof a)[0];if(n>=r.length)return"u"==o;var i=r[n],l=(typeof i)[0];if(o!=l)return"o"==o&&"n"==l||"s"==l||"u"==o;if("o"!=o&&"u"!=o&&a!=i)return a<i;n++}})(t,r)?r:t),0)},o=(e,a,o,c)=>{var u=n(e,o);return r(c,u)||i(((e,r,n,a)=>"Unsatisfied version "+n+" from "+(n&&e[r][n].from)+" of shared singleton module "+r+" (required "+t(a)+")")(e,o,u,c)),l(e[o][u])},i=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},l=e=>(e.loaded=1,e.get()),c=e=>function(t,r,n,o){var i=a.I(t);return i&&i.then?i.then(e.bind(e,t,a.S[t],r,n,o)):e(t,a.S[t],r,n,o)},u=c(((e,t,r,o)=>t&&a.o(t,r)?((e,t,r,a)=>{var o=n(e,r);return l(e[r][o])})(t,0,r):o())),s=c(((e,t,r,n,i)=>t&&a.o(t,r)?o(t,0,r,n):i())),f={},m={3397:()=>s("default","react-i18next",[1,11],(()=>a.e(707).then((()=>()=>a(707))))),2437:()=>u("default","@openmrs/esm-framework/src/internal",(()=>a.e(800).then((()=>()=>a(4800))))),5222:()=>s("default","rxjs",[1,6],(()=>a.e(558).then((()=>()=>a(8558))))),1672:()=>s("default","react",[1,18],(()=>a.e(294).then((()=>()=>a(7294))))),1132:()=>s("default","@openmrs/esm-framework",[0],(()=>a.e(800).then((()=>()=>a(4800))))),1914:()=>s("default","react-router-dom",[1,6],(()=>a.e(26).then((()=>()=>a(8026)))))};[1132,1672,1914].forEach((e=>{a.m[e]=t=>{f[e]=0,delete a.c[e];var r=m[e]();if("function"!=typeof r)throw new Error("Shared module is not available for eager consumption: "+e);t.exports=r()}}));var d={397:[3397],404:[2437,5222],672:[1672]};a.f.consumes=(e,t)=>{a.o(d,e)&&d[e].forEach((e=>{if(a.o(f,e))return t.push(f[e]);var r=t=>{f[e]=0,a.m[e]=r=>{delete a.c[e],r.exports=t()}},n=t=>{delete f[e],a.m[e]=r=>{throw delete a.c[e],t}};try{var o=m[e]();o.then?t.push(f[e]=o.then(r).catch(n)):r(o)}catch(e){n(e)}}))}})(),(()=>{var e={179:0,672:0,283:0};a.f.j=(t,r)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(/^(397|672)$/.test(t))e[t]=0;else{var o=new Promise(((r,a)=>n=e[t]=[r,a]));r.push(n[2]=o);var i=a.p+a.u(t),l=new Error;a.l(i,(r=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,n[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,l,c]=r,u=0;if(i.some((t=>0!==e[t]))){for(n in l)a.o(l,n)&&(a.m[n]=l[n]);c&&c(a)}for(t&&t(r);u<i.length;u++)o=i[u],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=globalThis.webpackChunk_kenyaemr_esm_bed_management_app=globalThis.webpackChunk_kenyaemr_esm_bed_management_app||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),a.nc=void 0,a(1283)})();
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":"^1.2.0","webservices.rest":"^2.24.0"},"pages":[{"component":"root","route":"bed-management"}],"extensions":[{"component":"adminCardLink","name":"bed-management-admin-card-link","slot":"system-admin-page-card-link-slot"},{"component":"adminLeftPanelLink","name":"bed-administration-left-panel-link","slot":"bed-management-left-panel-slot"},{"component":"summaryLeftPanelLink","name":"bed-management-home-dashboard-link","slot":"bed-management-left-panel-slot","order":0},{"component":"bedAdmission","name":"bed-admission-dashboard","slot":"bed-admission-dashboard-slot"},{"component":"bedTypeLeftPanelLink","name":"bed-type-left-panel-link","slot":"bed-management-left-panel-slot"},{"component":"bedTagLeftPanelLink","name":"bed-tag-left-panel-link","slot":"bed-management-left-panel-slot"},{"name":"bed-admission-dashboard-link","component":"bedAdmissionDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"bed-admission","slot":"bed-admission-dashboard-slot","title":"Bed-admission"}}],"version":"1.0.1-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":"^1.2.0","webservices.rest":"^2.24.0"},"pages":[{"component":"root","route":"bed-management"}],"extensions":[{"component":"adminCardLink","name":"bed-management-admin-card-link","slot":"system-admin-page-card-link-slot"},{"component":"adminLeftPanelLink","name":"bed-administration-left-panel-link","slot":"bed-management-left-panel-slot"},{"component":"summaryLeftPanelLink","name":"bed-management-home-dashboard-link","slot":"bed-management-left-panel-slot","order":0},{"component":"bedAdmission","name":"bed-admission-dashboard","slot":"bed-admission-dashboard-slot"},{"component":"bedTypeLeftPanelLink","name":"bed-type-left-panel-link","slot":"bed-management-left-panel-slot"},{"component":"bedTagLeftPanelLink","name":"bed-tag-left-panel-link","slot":"bed-management-left-panel-slot"},{"name":"bed-admission-dashboard-link","component":"bedAdmissionDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"bed-admission","slot":"bed-admission-dashboard-slot","title":"Bed-admission"}}],"version":"1.0.1-pre.13"}
|
package/package.json
CHANGED
|
@@ -15,18 +15,21 @@ import {
|
|
|
15
15
|
TableRow,
|
|
16
16
|
Tile,
|
|
17
17
|
} from "@carbon/react";
|
|
18
|
-
import { Add, Edit } from "@carbon/react/icons";
|
|
18
|
+
import { Add, Edit, Delete } from "@carbon/react/icons";
|
|
19
19
|
import {
|
|
20
20
|
isDesktop as desktopLayout,
|
|
21
|
+
showNotification,
|
|
22
|
+
showToast,
|
|
21
23
|
useLayoutType,
|
|
22
24
|
} from "@openmrs/esm-framework";
|
|
23
25
|
import { CardHeader, ErrorState } from "@openmrs/esm-patient-common-lib";
|
|
24
26
|
import type { BedTagData } from "../../types";
|
|
25
|
-
import { useBedTag } from "../../summary/summary.resource";
|
|
27
|
+
import { deleteBedTag, useBedTag } from "../../summary/summary.resource";
|
|
26
28
|
import Header from "../../header/header.component";
|
|
27
29
|
import styles from "../../bed-administration/bed-administration-table.scss";
|
|
28
30
|
import BedTagForm from "./new-tag-form.component";
|
|
29
31
|
import EditBedTagForm from "./edit-tag-form.component";
|
|
32
|
+
import DeleteBedTag from "./delete-bed-tag.component";
|
|
30
33
|
|
|
31
34
|
const BedTagAdministrationTable: React.FC = () => {
|
|
32
35
|
const { t } = useTranslation();
|
|
@@ -37,14 +40,12 @@ const BedTagAdministrationTable: React.FC = () => {
|
|
|
37
40
|
const isDesktop = desktopLayout(layout);
|
|
38
41
|
const [isBedDataLoading] = useState(false);
|
|
39
42
|
const [showBedTagsModal, setAddBedTagsModal] = useState(false);
|
|
43
|
+
const [showDeleteBedTagsModal, setDeleteBedTagsModal] = useState(false);
|
|
40
44
|
const [showEditBedModal, setShowEditBedModal] = useState(false);
|
|
41
45
|
const [editData, setEditData] = useState<BedTagData>();
|
|
42
46
|
const [currentPage, setCurrentPage] = useState(1);
|
|
43
47
|
const [pageSize] = useState(10);
|
|
44
48
|
const { bedTypeData, isError, loading, validate, mutate } = useBedTag();
|
|
45
|
-
const [currentPageSize, setPageSize] = useState(10);
|
|
46
|
-
const pageSizes = [10, 20, 30, 40, 50];
|
|
47
|
-
|
|
48
49
|
const tableHeaders = [
|
|
49
50
|
{
|
|
50
51
|
header: t("ids", "Id"),
|
|
@@ -59,7 +60,6 @@ const BedTagAdministrationTable: React.FC = () => {
|
|
|
59
60
|
key: "actions",
|
|
60
61
|
},
|
|
61
62
|
];
|
|
62
|
-
|
|
63
63
|
const tableRows = useMemo(() => {
|
|
64
64
|
return bedTypeData?.map((entry) => ({
|
|
65
65
|
id: entry.uuid,
|
|
@@ -75,6 +75,7 @@ const BedTagAdministrationTable: React.FC = () => {
|
|
|
75
75
|
setEditData(entry);
|
|
76
76
|
setShowEditBedModal(true);
|
|
77
77
|
setAddBedTagsModal(false);
|
|
78
|
+
setDeleteBedTagsModal(false);
|
|
78
79
|
}}
|
|
79
80
|
kind={"ghost"}
|
|
80
81
|
iconDescription={t("editBedTag", "Edit Bed Tag")}
|
|
@@ -82,6 +83,22 @@ const BedTagAdministrationTable: React.FC = () => {
|
|
|
82
83
|
size={responsiveSize}
|
|
83
84
|
tooltipAlignment="start"
|
|
84
85
|
/>
|
|
86
|
+
<Button
|
|
87
|
+
enterDelayMs={300}
|
|
88
|
+
renderIcon={Delete}
|
|
89
|
+
onClick={(e) => {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
setEditData(entry);
|
|
92
|
+
setShowEditBedModal(false);
|
|
93
|
+
setAddBedTagsModal(false);
|
|
94
|
+
setDeleteBedTagsModal(true);
|
|
95
|
+
}}
|
|
96
|
+
kind={"ghost"}
|
|
97
|
+
iconDescription={t("deleteBedTag", "Delete Bed Tag")}
|
|
98
|
+
hasIconOnly
|
|
99
|
+
size={responsiveSize}
|
|
100
|
+
tooltipAlignment="start"
|
|
101
|
+
/>
|
|
85
102
|
</>
|
|
86
103
|
),
|
|
87
104
|
}));
|
|
@@ -97,7 +114,6 @@ const BedTagAdministrationTable: React.FC = () => {
|
|
|
97
114
|
</>
|
|
98
115
|
);
|
|
99
116
|
}
|
|
100
|
-
|
|
101
117
|
if (isError) {
|
|
102
118
|
return (
|
|
103
119
|
<>
|
|
@@ -108,7 +124,6 @@ const BedTagAdministrationTable: React.FC = () => {
|
|
|
108
124
|
</>
|
|
109
125
|
);
|
|
110
126
|
}
|
|
111
|
-
|
|
112
127
|
return (
|
|
113
128
|
<>
|
|
114
129
|
<Header route="Bed Tag" />
|
|
@@ -129,6 +144,14 @@ const BedTagAdministrationTable: React.FC = () => {
|
|
|
129
144
|
mutate={mutate}
|
|
130
145
|
/>
|
|
131
146
|
) : null}
|
|
147
|
+
{showDeleteBedTagsModal ? (
|
|
148
|
+
<DeleteBedTag
|
|
149
|
+
onModalChange={setDeleteBedTagsModal}
|
|
150
|
+
showModal={showDeleteBedTagsModal}
|
|
151
|
+
editData={editData}
|
|
152
|
+
mutate={mutate}
|
|
153
|
+
/>
|
|
154
|
+
) : null}
|
|
132
155
|
<CardHeader title={headerTitle}>
|
|
133
156
|
<span className={styles.backgroundDataFetchingIndicator}>
|
|
134
157
|
<span>{validate ? <InlineLoading /> : null}</span>
|
|
@@ -204,7 +227,7 @@ const BedTagAdministrationTable: React.FC = () => {
|
|
|
204
227
|
totalItems={bedTypeData.length}
|
|
205
228
|
onChange={({ page, pageSize }) => {
|
|
206
229
|
setCurrentPage(page);
|
|
207
|
-
|
|
230
|
+
pageSize(pageSize);
|
|
208
231
|
}}
|
|
209
232
|
/>
|
|
210
233
|
</TableContainer>
|
|
@@ -19,7 +19,21 @@ import { Location } from "@openmrs/esm-framework";
|
|
|
19
19
|
import type { BedTagData } from "../../types";
|
|
20
20
|
|
|
21
21
|
const BedTagAdministrationSchema = z.object({
|
|
22
|
-
name: z
|
|
22
|
+
name: z
|
|
23
|
+
.string()
|
|
24
|
+
.max(255)
|
|
25
|
+
.refine(
|
|
26
|
+
(value) => {
|
|
27
|
+
return (
|
|
28
|
+
typeof value === "string" &&
|
|
29
|
+
value.trim().length > 0 &&
|
|
30
|
+
!/\d/.test(value)
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
message: "Bed tag must not contain numbers",
|
|
35
|
+
}
|
|
36
|
+
),
|
|
23
37
|
});
|
|
24
38
|
|
|
25
39
|
interface BedTagAdministrationFormProps {
|
|
@@ -88,6 +102,7 @@ const BedTagsAdministrationForm: React.FC<BedTagAdministrationFormProps> = ({
|
|
|
88
102
|
<Controller
|
|
89
103
|
name="name"
|
|
90
104
|
control={control}
|
|
105
|
+
rules={{ required: true }}
|
|
91
106
|
render={({ field, fieldState }) => (
|
|
92
107
|
<>
|
|
93
108
|
<TextInput
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import { showToast, showNotification } from "@openmrs/esm-framework";
|
|
4
|
+
import { deleteBedTag, useBedTag } from "../../summary/summary.resource";
|
|
5
|
+
import { BedTagDataAdministration } from "../../bed-administration/bed-administration-types";
|
|
6
|
+
import { BedTagData, Mutator } from "../../types";
|
|
7
|
+
import DeleteBedTagsForm from "./delete-bedForm.component";
|
|
8
|
+
|
|
9
|
+
interface DeleteBedTagFormProps {
|
|
10
|
+
showModal: boolean;
|
|
11
|
+
onModalChange: (showModal: boolean) => void;
|
|
12
|
+
editData: BedTagData;
|
|
13
|
+
mutate: Mutator;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const DeleteBedTag: React.FC<DeleteBedTagFormProps> = ({
|
|
17
|
+
showModal,
|
|
18
|
+
onModalChange,
|
|
19
|
+
editData,
|
|
20
|
+
mutate,
|
|
21
|
+
}) => {
|
|
22
|
+
const { t } = useTranslation();
|
|
23
|
+
const headerTitle = t("deleteBedTag", "Delete bed Tag");
|
|
24
|
+
const handleDeleteQuestion = useCallback(
|
|
25
|
+
(formData: BedTagDataAdministration) => {
|
|
26
|
+
const bedUuid = editData.uuid;
|
|
27
|
+
const { name } = formData;
|
|
28
|
+
deleteBedTag(bedUuid)
|
|
29
|
+
.then(() => {
|
|
30
|
+
showToast({
|
|
31
|
+
title: t("bedTagDeleted", "Bed Tag Deleted"),
|
|
32
|
+
kind: "success",
|
|
33
|
+
critical: true,
|
|
34
|
+
description:
|
|
35
|
+
name +
|
|
36
|
+
" " +
|
|
37
|
+
t("bedTagDeleteSuccessMessage", "was deleted successfully."),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
mutate();
|
|
41
|
+
onModalChange(false);
|
|
42
|
+
})
|
|
43
|
+
.catch((error) => {
|
|
44
|
+
showNotification({
|
|
45
|
+
title: t("errorDeletingBedTag", "Error deleting bed tag"),
|
|
46
|
+
kind: "error",
|
|
47
|
+
critical: true,
|
|
48
|
+
description: error?.message,
|
|
49
|
+
});
|
|
50
|
+
onModalChange(false);
|
|
51
|
+
});
|
|
52
|
+
onModalChange(false);
|
|
53
|
+
},
|
|
54
|
+
[onModalChange, mutate, editData, t]
|
|
55
|
+
);
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<DeleteBedTagsForm
|
|
59
|
+
onModalChange={onModalChange}
|
|
60
|
+
showModal={showModal}
|
|
61
|
+
handleDeleteBedTag={handleDeleteQuestion}
|
|
62
|
+
headerTitle={headerTitle}
|
|
63
|
+
initialData={editData}
|
|
64
|
+
/>
|
|
65
|
+
</>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default DeleteBedTag;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { useForm } from "react-hook-form";
|
|
4
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
5
|
+
import styles from "../../bed-administration/bed-administration-table.scss";
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
ComposedModal,
|
|
9
|
+
ModalBody,
|
|
10
|
+
ModalFooter,
|
|
11
|
+
ModalHeader,
|
|
12
|
+
Stack,
|
|
13
|
+
InlineNotification,
|
|
14
|
+
} from "@carbon/react";
|
|
15
|
+
import { useTranslation } from "react-i18next";
|
|
16
|
+
interface BedTagData {
|
|
17
|
+
name: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const BedTagAdministrationSchema = z.object({
|
|
21
|
+
name: z.string().max(255),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
interface BedTagAdministrationFormProps {
|
|
25
|
+
showModal: boolean;
|
|
26
|
+
onModalChange: (showModal: boolean) => void;
|
|
27
|
+
handleDeleteBedTag?: (formData: BedTagData) => void;
|
|
28
|
+
headerTitle: string;
|
|
29
|
+
initialData: BedTagData;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface ErrorType {
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const DeleteBedTagsForm: React.FC<BedTagAdministrationFormProps> = ({
|
|
37
|
+
showModal,
|
|
38
|
+
onModalChange,
|
|
39
|
+
handleDeleteBedTag,
|
|
40
|
+
headerTitle,
|
|
41
|
+
initialData,
|
|
42
|
+
}) => {
|
|
43
|
+
const { t } = useTranslation();
|
|
44
|
+
|
|
45
|
+
const [showErrorNotification, setShowErrorNotification] = useState(false);
|
|
46
|
+
const [formStateError, setFormStateError] = useState("");
|
|
47
|
+
|
|
48
|
+
const { handleSubmit } = useForm<BedTagData>({
|
|
49
|
+
mode: "all",
|
|
50
|
+
resolver: zodResolver(BedTagAdministrationSchema),
|
|
51
|
+
defaultValues: {
|
|
52
|
+
name: initialData.name || "",
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const onSubmit = (formData: BedTagData) => {
|
|
57
|
+
const result = BedTagAdministrationSchema.safeParse(formData);
|
|
58
|
+
if (result.success) {
|
|
59
|
+
setShowErrorNotification(false);
|
|
60
|
+
if (handleDeleteBedTag) {
|
|
61
|
+
handleDeleteBedTag(formData);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const onError = (error: { [key: string]: ErrorType }) => {
|
|
67
|
+
setFormStateError(Object.entries(error)[0][1].message);
|
|
68
|
+
setShowErrorNotification(true);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<ComposedModal
|
|
73
|
+
open={showModal}
|
|
74
|
+
onClose={() => onModalChange(false)}
|
|
75
|
+
preventCloseOnClickOutside
|
|
76
|
+
>
|
|
77
|
+
<ModalHeader title={headerTitle} />
|
|
78
|
+
<form onSubmit={handleSubmit(onSubmit, onError)}>
|
|
79
|
+
<ModalBody hasScrollingContent>
|
|
80
|
+
<Stack gap={3}>
|
|
81
|
+
<ModalBody>Are you sure you want to delete this bed tag?</ModalBody>
|
|
82
|
+
{showErrorNotification && (
|
|
83
|
+
<InlineNotification
|
|
84
|
+
lowContrast
|
|
85
|
+
title={t("error", "Error")}
|
|
86
|
+
style={{ minWidth: "100%", margin: "0rem", padding: "0rem" }}
|
|
87
|
+
role="alert"
|
|
88
|
+
kind="error"
|
|
89
|
+
subtitle={t("pleaseFillField", formStateError) + "."}
|
|
90
|
+
onClose={() => setShowErrorNotification(false)}
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
93
|
+
</Stack>
|
|
94
|
+
</ModalBody>
|
|
95
|
+
<ModalFooter>
|
|
96
|
+
<Button onClick={() => onModalChange(false)} kind="secondary">
|
|
97
|
+
{t("cancel", "Cancel")}
|
|
98
|
+
</Button>
|
|
99
|
+
<Button type="submit" className={styles.deleteButton}>
|
|
100
|
+
<span>{t("delete", "Delete")}</span>
|
|
101
|
+
</Button>
|
|
102
|
+
</ModalFooter>
|
|
103
|
+
</form>
|
|
104
|
+
</ComposedModal>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export default DeleteBedTagsForm;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from "react";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import { showToast, showNotification
|
|
3
|
+
import { showToast, showNotification } from "@openmrs/esm-framework";
|
|
4
4
|
|
|
5
5
|
import { editBedTag, useBedTag } from "../../summary/summary.resource";
|
|
6
6
|
import { BedTagDataAdministration } from "../../bed-administration/bed-administration-types";
|
|
@@ -20,11 +20,38 @@ import { Location } from "@openmrs/esm-framework";
|
|
|
20
20
|
import type { BedType, BedTypeData } from "../../types";
|
|
21
21
|
|
|
22
22
|
const BedTypeAdministrationSchema = z.object({
|
|
23
|
-
name: z
|
|
24
|
-
|
|
23
|
+
name: z
|
|
24
|
+
.string()
|
|
25
|
+
.max(255)
|
|
26
|
+
.refine(
|
|
27
|
+
(value) => {
|
|
28
|
+
return (
|
|
29
|
+
typeof value === "string" &&
|
|
30
|
+
value.trim().length > 0 &&
|
|
31
|
+
!/\d/.test(value)
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
message: "Bed Name must be a non-empty string without numbers",
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
displayName: z
|
|
39
|
+
.string()
|
|
40
|
+
.max(255)
|
|
41
|
+
.refine(
|
|
42
|
+
(value) => {
|
|
43
|
+
return (
|
|
44
|
+
typeof value === "string" &&
|
|
45
|
+
value.trim().length > 0 &&
|
|
46
|
+
!/\d/.test(value)
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
message: "Display name must be a non-empty string without numbers",
|
|
51
|
+
}
|
|
52
|
+
),
|
|
25
53
|
description: z.string().max(255),
|
|
26
54
|
});
|
|
27
|
-
|
|
28
55
|
interface BedAdministrationFormProps {
|
|
29
56
|
showModal: boolean;
|
|
30
57
|
onModalChange: (showModal: boolean) => void;
|
|
@@ -92,6 +119,7 @@ const BedTypeAdministrationForm: React.FC<BedAdministrationFormProps> = ({
|
|
|
92
119
|
<Controller
|
|
93
120
|
name="name"
|
|
94
121
|
control={control}
|
|
122
|
+
rules={{ required: true }}
|
|
95
123
|
render={({ field, fieldState }) => (
|
|
96
124
|
<>
|
|
97
125
|
<TextInput
|
|
@@ -109,6 +137,7 @@ const BedTypeAdministrationForm: React.FC<BedAdministrationFormProps> = ({
|
|
|
109
137
|
<Controller
|
|
110
138
|
name="displayName"
|
|
111
139
|
control={control}
|
|
140
|
+
rules={{ required: true }}
|
|
112
141
|
render={({ field, fieldState }) => (
|
|
113
142
|
<>
|
|
114
143
|
<TextInput
|
|
@@ -126,6 +155,7 @@ const BedTypeAdministrationForm: React.FC<BedAdministrationFormProps> = ({
|
|
|
126
155
|
<Controller
|
|
127
156
|
name="description"
|
|
128
157
|
control={control}
|
|
158
|
+
rules={{ required: true }}
|
|
129
159
|
render={({ field, fieldState }) => (
|
|
130
160
|
<>
|
|
131
161
|
<TextArea
|