@bahmni/registration-app 0.0.1-dev.169 → 0.0.1-dev.170

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,20 +1,20 @@
1
1
  import { jsx as s, jsxs as p, Fragment as H } from "react/jsx-runtime";
2
- import { u as ee, h as re, w as ae, J as te, Y as oe, G as ne, K as se, e as de, i as me, C as ie, z as U, a as le, b as ce, c as ue, M as be, V as q, d as pe, g as _e, f as R, F as fe, N as $e, j as ve, U as ge } from "./index-C_ok2zy5.js";
3
- import { useQueryClient as he, useQuery as C } from "@tanstack/react-query";
4
- import { useState as K, useMemo as h, useCallback as L } from "react";
5
- const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Le = "_formDetailsContainer_1pd36_25", Re = "_observation_1pd36_30", Ae = "_groupContainer_1pd36_39", Fe = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", Oe = "_rowValue_1pd36_67", Ie = "_groupMembers_1pd36_75", Te = "_memberRow_1pd36_81", Se = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", De = "_abnormalValue_1pd36_102", Ge = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", xe = "_nestedGroup_1pd36_125", Be = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
2
+ import { u as ee, h as re, v as ae, J as te, Y as oe, G as ne, K as se, e as de, i as me, T as ie, z as U, a as le, b as ce, c as ue, M as be, V as q, d as pe, g as _e, C as A, F as fe, N as $e, f as ve, U as ge } from "./index-DA_fHx-R.js";
3
+ import { useQueryClient as he, useQuery as L } from "@tanstack/react-query";
4
+ import { useState as K, useMemo as h, useCallback as R } from "react";
5
+ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", Fe = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", Oe = "_rowValue_1pd36_67", Te = "_groupMembers_1pd36_75", Ie = "_memberRow_1pd36_81", Se = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", De = "_abnormalValue_1pd36_102", Ge = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", xe = "_nestedGroup_1pd36_125", Be = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
6
6
  formsTableBody: Ne,
7
7
  customAccordianItem: ye,
8
- formContent: Ce,
9
- formDetailsContainer: Le,
10
- observation: Re,
11
- groupContainer: Ae,
8
+ formContent: Le,
9
+ formDetailsContainer: Re,
10
+ observation: Ae,
11
+ groupContainer: Ce,
12
12
  rowContainer: Fe,
13
13
  groupLabel: Me,
14
14
  rowLabel: Ve,
15
15
  rowValue: Oe,
16
- groupMembers: Ie,
17
- memberRow: Te,
16
+ groupMembers: Te,
17
+ memberRow: Ie,
18
18
  memberLabel: Se,
19
19
  memberValue: we,
20
20
  abnormalValue: De,
@@ -23,7 +23,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
23
23
  nestedGroup: xe,
24
24
  nestedGroupLabel: Be,
25
25
  nestedGroupMembers: Ue
26
- }, j = (e) => {
26
+ }, k = (e) => {
27
27
  const r = fe(e);
28
28
  return r === "Image" ? /* @__PURE__ */ s(
29
29
  $e,
@@ -33,10 +33,10 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
33
33
  id: `${e}-img`
34
34
  }
35
35
  ) : r === "Video" ? /* @__PURE__ */ s(ve, { id: `${e}-video`, videoSrc: e }) : e;
36
- }, k = (e) => {
36
+ }, P = (e) => {
37
37
  const r = e.observationValue?.unit, n = e.observationValue?.referenceRange?.low?.value, a = e.observationValue?.referenceRange?.high?.value, d = n != null, c = a != null, m = d && c ? ` (${n} - ${a})` : d ? ` (>${n})` : c ? ` (<${a})` : "", t = e.observationValue?.isAbnormal === !0;
38
38
  return { units: r, rangeString: m, isAbnormal: t };
39
- }, P = ({
39
+ }, j = ({
40
40
  member: e,
41
41
  depth: r = 0,
42
42
  memberIndex: n = 0,
@@ -66,7 +66,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
66
66
  className: o.nestedGroupMembers,
67
67
  "data-testid": `${t}obs-nested-group-members-${m}-${n}`,
68
68
  children: e.members?.map((N, y) => /* @__PURE__ */ s(
69
- P,
69
+ j,
70
70
  {
71
71
  member: N,
72
72
  depth: r + 1,
@@ -80,7 +80,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
80
80
  ]
81
81
  }
82
82
  );
83
- const { units: b, rangeString: v, isAbnormal: _ } = k(e), f = e.observationValue?.value?.toString(), $ = f ? j(f) : null;
83
+ const { units: b, rangeString: v, isAbnormal: _ } = P(e), f = e.observationValue?.value?.toString(), $ = f ? k(f) : null;
84
84
  return /* @__PURE__ */ p(H, { children: [
85
85
  /* @__PURE__ */ p(
86
86
  "div",
@@ -92,7 +92,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
92
92
  /* @__PURE__ */ p(
93
93
  "p",
94
94
  {
95
- className: R(
95
+ className: A(
96
96
  o.memberLabel,
97
97
  _ ? o.abnormalValue : ""
98
98
  ),
@@ -106,7 +106,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
106
106
  /* @__PURE__ */ p(
107
107
  "div",
108
108
  {
109
- className: R(
109
+ className: A(
110
110
  o.memberValue,
111
111
  _ ? o.abnormalValue : ""
112
112
  ),
@@ -139,7 +139,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
139
139
  formName: n = "",
140
140
  comment: a
141
141
  }) => {
142
- const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = k(e), b = n ? `${n}-` : "", v = e.observationValue?.value?.toString(), _ = v ? j(v) : null;
142
+ const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = P(e), b = n ? `${n}-` : "", v = e.observationValue?.value?.toString(), _ = v ? k(v) : null;
143
143
  return /* @__PURE__ */ p(
144
144
  "div",
145
145
  {
@@ -155,7 +155,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
155
155
  /* @__PURE__ */ p(
156
156
  "p",
157
157
  {
158
- className: R(
158
+ className: A(
159
159
  d ? o.groupLabel : o.rowLabel,
160
160
  !d && t ? o.abnormalValue : ""
161
161
  ),
@@ -172,7 +172,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
172
172
  className: o.groupMembers,
173
173
  "data-testid": `${b}observation-group-members-${e.display}-${r}`,
174
174
  children: e.members?.map((f, $) => /* @__PURE__ */ s(
175
- P,
175
+ j,
176
176
  {
177
177
  member: f,
178
178
  depth: 0,
@@ -185,7 +185,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
185
185
  ) : /* @__PURE__ */ p(
186
186
  "div",
187
187
  {
188
- className: R(
188
+ className: A(
189
189
  o.rowValue,
190
190
  t ? o.abnormalValue : ""
191
191
  ),
@@ -219,13 +219,13 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
219
219
  )?.valueString : void 0, He = (e) => {
220
220
  if (e)
221
221
  return e.note?.[0]?.text;
222
- }, je = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, V = (e, r) => {
223
- const n = je(e, r);
222
+ }, ke = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, V = (e, r) => {
223
+ const n = ke(e, r);
224
224
  return n ? {
225
225
  formFieldPath: Ke(n),
226
226
  comment: He(n)
227
227
  } : {};
228
- }, ke = (e, r) => {
228
+ }, Pe = (e, r) => {
229
229
  if (!e?.entry || !r)
230
230
  return [];
231
231
  const n = pe(e);
@@ -261,30 +261,30 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
261
261
  isError: y,
262
262
  error: z,
263
263
  refetch: Y
264
- } = C({
264
+ } = L({
265
265
  queryKey: ["forms", d, e],
266
266
  queryFn: () => te(d, void 0, v),
267
267
  enabled: !!d && !_
268
268
  }), O = h(() => !r || r.length === 0 ? $ : $.filter(
269
269
  (i) => r.includes(i.encounterUuid)
270
- ), [$, r]), { data: I = [] } = C({
270
+ ), [$, r]), { data: T = [] } = L({
271
271
  queryKey: ["observationForms"],
272
272
  queryFn: () => oe()
273
- }), T = L(
274
- (i) => I.find((u) => u.name === i)?.uuid,
275
- [I]
276
- ), A = h(() => {
273
+ }), I = R(
274
+ (i) => T.find((u) => u.name === i)?.uuid,
275
+ [T]
276
+ ), C = h(() => {
277
277
  if (t)
278
- return T(t.formName);
279
- }, [t, T]), { isLoading: Q, error: S } = C({
280
- queryKey: ["formMetadata", A],
281
- queryFn: () => ne(A),
282
- enabled: !!A && c
278
+ return I(t.formName);
279
+ }, [t, I]), { isLoading: Q, error: S } = L({
280
+ queryKey: ["formMetadata", C],
281
+ queryFn: () => ne(C),
282
+ enabled: !!C && c
283
283
  }), {
284
284
  data: F,
285
285
  isLoading: J,
286
286
  error: w
287
- } = C({
287
+ } = L({
288
288
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
289
289
  queryFn: () => se(t.encounterUuid),
290
290
  enabled: !!t?.encounterUuid && c
@@ -295,7 +295,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
295
295
  },
296
296
  [d]
297
297
  );
298
- const D = h(() => !F || !t?.formName ? [] : ke(
298
+ const D = h(() => !F || !t?.formName ? [] : Pe(
299
299
  F,
300
300
  t.formName
301
301
  ), [F, t?.formName]), G = h(
@@ -335,11 +335,11 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
335
335
  )
336
336
  })
337
337
  ).sort((u, l) => u.formName.localeCompare(l.formName));
338
- }, [O, a]), x = L((i) => {
338
+ }, [O, a]), x = R((i) => {
339
339
  b(i), m(!0);
340
- }, []), W = L(() => {
340
+ }, []), W = R(() => {
341
341
  m(!1), b(null);
342
- }, []), B = L(
342
+ }, []), B = R(
343
343
  (i, u) => {
344
344
  switch (u) {
345
345
  case "recordedOn":
@@ -1,25 +1,25 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BOhjibE5.js";
2
- import { l as d, m as f, o as e } from "./index-C_ok2zy5.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BqSb_VXD.js";
2
+ import { k as d, l as f, m as e } from "./index-DA_fHx-R.js";
3
3
  var p = (a) => {
4
- const [r, o] = c({
4
+ const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
6
6
  }), n = d(), s = f(() => {
7
- const t = r.theme_preference || l;
8
- return t !== "system" ? t : n();
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
  });
@@ -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-BOhjibE5.js";
2
- import { l as v, m as C, o as e } from "./index-C_ok2zy5.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-BqSb_VXD.js";
2
+ import { k as v, l as C, m as e } from "./index-DA_fHx-R.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 $, jsx as c } from "react/jsx-runtime";
2
- import { h as B, p as V, u as I, q as x, W as K, e as z, d as G, r as Q, n as j, A as w, z as H, k as M, x as S, t as W, F as P, D as X, N as Y, j as J } from "./index-C_ok2zy5.js";
2
+ import { h as B, p as V, u as I, q as x, W as K, e as z, d as G, r as Q, n as j, _ as w, z as H, j as M, x as S, t as W, F as P, D as X, N as Y, f as J } from "./index-DA_fHx-R.js";
3
3
  import { useQueries as Z, useQuery as ee } from "@tanstack/react-query";
4
4
  import { useRef as te, useEffect as N, useMemo as h } from "react";
5
- const A = (t, d, i, l, r) => {
5
+ const D = (t, d, i, l, r) => {
6
6
  const a = W(t, d), s = a.value, o = P(s);
7
7
  let n = s;
8
8
  o === "Image" && (n = /* @__PURE__ */ c(Y, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (n = /* @__PURE__ */ c(J, { id: `${s}-video`, videoSrc: s }));
@@ -28,7 +28,7 @@ const A = (t, d, i, l, r) => {
28
28
  id: `grouped-obs-${t.display}-${l}`,
29
29
  open: i,
30
30
  children: t.members?.map(
31
- (s, o) => A(s, o, r, a, d)
31
+ (s, o) => D(s, o, r, a, d)
32
32
  )
33
33
  },
34
34
  `grouped-obs-${t.id}`
@@ -46,7 +46,7 @@ const A = (t, d, i, l, r) => {
46
46
  open: a,
47
47
  children: [
48
48
  r.observations.map(
49
- (n, b) => A(n, b, s, d, i)
49
+ (n, b) => D(n, b, s, d, i)
50
50
  ),
51
51
  r.groupedObservations.map(
52
52
  (n, b) => ae(
@@ -99,9 +99,9 @@ const A = (t, d, i, l, r) => {
99
99
  }, [n, i]);
100
100
  const b = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = h(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), v = h(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
101
101
  data: u,
102
- isLoading: D,
102
+ isLoading: F,
103
103
  isError: R,
104
- refetch: g
104
+ refetch: f
105
105
  } = ee({
106
106
  queryKey: ne(a, p),
107
107
  queryFn: () => K(a, p),
@@ -111,9 +111,9 @@ const A = (t, d, i, l, r) => {
111
111
  (e) => {
112
112
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
113
113
  (m) => p.includes(m)
114
- ) && g();
114
+ ) && f();
115
115
  },
116
- [a, g]
116
+ [a, f]
117
117
  ), N(() => {
118
118
  R && s({
119
119
  title: o("ERROR_DEFAULT_TITLE"),
@@ -121,15 +121,15 @@ const A = (t, d, i, l, r) => {
121
121
  type: "error"
122
122
  });
123
123
  }, [R]);
124
- const f = h(() => {
124
+ const g = h(() => {
125
125
  if (!u) return [];
126
126
  const e = G(u), m = Q(e);
127
127
  return j(m);
128
- }, [u]), F = [
128
+ }, [u]), q = [
129
129
  { key: "name", header: "name" },
130
130
  { key: "value", header: "value" },
131
131
  { key: "form", header: "form" }
132
- ], O = D || !v, _ = R && v, k = (!u || u.entry?.length === 0 || p.length === 0) && v, q = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, L = k ? o("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
132
+ ], _ = F || !v, O = R && v, A = (!u || u.entry?.length === 0 || p.length === 0) && v, L = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, k = g.length > 0 && !_ && !O, E = d.titleTranslationKey, y = E ? o(E) : "";
133
133
  return /* @__PURE__ */ $(
134
134
  "div",
135
135
  {
@@ -148,15 +148,15 @@ const A = (t, d, i, l, r) => {
148
148
  children: /* @__PURE__ */ c("p", { children: y })
149
149
  }
150
150
  ),
151
- U ? /* @__PURE__ */ c(re, { groupedData: f, title: y }) : /* @__PURE__ */ c(
151
+ k ? /* @__PURE__ */ c(re, { groupedData: g, title: y }) : /* @__PURE__ */ c(
152
152
  H,
153
153
  {
154
- headers: F,
154
+ headers: q,
155
155
  rows: [],
156
156
  ariaLabel: o("OBSERVATIONS"),
157
- loading: O,
158
- errorStateMessage: q,
159
- emptyStateMessage: L,
157
+ loading: _,
158
+ errorStateMessage: L,
159
+ emptyStateMessage: U,
160
160
  dataTestId: "observations-table"
161
161
  }
162
162
  )
@@ -1,4 +1,4 @@
1
- import { s as we, v as z, y as xt, B, m as q, o as y, P as Ro, E as ye, S as R, H as _, I as k, L as N, O as A, Q as bs, R as ir, T as $e, X as U, Z as Hn, _ 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-C_ok2zy5.js";
1
+ import { o as we, s as z, w as xt, y as B, l as q, m as y, P as Ro, A as ye, S as R, B as _, E as k, H as N, I as A, L as bs, O as ir, Q as $e, R as U, X 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-DA_fHx-R.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {