@bahmni/clinical-app 0.0.1-dev.129 → 0.0.1-dev.131
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-BS5U3KO_-Cu6JoGdw.js → FormsTable-symiaWjC-3E1SCXx1.js} +74 -74
- package/dist/{LNWAZHJI-Dv05E5TG.js → LNWAZHJI-8VYjyX4j.js} +7 -7
- package/dist/{MWZ6AO7Z-DXI2S5JG.js → MWZ6AO7Z-DMPbC5bX.js} +2 -2
- package/dist/{Observations-DhxYnY6i-CK2irdUZ.js → Observations-Dkuz2yfC-ClkE6rwm.js} +39 -39
- package/dist/{YPM2AS64-BmlgHWMd.js → YPM2AS64-DY5RRzLf.js} +181 -181
- package/dist/{index-xo93cMxq.js → index-F6LdLtqm.js} +36089 -35851
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +1 -0
- package/dist/locales/locale_es.json +1 -0
- package/dist/pages/ConsultationPage.d.ts.map +1 -1
- package/dist/pages/constant.d.ts +4 -0
- package/dist/pages/constant.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { jsx as t, jsxs as p, Fragment as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useState as q, useMemo as
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import { u as W, C as Q, J as Y, a as h, c as Z, F as ee, q as x, D as re, R as ae, $ as oe, b as te, v as G, h as ne, W as v, I as se, d as de, S as me, e as ie } from "./index-F6LdLtqm.js";
|
|
3
|
+
import { useState as q, useMemo as $, 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",
|
|
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", $e = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", ge = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", ve = "_memberRow_1pd36_81", Ae = "_memberLabel_1pd36_86", Me = "_memberValue_1pd36_94", Te = "_abnormalValue_1pd36_102", Le = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Ce = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Oe = "_nestedGroupMembers_1pd36_141", o = {
|
|
6
6
|
formsTableBody: ce,
|
|
7
7
|
customAccordianItem: ue,
|
|
8
8
|
formContent: pe,
|
|
9
9
|
formDetailsContainer: be,
|
|
10
10
|
observation: _e,
|
|
11
11
|
groupContainer: fe,
|
|
12
|
-
rowContainer:
|
|
13
|
-
groupLabel:
|
|
12
|
+
rowContainer: $e,
|
|
13
|
+
groupLabel: Ne,
|
|
14
14
|
rowLabel: ge,
|
|
15
15
|
rowValue: he,
|
|
16
16
|
groupMembers: ye,
|
|
17
17
|
memberRow: ve,
|
|
18
18
|
memberLabel: Ae,
|
|
19
|
-
memberValue:
|
|
20
|
-
abnormalValue:
|
|
21
|
-
commentSection:
|
|
22
|
-
commentText:
|
|
23
|
-
nestedGroup:
|
|
24
|
-
nestedGroupLabel:
|
|
19
|
+
memberValue: Me,
|
|
20
|
+
abnormalValue: Te,
|
|
21
|
+
commentSection: Le,
|
|
22
|
+
commentText: Re,
|
|
23
|
+
nestedGroup: Ce,
|
|
24
|
+
nestedGroupLabel: De,
|
|
25
25
|
nestedGroupMembers: Oe
|
|
26
26
|
}, Fe = "ABNORMAL", U = (e) => {
|
|
27
|
-
const s = e.concept?.units,
|
|
27
|
+
const s = e.concept?.units, m = e.concept?.lowNormal, r = e.concept?.hiNormal, u = m != null, d = r != null, c = u && d ? ` (${m} - ${r})` : u ? ` (>${m})` : d ? ` (<${r})` : "", a = e.interpretation && e.interpretation.toUpperCase() === Fe;
|
|
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: m = 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, d = 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-${d}-${m}`,
|
|
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-${d}-${m}`,
|
|
48
48
|
style: { paddingLeft: `${s * 16}px` },
|
|
49
|
-
children:
|
|
49
|
+
children: d
|
|
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((
|
|
58
|
-
|
|
56
|
+
"data-testid": `${c}obs-nested-group-members-${d}-${m}`,
|
|
57
|
+
children: e.groupMembers?.map((N, g) => /* @__PURE__ */ t(
|
|
58
|
+
k,
|
|
59
59
|
{
|
|
60
|
-
member:
|
|
60
|
+
member: N,
|
|
61
61
|
depth: s + 1,
|
|
62
62
|
memberIndex: g,
|
|
63
63
|
formName: r
|
|
64
64
|
},
|
|
65
|
-
`${
|
|
65
|
+
`${N.concept.uuid}`
|
|
66
66
|
))
|
|
67
67
|
}
|
|
68
68
|
)
|
|
@@ -74,7 +74,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
76
|
className: o.memberRow,
|
|
77
|
-
"data-testid": `${c}obs-member-row-${
|
|
77
|
+
"data-testid": `${c}obs-member-row-${d}-${m}`,
|
|
78
78
|
style: { paddingLeft: `${s * 16}px` },
|
|
79
79
|
children: [
|
|
80
80
|
/* @__PURE__ */ p(
|
|
@@ -84,9 +84,9 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
84
84
|
o.memberLabel,
|
|
85
85
|
_ ? o.abnormalValue : ""
|
|
86
86
|
),
|
|
87
|
-
"data-testid": `${c}obs-member-label-${
|
|
87
|
+
"data-testid": `${c}obs-member-label-${d}-${m}`,
|
|
88
88
|
children: [
|
|
89
|
-
|
|
89
|
+
d,
|
|
90
90
|
b
|
|
91
91
|
]
|
|
92
92
|
}
|
|
@@ -98,7 +98,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
98
98
|
o.memberValue,
|
|
99
99
|
_ ? o.abnormalValue : ""
|
|
100
100
|
),
|
|
101
|
-
"data-testid": `${c}obs-member-value-${
|
|
101
|
+
"data-testid": `${c}obs-member-value-${d}-${m}`,
|
|
102
102
|
children: [
|
|
103
103
|
e.valueAsString,
|
|
104
104
|
a && ` ${a}`
|
|
@@ -111,9 +111,9 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
111
111
|
}, Ie = ({
|
|
112
112
|
observation: e,
|
|
113
113
|
index: s,
|
|
114
|
-
formName:
|
|
114
|
+
formName: m = ""
|
|
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: d, isAbnormal: c } = U(e), a = m ? `${m}-` : "";
|
|
117
117
|
return /* @__PURE__ */ p(
|
|
118
118
|
"div",
|
|
119
119
|
{
|
|
@@ -136,7 +136,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
136
136
|
"data-testid": `${a}observation-label-${e.conceptNameToDisplay}-${s}`,
|
|
137
137
|
children: [
|
|
138
138
|
e.conceptNameToDisplay,
|
|
139
|
-
!r &&
|
|
139
|
+
!r && d && /* @__PURE__ */ t("span", { className: o.rangeInfo, children: d })
|
|
140
140
|
]
|
|
141
141
|
}
|
|
142
142
|
),
|
|
@@ -146,12 +146,12 @@ 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
|
+
k,
|
|
150
150
|
{
|
|
151
151
|
member: b,
|
|
152
152
|
depth: 0,
|
|
153
153
|
memberIndex: _,
|
|
154
|
-
formName:
|
|
154
|
+
formName: m
|
|
155
155
|
},
|
|
156
156
|
`${b.concept.uuid}`
|
|
157
157
|
))
|
|
@@ -188,75 +188,75 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
188
188
|
},
|
|
189
189
|
`${e.concept.uuid}-${s}`
|
|
190
190
|
);
|
|
191
|
-
},
|
|
191
|
+
}, xe = ({
|
|
192
192
|
episodeOfCareUuids: e,
|
|
193
193
|
encounterUuids: s,
|
|
194
|
-
config:
|
|
194
|
+
config: m
|
|
195
195
|
}) => {
|
|
196
|
-
const { t: r } =
|
|
196
|
+
const { t: r } = W(), u = Q(), [d, c] = q(!1), [a, b] = q(null), _ = m?.numberOfVisits, N = Y(
|
|
197
197
|
e,
|
|
198
198
|
s
|
|
199
199
|
), {
|
|
200
200
|
data: g = [],
|
|
201
|
-
isLoading:
|
|
202
|
-
isError:
|
|
203
|
-
error:
|
|
201
|
+
isLoading: L,
|
|
202
|
+
isError: R,
|
|
203
|
+
error: H
|
|
204
204
|
} = h({
|
|
205
205
|
queryKey: ["forms", u, e],
|
|
206
206
|
queryFn: () => se(u, void 0, _),
|
|
207
|
-
enabled: !!u &&
|
|
208
|
-
}),
|
|
207
|
+
enabled: !!u && !N
|
|
208
|
+
}), C = $(() => !s || s.length === 0 ? g : g.filter(
|
|
209
209
|
(n) => s.includes(n.encounterUuid)
|
|
210
|
-
), [g, s]), { data:
|
|
210
|
+
), [g, s]), { data: D = [] } = h({
|
|
211
211
|
queryKey: ["observationForms"],
|
|
212
|
-
queryFn: () =>
|
|
212
|
+
queryFn: () => de()
|
|
213
213
|
}), O = y(
|
|
214
|
-
(n) =>
|
|
215
|
-
[
|
|
216
|
-
), A =
|
|
214
|
+
(n) => D.find((l) => l.name === n)?.uuid,
|
|
215
|
+
[D]
|
|
216
|
+
), A = $(() => {
|
|
217
217
|
if (a)
|
|
218
218
|
return O(a.formName);
|
|
219
219
|
}, [a, O]), {
|
|
220
220
|
data: we,
|
|
221
|
-
isLoading:
|
|
221
|
+
isLoading: X,
|
|
222
222
|
error: F
|
|
223
223
|
} = h({
|
|
224
224
|
queryKey: ["formMetadata", A],
|
|
225
|
-
queryFn: () =>
|
|
226
|
-
enabled: !!A &&
|
|
225
|
+
queryFn: () => me(A),
|
|
226
|
+
enabled: !!A && d
|
|
227
227
|
}), {
|
|
228
|
-
data:
|
|
228
|
+
data: M,
|
|
229
229
|
isLoading: j,
|
|
230
230
|
error: I
|
|
231
231
|
} = h({
|
|
232
232
|
queryKey: ["formsEncounter", a?.encounterUuid],
|
|
233
233
|
queryFn: () => ie(a.encounterUuid, !0),
|
|
234
|
-
enabled: !!a?.encounterUuid &&
|
|
235
|
-
}), w =
|
|
234
|
+
enabled: !!a?.encounterUuid && d
|
|
235
|
+
}), w = $(() => !M?.observations || !a?.formName ? [] : M.observations.filter(
|
|
236
236
|
(n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(a.formName)
|
|
237
|
-
), [
|
|
237
|
+
), [M?.observations, a?.formName]), S = $(
|
|
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
|
-
), K =
|
|
243
|
+
), K = $(
|
|
244
244
|
() => [
|
|
245
245
|
{ key: "recordedOn", sortable: !0 },
|
|
246
246
|
{ key: "recordedBy", sortable: !0 }
|
|
247
247
|
],
|
|
248
248
|
[]
|
|
249
|
-
),
|
|
250
|
-
const n =
|
|
249
|
+
), B = $(() => {
|
|
250
|
+
const n = C.reduce(
|
|
251
251
|
(l, i) => {
|
|
252
252
|
const f = i.formName;
|
|
253
253
|
l[f] ??= [];
|
|
254
|
-
const
|
|
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,
|
|
258
|
-
recordedOn:
|
|
259
|
-
recordedBy:
|
|
258
|
+
recordedOn: Z(i.encounterDateTime, r, ne).formattedResult,
|
|
259
|
+
recordedBy: T ?? "--",
|
|
260
260
|
encounterDateTime: i.encounterDateTime,
|
|
261
261
|
encounterUuid: i.encounterUuid
|
|
262
262
|
}), l;
|
|
@@ -267,11 +267,11 @@ 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, T) => T.encounterDateTime - f.encounterDateTime
|
|
271
271
|
)
|
|
272
272
|
})
|
|
273
273
|
).sort((l, i) => l.formName.localeCompare(i.formName));
|
|
274
|
-
}, [
|
|
274
|
+
}, [C, r]), E = y((n) => {
|
|
275
275
|
b(n), c(!0);
|
|
276
276
|
}, []), P = y(() => {
|
|
277
277
|
c(!1), b(null);
|
|
@@ -288,21 +288,21 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
288
288
|
},
|
|
289
289
|
[E]
|
|
290
290
|
);
|
|
291
|
-
return /* @__PURE__ */ p(
|
|
292
|
-
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children:
|
|
293
|
-
|
|
291
|
+
return /* @__PURE__ */ p(J, { children: [
|
|
292
|
+
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || R || B.length === 0 || N ? /* @__PURE__ */ t(
|
|
293
|
+
x,
|
|
294
294
|
{
|
|
295
|
-
headers:
|
|
295
|
+
headers: S,
|
|
296
296
|
ariaLabel: r("FORMS_HEADING"),
|
|
297
297
|
rows: [],
|
|
298
|
-
loading:
|
|
299
|
-
errorStateMessage:
|
|
298
|
+
loading: L,
|
|
299
|
+
errorStateMessage: R ? H?.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: B.map((n, l) => {
|
|
306
306
|
const { formName: i, records: f } = n;
|
|
307
307
|
return /* @__PURE__ */ t(
|
|
308
308
|
ae,
|
|
@@ -312,9 +312,9 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
312
312
|
testId: `accordian-title-${i}`,
|
|
313
313
|
open: l === 0,
|
|
314
314
|
children: /* @__PURE__ */ t(
|
|
315
|
-
|
|
315
|
+
x,
|
|
316
316
|
{
|
|
317
|
-
headers:
|
|
317
|
+
headers: S,
|
|
318
318
|
ariaLabel: r("FORMS_HEADING"),
|
|
319
319
|
rows: f,
|
|
320
320
|
loading: !1,
|
|
@@ -330,19 +330,19 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
330
330
|
i
|
|
331
331
|
);
|
|
332
332
|
}) }) }),
|
|
333
|
-
|
|
333
|
+
d && a && le(
|
|
334
334
|
/* @__PURE__ */ t(
|
|
335
335
|
oe,
|
|
336
336
|
{
|
|
337
337
|
id: "modalIdForActionAreaLayout",
|
|
338
|
-
open:
|
|
338
|
+
open: d,
|
|
339
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:
|
|
345
|
+
children: /* @__PURE__ */ t("div", { className: o.formContent, children: X || j ? /* @__PURE__ */ t(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: G(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : I ? /* @__PURE__ */ t("div", { children: G(I).message ?? r("ERROR_FETCHING_FORM_DATA") }) : w.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: w.map((n, l) => /* @__PURE__ */ t(
|
|
346
346
|
Ie,
|
|
347
347
|
{
|
|
348
348
|
observation: n,
|
|
@@ -358,5 +358,5 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
358
358
|
] });
|
|
359
359
|
};
|
|
360
360
|
export {
|
|
361
|
-
|
|
361
|
+
xe as default
|
|
362
362
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import { m as d, n as f,
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DY5RRzLf.js";
|
|
2
|
+
import { m as d, n as f, r as e } from "./index-F6LdLtqm.js";
|
|
3
3
|
var p = (a) => {
|
|
4
|
-
const [r,
|
|
4
|
+
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
6
|
}), n = d(), s = f(() => {
|
|
7
|
-
const
|
|
8
|
-
return
|
|
7
|
+
const o = r.theme_preference || l;
|
|
8
|
+
return o !== "system" ? o : n();
|
|
9
9
|
});
|
|
10
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: t,
|
|
16
16
|
get children() {
|
|
17
17
|
return e(u.Provider, {
|
|
18
18
|
value: s,
|
|
19
19
|
get children() {
|
|
20
20
|
return e(v, {
|
|
21
21
|
localStore: r,
|
|
22
|
-
setLocalStore:
|
|
22
|
+
setLocalStore: t
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -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 { m as v, n 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-DY5RRzLf.js";
|
|
2
|
+
import { m as v, n as C, r as e } from "./index-F6LdLtqm.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 { C as
|
|
3
|
-
import { useRef as z, useEffect as
|
|
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 ?
|
|
2
|
+
import { C as F, T as U, u as I, f as X, L as k, a as x, o as K, q as Q, g as j, i as D, O as G, j as H, p as P, k as Y, l as Z } from "./index-F6LdLtqm.js";
|
|
3
|
+
import { useRef as z, useEffect as T, 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 ? j(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;
|
|
@@ -111,9 +111,9 @@ function ue(e, n) {
|
|
|
111
111
|
location: t.location?.[0]?.location?.display
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function w(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) => w(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 = w(
|
|
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 A = (e, n, t, a, r) => {
|
|
180
|
+
const o = ae(e, n), i = o.value, s = G(i);
|
|
181
181
|
let u = i;
|
|
182
|
-
s === "Image" && (u = /* @__PURE__ */ b(
|
|
182
|
+
s === "Image" && (u = /* @__PURE__ */ b(P, { 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
|
+
H,
|
|
188
188
|
{
|
|
189
189
|
header: o.header,
|
|
190
190
|
value: u,
|
|
@@ -196,13 +196,13 @@ const D = (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
|
+
D,
|
|
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) => A(i, s, r, o, n)
|
|
206
206
|
)
|
|
207
207
|
},
|
|
208
208
|
`grouped-obs-${e.id}`
|
|
@@ -213,14 +213,14 @@ const D = (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
|
+
D,
|
|
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) => A(u, l, i, n, t)
|
|
224
224
|
),
|
|
225
225
|
r.groupedObservations.map(
|
|
226
226
|
(u, l) => ve(
|
|
@@ -248,24 +248,24 @@ const D = (e, n, t, a, r) => {
|
|
|
248
248
|
)
|
|
249
249
|
}
|
|
250
250
|
);
|
|
251
|
-
}, be = "_observations_kfbhq_1", ge = "_title_kfbhq_12",
|
|
251
|
+
}, be = "_observations_kfbhq_1", ge = "_title_kfbhq_12", S = {
|
|
252
252
|
observations: be,
|
|
253
253
|
title: ge
|
|
254
|
-
},
|
|
255
|
-
const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = z(/* @__PURE__ */ new Set()), o =
|
|
254
|
+
}, fe = (e) => ["conceptUuid", e], me = (e, n) => ["observations", e, ...n], Ee = ({ config: e }) => {
|
|
255
|
+
const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = z(/* @__PURE__ */ new Set()), o = F(), { addNotification: i } = U(), { t: s } = I(), u = X({
|
|
256
256
|
queries: t.map((d) => ({
|
|
257
|
-
queryKey:
|
|
258
|
-
queryFn: () =>
|
|
257
|
+
queryKey: fe(d),
|
|
258
|
+
queryFn: () => k(d),
|
|
259
259
|
enabled: !!d
|
|
260
260
|
}))
|
|
261
261
|
});
|
|
262
|
-
|
|
262
|
+
T(() => {
|
|
263
263
|
u.forEach((d, g) => {
|
|
264
264
|
if (d.isError && !r.current.has(g)) {
|
|
265
|
-
const
|
|
265
|
+
const B = 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: B }),
|
|
269
269
|
type: "error"
|
|
270
270
|
}), r.current.add(g);
|
|
271
271
|
} else d.isError || r.current.delete(g);
|
|
@@ -275,12 +275,12 @@ const D = (e, n, t, a, r) => {
|
|
|
275
275
|
data: p,
|
|
276
276
|
isLoading: N,
|
|
277
277
|
isError: y
|
|
278
|
-
} =
|
|
279
|
-
queryKey:
|
|
278
|
+
} = x({
|
|
279
|
+
queryKey: me(o, v),
|
|
280
280
|
queryFn: () => Z(o, v),
|
|
281
281
|
enabled: !!o && v.length > 0 && c
|
|
282
282
|
});
|
|
283
|
-
|
|
283
|
+
T(() => {
|
|
284
284
|
y && i({
|
|
285
285
|
title: s("ERROR_DEFAULT_TITLE"),
|
|
286
286
|
message: s("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -295,34 +295,34 @@ const D = (e, n, t, a, r) => {
|
|
|
295
295
|
{ key: "name", header: "name" },
|
|
296
296
|
{ key: "value", header: "value" },
|
|
297
297
|
{ key: "form", header: "form" }
|
|
298
|
-
], O = N || !c, R = y && c, V = (!p || p.entry?.length === 0 || v.length === 0) && c,
|
|
298
|
+
], O = N || !c, R = y && c, V = (!p || p.entry?.length === 0 || v.length === 0) && c, L = R ? s("ERROR_FETCHING_OBSERVATIONS") : null, q = V ? s("NO_OBSERVATIONS_FOUND") : void 0, M = E.length > 0 && !O && !R, m = n.titleTranslationKey, f = m ? s(m) : "";
|
|
299
299
|
return /* @__PURE__ */ _(
|
|
300
300
|
"div",
|
|
301
301
|
{
|
|
302
302
|
id: "observations",
|
|
303
|
-
"data-testid":
|
|
303
|
+
"data-testid": m ? `observations-${f}` : "observations",
|
|
304
304
|
"aria-label": "observations-aria-label",
|
|
305
|
-
className:
|
|
305
|
+
className: S.observations,
|
|
306
306
|
children: [
|
|
307
307
|
/* @__PURE__ */ b(
|
|
308
|
-
|
|
308
|
+
K,
|
|
309
309
|
{
|
|
310
310
|
id: "observations-title",
|
|
311
|
-
testId:
|
|
312
|
-
title:
|
|
313
|
-
className:
|
|
314
|
-
children: /* @__PURE__ */ b("p", { children:
|
|
311
|
+
testId: m ? `observations-title-${f}` : "observations-title",
|
|
312
|
+
title: f,
|
|
313
|
+
className: S.title,
|
|
314
|
+
children: /* @__PURE__ */ b("p", { children: f })
|
|
315
315
|
}
|
|
316
316
|
),
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
M ? /* @__PURE__ */ b(pe, { groupedData: E, title: f }) : /* @__PURE__ */ b(
|
|
318
|
+
Q,
|
|
319
319
|
{
|
|
320
320
|
headers: C,
|
|
321
321
|
rows: [],
|
|
322
322
|
ariaLabel: s("OBSERVATIONS"),
|
|
323
323
|
loading: O,
|
|
324
|
-
errorStateMessage:
|
|
325
|
-
emptyStateMessage:
|
|
324
|
+
errorStateMessage: L,
|
|
325
|
+
emptyStateMessage: q,
|
|
326
326
|
dataTestId: "observations-table"
|
|
327
327
|
}
|
|
328
328
|
)
|
|
@@ -331,7 +331,7 @@ const D = (e, n, t, a, r) => {
|
|
|
331
331
|
);
|
|
332
332
|
};
|
|
333
333
|
export {
|
|
334
|
-
|
|
334
|
+
fe as conceptUuidQueryKeys,
|
|
335
335
|
Ee as default,
|
|
336
|
-
|
|
336
|
+
me as observationsQueryKeys
|
|
337
337
|
};
|