@bahmni/appointments-app 0.0.1-dev.226 → 0.0.1-dev.228

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 { t as W, u as K, r as Q, a as J, M as X, N as Z, o as ee, s as te, b as ae } from "./index-Ct_yCJng.js";
2
+ import { t as W, u as K, r as Q, a as J, M as X, N as Z, o as ee, s as te, l as ae } from "./index-Brcr7LKs.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,
@@ -1,5 +1,5 @@
1
- import { jsx as o, jsxs as Y, Fragment as Z } from "react/jsx-runtime";
2
- import { u as W, t as ee, m as re, c as ae, a as c, k as te, V as U, N as se, M as oe, o as C, G as ne, J as de, s as ie, Z as ue, d as me, e as le, X as ce, f as fe, Q as ye } from "./index-Ct_yCJng.js";
1
+ import { jsx as o, jsxs as W, Fragment as X } from "react/jsx-runtime";
2
+ import { u as Z, t as ee, m as re, b as ae, a as c, k as te, V as U, N as se, M as oe, o as C, G as ne, J as de, s as ie, P as ue, c as me, d as le, e as ce, i as fe, f as ye } from "./index-Brcr7LKs.js";
3
3
  import { useState as S, useMemo as d, useCallback as f } from "react";
4
4
  const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
5
5
  formsTableBody: be,
@@ -11,15 +11,15 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
11
11
  encounterUuids: n,
12
12
  config: q
13
13
  }) => {
14
- const { t: s } = W(), m = ee(), [l, A] = S(!1), [t, I] = S(null), { numberOfVisits: k, hideThumbnail: V = !1 } = q ?? {}, M = re(
14
+ const { t: s } = Z(), m = ee(), [l, A] = S(!1), [t, I] = S(null), { numberOfVisits: k, hideThumbnail: V = !1 } = q ?? {}, M = re(
15
15
  u,
16
16
  n
17
- ), G = ae(), {
17
+ ), H = ae(), {
18
18
  data: y = [],
19
19
  isLoading: T,
20
20
  isError: B,
21
- error: H,
22
- refetch: K
21
+ error: K,
22
+ refetch: j
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", Ne = "_customAccordianItem_81hra_6", O = {
36
36
  if (t)
37
37
  return D(t.formName);
38
38
  }, [t, D]), {
39
- isLoading: Q,
40
- isError: j,
39
+ isLoading: x,
40
+ isError: G,
41
41
  error: N
42
42
  } = c({
43
43
  queryKey: ["formMetadata", b],
@@ -45,8 +45,8 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
45
45
  enabled: !!b && l
46
46
  }), {
47
47
  data: p,
48
- isLoading: x,
49
- isError: $,
48
+ isLoading: $,
49
+ isError: w,
50
50
  error: g
51
51
  } = c({
52
52
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
@@ -55,14 +55,14 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
55
55
  });
56
56
  te(
57
57
  (e) => {
58
- e.patientUUID === m && e.updatedConcepts.size > 0 && (K(), G.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
58
+ e.patientUUID === m && e.updatedConcepts.size > 0 && (j(), H.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
59
59
  },
60
60
  [m]
61
61
  );
62
- const w = d(() => !p?.entry || !t?.formName ? [] : p.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
62
+ const P = d(() => !p?.entry || !t?.formName ? [] : p.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
63
63
  const r = pe(e);
64
64
  return !r || r.includes(t.formName);
65
- }), [p, t?.formName]), z = d(() => {
65
+ }), [p, t?.formName]), Q = d(() => {
66
66
  if (N)
67
67
  return U(N).message;
68
68
  if (g)
@@ -73,7 +73,7 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
73
73
  { key: "recordedBy", header: s("RECORDED_BY") }
74
74
  ],
75
75
  [s]
76
- ), J = d(
76
+ ), z = d(
77
77
  () => [
78
78
  { key: "recordedOn", sortable: !0 },
79
79
  { key: "recordedBy", sortable: !0 }
@@ -84,7 +84,7 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
84
84
  (r, a) => {
85
85
  const i = a.formName;
86
86
  r[i] ??= [];
87
- const h = a.providers.map((X) => X.providerName).filter(Boolean).join(", ");
87
+ const h = a.providers.map((Y) => Y.providerName).filter(Boolean).join(", ");
88
88
  return r[i].push({
89
89
  id: a.encounterUuid,
90
90
  formName: a.formName,
@@ -106,7 +106,7 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
106
106
  ).sort((r, a) => r.formName.localeCompare(a.formName));
107
107
  }, [E, s]), R = f((e) => {
108
108
  I(e), A(!0);
109
- }, []), P = f(() => {
109
+ }, []), J = f(() => {
110
110
  A(!1), I(null);
111
111
  }, []), v = f(
112
112
  (e, r) => {
@@ -121,7 +121,7 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
121
121
  },
122
122
  [R]
123
123
  );
124
- return /* @__PURE__ */ Y(Z, { children: [
124
+ return /* @__PURE__ */ W(X, { children: [
125
125
  /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: T || B || L.length === 0 || M ? /* @__PURE__ */ o(
126
126
  C,
127
127
  {
@@ -129,7 +129,7 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
129
129
  ariaLabel: s("FORMS_HEADING"),
130
130
  rows: [],
131
131
  loading: T,
132
- errorStateMessage: B ? H?.message : void 0,
132
+ errorStateMessage: B ? K?.message : void 0,
133
133
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
134
134
  renderCell: v,
135
135
  className: O.formsTableBody,
@@ -152,7 +152,7 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
152
152
  rows: i,
153
153
  loading: !1,
154
154
  errorStateMessage: "",
155
- sortable: J,
155
+ sortable: z,
156
156
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
157
157
  renderCell: v,
158
158
  className: O.formsTableBody,
@@ -169,7 +169,7 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
169
169
  id: "modalIdForActionAreaLayout",
170
170
  portalId: "main-display-area",
171
171
  open: l,
172
- onRequestClose: P,
172
+ onRequestClose: J,
173
173
  modalHeading: t.formName,
174
174
  modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
175
175
  passiveModal: !0,
@@ -178,10 +178,10 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
178
178
  children: /* @__PURE__ */ o(
179
179
  ue,
180
180
  {
181
- observations: w,
182
- isLoading: Q || x,
183
- isError: j || $,
184
- errorMessage: z,
181
+ observations: P,
182
+ isLoading: x || $,
183
+ isError: G || w,
184
+ errorMessage: Q,
185
185
  emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
186
186
  testIdPrefix: t.formName,
187
187
  hideThumbnail: V
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BBTMqJxN.js";
2
- import { T as d, U as f, _ as e } from "./index-Ct_yCJng.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Cj3ebMT7.js";
2
+ import { Y as d, Z as f, _ as e } from "./index-Brcr7LKs.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-BBTMqJxN.js";
2
- import { T as v, U as C, _ as e } from "./index-Ct_yCJng.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-Cj3ebMT7.js";
2
+ import { Y as v, Z as C, _ as e } from "./index-Brcr7LKs.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,7 +1,7 @@
1
1
  import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
- import { t as K, r as V, u as S, g as G, Y as w, a as x, k as M, h as Q, l as j, i as H, j as Y, o as P, n as z, O as U, p as J, q as W, I as X, v as Z, w as ee, x as ae, y as te } from "./index-Ct_yCJng.js";
3
- import { useRef as se, useEffect as $, useMemo as R } from "react";
4
- const D = (a, n, d, l, b, r) => {
2
+ import { t as V, r as K, u as S, g as j, h as w, a as x, k as G, p as M, j as Q, n as H, q as z, o as P, v as Y, I as U, w as J, x as W, y as X, E as Z, T as ee, z as ae, A as te } from "./index-Brcr7LKs.js";
3
+ import { useRef as se, useEffect as $, useMemo as T } from "react";
4
+ const A = (a, n, d, l, b, r) => {
5
5
  const t = J(a, n, b), s = t.value, i = W(s);
6
6
  let o = s;
7
7
  i === "Image" && (o = /* @__PURE__ */ u(
@@ -42,7 +42,7 @@ const D = (a, n, d, l, b, r) => {
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) => A(
46
46
  s,
47
47
  i,
48
48
  b,
@@ -59,7 +59,7 @@ const D = (a, n, d, l, b, r) => {
59
59
  hideThumbnail: d
60
60
  }) => {
61
61
  const { t: l } = S(), b = (r, t, s) => {
62
- const i = z(r.encounterDetails, l);
62
+ const i = Y(r.encounterDetails, l);
63
63
  return /* @__PURE__ */ N(
64
64
  U,
65
65
  {
@@ -68,7 +68,7 @@ const D = (a, n, d, l, b, r) => {
68
68
  open: t,
69
69
  children: [
70
70
  r.observations.map(
71
- (o, p) => D(
71
+ (o, p) => A(
72
72
  o,
73
73
  p,
74
74
  s,
@@ -112,7 +112,7 @@ const D = (a, n, d, l, b, r) => {
112
112
  conceptNames: d = [],
113
113
  conceptUuid: l = [],
114
114
  hideThumbnail: b = !1
115
- } = n, r = se(/* @__PURE__ */ new Set()), t = K(), { addNotification: s } = V(), { t: i } = S(), o = G({
115
+ } = n, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = K(), { t: i } = S(), o = j({
116
116
  queries: d.map((e) => ({
117
117
  queryKey: de(e),
118
118
  queryFn: () => w(e),
@@ -131,17 +131,17 @@ const D = (a, n, d, l, b, 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]), y = R(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
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
135
  data: c,
136
- isLoading: F,
137
- isError: T,
136
+ isLoading: D,
137
+ isError: R,
138
138
  refetch: f
139
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
- M(
144
+ G(
145
145
  (e) => {
146
146
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
147
147
  (h) => m.includes(h)
@@ -149,21 +149,21 @@ const D = (a, n, d, l, b, r) => {
149
149
  },
150
150
  [t, f]
151
151
  ), $(() => {
152
- T && s({
152
+ R && 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(() => {
157
+ }, [R]);
158
+ const g = T(() => {
159
159
  if (!c) return [];
160
- const e = Q(c), h = j(e);
160
+ const e = M(c), h = Q(e);
161
161
  return H(h);
162
- }, [c]), q = [
162
+ }, [c]), F = [
163
163
  { key: "name", header: "name" },
164
164
  { key: "value", header: "value" },
165
165
  { key: "form", header: "form" }
166
- ], O = F || !y, _ = T && y, A = (!c || c.entry?.length === 0 || m.length === 0) && y, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, k = A ? i("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? i(E) : "";
166
+ ], O = D || !y, _ = R && y, q = (!c || c.entry?.length === 0 || m.length === 0) && y, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, k = q ? i("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? i(E) : "";
167
167
  return /* @__PURE__ */ N(
168
168
  "div",
169
169
  {
@@ -173,7 +173,7 @@ const D = (a, n, d, l, b, r) => {
173
173
  className: I.observations,
174
174
  children: [
175
175
  /* @__PURE__ */ u(
176
- Y,
176
+ z,
177
177
  {
178
178
  id: "observations-title",
179
179
  testId: E ? `observations-title-${v}` : "observations-title",
@@ -192,7 +192,7 @@ const D = (a, n, d, l, b, r) => {
192
192
  ) : /* @__PURE__ */ u(
193
193
  P,
194
194
  {
195
- headers: q,
195
+ headers: F,
196
196
  rows: [],
197
197
  ariaLabel: i("OBSERVATIONS"),
198
198
  loading: O,