@bahmni/widgets 0.0.1-dev.428 → 0.0.1-dev.430

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, n as J, V as Z, p as x, b as ee, F as te } from "./index-9dxfMEKm.js";
2
+ import { u as W, a as X, s as J, V as Z, m as x, b as ee, F as te } from "./index-8DwKY7zc.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,13 +1,13 @@
1
1
  import { jsx as n, jsxs as P, Fragment as ie } from "react/jsx-runtime";
2
- import { u as de, c as le, d as me, x as ce, C as ue, N as fe, h as be, W as he, e as Ne, f as ye, G as Oe, p as ge, g as q, B as x, V as pe, b as G, r as Te, i as Ee, F as Ie, O as Fe, j as Ae } from "./index-9dxfMEKm.js";
2
+ import { u as de, c as le, d as me, L as ce, x as ue, I as fe, p as be, J as he, e as Ne, f as ye, G as Oe, m as ge, C as q, B as x, V as pe, b as G, r as Te, g as Ie, F as Ee, O as Fe, h as Ae } from "./index-8DwKY7zc.js";
3
3
  import { useQueryClient as _e, useQuery as F } from "@tanstack/react-query";
4
4
  import { useState as $, useMemo as i, useCallback as d } from "react";
5
5
  import { useTranslation as Re } from "react-i18next";
6
- const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", De = "FormsTable-module_customAccordianItem__isszs", y = {
6
+ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", De = "FormsTable-module_customAccordianItem__isszs", y = {
7
7
  formsTableBody: ve,
8
- modalHeading: Ce,
8
+ modalHeading: Le,
9
9
  customAccordianItem: De
10
- }, Le = "startConsultation", He = ({
10
+ }, Ce = "startConsultation", He = ({
11
11
  episodeOfCareUuids: A,
12
12
  encounterUuids: m,
13
13
  config: j,
@@ -18,29 +18,29 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
18
18
  numberOfVisits: K,
19
19
  hideThumbnail: Q = !1,
20
20
  forms: h
21
- } = j ?? {}, W = le(
21
+ } = j ?? {}, J = le(
22
22
  Ae.EDIT_OBSERVATIONS
23
- ), { userPrivileges: N } = me(), g = W && !z && !!b, v = ce(
23
+ ), { userPrivileges: N } = me(), g = J && !z && !!b, v = ce(
24
24
  A,
25
25
  m
26
- ), Y = _e(), {
27
- data: C = [],
26
+ ), W = _e(), {
27
+ data: L = [],
28
28
  isLoading: D,
29
- isError: L,
30
- error: J,
29
+ isError: C,
30
+ error: Y,
31
31
  refetch: X
32
32
  } = F({
33
33
  queryKey: ["forms", c, A],
34
34
  queryFn: () => ue(c, void 0, K),
35
35
  enabled: !!c && !v
36
36
  }), B = i(() => {
37
- let e = C;
37
+ let e = L;
38
38
  return m && m.length > 0 && (e = e.filter(
39
39
  (t) => m.includes(t.encounterUuid)
40
40
  )), Array.isArray(h) && h.length > 0 && (e = e.filter(
41
41
  (t) => h.some((s) => s.toLowerCase() === t.formName.toLowerCase())
42
42
  )), e;
43
- }, [C, m, h]), { data: S = [] } = F({
43
+ }, [L, m, h]), { data: S = [] } = F({
44
44
  queryKey: ["observationForms"],
45
45
  queryFn: () => fe()
46
46
  }), M = d(
@@ -71,7 +71,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
71
71
  });
72
72
  he(
73
73
  (e) => {
74
- e.patientUUID === c && (X(), Y.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
74
+ e.patientUUID === c && (X(), W.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
75
75
  },
76
76
  [c]
77
77
  );
@@ -101,12 +101,12 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
101
101
  (s, r) => {
102
102
  const l = r.formName;
103
103
  s[l] ??= [];
104
- const I = r.providers.map((ne) => ne.providerName).filter(Boolean).join(", ");
104
+ const E = r.providers.map((ne) => ne.providerName).filter(Boolean).join(", ");
105
105
  return s[l].push({
106
106
  id: r.encounterUuid,
107
107
  formName: r.formName,
108
108
  recordedOn: ge(r.encounterDateTime, o, !0).formattedResult,
109
- recordedBy: I ?? "--",
109
+ recordedBy: E ?? "--",
110
110
  encounterDateTime: r.encounterDateTime,
111
111
  encounterUuid: r.encounterUuid
112
112
  }), s;
@@ -117,7 +117,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
117
117
  ([s, r]) => ({
118
118
  formName: s,
119
119
  records: r.sort(
120
- (l, I) => I.encounterDateTime - l.encounterDateTime
120
+ (l, E) => E.encounterDateTime - l.encounterDateTime
121
121
  )
122
122
  })
123
123
  ).sort((s, r) => s.formName.localeCompare(r.formName));
@@ -125,9 +125,9 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
125
125
  R(e), _(!0);
126
126
  }, []), V = d(() => {
127
127
  _(!1), R(null);
128
- }, []), E = d((e) => {
128
+ }, []), I = d((e) => {
129
129
  globalThis.dispatchEvent(
130
- new CustomEvent(Le, {
130
+ new CustomEvent(Ce, {
131
131
  detail: {
132
132
  editOnly: "observationForms",
133
133
  editTitle: "EDIT_OBSERVATION_FORM_TITLE",
@@ -152,7 +152,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
152
152
  kind: "ghost",
153
153
  size: "sm",
154
154
  testId: `edit-form-${e.encounterUuid}`,
155
- onClick: () => E(e),
155
+ onClick: () => I(e),
156
156
  children: /* @__PURE__ */ n(x, {})
157
157
  }
158
158
  ) : null;
@@ -160,17 +160,17 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
160
160
  return null;
161
161
  }
162
162
  },
163
- [H, E, u, o]
163
+ [H, I, u, o]
164
164
  );
165
165
  return /* @__PURE__ */ P(ie, { children: [
166
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: D || L || U.length === 0 || v ? /* @__PURE__ */ n(
166
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: D || C || U.length === 0 || v ? /* @__PURE__ */ n(
167
167
  G,
168
168
  {
169
169
  headers: oe,
170
170
  ariaLabel: o("FORMS_HEADING"),
171
171
  rows: [],
172
172
  loading: D,
173
- errorStateMessage: L ? J?.message : void 0,
173
+ errorStateMessage: C ? Y?.message : void 0,
174
174
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
175
175
  renderCell: k,
176
176
  className: y.formsTableBody,
@@ -179,7 +179,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
179
179
  ) : /* @__PURE__ */ n(Te, { align: "start", children: U.map((e, t) => {
180
180
  const { formName: s, records: r } = e, l = se(r);
181
181
  return /* @__PURE__ */ n(
182
- Ee,
182
+ Ie,
183
183
  {
184
184
  title: s,
185
185
  className: y.customAccordianItem,
@@ -205,7 +205,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
205
205
  );
206
206
  }) }) }),
207
207
  O && a && /* @__PURE__ */ n(
208
- Ie,
208
+ Ee,
209
209
  {
210
210
  id: "modalIdForActionAreaLayout",
211
211
  portalId: "main-display-area",
@@ -221,7 +221,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
221
221
  size: "sm",
222
222
  testId: `edit-form-modal-${a.encounterUuid}`,
223
223
  onClick: () => {
224
- V(), E(a);
224
+ V(), I(a);
225
225
  },
226
226
  children: /* @__PURE__ */ n(x, {})
227
227
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as i, jsxs as S } from "react/jsx-runtime";
2
- import { k as z, D as F, t as G, l as x, p as H, m as P, T as j, R as W, S as J, u as Y, a as X, o as Z, x as ee, q as se, s as te, W as re, v as ae, w as oe, y as ne, z as ie, A as ce, b as le } from "./index-9dxfMEKm.js";
2
+ import { i as G, D as F, t as j, j as z, m as H, k as J, T as P, R as x, S as Y, u as W, a as X, M as Z, L as ee, l as se, n as te, J as re, o as ae, q as oe, v as ne, w as ie, y as ce, b as le } from "./index-8DwKY7zc.js";
3
3
  import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
4
4
  import { useRef as pe, useEffect as C, useMemo as I } from "react";
5
5
  import { useTranslation as w } from "react-i18next";
@@ -9,10 +9,10 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
9
9
  wrapper: ve,
10
10
  secondary: ye
11
11
  }, U = (t, l, n, c, u, r) => {
12
- const a = G(t, l, u), e = a.value, p = x(e);
12
+ const a = j(t, l, u), e = a.value, p = z(e);
13
13
  let o = e;
14
14
  p === "Image" && (o = /* @__PURE__ */ i(
15
- j,
15
+ P,
16
16
  {
17
17
  imageSrc: e,
18
18
  alt: e,
@@ -20,13 +20,13 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
20
20
  hideThumbnail: r
21
21
  }
22
22
  )), p === "Video" && (o = /* @__PURE__ */ i(
23
- W,
23
+ x,
24
24
  {
25
25
  id: `${e}-video`,
26
26
  videoSrc: e,
27
27
  hideThumbnail: r
28
28
  }
29
- )), p === "PDF" && (o = /* @__PURE__ */ i(J, { id: `${e}-pdf`, src: e }));
29
+ )), p === "PDF" && (o = /* @__PURE__ */ i(Y, { id: `${e}-pdf`, src: e }));
30
30
  const b = /* @__PURE__ */ S("div", { className: y.wrapper, children: [
31
31
  /* @__PURE__ */ i("span", { children: a.header.display }),
32
32
  a.header.referenceRange && /* @__PURE__ */ i("span", { className: y.secondary, children: a.header.referenceRange })
@@ -37,7 +37,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
37
37
  m && /* @__PURE__ */ i("span", { className: y.secondary, children: m })
38
38
  ] }), v = t.display, T = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${T}-${v}-${n}-${l}` : `${T}-${v}-${n}-${l}`;
39
39
  return /* @__PURE__ */ i(
40
- P,
40
+ J,
41
41
  {
42
42
  header: b,
43
43
  value: o,
@@ -72,7 +72,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
72
72
  hideThumbnail: n
73
73
  }) => {
74
74
  const { t: c } = w(), u = (r, a, e) => {
75
- const p = z(r.encounterDetails, c);
75
+ const p = G(r.encounterDetails, c);
76
76
  return /* @__PURE__ */ S(
77
77
  F,
78
78
  {
@@ -133,7 +133,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
133
133
  conceptUuid: r = [],
134
134
  hideThumbnail: a = !1,
135
135
  scope: e = "all"
136
- } = c, p = pe(/* @__PURE__ */ new Set()), o = Y(), { addNotification: b } = X(), { t: d } = w(), m = de({
136
+ } = c, p = pe(/* @__PURE__ */ new Set()), o = W(), { addNotification: b } = X(), { t: d } = w(), m = de({
137
137
  queries: u.map((s) => ({
138
138
  queryKey: he(s),
139
139
  queryFn: () => Z(s),
@@ -188,17 +188,17 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
188
188
  type: "error"
189
189
  });
190
190
  }, [N]);
191
- const A = I(() => {
191
+ const L = I(() => {
192
192
  if (!h) return [];
193
193
  let s = ae(h);
194
194
  e === "latest-encounter" && (s = oe(s));
195
195
  const R = ne(s);
196
196
  return ie(R);
197
- }, [h, e]), k = [
197
+ }, [h, e]), M = [
198
198
  { key: "name", header: "name" },
199
199
  { key: "value", header: "value" },
200
200
  { key: "form", header: "form" }
201
- ], L = V || !f, B = N && f, K = (!h || h.entry?.length === 0 || v.length === 0) && f, M = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, q = K ? d("NO_OBSERVATIONS_FOUND") : void 0, Q = A.length > 0 && !L && !B, g = c.titleTranslationKey, E = g ? d(g) : "";
201
+ ], A = V || !f, B = N && f, K = (!h || h.entry?.length === 0 || v.length === 0) && f, k = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, q = K ? d("NO_OBSERVATIONS_FOUND") : void 0, Q = L.length > 0 && !A && !B, g = c.titleTranslationKey, E = g ? d(g) : "";
202
202
  return /* @__PURE__ */ S(
203
203
  "div",
204
204
  {
@@ -220,18 +220,18 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
220
220
  Q ? /* @__PURE__ */ i(
221
221
  Oe,
222
222
  {
223
- groupedData: A,
223
+ groupedData: L,
224
224
  title: E,
225
225
  hideThumbnail: a
226
226
  }
227
227
  ) : /* @__PURE__ */ i(
228
228
  le,
229
229
  {
230
- headers: k,
230
+ headers: M,
231
231
  rows: [],
232
232
  ariaLabel: d("OBSERVATIONS"),
233
- loading: L,
234
- errorStateMessage: M,
233
+ loading: A,
234
+ errorStateMessage: k,
235
235
  emptyStateMessage: q ?? d("NO_OBSERVATIONS_AVAILABLE"),
236
236
  dataTestId: "observations-table"
237
237
  }
@@ -115063,7 +115063,7 @@ const Z01 = [
115063
115063
  },
115064
115064
  {
115065
115065
  type: "patientDocuments",
115066
- component: l0(() => import("./DocumentsTable-C6HW3c4c.js"))
115066
+ component: l0(() => import("./DocumentsTable-GYAgWGwq.js"))
115067
115067
  },
115068
115068
  {
115069
115069
  type: "flowSheet",
@@ -115071,7 +115071,7 @@ const Z01 = [
115071
115071
  },
115072
115072
  {
115073
115073
  type: "forms",
115074
- component: l0(() => import("./FormsTable-Brpx2eFb.js"))
115074
+ component: l0(() => import("./FormsTable-C-7V3So9.js"))
115075
115075
  },
115076
115076
  {
115077
115077
  type: "labOrders",
@@ -115079,7 +115079,7 @@ const Z01 = [
115079
115079
  },
115080
115080
  {
115081
115081
  type: "observations",
115082
- component: l0(() => import("./Observations-fuqAKCep.js"))
115082
+ component: l0(() => import("./Observations-Can1-hcp.js"))
115083
115083
  },
115084
115084
  {
115085
115085
  type: "ordersControl",
@@ -115543,29 +115543,29 @@ const EPe = o.createContext(void 0), rr1 = () => {
115543
115543
  };
115544
115544
  export {
115545
115545
  iJt as $,
115546
- hi as A,
115546
+ Kr1 as A,
115547
115547
  Hc as B,
115548
- qr1 as C,
115548
+ C2 as C,
115549
115549
  xr1 as D,
115550
- TMt as E,
115550
+ Xr1 as E,
115551
115551
  p0 as F,
115552
115552
  R1 as G,
115553
- Kr1 as H,
115554
- Xr1 as I,
115555
- Ajt as J,
115553
+ Ajt as H,
115554
+ tke as I,
115555
+ mr as J,
115556
115556
  nUt as K,
115557
- zUt as L,
115558
- lWt as M,
115559
- tke as N,
115557
+ yi as L,
115558
+ jr1 as M,
115559
+ zUt as N,
115560
115560
  vp as O,
115561
115561
  Qr1 as P,
115562
- mWt as Q,
115562
+ lWt as Q,
115563
115563
  $Ie as R,
115564
115564
  SIe as S,
115565
115565
  DIe as T,
115566
- yGt as U,
115566
+ mWt as U,
115567
115567
  Kr as V,
115568
- mr as W,
115568
+ yGt as W,
115569
115569
  gWt as X,
115570
115570
  SKt as Y,
115571
115571
  gBe as Z,
@@ -115618,24 +115618,24 @@ export {
115618
115618
  Zr as d,
115619
115619
  mBe as e,
115620
115620
  IGt as f,
115621
- C2 as g,
115622
- vTt as h,
115623
- jo as i,
115624
- dn1 as j,
115625
- en1 as k,
115626
- W9e as l,
115627
- Byt as m,
115628
- Gr1 as n,
115629
- jr1 as o,
115630
- wt as p,
115631
- Wr1 as q,
115621
+ jo as g,
115622
+ dn1 as h,
115623
+ en1 as i,
115624
+ W9e as j,
115625
+ Byt as k,
115626
+ Wr1 as l,
115627
+ wt as m,
115628
+ Ur1 as n,
115629
+ rn1 as o,
115630
+ vTt as p,
115631
+ an1 as q,
115632
115632
  Fo as r,
115633
- Ur1 as s,
115633
+ Gr1 as s,
115634
115634
  tn1 as t,
115635
115635
  g0 as u,
115636
- rn1 as v,
115637
- an1 as w,
115638
- yi as x,
115639
- nn1 as y,
115640
- on1 as z
115636
+ nn1 as v,
115637
+ on1 as w,
115638
+ qr1 as x,
115639
+ hi as y,
115640
+ TMt as z
115641
115641
  };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ah as o, af as r, K as n, ae as c, aC as g, L as l, X as d, j as P, a6 as m, an as v, M as u, E as C, Q as T, H as A, I as p, a1 as S, a4 as L, _ as b, ay as D, aA as I, aB as N, aE as U, U as f, aD as h, a8 as W, a9 as E, O, P as R, a3 as _, a5 as y, Z as x, Y as F, $ as M, a2 as G, aw as H, av as k, ad as K, a0 as V, am as j, aj as q, ai as w, aF as z, f as B, at as Y, as as J, al as Q, ap as X, aq as Z, ar as $, ak as aa, ao as ea, J as sa, au as ta, ag as ia, a7 as oa, aa as ra, ac as na, c as ca, az as ga, a as la, ab as da, u as Pa, ax as ma, d as va } from "./index-9dxfMEKm.js";
1
+ import { ah as o, af as r, K as n, ae as c, aC as g, N as l, X as d, h as P, a6 as m, an as v, Q as u, z as C, U as T, A, E as p, a1 as S, a4 as N, _ as b, ay as D, aA as L, aB as U, aE as h, W as I, aD as W, a8 as f, a9 as E, O, P as R, a3 as _, a5 as y, Z as x, Y as F, $ as G, a2 as H, aw as M, av as k, ad as z, a0 as K, am as V, aj as q, ai as w, aF as B, f as Y, at as j, as as Q, al as X, ap as Z, aq as $, ar as J, ak as aa, ao as ea, H as sa, au as ta, ag as ia, a7 as oa, aa as ra, ac as na, c as ca, az as ga, a as la, ab as da, u as Pa, ax as ma, d as va } from "./index-8DwKY7zc.js";
2
2
  import "react";
3
3
  import "react/jsx-runtime";
4
4
  import "@tanstack/react-query";
@@ -19,15 +19,15 @@ export {
19
19
  A as DocumentPrintButton,
20
20
  p as DocumentUpload,
21
21
  S as GenericServiceRequestTable,
22
- L as ImmunizationHistory,
22
+ N as ImmunizationHistory,
23
23
  b as LabInvestigation,
24
24
  D as LocationContext,
25
- I as LocationProvider,
26
- N as LocationSelector,
27
- U as MODULE_TILES_SKELETON_COUNT,
28
- f as MedicationsTable,
29
- h as ModuleTileGrid,
30
- W as NotificationProvider,
25
+ L as LocationProvider,
26
+ U as LocationSelector,
27
+ h as MODULE_TILES_SKELETON_COUNT,
28
+ I as MedicationsTable,
29
+ W as ModuleTileGrid,
30
+ f as NotificationProvider,
31
31
  E as NotificationServiceComponent,
32
32
  O as ObservationsRenderer,
33
33
  R as PatientDetails,
@@ -35,23 +35,23 @@ export {
35
35
  y as ProgramDetails,
36
36
  x as RadiologyInvestigationReport,
37
37
  F as RadiologyInvestigationTable,
38
- M as SearchPatient,
39
- G as TaskList,
40
- H as UserActionProvider,
38
+ G as SearchPatient,
39
+ H as TaskList,
40
+ M as UserActionProvider,
41
41
  k as UserGlobalAction,
42
- K as UserPrivilegeProvider,
43
- V as VitalFlowSheet,
44
- j as clearSearchWidgetRegistry,
42
+ z as UserPrivilegeProvider,
43
+ K as VitalFlowSheet,
44
+ V as clearSearchWidgetRegistry,
45
45
  q as createConfigHook,
46
46
  w as createConfigProvider,
47
- z as deriveFormSchemaData,
48
- B as extractFormName,
49
- Y as getAllWidgetConfigs,
50
- J as getAllWidgetTypes,
51
- Q as getSearchWidget,
52
- X as getWidget,
53
- Z as getWidgetConfig,
54
- $ as hasWidget,
47
+ B as deriveFormSchemaData,
48
+ Y as extractFormName,
49
+ j as getAllWidgetConfigs,
50
+ Q as getAllWidgetTypes,
51
+ X as getSearchWidget,
52
+ Z as getWidget,
53
+ $ as getWidgetConfig,
54
+ J as hasWidget,
55
55
  aa as registerSearchWidget,
56
56
  ea as registerWidget,
57
57
  sa as renderDocumentTile,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/widgets",
3
- "version": "0.0.1-dev.428",
3
+ "version": "0.0.1-dev.430",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",