@bahmni/registration-app 0.0.1-dev.135 → 0.0.1-dev.139
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-CJbdqo4y-Bd13-5qt.js → FormsTable-L_FgKUMC-DmfXukQs.js} +55 -55
- package/dist/{LNWAZHJI-DvdDpKu_.js → LNWAZHJI-CMEwxQfR.js} +2 -2
- package/dist/{MWZ6AO7Z-BXnnaaKn.js → MWZ6AO7Z-Cn3Xlq8n.js} +2 -2
- package/dist/{Observations-DhWTpv8S-Bb2XuJG2.js → Observations-DvU3hHuI-Cw9nxJ8M.js} +28 -28
- package/dist/{YPM2AS64-3c5FwiSl.js → YPM2AS64-CLCwLQnS.js} +138 -138
- package/dist/hooks/useAddressSuggestions.d.ts.map +1 -1
- package/dist/{index-C2Cjutln.js → index-DPNl3mNU.js} +34249 -32675
- package/dist/index.css +1 -1
- package/dist/index.js +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, y as Q, a as X, Y as J, U as ee, K as re, W as ae, d as oe, m as te, $ as U, q as ne, b as se, F as me, V as de, c as G, Z as ie, v } from "./index-DPNl3mNU.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", $e = "_groupLabel_1pd36_48", Ne = "_rowLabel_1pd36_58", ge = "_rowValue_1pd36_67", he = "_groupMembers_1pd36_75",
|
|
4
|
+
import { useState as x, useMemo as $, 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", $e = "_groupLabel_1pd36_48", Ne = "_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", Le = "_commentText_1pd36_116", Ce = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Oe = "_nestedGroupMembers_1pd36_141", o = {
|
|
6
6
|
formsTableBody: le,
|
|
7
7
|
customAccordianItem: ce,
|
|
8
8
|
formContent: ue,
|
|
@@ -14,19 +14,19 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
14
14
|
rowLabel: Ne,
|
|
15
15
|
rowValue: ge,
|
|
16
16
|
groupMembers: he,
|
|
17
|
-
memberRow:
|
|
18
|
-
memberLabel:
|
|
17
|
+
memberRow: ye,
|
|
18
|
+
memberLabel: ve,
|
|
19
19
|
memberValue: Ae,
|
|
20
20
|
abnormalValue: Me,
|
|
21
21
|
commentSection: Te,
|
|
22
|
-
commentText:
|
|
22
|
+
commentText: Le,
|
|
23
23
|
nestedGroup: Ce,
|
|
24
24
|
nestedGroupLabel: De,
|
|
25
|
-
nestedGroupMembers:
|
|
26
|
-
},
|
|
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() ===
|
|
25
|
+
nestedGroupMembers: Oe
|
|
26
|
+
}, Re = "ABNORMAL", q = (e) => {
|
|
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
32
|
memberIndex: d = 0,
|
|
@@ -55,7 +55,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
55
55
|
className: o.nestedGroupMembers,
|
|
56
56
|
"data-testid": `${c}obs-nested-group-members-${m}-${d}`,
|
|
57
57
|
children: e.groupMembers?.map((N, g) => /* @__PURE__ */ t(
|
|
58
|
-
|
|
58
|
+
K,
|
|
59
59
|
{
|
|
60
60
|
member: N,
|
|
61
61
|
depth: s + 1,
|
|
@@ -80,7 +80,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
80
80
|
/* @__PURE__ */ p(
|
|
81
81
|
"p",
|
|
82
82
|
{
|
|
83
|
-
className:
|
|
83
|
+
className: v(
|
|
84
84
|
o.memberLabel,
|
|
85
85
|
_ ? o.abnormalValue : ""
|
|
86
86
|
),
|
|
@@ -94,7 +94,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
94
94
|
/* @__PURE__ */ p(
|
|
95
95
|
"p",
|
|
96
96
|
{
|
|
97
|
-
className:
|
|
97
|
+
className: v(
|
|
98
98
|
o.memberValue,
|
|
99
99
|
_ ? o.abnormalValue : ""
|
|
100
100
|
),
|
|
@@ -129,7 +129,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
129
129
|
/* @__PURE__ */ p(
|
|
130
130
|
"p",
|
|
131
131
|
{
|
|
132
|
-
className:
|
|
132
|
+
className: v(
|
|
133
133
|
r ? o.groupLabel : o.rowLabel,
|
|
134
134
|
!r && c ? o.abnormalValue : ""
|
|
135
135
|
),
|
|
@@ -146,7 +146,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
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
|
+
K,
|
|
150
150
|
{
|
|
151
151
|
member: b,
|
|
152
152
|
depth: 0,
|
|
@@ -159,7 +159,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
159
159
|
) : /* @__PURE__ */ p(
|
|
160
160
|
"p",
|
|
161
161
|
{
|
|
162
|
-
className:
|
|
162
|
+
className: v(
|
|
163
163
|
o.rowValue,
|
|
164
164
|
c ? o.abnormalValue : ""
|
|
165
165
|
),
|
|
@@ -188,37 +188,37 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
188
188
|
},
|
|
189
189
|
`${e.concept.uuid}-${s}`
|
|
190
190
|
);
|
|
191
|
-
},
|
|
191
|
+
}, Be = ({
|
|
192
192
|
episodeOfCareUuids: e,
|
|
193
193
|
encounterUuids: s,
|
|
194
194
|
config: d
|
|
195
195
|
}) => {
|
|
196
|
-
const { t: r } =
|
|
196
|
+
const { t: r } = z(), u = Q(), [m, c] = x(!1), [a, b] = x(null), _ = d?.numberOfVisits, N = X(
|
|
197
197
|
e,
|
|
198
198
|
s
|
|
199
199
|
), {
|
|
200
200
|
data: g = [],
|
|
201
|
-
isLoading:
|
|
201
|
+
isLoading: L,
|
|
202
202
|
isError: C,
|
|
203
|
-
error:
|
|
203
|
+
error: k
|
|
204
204
|
} = h({
|
|
205
205
|
queryKey: ["forms", u, e],
|
|
206
|
-
queryFn: () =>
|
|
206
|
+
queryFn: () => J(u, void 0, _),
|
|
207
207
|
enabled: !!u && !N
|
|
208
208
|
}), D = $(() => !s || s.length === 0 ? g : g.filter(
|
|
209
209
|
(n) => s.includes(n.encounterUuid)
|
|
210
|
-
), [g, s]), { data:
|
|
210
|
+
), [g, s]), { data: O = [] } = h({
|
|
211
211
|
queryKey: ["observationForms"],
|
|
212
212
|
queryFn: () => ee()
|
|
213
|
-
}),
|
|
214
|
-
(n) =>
|
|
215
|
-
[
|
|
213
|
+
}), R = y(
|
|
214
|
+
(n) => O.find((l) => l.name === n)?.uuid,
|
|
215
|
+
[O]
|
|
216
216
|
), A = $(() => {
|
|
217
217
|
if (a)
|
|
218
|
-
return
|
|
219
|
-
}, [a,
|
|
220
|
-
data:
|
|
221
|
-
isLoading:
|
|
218
|
+
return R(a.formName);
|
|
219
|
+
}, [a, R]), {
|
|
220
|
+
data: we,
|
|
221
|
+
isLoading: H,
|
|
222
222
|
error: F
|
|
223
223
|
} = h({
|
|
224
224
|
queryKey: ["formMetadata", A],
|
|
@@ -226,21 +226,21 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
226
226
|
enabled: !!A && m
|
|
227
227
|
}), {
|
|
228
228
|
data: M,
|
|
229
|
-
isLoading:
|
|
230
|
-
error:
|
|
229
|
+
isLoading: j,
|
|
230
|
+
error: w
|
|
231
231
|
} = h({
|
|
232
232
|
queryKey: ["formsEncounter", a?.encounterUuid],
|
|
233
233
|
queryFn: () => ae(a.encounterUuid, !0),
|
|
234
234
|
enabled: !!a?.encounterUuid && m
|
|
235
|
-
}),
|
|
235
|
+
}), I = $(() => !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]),
|
|
237
|
+
), [M?.observations, a?.formName]), V = $(
|
|
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 = $(
|
|
244
244
|
() => [
|
|
245
245
|
{ key: "recordedOn", sortable: !0 },
|
|
246
246
|
{ key: "recordedBy", sortable: !0 }
|
|
@@ -251,7 +251,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
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((Y) => Y.providerName).filter(Boolean).join(", ");
|
|
255
255
|
return l[f].push({
|
|
256
256
|
id: i.encounterUuid,
|
|
257
257
|
formName: i.formName,
|
|
@@ -271,34 +271,34 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
271
271
|
)
|
|
272
272
|
})
|
|
273
273
|
).sort((l, i) => l.formName.localeCompare(i.formName));
|
|
274
|
-
}, [D, r]),
|
|
274
|
+
}, [D, r]), S = y((n) => {
|
|
275
275
|
b(n), c(!0);
|
|
276
|
-
}, []),
|
|
276
|
+
}, []), W = y(() => {
|
|
277
277
|
c(!1), b(null);
|
|
278
|
-
}, []),
|
|
278
|
+
}, []), B = y(
|
|
279
279
|
(n, l) => {
|
|
280
280
|
switch (l) {
|
|
281
281
|
case "recordedOn":
|
|
282
|
-
return /* @__PURE__ */ t(te, { onClick: () =>
|
|
282
|
+
return /* @__PURE__ */ t(te, { onClick: () => S(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
|
+
[S]
|
|
290
290
|
);
|
|
291
|
-
return /* @__PURE__ */ p(
|
|
292
|
-
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children:
|
|
293
|
-
|
|
291
|
+
return /* @__PURE__ */ p(Z, { children: [
|
|
292
|
+
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || C || E.length === 0 || N ? /* @__PURE__ */ t(
|
|
293
|
+
U,
|
|
294
294
|
{
|
|
295
|
-
headers:
|
|
295
|
+
headers: V,
|
|
296
296
|
ariaLabel: r("FORMS_HEADING"),
|
|
297
297
|
rows: [],
|
|
298
|
-
loading:
|
|
299
|
-
errorStateMessage: C ?
|
|
298
|
+
loading: L,
|
|
299
|
+
errorStateMessage: C ? k?.message : void 0,
|
|
300
300
|
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
301
|
-
renderCell:
|
|
301
|
+
renderCell: B,
|
|
302
302
|
className: o.formsTableBody,
|
|
303
303
|
dataTestId: "forms-table"
|
|
304
304
|
}
|
|
@@ -312,16 +312,16 @@ 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
|
+
U,
|
|
316
316
|
{
|
|
317
|
-
headers:
|
|
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
|
-
renderCell:
|
|
324
|
+
renderCell: B,
|
|
325
325
|
className: o.formsTableBody,
|
|
326
326
|
dataTestId: `forms-table-${i}`
|
|
327
327
|
}
|
|
@@ -335,13 +335,13 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
335
335
|
{
|
|
336
336
|
id: "modalIdForActionAreaLayout",
|
|
337
337
|
open: m,
|
|
338
|
-
onRequestClose:
|
|
338
|
+
onRequestClose: W,
|
|
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: H || j ? /* @__PURE__ */ t(de, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: G(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ t("div", { children: G(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,
|
|
@@ -355,5 +355,5 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
355
355
|
] });
|
|
356
356
|
};
|
|
357
357
|
export {
|
|
358
|
-
|
|
358
|
+
Be as default
|
|
359
359
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import { k as d, l as f,
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CLCwLQnS.js";
|
|
2
|
+
import { k as d, l as f, n as e } from "./index-DPNl3mNU.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
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 { k as v, l as C,
|
|
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-CLCwLQnS.js";
|
|
2
|
+
import { k as v, l as C, n as e } from "./index-DPNl3mNU.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as _, jsx as b } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { y as B, e as U, u as I, f as k, g as x, h as H, $ as K, P as Q, i as w, j, w as P, H as G, M as X } from "./index-DPNl3mNU.js";
|
|
3
3
|
import { useQueries as Y, useQuery as Z } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as z, useEffect as
|
|
4
|
+
import { useRef as z, useEffect as S, useMemo as h } from "react";
|
|
5
5
|
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) => {
|
|
6
6
|
if (!e.observationValue?.value)
|
|
7
7
|
return "";
|
|
@@ -112,9 +112,9 @@ function ue(e, n) {
|
|
|
112
112
|
location: t.location?.[0]?.location?.display
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function A(e, n, t) {
|
|
116
116
|
const a = $(e.encounter), r = (e.hasMember ?? []).map((o) => $(o)).map((o) => o ? t.get(o) : void 0).filter((o) => !!o).map(
|
|
117
|
-
(o) =>
|
|
117
|
+
(o) => A(o, n, t)
|
|
118
118
|
);
|
|
119
119
|
return {
|
|
120
120
|
id: e.id,
|
|
@@ -137,7 +137,7 @@ function le(e) {
|
|
|
137
137
|
const r = [], o = [];
|
|
138
138
|
return t.forEach((i, s) => {
|
|
139
139
|
if (a.has(s)) return;
|
|
140
|
-
const u =
|
|
140
|
+
const u = A(
|
|
141
141
|
i,
|
|
142
142
|
n,
|
|
143
143
|
t
|
|
@@ -177,15 +177,15 @@ function ce(e) {
|
|
|
177
177
|
return !a && !r ? 0 : a ? r ? new Date(r).getTime() - new Date(a).getTime() : -1 : 1;
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
|
-
const
|
|
180
|
+
const D = (e, n, t, a, r) => {
|
|
181
181
|
const o = ae(e, n), i = o.value, s = j(i);
|
|
182
182
|
let u = i;
|
|
183
|
-
s === "Image" && (u = /* @__PURE__ */ b(
|
|
183
|
+
s === "Image" && (u = /* @__PURE__ */ b(G, { imageSrc: i, alt: i, id: `${i}-img` })), s === "Video" && (u = /* @__PURE__ */ b(X, { id: `${i}-video`, videoSrc: i }));
|
|
184
184
|
const l = r("OBSERVATIONS_RECORDED_BY", {
|
|
185
185
|
provider: o.provider
|
|
186
186
|
}), v = e.display, c = e.observationValue?.isAbnormal ? "abnormal-obs" : "obs", p = a ? `${a}-${c}-${v}-${t}-${n}` : `${c}-${v}-${t}-${n}`;
|
|
187
187
|
return /* @__PURE__ */ b(
|
|
188
|
-
|
|
188
|
+
P,
|
|
189
189
|
{
|
|
190
190
|
header: o.header,
|
|
191
191
|
value: u,
|
|
@@ -197,13 +197,13 @@ const A = (e, n, t, a, r) => {
|
|
|
197
197
|
`obs-${e.id}`
|
|
198
198
|
);
|
|
199
199
|
}, ve = (e, n, t, a, r, o) => /* @__PURE__ */ b(
|
|
200
|
-
|
|
200
|
+
w,
|
|
201
201
|
{
|
|
202
202
|
title: e.display,
|
|
203
203
|
id: `grouped-obs-${e.display}-${a}`,
|
|
204
204
|
open: t,
|
|
205
205
|
children: e.children.map(
|
|
206
|
-
(i, s) =>
|
|
206
|
+
(i, s) => D(i, s, r, o, n)
|
|
207
207
|
)
|
|
208
208
|
},
|
|
209
209
|
`grouped-obs-${e.id}`
|
|
@@ -214,14 +214,14 @@ const A = (e, n, t, a, r) => {
|
|
|
214
214
|
const { t } = I(), a = (r, o, i) => {
|
|
215
215
|
const s = ne(r.encounterDetails, t);
|
|
216
216
|
return /* @__PURE__ */ _(
|
|
217
|
-
|
|
217
|
+
w,
|
|
218
218
|
{
|
|
219
219
|
title: s,
|
|
220
220
|
id: `encounter-${r.encounterId}`,
|
|
221
221
|
open: o,
|
|
222
222
|
children: [
|
|
223
223
|
r.observations.map(
|
|
224
|
-
(u, l) =>
|
|
224
|
+
(u, l) => D(u, l, i, n, t)
|
|
225
225
|
),
|
|
226
226
|
r.groupedObservations.map(
|
|
227
227
|
(u, l) => ve(
|
|
@@ -249,24 +249,24 @@ const A = (e, n, t, a, r) => {
|
|
|
249
249
|
)
|
|
250
250
|
}
|
|
251
251
|
);
|
|
252
|
-
}, be = "_observations_kfbhq_1", ge = "_title_kfbhq_12",
|
|
252
|
+
}, be = "_observations_kfbhq_1", ge = "_title_kfbhq_12", T = {
|
|
253
253
|
observations: be,
|
|
254
254
|
title: ge
|
|
255
255
|
}, me = (e) => ["conceptUuid", e], fe = (e, n) => ["observations", e, ...n], Oe = ({ config: e }) => {
|
|
256
|
-
const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = z(/* @__PURE__ */ new Set()), o =
|
|
256
|
+
const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = z(/* @__PURE__ */ new Set()), o = B(), { addNotification: i } = U(), { t: s } = I(), u = Y({
|
|
257
257
|
queries: t.map((d) => ({
|
|
258
258
|
queryKey: me(d),
|
|
259
|
-
queryFn: () =>
|
|
259
|
+
queryFn: () => k(d),
|
|
260
260
|
enabled: !!d
|
|
261
261
|
}))
|
|
262
262
|
});
|
|
263
|
-
|
|
263
|
+
S(() => {
|
|
264
264
|
u.forEach((d, g) => {
|
|
265
265
|
if (d.isError && !r.current.has(g)) {
|
|
266
|
-
const
|
|
266
|
+
const L = t[g];
|
|
267
267
|
i({
|
|
268
268
|
title: s("ERROR_DEFAULT_TITLE"),
|
|
269
|
-
message: s("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
269
|
+
message: s("ERROR_FETCHING_CONCEPT", { conceptName: L }),
|
|
270
270
|
type: "error"
|
|
271
271
|
}), r.current.add(g);
|
|
272
272
|
} else d.isError || r.current.delete(g);
|
|
@@ -278,10 +278,10 @@ const A = (e, n, t, a, r) => {
|
|
|
278
278
|
isError: y
|
|
279
279
|
} = Z({
|
|
280
280
|
queryKey: fe(o, v),
|
|
281
|
-
queryFn: () =>
|
|
281
|
+
queryFn: () => x(o, v),
|
|
282
282
|
enabled: !!o && v.length > 0 && c
|
|
283
283
|
});
|
|
284
|
-
|
|
284
|
+
S(() => {
|
|
285
285
|
y && i({
|
|
286
286
|
title: s("ERROR_DEFAULT_TITLE"),
|
|
287
287
|
message: s("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -292,37 +292,37 @@ const A = (e, n, t, a, r) => {
|
|
|
292
292
|
if (!p) return [];
|
|
293
293
|
const d = le(p), g = de(d);
|
|
294
294
|
return ce(g);
|
|
295
|
-
}, [p]),
|
|
295
|
+
}, [p]), V = [
|
|
296
296
|
{ key: "name", header: "name" },
|
|
297
297
|
{ key: "value", header: "value" },
|
|
298
298
|
{ key: "form", header: "form" }
|
|
299
|
-
], O = N || !c, R = y && c,
|
|
299
|
+
], O = N || !c, R = y && c, C = (!p || p.entry?.length === 0 || v.length === 0) && c, M = R ? s("ERROR_FETCHING_OBSERVATIONS") : null, q = C ? s("NO_OBSERVATIONS_FOUND") : void 0, F = E.length > 0 && !O && !R, f = n.titleTranslationKey, m = f ? s(f) : "";
|
|
300
300
|
return /* @__PURE__ */ _(
|
|
301
301
|
"div",
|
|
302
302
|
{
|
|
303
303
|
id: "observations",
|
|
304
304
|
"data-testid": f ? `observations-${m}` : "observations",
|
|
305
305
|
"aria-label": "observations-aria-label",
|
|
306
|
-
className:
|
|
306
|
+
className: T.observations,
|
|
307
307
|
children: [
|
|
308
308
|
/* @__PURE__ */ b(
|
|
309
|
-
|
|
309
|
+
H,
|
|
310
310
|
{
|
|
311
311
|
id: "observations-title",
|
|
312
312
|
testId: f ? `observations-title-${m}` : "observations-title",
|
|
313
313
|
title: m,
|
|
314
|
-
className:
|
|
314
|
+
className: T.title,
|
|
315
315
|
children: /* @__PURE__ */ b("p", { children: m })
|
|
316
316
|
}
|
|
317
317
|
),
|
|
318
|
-
|
|
318
|
+
F ? /* @__PURE__ */ b(pe, { groupedData: E, title: m }) : /* @__PURE__ */ b(
|
|
319
319
|
K,
|
|
320
320
|
{
|
|
321
|
-
headers:
|
|
321
|
+
headers: V,
|
|
322
322
|
rows: [],
|
|
323
323
|
ariaLabel: s("OBSERVATIONS"),
|
|
324
324
|
loading: O,
|
|
325
|
-
errorStateMessage:
|
|
325
|
+
errorStateMessage: M,
|
|
326
326
|
emptyStateMessage: q,
|
|
327
327
|
dataTestId: "observations-table"
|
|
328
328
|
}
|