@bahmni/widgets 0.0.1-dev.403 → 0.0.1-dev.404
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/{DocumentsTable-Dzer5eOY.js → DocumentsTable-DjFTQRUd.js} +4 -4
- package/dist/{FormsTable-CwXX7pm4.js → FormsTable-BaH-u6Cj.js} +15 -15
- package/dist/{Observations-00pOtH3y.js → Observations-CIB2bMdg.js} +29 -29
- package/dist/{index-BqbZxHvD.js → index-CKyHo_Q1.js} +10357 -10205
- package/dist/index.css +1 -1
- package/dist/index.js +7 -7
- package/dist/search/commonSearch/CommonSearchWidget.d.ts.map +1 -1
- package/dist/search/commonSearch/__tests__/__mocks__/commonSearchWidgetMocks.d.ts.map +1 -1
- package/dist/search/commonSearch/__tests__/__mocks__/resultsTableMocks.d.ts +1 -0
- package/dist/search/commonSearch/__tests__/__mocks__/resultsTableMocks.d.ts.map +1 -1
- package/dist/search/commonSearch/__tests__/__mocks__/searchFormMocks.d.ts.map +1 -1
- package/dist/search/commonSearch/__tests__/__mocks__/searchSummaryMocks.d.ts.map +1 -1
- package/dist/search/commonSearch/__tests__/__mocks__/utilsMocks.d.ts.map +1 -1
- package/dist/search/commonSearch/components/ResultsTable.d.ts +13 -2
- package/dist/search/commonSearch/components/ResultsTable.d.ts.map +1 -1
- package/dist/search/commonSearch/constants.d.ts +1 -0
- package/dist/search/commonSearch/constants.d.ts.map +1 -1
- package/dist/search/commonSearch/models.d.ts +36 -1
- package/dist/search/commonSearch/models.d.ts.map +1 -1
- package/dist/search/commonSearch/schema.json.d.ts +6 -0
- package/dist/search/commonSearch/utils.d.ts +4 -2
- package/dist/search/commonSearch/utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
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";
|
|
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";
|
|
@@ -37,9 +37,9 @@ const Te = [
|
|
|
37
37
|
], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ie = ({ config: n, encounterUuids: f }) => {
|
|
38
38
|
const [d, M] = l(!1), [s, U] = l(
|
|
39
39
|
null
|
|
40
|
-
), [
|
|
40
|
+
), [V, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), E = W(), { t: o } = ae(), { addNotification: w } = X(),
|
|
42
|
+
), E = W(), { t: o } = ae(), { addNotification: w } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(P), [k, O] = l(void 0), v = _((e) => {
|
|
43
43
|
U(e), M(!0);
|
|
44
44
|
}, []), z = _(() => {
|
|
45
45
|
M(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
@@ -170,7 +170,7 @@ const Te = [
|
|
|
170
170
|
size: "lg",
|
|
171
171
|
testId: "document-view-modal",
|
|
172
172
|
children: /* @__PURE__ */ r("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
|
|
173
|
-
const a = R(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), y =
|
|
173
|
+
const a = R(e.url), g = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), y = V.has(t);
|
|
174
174
|
return a === "#" || y ? /* @__PURE__ */ T(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
@@ -1,13 +1,13 @@
|
|
|
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,
|
|
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";
|
|
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";
|
|
6
|
-
const He = "FormsTable-module_formsTableBody__SvGha",
|
|
6
|
+
const He = "FormsTable-module_formsTableBody__SvGha", Ve = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", T = {
|
|
7
7
|
formsTableBody: He,
|
|
8
|
-
modalHeading:
|
|
9
|
-
customAccordianItem:
|
|
10
|
-
},
|
|
8
|
+
modalHeading: Ve,
|
|
9
|
+
customAccordianItem: qe
|
|
10
|
+
}, Pe = "startConsultation", ze = ({
|
|
11
11
|
episodeOfCareUuids: D,
|
|
12
12
|
encounterUuids: m,
|
|
13
13
|
config: W,
|
|
@@ -135,19 +135,19 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
135
135
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
136
136
|
],
|
|
137
137
|
[n]
|
|
138
|
-
),
|
|
138
|
+
), V = d(
|
|
139
139
|
() => [...h, { key: "actions", header: n("ACTIONS") }],
|
|
140
140
|
[h, n]
|
|
141
141
|
), fe = c(
|
|
142
|
-
(e) => v && e.some((o) => f(o)) ?
|
|
143
|
-
[v, f,
|
|
142
|
+
(e) => v && e.some((o) => f(o)) ? V : h,
|
|
143
|
+
[v, f, V, h]
|
|
144
144
|
), he = h, pe = d(
|
|
145
145
|
() => [
|
|
146
146
|
{ key: "recordedOn", sortable: !0 },
|
|
147
147
|
{ key: "recordedBy", sortable: !0 }
|
|
148
148
|
],
|
|
149
149
|
[]
|
|
150
|
-
),
|
|
150
|
+
), q = d(() => {
|
|
151
151
|
const e = k.reduce(
|
|
152
152
|
(o, t) => {
|
|
153
153
|
const s = t.formName;
|
|
@@ -172,13 +172,13 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
172
172
|
)
|
|
173
173
|
})
|
|
174
174
|
).sort((o, t) => o.formName.localeCompare(t.formName));
|
|
175
|
-
}, [k, n]),
|
|
175
|
+
}, [k, n]), P = c((e) => {
|
|
176
176
|
B(e), M(!0);
|
|
177
177
|
}, []), j = c(() => {
|
|
178
178
|
M(!1), B(null);
|
|
179
179
|
}, []), R = c((e) => {
|
|
180
180
|
globalThis.dispatchEvent(
|
|
181
|
-
new CustomEvent(
|
|
181
|
+
new CustomEvent(Pe, {
|
|
182
182
|
detail: {
|
|
183
183
|
editOnly: "observationForms",
|
|
184
184
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -192,7 +192,7 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
192
192
|
(e, r) => {
|
|
193
193
|
switch (r) {
|
|
194
194
|
case "recordedOn":
|
|
195
|
-
return /* @__PURE__ */ i(Me, { onClick: () =>
|
|
195
|
+
return /* @__PURE__ */ i(Me, { onClick: () => P(e), children: e.recordedOn });
|
|
196
196
|
case "recordedBy":
|
|
197
197
|
return e.recordedBy;
|
|
198
198
|
case "actions":
|
|
@@ -211,10 +211,10 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
211
211
|
return null;
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
|
-
[
|
|
214
|
+
[P, R, f, n]
|
|
215
215
|
);
|
|
216
216
|
return /* @__PURE__ */ $(ge, { children: [
|
|
217
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: S || U ||
|
|
217
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: S || U || q.length === 0 || L ? /* @__PURE__ */ i(
|
|
218
218
|
Y,
|
|
219
219
|
{
|
|
220
220
|
headers: he,
|
|
@@ -227,7 +227,7 @@ const He = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
227
227
|
className: T.formsTableBody,
|
|
228
228
|
dataTestId: "forms-table"
|
|
229
229
|
}
|
|
230
|
-
) : /* @__PURE__ */ i(Be, { align: "start", children:
|
|
230
|
+
) : /* @__PURE__ */ i(Be, { align: "start", children: q.map((e, r) => {
|
|
231
231
|
const { formName: o, records: t } = e, s = fe(t);
|
|
232
232
|
return /* @__PURE__ */ i(
|
|
233
233
|
Le,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as d, jsxs as
|
|
2
|
-
import {
|
|
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";
|
|
3
3
|
import { useQueries as te, useQuery as se } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as oe, useEffect as
|
|
4
|
+
import { useRef as oe, useEffect as S, useMemo as R } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
6
|
const A = (t, i, c, l, u, r) => {
|
|
7
7
|
const s = w(t, i, u), o = s.value, a = Q(o);
|
|
@@ -15,16 +15,16 @@ const A = (t, i, c, l, u, r) => {
|
|
|
15
15
|
hideThumbnail: r
|
|
16
16
|
}
|
|
17
17
|
)), a === "Video" && (n = /* @__PURE__ */ d(
|
|
18
|
-
|
|
18
|
+
G,
|
|
19
19
|
{
|
|
20
20
|
id: `${o}-video`,
|
|
21
21
|
videoSrc: o,
|
|
22
22
|
hideThumbnail: r
|
|
23
23
|
}
|
|
24
|
-
)), a === "PDF" && (n = /* @__PURE__ */ d(
|
|
24
|
+
)), a === "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}`;
|
|
28
28
|
return /* @__PURE__ */ d(
|
|
29
29
|
q,
|
|
30
30
|
{
|
|
@@ -62,7 +62,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
62
62
|
}) => {
|
|
63
63
|
const { t: l } = U(), u = (r, s, o) => {
|
|
64
64
|
const a = M(r.encounterDetails, l);
|
|
65
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ N(
|
|
66
66
|
C,
|
|
67
67
|
{
|
|
68
68
|
title: a,
|
|
@@ -106,7 +106,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
106
106
|
)
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
|
-
}, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z",
|
|
109
|
+
}, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", D = {
|
|
110
110
|
observations: ne,
|
|
111
111
|
title: ie
|
|
112
112
|
}, ce = (t) => ["conceptUuid", t], le = (t, i) => ["observations", t, ...i], ve = ({ config: t }) => {
|
|
@@ -114,14 +114,14 @@ 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 =
|
|
117
|
+
} = i, r = oe(/* @__PURE__ */ new Set()), s = z(), { addNotification: o } = H(), { t: a } = U(), 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
|
-
|
|
124
|
+
S(() => {
|
|
125
125
|
n.forEach((e, v) => {
|
|
126
126
|
if (e.isError && !r.current.has(v)) {
|
|
127
127
|
const g = c[v];
|
|
@@ -133,46 +133,46 @@ const A = (t, i, c, l, u, r) => {
|
|
|
133
133
|
} else e.isError || r.current.delete(v);
|
|
134
134
|
});
|
|
135
135
|
}, [n, c]);
|
|
136
|
-
const b =
|
|
137
|
-
data:
|
|
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
|
+
data: m,
|
|
138
138
|
isLoading: f,
|
|
139
|
-
isError:
|
|
139
|
+
isError: h,
|
|
140
140
|
refetch: T
|
|
141
141
|
} = se({
|
|
142
|
-
queryKey: le(s,
|
|
143
|
-
queryFn: () => J(s,
|
|
144
|
-
enabled: !!s &&
|
|
142
|
+
queryKey: le(s, p),
|
|
143
|
+
queryFn: () => J(s, p),
|
|
144
|
+
enabled: !!s && p.length > 0 && y
|
|
145
145
|
});
|
|
146
146
|
Y(
|
|
147
147
|
(e) => {
|
|
148
148
|
e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
149
|
-
(g) =>
|
|
149
|
+
(g) => p.includes(g)
|
|
150
150
|
) && T();
|
|
151
151
|
},
|
|
152
152
|
[s, T]
|
|
153
|
-
),
|
|
154
|
-
|
|
153
|
+
), S(() => {
|
|
154
|
+
h && o({
|
|
155
155
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
156
156
|
message: a("ERROR_FETCHING_OBSERVATIONS"),
|
|
157
157
|
type: "error"
|
|
158
158
|
});
|
|
159
|
-
}, [
|
|
160
|
-
const _ =
|
|
161
|
-
if (!
|
|
162
|
-
const e = W(
|
|
159
|
+
}, [h]);
|
|
160
|
+
const _ = R(() => {
|
|
161
|
+
if (!m) return [];
|
|
162
|
+
const e = W(m), v = X(e);
|
|
163
163
|
return Z(v);
|
|
164
|
-
}, [
|
|
164
|
+
}, [m]), B = [
|
|
165
165
|
{ key: "name", header: "name" },
|
|
166
166
|
{ key: "value", header: "value" },
|
|
167
167
|
{ key: "form", header: "form" }
|
|
168
|
-
], I = f || !y, $ =
|
|
169
|
-
return /* @__PURE__ */
|
|
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(
|
|
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:
|
|
175
|
+
className: D.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:
|
|
183
|
+
className: D.title,
|
|
184
184
|
children: /* @__PURE__ */ d("p", { children: E })
|
|
185
185
|
}
|
|
186
186
|
),
|
|
@@ -198,7 +198,7 @@ const A = (t, i, c, l, u, r) => {
|
|
|
198
198
|
rows: [],
|
|
199
199
|
ariaLabel: a("OBSERVATIONS"),
|
|
200
200
|
loading: I,
|
|
201
|
-
errorStateMessage:
|
|
201
|
+
errorStateMessage: L,
|
|
202
202
|
emptyStateMessage: V,
|
|
203
203
|
dataTestId: "observations-table"
|
|
204
204
|
}
|