@bahmni/widgets 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 T, Fragment as Q } from "react/jsx-runtime";
2
- import { u as W, a as X, L as J, V as Z, Y as x, b as ee, F as te } from "./index-CKyHo_Q1.js";
2
+ import { u as W, a as X, L as J, V as Z, Y as x, b as ee, F as te } from "./index-DSanaOUz.js";
3
3
  import { useQuery as ne } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
5
5
  import { useTranslation as ae } from "react-i18next";
@@ -1,5 +1,5 @@
1
1
  import { jsx as i, jsxs as $, Fragment as ge } from "react/jsx-runtime";
2
- import { u as be, c as Oe, d as Ne, f as Ee, l as Te, i as ve, e as Fe, B as Ie, O as Ae, g as _e, h as Re, j as G, Y as De, C as K, k as z, V as Me, b as Y, r as Be, m as Le, F as Ce, n as Se, o as Ue } from "./index-CKyHo_Q1.js";
2
+ import { u as be, c as Oe, d as Ne, f as Ee, l as Te, i as ve, e as Fe, B as Ie, O as Ae, g as _e, h as Re, j as G, Y as De, C as K, k as z, V as Me, b as Y, r as Be, m as Le, F as Ce, n as Se, o as Ue } from "./index-DSanaOUz.js";
3
3
  import { useQueryClient as ke, useQuery as E } from "@tanstack/react-query";
4
4
  import { useState as Q, useMemo as d, useCallback as c } from "react";
5
5
  import { useTranslation as we } from "react-i18next";
@@ -1,27 +1,27 @@
1
- import { jsx as d, jsxs as N } from "react/jsx-runtime";
2
- import { p as M, D as C, t as w, q as Q, s as q, T as k, R as G, S as P, u as z, a as H, v as j, w as J, O as Y, x as W, y as X, z as Z, A as x, b as ee } from "./index-CKyHo_Q1.js";
1
+ import { jsx as d, jsxs as D } from "react/jsx-runtime";
2
+ import { p as M, D as A, t as w, q as Q, s as q, T as k, R as G, S as P, u as z, a as H, v as j, w as J, O as Y, x as W, y as X, z as Z, A as x, b as ee } from "./index-DSanaOUz.js";
3
3
  import { useQueries as te, useQuery as se } from "@tanstack/react-query";
4
- import { useRef as oe, useEffect as S, useMemo as R } from "react";
5
- import { useTranslation as U } from "react-i18next";
6
- const A = (t, i, c, l, u, r) => {
7
- const s = w(t, i, u), o = s.value, a = Q(o);
4
+ import { useRef as oe, useEffect as $, useMemo as R } from "react";
5
+ import { useTranslation as C } from "react-i18next";
6
+ const U = (t, i, c, l, u, a) => {
7
+ const s = w(t, i, u), o = s.value, r = Q(o);
8
8
  let n = o;
9
- a === "Image" && (n = /* @__PURE__ */ d(
9
+ r === "Image" && (n = /* @__PURE__ */ d(
10
10
  k,
11
11
  {
12
12
  imageSrc: o,
13
13
  alt: o,
14
14
  id: `${o}-img`,
15
- hideThumbnail: r
15
+ hideThumbnail: a
16
16
  }
17
- )), a === "Video" && (n = /* @__PURE__ */ d(
17
+ )), r === "Video" && (n = /* @__PURE__ */ d(
18
18
  G,
19
19
  {
20
20
  id: `${o}-video`,
21
21
  videoSrc: o,
22
- hideThumbnail: r
22
+ hideThumbnail: a
23
23
  }
24
- )), a === "PDF" && (n = /* @__PURE__ */ d(P, { id: `${o}-pdf`, src: o }));
24
+ )), r === "PDF" && (n = /* @__PURE__ */ d(P, { id: `${o}-pdf`, src: o }));
25
25
  const b = u("OBSERVATIONS_RECORDED_BY", {
26
26
  provider: s.provider
27
27
  }), p = t.display, m = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${m}-${p}-${c}-${i}` : `${m}-${p}-${c}-${i}`;
@@ -37,18 +37,18 @@ const A = (t, i, c, l, u, r) => {
37
37
  },
38
38
  `obs-${t.id}`
39
39
  );
40
- }, re = (t, i, c, l, u, r, s) => /* @__PURE__ */ d(
41
- C,
40
+ }, re = (t, i, c, l, u, a, s) => /* @__PURE__ */ d(
41
+ A,
42
42
  {
43
43
  title: t.display,
44
44
  id: `grouped-obs-${t.display}-${l}`,
45
45
  open: c,
46
46
  children: t.members?.map(
47
- (o, a) => A(
47
+ (o, r) => U(
48
48
  o,
49
- a,
50
- u,
51
49
  r,
50
+ u,
51
+ a,
52
52
  i,
53
53
  s
54
54
  )
@@ -60,17 +60,17 @@ const A = (t, i, c, l, u, r) => {
60
60
  title: i = "",
61
61
  hideThumbnail: c
62
62
  }) => {
63
- const { t: l } = U(), u = (r, s, o) => {
64
- const a = M(r.encounterDetails, l);
65
- return /* @__PURE__ */ N(
66
- C,
63
+ const { t: l } = C(), u = (a, s, o) => {
64
+ const r = M(a.encounterDetails, l);
65
+ return /* @__PURE__ */ D(
66
+ A,
67
67
  {
68
- title: a,
69
- id: `encounter-${r.encounterId}`,
68
+ title: r,
69
+ id: `encounter-${a.encounterId}`,
70
70
  open: s,
71
71
  children: [
72
- r.observations.map(
73
- (n, b) => A(
72
+ a.observations.map(
73
+ (n, b) => U(
74
74
  n,
75
75
  b,
76
76
  o,
@@ -79,7 +79,7 @@ const A = (t, i, c, l, u, r) => {
79
79
  c
80
80
  )
81
81
  ),
82
- r.groupedObservations.map(
82
+ a.groupedObservations.map(
83
83
  (n, b) => re(
84
84
  n,
85
85
  l,
@@ -92,7 +92,7 @@ const A = (t, i, c, l, u, r) => {
92
92
  )
93
93
  ]
94
94
  },
95
- `encounter-${r.encounterId}`
95
+ `encounter-${a.encounterId}`
96
96
  );
97
97
  };
98
98
  return /* @__PURE__ */ d(
@@ -102,11 +102,11 @@ const A = (t, i, c, l, u, r) => {
102
102
  "data-testid": "obs-by-encounter-test-id",
103
103
  "aria-label": "obs-by-encounter-aria-label",
104
104
  children: t.map(
105
- (r, s) => u(r, s === 0, s)
105
+ (a, s) => u(a, s === 0, s)
106
106
  )
107
107
  }
108
108
  );
109
- }, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", D = {
109
+ }, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", N = {
110
110
  observations: ne,
111
111
  title: ie
112
112
  }, ce = (t) => ["conceptUuid", t], le = (t, i) => ["observations", t, ...i], ve = ({ config: t }) => {
@@ -114,30 +114,30 @@ const A = (t, i, c, l, u, r) => {
114
114
  conceptNames: c = [],
115
115
  conceptUuid: l = [],
116
116
  hideThumbnail: u = !1
117
- } = i, r = oe(/* @__PURE__ */ new Set()), s = z(), { addNotification: o } = H(), { t: a } = U(), n = te({
117
+ } = i, a = oe(/* @__PURE__ */ new Set()), s = z(), { addNotification: o } = H(), { t: r } = C(), n = te({
118
118
  queries: c.map((e) => ({
119
119
  queryKey: ce(e),
120
120
  queryFn: () => j(e),
121
121
  enabled: !!e
122
122
  }))
123
123
  });
124
- S(() => {
124
+ $(() => {
125
125
  n.forEach((e, v) => {
126
- if (e.isError && !r.current.has(v)) {
127
- const g = c[v];
126
+ if (e.isError && !a.current.has(v)) {
127
+ const T = c[v];
128
128
  o({
129
- title: a("ERROR_DEFAULT_TITLE"),
130
- message: a("ERROR_FETCHING_CONCEPT", { conceptName: g }),
129
+ title: r("ERROR_DEFAULT_TITLE"),
130
+ message: r("ERROR_FETCHING_CONCEPT", { conceptName: T }),
131
131
  type: "error"
132
- }), r.current.add(v);
133
- } else e.isError || r.current.delete(v);
132
+ }), a.current.add(v);
133
+ } else e.isError || a.current.delete(v);
134
134
  });
135
135
  }, [n, c]);
136
136
  const b = R(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = R(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), y = R(() => c.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, c.length]), {
137
137
  data: m,
138
138
  isLoading: f,
139
139
  isError: h,
140
- refetch: T
140
+ refetch: g
141
141
  } = se({
142
142
  queryKey: le(s, p),
143
143
  queryFn: () => J(s, p),
@@ -146,14 +146,14 @@ const A = (t, i, c, l, u, r) => {
146
146
  Y(
147
147
  (e) => {
148
148
  e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
149
- (g) => p.includes(g)
150
- ) && T();
149
+ (T) => p.includes(T)
150
+ ) && g();
151
151
  },
152
- [s, T]
153
- ), S(() => {
152
+ [s, g]
153
+ ), $(() => {
154
154
  h && o({
155
- title: a("ERROR_DEFAULT_TITLE"),
156
- message: a("ERROR_FETCHING_OBSERVATIONS"),
155
+ title: r("ERROR_DEFAULT_TITLE"),
156
+ message: r("ERROR_FETCHING_OBSERVATIONS"),
157
157
  type: "error"
158
158
  });
159
159
  }, [h]);
@@ -165,14 +165,14 @@ const A = (t, i, c, l, u, r) => {
165
165
  { key: "name", header: "name" },
166
166
  { key: "value", header: "value" },
167
167
  { key: "form", header: "form" }
168
- ], I = f || !y, $ = h && y, F = (!m || m.entry?.length === 0 || p.length === 0) && y, L = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, V = F ? a("NO_OBSERVATIONS_FOUND") : void 0, K = _.length > 0 && !I && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
169
- return /* @__PURE__ */ N(
168
+ ], I = f || !y, S = h && y, L = (!m || m.entry?.length === 0 || p.length === 0) && y, V = S ? r("ERROR_FETCHING_OBSERVATIONS") : null, F = L ? r("NO_OBSERVATIONS_FOUND") : void 0, K = _.length > 0 && !I && !S, O = i.titleTranslationKey, E = O ? r(O) : "";
169
+ return /* @__PURE__ */ D(
170
170
  "div",
171
171
  {
172
172
  id: "observations",
173
173
  "data-testid": O ? `observations-${E}` : "observations",
174
174
  "aria-label": "observations-aria-label",
175
- className: D.observations,
175
+ className: N.observations,
176
176
  children: [
177
177
  /* @__PURE__ */ d(
178
178
  x,
@@ -180,7 +180,7 @@ const A = (t, i, c, l, u, r) => {
180
180
  id: "observations-title",
181
181
  testId: O ? `observations-title-${E}` : "observations-title",
182
182
  title: E,
183
- className: D.title,
183
+ className: N.title,
184
184
  children: /* @__PURE__ */ d("p", { children: E })
185
185
  }
186
186
  ),
@@ -196,10 +196,10 @@ const A = (t, i, c, l, u, r) => {
196
196
  {
197
197
  headers: B,
198
198
  rows: [],
199
- ariaLabel: a("OBSERVATIONS"),
199
+ ariaLabel: r("OBSERVATIONS"),
200
200
  loading: I,
201
- errorStateMessage: L,
202
- emptyStateMessage: V,
201
+ errorStateMessage: V,
202
+ emptyStateMessage: F ?? r("NO_OBSERVATIONS_AVAILABLE"),
203
203
  dataTestId: "observations-table"
204
204
  }
205
205
  )
@@ -114558,7 +114558,7 @@ const Q11 = [
114558
114558
  },
114559
114559
  {
114560
114560
  type: "patientDocuments",
114561
- component: l0(() => import("./DocumentsTable-DjFTQRUd.js"))
114561
+ component: l0(() => import("./DocumentsTable-CGenAqfr.js"))
114562
114562
  },
114563
114563
  {
114564
114564
  type: "flowSheet",
@@ -114566,7 +114566,7 @@ const Q11 = [
114566
114566
  },
114567
114567
  {
114568
114568
  type: "forms",
114569
- component: l0(() => import("./FormsTable-BaH-u6Cj.js"))
114569
+ component: l0(() => import("./FormsTable-CWgke1-_.js"))
114570
114570
  },
114571
114571
  {
114572
114572
  type: "labOrders",
@@ -114574,7 +114574,7 @@ const Q11 = [
114574
114574
  },
114575
114575
  {
114576
114576
  type: "observations",
114577
- component: l0(() => import("./Observations-CIB2bMdg.js"))
114577
+ component: l0(() => import("./Observations-lpTgbjJ8.js"))
114578
114578
  },
114579
114579
  {
114580
114580
  type: "ordersControl",
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { af as o, ad as r, J as n, ac as g, K as c, U as l, o as d, a5 as P, al as m, M as v, E as u, N as C, G as A, H as T, a0 as b, a3 as p, Z as I, aw as N, ay as W, az as S, Q as U, a7 as f, a8 as h, n as L, P as R, a2 as D, a4 as y, X as _, W as x, _ as O, a1 as E, au as G, at as H, ab as k, $ as M, ak as V, ah as q, ag as w, h as z, ar as F, aq as K, aj as j, an as B, ao as J, ap as Q, ai as X, am as Y, I as Z, as as $, ae as aa, a6 as ea, a9 as sa, c as ta, ax as ia, a as oa, aa as ra, u as na, av as ga, d as ca } from "./index-CKyHo_Q1.js";
1
+ import { af as o, ad as r, J as n, ac as g, K as c, U as l, o as d, a5 as P, al as m, M as v, E as u, N as C, G as A, H as T, a0 as b, a3 as p, Z as I, aw as N, ay as W, az as S, Q as U, a7 as f, a8 as h, n as L, P as R, a2 as D, a4 as y, X as _, W as x, _ as O, a1 as E, au as G, at as H, ab as k, $ as M, ak as V, ah as q, ag as w, h as z, ar as F, aq as K, aj as j, an as B, ao as J, ap as Q, ai as X, am as Y, I as Z, as as $, ae as aa, a6 as ea, a9 as sa, c as ta, ax as ia, a as oa, aa as ra, u as na, av as ga, d as ca } from "./index-DSanaOUz.js";
2
2
  import "react";
3
3
  import "react/jsx-runtime";
4
4
  import "@tanstack/react-query";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/widgets",
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",