@bahmni/clinical-app 0.0.1-dev.471 → 0.0.1-dev.473
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-DCUdR071.js → ConsultationPage-CKHxEYSx.js} +17867 -16276
- package/dist/{DocumentsTable-DddJ0p1F-Bg-bHYor.js → DocumentsTable-D05Z8kWb-Dz_qxqGy.js} +61 -61
- package/dist/{FormsTable-DLC_vCD0-C_UuAGwT.js → FormsTable-DS8v_y5q-DLKVWSEm.js} +67 -67
- package/dist/{LNWAZHJI-DxPDjR2c.js → LNWAZHJI-B3Qpq3D0.js} +2 -2
- package/dist/{MWZ6AO7Z-BDPCwGdh.js → MWZ6AO7Z-BR6xmPu0.js} +2 -2
- package/dist/{Observations-Cwi0QkK8-CX45zdmP.js → Observations-UeuPSqCU-ClqfsHph.js} +13 -13
- package/dist/{YPM2AS64-bRo4AAZG.js → YPM2AS64-D0X0Gk6O.js} +1 -1
- package/dist/components/consultationPad/__tests__/__mocks__/inputControlRegistryMocks.d.ts.map +1 -1
- package/dist/components/consultationPad/utils.d.ts +1 -0
- package/dist/components/consultationPad/utils.d.ts.map +1 -1
- package/dist/components/forms/disposition/Disposition.d.ts +8 -0
- package/dist/components/forms/disposition/Disposition.d.ts.map +1 -0
- package/dist/components/forms/disposition/index.d.ts +2 -0
- package/dist/components/forms/disposition/index.d.ts.map +1 -0
- package/dist/components/forms/immunization/utils.d.ts.map +1 -1
- package/dist/components/forms/index.d.ts.map +1 -1
- package/dist/components/patientHeader/DispositionActionButton.d.ts +14 -0
- package/dist/components/patientHeader/DispositionActionButton.d.ts.map +1 -0
- package/dist/components/patientHeader/PatientHeader.d.ts.map +1 -1
- package/dist/config/queryClient.d.ts +3 -0
- package/dist/config/queryClient.d.ts.map +1 -0
- package/dist/{hook-Jp81geP3.js → hook-JqJRtSXq.js} +3 -3
- package/dist/{index-bXoksl3w.js → index-DEfBpAC2.js} +3 -3
- package/dist/{index-sjgf7zfi-DXTBl8zZ.js → index-Dyt17CgX-Dkrcy8ng.js} +1 -1
- package/dist/{index-DDxNyscH.js → index-FXW4kDlU.js} +12 -12
- package/dist/{index-Bh3oRZPJ.js → index-N9VEj6aJ.js} +15638 -15585
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/dist/locales/locale_en.json +17 -0
- package/dist/locales/locale_es.json +17 -0
- package/dist/models/serviceRequest.d.ts +1 -0
- package/dist/models/serviceRequest.d.ts.map +1 -1
- package/dist/providers/clinicalConfig/schema.json.d.ts +2 -1
- package/dist/services/dispositionService.d.ts +24 -0
- package/dist/services/dispositionService.d.ts.map +1 -0
- package/dist/services/encounterBundleService.d.ts.map +1 -1
- package/dist/stores/dispositionStore.d.ts +39 -0
- package/dist/stores/dispositionStore.d.ts.map +1 -0
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/utils/fhir/serviceRequestResourceCreator.d.ts +2 -1
- package/dist/utils/fhir/serviceRequestResourceCreator.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as n, jsxs as u, Fragment as pe } from "react/jsx-runtime";
|
|
2
|
-
import { Q as _e, u as
|
|
2
|
+
import { Q as _e, u as Ee, a as ge, f as Ce, z as Ne, D as fe, $ as Ae, B as v, b as De, Z as Ie, t as be, H as Le, k as ye, c as ve, C as K, d as we, o as Oe, M as Se, R as Me, x as Re, T as Y, e as ee } from "./index-N9VEj6aJ.js";
|
|
3
3
|
import { useQuery as Ue } from "@tanstack/react-query";
|
|
4
|
-
import { useState as h, useRef as
|
|
5
|
-
const
|
|
6
|
-
documentsTableBody:
|
|
7
|
-
viewAttachmentsLink:
|
|
8
|
-
documentViewerContainer:
|
|
4
|
+
import { useState as h, useRef as ke, useEffect as _, useMemo as E, useCallback as T } from "react";
|
|
5
|
+
const Be = "DocumentsTable-module_documentsTableBody__6iR3w", $e = "DocumentsTable-module_viewAttachmentsLink__aQ1on", He = "DocumentsTable-module_documentViewerContainer__F5m8D", xe = "DocumentsTable-module_printContainer__rtarJ", ze = "DocumentsTable-module_attachmentItem__17KA7", Ve = "DocumentsTable-module_attachmentCounter__WFiI3", We = "DocumentsTable-module_attachmentError__RI4U2", Fe = "DocumentsTable-module_documentIframe__ptq5I", Ge = "DocumentsTable-module_attachmentContent__IaCEe", qe = "DocumentsTable-module_attachmentLoading__FAR6p", je = "DocumentsTable-module_hiddenWhileLoading__IxocW", Pe = "DocumentsTable-module_documentImage__KQVgS", Qe = "DocumentsTable-module_header__345GY", Ke = "DocumentsTable-module_documentTypeCell__uWGM8", Ye = "DocumentsTable-module_printAllButton__IVYUW", Ze = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
|
|
6
|
+
documentsTableBody: Be,
|
|
7
|
+
viewAttachmentsLink: $e,
|
|
8
|
+
documentViewerContainer: He,
|
|
9
9
|
printContainer: xe,
|
|
10
|
-
attachmentItem:
|
|
11
|
-
attachmentCounter:
|
|
12
|
-
attachmentError:
|
|
13
|
-
documentIframe:
|
|
14
|
-
attachmentContent:
|
|
10
|
+
attachmentItem: ze,
|
|
11
|
+
attachmentCounter: Ve,
|
|
12
|
+
attachmentError: We,
|
|
13
|
+
documentIframe: Fe,
|
|
14
|
+
attachmentContent: Ge,
|
|
15
15
|
attachmentLoading: qe,
|
|
16
16
|
hiddenWhileLoading: je,
|
|
17
17
|
documentImage: Pe,
|
|
@@ -33,67 +33,67 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
], nt = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, X = (l) => l.attachments.length > 0 ? l.attachments : l.documentUrl ? [{ url: l.documentUrl, contentType: l.contentType }] : [], st = ({ config: l, encounterUuids:
|
|
37
|
-
const [i,
|
|
36
|
+
], nt = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, X = (l) => l.attachments.length > 0 ? l.attachments : l.documentUrl ? [{ url: l.documentUrl, contentType: l.contentType }] : [], st = ({ config: l, encounterUuids: $ }) => {
|
|
37
|
+
const [i, H] = h(!1), [r, x] = h(
|
|
38
38
|
null
|
|
39
|
-
), [
|
|
39
|
+
), [D, w] = h(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), [
|
|
41
|
+
), [I, O] = h(
|
|
42
42
|
/* @__PURE__ */ new Set()
|
|
43
|
-
), N =
|
|
43
|
+
), N = ke(null), [S, z] = h(
|
|
44
44
|
null
|
|
45
|
-
),
|
|
45
|
+
), V = S !== null;
|
|
46
46
|
_(() => () => N.current?.abort(), []);
|
|
47
|
-
const
|
|
47
|
+
const g = _e(), { t: a } = Ee(), { addNotification: b } = ge(), C = E(
|
|
48
48
|
() => l?.actions?.find(
|
|
49
49
|
(e) => e.type === Je
|
|
50
50
|
),
|
|
51
51
|
[l?.actions]
|
|
52
|
-
), te = Ce(C?.requiredPrivilege), ne = !!C && te, ae = Number(l?.pageSize) || 5, [M, R] = h(1), [f, oe] = h(ae), [re, U] = h(void 0),
|
|
53
|
-
x(e),
|
|
52
|
+
), te = Ce(C?.requiredPrivilege), ne = !!C && te, ae = Number(l?.pageSize) || 5, [M, R] = h(1), [f, oe] = h(ae), [re, U] = h(void 0), W = T((e) => {
|
|
53
|
+
x(e), H(!0);
|
|
54
54
|
}, []), de = T(() => {
|
|
55
|
-
N.current?.abort(), O(/* @__PURE__ */ new Set()),
|
|
56
|
-
}, []),
|
|
55
|
+
N.current?.abort(), O(/* @__PURE__ */ new Set()), H(!1), x(null), w(/* @__PURE__ */ new Set());
|
|
56
|
+
}, []), F = T((e) => {
|
|
57
57
|
O((t) => new Set(t).add(e));
|
|
58
|
-
}, []),
|
|
58
|
+
}, []), G = T((e) => {
|
|
59
59
|
w((t) => new Set(t).add(e));
|
|
60
60
|
}, []), se = T(() => {
|
|
61
61
|
C && Ne({
|
|
62
62
|
context: { encounterType: C.encounterType },
|
|
63
63
|
action: { type: "create", resourceType: "DocumentReference" }
|
|
64
64
|
});
|
|
65
|
-
}, [C]), { data:
|
|
65
|
+
}, [C]), { data: A, isLoading: le, isError: k, error: B, refetch: q } = Ue({
|
|
66
66
|
queryKey: [
|
|
67
67
|
"documents",
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
g,
|
|
69
|
+
$,
|
|
70
70
|
M,
|
|
71
71
|
f
|
|
72
72
|
],
|
|
73
|
-
enabled: !!
|
|
73
|
+
enabled: !!g,
|
|
74
74
|
queryFn: () => fe(
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
g,
|
|
76
|
+
$,
|
|
77
77
|
f,
|
|
78
78
|
M
|
|
79
79
|
)
|
|
80
80
|
});
|
|
81
|
-
|
|
81
|
+
Ae(
|
|
82
82
|
(e) => {
|
|
83
|
-
e.patientUUID ===
|
|
83
|
+
e.patientUUID === g && e.updatedResources.documents && q();
|
|
84
84
|
},
|
|
85
|
-
[
|
|
85
|
+
[g, q]
|
|
86
86
|
), _(() => {
|
|
87
|
-
|
|
88
|
-
}, [
|
|
87
|
+
A && U(A.total);
|
|
88
|
+
}, [A]), _(() => {
|
|
89
89
|
R(1), U(void 0);
|
|
90
|
-
}, [
|
|
91
|
-
|
|
90
|
+
}, [g]), _(() => {
|
|
91
|
+
k && b({
|
|
92
92
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
93
|
-
message:
|
|
93
|
+
message: B?.message ?? "",
|
|
94
94
|
type: "error"
|
|
95
95
|
});
|
|
96
|
-
}, [B,
|
|
96
|
+
}, [k, B, b, a]), _(() => {
|
|
97
97
|
const e = new AbortController();
|
|
98
98
|
return (async () => {
|
|
99
99
|
if (!i || !r) return;
|
|
@@ -137,20 +137,20 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
137
137
|
t !== f ? (oe(t), R(1), U(void 0)) : R(e);
|
|
138
138
|
},
|
|
139
139
|
[f]
|
|
140
|
-
), L =
|
|
140
|
+
), L = E(
|
|
141
141
|
() => l?.fields ?? tt,
|
|
142
142
|
[l?.fields]
|
|
143
|
-
), ie =
|
|
143
|
+
), ie = E(() => [...A?.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), [A]), me = E(() => De(L, a), [L, a]), ue = E(
|
|
144
144
|
() => L.map((e) => ({
|
|
145
145
|
key: e,
|
|
146
146
|
sortable: e !== "attachments"
|
|
147
147
|
})),
|
|
148
148
|
[L]
|
|
149
|
-
), c =
|
|
149
|
+
), c = E(
|
|
150
150
|
() => r ? X(r) : [],
|
|
151
151
|
[r]
|
|
152
152
|
), j = c.every(
|
|
153
|
-
(e, t) =>
|
|
153
|
+
(e, t) => I.has(t) || D.has(t) || v(e.url) === "#"
|
|
154
154
|
);
|
|
155
155
|
_(() => {
|
|
156
156
|
if (!i || c.length === 0) return;
|
|
@@ -164,10 +164,10 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
164
164
|
async (e, t) => {
|
|
165
165
|
if (!r || N.current) return;
|
|
166
166
|
const d = new AbortController(), { signal: s } = d;
|
|
167
|
-
N.current = d,
|
|
167
|
+
N.current = d, z(t);
|
|
168
168
|
const m = document.getElementById(Z);
|
|
169
169
|
try {
|
|
170
|
-
await
|
|
170
|
+
await Ie(
|
|
171
171
|
e,
|
|
172
172
|
r.documentIdentifier,
|
|
173
173
|
{ container: m, signal: s }
|
|
@@ -179,15 +179,15 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
179
179
|
type: "error"
|
|
180
180
|
});
|
|
181
181
|
} finally {
|
|
182
|
-
N.current = null,
|
|
182
|
+
N.current = null, z(null);
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
185
|
[r, b, a]
|
|
186
|
-
), Q =
|
|
186
|
+
), Q = E(
|
|
187
187
|
() => c.filter(
|
|
188
|
-
(e, t) => v(e.url) !== "#" && !
|
|
188
|
+
(e, t) => v(e.url) !== "#" && !D.has(t)
|
|
189
189
|
),
|
|
190
|
-
[c,
|
|
190
|
+
[c, D]
|
|
191
191
|
), he = T(
|
|
192
192
|
(e, t) => {
|
|
193
193
|
switch (t) {
|
|
@@ -218,7 +218,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
218
218
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ n(
|
|
219
219
|
be,
|
|
220
220
|
{
|
|
221
|
-
onClick: () =>
|
|
221
|
+
onClick: () => W(e),
|
|
222
222
|
className: o.viewAttachmentsLink,
|
|
223
223
|
"data-testid": `view-attachments-${e.id}`,
|
|
224
224
|
children: a("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
@@ -228,7 +228,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
228
228
|
return null;
|
|
229
229
|
}
|
|
230
230
|
},
|
|
231
|
-
[
|
|
231
|
+
[W, a]
|
|
232
232
|
);
|
|
233
233
|
return /* @__PURE__ */ u(pe, { children: [
|
|
234
234
|
ne && /* @__PURE__ */ u(ve, { className: o.header, testId: "documents-header", children: [
|
|
@@ -253,7 +253,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
253
253
|
ariaLabel: a("DOCUMENTS_TABLE_HEADING"),
|
|
254
254
|
rows: ie,
|
|
255
255
|
loading: le,
|
|
256
|
-
errorStateMessage:
|
|
256
|
+
errorStateMessage: k ? B?.message : null,
|
|
257
257
|
sortable: ue,
|
|
258
258
|
emptyStateMessage: a("DOCUMENTS_NO_RECORDS"),
|
|
259
259
|
renderCell: he,
|
|
@@ -284,14 +284,14 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
284
284
|
size: "sm",
|
|
285
285
|
className: o.printAllButton,
|
|
286
286
|
renderIcon: S === "all" ? J : Y,
|
|
287
|
-
disabled:
|
|
287
|
+
disabled: V || !j,
|
|
288
288
|
testId: "print-all-attachments",
|
|
289
289
|
onClick: () => P(Q, "all"),
|
|
290
290
|
children: a("DOCUMENTS_PRINT_ALL")
|
|
291
291
|
}
|
|
292
292
|
),
|
|
293
293
|
c.map((e, t) => {
|
|
294
|
-
const d = v(e.url), s = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), p =
|
|
294
|
+
const d = v(e.url), s = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || nt.test(e.url ?? ""), p = D.has(t);
|
|
295
295
|
return d === "#" || p ? /* @__PURE__ */ u(
|
|
296
296
|
"div",
|
|
297
297
|
{
|
|
@@ -325,7 +325,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
325
325
|
label: a("DOCUMENTS_PRINT_ATTACHMENT", {
|
|
326
326
|
index: t + 1
|
|
327
327
|
}),
|
|
328
|
-
disabled:
|
|
328
|
+
disabled: V || !j,
|
|
329
329
|
testId: `print-attachment-${t}`,
|
|
330
330
|
onClick: () => P([e], t),
|
|
331
331
|
children: S === t ? /* @__PURE__ */ n(J, {}) : /* @__PURE__ */ n(Y, {})
|
|
@@ -333,7 +333,7 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
333
333
|
)
|
|
334
334
|
] }),
|
|
335
335
|
/* @__PURE__ */ u("div", { className: o.attachmentContent, children: [
|
|
336
|
-
!
|
|
336
|
+
!I.has(t) && /* @__PURE__ */ n(
|
|
337
337
|
"div",
|
|
338
338
|
{
|
|
339
339
|
className: o.attachmentLoading,
|
|
@@ -351,18 +351,18 @@ const $e = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTab
|
|
|
351
351
|
{
|
|
352
352
|
src: d,
|
|
353
353
|
alt: r.documentIdentifier,
|
|
354
|
-
className: `${o.documentImage} ${
|
|
355
|
-
onLoad: () =>
|
|
356
|
-
onError: () =>
|
|
354
|
+
className: `${o.documentImage} ${I.has(t) ? "" : o.hiddenWhileLoading}`,
|
|
355
|
+
onLoad: () => F(t),
|
|
356
|
+
onError: () => G(t)
|
|
357
357
|
}
|
|
358
358
|
) : /* @__PURE__ */ n(
|
|
359
359
|
"iframe",
|
|
360
360
|
{
|
|
361
361
|
src: s ? `${d}#toolbar=0` : d,
|
|
362
|
-
className: `${o.documentIframe} ${
|
|
362
|
+
className: `${o.documentIframe} ${I.has(t) ? "" : o.hiddenWhileLoading}`,
|
|
363
363
|
title: r.documentIdentifier,
|
|
364
|
-
onLoad: () =>
|
|
365
|
-
onError: () =>
|
|
364
|
+
onLoad: () => F(t),
|
|
365
|
+
onError: () => G(t)
|
|
366
366
|
}
|
|
367
367
|
)
|
|
368
368
|
] })
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
1
|
+
import { jsx as n, jsxs as H, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { u as ie, Q as de, f as le, p as me, g as ue, h as ce, E as fe, q as ye, $ as pe, i as Ne, X as ge, j as he, H as be, z as Oe, C as $, l as z, t as Te, M as V, O as Ie, S as Ae, R as _e, m as Ee, n as Re } from "./index-N9VEj6aJ.js";
|
|
3
|
+
import { useQueryClient as ve, useQuery as A } from "@tanstack/react-query";
|
|
4
|
+
import { useState as Q, useMemo as i, useCallback as d } from "react";
|
|
5
|
+
const Ce = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", g = {
|
|
6
|
+
formsTableBody: Ce,
|
|
7
7
|
modalHeading: Le,
|
|
8
|
-
customAccordianItem:
|
|
8
|
+
customAccordianItem: Be
|
|
9
9
|
}, De = ({
|
|
10
10
|
episodeOfCareUuids: _,
|
|
11
11
|
encounterUuids: l,
|
|
12
|
-
config:
|
|
13
|
-
disableActions:
|
|
12
|
+
config: j,
|
|
13
|
+
disableActions: x = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: o } =
|
|
16
|
+
const { t: o } = ie(), m = de(), [h, E] = Q(!1), [s, R] = Q(null), {
|
|
17
17
|
numberOfVisits: K,
|
|
18
|
-
hideThumbnail:
|
|
18
|
+
hideThumbnail: G = !1,
|
|
19
19
|
forms: p
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
), { userPrivileges: N } = me(),
|
|
20
|
+
} = j ?? {}, P = le(
|
|
21
|
+
Re.EDIT_OBSERVATIONS
|
|
22
|
+
), { userPrivileges: N } = me(), b = P && !x && !!y, v = ue(
|
|
23
23
|
_,
|
|
24
24
|
l
|
|
25
|
-
),
|
|
26
|
-
data:
|
|
25
|
+
), X = ve(), {
|
|
26
|
+
data: C = [],
|
|
27
27
|
isLoading: L,
|
|
28
|
-
isError:
|
|
29
|
-
error:
|
|
30
|
-
refetch:
|
|
28
|
+
isError: B,
|
|
29
|
+
error: W,
|
|
30
|
+
refetch: Y
|
|
31
31
|
} = A({
|
|
32
32
|
queryKey: ["forms", m, _],
|
|
33
33
|
queryFn: () => ce(m, void 0, K),
|
|
34
|
-
enabled: !!m && !
|
|
35
|
-
}),
|
|
36
|
-
let e =
|
|
34
|
+
enabled: !!m && !v
|
|
35
|
+
}), F = i(() => {
|
|
36
|
+
let e = C;
|
|
37
37
|
return l && l.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => l.includes(r.encounterUuid)
|
|
39
39
|
)), Array.isArray(p) && p.length > 0 && (e = e.filter(
|
|
40
40
|
(r) => p.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [
|
|
42
|
+
}, [C, l, p]), { data: S = [] } = A({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => fe()
|
|
45
|
-
}),
|
|
45
|
+
}), M = d(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r =
|
|
47
|
+
const r = S.find(
|
|
48
48
|
(t) => t.name.toLowerCase() === e.toLowerCase()
|
|
49
49
|
);
|
|
50
50
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
@@ -54,49 +54,49 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
54
54
|
(t) => a.has(t.privilegeName) && t.editable
|
|
55
55
|
);
|
|
56
56
|
},
|
|
57
|
-
[
|
|
58
|
-
), u =
|
|
59
|
-
(e) => !y || e.encounterUuid !== y ? !1 :
|
|
60
|
-
[y,
|
|
57
|
+
[S, N]
|
|
58
|
+
), u = d(
|
|
59
|
+
(e) => !y || e.encounterUuid !== y ? !1 : M(e.formName),
|
|
60
|
+
[y, M]
|
|
61
61
|
), {
|
|
62
62
|
data: O,
|
|
63
|
-
isLoading:
|
|
63
|
+
isLoading: J,
|
|
64
64
|
isError: Z,
|
|
65
65
|
error: T
|
|
66
66
|
} = A({
|
|
67
67
|
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
68
68
|
queryFn: () => ye(s.encounterUuid),
|
|
69
|
-
enabled: !!s?.encounterUuid &&
|
|
69
|
+
enabled: !!s?.encounterUuid && h
|
|
70
70
|
});
|
|
71
71
|
pe(
|
|
72
72
|
(e) => {
|
|
73
|
-
e.patientUUID === m && (
|
|
73
|
+
e.patientUUID === m && (Y(), X.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
74
74
|
},
|
|
75
75
|
[m]
|
|
76
76
|
);
|
|
77
|
-
const ee =
|
|
77
|
+
const ee = i(() => !O?.entry || !s?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Ne(e) ? ge(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [O, s?.formName]), re = i(() => {
|
|
78
78
|
if (T)
|
|
79
|
-
return
|
|
80
|
-
}, [T]), c =
|
|
79
|
+
return he(T).message;
|
|
80
|
+
}, [T]), c = i(
|
|
81
81
|
() => [
|
|
82
82
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
83
83
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
84
84
|
],
|
|
85
85
|
[o]
|
|
86
|
-
),
|
|
86
|
+
), U = i(
|
|
87
87
|
() => [...c, { key: "actions", header: o("ACTIONS") }],
|
|
88
88
|
[c, o]
|
|
89
|
-
), ae =
|
|
90
|
-
(e) =>
|
|
91
|
-
[
|
|
92
|
-
), oe = c, se =
|
|
89
|
+
), ae = d(
|
|
90
|
+
(e) => b && e.some((r) => u(r)) ? U : c,
|
|
91
|
+
[b, u, U, c]
|
|
92
|
+
), oe = c, se = i(
|
|
93
93
|
() => [
|
|
94
94
|
{ key: "recordedOn", sortable: !0 },
|
|
95
95
|
{ key: "recordedBy", sortable: !0 }
|
|
96
96
|
],
|
|
97
97
|
[]
|
|
98
|
-
), D =
|
|
99
|
-
const e =
|
|
98
|
+
), D = i(() => {
|
|
99
|
+
const e = F.reduce(
|
|
100
100
|
(r, a) => {
|
|
101
101
|
const t = a.formName;
|
|
102
102
|
r[t] ??= [];
|
|
@@ -104,7 +104,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
104
104
|
return r[t].push({
|
|
105
105
|
id: a.encounterUuid,
|
|
106
106
|
formName: a.formName,
|
|
107
|
-
recordedOn:
|
|
107
|
+
recordedOn: be(a.encounterDateTime, o, !0).formattedResult,
|
|
108
108
|
recordedBy: f ?? "--",
|
|
109
109
|
encounterDateTime: a.encounterDateTime,
|
|
110
110
|
encounterUuid: a.encounterUuid
|
|
@@ -120,11 +120,11 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
120
120
|
)
|
|
121
121
|
})
|
|
122
122
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
123
|
-
}, [
|
|
124
|
-
|
|
125
|
-
}, []), w =
|
|
126
|
-
E(!1),
|
|
127
|
-
}, []), I =
|
|
123
|
+
}, [F, o]), k = d((e) => {
|
|
124
|
+
R(e), E(!0);
|
|
125
|
+
}, []), w = d(() => {
|
|
126
|
+
E(!1), R(null);
|
|
127
|
+
}, []), I = d((e) => {
|
|
128
128
|
Oe({
|
|
129
129
|
context: {
|
|
130
130
|
encounter: { resourceType: "Encounter", id: e.encounterUuid },
|
|
@@ -133,7 +133,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
133
133
|
},
|
|
134
134
|
action: { type: "update", resourceType: "Observation" }
|
|
135
135
|
});
|
|
136
|
-
}, []),
|
|
136
|
+
}, []), q = d(
|
|
137
137
|
(e, r) => {
|
|
138
138
|
switch (r) {
|
|
139
139
|
case "recordedOn":
|
|
@@ -149,7 +149,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
149
149
|
size: "sm",
|
|
150
150
|
testId: `edit-form-${e.encounterUuid}`,
|
|
151
151
|
onClick: () => I(e),
|
|
152
|
-
children: /* @__PURE__ */ n(
|
|
152
|
+
children: /* @__PURE__ */ n(z, {})
|
|
153
153
|
}
|
|
154
154
|
) : null;
|
|
155
155
|
default:
|
|
@@ -158,18 +158,18 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
158
158
|
},
|
|
159
159
|
[k, I, u, o]
|
|
160
160
|
);
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L ||
|
|
163
|
-
|
|
161
|
+
return /* @__PURE__ */ H(ne, { children: [
|
|
162
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || D.length === 0 || v ? /* @__PURE__ */ n(
|
|
163
|
+
V,
|
|
164
164
|
{
|
|
165
165
|
headers: oe,
|
|
166
166
|
ariaLabel: o("FORMS_HEADING"),
|
|
167
167
|
rows: [],
|
|
168
168
|
loading: L,
|
|
169
|
-
errorStateMessage:
|
|
169
|
+
errorStateMessage: B ? W?.message : void 0,
|
|
170
170
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
171
|
-
renderCell:
|
|
172
|
-
className:
|
|
171
|
+
renderCell: q,
|
|
172
|
+
className: g.formsTableBody,
|
|
173
173
|
dataTestId: "forms-table"
|
|
174
174
|
}
|
|
175
175
|
) : /* @__PURE__ */ n(Ie, { align: "start", children: D.map((e, r) => {
|
|
@@ -178,11 +178,11 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
178
178
|
Ae,
|
|
179
179
|
{
|
|
180
180
|
title: a,
|
|
181
|
-
className:
|
|
181
|
+
className: g.customAccordianItem,
|
|
182
182
|
testId: `accordian-title-${a}`,
|
|
183
183
|
open: r === 0,
|
|
184
184
|
children: /* @__PURE__ */ n(
|
|
185
|
-
|
|
185
|
+
V,
|
|
186
186
|
{
|
|
187
187
|
headers: f,
|
|
188
188
|
ariaLabel: o("FORMS_HEADING"),
|
|
@@ -191,8 +191,8 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
191
191
|
errorStateMessage: "",
|
|
192
192
|
sortable: se,
|
|
193
193
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
194
|
-
renderCell:
|
|
195
|
-
className:
|
|
194
|
+
renderCell: q,
|
|
195
|
+
className: g.formsTableBody,
|
|
196
196
|
dataTestId: `forms-table-${a}`
|
|
197
197
|
}
|
|
198
198
|
)
|
|
@@ -200,16 +200,16 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
200
200
|
a
|
|
201
201
|
);
|
|
202
202
|
}) }) }),
|
|
203
|
-
|
|
203
|
+
h && s && /* @__PURE__ */ n(
|
|
204
204
|
_e,
|
|
205
205
|
{
|
|
206
206
|
id: "modalIdForActionAreaLayout",
|
|
207
207
|
portalId: "main-display-area",
|
|
208
|
-
open:
|
|
208
|
+
open: h,
|
|
209
209
|
onRequestClose: w,
|
|
210
|
-
modalHeading: /* @__PURE__ */
|
|
210
|
+
modalHeading: /* @__PURE__ */ H("div", { className: g.modalHeading, children: [
|
|
211
211
|
/* @__PURE__ */ n("span", { children: s.formName }),
|
|
212
|
-
|
|
212
|
+
b && u(s) && /* @__PURE__ */ n(
|
|
213
213
|
$,
|
|
214
214
|
{
|
|
215
215
|
label: o("EDIT_OBSERVATION_FORM"),
|
|
@@ -219,7 +219,7 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
219
219
|
onClick: () => {
|
|
220
220
|
w(), I(s);
|
|
221
221
|
},
|
|
222
|
-
children: /* @__PURE__ */ n(
|
|
222
|
+
children: /* @__PURE__ */ n(z, {})
|
|
223
223
|
}
|
|
224
224
|
)
|
|
225
225
|
] }),
|
|
@@ -231,12 +231,12 @@ const ve = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
231
231
|
Ee,
|
|
232
232
|
{
|
|
233
233
|
observations: ee,
|
|
234
|
-
isLoading:
|
|
234
|
+
isLoading: J,
|
|
235
235
|
isError: Z,
|
|
236
236
|
errorMessage: re,
|
|
237
237
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
238
238
|
testIdPrefix: s.formName,
|
|
239
|
-
hideThumbnail:
|
|
239
|
+
hideThumbnail: G,
|
|
240
240
|
formName: s.formName
|
|
241
241
|
}
|
|
242
242
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c as s, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-D0X0Gk6O.js";
|
|
2
|
+
import { cy as d, cz as f, cA as e } from "./index-N9VEj6aJ.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import {
|
|
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-D0X0Gk6O.js";
|
|
2
|
+
import { cy as v, cz as C, cA as e } from "./index-N9VEj6aJ.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|