@openmrs/esm-cohort-builder-app 3.0.1-pre.102

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 (99) hide show
  1. package/LICENSE +401 -0
  2. package/README.md +16 -0
  3. package/dist/241.js +2 -0
  4. package/dist/241.js.LICENSE.txt +27 -0
  5. package/dist/247.js +1 -0
  6. package/dist/255.js +1 -0
  7. package/dist/285.js +1 -0
  8. package/dist/294.js +2 -0
  9. package/dist/294.js.LICENSE.txt +9 -0
  10. package/dist/374.js +1 -0
  11. package/dist/484.js +1 -0
  12. package/dist/508.js +2 -0
  13. package/dist/508.js.LICENSE.txt +14 -0
  14. package/dist/574.js +1 -0
  15. package/dist/595.js +2 -0
  16. package/dist/595.js.LICENSE.txt +3 -0
  17. package/dist/935.js +2 -0
  18. package/dist/935.js.LICENSE.txt +19 -0
  19. package/dist/main.js +1 -0
  20. package/dist/openmrs-esm-cohort-builder-app.js +1 -0
  21. package/dist/openmrs-esm-cohort-builder-app.js.buildmanifest.json +376 -0
  22. package/dist/openmrs-esm-cohort-builder-app.old +1 -0
  23. package/package.json +93 -0
  24. package/src/cohort-builder-app-menu-link.tsx +14 -0
  25. package/src/cohort-builder.resources.ts +84 -0
  26. package/src/cohort-builder.scss +126 -0
  27. package/src/cohort-builder.test.tsx +12 -0
  28. package/src/cohort-builder.tsx +213 -0
  29. package/src/cohort-builder.utils.ts +197 -0
  30. package/src/components/composition/composition.component.tsx +109 -0
  31. package/src/components/composition/composition.style.css +3 -0
  32. package/src/components/composition/composition.test.tsx +112 -0
  33. package/src/components/composition/composition.utils.ts +53 -0
  34. package/src/components/empty-data/empty-data.component.tsx +25 -0
  35. package/src/components/empty-data/empty-data.style.scss +20 -0
  36. package/src/components/saved-cohorts/saved-cohorts-options/saved-cohort-options.test.tsx +49 -0
  37. package/src/components/saved-cohorts/saved-cohorts-options/saved-cohorts-options.component.tsx +112 -0
  38. package/src/components/saved-cohorts/saved-cohorts.component.tsx +139 -0
  39. package/src/components/saved-cohorts/saved-cohorts.resources.ts +39 -0
  40. package/src/components/saved-cohorts/saved-cohorts.scss +15 -0
  41. package/src/components/saved-cohorts/saved-cohorts.test.tsx +51 -0
  42. package/src/components/saved-queries/saved-queries-options/saved-queries-options.component.tsx +112 -0
  43. package/src/components/saved-queries/saved-queries-options/saved-queries-options.test.tsx +47 -0
  44. package/src/components/saved-queries/saved-queries.component.tsx +139 -0
  45. package/src/components/saved-queries/saved-queries.resources.ts +39 -0
  46. package/src/components/saved-queries/saved-queries.scss +23 -0
  47. package/src/components/saved-queries/saved-queries.test.tsx +50 -0
  48. package/src/components/search-button-set/search-button-set.css +9 -0
  49. package/src/components/search-button-set/search-button-set.test.tsx +26 -0
  50. package/src/components/search-button-set/search-button-set.tsx +47 -0
  51. package/src/components/search-by-concepts/search-by-concepts.component.tsx +344 -0
  52. package/src/components/search-by-concepts/search-by-concepts.style.scss +48 -0
  53. package/src/components/search-by-concepts/search-by-concepts.test.tsx +129 -0
  54. package/src/components/search-by-concepts/search-concept/search-concept.component.tsx +130 -0
  55. package/src/components/search-by-concepts/search-concept/search-concept.resource.ts +53 -0
  56. package/src/components/search-by-concepts/search-concept/search-concept.style.css +25 -0
  57. package/src/components/search-by-concepts/search-concept/search-concept.test.tsx +89 -0
  58. package/src/components/search-by-demographics/search-by-demographics.component.tsx +209 -0
  59. package/src/components/search-by-demographics/search-by-demographics.style.scss +42 -0
  60. package/src/components/search-by-demographics/search-by-demographics.test.tsx +92 -0
  61. package/src/components/search-by-demographics/search-by-demographics.utils.ts +129 -0
  62. package/src/components/search-by-drug-orders/search-by-drug-orders.component.tsx +185 -0
  63. package/src/components/search-by-drug-orders/search-by-drug-orders.resources.ts +60 -0
  64. package/src/components/search-by-drug-orders/search-by-drug-orders.style.scss +4 -0
  65. package/src/components/search-by-drug-orders/search-by-drug-orders.test.tsx +159 -0
  66. package/src/components/search-by-drug-orders/search-by-drug-orders.utils.ts +118 -0
  67. package/src/components/search-by-encounters/search-by-encounters.component.tsx +188 -0
  68. package/src/components/search-by-encounters/search-by-encounters.resources.ts +51 -0
  69. package/src/components/search-by-encounters/search-by-encounters.style.scss +12 -0
  70. package/src/components/search-by-encounters/search-by-encounters.test.tsx +202 -0
  71. package/src/components/search-by-encounters/search-by-encounters.utils.ts +113 -0
  72. package/src/components/search-by-enrollments/search-by-enrollments.component.tsx +183 -0
  73. package/src/components/search-by-enrollments/search-by-enrollments.resources.ts +31 -0
  74. package/src/components/search-by-enrollments/search-by-enrollments.style.scss +4 -0
  75. package/src/components/search-by-enrollments/search-by-enrollments.test.tsx +158 -0
  76. package/src/components/search-by-enrollments/search-by-enrollments.utils.ts +69 -0
  77. package/src/components/search-by-location/search-by-location.component.tsx +97 -0
  78. package/src/components/search-by-location/search-by-location.style.scss +4 -0
  79. package/src/components/search-by-location/search-by-location.test.tsx +110 -0
  80. package/src/components/search-by-location/search-by-location.utils.ts +40 -0
  81. package/src/components/search-by-person-attributes/search-by-person-attributes.component.tsx +90 -0
  82. package/src/components/search-by-person-attributes/search-by-person-attributes.resource.ts +27 -0
  83. package/src/components/search-by-person-attributes/search-by-person-attributes.style.scss +4 -0
  84. package/src/components/search-by-person-attributes/search-by-person-attributes.test.tsx +133 -0
  85. package/src/components/search-by-person-attributes/search-by-person-attributes.utils.ts +42 -0
  86. package/src/components/search-history/search-history-options/search-history-options.component.tsx +290 -0
  87. package/src/components/search-history/search-history-options/search-history-options.resources.ts +29 -0
  88. package/src/components/search-history/search-history-options/search-history-options.test.tsx +144 -0
  89. package/src/components/search-history/search-history.component.tsx +174 -0
  90. package/src/components/search-history/search-history.style.scss +12 -0
  91. package/src/components/search-history/search-history.test.tsx +106 -0
  92. package/src/components/search-history/search-history.utils.ts +14 -0
  93. package/src/components/search-results-table/search-results-table.component.tsx +105 -0
  94. package/src/components/search-results-table/search-results-table.scss +4 -0
  95. package/src/components/search-results-table/search-results-table.test.tsx +47 -0
  96. package/src/declarations.d.tsx +2 -0
  97. package/src/index.ts +47 -0
  98. package/src/setup-tests.ts +1 -0
  99. package/src/types/index.ts +120 -0
@@ -0,0 +1,376 @@
1
+ {
2
+ "chunks": [
3
+ {
4
+ "rendered": true,
5
+ "initial": true,
6
+ "entry": true,
7
+ "recorded": false,
8
+ "size": 21959,
9
+ "sizes": {
10
+ "javascript": 1301,
11
+ "consume-shared": 42,
12
+ "share-init": 252,
13
+ "runtime": 20364
14
+ },
15
+ "names": [
16
+ "main"
17
+ ],
18
+ "idHints": [],
19
+ "runtime": [
20
+ "main"
21
+ ],
22
+ "files": [
23
+ "main.js"
24
+ ],
25
+ "auxiliaryFiles": [],
26
+ "hash": "588387d2aec2e2bc01e3",
27
+ "childrenByOrder": {}
28
+ },
29
+ {
30
+ "rendered": false,
31
+ "initial": false,
32
+ "entry": false,
33
+ "recorded": false,
34
+ "reason": "reused as split chunk (cache group: default)",
35
+ "size": 42,
36
+ "sizes": {
37
+ "consume-shared": 42
38
+ },
39
+ "names": [],
40
+ "idHints": [],
41
+ "runtime": [
42
+ "@openmrs/esm-cohort-builder-app",
43
+ "main"
44
+ ],
45
+ "files": [],
46
+ "auxiliaryFiles": [],
47
+ "hash": "a4ba992f47960d103379",
48
+ "childrenByOrder": {}
49
+ },
50
+ {
51
+ "rendered": true,
52
+ "initial": false,
53
+ "entry": false,
54
+ "recorded": false,
55
+ "reason": "split chunk (cache group: defaultVendors)",
56
+ "size": 3422607,
57
+ "sizes": {
58
+ "javascript": 3422607
59
+ },
60
+ "names": [],
61
+ "idHints": [
62
+ "vendors"
63
+ ],
64
+ "runtime": [
65
+ "@openmrs/esm-cohort-builder-app",
66
+ "main"
67
+ ],
68
+ "files": [
69
+ "241.js"
70
+ ],
71
+ "auxiliaryFiles": [],
72
+ "hash": "dab3126e73e7da4c5c63",
73
+ "childrenByOrder": {}
74
+ },
75
+ {
76
+ "rendered": true,
77
+ "initial": false,
78
+ "entry": false,
79
+ "recorded": false,
80
+ "reason": "reused as split chunk (cache group: defaultVendors)",
81
+ "size": 39248,
82
+ "sizes": {
83
+ "javascript": 39248
84
+ },
85
+ "names": [],
86
+ "idHints": [
87
+ "vendors"
88
+ ],
89
+ "runtime": [
90
+ "@openmrs/esm-cohort-builder-app",
91
+ "main"
92
+ ],
93
+ "files": [
94
+ "247.js"
95
+ ],
96
+ "auxiliaryFiles": [],
97
+ "hash": "2f8bd40d809f31605ee1",
98
+ "childrenByOrder": {}
99
+ },
100
+ {
101
+ "rendered": true,
102
+ "initial": false,
103
+ "entry": false,
104
+ "recorded": false,
105
+ "size": 263023,
106
+ "sizes": {
107
+ "javascript": 262939,
108
+ "consume-shared": 84
109
+ },
110
+ "names": [],
111
+ "idHints": [],
112
+ "runtime": [
113
+ "@openmrs/esm-cohort-builder-app",
114
+ "main"
115
+ ],
116
+ "files": [
117
+ "255.js"
118
+ ],
119
+ "auxiliaryFiles": [],
120
+ "hash": "5d95f8f72eae9d0dc317",
121
+ "childrenByOrder": {}
122
+ },
123
+ {
124
+ "rendered": true,
125
+ "initial": false,
126
+ "entry": false,
127
+ "recorded": false,
128
+ "size": 380,
129
+ "sizes": {
130
+ "javascript": 380
131
+ },
132
+ "names": [],
133
+ "idHints": [],
134
+ "runtime": [
135
+ "@openmrs/esm-cohort-builder-app",
136
+ "main"
137
+ ],
138
+ "files": [
139
+ "285.js"
140
+ ],
141
+ "auxiliaryFiles": [],
142
+ "hash": "69871593940a8bfd2cd1",
143
+ "childrenByOrder": {}
144
+ },
145
+ {
146
+ "rendered": true,
147
+ "initial": false,
148
+ "entry": false,
149
+ "recorded": false,
150
+ "size": 7103,
151
+ "sizes": {
152
+ "javascript": 7103
153
+ },
154
+ "names": [],
155
+ "idHints": [],
156
+ "runtime": [
157
+ "@openmrs/esm-cohort-builder-app",
158
+ "main"
159
+ ],
160
+ "files": [
161
+ "294.js"
162
+ ],
163
+ "auxiliaryFiles": [],
164
+ "hash": "0dbdf982d57fd6958085",
165
+ "childrenByOrder": {}
166
+ },
167
+ {
168
+ "rendered": true,
169
+ "initial": false,
170
+ "entry": false,
171
+ "recorded": false,
172
+ "size": 1343,
173
+ "sizes": {
174
+ "javascript": 1301,
175
+ "consume-shared": 42
176
+ },
177
+ "names": [],
178
+ "idHints": [],
179
+ "runtime": [
180
+ "@openmrs/esm-cohort-builder-app"
181
+ ],
182
+ "files": [
183
+ "374.js"
184
+ ],
185
+ "auxiliaryFiles": [],
186
+ "hash": "8bde2c7957ee40fa95e9",
187
+ "childrenByOrder": {}
188
+ },
189
+ {
190
+ "rendered": false,
191
+ "initial": false,
192
+ "entry": false,
193
+ "recorded": false,
194
+ "reason": "split chunk (cache group: default)",
195
+ "size": 42,
196
+ "sizes": {
197
+ "consume-shared": 42
198
+ },
199
+ "names": [],
200
+ "idHints": [],
201
+ "runtime": [
202
+ "@openmrs/esm-cohort-builder-app",
203
+ "main"
204
+ ],
205
+ "files": [],
206
+ "auxiliaryFiles": [],
207
+ "hash": "8c5be47136c9ac1152e4",
208
+ "childrenByOrder": {}
209
+ },
210
+ {
211
+ "rendered": true,
212
+ "initial": false,
213
+ "entry": false,
214
+ "recorded": false,
215
+ "size": 6570,
216
+ "sizes": {
217
+ "javascript": 6570
218
+ },
219
+ "names": [],
220
+ "idHints": [],
221
+ "runtime": [
222
+ "@openmrs/esm-cohort-builder-app",
223
+ "main"
224
+ ],
225
+ "files": [
226
+ "484.js"
227
+ ],
228
+ "auxiliaryFiles": [],
229
+ "hash": "83c69307b4aad2af4664",
230
+ "childrenByOrder": {}
231
+ },
232
+ {
233
+ "rendered": true,
234
+ "initial": false,
235
+ "entry": false,
236
+ "recorded": false,
237
+ "reason": "split chunk (cache group: defaultVendors)",
238
+ "size": 104664,
239
+ "sizes": {
240
+ "javascript": 104664
241
+ },
242
+ "names": [],
243
+ "idHints": [
244
+ "vendors"
245
+ ],
246
+ "runtime": [
247
+ "@openmrs/esm-cohort-builder-app",
248
+ "main"
249
+ ],
250
+ "files": [
251
+ "508.js"
252
+ ],
253
+ "auxiliaryFiles": [],
254
+ "hash": "140fe5df134f9690846e",
255
+ "childrenByOrder": {}
256
+ },
257
+ {
258
+ "rendered": true,
259
+ "initial": false,
260
+ "entry": false,
261
+ "recorded": false,
262
+ "size": 4439,
263
+ "sizes": {
264
+ "javascript": 4439
265
+ },
266
+ "names": [],
267
+ "idHints": [],
268
+ "runtime": [
269
+ "@openmrs/esm-cohort-builder-app",
270
+ "main"
271
+ ],
272
+ "files": [
273
+ "574.js"
274
+ ],
275
+ "auxiliaryFiles": [],
276
+ "hash": "873f793538ce3a0b3f95",
277
+ "childrenByOrder": {}
278
+ },
279
+ {
280
+ "rendered": true,
281
+ "initial": false,
282
+ "entry": false,
283
+ "recorded": false,
284
+ "reason": "split chunk (cache group: defaultVendors)",
285
+ "size": 407232,
286
+ "sizes": {
287
+ "javascript": 407232
288
+ },
289
+ "names": [],
290
+ "idHints": [
291
+ "vendors"
292
+ ],
293
+ "runtime": [
294
+ "@openmrs/esm-cohort-builder-app",
295
+ "main"
296
+ ],
297
+ "files": [
298
+ "595.js"
299
+ ],
300
+ "auxiliaryFiles": [],
301
+ "hash": "7320782b2840b4f6297c",
302
+ "childrenByOrder": {}
303
+ },
304
+ {
305
+ "rendered": false,
306
+ "initial": false,
307
+ "entry": false,
308
+ "recorded": false,
309
+ "reason": "reused as split chunk (cache group: default)",
310
+ "size": 42,
311
+ "sizes": {
312
+ "consume-shared": 42
313
+ },
314
+ "names": [],
315
+ "idHints": [],
316
+ "runtime": [
317
+ "@openmrs/esm-cohort-builder-app",
318
+ "main"
319
+ ],
320
+ "files": [],
321
+ "auxiliaryFiles": [],
322
+ "hash": "d1810a8c31059b975c68",
323
+ "childrenByOrder": {}
324
+ },
325
+ {
326
+ "rendered": true,
327
+ "initial": true,
328
+ "entry": true,
329
+ "recorded": false,
330
+ "size": 20291,
331
+ "sizes": {
332
+ "javascript": 42,
333
+ "share-init": 252,
334
+ "runtime": 19997
335
+ },
336
+ "names": [
337
+ "@openmrs/esm-cohort-builder-app"
338
+ ],
339
+ "idHints": [],
340
+ "runtime": [
341
+ "@openmrs/esm-cohort-builder-app"
342
+ ],
343
+ "files": [
344
+ "openmrs-esm-cohort-builder-app.js"
345
+ ],
346
+ "auxiliaryFiles": [],
347
+ "hash": "6d31f0012b0aa2510ac7",
348
+ "childrenByOrder": {}
349
+ },
350
+ {
351
+ "rendered": true,
352
+ "initial": false,
353
+ "entry": false,
354
+ "recorded": false,
355
+ "reason": "reused as split chunk (cache group: defaultVendors)",
356
+ "size": 137533,
357
+ "sizes": {
358
+ "javascript": 137533
359
+ },
360
+ "names": [],
361
+ "idHints": [
362
+ "vendors"
363
+ ],
364
+ "runtime": [
365
+ "@openmrs/esm-cohort-builder-app",
366
+ "main"
367
+ ],
368
+ "files": [
369
+ "935.js"
370
+ ],
371
+ "auxiliaryFiles": [],
372
+ "hash": "44e513acaf00e86efa8d",
373
+ "childrenByOrder": {}
374
+ }
375
+ ]
376
+ }
@@ -0,0 +1 @@
1
+ var _openmrs_esm_cohort_builder_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,u,s,d,p,f,c,h={904:(e,r,t)=>{var n={"./start":()=>t.e(374).then((()=>()=>t(9374)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},m={};function v(e){var r=m[e];if(void 0!==r)return r.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return h[e].call(t.exports,t,t.exports,v),t.loaded=!0,t.exports}v.m=h,v.c=m,v.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return v.d(r,{a:r}),r},v.d=(e,r)=>{for(var t in r)v.o(r,t)&&!v.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},v.f={},v.e=e=>Promise.all(Object.keys(v.f).reduce(((r,t)=>(v.f[t](e,r),r)),[])),v.u=e=>e+".js",v.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),v.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@openmrs/esm-cohort-builder-app:",v.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,l;if(void 0!==o)for(var u=document.getElementsByTagName("script"),s=0;s<u.length;s++){var d=u[s];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==r+o){i=d;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,v.nc&&i.setAttribute("nonce",v.nc),i.setAttribute("data-webpack",r+o),i.src=t),e[t]=[n];var p=(r,n)=>{i.onerror=i.onload=null,clearTimeout(f);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},v.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},v.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{v.S={};var e={},r={};v.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];v.o(v.S,t)||(v.S[t]={});var a=v.S[t],i="@openmrs/esm-cohort-builder-app",l=(e,r,t,n)=>{var o=a[e]=a[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(o[r]={get:t,from:i,eager:!!n})},u=[];return"default"===t&&(l("@carbon/react","1.16.0",(()=>Promise.all([v.e(241),v.e(672),v.e(183)]).then((()=>()=>v(241))))),l("@openmrs/esm-framework","4.0.3-pre.406",(()=>Promise.all([v.e(595),v.e(672)]).then((()=>()=>v(595))))),l("dayjs","1.11.3",(()=>v.e(484).then((()=>()=>v(7484))))),l("react-dom","18.2.0",(()=>Promise.all([v.e(935),v.e(672)]).then((()=>()=>v(3935))))),l("react-i18next","11.18.4",(()=>Promise.all([v.e(247),v.e(672)]).then((()=>()=>v(8247))))),l("react","18.2.0",(()=>v.e(294).then((()=>()=>v(7294)))))),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),(()=>{var e;v.g.importScripts&&(e=v.g.location+"");var r=v.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),v.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n<r.length&&"u"!=(typeof r[n])[0];var o=e[n],a=(typeof o)[0];if(n>=r.length)return"u"==a;var i=r[n],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}},o=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a<e.length;a++)n--,t+="u"==(typeof(l=e[a]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var i=[];for(a=1;a<e.length;a++){var l=e[a];i.push(0===l?"not("+u()+")":1===l?"("+u()+" || "+u()+")":2===l?i.pop()+" "+i.pop():o(l))}return u();function u(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var i=0,l=1,u=!0;;l++,i++){var s,d,p=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(d=(typeof(s=r[i]))[0]))return!u||("u"==p?l>n&&!o:""==p!=o);if("u"==d){if(!u||"u"!=p)return!1}else if(u)if(p==d)if(l<=n){if(s!=e[l])return!1}else{if(o?s>e[l]:s<e[l])return!1;s!=e[l]&&(u=!1)}else if("s"!=p&&"n"!=p){if(o||l<=n)return!1;u=!1,l--}else{if(l<=n||d<p!=o)return!1;u=!1}else"s"!=p&&"n"!=p&&(u=!1,l--)}}var f=[],c=f.pop.bind(f);for(i=1;i<e.length;i++){var h=e[i];f.push(1==h?c()|c():2==h?c()&c():h?a(h,r):!c())}return!!c()},i=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&n(e,r)?r:e),0)},l=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(n)+")",u=(e,r,t,n)=>{var o=i(e,t);return a(n,o)||"undefined"!=typeof console&&console.warn&&console.warn(l(e,t,o,n)),s(e[t][o])},s=e=>(e.loaded=1,e.get()),d=(e=>function(r,t,n,o){var a=v.I(r);return a&&a.then?a.then(e.bind(e,r,v.S[r],t,n,o)):e(0,v.S[r],t,n,o)})(((e,r,t,n,o)=>r&&v.o(r,t)?u(r,0,t,n):o())),p={},f={1672:()=>d("default","react",[1,18],(()=>v.e(294).then((()=>()=>v(7294))))),5183:()=>d("default","react-dom",[1,18],(()=>v.e(935).then((()=>()=>v(3935))))),311:()=>d("default","@openmrs/esm-framework",[1,"next"],(()=>Promise.all([v.e(595),v.e(672)]).then((()=>()=>v(595))))),3397:()=>d("default","react-i18next",[1,11],(()=>v.e(247).then((()=>()=>v(8247))))),3119:()=>d("default","dayjs",[1,1,11,3],(()=>v.e(484).then((()=>()=>v(7484))))),7187:()=>d("default","@carbon/react",[1,1],(()=>Promise.all([v.e(241),v.e(183)]).then((()=>()=>v(241)))))},c={183:[5183],255:[3119,7187],374:[311],397:[3397],672:[1672]},v.f.consumes=(e,r)=>{v.o(c,e)&&c[e].forEach((e=>{if(v.o(p,e))return r.push(p[e]);var t=r=>{p[e]=0,v.m[e]=t=>{delete v.c[e],t.exports=r()}},n=r=>{delete p[e],v.m[e]=t=>{throw delete v.c[e],r}};try{var o=f[e]();o.then?r.push(p[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={926:0};v.f.j=(r,t)=>{var n=v.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(183|397|672)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=v.p+v.u(r),i=new Error;v.l(a,(t=>{if(v.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,l]=t,u=0;if(a.some((r=>0!==e[r]))){for(n in i)v.o(i,n)&&(v.m[n]=i[n]);l&&l(v)}for(r&&r(t);u<a.length;u++)o=a[u],v.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunk_openmrs_esm_cohort_builder_app=self.webpackChunk_openmrs_esm_cohort_builder_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),v.nc=void 0;var g=v(904);_openmrs_esm_cohort_builder_app=g})();
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "@openmrs/esm-cohort-builder-app",
3
+ "version": "3.0.1-pre.102",
4
+ "license": "MPL-2.0",
5
+ "description": "A microfrontend for OpenMRS cohorts",
6
+ "browser": "dist/openmrs-esm-cohort-builder-app.js",
7
+ "main": "src/index.ts",
8
+ "source": true,
9
+ "scripts": {
10
+ "start": "openmrs develop",
11
+ "serve": "webpack serve --mode=development",
12
+ "build": "webpack --mode production",
13
+ "analyze": "webpack --mode=production --env.analyze=true",
14
+ "lint": "eslint src --ext js,jsx,ts,tsx",
15
+ "prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
16
+ "typescript": "tsc",
17
+ "test": "jest --config jest.config.json --verbose",
18
+ "verify": "concurrently 'yarn:lint' 'yarn:test' 'yarn:typescript'",
19
+ "coverage": "yarn test -- --coverage",
20
+ "prepare": "husky install"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "src"
25
+ ],
26
+ "husky": {
27
+ "hooks": {
28
+ "pre-commit": "pretty-quick --staged && yarn verify"
29
+ }
30
+ },
31
+ "browserslist": [
32
+ "extends browserslist-config-openmrs"
33
+ ],
34
+ "keywords": [
35
+ "openmrs",
36
+ "microfrontends"
37
+ ],
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/openmrs/openmrs-esm-cohortbuilder.git"
41
+ },
42
+ "homepage": "https://github.com/openmrs/openmrs-esm-cohortbuilder#readme",
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "bugs": {
47
+ "url": "https://github.com/openmrs/openmrs-esm-cohortbuilder/issues"
48
+ },
49
+ "peerDependencies": {
50
+ "@carbon/react": "1.x",
51
+ "@openmrs/esm-framework": "next",
52
+ "dayjs": "^1.11.3",
53
+ "react": "18.x",
54
+ "react-dom": "18.x",
55
+ "react-i18next": "11.x"
56
+ },
57
+ "devDependencies": {
58
+ "@openmrs/esm-patient-common-lib": "next",
59
+ "@swc/cli": "^0.1.57",
60
+ "@swc/core": "^1.3.14",
61
+ "@swc/jest": "^0.2.22",
62
+ "@testing-library/dom": "^7.31.2",
63
+ "@testing-library/jest-dom": "^5.13.0",
64
+ "@testing-library/react": "^13.3.0",
65
+ "@testing-library/user-event": "^14.4.3",
66
+ "@types/jest": "^28.1.7",
67
+ "@types/react-dom": "^16.9.14",
68
+ "@types/webpack-env": "^1.16.0",
69
+ "@typescript-eslint/eslint-plugin": "^5.29.0",
70
+ "@typescript-eslint/parser": "^5.14.0",
71
+ "concurrently": "^6.2.0",
72
+ "css-loader": "^6.7.1",
73
+ "eslint": "^8.18.0",
74
+ "eslint-config-prettier": "^8.3.0",
75
+ "eslint-config-ts-react-important-stuff": "^3.0.0",
76
+ "eslint-plugin-import": "^2.26.0",
77
+ "eslint-plugin-prettier": "^3.4.0",
78
+ "eslint-plugin-unused-imports": "^2.0.0",
79
+ "husky": "^6.0.0",
80
+ "identity-obj-proxy": "^3.0.0",
81
+ "jest": "^28.1.3",
82
+ "jest-cli": "^28.1.3",
83
+ "jest-environment-jsdom": "^28.1.3",
84
+ "openmrs": "next",
85
+ "prettier": "^2.3.0",
86
+ "pretty-quick": "^3.1.0",
87
+ "react": "^18.2.0",
88
+ "react-dom": "^18.2.0",
89
+ "react-i18next": "^11.18.4",
90
+ "typescript": "^4.3.2"
91
+ },
92
+ "dependencies": {}
93
+ }
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+
3
+ import { ConfigurableLink } from "@openmrs/esm-framework";
4
+ import { useTranslation } from "react-i18next";
5
+
6
+ export default function CohortBuilderAppMenuLink() {
7
+ const { t } = useTranslation();
8
+
9
+ return (
10
+ <ConfigurableLink to="${openmrsSpaBase}/cohort-builder">
11
+ {t("cohortBuilder", "Cohort Builder")}
12
+ </ConfigurableLink>
13
+ );
14
+ }
@@ -0,0 +1,84 @@
1
+ import { openmrsFetch, FetchResponse } from "@openmrs/esm-framework";
2
+ import useSWRImmutable from "swr/immutable";
3
+
4
+ import { Patient, SearchParams, DropdownValue, Response } from "./types";
5
+
6
+ /**
7
+ * @param searchParams query details
8
+ */
9
+
10
+ interface SearchResults {
11
+ rows: Patient[];
12
+ }
13
+
14
+ export const search = async (searchParams: SearchParams) => {
15
+ const searchResults: FetchResponse<SearchResults> = await openmrsFetch(
16
+ "/ws/rest/v1/reportingrest/adhocquery?v=full",
17
+ {
18
+ method: "POST",
19
+ headers: { "Content-Type": "application/json" },
20
+ body: searchParams.query,
21
+ }
22
+ );
23
+ return searchResults;
24
+ };
25
+
26
+ /**
27
+ * @returns Locations
28
+ */
29
+ export const useLocations = () => {
30
+ const { data, error } = useSWRImmutable<{
31
+ data: { results: Response[] };
32
+ }>("/ws/rest/v1/location", openmrsFetch);
33
+
34
+ const locations: DropdownValue[] = [];
35
+ data?.data.results.map((location: Response, index: number) => {
36
+ locations.push({
37
+ id: index,
38
+ label: location.display,
39
+ value: location.uuid,
40
+ });
41
+ });
42
+
43
+ return {
44
+ isLoading: !data && !error,
45
+ locations,
46
+ locationsError: error,
47
+ };
48
+ };
49
+
50
+ export const getDataSet = async (queryID: string) => {
51
+ const results: FetchResponse<SearchResults> = await openmrsFetch(
52
+ `/ws/rest/v1/reportingrest/dataSet/${queryID}`,
53
+ {
54
+ method: "GET",
55
+ }
56
+ );
57
+
58
+ const dataset = results.data.rows.map((patient: Patient) => {
59
+ patient.id = patient.patientId.toString();
60
+ patient.name = `${patient.firstname} ${patient.lastname}`;
61
+
62
+ return patient;
63
+ });
64
+
65
+ return dataset;
66
+ };
67
+
68
+ export const getCohortMembers = async (cohortId: string) => {
69
+ const results: FetchResponse<SearchResults> = await openmrsFetch(
70
+ `/ws/rest/v1/cohort/${cohortId}/member?v=full`,
71
+ {
72
+ method: "GET",
73
+ }
74
+ );
75
+
76
+ const dataset = results.data.rows.map((patient: Patient) => {
77
+ patient.id = patient.patientId.toString();
78
+ patient.name = `${patient.firstname} ${patient.lastname}`;
79
+
80
+ return patient;
81
+ });
82
+
83
+ return dataset;
84
+ };