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

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,10 +1,10 @@
1
1
  import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { c as w, e as V, u as N, r as x, t as K, a as H, w as Q, s as j, v as G, y as M, z, x as P, A as Y, I as F, E as Z, o as J, F as W, g as X, i as ee, j as ae, H as te } from "./index-CYfTbWhQ.js";
3
- import { useRef as se, useEffect as $, useMemo as g } from "react";
4
- const A = (a, n, d, l, b, r) => {
5
- const t = Z(a, n, b), s = t.value, i = J(s);
6
- let o = s;
7
- i === "Image" && (o = /* @__PURE__ */ u(
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";
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
8
  X,
9
9
  {
10
10
  imageSrc: s,
@@ -12,22 +12,22 @@ const A = (a, n, d, l, b, r) => {
12
12
  id: `${s}-img`,
13
13
  hideThumbnail: r
14
14
  }
15
- )), i === "Video" && (o = /* @__PURE__ */ u(
15
+ )), i === "Video" && (n = /* @__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" && (o = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
22
+ )), i === "PDF" && (n = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
23
23
  const p = b("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}-${n}` : `${v}-${m}-${d}-${n}`;
25
+ }), m = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${v}-${m}-${d}-${o}` : `${v}-${m}-${d}-${o}`;
26
26
  return /* @__PURE__ */ u(
27
27
  W,
28
28
  {
29
29
  header: t.header,
30
- value: o,
30
+ value: n,
31
31
  info: p,
32
32
  id: c,
33
33
  testId: c,
@@ -35,8 +35,8 @@ const A = (a, n, d, l, b, r) => {
35
35
  },
36
36
  `obs-${a.id}`
37
37
  );
38
- }, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
39
- F,
38
+ }, re = (a, o, d, l, b, r, t) => /* @__PURE__ */ u(
39
+ q,
40
40
  {
41
41
  title: a.display,
42
42
  id: `grouped-obs-${a.display}-${l}`,
@@ -47,7 +47,7 @@ const A = (a, n, d, l, b, r) => {
47
47
  i,
48
48
  b,
49
49
  r,
50
- n,
50
+ o,
51
51
  t
52
52
  )
53
53
  )
@@ -55,36 +55,36 @@ const A = (a, n, d, l, b, r) => {
55
55
  `grouped-obs-${a.id}`
56
56
  ), ie = ({
57
57
  groupedData: a,
58
- title: n = "",
58
+ title: o = "",
59
59
  hideThumbnail: d
60
60
  }) => {
61
61
  const { t: l } = N(), b = (r, t, s) => {
62
62
  const i = Y(r.encounterDetails, l);
63
63
  return /* @__PURE__ */ S(
64
- F,
64
+ q,
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
- (o, p) => A(
72
- o,
71
+ (n, p) => A(
72
+ n,
73
73
  p,
74
74
  s,
75
- n,
75
+ o,
76
76
  l,
77
77
  d
78
78
  )
79
79
  ),
80
80
  r.groupedObservations.map(
81
- (o, p) => re(
82
- o,
81
+ (n, p) => re(
82
+ n,
83
83
  l,
84
84
  t,
85
85
  p,
86
86
  s,
87
- n,
87
+ o,
88
88
  d
89
89
  )
90
90
  )
@@ -104,15 +104,15 @@ const A = (a, n, d, l, b, r) => {
104
104
  )
105
105
  }
106
106
  );
107
- }, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
108
- observations: oe,
109
- title: ne
110
- }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
111
- const n = a, {
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, {
112
112
  conceptNames: d = [],
113
113
  conceptUuid: l = [],
114
114
  hideThumbnail: b = !1
115
- } = n, r = se(/* @__PURE__ */ new Set()), t = w(), { addNotification: s } = V(), { t: i } = N(), o = x({
115
+ } = o, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = w(), { t: i } = N(), n = x({
116
116
  queries: d.map((e) => ({
117
117
  queryKey: de(e),
118
118
  queryFn: () => K(e),
@@ -120,50 +120,50 @@ const A = (a, n, d, l, b, r) => {
120
120
  }))
121
121
  });
122
122
  $(() => {
123
- o.forEach((e, h) => {
123
+ n.forEach((e, h) => {
124
124
  if (e.isError && !r.current.has(h)) {
125
- const k = d[h];
125
+ const U = d[h];
126
126
  s({
127
127
  title: i("ERROR_DEFAULT_TITLE"),
128
- message: i("ERROR_FETCHING_CONCEPT", { conceptName: k }),
128
+ message: i("ERROR_FETCHING_CONCEPT", { conceptName: U }),
129
129
  type: "error"
130
130
  }), r.current.add(h);
131
131
  } else e.isError || r.current.delete(h);
132
132
  });
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]), {
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
135
  data: c,
136
136
  isLoading: D,
137
- isError: R,
138
- refetch: T
139
- } = H({
137
+ isError: T,
138
+ refetch: f
139
+ } = M({
140
140
  queryKey: le(t, m),
141
141
  queryFn: () => te(t, m),
142
142
  enabled: !!t && m.length > 0 && v
143
143
  });
144
- Q(
144
+ P(
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]
150
+ [t, f]
151
151
  ), $(() => {
152
- R && s({
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 f = g(() => {
157
+ }, [T]);
158
+ const g = R(() => {
159
159
  if (!c) return [];
160
- const e = j(c), h = G(e);
161
- return M(h);
162
- }, [c]), q = [
160
+ const e = Q(c), h = z(e);
161
+ return G(h);
162
+ }, [c]), F = [
163
163
  { key: "name", header: "name" },
164
164
  { key: "value", header: "value" },
165
165
  { key: "form", header: "form" }
166
- ], O = D || !v, _ = R && v, L = (!c || c.entry?.length === 0 || m.length === 0) && v, B = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, C = L ? i("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !O && !_, E = n.titleTranslationKey, y = E ? i(E) : "";
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
167
  return /* @__PURE__ */ S(
168
168
  "div",
169
169
  {
@@ -173,7 +173,7 @@ const A = (a, n, d, l, b, r) => {
173
173
  className: I.observations,
174
174
  children: [
175
175
  /* @__PURE__ */ u(
176
- z,
176
+ H,
177
177
  {
178
178
  id: "observations-title",
179
179
  testId: E ? `observations-title-${y}` : "observations-title",
@@ -182,22 +182,22 @@ const A = (a, n, d, l, b, r) => {
182
182
  children: /* @__PURE__ */ u("p", { children: y })
183
183
  }
184
184
  ),
185
- U ? /* @__PURE__ */ u(
185
+ k ? /* @__PURE__ */ u(
186
186
  ie,
187
187
  {
188
- groupedData: f,
188
+ groupedData: g,
189
189
  title: y,
190
190
  hideThumbnail: b
191
191
  }
192
192
  ) : /* @__PURE__ */ u(
193
- P,
193
+ j,
194
194
  {
195
- headers: q,
195
+ headers: F,
196
196
  rows: [],
197
197
  ariaLabel: i("OBSERVATIONS"),
198
198
  loading: O,
199
- errorStateMessage: B,
200
- emptyStateMessage: C,
199
+ errorStateMessage: C,
200
+ emptyStateMessage: L,
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-CYfTbWhQ.js";
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";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {