@bahmni/appointments-app 0.0.1-dev.216 → 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-B1RcPdJt.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,43 +1,43 @@
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, O as ue, i as me, j as le, k as ce, v as fe, w as ye } from "./index-B1RcPdJt.js";
3
- import { useState as C, useMemo as d, useCallback as f } from "react";
4
- const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
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
+ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
5
5
  formsTableBody: be,
6
6
  customAccordianItem: ge
7
7
  }, he = (u) => u ? u.extension?.find(
8
8
  (n) => n.url === me
9
- )?.valueString : void 0, Ae = ({
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, A] = 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
- isError: B,
21
- error: w,
22
- refetch: H
20
+ isError: L,
21
+ error: K,
22
+ refetch: V
23
23
  } = c({
24
24
  queryKey: ["forms", m, u],
25
25
  queryFn: () => le(m, void 0, k),
26
26
  enabled: !!m && !I
27
- }), _ = d(() => !n || n.length === 0 ? y : y.filter(
27
+ }), B = d(() => !n || n.length === 0 ? y : y.filter(
28
28
  (e) => n.includes(e.encounterUuid)
29
- ), [y, n]), { data: v = [] } = c({
29
+ ), [y, n]), { data: _ = [] } = c({
30
30
  queryKey: ["observationForms"],
31
31
  queryFn: () => ce()
32
- }), F = f(
33
- (e) => v.find((r) => r.name === e)?.uuid,
34
- [v]
32
+ }), v = f(
33
+ (e) => _.find((r) => r.name === e)?.uuid,
34
+ [_]
35
35
  ), b = d(() => {
36
36
  if (t)
37
- return F(t.formName);
38
- }, [t, F]), {
39
- isLoading: K,
40
- isError: x,
37
+ return v(t.formName);
38
+ }, [t, v]), {
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", O = {
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", O = {
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
  );
@@ -67,7 +67,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
67
67
  return R(g).message;
68
68
  if (p)
69
69
  return R(p).message;
70
- }, [g, p]), L = d(
70
+ }, [g, p]), F = d(
71
71
  () => [
72
72
  { key: "recordedOn", header: s("RECORDED_ON") },
73
73
  { key: "recordedBy", header: s("RECORDED_BY") }
@@ -80,11 +80,11 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
80
80
  ],
81
81
  []
82
82
  ), M = d(() => {
83
- const e = _.reduce(
83
+ const e = B.reduce(
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,
@@ -104,10 +104,10 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
104
104
  )
105
105
  })
106
106
  ).sort((r, a) => r.formName.localeCompare(a.formName));
107
- }, [_, s]), U = f((e) => {
108
- E(e), A(!0);
107
+ }, [B, s]), U = f((e) => {
108
+ E(e), O(!0);
109
109
  }, []), Y = f(() => {
110
- A(!1), E(null);
110
+ O(!1), E(null);
111
111
  }, []), D = f(
112
112
  (e, r) => {
113
113
  switch (r) {
@@ -121,18 +121,18 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
121
121
  },
122
122
  [U]
123
123
  );
124
- return /* @__PURE__ */ J(W, { children: [
125
- /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: T || B || M.length === 0 || I ? /* @__PURE__ */ o(
124
+ return /* @__PURE__ */ W(X, { children: [
125
+ /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: T || L || M.length === 0 || I ? /* @__PURE__ */ o(
126
126
  q,
127
127
  {
128
- headers: L,
128
+ headers: F,
129
129
  ariaLabel: s("FORMS_HEADING"),
130
130
  rows: [],
131
131
  loading: T,
132
- errorStateMessage: B ? w?.message : void 0,
132
+ errorStateMessage: L ? K?.message : void 0,
133
133
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
134
134
  renderCell: D,
135
- className: O.formsTableBody,
135
+ className: A.formsTableBody,
136
136
  dataTestId: "forms-table"
137
137
  }
138
138
  ) : /* @__PURE__ */ o(ne, { align: "start", children: M.map((e, r) => {
@@ -141,13 +141,13 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
141
141
  de,
142
142
  {
143
143
  title: a,
144
- className: O.customAccordianItem,
144
+ className: A.customAccordianItem,
145
145
  testId: `accordian-title-${a}`,
146
146
  open: r === 0,
147
147
  children: /* @__PURE__ */ o(
148
148
  q,
149
149
  {
150
- headers: L,
150
+ headers: F,
151
151
  ariaLabel: s("FORMS_HEADING"),
152
152
  rows: i,
153
153
  loading: !1,
@@ -155,7 +155,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
155
155
  sortable: P,
156
156
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
157
157
  renderCell: D,
158
- className: O.formsTableBody,
158
+ className: A.formsTableBody,
159
159
  dataTestId: `forms-table-${a}`
160
160
  }
161
161
  )
@@ -179,12 +179,12 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
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
  }
@@ -192,5 +192,5 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
192
192
  ] });
193
193
  };
194
194
  export {
195
- Ae as default
195
+ Oe as default
196
196
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-B-ZpyorD.js";
2
- import { Y as d, Z as f, _ as e } from "./index-B1RcPdJt.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-B-ZpyorD.js";
2
- import { Y as v, Z as C, _ as e } from "./index-B1RcPdJt.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 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
- import { useRef as se, useEffect as $, useMemo as R } from "react";
4
- const U = (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,22 +20,22 @@ const U = (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(
38
+ }, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
39
39
  A,
40
40
  {
41
41
  title: a.display,
@@ -45,7 +45,7 @@ const U = (a, n, d, l, c, r) => {
45
45
  (s, i) => U(
46
46
  s,
47
47
  i,
48
- c,
48
+ b,
49
49
  r,
50
50
  n,
51
51
  t
@@ -58,8 +58,8 @@ const U = (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
64
  A,
65
65
  {
@@ -100,22 +100,22 @@ const U = (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
  });
@@ -131,23 +131,23 @@ const U = (a, n, d, l, c, r) => {
131
131
  } else e.isError || r.current.delete(h);
132
132
  });
133
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
- isLoading: D,
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
137
  isError: g,
138
- refetch: T
139
- } = 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]
150
+ [t, R]
151
151
  ), $(() => {
152
152
  g && s({
153
153
  title: i("ERROR_DEFAULT_TITLE"),
@@ -155,49 +155,49 @@ const U = (a, n, d, l, c, r) => {
155
155
  type: "error"
156
156
  });
157
157
  }, [g]);
158
- const f = R(() => {
159
- if (!b) return [];
160
- const e = w(b), h = z(e);
158
+ const T = f(() => {
159
+ if (!c) return [];
160
+ const e = z(c), h = G(e);
161
161
  return H(h);
162
- }, [b]), F = [
162
+ }, [c]), D = [
163
163
  { key: "name", header: "name" },
164
164
  { key: "value", header: "value" },
165
165
  { key: "form", header: "form" }
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) : "";
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: f,
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: F,
195
+ headers: D,
196
196
  rows: [],
197
197
  ariaLabel: i("OBSERVATIONS"),
198
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 { $ 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";
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) => {