@bahmni/clinical-app 0.0.1-dev.323 → 0.0.1-dev.325
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/App.d.ts.map +1 -1
- package/dist/ConsultationPage-veadoKKn.js +143589 -0
- package/dist/{DocumentsTable-DJp5cpq1-C76ogudP.js → DocumentsTable-DEMSFjaR-4O-XPd0Q.js} +28 -28
- package/dist/{FormsTable-eYSyFNI4-DW7bVuul.js → FormsTable-DMc11j4e-CTExfA42.js} +60 -60
- package/dist/{LNWAZHJI-BVp9uP2k.js → LNWAZHJI-ChUeeDXZ.js} +8 -8
- package/dist/{MWZ6AO7Z-D-m17cE8.js → MWZ6AO7Z-DEy3kmtN.js} +7 -7
- package/dist/{Observations-DqC-iu2a-Bx-GIcJA.js → Observations-Cy5krW_v-BVQYtQCK.js} +35 -35
- package/dist/{YPM2AS64-CGrzz0tJ.js → YPM2AS64-CiGBMGOA.js} +1 -1
- package/dist/extensions/__tests__/__mocks__/extensionsMocks.d.ts +8 -0
- package/dist/extensions/__tests__/__mocks__/extensionsMocks.d.ts.map +1 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/models.d.ts +15 -0
- package/dist/extensions/models.d.ts.map +1 -0
- package/dist/extensions/utils.d.ts +5 -0
- package/dist/extensions/utils.d.ts.map +1 -0
- package/dist/hook-By86Vcmq.js +10 -0
- package/dist/index-BMr_A7ej.js +189022 -0
- package/dist/index-CzGCg-Cz.js +78 -0
- package/dist/index-DyxK6V4W.js +90 -0
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/dist/locales/locale_en.json +6 -0
- package/dist/locales/locale_es.json +6 -0
- package/dist/pages/list/__tests__/__mocks__/listMocks.d.ts +5 -0
- package/dist/pages/list/__tests__/__mocks__/listMocks.d.ts.map +1 -0
- package/dist/pages/list/constants.d.ts +4 -0
- package/dist/pages/list/constants.d.ts.map +1 -0
- package/dist/pages/list/extensions/searchHandler/__tests__/__mocks__/searchHandlerMocks.d.ts +6 -0
- package/dist/pages/list/extensions/searchHandler/__tests__/__mocks__/searchHandlerMocks.d.ts.map +1 -0
- package/dist/pages/list/extensions/searchHandler/index.d.ts +4 -0
- package/dist/pages/list/extensions/searchHandler/index.d.ts.map +1 -0
- package/dist/pages/list/index.d.ts +3 -0
- package/dist/pages/list/index.d.ts.map +1 -0
- package/dist/providers/clinicalConfig/models.d.ts +2 -0
- package/dist/providers/clinicalConfig/models.d.ts.map +1 -1
- package/dist/providers/clinicalConfig/schema.json.d.ts +27 -0
- package/dist/routes/index.d.ts +5 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/model.d.ts +7 -0
- package/dist/routes/model.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/index-BEDG7eJr.js +0 -332295
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { n as G, u as W, o as Y,
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { n as G, u as W, o as Y, c as J, a as X, g as Z, O as ee, p as te } from "./index-BMr_A7ej.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as
|
|
4
|
+
import { useState as l, useCallback as h, useEffect as N, useMemo as _ } from "react";
|
|
5
5
|
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
@@ -33,16 +33,16 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
],
|
|
37
|
-
const [s,
|
|
36
|
+
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Oe = ({ config: a, encounterUuids: g }) => {
|
|
37
|
+
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, D] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), E = G(), { t: n } = W(), { addNotification:
|
|
42
|
-
|
|
43
|
-
}, []), H =
|
|
44
|
-
|
|
45
|
-
}, []), v =
|
|
41
|
+
), E = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [I, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = h((e) => {
|
|
42
|
+
U(e), w(!0);
|
|
43
|
+
}, []), H = h(() => {
|
|
44
|
+
w(!1), U(null), D(/* @__PURE__ */ new Set());
|
|
45
|
+
}, []), v = h((e) => {
|
|
46
46
|
D((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: i, isLoading: q, isError: b, error: y } = ae({
|
|
48
48
|
queryKey: [
|
|
@@ -65,12 +65,12 @@ const Te = [
|
|
|
65
65
|
}, [i]), N(() => {
|
|
66
66
|
C(1), A(void 0);
|
|
67
67
|
}, [E]), N(() => {
|
|
68
|
-
b &&
|
|
68
|
+
b && L({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: y?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [b, y,
|
|
73
|
+
}, [b, y, L, n]), N(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
@@ -89,24 +89,24 @@ const Te = [
|
|
|
89
89
|
e.signal.aborted || D(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const j =
|
|
92
|
+
const j = h(
|
|
93
93
|
(e, t) => {
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
96
96
|
[u]
|
|
97
|
-
), O =
|
|
97
|
+
), O = _(
|
|
98
98
|
() => a?.fields ?? Te,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
), P =
|
|
100
|
+
), P = _(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), x = _(() => ie(O, n), [O, n]), z = _(
|
|
101
101
|
() => O.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "attachments"
|
|
104
104
|
})),
|
|
105
105
|
[O]
|
|
106
|
-
), T =
|
|
106
|
+
), T = _(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
),
|
|
109
|
+
), K = h(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -125,7 +125,7 @@ const Te = [
|
|
|
125
125
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
126
|
X,
|
|
127
127
|
{
|
|
128
|
-
onClick: () =>
|
|
128
|
+
onClick: () => M(e),
|
|
129
129
|
className: d.viewAttachmentsLink,
|
|
130
130
|
"data-testid": `view-attachments-${e.id}`,
|
|
131
131
|
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
@@ -135,20 +135,20 @@ const Te = [
|
|
|
135
135
|
return null;
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
|
-
[
|
|
138
|
+
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ p(Q, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
|
-
headers:
|
|
144
|
+
headers: x,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
146
|
rows: P,
|
|
147
147
|
loading: q,
|
|
148
148
|
errorStateMessage: b ? y?.message : null,
|
|
149
|
-
sortable:
|
|
149
|
+
sortable: z,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
|
-
renderCell:
|
|
151
|
+
renderCell: K,
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
@@ -169,14 +169,14 @@ const Te = [
|
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
171
|
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
|
|
172
|
-
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) ||
|
|
173
|
-
return m === "#" || f ? /* @__PURE__ */
|
|
172
|
+
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), f = $.has(t);
|
|
173
|
+
return m === "#" || f ? /* @__PURE__ */ p(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
177
177
|
"data-testid": `attachment-error-${t}`,
|
|
178
178
|
children: [
|
|
179
|
-
T.length > 1 && /* @__PURE__ */
|
|
179
|
+
T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
180
180
|
t + 1,
|
|
181
181
|
"/",
|
|
182
182
|
T.length
|
|
@@ -185,13 +185,13 @@ const Te = [
|
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
187
|
`${o.id}-${e.url}`
|
|
188
|
-
) : /* @__PURE__ */
|
|
188
|
+
) : /* @__PURE__ */ p(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: d.attachmentItem,
|
|
192
192
|
"data-testid": `attachment-item-${t}`,
|
|
193
193
|
children: [
|
|
194
|
-
T.length > 1 && /* @__PURE__ */
|
|
194
|
+
T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
195
195
|
t + 1,
|
|
196
196
|
"/",
|
|
197
197
|
T.length
|
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
import { jsx as i, jsxs as re, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
-
import { u as te, n as oe, x as se,
|
|
3
|
-
import { useQueryClient as
|
|
2
|
+
import { u as te, n as oe, x as se, l as ne, i as de, s as ie, b as le, d as ue, D as x, g as me, a as ce, O as q, w as fe, v as ye, p as be, e as pe, r as ge } from "./index-BMr_A7ej.js";
|
|
3
|
+
import { useQueryClient as he, useQuery as b } from "@tanstack/react-query";
|
|
4
4
|
import { useState as w, useMemo as d, useCallback as p } from "react";
|
|
5
|
-
const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs",
|
|
5
|
+
const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", v = {
|
|
6
6
|
formsTableBody: Ne,
|
|
7
7
|
customAccordianItem: Oe
|
|
8
8
|
}, Ae = (m) => m ? m.extension?.find(
|
|
9
|
-
(l) => l.url ===
|
|
10
|
-
)?.valueString : void 0,
|
|
9
|
+
(l) => l.url === ge
|
|
10
|
+
)?.valueString : void 0, Ee = ({
|
|
11
11
|
episodeOfCareUuids: m,
|
|
12
12
|
encounterUuids: l,
|
|
13
13
|
config: k
|
|
14
14
|
}) => {
|
|
15
|
-
const { t: n } = te(), c = oe(), [f,
|
|
16
|
-
numberOfVisits:
|
|
17
|
-
hideThumbnail:
|
|
15
|
+
const { t: n } = te(), c = oe(), [f, I] = w(!1), [o, T] = w(null), {
|
|
16
|
+
numberOfVisits: j,
|
|
17
|
+
hideThumbnail: H = !1,
|
|
18
18
|
forms: y
|
|
19
|
-
} = k ?? {},
|
|
19
|
+
} = k ?? {}, D = se(
|
|
20
20
|
m,
|
|
21
21
|
l
|
|
22
|
-
),
|
|
23
|
-
data:
|
|
24
|
-
isLoading:
|
|
25
|
-
isError:
|
|
26
|
-
error:
|
|
27
|
-
refetch:
|
|
28
|
-
} =
|
|
22
|
+
), K = he(), {
|
|
23
|
+
data: E = [],
|
|
24
|
+
isLoading: F,
|
|
25
|
+
isError: L,
|
|
26
|
+
error: V,
|
|
27
|
+
refetch: $
|
|
28
|
+
} = b({
|
|
29
29
|
queryKey: ["forms", c, m],
|
|
30
|
-
queryFn: () => ne(c, void 0,
|
|
31
|
-
enabled: !!c && !
|
|
32
|
-
}),
|
|
33
|
-
let e =
|
|
30
|
+
queryFn: () => ne(c, void 0, j),
|
|
31
|
+
enabled: !!c && !D
|
|
32
|
+
}), B = d(() => {
|
|
33
|
+
let e = E;
|
|
34
34
|
return l && l.length > 0 && (e = e.filter(
|
|
35
35
|
(r) => l.includes(r.encounterUuid)
|
|
36
36
|
)), Array.isArray(y) && y.length > 0 && (e = e.filter(
|
|
37
37
|
(r) => y.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
38
38
|
)), e;
|
|
39
|
-
}, [
|
|
39
|
+
}, [E, l, y]), { data: M = [] } = b({
|
|
40
40
|
queryKey: ["observationForms"],
|
|
41
41
|
queryFn: () => de()
|
|
42
42
|
}), S = p(
|
|
43
|
-
(e) =>
|
|
44
|
-
[
|
|
45
|
-
),
|
|
43
|
+
(e) => M.find((r) => r.name === e)?.uuid,
|
|
44
|
+
[M]
|
|
45
|
+
), g = d(() => {
|
|
46
46
|
if (o)
|
|
47
47
|
return S(o.formName);
|
|
48
48
|
}, [o, S]), {
|
|
49
49
|
data: u,
|
|
50
|
-
isLoading:
|
|
51
|
-
isError:
|
|
52
|
-
error:
|
|
53
|
-
} =
|
|
54
|
-
queryKey: ["formMetadata",
|
|
55
|
-
queryFn: () => ie(
|
|
56
|
-
enabled: !!
|
|
50
|
+
isLoading: z,
|
|
51
|
+
isError: G,
|
|
52
|
+
error: h
|
|
53
|
+
} = b({
|
|
54
|
+
queryKey: ["formMetadata", g],
|
|
55
|
+
queryFn: () => ie(g),
|
|
56
|
+
enabled: !!g && f
|
|
57
57
|
}), {
|
|
58
58
|
data: N,
|
|
59
|
-
isLoading:
|
|
60
|
-
isError:
|
|
59
|
+
isLoading: Q,
|
|
60
|
+
isError: Y,
|
|
61
61
|
error: O
|
|
62
|
-
} =
|
|
62
|
+
} = b({
|
|
63
63
|
queryKey: ["formsEncounterFHIR", o?.encounterUuid],
|
|
64
64
|
queryFn: () => le(o.encounterUuid),
|
|
65
65
|
enabled: !!o?.encounterUuid && f
|
|
66
66
|
});
|
|
67
67
|
ue(
|
|
68
68
|
(e) => {
|
|
69
|
-
e.patientUUID === c && e.updatedConcepts.size > 0 && (
|
|
69
|
+
e.patientUUID === c && e.updatedConcepts.size > 0 && ($(), K.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
70
70
|
},
|
|
71
71
|
[c]
|
|
72
72
|
);
|
|
73
|
-
const
|
|
73
|
+
const J = d(() => !N?.entry || !o?.formName ? [] : N.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
74
74
|
const r = Ae(e);
|
|
75
75
|
return !r || r.includes(o.formName);
|
|
76
|
-
}), [N, o?.formName]),
|
|
76
|
+
}), [N, o?.formName]), P = d(() => {
|
|
77
77
|
if (!u?.schema) return;
|
|
78
78
|
const e = [], r = (a) => {
|
|
79
79
|
(a ?? []).forEach((s) => {
|
|
@@ -99,11 +99,11 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
99
99
|
null
|
|
100
100
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
101
101
|
}, [u]), X = d(() => {
|
|
102
|
-
if (
|
|
103
|
-
return
|
|
102
|
+
if (h)
|
|
103
|
+
return x(h).message;
|
|
104
104
|
if (O)
|
|
105
|
-
return
|
|
106
|
-
}, [
|
|
105
|
+
return x(O).message;
|
|
106
|
+
}, [h, O]), _ = d(
|
|
107
107
|
() => [
|
|
108
108
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
109
109
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
@@ -116,7 +116,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
116
116
|
],
|
|
117
117
|
[]
|
|
118
118
|
), C = d(() => {
|
|
119
|
-
const e =
|
|
119
|
+
const e = B.reduce(
|
|
120
120
|
(r, a) => {
|
|
121
121
|
const s = a.formName;
|
|
122
122
|
r[s] ??= [];
|
|
@@ -140,10 +140,10 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
140
140
|
)
|
|
141
141
|
})
|
|
142
142
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
143
|
-
}, [
|
|
144
|
-
|
|
143
|
+
}, [B, n]), R = p((e) => {
|
|
144
|
+
T(e), I(!0);
|
|
145
145
|
}, []), ee = p(() => {
|
|
146
|
-
|
|
146
|
+
I(!1), T(null);
|
|
147
147
|
}, []), U = p(
|
|
148
148
|
(e, r) => {
|
|
149
149
|
switch (r) {
|
|
@@ -158,17 +158,17 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
158
158
|
[R]
|
|
159
159
|
);
|
|
160
160
|
return /* @__PURE__ */ re(ae, { children: [
|
|
161
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
162
|
-
|
|
161
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: F || L || C.length === 0 || D ? /* @__PURE__ */ i(
|
|
162
|
+
q,
|
|
163
163
|
{
|
|
164
164
|
headers: _,
|
|
165
165
|
ariaLabel: n("FORMS_HEADING"),
|
|
166
166
|
rows: [],
|
|
167
|
-
loading:
|
|
168
|
-
errorStateMessage:
|
|
167
|
+
loading: F,
|
|
168
|
+
errorStateMessage: L ? V?.message : void 0,
|
|
169
169
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
170
170
|
renderCell: U,
|
|
171
|
-
className:
|
|
171
|
+
className: v.formsTableBody,
|
|
172
172
|
dataTestId: "forms-table"
|
|
173
173
|
}
|
|
174
174
|
) : /* @__PURE__ */ i(fe, { align: "start", children: C.map((e, r) => {
|
|
@@ -177,11 +177,11 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
177
177
|
ye,
|
|
178
178
|
{
|
|
179
179
|
title: a,
|
|
180
|
-
className:
|
|
180
|
+
className: v.customAccordianItem,
|
|
181
181
|
testId: `accordian-title-${a}`,
|
|
182
182
|
open: r === 0,
|
|
183
183
|
children: /* @__PURE__ */ i(
|
|
184
|
-
|
|
184
|
+
q,
|
|
185
185
|
{
|
|
186
186
|
headers: _,
|
|
187
187
|
ariaLabel: n("FORMS_HEADING"),
|
|
@@ -191,7 +191,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
191
191
|
sortable: Z,
|
|
192
192
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
193
193
|
renderCell: U,
|
|
194
|
-
className:
|
|
194
|
+
className: v.formsTableBody,
|
|
195
195
|
dataTestId: `forms-table-${a}`
|
|
196
196
|
}
|
|
197
197
|
)
|
|
@@ -200,7 +200,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
200
200
|
);
|
|
201
201
|
}) }) }),
|
|
202
202
|
f && o && /* @__PURE__ */ i(
|
|
203
|
-
|
|
203
|
+
be,
|
|
204
204
|
{
|
|
205
205
|
id: "modalIdForActionAreaLayout",
|
|
206
206
|
portalId: "main-display-area",
|
|
@@ -214,14 +214,14 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
214
214
|
children: /* @__PURE__ */ i(
|
|
215
215
|
pe,
|
|
216
216
|
{
|
|
217
|
-
observations:
|
|
218
|
-
isLoading:
|
|
219
|
-
isError:
|
|
217
|
+
observations: J,
|
|
218
|
+
isLoading: z || Q,
|
|
219
|
+
isError: G || Y,
|
|
220
220
|
errorMessage: X,
|
|
221
221
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
222
222
|
testIdPrefix: o.formName,
|
|
223
|
-
hideThumbnail:
|
|
224
|
-
controlOrder:
|
|
223
|
+
hideThumbnail: H,
|
|
224
|
+
controlOrder: P,
|
|
225
225
|
sectionMap: W
|
|
226
226
|
}
|
|
227
227
|
)
|
|
@@ -230,5 +230,5 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
230
230
|
] });
|
|
231
231
|
};
|
|
232
232
|
export {
|
|
233
|
-
|
|
233
|
+
Ee as default
|
|
234
234
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as
|
|
2
|
-
import {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CiGBMGOA.js";
|
|
2
|
+
import { bC as d, bD as f, bE as e } from "./index-BMr_A7ej.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), n =
|
|
6
|
+
}), n = d(), s = f(() => {
|
|
7
7
|
const o = r.theme_preference || l;
|
|
8
8
|
return o !== "system" ? o : n();
|
|
9
9
|
});
|
|
10
|
-
return e(
|
|
10
|
+
return e(i.Provider, {
|
|
11
11
|
value: a,
|
|
12
12
|
get children() {
|
|
13
13
|
return e(m, {
|
|
14
14
|
localStore: r,
|
|
15
15
|
setLocalStore: t,
|
|
16
16
|
get children() {
|
|
17
|
-
return e(
|
|
17
|
+
return e(u.Provider, {
|
|
18
18
|
value: s,
|
|
19
19
|
get children() {
|
|
20
|
-
return e(
|
|
20
|
+
return e(v, {
|
|
21
21
|
localStore: r,
|
|
22
22
|
setLocalStore: t
|
|
23
23
|
});
|
|
@@ -27,7 +27,7 @@ var p = (a) => {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
},
|
|
30
|
+
}, P = p;
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
P as default
|
|
33
33
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { c as s, T as c, P as
|
|
2
|
-
import {
|
|
3
|
-
var
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-CiGBMGOA.js";
|
|
2
|
+
import { bC as C, bD as v, bE as e } from "./index-BMr_A7ej.js";
|
|
3
|
+
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a =
|
|
6
|
+
}), a = C(), l = v(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|
|
10
10
|
return e(d.Provider, {
|
|
11
11
|
value: t,
|
|
12
12
|
get children() {
|
|
13
|
-
return e(
|
|
13
|
+
return e(u, {
|
|
14
14
|
disabled: !0,
|
|
15
15
|
localStore: r,
|
|
16
16
|
setLocalStore: o,
|
|
17
17
|
get children() {
|
|
18
|
-
return e(
|
|
18
|
+
return e(i.Provider, {
|
|
19
19
|
value: l,
|
|
20
20
|
get children() {
|
|
21
21
|
return e(m, {
|
|
@@ -36,7 +36,7 @@ var f = (t) => {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
}, p =
|
|
39
|
+
}, p = h;
|
|
40
40
|
export {
|
|
41
41
|
p as default
|
|
42
42
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { n as
|
|
1
|
+
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { n as q, o as K, u as N, f as k, h as M, d as Q, m as w, j as z, k as j, q as G, O as H, t as P, I as C, y as Z, C as J, z as Y, A as W, Z as X, B as ee } from "./index-BMr_A7ej.js";
|
|
3
3
|
import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as se, useEffect as $, useMemo as O } from "react";
|
|
5
|
-
const
|
|
6
|
-
const a =
|
|
5
|
+
const x = (t, n, d, l, b, r) => {
|
|
6
|
+
const a = Z(t, n, b), s = a.value, o = J(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
-
|
|
9
|
+
W,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
@@ -14,7 +14,7 @@ const D = (t, n, d, l, b, r) => {
|
|
|
14
14
|
hideThumbnail: r
|
|
15
15
|
}
|
|
16
16
|
)), o === "Video" && (i = /* @__PURE__ */ u(
|
|
17
|
-
|
|
17
|
+
X,
|
|
18
18
|
{
|
|
19
19
|
id: `${s}-video`,
|
|
20
20
|
videoSrc: s,
|
|
@@ -25,7 +25,7 @@ const D = (t, n, d, l, b, r) => {
|
|
|
25
25
|
provider: a.provider
|
|
26
26
|
}), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
Y,
|
|
29
29
|
{
|
|
30
30
|
header: a.header,
|
|
31
31
|
value: i,
|
|
@@ -37,13 +37,13 @@ const D = (t, n, d, l, b, r) => {
|
|
|
37
37
|
`obs-${t.id}`
|
|
38
38
|
);
|
|
39
39
|
}, re = (t, n, d, l, b, r, a) => /* @__PURE__ */ u(
|
|
40
|
-
|
|
40
|
+
C,
|
|
41
41
|
{
|
|
42
42
|
title: t.display,
|
|
43
43
|
id: `grouped-obs-${t.display}-${l}`,
|
|
44
44
|
open: d,
|
|
45
45
|
children: t.members?.map(
|
|
46
|
-
(s, o) =>
|
|
46
|
+
(s, o) => x(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
@@ -60,16 +60,16 @@ const D = (t, n, d, l, b, r) => {
|
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
62
|
const { t: l } = N(), b = (r, a, s) => {
|
|
63
|
-
const o =
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
63
|
+
const o = P(r.encounterDetails, l);
|
|
64
|
+
return /* @__PURE__ */ S(
|
|
65
|
+
C,
|
|
66
66
|
{
|
|
67
67
|
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: a,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(i, m) =>
|
|
72
|
+
(i, m) => x(
|
|
73
73
|
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -105,7 +105,7 @@ const D = (t, n, d, l, b, r) => {
|
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z",
|
|
108
|
+
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
|
|
109
109
|
observations: ie,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (t) => ["conceptUuid", t], le = (t, n) => ["observations", t, ...n], pe = ({ config: t }) => {
|
|
@@ -113,10 +113,10 @@ const D = (t, n, d, l, b, r) => {
|
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), a =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), a = q(), { addNotification: s } = K(), { t: o } = N(), i = te({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => k(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
@@ -134,15 +134,15 @@ const D = (t, n, d, l, b, r) => {
|
|
|
134
134
|
}, [i, d]);
|
|
135
135
|
const m = O(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = O(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = O(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
137
|
+
isLoading: A,
|
|
138
138
|
isError: R,
|
|
139
139
|
refetch: T
|
|
140
140
|
} = ae({
|
|
141
141
|
queryKey: le(a, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => M(a, p),
|
|
143
143
|
enabled: !!a && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
Q(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
@@ -156,49 +156,49 @@ const D = (t, n, d, l, b, r) => {
|
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
158
|
}, [R]);
|
|
159
|
-
const
|
|
159
|
+
const f = O(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = w(c), h = z(e);
|
|
162
|
+
return j(h);
|
|
163
|
+
}, [c]), D = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], g = A || !y, _ = R && y, F = (!c || c.entry?.length === 0 || p.length === 0) && y, L = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, B = F ? o("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !g && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
|
+
return /* @__PURE__ */ S(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
172
|
"data-testid": E ? `observations-${v}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
|
-
className:
|
|
174
|
+
className: I.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
G,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
181
181
|
title: v,
|
|
182
|
-
className:
|
|
182
|
+
className: I.title,
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
U ? /* @__PURE__ */ u(
|
|
187
187
|
oe,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: f,
|
|
190
190
|
title: v,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
H,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: D,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
199
|
+
loading: g,
|
|
200
|
+
errorStateMessage: L,
|
|
201
|
+
emptyStateMessage: B,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bF as we, bG as z, bH as xt, bI as B, bD as q, bE as y, bJ as Ro, bK as ye, bL as R, bM as _, bN as k, bO as N, bP as A, bQ as bs, bR as ir, bS as $e, bT as U, bU as Hn, bV as Vn, bW as dt, bX as D, bY as xs, bZ as cn, b_ as Be, b$ as ws, c0 as qt, c1 as zt, c2 as $s, c3 as Cs, c4 as $n, c5 as Ss, c6 as Nr, c7 as Bt, c8 as zo, c9 as ks, ca as Es, cb as j, cc as Ur, cd as Ms, ce as Ds, cf as sr, cg as As, ch as Ts, ci as zn, cj as Fs, ck as Is, cl as Z, cm as Ps, cn as Ls } from "./index-BMr_A7ej.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UserPrivilege } from '@bahmni/services';
|
|
2
|
+
import { Extension } from '../../models';
|
|
3
|
+
export declare const mockExtensionWithPrivilege: Extension;
|
|
4
|
+
export declare const mockExtensionWithMultiplePrivileges: Extension;
|
|
5
|
+
export declare const mockExtensionNoPrivileges: Extension;
|
|
6
|
+
export declare const mockExtensionWithDifferentPoint: Extension;
|
|
7
|
+
export declare const mockUserPrivileges: UserPrivilege[];
|
|
8
|
+
//# sourceMappingURL=extensionsMocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensionsMocks.d.ts","sourceRoot":"","sources":["../../../../src/extensions/__tests__/__mocks__/extensionsMocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,0BAA0B,EAAE,SAMxC,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,SAMjD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,SAKvC,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,SAI7C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAE7C,CAAC"}
|