@bahmni/appointments-app 0.0.1-dev.217 → 0.0.1-dev.220

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,6 +1,6 @@
1
- import { jsx as r, jsxs as h, Fragment as Y } from "react/jsx-runtime";
2
- import { u as K, a as Q, e as W, b as J, E as X, T as Z, h as ee, c as te, y as ae } from "./index-B7yw-zcZ.js";
3
- import { useState as l, useCallback as p, useEffect as f, useMemo as T } from "react";
1
+ import { jsx as r, jsxs as p, Fragment as Y } from "react/jsx-runtime";
2
+ import { t as K, u as Q, r as W, a as J, M as X, N as Z, o as ee, s as te, b as ae } from "./index-CWBmCK15.js";
3
+ import { useState as l, useCallback as h, useEffect as f, useMemo as T } from "react";
4
4
  const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", le = "_documentImage_1voj8_50", d = {
5
5
  documentsTableBody: ne,
6
6
  viewAttachmentsLink: oe,
@@ -20,10 +20,10 @@ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11",
20
20
  function j(a) {
21
21
  return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
22
22
  }
23
- function ue(a, E) {
23
+ function ue(a, g) {
24
24
  return a.map((s) => ({
25
25
  key: s,
26
- header: E(me[s])
26
+ header: g(me[s])
27
27
  }));
28
28
  }
29
29
  const _e = [
@@ -32,44 +32,44 @@ const _e = [
32
32
  "uploadedOn",
33
33
  "uploadedBy",
34
34
  "action"
35
- ], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], ge = ({ config: a, encounterUuids: E }) => {
36
- const [s, w] = l(!1), [o, L] = l(
35
+ ], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ee = ({ config: a, encounterUuids: g }) => {
36
+ const [s, w] = l(!1), [o, M] = l(
37
37
  null
38
38
  ), [R, I] = l(
39
39
  /* @__PURE__ */ new Set()
40
- ), g = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, y] = l(1), [m, k] = l($), [V, A] = l(void 0), b = p((e) => {
41
- L(e), w(!0);
42
- }, []), F = p(() => {
43
- w(!1), L(null), I(/* @__PURE__ */ new Set());
44
- }, []), M = p((e) => {
40
+ ), E = K(), { t: n } = Q(), { addNotification: L } = W(), $ = Number(a?.pageSize) || 5, [C, A] = l(1), [m, k] = l($), [V, y] = l(void 0), U = h((e) => {
41
+ M(e), w(!0);
42
+ }, []), F = h(() => {
43
+ w(!1), M(null), I(/* @__PURE__ */ new Set());
44
+ }, []), b = h((e) => {
45
45
  I((t) => new Set(t).add(e));
46
46
  }, []), { data: u, isLoading: H, isError: D, error: v } = J({
47
47
  queryKey: [
48
48
  "documents",
49
- g,
50
49
  E,
50
+ g,
51
51
  C,
52
52
  m
53
53
  ],
54
- enabled: !!g,
54
+ enabled: !!E,
55
55
  queryFn: () => ae(
56
- g,
57
56
  E,
57
+ g,
58
58
  m,
59
59
  C
60
60
  )
61
61
  });
62
62
  f(() => {
63
- u && A(u.total);
63
+ u && y(u.total);
64
64
  }, [u]), f(() => {
65
- y(1), A(void 0);
66
- }, [g]), f(() => {
67
- D && U({
65
+ A(1), y(void 0);
66
+ }, [E]), f(() => {
67
+ D && L({
68
68
  title: n("ERROR_DEFAULT_TITLE"),
69
69
  message: v?.message ?? "",
70
70
  type: "error"
71
71
  });
72
- }, [D, v, U, n]), f(() => {
72
+ }, [D, v, L, n]), f(() => {
73
73
  const e = new AbortController();
74
74
  return (async () => {
75
75
  if (!s || !o) return;
@@ -88,9 +88,9 @@ const _e = [
88
88
  e.signal.aborted || I(t);
89
89
  })(), () => e.abort();
90
90
  }, [s, o]);
91
- const q = p(
91
+ const q = h(
92
92
  (e, t) => {
93
- t !== m ? (k(t), y(1), A(void 0)) : y(e);
93
+ t !== m ? (k(t), A(1), y(void 0)) : A(e);
94
94
  },
95
95
  [m]
96
96
  ), N = T(
@@ -105,7 +105,7 @@ const _e = [
105
105
  ), _ = T(
106
106
  () => o ? B(o) : [],
107
107
  [o]
108
- ), G = p(
108
+ ), G = h(
109
109
  (e, t) => {
110
110
  switch (t) {
111
111
  case "documentIdentifier":
@@ -124,7 +124,7 @@ const _e = [
124
124
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
125
125
  X,
126
126
  {
127
- onClick: () => b(e),
127
+ onClick: () => U(e),
128
128
  className: d.viewAttachmentsLink,
129
129
  "data-testid": `view-attachments-${e.id}`,
130
130
  children: n("DOCUMENTS_VIEW_ATTACHMENTS")
@@ -134,9 +134,9 @@ const _e = [
134
134
  return null;
135
135
  }
136
136
  },
137
- [b, n]
137
+ [U, n]
138
138
  );
139
- return /* @__PURE__ */ h(Y, { children: [
139
+ return /* @__PURE__ */ p(Y, { children: [
140
140
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
141
141
  ee,
142
142
  {
@@ -168,14 +168,14 @@ const _e = [
168
168
  size: "lg",
169
169
  testId: "document-view-modal",
170
170
  children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: _.map((e, t) => {
171
- const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), O = R.has(t);
172
- return c === "#" || O ? /* @__PURE__ */ h(
171
+ const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), O = R.has(t);
172
+ return c === "#" || O ? /* @__PURE__ */ p(
173
173
  "div",
174
174
  {
175
175
  className: d.attachmentError,
176
176
  "data-testid": `attachment-error-${t}`,
177
177
  children: [
178
- _.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
178
+ _.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
179
179
  t + 1,
180
180
  "/",
181
181
  _.length
@@ -184,13 +184,13 @@ const _e = [
184
184
  ]
185
185
  },
186
186
  `${o.id}-${e.url}`
187
- ) : /* @__PURE__ */ h(
187
+ ) : /* @__PURE__ */ p(
188
188
  "div",
189
189
  {
190
190
  className: d.attachmentItem,
191
191
  "data-testid": `attachment-item-${t}`,
192
192
  children: [
193
- _.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
193
+ _.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
194
194
  t + 1,
195
195
  "/",
196
196
  _.length
@@ -201,7 +201,7 @@ const _e = [
201
201
  src: c,
202
202
  alt: o.documentIdentifier,
203
203
  className: d.documentImage,
204
- onError: () => M(t)
204
+ onError: () => b(t)
205
205
  }
206
206
  ) : /* @__PURE__ */ r(
207
207
  "iframe",
@@ -209,7 +209,7 @@ const _e = [
209
209
  src: i ? `${c}#toolbar=0` : c,
210
210
  className: d.documentIframe,
211
211
  title: o.documentIdentifier,
212
- onError: () => M(t)
212
+ onError: () => b(t)
213
213
  }
214
214
  )
215
215
  ]
@@ -222,5 +222,5 @@ const _e = [
222
222
  ] });
223
223
  };
224
224
  export {
225
- ge as default
225
+ Ee as default
226
226
  };
@@ -1,53 +1,53 @@
1
- import { jsx as o, jsxs as J, Fragment as W } from "react/jsx-runtime";
2
- import { a as Z, u as ee, d as re, f as ae, b as c, g as te, V as R, T as se, E as oe, h as q, q as ne, U as de, c as ie, L as ue, i as me, j as le, k as ce, v as fe, w as ye } from "./index-B7yw-zcZ.js";
3
- import { useState as C, useMemo as d, useCallback as f } from "react";
4
- const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
1
+ import { jsx as o, jsxs as Y, Fragment as Z } from "react/jsx-runtime";
2
+ import { u as W, t as ee, m as re, c as ae, a as c, k as te, V as U, N as se, M as oe, o as C, G as ne, J as de, s as ie, Z as ue, d as me, e as le, X as ce, f as fe, Q as ye } from "./index-CWBmCK15.js";
3
+ import { useState as S, useMemo as d, useCallback as f } from "react";
4
+ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", I = {
5
5
  formsTableBody: be,
6
- customAccordianItem: ge
7
- }, he = (u) => u ? u.extension?.find(
6
+ customAccordianItem: Ne
7
+ }, pe = (u) => u ? u.extension?.find(
8
8
  (n) => n.url === me
9
9
  )?.valueString : void 0, Oe = ({
10
10
  episodeOfCareUuids: u,
11
11
  encounterUuids: n,
12
- config: S
12
+ config: q
13
13
  }) => {
14
- const { t: s } = Z(), m = ee(), [l, O] = C(!1), [t, E] = C(null), { numberOfVisits: k, hideThumbnail: V = !1 } = S ?? {}, I = re(
14
+ const { t: s } = W(), m = ee(), [l, O] = S(!1), [t, A] = S(null), { numberOfVisits: k, hideThumbnail: V = !1 } = q ?? {}, M = re(
15
15
  u,
16
16
  n
17
- ), j = ae(), {
17
+ ), G = ae(), {
18
18
  data: y = [],
19
19
  isLoading: T,
20
- isError: L,
21
- error: w,
22
- refetch: H
20
+ isError: B,
21
+ error: H,
22
+ refetch: K
23
23
  } = c({
24
24
  queryKey: ["forms", m, u],
25
25
  queryFn: () => le(m, void 0, k),
26
- enabled: !!m && !I
27
- }), B = d(() => !n || n.length === 0 ? y : y.filter(
26
+ enabled: !!m && !M
27
+ }), E = d(() => !n || n.length === 0 ? y : y.filter(
28
28
  (e) => n.includes(e.encounterUuid)
29
29
  ), [y, n]), { data: _ = [] } = c({
30
30
  queryKey: ["observationForms"],
31
31
  queryFn: () => ce()
32
- }), v = f(
32
+ }), F = f(
33
33
  (e) => _.find((r) => r.name === e)?.uuid,
34
34
  [_]
35
35
  ), b = d(() => {
36
36
  if (t)
37
- return v(t.formName);
38
- }, [t, v]), {
39
- isLoading: K,
40
- isError: x,
41
- error: g
37
+ return F(t.formName);
38
+ }, [t, F]), {
39
+ isLoading: Q,
40
+ isError: j,
41
+ error: N
42
42
  } = c({
43
43
  queryKey: ["formMetadata", b],
44
44
  queryFn: () => fe(b),
45
45
  enabled: !!b && l
46
46
  }), {
47
- data: h,
48
- isLoading: $,
49
- isError: Q,
50
- error: p
47
+ data: p,
48
+ isLoading: x,
49
+ isError: $,
50
+ error: g
51
51
  } = c({
52
52
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
53
53
  queryFn: () => ye(t.encounterUuid),
@@ -55,41 +55,41 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
55
55
  });
56
56
  te(
57
57
  (e) => {
58
- e.patientUUID === m && e.updatedConcepts.size > 0 && (H(), j.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
58
+ e.patientUUID === m && e.updatedConcepts.size > 0 && (K(), G.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
59
59
  },
60
60
  [m]
61
61
  );
62
- const z = d(() => !h?.entry || !t?.formName ? [] : h.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
63
- const r = he(e);
62
+ const w = d(() => !p?.entry || !t?.formName ? [] : p.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
63
+ const r = pe(e);
64
64
  return !r || r.includes(t.formName);
65
- }), [h, t?.formName]), G = d(() => {
65
+ }), [p, t?.formName]), z = d(() => {
66
+ if (N)
67
+ return U(N).message;
66
68
  if (g)
67
- return R(g).message;
68
- if (p)
69
- return R(p).message;
70
- }, [g, p]), F = d(
69
+ return U(g).message;
70
+ }, [N, g]), L = d(
71
71
  () => [
72
72
  { key: "recordedOn", header: s("RECORDED_ON") },
73
73
  { key: "recordedBy", header: s("RECORDED_BY") }
74
74
  ],
75
75
  [s]
76
- ), P = d(
76
+ ), J = d(
77
77
  () => [
78
78
  { key: "recordedOn", sortable: !0 },
79
79
  { key: "recordedBy", sortable: !0 }
80
80
  ],
81
81
  []
82
- ), M = d(() => {
83
- const e = B.reduce(
82
+ ), D = d(() => {
83
+ const e = E.reduce(
84
84
  (r, a) => {
85
85
  const i = a.formName;
86
86
  r[i] ??= [];
87
- const N = a.providers.map((X) => X.providerName).filter(Boolean).join(", ");
87
+ const h = a.providers.map((X) => X.providerName).filter(Boolean).join(", ");
88
88
  return r[i].push({
89
89
  id: a.encounterUuid,
90
90
  formName: a.formName,
91
91
  recordedOn: se(a.encounterDateTime, s, !0).formattedResult,
92
- recordedBy: N ?? "--",
92
+ recordedBy: h ?? "--",
93
93
  encounterDateTime: a.encounterDateTime,
94
94
  encounterUuid: a.encounterUuid
95
95
  }), r;
@@ -100,62 +100,62 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
100
100
  ([r, a]) => ({
101
101
  formName: r,
102
102
  records: a.sort(
103
- (i, N) => N.encounterDateTime - i.encounterDateTime
103
+ (i, h) => h.encounterDateTime - i.encounterDateTime
104
104
  )
105
105
  })
106
106
  ).sort((r, a) => r.formName.localeCompare(a.formName));
107
- }, [B, s]), U = f((e) => {
108
- E(e), O(!0);
109
- }, []), Y = f(() => {
110
- O(!1), E(null);
111
- }, []), D = f(
107
+ }, [E, s]), R = f((e) => {
108
+ A(e), O(!0);
109
+ }, []), P = f(() => {
110
+ O(!1), A(null);
111
+ }, []), v = f(
112
112
  (e, r) => {
113
113
  switch (r) {
114
114
  case "recordedOn":
115
- return /* @__PURE__ */ o(oe, { onClick: () => U(e), children: e.recordedOn });
115
+ return /* @__PURE__ */ o(oe, { onClick: () => R(e), children: e.recordedOn });
116
116
  case "recordedBy":
117
117
  return e.recordedBy;
118
118
  default:
119
119
  return null;
120
120
  }
121
121
  },
122
- [U]
122
+ [R]
123
123
  );
124
- return /* @__PURE__ */ J(W, { children: [
125
- /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: T || L || M.length === 0 || I ? /* @__PURE__ */ o(
126
- q,
124
+ return /* @__PURE__ */ Y(Z, { children: [
125
+ /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: T || B || D.length === 0 || M ? /* @__PURE__ */ o(
126
+ C,
127
127
  {
128
- headers: F,
128
+ headers: L,
129
129
  ariaLabel: s("FORMS_HEADING"),
130
130
  rows: [],
131
131
  loading: T,
132
- errorStateMessage: L ? w?.message : void 0,
132
+ errorStateMessage: B ? H?.message : void 0,
133
133
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
134
- renderCell: D,
135
- className: A.formsTableBody,
134
+ renderCell: v,
135
+ className: I.formsTableBody,
136
136
  dataTestId: "forms-table"
137
137
  }
138
- ) : /* @__PURE__ */ o(ne, { align: "start", children: M.map((e, r) => {
138
+ ) : /* @__PURE__ */ o(ne, { align: "start", children: D.map((e, r) => {
139
139
  const { formName: a, records: i } = e;
140
140
  return /* @__PURE__ */ o(
141
141
  de,
142
142
  {
143
143
  title: a,
144
- className: A.customAccordianItem,
144
+ className: I.customAccordianItem,
145
145
  testId: `accordian-title-${a}`,
146
146
  open: r === 0,
147
147
  children: /* @__PURE__ */ o(
148
- q,
148
+ C,
149
149
  {
150
- headers: F,
150
+ headers: L,
151
151
  ariaLabel: s("FORMS_HEADING"),
152
152
  rows: i,
153
153
  loading: !1,
154
154
  errorStateMessage: "",
155
- sortable: P,
155
+ sortable: J,
156
156
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
157
- renderCell: D,
158
- className: A.formsTableBody,
157
+ renderCell: v,
158
+ className: I.formsTableBody,
159
159
  dataTestId: `forms-table-${a}`
160
160
  }
161
161
  )
@@ -169,7 +169,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
169
169
  id: "modalIdForActionAreaLayout",
170
170
  portalId: "main-display-area",
171
171
  open: l,
172
- onRequestClose: Y,
172
+ onRequestClose: P,
173
173
  modalHeading: t.formName,
174
174
  modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
175
175
  passiveModal: !0,
@@ -178,10 +178,10 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
178
178
  children: /* @__PURE__ */ o(
179
179
  ue,
180
180
  {
181
- observations: z,
182
- isLoading: K || $,
183
- isError: x || Q,
184
- errorMessage: G,
181
+ observations: w,
182
+ isLoading: Q || x,
183
+ isError: j || $,
184
+ errorMessage: z,
185
185
  emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
186
186
  testIdPrefix: t.formName,
187
187
  hideThumbnail: V
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-D8cIIvPg.js";
2
- import { W as d, X as f, Y as e } from "./index-B7yw-zcZ.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CD6oYRfl.js";
2
+ import { T as d, U as f, _ as e } from "./index-CWBmCK15.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-D8cIIvPg.js";
2
- import { W as v, X as C, Y as e } from "./index-B7yw-zcZ.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-CD6oYRfl.js";
2
+ import { T as v, U as C, _ as e } from "./index-CWBmCK15.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,8 +1,8 @@
1
- import { jsxs as I, jsx as u } from "react/jsx-runtime";
2
- import { u as k, e as K, a as S, l as M, p as x, b as G, g as Q, x as w, z, N as H, m as j, h as P, n as Y, G as U, M as J, $ as W, _ as X, t as Z, o as ee, r as ae, s as te } from "./index-B7yw-zcZ.js";
3
- import { useRef as se, useEffect as O, useMemo as g } from "react";
4
- const D = (a, n, d, l, c, r) => {
5
- const t = J(a, n, c), s = t.value, i = W(s);
1
+ import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
+ import { t as B, r as K, u as S, g as G, Y as w, a as x, k as M, h as Q, l as j, i as H, j as Y, o as P, n as z, O as U, p as J, q as W, I as X, v as Z, w as ee, x as ae, y as te } from "./index-CWBmCK15.js";
3
+ import { useRef as se, useEffect as $, useMemo as R } from "react";
4
+ const D = (a, n, d, l, b, r) => {
5
+ const t = J(a, n, b), s = t.value, i = W(s);
6
6
  let o = s;
7
7
  i === "Image" && (o = /* @__PURE__ */ u(
8
8
  Z,
@@ -20,22 +20,22 @@ const D = (a, n, d, l, c, r) => {
20
20
  hideThumbnail: r
21
21
  }
22
22
  )), i === "PDF" && (o = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
23
- const p = c("OBSERVATIONS_RECORDED_BY", {
23
+ const p = b("OBSERVATIONS_RECORDED_BY", {
24
24
  provider: t.provider
25
- }), m = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", b = l ? `${l}-${v}-${m}-${d}-${n}` : `${v}-${m}-${d}-${n}`;
25
+ }), m = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${m}-${d}-${n}` : `${y}-${m}-${d}-${n}`;
26
26
  return /* @__PURE__ */ u(
27
27
  X,
28
28
  {
29
29
  header: t.header,
30
30
  value: o,
31
31
  info: p,
32
- id: b,
33
- testId: b,
34
- ariaLabel: b
32
+ id: c,
33
+ testId: c,
34
+ ariaLabel: c
35
35
  },
36
36
  `obs-${a.id}`
37
37
  );
38
- }, re = (a, n, d, l, c, r, t) => /* @__PURE__ */ u(
38
+ }, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
39
39
  U,
40
40
  {
41
41
  title: a.display,
@@ -45,7 +45,7 @@ const D = (a, n, d, l, c, r) => {
45
45
  (s, i) => D(
46
46
  s,
47
47
  i,
48
- c,
48
+ b,
49
49
  r,
50
50
  n,
51
51
  t
@@ -58,9 +58,9 @@ const D = (a, n, d, l, c, r) => {
58
58
  title: n = "",
59
59
  hideThumbnail: d
60
60
  }) => {
61
- const { t: l } = S(), c = (r, t, s) => {
62
- const i = Y(r.encounterDetails, l);
63
- return /* @__PURE__ */ I(
61
+ const { t: l } = S(), b = (r, t, s) => {
62
+ const i = z(r.encounterDetails, l);
63
+ return /* @__PURE__ */ N(
64
64
  U,
65
65
  {
66
66
  title: i,
@@ -100,94 +100,94 @@ const D = (a, n, d, l, c, r) => {
100
100
  "data-testid": "obs-by-encounter-test-id",
101
101
  "aria-label": "obs-by-encounter-aria-label",
102
102
  children: a.map(
103
- (r, t) => c(r, t === 0, t)
103
+ (r, t) => b(r, t === 0, t)
104
104
  )
105
105
  }
106
106
  );
107
- }, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", N = {
107
+ }, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
108
108
  observations: oe,
109
109
  title: ne
110
110
  }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
111
111
  const n = a, {
112
112
  conceptNames: d = [],
113
113
  conceptUuid: l = [],
114
- hideThumbnail: c = !1
115
- } = n, r = se(/* @__PURE__ */ new Set()), t = k(), { addNotification: s } = K(), { t: i } = S(), o = M({
114
+ hideThumbnail: b = !1
115
+ } = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } = K(), { t: i } = S(), o = G({
116
116
  queries: d.map((e) => ({
117
117
  queryKey: de(e),
118
- queryFn: () => x(e),
118
+ queryFn: () => w(e),
119
119
  enabled: !!e
120
120
  }))
121
121
  });
122
- O(() => {
122
+ $(() => {
123
123
  o.forEach((e, h) => {
124
124
  if (e.isError && !r.current.has(h)) {
125
- const B = d[h];
125
+ const V = d[h];
126
126
  s({
127
127
  title: i("ERROR_DEFAULT_TITLE"),
128
- message: i("ERROR_FETCHING_CONCEPT", { conceptName: B }),
128
+ message: i("ERROR_FETCHING_CONCEPT", { conceptName: V }),
129
129
  type: "error"
130
130
  }), r.current.add(h);
131
131
  } else e.isError || r.current.delete(h);
132
132
  });
133
133
  }, [o, d]);
134
- const p = g(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = g(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), v = g(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
135
- data: b,
134
+ const p = R(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = R(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
135
+ data: c,
136
136
  isLoading: F,
137
- isError: R,
138
- refetch: T
139
- } = G({
137
+ isError: T,
138
+ refetch: f
139
+ } = x({
140
140
  queryKey: le(t, m),
141
141
  queryFn: () => te(t, m),
142
- enabled: !!t && m.length > 0 && v
142
+ enabled: !!t && m.length > 0 && y
143
143
  });
144
- Q(
144
+ M(
145
145
  (e) => {
146
146
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
147
147
  (h) => m.includes(h)
148
- ) && T();
148
+ ) && f();
149
149
  },
150
- [t, T]
151
- ), O(() => {
152
- R && s({
150
+ [t, f]
151
+ ), $(() => {
152
+ T && s({
153
153
  title: i("ERROR_DEFAULT_TITLE"),
154
154
  message: i("ERROR_FETCHING_OBSERVATIONS"),
155
155
  type: "error"
156
156
  });
157
- }, [R]);
158
- const _ = g(() => {
159
- if (!b) return [];
160
- const e = w(b), h = z(e);
157
+ }, [T]);
158
+ const g = R(() => {
159
+ if (!c) return [];
160
+ const e = Q(c), h = j(e);
161
161
  return H(h);
162
- }, [b]), q = [
162
+ }, [c]), q = [
163
163
  { key: "name", header: "name" },
164
164
  { key: "value", header: "value" },
165
165
  { key: "form", header: "form" }
166
- ], $ = F || !v, f = R && v, A = (!b || b.entry?.length === 0 || m.length === 0) && v, L = f ? i("ERROR_FETCHING_OBSERVATIONS") : null, C = A ? i("NO_OBSERVATIONS_FOUND") : void 0, V = _.length > 0 && !$ && !f, E = n.titleTranslationKey, y = E ? i(E) : "";
167
- return /* @__PURE__ */ I(
166
+ ], O = F || !y, _ = T && y, A = (!c || c.entry?.length === 0 || m.length === 0) && y, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, k = A ? i("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? i(E) : "";
167
+ return /* @__PURE__ */ N(
168
168
  "div",
169
169
  {
170
170
  id: "observations",
171
- "data-testid": E ? `observations-${y}` : "observations",
171
+ "data-testid": E ? `observations-${v}` : "observations",
172
172
  "aria-label": "observations-aria-label",
173
- className: N.observations,
173
+ className: I.observations,
174
174
  children: [
175
175
  /* @__PURE__ */ u(
176
- j,
176
+ Y,
177
177
  {
178
178
  id: "observations-title",
179
- testId: E ? `observations-title-${y}` : "observations-title",
180
- title: y,
181
- className: N.title,
182
- children: /* @__PURE__ */ u("p", { children: y })
179
+ testId: E ? `observations-title-${v}` : "observations-title",
180
+ title: v,
181
+ className: I.title,
182
+ children: /* @__PURE__ */ u("p", { children: v })
183
183
  }
184
184
  ),
185
- V ? /* @__PURE__ */ u(
185
+ C ? /* @__PURE__ */ u(
186
186
  ie,
187
187
  {
188
- groupedData: _,
189
- title: y,
190
- hideThumbnail: c
188
+ groupedData: g,
189
+ title: v,
190
+ hideThumbnail: b
191
191
  }
192
192
  ) : /* @__PURE__ */ u(
193
193
  P,
@@ -195,9 +195,9 @@ const D = (a, n, d, l, c, r) => {
195
195
  headers: q,
196
196
  rows: [],
197
197
  ariaLabel: i("OBSERVATIONS"),
198
- loading: $,
198
+ loading: O,
199
199
  errorStateMessage: L,
200
- emptyStateMessage: C,
200
+ emptyStateMessage: k,
201
201
  dataTestId: "observations-table"
202
202
  }
203
203
  )