@bahmni/widgets 0.0.1-dev.177 → 0.0.1-dev.182

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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a0 as t, X as s, n as o, p as r, r as n, D as g, G as l, y as c, v as d, F as v, I as P, l as b, z as T, E as f, x as p, w as W, S as A, W as C, V as m, a2 as u, a1 as y, a8 as D, a7 as I, a4 as R, a5 as S, a6 as U, a3 as h, a9 as x, Z as N, a as w, u as F, U as G } from "./index-BSPrNaMV.js";
1
+ import { a1 as t, $ as s, o, p as r, C as n, r as g, F as l, z as c, v as d, U as v, W as P, n as b, H as T, N as f, y as p, w as C, S as W, Z as A, V as m, a3 as u, a2 as y, a9 as R, a8 as S, a5 as U, a6 as D, a7 as I, a4 as N, aa as h, a0 as w, a as x, u as F, X as H } from "./index-ByTTSt4p.js";
2
2
  import "react";
3
3
  export {
4
4
  t as ActivePractitionerContext,
@@ -16,21 +16,21 @@ export {
16
16
  T as PatientProgramsTable,
17
17
  f as ProgramDetails,
18
18
  p as RadiologyInvestigationReport,
19
- W as RadiologyInvestigationTable,
20
- A as SearchPatient,
21
- C as UserPrivilegeProvider,
19
+ C as RadiologyInvestigationTable,
20
+ W as SearchPatient,
21
+ A as UserPrivilegeProvider,
22
22
  m as VitalFlowSheet,
23
23
  u as createConfigHook,
24
24
  y as createConfigProvider,
25
- D as getAllWidgetConfigs,
26
- I as getAllWidgetTypes,
27
- R as getWidget,
28
- S as getWidgetConfig,
29
- U as hasWidget,
30
- h as registerWidget,
31
- x as resetWidgetRegistry,
32
- N as useActivePractitioner,
33
- w as useNotification,
25
+ R as getAllWidgetConfigs,
26
+ S as getAllWidgetTypes,
27
+ U as getWidget,
28
+ D as getWidgetConfig,
29
+ I as hasWidget,
30
+ N as registerWidget,
31
+ h as resetWidgetRegistry,
32
+ w as useActivePractitioner,
33
+ x as useNotification,
34
34
  F as usePatientUUID,
35
- G as useUserPrivilege
35
+ H as useUserPrivilege
36
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ObsByEncounter.d.ts","sourceRoot":"","sources":["../../../src/observations/components/ObsByEncounter.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAwB,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAG1E,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,uBAAuB,EAAE,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+CxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ObsByEncounter.d.ts","sourceRoot":"","sources":["../../../src/observations/components/ObsByEncounter.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAwB,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAG1E,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,uBAAuB,EAAE,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAwED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+CxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/widgets",
3
- "version": "0.0.1-dev.177",
3
+ "version": "0.0.1-dev.182",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,172 +0,0 @@
1
- import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import { f as K, _ as C, g as Q, Q as w, h as M, N as V, $ as k, u as G, a as j, q as H, R as P, K as z, e as Y, j as J, s as W, B as X, t as Z } from "./index-BSPrNaMV.js";
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";
5
- import { useTranslation as D } from "react-i18next";
6
- const U = (t, c, n, l, o) => {
7
- const s = Q(t, c), r = s.value, a = w(r);
8
- let i = r;
9
- a === "Image" && (i = /* @__PURE__ */ d(V, { imageSrc: r, alt: r, id: `${r}-img` })), a === "Video" && (i = /* @__PURE__ */ d(k, { id: `${r}-video`, videoSrc: r }));
10
- const u = o("OBSERVATIONS_RECORDED_BY", {
11
- provider: s.provider
12
- }), b = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${p}-${b}-${n}-${c}` : `${p}-${b}-${n}-${c}`;
13
- return /* @__PURE__ */ d(
14
- M,
15
- {
16
- header: s.header,
17
- value: i,
18
- info: u,
19
- id: f,
20
- testId: f,
21
- ariaLabel: f
22
- },
23
- `obs-${t.id}`
24
- );
25
- }, se = (t, c, n, l, o, s) => /* @__PURE__ */ d(
26
- C,
27
- {
28
- title: t.display,
29
- id: `grouped-obs-${t.display}-${l}`,
30
- open: n,
31
- children: t.members?.map(
32
- (r, a) => U(r, a, o, s, c)
33
- )
34
- },
35
- `grouped-obs-${t.id}`
36
- ), oe = ({
37
- groupedData: t,
38
- title: c = ""
39
- }) => {
40
- const { t: n } = D(), l = (o, s, r) => {
41
- const a = K(o.encounterDetails, n);
42
- return /* @__PURE__ */ S(
43
- C,
44
- {
45
- title: a,
46
- id: `encounter-${o.encounterId}`,
47
- open: s,
48
- children: [
49
- o.observations.map(
50
- (i, u) => U(i, u, r, c, n)
51
- ),
52
- o.groupedObservations.map(
53
- (i, u) => se(
54
- i,
55
- n,
56
- s,
57
- u,
58
- r,
59
- c
60
- )
61
- )
62
- ]
63
- },
64
- `encounter-${o.encounterId}`
65
- );
66
- };
67
- return /* @__PURE__ */ d(
68
- "div",
69
- {
70
- id: "obs-by-encounter",
71
- "data-testid": "obs-by-encounter-test-id",
72
- "aria-label": "obs-by-encounter-aria-label",
73
- children: t.map(
74
- (o, s) => l(o, s === 0, s)
75
- )
76
- }
77
- );
78
- }, re = "_observations_kfbhq_1", ae = "_title_kfbhq_12", N = {
79
- observations: re,
80
- title: ae
81
- }, ne = (t) => ["conceptUuid", t], ie = (t, c) => ["observations", t, ...c], pe = ({ config: t }) => {
82
- const c = t, { conceptNames: n = [], conceptUuid: l = [] } = c, o = te(/* @__PURE__ */ new Set()), s = G(), { addNotification: r } = j(), { t: a } = D(), i = x({
83
- queries: n.map((e) => ({
84
- queryKey: ne(e),
85
- queryFn: () => H(e),
86
- enabled: !!e
87
- }))
88
- });
89
- I(() => {
90
- i.forEach((e, m) => {
91
- if (e.isError && !o.current.has(m)) {
92
- const g = n[m];
93
- r({
94
- title: a("ERROR_DEFAULT_TITLE"),
95
- message: a("ERROR_FETCHING_CONCEPT", { conceptName: g }),
96
- type: "error"
97
- }), o.current.add(m);
98
- } else e.isError || o.current.delete(m);
99
- });
100
- }, [i, n]);
101
- const u = h(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), b = h(() => [.../* @__PURE__ */ new Set([...u, ...l])], [u, l]), v = h(() => n.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, n.length]), {
102
- data: p,
103
- isLoading: f,
104
- isError: O,
105
- refetch: R
106
- } = ee({
107
- queryKey: ie(s, b),
108
- queryFn: () => P(s, b),
109
- enabled: !!s && b.length > 0 && v
110
- });
111
- z(
112
- (e) => {
113
- e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
114
- (g) => b.includes(g)
115
- ) && R();
116
- },
117
- [s, R]
118
- ), I(() => {
119
- O && r({
120
- title: a("ERROR_DEFAULT_TITLE"),
121
- message: a("ERROR_FETCHING_OBSERVATIONS"),
122
- type: "error"
123
- });
124
- }, [O]);
125
- const T = h(() => {
126
- if (!p) return [];
127
- const e = Y(p), m = J(e);
128
- return W(m);
129
- }, [p]), B = [
130
- { key: "name", header: "name" },
131
- { key: "value", header: "value" },
132
- { key: "form", header: "form" }
133
- ], _ = f || !v, $ = O && v, A = (!p || p.entry?.length === 0 || b.length === 0) && v, F = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? a("NO_OBSERVATIONS_FOUND") : void 0, q = T.length > 0 && !_ && !$, E = c.titleTranslationKey, y = E ? a(E) : "";
134
- return /* @__PURE__ */ S(
135
- "div",
136
- {
137
- id: "observations",
138
- "data-testid": E ? `observations-${y}` : "observations",
139
- "aria-label": "observations-aria-label",
140
- className: N.observations,
141
- children: [
142
- /* @__PURE__ */ d(
143
- X,
144
- {
145
- id: "observations-title",
146
- testId: E ? `observations-title-${y}` : "observations-title",
147
- title: y,
148
- className: N.title,
149
- children: /* @__PURE__ */ d("p", { children: y })
150
- }
151
- ),
152
- q ? /* @__PURE__ */ d(oe, { groupedData: T, title: y }) : /* @__PURE__ */ d(
153
- Z,
154
- {
155
- headers: B,
156
- rows: [],
157
- ariaLabel: a("OBSERVATIONS"),
158
- loading: _,
159
- errorStateMessage: F,
160
- emptyStateMessage: L,
161
- dataTestId: "observations-table"
162
- }
163
- )
164
- ]
165
- }
166
- );
167
- };
168
- export {
169
- ne as conceptUuidQueryKeys,
170
- pe as default,
171
- ie as observationsQueryKeys
172
- };