@bahmni/home-app 0.0.1-dev.266 → 0.0.1-dev.268

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