@bahmni/widgets 0.0.1-dev.289 → 0.0.1-dev.292

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 Y } from "react/jsx-runtime";
2
- import { u as W, a as X, y as J, t as Z, R as x, i as ee, I as te } from "./index-BBcf9Ywd.js";
2
+ import { u as W, a as X, y as J, t as Z, T as x, i as ee, I as te } from "./index-C0VMuD23.js";
3
3
  import { useQuery as ne } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as g, useMemo as p } from "react";
5
5
  import { useTranslation as ae } from "react-i18next";
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as Z, Fragment as ee } from "react/jsx-runtime";
2
- import { Y as re, u as te, x as oe, Q as ae, W as se, J as ne, L as de, d as ie, M as U, R as me, t as le, i as x, X as ce, b as ue, I as fe, O as ye } from "./index-BBcf9Ywd.js";
2
+ import { G as re, u as te, k as oe, Q as ae, W as se, J as ne, x as de, d as ie, M as U, T as me, t as le, i as x, X as ce, b as ue, I as fe, O as ye } from "./index-C0VMuD23.js";
3
3
  import { useQueryClient as be, useQuery as y } from "@tanstack/react-query";
4
4
  import { useState as k, useMemo as d, useCallback as b } from "react";
5
5
  import { useTranslation as pe } from "react-i18next";
@@ -22,10 +22,10 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
22
22
  i
23
23
  ), Q = be(), {
24
24
  data: D = [],
25
- isLoading: v,
26
- isError: L,
27
- error: H,
28
- refetch: K
25
+ isLoading: T,
26
+ isError: v,
27
+ error: G,
28
+ refetch: H
29
29
  } = y({
30
30
  queryKey: ["forms", l, m],
31
31
  queryFn: () => ae(l, void 0, w),
@@ -37,18 +37,18 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
37
37
  )), Array.isArray(u) && u.length > 0 && (e = e.filter(
38
38
  (t) => u.some((r) => r.toLowerCase() === t.formName.toLowerCase())
39
39
  )), e;
40
- }, [D, i, u]), { data: R = [] } = y({
40
+ }, [D, i, u]), { data: L = [] } = y({
41
41
  queryKey: ["observationForms"],
42
42
  queryFn: () => se()
43
- }), T = b(
44
- (e) => R.find((r) => r.name === e)?.uuid,
45
- [R]
43
+ }), R = b(
44
+ (e) => L.find((r) => r.name === e)?.uuid,
45
+ [L]
46
46
  ), g = d(() => {
47
47
  if (o)
48
- return T(o.formName);
49
- }, [o, T]), {
50
- isLoading: j,
51
- isError: V,
48
+ return R(o.formName);
49
+ }, [o, R]), {
50
+ isLoading: K,
51
+ isError: j,
52
52
  error: F
53
53
  } = y({
54
54
  queryKey: ["formMetadata", g],
@@ -56,8 +56,8 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
56
56
  enabled: !!g && c
57
57
  }), {
58
58
  data: h,
59
- isLoading: $,
60
- isError: z,
59
+ isLoading: V,
60
+ isError: $,
61
61
  error: N
62
62
  } = y({
63
63
  queryKey: ["formsEncounterFHIR", o?.encounterUuid],
@@ -66,14 +66,14 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
66
66
  });
67
67
  ie(
68
68
  (e) => {
69
- e.patientUUID === l && e.updatedConcepts.size > 0 && (K(), Q.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
69
+ e.patientUUID === l && e.updatedConcepts.size > 0 && (H(), Q.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
70
70
  },
71
71
  [l]
72
72
  );
73
- const G = d(() => !h?.entry || !o?.formName ? [] : h.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => {
73
+ const z = d(() => !h?.entry || !o?.formName ? [] : h.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => {
74
74
  const r = he(t);
75
75
  return !r || r.includes(o.formName);
76
- }), [h, o?.formName]), Y = d(() => {
76
+ }), [h, o?.formName]), J = d(() => {
77
77
  if (F)
78
78
  return U(F).message;
79
79
  if (N)
@@ -84,7 +84,7 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
84
84
  { key: "recordedBy", header: s("RECORDED_BY") }
85
85
  ],
86
86
  [s]
87
- ), J = d(
87
+ ), W = d(
88
88
  () => [
89
89
  { key: "recordedOn", sortable: !0 },
90
90
  { key: "recordedBy", sortable: !0 }
@@ -95,7 +95,7 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
95
95
  (r, a) => {
96
96
  const f = a.formName;
97
97
  r[f] ??= [];
98
- const E = a.providers.map((X) => X.providerName).filter(Boolean).join(", ");
98
+ const E = a.providers.map((Y) => Y.providerName).filter(Boolean).join(", ");
99
99
  return r[f].push({
100
100
  id: a.encounterUuid,
101
101
  formName: a.formName,
@@ -117,7 +117,7 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
117
117
  ).sort((r, a) => r.formName.localeCompare(a.formName));
118
118
  }, [B, s]), S = b((e) => {
119
119
  M(e), I(!0);
120
- }, []), W = b(() => {
120
+ }, []), X = b(() => {
121
121
  I(!1), M(null);
122
122
  }, []), q = b(
123
123
  (e, t) => {
@@ -133,14 +133,14 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
133
133
  [S]
134
134
  );
135
135
  return /* @__PURE__ */ Z(ee, { children: [
136
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: v || L || C.length === 0 || A ? /* @__PURE__ */ n(
136
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: T || v || C.length === 0 || A ? /* @__PURE__ */ n(
137
137
  x,
138
138
  {
139
139
  headers: _,
140
140
  ariaLabel: s("FORMS_HEADING"),
141
141
  rows: [],
142
- loading: v,
143
- errorStateMessage: L ? H?.message : void 0,
142
+ loading: T,
143
+ errorStateMessage: v ? G?.message : void 0,
144
144
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
145
145
  renderCell: q,
146
146
  className: O.formsTableBody,
@@ -163,7 +163,7 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
163
163
  rows: a,
164
164
  loading: !1,
165
165
  errorStateMessage: "",
166
- sortable: J,
166
+ sortable: W,
167
167
  emptyStateMessage: s("FORMS_UNAVAILABLE"),
168
168
  renderCell: q,
169
169
  className: O.formsTableBody,
@@ -180,7 +180,7 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
180
180
  id: "modalIdForActionAreaLayout",
181
181
  portalId: "main-display-area",
182
182
  open: c,
183
- onRequestClose: W,
183
+ onRequestClose: X,
184
184
  modalHeading: o.formName,
185
185
  modalLabel: `${o.recordedOn} | ${o.recordedBy}`,
186
186
  passiveModal: !0,
@@ -189,10 +189,10 @@ const ge = "FormsTable-module_formsTableBody__SvGha", Fe = "FormsTable-module_cu
189
189
  children: /* @__PURE__ */ n(
190
190
  ye,
191
191
  {
192
- observations: G,
193
- isLoading: j || $,
194
- isError: V || z,
195
- errorMessage: Y,
192
+ observations: z,
193
+ isLoading: K || V,
194
+ isError: j || $,
195
+ errorMessage: J,
196
196
  emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
197
197
  testIdPrefix: o.formName,
198
198
  hideThumbnail: P
@@ -1,13 +1,13 @@
1
1
  import { jsx as l, jsxs as C } from "react/jsx-runtime";
2
- import { f as M, c as D, e as V, g as k, o as Q, h as H, w as q, m as G, u as P, a as j, k as z, $ as J, d as Y, j as W, l as X, s as Z, H as x, i as ee } from "./index-BBcf9Ywd.js";
2
+ import { f as K, c as D, e as V, g as Q, o as H, h as k, w as q, m as G, u as P, a as j, j as z, N as J, d as Y, l as W, n as X, s as Z, H as x, i as ee } from "./index-C0VMuD23.js";
3
3
  import { useQueries as te, useQuery as se } from "@tanstack/react-query";
4
- import { useRef as oe, useEffect as S, useMemo as h } from "react";
4
+ import { useRef as oe, useEffect as N, useMemo as h } from "react";
5
5
  import { useTranslation as U } from "react-i18next";
6
6
  const w = (t, i, c, d, u, r) => {
7
- const s = V(t, i, u), o = s.value, a = k(o);
7
+ const s = V(t, i, u), o = s.value, a = Q(o);
8
8
  let n = o;
9
9
  a === "Image" && (n = /* @__PURE__ */ l(
10
- H,
10
+ k,
11
11
  {
12
12
  imageSrc: o,
13
13
  alt: o,
@@ -26,7 +26,7 @@ const w = (t, i, c, d, u, r) => {
26
26
  provider: s.provider
27
27
  }), m = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", y = d ? `${d}-${p}-${m}-${c}-${i}` : `${p}-${m}-${c}-${i}`;
28
28
  return /* @__PURE__ */ l(
29
- Q,
29
+ H,
30
30
  {
31
31
  header: s.header,
32
32
  value: n,
@@ -61,7 +61,7 @@ const w = (t, i, c, d, u, r) => {
61
61
  hideThumbnail: c
62
62
  }) => {
63
63
  const { t: d } = U(), u = (r, s, o) => {
64
- const a = M(r.encounterDetails, d);
64
+ const a = K(r.encounterDetails, d);
65
65
  return /* @__PURE__ */ C(
66
66
  D,
67
67
  {
@@ -106,7 +106,7 @@ const w = (t, i, c, d, u, r) => {
106
106
  )
107
107
  }
108
108
  );
109
- }, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", N = {
109
+ }, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", S = {
110
110
  observations: ne,
111
111
  title: ie
112
112
  }, ce = (t) => ["conceptUuid", t], de = (t, i) => ["observations", t, ...i], ve = ({ config: t }) => {
@@ -121,7 +121,7 @@ const w = (t, i, c, d, u, r) => {
121
121
  enabled: !!e
122
122
  }))
123
123
  });
124
- S(() => {
124
+ N(() => {
125
125
  n.forEach((e, v) => {
126
126
  if (e.isError && !r.current.has(v)) {
127
127
  const R = c[v];
@@ -150,14 +150,14 @@ const w = (t, i, c, d, u, r) => {
150
150
  ) && T();
151
151
  },
152
152
  [s, T]
153
- ), S(() => {
153
+ ), N(() => {
154
154
  g && o({
155
155
  title: a("ERROR_DEFAULT_TITLE"),
156
156
  message: a("ERROR_FETCHING_OBSERVATIONS"),
157
157
  type: "error"
158
158
  });
159
159
  }, [g]);
160
- const $ = h(() => {
160
+ const _ = h(() => {
161
161
  if (!p) return [];
162
162
  const e = W(p), v = X(e);
163
163
  return Z(v);
@@ -165,14 +165,14 @@ const w = (t, i, c, d, u, r) => {
165
165
  { key: "name", header: "name" },
166
166
  { key: "value", header: "value" },
167
167
  { key: "form", header: "form" }
168
- ], _ = y || !f, I = g && f, A = (!p || p.entry?.length === 0 || m.length === 0) && f, F = I ? a("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? a("NO_OBSERVATIONS_FOUND") : void 0, K = $.length > 0 && !_ && !I, O = i.titleTranslationKey, E = O ? a(O) : "";
168
+ ], I = y || !f, $ = g && f, A = (!p || p.entry?.length === 0 || m.length === 0) && f, F = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? a("NO_OBSERVATIONS_FOUND") : void 0, M = _.length > 0 && !I && !$, O = i.titleTranslationKey, E = O ? a(O) : "";
169
169
  return /* @__PURE__ */ C(
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: N.observations,
175
+ className: S.observations,
176
176
  children: [
177
177
  /* @__PURE__ */ l(
178
178
  x,
@@ -180,14 +180,14 @@ const w = (t, i, c, d, u, r) => {
180
180
  id: "observations-title",
181
181
  testId: O ? `observations-title-${E}` : "observations-title",
182
182
  title: E,
183
- className: N.title,
183
+ className: S.title,
184
184
  children: /* @__PURE__ */ l("p", { children: E })
185
185
  }
186
186
  ),
187
- K ? /* @__PURE__ */ l(
187
+ M ? /* @__PURE__ */ l(
188
188
  ae,
189
189
  {
190
- groupedData: $,
190
+ groupedData: _,
191
191
  title: E,
192
192
  hideThumbnail: u
193
193
  }
@@ -197,7 +197,7 @@ const w = (t, i, c, d, u, r) => {
197
197
  headers: B,
198
198
  rows: [],
199
199
  ariaLabel: a("OBSERVATIONS"),
200
- loading: _,
200
+ loading: I,
201
201
  errorStateMessage: F,
202
202
  emptyStateMessage: L,
203
203
  dataTestId: "observations-table"
@@ -93258,7 +93258,7 @@ const rHt = [
93258
93258
  },
93259
93259
  {
93260
93260
  type: "patientDocuments",
93261
- component: B1(() => import("./DocumentsTable-C3NxQB1N.js"))
93261
+ component: B1(() => import("./DocumentsTable-BuCm6KdH.js"))
93262
93262
  },
93263
93263
  {
93264
93264
  type: "flowSheet",
@@ -93266,7 +93266,7 @@ const rHt = [
93266
93266
  },
93267
93267
  {
93268
93268
  type: "forms",
93269
- component: B1(() => import("./FormsTable-CmJsWJ2O.js"))
93269
+ component: B1(() => import("./FormsTable-Xv8BgYY6.js"))
93270
93270
  },
93271
93271
  {
93272
93272
  type: "labOrders",
@@ -93274,7 +93274,7 @@ const rHt = [
93274
93274
  },
93275
93275
  {
93276
93276
  type: "observations",
93277
- component: B1(() => import("./Observations-B48aWdf7.js"))
93277
+ component: B1(() => import("./Observations-B81mlEMg.js"))
93278
93278
  },
93279
93279
  {
93280
93280
  type: "ordersControl",
@@ -93446,34 +93446,34 @@ const rMt = (r) => {
93446
93446
  ) });
93447
93447
  };
93448
93448
  export {
93449
- $Ht as $,
93449
+ YVt as $,
93450
93450
  kwt as A,
93451
- Ayt as B,
93451
+ dVt as B,
93452
93452
  Zat as C,
93453
93453
  PHt as D,
93454
93454
  gVt as E,
93455
93455
  SVt as F,
93456
- dVt as G,
93456
+ RHt as G,
93457
93457
  zo as H,
93458
93458
  n0 as I,
93459
93459
  ZHt as J,
93460
93460
  JHt as K,
93461
- SHt as L,
93461
+ Ayt as L,
93462
93462
  _1 as M,
93463
- Mwt as N,
93463
+ $Ht as N,
93464
93464
  KMe as O,
93465
93465
  FHt as P,
93466
93466
  kHt as Q,
93467
- mt as R,
93467
+ GEt as R,
93468
93468
  YHt as S,
93469
- jHt as T,
93470
- zl as U,
93469
+ mt as T,
93470
+ Mwt as U,
93471
93471
  eVt as V,
93472
93472
  IHt as W,
93473
93473
  Oo as X,
93474
- RHt as Y,
93475
- Cl as Z,
93476
- YVt as _,
93474
+ jHt as Y,
93475
+ zl as Z,
93476
+ Cl as _,
93477
93477
  h0 as a,
93478
93478
  XHt as a0,
93479
93479
  uwt as a1,
@@ -93502,21 +93502,21 @@ export {
93502
93502
  vlt as g,
93503
93503
  Mat as h,
93504
93504
  c1 as i,
93505
- qHt as j,
93506
- DHt as k,
93507
- KHt as l,
93505
+ DHt as j,
93506
+ vl as k,
93507
+ qHt as l,
93508
93508
  Aat as m,
93509
- pvt as n,
93509
+ KHt as n,
93510
93510
  Kot as o,
93511
- jvt as p,
93512
- Jvt as q,
93513
- Bgt as r,
93511
+ pvt as p,
93512
+ jvt as q,
93513
+ Jvt as r,
93514
93514
  GHt as s,
93515
93515
  wi as t,
93516
93516
  u0 as u,
93517
- GEt as v,
93517
+ Bgt as v,
93518
93518
  Rat as w,
93519
- vl as x,
93519
+ SHt as x,
93520
93520
  BHt as y,
93521
93521
  GMe as z
93522
93522
  };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a5 as t, a3 as s, A as o, a2 as r, n, a0 as g, p as l, C as P, q as c, D as d, a1 as v, G as T, F as A, B as C, af as b, ah as u, ai as I, r as f, N as m, T as p, O as L, P as R, E as S, K as D, z as E, v as N, S as W, _ as O, V as U, a7 as _, a6 as y, ad as G, ac as h, a9 as x, aa as H, ab as V, a8 as q, ae as z, a4 as B, Z as F, ag as M, a as k, u as w, U as K } from "./index-BBcf9Ywd.js";
1
+ import { a5 as t, a3 as s, A as o, a2 as r, p as n, a0 as g, q as l, C as P, r as c, D as d, a1 as v, B as T, F as A, L as C, af as b, ah as u, ai as I, v as f, U as m, Y as p, O as L, P as R, E as S, K as D, z as E, R as W, S as N, $ as O, V as U, a7 as _, a6 as y, ad as h, ac as x, a9 as G, aa as H, ab as V, a8 as q, ae as z, a4 as B, _ as F, ag as M, a as k, u as w, Z as K } from "./index-C0VMuD23.js";
2
2
  import "react";
3
3
  export {
4
4
  t as ActivePractitionerContext,
@@ -26,15 +26,15 @@ export {
26
26
  S as PatientProgramsTable,
27
27
  D as ProgramDetails,
28
28
  E as RadiologyInvestigationReport,
29
- N as RadiologyInvestigationTable,
30
- W as SearchPatient,
29
+ W as RadiologyInvestigationTable,
30
+ N as SearchPatient,
31
31
  O as UserPrivilegeProvider,
32
32
  U as VitalFlowSheet,
33
33
  _ as createConfigHook,
34
34
  y as createConfigProvider,
35
- G as getAllWidgetConfigs,
36
- h as getAllWidgetTypes,
37
- x as getWidget,
35
+ h as getAllWidgetConfigs,
36
+ x as getAllWidgetTypes,
37
+ G as getWidget,
38
38
  H as getWidgetConfig,
39
39
  V as hasWidget,
40
40
  q as registerWidget,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/widgets",
3
- "version": "0.0.1-dev.289",
3
+ "version": "0.0.1-dev.292",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",