@epcare/esm-report-builder 0.1.1-pre.39 → 0.1.1-pre.40
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/538.js +1 -0
- package/dist/538.js.map +1 -0
- package/dist/729.js +1 -1
- package/dist/main.js +1 -1
- package/dist/openmrs-esm-report-builder.js.buildmanifest.json +26 -26
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/components/indicators/indicator-search-select.component.tsx +0 -12
- package/src/components/indicators/indicators-page.component.tsx +2 -3
- package/src/components/linelist/builder/column-category-selector.component.tsx +162 -9
- package/src/components/linelist/builder/column-category-selector.scss +148 -3
- package/src/components/linelist/builder/column-debug-panel.component.tsx +197 -0
- package/src/components/linelist/builder/column-debug-panel.scss +141 -0
- package/src/components/linelist/builder/encounter-diagnosis-column-modal.component.tsx +43 -22
- package/src/components/linelist/builder/linelist-builder-workspace.component.tsx +1 -23
- package/src/components/linelist/builder/observation-column-modal.component.tsx +125 -40
- package/src/components/linelist/modals/linelist-report-builder-modal.component.tsx +78 -8
- package/src/components/linelist/pages/linelist-report-editor-page.component.tsx +0 -2
- package/src/components/linelist/shared/json-preview.component.tsx +5 -2
- package/src/components/report-sections/hooks/useSectionEditorState.ts +4 -7
- package/src/components/shared/concept-selector.component.tsx +19 -2
- package/src/hooks/theme/useMambaTables.ts +0 -2
- package/src/types/linelist-types.ts +19 -1
- package/src/utils/config-enhancer.ts +62 -0
- package/dist/378.js +0 -1
- package/dist/378.js.map +0 -1
package/dist/729.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_epcare_esm_report_builder=self.webpackChunk_epcare_esm_report_builder||[]).push([[729],{7729(e,t,r){"use strict";r.r(t),r.d(t,{confirmModal:()=>c,importTranslation:()=>u,reportBuilderAdminLink:()=>o,root:()=>p,startupApp:()=>d});var n=r(2897),i={defaultMapping:{_description:"Defaults used by the report builder.",keyPattern:{_default:"{code}_{age}_{sex}",_description:"Default key pattern for flat values.",_type:n.Type.String},defaultDimensions:{_description:"Default dimension names used in templates.",age:{_default:"age",_type:n.Type.String},sex:{_default:"sex",_type:n.Type.String}}},etlTasks:{_description:"ETL task configuration for data extraction and processing.",tasks:{_default:[],_description:"List of ETL task names to execute. Tasks must exist in OpenMRS task definitions.",_type:n.Type.Array,_elements:{_type:n.Type.String}}}},s="@epcare/esm-report-builder",a={featureName:"report-builder",moduleName:s},o=(0,n.getAsyncLifecycle)(function(){return Promise.all([r.e(283),r.e(656),r.e(705),r.e(710)]).then(r.bind(r,2710))},a),u=r(6738),p=(0,n.getAsyncLifecycle)(function(){return Promise.all([r.e(283),r.e(242),r.e(933),r.e(656),r.e(705),r.e(
|
|
1
|
+
(self.webpackChunk_epcare_esm_report_builder=self.webpackChunk_epcare_esm_report_builder||[]).push([[729],{7729(e,t,r){"use strict";r.r(t),r.d(t,{confirmModal:()=>c,importTranslation:()=>u,reportBuilderAdminLink:()=>o,root:()=>p,startupApp:()=>d});var n=r(2897),i={defaultMapping:{_description:"Defaults used by the report builder.",keyPattern:{_default:"{code}_{age}_{sex}",_description:"Default key pattern for flat values.",_type:n.Type.String},defaultDimensions:{_description:"Default dimension names used in templates.",age:{_default:"age",_type:n.Type.String},sex:{_default:"sex",_type:n.Type.String}}},etlTasks:{_description:"ETL task configuration for data extraction and processing.",tasks:{_default:[],_description:"List of ETL task names to execute. Tasks must exist in OpenMRS task definitions.",_type:n.Type.Array,_elements:{_type:n.Type.String}}}},s="@epcare/esm-report-builder",a={featureName:"report-builder",moduleName:s},o=(0,n.getAsyncLifecycle)(function(){return Promise.all([r.e(283),r.e(656),r.e(705),r.e(710)]).then(r.bind(r,2710))},a),u=r(6738),p=(0,n.getAsyncLifecycle)(function(){return Promise.all([r.e(283),r.e(242),r.e(933),r.e(656),r.e(705),r.e(538)]).then(r.bind(r,2538))},a),c=(0,n.getAsyncLifecycle)(function(){return Promise.all([r.e(283),r.e(656),r.e(705),r.e(764)]).then(r.bind(r,764))},a);function d(){(0,n.defineConfigSchema)(s,i)}},6738(e,t,r){var n={"./en.json":[4300,[300]]};function i(e){try{if(!r.o(n,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=n[e],i=t[0];return r.e(t[1][0]).then(()=>r(i))}i.keys=()=>Object.keys(n),i.id=6738,e.exports=i}}]);
|
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e,r,t,n,o={7729(e,r,t){"use strict";var n=t(2897),o={featureName:"report-builder",moduleName:(n.Type.String,n.Type.String,n.Type.String,n.Type.Array,n.Type.String,"@epcare/esm-report-builder")};(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(283),t.e(656),t.e(705),t.e(710)]).then(t.bind(t,2710))},o),t(6738),(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(283),t.e(242),t.e(933),t.e(656),t.e(705),t.e(
|
|
1
|
+
(()=>{var e,r,t,n,o={7729(e,r,t){"use strict";var n=t(2897),o={featureName:"report-builder",moduleName:(n.Type.String,n.Type.String,n.Type.String,n.Type.Array,n.Type.String,"@epcare/esm-report-builder")};(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(283),t.e(656),t.e(705),t.e(710)]).then(t.bind(t,2710))},o),t(6738),(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(283),t.e(242),t.e(933),t.e(656),t.e(705),t.e(538)]).then(t.bind(t,2538))},o),(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(283),t.e(656),t.e(705),t.e(764)]).then(t.bind(t,764))},o)},6738(e,r,t){var n={"./en.json":[4300,[300]]};function o(e){try{if(!t.o(n,e))return Promise.resolve().then(()=>{var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r})}catch(e){return Promise.reject(e)}var r=n[e],o=r[0];return t.e(r[1][0]).then(()=>t(o))}o.keys=()=>Object.keys(n),o.id=6738,e.exports=o}},a={};function i(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={id:e,exports:{}};return o[e].call(t.exports,t,t.exports,i),t.exports}i.m=o,i.c=a,i.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return i.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.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);i.r(o);var a={};e=e||[null,r({}),r([]),r(r)];for(var u=2&n&&t;("object"==typeof u||"function"==typeof u)&&!~e.indexOf(u);u=r(u))Object.getOwnPropertyNames(u).forEach(e=>a[e]=()=>t[e]);return a.default=()=>t,i.d(o,a),o},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((r,t)=>(i.f[t](e,r),r),[])),i.u=e=>e+".js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@epcare/esm-report-builder:",i.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var u,l;if(void 0!==o)for(var s=document.getElementsByTagName("script"),f=0;f<s.length;f++){var c=s[f];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==n+o){u=c;break}}u||(l=!0,(u=document.createElement("script")).charset="utf-8",i.nc&&u.setAttribute("nonce",i.nc),u.setAttribute("data-webpack",n+o),u.src=e),t[e]=[r];var p=(r,n)=>{u.onerror=u.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(n)),r)return r(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=p.bind(null,u.onerror),u.onload=p.bind(null,u.onload),l&&document.head.appendChild(u)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{i.S={};var e={},r={};i.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];i.o(i.S,t)||(i.S[t]={});var a=i.S[t],u="@epcare/esm-report-builder",l=(e,r,t,n)=>{var o=a[e]=a[e]||{},i=o[r];(!i||!i.loaded&&(!n!=!i.eager?n:u>i.from))&&(o[r]={get:t,from:u,eager:!!n})},s=[];return"default"===t&&(l("@openmrs/esm-framework","9.0.3-pre.4342",()=>Promise.all([i.e(283),i.e(478),i.e(242),i.e(162),i.e(656),i.e(705),i.e(446)]).then(()=>()=>i(2162))),l("react-dom","18.3.1",()=>Promise.all([i.e(961),i.e(656)]).then(()=>()=>i(3342))),l("react-i18next","16.6.6",()=>Promise.all([i.e(478),i.e(311),i.e(656)]).then(()=>()=>i(3311))),l("react","18.3.1",()=>i.e(540).then(()=>()=>i(6540))),l("rxjs","6.6.7",()=>i.e(184).then(()=>()=>i(3184))),l("single-spa","5.9.5",()=>i.e(917).then(()=>()=>i(7917)))),e[t]=s.length?Promise.all(s).then(()=>e[t]=1):1}}})(),(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var r=i.g.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(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e=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},r=e=>{var t=e[0],n="";if(1===e.length)return"*";if(t+.5){n+=0==t?">=":-1==t?"<":1==t?"^":2==t?"~":t>0?"=":"!=";for(var o=1,a=1;a<e.length;a++)o--,n+="u"==(typeof(u=e[a]))[0]?"-":(o>0?".":"")+(o=2,u);return n}var i=[];for(a=1;a<e.length;a++){var u=e[a];i.push(0===u?"not("+l()+")":1===u?"("+l()+" || "+l()+")":2===u?i.pop()+" "+i.pop():r(u))}return l();function l(){return i.pop().replace(/^\((.+)\)$/,"$1")}},t=(r,n)=>{if(0 in r){n=e(n);var o=r[0],a=o<0;a&&(o=-o-1);for(var i=0,u=1,l=!0;;u++,i++){var s,f,c=u<r.length?(typeof r[u])[0]:"";if(i>=n.length||"o"==(f=(typeof(s=n[i]))[0]))return!l||("u"==c?u>o&&!a:""==c!=a);if("u"==f){if(!l||"u"!=c)return!1}else if(l)if(c==f)if(u<=o){if(s!=r[u])return!1}else{if(a?s>r[u]:s<r[u])return!1;s!=r[u]&&(l=!1)}else if("s"!=c&&"n"!=c){if(a||u<=o)return!1;l=!1,u--}else{if(u<=o||f<c!=a)return!1;l=!1}else"s"!=c&&"n"!=c&&(l=!1,u--)}}var p=[],d=p.pop.bind(p);for(i=1;i<r.length;i++){var h=r[i];p.push(1==h?d()|d():2==h?d()&d():h?t(h,n):!d())}return!!d()},n=(r,t,n)=>{var o=n?(e=>Object.keys(e).reduce((r,t)=>(e[t].eager&&(r[t]=e[t]),r),{}))(r[t]):r[t];return Object.keys(o).reduce((r,t)=>!r||!o[r].loaded&&((r,t)=>{r=e(r),t=e(t);for(var n=0;;){if(n>=r.length)return n<t.length&&"u"!=(typeof t[n])[0];var o=r[n],a=(typeof o)[0];if(n>=t.length)return"u"==a;var i=t[n],u=(typeof i)[0];if(a!=u)return"o"==a&&"n"==u||"s"==u||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}})(r,t)?t:r,0)},o=(e,r,t)=>t?t():((e,r)=>(e=>{throw new Error(e)})("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),a=(e=>function(r,t,n,o,a){var u=i.I(r);return u&&u.then&&!n?u.then(e.bind(e,r,i.S[r],t,!1,o,a)):e(r,i.S[r],t,n,o,a)})((e,a,u,l,s,f)=>{if(!((e,r)=>e&&i.o(e,r))(a,u))return o(e,u,f);var c,p,d=n(a,u,l);return t(s,d)||(p=((e,t,n,o)=>"Unsatisfied version "+n+" from "+(n&&e[t][n].from)+" of shared singleton module "+t+" (required "+r(o)+")")(a,u,d,s),"undefined"!=typeof console&&console.warn&&console.warn(p)),(c=a[u][d]).loaded=1,c.get()}),u={},l={2897:()=>a("default","@openmrs/esm-framework",!1,[1,8,0,0],()=>Promise.all([i.e(283),i.e(478),i.e(242),i.e(162),i.e(656),i.e(705),i.e(446)]).then(()=>()=>i(2162))),7656:()=>a("default","react",!1,[1,18,0,0],()=>i.e(540).then(()=>()=>i(6540))),1180:()=>a("default","react-i18next",!1,[1,16,0,0],()=>Promise.all([i.e(478),i.e(311)]).then(()=>()=>i(3311))),5686:()=>a("default","react-dom",!1,[1,18,0,0],()=>i.e(961).then(()=>()=>i(3342))),7858:()=>a("default","rxjs",!1,[1,6,6,7],()=>i.e(184).then(()=>()=>i(3184))),8443:()=>a("default","single-spa",!1,[1,5,0,0],()=>i.e(917).then(()=>()=>i(7917)))};[2897].forEach(e=>{i.m[e]=r=>{u[e]=0,delete i.c[e];var t=l[e]();if("function"!=typeof t)throw new Error("Shared module is not available for eager consumption: "+e);r.exports=t()}});var s={446:[7858,8443],656:[7656],705:[1180,5686],792:[2897]},f={};i.f.consumes=(e,r)=>{i.o(s,e)&&s[e].forEach(e=>{if(i.o(u,e))return r.push(u[e]);if(!f[e]){var t=r=>{u[e]=0,i.m[e]=t=>{delete i.c[e],t.exports=r()}};f[e]=!0;var n=r=>{delete u[e],i.m[e]=t=>{throw delete i.c[e],r}};try{var o=l[e]();o.then?r.push(u[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}})}})(),(()=>{var e={729:0,792:0};i.f.j=(r,t)=>{var n=i.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(446|656|705)$/.test(r))e[r]=0;else{var o=new Promise((t,o)=>n=e[r]=[t,o]);t.push(n[2]=o);var a=i.p+i.u(r),u=new Error;i.l(a,t=>{if(i.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;u.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",u.name="ChunkLoadError",u.type=o,u.request=a,n[1](u)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,u,l]=t,s=0;if(a.some(r=>0!==e[r])){for(n in u)i.o(u,n)&&(i.m[n]=u[n]);l&&l(i)}for(r&&r(t);s<a.length;s++)o=a[s],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunk_epcare_esm_report_builder=self.webpackChunk_epcare_esm_report_builder||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),i.nc=void 0,i(7729)})();
|
|
@@ -157,30 +157,6 @@
|
|
|
157
157
|
"hash": "0e359dbd7feccb45",
|
|
158
158
|
"childrenByOrder": {}
|
|
159
159
|
},
|
|
160
|
-
{
|
|
161
|
-
"rendered": true,
|
|
162
|
-
"initial": false,
|
|
163
|
-
"entry": false,
|
|
164
|
-
"recorded": false,
|
|
165
|
-
"size": 2497225,
|
|
166
|
-
"sizes": {
|
|
167
|
-
"javascript": 2497225
|
|
168
|
-
},
|
|
169
|
-
"names": [],
|
|
170
|
-
"idHints": [],
|
|
171
|
-
"runtime": [
|
|
172
|
-
"@epcare/esm-report-builder",
|
|
173
|
-
"main"
|
|
174
|
-
],
|
|
175
|
-
"files": [
|
|
176
|
-
"378.js"
|
|
177
|
-
],
|
|
178
|
-
"auxiliaryFiles": [
|
|
179
|
-
"378.js.map"
|
|
180
|
-
],
|
|
181
|
-
"hash": "1d6f45b9b62647ee",
|
|
182
|
-
"childrenByOrder": {}
|
|
183
|
-
},
|
|
184
160
|
{
|
|
185
161
|
"rendered": false,
|
|
186
162
|
"initial": false,
|
|
@@ -228,6 +204,30 @@
|
|
|
228
204
|
"hash": "d8ffac07ffc60dd6",
|
|
229
205
|
"childrenByOrder": {}
|
|
230
206
|
},
|
|
207
|
+
{
|
|
208
|
+
"rendered": true,
|
|
209
|
+
"initial": false,
|
|
210
|
+
"entry": false,
|
|
211
|
+
"recorded": false,
|
|
212
|
+
"size": 2551469,
|
|
213
|
+
"sizes": {
|
|
214
|
+
"javascript": 2551469
|
|
215
|
+
},
|
|
216
|
+
"names": [],
|
|
217
|
+
"idHints": [],
|
|
218
|
+
"runtime": [
|
|
219
|
+
"@epcare/esm-report-builder",
|
|
220
|
+
"main"
|
|
221
|
+
],
|
|
222
|
+
"files": [
|
|
223
|
+
"538.js"
|
|
224
|
+
],
|
|
225
|
+
"auxiliaryFiles": [
|
|
226
|
+
"538.js.map"
|
|
227
|
+
],
|
|
228
|
+
"hash": "af478c1bbf5ae2a0",
|
|
229
|
+
"childrenByOrder": {}
|
|
230
|
+
},
|
|
231
231
|
{
|
|
232
232
|
"rendered": true,
|
|
233
233
|
"initial": false,
|
|
@@ -390,7 +390,7 @@
|
|
|
390
390
|
"auxiliaryFiles": [
|
|
391
391
|
"729.js.map"
|
|
392
392
|
],
|
|
393
|
-
"hash": "
|
|
393
|
+
"hash": "ba2e4f7b641dcf92",
|
|
394
394
|
"childrenByOrder": {}
|
|
395
395
|
},
|
|
396
396
|
{
|
|
@@ -442,7 +442,7 @@
|
|
|
442
442
|
"auxiliaryFiles": [
|
|
443
443
|
"main.js.map"
|
|
444
444
|
],
|
|
445
|
-
"hash": "
|
|
445
|
+
"hash": "82e4b6ef6ee4c830",
|
|
446
446
|
"childrenByOrder": {}
|
|
447
447
|
},
|
|
448
448
|
{
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","pages":[{"component":"root","route":"report-builder","online":true,"offline":false,"order":1}],"extensions":[{"name":"system-administration-report-builder-card-link","slot":"system-admin-page-card-link-slot","component":"reportBuilderAdminLink","online":true,"offline":false},{"component":"confirmModal","name":"confirm-modal","online":true,"offline":true}],"version":"0.1.1-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","pages":[{"component":"root","route":"report-builder","online":true,"offline":false,"order":1}],"extensions":[{"name":"system-administration-report-builder-card-link","slot":"system-admin-page-card-link-slot","component":"reportBuilderAdminLink","online":true,"offline":false},{"component":"confirmModal","name":"confirm-modal","online":true,"offline":true}],"version":"0.1.1-pre.40"}
|
package/package.json
CHANGED
|
@@ -113,8 +113,6 @@ export default function IndicatorSearchSelect({
|
|
|
113
113
|
const ac = new AbortController();
|
|
114
114
|
abortControllerRef.current = ac;
|
|
115
115
|
|
|
116
|
-
console.log('🔍 Searching for:', searchQuery);
|
|
117
|
-
|
|
118
116
|
const results = await listIndicators(
|
|
119
117
|
{
|
|
120
118
|
q: searchQuery,
|
|
@@ -125,8 +123,6 @@ export default function IndicatorSearchSelect({
|
|
|
125
123
|
ac.signal,
|
|
126
124
|
);
|
|
127
125
|
|
|
128
|
-
console.log('✅ Search results:', results.length, 'items for:', searchQuery);
|
|
129
|
-
|
|
130
126
|
// Only update if this is still the pending query
|
|
131
127
|
if (pendingQueryRef.current === searchQuery && isMountedRef.current) {
|
|
132
128
|
// Filter by kinds if specified
|
|
@@ -149,10 +145,7 @@ export default function IndicatorSearchSelect({
|
|
|
149
145
|
}
|
|
150
146
|
} catch (e: any) {
|
|
151
147
|
if (isMountedRef.current && e.name !== 'AbortError') {
|
|
152
|
-
console.error('❌ Search error:', e);
|
|
153
148
|
setError(e?.message || 'Failed to search indicators');
|
|
154
|
-
} else if (e.name === 'AbortError') {
|
|
155
|
-
console.log('⚠️ Search aborted for:', searchQuery);
|
|
156
149
|
}
|
|
157
150
|
} finally {
|
|
158
151
|
if (isMountedRef.current && pendingQueryRef.current === searchQuery) {
|
|
@@ -201,18 +194,15 @@ export default function IndicatorSearchSelect({
|
|
|
201
194
|
(inputText: string) => {
|
|
202
195
|
// Ignore if input is empty or matches placeholder
|
|
203
196
|
if (!inputText || inputText === placeholderText) {
|
|
204
|
-
console.log('⏭️ Ignoring empty/placeholder input');
|
|
205
197
|
setLoading(false);
|
|
206
198
|
return;
|
|
207
199
|
}
|
|
208
200
|
|
|
209
201
|
// Only search if the input has actually changed
|
|
210
202
|
if (inputText === pendingQueryRef.current || inputText === completedQueryRef.current) {
|
|
211
|
-
console.log('⏭️ Skipping redundant search for:', inputText);
|
|
212
203
|
return;
|
|
213
204
|
}
|
|
214
205
|
|
|
215
|
-
console.log('⌨️ Input changed to:', inputText);
|
|
216
206
|
scheduleSearch(inputText);
|
|
217
207
|
},
|
|
218
208
|
[scheduleSearch, placeholderText],
|
|
@@ -220,8 +210,6 @@ export default function IndicatorSearchSelect({
|
|
|
220
210
|
|
|
221
211
|
// Handle selection changes
|
|
222
212
|
const handleSelectionChange = useCallback((selected: ComboItem | null) => {
|
|
223
|
-
console.log('🎯 Selection changed:', selected?.label || 'none');
|
|
224
|
-
|
|
225
213
|
if (!selected || selected.isPlaceholder) {
|
|
226
214
|
onChange('', null);
|
|
227
215
|
return;
|
|
@@ -317,7 +317,6 @@ export default function IndicatorsPage() {
|
|
|
317
317
|
setRunPreviewIndicator(uuid);
|
|
318
318
|
setOpenRunPreview(true);
|
|
319
319
|
};
|
|
320
|
-
const onOpen = (uuid: string) => console.log('Open indicator:', uuid);
|
|
321
320
|
|
|
322
321
|
// --------------------------------------------
|
|
323
322
|
// RENDER
|
|
@@ -385,14 +384,14 @@ export default function IndicatorsPage() {
|
|
|
385
384
|
{loading ? <InlineLoading description="Loading…" /> : null}
|
|
386
385
|
{!loading && error ? <div style={{ color: 'var(--cds-text-error, #da1e28)' }}>{error}</div> : null}
|
|
387
386
|
|
|
388
|
-
<IndicatorsTable rows={filteredRows}
|
|
387
|
+
<IndicatorsTable rows={filteredRows} onEdit={onEdit} onRun={onRun} onDelete={onDelete} />
|
|
389
388
|
</TabPanel>
|
|
390
389
|
|
|
391
390
|
<TabPanel>
|
|
392
391
|
{loading ? <InlineLoading description="Loading…" /> : null}
|
|
393
392
|
{!loading && error ? <div style={{ color: 'var(--cds-text-error, #da1e28)' }}>{error}</div> : null}
|
|
394
393
|
|
|
395
|
-
<IndicatorsTable rows={filteredRows}
|
|
394
|
+
<IndicatorsTable rows={filteredRows} onEdit={onEdit} onRun={onRun} onDelete={onDelete} />
|
|
396
395
|
</TabPanel>
|
|
397
396
|
</TabPanels>
|
|
398
397
|
</Tabs>
|
|
@@ -20,12 +20,15 @@ import {
|
|
|
20
20
|
Accordion,
|
|
21
21
|
AccordionItem,
|
|
22
22
|
} from '@carbon/react';
|
|
23
|
-
import { TrashCan, User, Tag as TagIcon, Function, Hashtag, ChartColumn, Edit } from '@carbon/react/icons';
|
|
23
|
+
import { TrashCan, User, Tag as TagIcon, Function, Hashtag, ChartColumn, Edit, Copy, ArrowUp, ArrowDown, Settings } from '@carbon/react/icons';
|
|
24
24
|
import type {
|
|
25
25
|
LinelistColumnDraft,
|
|
26
26
|
} from '../../../types/linelist-types';
|
|
27
27
|
import styles from './column-category-selector.scss';
|
|
28
28
|
import EditColumnModal from './edit-column-modal.component';
|
|
29
|
+
import ObservationColumnModal from './observation-column-modal.component';
|
|
30
|
+
import EncounterDiagnosisColumnModal from './encounter-diagnosis-column-modal.component';
|
|
31
|
+
import ColumnDebugPanel from './column-debug-panel.component';
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
34
|
* Category definitions for organizing columns
|
|
@@ -76,6 +79,10 @@ export default function ColumnCategorySelector({ columns, onChange, disabled = f
|
|
|
76
79
|
// Edit modal state
|
|
77
80
|
const [editingColumn, setEditingColumn] = useState<LinelistColumnDraft | null>(null);
|
|
78
81
|
const [showEditModal, setShowEditModal] = useState(false);
|
|
82
|
+
const [showObservationModal, setShowObservationModal] = useState(false);
|
|
83
|
+
const [showDiagnosisModal, setShowDiagnosisModal] = useState(false);
|
|
84
|
+
const [showDebugPanel, setShowDebugPanel] = useState(false);
|
|
85
|
+
const [debugColumn, setDebugColumn] = useState<LinelistColumnDraft | null>(null);
|
|
79
86
|
|
|
80
87
|
/**
|
|
81
88
|
* Categorize a column based on its dataDefinitionType and config
|
|
@@ -142,10 +149,22 @@ export default function ColumnCategorySelector({ columns, onChange, disabled = f
|
|
|
142
149
|
|
|
143
150
|
/**
|
|
144
151
|
* Edit a column
|
|
152
|
+
* Routes to the appropriate modal based on column type
|
|
145
153
|
*/
|
|
146
154
|
const editColumn = useCallback((column: LinelistColumnDraft) => {
|
|
147
155
|
setEditingColumn(column);
|
|
148
|
-
|
|
156
|
+
// Route to native modal based on dataDefinitionType
|
|
157
|
+
switch (column.dataDefinitionType) {
|
|
158
|
+
case 'OBSERVATION':
|
|
159
|
+
setShowObservationModal(true);
|
|
160
|
+
break;
|
|
161
|
+
case 'ENCOUNTER_DIAGNOSIS':
|
|
162
|
+
setShowDiagnosisModal(true);
|
|
163
|
+
break;
|
|
164
|
+
default:
|
|
165
|
+
setShowEditModal(true);
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
149
168
|
}, []);
|
|
150
169
|
|
|
151
170
|
/**
|
|
@@ -167,9 +186,58 @@ export default function ColumnCategorySelector({ columns, onChange, disabled = f
|
|
|
167
186
|
*/
|
|
168
187
|
const cancelEdit = useCallback(() => {
|
|
169
188
|
setShowEditModal(false);
|
|
189
|
+
setShowObservationModal(false);
|
|
190
|
+
setShowDiagnosisModal(false);
|
|
170
191
|
setEditingColumn(null);
|
|
171
192
|
}, []);
|
|
172
193
|
|
|
194
|
+
/**
|
|
195
|
+
* Copy column ID to clipboard
|
|
196
|
+
*/
|
|
197
|
+
const copyColumnId = useCallback((columnId: string) => {
|
|
198
|
+
navigator.clipboard.writeText(columnId).then(() => {
|
|
199
|
+
// Could add a toast notification here
|
|
200
|
+
});
|
|
201
|
+
}, []);
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Move column up in order
|
|
205
|
+
*/
|
|
206
|
+
const moveColumnUp = useCallback((columnId: string) => {
|
|
207
|
+
const index = columns.findIndex(c => c.id === columnId);
|
|
208
|
+
if (index <= 0) return; // Already at top
|
|
209
|
+
|
|
210
|
+
const updatedColumns = [...columns];
|
|
211
|
+
// Swap with previous column
|
|
212
|
+
[updatedColumns[index - 1], updatedColumns[index]] = [updatedColumns[index], updatedColumns[index - 1]];
|
|
213
|
+
// Update sortOrders
|
|
214
|
+
updatedColumns.forEach((col, idx) => col.sortOrder = idx);
|
|
215
|
+
onChange(updatedColumns);
|
|
216
|
+
}, [columns, onChange]);
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Move column down in order
|
|
220
|
+
*/
|
|
221
|
+
const moveColumnDown = useCallback((columnId: string) => {
|
|
222
|
+
const index = columns.findIndex(c => c.id === columnId);
|
|
223
|
+
if (index === -1 || index >= columns.length - 1) return; // Already at bottom
|
|
224
|
+
|
|
225
|
+
const updatedColumns = [...columns];
|
|
226
|
+
// Swap with next column
|
|
227
|
+
[updatedColumns[index], updatedColumns[index + 1]] = [updatedColumns[index + 1], updatedColumns[index]];
|
|
228
|
+
// Update sortOrders
|
|
229
|
+
updatedColumns.forEach((col, idx) => col.sortOrder = idx);
|
|
230
|
+
onChange(updatedColumns);
|
|
231
|
+
}, [columns, onChange]);
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Open debug panel for a column
|
|
235
|
+
*/
|
|
236
|
+
const openDebugPanel = useCallback((column: LinelistColumnDraft) => {
|
|
237
|
+
setDebugColumn(column);
|
|
238
|
+
setShowDebugPanel(true);
|
|
239
|
+
}, []);
|
|
240
|
+
|
|
173
241
|
const totalColumns = columns.length;
|
|
174
242
|
|
|
175
243
|
return (
|
|
@@ -227,14 +295,69 @@ export default function ColumnCategorySelector({ columns, onChange, disabled = f
|
|
|
227
295
|
<p className={styles.categoryDescription}>{category.description}</p>
|
|
228
296
|
<div className={styles.columnList}>
|
|
229
297
|
{categoryColumns.map((col) => (
|
|
230
|
-
<div key={col.id} className={styles.columnItem}>
|
|
231
|
-
|
|
232
|
-
<
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
298
|
+
<div key={col.id} className={styles.columnItem} data-column-id={col.id} data-position={col.sortOrder}>
|
|
299
|
+
{/* Position indicator with drag handle */}
|
|
300
|
+
<div className={styles.columnPosition}>
|
|
301
|
+
<span className={styles.positionNumber}>#{col.sortOrder + 1}</span>
|
|
302
|
+
</div>
|
|
303
|
+
|
|
304
|
+
{/* Column info */}
|
|
305
|
+
<div className={styles.columnInfo}>
|
|
306
|
+
<span className={styles.columnName}>{col.name}</span>
|
|
307
|
+
{/* Column ID shown as small tag */}
|
|
308
|
+
<Tag size="sm" type="blue" className={styles.columnIdTag}>
|
|
309
|
+
ID: {col.id}
|
|
310
|
+
</Tag>
|
|
311
|
+
{col.source?.dataSourceName && (
|
|
312
|
+
<Tag size="sm" type="cool-gray">{col.source.dataSourceName}</Tag>
|
|
313
|
+
)}
|
|
314
|
+
<Tag size="sm" type="gray">{col.dataDefinitionType}</Tag>
|
|
315
|
+
</div>
|
|
316
|
+
|
|
317
|
+
{/* Column actions */}
|
|
237
318
|
<div className={styles.columnActions}>
|
|
319
|
+
{/* Move Up */}
|
|
320
|
+
<Button
|
|
321
|
+
kind="ghost"
|
|
322
|
+
size="sm"
|
|
323
|
+
hasIconOnly
|
|
324
|
+
renderIcon={ArrowUp}
|
|
325
|
+
onClick={() => moveColumnUp(col.id)}
|
|
326
|
+
disabled={disabled || col.sortOrder === 0}
|
|
327
|
+
iconDescription="Move column up"
|
|
328
|
+
/>
|
|
329
|
+
{/* Move Down */}
|
|
330
|
+
<Button
|
|
331
|
+
kind="ghost"
|
|
332
|
+
size="sm"
|
|
333
|
+
hasIconOnly
|
|
334
|
+
renderIcon={ArrowDown}
|
|
335
|
+
onClick={() => moveColumnDown(col.id)}
|
|
336
|
+
disabled={disabled || col.sortOrder === columns.length - 1}
|
|
337
|
+
iconDescription="Move column down"
|
|
338
|
+
/>
|
|
339
|
+
{/* Copy ID */}
|
|
340
|
+
<Button
|
|
341
|
+
kind="ghost"
|
|
342
|
+
size="sm"
|
|
343
|
+
hasIconOnly
|
|
344
|
+
renderIcon={Copy}
|
|
345
|
+
onClick={() => copyColumnId(col.id)}
|
|
346
|
+
disabled={disabled}
|
|
347
|
+
iconDescription="Copy column ID to clipboard"
|
|
348
|
+
/>
|
|
349
|
+
{/* Debug */}
|
|
350
|
+
<Button
|
|
351
|
+
kind="ghost"
|
|
352
|
+
size="sm"
|
|
353
|
+
hasIconOnly
|
|
354
|
+
renderIcon={Settings}
|
|
355
|
+
onClick={() => openDebugPanel(col)}
|
|
356
|
+
disabled={disabled}
|
|
357
|
+
iconDescription="View column debug info"
|
|
358
|
+
style={{ color: '#0f62fe' }}
|
|
359
|
+
/>
|
|
360
|
+
{/* Edit */}
|
|
238
361
|
<Button
|
|
239
362
|
kind="ghost"
|
|
240
363
|
size="sm"
|
|
@@ -244,6 +367,7 @@ export default function ColumnCategorySelector({ columns, onChange, disabled = f
|
|
|
244
367
|
disabled={disabled}
|
|
245
368
|
iconDescription="Edit column"
|
|
246
369
|
/>
|
|
370
|
+
{/* Remove */}
|
|
247
371
|
<Button
|
|
248
372
|
kind="ghost"
|
|
249
373
|
size="sm"
|
|
@@ -271,6 +395,35 @@ export default function ColumnCategorySelector({ columns, onChange, disabled = f
|
|
|
271
395
|
onSave={saveColumn}
|
|
272
396
|
onClose={cancelEdit}
|
|
273
397
|
/>
|
|
398
|
+
|
|
399
|
+
{/* Observation Column Modal (native edit mode) */}
|
|
400
|
+
<ObservationColumnModal
|
|
401
|
+
open={showObservationModal}
|
|
402
|
+
onClose={cancelEdit}
|
|
403
|
+
onAddColumn={saveColumn}
|
|
404
|
+
existingColumns={columns}
|
|
405
|
+
editingColumn={editingColumn}
|
|
406
|
+
/>
|
|
407
|
+
|
|
408
|
+
{/* Encounter Diagnosis Column Modal (native edit mode) */}
|
|
409
|
+
<EncounterDiagnosisColumnModal
|
|
410
|
+
open={showDiagnosisModal}
|
|
411
|
+
onClose={cancelEdit}
|
|
412
|
+
onAddColumn={saveColumn}
|
|
413
|
+
existingColumns={columns}
|
|
414
|
+
editingColumn={editingColumn}
|
|
415
|
+
/>
|
|
416
|
+
|
|
417
|
+
{/* Column Debug Panel */}
|
|
418
|
+
{showDebugPanel && debugColumn && (
|
|
419
|
+
<ColumnDebugPanel
|
|
420
|
+
column={debugColumn}
|
|
421
|
+
onClose={() => {
|
|
422
|
+
setShowDebugPanel(false);
|
|
423
|
+
setDebugColumn(null);
|
|
424
|
+
}}
|
|
425
|
+
/>
|
|
426
|
+
)}
|
|
274
427
|
</Stack>
|
|
275
428
|
</div>
|
|
276
429
|
);
|
|
@@ -98,6 +98,90 @@
|
|
|
98
98
|
padding-top: 1rem;
|
|
99
99
|
border-top: 1px solid #e0e0e0;
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
.columnList {
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
gap: 0.5rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.columnItem {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
gap: 0.75rem;
|
|
112
|
+
padding: 0.75rem;
|
|
113
|
+
background-color: #ffffff;
|
|
114
|
+
border: 1px solid #e0e0e0;
|
|
115
|
+
border-radius: 6px;
|
|
116
|
+
transition: all 0.15s ease;
|
|
117
|
+
cursor: default;
|
|
118
|
+
|
|
119
|
+
&:hover {
|
|
120
|
+
background-color: #f4f4f4;
|
|
121
|
+
border-color: #8a8a8a;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.columnPosition {
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
min-width: 3rem;
|
|
128
|
+
|
|
129
|
+
.positionNumber {
|
|
130
|
+
font-size: 0.75rem;
|
|
131
|
+
font-weight: 600;
|
|
132
|
+
color: #0f62fe;
|
|
133
|
+
background-color: #e5f1ff;
|
|
134
|
+
padding: 0.125rem 0.5rem;
|
|
135
|
+
border-radius: 10px;
|
|
136
|
+
user-select: none;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.columnInfo {
|
|
141
|
+
flex: 1;
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: 0.5rem;
|
|
145
|
+
flex-wrap: wrap;
|
|
146
|
+
|
|
147
|
+
.columnName {
|
|
148
|
+
font-size: 0.875rem;
|
|
149
|
+
font-weight: 500;
|
|
150
|
+
color: #161616;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.columnIdTag {
|
|
154
|
+
font-size: 0.7rem;
|
|
155
|
+
font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
|
|
156
|
+
opacity: 0.8;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.columnOrder {
|
|
161
|
+
font-size: 0.75rem;
|
|
162
|
+
color: #6f6f6f;
|
|
163
|
+
min-width: 2rem;
|
|
164
|
+
display: none; // Hidden, replaced by columnPosition
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.columnName {
|
|
168
|
+
flex: 1;
|
|
169
|
+
font-size: 0.875rem;
|
|
170
|
+
font-weight: 500;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.columnActions {
|
|
174
|
+
display: flex;
|
|
175
|
+
gap: 0.25rem;
|
|
176
|
+
opacity: 0.7;
|
|
177
|
+
transition: opacity 0.15s ease;
|
|
178
|
+
|
|
179
|
+
// Show actions more prominently on hover
|
|
180
|
+
.columnItem:hover & {
|
|
181
|
+
opacity: 1;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
101
185
|
}
|
|
102
186
|
|
|
103
187
|
.selectedTable {
|
|
@@ -124,20 +208,59 @@
|
|
|
124
208
|
display: flex;
|
|
125
209
|
align-items: center;
|
|
126
210
|
gap: 0.75rem;
|
|
127
|
-
padding: 0.
|
|
211
|
+
padding: 0.75rem;
|
|
128
212
|
background-color: #ffffff;
|
|
129
213
|
border: 1px solid #e0e0e0;
|
|
130
|
-
border-radius:
|
|
131
|
-
transition:
|
|
214
|
+
border-radius: 6px;
|
|
215
|
+
transition: all 0.15s ease;
|
|
216
|
+
cursor: default;
|
|
132
217
|
|
|
133
218
|
&:hover {
|
|
134
219
|
background-color: #f4f4f4;
|
|
220
|
+
border-color: #8a8a8a;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.columnPosition {
|
|
224
|
+
display: flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
min-width: 3rem;
|
|
227
|
+
|
|
228
|
+
.positionNumber {
|
|
229
|
+
font-size: 0.75rem;
|
|
230
|
+
font-weight: 600;
|
|
231
|
+
color: #0f62fe;
|
|
232
|
+
background-color: #e5f1ff;
|
|
233
|
+
padding: 0.125rem 0.5rem;
|
|
234
|
+
border-radius: 10px;
|
|
235
|
+
user-select: none;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.columnInfo {
|
|
240
|
+
flex: 1;
|
|
241
|
+
display: flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
gap: 0.5rem;
|
|
244
|
+
flex-wrap: wrap;
|
|
245
|
+
|
|
246
|
+
.columnName {
|
|
247
|
+
font-size: 0.875rem;
|
|
248
|
+
font-weight: 500;
|
|
249
|
+
color: #161616;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.columnIdTag {
|
|
253
|
+
font-size: 0.7rem;
|
|
254
|
+
font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
|
|
255
|
+
opacity: 0.8;
|
|
256
|
+
}
|
|
135
257
|
}
|
|
136
258
|
|
|
137
259
|
.columnOrder {
|
|
138
260
|
font-size: 0.75rem;
|
|
139
261
|
color: #6f6f6f;
|
|
140
262
|
min-width: 2rem;
|
|
263
|
+
display: none; // Hidden, replaced by columnPosition
|
|
141
264
|
}
|
|
142
265
|
|
|
143
266
|
.columnName {
|
|
@@ -145,6 +268,18 @@
|
|
|
145
268
|
font-size: 0.875rem;
|
|
146
269
|
font-weight: 500;
|
|
147
270
|
}
|
|
271
|
+
|
|
272
|
+
.columnActions {
|
|
273
|
+
display: flex;
|
|
274
|
+
gap: 0.25rem;
|
|
275
|
+
opacity: 0.7;
|
|
276
|
+
transition: opacity 0.15s ease;
|
|
277
|
+
|
|
278
|
+
// Show actions more prominently on hover
|
|
279
|
+
.columnItem:hover & {
|
|
280
|
+
opacity: 1;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
148
283
|
}
|
|
149
284
|
}
|
|
150
285
|
|
|
@@ -182,3 +317,13 @@
|
|
|
182
317
|
color: #161616;
|
|
183
318
|
}
|
|
184
319
|
}
|
|
320
|
+
|
|
321
|
+
// Debug button styling
|
|
322
|
+
button[icondescription="View column debug info"] {
|
|
323
|
+
svg {
|
|
324
|
+
fill: #0f62fe;
|
|
325
|
+
}
|
|
326
|
+
&:hover {
|
|
327
|
+
background-color: #e5f1ff !important;
|
|
328
|
+
}
|
|
329
|
+
}
|