@bahmni/appointments-app 0.0.1-dev.215 → 0.0.1-dev.216

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,53 +1,53 @@
1
- import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { c as V, e as w, u as N, o as x, q as K, a as M, w as P, l as Q, r as z, E as G, y as H, x as j, t as Y, v as q, z as Z, f as J, A as W, k as X, P as ee, B as ae, C as te } from "./index-CU8j8cbs.js";
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 A, M as J, R as W, A as X, o as Z, r as ee, s as ae, t as te } from "./index-B1RcPdJt.js";
3
3
  import { useRef as se, useEffect as $, useMemo as R } from "react";
4
- const A = (a, o, d, l, b, r) => {
5
- const t = Z(a, o, b), s = t.value, i = J(s);
6
- let n = s;
7
- i === "Image" && (n = /* @__PURE__ */ u(
8
- X,
4
+ const U = (a, n, d, l, c, r) => {
5
+ const t = J(a, n, c), s = t.value, i = W(s);
6
+ let o = s;
7
+ i === "Image" && (o = /* @__PURE__ */ u(
8
+ Z,
9
9
  {
10
10
  imageSrc: s,
11
11
  alt: s,
12
12
  id: `${s}-img`,
13
13
  hideThumbnail: r
14
14
  }
15
- )), i === "Video" && (n = /* @__PURE__ */ u(
15
+ )), i === "Video" && (o = /* @__PURE__ */ u(
16
16
  ee,
17
17
  {
18
18
  id: `${s}-video`,
19
19
  videoSrc: s,
20
20
  hideThumbnail: r
21
21
  }
22
- )), i === "PDF" && (n = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
23
- const p = b("OBSERVATIONS_RECORDED_BY", {
22
+ )), i === "PDF" && (o = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
23
+ const p = c("OBSERVATIONS_RECORDED_BY", {
24
24
  provider: t.provider
25
- }), m = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${v}-${m}-${d}-${o}` : `${v}-${m}-${d}-${o}`;
25
+ }), m = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", b = l ? `${l}-${v}-${m}-${d}-${n}` : `${v}-${m}-${d}-${n}`;
26
26
  return /* @__PURE__ */ u(
27
- W,
27
+ X,
28
28
  {
29
29
  header: t.header,
30
- value: n,
30
+ value: o,
31
31
  info: p,
32
- id: c,
33
- testId: c,
34
- ariaLabel: c
32
+ id: b,
33
+ testId: b,
34
+ ariaLabel: b
35
35
  },
36
36
  `obs-${a.id}`
37
37
  );
38
- }, re = (a, o, d, l, b, r, t) => /* @__PURE__ */ u(
39
- q,
38
+ }, re = (a, n, d, l, c, r, t) => /* @__PURE__ */ u(
39
+ A,
40
40
  {
41
41
  title: a.display,
42
42
  id: `grouped-obs-${a.display}-${l}`,
43
43
  open: d,
44
44
  children: a.members?.map(
45
- (s, i) => A(
45
+ (s, i) => U(
46
46
  s,
47
47
  i,
48
- b,
48
+ c,
49
49
  r,
50
- o,
50
+ n,
51
51
  t
52
52
  )
53
53
  )
@@ -55,36 +55,36 @@ const A = (a, o, d, l, b, r) => {
55
55
  `grouped-obs-${a.id}`
56
56
  ), ie = ({
57
57
  groupedData: a,
58
- title: o = "",
58
+ title: n = "",
59
59
  hideThumbnail: d
60
60
  }) => {
61
- const { t: l } = N(), b = (r, t, s) => {
61
+ const { t: l } = S(), c = (r, t, s) => {
62
62
  const i = Y(r.encounterDetails, l);
63
- return /* @__PURE__ */ S(
64
- q,
63
+ return /* @__PURE__ */ I(
64
+ A,
65
65
  {
66
66
  title: i,
67
67
  id: `encounter-${r.encounterId}`,
68
68
  open: t,
69
69
  children: [
70
70
  r.observations.map(
71
- (n, p) => A(
72
- n,
71
+ (o, p) => U(
72
+ o,
73
73
  p,
74
74
  s,
75
- o,
75
+ n,
76
76
  l,
77
77
  d
78
78
  )
79
79
  ),
80
80
  r.groupedObservations.map(
81
- (n, p) => re(
82
- n,
81
+ (o, p) => re(
82
+ o,
83
83
  l,
84
84
  t,
85
85
  p,
86
86
  s,
87
- o,
87
+ n,
88
88
  d
89
89
  )
90
90
  )
@@ -100,104 +100,104 @@ const A = (a, o, d, l, b, 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) => b(r, t === 0, t)
103
+ (r, t) => c(r, t === 0, t)
104
104
  )
105
105
  }
106
106
  );
107
- }, ne = "_observations_kfbhq_1", oe = "_title_kfbhq_12", I = {
108
- observations: ne,
109
- title: oe
110
- }, de = (a) => ["conceptUuid", a], le = (a, o) => ["observations", a, ...o], pe = ({ config: a }) => {
111
- const o = a, {
107
+ }, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", N = {
108
+ observations: oe,
109
+ title: ne
110
+ }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
111
+ const n = a, {
112
112
  conceptNames: d = [],
113
113
  conceptUuid: l = [],
114
- hideThumbnail: b = !1
115
- } = o, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = w(), { t: i } = N(), n = x({
114
+ hideThumbnail: c = !1
115
+ } = n, r = se(/* @__PURE__ */ new Set()), t = k(), { addNotification: s } = K(), { t: i } = S(), o = M({
116
116
  queries: d.map((e) => ({
117
117
  queryKey: de(e),
118
- queryFn: () => K(e),
118
+ queryFn: () => x(e),
119
119
  enabled: !!e
120
120
  }))
121
121
  });
122
122
  $(() => {
123
- n.forEach((e, h) => {
123
+ o.forEach((e, h) => {
124
124
  if (e.isError && !r.current.has(h)) {
125
- const U = d[h];
125
+ const B = d[h];
126
126
  s({
127
127
  title: i("ERROR_DEFAULT_TITLE"),
128
- message: i("ERROR_FETCHING_CONCEPT", { conceptName: U }),
128
+ message: i("ERROR_FETCHING_CONCEPT", { conceptName: B }),
129
129
  type: "error"
130
130
  }), r.current.add(h);
131
131
  } else e.isError || r.current.delete(h);
132
132
  });
133
- }, [n, d]);
134
- const p = R(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), v = R(() => d.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, d.length]), {
135
- data: c,
133
+ }, [o, d]);
134
+ const p = R(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), v = R(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
135
+ data: b,
136
136
  isLoading: D,
137
- isError: T,
138
- refetch: f
139
- } = M({
137
+ isError: g,
138
+ refetch: T
139
+ } = G({
140
140
  queryKey: le(t, m),
141
141
  queryFn: () => te(t, m),
142
142
  enabled: !!t && m.length > 0 && v
143
143
  });
144
- P(
144
+ Q(
145
145
  (e) => {
146
146
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
147
147
  (h) => m.includes(h)
148
- ) && f();
148
+ ) && T();
149
149
  },
150
- [t, f]
150
+ [t, T]
151
151
  ), $(() => {
152
- T && s({
152
+ g && s({
153
153
  title: i("ERROR_DEFAULT_TITLE"),
154
154
  message: i("ERROR_FETCHING_OBSERVATIONS"),
155
155
  type: "error"
156
156
  });
157
- }, [T]);
158
- const g = R(() => {
159
- if (!c) return [];
160
- const e = Q(c), h = z(e);
161
- return G(h);
162
- }, [c]), F = [
157
+ }, [g]);
158
+ const f = R(() => {
159
+ if (!b) return [];
160
+ const e = w(b), h = z(e);
161
+ return H(h);
162
+ }, [b]), F = [
163
163
  { key: "name", header: "name" },
164
164
  { key: "value", header: "value" },
165
165
  { key: "form", header: "form" }
166
- ], O = D || !v, _ = T && v, B = (!c || c.entry?.length === 0 || m.length === 0) && v, C = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, L = B ? i("NO_OBSERVATIONS_FOUND") : void 0, k = g.length > 0 && !O && !_, E = o.titleTranslationKey, y = E ? i(E) : "";
167
- return /* @__PURE__ */ S(
166
+ ], O = D || !v, _ = g && v, q = (!b || b.entry?.length === 0 || m.length === 0) && v, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, C = q ? i("NO_OBSERVATIONS_FOUND") : void 0, V = f.length > 0 && !O && !_, E = n.titleTranslationKey, y = E ? i(E) : "";
167
+ return /* @__PURE__ */ I(
168
168
  "div",
169
169
  {
170
170
  id: "observations",
171
171
  "data-testid": E ? `observations-${y}` : "observations",
172
172
  "aria-label": "observations-aria-label",
173
- className: I.observations,
173
+ className: N.observations,
174
174
  children: [
175
175
  /* @__PURE__ */ u(
176
- H,
176
+ j,
177
177
  {
178
178
  id: "observations-title",
179
179
  testId: E ? `observations-title-${y}` : "observations-title",
180
180
  title: y,
181
- className: I.title,
181
+ className: N.title,
182
182
  children: /* @__PURE__ */ u("p", { children: y })
183
183
  }
184
184
  ),
185
- k ? /* @__PURE__ */ u(
185
+ V ? /* @__PURE__ */ u(
186
186
  ie,
187
187
  {
188
- groupedData: g,
188
+ groupedData: f,
189
189
  title: y,
190
- hideThumbnail: b
190
+ hideThumbnail: c
191
191
  }
192
192
  ) : /* @__PURE__ */ u(
193
- j,
193
+ P,
194
194
  {
195
195
  headers: F,
196
196
  rows: [],
197
197
  ariaLabel: i("OBSERVATIONS"),
198
198
  loading: O,
199
- errorStateMessage: C,
200
- emptyStateMessage: L,
199
+ errorStateMessage: L,
200
+ emptyStateMessage: C,
201
201
  dataTestId: "observations-table"
202
202
  }
203
203
  )
@@ -1,4 +1,4 @@
1
- import { a1 as we, a2 as z, a3 as xt, a4 as B, $ as q, a0 as y, a5 as Ro, a6 as ye, a7 as R, a8 as _, a9 as k, aa as N, ab as A, ac as bs, ad as ir, ae as $e, af as G, ag as Hn, ah as Vn, ai as dt, aj as D, ak as xs, al as cn, am as Be, an as ws, ao as qt, ap as zt, aq as $s, ar as Cs, as as $n, at as Ss, au as Nr, av as Bt, aw as zo, ax as ks, ay as Es, az as j, aA as Gr, aB as Ms, aC as Ds, aD as sr, aE as As, aF as Ts, aG as zn, aH as Fs, aI as Is, aJ as Z, aK as Ps, aL as Ls } from "./index-CU8j8cbs.js";
1
+ import { $ as we, a0 as z, a1 as xt, a2 as B, Z as q, _ as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-B1RcPdJt.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {