@bahmni/clinical-app 0.0.1-dev.127 → 0.0.1-dev.129
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/{FormsTable-DF8BnQAE-BUT6c2pl.js → FormsTable-BS5U3KO_-Cu6JoGdw.js} +56 -56
- package/dist/{LNWAZHJI-DSKav94n.js → LNWAZHJI-Dv05E5TG.js} +10 -10
- package/dist/{MWZ6AO7Z-WY5ahJF8.js → MWZ6AO7Z-DXI2S5JG.js} +4 -4
- package/dist/{Observations-DPWRbbqY-B7BWNKY3.js → Observations-DhxYnY6i-CK2irdUZ.js} +26 -26
- package/dist/{YPM2AS64-CIsq4Iy3.js → YPM2AS64-BmlgHWMd.js} +181 -181
- package/dist/{index-BDTn5_o7.js → index-xo93cMxq.js} +24381 -24301
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +1 -1
- package/dist/locales/locale_es.json +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as t, jsxs as p, Fragment as
|
|
2
|
-
import { u as
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { u as z, C as J, Y as Q, a as h, b as W, S as ee, q as G, L as re, D as ae, R as oe, B as te, g as x, X as ne, Z as v, f as se, h as me, p as de, c as ie } from "./index-xo93cMxq.js";
|
|
3
3
|
import { useState as q, useMemo as N, useCallback as y } from "react";
|
|
4
4
|
import { createPortal as le } from "react-dom";
|
|
5
|
-
const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", Ne = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", ge = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", ve = "_memberRow_1pd36_81",
|
|
5
|
+
const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", Ne = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", ge = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", ve = "_memberRow_1pd36_81", Ae = "_memberLabel_1pd36_86", Le = "_memberValue_1pd36_94", Me = "_abnormalValue_1pd36_102", Te = "_commentSection_1pd36_110", Ce = "_commentText_1pd36_116", De = "_nestedGroup_1pd36_125", Re = "_nestedGroupLabel_1pd36_132", Oe = "_nestedGroupMembers_1pd36_141", o = {
|
|
6
6
|
formsTableBody: ce,
|
|
7
7
|
customAccordianItem: ue,
|
|
8
8
|
formContent: pe,
|
|
@@ -15,18 +15,18 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
15
15
|
rowValue: he,
|
|
16
16
|
groupMembers: ye,
|
|
17
17
|
memberRow: ve,
|
|
18
|
-
memberLabel:
|
|
19
|
-
memberValue:
|
|
20
|
-
abnormalValue:
|
|
18
|
+
memberLabel: Ae,
|
|
19
|
+
memberValue: Le,
|
|
20
|
+
abnormalValue: Me,
|
|
21
21
|
commentSection: Te,
|
|
22
|
-
commentText:
|
|
23
|
-
nestedGroup:
|
|
24
|
-
nestedGroupLabel:
|
|
25
|
-
nestedGroupMembers:
|
|
22
|
+
commentText: Ce,
|
|
23
|
+
nestedGroup: De,
|
|
24
|
+
nestedGroupLabel: Re,
|
|
25
|
+
nestedGroupMembers: Oe
|
|
26
26
|
}, Fe = "ABNORMAL", U = (e) => {
|
|
27
27
|
const s = e.concept?.units, d = e.concept?.lowNormal, r = e.concept?.hiNormal, u = d != null, m = r != null, c = u && m ? ` (${d} - ${r})` : u ? ` (>${d})` : m ? ` (<${r})` : "", a = e.interpretation && e.interpretation.toUpperCase() === Fe;
|
|
28
28
|
return { units: s, rangeString: c, isAbnormal: a };
|
|
29
|
-
},
|
|
29
|
+
}, X = ({
|
|
30
30
|
member: e,
|
|
31
31
|
depth: s = 0,
|
|
32
32
|
memberIndex: d = 0,
|
|
@@ -55,7 +55,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
55
55
|
className: o.nestedGroupMembers,
|
|
56
56
|
"data-testid": `${c}obs-nested-group-members-${m}-${d}`,
|
|
57
57
|
children: e.groupMembers?.map(($, g) => /* @__PURE__ */ t(
|
|
58
|
-
|
|
58
|
+
X,
|
|
59
59
|
{
|
|
60
60
|
member: $,
|
|
61
61
|
depth: s + 1,
|
|
@@ -108,7 +108,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
108
108
|
]
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
|
-
},
|
|
111
|
+
}, Ie = ({
|
|
112
112
|
observation: e,
|
|
113
113
|
index: s,
|
|
114
114
|
formName: d = ""
|
|
@@ -146,7 +146,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
146
146
|
className: o.groupMembers,
|
|
147
147
|
"data-testid": `${a}observation-group-members-${e.conceptNameToDisplay}-${s}`,
|
|
148
148
|
children: e.groupMembers?.map((b, _) => /* @__PURE__ */ t(
|
|
149
|
-
|
|
149
|
+
X,
|
|
150
150
|
{
|
|
151
151
|
member: b,
|
|
152
152
|
depth: 0,
|
|
@@ -193,70 +193,70 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
193
193
|
encounterUuids: s,
|
|
194
194
|
config: d
|
|
195
195
|
}) => {
|
|
196
|
-
const { t: r } =
|
|
196
|
+
const { t: r } = z(), u = J(), [m, c] = q(!1), [a, b] = q(null), _ = d?.numberOfVisits, $ = Q(
|
|
197
197
|
e,
|
|
198
198
|
s
|
|
199
199
|
), {
|
|
200
200
|
data: g = [],
|
|
201
201
|
isLoading: T,
|
|
202
|
-
isError:
|
|
202
|
+
isError: C,
|
|
203
203
|
error: k
|
|
204
204
|
} = h({
|
|
205
205
|
queryKey: ["forms", u, e],
|
|
206
206
|
queryFn: () => se(u, void 0, _),
|
|
207
207
|
enabled: !!u && !$
|
|
208
|
-
}),
|
|
208
|
+
}), D = N(() => !s || s.length === 0 ? g : g.filter(
|
|
209
209
|
(n) => s.includes(n.encounterUuid)
|
|
210
|
-
), [g, s]), { data:
|
|
210
|
+
), [g, s]), { data: R = [] } = h({
|
|
211
211
|
queryKey: ["observationForms"],
|
|
212
212
|
queryFn: () => me()
|
|
213
|
-
}),
|
|
214
|
-
(n) =>
|
|
215
|
-
[
|
|
216
|
-
),
|
|
213
|
+
}), O = y(
|
|
214
|
+
(n) => R.find((l) => l.name === n)?.uuid,
|
|
215
|
+
[R]
|
|
216
|
+
), A = N(() => {
|
|
217
217
|
if (a)
|
|
218
|
-
return
|
|
219
|
-
}, [a,
|
|
220
|
-
data:
|
|
221
|
-
isLoading:
|
|
218
|
+
return O(a.formName);
|
|
219
|
+
}, [a, O]), {
|
|
220
|
+
data: we,
|
|
221
|
+
isLoading: H,
|
|
222
222
|
error: F
|
|
223
223
|
} = h({
|
|
224
|
-
queryKey: ["formMetadata",
|
|
225
|
-
queryFn: () => de(
|
|
226
|
-
enabled: !!
|
|
224
|
+
queryKey: ["formMetadata", A],
|
|
225
|
+
queryFn: () => de(A),
|
|
226
|
+
enabled: !!A && m
|
|
227
227
|
}), {
|
|
228
|
-
data:
|
|
229
|
-
isLoading:
|
|
230
|
-
error:
|
|
228
|
+
data: L,
|
|
229
|
+
isLoading: j,
|
|
230
|
+
error: I
|
|
231
231
|
} = h({
|
|
232
232
|
queryKey: ["formsEncounter", a?.encounterUuid],
|
|
233
233
|
queryFn: () => ie(a.encounterUuid, !0),
|
|
234
234
|
enabled: !!a?.encounterUuid && m
|
|
235
|
-
}),
|
|
235
|
+
}), w = N(() => !L?.observations || !a?.formName ? [] : L.observations.filter(
|
|
236
236
|
(n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(a.formName)
|
|
237
|
-
), [
|
|
237
|
+
), [L?.observations, a?.formName]), B = N(
|
|
238
238
|
() => [
|
|
239
239
|
{ key: "recordedOn", header: r("FORM_RECORDED_ON") },
|
|
240
240
|
{ key: "recordedBy", header: r("FORM_RECORDED_BY") }
|
|
241
241
|
],
|
|
242
242
|
[r]
|
|
243
|
-
),
|
|
243
|
+
), K = N(
|
|
244
244
|
() => [
|
|
245
245
|
{ key: "recordedOn", sortable: !0 },
|
|
246
246
|
{ key: "recordedBy", sortable: !0 }
|
|
247
247
|
],
|
|
248
248
|
[]
|
|
249
|
-
),
|
|
250
|
-
const n =
|
|
249
|
+
), S = N(() => {
|
|
250
|
+
const n = D.reduce(
|
|
251
251
|
(l, i) => {
|
|
252
252
|
const f = i.formName;
|
|
253
253
|
l[f] ??= [];
|
|
254
|
-
const
|
|
254
|
+
const M = i.providers.map((Y) => Y.providerName).filter(Boolean).join(", ");
|
|
255
255
|
return l[f].push({
|
|
256
256
|
id: i.encounterUuid,
|
|
257
257
|
formName: i.formName,
|
|
258
|
-
recordedOn:
|
|
259
|
-
recordedBy:
|
|
258
|
+
recordedOn: W(i.encounterDateTime, r, ne).formattedResult,
|
|
259
|
+
recordedBy: M ?? "--",
|
|
260
260
|
encounterDateTime: i.encounterDateTime,
|
|
261
261
|
encounterUuid: i.encounterUuid
|
|
262
262
|
}), l;
|
|
@@ -267,42 +267,42 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
267
267
|
([l, i]) => ({
|
|
268
268
|
formName: l,
|
|
269
269
|
records: i.sort(
|
|
270
|
-
(f,
|
|
270
|
+
(f, M) => M.encounterDateTime - f.encounterDateTime
|
|
271
271
|
)
|
|
272
272
|
})
|
|
273
273
|
).sort((l, i) => l.formName.localeCompare(i.formName));
|
|
274
|
-
}, [
|
|
274
|
+
}, [D, r]), E = y((n) => {
|
|
275
275
|
b(n), c(!0);
|
|
276
|
-
}, []),
|
|
276
|
+
}, []), P = y(() => {
|
|
277
277
|
c(!1), b(null);
|
|
278
278
|
}, []), V = y(
|
|
279
279
|
(n, l) => {
|
|
280
280
|
switch (l) {
|
|
281
281
|
case "recordedOn":
|
|
282
|
-
return /* @__PURE__ */ t(ee, { onClick: () =>
|
|
282
|
+
return /* @__PURE__ */ t(ee, { onClick: () => E(n), children: n.recordedOn });
|
|
283
283
|
case "recordedBy":
|
|
284
284
|
return n.recordedBy;
|
|
285
285
|
default:
|
|
286
286
|
return null;
|
|
287
287
|
}
|
|
288
288
|
},
|
|
289
|
-
[
|
|
289
|
+
[E]
|
|
290
290
|
);
|
|
291
|
-
return /* @__PURE__ */ p(
|
|
292
|
-
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children: T ||
|
|
291
|
+
return /* @__PURE__ */ p(Z, { children: [
|
|
292
|
+
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children: T || C || S.length === 0 || $ ? /* @__PURE__ */ t(
|
|
293
293
|
G,
|
|
294
294
|
{
|
|
295
|
-
headers:
|
|
295
|
+
headers: B,
|
|
296
296
|
ariaLabel: r("FORMS_HEADING"),
|
|
297
297
|
rows: [],
|
|
298
298
|
loading: T,
|
|
299
|
-
errorStateMessage:
|
|
299
|
+
errorStateMessage: C ? k?.message : void 0,
|
|
300
300
|
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
301
301
|
renderCell: V,
|
|
302
302
|
className: o.formsTableBody,
|
|
303
303
|
dataTestId: "forms-table"
|
|
304
304
|
}
|
|
305
|
-
) : /* @__PURE__ */ t(re, { align: "start", children:
|
|
305
|
+
) : /* @__PURE__ */ t(re, { align: "start", children: S.map((n, l) => {
|
|
306
306
|
const { formName: i, records: f } = n;
|
|
307
307
|
return /* @__PURE__ */ t(
|
|
308
308
|
ae,
|
|
@@ -314,12 +314,12 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
314
314
|
children: /* @__PURE__ */ t(
|
|
315
315
|
G,
|
|
316
316
|
{
|
|
317
|
-
headers:
|
|
317
|
+
headers: B,
|
|
318
318
|
ariaLabel: r("FORMS_HEADING"),
|
|
319
319
|
rows: f,
|
|
320
320
|
loading: !1,
|
|
321
321
|
errorStateMessage: "",
|
|
322
|
-
sortable:
|
|
322
|
+
sortable: K,
|
|
323
323
|
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
324
324
|
renderCell: V,
|
|
325
325
|
className: o.formsTableBody,
|
|
@@ -334,16 +334,16 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
334
334
|
/* @__PURE__ */ t(
|
|
335
335
|
oe,
|
|
336
336
|
{
|
|
337
|
-
id: "
|
|
337
|
+
id: "modalIdForActionAreaLayout",
|
|
338
338
|
open: m,
|
|
339
|
-
onRequestClose:
|
|
339
|
+
onRequestClose: P,
|
|
340
340
|
modalHeading: a.formName,
|
|
341
341
|
modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
|
|
342
342
|
passiveModal: !0,
|
|
343
343
|
size: "md",
|
|
344
344
|
testId: "form-details-modal",
|
|
345
|
-
children: /* @__PURE__ */ t("div", { className: o.formContent, children:
|
|
346
|
-
|
|
345
|
+
children: /* @__PURE__ */ t("div", { className: o.formContent, children: H || j ? /* @__PURE__ */ t(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: x(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : I ? /* @__PURE__ */ t("div", { children: x(I).message ?? r("ERROR_FETCHING_FORM_DATA") }) : w.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: w.map((n, l) => /* @__PURE__ */ t(
|
|
346
|
+
Ie,
|
|
347
347
|
{
|
|
348
348
|
observation: n,
|
|
349
349
|
index: l,
|
|
@@ -1,25 +1,25 @@
|
|
|
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-BmlgHWMd.js";
|
|
2
|
+
import { m as d, n as f, o as e } from "./index-xo93cMxq.js";
|
|
3
3
|
var p = (a) => {
|
|
4
|
-
const [r,
|
|
4
|
+
const [r, o] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
6
|
}), n = d(), s = f(() => {
|
|
7
|
-
const
|
|
8
|
-
return
|
|
7
|
+
const t = r.theme_preference || l;
|
|
8
|
+
return t !== "system" ? t : 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
|
-
setLocalStore:
|
|
15
|
+
setLocalStore: o,
|
|
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
|
-
setLocalStore:
|
|
22
|
+
setLocalStore: o
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as c, P as
|
|
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-BmlgHWMd.js";
|
|
2
|
+
import { m as v, n as C, o as e } from "./index-xo93cMxq.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -10,12 +10,12 @@ var h = (t) => {
|
|
|
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, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as _, jsx as b } from "react/jsx-runtime";
|
|
2
|
-
import { C as
|
|
3
|
-
import { useRef as
|
|
4
|
-
const
|
|
2
|
+
import { C as B, T as U, u as I, d as k, e as x, a as G, i as X, q as K, s as Q, P as w, l as j, _ as P, j as H, F as Y, k as Z } from "./index-xo93cMxq.js";
|
|
3
|
+
import { useRef as z, useEffect as S, useMemo as h } from "react";
|
|
4
|
+
const J = "normal", W = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ee = "A", te = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ne = (e, n) => e?.date ? Q(e.date, n).formattedResult : n("DATE_ERROR_PARSE"), re = (e) => {
|
|
5
5
|
if (!e.observationValue?.value)
|
|
6
6
|
return "";
|
|
7
7
|
const { value: n, unit: t } = e.observationValue;
|
|
@@ -59,7 +59,7 @@ function se(e) {
|
|
|
59
59
|
if (i && i.length > 0) {
|
|
60
60
|
const l = i.find(
|
|
61
61
|
(v) => v.type?.coding?.some(
|
|
62
|
-
(c) => c.system === W && c.code ===
|
|
62
|
+
(c) => c.system === W && c.code === J
|
|
63
63
|
)
|
|
64
64
|
);
|
|
65
65
|
l && (l.low || l.high) && (u.referenceRange = {
|
|
@@ -111,9 +111,9 @@ function ue(e, n) {
|
|
|
111
111
|
location: t.location?.[0]?.location?.display
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function A(e, n, t) {
|
|
115
115
|
const a = $(e.encounter), r = (e.hasMember ?? []).map((o) => $(o)).map((o) => o ? t.get(o) : void 0).filter((o) => !!o).map(
|
|
116
|
-
(o) =>
|
|
116
|
+
(o) => A(o, n, t)
|
|
117
117
|
);
|
|
118
118
|
return {
|
|
119
119
|
id: e.id,
|
|
@@ -136,7 +136,7 @@ function le(e) {
|
|
|
136
136
|
const r = [], o = [];
|
|
137
137
|
return t.forEach((i, s) => {
|
|
138
138
|
if (a.has(s)) return;
|
|
139
|
-
const u =
|
|
139
|
+
const u = A(
|
|
140
140
|
i,
|
|
141
141
|
n,
|
|
142
142
|
t
|
|
@@ -176,15 +176,15 @@ function ce(e) {
|
|
|
176
176
|
return !a && !r ? 0 : a ? r ? new Date(r).getTime() - new Date(a).getTime() : -1 : 1;
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
const
|
|
180
|
-
const o = ae(e, n), i = o.value, s =
|
|
179
|
+
const D = (e, n, t, a, r) => {
|
|
180
|
+
const o = ae(e, n), i = o.value, s = j(i);
|
|
181
181
|
let u = i;
|
|
182
|
-
s === "Image" && (u = /* @__PURE__ */ b(
|
|
182
|
+
s === "Image" && (u = /* @__PURE__ */ b(H, { imageSrc: i, alt: i, id: `${i}-img` })), s === "Video" && (u = /* @__PURE__ */ b(Y, { id: `${i}-video`, videoSrc: i }));
|
|
183
183
|
const l = r("OBSERVATIONS_RECORDED_BY", {
|
|
184
184
|
provider: o.provider
|
|
185
185
|
}), v = e.display, c = e.observationValue?.isAbnormal ? "abnormal-obs" : "obs", p = a ? `${a}-${c}-${v}-${t}-${n}` : `${c}-${v}-${t}-${n}`;
|
|
186
186
|
return /* @__PURE__ */ b(
|
|
187
|
-
|
|
187
|
+
P,
|
|
188
188
|
{
|
|
189
189
|
header: o.header,
|
|
190
190
|
value: u,
|
|
@@ -196,13 +196,13 @@ const w = (e, n, t, a, r) => {
|
|
|
196
196
|
`obs-${e.id}`
|
|
197
197
|
);
|
|
198
198
|
}, ve = (e, n, t, a, r, o) => /* @__PURE__ */ b(
|
|
199
|
-
|
|
199
|
+
w,
|
|
200
200
|
{
|
|
201
201
|
title: e.display,
|
|
202
202
|
id: `grouped-obs-${e.display}-${a}`,
|
|
203
203
|
open: t,
|
|
204
204
|
children: e.children.map(
|
|
205
|
-
(i, s) =>
|
|
205
|
+
(i, s) => D(i, s, r, o, n)
|
|
206
206
|
)
|
|
207
207
|
},
|
|
208
208
|
`grouped-obs-${e.id}`
|
|
@@ -213,14 +213,14 @@ const w = (e, n, t, a, r) => {
|
|
|
213
213
|
const { t } = I(), a = (r, o, i) => {
|
|
214
214
|
const s = ne(r.encounterDetails, t);
|
|
215
215
|
return /* @__PURE__ */ _(
|
|
216
|
-
|
|
216
|
+
w,
|
|
217
217
|
{
|
|
218
218
|
title: s,
|
|
219
219
|
id: `encounter-${r.encounterId}`,
|
|
220
220
|
open: o,
|
|
221
221
|
children: [
|
|
222
222
|
r.observations.map(
|
|
223
|
-
(u, l) =>
|
|
223
|
+
(u, l) => D(u, l, i, n, t)
|
|
224
224
|
),
|
|
225
225
|
r.groupedObservations.map(
|
|
226
226
|
(u, l) => ve(
|
|
@@ -252,20 +252,20 @@ const w = (e, n, t, a, r) => {
|
|
|
252
252
|
observations: be,
|
|
253
253
|
title: ge
|
|
254
254
|
}, me = (e) => ["conceptUuid", e], fe = (e, n) => ["observations", e, ...n], Ee = ({ config: e }) => {
|
|
255
|
-
const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r =
|
|
255
|
+
const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = z(/* @__PURE__ */ new Set()), o = B(), { addNotification: i } = U(), { t: s } = I(), u = k({
|
|
256
256
|
queries: t.map((d) => ({
|
|
257
257
|
queryKey: me(d),
|
|
258
|
-
queryFn: () =>
|
|
258
|
+
queryFn: () => x(d),
|
|
259
259
|
enabled: !!d
|
|
260
260
|
}))
|
|
261
261
|
});
|
|
262
262
|
S(() => {
|
|
263
263
|
u.forEach((d, g) => {
|
|
264
264
|
if (d.isError && !r.current.has(g)) {
|
|
265
|
-
const
|
|
265
|
+
const M = t[g];
|
|
266
266
|
i({
|
|
267
267
|
title: s("ERROR_DEFAULT_TITLE"),
|
|
268
|
-
message: s("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
268
|
+
message: s("ERROR_FETCHING_CONCEPT", { conceptName: M }),
|
|
269
269
|
type: "error"
|
|
270
270
|
}), r.current.add(g);
|
|
271
271
|
} else d.isError || r.current.delete(g);
|
|
@@ -275,9 +275,9 @@ const w = (e, n, t, a, r) => {
|
|
|
275
275
|
data: p,
|
|
276
276
|
isLoading: N,
|
|
277
277
|
isError: y
|
|
278
|
-
} =
|
|
278
|
+
} = G({
|
|
279
279
|
queryKey: fe(o, v),
|
|
280
|
-
queryFn: () =>
|
|
280
|
+
queryFn: () => Z(o, v),
|
|
281
281
|
enabled: !!o && v.length > 0 && c
|
|
282
282
|
});
|
|
283
283
|
S(() => {
|
|
@@ -295,7 +295,7 @@ const w = (e, n, t, a, r) => {
|
|
|
295
295
|
{ key: "name", header: "name" },
|
|
296
296
|
{ key: "value", header: "value" },
|
|
297
297
|
{ key: "form", header: "form" }
|
|
298
|
-
],
|
|
298
|
+
], O = N || !c, R = y && c, V = (!p || p.entry?.length === 0 || v.length === 0) && c, q = R ? s("ERROR_FETCHING_OBSERVATIONS") : null, F = V ? s("NO_OBSERVATIONS_FOUND") : void 0, L = E.length > 0 && !O && !R, f = n.titleTranslationKey, m = f ? s(f) : "";
|
|
299
299
|
return /* @__PURE__ */ _(
|
|
300
300
|
"div",
|
|
301
301
|
{
|
|
@@ -305,7 +305,7 @@ const w = (e, n, t, a, r) => {
|
|
|
305
305
|
className: T.observations,
|
|
306
306
|
children: [
|
|
307
307
|
/* @__PURE__ */ b(
|
|
308
|
-
|
|
308
|
+
X,
|
|
309
309
|
{
|
|
310
310
|
id: "observations-title",
|
|
311
311
|
testId: f ? `observations-title-${m}` : "observations-title",
|
|
@@ -314,15 +314,15 @@ const w = (e, n, t, a, r) => {
|
|
|
314
314
|
children: /* @__PURE__ */ b("p", { children: m })
|
|
315
315
|
}
|
|
316
316
|
),
|
|
317
|
-
|
|
317
|
+
L ? /* @__PURE__ */ b(pe, { groupedData: E, title: m }) : /* @__PURE__ */ b(
|
|
318
318
|
K,
|
|
319
319
|
{
|
|
320
320
|
headers: C,
|
|
321
321
|
rows: [],
|
|
322
322
|
ariaLabel: s("OBSERVATIONS"),
|
|
323
|
-
loading:
|
|
323
|
+
loading: O,
|
|
324
324
|
errorStateMessage: q,
|
|
325
|
-
emptyStateMessage:
|
|
325
|
+
emptyStateMessage: F,
|
|
326
326
|
dataTestId: "observations-table"
|
|
327
327
|
}
|
|
328
328
|
)
|