@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.
Files changed (586) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +19 -0
  3. package/.github/workflows/main.yml +162 -0
  4. package/.prettierrc +8 -0
  5. package/LICENSE +401 -0
  6. package/README.md +317 -0
  7. package/dist/0081d5d3d536cb23.js +1 -0
  8. package/dist/02acc4469a2fe2e4.woff2 +0 -0
  9. package/dist/081587ca0db8e63f.woff2 +0 -0
  10. package/dist/08cf53c4e5e71cf1.woff2 +0 -0
  11. package/dist/090b2bc014d24ea4.woff2 +0 -0
  12. package/dist/09de5db63ef7b579.js +1 -0
  13. package/dist/0ae92bcea615e948.woff2 +0 -0
  14. package/dist/0be8520d8945b3b7.woff2 +0 -0
  15. package/dist/0e7dd073cd8bb0ad.woff2 +0 -0
  16. package/dist/0edb77cd19e43550.js +1 -0
  17. package/dist/14869ac5d1830304.woff2 +0 -0
  18. package/dist/14aaceff85fc8b28.woff2 +0 -0
  19. package/dist/14c3abea79fc1389.js +1 -0
  20. package/dist/155a4ac079785bfd.js +1 -0
  21. package/dist/155a4ac079785bfd.js.map +1 -0
  22. package/dist/16f443eed01776ca.woff2 +0 -0
  23. package/dist/183bae0e53a22182.woff2 +0 -0
  24. package/dist/19c8f94ccd6289f5.woff2 +0 -0
  25. package/dist/1ae86565eab7451c.woff2 +0 -0
  26. package/dist/1c7bf8797e0a9be6.woff2 +0 -0
  27. package/dist/1f266d3619b30f16.woff2 +0 -0
  28. package/dist/1f8c5a4087a524fd.woff2 +0 -0
  29. package/dist/20ba2b23c5c0cd0b.woff2 +0 -0
  30. package/dist/22a32bd51591301b.js +1 -0
  31. package/dist/273c72d90e432a3d.js +1 -0
  32. package/dist/295dd01a1fbfee6d.woff2 +0 -0
  33. package/dist/29cbe6827c3f03ef.js +1 -0
  34. package/dist/2f686985e26e7107.woff2 +0 -0
  35. package/dist/315eff729e4ccbd9.woff2 +0 -0
  36. package/dist/368d16e3259bf207.woff2 +0 -0
  37. package/dist/36c49aa341a7079a.woff2 +0 -0
  38. package/dist/36e1e0430475edee.woff2 +0 -0
  39. package/dist/374c3ee36d9e040a.js +1 -0
  40. package/dist/377971e519bf3f4a.js +2 -0
  41. package/dist/377971e519bf3f4a.js.LICENSE.txt +39 -0
  42. package/dist/377971e519bf3f4a.js.map +1 -0
  43. package/dist/3b0ea8395009dcf3.js +2 -0
  44. package/dist/3b0ea8395009dcf3.js.LICENSE.txt +9 -0
  45. package/dist/3b0ea8395009dcf3.js.map +1 -0
  46. package/dist/3bc19662b8630ee9.woff2 +0 -0
  47. package/dist/3f645f473b3f8fba.woff2 +0 -0
  48. package/dist/41320d8930d23b36.js +1 -0
  49. package/dist/4218ac9901b9d36d.woff2 +0 -0
  50. package/dist/4659f3ca46d928b5.js +1 -0
  51. package/dist/4659f3ca46d928b5.js.map +1 -0
  52. package/dist/4680ba68412e4da9.woff2 +0 -0
  53. package/dist/48e37bd7ebf85a1f.woff2 +0 -0
  54. package/dist/4aabceefe5a2494a.js +1 -0
  55. package/dist/4c188cbaefba58cd.js +1 -0
  56. package/dist/4e11b8a7c445255f.woff2 +0 -0
  57. package/dist/537ddd61c5c1fce2.woff2 +0 -0
  58. package/dist/54f5eee3a7989556.js +1 -0
  59. package/dist/55c9107b50dd747c.js +1 -0
  60. package/dist/56c4118c0907f151.woff2 +0 -0
  61. package/dist/5938bc2ae7ec60c0.woff2 +0 -0
  62. package/dist/5c6586155f0d278a.woff2 +0 -0
  63. package/dist/5e50c92017029ca3.js +1 -0
  64. package/dist/5e50c92017029ca3.js.map +1 -0
  65. package/dist/600aca7295d8bcb7.js +2 -0
  66. package/dist/600aca7295d8bcb7.js.LICENSE.txt +9 -0
  67. package/dist/600aca7295d8bcb7.js.map +1 -0
  68. package/dist/60ec587649ba812a.woff2 +0 -0
  69. package/dist/64cf08a5ac3266d8.js +1 -0
  70. package/dist/652f476a8a1603d3.js +2 -0
  71. package/dist/652f476a8a1603d3.js.LICENSE.txt +9 -0
  72. package/dist/652f476a8a1603d3.js.map +1 -0
  73. package/dist/65e6511e035870e1.woff2 +0 -0
  74. package/dist/661425f6798cd16a.woff2 +0 -0
  75. package/dist/66b864fe213caf46.woff2 +0 -0
  76. package/dist/680eb791e6266590.js +2 -0
  77. package/dist/680eb791e6266590.js.LICENSE.txt +19 -0
  78. package/dist/680eb791e6266590.js.map +1 -0
  79. package/dist/69d087d970ee9455.woff2 +0 -0
  80. package/dist/69e3aa4276b4cb4b.js +1 -0
  81. package/dist/6a88f03fc4e7c3da.js +1 -0
  82. package/dist/6c6c45e66ff54281.woff2 +0 -0
  83. package/dist/6d9009857c6df878.js +1 -0
  84. package/dist/6ebe7cea59ed2853.js +1 -0
  85. package/dist/6f3181849e740935.js +1 -0
  86. package/dist/6f3181849e740935.js.map +1 -0
  87. package/dist/7073a7323e92bd11.woff2 +0 -0
  88. package/dist/70ac433ae2a89a89.js +1 -0
  89. package/dist/70ee4ee625ac0ec1.js +1 -0
  90. package/dist/718c6cc31274ab1a.woff2 +0 -0
  91. package/dist/727696c3934d0966.js +1 -0
  92. package/dist/727763c0f0df59dc.js +1 -0
  93. package/dist/727763c0f0df59dc.js.map +1 -0
  94. package/dist/72cdbedfe04be9f9.woff2 +0 -0
  95. package/dist/7509c9f56fe9e532.woff2 +0 -0
  96. package/dist/75dc5c5b04adc8bf.woff2 +0 -0
  97. package/dist/77b48bc05299ecca.woff2 +0 -0
  98. package/dist/7a0a0215c248c73d.woff2 +0 -0
  99. package/dist/7c0d0c5180de8729.js +1 -0
  100. package/dist/7f00bebb24e40167.woff2 +0 -0
  101. package/dist/802c6176541eeed7.woff2 +0 -0
  102. package/dist/8080081b3379c637.woff2 +0 -0
  103. package/dist/81cfdaeaa0bbca1f.js +1 -0
  104. package/dist/8605507b7a8487c4.woff2 +0 -0
  105. package/dist/893a160d06428365.js +1 -0
  106. package/dist/893a160d06428365.js.map +1 -0
  107. package/dist/8a83d654702f6534.woff2 +0 -0
  108. package/dist/8fe71173a13fe571.woff2 +0 -0
  109. package/dist/94aa912dcac90114.js +1 -0
  110. package/dist/9624cec0f9bdd81e.woff2 +0 -0
  111. package/dist/98a3af55a1698171.woff2 +0 -0
  112. package/dist/99823aaebba56f46.js +1 -0
  113. package/dist/9ba85996af74c5ce.woff2 +0 -0
  114. package/dist/9ddb22faa35006e7.woff2 +0 -0
  115. package/dist/a167fb2799dd741b.woff2 +0 -0
  116. package/dist/a2045a5cc4fdf94f.woff2 +0 -0
  117. package/dist/a246c73905a31c93.woff2 +0 -0
  118. package/dist/a325099b0a580ce2.js +2 -0
  119. package/dist/a325099b0a580ce2.js.LICENSE.txt +14 -0
  120. package/dist/a325099b0a580ce2.js.map +1 -0
  121. package/dist/a401aa7939cb6e6f.woff2 +0 -0
  122. package/dist/a40fef67997d3b2c.js +1 -0
  123. package/dist/a62897b000a24b86.js +1 -0
  124. package/dist/a6ed036f17a1ea29.woff2 +0 -0
  125. package/dist/a77bac4877483a0a.js +1 -0
  126. package/dist/a9f25ca430709a1a.woff2 +0 -0
  127. package/dist/aa0dfbdd569b1c24.js +2 -0
  128. package/dist/aa0dfbdd569b1c24.js.LICENSE.txt +5 -0
  129. package/dist/aa0dfbdd569b1c24.js.map +1 -0
  130. package/dist/ab0f637d6cff12e4.js +1 -0
  131. package/dist/afa9121a49e95351.woff2 +0 -0
  132. package/dist/afcda12d9f805543.woff2 +0 -0
  133. package/dist/b09ded85a7da77f1.woff2 +0 -0
  134. package/dist/b10dbe5318a91a12.js +1 -0
  135. package/dist/b2f4e9d1e821b71c.woff2 +0 -0
  136. package/dist/b4a074bf828bb757.woff2 +0 -0
  137. package/dist/b7f447da43f6e596.woff2 +0 -0
  138. package/dist/bcca84a524572d10.woff2 +0 -0
  139. package/dist/be093e052a6d50eb.js +1 -0
  140. package/dist/be4d1f97b11d087c.woff2 +0 -0
  141. package/dist/bec14780d81164de.woff2 +0 -0
  142. package/dist/c31657fe213c1b5e.js +1 -0
  143. package/dist/c49ef726d3f0420b.js +1 -0
  144. package/dist/c553f7e0199c5084.woff2 +0 -0
  145. package/dist/c94ac2fdc1ff1418.js +1 -0
  146. package/dist/c9d9ce9f465df4fe.woff2 +0 -0
  147. package/dist/cbbb57b397433964.js +2 -0
  148. package/dist/cbbb57b397433964.js.LICENSE.txt +14 -0
  149. package/dist/cbbb57b397433964.js.map +1 -0
  150. package/dist/d188f7f036ac5779.woff2 +0 -0
  151. package/dist/d1aa59bd9c702dc4.js +2 -0
  152. package/dist/d1aa59bd9c702dc4.js.LICENSE.txt +32 -0
  153. package/dist/d1aa59bd9c702dc4.js.map +1 -0
  154. package/dist/d265d81c58525ae4.woff2 +0 -0
  155. package/dist/d5942cd81663e136.woff2 +0 -0
  156. package/dist/d66b8ff73d95cabb.woff2 +0 -0
  157. package/dist/d84bac6d07672dd2.js +1 -0
  158. package/dist/d84bac6d07672dd2.js.map +1 -0
  159. package/dist/d88899ef0fd16719.woff2 +0 -0
  160. package/dist/d92b5ecf31fc187b.js +1 -0
  161. package/dist/d9a5d958e69e058d.woff2 +0 -0
  162. package/dist/dac90d495be353a0.woff2 +0 -0
  163. package/dist/db0550511978dc47.js +1 -0
  164. package/dist/dd8ce598529c3fab.woff2 +0 -0
  165. package/dist/de013f1be25103fa.woff2 +0 -0
  166. package/dist/df222fceeffca849.woff2 +0 -0
  167. package/dist/df22bda08ec7964c.js +1 -0
  168. package/dist/e05b7f902b02a251.js +1 -0
  169. package/dist/e05b7f902b02a251.js.map +1 -0
  170. package/dist/e465f1481f0d2e1c.js +1 -0
  171. package/dist/e62b00b9199c1ac9.woff2 +0 -0
  172. package/dist/e696cef1407b2610.woff2 +0 -0
  173. package/dist/eb42de5422d9af00.js +1 -0
  174. package/dist/eed48feba743e21c.woff2 +0 -0
  175. package/dist/f135ef54213f8975.js +1 -0
  176. package/dist/f260e50923d4283b.js +1 -0
  177. package/dist/f543c88feb236d11.woff2 +0 -0
  178. package/dist/f591b0079faa93fe.woff2 +0 -0
  179. package/dist/f6ed27923769ad1d.woff2 +0 -0
  180. package/dist/f8d066e92ea157c6.js +1 -0
  181. package/dist/fae042506530c1e6.js +1 -0
  182. package/dist/favicon.ico +0 -0
  183. package/dist/fbebeb4336e67012.woff2 +0 -0
  184. package/dist/fd574df77d31a5eb.js +1 -0
  185. package/dist/icon_128x128.3dde25c6e69b1c010a6a5d6b27b3f436.png +0 -0
  186. package/dist/icon_144x144.e263e02b838d229b02ff9133e6e0f2ba.png +0 -0
  187. package/dist/icon_192x192.d3d318638bbe8a10a3c687d3d302d01a.png +0 -0
  188. package/dist/icon_256x256.c729f6e7e914b58fcea5ce91d7aa9bad.png +0 -0
  189. package/dist/icon_384x384.c8923df6b6bd08eba5c79b78d7fcecc0.png +0 -0
  190. package/dist/icon_512x512.7163efb26df832de513bc58d925ea22e.png +0 -0
  191. package/dist/icon_96x96.682ee334ae19d49894217370b8596f61.png +0 -0
  192. package/dist/index.html +9 -0
  193. package/dist/logo-512.png +0 -0
  194. package/dist/logo.svg +30 -0
  195. package/dist/manifest.266df36f2271d27ae9bcaa196a2976ae.json +47 -0
  196. package/dist/openmrs.39723c21cec4b1fc.css +1 -0
  197. package/dist/openmrs.39723c21cec4b1fc.css.map +1 -0
  198. package/dist/openmrs.44bac4c8520ee42f.css +2 -0
  199. package/dist/openmrs.44bac4c8520ee42f.css.map +1 -0
  200. package/dist/openmrs.936e8cf6a4b1599d.css +2 -0
  201. package/dist/openmrs.936e8cf6a4b1599d.css.map +1 -0
  202. package/dist/openmrs.c3adea28ef850516.js +1 -0
  203. package/dist/openmrs.c3adea28ef850516.js.map +1 -0
  204. package/dist/openmrs.e4daba1e3b840e70.css +25 -0
  205. package/dist/openmrs.e4daba1e3b840e70.css.map +1 -0
  206. package/dist/service-worker.js +1 -0
  207. package/dist/service-worker.js.map +1 -0
  208. package/dist-build-23687264126/0081d5d3d536cb23.js +1 -0
  209. package/dist-build-23687264126/02acc4469a2fe2e4.woff2 +0 -0
  210. package/dist-build-23687264126/081587ca0db8e63f.woff2 +0 -0
  211. package/dist-build-23687264126/08cf53c4e5e71cf1.woff2 +0 -0
  212. package/dist-build-23687264126/090b2bc014d24ea4.woff2 +0 -0
  213. package/dist-build-23687264126/09de5db63ef7b579.js +1 -0
  214. package/dist-build-23687264126/0ae92bcea615e948.woff2 +0 -0
  215. package/dist-build-23687264126/0be8520d8945b3b7.woff2 +0 -0
  216. package/dist-build-23687264126/0e7dd073cd8bb0ad.woff2 +0 -0
  217. package/dist-build-23687264126/0edb77cd19e43550.js +1 -0
  218. package/dist-build-23687264126/14869ac5d1830304.woff2 +0 -0
  219. package/dist-build-23687264126/14aaceff85fc8b28.woff2 +0 -0
  220. package/dist-build-23687264126/14c3abea79fc1389.js +1 -0
  221. package/dist-build-23687264126/155a4ac079785bfd.js +1 -0
  222. package/dist-build-23687264126/155a4ac079785bfd.js.map +1 -0
  223. package/dist-build-23687264126/16f443eed01776ca.woff2 +0 -0
  224. package/dist-build-23687264126/183bae0e53a22182.woff2 +0 -0
  225. package/dist-build-23687264126/19c8f94ccd6289f5.woff2 +0 -0
  226. package/dist-build-23687264126/1ae86565eab7451c.woff2 +0 -0
  227. package/dist-build-23687264126/1c7bf8797e0a9be6.woff2 +0 -0
  228. package/dist-build-23687264126/1f266d3619b30f16.woff2 +0 -0
  229. package/dist-build-23687264126/1f8c5a4087a524fd.woff2 +0 -0
  230. package/dist-build-23687264126/20ba2b23c5c0cd0b.woff2 +0 -0
  231. package/dist-build-23687264126/22a32bd51591301b.js +1 -0
  232. package/dist-build-23687264126/273c72d90e432a3d.js +1 -0
  233. package/dist-build-23687264126/295dd01a1fbfee6d.woff2 +0 -0
  234. package/dist-build-23687264126/29cbe6827c3f03ef.js +1 -0
  235. package/dist-build-23687264126/2f686985e26e7107.woff2 +0 -0
  236. package/dist-build-23687264126/315eff729e4ccbd9.woff2 +0 -0
  237. package/dist-build-23687264126/368d16e3259bf207.woff2 +0 -0
  238. package/dist-build-23687264126/36c49aa341a7079a.woff2 +0 -0
  239. package/dist-build-23687264126/36e1e0430475edee.woff2 +0 -0
  240. package/dist-build-23687264126/374c3ee36d9e040a.js +1 -0
  241. package/dist-build-23687264126/377971e519bf3f4a.js +2 -0
  242. package/dist-build-23687264126/377971e519bf3f4a.js.LICENSE.txt +39 -0
  243. package/dist-build-23687264126/377971e519bf3f4a.js.map +1 -0
  244. package/dist-build-23687264126/3b0ea8395009dcf3.js +2 -0
  245. package/dist-build-23687264126/3b0ea8395009dcf3.js.LICENSE.txt +9 -0
  246. package/dist-build-23687264126/3b0ea8395009dcf3.js.map +1 -0
  247. package/dist-build-23687264126/3bc19662b8630ee9.woff2 +0 -0
  248. package/dist-build-23687264126/3f645f473b3f8fba.woff2 +0 -0
  249. package/dist-build-23687264126/41320d8930d23b36.js +1 -0
  250. package/dist-build-23687264126/4218ac9901b9d36d.woff2 +0 -0
  251. package/dist-build-23687264126/4659f3ca46d928b5.js +1 -0
  252. package/dist-build-23687264126/4659f3ca46d928b5.js.map +1 -0
  253. package/dist-build-23687264126/4680ba68412e4da9.woff2 +0 -0
  254. package/dist-build-23687264126/48e37bd7ebf85a1f.woff2 +0 -0
  255. package/dist-build-23687264126/4aabceefe5a2494a.js +1 -0
  256. package/dist-build-23687264126/4c188cbaefba58cd.js +1 -0
  257. package/dist-build-23687264126/4e11b8a7c445255f.woff2 +0 -0
  258. package/dist-build-23687264126/537ddd61c5c1fce2.woff2 +0 -0
  259. package/dist-build-23687264126/54f5eee3a7989556.js +1 -0
  260. package/dist-build-23687264126/55c9107b50dd747c.js +1 -0
  261. package/dist-build-23687264126/56c4118c0907f151.woff2 +0 -0
  262. package/dist-build-23687264126/5938bc2ae7ec60c0.woff2 +0 -0
  263. package/dist-build-23687264126/5c6586155f0d278a.woff2 +0 -0
  264. package/dist-build-23687264126/5e50c92017029ca3.js +1 -0
  265. package/dist-build-23687264126/5e50c92017029ca3.js.map +1 -0
  266. package/dist-build-23687264126/600aca7295d8bcb7.js +2 -0
  267. package/dist-build-23687264126/600aca7295d8bcb7.js.LICENSE.txt +9 -0
  268. package/dist-build-23687264126/600aca7295d8bcb7.js.map +1 -0
  269. package/dist-build-23687264126/60ec587649ba812a.woff2 +0 -0
  270. package/dist-build-23687264126/64cf08a5ac3266d8.js +1 -0
  271. package/dist-build-23687264126/652f476a8a1603d3.js +2 -0
  272. package/dist-build-23687264126/652f476a8a1603d3.js.LICENSE.txt +9 -0
  273. package/dist-build-23687264126/652f476a8a1603d3.js.map +1 -0
  274. package/dist-build-23687264126/65e6511e035870e1.woff2 +0 -0
  275. package/dist-build-23687264126/661425f6798cd16a.woff2 +0 -0
  276. package/dist-build-23687264126/66b864fe213caf46.woff2 +0 -0
  277. package/dist-build-23687264126/680eb791e6266590.js +2 -0
  278. package/dist-build-23687264126/680eb791e6266590.js.LICENSE.txt +19 -0
  279. package/dist-build-23687264126/680eb791e6266590.js.map +1 -0
  280. package/dist-build-23687264126/69d087d970ee9455.woff2 +0 -0
  281. package/dist-build-23687264126/69e3aa4276b4cb4b.js +1 -0
  282. package/dist-build-23687264126/6a88f03fc4e7c3da.js +1 -0
  283. package/dist-build-23687264126/6c6c45e66ff54281.woff2 +0 -0
  284. package/dist-build-23687264126/6d9009857c6df878.js +1 -0
  285. package/dist-build-23687264126/6ebe7cea59ed2853.js +1 -0
  286. package/dist-build-23687264126/6f3181849e740935.js +1 -0
  287. package/dist-build-23687264126/6f3181849e740935.js.map +1 -0
  288. package/dist-build-23687264126/7073a7323e92bd11.woff2 +0 -0
  289. package/dist-build-23687264126/70ac433ae2a89a89.js +1 -0
  290. package/dist-build-23687264126/70ee4ee625ac0ec1.js +1 -0
  291. package/dist-build-23687264126/718c6cc31274ab1a.woff2 +0 -0
  292. package/dist-build-23687264126/727696c3934d0966.js +1 -0
  293. package/dist-build-23687264126/727763c0f0df59dc.js +1 -0
  294. package/dist-build-23687264126/727763c0f0df59dc.js.map +1 -0
  295. package/dist-build-23687264126/72cdbedfe04be9f9.woff2 +0 -0
  296. package/dist-build-23687264126/7509c9f56fe9e532.woff2 +0 -0
  297. package/dist-build-23687264126/75dc5c5b04adc8bf.woff2 +0 -0
  298. package/dist-build-23687264126/77b48bc05299ecca.woff2 +0 -0
  299. package/dist-build-23687264126/7a0a0215c248c73d.woff2 +0 -0
  300. package/dist-build-23687264126/7c0d0c5180de8729.js +1 -0
  301. package/dist-build-23687264126/7f00bebb24e40167.woff2 +0 -0
  302. package/dist-build-23687264126/802c6176541eeed7.woff2 +0 -0
  303. package/dist-build-23687264126/8080081b3379c637.woff2 +0 -0
  304. package/dist-build-23687264126/81cfdaeaa0bbca1f.js +1 -0
  305. package/dist-build-23687264126/8605507b7a8487c4.woff2 +0 -0
  306. package/dist-build-23687264126/893a160d06428365.js +1 -0
  307. package/dist-build-23687264126/893a160d06428365.js.map +1 -0
  308. package/dist-build-23687264126/8a83d654702f6534.woff2 +0 -0
  309. package/dist-build-23687264126/8fe71173a13fe571.woff2 +0 -0
  310. package/dist-build-23687264126/94aa912dcac90114.js +1 -0
  311. package/dist-build-23687264126/9624cec0f9bdd81e.woff2 +0 -0
  312. package/dist-build-23687264126/98a3af55a1698171.woff2 +0 -0
  313. package/dist-build-23687264126/99823aaebba56f46.js +1 -0
  314. package/dist-build-23687264126/9ba85996af74c5ce.woff2 +0 -0
  315. package/dist-build-23687264126/9ddb22faa35006e7.woff2 +0 -0
  316. package/dist-build-23687264126/a167fb2799dd741b.woff2 +0 -0
  317. package/dist-build-23687264126/a2045a5cc4fdf94f.woff2 +0 -0
  318. package/dist-build-23687264126/a246c73905a31c93.woff2 +0 -0
  319. package/dist-build-23687264126/a325099b0a580ce2.js +2 -0
  320. package/dist-build-23687264126/a325099b0a580ce2.js.LICENSE.txt +14 -0
  321. package/dist-build-23687264126/a325099b0a580ce2.js.map +1 -0
  322. package/dist-build-23687264126/a401aa7939cb6e6f.woff2 +0 -0
  323. package/dist-build-23687264126/a40fef67997d3b2c.js +1 -0
  324. package/dist-build-23687264126/a62897b000a24b86.js +1 -0
  325. package/dist-build-23687264126/a6ed036f17a1ea29.woff2 +0 -0
  326. package/dist-build-23687264126/a77bac4877483a0a.js +1 -0
  327. package/dist-build-23687264126/a9f25ca430709a1a.woff2 +0 -0
  328. package/dist-build-23687264126/aa0dfbdd569b1c24.js +2 -0
  329. package/dist-build-23687264126/aa0dfbdd569b1c24.js.LICENSE.txt +5 -0
  330. package/dist-build-23687264126/aa0dfbdd569b1c24.js.map +1 -0
  331. package/dist-build-23687264126/ab0f637d6cff12e4.js +1 -0
  332. package/dist-build-23687264126/afa9121a49e95351.woff2 +0 -0
  333. package/dist-build-23687264126/afcda12d9f805543.woff2 +0 -0
  334. package/dist-build-23687264126/b09ded85a7da77f1.woff2 +0 -0
  335. package/dist-build-23687264126/b10dbe5318a91a12.js +1 -0
  336. package/dist-build-23687264126/b2f4e9d1e821b71c.woff2 +0 -0
  337. package/dist-build-23687264126/b4a074bf828bb757.woff2 +0 -0
  338. package/dist-build-23687264126/b7f447da43f6e596.woff2 +0 -0
  339. package/dist-build-23687264126/bcca84a524572d10.woff2 +0 -0
  340. package/dist-build-23687264126/be093e052a6d50eb.js +1 -0
  341. package/dist-build-23687264126/be4d1f97b11d087c.woff2 +0 -0
  342. package/dist-build-23687264126/bec14780d81164de.woff2 +0 -0
  343. package/dist-build-23687264126/c31657fe213c1b5e.js +1 -0
  344. package/dist-build-23687264126/c49ef726d3f0420b.js +1 -0
  345. package/dist-build-23687264126/c553f7e0199c5084.woff2 +0 -0
  346. package/dist-build-23687264126/c94ac2fdc1ff1418.js +1 -0
  347. package/dist-build-23687264126/c9d9ce9f465df4fe.woff2 +0 -0
  348. package/dist-build-23687264126/cbbb57b397433964.js +2 -0
  349. package/dist-build-23687264126/cbbb57b397433964.js.LICENSE.txt +14 -0
  350. package/dist-build-23687264126/cbbb57b397433964.js.map +1 -0
  351. package/dist-build-23687264126/d188f7f036ac5779.woff2 +0 -0
  352. package/dist-build-23687264126/d1aa59bd9c702dc4.js +2 -0
  353. package/dist-build-23687264126/d1aa59bd9c702dc4.js.LICENSE.txt +32 -0
  354. package/dist-build-23687264126/d1aa59bd9c702dc4.js.map +1 -0
  355. package/dist-build-23687264126/d265d81c58525ae4.woff2 +0 -0
  356. package/dist-build-23687264126/d5942cd81663e136.woff2 +0 -0
  357. package/dist-build-23687264126/d66b8ff73d95cabb.woff2 +0 -0
  358. package/dist-build-23687264126/d84bac6d07672dd2.js +1 -0
  359. package/dist-build-23687264126/d84bac6d07672dd2.js.map +1 -0
  360. package/dist-build-23687264126/d88899ef0fd16719.woff2 +0 -0
  361. package/dist-build-23687264126/d92b5ecf31fc187b.js +1 -0
  362. package/dist-build-23687264126/d9a5d958e69e058d.woff2 +0 -0
  363. package/dist-build-23687264126/dac90d495be353a0.woff2 +0 -0
  364. package/dist-build-23687264126/db0550511978dc47.js +1 -0
  365. package/dist-build-23687264126/dd8ce598529c3fab.woff2 +0 -0
  366. package/dist-build-23687264126/de013f1be25103fa.woff2 +0 -0
  367. package/dist-build-23687264126/df222fceeffca849.woff2 +0 -0
  368. package/dist-build-23687264126/df22bda08ec7964c.js +1 -0
  369. package/dist-build-23687264126/e05b7f902b02a251.js +1 -0
  370. package/dist-build-23687264126/e05b7f902b02a251.js.map +1 -0
  371. package/dist-build-23687264126/e465f1481f0d2e1c.js +1 -0
  372. package/dist-build-23687264126/e62b00b9199c1ac9.woff2 +0 -0
  373. package/dist-build-23687264126/e696cef1407b2610.woff2 +0 -0
  374. package/dist-build-23687264126/eb42de5422d9af00.js +1 -0
  375. package/dist-build-23687264126/eed48feba743e21c.woff2 +0 -0
  376. package/dist-build-23687264126/f135ef54213f8975.js +1 -0
  377. package/dist-build-23687264126/f260e50923d4283b.js +1 -0
  378. package/dist-build-23687264126/f543c88feb236d11.woff2 +0 -0
  379. package/dist-build-23687264126/f591b0079faa93fe.woff2 +0 -0
  380. package/dist-build-23687264126/f6ed27923769ad1d.woff2 +0 -0
  381. package/dist-build-23687264126/f8d066e92ea157c6.js +1 -0
  382. package/dist-build-23687264126/fae042506530c1e6.js +1 -0
  383. package/dist-build-23687264126/favicon.ico +0 -0
  384. package/dist-build-23687264126/fbebeb4336e67012.woff2 +0 -0
  385. package/dist-build-23687264126/fd574df77d31a5eb.js +1 -0
  386. package/dist-build-23687264126/icon_128x128.3dde25c6e69b1c010a6a5d6b27b3f436.png +0 -0
  387. package/dist-build-23687264126/icon_144x144.e263e02b838d229b02ff9133e6e0f2ba.png +0 -0
  388. package/dist-build-23687264126/icon_192x192.d3d318638bbe8a10a3c687d3d302d01a.png +0 -0
  389. package/dist-build-23687264126/icon_256x256.c729f6e7e914b58fcea5ce91d7aa9bad.png +0 -0
  390. package/dist-build-23687264126/icon_384x384.c8923df6b6bd08eba5c79b78d7fcecc0.png +0 -0
  391. package/dist-build-23687264126/icon_512x512.7163efb26df832de513bc58d925ea22e.png +0 -0
  392. package/dist-build-23687264126/icon_96x96.682ee334ae19d49894217370b8596f61.png +0 -0
  393. package/dist-build-23687264126/index.html +9 -0
  394. package/dist-build-23687264126/logo-512.png +0 -0
  395. package/dist-build-23687264126/logo.svg +30 -0
  396. package/dist-build-23687264126/manifest.266df36f2271d27ae9bcaa196a2976ae.json +47 -0
  397. package/dist-build-23687264126/openmrs.39723c21cec4b1fc.css +1 -0
  398. package/dist-build-23687264126/openmrs.39723c21cec4b1fc.css.map +1 -0
  399. package/dist-build-23687264126/openmrs.44bac4c8520ee42f.css +2 -0
  400. package/dist-build-23687264126/openmrs.44bac4c8520ee42f.css.map +1 -0
  401. package/dist-build-23687264126/openmrs.936e8cf6a4b1599d.css +2 -0
  402. package/dist-build-23687264126/openmrs.936e8cf6a4b1599d.css.map +1 -0
  403. package/dist-build-23687264126/openmrs.c3adea28ef850516.js +1 -0
  404. package/dist-build-23687264126/openmrs.c3adea28ef850516.js.map +1 -0
  405. package/dist-build-23687264126/openmrs.e4daba1e3b840e70.css +25 -0
  406. package/dist-build-23687264126/openmrs.e4daba1e3b840e70.css.map +1 -0
  407. package/dist-build-23687264126/service-worker.js +1 -0
  408. package/dist-build-23687264126/service-worker.js.map +1 -0
  409. package/e2e/core/env.ts +5 -0
  410. package/e2e/core/global-setup.ts +34 -0
  411. package/e2e/core/test.ts +21 -0
  412. package/e2e/pages/app-shell.page.ts +34 -0
  413. package/e2e/pages/etl-sources.page.ts +35 -0
  414. package/e2e/pages/report-sections.page.ts +20 -0
  415. package/e2e/pages/section-preview.modal.ts +29 -0
  416. package/e2e/specs/etl-sources.spec.ts +51 -0
  417. package/e2e/specs/navigation.spec.ts +13 -0
  418. package/e2e/specs/section-preview-validation.spec.ts +38 -0
  419. package/e2e/specs/section-preview.spec.ts +94 -0
  420. package/e2e/tsconfig.json +11 -0
  421. package/example.env +5 -0
  422. package/jest.config.js +28 -0
  423. package/package.json +82 -0
  424. package/playwright.config.ts +28 -0
  425. package/src/admin-card-link.extension.module.scss +55 -0
  426. package/src/admin-card-link.extension.tsx +24 -0
  427. package/src/components/admin/admin-page.component.tsx +31 -0
  428. package/src/components/admin/age-categories-page.component.tsx +109 -0
  429. package/src/components/admin/age-groups-page.component.tsx +146 -0
  430. package/src/components/admin/etl-sources-page.component.tsx +344 -0
  431. package/src/components/admin/report-categories-page.component.tsx +256 -0
  432. package/src/components/admin/report-library-page.component.tsx +540 -0
  433. package/src/components/ai-support/ai-assist-button.component.tsx +30 -0
  434. package/src/components/ai-support/ai-assist-modal.component.tsx +81 -0
  435. package/src/components/ai-support/ai.service.ts +21 -0
  436. package/src/components/ai-support/ai.types.ts +12 -0
  437. package/src/components/app-shell/report-builder-shell.component.tsx +120 -0
  438. package/src/components/app-shell/report-builder-shell.scss +15 -0
  439. package/src/components/data-themes/data-theme-form.component.tsx +59 -0
  440. package/src/components/data-themes/data-theme-modal.component.tsx +349 -0
  441. package/src/components/data-themes/data-themes-page.component.tsx +132 -0
  442. package/src/components/data-themes/data-themes-table.component.tsx +91 -0
  443. package/src/components/data-themes/icon-registry.ts +35 -0
  444. package/src/components/data-themes/sections/data-theme-basics.section.tsx +63 -0
  445. package/src/components/data-themes/sections/data-theme-condition-columns.section.tsx +397 -0
  446. package/src/components/data-themes/sections/data-theme-fields-editor.section.tsx +125 -0
  447. package/src/components/data-themes/sections/data-theme-metadata.section.tsx +245 -0
  448. package/src/components/data-themes/sections/data-theme-preview.section.tsx +115 -0
  449. package/src/components/data-themes/sections/data-theme-source.section.tsx +184 -0
  450. package/src/components/indicators/README.md +24 -0
  451. package/src/components/indicators/base-indicator-basic-fields.component.tsx +18 -0
  452. package/src/components/indicators/base-indicator-basics.section.tsx +54 -0
  453. package/src/components/indicators/base-indicator-countby.section.tsx +25 -0
  454. package/src/components/indicators/base-indicator-criteria.section.tsx +83 -0
  455. package/src/components/indicators/base-indicator-details-form.component.tsx +80 -0
  456. package/src/components/indicators/base-indicator-theme-unit-fields.component.tsx +39 -0
  457. package/src/components/indicators/create-base-indicator-modal.component.tsx +501 -0
  458. package/src/components/indicators/create-composite-base-indicator-modal.component.tsx +297 -0
  459. package/src/components/indicators/create-final-indicator-modal.component.tsx +260 -0
  460. package/src/components/indicators/diagnosis-filters-form.component.tsx +101 -0
  461. package/src/components/indicators/disaggregation-panel.component.tsx +93 -0
  462. package/src/components/indicators/handler/concept-search-multiselect.component.tsx +153 -0
  463. package/src/components/indicators/handler/question-answer-concept-search.component.tsx +336 -0
  464. package/src/components/indicators/indicator-status-tag.component.tsx +9 -0
  465. package/src/components/indicators/indicators-page.component.tsx +481 -0
  466. package/src/components/indicators/indicators-page.scss +121 -0
  467. package/src/components/indicators/indicators-table.component.tsx +166 -0
  468. package/src/components/indicators/preview-table.component.tsx +31 -0
  469. package/src/components/indicators/sections/composite-indicator-basics.section.tsx +36 -0
  470. package/src/components/indicators/sections/composite-indicator-picker.section.tsx +161 -0
  471. package/src/components/indicators/sections/composite-indicator-sql-preview.section.tsx +31 -0
  472. package/src/components/indicators/sections/final-indicator-basics.section.tsx +46 -0
  473. package/src/components/indicators/sections/final-indicator-disaggregation.section.tsx +47 -0
  474. package/src/components/indicators/sections/final-indicator-picker.section.tsx +92 -0
  475. package/src/components/indicators/sections/final-indicator-preview.section.tsx +20 -0
  476. package/src/components/indicators/sections/final-indicator-results-preview.section.tsx +65 -0
  477. package/src/components/indicators/sections/indicator-basics.section.tsx +40 -0
  478. package/src/components/indicators/sections/indicator-conditions.section.tsx +194 -0
  479. package/src/components/indicators/sections/indicator-sql-preview.section.tsx +26 -0
  480. package/src/components/indicators/sections/indicator-theme.section.tsx +48 -0
  481. package/src/components/indicators/sql-preview.component.tsx +19 -0
  482. package/src/components/indicators/types/base-indicator-form.types.ts +17 -0
  483. package/src/components/indicators/types/base-indicator-theme.constants.ts +8 -0
  484. package/src/components/indicators/types/composite-indicator.types.ts +21 -0
  485. package/src/components/indicators/types/condition-ui.types.ts +11 -0
  486. package/src/components/indicators/types/data-theme-config.types.ts +88 -0
  487. package/src/components/indicators/types/indicator-types.ts +56 -0
  488. package/src/components/indicators/types/sql-builders.ts +43 -0
  489. package/src/components/indicators/utils/composite-indicator-sql.utils.ts +206 -0
  490. package/src/components/indicators/utils/concept-preload.utils.ts +21 -0
  491. package/src/components/indicators/utils/final-indicator-sql.utils.ts +124 -0
  492. package/src/components/indicators/utils/indicator-conditions-hydration.utils.ts +254 -0
  493. package/src/components/indicators/utils/indicator-sql.utils.ts +185 -0
  494. package/src/components/landing/landing-action-item.component.tsx +50 -0
  495. package/src/components/landing/landing-action-list.component.tsx +12 -0
  496. package/src/components/landing/landing-activity-list.component.tsx +47 -0
  497. package/src/components/landing/landing-footer-grid.component.tsx +45 -0
  498. package/src/components/landing/landing-hero.component.tsx +18 -0
  499. package/src/components/landing/landing-section-card.component.tsx +33 -0
  500. package/src/components/landing/report-builder-landing-page.component.tsx +103 -0
  501. package/src/components/landing/report-builder-landing-page.scss +131 -0
  502. package/src/components/report/dashboard/reports-table.component.tsx +145 -0
  503. package/src/components/report/definition/panels/properties-panel.component.tsx +38 -0
  504. package/src/components/report/definition/panels/report-structure-panel.component.tsx +61 -0
  505. package/src/components/report/definition/panels/selection-panel.component.tsx +58 -0
  506. package/src/components/report/definition/report-definition-editor.component.tsx +99 -0
  507. package/src/components/report/definition/report-definition.types.ts +66 -0
  508. package/src/components/report/design/panels/IndicatorPropertiesPanel.scss +33 -0
  509. package/src/components/report/design/panels/IndicatorPropertiesPanel.tsx +389 -0
  510. package/src/components/report/design/panels/JsonPreviewPanel.scss +32 -0
  511. package/src/components/report/design/panels/JsonPreviewPanel.tsx +104 -0
  512. package/src/components/report/design/panels/mapping-preview-panel.component.tsx +82 -0
  513. package/src/components/report/design/panels/mapping-preview-panel.scss +55 -0
  514. package/src/components/report/design/panels/template-structure-panel.component.tsx +296 -0
  515. package/src/components/report/design/panels/template-structure-panel.scss +81 -0
  516. package/src/components/report/design/report-design-editor.component.tsx +894 -0
  517. package/src/components/report/design/report-design.types.ts +43 -0
  518. package/src/components/report/design/report-design.utils.ts +86 -0
  519. package/src/components/report/panels/report-detail.component.tsx +71 -0
  520. package/src/components/report/panels/report-panel-shell.component.tsx +60 -0
  521. package/src/components/report/report-dashboard.page.component.tsx +75 -0
  522. package/src/components/report/report-editor.page.component.tsx +466 -0
  523. package/src/components/report/report.routes.tsx +30 -0
  524. package/src/components/report-sections/create-report-section-modal.component.tsx +278 -0
  525. package/src/components/report-sections/hooks/useAgeCategories.ts +25 -0
  526. package/src/components/report-sections/hooks/useSectionEditorState.ts +306 -0
  527. package/src/components/report-sections/panels/Dhis2MappingPanel.tsx +157 -0
  528. package/src/components/report-sections/panels/DisaggregationPanel.tsx +97 -0
  529. package/src/components/report-sections/panels/IndicatorPickerPanel.tsx +143 -0
  530. package/src/components/report-sections/panels/SectionBasicsPanel.tsx +27 -0
  531. package/src/components/report-sections/report-section-preview-modal.component.tsx +418 -0
  532. package/src/components/report-sections/report-sections-page.component.tsx +313 -0
  533. package/src/components/report-sections/section-types.ts +55 -0
  534. package/src/components/report-sections/section-utils.ts +46 -0
  535. package/src/components/report-sections/sections-page.scss +79 -0
  536. package/src/components/run-reports/run-reports-page.component.tsx +23 -0
  537. package/src/components/shared/header/builder-header-actions.component.tsx +38 -0
  538. package/src/components/shared/header/header.component.tsx +85 -0
  539. package/src/components/shared/header/header.scss +150 -0
  540. package/src/components/shared/header/illustration.component.tsx +34 -0
  541. package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.scss +33 -0
  542. package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.tsx +389 -0
  543. package/src/components/shared/json-preview-panel/JsonPreviewPanel.scss +32 -0
  544. package/src/components/shared/json-preview-panel/JsonPreviewPanel.tsx +104 -0
  545. package/src/components/shared/mapping-preview-panel/mapping-preview-panel.component.tsx +82 -0
  546. package/src/components/shared/mapping-preview-panel/mapping-preview-panel.scss +55 -0
  547. package/src/components/shared/preview/query-results-preview.component.tsx +204 -0
  548. package/src/components/shared/template-structure-panel/template-structure-panel.component.tsx +296 -0
  549. package/src/components/shared/template-structure-panel/template-structure-panel.scss +81 -0
  550. package/src/config-schema.ts +23 -0
  551. package/src/globals.d.ts +14 -0
  552. package/src/hooks/theme/useDataThemes.ts +28 -0
  553. package/src/hooks/theme/useMambaTableMeta.ts +34 -0
  554. package/src/hooks/theme/useMambaTables.ts +63 -0
  555. package/src/index.ts +23 -0
  556. package/src/resources/agegroup/agegroups.api.ts +58 -0
  557. package/src/resources/concepts/concept-mapper.ts +21 -0
  558. package/src/resources/concepts/concept-types.ts +31 -0
  559. package/src/resources/concepts/concepts.resource.ts +44 -0
  560. package/src/resources/concepts/useConceptSearch.ts +41 -0
  561. package/src/resources/etl-source/etl-source.api.ts +65 -0
  562. package/src/resources/indicator/indicators.api.ts +125 -0
  563. package/src/resources/openmrs-api.ts +24 -0
  564. package/src/resources/preview/sql-preview.api.ts +54 -0
  565. package/src/resources/report/reports.api.ts +117 -0
  566. package/src/resources/report-category/report-category.api.ts +41 -0
  567. package/src/resources/report-library/report-library.api.ts +63 -0
  568. package/src/resources/report-section/report-sections.api.ts +73 -0
  569. package/src/resources/report-section/section-preview.api.ts +21 -0
  570. package/src/resources/theme/data-theme.api.ts +88 -0
  571. package/src/resources/theme/mamba-schema.api.ts +31 -0
  572. package/src/resources/theme/mamba-table-meta.api.ts +45 -0
  573. package/src/root.component.tsx +20 -0
  574. package/src/routes/report-builder.routes.tsx +66 -0
  575. package/src/routes/report-builder.scss +56 -0
  576. package/src/routes.json +21 -0
  577. package/src/sample-template.ts +121 -0
  578. package/src/template-utils.ts +110 -0
  579. package/src/types/carbon-react-inert.d.ts +13 -0
  580. package/src/types/condition-operators.ts +49 -0
  581. package/src/types/theme/data-theme.types.ts +88 -0
  582. package/src/utils/html-entities.utils.ts +23 -0
  583. package/tools/setup-tests.ts +1 -0
  584. package/translations/en.json +4 -0
  585. package/tsconfig.json +43 -0
  586. package/webpack.config.js +14 -0
@@ -0,0 +1,297 @@
1
+ import React from 'react';
2
+ import { Modal, Stack, InlineNotification } from '@carbon/react';
3
+
4
+ import { getIndicator, type IndicatorDto } from '../../resources/indicator/indicators.api';
5
+
6
+ import type { BaseIndicatorOption, CompositeOperator } from './types/composite-indicator.types';
7
+
8
+ import CompositeIndicatorBasicsSection from './sections/composite-indicator-basics.section';
9
+ import CompositeIndicatorPickerSection from './sections/composite-indicator-picker.section';
10
+ import CompositeIndicatorSqlPreviewSection from './sections/composite-indicator-sql-preview.section';
11
+
12
+ import {
13
+ countSqlToPopulationSql,
14
+ buildCompositeCountSql,
15
+ tryGetPatientIdColumnFromConfig,
16
+ tryGetCountSqlFromIndicator,
17
+ } from './utils/composite-indicator-sql.utils';
18
+
19
+ type Props = {
20
+ open: boolean;
21
+ mode?: 'create' | 'edit';
22
+ initial?: IndicatorDto | null;
23
+ onClose: () => void;
24
+ onCreate: (payload: Partial<IndicatorDto>) => Promise<void>;
25
+ onUpdate?: (uuid: string, payload: Partial<IndicatorDto>) => Promise<void>;
26
+ onSaved: () => void;
27
+ baseIndicators: BaseIndicatorOption[];
28
+ };
29
+
30
+ type CompositeIndicatorAuthoring = {
31
+ version: 1;
32
+ unit: 'Patients' | 'Encounters';
33
+ operator: CompositeOperator;
34
+ indicatorAId: string;
35
+ indicatorBId: string;
36
+ indicatorACode?: string;
37
+ indicatorBCode?: string;
38
+ sqlPreview: string;
39
+ };
40
+
41
+ function safeParseJson<T = any>(input?: string | null): T | null {
42
+ if (!input) return null;
43
+ try {
44
+ return JSON.parse(input) as T;
45
+ } catch {
46
+ return null;
47
+ }
48
+ }
49
+
50
+ const toCode = (name: string) =>
51
+ name
52
+ .toUpperCase()
53
+ .replace(/[^A-Z0-9]+/g, '_')
54
+ .replace(/^_+|_+$/g, '')
55
+ .slice(0, 50);
56
+
57
+ const CreateCompositeBaseIndicatorModal: React.FC<Props> = ({
58
+ open,
59
+ mode = 'create',
60
+ initial,
61
+ onClose,
62
+ onCreate,
63
+ onUpdate,
64
+ onSaved,
65
+ baseIndicators,
66
+ }) => {
67
+ // ✅ IMPORTANT: no defaults for create mode
68
+ const [name, setName] = React.useState('');
69
+ const [code, setCode] = React.useState('');
70
+ const [description, setDescription] = React.useState('');
71
+
72
+ const [indicatorAId, setIndicatorAId] = React.useState('');
73
+ const [indicatorBId, setIndicatorBId] = React.useState('');
74
+ const [operator, setOperator] = React.useState<CompositeOperator>('AND');
75
+
76
+ const [loadingA, setLoadingA] = React.useState(false);
77
+ const [loadingB, setLoadingB] = React.useState(false);
78
+ const [errA, setErrA] = React.useState<string | null>(null);
79
+ const [errB, setErrB] = React.useState<string | null>(null);
80
+
81
+ const [indA, setIndA] = React.useState<IndicatorDto | null>(null);
82
+ const [indB, setIndB] = React.useState<IndicatorDto | null>(null);
83
+
84
+ // reset / initialize on open
85
+ React.useEffect(() => {
86
+ if (!open) return;
87
+
88
+ // EDIT: hydrate from selected composite indicator
89
+ if (mode === 'edit' && initial?.uuid) {
90
+ const cfg = safeParseJson<any>(initial.configJson) ?? {};
91
+
92
+ setName(initial.name ?? '');
93
+ setCode(initial.code ?? '');
94
+ setDescription(initial.description ?? '');
95
+
96
+ // support both indicatorAId/indicatorBId and indicatorAUuid/indicatorBUuid
97
+ setIndicatorAId(String(cfg.indicatorAId ?? cfg.indicatorAUuid ?? ''));
98
+ setIndicatorBId(String(cfg.indicatorBId ?? cfg.indicatorBUuid ?? ''));
99
+ setOperator((String(cfg.operator ?? 'AND').toUpperCase() as CompositeOperator) ?? 'AND');
100
+
101
+ setErrA(null);
102
+ setErrB(null);
103
+ setIndA(null);
104
+ setIndB(null);
105
+ return;
106
+ }
107
+
108
+ // CREATE: start blank so users don't confuse it with edit
109
+ setName('');
110
+ setCode('');
111
+ setDescription('');
112
+ setIndicatorAId('');
113
+ setIndicatorBId('');
114
+ setOperator('AND');
115
+ setErrA(null);
116
+ setErrB(null);
117
+ setIndA(null);
118
+ setIndB(null);
119
+ }, [open, mode, initial?.uuid]);
120
+
121
+ const AOpt = React.useMemo(() => baseIndicators.find((x) => x.id === indicatorAId) ?? null, [baseIndicators, indicatorAId]);
122
+ const BOpt = React.useMemo(() => baseIndicators.find((x) => x.id === indicatorBId) ?? null, [baseIndicators, indicatorBId]);
123
+
124
+ const samePick = Boolean(indicatorAId && indicatorBId && indicatorAId === indicatorBId);
125
+
126
+ const inferredUnit: 'Patients' | 'Encounters' = React.useMemo(() => 'Patients', []);
127
+
128
+ // load full indicators for A/B
129
+ React.useEffect(() => {
130
+ if (!open) return;
131
+ if (!indicatorAId) {
132
+ setIndA(null);
133
+ return;
134
+ }
135
+
136
+ const ac = new AbortController();
137
+ setLoadingA(true);
138
+ setErrA(null);
139
+
140
+ getIndicator(indicatorAId, ac.signal, 'full')
141
+ .then((full) => setIndA(full))
142
+ .catch((e: any) => setErrA(e?.message ?? 'Failed to load indicator A'))
143
+ .finally(() => setLoadingA(false));
144
+
145
+ return () => ac.abort();
146
+ }, [open, indicatorAId]);
147
+
148
+ React.useEffect(() => {
149
+ if (!open) return;
150
+ if (!indicatorBId) {
151
+ setIndB(null);
152
+ return;
153
+ }
154
+
155
+ const ac = new AbortController();
156
+ setLoadingB(true);
157
+ setErrB(null);
158
+
159
+ getIndicator(indicatorBId, ac.signal, 'full')
160
+ .then((full) => setIndB(full))
161
+ .catch((e: any) => setErrB(e?.message ?? 'Failed to load indicator B'))
162
+ .finally(() => setLoadingB(false));
163
+
164
+ return () => ac.abort();
165
+ }, [open, indicatorBId]);
166
+
167
+ const populationSqlA = React.useMemo(() => {
168
+ if (!indA) return '';
169
+ const { sql: countSql } = tryGetCountSqlFromIndicator(indA);
170
+ const pidCol = tryGetPatientIdColumnFromConfig(indA);
171
+ if (!countSql) return '';
172
+ return countSqlToPopulationSql(countSql, pidCol, inferredUnit);
173
+ }, [indA, inferredUnit]);
174
+
175
+ const populationSqlB = React.useMemo(() => {
176
+ if (!indB) return '';
177
+ const { sql: countSql } = tryGetCountSqlFromIndicator(indB);
178
+ const pidCol = tryGetPatientIdColumnFromConfig(indB);
179
+ if (!countSql) return '';
180
+ return countSqlToPopulationSql(countSql, pidCol, inferredUnit);
181
+ }, [indB, inferredUnit]);
182
+
183
+ const compositeSql = React.useMemo(() => {
184
+ if (!populationSqlA || !populationSqlB) return '';
185
+ return buildCompositeCountSql({
186
+ unit: inferredUnit,
187
+ operator,
188
+ populationSqlA,
189
+ populationSqlB,
190
+ });
191
+ }, [populationSqlA, populationSqlB, inferredUnit, operator]);
192
+
193
+ const canSubmit =
194
+ Boolean(name.trim()) &&
195
+ Boolean(indicatorAId) &&
196
+ Boolean(indicatorBId) &&
197
+ !samePick &&
198
+ Boolean(compositeSql.trim());
199
+
200
+ const submit = async () => {
201
+ if (!canSubmit) return;
202
+
203
+ const finalCode = code.trim() ? code.trim().toUpperCase() : toCode(name);
204
+
205
+ const authoring: CompositeIndicatorAuthoring = {
206
+ version: 1,
207
+ unit: inferredUnit,
208
+ operator,
209
+ indicatorAId,
210
+ indicatorBId,
211
+ indicatorACode: AOpt?.code,
212
+ indicatorBCode: BOpt?.code,
213
+ sqlPreview: compositeSql,
214
+ };
215
+
216
+ const payload: Partial<IndicatorDto> = {
217
+ name: name.trim(),
218
+ code: finalCode,
219
+ description: description.trim() || undefined,
220
+ kind: 'COMPOSITE',
221
+ defaultValueType: 'NUMBER',
222
+ themeUuid: null,
223
+ configJson: JSON.stringify(authoring, null, 2),
224
+ sqlTemplate: compositeSql,
225
+ };
226
+
227
+ if (mode === 'edit' && initial?.uuid) {
228
+ if (!onUpdate) throw new Error('onUpdate handler is required for edit mode');
229
+ await onUpdate(initial.uuid, payload);
230
+ } else {
231
+ await onCreate(payload);
232
+ }
233
+
234
+ onSaved();
235
+ };
236
+
237
+ return (
238
+ <Modal
239
+ open={open}
240
+ onRequestClose={onClose}
241
+ modalHeading={mode === 'edit' ? 'Edit Composite Indicator' : 'Create Composite Indicator'}
242
+ primaryButtonText={mode === 'edit' ? 'Update Indicator' : 'Save Indicator'}
243
+ secondaryButtonText="Cancel"
244
+ onRequestSubmit={submit}
245
+ primaryButtonDisabled={!canSubmit}
246
+ size="lg"
247
+ >
248
+ <Stack gap={5}>
249
+ <div style={{ opacity: 0.8 }}>
250
+ Select two base indicators, pick an operator, and we generate a composite SQL preview.
251
+ </div>
252
+
253
+ {samePick ? (
254
+ <InlineNotification
255
+ kind="error"
256
+ lowContrast
257
+ title="Pick two different indicators"
258
+ subtitle="Indicator A and Indicator B cannot be the same."
259
+ />
260
+ ) : null}
261
+
262
+ <CompositeIndicatorBasicsSection
263
+ value={{ name, code, description }}
264
+ onChange={(next) => {
265
+ setName(next.name);
266
+ setCode(next.code);
267
+ setDescription(next.description);
268
+ }}
269
+ />
270
+
271
+ <hr style={{ border: 0, borderTop: '1px solid var(--cds-border-subtle, #e0e0e0)' }} />
272
+
273
+ <CompositeIndicatorPickerSection
274
+ baseIndicators={baseIndicators}
275
+ indicatorAId={indicatorAId}
276
+ indicatorBId={indicatorBId}
277
+ operator={operator}
278
+ inferredUnit={inferredUnit}
279
+ samePick={samePick}
280
+ onChangeA={setIndicatorAId}
281
+ onChangeB={setIndicatorBId}
282
+ onChangeOperator={setOperator}
283
+ />
284
+
285
+ <CompositeIndicatorSqlPreviewSection
286
+ loading={loadingA || loadingB}
287
+ errA={errA}
288
+ errB={errB}
289
+ compositeSql={compositeSql}
290
+ show={Boolean(AOpt && BOpt)}
291
+ />
292
+ </Stack>
293
+ </Modal>
294
+ );
295
+ };
296
+
297
+ export default CreateCompositeBaseIndicatorModal;
@@ -0,0 +1,260 @@
1
+ import React from 'react';
2
+ import { Modal, Stack, InlineLoading, InlineNotification } from '@carbon/react';
3
+
4
+ import type { IndicatorDto } from '../../resources/indicator/indicators.api';
5
+ import { getIndicator } from '../../resources/indicator/indicators.api';
6
+
7
+ import type { BaseIndicatorOption } from './types/composite-indicator.types';
8
+ import { listAgeCategoriesWithGroups, type AgeCategoryOption } from '../../resources/agegroup/agegroups.api';
9
+
10
+ import FinalIndicatorBasicsSection from './sections/final-indicator-basics.section';
11
+ import FinalIndicatorPickerSection from './sections/final-indicator-picker.section';
12
+ import FinalIndicatorDisaggregationSection from './sections/final-indicator-disaggregation.section';
13
+ import FinalIndicatorResultsPreviewSection from './sections/final-indicator-results-preview.section';
14
+
15
+ import { buildFinalIndicatorSql, type FinalIndicatorAuthoringV1 } from './utils/final-indicator-sql.utils';
16
+
17
+ type Props = {
18
+ open: boolean;
19
+ mode?: 'create' | 'edit';
20
+ initial?: IndicatorDto | null;
21
+
22
+ baseIndicators: BaseIndicatorOption[];
23
+
24
+ onClose: () => void;
25
+
26
+ onCreate: (payload: Partial<IndicatorDto>) => Promise<void>;
27
+ onUpdate?: (uuid: string, payload: Partial<IndicatorDto>) => Promise<void>;
28
+ onSaved: () => void;
29
+ };
30
+
31
+ function safeParseJson<T = any>(input?: string | null): T | null {
32
+ if (!input) return null;
33
+ try {
34
+ return JSON.parse(input) as T;
35
+ } catch {
36
+ return null;
37
+ }
38
+ }
39
+
40
+ const toCode = (name: string) =>
41
+ name
42
+ .toUpperCase()
43
+ .replace(/[^A-Z0-9]+/g, '_')
44
+ .replace(/^_+|_+$/g, '')
45
+ .slice(0, 50);
46
+
47
+ function todayIso(): string {
48
+ const d = new Date();
49
+ const yyyy = d.getFullYear();
50
+ const mm = String(d.getMonth() + 1).padStart(2, '0');
51
+ const dd = String(d.getDate()).padStart(2, '0');
52
+ return `${yyyy}-${mm}-${dd}`;
53
+ }
54
+
55
+ export default function CreateFinalIndicatorModal({
56
+ open,
57
+ mode = 'create',
58
+ initial,
59
+ baseIndicators,
60
+ onClose,
61
+ onCreate,
62
+ onUpdate,
63
+ onSaved,
64
+ }: Props) {
65
+ const [ageCategories, setAgeCategories] = React.useState<AgeCategoryOption[]>([]);
66
+ const [loadingCats, setLoadingCats] = React.useState(false);
67
+ const [catsError, setCatsError] = React.useState<string | null>(null);
68
+
69
+ const [basics, setBasics] = React.useState({ name: '', code: '', description: '' });
70
+
71
+ const [baseIndicatorId, setBaseIndicatorId] = React.useState('');
72
+ const [ageCategoryCode, setAgeCategoryCode] = React.useState('');
73
+ const [genders, setGenders] = React.useState<Array<'F' | 'M'>>(['F', 'M']);
74
+
75
+ const [baseFull, setBaseFull] = React.useState<IndicatorDto | null>(null);
76
+ const [loadingBase, setLoadingBase] = React.useState(false);
77
+ const [baseError, setBaseError] = React.useState<string | null>(null);
78
+
79
+ const [sqlPreview, setSqlPreview] = React.useState('');
80
+
81
+ // ✅ Preview parameters (must be inside component)
82
+ const [previewStartDate, setPreviewStartDate] = React.useState('2025-01-01');
83
+ const [previewEndDate, setPreviewEndDate] = React.useState(todayIso);
84
+
85
+ // load categories when modal opens
86
+ React.useEffect(() => {
87
+ if (!open) return;
88
+ const ac = new AbortController();
89
+
90
+ setLoadingCats(true);
91
+ setCatsError(null);
92
+
93
+ listAgeCategoriesWithGroups(ac.signal)
94
+ .then((items) => setAgeCategories(items))
95
+ .catch((e: any) => setCatsError(e?.message ?? 'Failed to load age categories'))
96
+ .finally(() => setLoadingCats(false));
97
+
98
+ return () => ac.abort();
99
+ }, [open]);
100
+
101
+ // init create vs edit
102
+ React.useEffect(() => {
103
+ if (!open) return;
104
+
105
+ if (mode === 'edit' && initial?.uuid) {
106
+ const cfg = safeParseJson<Partial<FinalIndicatorAuthoringV1>>(initial.configJson) ?? {};
107
+
108
+ setBasics({
109
+ name: initial.name ?? '',
110
+ code: initial.code ?? '',
111
+ description: initial.description ?? '',
112
+ });
113
+
114
+ setBaseIndicatorId(String(cfg.baseIndicatorId ?? ''));
115
+ setAgeCategoryCode(String(cfg.ageGroupSetCode ?? cfg.ageCategoryCode ?? '')); // tolerate both keys
116
+ setGenders((cfg.genders as any) ?? ['F', 'M']);
117
+
118
+ setSqlPreview(String(cfg.sqlPreview ?? initial.sqlTemplate ?? ''));
119
+
120
+ // keep preview dates as-is (user controlled)
121
+ return;
122
+ }
123
+
124
+ // create defaults
125
+ setBasics({ name: '', code: '', description: '' });
126
+ setBaseIndicatorId('');
127
+ setAgeCategoryCode('');
128
+ setGenders(['F', 'M']);
129
+ setSqlPreview('');
130
+ setBaseFull(null);
131
+ setBaseError(null);
132
+ // preview dates remain (or you can reset here if desired)
133
+ }, [open, mode, initial?.uuid]);
134
+
135
+ // load full base indicator
136
+ React.useEffect(() => {
137
+ if (!open) return;
138
+ if (!baseIndicatorId) {
139
+ setBaseFull(null);
140
+ return;
141
+ }
142
+
143
+ const ac = new AbortController();
144
+ setLoadingBase(true);
145
+ setBaseError(null);
146
+
147
+ getIndicator(baseIndicatorId, ac.signal, 'full')
148
+ .then((full) => setBaseFull(full))
149
+ .catch((e: any) => setBaseError(e?.message ?? 'Failed to load selected base indicator'))
150
+ .finally(() => setLoadingBase(false));
151
+
152
+ return () => ac.abort();
153
+ }, [open, baseIndicatorId]);
154
+
155
+ // compute sql preview
156
+ React.useEffect(() => {
157
+ if (!open) return;
158
+
159
+ if (!baseFull || !ageCategoryCode) {
160
+ setSqlPreview('');
161
+ return;
162
+ }
163
+
164
+ const sql = buildFinalIndicatorSql({
165
+ baseIndicator: baseFull,
166
+ ageCategoryCode,
167
+ genders,
168
+ });
169
+
170
+ setSqlPreview(sql);
171
+ }, [open, baseFull, ageCategoryCode, genders]);
172
+
173
+ const canSubmit =
174
+ Boolean(basics.name.trim()) &&
175
+ Boolean(baseIndicatorId) &&
176
+ Boolean(ageCategoryCode) &&
177
+ Boolean(sqlPreview.trim());
178
+
179
+ const submit = async () => {
180
+ if (!canSubmit || !baseFull) return;
181
+
182
+ const finalCode = basics.code.trim() ? basics.code.trim().toUpperCase() : toCode(basics.name);
183
+
184
+ // store both keys for forward compatibility (you can later remove ageGroupSetCode)
185
+ const authoring: any = {
186
+ version: 1,
187
+ baseIndicatorId,
188
+ ageCategoryCode,
189
+ ageGroupSetCode: ageCategoryCode,
190
+ genders,
191
+ sqlPreview,
192
+ };
193
+
194
+ const payload: Partial<IndicatorDto> = {
195
+ name: basics.name.trim(),
196
+ code: finalCode,
197
+ description: basics.description.trim() || undefined,
198
+ kind: 'FINAL',
199
+ defaultValueType: 'NUMBER',
200
+ themeUuid: null,
201
+ configJson: JSON.stringify(authoring, null, 2),
202
+ sqlTemplate: sqlPreview,
203
+ };
204
+
205
+ if (mode === 'edit' && initial?.uuid) {
206
+ if (!onUpdate) throw new Error('onUpdate handler is required for edit mode');
207
+ await onUpdate(initial.uuid, payload);
208
+ } else {
209
+ await onCreate(payload);
210
+ }
211
+
212
+ onSaved();
213
+ };
214
+
215
+
216
+ return (
217
+ <Modal
218
+ open={open}
219
+ onRequestClose={onClose}
220
+ modalHeading={mode === 'edit' ? 'Edit Final Indicator' : 'Create Final Indicator'}
221
+ primaryButtonText={mode === 'edit' ? 'Update Indicator' : 'Save Indicator'}
222
+ secondaryButtonText="Cancel"
223
+ onRequestSubmit={submit}
224
+ primaryButtonDisabled={!canSubmit}
225
+ size="lg"
226
+ >
227
+ <Stack gap={6}>
228
+ {loadingCats ? <InlineLoading description="Loading age categories…" /> : null}
229
+ {catsError ? <InlineNotification kind="error" lowContrast title="Age categories" subtitle={catsError} /> : null}
230
+
231
+ <FinalIndicatorBasicsSection value={basics} onChange={setBasics} />
232
+
233
+ <hr style={{ border: 0, borderTop: '1px solid var(--cds-border-subtle, #e0e0e0)' }} />
234
+
235
+ <FinalIndicatorPickerSection
236
+ baseIndicators={baseIndicators}
237
+ ageCategories={ageCategories}
238
+ selectedBaseId={baseIndicatorId}
239
+ selectedAgeCategoryCode={ageCategoryCode}
240
+ onChangeBaseId={setBaseIndicatorId}
241
+ onChangeAgeCategoryCode={setAgeCategoryCode}
242
+ />
243
+
244
+ {loadingBase ? <InlineLoading description="Loading base indicator details…" /> : null}
245
+ {baseError ? <InlineNotification kind="error" lowContrast title="Base indicator" subtitle={baseError} /> : null}
246
+
247
+ <FinalIndicatorDisaggregationSection genders={genders} onChange={setGenders} />
248
+
249
+ <FinalIndicatorResultsPreviewSection
250
+ sql={sqlPreview}
251
+ maxRows={200}
252
+ startDate={previewStartDate}
253
+ endDate={previewEndDate}
254
+ onChangeStartDate={setPreviewStartDate}
255
+ onChangeEndDate={setPreviewEndDate}
256
+ />
257
+ </Stack>
258
+ </Modal>
259
+ );
260
+ }
@@ -0,0 +1,101 @@
1
+ /*
2
+ import React from 'react';
3
+ import { Select, SelectItem, TextInput } from '@carbon/react';
4
+
5
+ import ConceptSearchMultiSelect, { SelectedConcept } from './concept-search-multiselect.component';
6
+ import type { DiagnosisBaseConfig } from './types/indicator-types';
7
+
8
+ type Props = {
9
+ value: DiagnosisBaseConfig;
10
+ onChange: (next: DiagnosisBaseConfig) => void;
11
+ };
12
+
13
+ export default function DiagnosisFiltersForm({ value, onChange }: Props) {
14
+ const onChangeConcepts = (selected: SelectedConcept[]) => {
15
+ // Use a for-loop to avoid any surprises and to keep behavior explicit.
16
+ const conceptIds: number[] = [];
17
+ const conceptUuids: string[] = [];
18
+ const conceptLabels: string[] = [];
19
+ const icd10Codes: string[] = [];
20
+ const icd11Codes: string[] = [];
21
+
22
+ for (const x of selected ?? []) {
23
+ // IDs (warehouse join)
24
+ const idNum = Number((x as any)?.id);
25
+ if (Number.isFinite(idNum) && idNum > 0) {
26
+ conceptIds.push(idNum);
27
+ }
28
+
29
+ // Labels / uuids
30
+ if (x?.uuid) conceptUuids.push(x.uuid);
31
+ if (x?.display) conceptLabels.push(x.display);
32
+
33
+ // Optional metadata
34
+ if (x?.icd10Code) icd10Codes.push(x.icd10Code);
35
+ if (x?.icd11Code) icd11Codes.push(x.icd11Code);
36
+ }
37
+
38
+ onChange({
39
+ ...value,
40
+ // ✅ self-contained selection (survives search reset)
41
+ selectedConcepts: selected ?? [],
42
+
43
+ // ✅ derived fields used by SQL builder + UI
44
+ conceptIds,
45
+ conceptUuids,
46
+ conceptLabels,
47
+ icd10Codes,
48
+ icd11Codes,
49
+ });
50
+ };
51
+
52
+ return (
53
+ <>
54
+ <div style={{ fontWeight: 600 }}>Diagnosis filters</div>
55
+
56
+ <ConceptSearchMultiSelect
57
+ id="diag-concepts"
58
+ labelText="Diagnosis concept(s)"
59
+ helperText="Search OpenMRS concepts and add one or more. ICD codes are shown to help you choose."
60
+ // ✅ Pass the full self-contained objects
61
+ value={value.selectedConcepts ?? []}
62
+ onChange={onChangeConcepts}
63
+ />
64
+
65
+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '0.75rem', marginTop: '0.75rem' }}>
66
+ <Select
67
+ id="diag-certainty"
68
+ labelText="Certainty"
69
+ value={value.certainty}
70
+ onChange={(e) =>
71
+ onChange({
72
+ ...value,
73
+ certainty: (e.target as HTMLSelectElement).value as DiagnosisBaseConfig['certainty'],
74
+ })
75
+ }
76
+ >
77
+ <SelectItem value="PROVISIONAL" text="PROVISIONAL" />
78
+ <SelectItem value="CONFIRMED" text="CONFIRMED" />
79
+ </Select>
80
+ </div>
81
+
82
+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '0.75rem', marginTop: '0.75rem' }}>
83
+ <TextInput
84
+ id="diag-ranks"
85
+ labelText="Diagnosis ranks (CSV)"
86
+ helperText="Example: 1,2"
87
+ value={value.dxRanksCsv}
88
+ onChange={(e) => onChange({ ...value, dxRanksCsv: (e.target as HTMLInputElement).value })}
89
+ />
90
+
91
+ <TextInput
92
+ id="diag-derived-ids"
93
+ labelText="Derived diagnosis_coded IDs"
94
+ helperText="Uses concept.id (perfect warehouse join)."
95
+ value={value.conceptIds?.length ? value.conceptIds.join(',') : ''}
96
+ readOnly
97
+ />
98
+ </div>
99
+ </>
100
+ );
101
+ }*/