@bahmni/appointments-app 0.0.1-dev.234 → 0.0.1-dev.237
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-Cl0S6I_z-Baxl9uRu.js → DocumentsTable-DZLV91xy-f5LDs6an.js} +19 -19
- package/dist/{FormsTable-Iqc9AxOy-CwtAmm0R.js → FormsTable-Yt3aI_e6-Bnb-Zklz.js} +74 -74
- package/dist/{LNWAZHJI-BwL0FBbh.js → LNWAZHJI-D-mYq8Ud.js} +2 -2
- package/dist/{MWZ6AO7Z-BMADqp8v.js → MWZ6AO7Z-DNr0igQc.js} +2 -2
- package/dist/{Observations-DBbsNLYV-DfePU_sO.js → Observations-DoBEcLrI-pq7YYK0e.js} +42 -42
- package/dist/{YPM2AS64-CAZuqnlm.js → YPM2AS64-B8I9n-lB.js} +1 -1
- package/dist/{index-D1Kbz7oG.js → index-Cx6uHzit.js} +24404 -24295
- package/dist/{index-Bh4chuNE.js → index-nVY_AosV.js} +28 -28
- package/dist/index.css +1 -1
- 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 p, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { t as K, u as Q, r as W, a as J, N as X, d as Z, o as ee, l as te, V as ae } from "./index-Cx6uHzit.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,
|
|
@@ -26,13 +26,13 @@ function ue(a, E) {
|
|
|
26
26
|
header: E(me[s])
|
|
27
27
|
}));
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const _e = [
|
|
30
30
|
"documentIdentifier",
|
|
31
31
|
"documentType",
|
|
32
32
|
"uploadedOn",
|
|
33
33
|
"uploadedBy",
|
|
34
34
|
"action"
|
|
35
|
-
],
|
|
35
|
+
], 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 }] : [], ge = ({ config: a, encounterUuids: E }) => {
|
|
36
36
|
const [s, w] = l(!1), [o, L] = l(
|
|
37
37
|
null
|
|
38
38
|
), [R, I] = l(
|
|
@@ -94,15 +94,15 @@ const pe = [
|
|
|
94
94
|
},
|
|
95
95
|
[m]
|
|
96
96
|
), N = T(
|
|
97
|
-
() => a?.fields ??
|
|
97
|
+
() => a?.fields ?? _e,
|
|
98
98
|
[a?.fields]
|
|
99
|
-
),
|
|
99
|
+
), P = 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]), z = T(() => ue(N, n), [N, n]), x = T(
|
|
100
100
|
() => N.map((e) => ({
|
|
101
101
|
key: e,
|
|
102
102
|
sortable: e !== "action"
|
|
103
103
|
})),
|
|
104
104
|
[N]
|
|
105
|
-
),
|
|
105
|
+
), _ = T(
|
|
106
106
|
() => o ? B(o) : [],
|
|
107
107
|
[o]
|
|
108
108
|
), G = h(
|
|
@@ -136,16 +136,16 @@ const pe = [
|
|
|
136
136
|
},
|
|
137
137
|
[M, n]
|
|
138
138
|
);
|
|
139
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ p(Y, { children: [
|
|
140
140
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
141
141
|
ee,
|
|
142
142
|
{
|
|
143
|
-
headers:
|
|
143
|
+
headers: z,
|
|
144
144
|
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
145
|
-
rows:
|
|
145
|
+
rows: P,
|
|
146
146
|
loading: H,
|
|
147
147
|
errorStateMessage: D ? v?.message : null,
|
|
148
|
-
sortable:
|
|
148
|
+
sortable: x,
|
|
149
149
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
150
150
|
renderCell: G,
|
|
151
151
|
className: d.documentsTableBody,
|
|
@@ -167,33 +167,33 @@ const pe = [
|
|
|
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: _.map((e, t) => {
|
|
171
|
+
const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), O = R.has(t);
|
|
172
|
+
return c === "#" || O ? /* @__PURE__ */ p(
|
|
173
173
|
"div",
|
|
174
174
|
{
|
|
175
175
|
className: d.attachmentError,
|
|
176
176
|
"data-testid": `attachment-error-${t}`,
|
|
177
177
|
children: [
|
|
178
|
-
|
|
178
|
+
_.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
179
179
|
t + 1,
|
|
180
180
|
"/",
|
|
181
|
-
|
|
181
|
+
_.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__ */ p(
|
|
188
188
|
"div",
|
|
189
189
|
{
|
|
190
190
|
className: d.attachmentItem,
|
|
191
191
|
"data-testid": `attachment-item-${t}`,
|
|
192
192
|
children: [
|
|
193
|
-
|
|
193
|
+
_.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
194
194
|
t + 1,
|
|
195
195
|
"/",
|
|
196
|
-
|
|
196
|
+
_.length
|
|
197
197
|
] }),
|
|
198
198
|
S ? /* @__PURE__ */ r(
|
|
199
199
|
"img",
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { u as Z, t as ee, g as re, b as ae, a as c,
|
|
1
|
+
import { jsx as s, jsxs as J, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { u as Z, t as ee, g as re, b as ae, a as c, B as te, c as U, d as oe, N as se, o as S, Q as ne, X as de, l as ie, e as ue, m as me, y as le, v as ce, E as fe, f as ye } from "./index-Cx6uHzit.js";
|
|
3
3
|
import { useState as C, useMemo as d, useCallback as f } from "react";
|
|
4
|
-
const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6",
|
|
4
|
+
const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
|
|
5
5
|
formsTableBody: be,
|
|
6
6
|
customAccordianItem: ge
|
|
7
|
-
},
|
|
7
|
+
}, Ne = (u) => u ? u.extension?.find(
|
|
8
8
|
(n) => n.url === me
|
|
9
|
-
)?.valueString : void 0,
|
|
9
|
+
)?.valueString : void 0, Ae = ({
|
|
10
10
|
episodeOfCareUuids: u,
|
|
11
11
|
encounterUuids: n,
|
|
12
|
-
config:
|
|
12
|
+
config: q
|
|
13
13
|
}) => {
|
|
14
|
-
const { t:
|
|
14
|
+
const { t: o } = Z(), m = ee(), [l, A] = C(!1), [t, B] = C(null), { numberOfVisits: k, hideThumbnail: H = !1 } = q ?? {}, I = re(
|
|
15
15
|
u,
|
|
16
16
|
n
|
|
17
|
-
),
|
|
17
|
+
), K = ae(), {
|
|
18
18
|
data: y = [],
|
|
19
|
-
isLoading:
|
|
20
|
-
isError:
|
|
21
|
-
error:
|
|
22
|
-
refetch:
|
|
19
|
+
isLoading: E,
|
|
20
|
+
isError: T,
|
|
21
|
+
error: Q,
|
|
22
|
+
refetch: V
|
|
23
23
|
} = c({
|
|
24
24
|
queryKey: ["forms", m, u],
|
|
25
25
|
queryFn: () => le(m, void 0, k),
|
|
26
|
-
enabled: !!m && !
|
|
26
|
+
enabled: !!m && !I
|
|
27
27
|
}), _ = d(() => !n || n.length === 0 ? y : y.filter(
|
|
28
28
|
(e) => n.includes(e.encounterUuid)
|
|
29
|
-
), [y, n]), { data:
|
|
29
|
+
), [y, n]), { data: v = [] } = c({
|
|
30
30
|
queryKey: ["observationForms"],
|
|
31
31
|
queryFn: () => ce()
|
|
32
|
-
}),
|
|
33
|
-
(e) =>
|
|
34
|
-
[
|
|
32
|
+
}), D = f(
|
|
33
|
+
(e) => v.find((r) => r.name === e)?.uuid,
|
|
34
|
+
[v]
|
|
35
35
|
), b = d(() => {
|
|
36
36
|
if (t)
|
|
37
|
-
return
|
|
38
|
-
}, [t,
|
|
39
|
-
isLoading:
|
|
40
|
-
isError:
|
|
37
|
+
return D(t.formName);
|
|
38
|
+
}, [t, D]), {
|
|
39
|
+
isLoading: j,
|
|
40
|
+
isError: x,
|
|
41
41
|
error: g
|
|
42
42
|
} = c({
|
|
43
43
|
queryKey: ["formMetadata", b],
|
|
44
44
|
queryFn: () => fe(b),
|
|
45
45
|
enabled: !!b && l
|
|
46
46
|
}), {
|
|
47
|
-
data:
|
|
47
|
+
data: N,
|
|
48
48
|
isLoading: $,
|
|
49
49
|
isError: w,
|
|
50
50
|
error: p
|
|
@@ -55,41 +55,41 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
|
|
|
55
55
|
});
|
|
56
56
|
te(
|
|
57
57
|
(e) => {
|
|
58
|
-
e.patientUUID === m && e.updatedConcepts.size > 0 && (
|
|
58
|
+
e.patientUUID === m && e.updatedConcepts.size > 0 && (V(), K.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
59
59
|
},
|
|
60
60
|
[m]
|
|
61
61
|
);
|
|
62
|
-
const z = d(() => !
|
|
63
|
-
const r =
|
|
62
|
+
const z = d(() => !N?.entry || !t?.formName ? [] : N.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
63
|
+
const r = Ne(e);
|
|
64
64
|
return !r || r.includes(t.formName);
|
|
65
|
-
}), [
|
|
65
|
+
}), [N, t?.formName]), G = d(() => {
|
|
66
66
|
if (g)
|
|
67
|
-
return
|
|
67
|
+
return U(g).message;
|
|
68
68
|
if (p)
|
|
69
|
-
return
|
|
70
|
-
}, [g, p]),
|
|
69
|
+
return U(p).message;
|
|
70
|
+
}, [g, p]), F = d(
|
|
71
71
|
() => [
|
|
72
|
-
{ key: "recordedOn", header:
|
|
73
|
-
{ key: "recordedBy", header:
|
|
72
|
+
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
73
|
+
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
74
74
|
],
|
|
75
|
-
[
|
|
76
|
-
),
|
|
75
|
+
[o]
|
|
76
|
+
), P = d(
|
|
77
77
|
() => [
|
|
78
78
|
{ key: "recordedOn", sortable: !0 },
|
|
79
79
|
{ key: "recordedBy", sortable: !0 }
|
|
80
80
|
],
|
|
81
81
|
[]
|
|
82
|
-
),
|
|
82
|
+
), L = d(() => {
|
|
83
83
|
const e = _.reduce(
|
|
84
84
|
(r, a) => {
|
|
85
85
|
const i = a.formName;
|
|
86
86
|
r[i] ??= [];
|
|
87
|
-
const
|
|
87
|
+
const h = 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
|
-
recordedOn:
|
|
92
|
-
recordedBy:
|
|
91
|
+
recordedOn: oe(a.encounterDateTime, o, !0).formattedResult,
|
|
92
|
+
recordedBy: h ?? "--",
|
|
93
93
|
encounterDateTime: a.encounterDateTime,
|
|
94
94
|
encounterUuid: a.encounterUuid
|
|
95
95
|
}), r;
|
|
@@ -100,62 +100,62 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
|
|
|
100
100
|
([r, a]) => ({
|
|
101
101
|
formName: r,
|
|
102
102
|
records: a.sort(
|
|
103
|
-
(i,
|
|
103
|
+
(i, h) => h.encounterDateTime - i.encounterDateTime
|
|
104
104
|
)
|
|
105
105
|
})
|
|
106
106
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
107
|
-
}, [_,
|
|
108
|
-
|
|
109
|
-
}, []),
|
|
110
|
-
|
|
111
|
-
}, []),
|
|
107
|
+
}, [_, o]), M = f((e) => {
|
|
108
|
+
B(e), A(!0);
|
|
109
|
+
}, []), X = f(() => {
|
|
110
|
+
A(!1), B(null);
|
|
111
|
+
}, []), R = f(
|
|
112
112
|
(e, r) => {
|
|
113
113
|
switch (r) {
|
|
114
114
|
case "recordedOn":
|
|
115
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ s(se, { onClick: () => M(e), children: e.recordedOn });
|
|
116
116
|
case "recordedBy":
|
|
117
117
|
return e.recordedBy;
|
|
118
118
|
default:
|
|
119
119
|
return null;
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
|
-
[
|
|
122
|
+
[M]
|
|
123
123
|
);
|
|
124
|
-
return /* @__PURE__ */ W
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
|
|
124
|
+
return /* @__PURE__ */ J(W, { children: [
|
|
125
|
+
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: E || T || L.length === 0 || I ? /* @__PURE__ */ s(
|
|
126
|
+
S,
|
|
127
127
|
{
|
|
128
|
-
headers:
|
|
129
|
-
ariaLabel:
|
|
128
|
+
headers: F,
|
|
129
|
+
ariaLabel: o("FORMS_HEADING"),
|
|
130
130
|
rows: [],
|
|
131
|
-
loading:
|
|
132
|
-
errorStateMessage:
|
|
133
|
-
emptyStateMessage:
|
|
134
|
-
renderCell:
|
|
135
|
-
className:
|
|
131
|
+
loading: E,
|
|
132
|
+
errorStateMessage: T ? Q?.message : void 0,
|
|
133
|
+
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
134
|
+
renderCell: R,
|
|
135
|
+
className: O.formsTableBody,
|
|
136
136
|
dataTestId: "forms-table"
|
|
137
137
|
}
|
|
138
|
-
) : /* @__PURE__ */
|
|
138
|
+
) : /* @__PURE__ */ s(ne, { align: "start", children: L.map((e, r) => {
|
|
139
139
|
const { formName: a, records: i } = e;
|
|
140
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ s(
|
|
141
141
|
de,
|
|
142
142
|
{
|
|
143
143
|
title: a,
|
|
144
|
-
className:
|
|
144
|
+
className: O.customAccordianItem,
|
|
145
145
|
testId: `accordian-title-${a}`,
|
|
146
146
|
open: r === 0,
|
|
147
|
-
children: /* @__PURE__ */
|
|
148
|
-
|
|
147
|
+
children: /* @__PURE__ */ s(
|
|
148
|
+
S,
|
|
149
149
|
{
|
|
150
|
-
headers:
|
|
151
|
-
ariaLabel:
|
|
150
|
+
headers: F,
|
|
151
|
+
ariaLabel: o("FORMS_HEADING"),
|
|
152
152
|
rows: i,
|
|
153
153
|
loading: !1,
|
|
154
154
|
errorStateMessage: "",
|
|
155
|
-
sortable:
|
|
156
|
-
emptyStateMessage:
|
|
157
|
-
renderCell:
|
|
158
|
-
className:
|
|
155
|
+
sortable: P,
|
|
156
|
+
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
157
|
+
renderCell: R,
|
|
158
|
+
className: O.formsTableBody,
|
|
159
159
|
dataTestId: `forms-table-${a}`
|
|
160
160
|
}
|
|
161
161
|
)
|
|
@@ -163,28 +163,28 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
|
|
|
163
163
|
a
|
|
164
164
|
);
|
|
165
165
|
}) }) }),
|
|
166
|
-
l && t && /* @__PURE__ */
|
|
166
|
+
l && t && /* @__PURE__ */ s(
|
|
167
167
|
ie,
|
|
168
168
|
{
|
|
169
169
|
id: "modalIdForActionAreaLayout",
|
|
170
170
|
portalId: "main-display-area",
|
|
171
171
|
open: l,
|
|
172
|
-
onRequestClose:
|
|
172
|
+
onRequestClose: X,
|
|
173
173
|
modalHeading: t.formName,
|
|
174
174
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
175
175
|
passiveModal: !0,
|
|
176
176
|
size: "md",
|
|
177
177
|
testId: "form-details-modal",
|
|
178
|
-
children: /* @__PURE__ */
|
|
178
|
+
children: /* @__PURE__ */ s(
|
|
179
179
|
ue,
|
|
180
180
|
{
|
|
181
181
|
observations: z,
|
|
182
|
-
isLoading:
|
|
183
|
-
isError:
|
|
182
|
+
isLoading: j || $,
|
|
183
|
+
isError: x || w,
|
|
184
184
|
errorMessage: G,
|
|
185
|
-
emptyStateMessage:
|
|
185
|
+
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
186
186
|
testIdPrefix: t.formName,
|
|
187
|
-
hideThumbnail:
|
|
187
|
+
hideThumbnail: H
|
|
188
188
|
}
|
|
189
189
|
)
|
|
190
190
|
}
|
|
@@ -192,5 +192,5 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
|
|
|
192
192
|
] });
|
|
193
193
|
};
|
|
194
194
|
export {
|
|
195
|
-
|
|
195
|
+
Ae 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 {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-B8I9n-lB.js";
|
|
2
|
+
import { S as d, W as f, Z as e } from "./index-Cx6uHzit.js";
|
|
3
3
|
var p = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-B8I9n-lB.js";
|
|
2
|
+
import { S as v, W as C, Z as e } from "./index-Cx6uHzit.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { t as k, r as w, u as S,
|
|
3
|
-
import { useRef as se, useEffect as $, useMemo as
|
|
4
|
-
const
|
|
2
|
+
import { t as k, r as w, u as S, h as x, i as G, a as K, B as M, j as Q, z as Y, A as j, Y as z, o as H, M as P, G as F, x as J, k as W, F as X, n as Z, T as ee, p as ae, w as te } from "./index-Cx6uHzit.js";
|
|
3
|
+
import { useRef as se, useEffect as $, useMemo as T } from "react";
|
|
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;
|
|
7
7
|
i === "Image" && (o = /* @__PURE__ */ u(
|
|
@@ -20,15 +20,15 @@ const U = (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 p = b("OBSERVATIONS_RECORDED_BY", {
|
|
24
24
|
provider: t.provider
|
|
25
|
-
}),
|
|
25
|
+
}), m = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${m}-${d}-${n}` : `${y}-${m}-${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: p,
|
|
32
32
|
id: c,
|
|
33
33
|
testId: c,
|
|
34
34
|
ariaLabel: c
|
|
@@ -36,13 +36,13 @@ const U = (a, n, d, l, b, r) => {
|
|
|
36
36
|
`obs-${a.id}`
|
|
37
37
|
);
|
|
38
38
|
}, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
|
|
39
|
-
|
|
39
|
+
F,
|
|
40
40
|
{
|
|
41
41
|
title: a.display,
|
|
42
42
|
id: `grouped-obs-${a.display}-${l}`,
|
|
43
43
|
open: d,
|
|
44
44
|
children: a.members?.map(
|
|
45
|
-
(s, i) =>
|
|
45
|
+
(s, i) => A(
|
|
46
46
|
s,
|
|
47
47
|
i,
|
|
48
48
|
b,
|
|
@@ -59,18 +59,18 @@ const U = (a, n, d, l, b, r) => {
|
|
|
59
59
|
hideThumbnail: d
|
|
60
60
|
}) => {
|
|
61
61
|
const { t: l } = S(), b = (r, t, s) => {
|
|
62
|
-
const i =
|
|
62
|
+
const i = P(r.encounterDetails, l);
|
|
63
63
|
return /* @__PURE__ */ N(
|
|
64
|
-
|
|
64
|
+
F,
|
|
65
65
|
{
|
|
66
66
|
title: i,
|
|
67
67
|
id: `encounter-${r.encounterId}`,
|
|
68
68
|
open: t,
|
|
69
69
|
children: [
|
|
70
70
|
r.observations.map(
|
|
71
|
-
(o,
|
|
71
|
+
(o, p) => A(
|
|
72
72
|
o,
|
|
73
|
-
|
|
73
|
+
p,
|
|
74
74
|
s,
|
|
75
75
|
n,
|
|
76
76
|
l,
|
|
@@ -78,11 +78,11 @@ const U = (a, n, d, l, b, r) => {
|
|
|
78
78
|
)
|
|
79
79
|
),
|
|
80
80
|
r.groupedObservations.map(
|
|
81
|
-
(o,
|
|
81
|
+
(o, p) => re(
|
|
82
82
|
o,
|
|
83
83
|
l,
|
|
84
84
|
t,
|
|
85
|
-
|
|
85
|
+
p,
|
|
86
86
|
s,
|
|
87
87
|
n,
|
|
88
88
|
d
|
|
@@ -107,15 +107,15 @@ const U = (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], pe = ({ 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 = k(), { addNotification: s } = w(), { t: i } = S(), o =
|
|
115
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = k(), { addNotification: s } = w(), { t: i } = S(), o = x({
|
|
116
116
|
queries: d.map((e) => ({
|
|
117
117
|
queryKey: de(e),
|
|
118
|
-
queryFn: () =>
|
|
118
|
+
queryFn: () => G(e),
|
|
119
119
|
enabled: !!e
|
|
120
120
|
}))
|
|
121
121
|
});
|
|
@@ -131,23 +131,23 @@ const U = (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 p = T(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), m = T(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = T(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
|
|
135
135
|
data: c,
|
|
136
|
-
isLoading:
|
|
136
|
+
isLoading: q,
|
|
137
137
|
isError: R,
|
|
138
|
-
refetch:
|
|
139
|
-
} =
|
|
140
|
-
queryKey: le(t,
|
|
141
|
-
queryFn: () => te(t,
|
|
142
|
-
enabled: !!t &&
|
|
138
|
+
refetch: f
|
|
139
|
+
} = K({
|
|
140
|
+
queryKey: le(t, m),
|
|
141
|
+
queryFn: () => te(t, m),
|
|
142
|
+
enabled: !!t && m.length > 0 && y
|
|
143
143
|
});
|
|
144
|
-
|
|
144
|
+
M(
|
|
145
145
|
(e) => {
|
|
146
146
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
147
|
-
(h) =>
|
|
148
|
-
) &&
|
|
147
|
+
(h) => m.includes(h)
|
|
148
|
+
) && f();
|
|
149
149
|
},
|
|
150
|
-
[t,
|
|
150
|
+
[t, f]
|
|
151
151
|
), $(() => {
|
|
152
152
|
R && s({
|
|
153
153
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
@@ -155,15 +155,15 @@ const U = (a, n, d, l, b, r) => {
|
|
|
155
155
|
type: "error"
|
|
156
156
|
});
|
|
157
157
|
}, [R]);
|
|
158
|
-
const
|
|
158
|
+
const g = T(() => {
|
|
159
159
|
if (!c) return [];
|
|
160
|
-
const e =
|
|
161
|
-
return
|
|
162
|
-
}, [c]),
|
|
160
|
+
const e = Q(c), h = Y(e);
|
|
161
|
+
return j(h);
|
|
162
|
+
}, [c]), D = [
|
|
163
163
|
{ key: "name", header: "name" },
|
|
164
164
|
{ key: "value", header: "value" },
|
|
165
165
|
{ key: "form", header: "form" }
|
|
166
|
-
],
|
|
166
|
+
], O = q || !y, _ = R && y, B = (!c || c.entry?.length === 0 || m.length === 0) && y, L = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, U = B ? i("NO_OBSERVATIONS_FOUND") : void 0, C = g.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? i(E) : "";
|
|
167
167
|
return /* @__PURE__ */ N(
|
|
168
168
|
"div",
|
|
169
169
|
{
|
|
@@ -173,7 +173,7 @@ const U = (a, n, d, l, b, r) => {
|
|
|
173
173
|
className: I.observations,
|
|
174
174
|
children: [
|
|
175
175
|
/* @__PURE__ */ u(
|
|
176
|
-
|
|
176
|
+
z,
|
|
177
177
|
{
|
|
178
178
|
id: "observations-title",
|
|
179
179
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
@@ -182,22 +182,22 @@ const U = (a, n, d, l, b, r) => {
|
|
|
182
182
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
183
183
|
}
|
|
184
184
|
),
|
|
185
|
-
|
|
185
|
+
C ? /* @__PURE__ */ u(
|
|
186
186
|
ie,
|
|
187
187
|
{
|
|
188
|
-
groupedData:
|
|
188
|
+
groupedData: g,
|
|
189
189
|
title: v,
|
|
190
190
|
hideThumbnail: b
|
|
191
191
|
}
|
|
192
192
|
) : /* @__PURE__ */ u(
|
|
193
|
-
|
|
193
|
+
H,
|
|
194
194
|
{
|
|
195
|
-
headers:
|
|
195
|
+
headers: D,
|
|
196
196
|
rows: [],
|
|
197
197
|
ariaLabel: i("OBSERVATIONS"),
|
|
198
|
-
loading:
|
|
199
|
-
errorStateMessage:
|
|
200
|
-
emptyStateMessage:
|
|
198
|
+
loading: O,
|
|
199
|
+
errorStateMessage: L,
|
|
200
|
+
emptyStateMessage: U,
|
|
201
201
|
dataTestId: "observations-table"
|
|
202
202
|
}
|
|
203
203
|
)
|
|
@@ -207,6 +207,6 @@ const U = (a, n, d, l, b, r) => {
|
|
|
207
207
|
};
|
|
208
208
|
export {
|
|
209
209
|
de as conceptUuidQueryKeys,
|
|
210
|
-
|
|
210
|
+
pe as default,
|
|
211
211
|
le as observationsQueryKeys
|
|
212
212
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as we, a0 as z, a1 as xt, a2 as B,
|
|
1
|
+
import { $ as we, a0 as z, a1 as xt, a2 as B, W 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-Cx6uHzit.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|