@bahmni/registration-app 0.0.1-dev.154 → 0.0.1-dev.156
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-B7fyRiO9-CqIqxQxv.js → FormsTable-CmVblWCC-CmpEOuuB.js} +69 -69
- package/dist/{LNWAZHJI-DQca0YzR.js → LNWAZHJI-Dnwa9ZNT.js} +7 -7
- package/dist/{MWZ6AO7Z-BqTgzSBg.js → MWZ6AO7Z-B7OaZ-U0.js} +2 -2
- package/dist/{Observations-CDp0Y3q7-CCTVrL6R.js → Observations-CoVHnDN6-Buwmag_q.js} +28 -28
- package/dist/{YPM2AS64-BQ-mXMla.js → YPM2AS64-DlUseWwO.js} +181 -181
- package/dist/{index-R6hQf4_0.js → index-Bz19Sm8s.js} +17071 -17050
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as s, jsxs as p, Fragment as
|
|
2
|
-
import { u as ee, h as re, w as ae,
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useState as K, useMemo as
|
|
5
|
-
const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18",
|
|
1
|
+
import { jsx as s, jsxs as p, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { u as ee, h as re, w as ae, J as te, Y as oe, G as ne, K as se, e as de, i as me, C as ie, z as U, a as le, b as ce, c as ue, M as be, V as q, d as pe, g as _e, f as L, F as fe, N as $e, j as ge, U as ve } from "./index-Bz19Sm8s.js";
|
|
3
|
+
import { useQueryClient as he, useQuery as C } from "@tanstack/react-query";
|
|
4
|
+
import { useState as K, useMemo as h, useCallback as A } from "react";
|
|
5
|
+
const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Ae = "_formDetailsContainer_1pd36_25", Le = "_observation_1pd36_30", Re = "_groupContainer_1pd36_39", Fe = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Ve = "_rowValue_1pd36_67", Ie = "_groupMembers_1pd36_75", Te = "_memberRow_1pd36_81", Se = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", De = "_abnormalValue_1pd36_102", Ge = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", xe = "_nestedGroup_1pd36_125", Be = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
|
|
6
6
|
formsTableBody: Ne,
|
|
7
7
|
customAccordianItem: ye,
|
|
8
8
|
formContent: Ce,
|
|
9
|
-
formDetailsContainer:
|
|
10
|
-
observation:
|
|
11
|
-
groupContainer:
|
|
12
|
-
rowContainer:
|
|
13
|
-
groupLabel:
|
|
14
|
-
rowLabel:
|
|
15
|
-
rowValue:
|
|
9
|
+
formDetailsContainer: Ae,
|
|
10
|
+
observation: Le,
|
|
11
|
+
groupContainer: Re,
|
|
12
|
+
rowContainer: Fe,
|
|
13
|
+
groupLabel: Me,
|
|
14
|
+
rowLabel: Oe,
|
|
15
|
+
rowValue: Ve,
|
|
16
16
|
groupMembers: Ie,
|
|
17
17
|
memberRow: Te,
|
|
18
18
|
memberLabel: Se,
|
|
19
19
|
memberValue: we,
|
|
20
|
-
abnormalValue:
|
|
21
|
-
commentSection:
|
|
20
|
+
abnormalValue: De,
|
|
21
|
+
commentSection: Ge,
|
|
22
22
|
commentText: Ee,
|
|
23
|
-
nestedGroup:
|
|
23
|
+
nestedGroup: xe,
|
|
24
24
|
nestedGroupLabel: Be,
|
|
25
25
|
nestedGroupMembers: Ue
|
|
26
26
|
}, k = (e) => {
|
|
@@ -32,11 +32,11 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
32
32
|
alt: e,
|
|
33
33
|
id: `${e}-img`
|
|
34
34
|
}
|
|
35
|
-
) : r === "Video" ? /* @__PURE__ */ s(
|
|
35
|
+
) : r === "Video" ? /* @__PURE__ */ s(ge, { id: `${e}-video`, videoSrc: e }) : e;
|
|
36
36
|
}, H = (e) => {
|
|
37
37
|
const r = e.observationValue?.unit, n = e.observationValue?.referenceRange?.low?.value, a = e.observationValue?.referenceRange?.high?.value, d = n != null, c = a != null, m = d && c ? ` (${n} - ${a})` : d ? ` (>${n})` : c ? ` (<${a})` : "", t = e.observationValue?.isAbnormal === !0;
|
|
38
38
|
return { units: r, rangeString: m, isAbnormal: t };
|
|
39
|
-
},
|
|
39
|
+
}, P = ({
|
|
40
40
|
member: e,
|
|
41
41
|
depth: r = 0,
|
|
42
42
|
memberIndex: n = 0,
|
|
@@ -66,7 +66,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
66
66
|
className: o.nestedGroupMembers,
|
|
67
67
|
"data-testid": `${t}obs-nested-group-members-${m}-${n}`,
|
|
68
68
|
children: e.members?.map((N, y) => /* @__PURE__ */ s(
|
|
69
|
-
|
|
69
|
+
P,
|
|
70
70
|
{
|
|
71
71
|
member: N,
|
|
72
72
|
depth: r + 1,
|
|
@@ -80,8 +80,8 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
80
80
|
]
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
|
-
const { units: b, rangeString:
|
|
84
|
-
return /* @__PURE__ */ p(
|
|
83
|
+
const { units: b, rangeString: g, isAbnormal: _ } = H(e), f = e.observationValue?.value?.toString(), $ = f ? k(f) : null;
|
|
84
|
+
return /* @__PURE__ */ p(j, { children: [
|
|
85
85
|
/* @__PURE__ */ p(
|
|
86
86
|
"div",
|
|
87
87
|
{
|
|
@@ -92,21 +92,21 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
92
92
|
/* @__PURE__ */ p(
|
|
93
93
|
"p",
|
|
94
94
|
{
|
|
95
|
-
className:
|
|
95
|
+
className: L(
|
|
96
96
|
o.memberLabel,
|
|
97
97
|
_ ? o.abnormalValue : ""
|
|
98
98
|
),
|
|
99
99
|
"data-testid": `${t}obs-member-label-${m}-${n}`,
|
|
100
100
|
children: [
|
|
101
101
|
m,
|
|
102
|
-
|
|
102
|
+
g
|
|
103
103
|
]
|
|
104
104
|
}
|
|
105
105
|
),
|
|
106
106
|
/* @__PURE__ */ p(
|
|
107
107
|
"div",
|
|
108
108
|
{
|
|
109
|
-
className:
|
|
109
|
+
className: L(
|
|
110
110
|
o.memberValue,
|
|
111
111
|
_ ? o.abnormalValue : ""
|
|
112
112
|
),
|
|
@@ -139,7 +139,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
139
139
|
formName: n = "",
|
|
140
140
|
comment: a
|
|
141
141
|
}) => {
|
|
142
|
-
const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = H(e), b = n ? `${n}-` : "",
|
|
142
|
+
const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = H(e), b = n ? `${n}-` : "", g = e.observationValue?.value?.toString(), _ = g ? k(g) : null;
|
|
143
143
|
return /* @__PURE__ */ p(
|
|
144
144
|
"div",
|
|
145
145
|
{
|
|
@@ -155,7 +155,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
155
155
|
/* @__PURE__ */ p(
|
|
156
156
|
"p",
|
|
157
157
|
{
|
|
158
|
-
className:
|
|
158
|
+
className: L(
|
|
159
159
|
d ? o.groupLabel : o.rowLabel,
|
|
160
160
|
!d && t ? o.abnormalValue : ""
|
|
161
161
|
),
|
|
@@ -172,7 +172,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
172
172
|
className: o.groupMembers,
|
|
173
173
|
"data-testid": `${b}observation-group-members-${e.display}-${r}`,
|
|
174
174
|
children: e.members?.map((f, $) => /* @__PURE__ */ s(
|
|
175
|
-
|
|
175
|
+
P,
|
|
176
176
|
{
|
|
177
177
|
member: f,
|
|
178
178
|
depth: 0,
|
|
@@ -185,7 +185,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
185
185
|
) : /* @__PURE__ */ p(
|
|
186
186
|
"div",
|
|
187
187
|
{
|
|
188
|
-
className:
|
|
188
|
+
className: L(
|
|
189
189
|
o.rowValue,
|
|
190
190
|
t ? o.abnormalValue : ""
|
|
191
191
|
),
|
|
@@ -216,14 +216,14 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
216
216
|
);
|
|
217
217
|
}, Ke = (e) => e ? e.extension?.find(
|
|
218
218
|
(r) => r.url === ve
|
|
219
|
-
)?.valueString : void 0,
|
|
219
|
+
)?.valueString : void 0, je = (e) => {
|
|
220
220
|
if (e)
|
|
221
221
|
return e.note?.[0]?.text;
|
|
222
|
-
}, ke = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource,
|
|
222
|
+
}, ke = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, O = (e, r) => {
|
|
223
223
|
const n = ke(e, r);
|
|
224
224
|
return n ? {
|
|
225
225
|
formFieldPath: Ke(n),
|
|
226
|
-
comment:
|
|
226
|
+
comment: je(n)
|
|
227
227
|
} : {};
|
|
228
228
|
}, He = (e, r) => {
|
|
229
229
|
if (!e?.entry || !r)
|
|
@@ -231,58 +231,58 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
231
231
|
const n = pe(e);
|
|
232
232
|
return [
|
|
233
233
|
...n.observations.map((a) => {
|
|
234
|
-
const { formFieldPath: d, comment: c } =
|
|
234
|
+
const { formFieldPath: d, comment: c } = O(
|
|
235
235
|
e,
|
|
236
236
|
a.id
|
|
237
237
|
);
|
|
238
238
|
return { obs: a, formFieldPath: d, comment: c };
|
|
239
239
|
}),
|
|
240
240
|
...n.groupedObservations.flatMap((a) => {
|
|
241
|
-
const { formFieldPath: d } =
|
|
241
|
+
const { formFieldPath: d } = O(e, a.id);
|
|
242
242
|
return (a.members ?? []).map((c) => {
|
|
243
|
-
const { comment: m } =
|
|
243
|
+
const { comment: m } = O(e, c.id);
|
|
244
244
|
return { obs: c, formFieldPath: d, comment: m };
|
|
245
245
|
});
|
|
246
246
|
})
|
|
247
247
|
].filter(
|
|
248
248
|
({ formFieldPath: a }) => !a || a.includes(r)
|
|
249
249
|
);
|
|
250
|
-
},
|
|
250
|
+
}, Je = ({
|
|
251
251
|
episodeOfCareUuids: e,
|
|
252
252
|
encounterUuids: r,
|
|
253
253
|
config: n
|
|
254
254
|
}) => {
|
|
255
|
-
const { t: a } = ee(), d = re(), [c, m] = K(!1), [t, b] = K(null),
|
|
255
|
+
const { t: a } = ee(), d = re(), [c, m] = K(!1), [t, b] = K(null), g = n?.numberOfVisits, _ = ae(
|
|
256
256
|
e,
|
|
257
257
|
r
|
|
258
|
-
), f =
|
|
258
|
+
), f = he(), {
|
|
259
259
|
data: $ = [],
|
|
260
260
|
isLoading: N,
|
|
261
261
|
isError: y,
|
|
262
|
-
error:
|
|
263
|
-
refetch:
|
|
262
|
+
error: z,
|
|
263
|
+
refetch: Y
|
|
264
264
|
} = C({
|
|
265
265
|
queryKey: ["forms", d, e],
|
|
266
|
-
queryFn: () => te(d, void 0,
|
|
266
|
+
queryFn: () => te(d, void 0, g),
|
|
267
267
|
enabled: !!d && !_
|
|
268
|
-
}),
|
|
268
|
+
}), V = h(() => !r || r.length === 0 ? $ : $.filter(
|
|
269
269
|
(i) => r.includes(i.encounterUuid)
|
|
270
270
|
), [$, r]), { data: I = [] } = C({
|
|
271
271
|
queryKey: ["observationForms"],
|
|
272
272
|
queryFn: () => oe()
|
|
273
|
-
}), T =
|
|
273
|
+
}), T = A(
|
|
274
274
|
(i) => I.find((u) => u.name === i)?.uuid,
|
|
275
275
|
[I]
|
|
276
|
-
),
|
|
276
|
+
), R = h(() => {
|
|
277
277
|
if (t)
|
|
278
278
|
return T(t.formName);
|
|
279
279
|
}, [t, T]), { isLoading: Q, error: S } = C({
|
|
280
|
-
queryKey: ["formMetadata",
|
|
281
|
-
queryFn: () => ne(
|
|
282
|
-
enabled: !!
|
|
280
|
+
queryKey: ["formMetadata", R],
|
|
281
|
+
queryFn: () => ne(R),
|
|
282
|
+
enabled: !!R && c
|
|
283
283
|
}), {
|
|
284
|
-
data:
|
|
285
|
-
isLoading:
|
|
284
|
+
data: F,
|
|
285
|
+
isLoading: J,
|
|
286
286
|
error: w
|
|
287
287
|
} = C({
|
|
288
288
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
@@ -291,36 +291,36 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
291
291
|
});
|
|
292
292
|
de(
|
|
293
293
|
(i) => {
|
|
294
|
-
i.patientUUID === d && i.updatedConcepts.size > 0 && (
|
|
294
|
+
i.patientUUID === d && i.updatedConcepts.size > 0 && (Y(), f.invalidateQueries({ queryKey: ["formsEncounter"] }));
|
|
295
295
|
},
|
|
296
296
|
[d]
|
|
297
297
|
);
|
|
298
|
-
const
|
|
299
|
-
|
|
298
|
+
const D = h(() => !F || !t?.formName ? [] : He(
|
|
299
|
+
F,
|
|
300
300
|
t.formName
|
|
301
|
-
), [
|
|
301
|
+
), [F, t?.formName]), G = h(
|
|
302
302
|
() => [
|
|
303
303
|
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
304
304
|
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
305
305
|
],
|
|
306
306
|
[a]
|
|
307
|
-
), X =
|
|
307
|
+
), X = h(
|
|
308
308
|
() => [
|
|
309
309
|
{ key: "recordedOn", sortable: !0 },
|
|
310
310
|
{ key: "recordedBy", sortable: !0 }
|
|
311
311
|
],
|
|
312
312
|
[]
|
|
313
|
-
), E =
|
|
314
|
-
const i =
|
|
313
|
+
), E = h(() => {
|
|
314
|
+
const i = V.reduce(
|
|
315
315
|
(u, l) => {
|
|
316
316
|
const v = l.formName;
|
|
317
317
|
u[v] ??= [];
|
|
318
|
-
const
|
|
318
|
+
const M = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
|
|
319
319
|
return u[v].push({
|
|
320
320
|
id: l.encounterUuid,
|
|
321
321
|
formName: l.formName,
|
|
322
322
|
recordedOn: me(l.encounterDateTime, a, _e).formattedResult,
|
|
323
|
-
recordedBy:
|
|
323
|
+
recordedBy: M ?? "--",
|
|
324
324
|
encounterDateTime: l.encounterDateTime,
|
|
325
325
|
encounterUuid: l.encounterUuid
|
|
326
326
|
}), u;
|
|
@@ -331,36 +331,36 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
331
331
|
([u, l]) => ({
|
|
332
332
|
formName: u,
|
|
333
333
|
records: l.sort(
|
|
334
|
-
(v,
|
|
334
|
+
(v, M) => M.encounterDateTime - v.encounterDateTime
|
|
335
335
|
)
|
|
336
336
|
})
|
|
337
337
|
).sort((u, l) => u.formName.localeCompare(l.formName));
|
|
338
|
-
}, [
|
|
338
|
+
}, [V, a]), x = A((i) => {
|
|
339
339
|
b(i), m(!0);
|
|
340
|
-
}, []),
|
|
340
|
+
}, []), W = A(() => {
|
|
341
341
|
m(!1), b(null);
|
|
342
|
-
}, []), B =
|
|
342
|
+
}, []), B = A(
|
|
343
343
|
(i, u) => {
|
|
344
344
|
switch (u) {
|
|
345
345
|
case "recordedOn":
|
|
346
|
-
return /* @__PURE__ */ s(ie, { onClick: () =>
|
|
346
|
+
return /* @__PURE__ */ s(ie, { onClick: () => x(i), children: i.recordedOn });
|
|
347
347
|
case "recordedBy":
|
|
348
348
|
return i.recordedBy;
|
|
349
349
|
default:
|
|
350
350
|
return null;
|
|
351
351
|
}
|
|
352
352
|
},
|
|
353
|
-
[
|
|
353
|
+
[x]
|
|
354
354
|
);
|
|
355
|
-
return /* @__PURE__ */ p(
|
|
355
|
+
return /* @__PURE__ */ p(j, { children: [
|
|
356
356
|
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: N || y || E.length === 0 || _ ? /* @__PURE__ */ s(
|
|
357
357
|
U,
|
|
358
358
|
{
|
|
359
|
-
headers:
|
|
359
|
+
headers: G,
|
|
360
360
|
ariaLabel: a("FORMS_HEADING"),
|
|
361
361
|
rows: [],
|
|
362
362
|
loading: N,
|
|
363
|
-
errorStateMessage: y ?
|
|
363
|
+
errorStateMessage: y ? z?.message : void 0,
|
|
364
364
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
365
365
|
renderCell: B,
|
|
366
366
|
className: o.formsTableBody,
|
|
@@ -378,7 +378,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
378
378
|
children: /* @__PURE__ */ s(
|
|
379
379
|
U,
|
|
380
380
|
{
|
|
381
|
-
headers:
|
|
381
|
+
headers: G,
|
|
382
382
|
ariaLabel: a("FORMS_HEADING"),
|
|
383
383
|
rows: v,
|
|
384
384
|
loading: !1,
|
|
@@ -399,13 +399,13 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
399
399
|
{
|
|
400
400
|
id: "modalIdForActionAreaLayout",
|
|
401
401
|
open: c,
|
|
402
|
-
onRequestClose:
|
|
402
|
+
onRequestClose: W,
|
|
403
403
|
modalHeading: t.formName,
|
|
404
404
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
405
405
|
passiveModal: !0,
|
|
406
406
|
size: "md",
|
|
407
407
|
testId: "form-details-modal",
|
|
408
|
-
children: /* @__PURE__ */ s("div", { className: o.formContent, children: Q ||
|
|
408
|
+
children: /* @__PURE__ */ s("div", { className: o.formContent, children: Q || J ? /* @__PURE__ */ s(be, { width: "100%", lineCount: 3 }) : S ? /* @__PURE__ */ s("div", { children: q(S).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ s("div", { children: q(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : D.length > 0 ? /* @__PURE__ */ s("div", { className: o.formDetailsContainer, children: D.map(({ obs: i, comment: u }, l) => /* @__PURE__ */ s(
|
|
409
409
|
qe,
|
|
410
410
|
{
|
|
411
411
|
observation: i,
|
|
@@ -420,5 +420,5 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
420
420
|
] });
|
|
421
421
|
};
|
|
422
422
|
export {
|
|
423
|
-
|
|
423
|
+
Je as default
|
|
424
424
|
};
|
|
@@ -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 { l as d, m as f,
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DlUseWwO.js";
|
|
2
|
+
import { l as d, m as f, o as e } from "./index-Bz19Sm8s.js";
|
|
3
3
|
var p = (a) => {
|
|
4
|
-
const [r,
|
|
4
|
+
const [r, o] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
6
|
}), n = d(), s = f(() => {
|
|
7
|
-
const
|
|
8
|
-
return
|
|
7
|
+
const t = r.theme_preference || l;
|
|
8
|
+
return t !== "system" ? t : 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: o,
|
|
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: o
|
|
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 { l as v, m 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-DlUseWwO.js";
|
|
2
|
+
import { l as v, m as C, o as e } from "./index-Bz19Sm8s.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { h as
|
|
1
|
+
import { jsxs as T, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { h as B, p as V, u as I, q as x, W as K, e as w, d as z, r as G, n as Q, A as j, z as H, k as M, x as S, t as W, F as P, D as X, N as Y, j as J } from "./index-Bz19Sm8s.js";
|
|
3
3
|
import { useQueries as Z, useQuery as ee } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as te, useEffect as
|
|
4
|
+
import { useRef as te, useEffect as $, useMemo as h } from "react";
|
|
5
5
|
const A = (t, d, i, l, r) => {
|
|
6
|
-
const a =
|
|
6
|
+
const a = W(t, d), s = a.value, o = P(s);
|
|
7
7
|
let n = s;
|
|
8
|
-
o === "Image" && (n = /* @__PURE__ */ c(
|
|
8
|
+
o === "Image" && (n = /* @__PURE__ */ c(Y, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (n = /* @__PURE__ */ c(J, { id: `${s}-video`, videoSrc: s }));
|
|
9
9
|
const b = r("OBSERVATIONS_RECORDED_BY", {
|
|
10
10
|
provider: a.provider
|
|
11
11
|
}), m = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${m}-${i}-${d}` : `${v}-${m}-${i}-${d}`;
|
|
12
12
|
return /* @__PURE__ */ c(
|
|
13
|
-
|
|
13
|
+
X,
|
|
14
14
|
{
|
|
15
15
|
header: a.header,
|
|
16
16
|
value: n,
|
|
@@ -36,9 +36,9 @@ const A = (t, d, i, l, r) => {
|
|
|
36
36
|
groupedData: t,
|
|
37
37
|
title: d = ""
|
|
38
38
|
}) => {
|
|
39
|
-
const { t: i } =
|
|
40
|
-
const o =
|
|
41
|
-
return /* @__PURE__ */
|
|
39
|
+
const { t: i } = I(), l = (r, a, s) => {
|
|
40
|
+
const o = M(r.encounterDetails, i);
|
|
41
|
+
return /* @__PURE__ */ T(
|
|
42
42
|
S,
|
|
43
43
|
{
|
|
44
44
|
title: o,
|
|
@@ -74,18 +74,18 @@ const A = (t, d, i, l, r) => {
|
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
}, se = "_observations_kfbhq_1", oe = "_title_kfbhq_12",
|
|
77
|
+
}, se = "_observations_kfbhq_1", oe = "_title_kfbhq_12", N = {
|
|
78
78
|
observations: se,
|
|
79
79
|
title: oe
|
|
80
80
|
}, ie = (t) => ["conceptUuid", t], ne = (t, d) => ["observations", t, ...d], be = ({ config: t }) => {
|
|
81
|
-
const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, r = te(/* @__PURE__ */ new Set()), a =
|
|
81
|
+
const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, r = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = V(), { t: o } = I(), n = Z({
|
|
82
82
|
queries: i.map((e) => ({
|
|
83
83
|
queryKey: ie(e),
|
|
84
|
-
queryFn: () =>
|
|
84
|
+
queryFn: () => x(e),
|
|
85
85
|
enabled: !!e
|
|
86
86
|
}))
|
|
87
87
|
});
|
|
88
|
-
|
|
88
|
+
$(() => {
|
|
89
89
|
n.forEach((e, p) => {
|
|
90
90
|
if (e.isError && !r.current.has(p)) {
|
|
91
91
|
const C = i[p];
|
|
@@ -99,22 +99,22 @@ const A = (t, d, i, l, r) => {
|
|
|
99
99
|
}, [n, i]);
|
|
100
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
101
|
data: u,
|
|
102
|
-
isLoading:
|
|
102
|
+
isLoading: D,
|
|
103
103
|
isError: R,
|
|
104
104
|
refetch: g
|
|
105
105
|
} = ee({
|
|
106
106
|
queryKey: ne(a, m),
|
|
107
|
-
queryFn: () =>
|
|
107
|
+
queryFn: () => K(a, m),
|
|
108
108
|
enabled: !!a && m.length > 0 && v
|
|
109
109
|
});
|
|
110
|
-
|
|
110
|
+
w(
|
|
111
111
|
(e) => {
|
|
112
112
|
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
113
113
|
(p) => m.includes(p)
|
|
114
114
|
) && g();
|
|
115
115
|
},
|
|
116
116
|
[a, g]
|
|
117
|
-
),
|
|
117
|
+
), $(() => {
|
|
118
118
|
R && s({
|
|
119
119
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
120
120
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -123,39 +123,39 @@ const A = (t, d, i, l, r) => {
|
|
|
123
123
|
}, [R]);
|
|
124
124
|
const f = h(() => {
|
|
125
125
|
if (!u) return [];
|
|
126
|
-
const e =
|
|
127
|
-
return
|
|
128
|
-
}, [u]),
|
|
126
|
+
const e = z(u), p = G(e);
|
|
127
|
+
return Q(p);
|
|
128
|
+
}, [u]), F = [
|
|
129
129
|
{ key: "name", header: "name" },
|
|
130
130
|
{ key: "value", header: "value" },
|
|
131
131
|
{ key: "form", header: "form" }
|
|
132
|
-
], O =
|
|
133
|
-
return /* @__PURE__ */
|
|
132
|
+
], O = D || !v, _ = R && v, q = (!u || u.entry?.length === 0 || m.length === 0) && v, L = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = q ? o("NO_OBSERVATIONS_FOUND") : void 0, k = f.length > 0 && !O && !_, E = d.titleTranslationKey, y = E ? o(E) : "";
|
|
133
|
+
return /* @__PURE__ */ T(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
136
136
|
id: "observations",
|
|
137
137
|
"data-testid": E ? `observations-${y}` : "observations",
|
|
138
138
|
"aria-label": "observations-aria-label",
|
|
139
|
-
className:
|
|
139
|
+
className: N.observations,
|
|
140
140
|
children: [
|
|
141
141
|
/* @__PURE__ */ c(
|
|
142
|
-
|
|
142
|
+
j,
|
|
143
143
|
{
|
|
144
144
|
id: "observations-title",
|
|
145
145
|
testId: E ? `observations-title-${y}` : "observations-title",
|
|
146
146
|
title: y,
|
|
147
|
-
className:
|
|
147
|
+
className: N.title,
|
|
148
148
|
children: /* @__PURE__ */ c("p", { children: y })
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
151
|
k ? /* @__PURE__ */ c(re, { groupedData: f, title: y }) : /* @__PURE__ */ c(
|
|
152
|
-
|
|
152
|
+
H,
|
|
153
153
|
{
|
|
154
|
-
headers:
|
|
154
|
+
headers: F,
|
|
155
155
|
rows: [],
|
|
156
156
|
ariaLabel: o("OBSERVATIONS"),
|
|
157
157
|
loading: O,
|
|
158
|
-
errorStateMessage:
|
|
158
|
+
errorStateMessage: L,
|
|
159
159
|
emptyStateMessage: U,
|
|
160
160
|
dataTestId: "observations-table"
|
|
161
161
|
}
|