@bahmni/home-app 0.0.1-dev.387 → 0.0.1-dev.388

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 p, Fragment as x } from "react/jsx-runtime";
2
- import { g as G, u as W, L as Y, O as J, a as X, w as Z, K as ee, p as te } from "./index-C0DNi_Vd.js";
2
+ import { g as G, u as W, L as Y, O as J, q as X, w as Z, K as ee, p as te } from "./index-CV4Fp1G4.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as h, useEffect as D, useMemo as _ } 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 = {
@@ -38,13 +38,13 @@ const Te = [
38
38
  null
39
39
  ), [$, I] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), E = G(), { t: n } = W(), { addNotification: U } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = h((e) => {
41
+ ), E = G(), { t: n } = W(), { addNotification: U } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [q, A] = l(void 0), M = h((e) => {
42
42
  L(e), w(!0);
43
- }, []), H = h(() => {
43
+ }, []), F = h(() => {
44
44
  w(!1), L(null), I(/* @__PURE__ */ new Set());
45
45
  }, []), v = h((e) => {
46
46
  I((t) => new Set(t).add(e));
47
- }, []), { data: i, isLoading: q, isError: y, error: b } = ae({
47
+ }, []), { data: i, isLoading: H, isError: y, error: b } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
50
  E,
@@ -144,7 +144,7 @@ const Te = [
144
144
  headers: P,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
146
  rows: j,
147
- loading: q,
147
+ loading: H,
148
148
  errorStateMessage: y ? b?.message : null,
149
149
  sortable: z,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
@@ -152,7 +152,7 @@ const Te = [
152
152
  className: d.documentsTableBody,
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
155
- totalItems: F,
155
+ totalItems: q,
156
156
  page: f,
157
157
  onPageChange: K
158
158
  }
@@ -163,7 +163,7 @@ const Te = [
163
163
  id: "modalIdForActionAreaLayout",
164
164
  portalId: "main-display-area",
165
165
  open: s,
166
- onRequestClose: H,
166
+ onRequestClose: F,
167
167
  modalHeading: o.documentIdentifier,
168
168
  passiveModal: !0,
169
169
  size: "lg",
@@ -1,26 +1,26 @@
1
1
  import { jsx as i, jsxs as G, Fragment as ye } from "react/jsx-runtime";
2
- import { u as ge, g as be, A as Ne, Q as Oe, b as Te, T as Ie, Y as Ee, z as Ae, D as _e, m as ve, G as Fe, I as Be, c as P, w as Se, N as $, E as x, a as Me, K as Q, B as Re, P as Ce, p as Le, i as Ue, d as De } from "./index-C0DNi_Vd.js";
2
+ import { u as ge, g as be, A as Ne, e as Oe, a as Te, T as Ee, J as Ie, z as Ae, S as _e, m as ve, G as Se, Z as Fe, Y as P, w as Be, N as $, E as x, q as Me, K as J, B as Re, P as Ce, p as Le, i as Ue, b as De } from "./index-CV4Fp1G4.js";
3
3
  import { useQueryClient as ke, useQuery as O } from "@tanstack/react-query";
4
- import { useState as Y, useMemo as d, useCallback as c } from "react";
5
- const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", T = {
6
- formsTableBody: we,
7
- modalHeading: qe,
4
+ import { useState as Q, useMemo as d, useCallback as c } from "react";
5
+ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", T = {
6
+ formsTableBody: qe,
7
+ modalHeading: we,
8
8
  customAccordianItem: He
9
9
  }, Ve = "startConsultation", Pe = ({
10
- episodeOfCareUuids: S,
10
+ episodeOfCareUuids: B,
11
11
  encounterUuids: m,
12
- config: J,
13
- disableActions: X = !1,
12
+ config: Y,
13
+ disableActions: Z = !1,
14
14
  activeEncounterUuid: h = null
15
15
  }) => {
16
- const { t: n } = ge(), u = be(), [y, M] = Y(!1), [s, R] = Y(null), {
17
- numberOfVisits: W,
18
- hideThumbnail: Z = !1,
16
+ const { t: n } = ge(), u = be(), [y, M] = Q(!1), [s, R] = Q(null), {
17
+ numberOfVisits: X,
18
+ hideThumbnail: W = !1,
19
19
  forms: g
20
- } = J ?? {}, ee = Ne(
20
+ } = Y ?? {}, ee = Ne(
21
21
  De.EDIT_OBSERVATIONS
22
- ), { userPrivileges: b } = Oe(), I = ee && !X && !!h, C = Te(
23
- S,
22
+ ), { userPrivileges: b } = Oe(), E = ee && !Z && !!h, C = Te(
23
+ B,
24
24
  m
25
25
  ), re = ke(), {
26
26
  data: L = [],
@@ -29,8 +29,8 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
29
29
  error: oe,
30
30
  refetch: ae
31
31
  } = O({
32
- queryKey: ["forms", u, S],
33
- queryFn: () => Ie(u, void 0, W),
32
+ queryKey: ["forms", u, B],
33
+ queryFn: () => Ee(u, void 0, X),
34
34
  enabled: !!u && !C
35
35
  }), k = d(() => {
36
36
  let e = L;
@@ -41,8 +41,8 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
41
41
  )), e;
42
42
  }, [L, m, g]), { data: N = [] } = O({
43
43
  queryKey: ["observationForms"],
44
- queryFn: () => Ee()
45
- }), w = c(
44
+ queryFn: () => Ie()
45
+ }), q = c(
46
46
  (e) => {
47
47
  const r = N.find((t) => t.name === e);
48
48
  if (!r?.privileges || r.privileges.length === 0) return !0;
@@ -54,23 +54,23 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
54
54
  },
55
55
  [N, b]
56
56
  ), f = c(
57
- (e) => !h || e.encounterUuid !== h ? !1 : w(e.formName),
58
- [h, w]
59
- ), q = c(
57
+ (e) => !h || e.encounterUuid !== h ? !1 : q(e.formName),
58
+ [h, q]
59
+ ), w = c(
60
60
  (e) => N.find((r) => r.name === e)?.uuid,
61
61
  [N]
62
- ), E = d(() => {
62
+ ), I = d(() => {
63
63
  if (s)
64
- return q(s.formName);
65
- }, [s, q]), {
64
+ return w(s.formName);
65
+ }, [s, w]), {
66
66
  data: l,
67
67
  isLoading: te,
68
68
  isError: se,
69
69
  error: A
70
70
  } = O({
71
- queryKey: ["formMetadata", E],
72
- queryFn: () => Ae(E),
73
- enabled: !!E && y
71
+ queryKey: ["formMetadata", I],
72
+ queryFn: () => Ae(I),
73
+ enabled: !!I && y
74
74
  }), {
75
75
  data: _,
76
76
  isLoading: ne,
@@ -87,7 +87,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
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) => Fe(e) ? Be(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [_, s?.formName]), le = d(() => {
90
+ const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Se(e) ? Fe(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [_, s?.formName]), le = d(() => {
91
91
  if (!l?.schema) return;
92
92
  const e = [], r = (o) => {
93
93
  (o ?? []).forEach((t) => {
@@ -103,8 +103,8 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
103
103
  const e = {}, r = (o, t) => {
104
104
  for (const a of o)
105
105
  if (a.type === "section") {
106
- const B = a.label?.value ?? "Section";
107
- r(a.controls ?? [], B);
106
+ const F = a.label?.value ?? "Section";
107
+ r(a.controls ?? [], F);
108
108
  } else
109
109
  a.id != null && t && (e[String(a.id)] = t), a.controls && r(a.controls, t);
110
110
  };
@@ -138,8 +138,8 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
138
138
  () => [...p, { key: "actions", header: n("ACTIONS") }],
139
139
  [p, n]
140
140
  ), fe = c(
141
- (e) => I && e.some((r) => f(r)) ? H : p,
142
- [I, f, H, p]
141
+ (e) => E && e.some((r) => f(r)) ? H : p,
142
+ [E, f, H, p]
143
143
  ), pe = p, he = d(
144
144
  () => [
145
145
  { key: "recordedOn", sortable: !0 },
@@ -151,11 +151,11 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
151
151
  (r, o) => {
152
152
  const t = o.formName;
153
153
  r[t] ??= [];
154
- const a = o.providers.map((B) => B.providerName).filter(Boolean).join(", ");
154
+ const a = o.providers.map((F) => F.providerName).filter(Boolean).join(", ");
155
155
  return r[t].push({
156
156
  id: o.encounterUuid,
157
157
  formName: o.formName,
158
- recordedOn: Se(o.encounterDateTime, n, !0).formattedResult,
158
+ recordedOn: Be(o.encounterDateTime, n, !0).formattedResult,
159
159
  recordedBy: a ?? "--",
160
160
  encounterDateTime: o.encounterDateTime,
161
161
  encounterUuid: o.encounterUuid
@@ -175,7 +175,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
175
175
  R(e), M(!0);
176
176
  }, []), j = c(() => {
177
177
  M(!1), R(null);
178
- }, []), F = c((e) => {
178
+ }, []), S = c((e) => {
179
179
  globalThis.dispatchEvent(
180
180
  new CustomEvent(Ve, {
181
181
  detail: {
@@ -202,7 +202,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
202
202
  kind: "ghost",
203
203
  size: "sm",
204
204
  testId: `edit-form-${e.encounterUuid}`,
205
- onClick: () => F(e),
205
+ onClick: () => S(e),
206
206
  children: /* @__PURE__ */ i(x, {})
207
207
  }
208
208
  ) : null;
@@ -210,11 +210,11 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
210
210
  return null;
211
211
  }
212
212
  },
213
- [z, F, f, n]
213
+ [z, S, f, n]
214
214
  );
215
215
  return /* @__PURE__ */ G(ye, { children: [
216
216
  /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || C ? /* @__PURE__ */ i(
217
- Q,
217
+ J,
218
218
  {
219
219
  headers: pe,
220
220
  ariaLabel: n("FORMS_HEADING"),
@@ -236,7 +236,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
236
236
  testId: `accordian-title-${o}`,
237
237
  open: r === 0,
238
238
  children: /* @__PURE__ */ i(
239
- Q,
239
+ J,
240
240
  {
241
241
  headers: a,
242
242
  ariaLabel: n("FORMS_HEADING"),
@@ -263,7 +263,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
263
263
  onRequestClose: j,
264
264
  modalHeading: /* @__PURE__ */ G("div", { className: T.modalHeading, children: [
265
265
  /* @__PURE__ */ i("span", { children: s.formName }),
266
- I && f(s) && /* @__PURE__ */ i(
266
+ E && f(s) && /* @__PURE__ */ i(
267
267
  $,
268
268
  {
269
269
  label: n("EDIT_OBSERVATION_FORM"),
@@ -271,7 +271,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
271
271
  size: "sm",
272
272
  testId: `edit-form-modal-${s.encounterUuid}`,
273
273
  onClick: () => {
274
- j(), F(s);
274
+ j(), S(s);
275
275
  },
276
276
  children: /* @__PURE__ */ i(x, {})
277
277
  }
@@ -290,7 +290,7 @@ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
290
290
  errorMessage: ue,
291
291
  emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
292
292
  testIdPrefix: s.formName,
293
- hideThumbnail: Z,
293
+ hideThumbnail: W,
294
294
  controlOrder: le,
295
295
  sectionMap: ce,
296
296
  conceptDatatypeMap: me
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-D2eFebQW.js";
2
- import { U as d, W as f, X as e } from "./index-C0DNi_Vd.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Cet3oFz3.js";
2
+ import { U as d, W as f, X as e } from "./index-CV4Fp1G4.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-D2eFebQW.js";
2
- import { U as v, W as C, X as e } from "./index-C0DNi_Vd.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-Cet3oFz3.js";
2
+ import { U as v, W as C, X as e } from "./index-CV4Fp1G4.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 { g as k, L as q, u as N, _ as w, C as Q, m as j, k as x, e as z, f as G, l as H, K as M, h as P, j as L, Z, n as J, o as Y, q as W, V as X, y as ee } from "./index-C0DNi_Vd.js";
2
+ import { g as k, L as q, u as N, _ as w, C as Q, m as j, k as x, c as z, d as G, l as H, K as M, I as P, f as L, h as J, j as Y, v as Z, n as W, V as X, y as ee } from "./index-CV4Fp1G4.js";
3
3
  import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as I, useMemo as g } from "react";
4
+ import { useRef as se, useEffect as _, useMemo as g } from "react";
5
5
  const C = (a, n, d, l, b, r) => {
6
- const t = Z(a, n, b), s = t.value, o = J(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
  W,
@@ -25,7 +25,7 @@ const C = (a, n, d, l, b, r) => {
25
25
  provider: t.provider
26
26
  }), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
27
27
  return /* @__PURE__ */ u(
28
- Y,
28
+ Z,
29
29
  {
30
30
  header: t.header,
31
31
  value: i,
@@ -120,7 +120,7 @@ const C = (a, n, d, l, b, r) => {
120
120
  enabled: !!e
121
121
  }))
122
122
  });
123
- I(() => {
123
+ _(() => {
124
124
  i.forEach((e, h) => {
125
125
  if (e.isError && !r.current.has(h)) {
126
126
  const B = d[h];
@@ -149,7 +149,7 @@ const C = (a, n, d, l, b, r) => {
149
149
  ) && T();
150
150
  },
151
151
  [t, T]
152
- ), I(() => {
152
+ ), _(() => {
153
153
  R && s({
154
154
  title: o("ERROR_DEFAULT_TITLE"),
155
155
  message: o("ERROR_FETCHING_OBSERVATIONS"),
@@ -164,7 +164,7 @@ const C = (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
- ], O = D || !y, _ = R && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, K = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, V = f.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
167
+ ], I = D || !y, O = R && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, K = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, V = f.length > 0 && !I && !O, E = n.titleTranslationKey, v = E ? o(E) : "";
168
168
  return /* @__PURE__ */ S(
169
169
  "div",
170
170
  {
@@ -196,7 +196,7 @@ const C = (a, n, d, l, b, r) => {
196
196
  headers: F,
197
197
  rows: [],
198
198
  ariaLabel: o("OBSERVATIONS"),
199
- loading: O,
199
+ loading: I,
200
200
  errorStateMessage: K,
201
201
  emptyStateMessage: U,
202
202
  dataTestId: "observations-table"
@@ -1,4 +1,4 @@
1
- import { $ as we, a0 as z, a1 as xt, a2 as B, W as q, X as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-C0DNi_Vd.js";
1
+ import { $ as we, a0 as z, a1 as xt, a2 as B, W as q, X as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-CV4Fp1G4.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {