@bahmni/registration-app 0.0.1-dev.246 → 0.0.1-dev.247
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-YDhjKVF1-CVIrOP5q.js → DocumentsTable-BEZ6qDeD-DnDGRgeF.js} +14 -14
- package/dist/{FormsTable-Db-oc-9c-DxgOa9KC.js → FormsTable-BPfzdJxV-Bqaovluh.js} +47 -47
- package/dist/{LNWAZHJI-DlC_t-NU.js → LNWAZHJI-BVlGXVDe.js} +4 -4
- package/dist/{MWZ6AO7Z-DkSGMBX7.js → MWZ6AO7Z-D3IMiOjO.js} +3 -3
- package/dist/{Observations-DIUn-YMi-S8MUeyA-.js → Observations-Dx_xD9ba-D-wlJQg0.js} +78 -78
- package/dist/{YPM2AS64-zIdfseOL.js → YPM2AS64-D42YfhZD.js} +181 -181
- package/dist/hooks/usePatientPhoto.d.ts +1 -1
- package/dist/{index-DEREz8wc.js → index-BrajMZw_.js} +16206 -16203
- 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 { c as K, u as Q, d as W,
|
|
2
|
+
import { c as K, u as Q, d as W, E as J, l as X, m as Z, a as ee, w as te } from "./index-BrajMZw_.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as h, useEffect as O, 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", le = "_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, E) {
|
|
25
25
|
return a.map((s) => ({
|
|
26
26
|
key: s,
|
|
27
|
-
header:
|
|
27
|
+
header: E(me[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 }] : [], fe = ({ config: a, encounterUuids:
|
|
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 }] : [], fe = ({ config: a, encounterUuids: E }) => {
|
|
37
37
|
const [s, S] = l(!1), [o, L] = l(
|
|
38
38
|
null
|
|
39
39
|
), [R, I] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
),
|
|
41
|
+
), 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) => {
|
|
42
42
|
L(e), S(!0);
|
|
43
43
|
}, []), F = h(() => {
|
|
44
44
|
S(!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
|
m
|
|
54
54
|
],
|
|
55
|
-
enabled: !!
|
|
55
|
+
enabled: !!g,
|
|
56
56
|
queryFn: () => J(
|
|
57
|
-
E,
|
|
58
57
|
g,
|
|
58
|
+
E,
|
|
59
59
|
m,
|
|
60
60
|
C
|
|
61
61
|
)
|
|
@@ -64,7 +64,7 @@ const _e = [
|
|
|
64
64
|
u && y(u.total);
|
|
65
65
|
}, [u]), O(() => {
|
|
66
66
|
A(1), y(void 0);
|
|
67
|
-
}, [
|
|
67
|
+
}, [g]), O(() => {
|
|
68
68
|
D && U({
|
|
69
69
|
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
70
|
message: v?.message ?? "",
|
|
@@ -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,7 +135,7 @@ const _e = [
|
|
|
135
135
|
return null;
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
|
-
[
|
|
138
|
+
[M, n]
|
|
139
139
|
);
|
|
140
140
|
return /* @__PURE__ */ p(Y, { children: [
|
|
141
141
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
@@ -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
1
|
import { jsx as s, jsxs as J, Fragment as W } from "react/jsx-runtime";
|
|
2
|
-
import { u as
|
|
2
|
+
import { u as Z, c as ee, b as re, v as ae, e as te, g as oe, f as se, X as ne, L as U, m as de, l as ie, a as S, x as me, N as ue, w as le, $ as ce, p as fe } from "./index-BrajMZw_.js";
|
|
3
3
|
import { useQueryClient as ye, useQuery as c } from "@tanstack/react-query";
|
|
4
4
|
import { useState as q, useMemo as d, useCallback as f } from "react";
|
|
5
5
|
const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
|
|
6
6
|
formsTableBody: pe,
|
|
7
7
|
customAccordianItem: be
|
|
8
|
-
},
|
|
8
|
+
}, ge = (m) => m ? m.extension?.find(
|
|
9
9
|
(n) => n.url === fe
|
|
10
10
|
)?.valueString : void 0, Ie = ({
|
|
11
11
|
episodeOfCareUuids: m,
|
|
12
12
|
encounterUuids: n,
|
|
13
13
|
config: C
|
|
14
14
|
}) => {
|
|
15
|
-
const { t: o } =
|
|
15
|
+
const { t: o } = Z(), u = ee(), [l, A] = q(!1), [t, I] = q(null), { numberOfVisits: k, hideThumbnail: w = !1 } = C ?? {}, L = re(
|
|
16
16
|
m,
|
|
17
17
|
n
|
|
18
|
-
),
|
|
18
|
+
), x = ye(), {
|
|
19
19
|
data: y = [],
|
|
20
|
-
isLoading:
|
|
21
|
-
isError:
|
|
22
|
-
error:
|
|
20
|
+
isLoading: T,
|
|
21
|
+
isError: B,
|
|
22
|
+
error: $,
|
|
23
23
|
refetch: H
|
|
24
24
|
} = c({
|
|
25
25
|
queryKey: ["forms", u, m],
|
|
26
26
|
queryFn: () => ae(u, void 0, k),
|
|
27
|
-
enabled: !!u && !
|
|
28
|
-
}),
|
|
27
|
+
enabled: !!u && !L
|
|
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: _ = [] } = c({
|
|
31
31
|
queryKey: ["observationForms"],
|
|
32
32
|
queryFn: () => te()
|
|
33
|
-
}),
|
|
34
|
-
(e) =>
|
|
35
|
-
[
|
|
33
|
+
}), v = f(
|
|
34
|
+
(e) => _.find((r) => r.name === e)?.uuid,
|
|
35
|
+
[_]
|
|
36
36
|
), p = d(() => {
|
|
37
37
|
if (t)
|
|
38
|
-
return
|
|
39
|
-
}, [t,
|
|
38
|
+
return v(t.formName);
|
|
39
|
+
}, [t, v]), {
|
|
40
40
|
isLoading: K,
|
|
41
|
-
isError:
|
|
41
|
+
isError: j,
|
|
42
42
|
error: b
|
|
43
43
|
} = c({
|
|
44
44
|
queryKey: ["formMetadata", p],
|
|
45
45
|
queryFn: () => oe(p),
|
|
46
46
|
enabled: !!p && l
|
|
47
47
|
}), {
|
|
48
|
-
data:
|
|
49
|
-
isLoading:
|
|
50
|
-
isError:
|
|
51
|
-
error:
|
|
48
|
+
data: g,
|
|
49
|
+
isLoading: V,
|
|
50
|
+
isError: Q,
|
|
51
|
+
error: N
|
|
52
52
|
} = c({
|
|
53
53
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
54
54
|
queryFn: () => se(t.encounterUuid),
|
|
@@ -56,19 +56,19 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
|
|
|
56
56
|
});
|
|
57
57
|
ne(
|
|
58
58
|
(e) => {
|
|
59
|
-
e.patientUUID === u && e.updatedConcepts.size > 0 && (H(),
|
|
59
|
+
e.patientUUID === u && e.updatedConcepts.size > 0 && (H(), x.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
60
60
|
},
|
|
61
61
|
[u]
|
|
62
62
|
);
|
|
63
|
-
const z = d(() => !
|
|
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
67
|
if (b)
|
|
68
68
|
return U(b).message;
|
|
69
|
-
if (
|
|
70
|
-
return U(
|
|
71
|
-
}, [b,
|
|
69
|
+
if (N)
|
|
70
|
+
return U(N).message;
|
|
71
|
+
}, [b, N]), D = d(
|
|
72
72
|
() => [
|
|
73
73
|
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
74
74
|
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
@@ -80,12 +80,12 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
|
|
|
80
80
|
{ key: "recordedBy", sortable: !0 }
|
|
81
81
|
],
|
|
82
82
|
[]
|
|
83
|
-
),
|
|
84
|
-
const e =
|
|
83
|
+
), F = d(() => {
|
|
84
|
+
const e = E.reduce(
|
|
85
85
|
(r, a) => {
|
|
86
86
|
const i = a.formName;
|
|
87
87
|
r[i] ??= [];
|
|
88
|
-
const h = a.providers.map((
|
|
88
|
+
const h = a.providers.map((Y) => Y.providerName).filter(Boolean).join(", ");
|
|
89
89
|
return r[i].push({
|
|
90
90
|
id: a.encounterUuid,
|
|
91
91
|
formName: a.formName,
|
|
@@ -105,38 +105,38 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
|
|
|
105
105
|
)
|
|
106
106
|
})
|
|
107
107
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
108
|
-
}, [
|
|
108
|
+
}, [E, o]), M = f((e) => {
|
|
109
109
|
I(e), A(!0);
|
|
110
|
-
}, []),
|
|
110
|
+
}, []), X = f(() => {
|
|
111
111
|
A(!1), I(null);
|
|
112
|
-
}, []),
|
|
112
|
+
}, []), R = 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: () => M(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
|
+
[M]
|
|
124
124
|
);
|
|
125
125
|
return /* @__PURE__ */ J(W, { children: [
|
|
126
|
-
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children:
|
|
126
|
+
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: T || B || F.length === 0 || L ? /* @__PURE__ */ s(
|
|
127
127
|
S,
|
|
128
128
|
{
|
|
129
|
-
headers:
|
|
129
|
+
headers: D,
|
|
130
130
|
ariaLabel: o("FORMS_HEADING"),
|
|
131
131
|
rows: [],
|
|
132
|
-
loading:
|
|
133
|
-
errorStateMessage:
|
|
132
|
+
loading: T,
|
|
133
|
+
errorStateMessage: B ? $?.message : void 0,
|
|
134
134
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
135
|
-
renderCell:
|
|
135
|
+
renderCell: R,
|
|
136
136
|
className: O.formsTableBody,
|
|
137
137
|
dataTestId: "forms-table"
|
|
138
138
|
}
|
|
139
|
-
) : /* @__PURE__ */ s(me, { align: "start", children:
|
|
139
|
+
) : /* @__PURE__ */ s(me, { align: "start", children: F.map((e, r) => {
|
|
140
140
|
const { formName: a, records: i } = e;
|
|
141
141
|
return /* @__PURE__ */ s(
|
|
142
142
|
ue,
|
|
@@ -148,14 +148,14 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
|
|
|
148
148
|
children: /* @__PURE__ */ s(
|
|
149
149
|
S,
|
|
150
150
|
{
|
|
151
|
-
headers:
|
|
151
|
+
headers: D,
|
|
152
152
|
ariaLabel: o("FORMS_HEADING"),
|
|
153
153
|
rows: i,
|
|
154
154
|
loading: !1,
|
|
155
155
|
errorStateMessage: "",
|
|
156
156
|
sortable: P,
|
|
157
157
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
158
|
-
renderCell:
|
|
158
|
+
renderCell: R,
|
|
159
159
|
className: O.formsTableBody,
|
|
160
160
|
dataTestId: `forms-table-${a}`
|
|
161
161
|
}
|
|
@@ -170,7 +170,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
|
|
|
170
170
|
id: "modalIdForActionAreaLayout",
|
|
171
171
|
portalId: "main-display-area",
|
|
172
172
|
open: l,
|
|
173
|
-
onRequestClose:
|
|
173
|
+
onRequestClose: X,
|
|
174
174
|
modalHeading: t.formName,
|
|
175
175
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
176
176
|
passiveModal: !0,
|
|
@@ -180,12 +180,12 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
|
|
|
180
180
|
ce,
|
|
181
181
|
{
|
|
182
182
|
observations: z,
|
|
183
|
-
isLoading: K ||
|
|
184
|
-
isError:
|
|
183
|
+
isLoading: K || V,
|
|
184
|
+
isError: j || Q,
|
|
185
185
|
errorMessage: G,
|
|
186
186
|
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
187
187
|
testIdPrefix: t.formName,
|
|
188
|
-
hideThumbnail:
|
|
188
|
+
hideThumbnail: w
|
|
189
189
|
}
|
|
190
190
|
)
|
|
191
191
|
}
|
|
@@ -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-D42YfhZD.js";
|
|
2
|
+
import { y as d, z as f, A as e } from "./index-BrajMZw_.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
|
+
}, C = p;
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
C 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-D42YfhZD.js";
|
|
2
|
+
import { y as v, z as C, A as e } from "./index-BrajMZw_.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a =
|
|
6
|
+
}), a = v(), l = C(() => {
|
|
7
7
|
const n = r.theme_preference || c;
|
|
8
8
|
return n !== "system" ? n : a();
|
|
9
9
|
});
|
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { useQueries as
|
|
4
|
-
import { useRef as se, useEffect as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { c as H, d as K, u as S, h as V, i as M, X as Q, M as X, j as x, k as j, H as w, a as G, n as P, K as D, o as z, q as Y, R as J, r as W, s as Z, t as ee } from "./index-BrajMZw_.js";
|
|
3
|
+
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as se, useEffect as $, useMemo as R } from "react";
|
|
5
|
+
const F = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = z(a, n, b), s = t.value, o = Y(s);
|
|
7
|
+
let i = s;
|
|
8
|
+
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
|
+
W,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
12
12
|
alt: s,
|
|
13
13
|
id: `${s}-img`,
|
|
14
14
|
hideThumbnail: r
|
|
15
15
|
}
|
|
16
|
-
)),
|
|
17
|
-
|
|
16
|
+
)), o === "Video" && (i = /* @__PURE__ */ u(
|
|
17
|
+
Z,
|
|
18
18
|
{
|
|
19
19
|
id: `${s}-video`,
|
|
20
20
|
videoSrc: s,
|
|
21
21
|
hideThumbnail: r
|
|
22
22
|
}
|
|
23
|
-
)),
|
|
23
|
+
)), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
24
|
const p = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
|
-
provider:
|
|
26
|
-
}), m =
|
|
25
|
+
provider: t.provider
|
|
26
|
+
}), m = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${m}-${d}-${n}` : `${y}-${m}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
J,
|
|
29
29
|
{
|
|
30
|
-
header:
|
|
31
|
-
value:
|
|
30
|
+
header: t.header,
|
|
31
|
+
value: i,
|
|
32
32
|
info: p,
|
|
33
33
|
id: c,
|
|
34
34
|
testId: c,
|
|
35
35
|
ariaLabel: c
|
|
36
36
|
},
|
|
37
|
-
`obs-${
|
|
37
|
+
`obs-${a.id}`
|
|
38
38
|
);
|
|
39
|
-
}, re = (
|
|
40
|
-
|
|
39
|
+
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
40
|
+
D,
|
|
41
41
|
{
|
|
42
|
-
title:
|
|
43
|
-
id: `grouped-obs-${
|
|
42
|
+
title: a.display,
|
|
43
|
+
id: `grouped-obs-${a.display}-${l}`,
|
|
44
44
|
open: d,
|
|
45
|
-
children:
|
|
46
|
-
(s,
|
|
45
|
+
children: a.members?.map(
|
|
46
|
+
(s, o) => F(
|
|
47
47
|
s,
|
|
48
|
-
|
|
48
|
+
o,
|
|
49
49
|
b,
|
|
50
50
|
r,
|
|
51
51
|
n,
|
|
52
|
-
|
|
52
|
+
t
|
|
53
53
|
)
|
|
54
54
|
)
|
|
55
55
|
},
|
|
56
|
-
`grouped-obs-${
|
|
57
|
-
),
|
|
58
|
-
groupedData:
|
|
56
|
+
`grouped-obs-${a.id}`
|
|
57
|
+
), oe = ({
|
|
58
|
+
groupedData: a,
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } = S(), b = (r,
|
|
63
|
-
const
|
|
62
|
+
const { t: l } = S(), b = (r, t, s) => {
|
|
63
|
+
const o = P(r.encounterDetails, l);
|
|
64
64
|
return /* @__PURE__ */ N(
|
|
65
|
-
|
|
65
|
+
D,
|
|
66
66
|
{
|
|
67
|
-
title:
|
|
67
|
+
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
|
-
open:
|
|
69
|
+
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(
|
|
73
|
-
|
|
72
|
+
(i, p) => F(
|
|
73
|
+
i,
|
|
74
74
|
p,
|
|
75
75
|
s,
|
|
76
76
|
n,
|
|
@@ -79,10 +79,10 @@ const D = (t, n, d, l, b, r) => {
|
|
|
79
79
|
)
|
|
80
80
|
),
|
|
81
81
|
r.groupedObservations.map(
|
|
82
|
-
(
|
|
83
|
-
|
|
82
|
+
(i, p) => re(
|
|
83
|
+
i,
|
|
84
84
|
l,
|
|
85
|
-
|
|
85
|
+
t,
|
|
86
86
|
p,
|
|
87
87
|
s,
|
|
88
88
|
n,
|
|
@@ -100,71 +100,71 @@ const D = (t, n, d, l, b, r) => {
|
|
|
100
100
|
id: "obs-by-encounter",
|
|
101
101
|
"data-testid": "obs-by-encounter-test-id",
|
|
102
102
|
"aria-label": "obs-by-encounter-aria-label",
|
|
103
|
-
children:
|
|
104
|
-
(r,
|
|
103
|
+
children: a.map(
|
|
104
|
+
(r, t) => b(r, t === 0, t)
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
},
|
|
109
|
-
observations:
|
|
108
|
+
}, ie = "_observations_kfbhq_1", ne = "_title_kfbhq_12", I = {
|
|
109
|
+
observations: ie,
|
|
110
110
|
title: ne
|
|
111
|
-
}, de = (
|
|
112
|
-
const n =
|
|
111
|
+
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], me = ({ config: a }) => {
|
|
112
|
+
const n = a, {
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()),
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = H(), { addNotification: s } = K(), { t: o } = S(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => V(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
$(() => {
|
|
124
|
+
i.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
126
|
const B = d[h];
|
|
127
127
|
s({
|
|
128
|
-
title:
|
|
129
|
-
message:
|
|
128
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
129
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: B }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(h);
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
|
-
}, [
|
|
135
|
-
const p = R(() =>
|
|
134
|
+
}, [i, d]);
|
|
135
|
+
const p = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = R(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
137
|
+
isLoading: A,
|
|
138
138
|
isError: f,
|
|
139
|
-
refetch:
|
|
140
|
-
} =
|
|
141
|
-
queryKey: le(
|
|
142
|
-
queryFn: () =>
|
|
143
|
-
enabled: !!
|
|
139
|
+
refetch: T
|
|
140
|
+
} = te({
|
|
141
|
+
queryKey: le(t, m),
|
|
142
|
+
queryFn: () => M(t, m),
|
|
143
|
+
enabled: !!t && m.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
Q(
|
|
146
146
|
(e) => {
|
|
147
|
-
e.patientUUID ===
|
|
147
|
+
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => m.includes(h)
|
|
149
|
-
) &&
|
|
149
|
+
) && T();
|
|
150
150
|
},
|
|
151
|
-
[
|
|
152
|
-
),
|
|
151
|
+
[t, T]
|
|
152
|
+
), $(() => {
|
|
153
153
|
f && s({
|
|
154
|
-
title:
|
|
155
|
-
message:
|
|
154
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
|
+
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
158
|
}, [f]);
|
|
159
|
-
const
|
|
159
|
+
const g = R(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = X(c), h = x(e);
|
|
162
|
+
return j(h);
|
|
163
|
+
}, [c]), L = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
167
|
+
], O = A || !y, _ = f && y, k = (!c || c.entry?.length === 0 || m.length === 0) && y, q = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = k ? o("NO_OBSERVATIONS_FOUND") : void 0, U = g.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
168
|
return /* @__PURE__ */ N(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
@@ -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
|
+
w,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
@@ -184,20 +184,20 @@ const D = (t, n, d, l, b, r) => {
|
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
186
|
U ? /* @__PURE__ */ u(
|
|
187
|
-
|
|
187
|
+
oe,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: g,
|
|
190
190
|
title: v,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
G,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: L,
|
|
197
197
|
rows: [],
|
|
198
|
-
ariaLabel:
|
|
199
|
-
loading:
|
|
200
|
-
errorStateMessage:
|
|
198
|
+
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
+
loading: O,
|
|
200
|
+
errorStateMessage: q,
|
|
201
201
|
emptyStateMessage: C,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|