@bahmni/widgets 0.0.1-dev.470 → 0.0.1-dev.472
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-CPng66yD.js → DocumentsTable-DozLTWft.js} +1 -1
- package/dist/{FormsTable-CHLYmk5-.js → FormsTable-BLgMgigo.js} +82 -82
- package/dist/{Observations-CKJBO_rQ.js → Observations-BXBr-YR8.js} +49 -49
- package/dist/{index-CmbXgAAP.js → index-BsguGr5X.js} +2816 -2794
- package/dist/{index-CcA9PbrN.js → index-DawlQMVt.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/userPrivileges/consultationPadPrivileges.d.ts +1 -0
- package/dist/userPrivileges/consultationPadPrivileges.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as a, jsxs as h, Fragment as pe } from "react/jsx-runtime";
|
|
2
|
-
import { u as _e, a as Ae, b as ge,
|
|
2
|
+
import { u as _e, a as Ae, b as ge, c as Ee, g as fe, o as Ce, d as Ie, e as y, p as De, f as Ne, h as Le, i as be, S as Se, j as Q, k as ye, w as ve, A as Oe, F as we, l as Me, m as J, B as ee } from "./index-BsguGr5X.js";
|
|
3
3
|
import { useQuery as Ue } from "@tanstack/react-query";
|
|
4
4
|
import { useState as T, useRef as Re, useEffect as _, useMemo as A, useCallback as p } from "react";
|
|
5
5
|
import { useTranslation as ke } from "react-i18next";
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { u as de, b as le,
|
|
3
|
-
import { useQueryClient as Re, useQuery as
|
|
1
|
+
import { jsx as n, jsxs as P, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import { u as de, b as le, n as me, q as ce, H as ue, r as fe, s as ye, o as he, t as be, v as pe, Q as ge, h as Ne, c as Oe, j as x, G as V, f as Fe, A as G, x as Ie, y as Te, F as Ae, O as Ee, C as ve } from "./index-BsguGr5X.js";
|
|
3
|
+
import { useQueryClient as Re, useQuery as A } from "@tanstack/react-query";
|
|
4
4
|
import { useState as $, useMemo as i, useCallback as d } from "react";
|
|
5
5
|
import { useTranslation as De } from "react-i18next";
|
|
6
6
|
const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", p = {
|
|
7
7
|
formsTableBody: _e,
|
|
8
8
|
modalHeading: Le,
|
|
9
9
|
customAccordianItem: Be
|
|
10
|
-
},
|
|
11
|
-
episodeOfCareUuids:
|
|
10
|
+
}, ke = ({
|
|
11
|
+
episodeOfCareUuids: E,
|
|
12
12
|
encounterUuids: m,
|
|
13
|
-
config:
|
|
14
|
-
disableActions:
|
|
13
|
+
config: j,
|
|
14
|
+
disableActions: Q = !1,
|
|
15
15
|
activeEncounterUuid: y = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t:
|
|
17
|
+
const { t: s } = De(), c = de(), [g, v] = $(!1), [a, R] = $(null), {
|
|
18
18
|
numberOfVisits: z,
|
|
19
19
|
hideThumbnail: K = !1,
|
|
20
|
-
forms:
|
|
21
|
-
} =
|
|
20
|
+
forms: h
|
|
21
|
+
} = j ?? {}, W = le(
|
|
22
22
|
ve.EDIT_OBSERVATIONS
|
|
23
|
-
), { userPrivileges:
|
|
24
|
-
|
|
23
|
+
), { userPrivileges: b } = me(), N = W && !Q && !!y, D = ce(
|
|
24
|
+
E,
|
|
25
25
|
m
|
|
26
26
|
), Y = Re(), {
|
|
27
27
|
data: _ = [],
|
|
@@ -29,33 +29,33 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
29
29
|
isError: B,
|
|
30
30
|
error: J,
|
|
31
31
|
refetch: X
|
|
32
|
-
} =
|
|
33
|
-
queryKey: ["forms", c,
|
|
32
|
+
} = A({
|
|
33
|
+
queryKey: ["forms", c, E],
|
|
34
34
|
queryFn: () => ue(c, void 0, z),
|
|
35
35
|
enabled: !!c && !D
|
|
36
36
|
}), C = i(() => {
|
|
37
37
|
let e = _;
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
|
-
(
|
|
40
|
-
)), Array.isArray(
|
|
41
|
-
(
|
|
39
|
+
(t) => m.includes(t.encounterUuid)
|
|
40
|
+
)), Array.isArray(h) && h.length > 0 && (e = e.filter(
|
|
41
|
+
(t) => h.some((o) => o.toLowerCase() === t.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [_, m,
|
|
43
|
+
}, [_, m, h]), { data: M = [] } = A({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => fe()
|
|
46
46
|
}), S = d(
|
|
47
47
|
(e) => {
|
|
48
|
-
const
|
|
48
|
+
const t = M.find(
|
|
49
49
|
(r) => r.name.toLowerCase() === e.toLowerCase()
|
|
50
50
|
);
|
|
51
|
-
if (!
|
|
52
|
-
if (!
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
(r) =>
|
|
51
|
+
if (!t?.privileges || t.privileges.length === 0) return !0;
|
|
52
|
+
if (!b || b.length === 0) return !1;
|
|
53
|
+
const o = new Set(b.map((r) => r.name));
|
|
54
|
+
return t.privileges.some(
|
|
55
|
+
(r) => o.has(r.privilegeName) && r.editable
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
|
-
[M,
|
|
58
|
+
[M, b]
|
|
59
59
|
), u = d(
|
|
60
60
|
(e) => !y || e.encounterUuid !== y ? !1 : S(e.formName),
|
|
61
61
|
[y, S]
|
|
@@ -64,66 +64,66 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
64
64
|
isLoading: Z,
|
|
65
65
|
isError: ee,
|
|
66
66
|
error: F
|
|
67
|
-
} =
|
|
67
|
+
} = A({
|
|
68
68
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
69
69
|
queryFn: () => ye(a.encounterUuid),
|
|
70
70
|
enabled: !!a?.encounterUuid && g
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
he(
|
|
73
73
|
(e) => {
|
|
74
74
|
e.patientUUID === c && (X(), Y.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
75
75
|
},
|
|
76
76
|
[c]
|
|
77
77
|
);
|
|
78
|
-
const re = i(() => !O?.entry || !a?.formName ? [] : O.entry.filter((
|
|
78
|
+
const re = i(() => !O?.entry || !a?.formName ? [] : O.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => be(t) ? pe(t)?.toLowerCase() === a.formName.toLowerCase() : !0), [O, a?.formName]), te = i(() => {
|
|
79
79
|
if (F)
|
|
80
80
|
return ge(F).message;
|
|
81
81
|
}, [F]), f = i(
|
|
82
82
|
() => [
|
|
83
|
-
{ key: "recordedOn", header:
|
|
84
|
-
{ key: "recordedBy", header:
|
|
83
|
+
{ key: "recordedOn", header: s("RECORDED_ON") },
|
|
84
|
+
{ key: "recordedBy", header: s("RECORDED_BY") }
|
|
85
85
|
],
|
|
86
|
-
[
|
|
86
|
+
[s]
|
|
87
87
|
), w = i(
|
|
88
|
-
() => [...f, { key: "actions", header:
|
|
89
|
-
[f,
|
|
90
|
-
),
|
|
91
|
-
(e) => N && e.some((
|
|
88
|
+
() => [...f, { key: "actions", header: s("ACTIONS") }],
|
|
89
|
+
[f, s]
|
|
90
|
+
), oe = d(
|
|
91
|
+
(e) => N && e.some((o) => u(o)) ? w : f,
|
|
92
92
|
[N, u, w, f]
|
|
93
|
-
),
|
|
93
|
+
), se = f, ae = i(
|
|
94
94
|
() => [
|
|
95
95
|
{ key: "recordedOn", sortable: !0 },
|
|
96
96
|
{ key: "recordedBy", sortable: !0 }
|
|
97
97
|
],
|
|
98
98
|
[]
|
|
99
|
-
),
|
|
99
|
+
), H = i(() => {
|
|
100
100
|
const e = C.reduce(
|
|
101
|
-
(
|
|
101
|
+
(o, r) => {
|
|
102
102
|
const l = r.formName;
|
|
103
|
-
|
|
103
|
+
o[l] ??= [];
|
|
104
104
|
const T = r.providers.map((ne) => ne.providerName).filter(Boolean).join(", ");
|
|
105
|
-
return
|
|
105
|
+
return o[l].push({
|
|
106
106
|
id: r.encounterUuid,
|
|
107
107
|
formName: r.formName,
|
|
108
|
-
recordedOn: Ne(r.encounterDateTime,
|
|
108
|
+
recordedOn: Ne(r.encounterDateTime, s, !0).formattedResult,
|
|
109
109
|
recordedBy: T ?? "--",
|
|
110
110
|
encounterDateTime: r.encounterDateTime,
|
|
111
111
|
encounterUuid: r.encounterUuid
|
|
112
|
-
}),
|
|
112
|
+
}), o;
|
|
113
113
|
},
|
|
114
114
|
{}
|
|
115
115
|
);
|
|
116
116
|
return Object.entries(e).map(
|
|
117
|
-
([
|
|
118
|
-
formName:
|
|
117
|
+
([o, r]) => ({
|
|
118
|
+
formName: o,
|
|
119
119
|
records: r.sort(
|
|
120
120
|
(l, T) => T.encounterDateTime - l.encounterDateTime
|
|
121
121
|
)
|
|
122
122
|
})
|
|
123
|
-
).sort((
|
|
124
|
-
}, [C,
|
|
123
|
+
).sort((o, r) => o.formName.localeCompare(r.formName));
|
|
124
|
+
}, [C, s]), k = d((e) => {
|
|
125
125
|
R(e), v(!0);
|
|
126
|
-
}, []),
|
|
126
|
+
}, []), U = d(() => {
|
|
127
127
|
v(!1), R(null);
|
|
128
128
|
}, []), I = d((e) => {
|
|
129
129
|
Oe({
|
|
@@ -134,93 +134,93 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
134
134
|
},
|
|
135
135
|
action: { type: "update", resourceType: "Observation" }
|
|
136
136
|
});
|
|
137
|
-
}, []),
|
|
138
|
-
(e,
|
|
139
|
-
switch (
|
|
137
|
+
}, []), q = d(
|
|
138
|
+
(e, t) => {
|
|
139
|
+
switch (t) {
|
|
140
140
|
case "recordedOn":
|
|
141
|
-
return /* @__PURE__ */ n(Fe, { onClick: () =>
|
|
141
|
+
return /* @__PURE__ */ n(Fe, { onClick: () => k(e), children: e.recordedOn });
|
|
142
142
|
case "recordedBy":
|
|
143
143
|
return e.recordedBy;
|
|
144
144
|
case "actions":
|
|
145
145
|
return u(e) ? /* @__PURE__ */ n(
|
|
146
|
-
|
|
146
|
+
x,
|
|
147
147
|
{
|
|
148
|
-
label:
|
|
148
|
+
label: s("EDIT_OBSERVATION_FORM"),
|
|
149
149
|
kind: "ghost",
|
|
150
150
|
size: "sm",
|
|
151
151
|
testId: `edit-form-${e.encounterUuid}`,
|
|
152
152
|
onClick: () => I(e),
|
|
153
|
-
children: /* @__PURE__ */ n(
|
|
153
|
+
children: /* @__PURE__ */ n(V, {})
|
|
154
154
|
}
|
|
155
155
|
) : null;
|
|
156
156
|
default:
|
|
157
157
|
return null;
|
|
158
158
|
}
|
|
159
159
|
},
|
|
160
|
-
[
|
|
160
|
+
[k, I, u, s]
|
|
161
161
|
);
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B ||
|
|
162
|
+
return /* @__PURE__ */ P(ie, { children: [
|
|
163
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || B || H.length === 0 || D ? /* @__PURE__ */ n(
|
|
164
164
|
G,
|
|
165
165
|
{
|
|
166
|
-
headers:
|
|
167
|
-
ariaLabel:
|
|
166
|
+
headers: se,
|
|
167
|
+
ariaLabel: s("FORMS_HEADING"),
|
|
168
168
|
rows: [],
|
|
169
169
|
loading: L,
|
|
170
170
|
errorStateMessage: B ? J?.message : void 0,
|
|
171
|
-
emptyStateMessage:
|
|
172
|
-
renderCell:
|
|
171
|
+
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
172
|
+
renderCell: q,
|
|
173
173
|
className: p.formsTableBody,
|
|
174
174
|
dataTestId: "forms-table"
|
|
175
175
|
}
|
|
176
|
-
) : /* @__PURE__ */ n(Ie, { align: "start", children:
|
|
177
|
-
const { formName:
|
|
176
|
+
) : /* @__PURE__ */ n(Ie, { align: "start", children: H.map((e, t) => {
|
|
177
|
+
const { formName: o, records: r } = e, l = oe(r);
|
|
178
178
|
return /* @__PURE__ */ n(
|
|
179
179
|
Te,
|
|
180
180
|
{
|
|
181
|
-
title:
|
|
181
|
+
title: o,
|
|
182
182
|
className: p.customAccordianItem,
|
|
183
|
-
testId: `accordian-title-${
|
|
184
|
-
open:
|
|
183
|
+
testId: `accordian-title-${o}`,
|
|
184
|
+
open: t === 0,
|
|
185
185
|
children: /* @__PURE__ */ n(
|
|
186
186
|
G,
|
|
187
187
|
{
|
|
188
188
|
headers: l,
|
|
189
|
-
ariaLabel:
|
|
189
|
+
ariaLabel: s("FORMS_HEADING"),
|
|
190
190
|
rows: r,
|
|
191
191
|
loading: !1,
|
|
192
192
|
errorStateMessage: "",
|
|
193
193
|
sortable: ae,
|
|
194
|
-
emptyStateMessage:
|
|
195
|
-
renderCell:
|
|
194
|
+
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
195
|
+
renderCell: q,
|
|
196
196
|
className: p.formsTableBody,
|
|
197
|
-
dataTestId: `forms-table-${
|
|
197
|
+
dataTestId: `forms-table-${o}`
|
|
198
198
|
}
|
|
199
199
|
)
|
|
200
200
|
},
|
|
201
|
-
|
|
201
|
+
o
|
|
202
202
|
);
|
|
203
203
|
}) }) }),
|
|
204
204
|
g && a && /* @__PURE__ */ n(
|
|
205
|
-
|
|
205
|
+
Ae,
|
|
206
206
|
{
|
|
207
207
|
id: "modalIdForActionAreaLayout",
|
|
208
208
|
portalId: "main-display-area",
|
|
209
209
|
open: g,
|
|
210
|
-
onRequestClose:
|
|
211
|
-
modalHeading: /* @__PURE__ */
|
|
210
|
+
onRequestClose: U,
|
|
211
|
+
modalHeading: /* @__PURE__ */ P("div", { className: p.modalHeading, children: [
|
|
212
212
|
/* @__PURE__ */ n("span", { children: a.formName }),
|
|
213
213
|
N && u(a) && /* @__PURE__ */ n(
|
|
214
|
-
|
|
214
|
+
x,
|
|
215
215
|
{
|
|
216
|
-
label:
|
|
216
|
+
label: s("EDIT_OBSERVATION_FORM"),
|
|
217
217
|
kind: "ghost",
|
|
218
218
|
size: "sm",
|
|
219
219
|
testId: `edit-form-modal-${a.encounterUuid}`,
|
|
220
220
|
onClick: () => {
|
|
221
|
-
|
|
221
|
+
U(), I(a);
|
|
222
222
|
},
|
|
223
|
-
children: /* @__PURE__ */ n(
|
|
223
|
+
children: /* @__PURE__ */ n(V, {})
|
|
224
224
|
}
|
|
225
225
|
)
|
|
226
226
|
] }),
|
|
@@ -229,13 +229,13 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
229
229
|
size: "md",
|
|
230
230
|
testId: "form-details-modal",
|
|
231
231
|
children: /* @__PURE__ */ n(
|
|
232
|
-
|
|
232
|
+
Ee,
|
|
233
233
|
{
|
|
234
234
|
observations: re,
|
|
235
235
|
isLoading: Z,
|
|
236
236
|
isError: ee,
|
|
237
|
-
errorMessage:
|
|
238
|
-
emptyStateMessage:
|
|
237
|
+
errorMessage: te,
|
|
238
|
+
emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
|
|
239
239
|
testIdPrefix: a.formName,
|
|
240
240
|
hideThumbnail: K,
|
|
241
241
|
formName: a.formName
|
|
@@ -246,5 +246,5 @@ const _e = "FormsTable-module_formsTableBody__SvGha", Le = "FormsTable-module_mo
|
|
|
246
246
|
] });
|
|
247
247
|
};
|
|
248
248
|
export {
|
|
249
|
-
|
|
249
|
+
ke as default
|
|
250
250
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as i, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { z, _ as F, D as G, E as H, h as P, I as j, J, L as x, K as Y, u as W, a as X, M as Z, q as ee, N as se, P as te, o as re, R as ae, T as oe, U as ne, V as ie, S as ce, A as le } from "./index-BsguGr5X.js";
|
|
3
3
|
import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as pe, useEffect as C, useMemo as I } from "react";
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L",
|
|
5
|
+
import { useTranslation as U } from "react-i18next";
|
|
6
|
+
const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", ye = "Observations-module_secondary__14nuS", y = {
|
|
7
7
|
observations: me,
|
|
8
8
|
title: be,
|
|
9
9
|
wrapper: ve,
|
|
10
|
-
secondary:
|
|
11
|
-
},
|
|
12
|
-
const a =
|
|
10
|
+
secondary: ye
|
|
11
|
+
}, V = (t, l, n, c, u, r) => {
|
|
12
|
+
const a = G(t, l, u), e = a.value, p = H(e);
|
|
13
13
|
let o = e;
|
|
14
14
|
p === "Image" && (o = /* @__PURE__ */ i(
|
|
15
|
-
|
|
15
|
+
J,
|
|
16
16
|
{
|
|
17
17
|
imageSrc: e,
|
|
18
18
|
alt: e,
|
|
@@ -20,42 +20,42 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
20
20
|
hideThumbnail: r
|
|
21
21
|
}
|
|
22
22
|
)), p === "Video" && (o = /* @__PURE__ */ i(
|
|
23
|
-
|
|
23
|
+
x,
|
|
24
24
|
{
|
|
25
25
|
id: `${e}-video`,
|
|
26
26
|
videoSrc: e,
|
|
27
27
|
hideThumbnail: r
|
|
28
28
|
}
|
|
29
|
-
)), p === "PDF" && (o = /* @__PURE__ */ i(
|
|
30
|
-
const m = /* @__PURE__ */ N("div", { className:
|
|
29
|
+
)), p === "PDF" && (o = /* @__PURE__ */ i(Y, { id: `${e}-pdf`, src: e }));
|
|
30
|
+
const m = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
|
|
31
31
|
/* @__PURE__ */ i("span", { children: a.header.display }),
|
|
32
|
-
a.header.referenceRange && /* @__PURE__ */ i("span", { className:
|
|
32
|
+
a.header.referenceRange && /* @__PURE__ */ i("span", { className: y.secondary, children: a.header.referenceRange })
|
|
33
33
|
] }), d = u("OBSERVATIONS_RECORDED_BY", {
|
|
34
34
|
provider: a.provider
|
|
35
|
-
}), b = t.effectiveDateTime ? P(t.effectiveDateTime, u, !0).formattedResult : void 0,
|
|
35
|
+
}), b = t.effectiveDateTime ? P(t.effectiveDateTime, u, !0).formattedResult : void 0, g = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
|
|
36
36
|
/* @__PURE__ */ i("span", { children: d }),
|
|
37
|
-
b && /* @__PURE__ */ i("span", { className:
|
|
38
|
-
] }), v = t.display,
|
|
37
|
+
b && /* @__PURE__ */ i("span", { className: y.secondary, children: b })
|
|
38
|
+
] }), v = t.display, _ = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${_}-${v}-${n}-${l}` : `${_}-${v}-${n}-${l}`;
|
|
39
39
|
return /* @__PURE__ */ i(
|
|
40
40
|
j,
|
|
41
41
|
{
|
|
42
42
|
header: m,
|
|
43
43
|
value: o,
|
|
44
|
-
info:
|
|
44
|
+
info: g,
|
|
45
45
|
id: O,
|
|
46
46
|
testId: O,
|
|
47
47
|
ariaLabel: O
|
|
48
48
|
},
|
|
49
49
|
`obs-${t.id}`
|
|
50
50
|
);
|
|
51
|
-
},
|
|
52
|
-
|
|
51
|
+
}, fe = (t, l, n, c, u, r, a) => /* @__PURE__ */ i(
|
|
52
|
+
F,
|
|
53
53
|
{
|
|
54
54
|
title: t.display,
|
|
55
55
|
id: `grouped-obs-${t.display}-${c}`,
|
|
56
56
|
open: n,
|
|
57
57
|
children: t.members?.map(
|
|
58
|
-
(e, p) =>
|
|
58
|
+
(e, p) => V(
|
|
59
59
|
e,
|
|
60
60
|
p,
|
|
61
61
|
u,
|
|
@@ -71,17 +71,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
71
71
|
title: l = "",
|
|
72
72
|
hideThumbnail: n
|
|
73
73
|
}) => {
|
|
74
|
-
const { t: c } =
|
|
75
|
-
const p =
|
|
74
|
+
const { t: c } = U(), u = (r, a, e) => {
|
|
75
|
+
const p = z(r.encounterDetails, c);
|
|
76
76
|
return /* @__PURE__ */ N(
|
|
77
|
-
|
|
77
|
+
F,
|
|
78
78
|
{
|
|
79
79
|
title: p,
|
|
80
80
|
id: `encounter-${r.encounterId}`,
|
|
81
81
|
open: a,
|
|
82
82
|
children: [
|
|
83
83
|
r.observations.map(
|
|
84
|
-
(o, m) =>
|
|
84
|
+
(o, m) => V(
|
|
85
85
|
o,
|
|
86
86
|
m,
|
|
87
87
|
e,
|
|
@@ -91,7 +91,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
91
91
|
)
|
|
92
92
|
),
|
|
93
93
|
r.groupedObservations.map(
|
|
94
|
-
(o, m) =>
|
|
94
|
+
(o, m) => fe(
|
|
95
95
|
o,
|
|
96
96
|
c,
|
|
97
97
|
a,
|
|
@@ -117,7 +117,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
117
117
|
)
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
|
-
},
|
|
120
|
+
}, he = (t) => ["conceptUuid", t], Ee = (t, l, n, c) => [
|
|
121
121
|
"observations",
|
|
122
122
|
t,
|
|
123
123
|
...l,
|
|
@@ -133,10 +133,10 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
133
133
|
conceptUuid: r = [],
|
|
134
134
|
hideThumbnail: a = !1,
|
|
135
135
|
scope: e = "all"
|
|
136
|
-
} = c, p = pe(/* @__PURE__ */ new Set()), o =
|
|
136
|
+
} = c, p = pe(/* @__PURE__ */ new Set()), o = W(), { addNotification: m } = X(), { t: d } = U(), b = de({
|
|
137
137
|
queries: u.map((s) => ({
|
|
138
|
-
queryKey:
|
|
139
|
-
queryFn: () =>
|
|
138
|
+
queryKey: he(s),
|
|
139
|
+
queryFn: () => Z(s),
|
|
140
140
|
enabled: !!s
|
|
141
141
|
}))
|
|
142
142
|
});
|
|
@@ -148,22 +148,22 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
148
148
|
type: "error"
|
|
149
149
|
}), p.current.add(0)) : !s && R && p.current.clear();
|
|
150
150
|
}, [b, m, d]);
|
|
151
|
-
const
|
|
151
|
+
const g = I(() => b.map((s) => s.data?.uuid).filter((s) => !!s), [b]), v = I(() => [.../* @__PURE__ */ new Set([...g, ...r])], [g, r]), f = I(() => u.length === 0 ? !0 : b.every((s) => !s.isLoading), [b, u.length]), _ = e === "latest" || e === "latest-encounter", O = ee(
|
|
152
152
|
l,
|
|
153
153
|
n
|
|
154
154
|
), {
|
|
155
|
-
data:
|
|
156
|
-
isLoading:
|
|
155
|
+
data: h,
|
|
156
|
+
isLoading: w,
|
|
157
157
|
isError: S,
|
|
158
158
|
refetch: A
|
|
159
159
|
} = ue({
|
|
160
|
-
queryKey:
|
|
160
|
+
queryKey: Ee(
|
|
161
161
|
o,
|
|
162
162
|
v,
|
|
163
163
|
n,
|
|
164
164
|
e
|
|
165
165
|
),
|
|
166
|
-
queryFn: () =>
|
|
166
|
+
queryFn: () => _ ? se(
|
|
167
167
|
o,
|
|
168
168
|
v,
|
|
169
169
|
n
|
|
@@ -172,7 +172,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
172
172
|
v,
|
|
173
173
|
n
|
|
174
174
|
),
|
|
175
|
-
enabled: !!o && v.length > 0 &&
|
|
175
|
+
enabled: !!o && v.length > 0 && f && !O
|
|
176
176
|
});
|
|
177
177
|
re(
|
|
178
178
|
(s) => {
|
|
@@ -189,39 +189,39 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
189
189
|
});
|
|
190
190
|
}, [S]);
|
|
191
191
|
const D = I(() => {
|
|
192
|
-
if (!
|
|
193
|
-
let s = ae(
|
|
192
|
+
if (!h) return [];
|
|
193
|
+
let s = ae(h);
|
|
194
194
|
e === "latest-encounter" && (s = oe(s));
|
|
195
195
|
const R = ne(s);
|
|
196
196
|
return ie(R);
|
|
197
|
-
}, [
|
|
197
|
+
}, [h, e]), K = [
|
|
198
198
|
{ key: "name", header: "name" },
|
|
199
199
|
{ key: "value", header: "value" },
|
|
200
200
|
{ key: "form", header: "form" }
|
|
201
|
-
], L =
|
|
201
|
+
], L = w || !f, B = S && f, M = (!h || h.entry?.length === 0 || v.length === 0) && f, q = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, Q = M ? d("NO_OBSERVATIONS_FOUND") : void 0, k = D.length > 0 && !L && !B, T = c.titleTranslationKey, E = T ? d(T) : "";
|
|
202
202
|
return /* @__PURE__ */ N(
|
|
203
203
|
"div",
|
|
204
204
|
{
|
|
205
205
|
id: "observations",
|
|
206
|
-
"data-testid": T ? `observations-${
|
|
206
|
+
"data-testid": T ? `observations-${E}` : "observations",
|
|
207
207
|
"aria-label": "observations-aria-label",
|
|
208
|
-
className:
|
|
208
|
+
className: y.observations,
|
|
209
209
|
children: [
|
|
210
210
|
/* @__PURE__ */ i(
|
|
211
211
|
ce,
|
|
212
212
|
{
|
|
213
213
|
id: "observations-title",
|
|
214
|
-
testId: T ? `observations-title-${
|
|
215
|
-
title:
|
|
216
|
-
className:
|
|
217
|
-
children: /* @__PURE__ */ i("p", { children:
|
|
214
|
+
testId: T ? `observations-title-${E}` : "observations-title",
|
|
215
|
+
title: E,
|
|
216
|
+
className: y.title,
|
|
217
|
+
children: /* @__PURE__ */ i("p", { children: E })
|
|
218
218
|
}
|
|
219
219
|
),
|
|
220
|
-
|
|
220
|
+
k ? /* @__PURE__ */ i(
|
|
221
221
|
Oe,
|
|
222
222
|
{
|
|
223
223
|
groupedData: D,
|
|
224
|
-
title:
|
|
224
|
+
title: E,
|
|
225
225
|
hideThumbnail: a
|
|
226
226
|
}
|
|
227
227
|
) : /* @__PURE__ */ i(
|
|
@@ -231,8 +231,8 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
231
231
|
rows: [],
|
|
232
232
|
ariaLabel: d("OBSERVATIONS"),
|
|
233
233
|
loading: L,
|
|
234
|
-
errorStateMessage:
|
|
235
|
-
emptyStateMessage:
|
|
234
|
+
errorStateMessage: q,
|
|
235
|
+
emptyStateMessage: Q ?? d("NO_OBSERVATIONS_AVAILABLE"),
|
|
236
236
|
dataTestId: "observations-table"
|
|
237
237
|
}
|
|
238
238
|
)
|
|
@@ -241,7 +241,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
241
241
|
);
|
|
242
242
|
};
|
|
243
243
|
export {
|
|
244
|
-
|
|
244
|
+
he as conceptUuidQueryKeys,
|
|
245
245
|
Ne as default,
|
|
246
|
-
|
|
246
|
+
Ee as observationsQueryKeys
|
|
247
247
|
};
|