@bahmni/admin-app 0.0.1-dev.439 → 0.0.1-dev.441

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,61 +1,61 @@
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 Te, h as pe, e as V, x as $, s as Oe, $ as x, W as be, q as Ie, a as Ae, f as Ee, J as _e } from "./index-DCAEnw_P.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 ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", Re = "FormsTable-module_customAccordianItem__isszs", N = {
6
- formsTableBody: ve,
7
- modalHeading: Ce,
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-C1nJC-ZZ.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 Be = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", Re = "FormsTable-module_customAccordianItem__isszs", g = {
6
+ formsTableBody: Be,
7
+ modalHeading: Le,
8
8
  customAccordianItem: Re
9
- }, Be = "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(), [T, _] = 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(), p = J && !z && !!y, v = ue(
23
- E,
19
+ forms: N
20
+ } = x ?? {}, W = le(
21
+ Ae.EDIT_OBSERVATIONS
22
+ ), { userPrivileges: h } = me(), p = W && !z && !!y, B = ue(
23
+ _,
24
24
  l
25
- ), W = Le(), {
26
- data: C = [],
25
+ ), P = ve(), {
26
+ data: L = [],
27
27
  isLoading: R,
28
- isError: B,
29
- error: P,
30
- refetch: Y
31
- } = A({
32
- queryKey: ["forms", m, E],
28
+ isError: C,
29
+ error: Y,
30
+ refetch: J
31
+ } = E({
32
+ queryKey: ["forms", m, _],
33
33
  queryFn: () => ce(m, void 0, Q),
34
- enabled: !!m && !v
35
- }), F = i(() => {
36
- let e = C;
34
+ enabled: !!m && !B
35
+ }), F = d(() => {
36
+ let e = L;
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
- }, [C, l, g]), { data: M = [] } = A({
42
+ }, [L, 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
  ), {
@@ -63,45 +63,45 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
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 && T
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(() => !O?.entry || !s?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? Ne(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [O, 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
79
  return Te(b).message;
80
- }, [b]), c = i(
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) => p && e.some((r) => u(r)) ? D : c,
91
- [p, 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
107
  recordedOn: pe(a.encounterDateTime, o, !0).formattedResult,
@@ -116,17 +116,17 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "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]), k = i((e) => {
124
+ v(e), A(!0);
125
+ }, []), w = i(() => {
126
+ A(!1), v(null);
127
+ }, []), I = i((e) => {
128
128
  globalThis.dispatchEvent(
129
- new CustomEvent(Be, {
129
+ new CustomEvent(Ce, {
130
130
  detail: {
131
131
  editOnly: "observationForms",
132
132
  editTitle: "EDIT_OBSERVATION_FORM_TITLE",
@@ -136,7 +136,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "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":
@@ -162,40 +162,40 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
162
162
  [k, I, u, o]
163
163
  );
164
164
  return /* @__PURE__ */ q(ne, { children: [
165
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: R || B || S.length === 0 || v ? /* @__PURE__ */ n(
166
- x,
165
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: R || C || M.length === 0 || B ? /* @__PURE__ */ n(
166
+ K,
167
167
  {
168
168
  headers: oe,
169
169
  ariaLabel: o("FORMS_HEADING"),
170
170
  rows: [],
171
171
  loading: R,
172
- errorStateMessage: B ? 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 ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
203
203
  a
204
204
  );
205
205
  }) }) }),
206
- T && 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
211
  open: T,
212
212
  onRequestClose: w,
213
- modalHeading: /* @__PURE__ */ q("div", { className: N.modalHeading, children: [
214
- /* @__PURE__ */ n("span", { children: s.formName }),
215
- p && u(s) && /* @__PURE__ */ n(
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
+ w(), 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 ve = "FormsTable-module_formsTableBody__SvGha", Ce = "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-CUMbqjIc.js";
2
- import { a2 as d, a3 as f, a4 as e } from "./index-DCAEnw_P.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DsTQkrYO.js";
2
+ import { a9 as d, aa as f, ab as e } from "./index-C1nJC-ZZ.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,11 +1,11 @@
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-CUMbqjIc.js";
2
- import { a2 as v, a3 as C, a4 as e } from "./index-DCAEnw_P.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-DsTQkrYO.js";
2
+ import { a9 as v, aa as C, ab as e } from "./index-C1nJC-ZZ.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), a = v(), l = C(() => {
7
- const n = r.theme_preference || c;
8
- return n !== "system" ? n : a();
6
+ }), n = v(), l = C(() => {
7
+ const a = r.theme_preference || c;
8
+ return a !== "system" ? a : n();
9
9
  });
10
10
  return e(d.Provider, {
11
11
  value: t,
@@ -1,16 +1,16 @@
1
1
  import { jsxs as I, jsx as o } from "react/jsx-runtime";
2
- import { d as Q, z as j, u as L, i as G, H as M, O as P, T as x, w as Y, P as J, U as W, F as X, j as Z, m as ee, $ as ae, n as se, o as U, B as te, Y as re, h as ie, p as ne, r as oe, t as de, v as le } from "./index-DCAEnw_P.js";
2
+ import { d as G, z as H, u as F, I as j, H as J, i as M, Z as Y, w as x, Y as P, Q as X, J as Z, X as W, j as ee, $ as ae, G as se, E as U, K as te, l as re, h as ie, m as ne, n as oe, o as de, F as le } from "./index-C1nJC-ZZ.js";
3
3
  import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
4
- import { useRef as pe, useEffect as D, useMemo as g } from "react";
5
- const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
6
- observations: me,
4
+ import { useRef as me, useEffect as D, useMemo as g } from "react";
5
+ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
6
+ observations: pe,
7
7
  title: be,
8
8
  wrapper: he,
9
9
  secondary: ve
10
- }, F = (s, l, n, d, c, t) => {
11
- const r = te(s, l, c), e = r.value, p = re(e);
10
+ }, w = (s, l, n, d, c, t) => {
11
+ const r = te(s, l, c), e = r.value, m = re(e);
12
12
  let i = e;
13
- p === "Image" && (i = /* @__PURE__ */ o(
13
+ m === "Image" && (i = /* @__PURE__ */ o(
14
14
  oe,
15
15
  {
16
16
  imageSrc: e,
@@ -18,29 +18,29 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
18
18
  id: `${e}-img`,
19
19
  hideThumbnail: t
20
20
  }
21
- )), p === "Video" && (i = /* @__PURE__ */ o(
21
+ )), m === "Video" && (i = /* @__PURE__ */ o(
22
22
  de,
23
23
  {
24
24
  id: `${e}-video`,
25
25
  videoSrc: e,
26
26
  hideThumbnail: t
27
27
  }
28
- )), p === "PDF" && (i = /* @__PURE__ */ o(le, { id: `${e}-pdf`, src: e }));
29
- const m = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
28
+ )), m === "PDF" && (i = /* @__PURE__ */ o(le, { id: `${e}-pdf`, src: e }));
29
+ const p = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
30
30
  /* @__PURE__ */ o("span", { children: r.header.display }),
31
31
  r.header.referenceRange && /* @__PURE__ */ o("span", { className: O.secondary, children: r.header.referenceRange })
32
32
  ] }), u = c("OBSERVATIONS_RECORDED_BY", {
33
33
  provider: r.provider
34
- }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, f = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
34
+ }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, E = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
35
35
  /* @__PURE__ */ o("span", { children: u }),
36
36
  b && /* @__PURE__ */ o("span", { className: O.secondary, children: b })
37
37
  ] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", R = d ? `${d}-${v}-${h}-${n}-${l}` : `${v}-${h}-${n}-${l}`;
38
38
  return /* @__PURE__ */ o(
39
39
  ne,
40
40
  {
41
- header: m,
41
+ header: p,
42
42
  value: i,
43
- info: f,
43
+ info: E,
44
44
  id: R,
45
45
  testId: R,
46
46
  ariaLabel: R
@@ -54,9 +54,9 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
54
54
  id: `grouped-obs-${s.display}-${d}`,
55
55
  open: n,
56
56
  children: s.members?.map(
57
- (e, p) => F(
57
+ (e, m) => w(
58
58
  e,
59
- p,
59
+ m,
60
60
  c,
61
61
  t,
62
62
  l,
@@ -70,19 +70,19 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
70
70
  title: l = "",
71
71
  hideThumbnail: n
72
72
  }) => {
73
- const { t: d } = L(), c = (t, r, e) => {
74
- const p = se(t.encounterDetails, d);
73
+ const { t: d } = F(), c = (t, r, e) => {
74
+ const m = se(t.encounterDetails, d);
75
75
  return /* @__PURE__ */ I(
76
76
  U,
77
77
  {
78
- title: p,
78
+ title: m,
79
79
  id: `encounter-${t.encounterId}`,
80
80
  open: r,
81
81
  children: [
82
82
  t.observations.map(
83
- (i, m) => F(
83
+ (i, p) => w(
84
84
  i,
85
- m,
85
+ p,
86
86
  e,
87
87
  l,
88
88
  d,
@@ -90,11 +90,11 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
90
90
  )
91
91
  ),
92
92
  t.groupedObservations.map(
93
- (i, m) => ye(
93
+ (i, p) => ye(
94
94
  i,
95
95
  d,
96
96
  r,
97
- m,
97
+ p,
98
98
  e,
99
99
  l,
100
100
  n
@@ -116,7 +116,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
116
116
  )
117
117
  }
118
118
  );
119
- }, Re = (s) => ["conceptUuid", s], Te = (s, l, n, d) => [
119
+ }, Re = (s) => ["conceptUuid", s], _e = (s, l, n, d) => [
120
120
  "observations",
121
121
  s,
122
122
  ...l,
@@ -132,77 +132,77 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
132
132
  conceptUuid: t = [],
133
133
  hideThumbnail: r = !1,
134
134
  scope: e = "all"
135
- } = d, p = pe(/* @__PURE__ */ new Set()), i = Q(), { addNotification: m } = j(), { t: u } = L(), b = ue({
135
+ } = d, m = me(/* @__PURE__ */ new Set()), i = G(), { addNotification: p } = H(), { t: u } = F(), b = ue({
136
136
  queries: c.map((a) => ({
137
137
  queryKey: Re(a),
138
- queryFn: () => G(a),
138
+ queryFn: () => j(a),
139
139
  enabled: !!a
140
140
  }))
141
141
  });
142
142
  D(() => {
143
- const a = b.some((H) => H.isError), y = p.current.size > 0;
144
- a && !y ? (m({
143
+ const a = b.some((z) => z.isError), y = m.current.size > 0;
144
+ a && !y ? (p({
145
145
  title: u("ERROR_DEFAULT_TITLE"),
146
146
  message: u("ERROR_FETCHING_OBSERVATIONS"),
147
147
  type: "error"
148
- }), p.current.add(0)) : !a && y && p.current.clear();
149
- }, [b, m, u]);
150
- const f = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...f, ...t])], [f, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", V = M(
148
+ }), m.current.add(0)) : !a && y && m.current.clear();
149
+ }, [b, p, u]);
150
+ const E = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...E, ...t])], [E, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", B = J(
151
151
  l,
152
152
  n
153
153
  ), {
154
- data: T,
155
- isLoading: w,
154
+ data: _,
155
+ isLoading: V,
156
156
  isError: S,
157
- refetch: N
157
+ refetch: $
158
158
  } = ce({
159
- queryKey: Te(
159
+ queryKey: _e(
160
160
  i,
161
161
  h,
162
162
  n,
163
163
  e
164
164
  ),
165
- queryFn: () => R ? P(
165
+ queryFn: () => R ? M(
166
166
  i,
167
167
  h,
168
168
  n
169
- ) : x(
169
+ ) : Y(
170
170
  i,
171
171
  h,
172
172
  n
173
173
  ),
174
- enabled: !!i && h.length > 0 && v && !V
174
+ enabled: !!i && h.length > 0 && v && !B
175
175
  });
176
- Y(
176
+ x(
177
177
  (a) => {
178
178
  a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
179
179
  (y) => h.includes(y)
180
- ) && N();
180
+ ) && $();
181
181
  },
182
- [i, N]
182
+ [i, $]
183
183
  ), D(() => {
184
- S && m({
184
+ S && p({
185
185
  title: u("ERROR_DEFAULT_TITLE"),
186
186
  message: u("ERROR_FETCHING_OBSERVATIONS"),
187
187
  type: "error"
188
188
  });
189
189
  }, [S]);
190
- const $ = g(() => {
191
- if (!T) return [];
192
- let a = J(T);
193
- e === "latest-encounter" && (a = W(a));
194
- const y = X(a);
195
- return Z(y);
196
- }, [T, e]), k = [
190
+ const N = g(() => {
191
+ if (!_) return [];
192
+ let a = P(_);
193
+ e === "latest-encounter" && (a = X(a));
194
+ const y = Z(a);
195
+ return W(y);
196
+ }, [_, e]), K = [
197
197
  { key: "name", header: "name" },
198
198
  { key: "value", header: "value" },
199
199
  { key: "form", header: "form" }
200
- ], A = w || !v, B = S && v, q = (!T || T.entry?.length === 0 || h.length === 0) && v, C = B ? u("ERROR_FETCHING_OBSERVATIONS") : null, K = q ? u("NO_OBSERVATIONS_FOUND") : void 0, z = $.length > 0 && !A && !B, E = d.titleTranslationKey, _ = E ? u(E) : "";
200
+ ], A = V || !v, L = S && v, k = (!_ || _.entry?.length === 0 || h.length === 0) && v, C = L ? u("ERROR_FETCHING_OBSERVATIONS") : null, Q = k ? u("NO_OBSERVATIONS_FOUND") : void 0, q = N.length > 0 && !A && !L, T = d.titleTranslationKey, f = T ? u(T) : "";
201
201
  return /* @__PURE__ */ I(
202
202
  "div",
203
203
  {
204
204
  id: "observations",
205
- "data-testid": E ? `observations-${_}` : "observations",
205
+ "data-testid": T ? `observations-${f}` : "observations",
206
206
  "aria-label": "observations-aria-label",
207
207
  className: O.observations,
208
208
  children: [
@@ -210,28 +210,28 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
210
210
  ee,
211
211
  {
212
212
  id: "observations-title",
213
- testId: E ? `observations-title-${_}` : "observations-title",
214
- title: _,
213
+ testId: T ? `observations-title-${f}` : "observations-title",
214
+ title: f,
215
215
  className: O.title,
216
- children: /* @__PURE__ */ o("p", { children: _ })
216
+ children: /* @__PURE__ */ o("p", { children: f })
217
217
  }
218
218
  ),
219
- z ? /* @__PURE__ */ o(
219
+ q ? /* @__PURE__ */ o(
220
220
  Oe,
221
221
  {
222
- groupedData: $,
223
- title: _,
222
+ groupedData: N,
223
+ title: f,
224
224
  hideThumbnail: r
225
225
  }
226
226
  ) : /* @__PURE__ */ o(
227
227
  ae,
228
228
  {
229
- headers: k,
229
+ headers: K,
230
230
  rows: [],
231
231
  ariaLabel: u("OBSERVATIONS"),
232
232
  loading: A,
233
233
  errorStateMessage: C,
234
- emptyStateMessage: K ?? u("NO_OBSERVATIONS_AVAILABLE"),
234
+ emptyStateMessage: Q ?? u("NO_OBSERVATIONS_AVAILABLE"),
235
235
  dataTestId: "observations-table"
236
236
  }
237
237
  )
@@ -242,5 +242,5 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
242
242
  export {
243
243
  Re as conceptUuidQueryKeys,
244
244
  Ie as default,
245
- Te as observationsQueryKeys
245
+ _e as observationsQueryKeys
246
246
  };