@bahmni/registration-app 0.0.1-dev.333 → 0.0.1-dev.336
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/{DocumentsTable-BWdWCSEF-DL7v73rv.js → DocumentsTable-CTusNB7B-Cqfc891X.js} +15 -15
- package/dist/{FormsTable-BeIgWoc7-D_xxxfi4.js → FormsTable-BG5HiaLE-CAnCUbVy.js} +93 -95
- package/dist/{LNWAZHJI-BMLUkSgW.js → LNWAZHJI-BVeUMUsi.js} +2 -2
- package/dist/{MWZ6AO7Z-B8_ujXks.js → MWZ6AO7Z-HczfY_Vu.js} +2 -2
- package/dist/{Observations-BjoSIa29-C07YE8J_.js → Observations-CMEosjHX-BngWl122.js} +15 -15
- package/dist/{YPM2AS64-BEFOLkTV.js → YPM2AS64-zv-gfVHZ.js} +1 -1
- package/dist/{index-B7cMVXBU.js → index-BjmjdKVd.js} +10915 -10913
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { a as G, u as W, q as Y,
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { a as G, u as W, q as Y, p as J, $ as X, v as Z, R as ee, b as te } from "./index-BjmjdKVd.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useState as l, useCallback as
|
|
4
|
+
import { useState as l, useCallback as h, useEffect as I, useMemo as _ } from "react";
|
|
5
5
|
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
|
|
6
6
|
documentsTableBody: ne,
|
|
7
7
|
viewAttachmentsLink: oe,
|
|
@@ -33,16 +33,16 @@ const Te = [
|
|
|
33
33
|
"attachments",
|
|
34
34
|
"uploadedOn",
|
|
35
35
|
"uploadedBy"
|
|
36
|
-
],
|
|
36
|
+
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ne = ({ config: a, encounterUuids: E }) => {
|
|
37
37
|
const [s, w] = l(!1), [o, U] = l(
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), g = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [q, A] = l(void 0), M =
|
|
41
|
+
), g = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [q, A] = l(void 0), M = h((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
|
-
}, []), F =
|
|
43
|
+
}, []), F = h(() => {
|
|
44
44
|
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
45
|
-
}, []), v =
|
|
45
|
+
}, []), v = h((e) => {
|
|
46
46
|
O((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: i, isLoading: H, isError: b, error: y } = ae({
|
|
48
48
|
queryKey: [
|
|
@@ -89,7 +89,7 @@ const Te = [
|
|
|
89
89
|
e.signal.aborted || O(t);
|
|
90
90
|
})(), () => e.abort();
|
|
91
91
|
}, [s, o]);
|
|
92
|
-
const j =
|
|
92
|
+
const j = h(
|
|
93
93
|
(e, t) => {
|
|
94
94
|
t !== u ? (V(t), C(1), A(void 0)) : C(e);
|
|
95
95
|
},
|
|
@@ -106,7 +106,7 @@ const Te = [
|
|
|
106
106
|
), T = _(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
), K =
|
|
109
|
+
), K = h(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -137,7 +137,7 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ p(x, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
@@ -169,14 +169,14 @@ const Te = [
|
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
171
|
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
|
|
172
|
-
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) ||
|
|
173
|
-
return m === "#" || D ? /* @__PURE__ */
|
|
172
|
+
const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), D = $.has(t);
|
|
173
|
+
return m === "#" || D ? /* @__PURE__ */ p(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
177
177
|
"data-testid": `attachment-error-${t}`,
|
|
178
178
|
children: [
|
|
179
|
-
T.length > 1 && /* @__PURE__ */
|
|
179
|
+
T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
180
180
|
t + 1,
|
|
181
181
|
"/",
|
|
182
182
|
T.length
|
|
@@ -185,13 +185,13 @@ const Te = [
|
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
187
|
`${o.id}-${e.url}`
|
|
188
|
-
) : /* @__PURE__ */
|
|
188
|
+
) : /* @__PURE__ */ p(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: d.attachmentItem,
|
|
192
192
|
"data-testid": `attachment-item-${t}`,
|
|
193
193
|
children: [
|
|
194
|
-
T.length > 1 && /* @__PURE__ */
|
|
194
|
+
T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
195
195
|
t + 1,
|
|
196
196
|
"/",
|
|
197
197
|
T.length
|
|
@@ -1,80 +1,78 @@
|
|
|
1
1
|
import { jsx as i, jsxs as re, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
-
import { u as ae, a as se,
|
|
3
|
-
import { useQueryClient as ge, useQuery as
|
|
4
|
-
import { useState as
|
|
5
|
-
const Ne = "FormsTable-module_formsTableBody__SvGha", Ae = "FormsTable-module_customAccordianItem__isszs",
|
|
2
|
+
import { u as ae, a as se, c as te, h as ne, d as de, e as ie, f as le, U as me, l as ce, g as q, v as ue, $ as fe, R as $, _ as ye, A as he, b as be, i as pe } from "./index-BjmjdKVd.js";
|
|
3
|
+
import { useQueryClient as ge, useQuery as y } from "@tanstack/react-query";
|
|
4
|
+
import { useState as k, useMemo as d, useCallback as h } from "react";
|
|
5
|
+
const Ne = "FormsTable-module_formsTableBody__SvGha", Ae = "FormsTable-module_customAccordianItem__isszs", O = {
|
|
6
6
|
formsTableBody: Ne,
|
|
7
7
|
customAccordianItem: Ae
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
encounterUuids: l,
|
|
13
|
-
config: k
|
|
8
|
+
}, Be = ({
|
|
9
|
+
episodeOfCareUuids: T,
|
|
10
|
+
encounterUuids: m,
|
|
11
|
+
config: Q
|
|
14
12
|
}) => {
|
|
15
|
-
const { t: n } = ae(), c = se(), [
|
|
13
|
+
const { t: n } = ae(), c = se(), [u, I] = k(!1), [s, _] = k(null), {
|
|
16
14
|
numberOfVisits: w,
|
|
17
|
-
hideThumbnail:
|
|
18
|
-
forms:
|
|
19
|
-
} =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
),
|
|
23
|
-
data:
|
|
24
|
-
isLoading:
|
|
25
|
-
isError:
|
|
26
|
-
error:
|
|
27
|
-
refetch:
|
|
28
|
-
} =
|
|
29
|
-
queryKey: ["forms", c,
|
|
15
|
+
hideThumbnail: K = !1,
|
|
16
|
+
forms: f
|
|
17
|
+
} = Q ?? {}, B = te(
|
|
18
|
+
T,
|
|
19
|
+
m
|
|
20
|
+
), j = ge(), {
|
|
21
|
+
data: E = [],
|
|
22
|
+
isLoading: F,
|
|
23
|
+
isError: L,
|
|
24
|
+
error: x,
|
|
25
|
+
refetch: G
|
|
26
|
+
} = y({
|
|
27
|
+
queryKey: ["forms", c, T],
|
|
30
28
|
queryFn: () => ne(c, void 0, w),
|
|
31
|
-
enabled: !!c && !
|
|
32
|
-
}),
|
|
33
|
-
let e =
|
|
34
|
-
return
|
|
35
|
-
(r) =>
|
|
36
|
-
)), Array.isArray(
|
|
37
|
-
(r) =>
|
|
29
|
+
enabled: !!c && !B
|
|
30
|
+
}), R = d(() => {
|
|
31
|
+
let e = E;
|
|
32
|
+
return m && m.length > 0 && (e = e.filter(
|
|
33
|
+
(r) => m.includes(r.encounterUuid)
|
|
34
|
+
)), Array.isArray(f) && f.length > 0 && (e = e.filter(
|
|
35
|
+
(r) => f.some((o) => o.toLowerCase() === r.formName.toLowerCase())
|
|
38
36
|
)), e;
|
|
39
|
-
}, [
|
|
37
|
+
}, [E, m, f]), { data: M = [] } = y({
|
|
40
38
|
queryKey: ["observationForms"],
|
|
41
39
|
queryFn: () => de()
|
|
42
|
-
}),
|
|
43
|
-
(e) =>
|
|
44
|
-
[
|
|
45
|
-
),
|
|
40
|
+
}), v = h(
|
|
41
|
+
(e) => M.find((r) => r.name === e)?.uuid,
|
|
42
|
+
[M]
|
|
43
|
+
), b = d(() => {
|
|
46
44
|
if (s)
|
|
47
|
-
return
|
|
48
|
-
}, [s,
|
|
49
|
-
data:
|
|
50
|
-
isLoading:
|
|
51
|
-
isError:
|
|
52
|
-
error:
|
|
53
|
-
} =
|
|
54
|
-
queryKey: ["formMetadata",
|
|
55
|
-
queryFn: () => ie(
|
|
56
|
-
enabled: !!
|
|
45
|
+
return v(s.formName);
|
|
46
|
+
}, [s, v]), {
|
|
47
|
+
data: l,
|
|
48
|
+
isLoading: H,
|
|
49
|
+
isError: V,
|
|
50
|
+
error: p
|
|
51
|
+
} = y({
|
|
52
|
+
queryKey: ["formMetadata", b],
|
|
53
|
+
queryFn: () => ie(b),
|
|
54
|
+
enabled: !!b && u
|
|
57
55
|
}), {
|
|
58
|
-
data:
|
|
59
|
-
isLoading:
|
|
56
|
+
data: g,
|
|
57
|
+
isLoading: z,
|
|
60
58
|
isError: P,
|
|
61
|
-
error:
|
|
62
|
-
} =
|
|
59
|
+
error: N
|
|
60
|
+
} = y({
|
|
63
61
|
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
64
62
|
queryFn: () => le(s.encounterUuid),
|
|
65
|
-
enabled: !!s?.encounterUuid &&
|
|
63
|
+
enabled: !!s?.encounterUuid && u
|
|
66
64
|
});
|
|
67
|
-
|
|
65
|
+
me(
|
|
68
66
|
(e) => {
|
|
69
|
-
e.patientUUID === c && e.updatedConcepts.size > 0 && (
|
|
67
|
+
e.patientUUID === c && e.updatedConcepts.size > 0 && (G(), j.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
70
68
|
},
|
|
71
69
|
[c]
|
|
72
70
|
);
|
|
73
|
-
const Y = d(() => !
|
|
74
|
-
const r =
|
|
71
|
+
const Y = d(() => !g?.entry || !s?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
72
|
+
const r = ce(e);
|
|
75
73
|
return !r || r.includes(s.formName);
|
|
76
|
-
}), [
|
|
77
|
-
if (!
|
|
74
|
+
}), [g, s?.formName]), J = d(() => {
|
|
75
|
+
if (!l?.schema) return;
|
|
78
76
|
const e = [], r = (o) => {
|
|
79
77
|
(o ?? []).forEach((t) => {
|
|
80
78
|
const a = t;
|
|
@@ -82,28 +80,28 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Ae = "FormsTable-module_cu
|
|
|
82
80
|
});
|
|
83
81
|
};
|
|
84
82
|
return r(
|
|
85
|
-
|
|
83
|
+
l.schema.controls ?? []
|
|
86
84
|
), e.length > 0 ? e : void 0;
|
|
87
|
-
}, [
|
|
88
|
-
if (!
|
|
85
|
+
}, [l]), W = d(() => {
|
|
86
|
+
if (!l?.schema) return;
|
|
89
87
|
const e = {}, r = (o, t) => {
|
|
90
88
|
for (const a of o)
|
|
91
89
|
if (a.type === "section") {
|
|
92
|
-
const
|
|
93
|
-
r(a.controls ?? [],
|
|
90
|
+
const A = a.label?.value ?? "Section";
|
|
91
|
+
r(a.controls ?? [], A);
|
|
94
92
|
} else
|
|
95
93
|
a.id != null && t && (e[String(a.id)] = t), a.controls && r(a.controls, t);
|
|
96
94
|
};
|
|
97
95
|
return r(
|
|
98
|
-
|
|
96
|
+
l.schema.controls ?? [],
|
|
99
97
|
null
|
|
100
98
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
101
|
-
}, [
|
|
102
|
-
if (
|
|
103
|
-
return q(
|
|
104
|
-
if (
|
|
105
|
-
return q(
|
|
106
|
-
}, [
|
|
99
|
+
}, [l]), X = d(() => {
|
|
100
|
+
if (p)
|
|
101
|
+
return q(p).message;
|
|
102
|
+
if (N)
|
|
103
|
+
return q(N).message;
|
|
104
|
+
}, [p, N]), S = d(
|
|
107
105
|
() => [
|
|
108
106
|
{ key: "recordedOn", header: n("RECORDED_ON") },
|
|
109
107
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
@@ -116,15 +114,15 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Ae = "FormsTable-module_cu
|
|
|
116
114
|
],
|
|
117
115
|
[]
|
|
118
116
|
), U = d(() => {
|
|
119
|
-
const e =
|
|
117
|
+
const e = R.reduce(
|
|
120
118
|
(r, o) => {
|
|
121
119
|
const t = o.formName;
|
|
122
120
|
r[t] ??= [];
|
|
123
|
-
const a = o.providers.map((
|
|
121
|
+
const a = o.providers.map((A) => A.providerName).filter(Boolean).join(", ");
|
|
124
122
|
return r[t].push({
|
|
125
123
|
id: o.encounterUuid,
|
|
126
124
|
formName: o.formName,
|
|
127
|
-
recordedOn:
|
|
125
|
+
recordedOn: ue(o.encounterDateTime, n, !0).formattedResult,
|
|
128
126
|
recordedBy: a ?? "--",
|
|
129
127
|
encounterDateTime: o.encounterDateTime,
|
|
130
128
|
encounterUuid: o.encounterUuid
|
|
@@ -140,15 +138,15 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Ae = "FormsTable-module_cu
|
|
|
140
138
|
)
|
|
141
139
|
})
|
|
142
140
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
143
|
-
}, [
|
|
144
|
-
|
|
145
|
-
}, []), ee =
|
|
146
|
-
I(!1),
|
|
147
|
-
}, []), D =
|
|
141
|
+
}, [R, n]), C = h((e) => {
|
|
142
|
+
_(e), I(!0);
|
|
143
|
+
}, []), ee = h(() => {
|
|
144
|
+
I(!1), _(null);
|
|
145
|
+
}, []), D = h(
|
|
148
146
|
(e, r) => {
|
|
149
147
|
switch (r) {
|
|
150
148
|
case "recordedOn":
|
|
151
|
-
return /* @__PURE__ */ i(
|
|
149
|
+
return /* @__PURE__ */ i(fe, { onClick: () => C(e), children: e.recordedOn });
|
|
152
150
|
case "recordedBy":
|
|
153
151
|
return e.recordedBy;
|
|
154
152
|
default:
|
|
@@ -158,30 +156,30 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Ae = "FormsTable-module_cu
|
|
|
158
156
|
[C]
|
|
159
157
|
);
|
|
160
158
|
return /* @__PURE__ */ re(oe, { children: [
|
|
161
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
162
|
-
|
|
159
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: F || L || U.length === 0 || B ? /* @__PURE__ */ i(
|
|
160
|
+
$,
|
|
163
161
|
{
|
|
164
162
|
headers: S,
|
|
165
163
|
ariaLabel: n("FORMS_HEADING"),
|
|
166
164
|
rows: [],
|
|
167
|
-
loading:
|
|
168
|
-
errorStateMessage:
|
|
165
|
+
loading: F,
|
|
166
|
+
errorStateMessage: L ? x?.message : void 0,
|
|
169
167
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
170
168
|
renderCell: D,
|
|
171
|
-
className:
|
|
169
|
+
className: O.formsTableBody,
|
|
172
170
|
dataTestId: "forms-table"
|
|
173
171
|
}
|
|
174
|
-
) : /* @__PURE__ */ i(
|
|
172
|
+
) : /* @__PURE__ */ i(ye, { align: "start", children: U.map((e, r) => {
|
|
175
173
|
const { formName: o, records: t } = e;
|
|
176
174
|
return /* @__PURE__ */ i(
|
|
177
|
-
|
|
175
|
+
he,
|
|
178
176
|
{
|
|
179
177
|
title: o,
|
|
180
|
-
className:
|
|
178
|
+
className: O.customAccordianItem,
|
|
181
179
|
testId: `accordian-title-${o}`,
|
|
182
180
|
open: r === 0,
|
|
183
181
|
children: /* @__PURE__ */ i(
|
|
184
|
-
|
|
182
|
+
$,
|
|
185
183
|
{
|
|
186
184
|
headers: S,
|
|
187
185
|
ariaLabel: n("FORMS_HEADING"),
|
|
@@ -191,7 +189,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Ae = "FormsTable-module_cu
|
|
|
191
189
|
sortable: Z,
|
|
192
190
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
193
191
|
renderCell: D,
|
|
194
|
-
className:
|
|
192
|
+
className: O.formsTableBody,
|
|
195
193
|
dataTestId: `forms-table-${o}`
|
|
196
194
|
}
|
|
197
195
|
)
|
|
@@ -199,12 +197,12 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Ae = "FormsTable-module_cu
|
|
|
199
197
|
o
|
|
200
198
|
);
|
|
201
199
|
}) }) }),
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
u && s && /* @__PURE__ */ i(
|
|
201
|
+
be,
|
|
204
202
|
{
|
|
205
203
|
id: "modalIdForActionAreaLayout",
|
|
206
204
|
portalId: "main-display-area",
|
|
207
|
-
open:
|
|
205
|
+
open: u,
|
|
208
206
|
onRequestClose: ee,
|
|
209
207
|
modalHeading: s.formName,
|
|
210
208
|
modalLabel: `${s.recordedOn} | ${s.recordedBy}`,
|
|
@@ -212,15 +210,15 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Ae = "FormsTable-module_cu
|
|
|
212
210
|
size: "md",
|
|
213
211
|
testId: "form-details-modal",
|
|
214
212
|
children: /* @__PURE__ */ i(
|
|
215
|
-
|
|
213
|
+
pe,
|
|
216
214
|
{
|
|
217
215
|
observations: Y,
|
|
218
|
-
isLoading:
|
|
219
|
-
isError:
|
|
216
|
+
isLoading: H || z,
|
|
217
|
+
isError: V || P,
|
|
220
218
|
errorMessage: X,
|
|
221
219
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
222
220
|
testIdPrefix: s.formName,
|
|
223
|
-
hideThumbnail:
|
|
221
|
+
hideThumbnail: K,
|
|
224
222
|
controlOrder: J,
|
|
225
223
|
sectionMap: W
|
|
226
224
|
}
|
|
@@ -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 {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-zv-gfVHZ.js";
|
|
2
|
+
import { t as d, w as f, x as e } from "./index-BjmjdKVd.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 {
|
|
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-zv-gfVHZ.js";
|
|
2
|
+
import { t as v, w as C, x as e } from "./index-BjmjdKVd.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { a as B, q as
|
|
2
|
+
import { a as B, q as K, u as N, s as M, j as k, U as H, y as j, H as w, M as x, k as G, R as z, E as P, F, V as W, m as J, n as X, o as Y, W as Z, r as ee } from "./index-BjmjdKVd.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as se, useEffect as _, useMemo as R } from "react";
|
|
5
|
-
const
|
|
5
|
+
const Q = (a, n, d, l, b, r) => {
|
|
6
6
|
const t = W(a, n, b), s = t.value, o = J(s);
|
|
7
7
|
let i = s;
|
|
8
8
|
o === "Image" && (i = /* @__PURE__ */ u(
|
|
@@ -37,13 +37,13 @@ const U = (a, n, d, l, b, r) => {
|
|
|
37
37
|
`obs-${a.id}`
|
|
38
38
|
);
|
|
39
39
|
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
40
|
-
|
|
40
|
+
F,
|
|
41
41
|
{
|
|
42
42
|
title: a.display,
|
|
43
43
|
id: `grouped-obs-${a.display}-${l}`,
|
|
44
44
|
open: d,
|
|
45
45
|
children: a.members?.map(
|
|
46
|
-
(s, o) =>
|
|
46
|
+
(s, o) => Q(
|
|
47
47
|
s,
|
|
48
48
|
o,
|
|
49
49
|
b,
|
|
@@ -62,14 +62,14 @@ const U = (a, n, d, l, b, r) => {
|
|
|
62
62
|
const { t: l } = N(), b = (r, t, s) => {
|
|
63
63
|
const o = P(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ S(
|
|
65
|
-
|
|
65
|
+
F,
|
|
66
66
|
{
|
|
67
67
|
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(i, m) =>
|
|
72
|
+
(i, m) => Q(
|
|
73
73
|
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -113,10 +113,10 @@ const U = (a, n, d, l, b, r) => {
|
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } = K(), { t: o } = N(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => M(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
@@ -134,15 +134,15 @@ const U = (a, n, d, l, b, r) => {
|
|
|
134
134
|
}, [i, d]);
|
|
135
135
|
const m = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = R(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
137
|
+
isLoading: U,
|
|
138
138
|
isError: T,
|
|
139
139
|
refetch: $
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => k(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
H(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
@@ -158,13 +158,13 @@ const U = (a, n, d, l, b, r) => {
|
|
|
158
158
|
}, [T]);
|
|
159
159
|
const g = R(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
161
|
+
const e = j(c), h = w(e);
|
|
162
162
|
return x(h);
|
|
163
|
-
}, [c]),
|
|
163
|
+
}, [c]), D = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
], O =
|
|
167
|
+
], O = U || !y, f = T && y, L = (!c || c.entry?.length === 0 || p.length === 0) && y, A = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = L ? o("NO_OBSERVATIONS_FOUND") : void 0, V = g.length > 0 && !O && !f, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
168
|
return /* @__PURE__ */ S(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
@@ -193,7 +193,7 @@ const U = (a, n, d, l, b, r) => {
|
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
194
|
z,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: D,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: o("OBSERVATIONS"),
|
|
199
199
|
loading: O,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z as we, B as z, C as xt, D as B, w as q, x as y, P as Ro, G as ye, S as R, I as _, J as k, K as N, L as A, N as bs, O as ir, Q as $e, T as G, X as Hn, Y as Vn, Z as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Gr, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-BjmjdKVd.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|