@bahmni/widgets 0.0.1-dev.415 → 0.0.1-dev.417
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-CAc5AVsk.js → DocumentsTable-DMIaNWVl.js} +9 -9
- package/dist/{FormsTable-DdLaG3o3.js → FormsTable-C4GSkGM8.js} +85 -85
- package/dist/{Observations-CToq2Qj8.js → Observations-C6aIPO5C.js} +38 -38
- package/dist/appContext/AppContextProvider.d.ts.map +1 -1
- package/dist/{index-DRZ-RjJ6.js → index-BKKc70c1.js} +15079 -15057
- package/dist/index.js +25 -25
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { u as W, a as X,
|
|
2
|
+
import { u as W, a as X, G as J, V as Z, s as x, b as ee, F as te } from "./index-BKKc70c1.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
|
|
5
5
|
import { useTranslation as ae } from "react-i18next";
|
|
@@ -41,11 +41,11 @@ const Te = [
|
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
42
|
), E = W(), { t: o } = ae(), { addNotification: w } = X(), P = Number(n?.pageSize) || 5, [N, C] = l(1), [u, $] = l(P), [k, O] = l(void 0), v = _((e) => {
|
|
43
43
|
U(e), L(!0);
|
|
44
|
-
}, []),
|
|
44
|
+
}, []), z = _(() => {
|
|
45
45
|
L(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
46
46
|
}, []), F = _((e) => {
|
|
47
47
|
A((t) => new Set(t).add(e));
|
|
48
|
-
}, []), { data: i, isLoading:
|
|
48
|
+
}, []), { data: i, isLoading: H, isError: S, error: b } = ne({
|
|
49
49
|
queryKey: [
|
|
50
50
|
"documents",
|
|
51
51
|
E,
|
|
@@ -98,7 +98,7 @@ const Te = [
|
|
|
98
98
|
), D = p(
|
|
99
99
|
() => n?.fields ?? Te,
|
|
100
100
|
[n?.fields]
|
|
101
|
-
),
|
|
101
|
+
), G = p(() => [...i?.documents ?? []].sort((t, a) => !t.uploadedOn && !a.uploadedOn ? 0 : t.uploadedOn ? a.uploadedOn ? new Date(a.uploadedOn).getTime() - new Date(t.uploadedOn).getTime() : -1 : 1), [i]), j = p(() => he(D, o), [D, o]), K = p(
|
|
102
102
|
() => D.map((e) => ({
|
|
103
103
|
key: e,
|
|
104
104
|
sortable: e !== "attachments"
|
|
@@ -142,12 +142,12 @@ const Te = [
|
|
|
142
142
|
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
143
143
|
ee,
|
|
144
144
|
{
|
|
145
|
-
headers:
|
|
145
|
+
headers: j,
|
|
146
146
|
ariaLabel: o("DOCUMENTS_TABLE_HEADING"),
|
|
147
|
-
rows:
|
|
148
|
-
loading:
|
|
147
|
+
rows: G,
|
|
148
|
+
loading: H,
|
|
149
149
|
errorStateMessage: S ? b?.message : null,
|
|
150
|
-
sortable:
|
|
150
|
+
sortable: K,
|
|
151
151
|
emptyStateMessage: o("DOCUMENTS_NO_RECORDS"),
|
|
152
152
|
renderCell: Q,
|
|
153
153
|
className: c.documentsTableBody,
|
|
@@ -164,7 +164,7 @@ const Te = [
|
|
|
164
164
|
id: "modalIdForActionAreaLayout",
|
|
165
165
|
portalId: "main-display-area",
|
|
166
166
|
open: d,
|
|
167
|
-
onRequestClose:
|
|
167
|
+
onRequestClose: z,
|
|
168
168
|
modalHeading: s.documentIdentifier,
|
|
169
169
|
passiveModal: !0,
|
|
170
170
|
size: "lg",
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import { jsx as n, jsxs as $, Fragment as
|
|
2
|
-
import { u as Ne, c as Oe, d as pe,
|
|
1
|
+
import { jsx as n, jsxs as $, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
+
import { u as Ne, c as Oe, d as pe, T as Te, S as Ee, _ as Fe, e as Ie, n as _e, f as Ae, g as ve, h as Re, i as De, j, s as Me, C as K, B as z, V as Le, b as Q, r as Se, k as Be, F as Ce, O as Ue, l as we } from "./index-BKKc70c1.js";
|
|
3
3
|
import { useQueryClient as ke, useQuery as O } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as W, useMemo as i, useCallback as d } from "react";
|
|
5
5
|
import { useTranslation as He } from "react-i18next";
|
|
6
6
|
const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", Pe = "FormsTable-module_customAccordianItem__isszs", p = {
|
|
7
7
|
formsTableBody: Ve,
|
|
8
8
|
modalHeading: qe,
|
|
9
9
|
customAccordianItem: Pe
|
|
10
|
-
},
|
|
10
|
+
}, xe = "startConsultation", Qe = ({
|
|
11
11
|
episodeOfCareUuids: R,
|
|
12
12
|
encounterUuids: m,
|
|
13
|
-
config:
|
|
14
|
-
disableActions:
|
|
15
|
-
activeEncounterUuid:
|
|
13
|
+
config: Y,
|
|
14
|
+
disableActions: J = !1,
|
|
15
|
+
activeEncounterUuid: b = null
|
|
16
16
|
}) => {
|
|
17
|
-
const { t:
|
|
18
|
-
numberOfVisits:
|
|
19
|
-
hideThumbnail:
|
|
20
|
-
forms:
|
|
21
|
-
} =
|
|
17
|
+
const { t: o } = He(), c = Ne(), [y, D] = W(!1), [s, M] = W(null), {
|
|
18
|
+
numberOfVisits: X,
|
|
19
|
+
hideThumbnail: Z = !1,
|
|
20
|
+
forms: h
|
|
21
|
+
} = Y ?? {}, ee = Oe(
|
|
22
22
|
we.EDIT_OBSERVATIONS
|
|
23
|
-
), { userPrivileges:
|
|
23
|
+
), { userPrivileges: g } = pe(), T = ee && !J && !!b, L = Te(
|
|
24
24
|
R,
|
|
25
25
|
m
|
|
26
26
|
), re = ke(), {
|
|
27
|
-
data:
|
|
28
|
-
isLoading:
|
|
27
|
+
data: S = [],
|
|
28
|
+
isLoading: B,
|
|
29
29
|
isError: C,
|
|
30
30
|
error: te,
|
|
31
31
|
refetch: ae
|
|
32
32
|
} = O({
|
|
33
33
|
queryKey: ["forms", c, R],
|
|
34
|
-
queryFn: () =>
|
|
35
|
-
enabled: !!c && !
|
|
34
|
+
queryFn: () => Ee(c, void 0, X),
|
|
35
|
+
enabled: !!c && !L
|
|
36
36
|
}), U = i(() => {
|
|
37
|
-
let e =
|
|
37
|
+
let e = S;
|
|
38
38
|
return m && m.length > 0 && (e = e.filter(
|
|
39
39
|
(r) => m.includes(r.encounterUuid)
|
|
40
|
-
)), Array.isArray(
|
|
41
|
-
(r) =>
|
|
40
|
+
)), Array.isArray(h) && h.length > 0 && (e = e.filter(
|
|
41
|
+
(r) => h.some((t) => t.toLowerCase() === r.formName.toLowerCase())
|
|
42
42
|
)), e;
|
|
43
|
-
}, [
|
|
43
|
+
}, [S, m, h]), { data: N = [] } = O({
|
|
44
44
|
queryKey: ["observationForms"],
|
|
45
45
|
queryFn: () => Fe()
|
|
46
46
|
}), w = d(
|
|
47
47
|
(e) => {
|
|
48
48
|
const r = N.find((a) => a.name === e);
|
|
49
49
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
50
|
-
if (!
|
|
51
|
-
const t = new Set(
|
|
50
|
+
if (!g || g.length === 0) return !1;
|
|
51
|
+
const t = new Set(g.map((a) => a.name));
|
|
52
52
|
return r.privileges.some(
|
|
53
53
|
(a) => t.has(a.privilegeName) && a.editable
|
|
54
54
|
);
|
|
55
55
|
},
|
|
56
|
-
[N,
|
|
56
|
+
[N, g]
|
|
57
57
|
), u = d(
|
|
58
|
-
(e) => !
|
|
59
|
-
[
|
|
58
|
+
(e) => !b || e.encounterUuid !== b ? !1 : w(e.formName),
|
|
59
|
+
[b, w]
|
|
60
60
|
), k = d(
|
|
61
61
|
(e) => N.find((t) => t.name === e)?.uuid,
|
|
62
62
|
[N]
|
|
63
|
-
),
|
|
64
|
-
if (
|
|
65
|
-
return k(
|
|
66
|
-
}, [
|
|
63
|
+
), E = i(() => {
|
|
64
|
+
if (s)
|
|
65
|
+
return k(s.formName);
|
|
66
|
+
}, [s, k]), {
|
|
67
67
|
data: H,
|
|
68
|
-
isLoading:
|
|
69
|
-
isError:
|
|
68
|
+
isLoading: se,
|
|
69
|
+
isError: oe,
|
|
70
70
|
error: F
|
|
71
71
|
} = O({
|
|
72
|
-
queryKey: ["formMetadata",
|
|
73
|
-
queryFn: () => Ie(
|
|
74
|
-
enabled: !!
|
|
72
|
+
queryKey: ["formMetadata", E],
|
|
73
|
+
queryFn: () => Ie(E),
|
|
74
|
+
enabled: !!E && y
|
|
75
75
|
}), {
|
|
76
76
|
data: I,
|
|
77
77
|
isLoading: ne,
|
|
78
78
|
isError: ie,
|
|
79
79
|
error: _
|
|
80
80
|
} = O({
|
|
81
|
-
queryKey: ["formsEncounterFHIR",
|
|
82
|
-
queryFn: () => _e(
|
|
83
|
-
enabled: !!
|
|
81
|
+
queryKey: ["formsEncounterFHIR", s?.encounterUuid],
|
|
82
|
+
queryFn: () => _e(s.encounterUuid),
|
|
83
|
+
enabled: !!s?.encounterUuid && y
|
|
84
84
|
});
|
|
85
85
|
Ae(
|
|
86
86
|
(e) => {
|
|
@@ -88,7 +88,7 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
88
88
|
},
|
|
89
89
|
[c]
|
|
90
90
|
);
|
|
91
|
-
const de = i(() => !I?.entry || !
|
|
91
|
+
const de = i(() => !I?.entry || !s?.formName ? [] : I.entry.filter((r) => r.resource?.resourceType === "Observation").map((r) => r.resource).filter((r) => ve(r) ? Re(r)?.toLowerCase() === s.formName.toLowerCase() : !0), [I, s?.formName]), { controlOrder: le, sectionMap: me, conceptDatatypeMap: ce } = i(
|
|
92
92
|
() => De(H?.schema),
|
|
93
93
|
[H]
|
|
94
94
|
), ue = i(() => {
|
|
@@ -98,17 +98,17 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
98
98
|
return j(_).message;
|
|
99
99
|
}, [F, _]), f = i(
|
|
100
100
|
() => [
|
|
101
|
-
{ key: "recordedOn", header:
|
|
102
|
-
{ key: "recordedBy", header:
|
|
101
|
+
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
102
|
+
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
103
103
|
],
|
|
104
|
-
[
|
|
104
|
+
[o]
|
|
105
105
|
), V = i(
|
|
106
|
-
() => [...f, { key: "actions", header:
|
|
107
|
-
[f,
|
|
106
|
+
() => [...f, { key: "actions", header: o("ACTIONS") }],
|
|
107
|
+
[f, o]
|
|
108
108
|
), fe = d(
|
|
109
|
-
(e) =>
|
|
110
|
-
[
|
|
111
|
-
),
|
|
109
|
+
(e) => T && e.some((t) => u(t)) ? V : f,
|
|
110
|
+
[T, u, V, f]
|
|
111
|
+
), be = f, ye = i(
|
|
112
112
|
() => [
|
|
113
113
|
{ key: "recordedOn", sortable: !0 },
|
|
114
114
|
{ key: "recordedBy", sortable: !0 }
|
|
@@ -119,11 +119,11 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
119
119
|
(t, a) => {
|
|
120
120
|
const l = a.formName;
|
|
121
121
|
t[l] ??= [];
|
|
122
|
-
const v = a.providers.map((
|
|
122
|
+
const v = a.providers.map((he) => he.providerName).filter(Boolean).join(", ");
|
|
123
123
|
return t[l].push({
|
|
124
124
|
id: a.encounterUuid,
|
|
125
125
|
formName: a.formName,
|
|
126
|
-
recordedOn:
|
|
126
|
+
recordedOn: Me(a.encounterDateTime, o, !0).formattedResult,
|
|
127
127
|
recordedBy: v ?? "--",
|
|
128
128
|
encounterDateTime: a.encounterDateTime,
|
|
129
129
|
encounterUuid: a.encounterUuid
|
|
@@ -139,13 +139,13 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
139
139
|
)
|
|
140
140
|
})
|
|
141
141
|
).sort((t, a) => t.formName.localeCompare(a.formName));
|
|
142
|
-
}, [U,
|
|
143
|
-
|
|
144
|
-
}, []),
|
|
145
|
-
D(!1),
|
|
142
|
+
}, [U, o]), P = d((e) => {
|
|
143
|
+
M(e), D(!0);
|
|
144
|
+
}, []), x = d(() => {
|
|
145
|
+
D(!1), M(null);
|
|
146
146
|
}, []), A = d((e) => {
|
|
147
147
|
globalThis.dispatchEvent(
|
|
148
|
-
new CustomEvent(
|
|
148
|
+
new CustomEvent(xe, {
|
|
149
149
|
detail: {
|
|
150
150
|
editOnly: "observationForms",
|
|
151
151
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -155,18 +155,18 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
155
155
|
}
|
|
156
156
|
})
|
|
157
157
|
);
|
|
158
|
-
}, []),
|
|
158
|
+
}, []), G = d(
|
|
159
159
|
(e, r) => {
|
|
160
160
|
switch (r) {
|
|
161
161
|
case "recordedOn":
|
|
162
|
-
return /* @__PURE__ */ n(
|
|
162
|
+
return /* @__PURE__ */ n(Le, { onClick: () => P(e), children: e.recordedOn });
|
|
163
163
|
case "recordedBy":
|
|
164
164
|
return e.recordedBy;
|
|
165
165
|
case "actions":
|
|
166
166
|
return u(e) ? /* @__PURE__ */ n(
|
|
167
167
|
K,
|
|
168
168
|
{
|
|
169
|
-
label:
|
|
169
|
+
label: o("EDIT_OBSERVATION_FORM"),
|
|
170
170
|
kind: "ghost",
|
|
171
171
|
size: "sm",
|
|
172
172
|
testId: `edit-form-${e.encounterUuid}`,
|
|
@@ -178,26 +178,26 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
178
178
|
return null;
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
|
-
[P, A, u,
|
|
181
|
+
[P, A, u, o]
|
|
182
182
|
);
|
|
183
|
-
return /* @__PURE__ */ $(
|
|
184
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children:
|
|
183
|
+
return /* @__PURE__ */ $(ge, { children: [
|
|
184
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || C || q.length === 0 || L ? /* @__PURE__ */ n(
|
|
185
185
|
Q,
|
|
186
186
|
{
|
|
187
|
-
headers:
|
|
188
|
-
ariaLabel:
|
|
187
|
+
headers: be,
|
|
188
|
+
ariaLabel: o("FORMS_HEADING"),
|
|
189
189
|
rows: [],
|
|
190
|
-
loading:
|
|
190
|
+
loading: B,
|
|
191
191
|
errorStateMessage: C ? te?.message : void 0,
|
|
192
|
-
emptyStateMessage:
|
|
193
|
-
renderCell:
|
|
192
|
+
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
193
|
+
renderCell: G,
|
|
194
194
|
className: p.formsTableBody,
|
|
195
195
|
dataTestId: "forms-table"
|
|
196
196
|
}
|
|
197
|
-
) : /* @__PURE__ */ n(
|
|
197
|
+
) : /* @__PURE__ */ n(Se, { align: "start", children: q.map((e, r) => {
|
|
198
198
|
const { formName: t, records: a } = e, l = fe(a);
|
|
199
199
|
return /* @__PURE__ */ n(
|
|
200
|
-
|
|
200
|
+
Be,
|
|
201
201
|
{
|
|
202
202
|
title: t,
|
|
203
203
|
className: p.customAccordianItem,
|
|
@@ -207,13 +207,13 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
207
207
|
Q,
|
|
208
208
|
{
|
|
209
209
|
headers: l,
|
|
210
|
-
ariaLabel:
|
|
210
|
+
ariaLabel: o("FORMS_HEADING"),
|
|
211
211
|
rows: a,
|
|
212
212
|
loading: !1,
|
|
213
213
|
errorStateMessage: "",
|
|
214
|
-
sortable:
|
|
215
|
-
emptyStateMessage:
|
|
216
|
-
renderCell:
|
|
214
|
+
sortable: ye,
|
|
215
|
+
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
216
|
+
renderCell: G,
|
|
217
217
|
className: p.formsTableBody,
|
|
218
218
|
dataTestId: `forms-table-${t}`
|
|
219
219
|
}
|
|
@@ -222,30 +222,30 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
222
222
|
t
|
|
223
223
|
);
|
|
224
224
|
}) }) }),
|
|
225
|
-
|
|
225
|
+
y && s && /* @__PURE__ */ n(
|
|
226
226
|
Ce,
|
|
227
227
|
{
|
|
228
228
|
id: "modalIdForActionAreaLayout",
|
|
229
229
|
portalId: "main-display-area",
|
|
230
|
-
open:
|
|
231
|
-
onRequestClose:
|
|
230
|
+
open: y,
|
|
231
|
+
onRequestClose: x,
|
|
232
232
|
modalHeading: /* @__PURE__ */ $("div", { className: p.modalHeading, children: [
|
|
233
|
-
/* @__PURE__ */ n("span", { children:
|
|
234
|
-
|
|
233
|
+
/* @__PURE__ */ n("span", { children: s.formName }),
|
|
234
|
+
T && u(s) && /* @__PURE__ */ n(
|
|
235
235
|
K,
|
|
236
236
|
{
|
|
237
|
-
label:
|
|
237
|
+
label: o("EDIT_OBSERVATION_FORM"),
|
|
238
238
|
kind: "ghost",
|
|
239
239
|
size: "sm",
|
|
240
|
-
testId: `edit-form-modal-${
|
|
240
|
+
testId: `edit-form-modal-${s.encounterUuid}`,
|
|
241
241
|
onClick: () => {
|
|
242
|
-
|
|
242
|
+
x(), A(s);
|
|
243
243
|
},
|
|
244
244
|
children: /* @__PURE__ */ n(z, {})
|
|
245
245
|
}
|
|
246
246
|
)
|
|
247
247
|
] }),
|
|
248
|
-
modalLabel: `${
|
|
248
|
+
modalLabel: `${s.recordedOn} | ${s.recordedBy}`,
|
|
249
249
|
passiveModal: !0,
|
|
250
250
|
size: "md",
|
|
251
251
|
testId: "form-details-modal",
|
|
@@ -253,12 +253,12 @@ const Ve = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
|
|
|
253
253
|
Ue,
|
|
254
254
|
{
|
|
255
255
|
observations: de,
|
|
256
|
-
isLoading:
|
|
257
|
-
isError:
|
|
256
|
+
isLoading: se || ne,
|
|
257
|
+
isError: oe || ie,
|
|
258
258
|
errorMessage: ue,
|
|
259
|
-
emptyStateMessage:
|
|
260
|
-
testIdPrefix:
|
|
261
|
-
hideThumbnail:
|
|
259
|
+
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
260
|
+
testIdPrefix: s.formName,
|
|
261
|
+
hideThumbnail: Z,
|
|
262
262
|
controlOrder: le,
|
|
263
263
|
sectionMap: me,
|
|
264
264
|
conceptDatatypeMap: ce
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as i, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { m as z, D as F, t as G, o as H, s as P, p as j, q as x, R as J, v as Y, u as W, a as X, I as Z, T as ee, w as se, x as te, f as re, y as ae, z as oe, A as ne, E as ie, H as ce, b as le } from "./index-BKKc70c1.js";
|
|
3
3
|
import { useQueries as de, useQuery as ue } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as pe, useEffect as C, useMemo as I } from "react";
|
|
5
|
-
import { useTranslation as
|
|
5
|
+
import { useTranslation as w } from "react-i18next";
|
|
6
6
|
const be = "Observations-module_observations__RKSyo", me = "Observations-module_title__TJL3z", ve = "Observations-module_wrapper__muk2L", ye = "Observations-module_secondary__14nuS", y = {
|
|
7
7
|
observations: be,
|
|
8
8
|
title: me,
|
|
9
9
|
wrapper: ve,
|
|
10
10
|
secondary: ye
|
|
11
|
-
},
|
|
12
|
-
const a =
|
|
11
|
+
}, U = (t, l, n, c, u, r) => {
|
|
12
|
+
const a = G(t, l, u), e = a.value, p = H(e);
|
|
13
13
|
let o = e;
|
|
14
14
|
p === "Image" && (o = /* @__PURE__ */ i(
|
|
15
|
-
|
|
15
|
+
x,
|
|
16
16
|
{
|
|
17
17
|
imageSrc: e,
|
|
18
18
|
alt: e,
|
|
@@ -20,28 +20,28 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
20
20
|
hideThumbnail: r
|
|
21
21
|
}
|
|
22
22
|
)), p === "Video" && (o = /* @__PURE__ */ i(
|
|
23
|
-
|
|
23
|
+
J,
|
|
24
24
|
{
|
|
25
25
|
id: `${e}-video`,
|
|
26
26
|
videoSrc: e,
|
|
27
27
|
hideThumbnail: r
|
|
28
28
|
}
|
|
29
29
|
)), p === "PDF" && (o = /* @__PURE__ */ i(Y, { id: `${e}-pdf`, src: e }));
|
|
30
|
-
const b = /* @__PURE__ */
|
|
30
|
+
const b = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
|
|
31
31
|
/* @__PURE__ */ i("span", { children: a.header.display }),
|
|
32
32
|
a.header.referenceRange && /* @__PURE__ */ i("span", { className: y.secondary, children: a.header.referenceRange })
|
|
33
33
|
] }), d = u("OBSERVATIONS_RECORDED_BY", {
|
|
34
34
|
provider: a.provider
|
|
35
|
-
}), m = t.effectiveDateTime ?
|
|
35
|
+
}), m = t.effectiveDateTime ? P(t.effectiveDateTime, u, !0).formattedResult : void 0, _ = /* @__PURE__ */ N("div", { className: y.wrapper, children: [
|
|
36
36
|
/* @__PURE__ */ i("span", { children: d }),
|
|
37
37
|
m && /* @__PURE__ */ i("span", { className: y.secondary, children: m })
|
|
38
38
|
] }), v = t.display, T = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", O = c ? `${c}-${T}-${v}-${n}-${l}` : `${T}-${v}-${n}-${l}`;
|
|
39
39
|
return /* @__PURE__ */ i(
|
|
40
|
-
|
|
40
|
+
j,
|
|
41
41
|
{
|
|
42
42
|
header: b,
|
|
43
43
|
value: o,
|
|
44
|
-
info:
|
|
44
|
+
info: _,
|
|
45
45
|
id: O,
|
|
46
46
|
testId: O,
|
|
47
47
|
ariaLabel: O
|
|
@@ -55,7 +55,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
55
55
|
id: `grouped-obs-${t.display}-${c}`,
|
|
56
56
|
open: n,
|
|
57
57
|
children: t.members?.map(
|
|
58
|
-
(e, p) =>
|
|
58
|
+
(e, p) => U(
|
|
59
59
|
e,
|
|
60
60
|
p,
|
|
61
61
|
u,
|
|
@@ -71,9 +71,9 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
71
71
|
title: l = "",
|
|
72
72
|
hideThumbnail: n
|
|
73
73
|
}) => {
|
|
74
|
-
const { t: c } =
|
|
75
|
-
const p =
|
|
76
|
-
return /* @__PURE__ */
|
|
74
|
+
const { t: c } = w(), u = (r, a, e) => {
|
|
75
|
+
const p = z(r.encounterDetails, c);
|
|
76
|
+
return /* @__PURE__ */ N(
|
|
77
77
|
F,
|
|
78
78
|
{
|
|
79
79
|
title: p,
|
|
@@ -81,7 +81,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
81
81
|
open: a,
|
|
82
82
|
children: [
|
|
83
83
|
r.observations.map(
|
|
84
|
-
(o, b) =>
|
|
84
|
+
(o, b) => U(
|
|
85
85
|
o,
|
|
86
86
|
b,
|
|
87
87
|
e,
|
|
@@ -123,7 +123,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
123
123
|
...l,
|
|
124
124
|
n,
|
|
125
125
|
c
|
|
126
|
-
],
|
|
126
|
+
], Ne = ({
|
|
127
127
|
config: t,
|
|
128
128
|
episodeOfCareUuids: l,
|
|
129
129
|
encounterUuids: n
|
|
@@ -133,7 +133,7 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
133
133
|
conceptUuid: r = [],
|
|
134
134
|
hideThumbnail: a = !1,
|
|
135
135
|
scope: e = "all"
|
|
136
|
-
} = c, p = pe(/* @__PURE__ */ new Set()), o = W(), { addNotification: b } = X(), { t: d } =
|
|
136
|
+
} = c, p = pe(/* @__PURE__ */ new Set()), o = W(), { addNotification: b } = X(), { t: d } = w(), m = de({
|
|
137
137
|
queries: u.map((s) => ({
|
|
138
138
|
queryKey: Ee(s),
|
|
139
139
|
queryFn: () => Z(s),
|
|
@@ -141,20 +141,20 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
141
141
|
}))
|
|
142
142
|
});
|
|
143
143
|
C(() => {
|
|
144
|
-
const s = m.some(($) => $.isError),
|
|
145
|
-
s && !
|
|
144
|
+
const s = m.some(($) => $.isError), R = p.current.size > 0;
|
|
145
|
+
s && !R ? (b({
|
|
146
146
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
147
147
|
message: d("ERROR_FETCHING_OBSERVATIONS"),
|
|
148
148
|
type: "error"
|
|
149
|
-
}), p.current.add(0)) : !s &&
|
|
149
|
+
}), p.current.add(0)) : !s && R && p.current.clear();
|
|
150
150
|
}, [m, b, d]);
|
|
151
|
-
const
|
|
151
|
+
const _ = I(() => m.map((s) => s.data?.uuid).filter((s) => !!s), [m]), v = I(() => [.../* @__PURE__ */ new Set([..._, ...r])], [_, r]), f = I(() => u.length === 0 ? !0 : m.every((s) => !s.isLoading), [m, u.length]), T = e === "latest" || e === "latest-encounter", O = ee(
|
|
152
152
|
l,
|
|
153
153
|
n
|
|
154
154
|
), {
|
|
155
155
|
data: E,
|
|
156
|
-
isLoading:
|
|
157
|
-
isError:
|
|
156
|
+
isLoading: V,
|
|
157
|
+
isError: S,
|
|
158
158
|
refetch: D
|
|
159
159
|
} = ue({
|
|
160
160
|
queryKey: he(
|
|
@@ -182,24 +182,24 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
182
182
|
},
|
|
183
183
|
[o, D]
|
|
184
184
|
), C(() => {
|
|
185
|
-
|
|
185
|
+
S && b({
|
|
186
186
|
title: d("ERROR_DEFAULT_TITLE"),
|
|
187
187
|
message: d("ERROR_FETCHING_OBSERVATIONS"),
|
|
188
188
|
type: "error"
|
|
189
189
|
});
|
|
190
|
-
}, [
|
|
191
|
-
const
|
|
190
|
+
}, [S]);
|
|
191
|
+
const A = I(() => {
|
|
192
192
|
if (!E) return [];
|
|
193
193
|
let s = ae(E);
|
|
194
194
|
e === "latest-encounter" && (s = oe(s));
|
|
195
|
-
const
|
|
196
|
-
return ie(
|
|
197
|
-
}, [E, e]),
|
|
195
|
+
const R = ne(s);
|
|
196
|
+
return ie(R);
|
|
197
|
+
}, [E, e]), K = [
|
|
198
198
|
{ key: "name", header: "name" },
|
|
199
199
|
{ key: "value", header: "value" },
|
|
200
200
|
{ key: "form", header: "form" }
|
|
201
|
-
],
|
|
202
|
-
return /* @__PURE__ */
|
|
201
|
+
], L = V || !f, B = S && f, M = (!E || E.entry?.length === 0 || v.length === 0) && f, q = B ? d("ERROR_FETCHING_OBSERVATIONS") : null, Q = M ? d("NO_OBSERVATIONS_FOUND") : void 0, k = A.length > 0 && !L && !B, g = c.titleTranslationKey, h = g ? d(g) : "";
|
|
202
|
+
return /* @__PURE__ */ N(
|
|
203
203
|
"div",
|
|
204
204
|
{
|
|
205
205
|
id: "observations",
|
|
@@ -220,19 +220,19 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
220
220
|
k ? /* @__PURE__ */ i(
|
|
221
221
|
Oe,
|
|
222
222
|
{
|
|
223
|
-
groupedData:
|
|
223
|
+
groupedData: A,
|
|
224
224
|
title: h,
|
|
225
225
|
hideThumbnail: a
|
|
226
226
|
}
|
|
227
227
|
) : /* @__PURE__ */ i(
|
|
228
228
|
le,
|
|
229
229
|
{
|
|
230
|
-
headers:
|
|
230
|
+
headers: K,
|
|
231
231
|
rows: [],
|
|
232
232
|
ariaLabel: d("OBSERVATIONS"),
|
|
233
|
-
loading:
|
|
234
|
-
errorStateMessage:
|
|
235
|
-
emptyStateMessage:
|
|
233
|
+
loading: L,
|
|
234
|
+
errorStateMessage: q,
|
|
235
|
+
emptyStateMessage: Q ?? d("NO_OBSERVATIONS_AVAILABLE"),
|
|
236
236
|
dataTestId: "observations-table"
|
|
237
237
|
}
|
|
238
238
|
)
|
|
@@ -242,6 +242,6 @@ const be = "Observations-module_observations__RKSyo", me = "Observations-module_
|
|
|
242
242
|
};
|
|
243
243
|
export {
|
|
244
244
|
Ee as conceptUuidQueryKeys,
|
|
245
|
-
|
|
245
|
+
Ne as default,
|
|
246
246
|
he as observationsQueryKeys
|
|
247
247
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppContextProvider.d.ts","sourceRoot":"","sources":["../../src/appContext/AppContextProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppContextProvider.d.ts","sourceRoot":"","sources":["../../src/appContext/AppContextProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAEpD,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAwChE,CAAC"}
|