@bahmni/registration-app 0.0.1-dev.219 → 0.0.1-dev.221
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-DGCf8sB7-DfwbBEkq.js → DocumentsTable-BZHe_sb0-C2zG0GwF.js} +21 -21
- package/dist/{FormsTable-Cngf3xjx-2LuJ_pWR.js → FormsTable-BztxQbBL-CLxpjuZi.js} +73 -73
- package/dist/{LNWAZHJI-tcOPJnEl.js → LNWAZHJI-DXQQ0dPM.js} +10 -10
- package/dist/{MWZ6AO7Z-BXeK3khR.js → MWZ6AO7Z-rDk_b_dN.js} +7 -7
- package/dist/{Observations-BTspCmvP-DH-HxWsf.js → Observations-Cnt-RGWx-11A1fxdA.js} +41 -41
- package/dist/{YPM2AS64-CnNXh1qY.js → YPM2AS64-DHZ5z7U1.js} +309 -309
- package/dist/{index-B_QFxkcq.js → index-Mm75tbmR.js} +31354 -30862
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { t as K, u as Q, r as W, a as J, M as X, N as Z, o as ee, s as te } from "./index-Mm75tbmR.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,10 +21,10 @@ 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, g) {
|
|
25
25
|
return a.map((s) => ({
|
|
26
26
|
key: s,
|
|
27
|
-
header:
|
|
27
|
+
header: g(le[s])
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
30
|
const _e = [
|
|
@@ -33,29 +33,29 @@ const _e = [
|
|
|
33
33
|
"uploadedOn",
|
|
34
34
|
"uploadedBy",
|
|
35
35
|
"action"
|
|
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:
|
|
37
|
-
const [s, w] = m(!1), [o,
|
|
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: g }) => {
|
|
37
|
+
const [s, w] = m(!1), [o, M] = m(
|
|
38
38
|
null
|
|
39
39
|
), [R, I] = m(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
),
|
|
42
|
-
|
|
41
|
+
), E = K(), { t: n } = Q(), { addNotification: L } = W(), $ = Number(a?.pageSize) || 5, [C, A] = m(1), [l, k] = m($), [V, y] = m(void 0), U = h((e) => {
|
|
42
|
+
M(e), w(!0);
|
|
43
43
|
}, []), F = h(() => {
|
|
44
|
-
w(!1),
|
|
45
|
-
}, []),
|
|
44
|
+
w(!1), M(null), I(/* @__PURE__ */ new Set());
|
|
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
|
-
g,
|
|
51
50
|
E,
|
|
51
|
+
g,
|
|
52
52
|
C,
|
|
53
53
|
l
|
|
54
54
|
],
|
|
55
|
-
enabled: !!
|
|
55
|
+
enabled: !!E,
|
|
56
56
|
queryFn: () => J(
|
|
57
|
-
g,
|
|
58
57
|
E,
|
|
58
|
+
g,
|
|
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
|
+
}, [E]), f(() => {
|
|
68
|
+
D && L({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: v?.message ?? "",
|
|
71
71
|
type: "error"
|
|
72
72
|
});
|
|
73
|
-
}, [D, v,
|
|
73
|
+
}, [D, v, L, n]), f(() => {
|
|
74
74
|
const e = new AbortController();
|
|
75
75
|
return (async () => {
|
|
76
76
|
if (!s || !o) return;
|
|
@@ -91,7 +91,7 @@ const _e = [
|
|
|
91
91
|
}, [s, o]);
|
|
92
92
|
const q = h(
|
|
93
93
|
(e, t) => {
|
|
94
|
-
t !== l ? (
|
|
94
|
+
t !== l ? (k(t), A(1), y(void 0)) : A(e);
|
|
95
95
|
},
|
|
96
96
|
[l]
|
|
97
97
|
), N = T(
|
|
@@ -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: () => U(e),
|
|
129
129
|
className: d.viewAttachmentsLink,
|
|
130
130
|
"data-testid": `view-attachments-${e.id}`,
|
|
131
131
|
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
@@ -135,7 +135,7 @@ const _e = [
|
|
|
135
135
|
return null;
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
|
-
[
|
|
138
|
+
[U, n]
|
|
139
139
|
);
|
|
140
140
|
return /* @__PURE__ */ p(Y, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
@@ -152,7 +152,7 @@ const _e = [
|
|
|
152
152
|
className: d.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: l,
|
|
155
|
-
totalItems:
|
|
155
|
+
totalItems: V,
|
|
156
156
|
page: C,
|
|
157
157
|
onPageChange: q
|
|
158
158
|
}
|
|
@@ -202,7 +202,7 @@ const _e = [
|
|
|
202
202
|
src: c,
|
|
203
203
|
alt: o.documentIdentifier,
|
|
204
204
|
className: d.documentImage,
|
|
205
|
-
onError: () =>
|
|
205
|
+
onError: () => b(t)
|
|
206
206
|
}
|
|
207
207
|
) : /* @__PURE__ */ r(
|
|
208
208
|
"iframe",
|
|
@@ -210,7 +210,7 @@ const _e = [
|
|
|
210
210
|
src: i ? `${c}#toolbar=0` : c,
|
|
211
211
|
className: d.documentIframe,
|
|
212
212
|
title: o.documentIdentifier,
|
|
213
|
-
onError: () =>
|
|
213
|
+
onError: () => b(t)
|
|
214
214
|
}
|
|
215
215
|
)
|
|
216
216
|
]
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as s, jsxs as Y, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { u as W, t as ee, m as re, b as ae, X as te, e as oe, Q as se, k as ne, V as U, N as de, M as ie, o as S, G as me, J as ue, s as le, Z as ce, c as fe } from "./index-Mm75tbmR.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 q, 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
|
-
}, pe = (
|
|
7
|
+
customAccordianItem: Ne
|
|
8
|
+
}, pe = (m) => m ? m.extension?.find(
|
|
9
9
|
(n) => n.url === fe
|
|
10
|
-
)?.valueString : void 0,
|
|
11
|
-
episodeOfCareUuids:
|
|
10
|
+
)?.valueString : void 0, Ae = ({
|
|
11
|
+
episodeOfCareUuids: m,
|
|
12
12
|
encounterUuids: n,
|
|
13
13
|
config: C
|
|
14
14
|
}) => {
|
|
15
|
-
const { t: o } =
|
|
16
|
-
|
|
15
|
+
const { t: o } = W(), u = ee(), [l, O] = q(!1), [t, A] = q(null), { numberOfVisits: k, hideThumbnail: V = !1 } = C ?? {}, M = re(
|
|
16
|
+
m,
|
|
17
17
|
n
|
|
18
|
-
),
|
|
18
|
+
), G = ye(), {
|
|
19
19
|
data: y = [],
|
|
20
20
|
isLoading: T,
|
|
21
|
-
isError:
|
|
22
|
-
error:
|
|
23
|
-
refetch:
|
|
21
|
+
isError: B,
|
|
22
|
+
error: H,
|
|
23
|
+
refetch: K
|
|
24
24
|
} = c({
|
|
25
|
-
queryKey: ["forms",
|
|
26
|
-
queryFn: () => ae(
|
|
27
|
-
enabled: !!
|
|
28
|
-
}),
|
|
25
|
+
queryKey: ["forms", u, m],
|
|
26
|
+
queryFn: () => ae(u, void 0, k),
|
|
27
|
+
enabled: !!u && !M
|
|
28
|
+
}), E = 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
|
+
}), _ = 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 _(t.formName);
|
|
39
|
+
}, [t, _]), {
|
|
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
48
|
data: p,
|
|
49
|
-
isLoading:
|
|
50
|
-
isError:
|
|
51
|
-
error:
|
|
49
|
+
isLoading: x,
|
|
50
|
+
isError: $,
|
|
51
|
+
error: g
|
|
52
52
|
} = c({
|
|
53
53
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
54
54
|
queryFn: () => se(t.encounterUuid),
|
|
@@ -56,41 +56,41 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
|
|
|
56
56
|
});
|
|
57
57
|
ne(
|
|
58
58
|
(e) => {
|
|
59
|
-
e.patientUUID ===
|
|
59
|
+
e.patientUUID === u && e.updatedConcepts.size > 0 && (K(), G.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
60
60
|
},
|
|
61
|
-
[
|
|
61
|
+
[u]
|
|
62
62
|
);
|
|
63
|
-
const
|
|
63
|
+
const w = d(() => !p?.entry || !t?.formName ? [] : p.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
64
64
|
const r = pe(e);
|
|
65
65
|
return !r || r.includes(t.formName);
|
|
66
|
-
}), [p, t?.formName]),
|
|
66
|
+
}), [p, t?.formName]), z = d(() => {
|
|
67
|
+
if (N)
|
|
68
|
+
return U(N).message;
|
|
67
69
|
if (g)
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
return R(h).message;
|
|
71
|
-
}, [g, h]), F = d(
|
|
70
|
+
return U(g).message;
|
|
71
|
+
}, [N, g]), L = 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 = E.reduce(
|
|
85
85
|
(r, a) => {
|
|
86
86
|
const i = a.formName;
|
|
87
87
|
r[i] ??= [];
|
|
88
|
-
const
|
|
88
|
+
const h = a.providers.map((X) => X.providerName).filter(Boolean).join(", ");
|
|
89
89
|
return r[i].push({
|
|
90
90
|
id: a.encounterUuid,
|
|
91
91
|
formName: a.formName,
|
|
92
92
|
recordedOn: de(a.encounterDateTime, o, !0).formattedResult,
|
|
93
|
-
recordedBy:
|
|
93
|
+
recordedBy: h ?? "--",
|
|
94
94
|
encounterDateTime: a.encounterDateTime,
|
|
95
95
|
encounterUuid: a.encounterUuid
|
|
96
96
|
}), r;
|
|
@@ -101,62 +101,62 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
|
|
|
101
101
|
([r, a]) => ({
|
|
102
102
|
formName: r,
|
|
103
103
|
records: a.sort(
|
|
104
|
-
(i,
|
|
104
|
+
(i, h) => h.encounterDateTime - i.encounterDateTime
|
|
105
105
|
)
|
|
106
106
|
})
|
|
107
107
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
108
|
-
}, [
|
|
109
|
-
|
|
110
|
-
}, []),
|
|
111
|
-
O(!1),
|
|
112
|
-
}, []),
|
|
108
|
+
}, [E, o]), R = f((e) => {
|
|
109
|
+
A(e), O(!0);
|
|
110
|
+
}, []), P = f(() => {
|
|
111
|
+
O(!1), A(null);
|
|
112
|
+
}, []), v = f(
|
|
113
113
|
(e, r) => {
|
|
114
114
|
switch (r) {
|
|
115
115
|
case "recordedOn":
|
|
116
|
-
return /* @__PURE__ */ s(ie, { onClick: () =>
|
|
116
|
+
return /* @__PURE__ */ s(ie, { onClick: () => R(e), children: e.recordedOn });
|
|
117
117
|
case "recordedBy":
|
|
118
118
|
return e.recordedBy;
|
|
119
119
|
default:
|
|
120
120
|
return null;
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
-
[
|
|
123
|
+
[R]
|
|
124
124
|
);
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: T ||
|
|
127
|
-
|
|
125
|
+
return /* @__PURE__ */ Y(Z, { children: [
|
|
126
|
+
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: T || B || D.length === 0 || M ? /* @__PURE__ */ s(
|
|
127
|
+
S,
|
|
128
128
|
{
|
|
129
|
-
headers:
|
|
129
|
+
headers: L,
|
|
130
130
|
ariaLabel: o("FORMS_HEADING"),
|
|
131
131
|
rows: [],
|
|
132
132
|
loading: T,
|
|
133
|
-
errorStateMessage:
|
|
133
|
+
errorStateMessage: B ? H?.message : void 0,
|
|
134
134
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
135
|
-
renderCell:
|
|
136
|
-
className:
|
|
135
|
+
renderCell: v,
|
|
136
|
+
className: I.formsTableBody,
|
|
137
137
|
dataTestId: "forms-table"
|
|
138
138
|
}
|
|
139
|
-
) : /* @__PURE__ */ s(
|
|
139
|
+
) : /* @__PURE__ */ s(me, { align: "start", children: D.map((e, r) => {
|
|
140
140
|
const { formName: a, records: i } = e;
|
|
141
141
|
return /* @__PURE__ */ s(
|
|
142
|
-
|
|
142
|
+
ue,
|
|
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
|
+
S,
|
|
150
150
|
{
|
|
151
|
-
headers:
|
|
151
|
+
headers: L,
|
|
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: v,
|
|
159
|
+
className: I.formsTableBody,
|
|
160
160
|
dataTestId: `forms-table-${a}`
|
|
161
161
|
}
|
|
162
162
|
)
|
|
@@ -170,7 +170,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
|
|
|
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", ge = "_customAccordianItem_81hra_6", A = {
|
|
|
179
179
|
children: /* @__PURE__ */ s(
|
|
180
180
|
ce,
|
|
181
181
|
{
|
|
182
|
-
observations:
|
|
183
|
-
isLoading:
|
|
184
|
-
isError:
|
|
185
|
-
errorMessage:
|
|
182
|
+
observations: w,
|
|
183
|
+
isLoading: Q || x,
|
|
184
|
+
isError: j || $,
|
|
185
|
+
errorMessage: z,
|
|
186
186
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
187
187
|
testIdPrefix: t.formName,
|
|
188
|
-
hideThumbnail:
|
|
188
|
+
hideThumbnail: V
|
|
189
189
|
}
|
|
190
190
|
)
|
|
191
191
|
}
|
|
@@ -193,5 +193,5 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", A = {
|
|
|
193
193
|
] });
|
|
194
194
|
};
|
|
195
195
|
export {
|
|
196
|
-
|
|
196
|
+
Ae as default
|
|
197
197
|
};
|
|
@@ -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 {
|
|
3
|
-
var
|
|
4
|
-
const [r,
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DHZ5z7U1.js";
|
|
2
|
+
import { w as d, x as f, y as e } from "./index-Mm75tbmR.js";
|
|
3
|
+
var p = (a) => {
|
|
4
|
+
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), n =
|
|
7
|
-
const
|
|
8
|
-
return
|
|
6
|
+
}), n = d(), s = f(() => {
|
|
7
|
+
const o = r.theme_preference || l;
|
|
8
|
+
return o !== "system" ? o : 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: t,
|
|
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: t
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -27,7 +27,7 @@ var f = (a) => {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
}, C =
|
|
30
|
+
}, C = p;
|
|
31
31
|
export {
|
|
32
32
|
C as default
|
|
33
33
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as
|
|
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-DHZ5z7U1.js";
|
|
2
|
+
import { w as v, x as C, y as e } from "./index-Mm75tbmR.js";
|
|
3
3
|
var h = (t) => {
|
|
4
|
-
const [r, o] =
|
|
4
|
+
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a = v(),
|
|
6
|
+
}), a = v(), l = C(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|
|
@@ -16,7 +16,7 @@ var h = (t) => {
|
|
|
16
16
|
setLocalStore: o,
|
|
17
17
|
get children() {
|
|
18
18
|
return e(i.Provider, {
|
|
19
|
-
value:
|
|
19
|
+
value: l,
|
|
20
20
|
get children() {
|
|
21
21
|
return e(m, {
|
|
22
22
|
get children() {
|
|
@@ -36,7 +36,7 @@ var h = (t) => {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
},
|
|
39
|
+
}, p = h;
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
p as default
|
|
42
42
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { t as B, r as K, u as S, Y as G, d as M, k as Q, f as j, l as w, g as x, h as H, o as Y, i as P, O as U, j as z, n as J, I as W, p as X, q as Z, v as ee } from "./index-Mm75tbmR.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as se, useEffect as $, useMemo as
|
|
5
|
-
const
|
|
6
|
-
const t =
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as f } from "react";
|
|
5
|
+
const D = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = z(a, n, b), s = t.value, i = J(s);
|
|
7
7
|
let o = s;
|
|
8
8
|
i === "Image" && (o = /* @__PURE__ */ u(
|
|
9
9
|
X,
|
|
@@ -23,7 +23,7 @@ const U = (a, n, d, l, b, r) => {
|
|
|
23
23
|
)), i === "PDF" && (o = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
24
|
const m = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
25
|
provider: t.provider
|
|
26
|
-
}), p = a.display,
|
|
26
|
+
}), p = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${v}-${p}-${d}-${n}` : `${v}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
28
|
W,
|
|
29
29
|
{
|
|
@@ -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
|
+
U,
|
|
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, i) =>
|
|
46
|
+
(s, i) => D(
|
|
47
47
|
s,
|
|
48
48
|
i,
|
|
49
49
|
b,
|
|
@@ -59,17 +59,17 @@ const U = (a, n, d, l, b, r) => {
|
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } =
|
|
63
|
-
const i =
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
62
|
+
const { t: l } = S(), b = (r, t, s) => {
|
|
63
|
+
const i = P(r.encounterDetails, l);
|
|
64
|
+
return /* @__PURE__ */ N(
|
|
65
|
+
U,
|
|
66
66
|
{
|
|
67
67
|
title: i,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(o, m) =>
|
|
72
|
+
(o, m) => D(
|
|
73
73
|
o,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
@@ -105,7 +105,7 @@ const U = (a, n, d, l, b, r) => {
|
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12",
|
|
108
|
+
}, oe = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
|
|
109
109
|
observations: oe,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
@@ -113,36 +113,36 @@ 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 } = K(), { t: i } =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = B(), { addNotification: s } = K(), { t: i } = S(), o = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => G(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 V = 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: V }),
|
|
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 m =
|
|
135
|
+
const m = f(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), p = f(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), v = f(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
137
|
+
isLoading: F,
|
|
138
138
|
isError: R,
|
|
139
139
|
refetch: T
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
143
|
-
enabled: !!t && p.length > 0 &&
|
|
142
|
+
queryFn: () => M(t, p),
|
|
143
|
+
enabled: !!t && p.length > 0 && v
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
Q(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
@@ -156,49 +156,49 @@ const U = (a, n, d, l, b, r) => {
|
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
158
|
}, [R]);
|
|
159
|
-
const g =
|
|
159
|
+
const g = f(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = j(c), h = w(e);
|
|
162
|
+
return x(h);
|
|
163
|
+
}, [c]), q = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
], O =
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], O = F || !v, _ = R && v, A = (!c || c.entry?.length === 0 || p.length === 0) && v, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, k = A ? i("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !O && !_, E = n.titleTranslationKey, y = E ? i(E) : "";
|
|
168
|
+
return /* @__PURE__ */ N(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
172
|
-
"data-testid":
|
|
172
|
+
"data-testid": E ? `observations-${y}` : "observations",
|
|
173
173
|
"aria-label": "observations-aria-label",
|
|
174
|
-
className:
|
|
174
|
+
className: I.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
H,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
|
-
testId:
|
|
181
|
-
title:
|
|
182
|
-
className:
|
|
183
|
-
children: /* @__PURE__ */ u("p", { children:
|
|
180
|
+
testId: E ? `observations-title-${y}` : "observations-title",
|
|
181
|
+
title: y,
|
|
182
|
+
className: I.title,
|
|
183
|
+
children: /* @__PURE__ */ u("p", { children: y })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
186
|
+
C ? /* @__PURE__ */ u(
|
|
187
187
|
ie,
|
|
188
188
|
{
|
|
189
189
|
groupedData: g,
|
|
190
|
-
title:
|
|
190
|
+
title: y,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
Y,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: q,
|
|
197
197
|
rows: [],
|
|
198
198
|
ariaLabel: i("OBSERVATIONS"),
|
|
199
199
|
loading: O,
|
|
200
200
|
errorStateMessage: L,
|
|
201
|
-
emptyStateMessage:
|
|
201
|
+
emptyStateMessage: k,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|