@bahmni/appointments-app 0.0.1-dev.261 → 0.0.1-dev.262

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 p, Fragment as Y } from "react/jsx-runtime";
2
- import { d as K, u as Q, a as W, b as J, c as X, m as Z, l as ee, r as te, z as ae } from "./index-BGsOPq88.js";
2
+ import { d as K, u as Q, a as W, b as J, c as X, m as Z, l as ee, r as te, A as ae } from "./index-CiBTO22M.js";
3
3
  import { useState as l, useCallback as h, 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,
@@ -39,11 +39,11 @@ const _e = [
39
39
  /* @__PURE__ */ new Set()
40
40
  ), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = l(1), [m, k] = l($), [V, y] = l(void 0), b = h((e) => {
41
41
  L(e), w(!0);
42
- }, []), z = h(() => {
42
+ }, []), F = h(() => {
43
43
  w(!1), L(null), I(/* @__PURE__ */ new Set());
44
44
  }, []), M = h((e) => {
45
45
  I((t) => new Set(t).add(e));
46
- }, []), { data: u, isLoading: F, isError: D, error: v } = J({
46
+ }, []), { data: u, isLoading: H, isError: D, error: v } = J({
47
47
  queryKey: [
48
48
  "documents",
49
49
  E,
@@ -88,7 +88,7 @@ const _e = [
88
88
  e.signal.aborted || I(t);
89
89
  })(), () => e.abort();
90
90
  }, [s, o]);
91
- const H = h(
91
+ const q = h(
92
92
  (e, t) => {
93
93
  t !== m ? (k(t), A(1), y(void 0)) : A(e);
94
94
  },
@@ -96,7 +96,7 @@ const _e = [
96
96
  ), N = T(
97
97
  () => a?.fields ?? _e,
98
98
  [a?.fields]
99
- ), q = T(() => [...u?.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), [u]), P = T(() => ue(N, n), [N, n]), x = T(
99
+ ), P = T(() => [...u?.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), [u]), z = T(() => ue(N, n), [N, n]), x = T(
100
100
  () => N.map((e) => ({
101
101
  key: e,
102
102
  sortable: e !== "action"
@@ -140,10 +140,10 @@ const _e = [
140
140
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
141
141
  ee,
142
142
  {
143
- headers: P,
143
+ headers: z,
144
144
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
145
- rows: q,
146
- loading: F,
145
+ rows: P,
146
+ loading: H,
147
147
  errorStateMessage: D ? v?.message : null,
148
148
  sortable: x,
149
149
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
@@ -153,7 +153,7 @@ const _e = [
153
153
  pageSize: m,
154
154
  totalItems: V,
155
155
  page: C,
156
- onPageChange: H
156
+ onPageChange: q
157
157
  }
158
158
  ) }),
159
159
  s && o && /* @__PURE__ */ r(
@@ -162,7 +162,7 @@ const _e = [
162
162
  id: "modalIdForActionAreaLayout",
163
163
  portalId: "main-display-area",
164
164
  open: s,
165
- onRequestClose: z,
165
+ onRequestClose: F,
166
166
  modalHeading: o.documentIdentifier,
167
167
  passiveModal: !0,
168
168
  size: "lg",
@@ -1,5 +1,5 @@
1
1
  import { jsx as s, jsxs as J, Fragment as W } from "react/jsx-runtime";
2
- import { u as Z, d as ee, h as re, e as ae, b as c, X as te, D as U, m as oe, c as se, l as S, A as ne, _ as de, r as ie, P as ue, V as me, N as le, M as ce, x as fe, f as ye } from "./index-BGsOPq88.js";
2
+ import { u as Z, d as ee, h as re, e as ae, b as c, X as te, D as U, m as oe, c as se, l as S, f as ne, _ as de, r as ie, j as ue, H as me, z as le, x as ce, N as fe, M as ye } from "./index-CiBTO22M.js";
3
3
  import { useState as q, useMemo as d, useCallback as f } from "react";
4
4
  const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
5
5
  formsTableBody: pe,
@@ -11,14 +11,14 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
11
11
  encounterUuids: n,
12
12
  config: C
13
13
  }) => {
14
- const { t: o } = Z(), m = ee(), [l, O] = q(!1), [t, I] = q(null), { numberOfVisits: x, hideThumbnail: V = !1 } = C ?? {}, _ = re(
14
+ const { t: o } = Z(), m = ee(), [l, O] = q(!1), [t, I] = q(null), { numberOfVisits: x, hideThumbnail: H = !1 } = C ?? {}, _ = re(
15
15
  u,
16
16
  n
17
- ), k = ae(), {
17
+ ), j = ae(), {
18
18
  data: y = [],
19
19
  isLoading: M,
20
20
  isError: T,
21
- error: H,
21
+ error: k,
22
22
  refetch: K
23
23
  } = c({
24
24
  queryKey: ["forms", m, u],
@@ -36,8 +36,8 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
36
36
  if (t)
37
37
  return E(t.formName);
38
38
  }, [t, E]), {
39
- isLoading: j,
40
- isError: $,
39
+ isLoading: z,
40
+ isError: V,
41
41
  error: b
42
42
  } = c({
43
43
  queryKey: ["formMetadata", p],
@@ -45,8 +45,8 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
45
45
  enabled: !!p && l
46
46
  }), {
47
47
  data: N,
48
- isLoading: w,
49
- isError: P,
48
+ isLoading: $,
49
+ isError: w,
50
50
  error: h
51
51
  } = c({
52
52
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
@@ -55,14 +55,14 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
55
55
  });
56
56
  te(
57
57
  (e) => {
58
- e.patientUUID === m && e.updatedConcepts.size > 0 && (K(), k.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
58
+ e.patientUUID === m && e.updatedConcepts.size > 0 && (K(), j.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
59
59
  },
60
60
  [m]
61
61
  );
62
62
  const Q = d(() => !N?.entry || !t?.formName ? [] : N.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
63
63
  const r = Ne(e);
64
64
  return !r || r.includes(t.formName);
65
- }), [N, t?.formName]), z = d(() => {
65
+ }), [N, t?.formName]), G = d(() => {
66
66
  if (b)
67
67
  return U(b).message;
68
68
  if (h)
@@ -73,7 +73,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
73
73
  { key: "recordedBy", header: o("RECORDED_BY") }
74
74
  ],
75
75
  [o]
76
- ), G = d(
76
+ ), P = d(
77
77
  () => [
78
78
  { key: "recordedOn", sortable: !0 },
79
79
  { key: "recordedBy", sortable: !0 }
@@ -129,7 +129,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
129
129
  ariaLabel: o("FORMS_HEADING"),
130
130
  rows: [],
131
131
  loading: M,
132
- errorStateMessage: T ? H?.message : void 0,
132
+ errorStateMessage: T ? k?.message : void 0,
133
133
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
134
134
  renderCell: R,
135
135
  className: A.formsTableBody,
@@ -152,7 +152,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
152
152
  rows: i,
153
153
  loading: !1,
154
154
  errorStateMessage: "",
155
- sortable: G,
155
+ sortable: P,
156
156
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
157
157
  renderCell: R,
158
158
  className: A.formsTableBody,
@@ -179,12 +179,12 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
179
179
  ue,
180
180
  {
181
181
  observations: Q,
182
- isLoading: j || w,
183
- isError: $ || P,
184
- errorMessage: z,
182
+ isLoading: z || $,
183
+ isError: V || w,
184
+ errorMessage: G,
185
185
  emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
186
186
  testIdPrefix: t.formName,
187
- hideThumbnail: V
187
+ hideThumbnail: H
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-5NZHFpxt.js";
2
- import { S as d, U as f, Y as e } from "./index-BGsOPq88.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DMealI3u.js";
2
+ import { U as d, Y as f, Z as e } from "./index-CiBTO22M.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-5NZHFpxt.js";
2
- import { S as v, U as C, Y as e } from "./index-BGsOPq88.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-DMealI3u.js";
2
+ import { U as v, Y as C, Z as e } from "./index-CiBTO22M.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,11 +1,11 @@
1
1
  import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
- import { d as V, a as H, u as S, g as K, y as Q, b as X, X as x, O as j, L as w, i as G, j as M, l as P, C as Z, k as D, T as z, n as Y, Z as J, o as W, p as ee, v as ae, H as te } from "./index-BGsOPq88.js";
3
- import { useRef as se, useEffect as $, useMemo as T } from "react";
4
- const L = (a, n, d, l, b, r) => {
5
- const t = z(a, n, b), s = t.value, i = Y(s);
2
+ import { d as B, a as K, u as S, g as Q, V as X, b as x, X as w, L as G, i as H, R as M, k as j, l as z, T as P, n as D, O as Y, o as J, p as W, q as Z, s as ee, E as ae, t as te } from "./index-CiBTO22M.js";
3
+ import { useRef as se, useEffect as $, useMemo as R } from "react";
4
+ const L = (a, n, d, l, c, r) => {
5
+ const t = Y(a, n, c), s = t.value, i = J(s);
6
6
  let o = s;
7
7
  i === "Image" && (o = /* @__PURE__ */ u(
8
- W,
8
+ Z,
9
9
  {
10
10
  imageSrc: s,
11
11
  alt: s,
@@ -20,22 +20,22 @@ const L = (a, n, d, l, b, r) => {
20
20
  hideThumbnail: r
21
21
  }
22
22
  )), i === "PDF" && (o = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
23
- const p = b("OBSERVATIONS_RECORDED_BY", {
23
+ const p = c("OBSERVATIONS_RECORDED_BY", {
24
24
  provider: t.provider
25
- }), m = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${m}-${d}-${n}` : `${y}-${m}-${d}-${n}`;
25
+ }), m = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", b = l ? `${l}-${y}-${m}-${d}-${n}` : `${y}-${m}-${d}-${n}`;
26
26
  return /* @__PURE__ */ u(
27
- J,
27
+ W,
28
28
  {
29
29
  header: t.header,
30
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, n, d, l, b, r, t) => /* @__PURE__ */ u(
38
+ }, re = (a, n, d, l, c, r, t) => /* @__PURE__ */ u(
39
39
  D,
40
40
  {
41
41
  title: a.display,
@@ -45,7 +45,7 @@ const L = (a, n, d, l, b, r) => {
45
45
  (s, i) => L(
46
46
  s,
47
47
  i,
48
- b,
48
+ c,
49
49
  r,
50
50
  n,
51
51
  t
@@ -58,8 +58,8 @@ const L = (a, n, d, l, b, r) => {
58
58
  title: n = "",
59
59
  hideThumbnail: d
60
60
  }) => {
61
- const { t: l } = S(), b = (r, t, s) => {
62
- const i = Z(r.encounterDetails, l);
61
+ const { t: l } = S(), c = (r, t, s) => {
62
+ const i = P(r.encounterDetails, l);
63
63
  return /* @__PURE__ */ N(
64
64
  D,
65
65
  {
@@ -100,7 +100,7 @@ const L = (a, n, 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
  );
@@ -111,93 +111,93 @@ const L = (a, n, d, l, b, r) => {
111
111
  const n = a, {
112
112
  conceptNames: d = [],
113
113
  conceptUuid: l = [],
114
- hideThumbnail: b = !1
115
- } = n, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = H(), { t: i } = S(), o = K({
114
+ hideThumbnail: c = !1
115
+ } = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } = K(), { t: i } = S(), o = Q({
116
116
  queries: d.map((e) => ({
117
117
  queryKey: de(e),
118
- queryFn: () => Q(e),
118
+ queryFn: () => X(e),
119
119
  enabled: !!e
120
120
  }))
121
121
  });
122
122
  $(() => {
123
123
  o.forEach((e, h) => {
124
124
  if (e.isError && !r.current.has(h)) {
125
- const B = d[h];
125
+ const U = d[h];
126
126
  s({
127
127
  title: i("ERROR_DEFAULT_TITLE"),
128
- message: i("ERROR_FETCHING_CONCEPT", { conceptName: B }),
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
133
  }, [o, d]);
134
- const p = T(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = T(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = T(() => 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({
134
+ const p = R(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = R(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
135
+ data: b,
136
+ isLoading: F,
137
+ isError: T,
138
+ refetch: g
139
+ } = x({
140
140
  queryKey: le(t, m),
141
141
  queryFn: () => te(t, m),
142
142
  enabled: !!t && m.length > 0 && y
143
143
  });
144
- x(
144
+ w(
145
145
  (e) => {
146
146
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
147
147
  (h) => m.includes(h)
148
- ) && R();
148
+ ) && g();
149
149
  },
150
- [t, R]
150
+ [t, g]
151
151
  ), $(() => {
152
- g && 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
- }, [g]);
158
- const f = T(() => {
159
- if (!c) return [];
160
- const e = j(c), h = w(e);
161
- return G(h);
162
- }, [c]), F = [
157
+ }, [T]);
158
+ const f = R(() => {
159
+ if (!b) return [];
160
+ const e = G(b), h = H(e);
161
+ return M(h);
162
+ }, [b]), k = [
163
163
  { key: "name", header: "name" },
164
164
  { key: "value", header: "value" },
165
165
  { key: "form", header: "form" }
166
- ], O = C || !y, _ = g && y, A = (!c || c.entry?.length === 0 || m.length === 0) && y, k = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, q = A ? i("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? i(E) : "";
166
+ ], O = F || !y, _ = T && y, q = (!b || b.entry?.length === 0 || m.length === 0) && y, A = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, V = q ? i("NO_OBSERVATIONS_FOUND") : void 0, C = f.length > 0 && !O && !_, v = n.titleTranslationKey, E = v ? i(v) : "";
167
167
  return /* @__PURE__ */ N(
168
168
  "div",
169
169
  {
170
170
  id: "observations",
171
- "data-testid": E ? `observations-${v}` : "observations",
171
+ "data-testid": v ? `observations-${E}` : "observations",
172
172
  "aria-label": "observations-aria-label",
173
173
  className: I.observations,
174
174
  children: [
175
175
  /* @__PURE__ */ u(
176
- M,
176
+ j,
177
177
  {
178
178
  id: "observations-title",
179
- testId: E ? `observations-title-${v}` : "observations-title",
180
- title: v,
179
+ testId: v ? `observations-title-${E}` : "observations-title",
180
+ title: E,
181
181
  className: I.title,
182
- children: /* @__PURE__ */ u("p", { children: v })
182
+ children: /* @__PURE__ */ u("p", { children: E })
183
183
  }
184
184
  ),
185
- U ? /* @__PURE__ */ u(
185
+ C ? /* @__PURE__ */ u(
186
186
  ie,
187
187
  {
188
188
  groupedData: f,
189
- title: v,
190
- hideThumbnail: b
189
+ title: E,
190
+ hideThumbnail: c
191
191
  }
192
192
  ) : /* @__PURE__ */ u(
193
- P,
193
+ z,
194
194
  {
195
- headers: F,
195
+ headers: k,
196
196
  rows: [],
197
197
  ariaLabel: i("OBSERVATIONS"),
198
198
  loading: O,
199
- errorStateMessage: k,
200
- emptyStateMessage: q,
199
+ errorStateMessage: A,
200
+ emptyStateMessage: V,
201
201
  dataTestId: "observations-table"
202
202
  }
203
203
  )