@bahmni/registration-app 0.0.1-dev.145 → 0.0.1-dev.148
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-BHeAQgqW-C0v258Zz.js → FormsTable-DWpgqIOY-37vFVNTZ.js} +55 -55
- package/dist/{LNWAZHJI-CnTQFP21.js → LNWAZHJI-zsoKkk5h.js} +5 -5
- package/dist/{MWZ6AO7Z-C9J-4zPr.js → MWZ6AO7Z-BtsUo8Ah.js} +4 -4
- package/dist/Observations-DJMt5zW3-DzNvUiTs.js +163 -0
- package/dist/{YPM2AS64-9Q9qiie5.js → YPM2AS64-DlEtdfM4.js} +455 -455
- package/dist/{index-Bz9hJQp5.js → index-BA_3C-qM.js} +36000 -35248
- package/dist/index.css +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/dist/Observations-GGAuVXyN-DlfH3XnC.js +0 -338
|
@@ -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 W } from "react/jsx-runtime";
|
|
2
|
+
import { u as J, H as Q, w as X, W as Z, q as ee, U as re, F as ae, i as oe, C as te, A as G, Y as ne, G as se, a as me, V as de, b as U, g as ie, c as v } from "./index-BA_3C-qM.js";
|
|
3
3
|
import { useQuery as h } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue = "_formContent_1pd36_18", pe = "_formDetailsContainer_1pd36_25", be = "_observation_1pd36_30", _e = "_groupContainer_1pd36_39", fe = "_rowContainer_1pd36_43",
|
|
4
|
+
import { useState as x, useMemo as N, useCallback as y } from "react";
|
|
5
|
+
const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue = "_formContent_1pd36_18", pe = "_formDetailsContainer_1pd36_25", be = "_observation_1pd36_30", _e = "_groupContainer_1pd36_39", fe = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", $e = "_rowLabel_1pd36_58", ge = "_rowValue_1pd36_67", he = "_groupMembers_1pd36_75", ye = "_memberRow_1pd36_81", ve = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Me = "_abnormalValue_1pd36_102", Te = "_commentSection_1pd36_110", Ce = "_commentText_1pd36_116", Le = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Oe = "_nestedGroupMembers_1pd36_141", o = {
|
|
6
6
|
formsTableBody: le,
|
|
7
7
|
customAccordianItem: ce,
|
|
8
8
|
formContent: ue,
|
|
@@ -10,8 +10,8 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
10
10
|
observation: be,
|
|
11
11
|
groupContainer: _e,
|
|
12
12
|
rowContainer: fe,
|
|
13
|
-
groupLabel:
|
|
14
|
-
rowLabel:
|
|
13
|
+
groupLabel: Ne,
|
|
14
|
+
rowLabel: $e,
|
|
15
15
|
rowValue: ge,
|
|
16
16
|
groupMembers: he,
|
|
17
17
|
memberRow: ye,
|
|
@@ -19,50 +19,50 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
19
19
|
memberValue: Ae,
|
|
20
20
|
abnormalValue: Me,
|
|
21
21
|
commentSection: Te,
|
|
22
|
-
commentText:
|
|
23
|
-
nestedGroup:
|
|
22
|
+
commentText: Ce,
|
|
23
|
+
nestedGroup: Le,
|
|
24
24
|
nestedGroupLabel: De,
|
|
25
25
|
nestedGroupMembers: Oe
|
|
26
26
|
}, Re = "ABNORMAL", q = (e) => {
|
|
27
|
-
const s = e.concept?.units,
|
|
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() === Re;
|
|
28
28
|
return { units: s, rangeString: c, isAbnormal: a };
|
|
29
29
|
}, k = ({
|
|
30
30
|
member: e,
|
|
31
31
|
depth: s = 0,
|
|
32
|
-
memberIndex:
|
|
32
|
+
memberIndex: d = 0,
|
|
33
33
|
formName: r = ""
|
|
34
34
|
}) => {
|
|
35
|
-
const u = e.groupMembers && e.groupMembers.length > 0,
|
|
35
|
+
const u = e.groupMembers && e.groupMembers.length > 0, m = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name, c = r ? `${r}-` : "";
|
|
36
36
|
if (u)
|
|
37
37
|
return /* @__PURE__ */ p(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
className: o.nestedGroup,
|
|
41
|
-
"data-testid": `${c}obs-nested-group-${
|
|
41
|
+
"data-testid": `${c}obs-nested-group-${m}-${d}`,
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ t(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
className: o.nestedGroupLabel,
|
|
47
|
-
"data-testid": `${c}obs-nested-group-label-${
|
|
47
|
+
"data-testid": `${c}obs-nested-group-label-${m}-${d}`,
|
|
48
48
|
style: { paddingLeft: `${s * 16}px` },
|
|
49
|
-
children:
|
|
49
|
+
children: m
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
52
|
/* @__PURE__ */ t(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
55
|
className: o.nestedGroupMembers,
|
|
56
|
-
"data-testid": `${c}obs-nested-group-members-${
|
|
57
|
-
children: e.groupMembers?.map((
|
|
56
|
+
"data-testid": `${c}obs-nested-group-members-${m}-${d}`,
|
|
57
|
+
children: e.groupMembers?.map(($, g) => /* @__PURE__ */ t(
|
|
58
58
|
k,
|
|
59
59
|
{
|
|
60
|
-
member:
|
|
60
|
+
member: $,
|
|
61
61
|
depth: s + 1,
|
|
62
62
|
memberIndex: g,
|
|
63
63
|
formName: r
|
|
64
64
|
},
|
|
65
|
-
`${
|
|
65
|
+
`${$.concept.uuid}`
|
|
66
66
|
))
|
|
67
67
|
}
|
|
68
68
|
)
|
|
@@ -74,7 +74,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
76
|
className: o.memberRow,
|
|
77
|
-
"data-testid": `${c}obs-member-row-${
|
|
77
|
+
"data-testid": `${c}obs-member-row-${m}-${d}`,
|
|
78
78
|
style: { paddingLeft: `${s * 16}px` },
|
|
79
79
|
children: [
|
|
80
80
|
/* @__PURE__ */ p(
|
|
@@ -84,9 +84,9 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
84
84
|
o.memberLabel,
|
|
85
85
|
_ ? o.abnormalValue : ""
|
|
86
86
|
),
|
|
87
|
-
"data-testid": `${c}obs-member-label-${
|
|
87
|
+
"data-testid": `${c}obs-member-label-${m}-${d}`,
|
|
88
88
|
children: [
|
|
89
|
-
|
|
89
|
+
m,
|
|
90
90
|
b
|
|
91
91
|
]
|
|
92
92
|
}
|
|
@@ -98,7 +98,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
98
98
|
o.memberValue,
|
|
99
99
|
_ ? o.abnormalValue : ""
|
|
100
100
|
),
|
|
101
|
-
"data-testid": `${c}obs-member-value-${
|
|
101
|
+
"data-testid": `${c}obs-member-value-${m}-${d}`,
|
|
102
102
|
children: [
|
|
103
103
|
e.valueAsString,
|
|
104
104
|
a && ` ${a}`
|
|
@@ -111,9 +111,9 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
111
111
|
}, Fe = ({
|
|
112
112
|
observation: e,
|
|
113
113
|
index: s,
|
|
114
|
-
formName:
|
|
114
|
+
formName: d = ""
|
|
115
115
|
}) => {
|
|
116
|
-
const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString:
|
|
116
|
+
const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: m, isAbnormal: c } = q(e), a = d ? `${d}-` : "";
|
|
117
117
|
return /* @__PURE__ */ p(
|
|
118
118
|
"div",
|
|
119
119
|
{
|
|
@@ -136,7 +136,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
136
136
|
"data-testid": `${a}observation-label-${e.conceptNameToDisplay}-${s}`,
|
|
137
137
|
children: [
|
|
138
138
|
e.conceptNameToDisplay,
|
|
139
|
-
!r &&
|
|
139
|
+
!r && m && /* @__PURE__ */ t("span", { className: o.rangeInfo, children: m })
|
|
140
140
|
]
|
|
141
141
|
}
|
|
142
142
|
),
|
|
@@ -151,7 +151,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
151
151
|
member: b,
|
|
152
152
|
depth: 0,
|
|
153
153
|
memberIndex: _,
|
|
154
|
-
formName:
|
|
154
|
+
formName: d
|
|
155
155
|
},
|
|
156
156
|
`${b.concept.uuid}`
|
|
157
157
|
))
|
|
@@ -191,21 +191,21 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
191
191
|
}, Be = ({
|
|
192
192
|
episodeOfCareUuids: e,
|
|
193
193
|
encounterUuids: s,
|
|
194
|
-
config:
|
|
194
|
+
config: d
|
|
195
195
|
}) => {
|
|
196
|
-
const { t: r } =
|
|
196
|
+
const { t: r } = J(), u = Q(), [m, c] = x(!1), [a, b] = x(null), _ = d?.numberOfVisits, $ = X(
|
|
197
197
|
e,
|
|
198
198
|
s
|
|
199
199
|
), {
|
|
200
200
|
data: g = [],
|
|
201
|
-
isLoading:
|
|
202
|
-
isError:
|
|
201
|
+
isLoading: C,
|
|
202
|
+
isError: L,
|
|
203
203
|
error: H
|
|
204
204
|
} = h({
|
|
205
205
|
queryKey: ["forms", u, e],
|
|
206
206
|
queryFn: () => Z(u, void 0, _),
|
|
207
|
-
enabled: !!u &&
|
|
208
|
-
}), D =
|
|
207
|
+
enabled: !!u && !$
|
|
208
|
+
}), D = N(() => !s || s.length === 0 ? g : g.filter(
|
|
209
209
|
(n) => s.includes(n.encounterUuid)
|
|
210
210
|
), [g, s]), { data: O = [] } = h({
|
|
211
211
|
queryKey: ["observationForms"],
|
|
@@ -213,45 +213,45 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
213
213
|
}), R = y(
|
|
214
214
|
(n) => O.find((l) => l.name === n)?.uuid,
|
|
215
215
|
[O]
|
|
216
|
-
), A =
|
|
216
|
+
), A = N(() => {
|
|
217
217
|
if (a)
|
|
218
218
|
return R(a.formName);
|
|
219
219
|
}, [a, R]), {
|
|
220
220
|
data: we,
|
|
221
|
-
isLoading:
|
|
221
|
+
isLoading: j,
|
|
222
222
|
error: F
|
|
223
223
|
} = h({
|
|
224
224
|
queryKey: ["formMetadata", A],
|
|
225
225
|
queryFn: () => re(A),
|
|
226
|
-
enabled: !!A &&
|
|
226
|
+
enabled: !!A && m
|
|
227
227
|
}), {
|
|
228
228
|
data: M,
|
|
229
|
-
isLoading:
|
|
229
|
+
isLoading: K,
|
|
230
230
|
error: w
|
|
231
231
|
} = h({
|
|
232
232
|
queryKey: ["formsEncounter", a?.encounterUuid],
|
|
233
233
|
queryFn: () => ae(a.encounterUuid, !0),
|
|
234
|
-
enabled: !!a?.encounterUuid &&
|
|
235
|
-
}), I =
|
|
234
|
+
enabled: !!a?.encounterUuid && m
|
|
235
|
+
}), I = N(() => !M?.observations || !a?.formName ? [] : M.observations.filter(
|
|
236
236
|
(n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(a.formName)
|
|
237
|
-
), [M?.observations, a?.formName]), V =
|
|
237
|
+
), [M?.observations, a?.formName]), V = 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
|
+
), P = N(
|
|
244
244
|
() => [
|
|
245
245
|
{ key: "recordedOn", sortable: !0 },
|
|
246
246
|
{ key: "recordedBy", sortable: !0 }
|
|
247
247
|
],
|
|
248
248
|
[]
|
|
249
|
-
), E =
|
|
249
|
+
), E = N(() => {
|
|
250
250
|
const n = D.reduce(
|
|
251
251
|
(l, i) => {
|
|
252
252
|
const f = i.formName;
|
|
253
253
|
l[f] ??= [];
|
|
254
|
-
const T = i.providers.map((
|
|
254
|
+
const T = i.providers.map((z) => z.providerName).filter(Boolean).join(", ");
|
|
255
255
|
return l[f].push({
|
|
256
256
|
id: i.encounterUuid,
|
|
257
257
|
formName: i.formName,
|
|
@@ -273,7 +273,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
273
273
|
).sort((l, i) => l.formName.localeCompare(i.formName));
|
|
274
274
|
}, [D, r]), S = y((n) => {
|
|
275
275
|
b(n), c(!0);
|
|
276
|
-
}, []),
|
|
276
|
+
}, []), Y = y(() => {
|
|
277
277
|
c(!1), b(null);
|
|
278
278
|
}, []), B = y(
|
|
279
279
|
(n, l) => {
|
|
@@ -288,15 +288,15 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
288
288
|
},
|
|
289
289
|
[S]
|
|
290
290
|
);
|
|
291
|
-
return /* @__PURE__ */ p(
|
|
292
|
-
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children:
|
|
293
|
-
|
|
291
|
+
return /* @__PURE__ */ p(W, { children: [
|
|
292
|
+
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children: C || L || E.length === 0 || $ ? /* @__PURE__ */ t(
|
|
293
|
+
G,
|
|
294
294
|
{
|
|
295
295
|
headers: V,
|
|
296
296
|
ariaLabel: r("FORMS_HEADING"),
|
|
297
297
|
rows: [],
|
|
298
|
-
loading:
|
|
299
|
-
errorStateMessage:
|
|
298
|
+
loading: C,
|
|
299
|
+
errorStateMessage: L ? H?.message : void 0,
|
|
300
300
|
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
301
301
|
renderCell: B,
|
|
302
302
|
className: o.formsTableBody,
|
|
@@ -312,14 +312,14 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
312
312
|
testId: `accordian-title-${i}`,
|
|
313
313
|
open: l === 0,
|
|
314
314
|
children: /* @__PURE__ */ t(
|
|
315
|
-
|
|
315
|
+
G,
|
|
316
316
|
{
|
|
317
317
|
headers: V,
|
|
318
318
|
ariaLabel: r("FORMS_HEADING"),
|
|
319
319
|
rows: f,
|
|
320
320
|
loading: !1,
|
|
321
321
|
errorStateMessage: "",
|
|
322
|
-
sortable:
|
|
322
|
+
sortable: P,
|
|
323
323
|
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
324
324
|
renderCell: B,
|
|
325
325
|
className: o.formsTableBody,
|
|
@@ -330,18 +330,18 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
330
330
|
i
|
|
331
331
|
);
|
|
332
332
|
}) }) }),
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
m && a && /* @__PURE__ */ t(
|
|
334
|
+
me,
|
|
335
335
|
{
|
|
336
336
|
id: "modalIdForActionAreaLayout",
|
|
337
|
-
open:
|
|
338
|
-
onRequestClose:
|
|
337
|
+
open: m,
|
|
338
|
+
onRequestClose: Y,
|
|
339
339
|
modalHeading: a.formName,
|
|
340
340
|
modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
|
|
341
341
|
passiveModal: !0,
|
|
342
342
|
size: "md",
|
|
343
343
|
testId: "form-details-modal",
|
|
344
|
-
children: /* @__PURE__ */ t("div", { className: o.formContent, children:
|
|
344
|
+
children: /* @__PURE__ */ t("div", { className: o.formContent, children: j || K ? /* @__PURE__ */ t(de, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: U(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ t("div", { children: U(w).message ?? r("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: I.map((n, l) => /* @__PURE__ */ t(
|
|
345
345
|
Fe,
|
|
346
346
|
{
|
|
347
347
|
observation: n,
|
|
@@ -1,5 +1,5 @@
|
|
|
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-DlEtdfM4.js";
|
|
2
|
+
import { l as d, m as f, n as e } from "./index-BA_3C-qM.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -7,17 +7,17 @@ var p = (a) => {
|
|
|
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
|
});
|
|
@@ -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-DlEtdfM4.js";
|
|
2
|
+
import { l as v, m as C, n as e } from "./index-BA_3C-qM.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, {
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { jsxs as $, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { H as C, h as K, u as I, P as U, j as V, K as H, X as Q, Q as M, d as j, A as G, e as w, f as N, J as x, B as P, O as X, k as J, M as Y } from "./index-BA_3C-qM.js";
|
|
3
|
+
import { useQueries as z, useQuery as W } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as Z, useEffect as _, useMemo as h } from "react";
|
|
5
|
+
const S = (e, d, o, l, t) => {
|
|
6
|
+
const a = x(e, d), r = a.value, s = P(r);
|
|
7
|
+
let i = r;
|
|
8
|
+
s === "Image" && (i = /* @__PURE__ */ b(J, { imageSrc: r, alt: r, id: `${r}-img` })), s === "Video" && (i = /* @__PURE__ */ b(Y, { id: `${r}-video`, videoSrc: r }));
|
|
9
|
+
const c = t("OBSERVATIONS_RECORDED_BY", {
|
|
10
|
+
provider: a.provider
|
|
11
|
+
}), m = e.display, p = e.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${p}-${m}-${o}-${d}` : `${p}-${m}-${o}-${d}`;
|
|
12
|
+
return /* @__PURE__ */ b(
|
|
13
|
+
X,
|
|
14
|
+
{
|
|
15
|
+
header: a.header,
|
|
16
|
+
value: i,
|
|
17
|
+
info: c,
|
|
18
|
+
id: u,
|
|
19
|
+
testId: u,
|
|
20
|
+
ariaLabel: u
|
|
21
|
+
},
|
|
22
|
+
`obs-${e.id}`
|
|
23
|
+
);
|
|
24
|
+
}, ee = (e, d, o, l, t, a) => /* @__PURE__ */ b(
|
|
25
|
+
N,
|
|
26
|
+
{
|
|
27
|
+
title: e.display,
|
|
28
|
+
id: `grouped-obs-${e.display}-${l}`,
|
|
29
|
+
open: o,
|
|
30
|
+
children: e.members?.map(
|
|
31
|
+
(r, s) => S(r, s, t, a, d)
|
|
32
|
+
)
|
|
33
|
+
},
|
|
34
|
+
`grouped-obs-${e.id}`
|
|
35
|
+
), te = ({
|
|
36
|
+
groupedData: e,
|
|
37
|
+
title: d = ""
|
|
38
|
+
}) => {
|
|
39
|
+
const { t: o } = I(), l = (t, a, r) => {
|
|
40
|
+
const s = w(t.encounterDetails, o);
|
|
41
|
+
return /* @__PURE__ */ $(
|
|
42
|
+
N,
|
|
43
|
+
{
|
|
44
|
+
title: s,
|
|
45
|
+
id: `encounter-${t.encounterId}`,
|
|
46
|
+
open: a,
|
|
47
|
+
children: [
|
|
48
|
+
t.observations.map(
|
|
49
|
+
(i, c) => S(i, c, r, d, o)
|
|
50
|
+
),
|
|
51
|
+
t.groupedObservations.map(
|
|
52
|
+
(i, c) => ee(
|
|
53
|
+
i,
|
|
54
|
+
o,
|
|
55
|
+
a,
|
|
56
|
+
c,
|
|
57
|
+
r,
|
|
58
|
+
d
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
`encounter-${t.encounterId}`
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ b(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
id: "obs-by-encounter",
|
|
70
|
+
"data-testid": "obs-by-encounter-test-id",
|
|
71
|
+
"aria-label": "obs-by-encounter-aria-label",
|
|
72
|
+
children: e.map(
|
|
73
|
+
(t, a) => l(t, a === 0, a)
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}, ae = "_observations_kfbhq_1", re = "_title_kfbhq_12", T = {
|
|
78
|
+
observations: ae,
|
|
79
|
+
title: re
|
|
80
|
+
}, se = (e) => ["conceptUuid", e], oe = (e, d) => ["observations", e, ...d], ue = ({ config: e }) => {
|
|
81
|
+
const d = e, { conceptNames: o = [], conceptUuid: l = [] } = d, t = Z(/* @__PURE__ */ new Set()), a = C(), { addNotification: r } = K(), { t: s } = I(), i = z({
|
|
82
|
+
queries: o.map((n) => ({
|
|
83
|
+
queryKey: se(n),
|
|
84
|
+
queryFn: () => U(n),
|
|
85
|
+
enabled: !!n
|
|
86
|
+
}))
|
|
87
|
+
});
|
|
88
|
+
_(() => {
|
|
89
|
+
i.forEach((n, y) => {
|
|
90
|
+
if (n.isError && !t.current.has(y)) {
|
|
91
|
+
const q = o[y];
|
|
92
|
+
r({
|
|
93
|
+
title: s("ERROR_DEFAULT_TITLE"),
|
|
94
|
+
message: s("ERROR_FETCHING_CONCEPT", { conceptName: q }),
|
|
95
|
+
type: "error"
|
|
96
|
+
}), t.current.add(y);
|
|
97
|
+
} else n.isError || t.current.delete(y);
|
|
98
|
+
});
|
|
99
|
+
}, [i, o]);
|
|
100
|
+
const c = h(() => i.map((n) => n.data?.uuid).filter((n) => !!n), [i]), m = h(() => [.../* @__PURE__ */ new Set([...c, ...l])], [c, l]), p = h(() => o.length === 0 ? !0 : i.every((n) => !n.isLoading), [i, o.length]), {
|
|
101
|
+
data: u,
|
|
102
|
+
isLoading: A,
|
|
103
|
+
isError: R
|
|
104
|
+
} = W({
|
|
105
|
+
queryKey: oe(a, m),
|
|
106
|
+
queryFn: () => V(a, m),
|
|
107
|
+
enabled: !!a && m.length > 0 && p
|
|
108
|
+
});
|
|
109
|
+
_(() => {
|
|
110
|
+
R && r({
|
|
111
|
+
title: s("ERROR_DEFAULT_TITLE"),
|
|
112
|
+
message: s("ERROR_FETCHING_OBSERVATIONS"),
|
|
113
|
+
type: "error"
|
|
114
|
+
});
|
|
115
|
+
}, [R]);
|
|
116
|
+
const g = h(() => {
|
|
117
|
+
if (!u) return [];
|
|
118
|
+
const n = H(u), y = Q(n);
|
|
119
|
+
return M(y);
|
|
120
|
+
}, [u]), B = [
|
|
121
|
+
{ key: "name", header: "name" },
|
|
122
|
+
{ key: "value", header: "value" },
|
|
123
|
+
{ key: "form", header: "form" }
|
|
124
|
+
], O = A || !p, f = R && p, D = (!u || u.entry?.length === 0 || m.length === 0) && p, F = f ? s("ERROR_FETCHING_OBSERVATIONS") : null, L = D ? s("NO_OBSERVATIONS_FOUND") : void 0, k = g.length > 0 && !O && !f, E = d.titleTranslationKey, v = E ? s(E) : "";
|
|
125
|
+
return /* @__PURE__ */ $(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
id: "observations",
|
|
129
|
+
"data-testid": E ? `observations-${v}` : "observations",
|
|
130
|
+
"aria-label": "observations-aria-label",
|
|
131
|
+
className: T.observations,
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ b(
|
|
134
|
+
j,
|
|
135
|
+
{
|
|
136
|
+
id: "observations-title",
|
|
137
|
+
testId: E ? `observations-title-${v}` : "observations-title",
|
|
138
|
+
title: v,
|
|
139
|
+
className: T.title,
|
|
140
|
+
children: /* @__PURE__ */ b("p", { children: v })
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
k ? /* @__PURE__ */ b(te, { groupedData: g, title: v }) : /* @__PURE__ */ b(
|
|
144
|
+
G,
|
|
145
|
+
{
|
|
146
|
+
headers: B,
|
|
147
|
+
rows: [],
|
|
148
|
+
ariaLabel: s("OBSERVATIONS"),
|
|
149
|
+
loading: O,
|
|
150
|
+
errorStateMessage: F,
|
|
151
|
+
emptyStateMessage: L,
|
|
152
|
+
dataTestId: "observations-table"
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
se as conceptUuidQueryKeys,
|
|
161
|
+
ue as default,
|
|
162
|
+
oe as observationsQueryKeys
|
|
163
|
+
};
|