@bahmni/clinical-app 0.0.1-dev.353 → 0.0.1-dev.354

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,5 +1,5 @@
1
1
  import { jsx as r, jsxs as h, Fragment as Q } from "react/jsx-runtime";
2
- import { m as x, u as W, a as Y, H as J, r as X, g as Z, e as ee, d as te } from "./index-DRz5WzPs.js";
2
+ import { m as x, u as W, a as Y, H as J, r as X, g as Z, e as ee, d as te } from "./index-Dpw5Fisz.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
5
5
  const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
@@ -1,45 +1,45 @@
1
1
  import { jsx as i, jsxs as x, Fragment as he } from "react/jsx-runtime";
2
- import { u as ge, m as pe, w as Ne, x as Oe, h as be, V as Ie, X as Te, y as Ae, k as Ee, J as _e, A as ve, N as Fe, o as z, g as Se, b as K, c as P, r as Me, e as Q, f as Ce, i as Re, d as Be, W as Le, I as Ue } from "./index-DRz5WzPs.js";
3
- import { useQueryClient as ke, useQuery as b } from "@tanstack/react-query";
2
+ import { u as ge, m as pe, w as Ne, x as Oe, h as be, V as Ie, X as Te, y as Ae, k as Ee, J as _e, A as ve, N as Fe, o as z, g as Se, b as K, c as P, r as Ce, e as Q, f as Re, i as Be, d as Le, W as Me, I as Ue } from "./index-Dpw5Fisz.js";
3
+ import { useQueryClient as De, useQuery as b } from "@tanstack/react-query";
4
4
  import { useState as X, useMemo as d, useCallback as l } from "react";
5
- const De = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", I = {
6
- formsTableBody: De,
5
+ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", I = {
6
+ formsTableBody: ke,
7
7
  modalHeading: we,
8
8
  customAccordianItem: qe
9
9
  }, He = "startConsultation", xe = ({
10
- episodeOfCareUuids: M,
10
+ episodeOfCareUuids: C,
11
11
  encounterUuids: c,
12
12
  config: J,
13
13
  disableActions: W = !1,
14
14
  activeEncounterUuid: h = null
15
15
  }) => {
16
- const { t: n } = ge(), u = pe(), [g, C] = X(!1), [s, R] = X(null), {
16
+ const { t: n } = ge(), u = pe(), [g, R] = X(!1), [s, B] = X(null), {
17
17
  numberOfVisits: Y,
18
18
  hideThumbnail: Z = !1,
19
19
  forms: p
20
20
  } = J ?? {}, ee = Ne(
21
21
  Ue.EDIT_OBSERVATIONS
22
- ), { userPrivileges: N } = Oe(), T = ee && !W && !!h, B = be(
23
- M,
22
+ ), { userPrivileges: N } = Oe(), T = ee && !W && !!h, L = be(
23
+ C,
24
24
  c
25
- ), re = ke(), {
26
- data: L = [],
25
+ ), re = De(), {
26
+ data: M = [],
27
27
  isLoading: U,
28
- isError: k,
28
+ isError: D,
29
29
  error: oe,
30
30
  refetch: ae
31
31
  } = b({
32
- queryKey: ["forms", u, M],
32
+ queryKey: ["forms", u, C],
33
33
  queryFn: () => Ie(u, void 0, Y),
34
- enabled: !!u && !B
35
- }), D = d(() => {
36
- let e = L;
34
+ enabled: !!u && !L
35
+ }), k = d(() => {
36
+ let e = M;
37
37
  return c && c.length > 0 && (e = e.filter(
38
38
  (r) => c.includes(r.encounterUuid)
39
39
  )), Array.isArray(p) && p.length > 0 && (e = e.filter(
40
40
  (r) => p.some((o) => o.toLowerCase() === r.formName.toLowerCase())
41
41
  )), e;
42
- }, [L, c, p]), { data: O = [] } = b({
42
+ }, [M, c, p]), { data: O = [] } = b({
43
43
  queryKey: ["observationForms"],
44
44
  queryFn: () => Te()
45
45
  }), w = l(
@@ -136,7 +136,7 @@ const De = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
136
136
  ],
137
137
  []
138
138
  ), V = d(() => {
139
- const e = D.reduce(
139
+ const e = k.reduce(
140
140
  (r, o) => {
141
141
  const a = o.formName;
142
142
  r[a] ??= [];
@@ -160,10 +160,10 @@ const De = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
160
160
  )
161
161
  })
162
162
  ).sort((r, o) => r.formName.localeCompare(o.formName));
163
- }, [D, n]), G = l((e) => {
164
- R(e), C(!0);
163
+ }, [k, n]), G = l((e) => {
164
+ B(e), R(!0);
165
165
  }, []), $ = l(() => {
166
- C(!1), R(null);
166
+ R(!1), B(null);
167
167
  }, []), F = l((e) => {
168
168
  globalThis.dispatchEvent(
169
169
  new CustomEvent(He, {
@@ -180,7 +180,7 @@ const De = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
180
180
  (e, r) => {
181
181
  switch (r) {
182
182
  case "recordedOn":
183
- return /* @__PURE__ */ i(Me, { onClick: () => G(e), children: e.recordedOn });
183
+ return /* @__PURE__ */ i(Ce, { onClick: () => G(e), children: e.recordedOn });
184
184
  case "recordedBy":
185
185
  return e.recordedBy;
186
186
  case "actions":
@@ -202,23 +202,23 @@ const De = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
202
202
  [G, F, f, n]
203
203
  );
204
204
  return /* @__PURE__ */ x(he, { children: [
205
- /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || k || V.length === 0 || B ? /* @__PURE__ */ i(
205
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || L ? /* @__PURE__ */ i(
206
206
  Q,
207
207
  {
208
208
  headers: fe,
209
209
  ariaLabel: n("FORMS_HEADING"),
210
210
  rows: [],
211
211
  loading: U,
212
- errorStateMessage: k ? oe?.message : void 0,
212
+ errorStateMessage: D ? oe?.message : void 0,
213
213
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
214
214
  renderCell: j,
215
215
  className: I.formsTableBody,
216
216
  dataTestId: "forms-table"
217
217
  }
218
- ) : /* @__PURE__ */ i(Ce, { align: "start", children: V.map((e, r) => {
218
+ ) : /* @__PURE__ */ i(Re, { align: "start", children: V.map((e, r) => {
219
219
  const { formName: o, records: a } = e, t = ue(a);
220
220
  return /* @__PURE__ */ i(
221
- Re,
221
+ Be,
222
222
  {
223
223
  title: o,
224
224
  className: I.customAccordianItem,
@@ -244,7 +244,7 @@ const De = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
244
244
  );
245
245
  }) }) }),
246
246
  g && s && /* @__PURE__ */ i(
247
- Be,
247
+ Le,
248
248
  {
249
249
  id: "modalIdForActionAreaLayout",
250
250
  portalId: "main-display-area",
@@ -271,7 +271,7 @@ const De = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
271
271
  size: "md",
272
272
  testId: "form-details-modal",
273
273
  children: /* @__PURE__ */ i(
274
- Le,
274
+ Me,
275
275
  {
276
276
  observations: de,
277
277
  isLoading: te || ne,
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CCn9iY2V.js";
2
- import { bO as d, bP as f, bQ as e } from "./index-DRz5WzPs.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-xdbYnYkR.js";
2
+ import { bN as d, bO as f, bP as e } from "./index-Dpw5Fisz.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-CCn9iY2V.js";
2
- import { bO as v, bP as C, bQ as e } from "./index-DRz5WzPs.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-xdbYnYkR.js";
2
+ import { bN as v, bO as C, bP as e } from "./index-Dpw5Fisz.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { m as V, a as q, u as N, v as Q, E as k, J as z, T as M, O as j, L as w, F as x, e as H, C as J, Q as D, z as P, p as Y, j as W, n as X, l as Z, q as ee } from "./index-DRz5WzPs.js";
2
+ import { m as Q, a as V, u as N, v as q, E as k, J as z, T as M, O as j, L as w, F as x, e as H, C as J, Q as D, z as P, p as Y, j as W, n as X, l as Z, q as ee } from "./index-Dpw5Fisz.js";
3
3
  import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as T } from "react";
5
5
  const F = (a, n, d, l, b, r) => {
@@ -113,20 +113,20 @@ const F = (a, n, d, l, b, r) => {
113
113
  conceptNames: d = [],
114
114
  conceptUuid: l = [],
115
115
  hideThumbnail: b = !1
116
- } = n, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = q(), { t: o } = N(), i = ae({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), t = Q(), { addNotification: s } = V(), { t: o } = N(), i = ae({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
- queryFn: () => Q(e),
119
+ queryFn: () => q(e),
120
120
  enabled: !!e
121
121
  }))
122
122
  });
123
123
  $(() => {
124
124
  i.forEach((e, h) => {
125
125
  if (e.isError && !r.current.has(h)) {
126
- const B = d[h];
126
+ const K = d[h];
127
127
  s({
128
128
  title: o("ERROR_DEFAULT_TITLE"),
129
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: B }),
129
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: K }),
130
130
  type: "error"
131
131
  }), r.current.add(h);
132
132
  } else e.isError || r.current.delete(h);
@@ -164,7 +164,7 @@ const F = (a, n, d, l, b, r) => {
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], g = L || !v, _ = O && v, G = (!c || c.entry?.length === 0 || p.length === 0) && v, A = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, K = G ? o("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !g && !_, E = n.titleTranslationKey, y = E ? o(E) : "";
167
+ ], g = L || !v, _ = O && v, G = (!c || c.entry?.length === 0 || p.length === 0) && v, A = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = G ? o("NO_OBSERVATIONS_FOUND") : void 0, B = f.length > 0 && !g && !_, E = n.titleTranslationKey, y = E ? o(E) : "";
168
168
  return /* @__PURE__ */ S(
169
169
  "div",
170
170
  {
@@ -183,7 +183,7 @@ const F = (a, n, d, l, b, r) => {
183
183
  children: /* @__PURE__ */ u("p", { children: y })
184
184
  }
185
185
  ),
186
- U ? /* @__PURE__ */ u(
186
+ B ? /* @__PURE__ */ u(
187
187
  oe,
188
188
  {
189
189
  groupedData: f,
@@ -198,7 +198,7 @@ const F = (a, n, d, l, b, r) => {
198
198
  ariaLabel: o("OBSERVATIONS"),
199
199
  loading: g,
200
200
  errorStateMessage: A,
201
- emptyStateMessage: K,
201
+ emptyStateMessage: U,
202
202
  dataTestId: "observations-table"
203
203
  }
204
204
  )