@bahmni/clinical-app 0.0.1-dev.362 → 0.0.1-dev.364

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,9 +1,9 @@
1
1
  import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { g as B, K as q, u as N, o as M, q as H, i as Q, V as k, H as w, M as x, r as G, U as z, t as j, F, y as P, w as J, I as W, x as X, z as Z, A as ee } from "./index-DVofVra1.js";
3
- import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
2
+ import { g as B, K as V, u as N, j as M, k, d as x, x as Q, A as G, _ as j, l as w, U as z, M as H, q as A, n as P, o as J, I as W, r as X, y as Z, z as ee } from "./index-Chw6QDJN.js";
3
+ import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as E } from "react";
5
- const A = (t, n, d, l, b, r) => {
6
- const a = P(t, n, b), s = a.value, o = J(s);
5
+ const D = (a, n, d, l, b, r) => {
6
+ const t = P(a, n, b), s = t.value, o = J(s);
7
7
  let i = s;
8
8
  o === "Image" && (i = /* @__PURE__ */ u(
9
9
  X,
@@ -22,54 +22,54 @@ const A = (t, n, d, l, b, r) => {
22
22
  }
23
23
  )), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
24
24
  const m = b("OBSERVATIONS_RECORDED_BY", {
25
- provider: a.provider
26
- }), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
25
+ provider: t.provider
26
+ }), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
27
27
  return /* @__PURE__ */ u(
28
28
  W,
29
29
  {
30
- header: a.header,
30
+ header: t.header,
31
31
  value: i,
32
32
  info: m,
33
33
  id: c,
34
34
  testId: c,
35
35
  ariaLabel: c
36
36
  },
37
- `obs-${t.id}`
37
+ `obs-${a.id}`
38
38
  );
39
- }, re = (t, n, d, l, b, r, a) => /* @__PURE__ */ u(
40
- F,
39
+ }, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
40
+ A,
41
41
  {
42
- title: t.display,
43
- id: `grouped-obs-${t.display}-${l}`,
42
+ title: a.display,
43
+ id: `grouped-obs-${a.display}-${l}`,
44
44
  open: d,
45
- children: t.members?.map(
46
- (s, o) => A(
45
+ children: a.members?.map(
46
+ (s, o) => D(
47
47
  s,
48
48
  o,
49
49
  b,
50
50
  r,
51
51
  n,
52
- a
52
+ t
53
53
  )
54
54
  )
55
55
  },
56
- `grouped-obs-${t.id}`
56
+ `grouped-obs-${a.id}`
57
57
  ), oe = ({
58
- groupedData: t,
58
+ groupedData: a,
59
59
  title: n = "",
60
60
  hideThumbnail: d
61
61
  }) => {
62
- const { t: l } = N(), b = (r, a, s) => {
63
- const o = j(r.encounterDetails, l);
62
+ const { t: l } = N(), b = (r, t, s) => {
63
+ const o = H(r.encounterDetails, l);
64
64
  return /* @__PURE__ */ S(
65
- F,
65
+ A,
66
66
  {
67
67
  title: o,
68
68
  id: `encounter-${r.encounterId}`,
69
- open: a,
69
+ open: t,
70
70
  children: [
71
71
  r.observations.map(
72
- (i, m) => A(
72
+ (i, m) => D(
73
73
  i,
74
74
  m,
75
75
  s,
@@ -82,7 +82,7 @@ const A = (t, n, d, l, b, r) => {
82
82
  (i, m) => re(
83
83
  i,
84
84
  l,
85
- a,
85
+ t,
86
86
  m,
87
87
  s,
88
88
  n,
@@ -100,20 +100,20 @@ const A = (t, n, d, l, b, r) => {
100
100
  id: "obs-by-encounter",
101
101
  "data-testid": "obs-by-encounter-test-id",
102
102
  "aria-label": "obs-by-encounter-aria-label",
103
- children: t.map(
104
- (r, a) => b(r, a === 0, a)
103
+ children: a.map(
104
+ (r, t) => b(r, t === 0, t)
105
105
  )
106
106
  }
107
107
  );
108
108
  }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
109
109
  observations: ie,
110
110
  title: ne
111
- }, de = (t) => ["conceptUuid", t], le = (t, n) => ["observations", t, ...n], pe = ({ config: t }) => {
112
- const n = t, {
111
+ }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
112
+ const n = a, {
113
113
  conceptNames: d = [],
114
114
  conceptUuid: l = [],
115
115
  hideThumbnail: b = !1
116
- } = n, r = se(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = q(), { t: o } = N(), i = te({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } = V(), { t: o } = N(), i = ae({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
119
  queryFn: () => M(e),
@@ -123,10 +123,10 @@ const A = (t, n, d, l, b, r) => {
123
123
  $(() => {
124
124
  i.forEach((e, h) => {
125
125
  if (e.isError && !r.current.has(h)) {
126
- const Y = d[h];
126
+ const q = d[h];
127
127
  s({
128
128
  title: o("ERROR_DEFAULT_TITLE"),
129
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: Y }),
129
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: q }),
130
130
  type: "error"
131
131
  }), r.current.add(h);
132
132
  } else e.isError || r.current.delete(h);
@@ -134,21 +134,21 @@ const A = (t, n, d, l, b, r) => {
134
134
  }, [i, d]);
135
135
  const m = E(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = E(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = E(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
136
136
  data: c,
137
- isLoading: D,
137
+ isLoading: F,
138
138
  isError: g,
139
139
  refetch: T
140
- } = ae({
141
- queryKey: le(a, p),
142
- queryFn: () => H(a, p),
143
- enabled: !!a && p.length > 0 && y
140
+ } = te({
141
+ queryKey: le(t, p),
142
+ queryFn: () => k(t, p),
143
+ enabled: !!t && p.length > 0 && y
144
144
  });
145
- Q(
145
+ x(
146
146
  (e) => {
147
- e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
147
+ e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
148
  (h) => p.includes(h)
149
149
  ) && T();
150
150
  },
151
- [a, T]
151
+ [t, T]
152
152
  ), $(() => {
153
153
  g && s({
154
154
  title: o("ERROR_DEFAULT_TITLE"),
@@ -158,13 +158,13 @@ const A = (t, n, d, l, b, r) => {
158
158
  }, [g]);
159
159
  const O = E(() => {
160
160
  if (!c) return [];
161
- const e = k(c), h = w(e);
162
- return x(h);
161
+ const e = Q(c), h = G(e);
162
+ return j(h);
163
163
  }, [c]), L = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], f = D || !y, _ = g && y, U = (!c || c.entry?.length === 0 || p.length === 0) && y, V = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = U ? o("NO_OBSERVATIONS_FOUND") : void 0, K = O.length > 0 && !f && !_, R = n.titleTranslationKey, v = R ? o(R) : "";
167
+ ], _ = F || !y, f = g && y, U = (!c || c.entry?.length === 0 || p.length === 0) && y, C = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, K = U ? o("NO_OBSERVATIONS_FOUND") : void 0, Y = O.length > 0 && !_ && !f, R = n.titleTranslationKey, v = R ? o(R) : "";
168
168
  return /* @__PURE__ */ S(
169
169
  "div",
170
170
  {
@@ -174,7 +174,7 @@ const A = (t, n, d, l, b, r) => {
174
174
  className: I.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
- G,
177
+ w,
178
178
  {
179
179
  id: "observations-title",
180
180
  testId: R ? `observations-title-${v}` : "observations-title",
@@ -183,7 +183,7 @@ const A = (t, n, d, l, b, r) => {
183
183
  children: /* @__PURE__ */ u("p", { children: v })
184
184
  }
185
185
  ),
186
- K ? /* @__PURE__ */ u(
186
+ Y ? /* @__PURE__ */ u(
187
187
  oe,
188
188
  {
189
189
  groupedData: O,
@@ -196,9 +196,9 @@ const A = (t, n, d, l, b, r) => {
196
196
  headers: L,
197
197
  rows: [],
198
198
  ariaLabel: o("OBSERVATIONS"),
199
- loading: f,
200
- errorStateMessage: V,
201
- emptyStateMessage: C,
199
+ loading: _,
200
+ errorStateMessage: C,
201
+ emptyStateMessage: K,
202
202
  dataTestId: "observations-table"
203
203
  }
204
204
  )
@@ -1,4 +1,4 @@
1
- import { bQ as we, bR as z, bS as xt, bT as B, bO as q, bP as y, bU as Ro, bV as ye, bW as R, bX as _, bY as k, bZ as N, b_ as A, b$ as bs, c0 as ir, c1 as $e, c2 as U, c3 as Hn, c4 as Vn, c5 as dt, c6 as D, c7 as xs, c8 as cn, c9 as Be, ca as ws, cb as qt, cc as zt, cd as $s, ce as Cs, cf as $n, cg as Ss, ch as Nr, ci as Bt, cj as zo, ck as ks, cl as Es, cm as j, cn as Ur, co as Ms, cp as Ds, cq as sr, cr as As, cs as Ts, ct as zn, cu as Fs, cv as Is, cw as Z, cx as Ps, cy as Os } from "./index-DVofVra1.js";
1
+ import { bQ as we, bR as z, bS as xt, bT as B, bO as q, bP as y, bU as Ro, bV as ye, bW as R, bX as _, bY as k, bZ as N, b_ as A, b$ as bs, c0 as ir, c1 as $e, c2 as U, c3 as Hn, c4 as Vn, c5 as dt, c6 as D, c7 as xs, c8 as cn, c9 as Be, ca as ws, cb as qt, cc as zt, cd as $s, ce as Cs, cf as $n, cg as Ss, ch as Nr, ci as Bt, cj as zo, ck as ks, cl as Es, cm as j, cn as Ur, co as Ms, cp as Ds, cq as sr, cr as As, cs as Ts, ct as zn, cu as Fs, cv as Is, cw as Z, cx as Ps, cy as Os } from "./index-Chw6QDJN.js";
2
2
  var Ls = (e) => e != null, qs = (e) => e.filter(Ls);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,4 +1,4 @@
1
- import { bL as i, bM as o } from "./index-DVofVra1.js";
1
+ import { bL as i, bM as o } from "./index-Chw6QDJN.js";
2
2
  import "react";
3
3
  import "react/jsx-runtime";
4
4
  import "@tanstack/react-query";
@@ -1,15 +1,16 @@
1
1
  import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { u as r, cz as o, cA as l, cB as c, b7 as m, b8 as g, cC as h, cD as b, cE as p, aG as u } from "./index-DVofVra1.js";
3
- import { Suspense as E } from "react";
2
+ import { u as r, cz as l, cA as o, cB as c, b7 as m, b8 as g, cC as p, cD as h, cE as b, aG as u } from "./index-Chw6QDJN.js";
3
+ import { Suspense as _ } from "react";
4
4
  import "@tanstack/react-query";
5
- const _ = "index-module_loading__FAL7n", $ = "index-module_message__KjCnF", t = {
6
- loading: _,
7
- message: $
5
+ const E = "index-module_loading__FAL7n", $ = "index-module_message__KjCnF", H = "index-module_panel__j5vTu", s = {
6
+ loading: E,
7
+ message: $,
8
+ panel: H
8
9
  }, I = ({ extensions: i }) => {
9
- const { t: s } = r();
10
- return i.length === 0 ? null : /* @__PURE__ */ d(o, { children: [
10
+ const { t: n } = r();
11
+ return i.length === 0 ? null : /* @__PURE__ */ d(l, { children: [
11
12
  /* @__PURE__ */ e(
12
- l,
13
+ o,
13
14
  {
14
15
  id: "search-extension-tab-list",
15
16
  "data-testid": "search-extension-tab-list-test-id",
@@ -30,33 +31,34 @@ const _ = "index-module_loading__FAL7n", $ = "index-module_message__KjCnF", t =
30
31
  size: g.SM
31
32
  }
32
33
  ) : void 0,
33
- children: s(a.translationKey)
34
+ children: n(a.translationKey)
34
35
  },
35
36
  a.id
36
37
  ))
37
38
  }
38
39
  ),
39
- /* @__PURE__ */ e(h, { children: i.map((a) => {
40
- const n = b(
40
+ /* @__PURE__ */ e(p, { children: i.map((a) => {
41
+ const t = h(
41
42
  a.extensionParams?.searchHandler ?? ""
42
43
  )?.component;
43
44
  return /* @__PURE__ */ e(
44
- p,
45
+ b,
45
46
  {
46
47
  id: `${a.id}-panel`,
48
+ className: s.panel,
47
49
  "data-testid": `${a.id}-panel-test-id`,
48
50
  "aria-label": `Panel ${a.id}`,
49
- children: n ? /* @__PURE__ */ e(
50
- E,
51
+ children: t ? /* @__PURE__ */ e(
52
+ _,
51
53
  {
52
54
  fallback: /* @__PURE__ */ e(
53
55
  u,
54
56
  {
55
57
  type: "multi",
56
- className: t.loading
58
+ className: s.loading
57
59
  }
58
60
  ),
59
- children: /* @__PURE__ */ e(n, { extensionParams: a.extensionParams })
61
+ children: /* @__PURE__ */ e(t, { extensionParams: a.extensionParams })
60
62
  }
61
63
  ) : /* @__PURE__ */ e(
62
64
  "p",
@@ -64,8 +66,8 @@ const _ = "index-module_loading__FAL7n", $ = "index-module_message__KjCnF", t =
64
66
  id: "extension-widget-not-registered",
65
67
  "data-testid": "extension-widget-not-registered-test-id",
66
68
  "aria-label": "Extension widget not registered",
67
- className: t.message,
68
- children: s("EXTENSION_WIDGET_NOT_REGISTERED")
69
+ className: s.message,
70
+ children: n("EXTENSION_WIDGET_NOT_REGISTERED")
69
71
  }
70
72
  )
71
73
  },
@@ -1,37 +1,36 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { bD as m, u, J as p, bA as f, bK as b, aG as _, bG as x } from "./index-DVofVra1.js";
3
- import { lazy as N, useMemo as r, Suspense as h } from "react";
2
+ import { bD as m, u, J as p, bA as f, bK as x, aG as _, bG as b } from "./index-Chw6QDJN.js";
3
+ import { lazy as h, useMemo as l, Suspense as E } from "react";
4
4
  import "@tanstack/react-query";
5
- import { u as E } from "./hook-BoQL42hZ.js";
6
- const P = (s) => {
7
- const i = /* @__PURE__ */ new Map();
8
- for (const e of s) {
9
- const o = i.get(e.extensionPointId) ?? [];
10
- o.push(e), i.set(e.extensionPointId, o);
5
+ import { u as N } from "./hook-BIEi04O4.js";
6
+ const P = (i) => {
7
+ const s = /* @__PURE__ */ new Map();
8
+ for (const e of i) {
9
+ const o = s.get(e.extensionPointId) ?? [];
10
+ o.push(e), s.set(e.extensionPointId, o);
11
11
  }
12
- return i;
13
- }, v = (s, i) => s.filter(
14
- (e) => !e.requiredPrivileges || e.requiredPrivileges.length === 0 || m(i, e.requiredPrivileges)
12
+ return s;
13
+ }, v = (i, s) => i.filter(
14
+ (e) => !e.requiredPrivileges || e.requiredPrivileges.length === 0 || m(s, e.requiredPrivileges)
15
15
  ), C = {
16
- "org.bahmni.clinical.v2.search": N(
17
- () => import("./index-8hfTiSbB.js")
16
+ "org.bahmni.clinical.v2.search": h(
17
+ () => import("./index-BlVbMbpX.js")
18
18
  )
19
- }, L = "index-module_page__16xxw", I = "index-module_loading__wNI-4", y = "index-module_tabs__ZZv8Y", H = "index-module_message__Ib5Iw", l = {
19
+ }, L = "index-module_page__16xxw", I = "index-module_loading__wNI-4", y = "index-module_message__Ib5Iw", r = {
20
20
  page: L,
21
21
  loading: I,
22
- tabs: y,
23
- message: H
24
- }, D = () => {
25
- const { t: s } = u(), { clinicalConfig: i } = E(), { userPrivileges: e } = p(), o = r(
22
+ message: y
23
+ }, w = () => {
24
+ const { t: i } = u(), { clinicalConfig: s } = N(), { userPrivileges: e } = p(), o = l(
26
25
  () => [
27
- { id: "home", label: s("HOME_LABEL"), href: f },
28
- { id: "clinical", label: s("CLINICAL_LABEL"), isCurrentPage: !0 }
26
+ { id: "home", label: i("HOME_LABEL"), href: f },
27
+ { id: "clinical", label: i("CLINICAL_LABEL"), isCurrentPage: !0 }
29
28
  ],
30
- [s]
31
- ), c = r(
32
- () => P(i?.extensions ?? []),
33
29
  [i]
34
- ), d = r(
30
+ ), c = l(
31
+ () => P(s?.extensions ?? []),
32
+ [s]
33
+ ), d = l(
35
34
  () => Array.from(c.entries()).map(([n, a]) => ({
36
35
  pointId: n,
37
36
  Handler: C[n],
@@ -40,30 +39,29 @@ const P = (s) => {
40
39
  [c, e]
41
40
  );
42
41
  return /* @__PURE__ */ t(
43
- b,
42
+ x,
44
43
  {
45
- header: /* @__PURE__ */ t(x, { breadcrumbItems: o }),
44
+ header: /* @__PURE__ */ t(b, { breadcrumbItems: o }),
46
45
  main: /* @__PURE__ */ t(
47
46
  "div",
48
47
  {
49
48
  id: "clinical-list-page",
50
49
  "data-testid": "clinical-list-page-test-id",
51
50
  "aria-label": "Clinical List Page",
52
- className: l.page,
51
+ className: r.page,
53
52
  children: d.length > 0 ? d.map(({ pointId: n, Handler: a, filtered: g }) => /* @__PURE__ */ t(
54
53
  "div",
55
54
  {
56
55
  id: n,
57
56
  "data-testid": `${n}-test-id`,
58
- className: l.tabs,
59
57
  children: /* @__PURE__ */ t(
60
- h,
58
+ E,
61
59
  {
62
60
  fallback: /* @__PURE__ */ t(
63
61
  _,
64
62
  {
65
63
  type: "multi",
66
- className: l.loading
64
+ className: r.loading
67
65
  }
68
66
  ),
69
67
  children: /* @__PURE__ */ t(a, { extensions: g })
@@ -77,8 +75,8 @@ const P = (s) => {
77
75
  id: "no-extensions-configured",
78
76
  "data-testid": "no-extensions-configured-test-id",
79
77
  "aria-label": "No extensions configured",
80
- className: l.message,
81
- children: s("NO_EXTENSIONS_CONFIGURED")
78
+ className: r.message,
79
+ children: i("NO_EXTENSIONS_CONFIGURED")
82
80
  }
83
81
  )
84
82
  }
@@ -87,5 +85,5 @@ const P = (s) => {
87
85
  );
88
86
  };
89
87
  export {
90
- D as default
88
+ w as default
91
89
  };