@bahmni/clinical-app 0.0.1-dev.171 → 0.0.1-dev.174
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-TPfrZJSk-tZF6XgiW.js → DocumentsTable-DV_nkz4--BxG6TzAi.js} +1 -1
- package/dist/{FormsTable-BSKlMAJe-CchhIrQU.js → FormsTable-DL_zg0dG-CNrIoP-u.js} +95 -95
- package/dist/{LNWAZHJI-DX2M6Ajj.js → LNWAZHJI-BLCOPCAj.js} +2 -2
- package/dist/{MWZ6AO7Z-CkzhX8b7.js → MWZ6AO7Z-CFFZL3fB.js} +2 -2
- package/dist/{Observations-Diygv8o5-CzzPZTaz.js → Observations-c94Dp42v-BU0sswLL.js} +31 -31
- package/dist/{YPM2AS64-BoYXutAm.js → YPM2AS64-BmgAicTF.js} +181 -181
- package/dist/__mocks__/configMocks.d.ts +1 -1
- package/dist/__mocks__/configMocks.d.ts.map +1 -1
- package/dist/components/dashboardContainer/DashboardContainer.d.ts +1 -1
- package/dist/components/dashboardContainer/DashboardContainer.d.ts.map +1 -1
- package/dist/components/dashboardSection/DashboardSection.d.ts +1 -1
- package/dist/components/dashboardSection/DashboardSection.d.ts.map +1 -1
- package/dist/components/forms/medications/MedicationsForm.d.ts.map +1 -1
- package/dist/components/forms/medications/constants.d.ts +2 -0
- package/dist/components/forms/medications/constants.d.ts.map +1 -0
- package/dist/components/forms/medications/schema.json.d.ts +40 -0
- package/dist/components/forms/vaccinations/VaccinationForm.d.ts.map +1 -1
- package/dist/constants/app.d.ts +1 -0
- package/dist/constants/app.d.ts.map +1 -1
- package/dist/constants/errors.d.ts +0 -1
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/{index-MTO-ZYpf.js → index-BFfaeZUC.js} +31117 -31096
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +2 -1
- package/dist/locales/locale_es.json +2 -1
- package/dist/pages/ConsultationPage.d.ts.map +1 -1
- package/dist/pages/constant.d.ts +1 -0
- package/dist/pages/constant.d.ts.map +1 -1
- package/dist/pages/models.d.ts +18 -0
- package/dist/pages/models.d.ts.map +1 -0
- package/dist/pages/schema.json.d.ts +57 -0
- package/dist/{services/consultationPageService.d.ts → pages/util.d.ts} +3 -2
- package/dist/pages/util.d.ts.map +1 -0
- package/dist/providers/clinicalConfig/constants.d.ts +2 -0
- package/dist/providers/clinicalConfig/constants.d.ts.map +1 -0
- package/dist/{contexts/ClinicalConfigContext.d.ts → providers/clinicalConfig/context.d.ts} +1 -1
- package/dist/providers/clinicalConfig/context.d.ts.map +1 -0
- package/dist/providers/clinicalConfig/hook.d.ts +3 -0
- package/dist/providers/clinicalConfig/hook.d.ts.map +1 -0
- package/dist/providers/clinicalConfig/index.d.ts +5 -0
- package/dist/providers/clinicalConfig/index.d.ts.map +1 -0
- package/dist/providers/clinicalConfig/models.d.ts +36 -0
- package/dist/providers/clinicalConfig/models.d.ts.map +1 -0
- package/dist/providers/clinicalConfig/provider.d.ts +4 -0
- package/dist/providers/clinicalConfig/provider.d.ts.map +1 -0
- package/dist/providers/clinicalConfig/schema.json.d.ts +124 -0
- package/package.json +1 -1
- package/dist/contexts/ClinicalConfigContext.d.ts.map +0 -1
- package/dist/contexts/models.d.ts +0 -14
- package/dist/contexts/models.d.ts.map +0 -1
- package/dist/hooks/useClinicalConfig.d.ts +0 -7
- package/dist/hooks/useClinicalConfig.d.ts.map +0 -1
- package/dist/hooks/useDashboardConfig.d.ts +0 -15
- package/dist/hooks/useDashboardConfig.d.ts.map +0 -1
- package/dist/hooks/useMedicationConfig.d.ts +0 -9
- package/dist/hooks/useMedicationConfig.d.ts.map +0 -1
- package/dist/providers/ClinicalConfigProvider.d.ts +0 -7
- package/dist/providers/ClinicalConfigProvider.d.ts.map +0 -1
- package/dist/services/consultationPageService.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as N, jsx as w, Fragment as St } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { f as kt, u as Wt, n as jt, a as Pt, b as Ut, z as $t, G as Yt, g as qt, W as h, P as Ft } from "./index-BFfaeZUC.js";
|
|
3
3
|
import e, { useState as A, useCallback as g, useEffect as Gt, useMemo as z } from "react";
|
|
4
4
|
function Kt(t, r, n) {
|
|
5
5
|
return (r = Xt(r)) in t ? Object.defineProperty(t, r, {
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsx as s, jsxs as p, Fragment as
|
|
2
|
-
import { u as ee,
|
|
3
|
-
import { useState as k, useMemo as h, useCallback as
|
|
4
|
-
const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6",
|
|
1
|
+
import { jsx as s, jsxs as p, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { u as ee, f as re, v as ae, c as te, a as L, e as oe, b as ne, L as se, z as U, K as de, Y as me, G as ie, d as le, B as q, $ as ce, g as ue, C as A, D as be, h as pe, w as fe, S as _e, i as $e, k as ge, Z as ve, I as he } from "./index-BFfaeZUC.js";
|
|
3
|
+
import { useState as k, useMemo as h, useCallback as R } from "react";
|
|
4
|
+
const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", Fe = "_rowContainer_1pd36_43", Ie = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Me = "_rowValue_1pd36_67", Se = "_groupMembers_1pd36_75", Ve = "_memberRow_1pd36_81", Te = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", De = "_abnormalValue_1pd36_102", Be = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", xe = "_nestedGroup_1pd36_125", Ge = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
|
|
5
5
|
formsTableBody: Ne,
|
|
6
6
|
customAccordianItem: ye,
|
|
7
|
-
formContent:
|
|
8
|
-
formDetailsContainer:
|
|
9
|
-
observation:
|
|
10
|
-
groupContainer:
|
|
7
|
+
formContent: Le,
|
|
8
|
+
formDetailsContainer: Re,
|
|
9
|
+
observation: Ae,
|
|
10
|
+
groupContainer: Ce,
|
|
11
11
|
rowContainer: Fe,
|
|
12
|
-
groupLabel:
|
|
13
|
-
rowLabel:
|
|
14
|
-
rowValue:
|
|
15
|
-
groupMembers:
|
|
16
|
-
memberRow:
|
|
17
|
-
memberLabel:
|
|
12
|
+
groupLabel: Ie,
|
|
13
|
+
rowLabel: Oe,
|
|
14
|
+
rowValue: Me,
|
|
15
|
+
groupMembers: Se,
|
|
16
|
+
memberRow: Ve,
|
|
17
|
+
memberLabel: Te,
|
|
18
18
|
memberValue: we,
|
|
19
19
|
abnormalValue: De,
|
|
20
|
-
commentSection:
|
|
20
|
+
commentSection: Be,
|
|
21
21
|
commentText: Ee,
|
|
22
|
-
nestedGroup:
|
|
23
|
-
nestedGroupLabel:
|
|
22
|
+
nestedGroup: xe,
|
|
23
|
+
nestedGroupLabel: Ge,
|
|
24
24
|
nestedGroupMembers: Ue
|
|
25
|
-
},
|
|
25
|
+
}, H = (e) => {
|
|
26
26
|
const r = be(e);
|
|
27
27
|
return r === "Image" ? /* @__PURE__ */ s(
|
|
28
28
|
pe,
|
|
@@ -31,11 +31,11 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
31
31
|
alt: e,
|
|
32
32
|
id: `${e}-img`
|
|
33
33
|
}
|
|
34
|
-
) : r === "Video" ? /* @__PURE__ */ s(
|
|
35
|
-
},
|
|
34
|
+
) : r === "Video" ? /* @__PURE__ */ s(fe, { id: `${e}-video`, videoSrc: e }) : e;
|
|
35
|
+
}, P = (e) => {
|
|
36
36
|
const r = e.observationValue?.unit, n = e.observationValue?.referenceRange?.low?.value, a = e.observationValue?.referenceRange?.high?.value, d = n != null, c = a != null, m = d && c ? ` (${n} - ${a})` : d ? ` (>${n})` : c ? ` (<${a})` : "", t = e.observationValue?.isAbnormal === !0;
|
|
37
37
|
return { units: r, rangeString: m, isAbnormal: t };
|
|
38
|
-
},
|
|
38
|
+
}, j = ({
|
|
39
39
|
member: e,
|
|
40
40
|
depth: r = 0,
|
|
41
41
|
memberIndex: n = 0,
|
|
@@ -65,7 +65,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
65
65
|
className: o.nestedGroupMembers,
|
|
66
66
|
"data-testid": `${t}obs-nested-group-members-${m}-${n}`,
|
|
67
67
|
children: e.members?.map((N, y) => /* @__PURE__ */ s(
|
|
68
|
-
|
|
68
|
+
j,
|
|
69
69
|
{
|
|
70
70
|
member: N,
|
|
71
71
|
depth: r + 1,
|
|
@@ -79,8 +79,8 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
79
79
|
]
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
const { units: b, rangeString:
|
|
83
|
-
return /* @__PURE__ */ p(
|
|
82
|
+
const { units: b, rangeString: g, isAbnormal: f } = P(e), _ = e.observationValue?.value?.toString(), $ = _ ? H(_) : null;
|
|
83
|
+
return /* @__PURE__ */ p(K, { children: [
|
|
84
84
|
/* @__PURE__ */ p(
|
|
85
85
|
"div",
|
|
86
86
|
{
|
|
@@ -91,23 +91,23 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
91
91
|
/* @__PURE__ */ p(
|
|
92
92
|
"p",
|
|
93
93
|
{
|
|
94
|
-
className:
|
|
94
|
+
className: A(
|
|
95
95
|
o.memberLabel,
|
|
96
|
-
|
|
96
|
+
f ? o.abnormalValue : ""
|
|
97
97
|
),
|
|
98
98
|
"data-testid": `${t}obs-member-label-${m}-${n}`,
|
|
99
99
|
children: [
|
|
100
100
|
m,
|
|
101
|
-
|
|
101
|
+
g
|
|
102
102
|
]
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
105
|
/* @__PURE__ */ p(
|
|
106
106
|
"div",
|
|
107
107
|
{
|
|
108
|
-
className:
|
|
108
|
+
className: A(
|
|
109
109
|
o.memberValue,
|
|
110
|
-
|
|
110
|
+
f ? o.abnormalValue : ""
|
|
111
111
|
),
|
|
112
112
|
"data-testid": `${t}obs-member-value-${m}-${n}`,
|
|
113
113
|
children: [
|
|
@@ -138,7 +138,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
138
138
|
formName: n = "",
|
|
139
139
|
comment: a
|
|
140
140
|
}) => {
|
|
141
|
-
const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } =
|
|
141
|
+
const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = P(e), b = n ? `${n}-` : "", g = e.observationValue?.value?.toString(), f = g ? H(g) : null;
|
|
142
142
|
return /* @__PURE__ */ p(
|
|
143
143
|
"div",
|
|
144
144
|
{
|
|
@@ -154,7 +154,7 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
154
154
|
/* @__PURE__ */ p(
|
|
155
155
|
"p",
|
|
156
156
|
{
|
|
157
|
-
className:
|
|
157
|
+
className: A(
|
|
158
158
|
d ? o.groupLabel : o.rowLabel,
|
|
159
159
|
!d && t ? o.abnormalValue : ""
|
|
160
160
|
),
|
|
@@ -170,27 +170,27 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
170
170
|
{
|
|
171
171
|
className: o.groupMembers,
|
|
172
172
|
"data-testid": `${b}observation-group-members-${e.display}-${r}`,
|
|
173
|
-
children: e.members?.map((
|
|
174
|
-
|
|
173
|
+
children: e.members?.map((_, $) => /* @__PURE__ */ s(
|
|
174
|
+
j,
|
|
175
175
|
{
|
|
176
|
-
member:
|
|
176
|
+
member: _,
|
|
177
177
|
depth: 0,
|
|
178
178
|
memberIndex: $,
|
|
179
179
|
formName: n
|
|
180
180
|
},
|
|
181
|
-
`${
|
|
181
|
+
`${_.id}`
|
|
182
182
|
))
|
|
183
183
|
}
|
|
184
184
|
) : /* @__PURE__ */ p(
|
|
185
185
|
"div",
|
|
186
186
|
{
|
|
187
|
-
className:
|
|
187
|
+
className: A(
|
|
188
188
|
o.rowValue,
|
|
189
189
|
t ? o.abnormalValue : ""
|
|
190
190
|
),
|
|
191
191
|
"data-testid": `${b}observation-value-${e.display}-${r}`,
|
|
192
192
|
children: [
|
|
193
|
-
|
|
193
|
+
f,
|
|
194
194
|
c && ` ${c}`
|
|
195
195
|
]
|
|
196
196
|
}
|
|
@@ -214,90 +214,90 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
214
214
|
`${e.id}-${r}`
|
|
215
215
|
);
|
|
216
216
|
}, ke = (e) => e ? e.extension?.find(
|
|
217
|
-
(r) => r.url ===
|
|
218
|
-
)?.valueString : void 0,
|
|
217
|
+
(r) => r.url === _e
|
|
218
|
+
)?.valueString : void 0, Ke = (e) => {
|
|
219
219
|
if (e)
|
|
220
220
|
return e.note?.[0]?.text;
|
|
221
|
-
},
|
|
222
|
-
const n =
|
|
221
|
+
}, He = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, O = (e, r) => {
|
|
222
|
+
const n = He(e, r);
|
|
223
223
|
return n ? {
|
|
224
224
|
formFieldPath: ke(n),
|
|
225
|
-
comment:
|
|
225
|
+
comment: Ke(n)
|
|
226
226
|
} : {};
|
|
227
|
-
},
|
|
227
|
+
}, Pe = (e, r) => {
|
|
228
228
|
if (!e?.entry || !r)
|
|
229
229
|
return [];
|
|
230
230
|
const n = ce(e);
|
|
231
231
|
return [
|
|
232
232
|
...n.observations.map((a) => {
|
|
233
|
-
const { formFieldPath: d, comment: c } =
|
|
233
|
+
const { formFieldPath: d, comment: c } = O(
|
|
234
234
|
e,
|
|
235
235
|
a.id
|
|
236
236
|
);
|
|
237
237
|
return { obs: a, formFieldPath: d, comment: c };
|
|
238
238
|
}),
|
|
239
239
|
...n.groupedObservations.flatMap((a) => {
|
|
240
|
-
const { formFieldPath: d } =
|
|
240
|
+
const { formFieldPath: d } = O(e, a.id);
|
|
241
241
|
return (a.members ?? []).map((c) => {
|
|
242
|
-
const { comment: m } =
|
|
242
|
+
const { comment: m } = O(e, c.id);
|
|
243
243
|
return { obs: c, formFieldPath: d, comment: m };
|
|
244
244
|
});
|
|
245
245
|
})
|
|
246
246
|
].filter(
|
|
247
247
|
({ formFieldPath: a }) => !a || a.includes(r)
|
|
248
248
|
);
|
|
249
|
-
},
|
|
249
|
+
}, Ye = ({
|
|
250
250
|
episodeOfCareUuids: e,
|
|
251
251
|
encounterUuids: r,
|
|
252
252
|
config: n
|
|
253
253
|
}) => {
|
|
254
|
-
const { t: a } = ee(), d = re(), [c, m] = k(!1), [t, b] = k(null),
|
|
254
|
+
const { t: a } = ee(), d = re(), [c, m] = k(!1), [t, b] = k(null), g = n?.numberOfVisits, f = ae(
|
|
255
255
|
e,
|
|
256
256
|
r
|
|
257
|
-
),
|
|
257
|
+
), _ = te(), {
|
|
258
258
|
data: $ = [],
|
|
259
259
|
isLoading: N,
|
|
260
260
|
isError: y,
|
|
261
|
-
error:
|
|
262
|
-
refetch:
|
|
263
|
-
} =
|
|
261
|
+
error: z,
|
|
262
|
+
refetch: Q
|
|
263
|
+
} = L({
|
|
264
264
|
queryKey: ["forms", d, e],
|
|
265
|
-
queryFn: () => $e(d, void 0,
|
|
266
|
-
enabled: !!d && !
|
|
267
|
-
}),
|
|
265
|
+
queryFn: () => $e(d, void 0, g),
|
|
266
|
+
enabled: !!d && !f
|
|
267
|
+
}), M = h(() => !r || r.length === 0 ? $ : $.filter(
|
|
268
268
|
(i) => r.includes(i.encounterUuid)
|
|
269
|
-
), [$, r]), { data:
|
|
269
|
+
), [$, r]), { data: S = [] } = L({
|
|
270
270
|
queryKey: ["observationForms"],
|
|
271
|
-
queryFn: () =>
|
|
272
|
-
}),
|
|
273
|
-
(i) =>
|
|
274
|
-
[
|
|
275
|
-
),
|
|
271
|
+
queryFn: () => ge()
|
|
272
|
+
}), V = R(
|
|
273
|
+
(i) => S.find((u) => u.name === i)?.uuid,
|
|
274
|
+
[S]
|
|
275
|
+
), C = h(() => {
|
|
276
276
|
if (t)
|
|
277
|
-
return
|
|
278
|
-
}, [t,
|
|
279
|
-
queryKey: ["formMetadata",
|
|
280
|
-
queryFn: () =>
|
|
281
|
-
enabled: !!
|
|
277
|
+
return V(t.formName);
|
|
278
|
+
}, [t, V]), { isLoading: Y, error: T } = L({
|
|
279
|
+
queryKey: ["formMetadata", C],
|
|
280
|
+
queryFn: () => ve(C),
|
|
281
|
+
enabled: !!C && c
|
|
282
282
|
}), {
|
|
283
283
|
data: F,
|
|
284
|
-
isLoading:
|
|
284
|
+
isLoading: Z,
|
|
285
285
|
error: w
|
|
286
|
-
} =
|
|
286
|
+
} = L({
|
|
287
287
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
288
288
|
queryFn: () => he(t.encounterUuid),
|
|
289
289
|
enabled: !!t?.encounterUuid && c
|
|
290
290
|
});
|
|
291
291
|
oe(
|
|
292
292
|
(i) => {
|
|
293
|
-
i.patientUUID === d && i.updatedConcepts.size > 0 && (
|
|
293
|
+
i.patientUUID === d && i.updatedConcepts.size > 0 && (Q(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
294
294
|
},
|
|
295
295
|
[d]
|
|
296
296
|
);
|
|
297
|
-
const D = h(() => !F || !t?.formName ? [] :
|
|
297
|
+
const D = h(() => !F || !t?.formName ? [] : Pe(
|
|
298
298
|
F,
|
|
299
299
|
t.formName
|
|
300
|
-
), [F, t?.formName]),
|
|
300
|
+
), [F, t?.formName]), B = h(
|
|
301
301
|
() => [
|
|
302
302
|
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
303
303
|
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
@@ -310,16 +310,16 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
310
310
|
],
|
|
311
311
|
[]
|
|
312
312
|
), E = h(() => {
|
|
313
|
-
const i =
|
|
313
|
+
const i = M.reduce(
|
|
314
314
|
(u, l) => {
|
|
315
|
-
const
|
|
316
|
-
u[
|
|
317
|
-
const
|
|
318
|
-
return u[
|
|
315
|
+
const v = l.formName;
|
|
316
|
+
u[v] ??= [];
|
|
317
|
+
const I = l.providers.map((W) => W.providerName).filter(Boolean).join(", ");
|
|
318
|
+
return u[v].push({
|
|
319
319
|
id: l.encounterUuid,
|
|
320
320
|
formName: l.formName,
|
|
321
321
|
recordedOn: ne(l.encounterDateTime, a, ue).formattedResult,
|
|
322
|
-
recordedBy:
|
|
322
|
+
recordedBy: I ?? "--",
|
|
323
323
|
encounterDateTime: l.encounterDateTime,
|
|
324
324
|
encounterUuid: l.encounterUuid
|
|
325
325
|
}), u;
|
|
@@ -330,43 +330,43 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
330
330
|
([u, l]) => ({
|
|
331
331
|
formName: u,
|
|
332
332
|
records: l.sort(
|
|
333
|
-
(
|
|
333
|
+
(v, I) => I.encounterDateTime - v.encounterDateTime
|
|
334
334
|
)
|
|
335
335
|
})
|
|
336
336
|
).sort((u, l) => u.formName.localeCompare(l.formName));
|
|
337
|
-
}, [
|
|
337
|
+
}, [M, a]), x = R((i) => {
|
|
338
338
|
b(i), m(!0);
|
|
339
|
-
}, []),
|
|
339
|
+
}, []), X = R(() => {
|
|
340
340
|
m(!1), b(null);
|
|
341
|
-
}, []),
|
|
341
|
+
}, []), G = R(
|
|
342
342
|
(i, u) => {
|
|
343
343
|
switch (u) {
|
|
344
344
|
case "recordedOn":
|
|
345
|
-
return /* @__PURE__ */ s(se, { onClick: () =>
|
|
345
|
+
return /* @__PURE__ */ s(se, { onClick: () => x(i), children: i.recordedOn });
|
|
346
346
|
case "recordedBy":
|
|
347
347
|
return i.recordedBy;
|
|
348
348
|
default:
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
|
-
[
|
|
352
|
+
[x]
|
|
353
353
|
);
|
|
354
|
-
return /* @__PURE__ */ p(
|
|
355
|
-
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: N || y || E.length === 0 ||
|
|
354
|
+
return /* @__PURE__ */ p(K, { children: [
|
|
355
|
+
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: N || y || E.length === 0 || f ? /* @__PURE__ */ s(
|
|
356
356
|
U,
|
|
357
357
|
{
|
|
358
|
-
headers:
|
|
358
|
+
headers: B,
|
|
359
359
|
ariaLabel: a("FORMS_HEADING"),
|
|
360
360
|
rows: [],
|
|
361
361
|
loading: N,
|
|
362
|
-
errorStateMessage: y ?
|
|
362
|
+
errorStateMessage: y ? z?.message : void 0,
|
|
363
363
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
364
|
-
renderCell:
|
|
364
|
+
renderCell: G,
|
|
365
365
|
className: o.formsTableBody,
|
|
366
366
|
dataTestId: "forms-table"
|
|
367
367
|
}
|
|
368
368
|
) : /* @__PURE__ */ s(de, { align: "start", children: E.map((i, u) => {
|
|
369
|
-
const { formName: l, records:
|
|
369
|
+
const { formName: l, records: v } = i;
|
|
370
370
|
return /* @__PURE__ */ s(
|
|
371
371
|
me,
|
|
372
372
|
{
|
|
@@ -377,14 +377,14 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
377
377
|
children: /* @__PURE__ */ s(
|
|
378
378
|
U,
|
|
379
379
|
{
|
|
380
|
-
headers:
|
|
380
|
+
headers: B,
|
|
381
381
|
ariaLabel: a("FORMS_HEADING"),
|
|
382
|
-
rows:
|
|
382
|
+
rows: v,
|
|
383
383
|
loading: !1,
|
|
384
384
|
errorStateMessage: "",
|
|
385
385
|
sortable: J,
|
|
386
386
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
387
|
-
renderCell:
|
|
387
|
+
renderCell: G,
|
|
388
388
|
className: o.formsTableBody,
|
|
389
389
|
dataTestId: `forms-table-${l}`
|
|
390
390
|
}
|
|
@@ -398,13 +398,13 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
398
398
|
{
|
|
399
399
|
id: "modalIdForActionAreaLayout",
|
|
400
400
|
open: c,
|
|
401
|
-
onRequestClose:
|
|
401
|
+
onRequestClose: X,
|
|
402
402
|
modalHeading: t.formName,
|
|
403
403
|
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
404
404
|
passiveModal: !0,
|
|
405
405
|
size: "md",
|
|
406
406
|
testId: "form-details-modal",
|
|
407
|
-
children: /* @__PURE__ */ s("div", { className: o.formContent, children:
|
|
407
|
+
children: /* @__PURE__ */ s("div", { className: o.formContent, children: Y || Z ? /* @__PURE__ */ s(le, { width: "100%", lineCount: 3 }) : T ? /* @__PURE__ */ s("div", { children: q(T).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ s("div", { children: q(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : D.length > 0 ? /* @__PURE__ */ s("div", { className: o.formDetailsContainer, children: D.map(({ obs: i, comment: u }, l) => /* @__PURE__ */ s(
|
|
408
408
|
qe,
|
|
409
409
|
{
|
|
410
410
|
observation: i,
|
|
@@ -419,5 +419,5 @@ const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce =
|
|
|
419
419
|
] });
|
|
420
420
|
};
|
|
421
421
|
export {
|
|
422
|
-
|
|
422
|
+
Ye as default
|
|
423
423
|
};
|
|
@@ -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-BmgAicTF.js";
|
|
2
|
+
import { t as d, x as f, y as e } from "./index-BFfaeZUC.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-BmgAicTF.js";
|
|
2
|
+
import { t as v, x as C, y as e } from "./index-BFfaeZUC.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 I, jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useRef as te, useEffect as
|
|
4
|
-
const
|
|
2
|
+
import { f as B, n as V, u as N, j as w, R as K, a as Q, e as j, $ as x, l as z, m as G, o as H, z as M, q as P, p as S, U as W, D as X, r as Y, h as J, w as Z, s as ee } from "./index-BFfaeZUC.js";
|
|
3
|
+
import { useRef as te, useEffect as _, useMemo as E } from "react";
|
|
4
|
+
const D = (t, d, i, l, s) => {
|
|
5
5
|
const a = W(t, d), r = a.value, o = X(r);
|
|
6
6
|
let n = r;
|
|
7
7
|
o === "Image" && (n = /* @__PURE__ */ c(J, { imageSrc: r, alt: r, id: `${r}-img` })), o === "Video" && (n = /* @__PURE__ */ c(Z, { id: `${r}-video`, videoSrc: r }));
|
|
@@ -27,7 +27,7 @@ const A = (t, d, i, l, s) => {
|
|
|
27
27
|
id: `grouped-obs-${t.display}-${l}`,
|
|
28
28
|
open: i,
|
|
29
29
|
children: t.members?.map(
|
|
30
|
-
(r, o) =>
|
|
30
|
+
(r, o) => D(r, o, s, a, d)
|
|
31
31
|
)
|
|
32
32
|
},
|
|
33
33
|
`grouped-obs-${t.id}`
|
|
@@ -45,7 +45,7 @@ const A = (t, d, i, l, s) => {
|
|
|
45
45
|
open: a,
|
|
46
46
|
children: [
|
|
47
47
|
s.observations.map(
|
|
48
|
-
(n, b) =>
|
|
48
|
+
(n, b) => D(n, b, r, d, i)
|
|
49
49
|
),
|
|
50
50
|
s.groupedObservations.map(
|
|
51
51
|
(n, b) => ae(
|
|
@@ -77,14 +77,14 @@ const A = (t, d, i, l, s) => {
|
|
|
77
77
|
observations: re,
|
|
78
78
|
title: oe
|
|
79
79
|
}, ie = (t) => ["conceptUuid", t], ne = (t, d) => ["observations", t, ...d], ce = ({ config: t }) => {
|
|
80
|
-
const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, s = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: r } =
|
|
80
|
+
const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, s = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: r } = V(), { t: o } = N(), n = w({
|
|
81
81
|
queries: i.map((e) => ({
|
|
82
82
|
queryKey: ie(e),
|
|
83
|
-
queryFn: () =>
|
|
83
|
+
queryFn: () => K(e),
|
|
84
84
|
enabled: !!e
|
|
85
85
|
}))
|
|
86
86
|
});
|
|
87
|
-
|
|
87
|
+
_(() => {
|
|
88
88
|
n.forEach((e, m) => {
|
|
89
89
|
if (e.isError && !s.current.has(m)) {
|
|
90
90
|
const k = i[m];
|
|
@@ -96,44 +96,44 @@ const A = (t, d, i, l, s) => {
|
|
|
96
96
|
} else e.isError || s.current.delete(m);
|
|
97
97
|
});
|
|
98
98
|
}, [n, i]);
|
|
99
|
-
const b =
|
|
99
|
+
const b = E(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = E(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), v = E(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
|
|
100
100
|
data: u,
|
|
101
|
-
isLoading:
|
|
102
|
-
isError:
|
|
103
|
-
refetch:
|
|
104
|
-
} =
|
|
101
|
+
isLoading: U,
|
|
102
|
+
isError: g,
|
|
103
|
+
refetch: h
|
|
104
|
+
} = Q({
|
|
105
105
|
queryKey: ne(a, p),
|
|
106
106
|
queryFn: () => ee(a, p),
|
|
107
107
|
enabled: !!a && p.length > 0 && v
|
|
108
108
|
});
|
|
109
|
-
|
|
109
|
+
j(
|
|
110
110
|
(e) => {
|
|
111
111
|
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
112
112
|
(m) => p.includes(m)
|
|
113
|
-
) &&
|
|
113
|
+
) && h();
|
|
114
114
|
},
|
|
115
|
-
[a,
|
|
116
|
-
),
|
|
117
|
-
|
|
115
|
+
[a, h]
|
|
116
|
+
), _(() => {
|
|
117
|
+
g && r({
|
|
118
118
|
title: o("ERROR_DEFAULT_TITLE"),
|
|
119
119
|
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
120
120
|
type: "error"
|
|
121
121
|
});
|
|
122
|
-
}, [
|
|
123
|
-
const f =
|
|
122
|
+
}, [g]);
|
|
123
|
+
const f = E(() => {
|
|
124
124
|
if (!u) return [];
|
|
125
|
-
const e =
|
|
126
|
-
return
|
|
127
|
-
}, [u]),
|
|
125
|
+
const e = x(u), m = z(e);
|
|
126
|
+
return G(m);
|
|
127
|
+
}, [u]), q = [
|
|
128
128
|
{ key: "name", header: "name" },
|
|
129
129
|
{ key: "value", header: "value" },
|
|
130
130
|
{ key: "form", header: "form" }
|
|
131
|
-
],
|
|
131
|
+
], $ = U || !v, O = g && v, A = (!u || u.entry?.length === 0 || p.length === 0) && v, C = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, F = A ? o("NO_OBSERVATIONS_FOUND") : void 0, L = f.length > 0 && !$ && !O, R = d.titleTranslationKey, y = R ? o(R) : "";
|
|
132
132
|
return /* @__PURE__ */ I(
|
|
133
133
|
"div",
|
|
134
134
|
{
|
|
135
135
|
id: "observations",
|
|
136
|
-
"data-testid":
|
|
136
|
+
"data-testid": R ? `observations-${y}` : "observations",
|
|
137
137
|
"aria-label": "observations-aria-label",
|
|
138
138
|
className: T.observations,
|
|
139
139
|
children: [
|
|
@@ -141,21 +141,21 @@ const A = (t, d, i, l, s) => {
|
|
|
141
141
|
H,
|
|
142
142
|
{
|
|
143
143
|
id: "observations-title",
|
|
144
|
-
testId:
|
|
144
|
+
testId: R ? `observations-title-${y}` : "observations-title",
|
|
145
145
|
title: y,
|
|
146
146
|
className: T.title,
|
|
147
147
|
children: /* @__PURE__ */ c("p", { children: y })
|
|
148
148
|
}
|
|
149
149
|
),
|
|
150
|
-
|
|
150
|
+
L ? /* @__PURE__ */ c(se, { groupedData: f, title: y }) : /* @__PURE__ */ c(
|
|
151
151
|
M,
|
|
152
152
|
{
|
|
153
|
-
headers:
|
|
153
|
+
headers: q,
|
|
154
154
|
rows: [],
|
|
155
155
|
ariaLabel: o("OBSERVATIONS"),
|
|
156
|
-
loading:
|
|
157
|
-
errorStateMessage:
|
|
158
|
-
emptyStateMessage:
|
|
156
|
+
loading: $,
|
|
157
|
+
errorStateMessage: C,
|
|
158
|
+
emptyStateMessage: F,
|
|
159
159
|
dataTestId: "observations-table"
|
|
160
160
|
}
|
|
161
161
|
)
|