@cc-openmrs/cc-esm-active-prescriptions 1.0.53 → 1.0.55
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/11.js +1 -0
- package/dist/353.js +1 -1
- package/dist/499.js +1 -1
- package/dist/840.js +1 -1
- package/dist/968.js +2 -0
- package/dist/{934.js.LICENSE.txt → 968.js.LICENSE.txt} +10 -0
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +10 -0
- package/dist/openmrs-esm-template-app.js +1 -1
- package/dist/openmrs-esm-template-app.js.buildmanifest.json +52 -52
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/prescription-1.pdf +0 -0
- package/src/root.component.tsx +256 -18
- package/src/root.scss +79 -6
- package/dist/217.js +0 -1
- package/dist/934.js +0 -2
package/dist/main.js.LICENSE.txt
CHANGED
|
@@ -34,6 +34,16 @@
|
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* @license React
|
|
39
|
+
* react-is.production.min.js
|
|
40
|
+
*
|
|
41
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the MIT license found in the
|
|
44
|
+
* LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/
|
|
46
|
+
|
|
37
47
|
/**
|
|
38
48
|
* @license React
|
|
39
49
|
* react-jsx-runtime.production.min.js
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _cc_openmrs_cc_esm_active_prescriptions;(()=>{"use strict";var e,r,t,n,o,a,i,s,l,c,u,f,p,d,h,v,m,g,b,y,_,w={6487(e,r,t){var n={"./start":()=>Promise.all([t.e(961),t.e(478),t.e(
|
|
1
|
+
var _cc_openmrs_cc_esm_active_prescriptions;(()=>{"use strict";var e,r,t,n,o,a,i,s,l,c,u,f,p,d,h,v,m,g,b,y,_,w={6487(e,r,t){var n={"./start":()=>Promise.all([t.e(961),t.e(478),t.e(968),t.e(72),t.e(263),t.e(499)]).then(()=>()=>t(2499))},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})}},S={};function j(e){var r=S[e];if(void 0!==r)return r.exports;var t=S[e]={id:e,exports:{}};return w[e].call(t.exports,t,t.exports,j),t.exports}j.m=w,j.c=S,j.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return j.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,j.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);j.r(o);var a={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;("object"==typeof i||"function"==typeof i)&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(e=>a[e]=()=>t[e]);return a.default=()=>t,j.d(o,a),o},j.d=(e,r)=>{for(var t in r)j.o(r,t)&&!j.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},j.f={},j.e=e=>Promise.all(Object.keys(j.f).reduce((r,t)=>(j.f[t](e,r),r),[])),j.u=e=>e+".js",j.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@cc-openmrs/cc-esm-active-prescriptions:",j.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var i,s;if(void 0!==o)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==n+o){i=u;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",j.nc&&i.setAttribute("nonce",j.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var f=(r,n)=>{i.onerror=i.onload=null,clearTimeout(p);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(n)),r)return r(n)},p=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)}},j.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{j.S={};var e={},r={};j.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];j.o(j.S,t)||(j.S[t]={});var a=j.S[t],i="@cc-openmrs/cc-esm-active-prescriptions",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","8.0.0",()=>Promise.all([j.e(961),j.e(478),j.e(968),j.e(840),j.e(72),j.e(263)]).then(()=>()=>j(6840))),s("dayjs","1.11.20",()=>j.e(353).then(()=>()=>j(9115))),s("react-i18next","16.5.8",()=>Promise.all([j.e(478),j.e(311),j.e(72)]).then(()=>()=>j(3311))),s("react-router-dom","6.30.3",()=>Promise.all([j.e(961),j.e(282),j.e(72)]).then(()=>()=>j(282))),s("react","18.3.1",()=>j.e(540).then(()=>()=>j(6540))),s("rxjs","6.6.7",()=>j.e(184).then(()=>()=>j(3184)))),e[t]=l.length?Promise.all(l).then(()=>e[t]=1):1}}})(),(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var r=globalThis.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),j.p=e})(),o=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},a=(e,r)=>{e=o(e),r=o(r);for(var t=0;;){if(t>=e.length)return t<r.length&&"u"!=(typeof r[t])[0];var n=e[t],a=(typeof n)[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&&n!=i)return n<i;t++}},i=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 a=[];for(o=1;o<e.length;o++){var s=e[o];a.push(0===s?"not("+l()+")":1===s?"("+l()+" || "+l()+")":2===s?a.pop()+" "+a.pop():i(s))}return l();function l(){return a.pop().replace(/^\((.+)\)$/,"$1")}},s=(e,r)=>{if(0 in e){r=o(r);var t=e[0],n=t<0;n&&(t=-t-1);for(var a=0,i=1,l=!0;;i++,a++){var c,u,f=i<e.length?(typeof e[i])[0]:"";if(a>=r.length||"o"==(u=(typeof(c=r[a]))[0]))return!l||("u"==f?i>t&&!n:""==f!=n);if("u"==u){if(!l||"u"!=f)return!1}else if(l)if(f==u)if(i<=t){if(c!=e[i])return!1}else{if(n?c>e[i]:c<e[i])return!1;c!=e[i]&&(l=!1)}else if("s"!=f&&"n"!=f){if(n||i<=t)return!1;l=!1,i--}else{if(i<=t||u<f!=n)return!1;l=!1}else"s"!=f&&"n"!=f&&(l=!1,i--)}}var p=[],d=p.pop.bind(p);for(a=1;a<e.length;a++){var h=e[a];p.push(1==h?d()|d():2==h?d()&d():h?s(h,r):!d())}return!!d()},l=(e,r)=>e&&j.o(e,r),c=e=>(e.loaded=1,e.get()),u=e=>Object.keys(e).reduce((r,t)=>(e[t].eager&&(r[t]=e[t]),r),{}),f=(e,r,t)=>{var n=t?u(e[r]):e[r];return Object.keys(n).reduce((e,r)=>!e||!n[e].loaded&&a(e,r)?r:e,0)},p=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+i(n)+")",d=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},v=(e,r,t)=>t?t():((e,r)=>d("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),m=(e=>function(r,t,n,o,a){var i=j.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,j.S[r],t,!1,o,a)):e(r,j.S[r],t,n,o,a)})((e,r,t,n,o,a)=>{if(!l(r,t))return v(e,t,a);var i=f(r,t,n);return s(o,i)||h(p(r,t,i,o)),c(r[t][i])}),g={},b={6072:()=>m("default","react",!1,[1,18],()=>j.e(540).then(()=>()=>j(6540))),231:()=>m("default","dayjs",!1,[1,1],()=>j.e(353).then(()=>()=>j(9115))),2076:()=>m("default","react-i18next",!1,[1,16],()=>j.e(311).then(()=>()=>j(3311))),3083:()=>m("default","rxjs",!1,[1,6],()=>j.e(184).then(()=>()=>j(3184))),5987:()=>m("default","@openmrs/esm-framework",!1,[0],()=>j.e(840).then(()=>()=>j(6840))),7114:()=>m("default","react-router-dom",!1,[1,6],()=>j.e(282).then(()=>()=>j(282)))},y={72:[6072],263:[231,2076,3083,5987,7114]},_={},j.f.consumes=(e,r)=>{j.o(y,e)&&y[e].forEach(e=>{if(j.o(g,e))return r.push(g[e]);if(!_[e]){var t=r=>{g[e]=0,j.m[e]=t=>{delete j.c[e],t.exports=r()}};_[e]=!0;var n=r=>{delete g[e],j.m[e]=t=>{throw delete j.c[e],r}};try{var o=b[e]();o.then?r.push(g[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}})},(()=>{var e={338:0};j.f.j=(r,t)=>{var n=j.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(263|72)$/.test(r))e[r]=0;else{var o=new Promise((t,o)=>n=e[r]=[t,o]);t.push(n[2]=o);var a=j.p+j.u(r),i=new Error;j.l(a,t=>{if(j.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)j.o(i,n)&&(j.m[n]=i[n]);s&&s(j)}for(r&&r(t);l<a.length;l++)o=a[l],j.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),j.nc=void 0;var O=j(6487);_cc_openmrs_cc_esm_active_prescriptions=O})();
|
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"chunks": [
|
|
3
|
+
{
|
|
4
|
+
"rendered": true,
|
|
5
|
+
"initial": false,
|
|
6
|
+
"entry": false,
|
|
7
|
+
"recorded": false,
|
|
8
|
+
"size": 61649,
|
|
9
|
+
"sizes": {
|
|
10
|
+
"javascript": 61649
|
|
11
|
+
},
|
|
12
|
+
"names": [],
|
|
13
|
+
"idHints": [],
|
|
14
|
+
"runtime": [
|
|
15
|
+
"@cc-openmrs/cc-esm-active-prescriptions",
|
|
16
|
+
"main"
|
|
17
|
+
],
|
|
18
|
+
"files": [
|
|
19
|
+
"11.js"
|
|
20
|
+
],
|
|
21
|
+
"auxiliaryFiles": [
|
|
22
|
+
"11.js.map"
|
|
23
|
+
],
|
|
24
|
+
"hash": "add31f0c3fc094bc",
|
|
25
|
+
"childrenByOrder": {}
|
|
26
|
+
},
|
|
3
27
|
{
|
|
4
28
|
"rendered": true,
|
|
5
29
|
"initial": false,
|
|
@@ -114,30 +138,6 @@
|
|
|
114
138
|
"hash": "9c3d01c936b93924",
|
|
115
139
|
"childrenByOrder": {}
|
|
116
140
|
},
|
|
117
|
-
{
|
|
118
|
-
"rendered": true,
|
|
119
|
-
"initial": false,
|
|
120
|
-
"entry": false,
|
|
121
|
-
"recorded": false,
|
|
122
|
-
"size": 137633,
|
|
123
|
-
"sizes": {
|
|
124
|
-
"javascript": 137633
|
|
125
|
-
},
|
|
126
|
-
"names": [],
|
|
127
|
-
"idHints": [],
|
|
128
|
-
"runtime": [
|
|
129
|
-
"@cc-openmrs/cc-esm-active-prescriptions",
|
|
130
|
-
"main"
|
|
131
|
-
],
|
|
132
|
-
"files": [
|
|
133
|
-
"217.js"
|
|
134
|
-
],
|
|
135
|
-
"auxiliaryFiles": [
|
|
136
|
-
"217.js.map"
|
|
137
|
-
],
|
|
138
|
-
"hash": "a6f18ae3cdb8e748",
|
|
139
|
-
"childrenByOrder": {}
|
|
140
|
-
},
|
|
141
141
|
{
|
|
142
142
|
"rendered": false,
|
|
143
143
|
"initial": false,
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
],
|
|
157
157
|
"files": [],
|
|
158
158
|
"auxiliaryFiles": [],
|
|
159
|
-
"hash": "
|
|
159
|
+
"hash": "f18eddf78bb62bde",
|
|
160
160
|
"childrenByOrder": {}
|
|
161
161
|
},
|
|
162
162
|
{
|
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"auxiliaryFiles": [
|
|
306
306
|
"openmrs-esm-template-app.js.map"
|
|
307
307
|
],
|
|
308
|
-
"hash": "
|
|
308
|
+
"hash": "19014c38679bd630",
|
|
309
309
|
"childrenByOrder": {}
|
|
310
310
|
},
|
|
311
311
|
{
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
"auxiliaryFiles": [
|
|
330
330
|
"353.js.map"
|
|
331
331
|
],
|
|
332
|
-
"hash": "
|
|
332
|
+
"hash": "6d9002043b446a48",
|
|
333
333
|
"childrenByOrder": {}
|
|
334
334
|
},
|
|
335
335
|
{
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"auxiliaryFiles": [
|
|
380
380
|
"499.js.map"
|
|
381
381
|
],
|
|
382
|
-
"hash": "
|
|
382
|
+
"hash": "096ce8685a946497",
|
|
383
383
|
"childrenByOrder": {}
|
|
384
384
|
},
|
|
385
385
|
{
|
|
@@ -479,10 +479,10 @@
|
|
|
479
479
|
"initial": true,
|
|
480
480
|
"entry": true,
|
|
481
481
|
"recorded": false,
|
|
482
|
-
"size":
|
|
482
|
+
"size": 6932099,
|
|
483
483
|
"sizes": {
|
|
484
484
|
"consume-shared": 252,
|
|
485
|
-
"javascript":
|
|
485
|
+
"javascript": 6911016,
|
|
486
486
|
"share-init": 252,
|
|
487
487
|
"runtime": 20579
|
|
488
488
|
},
|
|
@@ -499,7 +499,7 @@
|
|
|
499
499
|
"auxiliaryFiles": [
|
|
500
500
|
"main.js.map"
|
|
501
501
|
],
|
|
502
|
-
"hash": "
|
|
502
|
+
"hash": "b928bde2fb58cae4",
|
|
503
503
|
"childrenByOrder": {}
|
|
504
504
|
},
|
|
505
505
|
{
|
|
@@ -526,7 +526,7 @@
|
|
|
526
526
|
"auxiliaryFiles": [
|
|
527
527
|
"840.js.map"
|
|
528
528
|
],
|
|
529
|
-
"hash": "
|
|
529
|
+
"hash": "31524ae59d310e8c",
|
|
530
530
|
"childrenByOrder": {}
|
|
531
531
|
},
|
|
532
532
|
{
|
|
@@ -535,9 +535,9 @@
|
|
|
535
535
|
"entry": false,
|
|
536
536
|
"recorded": false,
|
|
537
537
|
"reason": "split chunk (cache group: defaultVendors)",
|
|
538
|
-
"size":
|
|
538
|
+
"size": 137481,
|
|
539
539
|
"sizes": {
|
|
540
|
-
"javascript":
|
|
540
|
+
"javascript": 137481
|
|
541
541
|
},
|
|
542
542
|
"names": [],
|
|
543
543
|
"idHints": [
|
|
@@ -548,12 +548,12 @@
|
|
|
548
548
|
"main"
|
|
549
549
|
],
|
|
550
550
|
"files": [
|
|
551
|
-
"
|
|
551
|
+
"961.js"
|
|
552
552
|
],
|
|
553
553
|
"auxiliaryFiles": [
|
|
554
|
-
"
|
|
554
|
+
"961.js.map"
|
|
555
555
|
],
|
|
556
|
-
"hash": "
|
|
556
|
+
"hash": "d585318c5384499b",
|
|
557
557
|
"childrenByOrder": {}
|
|
558
558
|
},
|
|
559
559
|
{
|
|
@@ -561,26 +561,23 @@
|
|
|
561
561
|
"initial": false,
|
|
562
562
|
"entry": false,
|
|
563
563
|
"recorded": false,
|
|
564
|
-
"
|
|
565
|
-
"size": 137481,
|
|
564
|
+
"size": 6209,
|
|
566
565
|
"sizes": {
|
|
567
|
-
"javascript":
|
|
566
|
+
"javascript": 6209
|
|
568
567
|
},
|
|
569
568
|
"names": [],
|
|
570
|
-
"idHints": [
|
|
571
|
-
"vendors"
|
|
572
|
-
],
|
|
569
|
+
"idHints": [],
|
|
573
570
|
"runtime": [
|
|
574
571
|
"@cc-openmrs/cc-esm-active-prescriptions",
|
|
575
572
|
"main"
|
|
576
573
|
],
|
|
577
574
|
"files": [
|
|
578
|
-
"
|
|
575
|
+
"966.js"
|
|
579
576
|
],
|
|
580
577
|
"auxiliaryFiles": [
|
|
581
|
-
"
|
|
578
|
+
"966.js.map"
|
|
582
579
|
],
|
|
583
|
-
"hash": "
|
|
580
|
+
"hash": "c9ff7f900e94bea7",
|
|
584
581
|
"childrenByOrder": {}
|
|
585
582
|
},
|
|
586
583
|
{
|
|
@@ -588,23 +585,26 @@
|
|
|
588
585
|
"initial": false,
|
|
589
586
|
"entry": false,
|
|
590
587
|
"recorded": false,
|
|
591
|
-
"
|
|
588
|
+
"reason": "split chunk (cache group: defaultVendors)",
|
|
589
|
+
"size": 6684135,
|
|
592
590
|
"sizes": {
|
|
593
|
-
"javascript":
|
|
591
|
+
"javascript": 6684135
|
|
594
592
|
},
|
|
595
593
|
"names": [],
|
|
596
|
-
"idHints": [
|
|
594
|
+
"idHints": [
|
|
595
|
+
"vendors"
|
|
596
|
+
],
|
|
597
597
|
"runtime": [
|
|
598
598
|
"@cc-openmrs/cc-esm-active-prescriptions",
|
|
599
599
|
"main"
|
|
600
600
|
],
|
|
601
601
|
"files": [
|
|
602
|
-
"
|
|
602
|
+
"968.js"
|
|
603
603
|
],
|
|
604
604
|
"auxiliaryFiles": [
|
|
605
|
-
"
|
|
605
|
+
"968.js.map"
|
|
606
606
|
],
|
|
607
|
-
"hash": "
|
|
607
|
+
"hash": "3b7335b17857d893",
|
|
608
608
|
"childrenByOrder": {}
|
|
609
609
|
}
|
|
610
610
|
]
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"Red box","component":"redBox","slot":"Boxes"},{"name":"Blue box","component":"blueBox","slot":"Boxes"},{"name":"Brand box","component":"blueBox","slot":"Boxes"},{"name":"prescriptions-action-menu","component":"prescriptionsActionButton","slot":"action-menu-patient-chart-items-slot"}],"workspaces":[{"name":"active-prescriptions","title":"activePrescriptionsWorkspaceTitle","component":"root","type":"active-prescriptions","canHide":false,"width":"wider"}],"version":"1.0.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"Red box","component":"redBox","slot":"Boxes"},{"name":"Blue box","component":"blueBox","slot":"Boxes"},{"name":"Brand box","component":"blueBox","slot":"Boxes"},{"name":"prescriptions-action-menu","component":"prescriptionsActionButton","slot":"action-menu-patient-chart-items-slot"}],"workspaces":[{"name":"active-prescriptions","title":"activePrescriptionsWorkspaceTitle","component":"root","type":"active-prescriptions","canHide":false,"width":"wider"}],"version":"1.0.55"}
|
package/package.json
CHANGED
|
Binary file
|
package/src/root.component.tsx
CHANGED
|
@@ -8,30 +8,268 @@
|
|
|
8
8
|
* https://openmrs.github.io/openmrs-esm-core/#/main/config
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import React from 'react';
|
|
11
|
+
import React, { useMemo, useState } from 'react';
|
|
12
|
+
import { PrescriptionService, PrescriptionPayload } from './prescriptions.service';
|
|
13
|
+
import {
|
|
14
|
+
Checkbox,
|
|
15
|
+
ComboBox,
|
|
16
|
+
InlineLoading,
|
|
17
|
+
InlineNotification,
|
|
18
|
+
Tab,
|
|
19
|
+
TabList,
|
|
20
|
+
TabPanel,
|
|
21
|
+
TabPanels,
|
|
22
|
+
Tabs,
|
|
23
|
+
TextInput,
|
|
24
|
+
} from '@carbon/react';
|
|
12
25
|
import { useTranslation } from 'react-i18next';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import PatientGetter from './patient-getter/patient-getter.component';
|
|
16
|
-
import Resources from './resources/resources.component';
|
|
26
|
+
import { useLocations, type Location } from '@openmrs/esm-framework';
|
|
27
|
+
import { usePatientOrders } from './prescriptions-orders/usePatientOrders';
|
|
17
28
|
import styles from './root.scss';
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
interface RootProps {
|
|
31
|
+
patientUuid?: string;
|
|
32
|
+
patient?: { uuid: string }; // Alguns workspaces passam assim
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const Root: React.FC<RootProps> = (props) => {
|
|
36
|
+
console.log('Root props:', props); // 👈 ADICIONE para debug
|
|
37
|
+
|
|
38
|
+
// Tenta pegar patientUuid de diferentes formas
|
|
39
|
+
const patientUuid = props.patientUuid || props.patient?.uuid;
|
|
40
|
+
|
|
20
41
|
const { t } = useTranslation();
|
|
42
|
+
if (!patientUuid) {
|
|
43
|
+
return (
|
|
44
|
+
<InlineNotification
|
|
45
|
+
lowContrast
|
|
46
|
+
kind="warning"
|
|
47
|
+
title={t('ordersMissingPatientTitle', 'Select a patient to continue')}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const [activeTab, setActiveTab] = useState<'new' | 'past'>('new');
|
|
53
|
+
const [selectedLocation, setSelectedLocation] = useState<Location | null>(null);
|
|
54
|
+
const [policyNumber, setPolicyNumber] = useState('');
|
|
55
|
+
const [selectedOrders, setSelectedOrders] = useState<Set<string>>(new Set());
|
|
56
|
+
const [digitallySigned, setDigitallySigned] = useState(false);
|
|
57
|
+
const [printRequested, setPrintRequested] = useState(false);
|
|
58
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
59
|
+
const locations = useLocations();
|
|
60
|
+
const { orders, isLoading, error } = usePatientOrders(patientUuid);
|
|
61
|
+
|
|
62
|
+
const locationItems = useMemo(() => locations ?? [], [locations]);
|
|
63
|
+
const selectedOrdersLabel =
|
|
64
|
+
selectedOrders.size > 0
|
|
65
|
+
? t('selectedOrdersCount', {
|
|
66
|
+
count: selectedOrders.size,
|
|
67
|
+
})
|
|
68
|
+
: null;
|
|
69
|
+
|
|
70
|
+
const toggleOrderSelection = (orderUuid: string) => {
|
|
71
|
+
setSelectedOrders((prev) => {
|
|
72
|
+
const updated = new Set(prev);
|
|
73
|
+
if (updated.has(orderUuid)) {
|
|
74
|
+
updated.delete(orderUuid);
|
|
75
|
+
} else {
|
|
76
|
+
updated.add(orderUuid);
|
|
77
|
+
}
|
|
78
|
+
return updated;
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const renderOrdersSection = () => {
|
|
83
|
+
if (!patientUuid) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (error) {
|
|
88
|
+
return (
|
|
89
|
+
<InlineNotification
|
|
90
|
+
lowContrast
|
|
91
|
+
kind="error"
|
|
92
|
+
title={t('ordersErrorTitle', 'Unable to load orders')}
|
|
93
|
+
subtitle={t('ordersErrorSubtitle', 'Try again or refresh the patient chart.')}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (isLoading) {
|
|
99
|
+
return <InlineLoading description={`${t('loading', 'Loading')}...`} />;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (!orders.length) {
|
|
103
|
+
return (
|
|
104
|
+
<InlineNotification
|
|
105
|
+
lowContrast
|
|
106
|
+
kind="info"
|
|
107
|
+
title={t('ordersEmptyState', 'There are no orders for this patient yet.')}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<>
|
|
114
|
+
<div className={styles.ordersList} role="group" aria-label={t('visitTypeHeading', 'Visit type')}>
|
|
115
|
+
{orders.map((order) => (
|
|
116
|
+
<Checkbox
|
|
117
|
+
key={order.uuid}
|
|
118
|
+
id={`order-${order.uuid}`}
|
|
119
|
+
labelText={
|
|
120
|
+
<span className={styles.orderLabel}>
|
|
121
|
+
<span className={styles.orderName}>{order.conceptName}</span>
|
|
122
|
+
{order.display && <span className={styles.orderMeta}>{order.display}</span>}
|
|
123
|
+
{!order.display && order.orderNumber && <span className={styles.orderMeta}>{order.orderNumber}</span>}
|
|
124
|
+
</span>
|
|
125
|
+
}
|
|
126
|
+
checked={selectedOrders.has(order.uuid)}
|
|
127
|
+
onChange={() => toggleOrderSelection(order.uuid)}
|
|
128
|
+
/>
|
|
129
|
+
))}
|
|
130
|
+
</div>
|
|
131
|
+
{selectedOrdersLabel ? <p className={styles.selectionSummary}>{selectedOrdersLabel}</p> : null}
|
|
132
|
+
</>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
21
135
|
|
|
22
136
|
return (
|
|
23
|
-
<div className={styles.
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
137
|
+
<div className={styles.workspace}>
|
|
138
|
+
<div className={styles.header}>
|
|
139
|
+
<h2>{t('activePrescriptionsWorkspaceTitle', 'Active prescriptions')}</h2>
|
|
140
|
+
<p className={styles.subtitle}>
|
|
141
|
+
{t(
|
|
142
|
+
'activePrescriptionsHelper',
|
|
143
|
+
'Review the patient context, choose the visit details, and add the matching orders to the prescription.',
|
|
144
|
+
)}
|
|
145
|
+
</p>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<section className={styles.section}>
|
|
149
|
+
<p className={styles.fieldLabel}>{t('visitTimingLabel', 'The visit is')}</p>
|
|
150
|
+
<Tabs
|
|
151
|
+
selectedIndex={activeTab === 'new' ? 0 : 1}
|
|
152
|
+
onChange={({ selectedIndex }) => setActiveTab(selectedIndex === 0 ? 'new' : 'past')}
|
|
153
|
+
>
|
|
154
|
+
<TabList aria-label={t('visitTimingLabel', 'The visit is')}>
|
|
155
|
+
<Tab>{t('visitTimingNew', 'New')}</Tab>
|
|
156
|
+
<Tab>{t('visitTimingPast', 'In the past')}</Tab>
|
|
157
|
+
</TabList>
|
|
158
|
+
<TabPanels>
|
|
159
|
+
<TabPanel className={styles.tabContent}>
|
|
160
|
+
<div className={styles.fieldGroup}>
|
|
161
|
+
<ComboBox
|
|
162
|
+
id="visit-location"
|
|
163
|
+
items={locationItems}
|
|
164
|
+
itemToString={(item) => item?.display ?? ''}
|
|
165
|
+
selectedItem={selectedLocation}
|
|
166
|
+
onChange={({ selectedItem }) => setSelectedLocation((selectedItem as Location) ?? null)}
|
|
167
|
+
placeholder={t('visitLocationPlaceholder', 'Select a location')}
|
|
168
|
+
titleText={t('visitLocationHeading', 'Visit location')}
|
|
169
|
+
helperText={t('visitLocationHelper', 'Select where the visit will take place.')}
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<div className={styles.fieldGroup}>
|
|
174
|
+
<p className={styles.fieldLabel}>{t('visitTypeHeading', 'Visit type')}</p>
|
|
175
|
+
<p className={styles.helperText}>
|
|
176
|
+
{t('visitTypeHelper', 'Select the orders that should be included in this prescription.')}
|
|
177
|
+
</p>
|
|
178
|
+
{renderOrdersSection()}
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<div className={styles.fieldGroup}>
|
|
182
|
+
<TextInput
|
|
183
|
+
id="insurance-policy"
|
|
184
|
+
labelText={t('insurancePolicyNumberLabel', 'Insurance Policy Number (optional)')}
|
|
185
|
+
placeholder={t('insurancePolicyNumberPlaceholder', 'Enter the policy number')}
|
|
186
|
+
value={policyNumber}
|
|
187
|
+
onChange={(event) => setPolicyNumber(event.target.value)}
|
|
188
|
+
/>
|
|
189
|
+
</div>
|
|
190
|
+
<div className={styles.fieldGroup}>
|
|
191
|
+
<Checkbox
|
|
192
|
+
id="sign-prescription-checkbox"
|
|
193
|
+
labelText={t('signPrescriptionLabel', 'Digitally sign the prescription')}
|
|
194
|
+
checked={digitallySigned}
|
|
195
|
+
onChange={() => setDigitallySigned((prev) => !prev)}
|
|
196
|
+
/>
|
|
197
|
+
<Checkbox
|
|
198
|
+
id="print-prescription-checkbox"
|
|
199
|
+
labelText={t('printPrescriptionLabel', 'Print the prescription')}
|
|
200
|
+
checked={printRequested}
|
|
201
|
+
onChange={() => setPrintRequested((prev) => !prev)}
|
|
202
|
+
/>
|
|
203
|
+
</div>
|
|
204
|
+
<div className={styles.fieldGroup} style={{ flexDirection: 'row', gap: '1rem' }}>
|
|
205
|
+
<button
|
|
206
|
+
type="button"
|
|
207
|
+
id="discard-prescription-btn"
|
|
208
|
+
onClick={() => {
|
|
209
|
+
setSelectedLocation(null);
|
|
210
|
+
setPolicyNumber('');
|
|
211
|
+
setSelectedOrders(new Set());
|
|
212
|
+
setDigitallySigned(false);
|
|
213
|
+
setPrintRequested(false);
|
|
214
|
+
}}
|
|
215
|
+
disabled={isSubmitting}
|
|
216
|
+
>
|
|
217
|
+
{t('discardButtonLabel', 'Discard')}
|
|
218
|
+
</button>
|
|
219
|
+
<button
|
|
220
|
+
type="button"
|
|
221
|
+
id="create-prescription-btn"
|
|
222
|
+
onClick={async () => {
|
|
223
|
+
if (!patientUuid || !selectedLocation || selectedOrders.size === 0) return;
|
|
224
|
+
setIsSubmitting(true);
|
|
225
|
+
// TODO: obter dados reais do paciente e do médico
|
|
226
|
+
const payload: PrescriptionPayload = {
|
|
227
|
+
patient: {
|
|
228
|
+
uuid: patientUuid,
|
|
229
|
+
},
|
|
230
|
+
provider: {
|
|
231
|
+
uuid: 'provider-uuid', // Substituir pelo uuid real do médico
|
|
232
|
+
},
|
|
233
|
+
location: {
|
|
234
|
+
uuid: selectedLocation.uuid,
|
|
235
|
+
name: selectedLocation.display,
|
|
236
|
+
},
|
|
237
|
+
policyNumber,
|
|
238
|
+
orderUuids: Array.from(selectedOrders),
|
|
239
|
+
digitallySigned,
|
|
240
|
+
printRequested,
|
|
241
|
+
};
|
|
242
|
+
try {
|
|
243
|
+
await PrescriptionService.createPrescription(payload);
|
|
244
|
+
// Limpar formulário após sucesso
|
|
245
|
+
setSelectedLocation(null);
|
|
246
|
+
setPolicyNumber('');
|
|
247
|
+
setSelectedOrders(new Set());
|
|
248
|
+
setDigitallySigned(false);
|
|
249
|
+
setPrintRequested(false);
|
|
250
|
+
} catch (e) {
|
|
251
|
+
// TODO: tratar erro
|
|
252
|
+
} finally {
|
|
253
|
+
setIsSubmitting(false);
|
|
254
|
+
}
|
|
255
|
+
}}
|
|
256
|
+
disabled={isSubmitting}
|
|
257
|
+
>
|
|
258
|
+
{isSubmitting ? t('loading', 'Loading') : t('createPrescriptionButtonLabel', 'Create Prescription')}
|
|
259
|
+
</button>
|
|
260
|
+
</div>
|
|
261
|
+
</TabPanel>
|
|
262
|
+
<TabPanel className={styles.tabContent}>
|
|
263
|
+
<InlineNotification
|
|
264
|
+
lowContrast
|
|
265
|
+
kind="info"
|
|
266
|
+
title={t('inPastTabPlaceholderTitle', 'Historic prescriptions will be available soon')}
|
|
267
|
+
subtitle={t('inPastTabPlaceholderSubtitle', 'Switch back to the New tab to manage current orders.')}
|
|
268
|
+
/>
|
|
269
|
+
</TabPanel>
|
|
270
|
+
</TabPanels>
|
|
271
|
+
</Tabs>
|
|
272
|
+
</section>
|
|
35
273
|
</div>
|
|
36
274
|
);
|
|
37
275
|
};
|
package/src/root.scss
CHANGED
|
@@ -1,15 +1,88 @@
|
|
|
1
1
|
@use '@carbon/layout';
|
|
2
2
|
@use '@carbon/type';
|
|
3
3
|
|
|
4
|
-
.
|
|
4
|
+
.workspace {
|
|
5
5
|
padding: layout.$spacing-07;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: layout.$spacing-06;
|
|
9
|
+
background-color: var(--cds-layer, #ffffff);
|
|
10
|
+
min-height: 100%;
|
|
6
11
|
}
|
|
7
12
|
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
.header {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: layout.$spacing-03;
|
|
11
17
|
}
|
|
12
18
|
|
|
13
|
-
.
|
|
14
|
-
|
|
19
|
+
.subtitle {
|
|
20
|
+
@include type.type-style('body-01');
|
|
21
|
+
color: var(--cds-text-secondary, #525252);
|
|
22
|
+
margin: 0;
|
|
23
|
+
max-width: 48rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.section {
|
|
27
|
+
background-color: var(--cds-layer-accent, #f4f4f4);
|
|
28
|
+
padding: layout.$spacing-05;
|
|
29
|
+
border-radius: layout.$spacing-02;
|
|
30
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.fieldLabel {
|
|
34
|
+
@include type.type-style('heading-compact-01');
|
|
35
|
+
margin-bottom: layout.$spacing-03;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.tabContent {
|
|
39
|
+
padding: layout.$spacing-05 0 0;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: layout.$spacing-06;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.fieldGroup {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: layout.$spacing-03;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.helperText {
|
|
52
|
+
@include type.type-style('label-01');
|
|
53
|
+
color: var(--cds-text-secondary, #525252);
|
|
54
|
+
margin: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ordersList {
|
|
58
|
+
border: 1px solid var(--cds-border-subtle, #e0e0e0);
|
|
59
|
+
border-radius: layout.$spacing-02;
|
|
60
|
+
padding: layout.$spacing-04;
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: layout.$spacing-03;
|
|
64
|
+
background-color: var(--cds-layer, #ffffff);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.orderLabel {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
align-items: flex-start;
|
|
71
|
+
gap: layout.$spacing-01;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.orderName {
|
|
75
|
+
@include type.type-style('body-compact-01');
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.orderMeta {
|
|
80
|
+
@include type.type-style('label-01');
|
|
81
|
+
color: var(--cds-text-secondary, #525252);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.selectionSummary {
|
|
85
|
+
@include type.type-style('label-01');
|
|
86
|
+
color: var(--cds-text-secondary, #525252);
|
|
87
|
+
margin: layout.$spacing-02 0 0;
|
|
15
88
|
}
|