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

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 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";
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, V as ae } from "./index-BIUXeehZ.js";
3
3
  import { useState as l, useCallback as p, 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,
@@ -37,7 +37,7 @@ const _e = [
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) => {
40
+ ), g = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = l(1), [m, V] = l($), [k, y] = l(void 0), b = p((e) => {
41
41
  L(e), w(!0);
42
42
  }, []), F = p(() => {
43
43
  w(!1), L(null), I(/* @__PURE__ */ new Set());
@@ -60,9 +60,9 @@ const _e = [
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);
65
+ A(1), y(void 0);
66
66
  }, [g]), f(() => {
67
67
  D && U({
68
68
  title: n("ERROR_DEFAULT_TITLE"),
@@ -90,7 +90,7 @@ const _e = [
90
90
  }, [s, o]);
91
91
  const q = p(
92
92
  (e, t) => {
93
- t !== m ? (k(t), y(1), A(void 0)) : y(e);
93
+ t !== m ? (V(t), A(1), y(void 0)) : A(e);
94
94
  },
95
95
  [m]
96
96
  ), N = T(
@@ -151,7 +151,7 @@ const _e = [
151
151
  className: d.documentsTableBody,
152
152
  dataTestId: "documents-table",
153
153
  pageSize: m,
154
- totalItems: V,
154
+ totalItems: k,
155
155
  page: C,
156
156
  onPageChange: q
157
157
  }
@@ -1,6 +1,6 @@
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";
1
+ import { jsx as o, jsxs as W, Fragment as X } from "react/jsx-runtime";
2
+ import { a as Z, u as ee, d as re, f as ae, b as c, g as te, i as R, T as se, E as oe, h as q, q as ne, U as de, c as ie, L as ue, m as me, y as le, v as ce, j as fe, k as ye } from "./index-BIUXeehZ.js";
3
+ import { useState as S, useMemo as d, useCallback as f } from "react";
4
4
  const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
5
5
  formsTableBody: be,
6
6
  customAccordianItem: ge
@@ -9,17 +9,17 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
9
9
  )?.valueString : void 0, Oe = ({
10
10
  episodeOfCareUuids: u,
11
11
  encounterUuids: n,
12
- config: S
12
+ config: C
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 } = Z(), m = ee(), [l, O] = S(!1), [t, E] = S(null), { numberOfVisits: k, hideThumbnail: j = !1 } = C ?? {}, I = re(
15
15
  u,
16
16
  n
17
- ), j = ae(), {
17
+ ), H = ae(), {
18
18
  data: y = [],
19
19
  isLoading: T,
20
20
  isError: L,
21
- error: w,
22
- refetch: H
21
+ error: K,
22
+ refetch: V
23
23
  } = c({
24
24
  queryKey: ["forms", m, u],
25
25
  queryFn: () => le(m, void 0, k),
@@ -36,8 +36,8 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
36
36
  if (t)
37
37
  return v(t.formName);
38
38
  }, [t, v]), {
39
- isLoading: K,
40
- isError: x,
39
+ isLoading: x,
40
+ isError: $,
41
41
  error: g
42
42
  } = c({
43
43
  queryKey: ["formMetadata", b],
@@ -45,7 +45,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
45
45
  enabled: !!b && l
46
46
  }), {
47
47
  data: h,
48
- isLoading: $,
48
+ isLoading: w,
49
49
  isError: Q,
50
50
  error: p
51
51
  } = c({
@@ -55,7 +55,7 @@ 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 && (V(), H.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
59
59
  },
60
60
  [m]
61
61
  );
@@ -84,7 +84,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
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 N = a.providers.map((J) => J.providerName).filter(Boolean).join(", ");
88
88
  return r[i].push({
89
89
  id: a.encounterUuid,
90
90
  formName: a.formName,
@@ -121,7 +121,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
121
121
  },
122
122
  [U]
123
123
  );
124
- return /* @__PURE__ */ J(W, { children: [
124
+ return /* @__PURE__ */ W(X, { children: [
125
125
  /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: T || L || M.length === 0 || I ? /* @__PURE__ */ o(
126
126
  q,
127
127
  {
@@ -129,7 +129,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
129
129
  ariaLabel: s("FORMS_HEADING"),
130
130
  rows: [],
131
131
  loading: T,
132
- errorStateMessage: L ? w?.message : void 0,
132
+ errorStateMessage: L ? K?.message : void 0,
133
133
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
134
134
  renderCell: D,
135
135
  className: A.formsTableBody,
@@ -179,12 +179,12 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
179
179
  ue,
180
180
  {
181
181
  observations: z,
182
- isLoading: K || $,
183
- isError: x || Q,
182
+ isLoading: x || w,
183
+ isError: $ || Q,
184
184
  errorMessage: G,
185
185
  emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
186
186
  testIdPrefix: t.formName,
187
- hideThumbnail: V
187
+ hideThumbnail: j
188
188
  }
189
189
  )
190
190
  }
@@ -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-CmBNedrD.js";
2
+ import { Y as d, Z as f, _ as e } from "./index-BIUXeehZ.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-CmBNedrD.js";
2
+ import { Y as v, Z as C, _ as e } from "./index-BIUXeehZ.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,8 +1,8 @@
1
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);
2
+ import { u as k, e as K, a as N, l as M, n as w, b as x, g as Q, z, N as G, A as H, o as j, h as J, M as P, J as A, x as Y, S as W, C as X, r as Z, p as ee, s as ae, w as te } from "./index-BIUXeehZ.js";
3
+ import { useRef as se, useEffect as $, useMemo as f } from "react";
4
+ const U = (a, n, d, l, b, r) => {
5
+ const t = Y(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,32 +20,32 @@ 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(
39
- U,
38
+ }, re = (a, n, d, l, b, 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) => D(
45
+ (s, i) => U(
46
46
  s,
47
47
  i,
48
- c,
48
+ b,
49
49
  r,
50
50
  n,
51
51
  t
@@ -58,17 +58,17 @@ 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);
61
+ const { t: l } = N(), b = (r, t, s) => {
62
+ const i = P(r.encounterDetails, l);
63
63
  return /* @__PURE__ */ I(
64
- U,
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
- (o, p) => D(
71
+ (o, p) => U(
72
72
  o,
73
73
  p,
74
74
  s,
@@ -100,26 +100,26 @@ 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", S = {
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 = k(), { addNotification: s } = K(), { t: i } = N(), o = M({
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
125
  const B = d[h];
@@ -131,73 +131,73 @@ const D = (a, n, d, l, c, r) => {
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,
136
- isLoading: F,
137
- isError: R,
138
- refetch: T
139
- } = G({
134
+ const p = f(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = f(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = f(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
135
+ data: c,
136
+ isLoading: C,
137
+ isError: g,
138
+ refetch: R
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
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
- ) && T();
148
+ ) && R();
149
149
  },
150
- [t, T]
151
- ), O(() => {
152
- R && s({
150
+ [t, R]
151
+ ), $(() => {
152
+ g && 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
+ }, [g]);
158
+ const T = f(() => {
159
+ if (!c) return [];
160
+ const e = z(c), h = G(e);
161
161
  return H(h);
162
- }, [b]), q = [
162
+ }, [c]), D = [
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) : "";
166
+ ], O = C || !y, _ = g && y, F = (!c || c.entry?.length === 0 || m.length === 0) && y, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, V = F ? i("NO_OBSERVATIONS_FOUND") : void 0, q = T.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? i(E) : "";
167
167
  return /* @__PURE__ */ I(
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: S.observations,
174
174
  children: [
175
175
  /* @__PURE__ */ u(
176
176
  j,
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: S.title,
182
+ children: /* @__PURE__ */ u("p", { children: v })
183
183
  }
184
184
  ),
185
- V ? /* @__PURE__ */ u(
185
+ q ? /* @__PURE__ */ u(
186
186
  ie,
187
187
  {
188
- groupedData: _,
189
- title: y,
190
- hideThumbnail: c
188
+ groupedData: T,
189
+ title: v,
190
+ hideThumbnail: b
191
191
  }
192
192
  ) : /* @__PURE__ */ u(
193
- P,
193
+ J,
194
194
  {
195
- headers: q,
195
+ headers: D,
196
196
  rows: [],
197
197
  ariaLabel: i("OBSERVATIONS"),
198
- loading: $,
198
+ loading: O,
199
199
  errorStateMessage: L,
200
- emptyStateMessage: C,
200
+ emptyStateMessage: V,
201
201
  dataTestId: "observations-table"
202
202
  }
203
203
  )
@@ -1,4 +1,4 @@
1
- import { Z as we, a0 as z, a1 as xt, a2 as B, X as q, Y 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-B7yw-zcZ.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-BIUXeehZ.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {