@bahmni/registration-app 0.0.1-dev.153 → 0.0.1-dev.155

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,18 +1,18 @@
1
1
  import { jsx as s, jsxs as p, Fragment as P } from "react/jsx-runtime";
2
- import { u as ee, h as re, w as ae, Y as te, W as oe, K as ne, U as se, e as de, i as me, C as ie, z as U, a as le, G as ce, b as ue, c as be, V as q, d as pe, g as _e, f as A, P as fe, M as $e, x as he, F as ve } from "./index-R6hQf4_0.js";
2
+ import { u as ee, h as re, w as ae, Y as te, W as oe, K as ne, U as se, e as de, i as me, C as ie, z as U, a as le, G as ce, b as ue, c as be, V as q, d as pe, g as _e, f as L, P as fe, M as $e, x as he, F as ve } from "./index-Bnufarzo.js";
3
3
  import { useQueryClient as ge, useQuery as C } from "@tanstack/react-query";
4
- import { useState as K, useMemo as g, useCallback as L } from "react";
5
- const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Le = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Fe = "_groupContainer_1pd36_39", Me = "_rowContainer_1pd36_43", Re = "_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", xe = "_abnormalValue_1pd36_102", De = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Be = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
4
+ import { useState as K, useMemo as g, useCallback as A } from "react";
5
+ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Ae = "_formDetailsContainer_1pd36_25", Le = "_observation_1pd36_30", Re = "_groupContainer_1pd36_39", Fe = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Ve = "_rowValue_1pd36_67", Ie = "_groupMembers_1pd36_75", Te = "_memberRow_1pd36_81", Se = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", xe = "_abnormalValue_1pd36_102", De = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Be = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
6
6
  formsTableBody: Ne,
7
7
  customAccordianItem: ye,
8
8
  formContent: Ce,
9
- formDetailsContainer: Le,
10
- observation: Ae,
11
- groupContainer: Fe,
12
- rowContainer: Me,
13
- groupLabel: Re,
14
- rowLabel: Ve,
15
- rowValue: Oe,
9
+ formDetailsContainer: Ae,
10
+ observation: Le,
11
+ groupContainer: Re,
12
+ rowContainer: Fe,
13
+ groupLabel: Me,
14
+ rowLabel: Oe,
15
+ rowValue: Ve,
16
16
  groupMembers: Ie,
17
17
  memberRow: Te,
18
18
  memberLabel: Se,
@@ -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: A(
95
+ className: L(
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: A(
109
+ className: L(
110
110
  o.memberValue,
111
111
  _ ? o.abnormalValue : ""
112
112
  ),
@@ -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: A(
158
+ className: L(
159
159
  d ? o.groupLabel : o.rowLabel,
160
160
  !d && t ? o.abnormalValue : ""
161
161
  ),
@@ -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: A(
188
+ className: L(
189
189
  o.rowValue,
190
190
  t ? o.abnormalValue : ""
191
191
  ),
@@ -219,7 +219,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
219
219
  )?.valueString : void 0, Pe = (e) => {
220
220
  if (e)
221
221
  return e.note?.[0]?.text;
222
- }, ke = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, V = (e, r) => {
222
+ }, ke = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, O = (e, r) => {
223
223
  const n = ke(e, r);
224
224
  return n ? {
225
225
  formFieldPath: Ke(n),
@@ -231,16 +231,16 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
231
231
  const n = pe(e);
232
232
  return [
233
233
  ...n.observations.map((a) => {
234
- const { formFieldPath: d, comment: c } = V(
234
+ const { formFieldPath: d, comment: c } = O(
235
235
  e,
236
236
  a.id
237
237
  );
238
238
  return { obs: a, formFieldPath: d, comment: c };
239
239
  }),
240
240
  ...n.groupedObservations.flatMap((a) => {
241
- const { formFieldPath: d } = V(e, a.id);
241
+ const { formFieldPath: d } = O(e, a.id);
242
242
  return (a.members ?? []).map((c) => {
243
- const { comment: m } = V(e, c.id);
243
+ const { comment: m } = O(e, c.id);
244
244
  return { obs: c, formFieldPath: d, comment: m };
245
245
  });
246
246
  })
@@ -265,23 +265,23 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
265
265
  queryKey: ["forms", d, e],
266
266
  queryFn: () => te(d, void 0, h),
267
267
  enabled: !!d && !_
268
- }), O = g(() => !r || r.length === 0 ? $ : $.filter(
268
+ }), V = g(() => !r || r.length === 0 ? $ : $.filter(
269
269
  (i) => r.includes(i.encounterUuid)
270
270
  ), [$, r]), { data: I = [] } = C({
271
271
  queryKey: ["observationForms"],
272
272
  queryFn: () => oe()
273
- }), T = L(
273
+ }), T = A(
274
274
  (i) => I.find((u) => u.name === i)?.uuid,
275
275
  [I]
276
- ), F = g(() => {
276
+ ), R = g(() => {
277
277
  if (t)
278
278
  return T(t.formName);
279
279
  }, [t, T]), { isLoading: Q, error: S } = C({
280
- queryKey: ["formMetadata", F],
281
- queryFn: () => ne(F),
282
- enabled: !!F && c
280
+ queryKey: ["formMetadata", R],
281
+ queryFn: () => ne(R),
282
+ enabled: !!R && c
283
283
  }), {
284
- data: M,
284
+ data: F,
285
285
  isLoading: W,
286
286
  error: w
287
287
  } = C({
@@ -295,10 +295,10 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
295
295
  },
296
296
  [d]
297
297
  );
298
- const x = g(() => !M || !t?.formName ? [] : He(
299
- M,
298
+ const x = g(() => !F || !t?.formName ? [] : He(
299
+ F,
300
300
  t.formName
301
- ), [M, t?.formName]), D = g(
301
+ ), [F, t?.formName]), D = g(
302
302
  () => [
303
303
  { key: "recordedOn", header: a("FORM_RECORDED_ON") },
304
304
  { key: "recordedBy", header: a("FORM_RECORDED_BY") }
@@ -311,16 +311,16 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
311
311
  ],
312
312
  []
313
313
  ), E = g(() => {
314
- const i = O.reduce(
314
+ const i = V.reduce(
315
315
  (u, l) => {
316
316
  const v = l.formName;
317
317
  u[v] ??= [];
318
- const R = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
318
+ const M = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
319
319
  return u[v].push({
320
320
  id: l.encounterUuid,
321
321
  formName: l.formName,
322
322
  recordedOn: me(l.encounterDateTime, a, _e).formattedResult,
323
- recordedBy: R ?? "--",
323
+ recordedBy: M ?? "--",
324
324
  encounterDateTime: l.encounterDateTime,
325
325
  encounterUuid: l.encounterUuid
326
326
  }), u;
@@ -331,15 +331,15 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
331
331
  ([u, l]) => ({
332
332
  formName: u,
333
333
  records: l.sort(
334
- (v, R) => R.encounterDateTime - v.encounterDateTime
334
+ (v, M) => M.encounterDateTime - v.encounterDateTime
335
335
  )
336
336
  })
337
337
  ).sort((u, l) => u.formName.localeCompare(l.formName));
338
- }, [O, a]), G = L((i) => {
338
+ }, [V, a]), G = A((i) => {
339
339
  b(i), m(!0);
340
- }, []), J = L(() => {
340
+ }, []), J = A(() => {
341
341
  m(!1), b(null);
342
- }, []), B = L(
342
+ }, []), B = A(
343
343
  (i, u) => {
344
344
  switch (u) {
345
345
  case "recordedOn":
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BQ-mXMla.js";
2
- import { l as d, m as f, n as e } from "./index-R6hQf4_0.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BbefJEgY.js";
2
+ import { l as d, m as f, n as e } from "./index-Bnufarzo.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-BQ-mXMla.js";
2
- import { l as v, m as C, n as e } from "./index-R6hQf4_0.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-BbefJEgY.js";
2
+ import { l as v, m as C, n as e } from "./index-Bnufarzo.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,14 +1,14 @@
1
1
  import { jsxs as I, jsx as c } from "react/jsx-runtime";
2
- import { h as V, p as B, u as N, j as Q, q as x, e as H, d as K, k as M, t as j, A as w, z, X as G, H as S, Q as P, P as X, L as Y, M as J, x as W } from "./index-R6hQf4_0.js";
2
+ import { h as B, p as V, u as N, j as Q, q as x, e as H, d as K, k as M, t as j, A as w, z, X as G, H as S, Q as P, P as X, L as Y, M as J, x as W } from "./index-Bnufarzo.js";
3
3
  import { useQueries as Z, useQuery as ee } from "@tanstack/react-query";
4
- import { useRef as te, useEffect as T, useMemo as h } from "react";
4
+ import { useRef as te, useEffect as $, useMemo as h } from "react";
5
5
  const A = (t, d, i, l, r) => {
6
6
  const a = P(t, d), s = a.value, o = X(s);
7
7
  let n = s;
8
8
  o === "Image" && (n = /* @__PURE__ */ c(J, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (n = /* @__PURE__ */ c(W, { id: `${s}-video`, videoSrc: s }));
9
9
  const b = r("OBSERVATIONS_RECORDED_BY", {
10
10
  provider: a.provider
11
- }), m = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${m}-${i}-${d}` : `${v}-${m}-${i}-${d}`;
11
+ }), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${p}-${i}-${d}` : `${v}-${p}-${i}-${d}`;
12
12
  return /* @__PURE__ */ c(
13
13
  Y,
14
14
  {
@@ -74,47 +74,47 @@ const A = (t, d, i, l, r) => {
74
74
  )
75
75
  }
76
76
  );
77
- }, se = "_observations_kfbhq_1", oe = "_title_kfbhq_12", $ = {
77
+ }, se = "_observations_kfbhq_1", oe = "_title_kfbhq_12", T = {
78
78
  observations: se,
79
79
  title: oe
80
80
  }, ie = (t) => ["conceptUuid", t], ne = (t, d) => ["observations", t, ...d], be = ({ config: t }) => {
81
- const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, r = te(/* @__PURE__ */ new Set()), a = V(), { addNotification: s } = B(), { t: o } = N(), n = Z({
81
+ const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, r = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = V(), { t: o } = N(), n = Z({
82
82
  queries: i.map((e) => ({
83
83
  queryKey: ie(e),
84
84
  queryFn: () => Q(e),
85
85
  enabled: !!e
86
86
  }))
87
87
  });
88
- T(() => {
89
- n.forEach((e, p) => {
90
- if (e.isError && !r.current.has(p)) {
91
- const C = i[p];
88
+ $(() => {
89
+ n.forEach((e, m) => {
90
+ if (e.isError && !r.current.has(m)) {
91
+ const C = i[m];
92
92
  s({
93
93
  title: o("ERROR_DEFAULT_TITLE"),
94
94
  message: o("ERROR_FETCHING_CONCEPT", { conceptName: C }),
95
95
  type: "error"
96
- }), r.current.add(p);
97
- } else e.isError || r.current.delete(p);
96
+ }), r.current.add(m);
97
+ } else e.isError || r.current.delete(m);
98
98
  });
99
99
  }, [n, i]);
100
- const b = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), m = h(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), v = h(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
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
102
  isLoading: L,
103
103
  isError: R,
104
104
  refetch: g
105
105
  } = ee({
106
- queryKey: ne(a, m),
107
- queryFn: () => x(a, m),
108
- enabled: !!a && m.length > 0 && v
106
+ queryKey: ne(a, p),
107
+ queryFn: () => x(a, p),
108
+ enabled: !!a && p.length > 0 && v
109
109
  });
110
110
  H(
111
111
  (e) => {
112
112
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
113
- (p) => m.includes(p)
113
+ (m) => p.includes(m)
114
114
  ) && g();
115
115
  },
116
116
  [a, g]
117
- ), T(() => {
117
+ ), $(() => {
118
118
  R && s({
119
119
  title: o("ERROR_DEFAULT_TITLE"),
120
120
  message: o("ERROR_FETCHING_OBSERVATIONS"),
@@ -123,20 +123,20 @@ const A = (t, d, i, l, r) => {
123
123
  }, [R]);
124
124
  const f = h(() => {
125
125
  if (!u) return [];
126
- const e = K(u), p = M(e);
127
- return j(p);
128
- }, [u]), D = [
126
+ const e = K(u), m = M(e);
127
+ return j(m);
128
+ }, [u]), q = [
129
129
  { key: "name", header: "name" },
130
130
  { key: "value", header: "value" },
131
131
  { key: "form", header: "form" }
132
- ], O = L || !v, _ = R && v, q = (!u || u.entry?.length === 0 || m.length === 0) && v, F = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = q ? o("NO_OBSERVATIONS_FOUND") : void 0, k = f.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
132
+ ], O = L || !v, _ = R && v, D = (!u || u.entry?.length === 0 || p.length === 0) && v, F = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = D ? o("NO_OBSERVATIONS_FOUND") : void 0, k = f.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
133
133
  return /* @__PURE__ */ I(
134
134
  "div",
135
135
  {
136
136
  id: "observations",
137
137
  "data-testid": E ? `observations-${y}` : "observations",
138
138
  "aria-label": "observations-aria-label",
139
- className: $.observations,
139
+ className: T.observations,
140
140
  children: [
141
141
  /* @__PURE__ */ c(
142
142
  w,
@@ -144,14 +144,14 @@ const A = (t, d, i, l, r) => {
144
144
  id: "observations-title",
145
145
  testId: E ? `observations-title-${y}` : "observations-title",
146
146
  title: y,
147
- className: $.title,
147
+ className: T.title,
148
148
  children: /* @__PURE__ */ c("p", { children: y })
149
149
  }
150
150
  ),
151
151
  k ? /* @__PURE__ */ c(re, { groupedData: f, title: y }) : /* @__PURE__ */ c(
152
152
  z,
153
153
  {
154
- headers: D,
154
+ headers: q,
155
155
  rows: [],
156
156
  ariaLabel: o("OBSERVATIONS"),
157
157
  loading: O,
@@ -1,4 +1,4 @@
1
- import { o as we, r as z, s as xt, v as B, m as q, n as y, y as Ro, B as ye, S as R, D as _, E as k, I as N, J as A, N as bs, O as ir, R as $e, T 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 Os } from "./index-R6hQf4_0.js";
1
+ import { o as we, r as z, s as xt, v as B, m as q, n as y, y as Ro, B as ye, S as R, D as _, E as k, I as N, J as A, N as bs, O as ir, R as $e, T 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 Os } from "./index-Bnufarzo.js";
2
2
  var Ls = (e) => e != null, qs = (e) => e.filter(Ls);
3
3
  function _s(e) {
4
4
  return (...t) => {