@epcare/esm-report-builder 0.1.1-pre.15
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/.eslintignore +5 -0
- package/.eslintrc.js +19 -0
- package/.github/workflows/main.yml +162 -0
- package/.prettierrc +8 -0
- package/LICENSE +401 -0
- package/README.md +317 -0
- package/dist/0081d5d3d536cb23.js +1 -0
- package/dist/02acc4469a2fe2e4.woff2 +0 -0
- package/dist/081587ca0db8e63f.woff2 +0 -0
- package/dist/08cf53c4e5e71cf1.woff2 +0 -0
- package/dist/090b2bc014d24ea4.woff2 +0 -0
- package/dist/09de5db63ef7b579.js +1 -0
- package/dist/0ae92bcea615e948.woff2 +0 -0
- package/dist/0be8520d8945b3b7.woff2 +0 -0
- package/dist/0e7dd073cd8bb0ad.woff2 +0 -0
- package/dist/0edb77cd19e43550.js +1 -0
- package/dist/14869ac5d1830304.woff2 +0 -0
- package/dist/14aaceff85fc8b28.woff2 +0 -0
- package/dist/14c3abea79fc1389.js +1 -0
- package/dist/155a4ac079785bfd.js +1 -0
- package/dist/155a4ac079785bfd.js.map +1 -0
- package/dist/16f443eed01776ca.woff2 +0 -0
- package/dist/183bae0e53a22182.woff2 +0 -0
- package/dist/19c8f94ccd6289f5.woff2 +0 -0
- package/dist/1ae86565eab7451c.woff2 +0 -0
- package/dist/1c7bf8797e0a9be6.woff2 +0 -0
- package/dist/1f266d3619b30f16.woff2 +0 -0
- package/dist/1f8c5a4087a524fd.woff2 +0 -0
- package/dist/20ba2b23c5c0cd0b.woff2 +0 -0
- package/dist/22a32bd51591301b.js +1 -0
- package/dist/273c72d90e432a3d.js +1 -0
- package/dist/295dd01a1fbfee6d.woff2 +0 -0
- package/dist/29cbe6827c3f03ef.js +1 -0
- package/dist/2f686985e26e7107.woff2 +0 -0
- package/dist/315eff729e4ccbd9.woff2 +0 -0
- package/dist/368d16e3259bf207.woff2 +0 -0
- package/dist/36c49aa341a7079a.woff2 +0 -0
- package/dist/36e1e0430475edee.woff2 +0 -0
- package/dist/374c3ee36d9e040a.js +1 -0
- package/dist/377971e519bf3f4a.js +2 -0
- package/dist/377971e519bf3f4a.js.LICENSE.txt +39 -0
- package/dist/377971e519bf3f4a.js.map +1 -0
- package/dist/3b0ea8395009dcf3.js +2 -0
- package/dist/3b0ea8395009dcf3.js.LICENSE.txt +9 -0
- package/dist/3b0ea8395009dcf3.js.map +1 -0
- package/dist/3bc19662b8630ee9.woff2 +0 -0
- package/dist/3f645f473b3f8fba.woff2 +0 -0
- package/dist/41320d8930d23b36.js +1 -0
- package/dist/4218ac9901b9d36d.woff2 +0 -0
- package/dist/4659f3ca46d928b5.js +1 -0
- package/dist/4659f3ca46d928b5.js.map +1 -0
- package/dist/4680ba68412e4da9.woff2 +0 -0
- package/dist/48e37bd7ebf85a1f.woff2 +0 -0
- package/dist/4aabceefe5a2494a.js +1 -0
- package/dist/4c188cbaefba58cd.js +1 -0
- package/dist/4e11b8a7c445255f.woff2 +0 -0
- package/dist/537ddd61c5c1fce2.woff2 +0 -0
- package/dist/54f5eee3a7989556.js +1 -0
- package/dist/55c9107b50dd747c.js +1 -0
- package/dist/56c4118c0907f151.woff2 +0 -0
- package/dist/5938bc2ae7ec60c0.woff2 +0 -0
- package/dist/5c6586155f0d278a.woff2 +0 -0
- package/dist/5e50c92017029ca3.js +1 -0
- package/dist/5e50c92017029ca3.js.map +1 -0
- package/dist/600aca7295d8bcb7.js +2 -0
- package/dist/600aca7295d8bcb7.js.LICENSE.txt +9 -0
- package/dist/600aca7295d8bcb7.js.map +1 -0
- package/dist/60ec587649ba812a.woff2 +0 -0
- package/dist/64cf08a5ac3266d8.js +1 -0
- package/dist/652f476a8a1603d3.js +2 -0
- package/dist/652f476a8a1603d3.js.LICENSE.txt +9 -0
- package/dist/652f476a8a1603d3.js.map +1 -0
- package/dist/65e6511e035870e1.woff2 +0 -0
- package/dist/661425f6798cd16a.woff2 +0 -0
- package/dist/66b864fe213caf46.woff2 +0 -0
- package/dist/680eb791e6266590.js +2 -0
- package/dist/680eb791e6266590.js.LICENSE.txt +19 -0
- package/dist/680eb791e6266590.js.map +1 -0
- package/dist/69d087d970ee9455.woff2 +0 -0
- package/dist/69e3aa4276b4cb4b.js +1 -0
- package/dist/6a88f03fc4e7c3da.js +1 -0
- package/dist/6c6c45e66ff54281.woff2 +0 -0
- package/dist/6d9009857c6df878.js +1 -0
- package/dist/6ebe7cea59ed2853.js +1 -0
- package/dist/6f3181849e740935.js +1 -0
- package/dist/6f3181849e740935.js.map +1 -0
- package/dist/7073a7323e92bd11.woff2 +0 -0
- package/dist/70ac433ae2a89a89.js +1 -0
- package/dist/70ee4ee625ac0ec1.js +1 -0
- package/dist/718c6cc31274ab1a.woff2 +0 -0
- package/dist/727696c3934d0966.js +1 -0
- package/dist/727763c0f0df59dc.js +1 -0
- package/dist/727763c0f0df59dc.js.map +1 -0
- package/dist/72cdbedfe04be9f9.woff2 +0 -0
- package/dist/7509c9f56fe9e532.woff2 +0 -0
- package/dist/75dc5c5b04adc8bf.woff2 +0 -0
- package/dist/77b48bc05299ecca.woff2 +0 -0
- package/dist/7a0a0215c248c73d.woff2 +0 -0
- package/dist/7c0d0c5180de8729.js +1 -0
- package/dist/7f00bebb24e40167.woff2 +0 -0
- package/dist/802c6176541eeed7.woff2 +0 -0
- package/dist/8080081b3379c637.woff2 +0 -0
- package/dist/81cfdaeaa0bbca1f.js +1 -0
- package/dist/8605507b7a8487c4.woff2 +0 -0
- package/dist/893a160d06428365.js +1 -0
- package/dist/893a160d06428365.js.map +1 -0
- package/dist/8a83d654702f6534.woff2 +0 -0
- package/dist/8fe71173a13fe571.woff2 +0 -0
- package/dist/94aa912dcac90114.js +1 -0
- package/dist/9624cec0f9bdd81e.woff2 +0 -0
- package/dist/98a3af55a1698171.woff2 +0 -0
- package/dist/99823aaebba56f46.js +1 -0
- package/dist/9ba85996af74c5ce.woff2 +0 -0
- package/dist/9ddb22faa35006e7.woff2 +0 -0
- package/dist/a167fb2799dd741b.woff2 +0 -0
- package/dist/a2045a5cc4fdf94f.woff2 +0 -0
- package/dist/a246c73905a31c93.woff2 +0 -0
- package/dist/a325099b0a580ce2.js +2 -0
- package/dist/a325099b0a580ce2.js.LICENSE.txt +14 -0
- package/dist/a325099b0a580ce2.js.map +1 -0
- package/dist/a401aa7939cb6e6f.woff2 +0 -0
- package/dist/a40fef67997d3b2c.js +1 -0
- package/dist/a62897b000a24b86.js +1 -0
- package/dist/a6ed036f17a1ea29.woff2 +0 -0
- package/dist/a77bac4877483a0a.js +1 -0
- package/dist/a9f25ca430709a1a.woff2 +0 -0
- package/dist/aa0dfbdd569b1c24.js +2 -0
- package/dist/aa0dfbdd569b1c24.js.LICENSE.txt +5 -0
- package/dist/aa0dfbdd569b1c24.js.map +1 -0
- package/dist/ab0f637d6cff12e4.js +1 -0
- package/dist/afa9121a49e95351.woff2 +0 -0
- package/dist/afcda12d9f805543.woff2 +0 -0
- package/dist/b09ded85a7da77f1.woff2 +0 -0
- package/dist/b10dbe5318a91a12.js +1 -0
- package/dist/b2f4e9d1e821b71c.woff2 +0 -0
- package/dist/b4a074bf828bb757.woff2 +0 -0
- package/dist/b7f447da43f6e596.woff2 +0 -0
- package/dist/bcca84a524572d10.woff2 +0 -0
- package/dist/be093e052a6d50eb.js +1 -0
- package/dist/be4d1f97b11d087c.woff2 +0 -0
- package/dist/bec14780d81164de.woff2 +0 -0
- package/dist/c31657fe213c1b5e.js +1 -0
- package/dist/c49ef726d3f0420b.js +1 -0
- package/dist/c553f7e0199c5084.woff2 +0 -0
- package/dist/c94ac2fdc1ff1418.js +1 -0
- package/dist/c9d9ce9f465df4fe.woff2 +0 -0
- package/dist/cbbb57b397433964.js +2 -0
- package/dist/cbbb57b397433964.js.LICENSE.txt +14 -0
- package/dist/cbbb57b397433964.js.map +1 -0
- package/dist/d188f7f036ac5779.woff2 +0 -0
- package/dist/d1aa59bd9c702dc4.js +2 -0
- package/dist/d1aa59bd9c702dc4.js.LICENSE.txt +32 -0
- package/dist/d1aa59bd9c702dc4.js.map +1 -0
- package/dist/d265d81c58525ae4.woff2 +0 -0
- package/dist/d5942cd81663e136.woff2 +0 -0
- package/dist/d66b8ff73d95cabb.woff2 +0 -0
- package/dist/d84bac6d07672dd2.js +1 -0
- package/dist/d84bac6d07672dd2.js.map +1 -0
- package/dist/d88899ef0fd16719.woff2 +0 -0
- package/dist/d92b5ecf31fc187b.js +1 -0
- package/dist/d9a5d958e69e058d.woff2 +0 -0
- package/dist/dac90d495be353a0.woff2 +0 -0
- package/dist/db0550511978dc47.js +1 -0
- package/dist/dd8ce598529c3fab.woff2 +0 -0
- package/dist/de013f1be25103fa.woff2 +0 -0
- package/dist/df222fceeffca849.woff2 +0 -0
- package/dist/df22bda08ec7964c.js +1 -0
- package/dist/e05b7f902b02a251.js +1 -0
- package/dist/e05b7f902b02a251.js.map +1 -0
- package/dist/e465f1481f0d2e1c.js +1 -0
- package/dist/e62b00b9199c1ac9.woff2 +0 -0
- package/dist/e696cef1407b2610.woff2 +0 -0
- package/dist/eb42de5422d9af00.js +1 -0
- package/dist/eed48feba743e21c.woff2 +0 -0
- package/dist/f135ef54213f8975.js +1 -0
- package/dist/f260e50923d4283b.js +1 -0
- package/dist/f543c88feb236d11.woff2 +0 -0
- package/dist/f591b0079faa93fe.woff2 +0 -0
- package/dist/f6ed27923769ad1d.woff2 +0 -0
- package/dist/f8d066e92ea157c6.js +1 -0
- package/dist/fae042506530c1e6.js +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/fbebeb4336e67012.woff2 +0 -0
- package/dist/fd574df77d31a5eb.js +1 -0
- package/dist/icon_128x128.3dde25c6e69b1c010a6a5d6b27b3f436.png +0 -0
- package/dist/icon_144x144.e263e02b838d229b02ff9133e6e0f2ba.png +0 -0
- package/dist/icon_192x192.d3d318638bbe8a10a3c687d3d302d01a.png +0 -0
- package/dist/icon_256x256.c729f6e7e914b58fcea5ce91d7aa9bad.png +0 -0
- package/dist/icon_384x384.c8923df6b6bd08eba5c79b78d7fcecc0.png +0 -0
- package/dist/icon_512x512.7163efb26df832de513bc58d925ea22e.png +0 -0
- package/dist/icon_96x96.682ee334ae19d49894217370b8596f61.png +0 -0
- package/dist/index.html +9 -0
- package/dist/logo-512.png +0 -0
- package/dist/logo.svg +30 -0
- package/dist/manifest.266df36f2271d27ae9bcaa196a2976ae.json +47 -0
- package/dist/openmrs.39723c21cec4b1fc.css +1 -0
- package/dist/openmrs.39723c21cec4b1fc.css.map +1 -0
- package/dist/openmrs.44bac4c8520ee42f.css +2 -0
- package/dist/openmrs.44bac4c8520ee42f.css.map +1 -0
- package/dist/openmrs.936e8cf6a4b1599d.css +2 -0
- package/dist/openmrs.936e8cf6a4b1599d.css.map +1 -0
- package/dist/openmrs.c3adea28ef850516.js +1 -0
- package/dist/openmrs.c3adea28ef850516.js.map +1 -0
- package/dist/openmrs.e4daba1e3b840e70.css +25 -0
- package/dist/openmrs.e4daba1e3b840e70.css.map +1 -0
- package/dist/service-worker.js +1 -0
- package/dist/service-worker.js.map +1 -0
- package/dist-build-23687264126/0081d5d3d536cb23.js +1 -0
- package/dist-build-23687264126/02acc4469a2fe2e4.woff2 +0 -0
- package/dist-build-23687264126/081587ca0db8e63f.woff2 +0 -0
- package/dist-build-23687264126/08cf53c4e5e71cf1.woff2 +0 -0
- package/dist-build-23687264126/090b2bc014d24ea4.woff2 +0 -0
- package/dist-build-23687264126/09de5db63ef7b579.js +1 -0
- package/dist-build-23687264126/0ae92bcea615e948.woff2 +0 -0
- package/dist-build-23687264126/0be8520d8945b3b7.woff2 +0 -0
- package/dist-build-23687264126/0e7dd073cd8bb0ad.woff2 +0 -0
- package/dist-build-23687264126/0edb77cd19e43550.js +1 -0
- package/dist-build-23687264126/14869ac5d1830304.woff2 +0 -0
- package/dist-build-23687264126/14aaceff85fc8b28.woff2 +0 -0
- package/dist-build-23687264126/14c3abea79fc1389.js +1 -0
- package/dist-build-23687264126/155a4ac079785bfd.js +1 -0
- package/dist-build-23687264126/155a4ac079785bfd.js.map +1 -0
- package/dist-build-23687264126/16f443eed01776ca.woff2 +0 -0
- package/dist-build-23687264126/183bae0e53a22182.woff2 +0 -0
- package/dist-build-23687264126/19c8f94ccd6289f5.woff2 +0 -0
- package/dist-build-23687264126/1ae86565eab7451c.woff2 +0 -0
- package/dist-build-23687264126/1c7bf8797e0a9be6.woff2 +0 -0
- package/dist-build-23687264126/1f266d3619b30f16.woff2 +0 -0
- package/dist-build-23687264126/1f8c5a4087a524fd.woff2 +0 -0
- package/dist-build-23687264126/20ba2b23c5c0cd0b.woff2 +0 -0
- package/dist-build-23687264126/22a32bd51591301b.js +1 -0
- package/dist-build-23687264126/273c72d90e432a3d.js +1 -0
- package/dist-build-23687264126/295dd01a1fbfee6d.woff2 +0 -0
- package/dist-build-23687264126/29cbe6827c3f03ef.js +1 -0
- package/dist-build-23687264126/2f686985e26e7107.woff2 +0 -0
- package/dist-build-23687264126/315eff729e4ccbd9.woff2 +0 -0
- package/dist-build-23687264126/368d16e3259bf207.woff2 +0 -0
- package/dist-build-23687264126/36c49aa341a7079a.woff2 +0 -0
- package/dist-build-23687264126/36e1e0430475edee.woff2 +0 -0
- package/dist-build-23687264126/374c3ee36d9e040a.js +1 -0
- package/dist-build-23687264126/377971e519bf3f4a.js +2 -0
- package/dist-build-23687264126/377971e519bf3f4a.js.LICENSE.txt +39 -0
- package/dist-build-23687264126/377971e519bf3f4a.js.map +1 -0
- package/dist-build-23687264126/3b0ea8395009dcf3.js +2 -0
- package/dist-build-23687264126/3b0ea8395009dcf3.js.LICENSE.txt +9 -0
- package/dist-build-23687264126/3b0ea8395009dcf3.js.map +1 -0
- package/dist-build-23687264126/3bc19662b8630ee9.woff2 +0 -0
- package/dist-build-23687264126/3f645f473b3f8fba.woff2 +0 -0
- package/dist-build-23687264126/41320d8930d23b36.js +1 -0
- package/dist-build-23687264126/4218ac9901b9d36d.woff2 +0 -0
- package/dist-build-23687264126/4659f3ca46d928b5.js +1 -0
- package/dist-build-23687264126/4659f3ca46d928b5.js.map +1 -0
- package/dist-build-23687264126/4680ba68412e4da9.woff2 +0 -0
- package/dist-build-23687264126/48e37bd7ebf85a1f.woff2 +0 -0
- package/dist-build-23687264126/4aabceefe5a2494a.js +1 -0
- package/dist-build-23687264126/4c188cbaefba58cd.js +1 -0
- package/dist-build-23687264126/4e11b8a7c445255f.woff2 +0 -0
- package/dist-build-23687264126/537ddd61c5c1fce2.woff2 +0 -0
- package/dist-build-23687264126/54f5eee3a7989556.js +1 -0
- package/dist-build-23687264126/55c9107b50dd747c.js +1 -0
- package/dist-build-23687264126/56c4118c0907f151.woff2 +0 -0
- package/dist-build-23687264126/5938bc2ae7ec60c0.woff2 +0 -0
- package/dist-build-23687264126/5c6586155f0d278a.woff2 +0 -0
- package/dist-build-23687264126/5e50c92017029ca3.js +1 -0
- package/dist-build-23687264126/5e50c92017029ca3.js.map +1 -0
- package/dist-build-23687264126/600aca7295d8bcb7.js +2 -0
- package/dist-build-23687264126/600aca7295d8bcb7.js.LICENSE.txt +9 -0
- package/dist-build-23687264126/600aca7295d8bcb7.js.map +1 -0
- package/dist-build-23687264126/60ec587649ba812a.woff2 +0 -0
- package/dist-build-23687264126/64cf08a5ac3266d8.js +1 -0
- package/dist-build-23687264126/652f476a8a1603d3.js +2 -0
- package/dist-build-23687264126/652f476a8a1603d3.js.LICENSE.txt +9 -0
- package/dist-build-23687264126/652f476a8a1603d3.js.map +1 -0
- package/dist-build-23687264126/65e6511e035870e1.woff2 +0 -0
- package/dist-build-23687264126/661425f6798cd16a.woff2 +0 -0
- package/dist-build-23687264126/66b864fe213caf46.woff2 +0 -0
- package/dist-build-23687264126/680eb791e6266590.js +2 -0
- package/dist-build-23687264126/680eb791e6266590.js.LICENSE.txt +19 -0
- package/dist-build-23687264126/680eb791e6266590.js.map +1 -0
- package/dist-build-23687264126/69d087d970ee9455.woff2 +0 -0
- package/dist-build-23687264126/69e3aa4276b4cb4b.js +1 -0
- package/dist-build-23687264126/6a88f03fc4e7c3da.js +1 -0
- package/dist-build-23687264126/6c6c45e66ff54281.woff2 +0 -0
- package/dist-build-23687264126/6d9009857c6df878.js +1 -0
- package/dist-build-23687264126/6ebe7cea59ed2853.js +1 -0
- package/dist-build-23687264126/6f3181849e740935.js +1 -0
- package/dist-build-23687264126/6f3181849e740935.js.map +1 -0
- package/dist-build-23687264126/7073a7323e92bd11.woff2 +0 -0
- package/dist-build-23687264126/70ac433ae2a89a89.js +1 -0
- package/dist-build-23687264126/70ee4ee625ac0ec1.js +1 -0
- package/dist-build-23687264126/718c6cc31274ab1a.woff2 +0 -0
- package/dist-build-23687264126/727696c3934d0966.js +1 -0
- package/dist-build-23687264126/727763c0f0df59dc.js +1 -0
- package/dist-build-23687264126/727763c0f0df59dc.js.map +1 -0
- package/dist-build-23687264126/72cdbedfe04be9f9.woff2 +0 -0
- package/dist-build-23687264126/7509c9f56fe9e532.woff2 +0 -0
- package/dist-build-23687264126/75dc5c5b04adc8bf.woff2 +0 -0
- package/dist-build-23687264126/77b48bc05299ecca.woff2 +0 -0
- package/dist-build-23687264126/7a0a0215c248c73d.woff2 +0 -0
- package/dist-build-23687264126/7c0d0c5180de8729.js +1 -0
- package/dist-build-23687264126/7f00bebb24e40167.woff2 +0 -0
- package/dist-build-23687264126/802c6176541eeed7.woff2 +0 -0
- package/dist-build-23687264126/8080081b3379c637.woff2 +0 -0
- package/dist-build-23687264126/81cfdaeaa0bbca1f.js +1 -0
- package/dist-build-23687264126/8605507b7a8487c4.woff2 +0 -0
- package/dist-build-23687264126/893a160d06428365.js +1 -0
- package/dist-build-23687264126/893a160d06428365.js.map +1 -0
- package/dist-build-23687264126/8a83d654702f6534.woff2 +0 -0
- package/dist-build-23687264126/8fe71173a13fe571.woff2 +0 -0
- package/dist-build-23687264126/94aa912dcac90114.js +1 -0
- package/dist-build-23687264126/9624cec0f9bdd81e.woff2 +0 -0
- package/dist-build-23687264126/98a3af55a1698171.woff2 +0 -0
- package/dist-build-23687264126/99823aaebba56f46.js +1 -0
- package/dist-build-23687264126/9ba85996af74c5ce.woff2 +0 -0
- package/dist-build-23687264126/9ddb22faa35006e7.woff2 +0 -0
- package/dist-build-23687264126/a167fb2799dd741b.woff2 +0 -0
- package/dist-build-23687264126/a2045a5cc4fdf94f.woff2 +0 -0
- package/dist-build-23687264126/a246c73905a31c93.woff2 +0 -0
- package/dist-build-23687264126/a325099b0a580ce2.js +2 -0
- package/dist-build-23687264126/a325099b0a580ce2.js.LICENSE.txt +14 -0
- package/dist-build-23687264126/a325099b0a580ce2.js.map +1 -0
- package/dist-build-23687264126/a401aa7939cb6e6f.woff2 +0 -0
- package/dist-build-23687264126/a40fef67997d3b2c.js +1 -0
- package/dist-build-23687264126/a62897b000a24b86.js +1 -0
- package/dist-build-23687264126/a6ed036f17a1ea29.woff2 +0 -0
- package/dist-build-23687264126/a77bac4877483a0a.js +1 -0
- package/dist-build-23687264126/a9f25ca430709a1a.woff2 +0 -0
- package/dist-build-23687264126/aa0dfbdd569b1c24.js +2 -0
- package/dist-build-23687264126/aa0dfbdd569b1c24.js.LICENSE.txt +5 -0
- package/dist-build-23687264126/aa0dfbdd569b1c24.js.map +1 -0
- package/dist-build-23687264126/ab0f637d6cff12e4.js +1 -0
- package/dist-build-23687264126/afa9121a49e95351.woff2 +0 -0
- package/dist-build-23687264126/afcda12d9f805543.woff2 +0 -0
- package/dist-build-23687264126/b09ded85a7da77f1.woff2 +0 -0
- package/dist-build-23687264126/b10dbe5318a91a12.js +1 -0
- package/dist-build-23687264126/b2f4e9d1e821b71c.woff2 +0 -0
- package/dist-build-23687264126/b4a074bf828bb757.woff2 +0 -0
- package/dist-build-23687264126/b7f447da43f6e596.woff2 +0 -0
- package/dist-build-23687264126/bcca84a524572d10.woff2 +0 -0
- package/dist-build-23687264126/be093e052a6d50eb.js +1 -0
- package/dist-build-23687264126/be4d1f97b11d087c.woff2 +0 -0
- package/dist-build-23687264126/bec14780d81164de.woff2 +0 -0
- package/dist-build-23687264126/c31657fe213c1b5e.js +1 -0
- package/dist-build-23687264126/c49ef726d3f0420b.js +1 -0
- package/dist-build-23687264126/c553f7e0199c5084.woff2 +0 -0
- package/dist-build-23687264126/c94ac2fdc1ff1418.js +1 -0
- package/dist-build-23687264126/c9d9ce9f465df4fe.woff2 +0 -0
- package/dist-build-23687264126/cbbb57b397433964.js +2 -0
- package/dist-build-23687264126/cbbb57b397433964.js.LICENSE.txt +14 -0
- package/dist-build-23687264126/cbbb57b397433964.js.map +1 -0
- package/dist-build-23687264126/d188f7f036ac5779.woff2 +0 -0
- package/dist-build-23687264126/d1aa59bd9c702dc4.js +2 -0
- package/dist-build-23687264126/d1aa59bd9c702dc4.js.LICENSE.txt +32 -0
- package/dist-build-23687264126/d1aa59bd9c702dc4.js.map +1 -0
- package/dist-build-23687264126/d265d81c58525ae4.woff2 +0 -0
- package/dist-build-23687264126/d5942cd81663e136.woff2 +0 -0
- package/dist-build-23687264126/d66b8ff73d95cabb.woff2 +0 -0
- package/dist-build-23687264126/d84bac6d07672dd2.js +1 -0
- package/dist-build-23687264126/d84bac6d07672dd2.js.map +1 -0
- package/dist-build-23687264126/d88899ef0fd16719.woff2 +0 -0
- package/dist-build-23687264126/d92b5ecf31fc187b.js +1 -0
- package/dist-build-23687264126/d9a5d958e69e058d.woff2 +0 -0
- package/dist-build-23687264126/dac90d495be353a0.woff2 +0 -0
- package/dist-build-23687264126/db0550511978dc47.js +1 -0
- package/dist-build-23687264126/dd8ce598529c3fab.woff2 +0 -0
- package/dist-build-23687264126/de013f1be25103fa.woff2 +0 -0
- package/dist-build-23687264126/df222fceeffca849.woff2 +0 -0
- package/dist-build-23687264126/df22bda08ec7964c.js +1 -0
- package/dist-build-23687264126/e05b7f902b02a251.js +1 -0
- package/dist-build-23687264126/e05b7f902b02a251.js.map +1 -0
- package/dist-build-23687264126/e465f1481f0d2e1c.js +1 -0
- package/dist-build-23687264126/e62b00b9199c1ac9.woff2 +0 -0
- package/dist-build-23687264126/e696cef1407b2610.woff2 +0 -0
- package/dist-build-23687264126/eb42de5422d9af00.js +1 -0
- package/dist-build-23687264126/eed48feba743e21c.woff2 +0 -0
- package/dist-build-23687264126/f135ef54213f8975.js +1 -0
- package/dist-build-23687264126/f260e50923d4283b.js +1 -0
- package/dist-build-23687264126/f543c88feb236d11.woff2 +0 -0
- package/dist-build-23687264126/f591b0079faa93fe.woff2 +0 -0
- package/dist-build-23687264126/f6ed27923769ad1d.woff2 +0 -0
- package/dist-build-23687264126/f8d066e92ea157c6.js +1 -0
- package/dist-build-23687264126/fae042506530c1e6.js +1 -0
- package/dist-build-23687264126/favicon.ico +0 -0
- package/dist-build-23687264126/fbebeb4336e67012.woff2 +0 -0
- package/dist-build-23687264126/fd574df77d31a5eb.js +1 -0
- package/dist-build-23687264126/icon_128x128.3dde25c6e69b1c010a6a5d6b27b3f436.png +0 -0
- package/dist-build-23687264126/icon_144x144.e263e02b838d229b02ff9133e6e0f2ba.png +0 -0
- package/dist-build-23687264126/icon_192x192.d3d318638bbe8a10a3c687d3d302d01a.png +0 -0
- package/dist-build-23687264126/icon_256x256.c729f6e7e914b58fcea5ce91d7aa9bad.png +0 -0
- package/dist-build-23687264126/icon_384x384.c8923df6b6bd08eba5c79b78d7fcecc0.png +0 -0
- package/dist-build-23687264126/icon_512x512.7163efb26df832de513bc58d925ea22e.png +0 -0
- package/dist-build-23687264126/icon_96x96.682ee334ae19d49894217370b8596f61.png +0 -0
- package/dist-build-23687264126/index.html +9 -0
- package/dist-build-23687264126/logo-512.png +0 -0
- package/dist-build-23687264126/logo.svg +30 -0
- package/dist-build-23687264126/manifest.266df36f2271d27ae9bcaa196a2976ae.json +47 -0
- package/dist-build-23687264126/openmrs.39723c21cec4b1fc.css +1 -0
- package/dist-build-23687264126/openmrs.39723c21cec4b1fc.css.map +1 -0
- package/dist-build-23687264126/openmrs.44bac4c8520ee42f.css +2 -0
- package/dist-build-23687264126/openmrs.44bac4c8520ee42f.css.map +1 -0
- package/dist-build-23687264126/openmrs.936e8cf6a4b1599d.css +2 -0
- package/dist-build-23687264126/openmrs.936e8cf6a4b1599d.css.map +1 -0
- package/dist-build-23687264126/openmrs.c3adea28ef850516.js +1 -0
- package/dist-build-23687264126/openmrs.c3adea28ef850516.js.map +1 -0
- package/dist-build-23687264126/openmrs.e4daba1e3b840e70.css +25 -0
- package/dist-build-23687264126/openmrs.e4daba1e3b840e70.css.map +1 -0
- package/dist-build-23687264126/service-worker.js +1 -0
- package/dist-build-23687264126/service-worker.js.map +1 -0
- package/e2e/core/env.ts +5 -0
- package/e2e/core/global-setup.ts +34 -0
- package/e2e/core/test.ts +21 -0
- package/e2e/pages/app-shell.page.ts +34 -0
- package/e2e/pages/etl-sources.page.ts +35 -0
- package/e2e/pages/report-sections.page.ts +20 -0
- package/e2e/pages/section-preview.modal.ts +29 -0
- package/e2e/specs/etl-sources.spec.ts +51 -0
- package/e2e/specs/navigation.spec.ts +13 -0
- package/e2e/specs/section-preview-validation.spec.ts +38 -0
- package/e2e/specs/section-preview.spec.ts +94 -0
- package/e2e/tsconfig.json +11 -0
- package/example.env +5 -0
- package/jest.config.js +28 -0
- package/package.json +82 -0
- package/playwright.config.ts +28 -0
- package/src/admin-card-link.extension.module.scss +55 -0
- package/src/admin-card-link.extension.tsx +24 -0
- package/src/components/admin/admin-page.component.tsx +31 -0
- package/src/components/admin/age-categories-page.component.tsx +109 -0
- package/src/components/admin/age-groups-page.component.tsx +146 -0
- package/src/components/admin/etl-sources-page.component.tsx +344 -0
- package/src/components/admin/report-categories-page.component.tsx +256 -0
- package/src/components/admin/report-library-page.component.tsx +540 -0
- package/src/components/ai-support/ai-assist-button.component.tsx +30 -0
- package/src/components/ai-support/ai-assist-modal.component.tsx +81 -0
- package/src/components/ai-support/ai.service.ts +21 -0
- package/src/components/ai-support/ai.types.ts +12 -0
- package/src/components/app-shell/report-builder-shell.component.tsx +120 -0
- package/src/components/app-shell/report-builder-shell.scss +15 -0
- package/src/components/data-themes/data-theme-form.component.tsx +59 -0
- package/src/components/data-themes/data-theme-modal.component.tsx +349 -0
- package/src/components/data-themes/data-themes-page.component.tsx +132 -0
- package/src/components/data-themes/data-themes-table.component.tsx +91 -0
- package/src/components/data-themes/icon-registry.ts +35 -0
- package/src/components/data-themes/sections/data-theme-basics.section.tsx +63 -0
- package/src/components/data-themes/sections/data-theme-condition-columns.section.tsx +397 -0
- package/src/components/data-themes/sections/data-theme-fields-editor.section.tsx +125 -0
- package/src/components/data-themes/sections/data-theme-metadata.section.tsx +245 -0
- package/src/components/data-themes/sections/data-theme-preview.section.tsx +115 -0
- package/src/components/data-themes/sections/data-theme-source.section.tsx +184 -0
- package/src/components/indicators/README.md +24 -0
- package/src/components/indicators/base-indicator-basic-fields.component.tsx +18 -0
- package/src/components/indicators/base-indicator-basics.section.tsx +54 -0
- package/src/components/indicators/base-indicator-countby.section.tsx +25 -0
- package/src/components/indicators/base-indicator-criteria.section.tsx +83 -0
- package/src/components/indicators/base-indicator-details-form.component.tsx +80 -0
- package/src/components/indicators/base-indicator-theme-unit-fields.component.tsx +39 -0
- package/src/components/indicators/create-base-indicator-modal.component.tsx +501 -0
- package/src/components/indicators/create-composite-base-indicator-modal.component.tsx +297 -0
- package/src/components/indicators/create-final-indicator-modal.component.tsx +260 -0
- package/src/components/indicators/diagnosis-filters-form.component.tsx +101 -0
- package/src/components/indicators/disaggregation-panel.component.tsx +93 -0
- package/src/components/indicators/handler/concept-search-multiselect.component.tsx +153 -0
- package/src/components/indicators/handler/question-answer-concept-search.component.tsx +336 -0
- package/src/components/indicators/indicator-status-tag.component.tsx +9 -0
- package/src/components/indicators/indicators-page.component.tsx +481 -0
- package/src/components/indicators/indicators-page.scss +121 -0
- package/src/components/indicators/indicators-table.component.tsx +166 -0
- package/src/components/indicators/preview-table.component.tsx +31 -0
- package/src/components/indicators/sections/composite-indicator-basics.section.tsx +36 -0
- package/src/components/indicators/sections/composite-indicator-picker.section.tsx +161 -0
- package/src/components/indicators/sections/composite-indicator-sql-preview.section.tsx +31 -0
- package/src/components/indicators/sections/final-indicator-basics.section.tsx +46 -0
- package/src/components/indicators/sections/final-indicator-disaggregation.section.tsx +47 -0
- package/src/components/indicators/sections/final-indicator-picker.section.tsx +92 -0
- package/src/components/indicators/sections/final-indicator-preview.section.tsx +20 -0
- package/src/components/indicators/sections/final-indicator-results-preview.section.tsx +65 -0
- package/src/components/indicators/sections/indicator-basics.section.tsx +40 -0
- package/src/components/indicators/sections/indicator-conditions.section.tsx +194 -0
- package/src/components/indicators/sections/indicator-sql-preview.section.tsx +26 -0
- package/src/components/indicators/sections/indicator-theme.section.tsx +48 -0
- package/src/components/indicators/sql-preview.component.tsx +19 -0
- package/src/components/indicators/types/base-indicator-form.types.ts +17 -0
- package/src/components/indicators/types/base-indicator-theme.constants.ts +8 -0
- package/src/components/indicators/types/composite-indicator.types.ts +21 -0
- package/src/components/indicators/types/condition-ui.types.ts +11 -0
- package/src/components/indicators/types/data-theme-config.types.ts +88 -0
- package/src/components/indicators/types/indicator-types.ts +56 -0
- package/src/components/indicators/types/sql-builders.ts +43 -0
- package/src/components/indicators/utils/composite-indicator-sql.utils.ts +206 -0
- package/src/components/indicators/utils/concept-preload.utils.ts +21 -0
- package/src/components/indicators/utils/final-indicator-sql.utils.ts +124 -0
- package/src/components/indicators/utils/indicator-conditions-hydration.utils.ts +254 -0
- package/src/components/indicators/utils/indicator-sql.utils.ts +185 -0
- package/src/components/landing/landing-action-item.component.tsx +50 -0
- package/src/components/landing/landing-action-list.component.tsx +12 -0
- package/src/components/landing/landing-activity-list.component.tsx +47 -0
- package/src/components/landing/landing-footer-grid.component.tsx +45 -0
- package/src/components/landing/landing-hero.component.tsx +18 -0
- package/src/components/landing/landing-section-card.component.tsx +33 -0
- package/src/components/landing/report-builder-landing-page.component.tsx +103 -0
- package/src/components/landing/report-builder-landing-page.scss +131 -0
- package/src/components/report/dashboard/reports-table.component.tsx +145 -0
- package/src/components/report/definition/panels/properties-panel.component.tsx +38 -0
- package/src/components/report/definition/panels/report-structure-panel.component.tsx +61 -0
- package/src/components/report/definition/panels/selection-panel.component.tsx +58 -0
- package/src/components/report/definition/report-definition-editor.component.tsx +99 -0
- package/src/components/report/definition/report-definition.types.ts +66 -0
- package/src/components/report/design/panels/IndicatorPropertiesPanel.scss +33 -0
- package/src/components/report/design/panels/IndicatorPropertiesPanel.tsx +389 -0
- package/src/components/report/design/panels/JsonPreviewPanel.scss +32 -0
- package/src/components/report/design/panels/JsonPreviewPanel.tsx +104 -0
- package/src/components/report/design/panels/mapping-preview-panel.component.tsx +82 -0
- package/src/components/report/design/panels/mapping-preview-panel.scss +55 -0
- package/src/components/report/design/panels/template-structure-panel.component.tsx +296 -0
- package/src/components/report/design/panels/template-structure-panel.scss +81 -0
- package/src/components/report/design/report-design-editor.component.tsx +894 -0
- package/src/components/report/design/report-design.types.ts +43 -0
- package/src/components/report/design/report-design.utils.ts +86 -0
- package/src/components/report/panels/report-detail.component.tsx +71 -0
- package/src/components/report/panels/report-panel-shell.component.tsx +60 -0
- package/src/components/report/report-dashboard.page.component.tsx +75 -0
- package/src/components/report/report-editor.page.component.tsx +466 -0
- package/src/components/report/report.routes.tsx +30 -0
- package/src/components/report-sections/create-report-section-modal.component.tsx +278 -0
- package/src/components/report-sections/hooks/useAgeCategories.ts +25 -0
- package/src/components/report-sections/hooks/useSectionEditorState.ts +306 -0
- package/src/components/report-sections/panels/Dhis2MappingPanel.tsx +157 -0
- package/src/components/report-sections/panels/DisaggregationPanel.tsx +97 -0
- package/src/components/report-sections/panels/IndicatorPickerPanel.tsx +143 -0
- package/src/components/report-sections/panels/SectionBasicsPanel.tsx +27 -0
- package/src/components/report-sections/report-section-preview-modal.component.tsx +418 -0
- package/src/components/report-sections/report-sections-page.component.tsx +313 -0
- package/src/components/report-sections/section-types.ts +55 -0
- package/src/components/report-sections/section-utils.ts +46 -0
- package/src/components/report-sections/sections-page.scss +79 -0
- package/src/components/run-reports/run-reports-page.component.tsx +23 -0
- package/src/components/shared/header/builder-header-actions.component.tsx +38 -0
- package/src/components/shared/header/header.component.tsx +85 -0
- package/src/components/shared/header/header.scss +150 -0
- package/src/components/shared/header/illustration.component.tsx +34 -0
- package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.scss +33 -0
- package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.tsx +389 -0
- package/src/components/shared/json-preview-panel/JsonPreviewPanel.scss +32 -0
- package/src/components/shared/json-preview-panel/JsonPreviewPanel.tsx +104 -0
- package/src/components/shared/mapping-preview-panel/mapping-preview-panel.component.tsx +82 -0
- package/src/components/shared/mapping-preview-panel/mapping-preview-panel.scss +55 -0
- package/src/components/shared/preview/query-results-preview.component.tsx +204 -0
- package/src/components/shared/template-structure-panel/template-structure-panel.component.tsx +296 -0
- package/src/components/shared/template-structure-panel/template-structure-panel.scss +81 -0
- package/src/config-schema.ts +23 -0
- package/src/globals.d.ts +14 -0
- package/src/hooks/theme/useDataThemes.ts +28 -0
- package/src/hooks/theme/useMambaTableMeta.ts +34 -0
- package/src/hooks/theme/useMambaTables.ts +63 -0
- package/src/index.ts +23 -0
- package/src/resources/agegroup/agegroups.api.ts +58 -0
- package/src/resources/concepts/concept-mapper.ts +21 -0
- package/src/resources/concepts/concept-types.ts +31 -0
- package/src/resources/concepts/concepts.resource.ts +44 -0
- package/src/resources/concepts/useConceptSearch.ts +41 -0
- package/src/resources/etl-source/etl-source.api.ts +65 -0
- package/src/resources/indicator/indicators.api.ts +125 -0
- package/src/resources/openmrs-api.ts +24 -0
- package/src/resources/preview/sql-preview.api.ts +54 -0
- package/src/resources/report/reports.api.ts +117 -0
- package/src/resources/report-category/report-category.api.ts +41 -0
- package/src/resources/report-library/report-library.api.ts +63 -0
- package/src/resources/report-section/report-sections.api.ts +73 -0
- package/src/resources/report-section/section-preview.api.ts +21 -0
- package/src/resources/theme/data-theme.api.ts +88 -0
- package/src/resources/theme/mamba-schema.api.ts +31 -0
- package/src/resources/theme/mamba-table-meta.api.ts +45 -0
- package/src/root.component.tsx +20 -0
- package/src/routes/report-builder.routes.tsx +66 -0
- package/src/routes/report-builder.scss +56 -0
- package/src/routes.json +21 -0
- package/src/sample-template.ts +121 -0
- package/src/template-utils.ts +110 -0
- package/src/types/carbon-react-inert.d.ts +13 -0
- package/src/types/condition-operators.ts +49 -0
- package/src/types/theme/data-theme.types.ts +88 -0
- package/src/utils/html-entities.utils.ts +23 -0
- package/tools/setup-tests.ts +1 -0
- package/translations/en.json +4 -0
- package/tsconfig.json +43 -0
- package/webpack.config.js +14 -0
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal, Stack, SideNav, SideNavItems, SideNavLink, Content } from '@carbon/react';
|
|
3
|
+
|
|
4
|
+
import { listDataThemes, getDataTheme, type DataThemeDto } from '../../resources/theme/data-theme.api';
|
|
5
|
+
import type { DataThemeConfig, ThemeCondition } from './types/data-theme-config.types';
|
|
6
|
+
import type { IndicatorCondition } from './types/indicator-types';
|
|
7
|
+
import type { IndicatorDto } from '../../resources/indicator/indicators.api';
|
|
8
|
+
|
|
9
|
+
import IndicatorBasicsSection from './sections/indicator-basics.section';
|
|
10
|
+
import IndicatorThemeSection from './sections/indicator-theme.section';
|
|
11
|
+
import IndicatorConditionsSection from './sections/indicator-conditions.section';
|
|
12
|
+
import IndicatorSqlPreviewSection from './sections/indicator-sql-preview.section';
|
|
13
|
+
|
|
14
|
+
import { buildSqlPreview, applyConditionClauses } from './utils/indicator-sql.utils';
|
|
15
|
+
import type { SelectedConcept } from './handler/concept-search-multiselect.component';
|
|
16
|
+
import type { QAUiState } from './types/condition-ui.types';
|
|
17
|
+
|
|
18
|
+
type PanelKey = 'basics' | 'theme' | 'conditions' | 'sql';
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
type Props = {
|
|
23
|
+
open: boolean;
|
|
24
|
+
mode: 'create' | 'edit';
|
|
25
|
+
initial?: IndicatorDto | null;
|
|
26
|
+
|
|
27
|
+
initialConceptUi?: Record<string, SelectedConcept[]>;
|
|
28
|
+
initialQaUi?: Record<string, QAUiState>;
|
|
29
|
+
|
|
30
|
+
onClose: () => void;
|
|
31
|
+
onCreate: (payload: Partial<IndicatorDto>) => Promise<void>;
|
|
32
|
+
onUpdate: (uuid: string, payload: Partial<IndicatorDto>) => Promise<void>;
|
|
33
|
+
onSaved: () => void;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type BaseIndicatorAuthoring = {
|
|
37
|
+
version: 1;
|
|
38
|
+
themeUuid: string;
|
|
39
|
+
themeConfig: DataThemeConfig;
|
|
40
|
+
conditions: IndicatorCondition[];
|
|
41
|
+
sqlPreview: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
type QAValue = { questions: string[]; answers: string[] };
|
|
45
|
+
|
|
46
|
+
function safeParse<T>(raw: string | undefined | null, fallback: T): T {
|
|
47
|
+
try {
|
|
48
|
+
if (!raw) return fallback;
|
|
49
|
+
const p = JSON.parse(raw);
|
|
50
|
+
return (p ?? fallback) as T;
|
|
51
|
+
} catch {
|
|
52
|
+
return fallback;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function normalizeThemeConfig(rawConfigJson: string | undefined | null): DataThemeConfig {
|
|
57
|
+
const base = safeParse<any>(rawConfigJson, {});
|
|
58
|
+
if (base && typeof base === 'object' && base.configJson && typeof base.configJson === 'object') {
|
|
59
|
+
return base.configJson as DataThemeConfig;
|
|
60
|
+
}
|
|
61
|
+
return base as DataThemeConfig;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function normalizeAuthoring(ind: IndicatorDto | null | undefined): BaseIndicatorAuthoring | null {
|
|
65
|
+
if (!ind?.configJson) return null;
|
|
66
|
+
|
|
67
|
+
let parsed: any = null;
|
|
68
|
+
try {
|
|
69
|
+
parsed = JSON.parse(ind.configJson);
|
|
70
|
+
} catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (!parsed || typeof parsed !== 'object') return null;
|
|
74
|
+
|
|
75
|
+
if (parsed.themeUuid && parsed.themeConfig) {
|
|
76
|
+
return {
|
|
77
|
+
version: 1,
|
|
78
|
+
themeUuid: parsed.themeUuid,
|
|
79
|
+
themeConfig: parsed.themeConfig,
|
|
80
|
+
conditions: Array.isArray(parsed.conditions) ? parsed.conditions : [],
|
|
81
|
+
sqlPreview: parsed.sqlPreview ?? ind.sqlTemplate ?? '',
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (parsed.base?.themeUuid && parsed.base?.themeConfig) {
|
|
86
|
+
return {
|
|
87
|
+
version: 1,
|
|
88
|
+
themeUuid: parsed.base.themeUuid,
|
|
89
|
+
themeConfig: parsed.base.themeConfig,
|
|
90
|
+
conditions: Array.isArray(parsed.base.conditions) ? parsed.base.conditions : [],
|
|
91
|
+
sqlPreview: parsed.base.sqlPreview ?? ind.sqlTemplate ?? '',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (parsed.authoring?.base?.themeUuid && parsed.authoring?.base?.themeConfig) {
|
|
96
|
+
const b = parsed.authoring.base;
|
|
97
|
+
return {
|
|
98
|
+
version: 1,
|
|
99
|
+
themeUuid: b.themeUuid,
|
|
100
|
+
themeConfig: b.themeConfig,
|
|
101
|
+
conditions: Array.isArray(b.conditions) ? b.conditions : [],
|
|
102
|
+
sqlPreview: b.sqlPreview ?? ind.sqlTemplate ?? '',
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function buildAuthoring(
|
|
110
|
+
themeUuid: string,
|
|
111
|
+
themeConfig: DataThemeConfig,
|
|
112
|
+
conditions: IndicatorCondition[],
|
|
113
|
+
sqlPreview: string,
|
|
114
|
+
): BaseIndicatorAuthoring {
|
|
115
|
+
return { version: 1, themeUuid, themeConfig, conditions, sqlPreview };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function defaultValueForTheme(tc: ThemeCondition) {
|
|
119
|
+
if (tc.handler === 'QUESTION_ANSWER_CONCEPT_SEARCH') return { questions: [], answers: [] } as any;
|
|
120
|
+
if (tc.operator === 'IN' || tc.operator === 'NOT_IN') return [] as any;
|
|
121
|
+
return '' as any;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* ✅ Ensures pickedConditions has entries for all theme conditions.
|
|
126
|
+
* Keeps existing values.
|
|
127
|
+
*/
|
|
128
|
+
function normalizePickedAgainstTheme(themeConditions: ThemeCondition[], picked: IndicatorCondition[]) {
|
|
129
|
+
const byKey = new Map<string, IndicatorCondition>();
|
|
130
|
+
for (const p of picked ?? []) if (p?.key) byKey.set(p.key, p);
|
|
131
|
+
|
|
132
|
+
const next: IndicatorCondition[] = [];
|
|
133
|
+
|
|
134
|
+
for (const tc of themeConditions ?? []) {
|
|
135
|
+
if (!tc?.key) continue;
|
|
136
|
+
|
|
137
|
+
const existing = byKey.get(tc.key);
|
|
138
|
+
if (existing) {
|
|
139
|
+
next.push(existing);
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
next.push({
|
|
144
|
+
key: tc.key,
|
|
145
|
+
operator: tc.operator as any,
|
|
146
|
+
valueType: tc.valueType as any,
|
|
147
|
+
value: defaultValueForTheme(tc),
|
|
148
|
+
} as any);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// keep unknown keys to avoid data loss
|
|
152
|
+
for (const p of picked ?? []) {
|
|
153
|
+
if (!p?.key) continue;
|
|
154
|
+
if (!byKey.has(p.key)) continue;
|
|
155
|
+
// already included
|
|
156
|
+
}
|
|
157
|
+
for (const p of picked ?? []) {
|
|
158
|
+
if (!p?.key) continue;
|
|
159
|
+
const inTheme = (themeConditions ?? []).some((tc) => tc?.key === p.key);
|
|
160
|
+
if (!inTheme) next.push(p);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return next;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Before saving, enforce that concept-based conditions persist UUIDs using UI maps.
|
|
168
|
+
*/
|
|
169
|
+
function prepareConditionsForSave(
|
|
170
|
+
themeConditions: ThemeCondition[],
|
|
171
|
+
picked: IndicatorCondition[],
|
|
172
|
+
conceptUi: Record<string, SelectedConcept[]>,
|
|
173
|
+
qaUi: Record<string, QAUiState>,
|
|
174
|
+
): IndicatorCondition[] {
|
|
175
|
+
const byKey = new Map<string, IndicatorCondition>();
|
|
176
|
+
for (const pc of picked ?? []) if (pc?.key) byKey.set(pc.key, pc);
|
|
177
|
+
|
|
178
|
+
const next: IndicatorCondition[] = [];
|
|
179
|
+
|
|
180
|
+
for (const tc of themeConditions ?? []) {
|
|
181
|
+
if (!tc?.key) continue;
|
|
182
|
+
|
|
183
|
+
const existing = byKey.get(tc.key);
|
|
184
|
+
const base: IndicatorCondition = existing
|
|
185
|
+
? { ...existing }
|
|
186
|
+
: ({
|
|
187
|
+
key: tc.key,
|
|
188
|
+
operator: tc.operator,
|
|
189
|
+
valueType: tc.valueType,
|
|
190
|
+
value: defaultValueForTheme(tc),
|
|
191
|
+
} as any);
|
|
192
|
+
|
|
193
|
+
if (tc.handler === 'CONCEPT_SEARCH') {
|
|
194
|
+
const selected = conceptUi?.[tc.key] ?? [];
|
|
195
|
+
const uuids = (selected ?? []).map((c) => c.uuid).filter(Boolean);
|
|
196
|
+
base.valueType = 'conceptUuid' as any;
|
|
197
|
+
base.value = uuids as any;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (tc.handler === 'QUESTION_ANSWER_CONCEPT_SEARCH') {
|
|
201
|
+
const ui = qaUi?.[tc.key] ?? { questions: [], answers: [] };
|
|
202
|
+
const qUuids = (ui.questions ?? []).map((q) => q.uuid).filter(Boolean);
|
|
203
|
+
const aUuids = (ui.answers ?? []).map((a) => a.uuid).filter(Boolean);
|
|
204
|
+
|
|
205
|
+
base.valueType = 'conceptUuid' as any;
|
|
206
|
+
base.value = { questions: qUuids, answers: aUuids } as QAValue as any;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
next.push(base);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// keep unknown keys
|
|
213
|
+
const themeKeys = new Set((themeConditions ?? []).map((t) => t?.key).filter(Boolean) as string[]);
|
|
214
|
+
for (const pc of picked ?? []) {
|
|
215
|
+
if (!pc?.key) continue;
|
|
216
|
+
if (!themeKeys.has(pc.key)) next.push(pc);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return next;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export default function CreateBaseIndicatorModal({
|
|
223
|
+
open,
|
|
224
|
+
mode,
|
|
225
|
+
initial,
|
|
226
|
+
initialConceptUi,
|
|
227
|
+
initialQaUi,
|
|
228
|
+
onClose,
|
|
229
|
+
onCreate,
|
|
230
|
+
onUpdate,
|
|
231
|
+
onSaved,
|
|
232
|
+
}: Props) {
|
|
233
|
+
const isEdit = mode === 'edit';
|
|
234
|
+
|
|
235
|
+
const [active, setActive] = React.useState<PanelKey>('basics');
|
|
236
|
+
|
|
237
|
+
const [name, setName] = React.useState('');
|
|
238
|
+
const [code, setCode] = React.useState('');
|
|
239
|
+
const [description, setDescription] = React.useState('');
|
|
240
|
+
|
|
241
|
+
const [themes, setThemes] = React.useState<DataThemeDto[]>([]);
|
|
242
|
+
const [loadingThemes, setLoadingThemes] = React.useState(false);
|
|
243
|
+
const [themesError, setThemesError] = React.useState<string | null>(null);
|
|
244
|
+
|
|
245
|
+
const [themeUuid, setThemeUuid] = React.useState('');
|
|
246
|
+
const [themeConfig, setThemeConfig] = React.useState<DataThemeConfig | null>(null);
|
|
247
|
+
const [themeConfigError, setThemeConfigError] = React.useState<string | null>(null);
|
|
248
|
+
|
|
249
|
+
const [pickedConditions, setPickedConditions] = React.useState<IndicatorCondition[]>([]);
|
|
250
|
+
|
|
251
|
+
const [conceptUi, setConceptUi] = React.useState<Record<string, SelectedConcept[]>>({});
|
|
252
|
+
const [qaUi, setQaUi] = React.useState<Record<string, QAUiState>>({});
|
|
253
|
+
|
|
254
|
+
const [sqlPreview, setSqlPreview] = React.useState('');
|
|
255
|
+
const [sqlDirty, setSqlDirty] = React.useState(false);
|
|
256
|
+
|
|
257
|
+
React.useEffect(() => {
|
|
258
|
+
if (!open) return;
|
|
259
|
+
|
|
260
|
+
setActive('basics');
|
|
261
|
+
|
|
262
|
+
const ac = new AbortController();
|
|
263
|
+
setLoadingThemes(true);
|
|
264
|
+
setThemesError(null);
|
|
265
|
+
setThemes([]);
|
|
266
|
+
|
|
267
|
+
listDataThemes(undefined, ac.signal)
|
|
268
|
+
.then((data) => setThemes(data ?? []))
|
|
269
|
+
.catch((e) => setThemesError(e?.message ?? 'Failed to load themes'))
|
|
270
|
+
.finally(() => setLoadingThemes(false));
|
|
271
|
+
|
|
272
|
+
return () => ac.abort();
|
|
273
|
+
}, [open]);
|
|
274
|
+
|
|
275
|
+
React.useEffect(() => {
|
|
276
|
+
if (!open) return;
|
|
277
|
+
|
|
278
|
+
if (isEdit && initial) {
|
|
279
|
+
setName(initial.name ?? '');
|
|
280
|
+
setCode(initial.code ?? '');
|
|
281
|
+
setDescription(initial.description ?? '');
|
|
282
|
+
|
|
283
|
+
const authoring = normalizeAuthoring(initial);
|
|
284
|
+
|
|
285
|
+
if (authoring?.themeUuid && authoring?.themeConfig) {
|
|
286
|
+
setThemeUuid(authoring.themeUuid);
|
|
287
|
+
setThemeConfig(authoring.themeConfig);
|
|
288
|
+
setPickedConditions(authoring.conditions ?? []);
|
|
289
|
+
setSqlPreview(authoring.sqlPreview ?? '');
|
|
290
|
+
} else {
|
|
291
|
+
setThemeUuid(initial.themeUuid ?? '');
|
|
292
|
+
setThemeConfig(null);
|
|
293
|
+
setPickedConditions([]);
|
|
294
|
+
setSqlPreview('');
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
setConceptUi(initialConceptUi ?? {});
|
|
298
|
+
setQaUi(initialQaUi ?? {});
|
|
299
|
+
setSqlDirty(false);
|
|
300
|
+
} else {
|
|
301
|
+
setName('');
|
|
302
|
+
setCode('');
|
|
303
|
+
setDescription('');
|
|
304
|
+
setThemeUuid('');
|
|
305
|
+
setThemeConfig(null);
|
|
306
|
+
setThemeConfigError(null);
|
|
307
|
+
setPickedConditions([]);
|
|
308
|
+
setConceptUi({});
|
|
309
|
+
setQaUi({});
|
|
310
|
+
setSqlPreview('');
|
|
311
|
+
setSqlDirty(true);
|
|
312
|
+
}
|
|
313
|
+
}, [open, isEdit, initial, initialConceptUi, initialQaUi]);
|
|
314
|
+
|
|
315
|
+
const onThemeUuidChange = React.useCallback((uuid: string) => {
|
|
316
|
+
setThemeUuid(uuid);
|
|
317
|
+
setSqlDirty(true);
|
|
318
|
+
}, []);
|
|
319
|
+
|
|
320
|
+
const onPickedChange = React.useCallback(
|
|
321
|
+
(next: React.SetStateAction<IndicatorCondition[]>) => {
|
|
322
|
+
setPickedConditions(next);
|
|
323
|
+
setSqlDirty(true);
|
|
324
|
+
},
|
|
325
|
+
[],
|
|
326
|
+
);
|
|
327
|
+
|
|
328
|
+
React.useEffect(() => {
|
|
329
|
+
if (!open) return;
|
|
330
|
+
|
|
331
|
+
if (!themeUuid) {
|
|
332
|
+
setThemeConfig(null);
|
|
333
|
+
setThemeConfigError(null);
|
|
334
|
+
setPickedConditions([]);
|
|
335
|
+
if (!isEdit) setSqlPreview('');
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (themeConfig?.sourceTable && initial?.configJson) {
|
|
340
|
+
const authoring = normalizeAuthoring(initial);
|
|
341
|
+
if (authoring?.themeUuid === themeUuid && authoring?.themeConfig?.sourceTable === themeConfig.sourceTable) {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const ac = new AbortController();
|
|
347
|
+
setThemeConfigError(null);
|
|
348
|
+
|
|
349
|
+
getDataTheme(themeUuid, ac.signal)
|
|
350
|
+
.then((full) => {
|
|
351
|
+
const cfg = normalizeThemeConfig(full.configJson);
|
|
352
|
+
setThemeConfig(cfg);
|
|
353
|
+
|
|
354
|
+
// ✅ CRITICAL: normalize picked so ALL theme conditions exist (fixes SQL preview)
|
|
355
|
+
setPickedConditions((prev) => normalizePickedAgainstTheme(cfg.conditions ?? [], prev ?? []));
|
|
356
|
+
|
|
357
|
+
// init missing UI keys only
|
|
358
|
+
setConceptUi((prev) => {
|
|
359
|
+
const next = { ...(prev ?? {}) };
|
|
360
|
+
for (const c of cfg.conditions ?? []) {
|
|
361
|
+
if (c.handler === 'CONCEPT_SEARCH' && !(c.key in next)) next[c.key] = [];
|
|
362
|
+
}
|
|
363
|
+
return next;
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
setQaUi((prev) => {
|
|
367
|
+
const next = { ...(prev ?? {}) };
|
|
368
|
+
for (const c of cfg.conditions ?? []) {
|
|
369
|
+
if (c.handler === 'QUESTION_ANSWER_CONCEPT_SEARCH' && !(c.key in next)) {
|
|
370
|
+
next[c.key] = { questions: [], answers: [] };
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return next;
|
|
374
|
+
});
|
|
375
|
+
})
|
|
376
|
+
.catch((e) => setThemeConfigError(e?.message ?? 'Failed to load theme config'));
|
|
377
|
+
|
|
378
|
+
return () => ac.abort();
|
|
379
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
380
|
+
}, [open, themeUuid]);
|
|
381
|
+
|
|
382
|
+
React.useEffect(() => {
|
|
383
|
+
if (!themeConfig) return;
|
|
384
|
+
|
|
385
|
+
if (isEdit && !sqlDirty) return;
|
|
386
|
+
|
|
387
|
+
const base = buildSqlPreview(themeConfig);
|
|
388
|
+
setSqlPreview(applyConditionClauses(base, themeConfig.conditions ?? [], pickedConditions));
|
|
389
|
+
}, [themeConfig, pickedConditions, isEdit, sqlDirty]);
|
|
390
|
+
|
|
391
|
+
const canSave =
|
|
392
|
+
Boolean(name.trim()) &&
|
|
393
|
+
Boolean(themeUuid) &&
|
|
394
|
+
Boolean(themeConfig?.sourceTable) &&
|
|
395
|
+
Boolean(themeConfig?.patientIdColumn) &&
|
|
396
|
+
Boolean(themeConfig?.dateColumn);
|
|
397
|
+
|
|
398
|
+
const save = async () => {
|
|
399
|
+
if (!canSave || !themeConfig) return;
|
|
400
|
+
|
|
401
|
+
const preparedConditions = prepareConditionsForSave(themeConfig.conditions ?? [], pickedConditions, conceptUi, qaUi);
|
|
402
|
+
const authoring = buildAuthoring(themeUuid, themeConfig, preparedConditions, sqlPreview);
|
|
403
|
+
|
|
404
|
+
const payload: Partial<IndicatorDto> = {
|
|
405
|
+
name: name.trim(),
|
|
406
|
+
code: code.trim() || undefined,
|
|
407
|
+
description: description.trim() || undefined,
|
|
408
|
+
kind: 'BASE',
|
|
409
|
+
defaultValueType: 'NUMBER',
|
|
410
|
+
themeUuid,
|
|
411
|
+
configJson: JSON.stringify(authoring, null, 2),
|
|
412
|
+
sqlTemplate: sqlPreview,
|
|
413
|
+
metaJson: undefined,
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
if (isEdit && initial?.uuid) await onUpdate(initial.uuid, payload);
|
|
417
|
+
else await onCreate(payload);
|
|
418
|
+
|
|
419
|
+
onSaved();
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
if (!open) return null;
|
|
423
|
+
|
|
424
|
+
const NavLink = ({ id, label }: { id: PanelKey; label: string }) => (
|
|
425
|
+
<SideNavLink isActive={active === id} onClick={() => setActive(id)}>
|
|
426
|
+
{label}
|
|
427
|
+
</SideNavLink>
|
|
428
|
+
);
|
|
429
|
+
|
|
430
|
+
return (
|
|
431
|
+
<Modal
|
|
432
|
+
open={open}
|
|
433
|
+
modalHeading={isEdit ? 'Edit Base Indicator' : 'Create Base Indicator'}
|
|
434
|
+
primaryButtonText={isEdit ? 'Save' : 'Create'}
|
|
435
|
+
secondaryButtonText="Cancel"
|
|
436
|
+
onRequestClose={onClose}
|
|
437
|
+
onRequestSubmit={save}
|
|
438
|
+
primaryButtonDisabled={!canSave}
|
|
439
|
+
size="lg"
|
|
440
|
+
>
|
|
441
|
+
<Stack gap={6}>
|
|
442
|
+
<div style={{ display: 'grid', gridTemplateColumns: '240px 1fr', gap: '1rem' }}>
|
|
443
|
+
<div>
|
|
444
|
+
<SideNav expanded isPersistent={false} aria-label="Indicator editor sections">
|
|
445
|
+
<SideNavItems>
|
|
446
|
+
<NavLink id="basics" label="Basics" />
|
|
447
|
+
<NavLink id="theme" label="Theme" />
|
|
448
|
+
<NavLink id="conditions" label="Conditions" />
|
|
449
|
+
<NavLink id="sql" label="SQL Preview" />
|
|
450
|
+
</SideNavItems>
|
|
451
|
+
</SideNav>
|
|
452
|
+
</div>
|
|
453
|
+
|
|
454
|
+
<Content style={{ padding: 0 }}>
|
|
455
|
+
{active === 'basics' ? (
|
|
456
|
+
<IndicatorBasicsSection
|
|
457
|
+
value={{ name, code, description }}
|
|
458
|
+
onChange={(next) => {
|
|
459
|
+
setName(next.name);
|
|
460
|
+
setCode(next.code);
|
|
461
|
+
setDescription(next.description);
|
|
462
|
+
}}
|
|
463
|
+
/>
|
|
464
|
+
) : null}
|
|
465
|
+
|
|
466
|
+
{active === 'theme' ? (
|
|
467
|
+
<IndicatorThemeSection
|
|
468
|
+
themes={themes}
|
|
469
|
+
loading={loadingThemes}
|
|
470
|
+
error={themesError}
|
|
471
|
+
themeUuid={themeUuid}
|
|
472
|
+
onThemeUuidChange={onThemeUuidChange}
|
|
473
|
+
themeConfigError={themeConfigError}
|
|
474
|
+
/>
|
|
475
|
+
) : null}
|
|
476
|
+
|
|
477
|
+
{active === 'conditions' ? (
|
|
478
|
+
<IndicatorConditionsSection
|
|
479
|
+
conditions={themeConfig?.conditions ?? []}
|
|
480
|
+
picked={pickedConditions}
|
|
481
|
+
onPickedChange={onPickedChange}
|
|
482
|
+
conceptUi={conceptUi}
|
|
483
|
+
onConceptUiChange={(next) => {
|
|
484
|
+
setConceptUi(next);
|
|
485
|
+
setSqlDirty(true);
|
|
486
|
+
}}
|
|
487
|
+
qaUi={qaUi}
|
|
488
|
+
onQaUiChange={(next) => {
|
|
489
|
+
setQaUi(next);
|
|
490
|
+
setSqlDirty(true);
|
|
491
|
+
}}
|
|
492
|
+
/>
|
|
493
|
+
) : null}
|
|
494
|
+
|
|
495
|
+
{active === 'sql' ? <IndicatorSqlPreviewSection sql={sqlPreview} /> : null}
|
|
496
|
+
</Content>
|
|
497
|
+
</div>
|
|
498
|
+
</Stack>
|
|
499
|
+
</Modal>
|
|
500
|
+
);
|
|
501
|
+
}
|