@bahmni/registration-app 0.0.1-dev.261 → 0.0.1-dev.263

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, z as J, b as X, m as Z, l as ee, r as te } from "./index-r04XHb20.js";
2
+ import { d as K, u as Q, a as W, A as J, b as X, m as Z, l as ee, r as te } from "./index-D1-b232k.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as m, useCallback as h, useEffect as O, useMemo as T } from "react";
5
5
  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", me = "_documentImage_1voj8_50", d = {
@@ -40,11 +40,11 @@ const _e = [
40
40
  /* @__PURE__ */ new Set()
41
41
  ), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = m(1), [l, k] = m($), [V, y] = m(void 0), b = h((e) => {
42
42
  L(e), w(!0);
43
- }, []), z = h(() => {
43
+ }, []), F = h(() => {
44
44
  w(!1), L(null), I(/* @__PURE__ */ new Set());
45
45
  }, []), M = h((e) => {
46
46
  I((t) => new Set(t).add(e));
47
- }, []), { data: u, isLoading: F, isError: D, error: v } = ae({
47
+ }, []), { data: u, isLoading: H, isError: D, error: v } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
50
  E,
@@ -89,7 +89,7 @@ const _e = [
89
89
  e.signal.aborted || I(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
- const H = h(
92
+ const q = h(
93
93
  (e, t) => {
94
94
  t !== l ? (k(t), A(1), y(void 0)) : A(e);
95
95
  },
@@ -97,7 +97,7 @@ const _e = [
97
97
  ), f = T(
98
98
  () => a?.fields ?? _e,
99
99
  [a?.fields]
100
- ), 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(f, n), [f, n]), x = T(
100
+ ), 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(f, n), [f, n]), x = T(
101
101
  () => f.map((e) => ({
102
102
  key: e,
103
103
  sortable: e !== "action"
@@ -141,10 +141,10 @@ const _e = [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
144
- headers: P,
144
+ headers: z,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
- rows: q,
147
- loading: F,
146
+ rows: P,
147
+ loading: H,
148
148
  errorStateMessage: D ? v?.message : null,
149
149
  sortable: x,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
@@ -154,7 +154,7 @@ const _e = [
154
154
  pageSize: l,
155
155
  totalItems: V,
156
156
  page: C,
157
- onPageChange: H
157
+ onPageChange: q
158
158
  }
159
159
  ) }),
160
160
  s && o && /* @__PURE__ */ r(
@@ -163,7 +163,7 @@ const _e = [
163
163
  id: "modalIdForActionAreaLayout",
164
164
  portalId: "main-display-area",
165
165
  open: s,
166
- onRequestClose: z,
166
+ onRequestClose: F,
167
167
  modalHeading: o.documentIdentifier,
168
168
  passiveModal: !0,
169
169
  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, N as ae, M as te, x as oe, c as se, X as ne, D as U, m as de, b as ie, l as S, A as me, _ as ue, r as le, P as ce, V as fe } from "./index-r04XHb20.js";
2
+ import { u as Z, d as ee, h as re, z as ae, x as te, N as oe, M as se, X as ne, D as U, m as de, b as ie, l as S, c as me, _ as ue, r as le, j as ce, H as fe } from "./index-D1-b232k.js";
3
3
  import { useQueryClient as ye, useQuery as c } from "@tanstack/react-query";
4
4
  import { useState as q, useMemo as d, useCallback as f } from "react";
5
5
  const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
@@ -12,14 +12,14 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
12
12
  encounterUuids: n,
13
13
  config: C
14
14
  }) => {
15
- const { t: o } = Z(), u = ee(), [l, O] = q(!1), [t, I] = q(null), { numberOfVisits: x, hideThumbnail: V = !1 } = C ?? {}, _ = re(
15
+ const { t: o } = Z(), u = ee(), [l, O] = q(!1), [t, I] = q(null), { numberOfVisits: x, hideThumbnail: H = !1 } = C ?? {}, _ = re(
16
16
  m,
17
17
  n
18
- ), k = ye(), {
18
+ ), j = ye(), {
19
19
  data: y = [],
20
20
  isLoading: M,
21
21
  isError: T,
22
- error: H,
22
+ error: k,
23
23
  refetch: K
24
24
  } = c({
25
25
  queryKey: ["forms", u, m],
@@ -37,8 +37,8 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
37
37
  if (t)
38
38
  return E(t.formName);
39
39
  }, [t, E]), {
40
- isLoading: j,
41
- isError: $,
40
+ isLoading: z,
41
+ isError: V,
42
42
  error: b
43
43
  } = c({
44
44
  queryKey: ["formMetadata", p],
@@ -46,8 +46,8 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
46
46
  enabled: !!p && l
47
47
  }), {
48
48
  data: N,
49
- isLoading: w,
50
- isError: P,
49
+ isLoading: $,
50
+ isError: w,
51
51
  error: h
52
52
  } = c({
53
53
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
@@ -56,14 +56,14 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
56
56
  });
57
57
  ne(
58
58
  (e) => {
59
- e.patientUUID === u && e.updatedConcepts.size > 0 && (K(), k.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
59
+ e.patientUUID === u && e.updatedConcepts.size > 0 && (K(), j.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
60
60
  },
61
61
  [u]
62
62
  );
63
63
  const Q = d(() => !N?.entry || !t?.formName ? [] : N.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
64
64
  const r = Ne(e);
65
65
  return !r || r.includes(t.formName);
66
- }), [N, t?.formName]), z = d(() => {
66
+ }), [N, t?.formName]), G = d(() => {
67
67
  if (b)
68
68
  return U(b).message;
69
69
  if (h)
@@ -74,7 +74,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
74
74
  { key: "recordedBy", header: o("RECORDED_BY") }
75
75
  ],
76
76
  [o]
77
- ), G = d(
77
+ ), P = d(
78
78
  () => [
79
79
  { key: "recordedOn", sortable: !0 },
80
80
  { key: "recordedBy", sortable: !0 }
@@ -130,7 +130,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
130
130
  ariaLabel: o("FORMS_HEADING"),
131
131
  rows: [],
132
132
  loading: M,
133
- errorStateMessage: T ? H?.message : void 0,
133
+ errorStateMessage: T ? k?.message : void 0,
134
134
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
135
135
  renderCell: R,
136
136
  className: A.formsTableBody,
@@ -153,7 +153,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
153
153
  rows: i,
154
154
  loading: !1,
155
155
  errorStateMessage: "",
156
- sortable: G,
156
+ sortable: P,
157
157
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
158
158
  renderCell: R,
159
159
  className: A.formsTableBody,
@@ -180,12 +180,12 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", A = {
180
180
  ce,
181
181
  {
182
182
  observations: Q,
183
- isLoading: j || w,
184
- isError: $ || P,
185
- errorMessage: z,
183
+ isLoading: z || $,
184
+ isError: V || w,
185
+ errorMessage: G,
186
186
  emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
187
187
  testIdPrefix: t.formName,
188
- hideThumbnail: V
188
+ hideThumbnail: H
189
189
  }
190
190
  )
191
191
  }
@@ -1,25 +1,25 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CeontiXK.js";
2
- import { n as p, o as d, p as e } from "./index-r04XHb20.js";
3
- var f = (a) => {
4
- const [r, o] = c({
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-MwrxBN6h.js";
2
+ import { q as d, s as f, t as e } from "./index-D1-b232k.js";
3
+ var p = (a) => {
4
+ const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), n = p(), s = d(() => {
7
- const t = r.theme_preference || l;
8
- return t !== "system" ? t : n();
6
+ }), n = d(), s = f(() => {
7
+ const o = r.theme_preference || l;
8
+ return o !== "system" ? o : n();
9
9
  });
10
10
  return e(i.Provider, {
11
11
  value: a,
12
12
  get children() {
13
13
  return e(m, {
14
14
  localStore: r,
15
- setLocalStore: o,
15
+ setLocalStore: t,
16
16
  get children() {
17
17
  return e(u.Provider, {
18
18
  value: s,
19
19
  get children() {
20
20
  return e(v, {
21
21
  localStore: r,
22
- setLocalStore: o
22
+ setLocalStore: t
23
23
  });
24
24
  }
25
25
  });
@@ -27,7 +27,7 @@ var f = (a) => {
27
27
  });
28
28
  }
29
29
  });
30
- }, C = f;
30
+ }, C = p;
31
31
  export {
32
32
  C as default
33
33
  };
@@ -1,9 +1,9 @@
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-CeontiXK.js";
2
- import { n as v, o as C, p as e } from "./index-r04XHb20.js";
1
+ import { c as l, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-MwrxBN6h.js";
2
+ import { q as v, s as C, t as e } from "./index-D1-b232k.js";
3
3
  var h = (t) => {
4
- const [r, o] = s({
4
+ const [r, o] = l({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), a = v(), l = C(() => {
6
+ }), a = v(), s = C(() => {
7
7
  const n = r.theme_preference || c;
8
8
  return n !== "system" ? n : a();
9
9
  });
@@ -16,7 +16,7 @@ var h = (t) => {
16
16
  setLocalStore: o,
17
17
  get children() {
18
18
  return e(i.Provider, {
19
- value: l,
19
+ value: s,
20
20
  get children() {
21
21
  return e(m, {
22
22
  get children() {
@@ -36,7 +36,7 @@ var h = (t) => {
36
36
  });
37
37
  }
38
38
  });
39
- }, g = h;
39
+ }, p = h;
40
40
  export {
41
- g as default
41
+ p as default
42
42
  };
@@ -1,12 +1,12 @@
1
1
  import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
- import { d as V, a as H, u as S, y as K, H as Q, X, O as x, L as j, e as w, f as G, l as M, C as P, g as D, T as Z, i as z, Z as Y, j as J, k as W, v as ee } from "./index-r04XHb20.js";
2
+ import { d as B, a as K, u as S, V as Q, e as X, X as x, L as w, f as G, R as H, g as M, l as j, T as z, n as D, O as P, i as Y, k as J, o as W, p as Z, E as ee } from "./index-D1-b232k.js";
3
3
  import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as $, useMemo as T } from "react";
4
+ import { useRef as se, useEffect as $, useMemo as R } from "react";
5
5
  const L = (a, n, d, l, b, r) => {
6
- const t = Z(a, n, b), s = t.value, i = z(s);
6
+ const t = P(a, n, b), s = t.value, i = Y(s);
7
7
  let o = s;
8
8
  i === "Image" && (o = /* @__PURE__ */ u(
9
- J,
9
+ W,
10
10
  {
11
11
  imageSrc: s,
12
12
  alt: s,
@@ -14,7 +14,7 @@ const L = (a, n, d, l, b, r) => {
14
14
  hideThumbnail: r
15
15
  }
16
16
  )), i === "Video" && (o = /* @__PURE__ */ u(
17
- W,
17
+ Z,
18
18
  {
19
19
  id: `${s}-video`,
20
20
  videoSrc: s,
@@ -25,7 +25,7 @@ const L = (a, n, d, l, b, r) => {
25
25
  provider: t.provider
26
26
  }), m = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${m}-${d}-${n}` : `${y}-${m}-${d}-${n}`;
27
27
  return /* @__PURE__ */ u(
28
- Y,
28
+ J,
29
29
  {
30
30
  header: t.header,
31
31
  value: o,
@@ -60,7 +60,7 @@ const L = (a, n, d, l, b, r) => {
60
60
  hideThumbnail: d
61
61
  }) => {
62
62
  const { t: l } = S(), b = (r, t, s) => {
63
- const i = P(r.encounterDetails, l);
63
+ const i = z(r.encounterDetails, l);
64
64
  return /* @__PURE__ */ N(
65
65
  D,
66
66
  {
@@ -113,91 +113,91 @@ const L = (a, n, d, l, b, r) => {
113
113
  conceptNames: d = [],
114
114
  conceptUuid: l = [],
115
115
  hideThumbnail: b = !1
116
- } = n, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = H(), { t: i } = S(), o = ae({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } = K(), { t: i } = S(), o = ae({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
- queryFn: () => K(e),
119
+ queryFn: () => Q(e),
120
120
  enabled: !!e
121
121
  }))
122
122
  });
123
123
  $(() => {
124
124
  o.forEach((e, h) => {
125
125
  if (e.isError && !r.current.has(h)) {
126
- const B = d[h];
126
+ const U = d[h];
127
127
  s({
128
128
  title: i("ERROR_DEFAULT_TITLE"),
129
- message: i("ERROR_FETCHING_CONCEPT", { conceptName: B }),
129
+ message: i("ERROR_FETCHING_CONCEPT", { conceptName: U }),
130
130
  type: "error"
131
131
  }), r.current.add(h);
132
132
  } else e.isError || r.current.delete(h);
133
133
  });
134
134
  }, [o, d]);
135
- 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
+ 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]), {
136
136
  data: c,
137
- isLoading: C,
138
- isError: f,
139
- refetch: g
137
+ isLoading: F,
138
+ isError: T,
139
+ refetch: f
140
140
  } = te({
141
141
  queryKey: le(t, m),
142
- queryFn: () => Q(t, m),
142
+ queryFn: () => X(t, m),
143
143
  enabled: !!t && m.length > 0 && y
144
144
  });
145
- X(
145
+ x(
146
146
  (e) => {
147
147
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
148
  (h) => m.includes(h)
149
- ) && g();
149
+ ) && f();
150
150
  },
151
- [t, g]
151
+ [t, f]
152
152
  ), $(() => {
153
- f && s({
153
+ T && s({
154
154
  title: i("ERROR_DEFAULT_TITLE"),
155
155
  message: i("ERROR_FETCHING_OBSERVATIONS"),
156
156
  type: "error"
157
157
  });
158
- }, [f]);
159
- const R = T(() => {
158
+ }, [T]);
159
+ const g = R(() => {
160
160
  if (!c) return [];
161
- const e = x(c), h = j(e);
162
- return w(h);
163
- }, [c]), F = [
161
+ const e = w(c), h = G(e);
162
+ return H(h);
163
+ }, [c]), k = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], O = C || !y, _ = f && 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 = R.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? i(E) : "";
167
+ ], O = F || !y, _ = T && y, A = (!c || c.entry?.length === 0 || m.length === 0) && y, V = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, q = A ? i("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !O && !_, v = n.titleTranslationKey, E = v ? i(v) : "";
168
168
  return /* @__PURE__ */ N(
169
169
  "div",
170
170
  {
171
171
  id: "observations",
172
- "data-testid": E ? `observations-${v}` : "observations",
172
+ "data-testid": v ? `observations-${E}` : "observations",
173
173
  "aria-label": "observations-aria-label",
174
174
  className: I.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
- G,
177
+ M,
178
178
  {
179
179
  id: "observations-title",
180
- testId: E ? `observations-title-${v}` : "observations-title",
181
- title: v,
180
+ testId: v ? `observations-title-${E}` : "observations-title",
181
+ title: E,
182
182
  className: I.title,
183
- children: /* @__PURE__ */ u("p", { children: v })
183
+ children: /* @__PURE__ */ u("p", { children: E })
184
184
  }
185
185
  ),
186
- U ? /* @__PURE__ */ u(
186
+ C ? /* @__PURE__ */ u(
187
187
  ie,
188
188
  {
189
- groupedData: R,
190
- title: v,
189
+ groupedData: g,
190
+ title: E,
191
191
  hideThumbnail: b
192
192
  }
193
193
  ) : /* @__PURE__ */ u(
194
- M,
194
+ j,
195
195
  {
196
- headers: F,
196
+ headers: k,
197
197
  rows: [],
198
198
  ariaLabel: i("OBSERVATIONS"),
199
199
  loading: O,
200
- errorStateMessage: k,
200
+ errorStateMessage: V,
201
201
  emptyStateMessage: q,
202
202
  dataTestId: "observations-table"
203
203
  }
@@ -1,4 +1,4 @@
1
- import { q as we, s as z, t as xt, w as B, o as q, p as y, B as Ro, E as ye, S as R, F as _, G as k, I as N, J as A, K as bs, Q as ir, R as $e, U, W as Hn, Y as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Ur, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-r04XHb20.js";
1
+ import { v as we, w as z, y as xt, B, s as q, t as y, P as Ro, C as ye, S as R, F as _, G as k, I as N, J as A, K as bs, Q as ir, U as $e, W as U, Y as Hn, Z as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Ur, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-D1-b232k.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {