@bahmni/registration-app 0.0.1-dev.150 → 0.0.1-dev.152
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-2H_unWnb-BMSDpi1c.js → FormsTable-C2-Q9TG2-DhxXVmJD.js} +122 -114
- package/dist/{LNWAZHJI-C3jSkzaq.js → LNWAZHJI-BNFXxxyy.js} +2 -2
- package/dist/{MWZ6AO7Z-DYYoMlgH.js → MWZ6AO7Z-ut1vKCaN.js} +2 -2
- package/dist/Observations-DmBegyWd-kEFHRZV1.js +171 -0
- package/dist/{YPM2AS64-DvBT3iux.js → YPM2AS64-BBeTDdWD.js} +181 -181
- package/dist/{index-O3L-Q5oy.js → index-B6DRKpTQ.js} +10629 -10611
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/Observations-Dj336sZY-DGcE0djF.js +0 -163
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useQuery as
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
6
|
-
formsTableBody:
|
|
7
|
-
customAccordianItem:
|
|
8
|
-
formContent:
|
|
9
|
-
formDetailsContainer:
|
|
10
|
-
observation:
|
|
11
|
-
groupContainer:
|
|
12
|
-
rowContainer:
|
|
13
|
-
groupLabel:
|
|
14
|
-
rowLabel:
|
|
15
|
-
rowValue:
|
|
16
|
-
groupMembers:
|
|
17
|
-
memberRow:
|
|
18
|
-
memberLabel:
|
|
19
|
-
memberValue:
|
|
20
|
-
abnormalValue:
|
|
21
|
-
commentSection:
|
|
22
|
-
commentText:
|
|
23
|
-
nestedGroup:
|
|
24
|
-
nestedGroupLabel:
|
|
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() ===
|
|
1
|
+
import { jsx as n, jsxs as p, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import { u as X, h as Z, w as ee, K as re, U as ae, W as oe, q as te, e as ne, i as se, C as me, A as U, Y as de, G as ie, a as le, b as ce, V as x, g as ue, c as y } from "./index-B6DRKpTQ.js";
|
|
3
|
+
import { useQueryClient as pe, useQuery as g } from "@tanstack/react-query";
|
|
4
|
+
import { useState as q, useMemo as N, useCallback as h } from "react";
|
|
5
|
+
const be = "_formsTableBody_1pd36_1", _e = "_customAccordianItem_1pd36_6", fe = "_formContent_1pd36_18", Ne = "_formDetailsContainer_1pd36_25", $e = "_observation_1pd36_30", ge = "_groupContainer_1pd36_39", he = "_rowContainer_1pd36_43", ye = "_groupLabel_1pd36_48", ve = "_rowLabel_1pd36_58", Ae = "_rowValue_1pd36_67", Ce = "_groupMembers_1pd36_75", Me = "_memberRow_1pd36_81", Te = "_memberLabel_1pd36_86", Le = "_memberValue_1pd36_94", De = "_abnormalValue_1pd36_102", Oe = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Fe = "_nestedGroup_1pd36_125", we = "_nestedGroupLabel_1pd36_132", Ie = "_nestedGroupMembers_1pd36_141", o = {
|
|
6
|
+
formsTableBody: be,
|
|
7
|
+
customAccordianItem: _e,
|
|
8
|
+
formContent: fe,
|
|
9
|
+
formDetailsContainer: Ne,
|
|
10
|
+
observation: $e,
|
|
11
|
+
groupContainer: ge,
|
|
12
|
+
rowContainer: he,
|
|
13
|
+
groupLabel: ye,
|
|
14
|
+
rowLabel: ve,
|
|
15
|
+
rowValue: Ae,
|
|
16
|
+
groupMembers: Ce,
|
|
17
|
+
memberRow: Me,
|
|
18
|
+
memberLabel: Te,
|
|
19
|
+
memberValue: Le,
|
|
20
|
+
abnormalValue: De,
|
|
21
|
+
commentSection: Oe,
|
|
22
|
+
commentText: Re,
|
|
23
|
+
nestedGroup: Fe,
|
|
24
|
+
nestedGroupLabel: we,
|
|
25
|
+
nestedGroupMembers: Ie
|
|
26
|
+
}, Ve = "ABNORMAL", K = (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() === Ve;
|
|
28
28
|
return { units: s, rangeString: c, isAbnormal: a };
|
|
29
29
|
}, k = ({
|
|
30
30
|
member: e,
|
|
@@ -40,7 +40,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
40
40
|
className: o.nestedGroup,
|
|
41
41
|
"data-testid": `${c}obs-nested-group-${m}-${d}`,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ n(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
className: o.nestedGroupLabel,
|
|
@@ -49,17 +49,17 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
49
49
|
children: m
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ n(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
55
|
className: o.nestedGroupMembers,
|
|
56
56
|
"data-testid": `${c}obs-nested-group-members-${m}-${d}`,
|
|
57
|
-
children: e.groupMembers?.map(($,
|
|
57
|
+
children: e.groupMembers?.map(($, v) => /* @__PURE__ */ n(
|
|
58
58
|
k,
|
|
59
59
|
{
|
|
60
60
|
member: $,
|
|
61
61
|
depth: s + 1,
|
|
62
|
-
memberIndex:
|
|
62
|
+
memberIndex: v,
|
|
63
63
|
formName: r
|
|
64
64
|
},
|
|
65
65
|
`${$.concept.uuid}`
|
|
@@ -69,7 +69,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
69
69
|
]
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
|
-
const { units: a, rangeString: b, isAbnormal: _ } =
|
|
72
|
+
const { units: a, rangeString: b, isAbnormal: _ } = K(e);
|
|
73
73
|
return /* @__PURE__ */ p(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
@@ -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: y(
|
|
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: y(
|
|
98
98
|
o.memberValue,
|
|
99
99
|
_ ? o.abnormalValue : ""
|
|
100
100
|
),
|
|
@@ -108,12 +108,12 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
108
108
|
]
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
|
-
},
|
|
111
|
+
}, Ee = ({
|
|
112
112
|
observation: e,
|
|
113
113
|
index: s,
|
|
114
114
|
formName: d = ""
|
|
115
115
|
}) => {
|
|
116
|
-
const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: m, isAbnormal: c } =
|
|
116
|
+
const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: m, isAbnormal: c } = K(e), a = d ? `${d}-` : "";
|
|
117
117
|
return /* @__PURE__ */ p(
|
|
118
118
|
"div",
|
|
119
119
|
{
|
|
@@ -129,23 +129,23 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
129
129
|
/* @__PURE__ */ p(
|
|
130
130
|
"p",
|
|
131
131
|
{
|
|
132
|
-
className:
|
|
132
|
+
className: y(
|
|
133
133
|
r ? o.groupLabel : o.rowLabel,
|
|
134
134
|
!r && c ? o.abnormalValue : ""
|
|
135
135
|
),
|
|
136
136
|
"data-testid": `${a}observation-label-${e.conceptNameToDisplay}-${s}`,
|
|
137
137
|
children: [
|
|
138
138
|
e.conceptNameToDisplay,
|
|
139
|
-
!r && m && /* @__PURE__ */
|
|
139
|
+
!r && m && /* @__PURE__ */ n("span", { className: o.rangeInfo, children: m })
|
|
140
140
|
]
|
|
141
141
|
}
|
|
142
142
|
),
|
|
143
|
-
r ? /* @__PURE__ */
|
|
143
|
+
r ? /* @__PURE__ */ n(
|
|
144
144
|
"div",
|
|
145
145
|
{
|
|
146
146
|
className: o.groupMembers,
|
|
147
147
|
"data-testid": `${a}observation-group-members-${e.conceptNameToDisplay}-${s}`,
|
|
148
|
-
children: e.groupMembers?.map((b, _) => /* @__PURE__ */
|
|
148
|
+
children: e.groupMembers?.map((b, _) => /* @__PURE__ */ n(
|
|
149
149
|
k,
|
|
150
150
|
{
|
|
151
151
|
member: b,
|
|
@@ -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: y(
|
|
163
163
|
o.rowValue,
|
|
164
164
|
c ? o.abnormalValue : ""
|
|
165
165
|
),
|
|
@@ -173,7 +173,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
173
173
|
]
|
|
174
174
|
}
|
|
175
175
|
),
|
|
176
|
-
e.comment && /* @__PURE__ */
|
|
176
|
+
e.comment && /* @__PURE__ */ n(
|
|
177
177
|
"div",
|
|
178
178
|
{
|
|
179
179
|
className: o.commentSection,
|
|
@@ -188,74 +188,82 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
188
188
|
},
|
|
189
189
|
`${e.concept.uuid}-${s}`
|
|
190
190
|
);
|
|
191
|
-
},
|
|
191
|
+
}, qe = ({
|
|
192
192
|
episodeOfCareUuids: e,
|
|
193
193
|
encounterUuids: s,
|
|
194
194
|
config: d
|
|
195
195
|
}) => {
|
|
196
|
-
const { t: r } =
|
|
196
|
+
const { t: r } = X(), u = Z(), [m, c] = q(!1), [a, b] = q(null), _ = d?.numberOfVisits, $ = ee(
|
|
197
197
|
e,
|
|
198
198
|
s
|
|
199
|
-
), {
|
|
200
|
-
data:
|
|
201
|
-
isLoading:
|
|
202
|
-
isError:
|
|
203
|
-
error:
|
|
204
|
-
|
|
199
|
+
), v = pe(), {
|
|
200
|
+
data: A = [],
|
|
201
|
+
isLoading: L,
|
|
202
|
+
isError: D,
|
|
203
|
+
error: j,
|
|
204
|
+
refetch: H
|
|
205
|
+
} = g({
|
|
205
206
|
queryKey: ["forms", u, e],
|
|
206
|
-
queryFn: () =>
|
|
207
|
+
queryFn: () => re(u, void 0, _),
|
|
207
208
|
enabled: !!u && !$
|
|
208
|
-
}),
|
|
209
|
-
(
|
|
210
|
-
), [
|
|
209
|
+
}), O = N(() => !s || s.length === 0 ? A : A.filter(
|
|
210
|
+
(t) => s.includes(t.encounterUuid)
|
|
211
|
+
), [A, s]), { data: R = [] } = g({
|
|
211
212
|
queryKey: ["observationForms"],
|
|
212
|
-
queryFn: () =>
|
|
213
|
-
}),
|
|
214
|
-
(
|
|
215
|
-
[
|
|
216
|
-
),
|
|
213
|
+
queryFn: () => ae()
|
|
214
|
+
}), F = h(
|
|
215
|
+
(t) => R.find((l) => l.name === t)?.uuid,
|
|
216
|
+
[R]
|
|
217
|
+
), C = N(() => {
|
|
217
218
|
if (a)
|
|
218
|
-
return
|
|
219
|
-
}, [a,
|
|
220
|
-
data:
|
|
221
|
-
isLoading:
|
|
222
|
-
error:
|
|
223
|
-
} =
|
|
224
|
-
queryKey: ["formMetadata",
|
|
225
|
-
queryFn: () =>
|
|
226
|
-
enabled: !!
|
|
219
|
+
return F(a.formName);
|
|
220
|
+
}, [a, F]), {
|
|
221
|
+
data: Se,
|
|
222
|
+
isLoading: P,
|
|
223
|
+
error: w
|
|
224
|
+
} = g({
|
|
225
|
+
queryKey: ["formMetadata", C],
|
|
226
|
+
queryFn: () => oe(C),
|
|
227
|
+
enabled: !!C && m
|
|
227
228
|
}), {
|
|
228
229
|
data: M,
|
|
229
|
-
isLoading:
|
|
230
|
-
error:
|
|
231
|
-
} =
|
|
230
|
+
isLoading: Q,
|
|
231
|
+
error: I
|
|
232
|
+
} = g({
|
|
232
233
|
queryKey: ["formsEncounter", a?.encounterUuid],
|
|
233
|
-
queryFn: () =>
|
|
234
|
+
queryFn: () => te(a.encounterUuid, !0),
|
|
234
235
|
enabled: !!a?.encounterUuid && m
|
|
235
|
-
})
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
});
|
|
237
|
+
ne(
|
|
238
|
+
(t) => {
|
|
239
|
+
t.patientUUID === u && t.updatedConcepts.size > 0 && (H(), v.invalidateQueries({ queryKey: ["formsEncounter"] }));
|
|
240
|
+
},
|
|
241
|
+
[u]
|
|
242
|
+
);
|
|
243
|
+
const V = N(() => !M?.observations || !a?.formName ? [] : M.observations.filter(
|
|
244
|
+
(t) => "formFieldPath" in t && typeof t.formFieldPath == "string" && t.formFieldPath.includes(a.formName)
|
|
245
|
+
), [M?.observations, a?.formName]), E = N(
|
|
238
246
|
() => [
|
|
239
247
|
{ key: "recordedOn", header: r("FORM_RECORDED_ON") },
|
|
240
248
|
{ key: "recordedBy", header: r("FORM_RECORDED_BY") }
|
|
241
249
|
],
|
|
242
250
|
[r]
|
|
243
|
-
),
|
|
251
|
+
), Y = N(
|
|
244
252
|
() => [
|
|
245
253
|
{ key: "recordedOn", sortable: !0 },
|
|
246
254
|
{ key: "recordedBy", sortable: !0 }
|
|
247
255
|
],
|
|
248
256
|
[]
|
|
249
|
-
),
|
|
250
|
-
const
|
|
257
|
+
), S = N(() => {
|
|
258
|
+
const t = O.reduce(
|
|
251
259
|
(l, i) => {
|
|
252
260
|
const f = i.formName;
|
|
253
261
|
l[f] ??= [];
|
|
254
|
-
const T = i.providers.map((
|
|
262
|
+
const T = i.providers.map((W) => W.providerName).filter(Boolean).join(", ");
|
|
255
263
|
return l[f].push({
|
|
256
264
|
id: i.encounterUuid,
|
|
257
265
|
formName: i.formName,
|
|
258
|
-
recordedOn:
|
|
266
|
+
recordedOn: se(i.encounterDateTime, r, ue).formattedResult,
|
|
259
267
|
recordedBy: T ?? "--",
|
|
260
268
|
encounterDateTime: i.encounterDateTime,
|
|
261
269
|
encounterUuid: i.encounterUuid
|
|
@@ -263,7 +271,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
263
271
|
},
|
|
264
272
|
{}
|
|
265
273
|
);
|
|
266
|
-
return Object.entries(
|
|
274
|
+
return Object.entries(t).map(
|
|
267
275
|
([l, i]) => ({
|
|
268
276
|
formName: l,
|
|
269
277
|
records: i.sort(
|
|
@@ -271,57 +279,57 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
271
279
|
)
|
|
272
280
|
})
|
|
273
281
|
).sort((l, i) => l.formName.localeCompare(i.formName));
|
|
274
|
-
}, [
|
|
275
|
-
b(
|
|
276
|
-
}, []),
|
|
282
|
+
}, [O, r]), B = h((t) => {
|
|
283
|
+
b(t), c(!0);
|
|
284
|
+
}, []), z = h(() => {
|
|
277
285
|
c(!1), b(null);
|
|
278
|
-
}, []),
|
|
279
|
-
(
|
|
286
|
+
}, []), G = h(
|
|
287
|
+
(t, l) => {
|
|
280
288
|
switch (l) {
|
|
281
289
|
case "recordedOn":
|
|
282
|
-
return /* @__PURE__ */
|
|
290
|
+
return /* @__PURE__ */ n(me, { onClick: () => B(t), children: t.recordedOn });
|
|
283
291
|
case "recordedBy":
|
|
284
|
-
return
|
|
292
|
+
return t.recordedBy;
|
|
285
293
|
default:
|
|
286
294
|
return null;
|
|
287
295
|
}
|
|
288
296
|
},
|
|
289
|
-
[
|
|
297
|
+
[B]
|
|
290
298
|
);
|
|
291
|
-
return /* @__PURE__ */ p(
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
|
|
299
|
+
return /* @__PURE__ */ p(J, { children: [
|
|
300
|
+
/* @__PURE__ */ n("div", { "data-testid": "forms-table", children: L || D || S.length === 0 || $ ? /* @__PURE__ */ n(
|
|
301
|
+
U,
|
|
294
302
|
{
|
|
295
|
-
headers:
|
|
303
|
+
headers: E,
|
|
296
304
|
ariaLabel: r("FORMS_HEADING"),
|
|
297
305
|
rows: [],
|
|
298
|
-
loading:
|
|
299
|
-
errorStateMessage:
|
|
306
|
+
loading: L,
|
|
307
|
+
errorStateMessage: D ? j?.message : void 0,
|
|
300
308
|
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
301
|
-
renderCell:
|
|
309
|
+
renderCell: G,
|
|
302
310
|
className: o.formsTableBody,
|
|
303
311
|
dataTestId: "forms-table"
|
|
304
312
|
}
|
|
305
|
-
) : /* @__PURE__ */
|
|
306
|
-
const { formName: i, records: f } =
|
|
307
|
-
return /* @__PURE__ */
|
|
308
|
-
|
|
313
|
+
) : /* @__PURE__ */ n(de, { align: "start", children: S.map((t, l) => {
|
|
314
|
+
const { formName: i, records: f } = t;
|
|
315
|
+
return /* @__PURE__ */ n(
|
|
316
|
+
ie,
|
|
309
317
|
{
|
|
310
318
|
title: i,
|
|
311
319
|
className: o.customAccordianItem,
|
|
312
320
|
testId: `accordian-title-${i}`,
|
|
313
321
|
open: l === 0,
|
|
314
|
-
children: /* @__PURE__ */
|
|
315
|
-
|
|
322
|
+
children: /* @__PURE__ */ n(
|
|
323
|
+
U,
|
|
316
324
|
{
|
|
317
|
-
headers:
|
|
325
|
+
headers: E,
|
|
318
326
|
ariaLabel: r("FORMS_HEADING"),
|
|
319
327
|
rows: f,
|
|
320
328
|
loading: !1,
|
|
321
329
|
errorStateMessage: "",
|
|
322
|
-
sortable:
|
|
330
|
+
sortable: Y,
|
|
323
331
|
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
324
|
-
renderCell:
|
|
332
|
+
renderCell: G,
|
|
325
333
|
className: o.formsTableBody,
|
|
326
334
|
dataTestId: `forms-table-${i}`
|
|
327
335
|
}
|
|
@@ -330,30 +338,30 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
330
338
|
i
|
|
331
339
|
);
|
|
332
340
|
}) }) }),
|
|
333
|
-
m && a && /* @__PURE__ */
|
|
334
|
-
|
|
341
|
+
m && a && /* @__PURE__ */ n(
|
|
342
|
+
le,
|
|
335
343
|
{
|
|
336
344
|
id: "modalIdForActionAreaLayout",
|
|
337
345
|
open: m,
|
|
338
|
-
onRequestClose:
|
|
346
|
+
onRequestClose: z,
|
|
339
347
|
modalHeading: a.formName,
|
|
340
348
|
modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
|
|
341
349
|
passiveModal: !0,
|
|
342
350
|
size: "md",
|
|
343
351
|
testId: "form-details-modal",
|
|
344
|
-
children: /* @__PURE__ */
|
|
345
|
-
|
|
352
|
+
children: /* @__PURE__ */ n("div", { className: o.formContent, children: P || Q ? /* @__PURE__ */ n(ce, { width: "100%", lineCount: 3 }) : w ? /* @__PURE__ */ n("div", { children: x(w).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : I ? /* @__PURE__ */ n("div", { children: x(I).message ?? r("ERROR_FETCHING_FORM_DATA") }) : V.length > 0 ? /* @__PURE__ */ n("div", { className: o.formDetailsContainer, children: V.map((t, l) => /* @__PURE__ */ n(
|
|
353
|
+
Ee,
|
|
346
354
|
{
|
|
347
|
-
observation:
|
|
355
|
+
observation: t,
|
|
348
356
|
index: l,
|
|
349
357
|
formName: a.formName
|
|
350
358
|
},
|
|
351
|
-
`${
|
|
352
|
-
)) }) : /* @__PURE__ */
|
|
359
|
+
`${t.concept.uuid}`
|
|
360
|
+
)) }) : /* @__PURE__ */ n("div", { children: r("NO_FORM_DATA_AVAILABLE") }) })
|
|
353
361
|
}
|
|
354
362
|
)
|
|
355
363
|
] });
|
|
356
364
|
};
|
|
357
365
|
export {
|
|
358
|
-
|
|
366
|
+
qe as default
|
|
359
367
|
};
|
|
@@ -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 { l as d, m as f, n as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BBeTDdWD.js";
|
|
2
|
+
import { l as d, m as f, n as e } from "./index-B6DRKpTQ.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 { l as v, m as C, n as e } from "./index-
|
|
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-BBeTDdWD.js";
|
|
2
|
+
import { l as v, m as C, n as e } from "./index-B6DRKpTQ.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { jsxs as I, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { h as q, p as B, u as N, j as Q, F as x, e as H, d as K, Q as M, f as j, k as w, A as G, J as P, H as S, X, P as J, L as Y, M as z, x as W } from "./index-B6DRKpTQ.js";
|
|
3
|
+
import { useQueries as Z, useQuery as ee } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as te, useEffect as T, useMemo as h } from "react";
|
|
5
|
+
const A = (t, d, i, l, s) => {
|
|
6
|
+
const a = X(t, d), r = a.value, o = J(r);
|
|
7
|
+
let n = r;
|
|
8
|
+
o === "Image" && (n = /* @__PURE__ */ c(z, { imageSrc: r, alt: r, id: `${r}-img` })), o === "Video" && (n = /* @__PURE__ */ c(W, { id: `${r}-video`, videoSrc: r }));
|
|
9
|
+
const b = s("OBSERVATIONS_RECORDED_BY", {
|
|
10
|
+
provider: a.provider
|
|
11
|
+
}), m = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${m}-${i}-${d}` : `${v}-${m}-${i}-${d}`;
|
|
12
|
+
return /* @__PURE__ */ c(
|
|
13
|
+
Y,
|
|
14
|
+
{
|
|
15
|
+
header: a.header,
|
|
16
|
+
value: n,
|
|
17
|
+
info: b,
|
|
18
|
+
id: u,
|
|
19
|
+
testId: u,
|
|
20
|
+
ariaLabel: u
|
|
21
|
+
},
|
|
22
|
+
`obs-${t.id}`
|
|
23
|
+
);
|
|
24
|
+
}, ae = (t, d, i, l, s, a) => /* @__PURE__ */ c(
|
|
25
|
+
S,
|
|
26
|
+
{
|
|
27
|
+
title: t.display,
|
|
28
|
+
id: `grouped-obs-${t.display}-${l}`,
|
|
29
|
+
open: i,
|
|
30
|
+
children: t.members?.map(
|
|
31
|
+
(r, o) => A(r, o, s, a, d)
|
|
32
|
+
)
|
|
33
|
+
},
|
|
34
|
+
`grouped-obs-${t.id}`
|
|
35
|
+
), se = ({
|
|
36
|
+
groupedData: t,
|
|
37
|
+
title: d = ""
|
|
38
|
+
}) => {
|
|
39
|
+
const { t: i } = N(), l = (s, a, r) => {
|
|
40
|
+
const o = P(s.encounterDetails, i);
|
|
41
|
+
return /* @__PURE__ */ I(
|
|
42
|
+
S,
|
|
43
|
+
{
|
|
44
|
+
title: o,
|
|
45
|
+
id: `encounter-${s.encounterId}`,
|
|
46
|
+
open: a,
|
|
47
|
+
children: [
|
|
48
|
+
s.observations.map(
|
|
49
|
+
(n, b) => A(n, b, r, d, i)
|
|
50
|
+
),
|
|
51
|
+
s.groupedObservations.map(
|
|
52
|
+
(n, b) => ae(
|
|
53
|
+
n,
|
|
54
|
+
i,
|
|
55
|
+
a,
|
|
56
|
+
b,
|
|
57
|
+
r,
|
|
58
|
+
d
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
`encounter-${s.encounterId}`
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ c(
|
|
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: t.map(
|
|
73
|
+
(s, a) => l(s, a === 0, a)
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}, re = "_observations_kfbhq_1", oe = "_title_kfbhq_12", $ = {
|
|
78
|
+
observations: re,
|
|
79
|
+
title: oe
|
|
80
|
+
}, ie = (t) => ["conceptUuid", t], ne = (t, d) => ["observations", t, ...d], be = ({ config: t }) => {
|
|
81
|
+
const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, s = te(/* @__PURE__ */ new Set()), a = q(), { addNotification: r } = B(), { t: o } = N(), n = Z({
|
|
82
|
+
queries: i.map((e) => ({
|
|
83
|
+
queryKey: ie(e),
|
|
84
|
+
queryFn: () => Q(e),
|
|
85
|
+
enabled: !!e
|
|
86
|
+
}))
|
|
87
|
+
});
|
|
88
|
+
T(() => {
|
|
89
|
+
n.forEach((e, p) => {
|
|
90
|
+
if (e.isError && !s.current.has(p)) {
|
|
91
|
+
const V = i[p];
|
|
92
|
+
r({
|
|
93
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
94
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: V }),
|
|
95
|
+
type: "error"
|
|
96
|
+
}), s.current.add(p);
|
|
97
|
+
} else e.isError || s.current.delete(p);
|
|
98
|
+
});
|
|
99
|
+
}, [n, i]);
|
|
100
|
+
const b = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), m = h(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), v = h(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
|
|
101
|
+
data: u,
|
|
102
|
+
isLoading: F,
|
|
103
|
+
isError: R,
|
|
104
|
+
refetch: f
|
|
105
|
+
} = ee({
|
|
106
|
+
queryKey: ne(a, m),
|
|
107
|
+
queryFn: () => x(a, m),
|
|
108
|
+
enabled: !!a && m.length > 0 && v
|
|
109
|
+
});
|
|
110
|
+
H(
|
|
111
|
+
(e) => {
|
|
112
|
+
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
113
|
+
(p) => m.includes(p)
|
|
114
|
+
) && f();
|
|
115
|
+
},
|
|
116
|
+
[a, f]
|
|
117
|
+
), T(() => {
|
|
118
|
+
R && r({
|
|
119
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
120
|
+
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
121
|
+
type: "error"
|
|
122
|
+
});
|
|
123
|
+
}, [R]);
|
|
124
|
+
const g = h(() => {
|
|
125
|
+
if (!u) return [];
|
|
126
|
+
const e = K(u), p = M(e);
|
|
127
|
+
return j(p);
|
|
128
|
+
}, [u]), L = [
|
|
129
|
+
{ key: "name", header: "name" },
|
|
130
|
+
{ key: "value", header: "value" },
|
|
131
|
+
{ key: "form", header: "form" }
|
|
132
|
+
], O = F || !v, _ = R && v, D = (!u || u.entry?.length === 0 || m.length === 0) && v, U = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, k = D ? o("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
|
|
133
|
+
return /* @__PURE__ */ I(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
id: "observations",
|
|
137
|
+
"data-testid": E ? `observations-${y}` : "observations",
|
|
138
|
+
"aria-label": "observations-aria-label",
|
|
139
|
+
className: $.observations,
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ c(
|
|
142
|
+
w,
|
|
143
|
+
{
|
|
144
|
+
id: "observations-title",
|
|
145
|
+
testId: E ? `observations-title-${y}` : "observations-title",
|
|
146
|
+
title: y,
|
|
147
|
+
className: $.title,
|
|
148
|
+
children: /* @__PURE__ */ c("p", { children: y })
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
C ? /* @__PURE__ */ c(se, { groupedData: g, title: y }) : /* @__PURE__ */ c(
|
|
152
|
+
G,
|
|
153
|
+
{
|
|
154
|
+
headers: L,
|
|
155
|
+
rows: [],
|
|
156
|
+
ariaLabel: o("OBSERVATIONS"),
|
|
157
|
+
loading: O,
|
|
158
|
+
errorStateMessage: U,
|
|
159
|
+
emptyStateMessage: k,
|
|
160
|
+
dataTestId: "observations-table"
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
export {
|
|
168
|
+
ie as conceptUuidQueryKeys,
|
|
169
|
+
be as default,
|
|
170
|
+
ne as observationsQueryKeys
|
|
171
|
+
};
|