@bahmni/home-app 0.0.1-dev.423 → 0.0.1-dev.425

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,12 +1,12 @@
1
- import { jsxs as I, jsx as n } from "react/jsx-runtime";
2
- import { v as Q, z as M, u as B, j as Y, a as j, k as G, l as H, m as J, n as P, o as W, _ as X, C as Z, r as ee, Y as ae, x as se, s as U, t as re, B as te, w as ie, R as oe, T as ne, L as de, O as le } from "./index-0gCl6Ezv.js";
1
+ import { jsxs as S, jsx as n } from "react/jsx-runtime";
2
+ import { g as H, z as M, u as B, B as x, y as G, d as J, P, m as Y, Q as j, r as W, i as X, t as Z, k as ee, Y as ae, J as se, n as U, X as re, W as te, w as ie, o as oe, R as ne, q as de, D as le } from "./index-ExXHC3NK.js";
3
3
  import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
4
- import { useRef as me, useEffect as D, useMemo as g } from "react";
5
- const pe = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", he = "Observations-module_secondary__14nuS", O = {
4
+ import { useRef as me, useEffect as L, useMemo as E } from "react";
5
+ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", R = {
6
6
  observations: pe,
7
7
  title: be,
8
- wrapper: ve,
9
- secondary: he
8
+ wrapper: he,
9
+ secondary: ve
10
10
  }, V = (s, l, o, d, c, r) => {
11
11
  const t = re(s, l, c), e = t.value, m = te(e);
12
12
  let i = e;
@@ -26,24 +26,24 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
26
26
  hideThumbnail: r
27
27
  }
28
28
  )), m === "PDF" && (i = /* @__PURE__ */ n(le, { id: `${e}-pdf`, src: e }));
29
- const p = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
29
+ const p = /* @__PURE__ */ S("div", { className: R.wrapper, children: [
30
30
  /* @__PURE__ */ n("span", { children: t.header.display }),
31
- t.header.referenceRange && /* @__PURE__ */ n("span", { className: O.secondary, children: t.header.referenceRange })
31
+ t.header.referenceRange && /* @__PURE__ */ n("span", { className: R.secondary, children: t.header.referenceRange })
32
32
  ] }), u = c("OBSERVATIONS_RECORDED_BY", {
33
33
  provider: t.provider
34
- }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, f = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
34
+ }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, f = /* @__PURE__ */ S("div", { className: R.wrapper, children: [
35
35
  /* @__PURE__ */ n("span", { children: u }),
36
- b && /* @__PURE__ */ n("span", { className: O.secondary, children: b })
37
- ] }), v = s.display, h = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", R = d ? `${d}-${h}-${v}-${o}-${l}` : `${h}-${v}-${o}-${l}`;
36
+ b && /* @__PURE__ */ n("span", { className: R.secondary, children: b })
37
+ ] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = d ? `${d}-${v}-${h}-${o}-${l}` : `${v}-${h}-${o}-${l}`;
38
38
  return /* @__PURE__ */ n(
39
39
  oe,
40
40
  {
41
41
  header: p,
42
42
  value: i,
43
43
  info: f,
44
- id: R,
45
- testId: R,
46
- ariaLabel: R
44
+ id: O,
45
+ testId: O,
46
+ ariaLabel: O
47
47
  },
48
48
  `obs-${s.id}`
49
49
  );
@@ -65,14 +65,14 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
65
65
  )
66
66
  },
67
67
  `grouped-obs-${s.id}`
68
- ), Oe = ({
68
+ ), Re = ({
69
69
  groupedData: s,
70
70
  title: l = "",
71
71
  hideThumbnail: o
72
72
  }) => {
73
73
  const { t: d } = B(), c = (r, t, e) => {
74
74
  const m = se(r.encounterDetails, d);
75
- return /* @__PURE__ */ I(
75
+ return /* @__PURE__ */ S(
76
76
  U,
77
77
  {
78
78
  title: m,
@@ -116,13 +116,13 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
116
116
  )
117
117
  }
118
118
  );
119
- }, Re = (s) => ["conceptUuid", s], _e = (s, l, o, d) => [
119
+ }, Oe = (s) => ["conceptUuid", s], _e = (s, l, o, d) => [
120
120
  "observations",
121
121
  s,
122
122
  ...l,
123
123
  o,
124
124
  d
125
- ], Ie = ({
125
+ ], Se = ({
126
126
  config: s,
127
127
  episodeOfCareUuids: l,
128
128
  encounterUuids: o
@@ -132,92 +132,92 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
132
132
  conceptUuid: r = [],
133
133
  hideThumbnail: t = !1,
134
134
  scope: e = "all"
135
- } = d, m = me(/* @__PURE__ */ new Set()), i = Q(), { addNotification: p } = M(), { t: u } = B(), b = ue({
135
+ } = d, m = me(/* @__PURE__ */ new Set()), i = H(), { addNotification: p } = M(), { t: u } = B(), b = ue({
136
136
  queries: c.map((a) => ({
137
- queryKey: Re(a),
138
- queryFn: () => Y(a),
137
+ queryKey: Oe(a),
138
+ queryFn: () => x(a),
139
139
  enabled: !!a
140
140
  }))
141
141
  });
142
- D(() => {
143
- const a = b.some((x) => x.isError), y = m.current.size > 0;
142
+ L(() => {
143
+ const a = b.some((z) => z.isError), y = m.current.size > 0;
144
144
  a && !y ? (p({
145
145
  title: u("ERROR_DEFAULT_TITLE"),
146
146
  message: u("ERROR_FETCHING_OBSERVATIONS"),
147
147
  type: "error"
148
148
  }), m.current.add(0)) : !a && y && m.current.clear();
149
149
  }, [b, p, u]);
150
- const f = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), v = g(() => [.../* @__PURE__ */ new Set([...f, ...r])], [f, r]), h = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", w = j(
150
+ const f = E(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = E(() => [.../* @__PURE__ */ new Set([...f, ...r])], [f, r]), v = E(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), O = e === "latest" || e === "latest-encounter", F = G(
151
151
  l,
152
152
  o
153
153
  ), {
154
154
  data: _,
155
- isLoading: C,
156
- isError: N,
157
- refetch: S
155
+ isLoading: w,
156
+ isError: I,
157
+ refetch: N
158
158
  } = ce({
159
159
  queryKey: _e(
160
160
  i,
161
- v,
161
+ h,
162
162
  o,
163
163
  e
164
164
  ),
165
- queryFn: () => R ? G(
165
+ queryFn: () => O ? J(
166
166
  i,
167
- v,
167
+ h,
168
168
  o
169
- ) : H(
169
+ ) : P(
170
170
  i,
171
- v,
171
+ h,
172
172
  o
173
173
  ),
174
- enabled: !!i && v.length > 0 && h && !w
174
+ enabled: !!i && h.length > 0 && v && !F
175
175
  });
176
- J(
176
+ Y(
177
177
  (a) => {
178
178
  a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
179
- (y) => v.includes(y)
180
- ) && S();
179
+ (y) => h.includes(y)
180
+ ) && N();
181
181
  },
182
- [i, S]
183
- ), D(() => {
184
- N && p({
182
+ [i, N]
183
+ ), L(() => {
184
+ I && p({
185
185
  title: u("ERROR_DEFAULT_TITLE"),
186
186
  message: u("ERROR_FETCHING_OBSERVATIONS"),
187
187
  type: "error"
188
188
  });
189
- }, [N]);
190
- const $ = g(() => {
189
+ }, [I]);
190
+ const $ = E(() => {
191
191
  if (!_) return [];
192
- let a = P(_);
192
+ let a = j(_);
193
193
  e === "latest-encounter" && (a = W(a));
194
194
  const y = X(a);
195
195
  return Z(y);
196
- }, [_, e]), F = [
196
+ }, [_, e]), k = [
197
197
  { key: "name", header: "name" },
198
198
  { key: "value", header: "value" },
199
199
  { key: "form", header: "form" }
200
- ], A = C || !h, L = N && h, k = (!_ || _.entry?.length === 0 || v.length === 0) && h, K = L ? u("ERROR_FETCHING_OBSERVATIONS") : null, q = k ? u("NO_OBSERVATIONS_FOUND") : void 0, z = $.length > 0 && !A && !L, E = d.titleTranslationKey, T = E ? u(E) : "";
201
- return /* @__PURE__ */ I(
200
+ ], D = w || !v, A = I && v, q = (!_ || _.entry?.length === 0 || h.length === 0) && v, C = A ? u("ERROR_FETCHING_OBSERVATIONS") : null, K = q ? u("NO_OBSERVATIONS_FOUND") : void 0, Q = $.length > 0 && !D && !A, g = d.titleTranslationKey, T = g ? u(g) : "";
201
+ return /* @__PURE__ */ S(
202
202
  "div",
203
203
  {
204
204
  id: "observations",
205
- "data-testid": E ? `observations-${T}` : "observations",
205
+ "data-testid": g ? `observations-${T}` : "observations",
206
206
  "aria-label": "observations-aria-label",
207
- className: O.observations,
207
+ className: R.observations,
208
208
  children: [
209
209
  /* @__PURE__ */ n(
210
210
  ee,
211
211
  {
212
212
  id: "observations-title",
213
- testId: E ? `observations-title-${T}` : "observations-title",
213
+ testId: g ? `observations-title-${T}` : "observations-title",
214
214
  title: T,
215
- className: O.title,
215
+ className: R.title,
216
216
  children: /* @__PURE__ */ n("p", { children: T })
217
217
  }
218
218
  ),
219
- z ? /* @__PURE__ */ n(
220
- Oe,
219
+ Q ? /* @__PURE__ */ n(
220
+ Re,
221
221
  {
222
222
  groupedData: $,
223
223
  title: T,
@@ -226,12 +226,12 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
226
226
  ) : /* @__PURE__ */ n(
227
227
  ae,
228
228
  {
229
- headers: F,
229
+ headers: k,
230
230
  rows: [],
231
231
  ariaLabel: u("OBSERVATIONS"),
232
- loading: A,
233
- errorStateMessage: K,
234
- emptyStateMessage: q ?? u("NO_OBSERVATIONS_AVAILABLE"),
232
+ loading: D,
233
+ errorStateMessage: C,
234
+ emptyStateMessage: K ?? u("NO_OBSERVATIONS_AVAILABLE"),
235
235
  dataTestId: "observations-table"
236
236
  }
237
237
  )
@@ -240,7 +240,7 @@ const pe = "Observations-module_observations__RKSyo", be = "Observations-module_
240
240
  );
241
241
  };
242
242
  export {
243
- Re as conceptUuidQueryKeys,
244
- Ie as default,
243
+ Oe as conceptUuidQueryKeys,
244
+ Se as default,
245
245
  _e as observationsQueryKeys
246
246
  };
@@ -1,4 +1,4 @@
1
- import { a2 as we, a3 as z, a4 as xt, a5 as B, a0 as q, a1 as y, a6 as Ro, a7 as ye, a8 as R, a9 as _, aa as k, ab as N, ac as A, ad as bs, ae as ir, af as $e, ag as G, ah as Hn, ai as Vn, aj as dt, ak as D, al as xs, am as cn, an as Be, ao as ws, ap as qt, aq as zt, ar as $s, as as Cs, at as $n, au as Ss, av as Nr, aw as Bt, ax as zo, ay as ks, az as Es, aA as j, aB as Gr, aC as Ms, aD as Ds, aE as sr, aF as As, aG as Ts, aH as zn, aI as Fs, aJ as Is, aK as Z, aL as Ps, aM as Ls } from "./index-0gCl6Ezv.js";
1
+ import { N as we, T as z, V as xt, _ as B, L as q, M as y, a0 as Ro, a1 as ye, a2 as R, a3 as _, a4 as k, a5 as N, a6 as A, a7 as bs, a8 as ir, a9 as $e, aa as G, ab as Hn, ac as Vn, ad as dt, ae as D, af as xs, ag as cn, ah as Be, ai as ws, aj as qt, ak as zt, al as $s, am as Cs, an as $n, ao as Ss, ap as Nr, aq as Bt, ar as zo, as as ks, at as Es, au as j, av as Gr, aw as Ms, ax as Ds, ay as sr, az as As, aA as Ts, aB as zn, aC as Fs, aD as Is, aE as Z, aF as Ps, aG as Ls } from "./index-ExXHC3NK.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":"HomePageGrid.d.ts","sourceRoot":"","sources":["../../../src/components/HomePageGrid/HomePageGrid.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAyFhC,CAAC"}
1
+ {"version":3,"file":"HomePageGrid.d.ts","sourceRoot":"","sources":["../../../src/components/HomePageGrid/HomePageGrid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAShC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export declare const HOME_NAMESPACE = "home";
2
- export declare const HOMEPAGE_TILES_SKELETON_COUNT = 6;
2
+ export declare const HOME_EXTENSION_POINT = "org.bahmni.home.dashboard";
3
3
  //# sourceMappingURL=app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/constants/app.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,6BAA6B,IAAI,CAAC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/constants/app.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,oBAAoB,8BAA8B,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { jsx as e, jsxs as a, Fragment as s } from "react/jsx-runtime";
2
+ import { s as t, x as r, u as n, A as m, E as l, G as c } from "./index-ExXHC3NK.js";
3
+ import "react";
4
+ import "@tanstack/react-query";
5
+ const d = "HomePageGrid-module_headerOffset__xmJ-q", i = {
6
+ headerOffset: d
7
+ }, _ = () => /* @__PURE__ */ e(
8
+ t,
9
+ {
10
+ extensionPointId: r,
11
+ loadingLabelKey: "HOME_LOADING_MODULES",
12
+ errorMessageKey: "HOME_ERROR_FETCH_CONFIG",
13
+ emptyMessageKey: "HOME_NO_MODULES",
14
+ className: i.headerOffset,
15
+ testId: "home-modules"
16
+ }
17
+ ), O = "HomePageHeader-module_locationSelector__foYmn", g = {
18
+ locationSelector: O
19
+ }, H = () => {
20
+ const { t: o } = n();
21
+ return /* @__PURE__ */ e(
22
+ m,
23
+ {
24
+ ariaLabel: "Bahmni",
25
+ brandPrefix: o("HOME_LABEL"),
26
+ brandHref: "/",
27
+ globalFeatures: [
28
+ /* @__PURE__ */ e("div", { className: g.locationSelector, children: /* @__PURE__ */ e(c, {}) }, "location")
29
+ ],
30
+ userMenu: /* @__PURE__ */ e(l, {})
31
+ }
32
+ );
33
+ }, E = "HomePage-module_homePageBody__0qtrS", f = {
34
+ homePageBody: E
35
+ }, M = () => /* @__PURE__ */ a(s, { children: [
36
+ /* @__PURE__ */ e(H, {}),
37
+ /* @__PURE__ */ e("main", { className: f.homePageBody, children: /* @__PURE__ */ e(_, {}) })
38
+ ] });
39
+ export {
40
+ M as HomePage
41
+ };