@bahmni/admin-app 0.0.1-dev.438 → 0.0.1-dev.440

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,11 +1,11 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { y as o, C as a, D as s, E as N } from "./index-zul2tc9C.js";
2
+ import { A as o, p as a, r as s, t as r } from "./index-BdGZxaWH.js";
3
3
  import "react";
4
4
  import "@tanstack/react-query";
5
5
  const i = () => /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(
6
6
  a,
7
7
  {
8
- extensionPointId: N,
8
+ extensionPointId: r,
9
9
  appName: s,
10
10
  loadingLabelKey: "ADMIN_LOADING_MODULES",
11
11
  errorMessageKey: "ADMIN_ERROR_FETCH_CONFIG",
@@ -1,10 +1,10 @@
1
1
  import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import { G as ee, I as te, K as se, N as K, u as ae, Q as ne, S as re, y as ie, V as oe, X as ue, Z as de, _ as U, a0 as k, a1 as le } from "./index-zul2tc9C.js";
3
- import { useState as l, useRef as C, useEffect as G, useMemo as ce, useCallback as me } from "react";
2
+ import { x as ee, y as te, C as se, M as K, u as ae, O as ne, S as re, A as ie, T as oe, U as ue, V as de, _ as C, a0 as k, a1 as le } from "./index-BdGZxaWH.js";
3
+ import { useState as l, useRef as U, useEffect as H, useMemo as ce, useCallback as me } from "react";
4
4
  import { useQuery as _e } from "@tanstack/react-query";
5
- const H = Symbol.for("constructDateFrom");
5
+ const G = Symbol.for("constructDateFrom");
6
6
  function y(e, t) {
7
- return typeof e == "function" ? e(t) : e && typeof e == "object" && H in e ? e[H](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
7
+ return typeof e == "function" ? e(t) : e && typeof e == "object" && G in e ? e[G](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
8
8
  }
9
9
  function w(e, t) {
10
10
  return y(e, e);
@@ -32,15 +32,15 @@ const Le = (e, t) => {
32
32
  }
33
33
  if (!Number.isNaN(r.getTime()))
34
34
  return r.toISOString();
35
- }, q = "NO_EVENTS_FOUND", Y = "NO_MORE_EVENTS_FOUND", Ie = "MATCHING_EVENTS_NOT_FOUND", Te = () => {
35
+ }, q = "NO_EVENTS_FOUND", Y = "NO_MORE_EVENTS_FOUND", Te = "MATCHING_EVENTS_NOT_FOUND", Ie = () => {
36
36
  const [e, t] = l({
37
37
  startDate: ee(),
38
38
  startTime: "00:00",
39
39
  username: "",
40
40
  patientId: ""
41
- }), [r, a] = l(0), [i, u] = l(0), [_, E] = l([]), [R, p] = l(null), [b, f] = l(!1), [F, g] = l(!1), [O, M] = l(1), I = C(1), s = (c) => {
42
- I.current = c, M(c);
43
- }, o = C(0), [n, j] = l(null), B = C(null), { data: N, isLoading: Q, isFetching: L, isError: X } = _e({
41
+ }), [r, a] = l(0), [i, u] = l(0), [_, E] = l([]), [R, p] = l(null), [b, f] = l(!1), [F, g] = l(!1), [O, M] = l(1), T = U(1), s = (c) => {
42
+ T.current = c, M(c);
43
+ }, o = U(0), [n, j] = l(null), B = U(null), { data: N, isLoading: z, isFetching: L, isError: Q } = _e({
44
44
  queryKey: ["auditLogs", n?.requestId],
45
45
  queryFn: () => te(n.params),
46
46
  enabled: !!n,
@@ -48,7 +48,7 @@ const Le = (e, t) => {
48
48
  // (and audit logs must always be fetched fresh). Drop entries as soon as
49
49
  // they become inactive instead of retaining them for the default gcTime.
50
50
  gcTime: 0
51
- }), T = (c, V, m, D, h, $) => {
51
+ }), I = (c, V, m, D, h, $) => {
52
52
  o.current += 1, j({
53
53
  action: c,
54
54
  params: V,
@@ -58,8 +58,8 @@ const Le = (e, t) => {
58
58
  emptyMessageKey: $,
59
59
  requestId: o.current
60
60
  });
61
- }, A = Le(e.startDate, e.startTime), z = () => {
62
- T(
61
+ }, A = Le(e.startDate, e.startTime), X = () => {
62
+ I(
63
63
  "init",
64
64
  { startFrom: A, defaultView: !0 },
65
65
  !0,
@@ -67,13 +67,13 @@ const Le = (e, t) => {
67
67
  0,
68
68
  q
69
69
  );
70
- }, v = () => !!r || !!i, Z = () => {
70
+ }, v = () => !!r || !!i, W = () => {
71
71
  if (!L) {
72
72
  if (!v()) {
73
73
  x();
74
74
  return;
75
75
  }
76
- T(
76
+ I(
77
77
  "next",
78
78
  {
79
79
  lastAuditLogId: i,
@@ -88,13 +88,13 @@ const Le = (e, t) => {
88
88
  Y
89
89
  );
90
90
  }
91
- }, W = () => {
91
+ }, Z = () => {
92
92
  if (!L) {
93
93
  if (!v()) {
94
94
  x();
95
95
  return;
96
96
  }
97
- T(
97
+ I(
98
98
  "prev",
99
99
  {
100
100
  lastAuditLogId: r,
@@ -109,7 +109,7 @@ const Le = (e, t) => {
109
109
  );
110
110
  }
111
111
  }, x = () => {
112
- L || T(
112
+ L || I(
113
113
  "runReport",
114
114
  {
115
115
  defaultView: !0,
@@ -120,7 +120,7 @@ const Le = (e, t) => {
120
120
  !0,
121
121
  0,
122
122
  0,
123
- Ie
123
+ Te
124
124
  );
125
125
  }, J = () => {
126
126
  L || (t({
@@ -128,11 +128,11 @@ const Le = (e, t) => {
128
128
  startTime: "",
129
129
  username: "",
130
130
  patientId: ""
131
- }), T("init", { defaultView: !0 }, !0, 0, 0, q));
131
+ }), I("init", { defaultView: !0 }, !0, 0, 0, q));
132
132
  };
133
- return G(() => {
134
- z();
135
- }, []), G(() => {
133
+ return H(() => {
134
+ X();
135
+ }, []), H(() => {
136
136
  if (!n || N === void 0 || B.current === n.requestId) return;
137
137
  B.current = n.requestId;
138
138
  const c = !!n.params.defaultView, m = (c ? N : [...N].reverse()).map(se), D = m.length === K;
@@ -140,10 +140,10 @@ const Le = (e, t) => {
140
140
  if (E(m), p(null), a(m[0].auditLogId), u(m[m.length - 1].auditLogId), c)
141
141
  g(!1), f(D), s(1);
142
142
  else if (n.action === "next")
143
- g(!0), f(D), s(I.current + 1);
143
+ g(!0), f(D), s(T.current + 1);
144
144
  else {
145
145
  f(!0);
146
- const h = Math.max(1, I.current - 1);
146
+ const h = Math.max(1, T.current - 1);
147
147
  g(h > 1), s(h);
148
148
  }
149
149
  else
@@ -152,17 +152,17 @@ const Le = (e, t) => {
152
152
  filters: e,
153
153
  setFilters: t,
154
154
  logs: _,
155
- isLoading: Q || L,
155
+ isLoading: z || L,
156
156
  isFetching: L,
157
- isError: X,
157
+ isError: Q,
158
158
  emptyMessageKey: R,
159
159
  firstIndex: r,
160
160
  lastIndex: i,
161
161
  hasNext: b,
162
162
  hasPrevious: F,
163
163
  currentPageNumber: O,
164
- next: Z,
165
- prev: W,
164
+ next: W,
165
+ prev: Z,
166
166
  runReport: x,
167
167
  reset: J
168
168
  };
@@ -186,7 +186,7 @@ const Le = (e, t) => {
186
186
  prev: F,
187
187
  runReport: g,
188
188
  reset: O
189
- } = Te(), M = ce(
189
+ } = Ie(), M = ce(
190
190
  () => [
191
191
  { key: "auditLogId", header: e("EVENT_ID") },
192
192
  { key: "dateCreated", header: e("CREATED_AT") },
@@ -197,7 +197,7 @@ const Le = (e, t) => {
197
197
  { key: "module", header: e("MODULE") }
198
198
  ],
199
199
  [e]
200
- ), I = me(
200
+ ), T = me(
201
201
  (s, o) => {
202
202
  switch (o) {
203
203
  case "dateCreated":
@@ -256,7 +256,7 @@ const Le = (e, t) => {
256
256
  t.startDate?.getTime() ?? "empty"
257
257
  ),
258
258
  /* @__PURE__ */ d(
259
- U,
259
+ C,
260
260
  {
261
261
  id: "audit-log-start-time",
262
262
  type: "time",
@@ -270,7 +270,7 @@ const Le = (e, t) => {
270
270
  }
271
271
  ),
272
272
  /* @__PURE__ */ d(
273
- U,
273
+ C,
274
274
  {
275
275
  id: "audit-log-username",
276
276
  labelText: e("USERNAME_FILTER_LABEL"),
@@ -284,7 +284,7 @@ const Le = (e, t) => {
284
284
  }
285
285
  ),
286
286
  /* @__PURE__ */ d(
287
- U,
287
+ C,
288
288
  {
289
289
  id: "audit-log-patient-id",
290
290
  labelText: e("PATIENT_ID_FILTER_LABEL"),
@@ -328,7 +328,7 @@ const Le = (e, t) => {
328
328
  title: e("AUDIT_LOG_TABLE_HEADER_LABEL"),
329
329
  dataTestId: "audit-log-table",
330
330
  loading: i,
331
- renderCell: I,
331
+ renderCell: T,
332
332
  emptyStateMessage: E ? e(E) : void 0,
333
333
  errorStateMessage: _ ? e("ADMIN_ERROR_FETCH_CONFIG") : null,
334
334
  pagination: {
@@ -1,5 +1,5 @@
1
1
  import { jsx as a, jsxs as e } from "react/jsx-runtime";
2
- import { u as d, y as o } from "./index-zul2tc9C.js";
2
+ import { u as d, A as o } from "./index-BdGZxaWH.js";
3
3
  const t = "CsvUpload-module_page__AxMNv", i = {
4
4
  page: t
5
5
  }, n = () => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as d, jsxs as h, Fragment as x } from "react/jsx-runtime";
2
- import { d as G, u as W, z as Y, R as J, s as X, h as Z, $ as ee, a as te } from "./index-zul2tc9C.js";
2
+ import { d as G, u as W, z as Y, P as J, s as X, h as Z, $ as ee, a as te } from "./index-BdGZxaWH.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", de = "DocumentsTable-module_documentViewerContainer__F5m8D", re = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", r = {
@@ -18,7 +18,7 @@ const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTab
18
18
  uploadedBy: "DOCUMENTS_UPLOADED_BY",
19
19
  attachments: "DOCUMENTS_ATTACHMENTS"
20
20
  };
21
- function v(a) {
21
+ function R(a) {
22
22
  return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
23
23
  }
24
24
  function ie(a, E) {
@@ -42,9 +42,9 @@ const Te = [
42
42
  U(e), w(!0);
43
43
  }, []), H = _(() => {
44
44
  w(!1), U(null), O(/* @__PURE__ */ new Set());
45
- }, []), R = _((e) => {
45
+ }, []), v = _((e) => {
46
46
  O((t) => new Set(t).add(e));
47
- }, []), { data: i, isLoading: q, isError: y, error: b } = ae({
47
+ }, []), { data: i, isLoading: P, isError: y, error: b } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
50
  g,
@@ -76,7 +76,7 @@ const Te = [
76
76
  if (!s || !o) return;
77
77
  const t = /* @__PURE__ */ new Set(), m = B(o);
78
78
  for (let c = 0; c < m.length; c++) {
79
- const S = v(m[c].url);
79
+ const S = R(m[c].url);
80
80
  try {
81
81
  (await fetch(S, {
82
82
  method: "HEAD",
@@ -89,7 +89,7 @@ const Te = [
89
89
  e.signal.aborted || O(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
- const z = _(
92
+ const q = _(
93
93
  (e, t) => {
94
94
  t !== u ? (V(t), C(1), A(void 0)) : C(e);
95
95
  },
@@ -97,7 +97,7 @@ const Te = [
97
97
  ), N = p(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), j = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = p(() => ie(N, n), [N, n]), K = p(
100
+ ), z = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), j = p(() => ie(N, n), [N, n]), K = p(
101
101
  () => N.map((e) => ({
102
102
  key: e,
103
103
  sortable: e !== "attachments"
@@ -141,10 +141,10 @@ const Te = [
141
141
  /* @__PURE__ */ d("div", { "data-testid": "documents-table", children: /* @__PURE__ */ d(
142
142
  ee,
143
143
  {
144
- headers: P,
144
+ headers: j,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
- rows: j,
147
- loading: q,
146
+ rows: z,
147
+ loading: P,
148
148
  errorStateMessage: y ? b?.message : null,
149
149
  sortable: K,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
@@ -154,7 +154,7 @@ const Te = [
154
154
  pageSize: u,
155
155
  totalItems: F,
156
156
  page: f,
157
- onPageChange: z
157
+ onPageChange: q
158
158
  }
159
159
  ) }),
160
160
  s && o && /* @__PURE__ */ d(
@@ -169,7 +169,7 @@ const Te = [
169
169
  size: "lg",
170
170
  testId: "document-view-modal",
171
171
  children: /* @__PURE__ */ d("div", { className: r.documentViewerContainer, children: T.map((e, t) => {
172
- const m = v(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), D = $.has(t);
172
+ const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), D = $.has(t);
173
173
  return m === "#" || D ? /* @__PURE__ */ h(
174
174
  "div",
175
175
  {
@@ -202,7 +202,7 @@ const Te = [
202
202
  src: m,
203
203
  alt: o.documentIdentifier,
204
204
  className: r.documentImage,
205
- onError: () => R(t)
205
+ onError: () => v(t)
206
206
  }
207
207
  ) : /* @__PURE__ */ d(
208
208
  "iframe",
@@ -210,7 +210,7 @@ const Te = [
210
210
  src: c ? `${m}#toolbar=0` : m,
211
211
  className: r.documentIframe,
212
212
  title: o.documentIdentifier,
213
- onError: () => R(t)
213
+ onError: () => v(t)
214
214
  }
215
215
  )
216
216
  ]
@@ -1,110 +1,110 @@
1
1
  import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
2
- import { u as ie, d as de, g as le, k as me, H as ue, L as ce, b as fe, A as ye, w as ge, M as he, l as Ne, c as Oe, h as Te, O as V, x as $, s as pe, $ as x, W as be, q as Ie, a as Ae, e as Ee, J as _e } from "./index-zul2tc9C.js";
3
- import { useQueryClient as Le, useQuery as A } from "@tanstack/react-query";
4
- import { useState as K, useMemo as i, useCallback as d } from "react";
5
- const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", N = {
6
- formsTableBody: Re,
7
- modalHeading: ve,
2
+ import { u as de, d as ie, v as le, k as me, H as ue, B as ce, b as fe, D as ye, w as Ne, N as he, c as ge, R as Te, h as pe, L as V, e as $, s as Oe, $ as K, W as be, q as Ie, a as Ee, f as _e, g as Ae } from "./index-BdGZxaWH.js";
3
+ import { useQueryClient as ve, useQuery as E } from "@tanstack/react-query";
4
+ import { useState as j, useMemo as d, useCallback as i } from "react";
5
+ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", g = {
6
+ formsTableBody: Le,
7
+ modalHeading: Re,
8
8
  customAccordianItem: Be
9
- }, Ce = "startConsultation", Se = ({
10
- episodeOfCareUuids: E,
9
+ }, Ce = "startConsultation", Me = ({
10
+ episodeOfCareUuids: _,
11
11
  encounterUuids: l,
12
- config: j,
12
+ config: x,
13
13
  disableActions: z = !1,
14
14
  activeEncounterUuid: y = null
15
15
  }) => {
16
- const { t: o } = ie(), m = de(), [O, _] = K(!1), [s, L] = K(null), {
16
+ const { t: o } = de(), m = ie(), [T, A] = j(!1), [t, v] = j(null), {
17
17
  numberOfVisits: Q,
18
18
  hideThumbnail: G = !1,
19
- forms: g
20
- } = j ?? {}, J = le(
21
- _e.EDIT_OBSERVATIONS
22
- ), { userPrivileges: h } = me(), T = J && !z && !!y, R = ue(
23
- E,
19
+ forms: N
20
+ } = x ?? {}, W = le(
21
+ Ae.EDIT_OBSERVATIONS
22
+ ), { userPrivileges: h } = me(), p = W && !z && !!y, L = ue(
23
+ _,
24
24
  l
25
- ), W = Le(), {
26
- data: v = [],
25
+ ), P = ve(), {
26
+ data: R = [],
27
27
  isLoading: B,
28
28
  isError: C,
29
- error: P,
30
- refetch: Y
31
- } = A({
32
- queryKey: ["forms", m, E],
29
+ error: Y,
30
+ refetch: J
31
+ } = E({
32
+ queryKey: ["forms", m, _],
33
33
  queryFn: () => ce(m, void 0, Q),
34
- enabled: !!m && !R
35
- }), F = i(() => {
36
- let e = v;
34
+ enabled: !!m && !L
35
+ }), F = d(() => {
36
+ let e = R;
37
37
  return l && l.length > 0 && (e = e.filter(
38
38
  (r) => l.includes(r.encounterUuid)
39
- )), Array.isArray(g) && g.length > 0 && (e = e.filter(
40
- (r) => g.some((a) => a.toLowerCase() === r.formName.toLowerCase())
39
+ )), Array.isArray(N) && N.length > 0 && (e = e.filter(
40
+ (r) => N.some((a) => a.toLowerCase() === r.formName.toLowerCase())
41
41
  )), e;
42
- }, [v, l, g]), { data: M = [] } = A({
42
+ }, [R, l, N]), { data: D = [] } = E({
43
43
  queryKey: ["observationForms"],
44
44
  queryFn: () => fe()
45
- }), U = d(
45
+ }), U = i(
46
46
  (e) => {
47
- const r = M.find(
48
- (t) => t.name.toLowerCase() === e.toLowerCase()
47
+ const r = D.find(
48
+ (s) => s.name.toLowerCase() === e.toLowerCase()
49
49
  );
50
50
  if (!r?.privileges || r.privileges.length === 0) return !0;
51
51
  if (!h || h.length === 0) return !1;
52
- const a = new Set(h.map((t) => t.name));
52
+ const a = new Set(h.map((s) => s.name));
53
53
  return r.privileges.some(
54
- (t) => a.has(t.privilegeName) && t.editable
54
+ (s) => a.has(s.privilegeName) && s.editable
55
55
  );
56
56
  },
57
- [M, h]
58
- ), u = d(
57
+ [D, h]
58
+ ), u = i(
59
59
  (e) => !y || e.encounterUuid !== y ? !1 : U(e.formName),
60
60
  [y, U]
61
61
  ), {
62
- data: p,
62
+ data: O,
63
63
  isLoading: X,
64
64
  isError: Z,
65
65
  error: b
66
- } = A({
67
- queryKey: ["formsEncounterFHIR", s?.encounterUuid],
68
- queryFn: () => ye(s.encounterUuid),
69
- enabled: !!s?.encounterUuid && O
66
+ } = E({
67
+ queryKey: ["formsEncounterFHIR", t?.encounterUuid],
68
+ queryFn: () => ye(t.encounterUuid),
69
+ enabled: !!t?.encounterUuid && T
70
70
  });
71
- ge(
71
+ Ne(
72
72
  (e) => {
73
- e.patientUUID === m && (Y(), W.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
73
+ e.patientUUID === m && (J(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
74
74
  },
75
75
  [m]
76
76
  );
77
- const ee = i(() => !p?.entry || !s?.formName ? [] : p.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? Ne(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [p, s?.formName]), re = i(() => {
77
+ const ee = d(() => !O?.entry || !t?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [O, t?.formName]), re = d(() => {
78
78
  if (b)
79
- return Oe(b).message;
80
- }, [b]), c = i(
79
+ return Te(b).message;
80
+ }, [b]), c = d(
81
81
  () => [
82
82
  { key: "recordedOn", header: o("RECORDED_ON") },
83
83
  { key: "recordedBy", header: o("RECORDED_BY") }
84
84
  ],
85
85
  [o]
86
- ), D = i(
86
+ ), S = d(
87
87
  () => [...c, { key: "actions", header: o("ACTIONS") }],
88
88
  [c, o]
89
- ), ae = d(
90
- (e) => T && e.some((r) => u(r)) ? D : c,
91
- [T, u, D, c]
92
- ), oe = c, se = i(
89
+ ), ae = i(
90
+ (e) => p && e.some((r) => u(r)) ? S : c,
91
+ [p, u, S, c]
92
+ ), oe = c, te = d(
93
93
  () => [
94
94
  { key: "recordedOn", sortable: !0 },
95
95
  { key: "recordedBy", sortable: !0 }
96
96
  ],
97
97
  []
98
- ), S = i(() => {
98
+ ), M = d(() => {
99
99
  const e = F.reduce(
100
100
  (r, a) => {
101
- const t = a.formName;
102
- r[t] ??= [];
103
- const f = a.providers.map((te) => te.providerName).filter(Boolean).join(", ");
104
- return r[t].push({
101
+ const s = a.formName;
102
+ r[s] ??= [];
103
+ const f = a.providers.map((se) => se.providerName).filter(Boolean).join(", ");
104
+ return r[s].push({
105
105
  id: a.encounterUuid,
106
106
  formName: a.formName,
107
- recordedOn: Te(a.encounterDateTime, o, !0).formattedResult,
107
+ recordedOn: pe(a.encounterDateTime, o, !0).formattedResult,
108
108
  recordedBy: f ?? "--",
109
109
  encounterDateTime: a.encounterDateTime,
110
110
  encounterUuid: a.encounterUuid
@@ -116,15 +116,15 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
116
116
  ([r, a]) => ({
117
117
  formName: r,
118
118
  records: a.sort(
119
- (t, f) => f.encounterDateTime - t.encounterDateTime
119
+ (s, f) => f.encounterDateTime - s.encounterDateTime
120
120
  )
121
121
  })
122
122
  ).sort((r, a) => r.formName.localeCompare(a.formName));
123
- }, [F, o]), k = d((e) => {
124
- L(e), _(!0);
125
- }, []), w = d(() => {
126
- _(!1), L(null);
127
- }, []), I = d((e) => {
123
+ }, [F, o]), w = i((e) => {
124
+ v(e), A(!0);
125
+ }, []), k = i(() => {
126
+ A(!1), v(null);
127
+ }, []), I = i((e) => {
128
128
  globalThis.dispatchEvent(
129
129
  new CustomEvent(Ce, {
130
130
  detail: {
@@ -136,11 +136,11 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
136
136
  }
137
137
  })
138
138
  );
139
- }, []), H = d(
139
+ }, []), H = i(
140
140
  (e, r) => {
141
141
  switch (r) {
142
142
  case "recordedOn":
143
- return /* @__PURE__ */ n(pe, { 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":
@@ -159,43 +159,43 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
159
159
  return null;
160
160
  }
161
161
  },
162
- [k, I, u, o]
162
+ [w, I, u, o]
163
163
  );
164
164
  return /* @__PURE__ */ q(ne, { children: [
165
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || C || S.length === 0 || R ? /* @__PURE__ */ n(
166
- x,
165
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || C || M.length === 0 || L ? /* @__PURE__ */ n(
166
+ K,
167
167
  {
168
168
  headers: oe,
169
169
  ariaLabel: o("FORMS_HEADING"),
170
170
  rows: [],
171
171
  loading: B,
172
- errorStateMessage: C ? P?.message : void 0,
172
+ errorStateMessage: C ? Y?.message : void 0,
173
173
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
174
174
  renderCell: H,
175
- className: N.formsTableBody,
175
+ className: g.formsTableBody,
176
176
  dataTestId: "forms-table"
177
177
  }
178
- ) : /* @__PURE__ */ n(be, { align: "start", children: S.map((e, r) => {
179
- const { formName: a, records: t } = e, f = ae(t);
178
+ ) : /* @__PURE__ */ n(be, { align: "start", children: M.map((e, r) => {
179
+ const { formName: a, records: s } = e, f = ae(s);
180
180
  return /* @__PURE__ */ n(
181
181
  Ie,
182
182
  {
183
183
  title: a,
184
- className: N.customAccordianItem,
184
+ className: g.customAccordianItem,
185
185
  testId: `accordian-title-${a}`,
186
186
  open: r === 0,
187
187
  children: /* @__PURE__ */ n(
188
- x,
188
+ K,
189
189
  {
190
190
  headers: f,
191
191
  ariaLabel: o("FORMS_HEADING"),
192
- rows: t,
192
+ rows: s,
193
193
  loading: !1,
194
194
  errorStateMessage: "",
195
- sortable: se,
195
+ sortable: te,
196
196
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
197
197
  renderCell: H,
198
- className: N.formsTableBody,
198
+ className: g.formsTableBody,
199
199
  dataTestId: `forms-table-${a}`
200
200
  }
201
201
  )
@@ -203,44 +203,44 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
203
203
  a
204
204
  );
205
205
  }) }) }),
206
- O && s && /* @__PURE__ */ n(
207
- Ae,
206
+ T && t && /* @__PURE__ */ n(
207
+ Ee,
208
208
  {
209
209
  id: "modalIdForActionAreaLayout",
210
210
  portalId: "main-display-area",
211
- open: O,
212
- onRequestClose: w,
213
- modalHeading: /* @__PURE__ */ q("div", { className: N.modalHeading, children: [
214
- /* @__PURE__ */ n("span", { children: s.formName }),
215
- T && u(s) && /* @__PURE__ */ n(
211
+ open: T,
212
+ onRequestClose: k,
213
+ modalHeading: /* @__PURE__ */ q("div", { className: g.modalHeading, children: [
214
+ /* @__PURE__ */ n("span", { children: t.formName }),
215
+ p && u(t) && /* @__PURE__ */ n(
216
216
  V,
217
217
  {
218
218
  label: o("EDIT_OBSERVATION_FORM"),
219
219
  kind: "ghost",
220
220
  size: "sm",
221
- testId: `edit-form-modal-${s.encounterUuid}`,
221
+ testId: `edit-form-modal-${t.encounterUuid}`,
222
222
  onClick: () => {
223
- w(), I(s);
223
+ k(), I(t);
224
224
  },
225
225
  children: /* @__PURE__ */ n($, {})
226
226
  }
227
227
  )
228
228
  ] }),
229
- modalLabel: `${s.recordedOn} | ${s.recordedBy}`,
229
+ modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
230
230
  passiveModal: !0,
231
231
  size: "md",
232
232
  testId: "form-details-modal",
233
233
  children: /* @__PURE__ */ n(
234
- Ee,
234
+ _e,
235
235
  {
236
236
  observations: ee,
237
237
  isLoading: X,
238
238
  isError: Z,
239
239
  errorMessage: re,
240
240
  emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
241
- testIdPrefix: s.formName,
241
+ testIdPrefix: t.formName,
242
242
  hideThumbnail: G,
243
- formName: s.formName
243
+ formName: t.formName
244
244
  }
245
245
  )
246
246
  }
@@ -248,5 +248,5 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
248
248
  ] });
249
249
  };
250
250
  export {
251
- Se as default
251
+ Me as default
252
252
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DdbQ53ga.js";
2
- import { a2 as d, a3 as f, a4 as e } from "./index-zul2tc9C.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-C_XJnyBg.js";
2
+ import { a2 as d, a3 as f, a4 as e } from "./index-BdGZxaWH.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"