@bahmni/widgets 0.0.1-dev.144 → 0.0.1-dev.147
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-RFNUmGV-.js → FormsTable-j_uo-nfJ.js} +56 -56
- package/dist/{Observations-CY2RzEe0.js → Observations-GyA59xrS.js} +42 -42
- package/dist/{index-DCdaPdMj.js → index-dsfoXKAL.js} +15058 -14754
- package/dist/index.css +1 -1
- package/dist/index.js +14 -14
- package/dist/medications/MedicationsTable.d.ts.map +1 -1
- package/dist/medications/utils.d.ts.map +1 -1
- package/dist/programDetails/ProgramDetails.d.ts.map +1 -1
- package/dist/programDetails/__mocks__/mocks.d.ts.map +1 -1
- package/dist/programDetails/constants.d.ts +1 -0
- package/dist/programDetails/constants.d.ts.map +1 -1
- package/dist/programDetails/model.d.ts +4 -0
- package/dist/programDetails/model.d.ts.map +1 -1
- package/dist/programDetails/utils.d.ts +0 -1
- package/dist/programDetails/utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as b, jsx as a, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { c as L, u as
|
|
2
|
+
import { c as L, u as W, o as X, h as Z, f as ee, p as te, a as re, g as oe, b as ae, J as U, L as se, H as ne, d as de, t as ce, e as q, l as le } from "./index-dsfoXKAL.js";
|
|
3
3
|
import { useQuery as y } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as H, useMemo as g, useCallback as M } from "react";
|
|
5
5
|
import { useTranslation as me } from "react-i18next";
|
|
6
|
-
const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", ge = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", $e = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", Me = "_memberRow_1pd36_81", Le = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Te = "_abnormalValue_1pd36_102", Ae = "_commentSection_1pd36_110", Oe = "_commentText_1pd36_116", Re = "_nestedGroup_1pd36_125",
|
|
6
|
+
const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", ge = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", $e = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", Me = "_memberRow_1pd36_81", Le = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Te = "_abnormalValue_1pd36_102", Ae = "_commentSection_1pd36_110", Oe = "_commentText_1pd36_116", Re = "_nestedGroup_1pd36_125", we = "_nestedGroupLabel_1pd36_132", Ce = "_nestedGroupMembers_1pd36_141", o = {
|
|
7
7
|
formsTableBody: ie,
|
|
8
8
|
customAccordianItem: ue,
|
|
9
9
|
formContent: pe,
|
|
@@ -22,15 +22,15 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
22
22
|
commentSection: Ae,
|
|
23
23
|
commentText: Oe,
|
|
24
24
|
nestedGroup: Re,
|
|
25
|
-
nestedGroupLabel:
|
|
26
|
-
nestedGroupMembers:
|
|
27
|
-
},
|
|
28
|
-
const s = e.concept?.units,
|
|
25
|
+
nestedGroupLabel: we,
|
|
26
|
+
nestedGroupMembers: Ce
|
|
27
|
+
}, Fe = "ABNORMAL", k = (e) => {
|
|
28
|
+
const s = e.concept?.units, c = e.concept?.lowNormal, t = e.concept?.hiNormal, u = c != null, n = t != null, l = u && n ? ` (${c} - ${t})` : u ? ` (>${c})` : n ? ` (<${t})` : "", r = e.interpretation && e.interpretation.toUpperCase() === Fe;
|
|
29
29
|
return { units: s, rangeString: l, isAbnormal: r };
|
|
30
|
-
},
|
|
30
|
+
}, P = ({
|
|
31
31
|
member: e,
|
|
32
32
|
depth: s = 0,
|
|
33
|
-
memberIndex:
|
|
33
|
+
memberIndex: c = 0,
|
|
34
34
|
formName: t = ""
|
|
35
35
|
}) => {
|
|
36
36
|
const u = e.groupMembers && e.groupMembers.length > 0, n = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name, l = t ? `${t}-` : "";
|
|
@@ -39,13 +39,13 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
39
39
|
"div",
|
|
40
40
|
{
|
|
41
41
|
className: o.nestedGroup,
|
|
42
|
-
"data-testid": `${l}obs-nested-group-${n}-${
|
|
42
|
+
"data-testid": `${l}obs-nested-group-${n}-${c}`,
|
|
43
43
|
children: [
|
|
44
44
|
/* @__PURE__ */ a(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
47
|
className: o.nestedGroupLabel,
|
|
48
|
-
"data-testid": `${l}obs-nested-group-label-${n}-${
|
|
48
|
+
"data-testid": `${l}obs-nested-group-label-${n}-${c}`,
|
|
49
49
|
style: { paddingLeft: `${s * 16}px` },
|
|
50
50
|
children: n
|
|
51
51
|
}
|
|
@@ -54,9 +54,9 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
56
|
className: o.nestedGroupMembers,
|
|
57
|
-
"data-testid": `${l}obs-nested-group-members-${n}-${
|
|
57
|
+
"data-testid": `${l}obs-nested-group-members-${n}-${c}`,
|
|
58
58
|
children: e.groupMembers?.map((N, $) => /* @__PURE__ */ a(
|
|
59
|
-
|
|
59
|
+
P,
|
|
60
60
|
{
|
|
61
61
|
member: N,
|
|
62
62
|
depth: s + 1,
|
|
@@ -70,12 +70,12 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
70
70
|
]
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
|
-
const { units: r, rangeString: _, isAbnormal: f } =
|
|
73
|
+
const { units: r, rangeString: _, isAbnormal: f } = k(e);
|
|
74
74
|
return /* @__PURE__ */ b(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
77
|
className: o.memberRow,
|
|
78
|
-
"data-testid": `${l}obs-member-row-${n}-${
|
|
78
|
+
"data-testid": `${l}obs-member-row-${n}-${c}`,
|
|
79
79
|
style: { paddingLeft: `${s * 16}px` },
|
|
80
80
|
children: [
|
|
81
81
|
/* @__PURE__ */ b(
|
|
@@ -85,7 +85,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
85
85
|
o.memberLabel,
|
|
86
86
|
f ? o.abnormalValue : ""
|
|
87
87
|
),
|
|
88
|
-
"data-testid": `${l}obs-member-label-${n}-${
|
|
88
|
+
"data-testid": `${l}obs-member-label-${n}-${c}`,
|
|
89
89
|
children: [
|
|
90
90
|
n,
|
|
91
91
|
_
|
|
@@ -99,7 +99,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
99
99
|
o.memberValue,
|
|
100
100
|
f ? o.abnormalValue : ""
|
|
101
101
|
),
|
|
102
|
-
"data-testid": `${l}obs-member-value-${n}-${
|
|
102
|
+
"data-testid": `${l}obs-member-value-${n}-${c}`,
|
|
103
103
|
children: [
|
|
104
104
|
e.valueAsString,
|
|
105
105
|
r && ` ${r}`
|
|
@@ -109,12 +109,12 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
109
109
|
]
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
|
-
},
|
|
112
|
+
}, ve = ({
|
|
113
113
|
observation: e,
|
|
114
114
|
index: s,
|
|
115
|
-
formName:
|
|
115
|
+
formName: c = ""
|
|
116
116
|
}) => {
|
|
117
|
-
const t = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: n, isAbnormal: l } =
|
|
117
|
+
const t = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: n, isAbnormal: l } = k(e), r = c ? `${c}-` : "";
|
|
118
118
|
return /* @__PURE__ */ b(
|
|
119
119
|
"div",
|
|
120
120
|
{
|
|
@@ -147,12 +147,12 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
147
147
|
className: o.groupMembers,
|
|
148
148
|
"data-testid": `${r}observation-group-members-${e.conceptNameToDisplay}-${s}`,
|
|
149
149
|
children: e.groupMembers?.map((_, f) => /* @__PURE__ */ a(
|
|
150
|
-
|
|
150
|
+
P,
|
|
151
151
|
{
|
|
152
152
|
member: _,
|
|
153
153
|
depth: 0,
|
|
154
154
|
memberIndex: f,
|
|
155
|
-
formName:
|
|
155
|
+
formName: c
|
|
156
156
|
},
|
|
157
157
|
`${_.concept.uuid}`
|
|
158
158
|
))
|
|
@@ -192,42 +192,42 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
192
192
|
}, Ue = ({
|
|
193
193
|
episodeOfCareUuids: e,
|
|
194
194
|
encounterUuids: s,
|
|
195
|
-
config:
|
|
195
|
+
config: c
|
|
196
196
|
}) => {
|
|
197
|
-
const { t } = me(), u =
|
|
197
|
+
const { t } = me(), u = W(), [n, l] = H(!1), [r, _] = H(null), f = c?.numberOfVisits, N = X(
|
|
198
198
|
e,
|
|
199
199
|
s
|
|
200
200
|
), {
|
|
201
201
|
data: $ = [],
|
|
202
202
|
isLoading: O,
|
|
203
203
|
isError: R,
|
|
204
|
-
error:
|
|
204
|
+
error: j
|
|
205
205
|
} = y({
|
|
206
206
|
queryKey: ["forms", u, e],
|
|
207
207
|
queryFn: () => Z(u, void 0, f),
|
|
208
208
|
enabled: !!u && !N
|
|
209
|
-
}),
|
|
210
|
-
(
|
|
211
|
-
), [$, s]), { data:
|
|
209
|
+
}), w = g(() => !s || s.length === 0 ? $ : $.filter(
|
|
210
|
+
(d) => s.includes(d.encounterUuid)
|
|
211
|
+
), [$, s]), { data: C = [] } = y({
|
|
212
212
|
queryKey: ["observationForms"],
|
|
213
213
|
queryFn: () => ee()
|
|
214
|
-
}),
|
|
215
|
-
(
|
|
216
|
-
[
|
|
214
|
+
}), F = M(
|
|
215
|
+
(d) => C.find((m) => m.name === d)?.uuid,
|
|
216
|
+
[C]
|
|
217
217
|
), D = g(() => {
|
|
218
218
|
if (r)
|
|
219
|
-
return
|
|
220
|
-
}, [r,
|
|
219
|
+
return F(r.formName);
|
|
220
|
+
}, [r, F]), {
|
|
221
221
|
data: Ee,
|
|
222
|
-
isLoading:
|
|
223
|
-
error:
|
|
222
|
+
isLoading: K,
|
|
223
|
+
error: v
|
|
224
224
|
} = y({
|
|
225
225
|
queryKey: ["formMetadata", D],
|
|
226
226
|
queryFn: () => te(D),
|
|
227
227
|
enabled: !!D && n
|
|
228
228
|
}), {
|
|
229
229
|
data: T,
|
|
230
|
-
isLoading:
|
|
230
|
+
isLoading: J,
|
|
231
231
|
error: E
|
|
232
232
|
} = y({
|
|
233
233
|
queryKey: ["formsEncounter", r?.encounterUuid],
|
|
@@ -241,18 +241,18 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
241
241
|
{ key: "recordedBy", header: t("FORM_RECORDED_BY") }
|
|
242
242
|
],
|
|
243
243
|
[t]
|
|
244
|
-
),
|
|
244
|
+
), x = g(
|
|
245
245
|
() => [
|
|
246
246
|
{ key: "recordedOn", sortable: !0 },
|
|
247
247
|
{ key: "recordedBy", sortable: !0 }
|
|
248
248
|
],
|
|
249
249
|
[]
|
|
250
250
|
), V = g(() => {
|
|
251
|
-
const
|
|
251
|
+
const d = w.reduce(
|
|
252
252
|
(m, i) => {
|
|
253
253
|
const h = i.formName;
|
|
254
254
|
m[h] ??= [];
|
|
255
|
-
const A = i.providers.map((
|
|
255
|
+
const A = i.providers.map((Q) => Q.providerName).filter(Boolean).join(", ");
|
|
256
256
|
return m[h].push({
|
|
257
257
|
id: i.encounterUuid,
|
|
258
258
|
formName: i.formName,
|
|
@@ -264,7 +264,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
264
264
|
},
|
|
265
265
|
{}
|
|
266
266
|
);
|
|
267
|
-
return Object.entries(
|
|
267
|
+
return Object.entries(d).map(
|
|
268
268
|
([m, i]) => ({
|
|
269
269
|
formName: m,
|
|
270
270
|
records: i.sort(
|
|
@@ -272,17 +272,17 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
272
272
|
)
|
|
273
273
|
})
|
|
274
274
|
).sort((m, i) => m.formName.localeCompare(i.formName));
|
|
275
|
-
}, [
|
|
276
|
-
_(
|
|
277
|
-
}, []),
|
|
275
|
+
}, [w, t]), S = M((d) => {
|
|
276
|
+
_(d), l(!0);
|
|
277
|
+
}, []), z = M(() => {
|
|
278
278
|
l(!1), _(null);
|
|
279
279
|
}, []), G = M(
|
|
280
|
-
(
|
|
280
|
+
(d, p) => {
|
|
281
281
|
switch (p) {
|
|
282
282
|
case "recordedOn":
|
|
283
|
-
return /* @__PURE__ */ a(ae, { onClick: () => S(
|
|
283
|
+
return /* @__PURE__ */ a(ae, { onClick: () => S(d), children: d.recordedOn });
|
|
284
284
|
case "recordedBy":
|
|
285
|
-
return
|
|
285
|
+
return d.recordedBy;
|
|
286
286
|
default:
|
|
287
287
|
return null;
|
|
288
288
|
}
|
|
@@ -297,14 +297,14 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
297
297
|
ariaLabel: t("FORMS_HEADING"),
|
|
298
298
|
rows: [],
|
|
299
299
|
loading: O,
|
|
300
|
-
errorStateMessage: R ?
|
|
300
|
+
errorStateMessage: R ? j?.message : void 0,
|
|
301
301
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
302
302
|
renderCell: G,
|
|
303
303
|
className: o.formsTableBody,
|
|
304
304
|
dataTestId: "forms-table"
|
|
305
305
|
}
|
|
306
|
-
) : /* @__PURE__ */ a(se, { align: "start", children: V.map((
|
|
307
|
-
const { formName: m, records: i } =
|
|
306
|
+
) : /* @__PURE__ */ a(se, { align: "start", children: V.map((d, p) => {
|
|
307
|
+
const { formName: m, records: i } = d;
|
|
308
308
|
return /* @__PURE__ */ a(
|
|
309
309
|
ne,
|
|
310
310
|
{
|
|
@@ -320,7 +320,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
320
320
|
rows: i,
|
|
321
321
|
loading: !1,
|
|
322
322
|
errorStateMessage: "",
|
|
323
|
-
sortable:
|
|
323
|
+
sortable: x,
|
|
324
324
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
325
325
|
renderCell: G,
|
|
326
326
|
className: o.formsTableBody,
|
|
@@ -332,24 +332,24 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
332
332
|
);
|
|
333
333
|
}) }) }),
|
|
334
334
|
n && r && /* @__PURE__ */ a(
|
|
335
|
-
|
|
335
|
+
de,
|
|
336
336
|
{
|
|
337
337
|
id: "modalIdForActionAreaLayout",
|
|
338
338
|
open: n,
|
|
339
|
-
onRequestClose:
|
|
339
|
+
onRequestClose: z,
|
|
340
340
|
modalHeading: r.formName,
|
|
341
341
|
modalLabel: `${r.recordedOn} | ${r.recordedBy}`,
|
|
342
342
|
passiveModal: !0,
|
|
343
343
|
size: "md",
|
|
344
344
|
testId: "form-details-modal",
|
|
345
|
-
children: /* @__PURE__ */ a("div", { className: o.formContent, children:
|
|
346
|
-
|
|
345
|
+
children: /* @__PURE__ */ a("div", { className: o.formContent, children: K || J ? /* @__PURE__ */ a(ce, { width: "100%", lineCount: 3 }) : v ? /* @__PURE__ */ a("div", { children: q(v).message ?? t("ERROR_FETCHING_FORM_METADATA") }) : E ? /* @__PURE__ */ a("div", { children: q(E).message ?? t("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ a("div", { className: o.formDetailsContainer, children: I.map((d, p) => /* @__PURE__ */ a(
|
|
346
|
+
ve,
|
|
347
347
|
{
|
|
348
|
-
observation:
|
|
348
|
+
observation: d,
|
|
349
349
|
index: p,
|
|
350
350
|
formName: r.formName
|
|
351
351
|
},
|
|
352
|
-
`${
|
|
352
|
+
`${d.concept.uuid}`
|
|
353
353
|
)) }) : /* @__PURE__ */ a("div", { children: t("NO_FORM_DATA_AVAILABLE") }) })
|
|
354
354
|
}
|
|
355
355
|
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as v, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useQueries as
|
|
4
|
-
import { useRef as W, useEffect as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
const X = "normal", Z = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ee = "A", te = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ne = (e, n) => e?.date ?
|
|
1
|
+
import { jsx as v, jsxs as I } from "react/jsx-runtime";
|
|
2
|
+
import { m as L, V as N, D as k, _ as q, x, i as Q, u as G, j as K, k as P, r as H, O as j, J as Y } from "./index-dsfoXKAL.js";
|
|
3
|
+
import { useQueries as J, useQuery as z } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as W, useEffect as T, useMemo as y } from "react";
|
|
5
|
+
import { useTranslation as D } from "react-i18next";
|
|
6
|
+
const X = "normal", Z = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ee = "A", te = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ne = (e, n) => e?.date ? L(e.date, n).formattedResult : n("DATE_ERROR_PARSE"), re = (e) => {
|
|
7
7
|
if (!e.observationValue?.value)
|
|
8
8
|
return "";
|
|
9
9
|
const { value: n, unit: t } = e.observationValue;
|
|
@@ -113,9 +113,9 @@ function ue(e, n) {
|
|
|
113
113
|
location: t.location?.[0]?.location?.display
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function A(e, n, t) {
|
|
117
117
|
const s = O(e.encounter), r = (e.hasMember ?? []).map((o) => O(o)).map((o) => o ? t.get(o) : void 0).filter((o) => !!o).map(
|
|
118
|
-
(o) =>
|
|
118
|
+
(o) => A(o, n, t)
|
|
119
119
|
);
|
|
120
120
|
return {
|
|
121
121
|
id: e.id,
|
|
@@ -138,7 +138,7 @@ function ce(e) {
|
|
|
138
138
|
const r = [], o = [];
|
|
139
139
|
return t.forEach((i, a) => {
|
|
140
140
|
if (s.has(a)) return;
|
|
141
|
-
const u =
|
|
141
|
+
const u = A(
|
|
142
142
|
i,
|
|
143
143
|
n,
|
|
144
144
|
t
|
|
@@ -179,21 +179,21 @@ function de(e) {
|
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
const w = (e, n, t, s, r) => {
|
|
182
|
-
const o = se(e, n), i = o.value, a =
|
|
182
|
+
const o = se(e, n), i = o.value, a = k(i);
|
|
183
183
|
let u = i;
|
|
184
|
-
a === "Image" && (u = /* @__PURE__ */ v(
|
|
184
|
+
a === "Image" && (u = /* @__PURE__ */ v(x, { imageSrc: i, alt: i, id: `${i}-img` })), a === "Video" && (u = /* @__PURE__ */ v(Q, { id: `${i}-video`, videoSrc: i }));
|
|
185
185
|
const c = r("OBSERVATIONS_RECORDED_BY", {
|
|
186
186
|
provider: o.provider
|
|
187
|
-
}), d = e.display, f = e.observationValue?.isAbnormal ? "abnormal-obs" : "obs",
|
|
187
|
+
}), d = e.display, f = e.observationValue?.isAbnormal ? "abnormal-obs" : "obs", g = s ? `${s}-${f}-${d}-${t}-${n}` : `${f}-${d}-${t}-${n}`;
|
|
188
188
|
return /* @__PURE__ */ v(
|
|
189
|
-
|
|
189
|
+
q,
|
|
190
190
|
{
|
|
191
191
|
header: o.header,
|
|
192
192
|
value: u,
|
|
193
193
|
info: c,
|
|
194
|
-
id:
|
|
195
|
-
testId:
|
|
196
|
-
ariaLabel:
|
|
194
|
+
id: g,
|
|
195
|
+
testId: g,
|
|
196
|
+
ariaLabel: g
|
|
197
197
|
},
|
|
198
198
|
`obs-${e.id}`
|
|
199
199
|
);
|
|
@@ -212,9 +212,9 @@ const w = (e, n, t, s, r) => {
|
|
|
212
212
|
groupedData: e,
|
|
213
213
|
title: n = ""
|
|
214
214
|
}) => {
|
|
215
|
-
const { t } =
|
|
215
|
+
const { t } = D(), s = (r, o, i) => {
|
|
216
216
|
const a = ne(r.encounterDetails, t);
|
|
217
|
-
return /* @__PURE__ */
|
|
217
|
+
return /* @__PURE__ */ I(
|
|
218
218
|
N,
|
|
219
219
|
{
|
|
220
220
|
title: a,
|
|
@@ -250,39 +250,39 @@ const w = (e, n, t, s, r) => {
|
|
|
250
250
|
)
|
|
251
251
|
}
|
|
252
252
|
);
|
|
253
|
-
}, fe = "_observations_kfbhq_1",
|
|
253
|
+
}, fe = "_observations_kfbhq_1", me = "_title_kfbhq_12", _ = {
|
|
254
254
|
observations: fe,
|
|
255
|
-
title:
|
|
256
|
-
},
|
|
257
|
-
const n = e, { conceptNames: t = [], conceptUuid: s = [] } = n, r = W(/* @__PURE__ */ new Set()), o = G(), { addNotification: i } =
|
|
255
|
+
title: me
|
|
256
|
+
}, ge = (e) => ["conceptUuid", e], be = (e, n) => ["observations", e, ...n], $e = ({ config: e }) => {
|
|
257
|
+
const n = e, { conceptNames: t = [], conceptUuid: s = [] } = n, r = W(/* @__PURE__ */ new Set()), o = G(), { addNotification: i } = K(), { t: a } = D(), u = J({
|
|
258
258
|
queries: t.map((l) => ({
|
|
259
|
-
queryKey:
|
|
259
|
+
queryKey: ge(l),
|
|
260
260
|
queryFn: () => P(l),
|
|
261
261
|
enabled: !!l
|
|
262
262
|
}))
|
|
263
263
|
});
|
|
264
|
-
|
|
265
|
-
u.forEach((l,
|
|
266
|
-
if (l.isError && !r.current.has(
|
|
267
|
-
const
|
|
264
|
+
T(() => {
|
|
265
|
+
u.forEach((l, m) => {
|
|
266
|
+
if (l.isError && !r.current.has(m)) {
|
|
267
|
+
const F = t[m];
|
|
268
268
|
i({
|
|
269
269
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
270
|
-
message: a("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
270
|
+
message: a("ERROR_FETCHING_CONCEPT", { conceptName: F }),
|
|
271
271
|
type: "error"
|
|
272
|
-
}), r.current.add(
|
|
273
|
-
} else l.isError || r.current.delete(
|
|
272
|
+
}), r.current.add(m);
|
|
273
|
+
} else l.isError || r.current.delete(m);
|
|
274
274
|
});
|
|
275
275
|
}, [u, t]);
|
|
276
276
|
const c = y(() => u.map((l) => l.data?.uuid).filter((l) => !!l), [u]), d = y(() => [.../* @__PURE__ */ new Set([...c, ...s])], [c, s]), p = y(() => t.length === 0 ? !0 : u.every((l) => !l.isLoading), [u, t.length]), {
|
|
277
277
|
data: f,
|
|
278
|
-
isLoading:
|
|
278
|
+
isLoading: g,
|
|
279
279
|
isError: E
|
|
280
|
-
} =
|
|
280
|
+
} = z({
|
|
281
281
|
queryKey: be(o, d),
|
|
282
|
-
queryFn: () =>
|
|
282
|
+
queryFn: () => H(o, d),
|
|
283
283
|
enabled: !!o && d.length > 0 && p
|
|
284
284
|
});
|
|
285
|
-
|
|
285
|
+
T(() => {
|
|
286
286
|
E && i({
|
|
287
287
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
288
288
|
message: a("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -291,20 +291,20 @@ const w = (e, n, t, s, r) => {
|
|
|
291
291
|
}, [E]);
|
|
292
292
|
const R = y(() => {
|
|
293
293
|
if (!f) return [];
|
|
294
|
-
const l = ce(f),
|
|
295
|
-
return de(
|
|
294
|
+
const l = ce(f), m = le(l);
|
|
295
|
+
return de(m);
|
|
296
296
|
}, [f]), C = [
|
|
297
297
|
{ key: "name", header: "name" },
|
|
298
298
|
{ key: "value", header: "value" },
|
|
299
299
|
{ key: "form", header: "form" }
|
|
300
|
-
], $ =
|
|
301
|
-
return /* @__PURE__ */
|
|
300
|
+
], $ = g || !p, S = E && p, V = (!f || f.entry?.length === 0 || d.length === 0) && p, B = S ? a("ERROR_FETCHING_OBSERVATIONS") : null, M = V ? a("NO_OBSERVATIONS_FOUND") : void 0, U = R.length > 0 && !$ && !S, h = n.titleTranslationKey, b = h ? a(h) : "";
|
|
301
|
+
return /* @__PURE__ */ I(
|
|
302
302
|
"div",
|
|
303
303
|
{
|
|
304
304
|
id: "observations",
|
|
305
305
|
"data-testid": h ? `observations-${b}` : "observations",
|
|
306
306
|
"aria-label": "observations-aria-label",
|
|
307
|
-
className:
|
|
307
|
+
className: _.observations,
|
|
308
308
|
children: [
|
|
309
309
|
/* @__PURE__ */ v(
|
|
310
310
|
j,
|
|
@@ -312,11 +312,11 @@ const w = (e, n, t, s, r) => {
|
|
|
312
312
|
id: "observations-title",
|
|
313
313
|
testId: h ? `observations-title-${b}` : "observations-title",
|
|
314
314
|
title: b,
|
|
315
|
-
className:
|
|
315
|
+
className: _.title,
|
|
316
316
|
children: /* @__PURE__ */ v("p", { children: b })
|
|
317
317
|
}
|
|
318
318
|
),
|
|
319
|
-
|
|
319
|
+
U ? /* @__PURE__ */ v(pe, { groupedData: R, title: b }) : /* @__PURE__ */ v(
|
|
320
320
|
Y,
|
|
321
321
|
{
|
|
322
322
|
headers: C,
|
|
@@ -333,7 +333,7 @@ const w = (e, n, t, s, r) => {
|
|
|
333
333
|
);
|
|
334
334
|
};
|
|
335
335
|
export {
|
|
336
|
-
|
|
336
|
+
ge as conceptUuidQueryKeys,
|
|
337
337
|
$e as default,
|
|
338
338
|
be as observationsQueryKeys
|
|
339
339
|
};
|