@bahmni/widgets 0.0.1-dev.469 → 0.0.1-dev.472

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 a, jsxs as h, Fragment as pe } from "react/jsx-runtime";
2
- import { u as _e, a as Ae, b as ge, o as Ee, m as fe, s as Ce, c as Ie, d as y, p as De, e as Ne, f as Le, g as be, S as Se, h as Q, i as ye, w as ve, A as Oe, F as we, j as Me, k as J, B as ee } from "./index-CmbXgAAP.js";
2
+ import { u as _e, a as Ae, b as ge, c as Ee, g as fe, o as Ce, d as Ie, e as y, p as De, f as Ne, h as Le, i as be, S as Se, j as Q, k as ye, w as ve, A as Oe, F as we, l as Me, m as J, B as ee } from "./index-BsguGr5X.js";
3
3
  import { useQuery as Ue } from "@tanstack/react-query";
4
4
  import { useState as T, useRef as Re, useEffect as _, useMemo as A, useCallback as p } from "react";
5
5
  import { useTranslation as ke } from "react-i18next";
@@ -1,27 +1,27 @@
1
- import { jsx as n, jsxs as q, Fragment as ie } from "react/jsx-runtime";
2
- import { u as de, b as le, l as me, U as ce, V as ue, n as fe, E as ye, s as be, q as he, r as pe, Q as ge, f as Ne, o as Oe, h as V, G as x, e as Fe, A as G, t as Ie, v as Te, F as Ee, O as Ae, C as ve } from "./index-CmbXgAAP.js";
3
- import { useQueryClient as Re, useQuery as E } from "@tanstack/react-query";
1
+ import { jsx as n, jsxs as P, Fragment as ie } from "react/jsx-runtime";
2
+ import { u as de, b as le, n as me, q as ce, H as ue, r as fe, s as ye, o as he, t as be, v as pe, Q as ge, h as Ne, c as Oe, j as x, G as V, f as Fe, A as G, x as Ie, y as Te, F as Ae, O as Ee, C as ve } from "./index-BsguGr5X.js";
3
+ import { useQueryClient as Re, useQuery as A } from "@tanstack/react-query";
4
4
  import { useState as $, useMemo as i, useCallback as d } from "react";
5
5
  import { useTranslation as De } from "react-i18next";
6
6
  const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", p = {
7
7
  formsTableBody: _e,
8
8
  modalHeading: Le,
9
9
  customAccordianItem: Be
10
- }, He = ({
11
- episodeOfCareUuids: A,
10
+ }, ke = ({
11
+ episodeOfCareUuids: E,
12
12
  encounterUuids: m,
13
- config: Q,
14
- disableActions: j = !1,
13
+ config: j,
14
+ disableActions: Q = !1,
15
15
  activeEncounterUuid: y = null
16
16
  }) => {
17
- const { t: o } = De(), c = de(), [g, v] = $(!1), [a, R] = $(null), {
17
+ const { t: s } = De(), c = de(), [g, v] = $(!1), [a, R] = $(null), {
18
18
  numberOfVisits: z,
19
19
  hideThumbnail: K = !1,
20
- forms: b
21
- } = Q ?? {}, W = le(
20
+ forms: h
21
+ } = j ?? {}, W = le(
22
22
  ve.EDIT_OBSERVATIONS
23
- ), { userPrivileges: h } = me(), N = W && !j && !!y, D = ce(
24
- A,
23
+ ), { userPrivileges: b } = me(), N = W && !Q && !!y, D = ce(
24
+ E,
25
25
  m
26
26
  ), Y = Re(), {
27
27
  data: _ = [],
@@ -29,33 +29,33 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
29
29
  isError: B,
30
30
  error: J,
31
31
  refetch: X
32
- } = E({
33
- queryKey: ["forms", c, A],
32
+ } = A({
33
+ queryKey: ["forms", c, E],
34
34
  queryFn: () => ue(c, void 0, z),
35
35
  enabled: !!c && !D
36
36
  }), C = i(() => {
37
37
  let e = _;
38
38
  return m && m.length > 0 && (e = e.filter(
39
- (s) => m.includes(s.encounterUuid)
40
- )), Array.isArray(b) && b.length > 0 && (e = e.filter(
41
- (s) => b.some((t) => t.toLowerCase() === s.formName.toLowerCase())
39
+ (t) => m.includes(t.encounterUuid)
40
+ )), Array.isArray(h) && h.length > 0 && (e = e.filter(
41
+ (t) => h.some((o) => o.toLowerCase() === t.formName.toLowerCase())
42
42
  )), e;
43
- }, [_, m, b]), { data: M = [] } = E({
43
+ }, [_, m, h]), { data: M = [] } = A({
44
44
  queryKey: ["observationForms"],
45
45
  queryFn: () => fe()
46
46
  }), S = d(
47
47
  (e) => {
48
- const s = M.find(
48
+ const t = M.find(
49
49
  (r) => r.name.toLowerCase() === e.toLowerCase()
50
50
  );
51
- if (!s?.privileges || s.privileges.length === 0) return !0;
52
- if (!h || h.length === 0) return !1;
53
- const t = new Set(h.map((r) => r.name));
54
- return s.privileges.some(
55
- (r) => t.has(r.privilegeName) && r.editable
51
+ if (!t?.privileges || t.privileges.length === 0) return !0;
52
+ if (!b || b.length === 0) return !1;
53
+ const o = new Set(b.map((r) => r.name));
54
+ return t.privileges.some(
55
+ (r) => o.has(r.privilegeName) && r.editable
56
56
  );
57
57
  },
58
- [M, h]
58
+ [M, b]
59
59
  ), u = d(
60
60
  (e) => !y || e.encounterUuid !== y ? !1 : S(e.formName),
61
61
  [y, S]
@@ -64,66 +64,66 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
64
64
  isLoading: Z,
65
65
  isError: ee,
66
66
  error: F
67
- } = E({
67
+ } = A({
68
68
  queryKey: ["formsEncounterFHIR", a?.encounterUuid],
69
69
  queryFn: () => ye(a.encounterUuid),
70
70
  enabled: !!a?.encounterUuid && g
71
71
  });
72
- be(
72
+ he(
73
73
  (e) => {
74
74
  e.patientUUID === c && (X(), Y.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
75
75
  },
76
76
  [c]
77
77
  );
78
- const re = i(() => !O?.entry || !a?.formName ? [] : O.entry.filter((s) => s.resource?.resourceType === "Observation").map((s) => s.resource).filter((s) => he(s) ? pe(s)?.toLowerCase() === a.formName.toLowerCase() : !0), [O, a?.formName]), se = i(() => {
78
+ const re = i(() => !O?.entry || !a?.formName ? [] : O.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => be(t) ? pe(t)?.toLowerCase() === a.formName.toLowerCase() : !0), [O, a?.formName]), te = i(() => {
79
79
  if (F)
80
80
  return ge(F).message;
81
81
  }, [F]), f = i(
82
82
  () => [
83
- { key: "recordedOn", header: o("RECORDED_ON") },
84
- { key: "recordedBy", header: o("RECORDED_BY") }
83
+ { key: "recordedOn", header: s("RECORDED_ON") },
84
+ { key: "recordedBy", header: s("RECORDED_BY") }
85
85
  ],
86
- [o]
86
+ [s]
87
87
  ), w = i(
88
- () => [...f, { key: "actions", header: o("ACTIONS") }],
89
- [f, o]
90
- ), te = d(
91
- (e) => N && e.some((t) => u(t)) ? w : f,
88
+ () => [...f, { key: "actions", header: s("ACTIONS") }],
89
+ [f, s]
90
+ ), oe = d(
91
+ (e) => N && e.some((o) => u(o)) ? w : f,
92
92
  [N, u, w, f]
93
- ), oe = f, ae = i(
93
+ ), se = f, ae = i(
94
94
  () => [
95
95
  { key: "recordedOn", sortable: !0 },
96
96
  { key: "recordedBy", sortable: !0 }
97
97
  ],
98
98
  []
99
- ), U = i(() => {
99
+ ), H = i(() => {
100
100
  const e = C.reduce(
101
- (t, r) => {
101
+ (o, r) => {
102
102
  const l = r.formName;
103
- t[l] ??= [];
103
+ o[l] ??= [];
104
104
  const T = r.providers.map((ne) => ne.providerName).filter(Boolean).join(", ");
105
- return t[l].push({
105
+ return o[l].push({
106
106
  id: r.encounterUuid,
107
107
  formName: r.formName,
108
- recordedOn: Ne(r.encounterDateTime, o, !0).formattedResult,
108
+ recordedOn: Ne(r.encounterDateTime, s, !0).formattedResult,
109
109
  recordedBy: T ?? "--",
110
110
  encounterDateTime: r.encounterDateTime,
111
111
  encounterUuid: r.encounterUuid
112
- }), t;
112
+ }), o;
113
113
  },
114
114
  {}
115
115
  );
116
116
  return Object.entries(e).map(
117
- ([t, r]) => ({
118
- formName: t,
117
+ ([o, r]) => ({
118
+ formName: o,
119
119
  records: r.sort(
120
120
  (l, T) => T.encounterDateTime - l.encounterDateTime
121
121
  )
122
122
  })
123
- ).sort((t, r) => t.formName.localeCompare(r.formName));
124
- }, [C, o]), H = d((e) => {
123
+ ).sort((o, r) => o.formName.localeCompare(r.formName));
124
+ }, [C, s]), k = d((e) => {
125
125
  R(e), v(!0);
126
- }, []), k = d(() => {
126
+ }, []), U = d(() => {
127
127
  v(!1), R(null);
128
128
  }, []), I = d((e) => {
129
129
  Oe({
@@ -134,93 +134,93 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
134
134
  },
135
135
  action: { type: "update", resourceType: "Observation" }
136
136
  });
137
- }, []), P = d(
138
- (e, s) => {
139
- switch (s) {
137
+ }, []), q = d(
138
+ (e, t) => {
139
+ switch (t) {
140
140
  case "recordedOn":
141
- return /* @__PURE__ */ n(Fe, { onClick: () => H(e), children: e.recordedOn });
141
+ return /* @__PURE__ */ n(Fe, { onClick: () => k(e), children: e.recordedOn });
142
142
  case "recordedBy":
143
143
  return e.recordedBy;
144
144
  case "actions":
145
145
  return u(e) ? /* @__PURE__ */ n(
146
- V,
146
+ x,
147
147
  {
148
- label: o("EDIT_OBSERVATION_FORM"),
148
+ label: s("EDIT_OBSERVATION_FORM"),
149
149
  kind: "ghost",
150
150
  size: "sm",
151
151
  testId: `edit-form-${e.encounterUuid}`,
152
152
  onClick: () => I(e),
153
- children: /* @__PURE__ */ n(x, {})
153
+ children: /* @__PURE__ */ n(V, {})
154
154
  }
155
155
  ) : null;
156
156
  default:
157
157
  return null;
158
158
  }
159
159
  },
160
- [H, I, u, o]
160
+ [k, I, u, s]
161
161
  );
162
- return /* @__PURE__ */ q(ie, { children: [
163
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || U.length === 0 || D ? /* @__PURE__ */ n(
162
+ return /* @__PURE__ */ P(ie, { children: [
163
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || H.length === 0 || D ? /* @__PURE__ */ n(
164
164
  G,
165
165
  {
166
- headers: oe,
167
- ariaLabel: o("FORMS_HEADING"),
166
+ headers: se,
167
+ ariaLabel: s("FORMS_HEADING"),
168
168
  rows: [],
169
169
  loading: L,
170
170
  errorStateMessage: B ? J?.message : void 0,
171
- emptyStateMessage: o("FORMS_UNAVAILABLE"),
172
- renderCell: P,
171
+ emptyStateMessage: s("FORMS_UNAVAILABLE"),
172
+ renderCell: q,
173
173
  className: p.formsTableBody,
174
174
  dataTestId: "forms-table"
175
175
  }
176
- ) : /* @__PURE__ */ n(Ie, { align: "start", children: U.map((e, s) => {
177
- const { formName: t, records: r } = e, l = te(r);
176
+ ) : /* @__PURE__ */ n(Ie, { align: "start", children: H.map((e, t) => {
177
+ const { formName: o, records: r } = e, l = oe(r);
178
178
  return /* @__PURE__ */ n(
179
179
  Te,
180
180
  {
181
- title: t,
181
+ title: o,
182
182
  className: p.customAccordianItem,
183
- testId: `accordian-title-${t}`,
184
- open: s === 0,
183
+ testId: `accordian-title-${o}`,
184
+ open: t === 0,
185
185
  children: /* @__PURE__ */ n(
186
186
  G,
187
187
  {
188
188
  headers: l,
189
- ariaLabel: o("FORMS_HEADING"),
189
+ ariaLabel: s("FORMS_HEADING"),
190
190
  rows: r,
191
191
  loading: !1,
192
192
  errorStateMessage: "",
193
193
  sortable: ae,
194
- emptyStateMessage: o("FORMS_UNAVAILABLE"),
195
- renderCell: P,
194
+ emptyStateMessage: s("FORMS_UNAVAILABLE"),
195
+ renderCell: q,
196
196
  className: p.formsTableBody,
197
- dataTestId: `forms-table-${t}`
197
+ dataTestId: `forms-table-${o}`
198
198
  }
199
199
  )
200
200
  },
201
- t
201
+ o
202
202
  );
203
203
  }) }) }),
204
204
  g && a && /* @__PURE__ */ n(
205
- Ee,
205
+ Ae,
206
206
  {
207
207
  id: "modalIdForActionAreaLayout",
208
208
  portalId: "main-display-area",
209
209
  open: g,
210
- onRequestClose: k,
211
- modalHeading: /* @__PURE__ */ q("div", { className: p.modalHeading, children: [
210
+ onRequestClose: U,
211
+ modalHeading: /* @__PURE__ */ P("div", { className: p.modalHeading, children: [
212
212
  /* @__PURE__ */ n("span", { children: a.formName }),
213
213
  N && u(a) && /* @__PURE__ */ n(
214
- V,
214
+ x,
215
215
  {
216
- label: o("EDIT_OBSERVATION_FORM"),
216
+ label: s("EDIT_OBSERVATION_FORM"),
217
217
  kind: "ghost",
218
218
  size: "sm",
219
219
  testId: `edit-form-modal-${a.encounterUuid}`,
220
220
  onClick: () => {
221
- k(), I(a);
221
+ U(), I(a);
222
222
  },
223
- children: /* @__PURE__ */ n(x, {})
223
+ children: /* @__PURE__ */ n(V, {})
224
224
  }
225
225
  )
226
226
  ] }),
@@ -229,13 +229,13 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
229
229
  size: "md",
230
230
  testId: "form-details-modal",
231
231
  children: /* @__PURE__ */ n(
232
- Ae,
232
+ Ee,
233
233
  {
234
234
  observations: re,
235
235
  isLoading: Z,
236
236
  isError: ee,
237
- errorMessage: se,
238
- emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
237
+ errorMessage: te,
238
+ emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
239
239
  testIdPrefix: a.formName,
240
240
  hideThumbnail: K,
241
241
  formName: a.formName
@@ -246,5 +246,5 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
246
246
  ] });
247
247
  };
248
248
  export {
249
- He as default
249
+ ke as default
250
250
  };
@@ -1,18 +1,18 @@
1
1
  import { jsx as i, jsxs as N } from "react/jsx-runtime";
2
- import { x as H, _ as U, y as z, Z as G, f as P, z as j, H as x, L as J, D as Z, u as Y, a as W, I as X, U as ee, J as se, K as te, s as re, M as ae, N as oe, P as ne, R as ie, S as ce, A as le } from "./index-CmbXgAAP.js";
2
+ import { z, _ as F, D as G, E as H, h as P, I as j, J, L as x, K as Y, u as W, a as X, M as Z, q as ee, N as se, P as te, o as re, R as ae, T as oe, U as ne, V as ie, S as ce, A as le } from "./index-BsguGr5X.js";
3
3
  import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
4
4
  import { useRef as pe, useEffect as C, useMemo as I } from "react";
5
- import { useTranslation as F } from "react-i18next";
6
- const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", fe = "Observations-module_secondary__14nuS", f = {
5
+ import { useTranslation as U } from "react-i18next";
6
+ const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", ye = "Observations-module_secondary__14nuS", y = {
7
7
  observations: me,
8
8
  title: be,
9
9
  wrapper: ve,
10
- secondary: fe
11
- }, w = (t, l, n, c, u, r) => {
12
- const a = z(t, l, u), e = a.value, p = G(e);
10
+ secondary: ye
11
+ }, V = (t, l, n, c, u, r) => {
12
+ const a = G(t, l, u), e = a.value, p = H(e);
13
13
  let o = e;
14
14
  p === "Image" && (o = /* @__PURE__ */ i(
15
- x,
15
+ J,
16
16
  {
17
17
  imageSrc: e,
18
18
  alt: e,
@@ -20,42 +20,42 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
20
20
  hideThumbnail: r
21
21
  }
22
22
  )), p === "Video" && (o = /* @__PURE__ */ i(
23
- J,
23
+ x,
24
24
  {
25
25
  id: `${e}-video`,
26
26
  videoSrc: e,
27
27
  hideThumbnail: r
28
28
  }
29
- )), p === "PDF" && (o = /* @__PURE__ */ i(Z, { id: `${e}-pdf`, src: e }));
30
- const m = /* @__PURE__ */ N("div", { className: f.wrapper, children: [
29
+ )), p === "PDF" && (o = /* @__PURE__ */ i(Y, { id: `${e}-pdf`, src: e }));
30
+ const m = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
31
31
  /* @__PURE__ */ i("span", { children: a.header.display }),
32
- a.header.referenceRange && /* @__PURE__ */ i("span", { className: f.secondary, children: a.header.referenceRange })
32
+ a.header.referenceRange && /* @__PURE__ */ i("span", { className: y.secondary, children: a.header.referenceRange })
33
33
  ] }), d = u("OBSERVATIONS_RECORDED_BY", {
34
34
  provider: a.provider
35
- }), b = t.effectiveDateTime ? P(t.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ N("div", { className: f.wrapper, children: [
35
+ }), b = t.effectiveDateTime ? P(t.effectiveDateTime, u, !0).formattedResult : void 0, g = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
36
36
  /* @__PURE__ */ i("span", { children: d }),
37
- b && /* @__PURE__ */ i("span", { className: f.secondary, children: b })
38
- ] }), v = t.display, g = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${g}-${v}-${n}-${l}` : `${g}-${v}-${n}-${l}`;
37
+ b && /* @__PURE__ */ i("span", { className: y.secondary, children: b })
38
+ ] }), v = t.display, _ = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${_}-${v}-${n}-${l}` : `${_}-${v}-${n}-${l}`;
39
39
  return /* @__PURE__ */ i(
40
40
  j,
41
41
  {
42
42
  header: m,
43
43
  value: o,
44
- info: _,
44
+ info: g,
45
45
  id: O,
46
46
  testId: O,
47
47
  ariaLabel: O
48
48
  },
49
49
  `obs-${t.id}`
50
50
  );
51
- }, ye = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
52
- U,
51
+ }, fe = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
52
+ F,
53
53
  {
54
54
  title: t.display,
55
55
  id: `grouped-obs-${t.display}-${c}`,
56
56
  open: n,
57
57
  children: t.members?.map(
58
- (e, p) => w(
58
+ (e, p) => V(
59
59
  e,
60
60
  p,
61
61
  u,
@@ -71,17 +71,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
71
71
  title: l = "",
72
72
  hideThumbnail: n
73
73
  }) => {
74
- const { t: c } = F(), u = (r, a, e) => {
75
- const p = H(r.encounterDetails, c);
74
+ const { t: c } = U(), u = (r, a, e) => {
75
+ const p = z(r.encounterDetails, c);
76
76
  return /* @__PURE__ */ N(
77
- U,
77
+ F,
78
78
  {
79
79
  title: p,
80
80
  id: `encounter-${r.encounterId}`,
81
81
  open: a,
82
82
  children: [
83
83
  r.observations.map(
84
- (o, m) => w(
84
+ (o, m) => V(
85
85
  o,
86
86
  m,
87
87
  e,
@@ -91,7 +91,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
91
91
  )
92
92
  ),
93
93
  r.groupedObservations.map(
94
- (o, m) => ye(
94
+ (o, m) => fe(
95
95
  o,
96
96
  c,
97
97
  a,
@@ -117,7 +117,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
117
117
  )
118
118
  }
119
119
  );
120
- }, Ee = (t) => ["conceptUuid", t], he = (t, l, n, c) => [
120
+ }, he = (t) => ["conceptUuid", t], Ee = (t, l, n, c) => [
121
121
  "observations",
122
122
  t,
123
123
  ...l,
@@ -133,10 +133,10 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
133
133
  conceptUuid: r = [],
134
134
  hideThumbnail: a = !1,
135
135
  scope: e = "all"
136
- } = c, p = pe(/* @__PURE__ */ new Set()), o = Y(), { addNotification: m } = W(), { t: d } = F(), b = de({
136
+ } = c, p = pe(/* @__PURE__ */ new Set()), o = W(), { addNotification: m } = X(), { t: d } = U(), b = de({
137
137
  queries: u.map((s) => ({
138
- queryKey: Ee(s),
139
- queryFn: () => X(s),
138
+ queryKey: he(s),
139
+ queryFn: () => Z(s),
140
140
  enabled: !!s
141
141
  }))
142
142
  });
@@ -148,22 +148,22 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
148
148
  type: "error"
149
149
  }), p.current.add(0)) : !s && R && p.current.clear();
150
150
  }, [b, m, d]);
151
- const _ = I(() => b.map((s) => s.data?.uuid).filter((s) => !!s), [b]), v = I(() => [.../* @__PURE__ */ new Set([..._, ...r])], [_, r]), y = I(() => u.length === 0 ? !0 : b.every((s) => !s.isLoading), [b, u.length]), g = e === "latest" || e === "latest-encounter", O = ee(
151
+ const g = I(() => b.map((s) => s.data?.uuid).filter((s) => !!s), [b]), v = I(() => [.../* @__PURE__ */ new Set([...g, ...r])], [g, r]), f = I(() => u.length === 0 ? !0 : b.every((s) => !s.isLoading), [b, u.length]), _ = e === "latest" || e === "latest-encounter", O = ee(
152
152
  l,
153
153
  n
154
154
  ), {
155
- data: E,
156
- isLoading: V,
155
+ data: h,
156
+ isLoading: w,
157
157
  isError: S,
158
158
  refetch: A
159
159
  } = ue({
160
- queryKey: he(
160
+ queryKey: Ee(
161
161
  o,
162
162
  v,
163
163
  n,
164
164
  e
165
165
  ),
166
- queryFn: () => g ? se(
166
+ queryFn: () => _ ? se(
167
167
  o,
168
168
  v,
169
169
  n
@@ -172,7 +172,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
172
172
  v,
173
173
  n
174
174
  ),
175
- enabled: !!o && v.length > 0 && y && !O
175
+ enabled: !!o && v.length > 0 && f && !O
176
176
  });
177
177
  re(
178
178
  (s) => {
@@ -189,39 +189,39 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
189
189
  });
190
190
  }, [S]);
191
191
  const D = I(() => {
192
- if (!E) return [];
193
- let s = ae(E);
192
+ if (!h) return [];
193
+ let s = ae(h);
194
194
  e === "latest-encounter" && (s = oe(s));
195
195
  const R = ne(s);
196
196
  return ie(R);
197
- }, [E, e]), K = [
197
+ }, [h, e]), K = [
198
198
  { key: "name", header: "name" },
199
199
  { key: "value", header: "value" },
200
200
  { key: "form", header: "form" }
201
- ], L = V || !y, B = S && y, M = (!E || E.entry?.length === 0 || v.length === 0) && y, Q = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, k = M ? d("NO_OBSERVATIONS_FOUND") : void 0, q = D.length > 0 && !L && !B, T = c.titleTranslationKey, h = T ? d(T) : "";
201
+ ], L = w || !f, B = S && f, M = (!h || h.entry?.length === 0 || v.length === 0) && f, q = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, Q = M ? d("NO_OBSERVATIONS_FOUND") : void 0, k = D.length > 0 && !L && !B, T = c.titleTranslationKey, E = T ? d(T) : "";
202
202
  return /* @__PURE__ */ N(
203
203
  "div",
204
204
  {
205
205
  id: "observations",
206
- "data-testid": T ? `observations-${h}` : "observations",
206
+ "data-testid": T ? `observations-${E}` : "observations",
207
207
  "aria-label": "observations-aria-label",
208
- className: f.observations,
208
+ className: y.observations,
209
209
  children: [
210
210
  /* @__PURE__ */ i(
211
211
  ce,
212
212
  {
213
213
  id: "observations-title",
214
- testId: T ? `observations-title-${h}` : "observations-title",
215
- title: h,
216
- className: f.title,
217
- children: /* @__PURE__ */ i("p", { children: h })
214
+ testId: T ? `observations-title-${E}` : "observations-title",
215
+ title: E,
216
+ className: y.title,
217
+ children: /* @__PURE__ */ i("p", { children: E })
218
218
  }
219
219
  ),
220
- q ? /* @__PURE__ */ i(
220
+ k ? /* @__PURE__ */ i(
221
221
  Oe,
222
222
  {
223
223
  groupedData: D,
224
- title: h,
224
+ title: E,
225
225
  hideThumbnail: a
226
226
  }
227
227
  ) : /* @__PURE__ */ i(
@@ -231,8 +231,8 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
231
231
  rows: [],
232
232
  ariaLabel: d("OBSERVATIONS"),
233
233
  loading: L,
234
- errorStateMessage: Q,
235
- emptyStateMessage: k ?? d("NO_OBSERVATIONS_AVAILABLE"),
234
+ errorStateMessage: q,
235
+ emptyStateMessage: Q ?? d("NO_OBSERVATIONS_AVAILABLE"),
236
236
  dataTestId: "observations-table"
237
237
  }
238
238
  )
@@ -241,7 +241,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
241
241
  );
242
242
  };
243
243
  export {
244
- Ee as conceptUuidQueryKeys,
244
+ he as conceptUuidQueryKeys,
245
245
  Ne as default,
246
- he as observationsQueryKeys
246
+ Ee as observationsQueryKeys
247
247
  };