@bahmni/registration-app 0.0.1-dev.229 → 0.0.1-dev.230
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-6tDw4SyX-BWGrInwV.js → DocumentsTable-asIFkp7i-CdIhp145.js} +33 -33
- package/dist/{FormsTable-BXY2feyi-BedI_bwA.js → FormsTable-Eps5HHdl-sKfb6pRt.js} +69 -69
- package/dist/{LNWAZHJI-C9wox7lt.js → LNWAZHJI-DvJMWiNi.js} +4 -4
- package/dist/{MWZ6AO7Z-C-4LRG3U.js → MWZ6AO7Z-Bt3rQzvv.js} +3 -3
- package/dist/{Observations-BEqqihoJ-DZCp5qMP.js → Observations-I6ZLFaJF-BijtJMzv.js} +41 -41
- package/dist/{YPM2AS64-M1wy1Zyd.js → YPM2AS64-TV3Ut9cs.js} +1 -1
- package/dist/{index-UAAQaH3g.js → index-CMiwOKw0.js} +53458 -53071
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { t as K, u as Q, r as W,
|
|
1
|
+
import { jsx as r, jsxs as _, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { t as K, u as Q, r as W, p as J, x as X, N as Z, o as ee, s as te } from "./index-CMiwOKw0.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as m, useCallback as h, useEffect as f, useMemo as T } from "react";
|
|
5
5
|
const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", me = "_documentImage_1voj8_50", d = {
|
|
@@ -21,41 +21,41 @@ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11",
|
|
|
21
21
|
function j(a) {
|
|
22
22
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
23
|
}
|
|
24
|
-
function ue(a,
|
|
24
|
+
function ue(a, E) {
|
|
25
25
|
return a.map((s) => ({
|
|
26
26
|
key: s,
|
|
27
|
-
header:
|
|
27
|
+
header: E(le[s])
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const pe = [
|
|
31
31
|
"documentIdentifier",
|
|
32
32
|
"documentType",
|
|
33
33
|
"uploadedOn",
|
|
34
34
|
"uploadedBy",
|
|
35
35
|
"action"
|
|
36
|
-
],
|
|
37
|
-
const [s, w] = m(!1), [o,
|
|
36
|
+
], _e = /\.(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
|
+
const [s, w] = m(!1), [o, L] = m(
|
|
38
38
|
null
|
|
39
39
|
), [R, I] = m(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
),
|
|
42
|
-
|
|
41
|
+
), g = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = m(1), [l, k] = m($), [V, y] = m(void 0), M = h((e) => {
|
|
42
|
+
L(e), w(!0);
|
|
43
43
|
}, []), F = h(() => {
|
|
44
|
-
w(!1),
|
|
44
|
+
w(!1), L(null), I(/* @__PURE__ */ new Set());
|
|
45
45
|
}, []), b = h((e) => {
|
|
46
46
|
I((t) => new Set(t).add(e));
|
|
47
47
|
}, []), { data: u, isLoading: H, isError: D, error: v } = ae({
|
|
48
48
|
queryKey: [
|
|
49
49
|
"documents",
|
|
50
|
-
E,
|
|
51
50
|
g,
|
|
51
|
+
E,
|
|
52
52
|
C,
|
|
53
53
|
l
|
|
54
54
|
],
|
|
55
|
-
enabled: !!
|
|
55
|
+
enabled: !!g,
|
|
56
56
|
queryFn: () => J(
|
|
57
|
-
E,
|
|
58
57
|
g,
|
|
58
|
+
E,
|
|
59
59
|
l,
|
|
60
60
|
C
|
|
61
61
|
)
|
|
@@ -64,13 +64,13 @@ const _e = [
|
|
|
64
64
|
u && y(u.total);
|
|
65
65
|
}, [u]), f(() => {
|
|
66
66
|
A(1), y(void 0);
|
|
67
|
-
}, [
|
|
68
|
-
D &&
|
|
67
|
+
}, [g]), f(() => {
|
|
68
|
+
D && U({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: v?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [D, v,
|
|
73
|
+
}, [D, v, U, n]), f(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
@@ -95,15 +95,15 @@ const _e = [
|
|
|
95
95
|
},
|
|
96
96
|
[l]
|
|
97
97
|
), N = T(
|
|
98
|
-
() => a?.fields ??
|
|
98
|
+
() => a?.fields ?? pe,
|
|
99
99
|
[a?.fields]
|
|
100
|
-
),
|
|
100
|
+
), x = T(() => [...u?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [u]), P = T(() => ue(N, n), [N, n]), z = T(
|
|
101
101
|
() => N.map((e) => ({
|
|
102
102
|
key: e,
|
|
103
103
|
sortable: e !== "action"
|
|
104
104
|
})),
|
|
105
105
|
[N]
|
|
106
|
-
),
|
|
106
|
+
), p = T(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
109
|
), G = h(
|
|
@@ -125,7 +125,7 @@ const _e = [
|
|
|
125
125
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
126
|
X,
|
|
127
127
|
{
|
|
128
|
-
onClick: () =>
|
|
128
|
+
onClick: () => M(e),
|
|
129
129
|
className: d.viewAttachmentsLink,
|
|
130
130
|
"data-testid": `view-attachments-${e.id}`,
|
|
131
131
|
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
@@ -135,18 +135,18 @@ const _e = [
|
|
|
135
135
|
return null;
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
|
-
[
|
|
138
|
+
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ _(Y, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
144
|
-
headers:
|
|
144
|
+
headers: P,
|
|
145
145
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
-
rows:
|
|
146
|
+
rows: x,
|
|
147
147
|
loading: H,
|
|
148
148
|
errorStateMessage: D ? v?.message : null,
|
|
149
|
-
sortable:
|
|
149
|
+
sortable: z,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
151
|
renderCell: G,
|
|
152
152
|
className: d.documentsTableBody,
|
|
@@ -168,33 +168,33 @@ const _e = [
|
|
|
168
168
|
passiveModal: !0,
|
|
169
169
|
size: "lg",
|
|
170
170
|
testId: "document-view-modal",
|
|
171
|
-
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children:
|
|
172
|
-
const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) ||
|
|
173
|
-
return c === "#" || O ? /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: p.map((e, t) => {
|
|
172
|
+
const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), O = R.has(t);
|
|
173
|
+
return c === "#" || O ? /* @__PURE__ */ _(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: d.attachmentError,
|
|
177
177
|
"data-testid": `attachment-error-${t}`,
|
|
178
178
|
children: [
|
|
179
|
-
|
|
179
|
+
p.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
|
|
180
180
|
t + 1,
|
|
181
181
|
"/",
|
|
182
|
-
|
|
182
|
+
p.length
|
|
183
183
|
] }),
|
|
184
184
|
/* @__PURE__ */ r("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
187
|
`${o.id}-${e.url}`
|
|
188
|
-
) : /* @__PURE__ */
|
|
188
|
+
) : /* @__PURE__ */ _(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: d.attachmentItem,
|
|
192
192
|
"data-testid": `attachment-item-${t}`,
|
|
193
193
|
children: [
|
|
194
|
-
|
|
194
|
+
p.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
|
|
195
195
|
t + 1,
|
|
196
196
|
"/",
|
|
197
|
-
|
|
197
|
+
p.length
|
|
198
198
|
] }),
|
|
199
199
|
S ? /* @__PURE__ */ r(
|
|
200
200
|
"img",
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import { jsx as s, jsxs as W, Fragment as X } from "react/jsx-runtime";
|
|
2
|
-
import { u as Z, t as ee,
|
|
2
|
+
import { u as Z, t as ee, g as re, h as ae, d as te, a as oe, c as se, k as ne, V as v, N as de, x as ie, o as q, J as ue, Q as me, s as le, b as ce, e as fe } from "./index-CMiwOKw0.js";
|
|
3
3
|
import { useQueryClient as ye, useQuery as c } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
5
|
-
const be = "_formsTableBody_81hra_1",
|
|
4
|
+
import { useState as C, useMemo as d, useCallback as f } from "react";
|
|
5
|
+
const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", I = {
|
|
6
6
|
formsTableBody: be,
|
|
7
|
-
customAccordianItem:
|
|
8
|
-
},
|
|
7
|
+
customAccordianItem: Ne
|
|
8
|
+
}, ge = (u) => u ? u.extension?.find(
|
|
9
9
|
(n) => n.url === fe
|
|
10
|
-
)?.valueString : void 0,
|
|
11
|
-
episodeOfCareUuids:
|
|
10
|
+
)?.valueString : void 0, Ae = ({
|
|
11
|
+
episodeOfCareUuids: u,
|
|
12
12
|
encounterUuids: n,
|
|
13
|
-
config:
|
|
13
|
+
config: S
|
|
14
14
|
}) => {
|
|
15
|
-
const { t: o } = Z(),
|
|
16
|
-
|
|
15
|
+
const { t: o } = Z(), m = ee(), [l, O] = C(!1), [t, A] = C(null), { numberOfVisits: k, hideThumbnail: x = !1 } = S ?? {}, T = re(
|
|
16
|
+
u,
|
|
17
17
|
n
|
|
18
|
-
),
|
|
18
|
+
), V = ye(), {
|
|
19
19
|
data: y = [],
|
|
20
|
-
isLoading:
|
|
21
|
-
isError:
|
|
22
|
-
error:
|
|
23
|
-
refetch:
|
|
20
|
+
isLoading: B,
|
|
21
|
+
isError: E,
|
|
22
|
+
error: H,
|
|
23
|
+
refetch: K
|
|
24
24
|
} = c({
|
|
25
|
-
queryKey: ["forms",
|
|
26
|
-
queryFn: () => ae(
|
|
27
|
-
enabled: !!
|
|
28
|
-
}),
|
|
25
|
+
queryKey: ["forms", m, u],
|
|
26
|
+
queryFn: () => ae(m, void 0, k),
|
|
27
|
+
enabled: !!m && !T
|
|
28
|
+
}), _ = d(() => !n || n.length === 0 ? y : y.filter(
|
|
29
29
|
(e) => n.includes(e.encounterUuid)
|
|
30
|
-
), [y, n]), { data:
|
|
30
|
+
), [y, n]), { data: F = [] } = c({
|
|
31
31
|
queryKey: ["observationForms"],
|
|
32
32
|
queryFn: () => te()
|
|
33
|
-
}),
|
|
34
|
-
(e) =>
|
|
35
|
-
[
|
|
33
|
+
}), L = f(
|
|
34
|
+
(e) => F.find((r) => r.name === e)?.uuid,
|
|
35
|
+
[F]
|
|
36
36
|
), b = d(() => {
|
|
37
37
|
if (t)
|
|
38
|
-
return
|
|
39
|
-
}, [t,
|
|
40
|
-
isLoading:
|
|
41
|
-
isError:
|
|
42
|
-
error:
|
|
38
|
+
return L(t.formName);
|
|
39
|
+
}, [t, L]), {
|
|
40
|
+
isLoading: Q,
|
|
41
|
+
isError: j,
|
|
42
|
+
error: N
|
|
43
43
|
} = c({
|
|
44
44
|
queryKey: ["formMetadata", b],
|
|
45
45
|
queryFn: () => oe(b),
|
|
46
46
|
enabled: !!b && l
|
|
47
47
|
}), {
|
|
48
|
-
data:
|
|
48
|
+
data: g,
|
|
49
49
|
isLoading: $,
|
|
50
50
|
isError: w,
|
|
51
|
-
error:
|
|
51
|
+
error: p
|
|
52
52
|
} = c({
|
|
53
53
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
54
54
|
queryFn: () => se(t.encounterUuid),
|
|
@@ -56,32 +56,32 @@ const be = "_formsTableBody_81hra_1", pe = "_customAccordianItem_81hra_6", O = {
|
|
|
56
56
|
});
|
|
57
57
|
ne(
|
|
58
58
|
(e) => {
|
|
59
|
-
e.patientUUID ===
|
|
59
|
+
e.patientUUID === m && e.updatedConcepts.size > 0 && (K(), V.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
60
60
|
},
|
|
61
|
-
[
|
|
61
|
+
[m]
|
|
62
62
|
);
|
|
63
|
-
const
|
|
64
|
-
const r =
|
|
63
|
+
const z = d(() => !g?.entry || !t?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
64
|
+
const r = ge(e);
|
|
65
65
|
return !r || r.includes(t.formName);
|
|
66
|
-
}), [
|
|
66
|
+
}), [g, t?.formName]), G = d(() => {
|
|
67
|
+
if (N)
|
|
68
|
+
return v(N).message;
|
|
67
69
|
if (p)
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
return U(g).message;
|
|
71
|
-
}, [p, g]), F = d(
|
|
70
|
+
return v(p).message;
|
|
71
|
+
}, [N, p]), M = d(
|
|
72
72
|
() => [
|
|
73
73
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
74
74
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
75
75
|
],
|
|
76
76
|
[o]
|
|
77
|
-
),
|
|
77
|
+
), J = d(
|
|
78
78
|
() => [
|
|
79
79
|
{ key: "recordedOn", sortable: !0 },
|
|
80
80
|
{ key: "recordedBy", sortable: !0 }
|
|
81
81
|
],
|
|
82
82
|
[]
|
|
83
|
-
),
|
|
84
|
-
const e =
|
|
83
|
+
), D = d(() => {
|
|
84
|
+
const e = _.reduce(
|
|
85
85
|
(r, a) => {
|
|
86
86
|
const i = a.formName;
|
|
87
87
|
r[i] ??= [];
|
|
@@ -105,11 +105,11 @@ const be = "_formsTableBody_81hra_1", pe = "_customAccordianItem_81hra_6", O = {
|
|
|
105
105
|
)
|
|
106
106
|
})
|
|
107
107
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
108
|
-
}, [
|
|
109
|
-
|
|
110
|
-
}, []),
|
|
111
|
-
|
|
112
|
-
}, []),
|
|
108
|
+
}, [_, o]), R = f((e) => {
|
|
109
|
+
A(e), O(!0);
|
|
110
|
+
}, []), P = f(() => {
|
|
111
|
+
O(!1), A(null);
|
|
112
|
+
}, []), U = f(
|
|
113
113
|
(e, r) => {
|
|
114
114
|
switch (r) {
|
|
115
115
|
case "recordedOn":
|
|
@@ -123,40 +123,40 @@ const be = "_formsTableBody_81hra_1", pe = "_customAccordianItem_81hra_6", O = {
|
|
|
123
123
|
[R]
|
|
124
124
|
);
|
|
125
125
|
return /* @__PURE__ */ W(X, { children: [
|
|
126
|
-
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children:
|
|
127
|
-
|
|
126
|
+
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: B || E || D.length === 0 || T ? /* @__PURE__ */ s(
|
|
127
|
+
q,
|
|
128
128
|
{
|
|
129
|
-
headers:
|
|
129
|
+
headers: M,
|
|
130
130
|
ariaLabel: o("FORMS_HEADING"),
|
|
131
131
|
rows: [],
|
|
132
|
-
loading:
|
|
133
|
-
errorStateMessage:
|
|
132
|
+
loading: B,
|
|
133
|
+
errorStateMessage: E ? H?.message : void 0,
|
|
134
134
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
135
|
-
renderCell:
|
|
136
|
-
className:
|
|
135
|
+
renderCell: U,
|
|
136
|
+
className: I.formsTableBody,
|
|
137
137
|
dataTestId: "forms-table"
|
|
138
138
|
}
|
|
139
|
-
) : /* @__PURE__ */ s(
|
|
139
|
+
) : /* @__PURE__ */ s(ue, { align: "start", children: D.map((e, r) => {
|
|
140
140
|
const { formName: a, records: i } = e;
|
|
141
141
|
return /* @__PURE__ */ s(
|
|
142
|
-
|
|
142
|
+
me,
|
|
143
143
|
{
|
|
144
144
|
title: a,
|
|
145
|
-
className:
|
|
145
|
+
className: I.customAccordianItem,
|
|
146
146
|
testId: `accordian-title-${a}`,
|
|
147
147
|
open: r === 0,
|
|
148
148
|
children: /* @__PURE__ */ s(
|
|
149
|
-
|
|
149
|
+
q,
|
|
150
150
|
{
|
|
151
|
-
headers:
|
|
151
|
+
headers: M,
|
|
152
152
|
ariaLabel: o("FORMS_HEADING"),
|
|
153
153
|
rows: i,
|
|
154
154
|
loading: !1,
|
|
155
155
|
errorStateMessage: "",
|
|
156
|
-
sortable:
|
|
156
|
+
sortable: J,
|
|
157
157
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
158
|
-
renderCell:
|
|
159
|
-
className:
|
|
158
|
+
renderCell: U,
|
|
159
|
+
className: I.formsTableBody,
|
|
160
160
|
dataTestId: `forms-table-${a}`
|
|
161
161
|
}
|
|
162
162
|
)
|
|
@@ -170,7 +170,7 @@ const be = "_formsTableBody_81hra_1", pe = "_customAccordianItem_81hra_6", O = {
|
|
|
170
170
|
id: "modalIdForActionAreaLayout",
|
|
171
171
|
portalId: "main-display-area",
|
|
172
172
|
open: l,
|
|
173
|
-
onRequestClose:
|
|
173
|
+
onRequestClose: P,
|
|
174
174
|
modalHeading: t.formName,
|
|
175
175
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
176
176
|
passiveModal: !0,
|
|
@@ -179,13 +179,13 @@ const be = "_formsTableBody_81hra_1", pe = "_customAccordianItem_81hra_6", O = {
|
|
|
179
179
|
children: /* @__PURE__ */ s(
|
|
180
180
|
ce,
|
|
181
181
|
{
|
|
182
|
-
observations:
|
|
183
|
-
isLoading:
|
|
184
|
-
isError:
|
|
185
|
-
errorMessage:
|
|
182
|
+
observations: z,
|
|
183
|
+
isLoading: Q || $,
|
|
184
|
+
isError: j || w,
|
|
185
|
+
errorMessage: G,
|
|
186
186
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
187
187
|
testIdPrefix: t.formName,
|
|
188
|
-
hideThumbnail:
|
|
188
|
+
hideThumbnail: x
|
|
189
189
|
}
|
|
190
190
|
)
|
|
191
191
|
}
|
|
@@ -193,5 +193,5 @@ const be = "_formsTableBody_81hra_1", pe = "_customAccordianItem_81hra_6", O = {
|
|
|
193
193
|
] });
|
|
194
194
|
};
|
|
195
195
|
export {
|
|
196
|
-
|
|
196
|
+
Ae as default
|
|
197
197
|
};
|
|
@@ -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-TV3Ut9cs.js";
|
|
2
|
+
import { z as d, A as f, C as e } from "./index-CMiwOKw0.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -27,7 +27,7 @@ var p = (a) => {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
},
|
|
30
|
+
}, P = p;
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
P as default
|
|
33
33
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
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-TV3Ut9cs.js";
|
|
2
|
+
import { z as C, A as v, C as e } from "./index-CMiwOKw0.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a =
|
|
6
|
+
}), a = C(), l = v(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { t as
|
|
1
|
+
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { t as C, r as w, u as S, i as K, l as M, k as P, v as Q, E as j, y as x, f as G, o as H, w as Y, P as U, j as z, m as J, B as W, n as X, _ as Z, q as ee } from "./index-CMiwOKw0.js";
|
|
3
3
|
import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as f } from "react";
|
|
5
5
|
const D = (t, n, d, l, b, r) => {
|
|
6
6
|
const a = z(t, n, b), s = a.value, i = J(s);
|
|
7
7
|
let o = s;
|
|
@@ -21,15 +21,15 @@ const D = (t, n, d, l, b, r) => {
|
|
|
21
21
|
hideThumbnail: r
|
|
22
22
|
}
|
|
23
23
|
)), i === "PDF" && (o = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
|
-
const
|
|
24
|
+
const m = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
25
|
provider: a.provider
|
|
26
|
-
}),
|
|
26
|
+
}), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
28
|
W,
|
|
29
29
|
{
|
|
30
30
|
header: a.header,
|
|
31
31
|
value: o,
|
|
32
|
-
info:
|
|
32
|
+
info: m,
|
|
33
33
|
id: c,
|
|
34
34
|
testId: c,
|
|
35
35
|
ariaLabel: c
|
|
@@ -59,9 +59,9 @@ const D = (t, n, d, l, b, r) => {
|
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } =
|
|
62
|
+
const { t: l } = S(), b = (r, a, s) => {
|
|
63
63
|
const i = Y(r.encounterDetails, l);
|
|
64
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ N(
|
|
65
65
|
U,
|
|
66
66
|
{
|
|
67
67
|
title: i,
|
|
@@ -69,9 +69,9 @@ const D = (t, n, d, l, b, r) => {
|
|
|
69
69
|
open: a,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(o,
|
|
72
|
+
(o, m) => D(
|
|
73
73
|
o,
|
|
74
|
-
|
|
74
|
+
m,
|
|
75
75
|
s,
|
|
76
76
|
n,
|
|
77
77
|
l,
|
|
@@ -79,11 +79,11 @@ const D = (t, n, d, l, b, r) => {
|
|
|
79
79
|
)
|
|
80
80
|
),
|
|
81
81
|
r.groupedObservations.map(
|
|
82
|
-
(o,
|
|
82
|
+
(o, m) => re(
|
|
83
83
|
o,
|
|
84
84
|
l,
|
|
85
85
|
a,
|
|
86
|
-
|
|
86
|
+
m,
|
|
87
87
|
s,
|
|
88
88
|
n,
|
|
89
89
|
d
|
|
@@ -108,64 +108,64 @@ const D = (t, n, d, l, b, r) => {
|
|
|
108
108
|
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
|
|
109
109
|
observations: oe,
|
|
110
110
|
title: ne
|
|
111
|
-
}, de = (t) => ["conceptUuid", t], le = (t, n) => ["observations", t, ...n],
|
|
111
|
+
}, de = (t) => ["conceptUuid", t], le = (t, n) => ["observations", t, ...n], pe = ({ config: t }) => {
|
|
112
112
|
const n = t, {
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), a =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), a = C(), { addNotification: s } = w(), { t: i } = S(), o = te({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => K(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
|
-
|
|
123
|
+
$(() => {
|
|
124
124
|
o.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
|
-
const
|
|
126
|
+
const k = d[h];
|
|
127
127
|
s({
|
|
128
128
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
129
|
-
message: i("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
129
|
+
message: i("ERROR_FETCHING_CONCEPT", { conceptName: k }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(h);
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
134
|
}, [o, d]);
|
|
135
|
-
const
|
|
135
|
+
const m = f(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), p = f(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = f(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
136
136
|
data: c,
|
|
137
137
|
isLoading: F,
|
|
138
|
-
isError:
|
|
138
|
+
isError: g,
|
|
139
139
|
refetch: R
|
|
140
140
|
} = ae({
|
|
141
|
-
queryKey: le(a,
|
|
142
|
-
queryFn: () =>
|
|
143
|
-
enabled: !!a &&
|
|
141
|
+
queryKey: le(a, p),
|
|
142
|
+
queryFn: () => M(a, p),
|
|
143
|
+
enabled: !!a && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
P(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
|
-
(h) =>
|
|
148
|
+
(h) => p.includes(h)
|
|
149
149
|
) && R();
|
|
150
150
|
},
|
|
151
151
|
[a, R]
|
|
152
|
-
),
|
|
153
|
-
|
|
152
|
+
), $(() => {
|
|
153
|
+
g && s({
|
|
154
154
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
155
155
|
message: i("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
|
-
}, [
|
|
159
|
-
const
|
|
158
|
+
}, [g]);
|
|
159
|
+
const T = f(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
161
|
+
const e = Q(c), h = j(e);
|
|
162
|
+
return x(h);
|
|
163
163
|
}, [c]), q = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], _ = F || !y, O = g && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, B = O ? i("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? i("NO_OBSERVATIONS_FOUND") : void 0, V = T.length > 0 && !_ && !O, E = n.titleTranslationKey, v = E ? i(E) : "";
|
|
168
|
+
return /* @__PURE__ */ N(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
@@ -174,7 +174,7 @@ const D = (t, n, d, l, b, r) => {
|
|
|
174
174
|
className: I.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
G,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
@@ -183,22 +183,22 @@ const D = (t, n, d, l, b, r) => {
|
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
V ? /* @__PURE__ */ u(
|
|
187
187
|
ie,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: T,
|
|
190
190
|
title: v,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
H,
|
|
195
195
|
{
|
|
196
196
|
headers: q,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: i("OBSERVATIONS"),
|
|
199
|
-
loading:
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
199
|
+
loading: _,
|
|
200
|
+
errorStateMessage: B,
|
|
201
|
+
emptyStateMessage: L,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -208,6 +208,6 @@ const D = (t, n, d, l, b, r) => {
|
|
|
208
208
|
};
|
|
209
209
|
export {
|
|
210
210
|
de as conceptUuidQueryKeys,
|
|
211
|
-
|
|
211
|
+
pe as default,
|
|
212
212
|
le as observationsQueryKeys
|
|
213
213
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as we, F as z, G as xt, H as B, A as q, C as y, I as Ro, K as ye, S as R, L as _, M as k, O as N, R as A, T as bs, U as ir, W as $e, X as U, Y as Hn, Z as Vn, $ 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 Ur, 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-CMiwOKw0.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|