@bahmni/appointments-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-DfiYQ172.js → DocumentsTable-asIFkp7i-CznVy4o_.js} +34 -34
- package/dist/{FormsTable-BXY2feyi-BdZT4I1H.js → FormsTable-Eps5HHdl-syCZtlUs.js} +64 -64
- package/dist/{LNWAZHJI-BY5aGxON.js → LNWAZHJI-DUv0i-_t.js} +2 -2
- package/dist/{MWZ6AO7Z-CjkrcQyI.js → MWZ6AO7Z-WQKZNlXG.js} +2 -2
- package/dist/{Observations-BEqqihoJ-CoEpsvA3.js → Observations-I6ZLFaJF-CYdSOy68.js} +40 -40
- package/dist/{YPM2AS64-CeVAFQXP.js → YPM2AS64-D7x06CwS.js} +1 -1
- package/dist/{index-CxnXRrUj.js → index-CYdJ-VS1.js} +23 -23
- package/dist/{index-DgXd_LG2.js → index-D9l2Pf2N.js} +40170 -39783
- 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, a as J,
|
|
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, a as J, x as X, N as Z, o as ee, s as te, p as ae } from "./index-D9l2Pf2N.js";
|
|
3
3
|
import { useState as l, useCallback as h, useEffect as f, useMemo as T } from "react";
|
|
4
4
|
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", le = "_documentImage_1voj8_50", d = {
|
|
5
5
|
documentsTableBody: ne,
|
|
@@ -20,41 +20,41 @@ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11",
|
|
|
20
20
|
function j(a) {
|
|
21
21
|
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
22
22
|
}
|
|
23
|
-
function ue(a,
|
|
23
|
+
function ue(a, E) {
|
|
24
24
|
return a.map((s) => ({
|
|
25
25
|
key: s,
|
|
26
|
-
header:
|
|
26
|
+
header: E(me[s])
|
|
27
27
|
}));
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const pe = [
|
|
30
30
|
"documentIdentifier",
|
|
31
31
|
"documentType",
|
|
32
32
|
"uploadedOn",
|
|
33
33
|
"uploadedBy",
|
|
34
34
|
"action"
|
|
35
|
-
],
|
|
36
|
-
const [s, w] = l(!1), [o,
|
|
35
|
+
], _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 }] : [], ge = ({ config: a, encounterUuids: E }) => {
|
|
36
|
+
const [s, w] = l(!1), [o, L] = l(
|
|
37
37
|
null
|
|
38
38
|
), [R, I] = l(
|
|
39
39
|
/* @__PURE__ */ new Set()
|
|
40
|
-
),
|
|
41
|
-
|
|
40
|
+
), g = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = l(1), [m, k] = l($), [V, y] = l(void 0), M = h((e) => {
|
|
41
|
+
L(e), w(!0);
|
|
42
42
|
}, []), F = h(() => {
|
|
43
|
-
w(!1),
|
|
43
|
+
w(!1), L(null), I(/* @__PURE__ */ new Set());
|
|
44
44
|
}, []), b = h((e) => {
|
|
45
45
|
I((t) => new Set(t).add(e));
|
|
46
46
|
}, []), { data: u, isLoading: H, isError: D, error: v } = J({
|
|
47
47
|
queryKey: [
|
|
48
48
|
"documents",
|
|
49
|
-
E,
|
|
50
49
|
g,
|
|
50
|
+
E,
|
|
51
51
|
C,
|
|
52
52
|
m
|
|
53
53
|
],
|
|
54
|
-
enabled: !!
|
|
54
|
+
enabled: !!g,
|
|
55
55
|
queryFn: () => ae(
|
|
56
|
-
E,
|
|
57
56
|
g,
|
|
57
|
+
E,
|
|
58
58
|
m,
|
|
59
59
|
C
|
|
60
60
|
)
|
|
@@ -63,13 +63,13 @@ const _e = [
|
|
|
63
63
|
u && y(u.total);
|
|
64
64
|
}, [u]), f(() => {
|
|
65
65
|
A(1), y(void 0);
|
|
66
|
-
}, [
|
|
67
|
-
D &&
|
|
66
|
+
}, [g]), f(() => {
|
|
67
|
+
D && U({
|
|
68
68
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
69
69
|
message: v?.message ?? "",
|
|
70
70
|
type: "error"
|
|
71
71
|
});
|
|
72
|
-
}, [D, v,
|
|
72
|
+
}, [D, v, U, n]), f(() => {
|
|
73
73
|
const e = new AbortController();
|
|
74
74
|
return (async () => {
|
|
75
75
|
if (!s || !o) return;
|
|
@@ -94,15 +94,15 @@ const _e = [
|
|
|
94
94
|
},
|
|
95
95
|
[m]
|
|
96
96
|
), N = T(
|
|
97
|
-
() => a?.fields ??
|
|
97
|
+
() => a?.fields ?? pe,
|
|
98
98
|
[a?.fields]
|
|
99
|
-
),
|
|
99
|
+
), 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(
|
|
100
100
|
() => N.map((e) => ({
|
|
101
101
|
key: e,
|
|
102
102
|
sortable: e !== "action"
|
|
103
103
|
})),
|
|
104
104
|
[N]
|
|
105
|
-
),
|
|
105
|
+
), p = T(
|
|
106
106
|
() => o ? B(o) : [],
|
|
107
107
|
[o]
|
|
108
108
|
), G = h(
|
|
@@ -124,7 +124,7 @@ const _e = [
|
|
|
124
124
|
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
125
125
|
X,
|
|
126
126
|
{
|
|
127
|
-
onClick: () =>
|
|
127
|
+
onClick: () => M(e),
|
|
128
128
|
className: d.viewAttachmentsLink,
|
|
129
129
|
"data-testid": `view-attachments-${e.id}`,
|
|
130
130
|
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
@@ -134,18 +134,18 @@ const _e = [
|
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
[
|
|
137
|
+
[M, n]
|
|
138
138
|
);
|
|
139
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ _(Y, { children: [
|
|
140
140
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
141
141
|
ee,
|
|
142
142
|
{
|
|
143
|
-
headers:
|
|
143
|
+
headers: P,
|
|
144
144
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
145
|
-
rows:
|
|
145
|
+
rows: x,
|
|
146
146
|
loading: H,
|
|
147
147
|
errorStateMessage: D ? v?.message : null,
|
|
148
|
-
sortable:
|
|
148
|
+
sortable: z,
|
|
149
149
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
150
150
|
renderCell: G,
|
|
151
151
|
className: d.documentsTableBody,
|
|
@@ -167,33 +167,33 @@ const _e = [
|
|
|
167
167
|
passiveModal: !0,
|
|
168
168
|
size: "lg",
|
|
169
169
|
testId: "document-view-modal",
|
|
170
|
-
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children:
|
|
171
|
-
const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) ||
|
|
172
|
-
return c === "#" || O ? /* @__PURE__ */
|
|
170
|
+
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: p.map((e, t) => {
|
|
171
|
+
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);
|
|
172
|
+
return c === "#" || O ? /* @__PURE__ */ _(
|
|
173
173
|
"div",
|
|
174
174
|
{
|
|
175
175
|
className: d.attachmentError,
|
|
176
176
|
"data-testid": `attachment-error-${t}`,
|
|
177
177
|
children: [
|
|
178
|
-
|
|
178
|
+
p.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
|
|
179
179
|
t + 1,
|
|
180
180
|
"/",
|
|
181
|
-
|
|
181
|
+
p.length
|
|
182
182
|
] }),
|
|
183
183
|
/* @__PURE__ */ r("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
184
184
|
]
|
|
185
185
|
},
|
|
186
186
|
`${o.id}-${e.url}`
|
|
187
|
-
) : /* @__PURE__ */
|
|
187
|
+
) : /* @__PURE__ */ _(
|
|
188
188
|
"div",
|
|
189
189
|
{
|
|
190
190
|
className: d.attachmentItem,
|
|
191
191
|
"data-testid": `attachment-item-${t}`,
|
|
192
192
|
children: [
|
|
193
|
-
|
|
193
|
+
p.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
|
|
194
194
|
t + 1,
|
|
195
195
|
"/",
|
|
196
|
-
|
|
196
|
+
p.length
|
|
197
197
|
] }),
|
|
198
198
|
S ? /* @__PURE__ */ r(
|
|
199
199
|
"img",
|
|
@@ -222,5 +222,5 @@ const _e = [
|
|
|
222
222
|
] });
|
|
223
223
|
};
|
|
224
224
|
export {
|
|
225
|
-
|
|
225
|
+
ge as default
|
|
226
226
|
};
|
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import { jsx as o, jsxs as W, Fragment as X } from "react/jsx-runtime";
|
|
2
|
-
import { u as Z, t as ee,
|
|
3
|
-
import { useState as
|
|
4
|
-
const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6",
|
|
2
|
+
import { u as Z, t as ee, g as re, b as ae, a as c, k as te, V as v, N as se, x as oe, o as q, J as ne, Q as de, s as ie, c as ue, d as me, h as le, e as ce, f as fe, i as ye } from "./index-D9l2Pf2N.js";
|
|
3
|
+
import { useState as C, useMemo as d, useCallback as f } from "react";
|
|
4
|
+
const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", I = {
|
|
5
5
|
formsTableBody: be,
|
|
6
6
|
customAccordianItem: Ne
|
|
7
|
-
},
|
|
7
|
+
}, ge = (u) => u ? u.extension?.find(
|
|
8
8
|
(n) => n.url === me
|
|
9
|
-
)?.valueString : void 0,
|
|
9
|
+
)?.valueString : void 0, Oe = ({
|
|
10
10
|
episodeOfCareUuids: u,
|
|
11
11
|
encounterUuids: n,
|
|
12
|
-
config:
|
|
12
|
+
config: S
|
|
13
13
|
}) => {
|
|
14
|
-
const { t: s } = Z(), m = ee(), [l,
|
|
14
|
+
const { t: s } = Z(), m = ee(), [l, O] = C(!1), [t, A] = C(null), { numberOfVisits: k, hideThumbnail: x = !1 } = S ?? {}, T = re(
|
|
15
15
|
u,
|
|
16
16
|
n
|
|
17
|
-
),
|
|
17
|
+
), V = ae(), {
|
|
18
18
|
data: y = [],
|
|
19
|
-
isLoading:
|
|
20
|
-
isError:
|
|
21
|
-
error:
|
|
22
|
-
refetch:
|
|
19
|
+
isLoading: B,
|
|
20
|
+
isError: E,
|
|
21
|
+
error: H,
|
|
22
|
+
refetch: K
|
|
23
23
|
} = c({
|
|
24
24
|
queryKey: ["forms", m, u],
|
|
25
25
|
queryFn: () => le(m, void 0, k),
|
|
26
|
-
enabled: !!m && !
|
|
27
|
-
}),
|
|
26
|
+
enabled: !!m && !T
|
|
27
|
+
}), _ = d(() => !n || n.length === 0 ? y : y.filter(
|
|
28
28
|
(e) => n.includes(e.encounterUuid)
|
|
29
|
-
), [y, n]), { data:
|
|
29
|
+
), [y, n]), { data: F = [] } = c({
|
|
30
30
|
queryKey: ["observationForms"],
|
|
31
31
|
queryFn: () => ce()
|
|
32
|
-
}),
|
|
33
|
-
(e) =>
|
|
34
|
-
[
|
|
32
|
+
}), L = f(
|
|
33
|
+
(e) => F.find((r) => r.name === e)?.uuid,
|
|
34
|
+
[F]
|
|
35
35
|
), b = d(() => {
|
|
36
36
|
if (t)
|
|
37
|
-
return
|
|
38
|
-
}, [t,
|
|
39
|
-
isLoading:
|
|
40
|
-
isError:
|
|
37
|
+
return L(t.formName);
|
|
38
|
+
}, [t, L]), {
|
|
39
|
+
isLoading: Q,
|
|
40
|
+
isError: j,
|
|
41
41
|
error: N
|
|
42
42
|
} = c({
|
|
43
43
|
queryKey: ["formMetadata", b],
|
|
44
44
|
queryFn: () => fe(b),
|
|
45
45
|
enabled: !!b && l
|
|
46
46
|
}), {
|
|
47
|
-
data:
|
|
47
|
+
data: g,
|
|
48
48
|
isLoading: $,
|
|
49
49
|
isError: w,
|
|
50
|
-
error:
|
|
50
|
+
error: h
|
|
51
51
|
} = c({
|
|
52
52
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
53
53
|
queryFn: () => ye(t.encounterUuid),
|
|
@@ -55,41 +55,41 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
|
|
|
55
55
|
});
|
|
56
56
|
te(
|
|
57
57
|
(e) => {
|
|
58
|
-
e.patientUUID === m && e.updatedConcepts.size > 0 && (
|
|
58
|
+
e.patientUUID === m && e.updatedConcepts.size > 0 && (K(), V.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
59
59
|
},
|
|
60
60
|
[m]
|
|
61
61
|
);
|
|
62
|
-
const
|
|
63
|
-
const r =
|
|
62
|
+
const z = d(() => !g?.entry || !t?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
63
|
+
const r = ge(e);
|
|
64
64
|
return !r || r.includes(t.formName);
|
|
65
|
-
}), [
|
|
65
|
+
}), [g, t?.formName]), G = d(() => {
|
|
66
66
|
if (N)
|
|
67
|
-
return
|
|
68
|
-
if (
|
|
69
|
-
return
|
|
70
|
-
}, [N,
|
|
67
|
+
return v(N).message;
|
|
68
|
+
if (h)
|
|
69
|
+
return v(h).message;
|
|
70
|
+
}, [N, h]), M = d(
|
|
71
71
|
() => [
|
|
72
72
|
{ key: "recordedOn", header: s("RECORDED_ON") },
|
|
73
73
|
{ key: "recordedBy", header: s("RECORDED_BY") }
|
|
74
74
|
],
|
|
75
75
|
[s]
|
|
76
|
-
),
|
|
76
|
+
), J = d(
|
|
77
77
|
() => [
|
|
78
78
|
{ key: "recordedOn", sortable: !0 },
|
|
79
79
|
{ key: "recordedBy", sortable: !0 }
|
|
80
80
|
],
|
|
81
81
|
[]
|
|
82
|
-
),
|
|
83
|
-
const e =
|
|
82
|
+
), D = d(() => {
|
|
83
|
+
const e = _.reduce(
|
|
84
84
|
(r, a) => {
|
|
85
85
|
const i = a.formName;
|
|
86
86
|
r[i] ??= [];
|
|
87
|
-
const
|
|
87
|
+
const p = a.providers.map((Y) => Y.providerName).filter(Boolean).join(", ");
|
|
88
88
|
return r[i].push({
|
|
89
89
|
id: a.encounterUuid,
|
|
90
90
|
formName: a.formName,
|
|
91
91
|
recordedOn: se(a.encounterDateTime, s, !0).formattedResult,
|
|
92
|
-
recordedBy:
|
|
92
|
+
recordedBy: p ?? "--",
|
|
93
93
|
encounterDateTime: a.encounterDateTime,
|
|
94
94
|
encounterUuid: a.encounterUuid
|
|
95
95
|
}), r;
|
|
@@ -100,15 +100,15 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
|
|
|
100
100
|
([r, a]) => ({
|
|
101
101
|
formName: r,
|
|
102
102
|
records: a.sort(
|
|
103
|
-
(i,
|
|
103
|
+
(i, p) => p.encounterDateTime - i.encounterDateTime
|
|
104
104
|
)
|
|
105
105
|
})
|
|
106
106
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
107
|
-
}, [
|
|
108
|
-
|
|
109
|
-
}, []),
|
|
110
|
-
|
|
111
|
-
}, []),
|
|
107
|
+
}, [_, s]), R = f((e) => {
|
|
108
|
+
A(e), O(!0);
|
|
109
|
+
}, []), P = f(() => {
|
|
110
|
+
O(!1), A(null);
|
|
111
|
+
}, []), U = f(
|
|
112
112
|
(e, r) => {
|
|
113
113
|
switch (r) {
|
|
114
114
|
case "recordedOn":
|
|
@@ -122,40 +122,40 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
|
|
|
122
122
|
[R]
|
|
123
123
|
);
|
|
124
124
|
return /* @__PURE__ */ W(X, { children: [
|
|
125
|
-
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children:
|
|
126
|
-
|
|
125
|
+
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: B || E || D.length === 0 || T ? /* @__PURE__ */ o(
|
|
126
|
+
q,
|
|
127
127
|
{
|
|
128
|
-
headers:
|
|
128
|
+
headers: M,
|
|
129
129
|
ariaLabel: s("FORMS_HEADING"),
|
|
130
130
|
rows: [],
|
|
131
|
-
loading:
|
|
132
|
-
errorStateMessage:
|
|
131
|
+
loading: B,
|
|
132
|
+
errorStateMessage: E ? H?.message : void 0,
|
|
133
133
|
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
134
|
-
renderCell:
|
|
135
|
-
className:
|
|
134
|
+
renderCell: U,
|
|
135
|
+
className: I.formsTableBody,
|
|
136
136
|
dataTestId: "forms-table"
|
|
137
137
|
}
|
|
138
|
-
) : /* @__PURE__ */ o(ne, { align: "start", children:
|
|
138
|
+
) : /* @__PURE__ */ o(ne, { align: "start", children: D.map((e, r) => {
|
|
139
139
|
const { formName: a, records: i } = e;
|
|
140
140
|
return /* @__PURE__ */ o(
|
|
141
141
|
de,
|
|
142
142
|
{
|
|
143
143
|
title: a,
|
|
144
|
-
className:
|
|
144
|
+
className: I.customAccordianItem,
|
|
145
145
|
testId: `accordian-title-${a}`,
|
|
146
146
|
open: r === 0,
|
|
147
147
|
children: /* @__PURE__ */ o(
|
|
148
|
-
|
|
148
|
+
q,
|
|
149
149
|
{
|
|
150
|
-
headers:
|
|
150
|
+
headers: M,
|
|
151
151
|
ariaLabel: s("FORMS_HEADING"),
|
|
152
152
|
rows: i,
|
|
153
153
|
loading: !1,
|
|
154
154
|
errorStateMessage: "",
|
|
155
|
-
sortable:
|
|
155
|
+
sortable: J,
|
|
156
156
|
emptyStateMessage: s("FORMS_UNAVAILABLE"),
|
|
157
|
-
renderCell:
|
|
158
|
-
className:
|
|
157
|
+
renderCell: U,
|
|
158
|
+
className: I.formsTableBody,
|
|
159
159
|
dataTestId: `forms-table-${a}`
|
|
160
160
|
}
|
|
161
161
|
)
|
|
@@ -169,7 +169,7 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
|
|
|
169
169
|
id: "modalIdForActionAreaLayout",
|
|
170
170
|
portalId: "main-display-area",
|
|
171
171
|
open: l,
|
|
172
|
-
onRequestClose:
|
|
172
|
+
onRequestClose: P,
|
|
173
173
|
modalHeading: t.formName,
|
|
174
174
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
175
175
|
passiveModal: !0,
|
|
@@ -178,13 +178,13 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
|
|
|
178
178
|
children: /* @__PURE__ */ o(
|
|
179
179
|
ue,
|
|
180
180
|
{
|
|
181
|
-
observations:
|
|
182
|
-
isLoading:
|
|
183
|
-
isError:
|
|
184
|
-
errorMessage:
|
|
181
|
+
observations: z,
|
|
182
|
+
isLoading: Q || $,
|
|
183
|
+
isError: j || w,
|
|
184
|
+
errorMessage: G,
|
|
185
185
|
emptyStateMessage: s("NO_FORM_DATA_AVAILABLE"),
|
|
186
186
|
testIdPrefix: t.formName,
|
|
187
|
-
hideThumbnail:
|
|
187
|
+
hideThumbnail: x
|
|
188
188
|
}
|
|
189
189
|
)
|
|
190
190
|
}
|
|
@@ -192,5 +192,5 @@ const be = "_formsTableBody_81hra_1", Ne = "_customAccordianItem_81hra_6", O = {
|
|
|
192
192
|
] });
|
|
193
193
|
};
|
|
194
194
|
export {
|
|
195
|
-
|
|
195
|
+
Oe as default
|
|
196
196
|
};
|
|
@@ -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 { X as d, Y as f, Z as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-D7x06CwS.js";
|
|
2
|
+
import { X as d, Y as f, Z as e } from "./index-D9l2Pf2N.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 { X as v, Y as C, Z 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-D7x06CwS.js";
|
|
2
|
+
import { X as v, Y as C, Z as e } from "./index-D9l2Pf2N.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { t as
|
|
3
|
-
import { useRef as se, useEffect as
|
|
1
|
+
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { t as k, r as w, u as S, j as K, l as M, a as P, k as Q, v as j, E as x, y as G, m as H, o as z, w as Y, P as U, n as J, q as W, B as X, z as Z, _ as ee, A as ae, C as te } from "./index-D9l2Pf2N.js";
|
|
3
|
+
import { useRef as se, useEffect as $, useMemo as g } from "react";
|
|
4
4
|
const A = (a, n, d, l, b, r) => {
|
|
5
5
|
const t = J(a, n, b), s = t.value, i = W(s);
|
|
6
6
|
let o = s;
|
|
@@ -20,15 +20,15 @@ const A = (a, n, d, l, b, r) => {
|
|
|
20
20
|
hideThumbnail: r
|
|
21
21
|
}
|
|
22
22
|
)), i === "PDF" && (o = /* @__PURE__ */ u(ae, { id: `${s}-pdf`, src: s }));
|
|
23
|
-
const
|
|
23
|
+
const m = b("OBSERVATIONS_RECORDED_BY", {
|
|
24
24
|
provider: t.provider
|
|
25
|
-
}),
|
|
25
|
+
}), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
|
|
26
26
|
return /* @__PURE__ */ u(
|
|
27
27
|
X,
|
|
28
28
|
{
|
|
29
29
|
header: t.header,
|
|
30
30
|
value: o,
|
|
31
|
-
info:
|
|
31
|
+
info: m,
|
|
32
32
|
id: c,
|
|
33
33
|
testId: c,
|
|
34
34
|
ariaLabel: c
|
|
@@ -58,9 +58,9 @@ const A = (a, n, d, l, b, r) => {
|
|
|
58
58
|
title: n = "",
|
|
59
59
|
hideThumbnail: d
|
|
60
60
|
}) => {
|
|
61
|
-
const { t: l } =
|
|
61
|
+
const { t: l } = S(), b = (r, t, s) => {
|
|
62
62
|
const i = Y(r.encounterDetails, l);
|
|
63
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ N(
|
|
64
64
|
U,
|
|
65
65
|
{
|
|
66
66
|
title: i,
|
|
@@ -68,9 +68,9 @@ const A = (a, n, d, l, b, r) => {
|
|
|
68
68
|
open: t,
|
|
69
69
|
children: [
|
|
70
70
|
r.observations.map(
|
|
71
|
-
(o,
|
|
71
|
+
(o, m) => A(
|
|
72
72
|
o,
|
|
73
|
-
|
|
73
|
+
m,
|
|
74
74
|
s,
|
|
75
75
|
n,
|
|
76
76
|
l,
|
|
@@ -78,11 +78,11 @@ const A = (a, n, d, l, b, r) => {
|
|
|
78
78
|
)
|
|
79
79
|
),
|
|
80
80
|
r.groupedObservations.map(
|
|
81
|
-
(o,
|
|
81
|
+
(o, m) => re(
|
|
82
82
|
o,
|
|
83
83
|
l,
|
|
84
84
|
t,
|
|
85
|
-
|
|
85
|
+
m,
|
|
86
86
|
s,
|
|
87
87
|
n,
|
|
88
88
|
d
|
|
@@ -107,19 +107,19 @@ const A = (a, n, d, l, b, r) => {
|
|
|
107
107
|
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
|
|
108
108
|
observations: oe,
|
|
109
109
|
title: ne
|
|
110
|
-
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n],
|
|
110
|
+
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], me = ({ config: a }) => {
|
|
111
111
|
const n = a, {
|
|
112
112
|
conceptNames: d = [],
|
|
113
113
|
conceptUuid: l = [],
|
|
114
114
|
hideThumbnail: b = !1
|
|
115
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t =
|
|
115
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = k(), { addNotification: s } = w(), { t: i } = S(), o = K({
|
|
116
116
|
queries: d.map((e) => ({
|
|
117
117
|
queryKey: de(e),
|
|
118
|
-
queryFn: () =>
|
|
118
|
+
queryFn: () => M(e),
|
|
119
119
|
enabled: !!e
|
|
120
120
|
}))
|
|
121
121
|
});
|
|
122
|
-
|
|
122
|
+
$(() => {
|
|
123
123
|
o.forEach((e, h) => {
|
|
124
124
|
if (e.isError && !r.current.has(h)) {
|
|
125
125
|
const V = d[h];
|
|
@@ -131,40 +131,40 @@ const A = (a, n, d, l, b, r) => {
|
|
|
131
131
|
} else e.isError || r.current.delete(h);
|
|
132
132
|
});
|
|
133
133
|
}, [o, d]);
|
|
134
|
-
const
|
|
134
|
+
const m = g(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), p = g(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = g(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
135
135
|
data: c,
|
|
136
136
|
isLoading: D,
|
|
137
137
|
isError: R,
|
|
138
|
-
refetch:
|
|
139
|
-
} =
|
|
140
|
-
queryKey: le(t,
|
|
141
|
-
queryFn: () => te(t,
|
|
142
|
-
enabled: !!t &&
|
|
138
|
+
refetch: T
|
|
139
|
+
} = P({
|
|
140
|
+
queryKey: le(t, p),
|
|
141
|
+
queryFn: () => te(t, p),
|
|
142
|
+
enabled: !!t && p.length > 0 && y
|
|
143
143
|
});
|
|
144
|
-
|
|
144
|
+
Q(
|
|
145
145
|
(e) => {
|
|
146
146
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
147
|
-
(h) =>
|
|
148
|
-
) &&
|
|
147
|
+
(h) => p.includes(h)
|
|
148
|
+
) && T();
|
|
149
149
|
},
|
|
150
|
-
[t,
|
|
151
|
-
),
|
|
150
|
+
[t, T]
|
|
151
|
+
), $(() => {
|
|
152
152
|
R && s({
|
|
153
153
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
154
154
|
message: i("ERROR_FETCHING_OBSERVATIONS"),
|
|
155
155
|
type: "error"
|
|
156
156
|
});
|
|
157
157
|
}, [R]);
|
|
158
|
-
const
|
|
158
|
+
const _ = g(() => {
|
|
159
159
|
if (!c) return [];
|
|
160
|
-
const e =
|
|
161
|
-
return
|
|
160
|
+
const e = j(c), h = x(e);
|
|
161
|
+
return G(h);
|
|
162
162
|
}, [c]), F = [
|
|
163
163
|
{ key: "name", header: "name" },
|
|
164
164
|
{ key: "value", header: "value" },
|
|
165
165
|
{ key: "form", header: "form" }
|
|
166
|
-
],
|
|
167
|
-
return /* @__PURE__ */
|
|
166
|
+
], f = D || !y, O = R && y, q = (!c || c.entry?.length === 0 || p.length === 0) && y, B = O ? i("ERROR_FETCHING_OBSERVATIONS") : null, C = q ? i("NO_OBSERVATIONS_FOUND") : void 0, L = _.length > 0 && !f && !O, E = n.titleTranslationKey, v = E ? i(E) : "";
|
|
167
|
+
return /* @__PURE__ */ N(
|
|
168
168
|
"div",
|
|
169
169
|
{
|
|
170
170
|
id: "observations",
|
|
@@ -173,7 +173,7 @@ const A = (a, n, d, l, b, r) => {
|
|
|
173
173
|
className: I.observations,
|
|
174
174
|
children: [
|
|
175
175
|
/* @__PURE__ */ u(
|
|
176
|
-
|
|
176
|
+
H,
|
|
177
177
|
{
|
|
178
178
|
id: "observations-title",
|
|
179
179
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
@@ -182,22 +182,22 @@ const A = (a, n, d, l, b, r) => {
|
|
|
182
182
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
|
|
185
|
+
L ? /* @__PURE__ */ u(
|
|
186
186
|
ie,
|
|
187
187
|
{
|
|
188
|
-
groupedData:
|
|
188
|
+
groupedData: _,
|
|
189
189
|
title: v,
|
|
190
190
|
hideThumbnail: b
|
|
191
191
|
}
|
|
192
192
|
) : /* @__PURE__ */ u(
|
|
193
|
-
|
|
193
|
+
z,
|
|
194
194
|
{
|
|
195
195
|
headers: F,
|
|
196
196
|
rows: [],
|
|
197
197
|
ariaLabel: i("OBSERVATIONS"),
|
|
198
|
-
loading:
|
|
199
|
-
errorStateMessage:
|
|
200
|
-
emptyStateMessage:
|
|
198
|
+
loading: f,
|
|
199
|
+
errorStateMessage: B,
|
|
200
|
+
emptyStateMessage: C,
|
|
201
201
|
dataTestId: "observations-table"
|
|
202
202
|
}
|
|
203
203
|
)
|
|
@@ -207,6 +207,6 @@ const A = (a, n, d, l, b, r) => {
|
|
|
207
207
|
};
|
|
208
208
|
export {
|
|
209
209
|
de as conceptUuidQueryKeys,
|
|
210
|
-
|
|
210
|
+
me as default,
|
|
211
211
|
le as observationsQueryKeys
|
|
212
212
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as we, a0 as z, a1 as xt, a2 as B, Y as q, Z as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-D9l2Pf2N.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|