@bahmni/home-app 0.0.1-dev.404 → 0.0.1-dev.405

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 G } from "react/jsx-runtime";
2
- import { v as Q, u as Y, z as J, J as W, q as X, w as Z, K as ee, p as te } from "./index-dkqs2X3C.js";
2
+ import { v as Q, u as Y, z as J, J as W, q as X, w as Z, K as ee, p as te } from "./index-CuC_lo4i.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as h, useEffect as I, useMemo as _ } from "react";
5
5
  const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
@@ -1,5 +1,5 @@
1
1
  import { jsx as i, jsxs as P, Fragment as ye } from "react/jsx-runtime";
2
- import { u as ge, v as be, e as Oe, a as Ne, b as Te, Y as Ie, d as Ae, c as Ee, f as ve, m as _e, g as Fe, h as Se, i as $, w as Me, A as x, V as Y, q as Re, K as G, P as Be, F as Ce, p as Le, j as Ue, k as De } from "./index-dkqs2X3C.js";
2
+ import { u as ge, v as be, e as Oe, a as Ne, b as Te, Y as Ie, d as Ae, c as Ee, f as ve, m as _e, g as Fe, h as Se, i as $, w as Me, A as x, V as Y, q as Re, K as G, P as Be, F as Ce, p as Le, j as Ue, k as De } from "./index-CuC_lo4i.js";
3
3
  import { useQueryClient as ke, useQuery as N } from "@tanstack/react-query";
4
4
  import { useState as Q, useMemo as d, useCallback as c } from "react";
5
5
  const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", Ve = "FormsTable-module_customAccordianItem__isszs", T = {
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Ze1E-dld.js";
2
- import { U as d, X as f, Z as e } from "./index-dkqs2X3C.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CbaAOFUJ.js";
2
+ import { U as d, X as f, Z as e } from "./index-CuC_lo4i.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-Ze1E-dld.js";
2
- import { U as v, X as C, Z as e } from "./index-dkqs2X3C.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-CbaAOFUJ.js";
2
+ import { U as v, X as C, Z as e } from "./index-CuC_lo4i.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -0,0 +1,213 @@
1
+ import { jsxs as $, jsx as u } from "react/jsx-runtime";
2
+ import { v as q, z as G, u as N, l as k, G as x, m as z, n as Q, o as w, s as H, r as M, K as j, t as P, _ as A, x as J, C as Y, y as W, E as X, B as Z, D as ee } from "./index-CuC_lo4i.js";
3
+ import { useQueries as ae, useQuery as re } from "@tanstack/react-query";
4
+ import { useRef as te, useEffect as f, useMemo as O } from "react";
5
+ const L = (a, n, d, l, b, o) => {
6
+ const r = J(a, n, b), t = r.value, s = Y(t);
7
+ let i = t;
8
+ s === "Image" && (i = /* @__PURE__ */ u(
9
+ X,
10
+ {
11
+ imageSrc: t,
12
+ alt: t,
13
+ id: `${t}-img`,
14
+ hideThumbnail: o
15
+ }
16
+ )), s === "Video" && (i = /* @__PURE__ */ u(
17
+ Z,
18
+ {
19
+ id: `${t}-video`,
20
+ videoSrc: t,
21
+ hideThumbnail: o
22
+ }
23
+ )), s === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${t}-pdf`, src: t }));
24
+ const m = b("OBSERVATIONS_RECORDED_BY", {
25
+ provider: r.provider
26
+ }), p = a.display, h = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${h}-${p}-${d}-${n}` : `${h}-${p}-${d}-${n}`;
27
+ return /* @__PURE__ */ u(
28
+ W,
29
+ {
30
+ header: r.header,
31
+ value: i,
32
+ info: m,
33
+ id: c,
34
+ testId: c,
35
+ ariaLabel: c
36
+ },
37
+ `obs-${a.id}`
38
+ );
39
+ }, se = (a, n, d, l, b, o, r) => /* @__PURE__ */ u(
40
+ A,
41
+ {
42
+ title: a.display,
43
+ id: `grouped-obs-${a.display}-${l}`,
44
+ open: d,
45
+ children: a.members?.map(
46
+ (t, s) => L(
47
+ t,
48
+ s,
49
+ b,
50
+ o,
51
+ n,
52
+ r
53
+ )
54
+ )
55
+ },
56
+ `grouped-obs-${a.id}`
57
+ ), oe = ({
58
+ groupedData: a,
59
+ title: n = "",
60
+ hideThumbnail: d
61
+ }) => {
62
+ const { t: l } = N(), b = (o, r, t) => {
63
+ const s = P(o.encounterDetails, l);
64
+ return /* @__PURE__ */ $(
65
+ A,
66
+ {
67
+ title: s,
68
+ id: `encounter-${o.encounterId}`,
69
+ open: r,
70
+ children: [
71
+ o.observations.map(
72
+ (i, m) => L(
73
+ i,
74
+ m,
75
+ t,
76
+ n,
77
+ l,
78
+ d
79
+ )
80
+ ),
81
+ o.groupedObservations.map(
82
+ (i, m) => se(
83
+ i,
84
+ l,
85
+ r,
86
+ m,
87
+ t,
88
+ n,
89
+ d
90
+ )
91
+ )
92
+ ]
93
+ },
94
+ `encounter-${o.encounterId}`
95
+ );
96
+ };
97
+ return /* @__PURE__ */ u(
98
+ "div",
99
+ {
100
+ id: "obs-by-encounter",
101
+ "data-testid": "obs-by-encounter-test-id",
102
+ "aria-label": "obs-by-encounter-aria-label",
103
+ children: a.map(
104
+ (o, r) => b(o, r === 0, r)
105
+ )
106
+ }
107
+ );
108
+ }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", S = {
109
+ observations: ie,
110
+ title: ne
111
+ }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
112
+ const n = a, {
113
+ conceptNames: d = [],
114
+ conceptUuid: l = [],
115
+ hideThumbnail: b = !1
116
+ } = n, o = te(/* @__PURE__ */ new Set()), r = q(), { addNotification: t } = G(), { t: s } = N(), i = ae({
117
+ queries: d.map((e) => ({
118
+ queryKey: de(e),
119
+ queryFn: () => k(e),
120
+ enabled: !!e
121
+ }))
122
+ });
123
+ f(() => {
124
+ i.forEach((e, y) => {
125
+ if (e.isError && !o.current.has(y)) {
126
+ const U = d[y];
127
+ t({
128
+ title: s("ERROR_DEFAULT_TITLE"),
129
+ message: s("ERROR_FETCHING_CONCEPT", { conceptName: U }),
130
+ type: "error"
131
+ }), o.current.add(y);
132
+ } else e.isError || o.current.delete(y);
133
+ });
134
+ }, [i, d]);
135
+ const m = O(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = O(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), h = O(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
136
+ data: c,
137
+ isLoading: D,
138
+ isError: T,
139
+ refetch: R
140
+ } = re({
141
+ queryKey: le(r, p),
142
+ queryFn: () => x(r, p),
143
+ enabled: !!r && p.length > 0 && h
144
+ });
145
+ z(
146
+ (e) => {
147
+ e.patientUUID === r && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
+ (y) => p.includes(y)
149
+ ) && R();
150
+ },
151
+ [r, R]
152
+ ), f(() => {
153
+ T && t({
154
+ title: s("ERROR_DEFAULT_TITLE"),
155
+ message: s("ERROR_FETCHING_OBSERVATIONS"),
156
+ type: "error"
157
+ });
158
+ }, [T]);
159
+ const _ = O(() => {
160
+ if (!c) return [];
161
+ const e = Q(c), y = w(e);
162
+ return H(y);
163
+ }, [c]), V = [
164
+ { key: "name", header: "name" },
165
+ { key: "value", header: "value" },
166
+ { key: "form", header: "form" }
167
+ ], g = D || !h, I = T && h, B = (!c || c.entry?.length === 0 || p.length === 0) && h, C = I ? s("ERROR_FETCHING_OBSERVATIONS") : null, F = B ? s("NO_OBSERVATIONS_FOUND") : void 0, K = _.length > 0 && !g && !I, E = n.titleTranslationKey, v = E ? s(E) : "";
168
+ return /* @__PURE__ */ $(
169
+ "div",
170
+ {
171
+ id: "observations",
172
+ "data-testid": E ? `observations-${v}` : "observations",
173
+ "aria-label": "observations-aria-label",
174
+ className: S.observations,
175
+ children: [
176
+ /* @__PURE__ */ u(
177
+ M,
178
+ {
179
+ id: "observations-title",
180
+ testId: E ? `observations-title-${v}` : "observations-title",
181
+ title: v,
182
+ className: S.title,
183
+ children: /* @__PURE__ */ u("p", { children: v })
184
+ }
185
+ ),
186
+ K ? /* @__PURE__ */ u(
187
+ oe,
188
+ {
189
+ groupedData: _,
190
+ title: v,
191
+ hideThumbnail: b
192
+ }
193
+ ) : /* @__PURE__ */ u(
194
+ j,
195
+ {
196
+ headers: V,
197
+ rows: [],
198
+ ariaLabel: s("OBSERVATIONS"),
199
+ loading: g,
200
+ errorStateMessage: C,
201
+ emptyStateMessage: F ?? s("NO_OBSERVATIONS_AVAILABLE"),
202
+ dataTestId: "observations-table"
203
+ }
204
+ )
205
+ ]
206
+ }
207
+ );
208
+ };
209
+ export {
210
+ de as conceptUuidQueryKeys,
211
+ pe as default,
212
+ le as observationsQueryKeys
213
+ };
@@ -1,4 +1,4 @@
1
- import { $ as we, a0 as z, a1 as xt, a2 as B, X as q, Z as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-dkqs2X3C.js";
1
+ import { $ as we, a0 as z, a1 as xt, a2 as B, X as q, Z as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-CuC_lo4i.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1 +1 @@
1
- {"version":3,"file":"HomePageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/HomePageHeader/HomePageHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAYlC,CAAC"}
1
+ {"version":3,"file":"HomePageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/HomePageHeader/HomePageHeader.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAelC,CAAC"}
@@ -113462,7 +113462,7 @@ x02({
113462
113462
  key: "commonSearch",
113463
113463
  component: _V0
113464
113464
  });
113465
- J0(() => Promise.resolve().then(() => E70)), J0(() => Promise.resolve().then(() => U70)), J0(() => Promise.resolve().then(() => xd0)), J0(() => Promise.resolve().then(() => Td0)), J0(() => import("./DocumentsTable-BmYFio6a-zmPPe9BV.js")), J0(() => Promise.resolve().then(() => Tm0)), J0(() => import("./FormsTable-Dn0dYzgO-COihlfn-.js")), J0(() => Promise.resolve().then(() => xf0)), J0(() => import("./Observations-BgGdEmnb-BvZt75bk.js")), J0(
113465
+ J0(() => Promise.resolve().then(() => E70)), J0(() => Promise.resolve().then(() => U70)), J0(() => Promise.resolve().then(() => xd0)), J0(() => Promise.resolve().then(() => Td0)), J0(() => import("./DocumentsTable-CIJwgXmb-D3Z-yefq.js")), J0(() => Promise.resolve().then(() => Tm0)), J0(() => import("./FormsTable-DMPfuqmY-IDtATXYn.js")), J0(() => Promise.resolve().then(() => xf0)), J0(() => import("./Observations-BflI1_YX-BOSQX59a.js")), J0(
113466
113466
  () => Promise.resolve().then(() => Vw0)
113467
113467
  ), J0(
113468
113468
  () => Promise.resolve().then(() => Wp0)
@@ -198333,7 +198333,7 @@ var RRt = (t, e = !1) => {
198333
198333
  const e = u82(() => {
198334
198334
  const r = this, [o] = this.#n, [a] = this.#o, [c] = this.#a, [l] = this.#c, [i] = this.#p, [s] = this.#t;
198335
198335
  let d;
198336
- return this.#l ? d = this.#l : (d = s82(() => import("./LNWAZHJI--EdTiJwJ.js")), this.#l = d), A82(this.#h, this.#r), l82(d, i82({
198336
+ return this.#l ? d = this.#l : (d = s82(() => import("./LNWAZHJI-ipM9wVpN.js")), this.#l = d), A82(this.#h, this.#r), l82(d, i82({
198337
198337
  get queryFlavor() {
198338
198338
  return r.#d;
198339
198339
  },
@@ -198431,7 +198431,7 @@ var RRt = (t, e = !1) => {
198431
198431
  const e = u82(() => {
198432
198432
  const r = this, [o] = this.#n, [a] = this.#o, [c] = this.#a, [l] = this.#c, [i] = this.#p, [s] = this.#t, [d] = this.#l;
198433
198433
  let u;
198434
- return this.#i ? u = this.#i : (u = s82(() => import("./MWZ6AO7Z-VB4PD1cY.js")), this.#i = u), A82(this.#h, this.#r), l82(u, i82({
198434
+ return this.#i ? u = this.#i : (u = s82(() => import("./MWZ6AO7Z-DvyQIXn6.js")), this.#i = u), A82(this.#h, this.#r), l82(u, i82({
198435
198435
  get queryFlavor() {
198436
198436
  return r.#d;
198437
198437
  },
@@ -198561,7 +198561,7 @@ const O$t = {
198561
198561
  }
198562
198562
  }
198563
198563
  }, $$t = "home", IRt = 6, D$t = J0(
198564
- () => import("./index-BUK4yYWQ.js").then((t) => ({
198564
+ () => import("./index-l85yN2dU.js").then((t) => ({
198565
198565
  default: t.HomePage
198566
198566
  }))
198567
198567
  ), R$t = [
@@ -1,12 +1,12 @@
1
1
  import { jsxs as c, jsx as e, Fragment as b } from "react/jsx-runtime";
2
- import { u as m, W as p, N as y, H, I as N, a as P, L as v, M as E, O as G, Q as f, R as S, S as T, T as O } from "./index-dkqs2X3C.js";
2
+ import { u as m, W as p, N as y, H, I as N, a as E, L as P, M as v, O as G, Q as f, R as L, S as O, T as S } from "./index-CuC_lo4i.js";
3
3
  import "react";
4
- import { useQuery as L } from "@tanstack/react-query";
4
+ import { useQuery as T } from "@tanstack/react-query";
5
5
  const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "AppTile-module_bottom__lcJiG", d = {
6
6
  tile: C,
7
7
  label: B,
8
8
  bottom: M
9
- }, A = ({ id: r, label: n, icon: s, url: l }) => {
9
+ }, A = ({ id: o, label: n, icon: s, url: l }) => {
10
10
  const { t } = m(), i = t(n);
11
11
  return /* @__PURE__ */ c(
12
12
  p,
@@ -14,53 +14,53 @@ const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "
14
14
  href: l,
15
15
  className: d.tile,
16
16
  "aria-label": i,
17
- testId: `app-tile-${r}`,
17
+ testId: `app-tile-${o}`,
18
18
  children: [
19
19
  /* @__PURE__ */ e("h2", { className: d.label, "aria-hidden": "true", children: i }),
20
20
  /* @__PURE__ */ c("div", { className: d.bottom, children: [
21
- /* @__PURE__ */ e(y, { name: s, id: r, size: H.X2, "aria-hidden": "true" }),
21
+ /* @__PURE__ */ e(y, { name: s, id: o, size: H.X2, "aria-hidden": "true" }),
22
22
  /* @__PURE__ */ e(N, { size: 20, "aria-hidden": "true" })
23
23
  ] })
24
24
  ]
25
25
  }
26
26
  );
27
- }, F = "HomePageGrid-module_container__Kxfim", k = "HomePageGrid-module_tileGrid__X6-Bm", x = "HomePageGrid-module_skeletonTile__U-1vu", I = "HomePageGrid-module_emptyState__xEwoK", K = "HomePageGrid-module_errorContainer__IKR3E", o = {
27
+ }, F = "HomePageGrid-module_container__Kxfim", k = "HomePageGrid-module_tileGrid__X6-Bm", x = "HomePageGrid-module_skeletonTile__U-1vu", I = "HomePageGrid-module_emptyState__xEwoK", K = "HomePageGrid-module_errorContainer__IKR3E", r = {
28
28
  container: F,
29
29
  tileGrid: k,
30
30
  skeletonTile: x,
31
31
  emptyState: I,
32
32
  errorContainer: K
33
33
  }, R = () => {
34
- const { t: r } = m(), {
34
+ const { t: o } = m(), {
35
35
  userPrivileges: n,
36
36
  isLoading: s,
37
37
  error: l
38
- } = P(), t = n?.map((a) => a.name) ?? null, {
38
+ } = E(), t = n?.map((a) => a.name) ?? null, {
39
39
  data: i = [],
40
40
  isLoading: _,
41
41
  isError: u,
42
42
  refetch: h
43
- } = L({
43
+ } = T({
44
44
  queryKey: ["home-modules", t],
45
- queryFn: () => v("org.bahmni.home.dashboard", t),
45
+ queryFn: () => P("org.bahmni.home.dashboard", t),
46
46
  enabled: !s && l === null && t !== null
47
47
  });
48
48
  return s || _ || t === null && !l ? /* @__PURE__ */ e(
49
49
  "div",
50
50
  {
51
- className: o.container,
51
+ className: r.container,
52
52
  role: "status",
53
- "aria-label": r("HOME_LOADING_MODULES"),
53
+ "aria-label": o("HOME_LOADING_MODULES"),
54
54
  "aria-busy": "true",
55
- children: /* @__PURE__ */ e("div", { className: o.tileGrid, children: Array.from(
56
- { length: E },
55
+ children: /* @__PURE__ */ e("div", { className: r.tileGrid, children: Array.from(
56
+ { length: v },
57
57
  (a, g) => `skeleton-${g}`
58
- ).map((a) => /* @__PURE__ */ e(G, { className: o.skeletonTile }, a)) })
58
+ ).map((a) => /* @__PURE__ */ e(G, { className: r.skeletonTile }, a)) })
59
59
  }
60
60
  ) : l || u ? /* @__PURE__ */ e(
61
61
  "div",
62
62
  {
63
- className: o.errorContainer,
63
+ className: r.errorContainer,
64
64
  "data-testid": "home-error",
65
65
  role: "alert",
66
66
  children: /* @__PURE__ */ e(
@@ -68,13 +68,13 @@ const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "
68
68
  {
69
69
  kind: "error",
70
70
  lowContrast: !0,
71
- subtitle: r("HOME_ERROR_FETCH_CONFIG"),
71
+ subtitle: o("HOME_ERROR_FETCH_CONFIG"),
72
72
  hideCloseButton: !1,
73
73
  onClose: () => void h()
74
74
  }
75
75
  )
76
76
  }
77
- ) : i.length === 0 ? /* @__PURE__ */ e("div", { className: o.emptyState, role: "status", children: r("HOME_NO_MODULES") }) : /* @__PURE__ */ e("div", { className: o.container, children: /* @__PURE__ */ e("div", { className: o.tileGrid, children: i.map((a) => /* @__PURE__ */ e(
77
+ ) : i.length === 0 ? /* @__PURE__ */ e("div", { className: r.emptyState, role: "status", children: o("HOME_NO_MODULES") }) : /* @__PURE__ */ e("div", { className: r.container, children: /* @__PURE__ */ e("div", { className: r.tileGrid, children: i.map((a) => /* @__PURE__ */ e(
78
78
  A,
79
79
  {
80
80
  id: a.id,
@@ -86,18 +86,21 @@ const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "
86
86
  )) }) });
87
87
  }, $ = "HomePageHeader-module_locationSelector__foYmn", D = {
88
88
  locationSelector: $
89
- }, U = () => /* @__PURE__ */ e(
90
- S,
91
- {
92
- ariaLabel: "Bahmni",
93
- brandPrefix: "Home",
94
- brandHref: "/",
95
- globalFeatures: [
96
- /* @__PURE__ */ e("div", { className: D.locationSelector, children: /* @__PURE__ */ e(O, {}) }, "location")
97
- ],
98
- userMenu: /* @__PURE__ */ e(T, {})
99
- }
100
- ), j = "HomePage-module_homePageBody__0qtrS", q = {
89
+ }, U = () => {
90
+ const { t: o } = m();
91
+ return /* @__PURE__ */ e(
92
+ L,
93
+ {
94
+ ariaLabel: "Bahmni",
95
+ brandPrefix: o("HOME_LABEL"),
96
+ brandHref: "/",
97
+ globalFeatures: [
98
+ /* @__PURE__ */ e("div", { className: D.locationSelector, children: /* @__PURE__ */ e(S, {}) }, "location")
99
+ ],
100
+ userMenu: /* @__PURE__ */ e(O, {})
101
+ }
102
+ );
103
+ }, j = "HomePage-module_homePageBody__0qtrS", q = {
101
104
  homePageBody: j
102
105
  }, X = () => /* @__PURE__ */ c(b, { children: [
103
106
  /* @__PURE__ */ e(U, {}),
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aK as a } from "./index-dkqs2X3C.js";
1
+ import { aK as a } from "./index-CuC_lo4i.js";
2
2
  export {
3
3
  a as HomeApp
4
4
  };
@@ -2,6 +2,7 @@
2
2
  "HOME_ERROR_FETCH_CONFIG": "Failed to load home page configuration",
3
3
  "HOME_ERROR_LOCATION_SYNC_FAILED": "Location change saved locally but failed to sync to server.",
4
4
  "HOME_ERROR_LOCATION_SYNC_FAILED_TITLE": "Location Sync Warning",
5
+ "HOME_LABEL": "Home",
5
6
  "HOME_LOADING_MODULES": "Loading modules",
6
7
  "HOME_NO_LOCATION_SELECTED": "No location selected",
7
8
  "HOME_NO_MODULES": "No modules available",
@@ -2,6 +2,7 @@
2
2
  "HOME_ERROR_FETCH_CONFIG": "Error al cargar la configuración de la página de inicio",
3
3
  "HOME_ERROR_LOCATION_SYNC_FAILED": "El cambio de ubicación se guardó localmente pero no se pudo sincronizar con el servidor.",
4
4
  "HOME_ERROR_LOCATION_SYNC_FAILED_TITLE": "Advertencia de sincronización de ubicación",
5
+ "HOME_LABEL": "Inicio",
5
6
  "HOME_LOADING_MODULES": "Cargando módulos",
6
7
  "HOME_NO_LOCATION_SELECTED": "Ninguna ubicación seleccionada",
7
8
  "HOME_NO_MODULES": "No hay módulos disponibles",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/home-app",
3
- "version": "0.0.1-dev.404",
3
+ "version": "0.0.1-dev.405",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,213 +0,0 @@
1
- import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { v as q, z as G, u as N, l as k, G as x, m as z, n as Q, o as w, s as H, r as M, K as j, t as P, _ as D, x as J, C as Y, y as W, E as X, B as Z, D as ee } from "./index-dkqs2X3C.js";
3
- import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as I, useMemo as T } from "react";
5
- const C = (a, n, d, l, b, r) => {
6
- const t = J(a, n, b), s = t.value, o = Y(s);
7
- let i = s;
8
- o === "Image" && (i = /* @__PURE__ */ u(
9
- X,
10
- {
11
- imageSrc: s,
12
- alt: s,
13
- id: `${s}-img`,
14
- hideThumbnail: r
15
- }
16
- )), o === "Video" && (i = /* @__PURE__ */ u(
17
- Z,
18
- {
19
- id: `${s}-video`,
20
- videoSrc: s,
21
- hideThumbnail: r
22
- }
23
- )), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
24
- const m = b("OBSERVATIONS_RECORDED_BY", {
25
- provider: t.provider
26
- }), p = a.display, h = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${h}-${p}-${d}-${n}` : `${h}-${p}-${d}-${n}`;
27
- return /* @__PURE__ */ u(
28
- W,
29
- {
30
- header: t.header,
31
- value: i,
32
- info: m,
33
- id: c,
34
- testId: c,
35
- ariaLabel: c
36
- },
37
- `obs-${a.id}`
38
- );
39
- }, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
40
- D,
41
- {
42
- title: a.display,
43
- id: `grouped-obs-${a.display}-${l}`,
44
- open: d,
45
- children: a.members?.map(
46
- (s, o) => C(
47
- s,
48
- o,
49
- b,
50
- r,
51
- n,
52
- t
53
- )
54
- )
55
- },
56
- `grouped-obs-${a.id}`
57
- ), oe = ({
58
- groupedData: a,
59
- title: n = "",
60
- hideThumbnail: d
61
- }) => {
62
- const { t: l } = N(), b = (r, t, s) => {
63
- const o = P(r.encounterDetails, l);
64
- return /* @__PURE__ */ S(
65
- D,
66
- {
67
- title: o,
68
- id: `encounter-${r.encounterId}`,
69
- open: t,
70
- children: [
71
- r.observations.map(
72
- (i, m) => C(
73
- i,
74
- m,
75
- s,
76
- n,
77
- l,
78
- d
79
- )
80
- ),
81
- r.groupedObservations.map(
82
- (i, m) => re(
83
- i,
84
- l,
85
- t,
86
- m,
87
- s,
88
- n,
89
- d
90
- )
91
- )
92
- ]
93
- },
94
- `encounter-${r.encounterId}`
95
- );
96
- };
97
- return /* @__PURE__ */ u(
98
- "div",
99
- {
100
- id: "obs-by-encounter",
101
- "data-testid": "obs-by-encounter-test-id",
102
- "aria-label": "obs-by-encounter-aria-label",
103
- children: a.map(
104
- (r, t) => b(r, t === 0, t)
105
- )
106
- }
107
- );
108
- }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", $ = {
109
- observations: ie,
110
- title: ne
111
- }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
112
- const n = a, {
113
- conceptNames: d = [],
114
- conceptUuid: l = [],
115
- hideThumbnail: b = !1
116
- } = n, r = se(/* @__PURE__ */ new Set()), t = q(), { addNotification: s } = G(), { t: o } = N(), i = ae({
117
- queries: d.map((e) => ({
118
- queryKey: de(e),
119
- queryFn: () => k(e),
120
- enabled: !!e
121
- }))
122
- });
123
- I(() => {
124
- i.forEach((e, y) => {
125
- if (e.isError && !r.current.has(y)) {
126
- const U = d[y];
127
- s({
128
- title: o("ERROR_DEFAULT_TITLE"),
129
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: U }),
130
- type: "error"
131
- }), r.current.add(y);
132
- } else e.isError || r.current.delete(y);
133
- });
134
- }, [i, d]);
135
- const m = T(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = T(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), h = T(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
136
- data: c,
137
- isLoading: F,
138
- isError: R,
139
- refetch: g
140
- } = te({
141
- queryKey: le(t, p),
142
- queryFn: () => x(t, p),
143
- enabled: !!t && p.length > 0 && h
144
- });
145
- z(
146
- (e) => {
147
- e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
- (y) => p.includes(y)
149
- ) && g();
150
- },
151
- [t, g]
152
- ), I(() => {
153
- R && s({
154
- title: o("ERROR_DEFAULT_TITLE"),
155
- message: o("ERROR_FETCHING_OBSERVATIONS"),
156
- type: "error"
157
- });
158
- }, [R]);
159
- const O = T(() => {
160
- if (!c) return [];
161
- const e = Q(c), y = w(e);
162
- return H(y);
163
- }, [c]), L = [
164
- { key: "name", header: "name" },
165
- { key: "value", header: "value" },
166
- { key: "form", header: "form" }
167
- ], _ = F || !h, f = R && h, A = (!c || c.entry?.length === 0 || p.length === 0) && h, K = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, V = A ? o("NO_OBSERVATIONS_FOUND") : void 0, B = O.length > 0 && !_ && !f, E = n.titleTranslationKey, v = E ? o(E) : "";
168
- return /* @__PURE__ */ S(
169
- "div",
170
- {
171
- id: "observations",
172
- "data-testid": E ? `observations-${v}` : "observations",
173
- "aria-label": "observations-aria-label",
174
- className: $.observations,
175
- children: [
176
- /* @__PURE__ */ u(
177
- M,
178
- {
179
- id: "observations-title",
180
- testId: E ? `observations-title-${v}` : "observations-title",
181
- title: v,
182
- className: $.title,
183
- children: /* @__PURE__ */ u("p", { children: v })
184
- }
185
- ),
186
- B ? /* @__PURE__ */ u(
187
- oe,
188
- {
189
- groupedData: O,
190
- title: v,
191
- hideThumbnail: b
192
- }
193
- ) : /* @__PURE__ */ u(
194
- j,
195
- {
196
- headers: L,
197
- rows: [],
198
- ariaLabel: o("OBSERVATIONS"),
199
- loading: _,
200
- errorStateMessage: K,
201
- emptyStateMessage: V,
202
- dataTestId: "observations-table"
203
- }
204
- )
205
- ]
206
- }
207
- );
208
- };
209
- export {
210
- de as conceptUuidQueryKeys,
211
- pe as default,
212
- le as observationsQueryKeys
213
- };