@openmrs/esm-cohort-builder-app 3.0.0

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 (103) hide show
  1. package/LICENSE +401 -0
  2. package/README.md +16 -0
  3. package/dist/130.js +2 -0
  4. package/dist/130.js.LICENSE.txt +9 -0
  5. package/dist/139.js +1 -0
  6. package/dist/247.js +1 -0
  7. package/dist/294.js +2 -0
  8. package/dist/294.js.LICENSE.txt +9 -0
  9. package/dist/434.js +2 -0
  10. package/dist/434.js.LICENSE.txt +12 -0
  11. package/dist/480.js +2 -0
  12. package/dist/480.js.LICENSE.txt +12 -0
  13. package/dist/484.js +1 -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/690.js +1 -0
  18. package/dist/873.js +1 -0
  19. package/dist/935.js +2 -0
  20. package/dist/935.js.LICENSE.txt +19 -0
  21. package/dist/964.js +2 -0
  22. package/dist/964.js.LICENSE.txt +14 -0
  23. package/dist/main.js +1 -0
  24. package/dist/openmrs-esm-cohort-builder-app.js +1 -0
  25. package/dist/openmrs-esm-cohort-builder-app.js.buildmanifest.json +426 -0
  26. package/dist/openmrs-esm-cohort-builder-app.old +1 -0
  27. package/package.json +99 -0
  28. package/src/cohort-builder-app-menu-link.tsx +14 -0
  29. package/src/cohort-builder.resources.ts +84 -0
  30. package/src/cohort-builder.scss +126 -0
  31. package/src/cohort-builder.test.tsx +12 -0
  32. package/src/cohort-builder.tsx +213 -0
  33. package/src/cohort-builder.utils.ts +197 -0
  34. package/src/components/composition/composition.component.tsx +109 -0
  35. package/src/components/composition/composition.style.css +3 -0
  36. package/src/components/composition/composition.test.tsx +112 -0
  37. package/src/components/composition/composition.utils.ts +53 -0
  38. package/src/components/empty-data/empty-data.component.tsx +25 -0
  39. package/src/components/empty-data/empty-data.style.scss +19 -0
  40. package/src/components/saved-cohorts/saved-cohorts-options/saved-cohort-options.test.tsx +49 -0
  41. package/src/components/saved-cohorts/saved-cohorts-options/saved-cohorts-options.component.tsx +112 -0
  42. package/src/components/saved-cohorts/saved-cohorts.component.tsx +139 -0
  43. package/src/components/saved-cohorts/saved-cohorts.resources.ts +39 -0
  44. package/src/components/saved-cohorts/saved-cohorts.scss +15 -0
  45. package/src/components/saved-cohorts/saved-cohorts.test.tsx +51 -0
  46. package/src/components/saved-queries/saved-queries-options/saved-queries-options.component.tsx +112 -0
  47. package/src/components/saved-queries/saved-queries-options/saved-queries-options.test.tsx +47 -0
  48. package/src/components/saved-queries/saved-queries.component.tsx +139 -0
  49. package/src/components/saved-queries/saved-queries.resources.ts +39 -0
  50. package/src/components/saved-queries/saved-queries.scss +23 -0
  51. package/src/components/saved-queries/saved-queries.test.tsx +50 -0
  52. package/src/components/search-button-set/search-button-set.css +9 -0
  53. package/src/components/search-button-set/search-button-set.test.tsx +26 -0
  54. package/src/components/search-button-set/search-button-set.tsx +47 -0
  55. package/src/components/search-by-concepts/search-by-concepts.component.tsx +344 -0
  56. package/src/components/search-by-concepts/search-by-concepts.style.scss +48 -0
  57. package/src/components/search-by-concepts/search-by-concepts.test.tsx +129 -0
  58. package/src/components/search-by-concepts/search-concept/search-concept.component.tsx +130 -0
  59. package/src/components/search-by-concepts/search-concept/search-concept.resource.ts +53 -0
  60. package/src/components/search-by-concepts/search-concept/search-concept.style.css +25 -0
  61. package/src/components/search-by-concepts/search-concept/search-concept.test.tsx +89 -0
  62. package/src/components/search-by-demographics/search-by-demographics.component.tsx +209 -0
  63. package/src/components/search-by-demographics/search-by-demographics.style.scss +41 -0
  64. package/src/components/search-by-demographics/search-by-demographics.test.tsx +92 -0
  65. package/src/components/search-by-demographics/search-by-demographics.utils.ts +129 -0
  66. package/src/components/search-by-drug-orders/search-by-drug-orders.component.tsx +185 -0
  67. package/src/components/search-by-drug-orders/search-by-drug-orders.resources.ts +60 -0
  68. package/src/components/search-by-drug-orders/search-by-drug-orders.style.scss +4 -0
  69. package/src/components/search-by-drug-orders/search-by-drug-orders.test.tsx +159 -0
  70. package/src/components/search-by-drug-orders/search-by-drug-orders.utils.ts +118 -0
  71. package/src/components/search-by-encounters/search-by-encounters.component.tsx +188 -0
  72. package/src/components/search-by-encounters/search-by-encounters.resources.ts +51 -0
  73. package/src/components/search-by-encounters/search-by-encounters.style.scss +12 -0
  74. package/src/components/search-by-encounters/search-by-encounters.test.tsx +202 -0
  75. package/src/components/search-by-encounters/search-by-encounters.utils.ts +113 -0
  76. package/src/components/search-by-enrollments/search-by-enrollments.component.tsx +183 -0
  77. package/src/components/search-by-enrollments/search-by-enrollments.resources.ts +31 -0
  78. package/src/components/search-by-enrollments/search-by-enrollments.style.scss +4 -0
  79. package/src/components/search-by-enrollments/search-by-enrollments.test.tsx +158 -0
  80. package/src/components/search-by-enrollments/search-by-enrollments.utils.ts +69 -0
  81. package/src/components/search-by-location/search-by-location.component.tsx +97 -0
  82. package/src/components/search-by-location/search-by-location.style.scss +4 -0
  83. package/src/components/search-by-location/search-by-location.test.tsx +110 -0
  84. package/src/components/search-by-location/search-by-location.utils.ts +40 -0
  85. package/src/components/search-by-person-attributes/search-by-person-attributes.component.tsx +90 -0
  86. package/src/components/search-by-person-attributes/search-by-person-attributes.resource.ts +27 -0
  87. package/src/components/search-by-person-attributes/search-by-person-attributes.style.scss +4 -0
  88. package/src/components/search-by-person-attributes/search-by-person-attributes.test.tsx +133 -0
  89. package/src/components/search-by-person-attributes/search-by-person-attributes.utils.ts +42 -0
  90. package/src/components/search-history/search-history-options/search-history-options.component.tsx +290 -0
  91. package/src/components/search-history/search-history-options/search-history-options.resources.ts +29 -0
  92. package/src/components/search-history/search-history-options/search-history-options.test.tsx +144 -0
  93. package/src/components/search-history/search-history.component.tsx +174 -0
  94. package/src/components/search-history/search-history.style.scss +12 -0
  95. package/src/components/search-history/search-history.test.tsx +106 -0
  96. package/src/components/search-history/search-history.utils.ts +14 -0
  97. package/src/components/search-results-table/search-results-table.component.tsx +105 -0
  98. package/src/components/search-results-table/search-results-table.scss +4 -0
  99. package/src/components/search-results-table/search-results-table.test.tsx +47 -0
  100. package/src/declarations.d.tsx +2 -0
  101. package/src/index.ts +47 -0
  102. package/src/setup-tests.ts +1 -0
  103. package/src/types/index.ts +120 -0
@@ -0,0 +1,426 @@
1
+ {
2
+ "chunks": [
3
+ {
4
+ "rendered": true,
5
+ "initial": false,
6
+ "entry": false,
7
+ "recorded": false,
8
+ "reason": "split chunk (cache group: defaultVendors)",
9
+ "size": 104403,
10
+ "sizes": {
11
+ "javascript": 104403
12
+ },
13
+ "names": [],
14
+ "idHints": [
15
+ "vendors"
16
+ ],
17
+ "runtime": [
18
+ "@openmrs/esm-cohort-builder-app",
19
+ "main"
20
+ ],
21
+ "files": [
22
+ "130.js"
23
+ ],
24
+ "auxiliaryFiles": [],
25
+ "hash": "c15abe8cc24716d3354b",
26
+ "childrenByOrder": {}
27
+ },
28
+ {
29
+ "rendered": true,
30
+ "initial": false,
31
+ "entry": false,
32
+ "recorded": false,
33
+ "size": 380,
34
+ "sizes": {
35
+ "javascript": 380
36
+ },
37
+ "names": [],
38
+ "idHints": [],
39
+ "runtime": [
40
+ "@openmrs/esm-cohort-builder-app",
41
+ "main"
42
+ ],
43
+ "files": [
44
+ "139.js"
45
+ ],
46
+ "auxiliaryFiles": [],
47
+ "hash": "6e0c20b18ab6c71f0b54",
48
+ "childrenByOrder": {}
49
+ },
50
+ {
51
+ "rendered": true,
52
+ "initial": true,
53
+ "entry": true,
54
+ "recorded": false,
55
+ "size": 22523,
56
+ "sizes": {
57
+ "javascript": 1301,
58
+ "consume-shared": 42,
59
+ "share-init": 294,
60
+ "runtime": 20886
61
+ },
62
+ "names": [
63
+ "main"
64
+ ],
65
+ "idHints": [],
66
+ "runtime": [
67
+ "main"
68
+ ],
69
+ "files": [
70
+ "main.js"
71
+ ],
72
+ "auxiliaryFiles": [],
73
+ "hash": "63ba91d6d7b3452853ce",
74
+ "childrenByOrder": {}
75
+ },
76
+ {
77
+ "rendered": false,
78
+ "initial": false,
79
+ "entry": false,
80
+ "recorded": false,
81
+ "reason": "reused as split chunk (cache group: default)",
82
+ "size": 42,
83
+ "sizes": {
84
+ "consume-shared": 42
85
+ },
86
+ "names": [],
87
+ "idHints": [],
88
+ "runtime": [
89
+ "@openmrs/esm-cohort-builder-app",
90
+ "main"
91
+ ],
92
+ "files": [],
93
+ "auxiliaryFiles": [],
94
+ "hash": "a4ba992f47960d103379",
95
+ "childrenByOrder": {}
96
+ },
97
+ {
98
+ "rendered": true,
99
+ "initial": false,
100
+ "entry": false,
101
+ "recorded": false,
102
+ "reason": "reused as split chunk (cache group: defaultVendors)",
103
+ "size": 39248,
104
+ "sizes": {
105
+ "javascript": 39248
106
+ },
107
+ "names": [],
108
+ "idHints": [
109
+ "vendors"
110
+ ],
111
+ "runtime": [
112
+ "@openmrs/esm-cohort-builder-app",
113
+ "main"
114
+ ],
115
+ "files": [
116
+ "247.js"
117
+ ],
118
+ "auxiliaryFiles": [],
119
+ "hash": "2f8bd40d809f31605ee1",
120
+ "childrenByOrder": {}
121
+ },
122
+ {
123
+ "rendered": true,
124
+ "initial": false,
125
+ "entry": false,
126
+ "recorded": false,
127
+ "size": 7103,
128
+ "sizes": {
129
+ "javascript": 7103
130
+ },
131
+ "names": [],
132
+ "idHints": [],
133
+ "runtime": [
134
+ "@openmrs/esm-cohort-builder-app",
135
+ "main"
136
+ ],
137
+ "files": [
138
+ "294.js"
139
+ ],
140
+ "auxiliaryFiles": [],
141
+ "hash": "0dbdf982d57fd6958085",
142
+ "childrenByOrder": {}
143
+ },
144
+ {
145
+ "rendered": false,
146
+ "initial": false,
147
+ "entry": false,
148
+ "recorded": false,
149
+ "reason": "split chunk (cache group: default)",
150
+ "size": 42,
151
+ "sizes": {
152
+ "consume-shared": 42
153
+ },
154
+ "names": [],
155
+ "idHints": [],
156
+ "runtime": [
157
+ "@openmrs/esm-cohort-builder-app",
158
+ "main"
159
+ ],
160
+ "files": [],
161
+ "auxiliaryFiles": [],
162
+ "hash": "8c5be47136c9ac1152e4",
163
+ "childrenByOrder": {}
164
+ },
165
+ {
166
+ "rendered": true,
167
+ "initial": false,
168
+ "entry": false,
169
+ "recorded": false,
170
+ "reason": "split chunk (cache group: defaultVendors)",
171
+ "size": 2992186,
172
+ "sizes": {
173
+ "javascript": 2992186
174
+ },
175
+ "names": [],
176
+ "idHints": [
177
+ "vendors"
178
+ ],
179
+ "runtime": [
180
+ "@openmrs/esm-cohort-builder-app",
181
+ "main"
182
+ ],
183
+ "files": [
184
+ "434.js"
185
+ ],
186
+ "auxiliaryFiles": [],
187
+ "hash": "c0dbc2a2a34ef9e5fba0",
188
+ "childrenByOrder": {}
189
+ },
190
+ {
191
+ "rendered": true,
192
+ "initial": false,
193
+ "entry": false,
194
+ "recorded": false,
195
+ "reason": "split chunk (cache group: defaultVendors)",
196
+ "size": 2960979,
197
+ "sizes": {
198
+ "javascript": 2960979
199
+ },
200
+ "names": [],
201
+ "idHints": [
202
+ "vendors"
203
+ ],
204
+ "runtime": [
205
+ "@openmrs/esm-cohort-builder-app",
206
+ "main"
207
+ ],
208
+ "files": [
209
+ "480.js"
210
+ ],
211
+ "auxiliaryFiles": [],
212
+ "hash": "40cb4314f38e522f0153",
213
+ "childrenByOrder": {}
214
+ },
215
+ {
216
+ "rendered": true,
217
+ "initial": false,
218
+ "entry": false,
219
+ "recorded": false,
220
+ "size": 6670,
221
+ "sizes": {
222
+ "javascript": 6670
223
+ },
224
+ "names": [],
225
+ "idHints": [],
226
+ "runtime": [
227
+ "@openmrs/esm-cohort-builder-app",
228
+ "main"
229
+ ],
230
+ "files": [
231
+ "484.js"
232
+ ],
233
+ "auxiliaryFiles": [],
234
+ "hash": "6822e873678e33cb5f12",
235
+ "childrenByOrder": {}
236
+ },
237
+ {
238
+ "rendered": true,
239
+ "initial": false,
240
+ "entry": false,
241
+ "recorded": false,
242
+ "size": 4439,
243
+ "sizes": {
244
+ "javascript": 4439
245
+ },
246
+ "names": [],
247
+ "idHints": [],
248
+ "runtime": [
249
+ "@openmrs/esm-cohort-builder-app",
250
+ "main"
251
+ ],
252
+ "files": [
253
+ "574.js"
254
+ ],
255
+ "auxiliaryFiles": [],
256
+ "hash": "873f793538ce3a0b3f95",
257
+ "childrenByOrder": {}
258
+ },
259
+ {
260
+ "rendered": true,
261
+ "initial": false,
262
+ "entry": false,
263
+ "recorded": false,
264
+ "reason": "split chunk (cache group: defaultVendors)",
265
+ "size": 391981,
266
+ "sizes": {
267
+ "javascript": 391981
268
+ },
269
+ "names": [],
270
+ "idHints": [
271
+ "vendors"
272
+ ],
273
+ "runtime": [
274
+ "@openmrs/esm-cohort-builder-app",
275
+ "main"
276
+ ],
277
+ "files": [
278
+ "595.js"
279
+ ],
280
+ "auxiliaryFiles": [],
281
+ "hash": "ea16e925881ea77666d2",
282
+ "childrenByOrder": {}
283
+ },
284
+ {
285
+ "rendered": false,
286
+ "initial": false,
287
+ "entry": false,
288
+ "recorded": false,
289
+ "reason": "reused as split chunk (cache group: default)",
290
+ "size": 42,
291
+ "sizes": {
292
+ "consume-shared": 42
293
+ },
294
+ "names": [],
295
+ "idHints": [],
296
+ "runtime": [
297
+ "@openmrs/esm-cohort-builder-app",
298
+ "main"
299
+ ],
300
+ "files": [],
301
+ "auxiliaryFiles": [],
302
+ "hash": "d1810a8c31059b975c68",
303
+ "childrenByOrder": {}
304
+ },
305
+ {
306
+ "rendered": true,
307
+ "initial": false,
308
+ "entry": false,
309
+ "recorded": false,
310
+ "size": 263104,
311
+ "sizes": {
312
+ "javascript": 262978,
313
+ "consume-shared": 126
314
+ },
315
+ "names": [],
316
+ "idHints": [],
317
+ "runtime": [
318
+ "@openmrs/esm-cohort-builder-app",
319
+ "main"
320
+ ],
321
+ "files": [
322
+ "690.js"
323
+ ],
324
+ "auxiliaryFiles": [],
325
+ "hash": "224182b966132ced29d8",
326
+ "childrenByOrder": {}
327
+ },
328
+ {
329
+ "rendered": true,
330
+ "initial": false,
331
+ "entry": false,
332
+ "recorded": false,
333
+ "size": 1343,
334
+ "sizes": {
335
+ "javascript": 1301,
336
+ "consume-shared": 42
337
+ },
338
+ "names": [],
339
+ "idHints": [],
340
+ "runtime": [
341
+ "@openmrs/esm-cohort-builder-app"
342
+ ],
343
+ "files": [
344
+ "873.js"
345
+ ],
346
+ "auxiliaryFiles": [],
347
+ "hash": "9f35c81fc4aa9871defa",
348
+ "childrenByOrder": {}
349
+ },
350
+ {
351
+ "rendered": true,
352
+ "initial": true,
353
+ "entry": true,
354
+ "recorded": false,
355
+ "size": 20855,
356
+ "sizes": {
357
+ "javascript": 42,
358
+ "share-init": 294,
359
+ "runtime": 20519
360
+ },
361
+ "names": [
362
+ "@openmrs/esm-cohort-builder-app"
363
+ ],
364
+ "idHints": [],
365
+ "runtime": [
366
+ "@openmrs/esm-cohort-builder-app"
367
+ ],
368
+ "files": [
369
+ "openmrs-esm-cohort-builder-app.js"
370
+ ],
371
+ "auxiliaryFiles": [],
372
+ "hash": "b6f543c102530d3034b6",
373
+ "childrenByOrder": {}
374
+ },
375
+ {
376
+ "rendered": true,
377
+ "initial": false,
378
+ "entry": false,
379
+ "recorded": false,
380
+ "reason": "reused as split chunk (cache group: defaultVendors)",
381
+ "size": 137533,
382
+ "sizes": {
383
+ "javascript": 137533
384
+ },
385
+ "names": [],
386
+ "idHints": [
387
+ "vendors"
388
+ ],
389
+ "runtime": [
390
+ "@openmrs/esm-cohort-builder-app",
391
+ "main"
392
+ ],
393
+ "files": [
394
+ "935.js"
395
+ ],
396
+ "auxiliaryFiles": [],
397
+ "hash": "44e513acaf00e86efa8d",
398
+ "childrenByOrder": {}
399
+ },
400
+ {
401
+ "rendered": true,
402
+ "initial": false,
403
+ "entry": false,
404
+ "recorded": false,
405
+ "reason": "split chunk (cache group: defaultVendors)",
406
+ "size": 430421,
407
+ "sizes": {
408
+ "javascript": 430421
409
+ },
410
+ "names": [],
411
+ "idHints": [
412
+ "vendors"
413
+ ],
414
+ "runtime": [
415
+ "@openmrs/esm-cohort-builder-app",
416
+ "main"
417
+ ],
418
+ "files": [
419
+ "964.js"
420
+ ],
421
+ "auxiliaryFiles": [],
422
+ "hash": "9bca39d77a0a20b2b887",
423
+ "childrenByOrder": {}
424
+ }
425
+ ]
426
+ }
@@ -0,0 +1 @@
1
+ var _openmrs_esm_cohort_builder_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,d,p,f,c,h={904:(e,r,t)=>{var n={"./start":()=>t.e(873).then((()=>()=>t(8873)))},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 s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var d=s[u];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})},s=[];return"default"===t&&(l("@carbon/react","1.16.0",(()=>Promise.all([v.e(964),v.e(434),v.e(672),v.e(183)]).then((()=>()=>v(4434))))),l("@carbon/react","1.21.0",(()=>Promise.all([v.e(964),v.e(480),v.e(672),v.e(183)]).then((()=>()=>v(3480))))),l("@openmrs/esm-framework","4.0.4-pre.475",(()=>Promise.all([v.e(595),v.e(672)]).then((()=>()=>v(595))))),l("dayjs","1.11.7",(()=>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]=s.length?Promise.all(s).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("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?i.pop()+" "+i.pop():o(l))}return s();function s(){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,s=!0;;l++,i++){var u,d,p=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(d=(typeof(u=r[i]))[0]))return!s||("u"==p?l>n&&!o:""==p!=o);if("u"==d){if(!s||"u"!=p)return!1}else if(s)if(p==d)if(l<=n){if(u!=e[l])return!1}else{if(o?u>e[l]:u<e[l])return!1;u!=e[l]&&(s=!1)}else if("s"!=p&&"n"!=p){if(o||l<=n)return!1;s=!1,l--}else{if(l<=n||d<p!=o)return!1;s=!1}else"s"!=p&&"n"!=p&&(s=!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)+")",s=(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)),u(e[t][o])},u=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)?s(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))))),1132:()=>d("default","@openmrs/esm-framework",[0],(()=>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))))),5247:()=>d("default","@carbon/react",[1,1],(()=>Promise.all([v.e(964),v.e(434),v.e(183)]).then((()=>()=>v(4434))))),7187:()=>d("default","@carbon/react",[1,1],(()=>Promise.all([v.e(964),v.e(480),v.e(183)]).then((()=>()=>v(3480)))))},c={183:[5183],397:[3397],672:[1672],690:[3119,5247,7187],873:[1132]},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,s=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);s<a.length;s++)o=a[s],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 b=v(904);_openmrs_esm_cohort_builder_app=b})();
package/package.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "@openmrs/esm-cohort-builder-app",
3
+ "version": "3.0.0",
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": "*",
52
+ "dayjs": "^1.11.3",
53
+ "react": "18.x",
54
+ "react-dom": "18.x",
55
+ "react-i18next": "11.x"
56
+ },
57
+ "devDependencies": {
58
+ "@carbon/react": "^1.21.0",
59
+ "@openmrs/esm-framework": "next",
60
+ "@openmrs/esm-patient-common-lib": "next",
61
+ "@openmrs/esm-styleguide": "next",
62
+ "@swc/cli": "^0.1.57",
63
+ "@swc/core": "^1.3.14",
64
+ "@swc/jest": "^0.2.22",
65
+ "@testing-library/dom": "^7.31.2",
66
+ "@testing-library/jest-dom": "^5.13.0",
67
+ "@testing-library/react": "^13.3.0",
68
+ "@testing-library/user-event": "^14.4.3",
69
+ "@types/jest": "^28.1.7",
70
+ "@types/react-dom": "^16.9.14",
71
+ "@types/webpack-env": "^1.16.0",
72
+ "@typescript-eslint/eslint-plugin": "^5.29.0",
73
+ "@typescript-eslint/parser": "^5.14.0",
74
+ "concurrently": "^6.2.0",
75
+ "css-loader": "^6.7.1",
76
+ "dayjs": "^1.11.3",
77
+ "eslint": "^8.18.0",
78
+ "eslint-config-prettier": "^8.3.0",
79
+ "eslint-config-ts-react-important-stuff": "^3.0.0",
80
+ "eslint-plugin-import": "^2.26.0",
81
+ "eslint-plugin-prettier": "^3.4.0",
82
+ "eslint-plugin-unused-imports": "^2.0.0",
83
+ "husky": "^6.0.0",
84
+ "identity-obj-proxy": "^3.0.0",
85
+ "jest": "^28.1.3",
86
+ "jest-cli": "^28.1.3",
87
+ "jest-environment-jsdom": "^28.1.3",
88
+ "openmrs": "next",
89
+ "prettier": "^2.3.0",
90
+ "pretty-quick": "^3.1.0",
91
+ "react": "^18.2.0",
92
+ "react-dom": "^18.2.0",
93
+ "react-i18next": "^11.18.4",
94
+ "typescript": "^4.3.2",
95
+ "webpack": "^5.75.0",
96
+ "webpack-cli": "^5.0.1"
97
+ },
98
+ "packageManager": "yarn@3.3.0"
99
+ }
@@ -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
+ };