@bahmni/clinical-app 0.0.1-dev.154 → 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,17 +1,17 @@
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, a as te, b as C, e as oe, i as ne, C as se, z as U, Y as de, G as me, c as ie, d as le, V as q, f as ce, g as ue, j as A, P as be, M as pe, x as _e, F as fe, k as $e, W as he, K as ve, U as ge } from "./index-stDG41fx.js";
3
- import { useState as K, useMemo as g, useCallback as L } from "react";
4
- 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 = {
2
+ import { u as ee, h as re, w as ae, a as te, b as C, e as oe, i as ne, C as se, z as U, Y as de, G as me, c as ie, d as le, V as q, f as ce, g as ue, j as L, P as be, M as pe, x as _e, F as fe, k as $e, W as he, K as ve, U as ge } from "./index-BXHBayWR.js";
3
+ import { useState as K, useMemo as g, useCallback as A } from "react";
4
+ 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 = {
5
5
  formsTableBody: Ne,
6
6
  customAccordianItem: ye,
7
7
  formContent: Ce,
8
- formDetailsContainer: Le,
9
- observation: Ae,
10
- groupContainer: Fe,
11
- rowContainer: Me,
12
- groupLabel: Re,
13
- rowLabel: Ve,
14
- rowValue: Oe,
8
+ formDetailsContainer: Ae,
9
+ observation: Le,
10
+ groupContainer: Re,
11
+ rowContainer: Fe,
12
+ groupLabel: Me,
13
+ rowLabel: Oe,
14
+ rowValue: Ve,
15
15
  groupMembers: Ie,
16
16
  memberRow: Te,
17
17
  memberLabel: Se,
@@ -91,7 +91,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
91
91
  /* @__PURE__ */ p(
92
92
  "p",
93
93
  {
94
- className: A(
94
+ className: L(
95
95
  o.memberLabel,
96
96
  _ ? o.abnormalValue : ""
97
97
  ),
@@ -105,7 +105,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
105
105
  /* @__PURE__ */ p(
106
106
  "div",
107
107
  {
108
- className: A(
108
+ className: L(
109
109
  o.memberValue,
110
110
  _ ? o.abnormalValue : ""
111
111
  ),
@@ -154,7 +154,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
154
154
  /* @__PURE__ */ p(
155
155
  "p",
156
156
  {
157
- className: A(
157
+ className: L(
158
158
  d ? o.groupLabel : o.rowLabel,
159
159
  !d && t ? o.abnormalValue : ""
160
160
  ),
@@ -184,7 +184,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
184
184
  ) : /* @__PURE__ */ p(
185
185
  "div",
186
186
  {
187
- className: A(
187
+ className: L(
188
188
  o.rowValue,
189
189
  t ? o.abnormalValue : ""
190
190
  ),
@@ -218,7 +218,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
218
218
  )?.valueString : void 0, Pe = (e) => {
219
219
  if (e)
220
220
  return e.note?.[0]?.text;
221
- }, ke = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, V = (e, r) => {
221
+ }, ke = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, O = (e, r) => {
222
222
  const n = ke(e, r);
223
223
  return n ? {
224
224
  formFieldPath: Ke(n),
@@ -230,16 +230,16 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
230
230
  const n = ce(e);
231
231
  return [
232
232
  ...n.observations.map((a) => {
233
- const { formFieldPath: d, comment: c } = V(
233
+ const { formFieldPath: d, comment: c } = O(
234
234
  e,
235
235
  a.id
236
236
  );
237
237
  return { obs: a, formFieldPath: d, comment: c };
238
238
  }),
239
239
  ...n.groupedObservations.flatMap((a) => {
240
- const { formFieldPath: d } = V(e, a.id);
240
+ const { formFieldPath: d } = O(e, a.id);
241
241
  return (a.members ?? []).map((c) => {
242
- const { comment: m } = V(e, c.id);
242
+ const { comment: m } = O(e, c.id);
243
243
  return { obs: c, formFieldPath: d, comment: m };
244
244
  });
245
245
  })
@@ -264,23 +264,23 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
264
264
  queryKey: ["forms", d, e],
265
265
  queryFn: () => $e(d, void 0, h),
266
266
  enabled: !!d && !_
267
- }), O = g(() => !r || r.length === 0 ? $ : $.filter(
267
+ }), V = g(() => !r || r.length === 0 ? $ : $.filter(
268
268
  (i) => r.includes(i.encounterUuid)
269
269
  ), [$, r]), { data: I = [] } = C({
270
270
  queryKey: ["observationForms"],
271
271
  queryFn: () => he()
272
- }), T = L(
272
+ }), T = A(
273
273
  (i) => I.find((u) => u.name === i)?.uuid,
274
274
  [I]
275
- ), F = g(() => {
275
+ ), R = g(() => {
276
276
  if (t)
277
277
  return T(t.formName);
278
278
  }, [t, T]), { isLoading: Q, error: S } = C({
279
- queryKey: ["formMetadata", F],
280
- queryFn: () => ve(F),
281
- enabled: !!F && c
279
+ queryKey: ["formMetadata", R],
280
+ queryFn: () => ve(R),
281
+ enabled: !!R && c
282
282
  }), {
283
- data: M,
283
+ data: F,
284
284
  isLoading: W,
285
285
  error: w
286
286
  } = C({
@@ -294,10 +294,10 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
294
294
  },
295
295
  [d]
296
296
  );
297
- const x = g(() => !M || !t?.formName ? [] : je(
298
- M,
297
+ const x = g(() => !F || !t?.formName ? [] : je(
298
+ F,
299
299
  t.formName
300
- ), [M, t?.formName]), D = g(
300
+ ), [F, t?.formName]), D = g(
301
301
  () => [
302
302
  { key: "recordedOn", header: a("FORM_RECORDED_ON") },
303
303
  { key: "recordedBy", header: a("FORM_RECORDED_BY") }
@@ -310,16 +310,16 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
310
310
  ],
311
311
  []
312
312
  ), E = g(() => {
313
- const i = O.reduce(
313
+ const i = V.reduce(
314
314
  (u, l) => {
315
315
  const v = l.formName;
316
316
  u[v] ??= [];
317
- const R = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
317
+ const M = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
318
318
  return u[v].push({
319
319
  id: l.encounterUuid,
320
320
  formName: l.formName,
321
321
  recordedOn: ne(l.encounterDateTime, a, ue).formattedResult,
322
- recordedBy: R ?? "--",
322
+ recordedBy: M ?? "--",
323
323
  encounterDateTime: l.encounterDateTime,
324
324
  encounterUuid: l.encounterUuid
325
325
  }), u;
@@ -330,15 +330,15 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
330
330
  ([u, l]) => ({
331
331
  formName: u,
332
332
  records: l.sort(
333
- (v, R) => R.encounterDateTime - v.encounterDateTime
333
+ (v, M) => M.encounterDateTime - v.encounterDateTime
334
334
  )
335
335
  })
336
336
  ).sort((u, l) => u.formName.localeCompare(l.formName));
337
- }, [O, a]), G = L((i) => {
337
+ }, [V, a]), G = A((i) => {
338
338
  b(i), m(!0);
339
- }, []), J = L(() => {
339
+ }, []), J = A(() => {
340
340
  m(!1), b(null);
341
- }, []), B = L(
341
+ }, []), B = A(
342
342
  (i, u) => {
343
343
  switch (u) {
344
344
  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-BJExYDyP.js";
2
- import { o as d, r as f, s as e } from "./index-stDG41fx.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Be9utoWc.js";
2
+ import { o as d, r as f, s as e } from "./index-BXHBayWR.js";
3
3
  var p = (a) => {
4
4
  const [r, o] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
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-BJExYDyP.js";
2
- import { o as v, r as C, s as e } from "./index-stDG41fx.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-Be9utoWc.js";
2
+ import { o as v, r as C, s as e } from "./index-BXHBayWR.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = l({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,13 +1,13 @@
1
1
  import { jsxs as I, jsx as c } from "react/jsx-runtime";
2
- import { h as k, p as B, u as N, l as Q, m as x, b as H, e as K, f as M, n as j, t as w, A as z, z as G, X as P, H as S, Q as X, P as Y, L as J, M as W, x as Z, q as ee } from "./index-stDG41fx.js";
3
- import { useRef as te, useEffect as T, useMemo as h } from "react";
2
+ import { h as B, p as V, u as N, l as Q, m as x, b as H, e as K, f as M, n as w, t as j, A as z, z as G, X as P, H as S, Q as X, P as Y, L as J, M as W, x as Z, q as ee } from "./index-BXHBayWR.js";
3
+ import { useRef as te, useEffect as $, useMemo as h } from "react";
4
4
  const A = (t, d, i, l, s) => {
5
5
  const a = X(t, d), r = a.value, o = Y(r);
6
6
  let n = r;
7
7
  o === "Image" && (n = /* @__PURE__ */ c(W, { imageSrc: r, alt: r, id: `${r}-img` })), o === "Video" && (n = /* @__PURE__ */ c(Z, { id: `${r}-video`, videoSrc: r }));
8
8
  const b = s("OBSERVATIONS_RECORDED_BY", {
9
9
  provider: a.provider
10
- }), m = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${m}-${i}-${d}` : `${v}-${m}-${i}-${d}`;
10
+ }), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${p}-${i}-${d}` : `${v}-${p}-${i}-${d}`;
11
11
  return /* @__PURE__ */ c(
12
12
  J,
13
13
  {
@@ -73,47 +73,47 @@ const A = (t, d, i, l, s) => {
73
73
  )
74
74
  }
75
75
  );
76
- }, re = "_observations_kfbhq_1", oe = "_title_kfbhq_12", $ = {
76
+ }, re = "_observations_kfbhq_1", oe = "_title_kfbhq_12", T = {
77
77
  observations: re,
78
78
  title: oe
79
79
  }, ie = (t) => ["conceptUuid", t], ne = (t, d) => ["observations", t, ...d], ce = ({ config: t }) => {
80
- const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, s = te(/* @__PURE__ */ new Set()), a = k(), { addNotification: r } = B(), { t: o } = N(), n = Q({
80
+ const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, s = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: r } = V(), { t: o } = N(), n = Q({
81
81
  queries: i.map((e) => ({
82
82
  queryKey: ie(e),
83
83
  queryFn: () => x(e),
84
84
  enabled: !!e
85
85
  }))
86
86
  });
87
- T(() => {
88
- n.forEach((e, p) => {
89
- if (e.isError && !s.current.has(p)) {
90
- const V = i[p];
87
+ $(() => {
88
+ n.forEach((e, m) => {
89
+ if (e.isError && !s.current.has(m)) {
90
+ const k = i[m];
91
91
  r({
92
92
  title: o("ERROR_DEFAULT_TITLE"),
93
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: V }),
93
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: k }),
94
94
  type: "error"
95
- }), s.current.add(p);
96
- } else e.isError || s.current.delete(p);
95
+ }), s.current.add(m);
96
+ } else e.isError || s.current.delete(m);
97
97
  });
98
98
  }, [n, i]);
99
- 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]), {
99
+ 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]), {
100
100
  data: u,
101
101
  isLoading: L,
102
102
  isError: R,
103
103
  refetch: g
104
104
  } = H({
105
- queryKey: ne(a, m),
106
- queryFn: () => ee(a, m),
107
- enabled: !!a && m.length > 0 && v
105
+ queryKey: ne(a, p),
106
+ queryFn: () => ee(a, p),
107
+ enabled: !!a && p.length > 0 && v
108
108
  });
109
109
  K(
110
110
  (e) => {
111
111
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
112
- (p) => m.includes(p)
112
+ (m) => p.includes(m)
113
113
  ) && g();
114
114
  },
115
115
  [a, g]
116
- ), T(() => {
116
+ ), $(() => {
117
117
  R && r({
118
118
  title: o("ERROR_DEFAULT_TITLE"),
119
119
  message: o("ERROR_FETCHING_OBSERVATIONS"),
@@ -122,20 +122,20 @@ const A = (t, d, i, l, s) => {
122
122
  }, [R]);
123
123
  const f = h(() => {
124
124
  if (!u) return [];
125
- const e = M(u), p = j(e);
126
- return w(p);
127
- }, [u]), D = [
125
+ const e = M(u), m = w(e);
126
+ return j(m);
127
+ }, [u]), q = [
128
128
  { key: "name", header: "name" },
129
129
  { key: "value", header: "value" },
130
130
  { key: "form", header: "form" }
131
- ], 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, C = f.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
131
+ ], 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, C = f.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
132
132
  return /* @__PURE__ */ I(
133
133
  "div",
134
134
  {
135
135
  id: "observations",
136
136
  "data-testid": E ? `observations-${y}` : "observations",
137
137
  "aria-label": "observations-aria-label",
138
- className: $.observations,
138
+ className: T.observations,
139
139
  children: [
140
140
  /* @__PURE__ */ c(
141
141
  z,
@@ -143,14 +143,14 @@ const A = (t, d, i, l, s) => {
143
143
  id: "observations-title",
144
144
  testId: E ? `observations-title-${y}` : "observations-title",
145
145
  title: y,
146
- className: $.title,
146
+ className: T.title,
147
147
  children: /* @__PURE__ */ c("p", { children: y })
148
148
  }
149
149
  ),
150
150
  C ? /* @__PURE__ */ c(se, { groupedData: f, title: y }) : /* @__PURE__ */ c(
151
151
  G,
152
152
  {
153
- headers: D,
153
+ headers: q,
154
154
  rows: [],
155
155
  ariaLabel: o("OBSERVATIONS"),
156
156
  loading: O,
@@ -1,4 +1,4 @@
1
- import { v as we, y as z, B as xt, D as B, r as q, s as y, E as Ro, I as ye, S as R, J as _, N as k, O as N, R as A, T as bs, Z as ir, _ as $e, $ as U, a0 as Hn, a1 as Vn, a2 as dt, a3 as D, a4 as xs, a5 as cn, a6 as Be, a7 as ws, a8 as qt, a9 as zt, aa as $s, ab as Cs, ac as $n, ad as Ss, ae as Nr, af as Bt, ag as zo, ah as ks, ai as Es, aj as j, ak as Ur, al as Ms, am as Ds, an as sr, ao as As, ap as Ts, aq as zn, ar as Fs, as as Is, at as Z, au as Ps, av as Os } from "./index-stDG41fx.js";
1
+ import { v as we, y as z, B as xt, D as B, r as q, s as y, E as Ro, I as ye, S as R, J as _, N as k, O as N, R as A, T as bs, Z as ir, _ as $e, $ as U, a0 as Hn, a1 as Vn, a2 as dt, a3 as D, a4 as xs, a5 as cn, a6 as Be, a7 as ws, a8 as qt, a9 as zt, aa as $s, ab as Cs, ac as $n, ad as Ss, ae as Nr, af as Bt, ag as zo, ah as ks, ai as Es, aj as j, ak as Ur, al as Ms, am as Ds, an as sr, ao as As, ap as Ts, aq as zn, ar as Fs, as as Is, at as Z, au as Ps, av as Os } from "./index-BXHBayWR.js";
2
2
  var Ls = (e) => e != null, qs = (e) => e.filter(Ls);
3
3
  function _s(e) {
4
4
  return (...t) => {