@bahmni/reports-app 0.0.1-dev.441 → 0.0.1-dev.443

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