@bahmni/widgets 0.0.1-dev.166 → 0.0.1-dev.169

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,9 +1,9 @@
1
1
  import { jsxs as b, jsx as d, Fragment as k } from "react/jsx-runtime";
2
- import { c as C, L as te, N as re, $ as ae, e as oe, T as se, u as ne, a as de, y as ie, m as le, g as ce, b as me, d as ue, v as pe, f as be, t as x, H as fe, C as _e, h as $e, o as ge, i as H, l as ye } from "./index-qzRrsNNl.js";
2
+ import { c as C, L as te, N as re, $ as ae, e as oe, A as se, u as ne, l as de, v as ie, g as le, y as ce, a as me, I as ue, b as pe, m as be, t as x, H as fe, C as _e, d as $e, o as ge, f as H, h as ye } from "./index-CDSi0jbD.js";
3
3
  import { useQueryClient as he, useQuery as O } from "@tanstack/react-query";
4
4
  import { useState as P, useMemo as h, useCallback as F } from "react";
5
5
  import { useTranslation as ve } from "react-i18next";
6
- const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe = "_formContent_1pd36_18", Fe = "_formDetailsContainer_1pd36_25", Ce = "_observation_1pd36_30", Me = "_groupContainer_1pd36_39", Re = "_rowContainer_1pd36_43", we = "_groupLabel_1pd36_48", Te = "_rowLabel_1pd36_58", De = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", Ae = "_memberRow_1pd36_81", Ee = "_memberLabel_1pd36_86", Ie = "_memberValue_1pd36_94", Be = "_abnormalValue_1pd36_102", Se = "_commentSection_1pd36_110", Ge = "_commentText_1pd36_116", qe = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", xe = "_nestedGroupMembers_1pd36_141", o = {
6
+ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe = "_formContent_1pd36_18", Fe = "_formDetailsContainer_1pd36_25", Ce = "_observation_1pd36_30", Me = "_groupContainer_1pd36_39", Re = "_rowContainer_1pd36_43", we = "_groupLabel_1pd36_48", De = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", Ae = "_memberRow_1pd36_81", Ie = "_memberLabel_1pd36_86", Ee = "_memberValue_1pd36_94", Be = "_abnormalValue_1pd36_102", Se = "_commentSection_1pd36_110", Ge = "_commentText_1pd36_116", qe = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", xe = "_nestedGroupMembers_1pd36_141", o = {
7
7
  formsTableBody: Ne,
8
8
  customAccordianItem: Le,
9
9
  formContent: Oe,
@@ -12,12 +12,12 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
12
12
  groupContainer: Me,
13
13
  rowContainer: Re,
14
14
  groupLabel: we,
15
- rowLabel: Te,
16
- rowValue: De,
15
+ rowLabel: De,
16
+ rowValue: Te,
17
17
  groupMembers: Ve,
18
18
  memberRow: Ae,
19
- memberLabel: Ee,
20
- memberValue: Ie,
19
+ memberLabel: Ie,
20
+ memberValue: Ee,
21
21
  abnormalValue: Be,
22
22
  commentSection: Se,
23
23
  commentText: Ge,
@@ -220,7 +220,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
220
220
  )?.valueString : void 0, ke = (e) => {
221
221
  if (e)
222
222
  return e.note?.[0]?.text;
223
- }, Ke = (e, t) => e.entry?.find((a) => a.resource?.id === t)?.resource, T = (e, t) => {
223
+ }, Ke = (e, t) => e.entry?.find((a) => a.resource?.id === t)?.resource, D = (e, t) => {
224
224
  const a = Ke(e, t);
225
225
  return a ? {
226
226
  formFieldPath: Pe(a),
@@ -232,16 +232,16 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
232
232
  const a = oe(e);
233
233
  return [
234
234
  ...a.observations.map((s) => {
235
- const { formFieldPath: c, comment: i } = T(
235
+ const { formFieldPath: c, comment: i } = D(
236
236
  e,
237
237
  s.id
238
238
  );
239
239
  return { obs: s, formFieldPath: c, comment: i };
240
240
  }),
241
241
  ...a.groupedObservations.flatMap((s) => {
242
- const { formFieldPath: c } = T(e, s.id);
242
+ const { formFieldPath: c } = D(e, s.id);
243
243
  return (s.members ?? []).map((i) => {
244
- const { comment: r } = T(e, i.id);
244
+ const { comment: r } = D(e, i.id);
245
245
  return { obs: i, formFieldPath: c, comment: r };
246
246
  });
247
247
  })
@@ -266,7 +266,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
266
266
  queryKey: ["forms", s, e],
267
267
  queryFn: () => ie(s, void 0, y),
268
268
  enabled: !!s && !f
269
- }), D = h(() => !t || t.length === 0 ? $ : $.filter(
269
+ }), T = h(() => !t || t.length === 0 ? $ : $.filter(
270
270
  (l) => t.includes(l.encounterUuid)
271
271
  ), [$, t]), { data: V = [] } = O({
272
272
  queryKey: ["observationForms"],
@@ -277,14 +277,14 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
277
277
  ), M = h(() => {
278
278
  if (r)
279
279
  return A(r.formName);
280
- }, [r, A]), { isLoading: Y, error: E } = O({
280
+ }, [r, A]), { isLoading: Y, error: I } = O({
281
281
  queryKey: ["formMetadata", M],
282
282
  queryFn: () => ce(M),
283
283
  enabled: !!M && c
284
284
  }), {
285
285
  data: R,
286
286
  isLoading: J,
287
- error: I
287
+ error: E
288
288
  } = O({
289
289
  queryKey: ["formsEncounterFHIR", r?.encounterUuid],
290
290
  queryFn: () => me(r.encounterUuid),
@@ -312,7 +312,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
312
312
  ],
313
313
  []
314
314
  ), G = h(() => {
315
- const l = D.reduce(
315
+ const l = T.reduce(
316
316
  (m, u) => {
317
317
  const L = u.formName;
318
318
  m[L] ??= [];
@@ -336,7 +336,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
336
336
  )
337
337
  })
338
338
  ).sort((m, u) => m.formName.localeCompare(u.formName));
339
- }, [D, n]), q = F((l) => {
339
+ }, [T, n]), q = F((l) => {
340
340
  p(l), i(!0);
341
341
  }, []), Z = F(() => {
342
342
  i(!1), p(null);
@@ -406,7 +406,7 @@ const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Oe =
406
406
  passiveModal: !0,
407
407
  size: "md",
408
408
  testId: "form-details-modal",
409
- children: /* @__PURE__ */ d("div", { className: o.formContent, children: Y || J ? /* @__PURE__ */ d(ge, { width: "100%", lineCount: 3 }) : E ? /* @__PURE__ */ d("div", { children: H(E).message ?? n("ERROR_FETCHING_FORM_METADATA") }) : I ? /* @__PURE__ */ d("div", { children: H(I).message ?? n("ERROR_FETCHING_FORM_DATA") }) : B.length > 0 ? /* @__PURE__ */ d("div", { className: o.formDetailsContainer, children: B.map(({ obs: l, comment: g }, m) => /* @__PURE__ */ d(
409
+ children: /* @__PURE__ */ d("div", { className: o.formContent, children: Y || J ? /* @__PURE__ */ d(ge, { width: "100%", lineCount: 3 }) : I ? /* @__PURE__ */ d("div", { children: H(I).message ?? n("ERROR_FETCHING_FORM_METADATA") }) : E ? /* @__PURE__ */ d("div", { children: H(E).message ?? n("ERROR_FETCHING_FORM_DATA") }) : B.length > 0 ? /* @__PURE__ */ d("div", { className: o.formDetailsContainer, children: B.map(({ obs: l, comment: g }, m) => /* @__PURE__ */ d(
410
410
  He,
411
411
  {
412
412
  observation: l,
@@ -1,10 +1,10 @@
1
1
  import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import { j as k, _ as C, k as q, L as M, n as V, N as K, $ as Q, u as G, p as j, q as H, r as P, d as z, e as Y, s as J, w as W, B as X, t as Z } from "./index-qzRrsNNl.js";
2
+ import { i as q, _ as C, j as w, L as M, k as V, N as K, $ as Q, u as G, n as j, p as H, q as P, I as z, e as Y, r as J, s as W, B as X, t as Z } from "./index-CDSi0jbD.js";
3
3
  import { useQueries as x, useQuery as ee } from "@tanstack/react-query";
4
- import { useRef as te, useEffect as I, useMemo as h } from "react";
4
+ import { useRef as te, useEffect as $, useMemo as h } from "react";
5
5
  import { useTranslation as D } from "react-i18next";
6
6
  const U = (t, c, n, l, o) => {
7
- const s = q(t, c), r = s.value, a = M(r);
7
+ const s = w(t, c), r = s.value, a = M(r);
8
8
  let i = r;
9
9
  a === "Image" && (i = /* @__PURE__ */ d(K, { imageSrc: r, alt: r, id: `${r}-img` })), a === "Video" && (i = /* @__PURE__ */ d(Q, { id: `${r}-video`, videoSrc: r }));
10
10
  const u = o("OBSERVATIONS_RECORDED_BY", {
@@ -38,7 +38,7 @@ const U = (t, c, n, l, o) => {
38
38
  title: c = ""
39
39
  }) => {
40
40
  const { t: n } = D(), l = (o, s, r) => {
41
- const a = k(o.encounterDetails, n);
41
+ const a = q(o.encounterDetails, n);
42
42
  return /* @__PURE__ */ S(
43
43
  C,
44
44
  {
@@ -86,7 +86,7 @@ const U = (t, c, n, l, o) => {
86
86
  enabled: !!e
87
87
  }))
88
88
  });
89
- I(() => {
89
+ $(() => {
90
90
  i.forEach((e, m) => {
91
91
  if (e.isError && !o.current.has(m)) {
92
92
  const g = n[m];
@@ -115,7 +115,7 @@ const U = (t, c, n, l, o) => {
115
115
  ) && R();
116
116
  },
117
117
  [s, R]
118
- ), I(() => {
118
+ ), $(() => {
119
119
  O && r({
120
120
  title: a("ERROR_DEFAULT_TITLE"),
121
121
  message: a("ERROR_FETCHING_OBSERVATIONS"),
@@ -130,7 +130,7 @@ const U = (t, c, n, l, o) => {
130
130
  { key: "name", header: "name" },
131
131
  { key: "value", header: "value" },
132
132
  { key: "form", header: "form" }
133
- ], _ = f || !v, $ = O && v, L = (!p || p.entry?.length === 0 || b.length === 0) && v, A = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, F = L ? a("NO_OBSERVATIONS_FOUND") : void 0, w = T.length > 0 && !_ && !$, E = c.titleTranslationKey, y = E ? a(E) : "";
133
+ ], I = f || !v, _ = O && v, L = (!p || p.entry?.length === 0 || b.length === 0) && v, A = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, F = L ? a("NO_OBSERVATIONS_FOUND") : void 0, k = T.length > 0 && !I && !_, E = c.titleTranslationKey, y = E ? a(E) : "";
134
134
  return /* @__PURE__ */ S(
135
135
  "div",
136
136
  {
@@ -149,13 +149,13 @@ const U = (t, c, n, l, o) => {
149
149
  children: /* @__PURE__ */ d("p", { children: y })
150
150
  }
151
151
  ),
152
- w ? /* @__PURE__ */ d(oe, { groupedData: T, title: y }) : /* @__PURE__ */ d(
152
+ k ? /* @__PURE__ */ d(oe, { groupedData: T, title: y }) : /* @__PURE__ */ d(
153
153
  Z,
154
154
  {
155
155
  headers: B,
156
156
  rows: [],
157
157
  ariaLabel: a("OBSERVATIONS"),
158
- loading: _,
158
+ loading: I,
159
159
  errorStateMessage: A,
160
160
  emptyStateMessage: F,
161
161
  dataTestId: "observations-table"
@@ -77521,11 +77521,8 @@ const fet = "_searchPatientContainer_4r1cg_1", met = "_searchPatient_4r1cg_1", g
77521
77521
  message: _ instanceof Error ? _.message : String(_),
77522
77522
  type: "error"
77523
77523
  }), w([]), m("");
77524
- else if (M?.patientSearch?.customAttributes) {
77525
- const k = [
77526
- ...M.patientSearch.customAttributes || [],
77527
- ...M.patientSearch.appointment || []
77528
- ];
77524
+ else if (M?.patientSearch) {
77525
+ const k = Object.values(M.patientSearch).filter(Array.isArray).flat();
77529
77526
  x(k);
77530
77527
  const Y = k.map(
77531
77528
  (z) => v(z.translationKey)
@@ -78392,11 +78389,11 @@ const htt = (t) => ["programs", t], ptt = async (t, e) => {
78392
78389
  message: r("PROGRAM_STATE_UPDATED_SUCCESSFULLY_MESSAGE")
78393
78390
  });
78394
78391
  }).catch((y) => {
78395
- const x = String(y), M = x.indexOf("[") + 1, N = x.indexOf("]"), _ = M > 0 && N > M ? l2(x.substring(M, N)) : r("PROGRAM_DETAILS_ERROR_UPDATING_STATE");
78392
+ const x = String(y), M = x.indexOf("[") + 1, N = x.indexOf("]"), _ = M > 0 && N > M ? r(l2(x.substring(M, N))) : r("PROGRAM_DETAILS_ERROR_UPDATING_STATE");
78396
78393
  n({
78397
78394
  type: "error",
78398
78395
  title: r("PROGRAM_DETAILS_STATE_CHANGE_ERROR_TITLE"),
78399
- message: r(_)
78396
+ message: _
78400
78397
  });
78401
78398
  }).finally(() => {
78402
78399
  i(!1);
@@ -78645,7 +78642,7 @@ const irt = () => {
78645
78642
  },
78646
78643
  {
78647
78644
  type: "forms",
78648
- component: nn(() => import("./FormsTable-GBHqYBC8.js"))
78645
+ component: nn(() => import("./FormsTable-CnWTVrBS.js"))
78649
78646
  },
78650
78647
  {
78651
78648
  type: "labOrders",
@@ -78653,7 +78650,7 @@ const irt = () => {
78653
78650
  },
78654
78651
  {
78655
78652
  type: "observations",
78656
- component: nn(() => import("./Observations-DwtrmYYV.js"))
78653
+ component: nn(() => import("./Observations-CG4MEXOi.js"))
78657
78654
  },
78658
78655
  {
78659
78656
  type: "ordersControl",
@@ -78726,7 +78723,7 @@ const srt = (t) => {
78726
78723
  };
78727
78724
  export {
78728
78725
  ztt as $,
78729
- kYe as A,
78726
+ Utt as A,
78730
78727
  Au as B,
78731
78728
  G2 as C,
78732
78729
  pXe as D,
@@ -78734,18 +78731,18 @@ export {
78734
78731
  set as F,
78735
78732
  qet as G,
78736
78733
  Y2 as H,
78737
- ett as I,
78738
- art as J,
78739
- xYe as K,
78734
+ e1 as I,
78735
+ ett as J,
78736
+ art as K,
78740
78737
  Ftt as L,
78741
78738
  kXe as M,
78742
78739
  Ntt as N,
78743
- Qtt as O,
78740
+ xYe as O,
78744
78741
  Xtt as P,
78745
- rtt as Q,
78742
+ Qtt as Q,
78746
78743
  _Qe as R,
78747
78744
  ort as S,
78748
- Utt as T,
78745
+ rtt as T,
78749
78746
  ftt as U,
78750
78747
  Det as V,
78751
78748
  mtt as W,
@@ -78753,36 +78750,36 @@ export {
78753
78750
  aue as Y,
78754
78751
  srt as Z,
78755
78752
  xtt as _,
78756
- ws as a,
78753
+ Ktt as a,
78757
78754
  lrt as a0,
78758
78755
  crt as a1,
78759
78756
  drt as a2,
78760
78757
  urt as a3,
78761
78758
  hrt as a4,
78762
78759
  prt as a5,
78763
- Ktt as b,
78760
+ ir as b,
78764
78761
  C0 as c,
78765
- e1 as d,
78762
+ Gn as d,
78766
78763
  GXe as e,
78767
- Cc as f,
78768
- Gtt as g,
78769
- Gn as h,
78770
- Vr as i,
78771
- ert as j,
78772
- trt as k,
78773
- gde as l,
78774
- Ytt as m,
78775
- Dke as n,
78764
+ Vr as f,
78765
+ Ytt as g,
78766
+ gde as h,
78767
+ ert as i,
78768
+ trt as j,
78769
+ Dke as k,
78770
+ ws as l,
78771
+ Cc as m,
78772
+ pn as n,
78776
78773
  Mtt as o,
78777
- pn as p,
78778
- qtt as q,
78779
- Wtt as r,
78780
- rrt as s,
78774
+ qtt as p,
78775
+ Wtt as q,
78776
+ rrt as r,
78777
+ nrt as s,
78781
78778
  zr as t,
78782
78779
  hn as u,
78783
- ir as v,
78784
- nrt as w,
78780
+ Jtt as v,
78781
+ kYe as w,
78785
78782
  _Je as x,
78786
- Jtt as y,
78783
+ Gtt as y,
78787
78784
  iXe as z
78788
78785
  };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Y as t, W as s, A as o, x as r, z as n, D as g, G as l, F as P, M as c, K as d, O as v, P as b, I as T, J as p, E as A, R as W, S as f, U as m, V as u, a4 as R, a3 as C, a0 as D, a1 as I, a2 as S, Z as U, a5 as y, X as h, p as x, u as N, Q as F } from "./index-qzRrsNNl.js";
1
+ import { Y as t, W as s, w as o, x as r, z as n, D as g, G as l, F as P, M as c, O as d, Q as v, P as T, J as b, K as W, E as p, R as A, S as f, U as m, V as u, a4 as R, a3 as C, a0 as D, a1 as S, a2 as U, Z as y, a5 as I, X as h, n as x, u as N, T as w } from "./index-CDSi0jbD.js";
2
2
  import "react";
3
3
  export {
4
4
  t as ActivePractitionerContext,
@@ -12,23 +12,23 @@ export {
12
12
  c as MedicationsTable,
13
13
  d as NotificationProvider,
14
14
  v as NotificationServiceComponent,
15
- b as PatientDetails,
16
- T as PatientProgramsTable,
17
- p as ProgramDetails,
18
- A as RadiologyInvestigationReport,
19
- W as RadiologyInvestigationTable,
15
+ T as PatientDetails,
16
+ b as PatientProgramsTable,
17
+ W as ProgramDetails,
18
+ p as RadiologyInvestigationReport,
19
+ A as RadiologyInvestigationTable,
20
20
  f as SearchPatient,
21
21
  m as UserPrivilegeProvider,
22
22
  u as VitalFlowSheet,
23
23
  R as getAllWidgetConfigs,
24
24
  C as getAllWidgetTypes,
25
25
  D as getWidget,
26
- I as getWidgetConfig,
27
- S as hasWidget,
28
- U as registerWidget,
29
- y as resetWidgetRegistry,
26
+ S as getWidgetConfig,
27
+ U as hasWidget,
28
+ y as registerWidget,
29
+ I as resetWidgetRegistry,
30
30
  h as useActivePractitioner,
31
31
  x as useNotification,
32
32
  N as usePatientUUID,
33
- F as useUserPrivilege
33
+ w as useUserPrivilege
34
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SearchPatient.d.ts","sourceRoot":"","sources":["../../src/searchPatient/SearchPatient.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EAI1B,MAAM,kBAAkB,CAAC;AAQ1B,UAAU,kBAAkB;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,CACR,IAAI,EAAE,yBAAyB,GAAG,SAAS,EAC3C,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,OAAO,EACzB,iBAAiB,CAAC,EAAE,MAAM,KACvB,IAAI,CAAC;CACX;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA0V/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"SearchPatient.d.ts","sourceRoot":"","sources":["../../src/searchPatient/SearchPatient.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EAI1B,MAAM,kBAAkB,CAAC;AAQ1B,UAAU,kBAAkB;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,CACR,IAAI,EAAE,yBAAyB,GAAG,SAAS,EAC3C,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,OAAO,EACzB,iBAAiB,CAAC,EAAE,MAAM,KACvB,IAAI,CAAC;CACX;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAyV/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/widgets",
3
- "version": "0.0.1-dev.166",
3
+ "version": "0.0.1-dev.169",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",