@bahmni/admin-app 0.0.1-dev.458 → 0.0.1-dev.459

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.
@@ -1,8 +1,8 @@
1
1
  import { jsx as n, jsxs as h, Fragment as _e } from "react/jsx-runtime";
2
- import { u as pe, a as Ee, z as ge, i as Ne, Q as Ce, w as Ie, T as v, b as Ae, c as be, K as Le, h as fe, O as ye, d as De, U as j, J as ve, L as we, I as Oe, e as Se, N as Ue, X as J, G as ee } from "./index-DibGUGp0.js";
2
+ import { u as pe, a as Ee, z as ge, i as Ce, Q as Ne, w as Ie, T as v, b as Ae, c as be, K as fe, h as Le, O as ye, d as De, U as Q, J as ve, L as we, I as Oe, e as Se, N as Ue, X as J, G as ee } from "./index-B11WX0rP.js";
3
3
  import { useQuery as Me } from "@tanstack/react-query";
4
4
  import { useState as T, useRef as Re, useEffect as E, useMemo as g, useCallback as _ } from "react";
5
- const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTable-module_viewAttachmentsLink__aQ1on", He = "DocumentsTable-module_documentViewerContainer__F5m8D", Be = "DocumentsTable-module_printContainer__rtarJ", Ge = "DocumentsTable-module_attachmentItem__17KA7", ze = "DocumentsTable-module_attachmentCounter__WFiI3", Ve = "DocumentsTable-module_attachmentError__RI4U2", We = "DocumentsTable-module_documentIframe__ptq5I", Fe = "DocumentsTable-module_attachmentContent__IaCEe", xe = "DocumentsTable-module_attachmentLoading__FAR6p", qe = "DocumentsTable-module_hiddenWhileLoading__IxocW", Ke = "DocumentsTable-module_documentImage__KQVgS", Pe = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", je = "DocumentsTable-module_printAllButton__IVYUW", Je = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
5
+ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTable-module_viewAttachmentsLink__aQ1on", He = "DocumentsTable-module_documentViewerContainer__F5m8D", Be = "DocumentsTable-module_printContainer__rtarJ", Ge = "DocumentsTable-module_attachmentItem__17KA7", ze = "DocumentsTable-module_attachmentCounter__WFiI3", Ve = "DocumentsTable-module_attachmentError__RI4U2", We = "DocumentsTable-module_documentIframe__ptq5I", Fe = "DocumentsTable-module_attachmentContent__IaCEe", xe = "DocumentsTable-module_attachmentLoading__FAR6p", qe = "DocumentsTable-module_hiddenWhileLoading__IxocW", Ke = "DocumentsTable-module_documentImage__KQVgS", Pe = "DocumentsTable-module_header__345GY", je = "DocumentsTable-module_documentTypeCell__uWGM8", Qe = "DocumentsTable-module_printAllButton__IVYUW", Je = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
6
6
  documentsTableBody: ke,
7
7
  viewAttachmentsLink: $e,
8
8
  documentViewerContainer: He,
@@ -16,8 +16,8 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
16
16
  hiddenWhileLoading: qe,
17
17
  documentImage: Ke,
18
18
  header: Pe,
19
- documentTypeCell: Qe,
20
- printAllButton: je,
19
+ documentTypeCell: je,
20
+ printAllButton: Qe,
21
21
  attachmentHeader: Je
22
22
  }, Xe = "startConsultation", Ye = "add", Ze = "documents", X = "document-print-container", Y = () => /* @__PURE__ */ n(ee, {}), et = /* @__PURE__ */ new Set([
23
23
  "ArrowUp",
@@ -38,21 +38,21 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
38
38
  null
39
39
  ), [b, w] = T(
40
40
  /* @__PURE__ */ new Set()
41
- ), [L, O] = T(
41
+ ), [f, O] = T(
42
42
  /* @__PURE__ */ new Set()
43
- ), C = Re(null), [S, z] = T(
43
+ ), N = Re(null), [S, z] = T(
44
44
  null
45
45
  ), V = S !== null;
46
- E(() => () => C.current?.abort(), []);
47
- const N = pe(), { t: a } = Ee(), { addNotification: f } = ge(), c = g(
46
+ E(() => () => N.current?.abort(), []);
47
+ const C = pe(), { t: a } = Ee(), { addNotification: L } = ge(), c = g(
48
48
  () => l?.actions?.find(
49
49
  (e) => e.type === Ye
50
50
  ),
51
51
  [l?.actions]
52
- ), te = Ne(c?.requiredPrivilege), ne = !!c && te, ae = Number(l?.pageSize) || 5, [U, M] = T(1), [I, oe] = T(ae), [re, R] = T(void 0), W = _((e) => {
52
+ ), te = Ce(c?.requiredPrivilege), ne = !!c && te, ae = Number(l?.pageSize) || 5, [U, M] = T(1), [I, oe] = T(ae), [re, R] = T(void 0), W = _((e) => {
53
53
  G(e), B(!0);
54
54
  }, []), de = _(() => {
55
- C.current?.abort(), O(/* @__PURE__ */ new Set()), B(!1), G(null), w(/* @__PURE__ */ new Set());
55
+ N.current?.abort(), O(/* @__PURE__ */ new Set()), B(!1), G(null), w(/* @__PURE__ */ new Set());
56
56
  }, []), F = _((e) => {
57
57
  O((t) => new Set(t).add(e));
58
58
  }, []), x = _((e) => {
@@ -70,14 +70,14 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
70
70
  }, [c]), { data: A, isLoading: le, isError: k, error: $, refetch: q } = Me({
71
71
  queryKey: [
72
72
  "documents",
73
- N,
73
+ C,
74
74
  H,
75
75
  U,
76
76
  I
77
77
  ],
78
- enabled: !!N,
79
- queryFn: () => Ce(
80
- N,
78
+ enabled: !!C,
79
+ queryFn: () => Ne(
80
+ C,
81
81
  H,
82
82
  I,
83
83
  U
@@ -85,20 +85,20 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
85
85
  });
86
86
  Ie(
87
87
  (e) => {
88
- e.patientUUID === N && e.updatedResources.documents && q();
88
+ e.patientUUID === C && e.updatedResources.documents && q();
89
89
  },
90
- [N, q]
90
+ [C, q]
91
91
  ), E(() => {
92
92
  A && R(A.total);
93
93
  }, [A]), E(() => {
94
94
  M(1), R(void 0);
95
- }, [N]), E(() => {
96
- k && f({
95
+ }, [C]), E(() => {
96
+ k && L({
97
97
  title: a("ERROR_DEFAULT_TITLE"),
98
98
  message: $?.message ?? "",
99
99
  type: "error"
100
100
  });
101
- }, [k, $, f, a]), E(() => {
101
+ }, [k, $, L, a]), E(() => {
102
102
  const e = new AbortController();
103
103
  return (async () => {
104
104
  if (!m || !r) return;
@@ -155,7 +155,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
155
155
  () => r ? Z(r) : [],
156
156
  [r]
157
157
  ), K = i.every(
158
- (e, t) => L.has(t) || b.has(t) || v(e.url) === "#"
158
+ (e, t) => f.has(t) || b.has(t) || v(e.url) === "#"
159
159
  );
160
160
  E(() => {
161
161
  if (!m || i.length === 0) return;
@@ -167,9 +167,9 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
167
167
  }, [m, i]);
168
168
  const P = _(
169
169
  async (e, t) => {
170
- if (!r || C.current) return;
170
+ if (!r || N.current) return;
171
171
  const d = new AbortController(), { signal: s } = d;
172
- C.current = d, z(t);
172
+ N.current = d, z(t);
173
173
  const u = document.getElementById(X);
174
174
  try {
175
175
  await be(
@@ -178,17 +178,17 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
178
178
  { container: u, signal: s }
179
179
  );
180
180
  } catch {
181
- s.aborted || f({
181
+ s.aborted || L({
182
182
  title: a("ERROR_DEFAULT_TITLE"),
183
183
  message: a("DOCUMENTS_ERROR_LOADING_ATTACHMENT"),
184
184
  type: "error"
185
185
  });
186
186
  } finally {
187
- C.current = null, z(null);
187
+ N.current = null, z(null);
188
188
  }
189
189
  },
190
- [r, f, a]
191
- ), Q = g(
190
+ [r, L, a]
191
+ ), j = g(
192
192
  () => i.filter(
193
193
  (e, t) => v(e.url) !== "#" && !b.has(t)
194
194
  ),
@@ -212,7 +212,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
212
212
  )
213
213
  ] });
214
214
  case "uploadedOn":
215
- return fe(
215
+ return Le(
216
216
  e.uploadedOn,
217
217
  a,
218
218
  !0
@@ -221,7 +221,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
221
221
  return e.uploadedBy ?? a("DOCUMENTS_NOT_AVAILABLE");
222
222
  case "attachments":
223
223
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ n(
224
- Le,
224
+ fe,
225
225
  {
226
226
  onClick: () => W(e),
227
227
  className: o.viewAttachmentsLink,
@@ -239,7 +239,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
239
239
  ne && /* @__PURE__ */ h(De, { className: o.header, testId: "documents-header", children: [
240
240
  /* @__PURE__ */ n("p", { children: a("DOCUMENTS_TABLE_HEADING") }),
241
241
  /* @__PURE__ */ n(
242
- j,
242
+ Q,
243
243
  {
244
244
  autoAlign: !0,
245
245
  size: "lg",
@@ -282,7 +282,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
282
282
  size: "lg",
283
283
  testId: "document-view-modal",
284
284
  children: /* @__PURE__ */ h("div", { className: o.documentViewerContainer, children: [
285
- Q.length > 1 && /* @__PURE__ */ n(
285
+ j.length > 1 && /* @__PURE__ */ n(
286
286
  Ue,
287
287
  {
288
288
  kind: "tertiary",
@@ -291,7 +291,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
291
291
  renderIcon: S === "all" ? Y : J,
292
292
  disabled: V || !K,
293
293
  testId: "print-all-attachments",
294
- onClick: () => P(Q, "all"),
294
+ onClick: () => P(j, "all"),
295
295
  children: a("DOCUMENTS_PRINT_ALL")
296
296
  }
297
297
  ),
@@ -323,7 +323,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
323
323
  total: i.length
324
324
  }) }) : /* @__PURE__ */ n("span", {}),
325
325
  /* @__PURE__ */ n(
326
- j,
326
+ Q,
327
327
  {
328
328
  kind: "ghost",
329
329
  size: "sm",
@@ -338,7 +338,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
338
338
  )
339
339
  ] }),
340
340
  /* @__PURE__ */ h("div", { className: o.attachmentContent, children: [
341
- !L.has(t) && /* @__PURE__ */ n(
341
+ !f.has(t) && /* @__PURE__ */ n(
342
342
  "div",
343
343
  {
344
344
  className: o.attachmentLoading,
@@ -356,7 +356,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
356
356
  {
357
357
  src: d,
358
358
  alt: r.documentIdentifier,
359
- className: `${o.documentImage} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
359
+ className: `${o.documentImage} ${f.has(t) ? "" : o.hiddenWhileLoading}`,
360
360
  onLoad: () => F(t),
361
361
  onError: () => x(t)
362
362
  }
@@ -364,7 +364,7 @@ const ke = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTab
364
364
  "iframe",
365
365
  {
366
366
  src: s ? `${d}#toolbar=0` : d,
367
- className: `${o.documentIframe} ${L.has(t) ? "" : o.hiddenWhileLoading}`,
367
+ className: `${o.documentIframe} ${f.has(t) ? "" : o.hiddenWhileLoading}`,
368
368
  title: r.documentIdentifier,
369
369
  onLoad: () => F(t),
370
370
  onError: () => x(t)
@@ -1,50 +1,50 @@
1
- import { jsx as n, jsxs as H, Fragment as ne } from "react/jsx-runtime";
2
- import { a as ie, u as de, i as le, Z as me, V as ue, f as ce, g as fe, j as ye, w as Ne, $ as he, A as ge, R as Te, h as Ie, U as q, k as K, K as Oe, I as $, W as pe, l as be, e as Ae, m as Ee, y as _e } from "./index-DibGUGp0.js";
1
+ import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
2
+ import { a as ie, u as de, i as le, Z as me, V as ue, f as ce, g as fe, j as ye, w as Ne, $ as he, A as ge, R as Te, h as Ie, U as H, k as K, K as Oe, I as $, W as pe, l as be, e as Ae, m as Ee, y as _e } from "./index-B11WX0rP.js";
3
3
  import { useQueryClient as Re, useQuery as A } from "@tanstack/react-query";
4
- import { useState as z, useMemo as i, useCallback as d } from "react";
5
- const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", Le = "FormsTable-module_customAccordianItem__isszs", g = {
4
+ import { useState as j, useMemo as i, useCallback as d } from "react";
5
+ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", Ue = "FormsTable-module_customAccordianItem__isszs", g = {
6
6
  formsTableBody: ve,
7
7
  modalHeading: Ce,
8
- customAccordianItem: Le
9
- }, Ue = "startConsultation", Me = ({
8
+ customAccordianItem: Ue
9
+ }, Le = "startConsultation", Me = ({
10
10
  episodeOfCareUuids: E,
11
11
  encounterUuids: l,
12
- config: j,
12
+ config: z,
13
13
  disableActions: x = !1,
14
14
  activeEncounterUuid: y = null
15
15
  }) => {
16
- const { t: o } = ie(), m = de(), [T, _] = z(!1), [t, R] = z(null), {
16
+ const { t: o } = ie(), m = de(), [T, _] = j(!1), [t, R] = j(null), {
17
17
  numberOfVisits: G,
18
- hideThumbnail: Q = !1,
18
+ hideThumbnail: Z = !1,
19
19
  forms: N
20
- } = j ?? {}, Z = le(
20
+ } = z ?? {}, Q = le(
21
21
  _e.EDIT_OBSERVATIONS
22
- ), { userPrivileges: h } = me(), I = Z && !x && !!y, v = ue(
22
+ ), { userPrivileges: h } = me(), I = Q && !x && !!y, v = ue(
23
23
  E,
24
24
  l
25
- ), P = Re(), {
25
+ ), W = Re(), {
26
26
  data: C = [],
27
- isLoading: L,
28
- isError: U,
29
- error: W,
27
+ isLoading: U,
28
+ isError: L,
29
+ error: P,
30
30
  refetch: X
31
31
  } = A({
32
32
  queryKey: ["forms", m, E],
33
33
  queryFn: () => ce(m, void 0, G),
34
34
  enabled: !!m && !v
35
- }), B = i(() => {
35
+ }), F = i(() => {
36
36
  let e = C;
37
37
  return l && l.length > 0 && (e = e.filter(
38
38
  (r) => l.includes(r.encounterUuid)
39
39
  )), Array.isArray(N) && N.length > 0 && (e = e.filter(
40
40
  (r) => N.some((a) => a.toLowerCase() === r.formName.toLowerCase())
41
41
  )), e;
42
- }, [C, l, N]), { data: F = [] } = A({
42
+ }, [C, l, N]), { data: B = [] } = A({
43
43
  queryKey: ["observationForms"],
44
44
  queryFn: () => fe()
45
45
  }), D = d(
46
46
  (e) => {
47
- const r = F.find(
47
+ const r = B.find(
48
48
  (s) => s.name.toLowerCase() === e.toLowerCase()
49
49
  );
50
50
  if (!r?.privileges || r.privileges.length === 0) return !0;
@@ -54,7 +54,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
54
54
  (s) => a.has(s.privilegeName) && s.editable
55
55
  );
56
56
  },
57
- [F, h]
57
+ [B, h]
58
58
  ), u = d(
59
59
  (e) => !y || e.encounterUuid !== y ? !1 : D(e.formName),
60
60
  [y, D]
@@ -70,7 +70,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
70
70
  });
71
71
  Ne(
72
72
  (e) => {
73
- e.patientUUID === m && (X(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
73
+ e.patientUUID === m && (X(), W.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
74
74
  },
75
75
  [m]
76
76
  );
@@ -96,7 +96,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
96
96
  ],
97
97
  []
98
98
  ), M = i(() => {
99
- const e = B.reduce(
99
+ const e = F.reduce(
100
100
  (r, a) => {
101
101
  const s = a.formName;
102
102
  r[s] ??= [];
@@ -120,13 +120,13 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
120
120
  )
121
121
  })
122
122
  ).sort((r, a) => r.formName.localeCompare(a.formName));
123
- }, [B, o]), k = d((e) => {
123
+ }, [F, o]), w = d((e) => {
124
124
  R(e), _(!0);
125
- }, []), w = d(() => {
125
+ }, []), k = d(() => {
126
126
  _(!1), R(null);
127
127
  }, []), b = d((e) => {
128
128
  globalThis.dispatchEvent(
129
- new CustomEvent(Ue, {
129
+ new CustomEvent(Le, {
130
130
  detail: {
131
131
  editOnly: "observationForms",
132
132
  editTitle: "EDIT_OBSERVATION_FORM_TITLE",
@@ -140,12 +140,12 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
140
140
  (e, r) => {
141
141
  switch (r) {
142
142
  case "recordedOn":
143
- return /* @__PURE__ */ n(Oe, { onClick: () => k(e), children: e.recordedOn });
143
+ return /* @__PURE__ */ n(Oe, { onClick: () => w(e), children: e.recordedOn });
144
144
  case "recordedBy":
145
145
  return e.recordedBy;
146
146
  case "actions":
147
147
  return u(e) ? /* @__PURE__ */ n(
148
- q,
148
+ H,
149
149
  {
150
150
  label: o("EDIT_OBSERVATION_FORM"),
151
151
  kind: "ghost",
@@ -159,17 +159,17 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
159
159
  return null;
160
160
  }
161
161
  },
162
- [k, b, u, o]
162
+ [w, b, u, o]
163
163
  );
164
- return /* @__PURE__ */ H(ne, { children: [
165
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || U || M.length === 0 || v ? /* @__PURE__ */ n(
164
+ return /* @__PURE__ */ q(ne, { children: [
165
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: U || L || M.length === 0 || v ? /* @__PURE__ */ n(
166
166
  $,
167
167
  {
168
168
  headers: oe,
169
169
  ariaLabel: o("FORMS_HEADING"),
170
170
  rows: [],
171
- loading: L,
172
- errorStateMessage: U ? W?.message : void 0,
171
+ loading: U,
172
+ errorStateMessage: L ? P?.message : void 0,
173
173
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
174
174
  renderCell: V,
175
175
  className: g.formsTableBody,
@@ -209,18 +209,18 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
209
209
  id: "modalIdForActionAreaLayout",
210
210
  portalId: "main-display-area",
211
211
  open: T,
212
- onRequestClose: w,
213
- modalHeading: /* @__PURE__ */ H("div", { className: g.modalHeading, children: [
212
+ onRequestClose: k,
213
+ modalHeading: /* @__PURE__ */ q("div", { className: g.modalHeading, children: [
214
214
  /* @__PURE__ */ n("span", { children: t.formName }),
215
215
  I && u(t) && /* @__PURE__ */ n(
216
- q,
216
+ H,
217
217
  {
218
218
  label: o("EDIT_OBSERVATION_FORM"),
219
219
  kind: "ghost",
220
220
  size: "sm",
221
221
  testId: `edit-form-modal-${t.encounterUuid}`,
222
222
  onClick: () => {
223
- w(), b(t);
223
+ k(), b(t);
224
224
  },
225
225
  children: /* @__PURE__ */ n(K, {})
226
226
  }
@@ -239,7 +239,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
239
239
  errorMessage: re,
240
240
  emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
241
241
  testIdPrefix: t.formName,
242
- hideThumbnail: Q,
242
+ hideThumbnail: Z,
243
243
  formName: t.formName
244
244
  }
245
245
  )
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-WlM3cWX3.js";
2
- import { ai as d, aj as f, ak as e } from "./index-DibGUGp0.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Bu2gjTxS.js";
2
+ import { as as d, at as f, au as e } from "./index-B11WX0rP.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -7,17 +7,17 @@ var p = (a) => {
7
7
  const o = r.theme_preference || l;
8
8
  return o !== "system" ? o : n();
9
9
  });
10
- return e(v.Provider, {
10
+ return e(i.Provider, {
11
11
  value: a,
12
12
  get children() {
13
13
  return e(m, {
14
14
  localStore: r,
15
15
  setLocalStore: t,
16
16
  get children() {
17
- return e(i.Provider, {
17
+ return e(u.Provider, {
18
18
  value: s,
19
19
  get children() {
20
- return e(u, {
20
+ return e(v, {
21
21
  localStore: r,
22
22
  setLocalStore: t
23
23
  });
@@ -1,22 +1,22 @@
1
- import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-WlM3cWX3.js";
2
- import { ai as v, aj as C, ak as e } from "./index-DibGUGp0.js";
1
+ import { c as l, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-Bu2gjTxS.js";
2
+ import { as as v, at as C, au as e } from "./index-B11WX0rP.js";
3
3
  var h = (t) => {
4
- const [r, o] = s({
4
+ const [r, o] = l({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), a = v(), l = C(() => {
6
+ }), a = v(), s = C(() => {
7
7
  const n = r.theme_preference || c;
8
8
  return n !== "system" ? n : a();
9
9
  });
10
10
  return e(d.Provider, {
11
11
  value: t,
12
12
  get children() {
13
- return e(i, {
13
+ return e(u, {
14
14
  disabled: !0,
15
15
  localStore: r,
16
16
  setLocalStore: o,
17
17
  get children() {
18
- return e(u.Provider, {
19
- value: l,
18
+ return e(i.Provider, {
19
+ value: s,
20
20
  get children() {
21
21
  return e(m, {
22
22
  get children() {
@@ -1,5 +1,5 @@
1
1
  import { jsxs as S, jsx as n } from "react/jsx-runtime";
2
- import { u as z, z as Q, a as V, n as M, V as G, o as H, Y, w as j, p as J, q as P, r as W, s as X, d as ee, I as ae, t as se, v as U, x as te, B as re, h as ie, C as oe, D as ne, E as de, F as le } from "./index-DibGUGp0.js";
2
+ import { u as z, z as Q, a as V, n as M, V as G, o as H, Y, w as j, p as J, q as P, r as W, s as X, d as ee, I as ae, t as se, v as B, x as te, B as re, h as ie, C as oe, D as ne, E as de, F as le } from "./index-B11WX0rP.js";
3
3
  import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
4
4
  import { useRef as pe, useEffect as L, useMemo as g } from "react";
5
5
  const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
@@ -7,7 +7,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
7
7
  title: be,
8
8
  wrapper: he,
9
9
  secondary: ve
10
- }, B = (s, l, o, d, c, t) => {
10
+ }, F = (s, l, o, d, c, t) => {
11
11
  const r = te(s, l, c), e = r.value, p = re(e);
12
12
  let i = e;
13
13
  p === "Image" && (i = /* @__PURE__ */ n(
@@ -48,13 +48,13 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
48
48
  `obs-${s.id}`
49
49
  );
50
50
  }, ye = (s, l, o, d, c, t, r) => /* @__PURE__ */ n(
51
- U,
51
+ B,
52
52
  {
53
53
  title: s.display,
54
54
  id: `grouped-obs-${s.display}-${d}`,
55
55
  open: o,
56
56
  children: s.members?.map(
57
- (e, p) => B(
57
+ (e, p) => F(
58
58
  e,
59
59
  p,
60
60
  c,
@@ -73,14 +73,14 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
73
73
  const { t: d } = V(), c = (t, r, e) => {
74
74
  const p = se(t.encounterDetails, d);
75
75
  return /* @__PURE__ */ S(
76
- U,
76
+ B,
77
77
  {
78
78
  title: p,
79
79
  id: `encounter-${t.encounterId}`,
80
80
  open: r,
81
81
  children: [
82
82
  t.observations.map(
83
- (i, m) => B(
83
+ (i, m) => F(
84
84
  i,
85
85
  m,
86
86
  e,
@@ -147,7 +147,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
147
147
  type: "error"
148
148
  }), p.current.add(0)) : !a && y && p.current.clear();
149
149
  }, [b, m, u]);
150
- const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", F = G(
150
+ const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", U = G(
151
151
  l,
152
152
  o
153
153
  ), {
@@ -171,7 +171,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
171
171
  h,
172
172
  o
173
173
  ),
174
- enabled: !!i && h.length > 0 && v && !F
174
+ enabled: !!i && h.length > 0 && v && !U
175
175
  });
176
176
  j(
177
177
  (a) => {
@@ -1,4 +1,4 @@
1
- import { al as we, am as z, an as xt, ao as B, aj as q, ak as y, ap as Ro, aq as ye, ar as R, as as _, at as k, au as N, av as A, aw as bs, ax as ir, ay as $e, az as U, aA as Hn, aB as Vn, aC as dt, aD as D, aE as xs, aF as cn, aG as Be, aH as ws, aI as qt, aJ as zt, aK as $s, aL as Cs, aM as $n, aN as Ss, aO as Nr, aP as Bt, aQ as zo, aR as ks, aS as Es, aT as j, aU as Ur, aV as Ms, aW as Ds, aX as sr, aY as As, aZ as Ts, a_ as zn, a$ as Fs, b0 as Is, b1 as Z, b2 as Ps, b3 as Ls } from "./index-DibGUGp0.js";
1
+ import { av as we, aw as z, ax as xt, ay as B, at as q, au as y, az as Ro, aA as ye, aB as R, aC as _, aD as k, aE as N, aF as A, aG as bs, aH as ir, aI as $e, aJ as U, aK as Hn, aL as Vn, aM as dt, aN as D, aO as xs, aP as cn, aQ as Be, aR as ws, aS as qt, aT as zt, aU as $s, aV as Cs, aW as $n, aX as Ss, aY as Nr, aZ as Bt, a_ as zo, a$ as ks, b0 as Es, b1 as j, b2 as Ur, b3 as Ms, b4 as Ds, b5 as sr, b6 as As, b7 as Ts, b8 as zn, b9 as Fs, ba as Is, bb as Z, bc as Ps, bd as Ls } from "./index-B11WX0rP.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -8,4 +8,6 @@ export declare const ADMIN_EXTENSION_POINT = "org.bahmni.admin.dashboard";
8
8
  export declare const ADMIN_CONFIG_APP = "admin";
9
9
  /** Number of audit log events per page; a full page means more may follow. */
10
10
  export declare const AUDIT_LOG_PAGE_SIZE = 50;
11
+ /** CSV uploads larger than this (50 MB) show a progress bar; smaller ones finish almost instantly. */
12
+ export declare const PROGRESS_INDICATOR_MIN_FILE_SIZE_BYTES: number;
11
13
  //# sourceMappingURL=app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/constants/app.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAE9C,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,qBAAkC,CAAC;AAEtE,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAElE,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,KAAK,CAAC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/constants/app.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAE9C,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,qBAAkC,CAAC;AAEtE,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAElE,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,sGAAsG;AACtG,eAAO,MAAM,sCAAsC,QAAmB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { ImportType } from '@bahmni/services';
2
+ export interface UploadState {
3
+ fileName: string;
4
+ fileIndex: number;
5
+ fileCount: number;
6
+ percent: number;
7
+ showProgress: boolean;
8
+ }
9
+ /**
10
+ * Uploads files one at a time, as the legacy queue did. The success notification only says the
11
+ * upload request went through; the import outcome is shown in the history table. A failed file
12
+ * does not stop the rest, and the history reloads once after the last file finishes.
13
+ *
14
+ * This flow deliberately does not use `useMutation`: it uploads a batch of files sequentially,
15
+ * tracks per-file progress via `uploadState`, and must continue after an individual file fails
16
+ * (partial failure), which doesn't map cleanly onto a single mutation's success/error lifecycle.
17
+ */
18
+ export declare const useCsvUpload: () => {
19
+ upload: (files: File[], importType: ImportType) => Promise<void>;
20
+ uploadState: UploadState | null;
21
+ isUploading: boolean;
22
+ };
23
+ //# sourceMappingURL=useCsvUpload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCsvUpload.d.ts","sourceRoot":"","sources":["../../src/hooks/useCsvUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoC,MAAM,kBAAkB,CAAC;AAUhF,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY;oBAOP,IAAI,EAAE,cAAc,UAAU;;;CAqD/C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ImportedItem } from '@bahmni/services';
2
+ export declare const IMPORTED_ITEMS_QUERY_KEY: string[];
3
+ export declare const useImportedItems: () => import('@tanstack/react-query').UseQueryResult<ImportedItem[], Error>;
4
+ //# sourceMappingURL=useImportedItems.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useImportedItems.d.ts","sourceRoot":"","sources":["../../src/hooks/useImportedItems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGlE,eAAO,MAAM,wBAAwB,UAAoB,CAAC;AAG1D,eAAO,MAAM,gBAAgB,6EAMzB,CAAC"}