@bahmni/widgets 0.0.1-dev.239 → 0.0.1-dev.241
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-C2sfIva6.js → DocumentsTable-DteDdtZi.js} +6 -6
- package/dist/{FormsTable-1qfCQlR3.js → FormsTable-8rC2KDQs.js} +4 -4
- package/dist/{Observations-B969A5-O.js → Observations-C4s1Hykn.js} +13 -13
- package/dist/{index-BzSe3GZZ.js → index-BOsdedao.js} +33590 -27014
- package/dist/index.js +1 -1
- package/dist/medications/MedicationsTable.d.ts.map +1 -1
- package/dist/medications/__tests__/__mocks__/actionsMocks.d.ts +4 -0
- package/dist/medications/__tests__/__mocks__/actionsMocks.d.ts.map +1 -0
- package/dist/medications/__tests__/__mocks__/medicationMocks.d.ts +3 -0
- package/dist/medications/__tests__/__mocks__/medicationMocks.d.ts.map +1 -0
- package/dist/medications/components/Actions.d.ts +10 -0
- package/dist/medications/components/Actions.d.ts.map +1 -0
- package/dist/medications/components/actionHandlers.d.ts +4 -0
- package/dist/medications/components/actionHandlers.d.ts.map +1 -0
- package/dist/medications/models.d.ts +7 -0
- package/dist/medications/models.d.ts.map +1 -0
- package/dist/medications/utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as _, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
-
import { u as W, a as X, l as J, o as Z, x, b as ee, y as te } from "./index-
|
|
2
|
+
import { u as W, a as X, l as J, o as Z, k as x, b as ee, y as te } from "./index-BOsdedao.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as p, useEffect as N, useMemo as f } from "react";
|
|
5
5
|
import { useTranslation as ae } from "react-i18next";
|
|
@@ -37,9 +37,9 @@ const _e = [
|
|
|
37
37
|
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, R = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ne = ({ config: n, encounterUuids: E }) => {
|
|
38
38
|
const [d, M] = l(!1), [r, U] = l(
|
|
39
39
|
null
|
|
40
|
-
), [
|
|
40
|
+
), [k, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), T = W(), { t: o } = ae(), { addNotification: w } = X(),
|
|
42
|
+
), T = W(), { t: o } = ae(), { addNotification: w } = X(), P = Number(n?.pageSize) || 5, [D, O] = l(1), [m, F] = l(P), [$, C] = l(void 0), b = p((e) => {
|
|
43
43
|
U(e), M(!0);
|
|
44
44
|
}, []), V = p(() => {
|
|
45
45
|
M(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
@@ -92,7 +92,7 @@ const _e = [
|
|
|
92
92
|
}, [d, r]);
|
|
93
93
|
const H = p(
|
|
94
94
|
(e, t) => {
|
|
95
|
-
t !== m ? (
|
|
95
|
+
t !== m ? (F(t), O(1), C(void 0)) : O(e);
|
|
96
96
|
},
|
|
97
97
|
[m]
|
|
98
98
|
), g = f(
|
|
@@ -153,7 +153,7 @@ const _e = [
|
|
|
153
153
|
className: c.documentsTableBody,
|
|
154
154
|
dataTestId: "documents-table",
|
|
155
155
|
pageSize: m,
|
|
156
|
-
totalItems:
|
|
156
|
+
totalItems: $,
|
|
157
157
|
page: D,
|
|
158
158
|
onPageChange: H
|
|
159
159
|
}
|
|
@@ -170,7 +170,7 @@ const _e = [
|
|
|
170
170
|
size: "lg",
|
|
171
171
|
testId: "document-view-modal",
|
|
172
172
|
children: /* @__PURE__ */ s("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
|
|
173
|
-
const a = j(e.url), I = e.contentType?.toLowerCase().includes("pdf"), i = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), v =
|
|
173
|
+
const a = j(e.url), I = e.contentType?.toLowerCase().includes("pdf"), i = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), v = k.has(t);
|
|
174
174
|
return a === "#" || v ? /* @__PURE__ */ _(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as X, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { r as ee, u as re, F as te, Y as oe, G as ae, K as se, q as ne, c as de, O as C, k as ie, o as ce, b as U, Q as me, e as le, y as ue, d as fe } from "./index-BOsdedao.js";
|
|
3
3
|
import { useQueryClient as ye, useQuery as f } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as k, useMemo as d, useCallback as y } from "react";
|
|
5
5
|
import { useTranslation as pe } from "react-i18next";
|
|
6
6
|
const be = "_formsTableBody_81hra_1", Fe = "_customAccordianItem_81hra_6", E = {
|
|
7
7
|
formsTableBody: be,
|
|
@@ -13,7 +13,7 @@ const be = "_formsTableBody_81hra_1", Fe = "_customAccordianItem_81hra_6", E = {
|
|
|
13
13
|
encounterUuids: i,
|
|
14
14
|
config: p
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: s } = pe(), m = re(), [l, D] =
|
|
16
|
+
const { t: s } = pe(), m = re(), [l, D] = k(!1), [t, I] = k(null), { numberOfVisits: w, hideThumbnail: x = !1 } = p ?? {}, v = te(
|
|
17
17
|
c,
|
|
18
18
|
i
|
|
19
19
|
), K = ye(), {
|
|
@@ -186,7 +186,7 @@ const be = "_formsTableBody_81hra_1", Fe = "_customAccordianItem_81hra_6", E = {
|
|
|
186
186
|
errorMessage: Y,
|
|
187
187
|
emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
|
|
188
188
|
testIdPrefix: t.formName,
|
|
189
|
-
hideThumbnail:
|
|
189
|
+
hideThumbnail: x
|
|
190
190
|
}
|
|
191
191
|
)
|
|
192
192
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as l, jsxs as C } from "react/jsx-runtime";
|
|
2
|
-
import { f as
|
|
2
|
+
import { f as k, E as D, t as q, j as w, g as K, V as Q, L as G, H, u as j, a as P, h as z, x as Y, c as x, i as J, m as W, s as X, N as Z, b as ee } from "./index-BOsdedao.js";
|
|
3
3
|
import { useQueries as te, useQuery as se } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as oe, useEffect as N, useMemo as g } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
6
|
const B = (t, i, c, d, u, r) => {
|
|
7
|
-
const s =
|
|
7
|
+
const s = q(t, i, u), o = s.value, a = w(o);
|
|
8
8
|
let n = o;
|
|
9
9
|
a === "Image" && (n = /* @__PURE__ */ l(
|
|
10
10
|
Q,
|
|
@@ -15,18 +15,18 @@ const B = (t, i, c, d, u, r) => {
|
|
|
15
15
|
hideThumbnail: r
|
|
16
16
|
}
|
|
17
17
|
)), a === "Video" && (n = /* @__PURE__ */ l(
|
|
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__ */ l(
|
|
24
|
+
)), a === "PDF" && (n = /* @__PURE__ */ l(H, { 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", y = d ? `${d}-${m}-${p}-${c}-${i}` : `${m}-${p}-${c}-${i}`;
|
|
28
28
|
return /* @__PURE__ */ l(
|
|
29
|
-
|
|
29
|
+
K,
|
|
30
30
|
{
|
|
31
31
|
header: s.header,
|
|
32
32
|
value: n,
|
|
@@ -61,7 +61,7 @@ const B = (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 =
|
|
64
|
+
const a = k(r.encounterDetails, d);
|
|
65
65
|
return /* @__PURE__ */ C(
|
|
66
66
|
D,
|
|
67
67
|
{
|
|
@@ -114,7 +114,7 @@ const B = (t, i, c, d, u, r) => {
|
|
|
114
114
|
conceptNames: c = [],
|
|
115
115
|
conceptUuid: d = [],
|
|
116
116
|
hideThumbnail: u = !1
|
|
117
|
-
} = i, r = oe(/* @__PURE__ */ new Set()), s =
|
|
117
|
+
} = i, r = oe(/* @__PURE__ */ new Set()), s = j(), { addNotification: o } = P(), { t: a } = U(), n = te({
|
|
118
118
|
queries: c.map((e) => ({
|
|
119
119
|
queryKey: ce(e),
|
|
120
120
|
queryFn: () => z(e),
|
|
@@ -143,7 +143,7 @@ const B = (t, i, c, d, u, r) => {
|
|
|
143
143
|
queryFn: () => Y(s, p),
|
|
144
144
|
enabled: !!s && p.length > 0 && f
|
|
145
145
|
});
|
|
146
|
-
|
|
146
|
+
x(
|
|
147
147
|
(e) => {
|
|
148
148
|
e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
149
149
|
(R) => p.includes(R)
|
|
@@ -159,13 +159,13 @@ const B = (t, i, c, d, u, r) => {
|
|
|
159
159
|
}, [O]);
|
|
160
160
|
const I = g(() => {
|
|
161
161
|
if (!m) return [];
|
|
162
|
-
const e =
|
|
163
|
-
return
|
|
162
|
+
const e = J(m), v = W(e);
|
|
163
|
+
return X(v);
|
|
164
164
|
}, [m]), L = [
|
|
165
165
|
{ key: "name", header: "name" },
|
|
166
166
|
{ key: "value", header: "value" },
|
|
167
167
|
{ key: "form", header: "form" }
|
|
168
|
-
], _ = y || !f, $ = O && f, A = (!m || m.entry?.length === 0 || p.length === 0) && f, F = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, V = A ? a("NO_OBSERVATIONS_FOUND") : void 0,
|
|
168
|
+
], _ = y || !f, $ = O && f, A = (!m || m.entry?.length === 0 || p.length === 0) && f, F = $ ? a("ERROR_FETCHING_OBSERVATIONS") : null, V = A ? a("NO_OBSERVATIONS_FOUND") : void 0, M = I.length > 0 && !_ && !$, h = i.titleTranslationKey, E = h ? a(h) : "";
|
|
169
169
|
return /* @__PURE__ */ C(
|
|
170
170
|
"div",
|
|
171
171
|
{
|
|
@@ -175,7 +175,7 @@ const B = (t, i, c, d, u, r) => {
|
|
|
175
175
|
className: S.observations,
|
|
176
176
|
children: [
|
|
177
177
|
/* @__PURE__ */ l(
|
|
178
|
-
|
|
178
|
+
Z,
|
|
179
179
|
{
|
|
180
180
|
id: "observations-title",
|
|
181
181
|
testId: h ? `observations-title-${E}` : "observations-title",
|
|
@@ -184,7 +184,7 @@ const B = (t, i, c, d, u, r) => {
|
|
|
184
184
|
children: /* @__PURE__ */ l("p", { children: E })
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
|
|
187
|
+
M ? /* @__PURE__ */ l(
|
|
188
188
|
ae,
|
|
189
189
|
{
|
|
190
190
|
groupedData: I,
|