@bahmni/home-app 0.0.1-dev.355 → 0.0.1-dev.356

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, t as X, g as Z, e as ee, d as te } from "./index-CLMmxwcG.js";
2
+ import { m as x, u as W, a as Y, H as J, t as X, g as Z, e as ee, d as te } from "./index-Rj-AgMX1.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,5 +1,5 @@
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, t as Ce, e as Q, f as Re, i as Be, d as Le, W as Me, I as Ue } from "./index-CLMmxwcG.js";
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 Ee, k as _e, b as Ae, _ as ve, N as Fe, o as z, g as Se, c as K, f as P, t as Ce, e as Q, i as Re, j as Be, d as Le, W as Me, I as Ue } from "./index-Rj-AgMX1.js";
3
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
5
  const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", I = {
@@ -9,17 +9,17 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
9
9
  }, He = "startConsultation", xe = ({
10
10
  episodeOfCareUuids: C,
11
11
  encounterUuids: c,
12
- config: J,
13
- disableActions: W = !1,
12
+ config: W,
13
+ disableActions: Y = !1,
14
14
  activeEncounterUuid: h = null
15
15
  }) => {
16
16
  const { t: n } = ge(), u = pe(), [g, R] = X(!1), [s, B] = X(null), {
17
- numberOfVisits: Y,
18
- hideThumbnail: Z = !1,
17
+ numberOfVisits: Z,
18
+ hideThumbnail: J = !1,
19
19
  forms: p
20
- } = J ?? {}, ee = Ne(
20
+ } = W ?? {}, ee = Ne(
21
21
  Ue.EDIT_OBSERVATIONS
22
- ), { userPrivileges: N } = Oe(), T = ee && !W && !!h, L = be(
22
+ ), { userPrivileges: N } = Oe(), T = ee && !Y && !!h, L = be(
23
23
  C,
24
24
  c
25
25
  ), re = De(), {
@@ -30,7 +30,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
30
30
  refetch: ae
31
31
  } = b({
32
32
  queryKey: ["forms", u, C],
33
- queryFn: () => Ie(u, void 0, Y),
33
+ queryFn: () => Ie(u, void 0, Z),
34
34
  enabled: !!u && !L
35
35
  }), k = d(() => {
36
36
  let e = M;
@@ -59,35 +59,35 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
59
59
  ), q = l(
60
60
  (e) => O.find((r) => r.name === e)?.uuid,
61
61
  [O]
62
- ), A = d(() => {
62
+ ), E = d(() => {
63
63
  if (s)
64
64
  return q(s.formName);
65
65
  }, [s, q]), {
66
66
  data: m,
67
67
  isLoading: te,
68
68
  isError: se,
69
- error: E
69
+ error: _
70
70
  } = b({
71
- queryKey: ["formMetadata", A],
72
- queryFn: () => Ae(A),
73
- enabled: !!A && g
71
+ queryKey: ["formMetadata", E],
72
+ queryFn: () => Ee(E),
73
+ enabled: !!E && g
74
74
  }), {
75
- data: _,
75
+ data: A,
76
76
  isLoading: ne,
77
77
  isError: ie,
78
78
  error: v
79
79
  } = b({
80
80
  queryKey: ["formsEncounterFHIR", s?.encounterUuid],
81
- queryFn: () => Ee(s.encounterUuid),
81
+ queryFn: () => _e(s.encounterUuid),
82
82
  enabled: !!s?.encounterUuid && g
83
83
  });
84
- _e(
84
+ Ae(
85
85
  (e) => {
86
86
  e.patientUUID === u && e.updatedConcepts.size > 0 && (ae(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
87
87
  },
88
88
  [u]
89
89
  );
90
- const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => ve(e) ? Fe(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [_, s?.formName]), le = d(() => {
90
+ const de = d(() => !A?.entry || !s?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => ve(e) ? Fe(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [A, s?.formName]), le = d(() => {
91
91
  if (!m?.schema) return;
92
92
  const e = [], r = (o) => {
93
93
  (o ?? []).forEach((a) => {
@@ -113,11 +113,11 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
113
113
  null
114
114
  ), Object.keys(e).length > 0 ? e : void 0;
115
115
  }, [m]), ce = d(() => {
116
- if (E)
117
- return z(E).message;
116
+ if (_)
117
+ return z(_).message;
118
118
  if (v)
119
119
  return z(v).message;
120
- }, [E, v]), y = d(
120
+ }, [_, v]), y = d(
121
121
  () => [
122
122
  { key: "recordedOn", header: n("RECORDED_ON") },
123
123
  { key: "recordedBy", header: n("RECORDED_BY") }
@@ -160,9 +160,9 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
160
160
  )
161
161
  })
162
162
  ).sort((r, o) => r.formName.localeCompare(o.formName));
163
- }, [k, n]), G = l((e) => {
163
+ }, [k, n]), j = l((e) => {
164
164
  B(e), R(!0);
165
- }, []), $ = l(() => {
165
+ }, []), G = l(() => {
166
166
  R(!1), B(null);
167
167
  }, []), F = l((e) => {
168
168
  globalThis.dispatchEvent(
@@ -176,11 +176,11 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
176
176
  }
177
177
  })
178
178
  );
179
- }, []), j = l(
179
+ }, []), $ = l(
180
180
  (e, r) => {
181
181
  switch (r) {
182
182
  case "recordedOn":
183
- return /* @__PURE__ */ i(Ce, { onClick: () => G(e), children: e.recordedOn });
183
+ return /* @__PURE__ */ i(Ce, { onClick: () => j(e), children: e.recordedOn });
184
184
  case "recordedBy":
185
185
  return e.recordedBy;
186
186
  case "actions":
@@ -199,7 +199,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
199
199
  return null;
200
200
  }
201
201
  },
202
- [G, F, f, n]
202
+ [j, F, f, n]
203
203
  );
204
204
  return /* @__PURE__ */ x(he, { children: [
205
205
  /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || L ? /* @__PURE__ */ i(
@@ -211,7 +211,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
211
211
  loading: U,
212
212
  errorStateMessage: D ? oe?.message : void 0,
213
213
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
214
- renderCell: j,
214
+ renderCell: $,
215
215
  className: I.formsTableBody,
216
216
  dataTestId: "forms-table"
217
217
  }
@@ -234,7 +234,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
234
234
  errorStateMessage: "",
235
235
  sortable: ye,
236
236
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
237
- renderCell: j,
237
+ renderCell: $,
238
238
  className: I.formsTableBody,
239
239
  dataTestId: `forms-table-${o}`
240
240
  }
@@ -249,7 +249,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
249
249
  id: "modalIdForActionAreaLayout",
250
250
  portalId: "main-display-area",
251
251
  open: g,
252
- onRequestClose: $,
252
+ onRequestClose: G,
253
253
  modalHeading: /* @__PURE__ */ x("div", { className: I.modalHeading, children: [
254
254
  /* @__PURE__ */ i("span", { children: s.formName }),
255
255
  T && f(s) && /* @__PURE__ */ i(
@@ -260,7 +260,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
260
260
  size: "sm",
261
261
  testId: `edit-form-modal-${s.encounterUuid}`,
262
262
  onClick: () => {
263
- $(), F(s);
263
+ G(), F(s);
264
264
  },
265
265
  children: /* @__PURE__ */ i(P, {})
266
266
  }
@@ -279,7 +279,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
279
279
  errorMessage: ce,
280
280
  emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
281
281
  testIdPrefix: s.formName,
282
- hideThumbnail: Z,
282
+ hideThumbnail: J,
283
283
  controlOrder: le,
284
284
  sectionMap: me
285
285
  }
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BLPkkcfk.js";
2
- import { a0 as d, a1 as f, a2 as e } from "./index-CLMmxwcG.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CuZOo2Fa.js";
2
+ import { a0 as d, a1 as f, a2 as e } from "./index-Rj-AgMX1.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-BLPkkcfk.js";
2
- import { a0 as v, a1 as C, a2 as e } from "./index-CLMmxwcG.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-CuZOo2Fa.js";
2
+ import { a0 as v, a1 as C, a2 as e } from "./index-Rj-AgMX1.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,9 +1,9 @@
1
1
  import { jsxs as S, jsx as u } from "react/jsx-runtime";
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-CLMmxwcG.js";
2
+ import { m as Q, a as V, u as N, v as q, E as k, b as z, T as M, O as w, L as x, F as H, e as j, C as P, Q as D, z as J, p as Y, l as W, n as X, q as Z, r as ee } from "./index-Rj-AgMX1.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) => {
6
- const t = P(a, n, b), s = t.value, o = Y(s);
6
+ const t = J(a, n, b), s = t.value, o = Y(s);
7
7
  let i = s;
8
8
  o === "Image" && (i = /* @__PURE__ */ u(
9
9
  X,
@@ -60,7 +60,7 @@ const F = (a, n, d, l, b, r) => {
60
60
  hideThumbnail: d
61
61
  }) => {
62
62
  const { t: l } = N(), b = (r, t, s) => {
63
- const o = J(r.encounterDetails, l);
63
+ const o = P(r.encounterDetails, l);
64
64
  return /* @__PURE__ */ S(
65
65
  D,
66
66
  {
@@ -158,8 +158,8 @@ const F = (a, n, d, l, b, r) => {
158
158
  }, [O]);
159
159
  const f = T(() => {
160
160
  if (!c) return [];
161
- const e = M(c), h = j(e);
162
- return w(h);
161
+ const e = M(c), h = w(e);
162
+ return x(h);
163
163
  }, [c]), C = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
@@ -174,7 +174,7 @@ const F = (a, n, d, l, b, r) => {
174
174
  className: I.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
- x,
177
+ H,
178
178
  {
179
179
  id: "observations-title",
180
180
  testId: E ? `observations-title-${y}` : "observations-title",
@@ -191,7 +191,7 @@ const F = (a, n, d, l, b, r) => {
191
191
  hideThumbnail: b
192
192
  }
193
193
  ) : /* @__PURE__ */ u(
194
- H,
194
+ j,
195
195
  {
196
196
  headers: C,
197
197
  rows: [],
@@ -1,4 +1,4 @@
1
- import { a3 as we, a4 as z, a5 as xt, a6 as B, a1 as q, a2 as y, a7 as Ro, a8 as ye, a9 as R, aa as _, ab as k, ac as N, ad as A, ae as bs, af as ir, ag as $e, ah as G, ai as Hn, aj as Vn, ak as dt, al as D, am as xs, an as cn, ao as Be, ap as ws, aq as qt, ar as zt, as as $s, at as Cs, au as $n, av as Ss, aw as Nr, ax as Bt, ay as zo, az as ks, aA as Es, aB as j, aC as Gr, aD as Ms, aE as Ds, aF as sr, aG as As, aH as Ts, aI as zn, aJ as Fs, aK as Is, aL as Z, aM as Ps, aN as Ls } from "./index-CLMmxwcG.js";
1
+ import { a3 as we, a4 as z, a5 as xt, a6 as B, a1 as q, a2 as y, a7 as Ro, a8 as ye, a9 as R, aa as _, ab as k, ac as N, ad as A, ae as bs, af as ir, ag as $e, ah as G, ai as Hn, aj as Vn, ak as dt, al as D, am as xs, an as cn, ao as Be, ap as ws, aq as qt, ar as zt, as as $s, at as Cs, au as $n, av as Ss, aw as Nr, ax as Bt, ay as zo, az as ks, aA as Es, aB as j, aC as Gr, aD as Ms, aE as Ds, aF as sr, aG as As, aH as Ts, aI as zn, aJ as Fs, aK as Is, aL as Z, aM as Ps, aN as Ls } from "./index-Rj-AgMX1.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,5 +1,5 @@
1
1
  import { jsxs as Ne, jsx as ne, Fragment as Xi } from "react/jsx-runtime";
2
- import { u as ot, r as Qi, s as Ji, B as ec, D as tc, x as rc, _ as nc, G as oc, $ as hi, K as ac, M as lc, a as ic, P as cc, R as sc, S as fc, Y as pc, U as hc, Z as uc } from "./index-CLMmxwcG.js";
2
+ import { u as ot, s as Qi, A as Ji, B as ec, D as tc, x as rc, G as nc, J as oc, $ as hi, K as ac, M as lc, a as ic, P as cc, R as sc, S as fc, Y as pc, U as hc, Z as uc } from "./index-Rj-AgMX1.js";
3
3
  import * as X from "react";
4
4
  import r, { createContext as at, useContext as $e, Children as q1, useState as pe, useLayoutEffect as V1, useEffect as ie, useMemo as lt, useCallback as Me, useRef as oe, forwardRef as y1, useReducer as dc, cloneElement as G1, isValidElement as wc } from "react";
5
5
  import { useQuery as mc } from "@tanstack/react-query";