@bahmni/appointments-app 0.0.1-dev.172
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/README.md +20 -0
- package/dist/App.d.ts +3 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/DocumentsTable-TPfrZJSk-Cqm8-CTh.js +5429 -0
- package/dist/FormsTable-BSKlMAJe-BkpZHPeB.js +423 -0
- package/dist/LNWAZHJI-DO9J_8M1.js +33 -0
- package/dist/MWZ6AO7Z-Crr2E7yS.js +42 -0
- package/dist/Observations-Diygv8o5-c_ci9Obh.js +170 -0
- package/dist/YPM2AS64-BCL6ByR_.js +8975 -0
- package/dist/config/tanstackQuery.d.ts +3 -0
- package/dist/config/tanstackQuery.d.ts.map +1 -0
- package/dist/constants/app.d.ts +2 -0
- package/dist/constants/app.d.ts.map +1 -0
- package/dist/index-BjYaBVts.js +155377 -0
- package/dist/index-CFigb5vF.js +8 -0
- package/dist/index.css +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/locales/locale_en.json +1 -0
- package/dist/locales/locale_es.json +1 -0
- package/dist/pages/index.d.ts +3 -0
- package/dist/pages/index.d.ts.map +1 -0
- package/dist/routes/index.d.ts +4 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/model.d.ts +8 -0
- package/dist/routes/model.d.ts.map +1 -0
- package/package.json +31 -0
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { jsx as s, jsxs as p, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { u as ee, p as re, v as ae, b as te, a as C, e as oe, i as ne, T as se, z as U, Y as de, c as me, G as ie, d as le, V as q, Q as ce, g as ue, C as R, h as be, _ as pe, j as _e, k as fe, l as $e, X as ve, m as ge, J as he } from "./index-BjYaBVts.js";
|
|
3
|
+
import { useState as k, useMemo as h, useCallback as L } from "react";
|
|
4
|
+
const Ne = "_formsTableBody_1pd36_1", ye = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Le = "_formDetailsContainer_1pd36_25", Re = "_observation_1pd36_30", Ae = "_groupContainer_1pd36_39", Fe = "_rowContainer_1pd36_43", Ve = "_groupLabel_1pd36_48", Me = "_rowLabel_1pd36_58", Oe = "_rowValue_1pd36_67", Te = "_groupMembers_1pd36_75", Ie = "_memberRow_1pd36_81", Se = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", De = "_abnormalValue_1pd36_102", xe = "_commentSection_1pd36_110", Ee = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Be = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
|
|
5
|
+
formsTableBody: Ne,
|
|
6
|
+
customAccordianItem: ye,
|
|
7
|
+
formContent: Ce,
|
|
8
|
+
formDetailsContainer: Le,
|
|
9
|
+
observation: Re,
|
|
10
|
+
groupContainer: Ae,
|
|
11
|
+
rowContainer: Fe,
|
|
12
|
+
groupLabel: Ve,
|
|
13
|
+
rowLabel: Me,
|
|
14
|
+
rowValue: Oe,
|
|
15
|
+
groupMembers: Te,
|
|
16
|
+
memberRow: Ie,
|
|
17
|
+
memberLabel: Se,
|
|
18
|
+
memberValue: we,
|
|
19
|
+
abnormalValue: De,
|
|
20
|
+
commentSection: xe,
|
|
21
|
+
commentText: Ee,
|
|
22
|
+
nestedGroup: Ge,
|
|
23
|
+
nestedGroupLabel: Be,
|
|
24
|
+
nestedGroupMembers: Ue
|
|
25
|
+
}, j = (e) => {
|
|
26
|
+
const r = be(e);
|
|
27
|
+
return r === "Image" ? /* @__PURE__ */ s(
|
|
28
|
+
pe,
|
|
29
|
+
{
|
|
30
|
+
imageSrc: e,
|
|
31
|
+
alt: e,
|
|
32
|
+
id: `${e}-img`
|
|
33
|
+
}
|
|
34
|
+
) : r === "Video" ? /* @__PURE__ */ s(_e, { id: `${e}-video`, videoSrc: e }) : e;
|
|
35
|
+
}, K = (e) => {
|
|
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
|
+
return { units: r, rangeString: m, isAbnormal: t };
|
|
38
|
+
}, P = ({
|
|
39
|
+
member: e,
|
|
40
|
+
depth: r = 0,
|
|
41
|
+
memberIndex: n = 0,
|
|
42
|
+
formName: a = "",
|
|
43
|
+
comment: d
|
|
44
|
+
}) => {
|
|
45
|
+
const c = e.members && e.members.length > 0, m = e.display, t = a ? `${a}-` : "";
|
|
46
|
+
if (c)
|
|
47
|
+
return /* @__PURE__ */ p(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: o.nestedGroup,
|
|
51
|
+
"data-testid": `${t}obs-nested-group-${m}-${n}`,
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ s(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: o.nestedGroupLabel,
|
|
57
|
+
"data-testid": `${t}obs-nested-group-label-${m}-${n}`,
|
|
58
|
+
style: { paddingLeft: `${r * 16}px` },
|
|
59
|
+
children: m
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ s(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: o.nestedGroupMembers,
|
|
66
|
+
"data-testid": `${t}obs-nested-group-members-${m}-${n}`,
|
|
67
|
+
children: e.members?.map((N, y) => /* @__PURE__ */ s(
|
|
68
|
+
P,
|
|
69
|
+
{
|
|
70
|
+
member: N,
|
|
71
|
+
depth: r + 1,
|
|
72
|
+
memberIndex: y,
|
|
73
|
+
formName: a
|
|
74
|
+
},
|
|
75
|
+
`${N.id}`
|
|
76
|
+
))
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
const { units: b, rangeString: v, isAbnormal: _ } = K(e), f = e.observationValue?.value?.toString(), $ = f ? j(f) : null;
|
|
83
|
+
return /* @__PURE__ */ p(H, { children: [
|
|
84
|
+
/* @__PURE__ */ p(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: o.memberRow,
|
|
88
|
+
"data-testid": `${t}obs-member-row-${m}-${n}`,
|
|
89
|
+
style: { paddingLeft: `${r * 16}px` },
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ p(
|
|
92
|
+
"p",
|
|
93
|
+
{
|
|
94
|
+
className: R(
|
|
95
|
+
o.memberLabel,
|
|
96
|
+
_ ? o.abnormalValue : ""
|
|
97
|
+
),
|
|
98
|
+
"data-testid": `${t}obs-member-label-${m}-${n}`,
|
|
99
|
+
children: [
|
|
100
|
+
m,
|
|
101
|
+
v
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ p(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: R(
|
|
109
|
+
o.memberValue,
|
|
110
|
+
_ ? o.abnormalValue : ""
|
|
111
|
+
),
|
|
112
|
+
"data-testid": `${t}obs-member-value-${m}-${n}`,
|
|
113
|
+
children: [
|
|
114
|
+
$,
|
|
115
|
+
b && ` ${b}`
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
d && /* @__PURE__ */ s(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
className: o.commentSection,
|
|
126
|
+
"data-testid": `${t}obs-member-comment-${m}-${n}`,
|
|
127
|
+
style: { paddingLeft: `${r * 16}px` },
|
|
128
|
+
children: /* @__PURE__ */ p("span", { className: o.commentText, children: [
|
|
129
|
+
d,
|
|
130
|
+
e.encounter?.provider && ` - by ${e.encounter.provider}`
|
|
131
|
+
] })
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] });
|
|
135
|
+
}, qe = ({
|
|
136
|
+
observation: e,
|
|
137
|
+
index: r,
|
|
138
|
+
formName: n = "",
|
|
139
|
+
comment: a
|
|
140
|
+
}) => {
|
|
141
|
+
const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = K(e), b = n ? `${n}-` : "", v = e.observationValue?.value?.toString(), _ = v ? j(v) : null;
|
|
142
|
+
return /* @__PURE__ */ p(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
className: o.observation,
|
|
146
|
+
"data-testid": `${b}observation-item-${e.display}-${r}`,
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ p(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
className: d ? o.groupContainer : o.rowContainer,
|
|
152
|
+
"data-testid": `${b}observation-container-${e.display}-${r}`,
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ p(
|
|
155
|
+
"p",
|
|
156
|
+
{
|
|
157
|
+
className: R(
|
|
158
|
+
d ? o.groupLabel : o.rowLabel,
|
|
159
|
+
!d && t ? o.abnormalValue : ""
|
|
160
|
+
),
|
|
161
|
+
"data-testid": `${b}observation-label-${e.display}-${r}`,
|
|
162
|
+
children: [
|
|
163
|
+
e.display,
|
|
164
|
+
!d && m && /* @__PURE__ */ s("span", { className: o.rangeInfo, children: m })
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
d ? /* @__PURE__ */ s(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
className: o.groupMembers,
|
|
172
|
+
"data-testid": `${b}observation-group-members-${e.display}-${r}`,
|
|
173
|
+
children: e.members?.map((f, $) => /* @__PURE__ */ s(
|
|
174
|
+
P,
|
|
175
|
+
{
|
|
176
|
+
member: f,
|
|
177
|
+
depth: 0,
|
|
178
|
+
memberIndex: $,
|
|
179
|
+
formName: n
|
|
180
|
+
},
|
|
181
|
+
`${f.id}`
|
|
182
|
+
))
|
|
183
|
+
}
|
|
184
|
+
) : /* @__PURE__ */ p(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
className: R(
|
|
188
|
+
o.rowValue,
|
|
189
|
+
t ? o.abnormalValue : ""
|
|
190
|
+
),
|
|
191
|
+
"data-testid": `${b}observation-value-${e.display}-${r}`,
|
|
192
|
+
children: [
|
|
193
|
+
_,
|
|
194
|
+
c && ` ${c}`
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
a && /* @__PURE__ */ s(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
className: o.commentSection,
|
|
205
|
+
"data-testid": `${b}observation-comment-${e.display}-${r}`,
|
|
206
|
+
children: /* @__PURE__ */ p("span", { className: o.commentText, children: [
|
|
207
|
+
a,
|
|
208
|
+
e.encounter?.provider && ` - by ${e.encounter.provider}`
|
|
209
|
+
] })
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
`${e.id}-${r}`
|
|
215
|
+
);
|
|
216
|
+
}, ke = (e) => e ? e.extension?.find(
|
|
217
|
+
(r) => r.url === fe
|
|
218
|
+
)?.valueString : void 0, He = (e) => {
|
|
219
|
+
if (e)
|
|
220
|
+
return e.note?.[0]?.text;
|
|
221
|
+
}, je = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, M = (e, r) => {
|
|
222
|
+
const n = je(e, r);
|
|
223
|
+
return n ? {
|
|
224
|
+
formFieldPath: ke(n),
|
|
225
|
+
comment: He(n)
|
|
226
|
+
} : {};
|
|
227
|
+
}, Ke = (e, r) => {
|
|
228
|
+
if (!e?.entry || !r)
|
|
229
|
+
return [];
|
|
230
|
+
const n = ce(e);
|
|
231
|
+
return [
|
|
232
|
+
...n.observations.map((a) => {
|
|
233
|
+
const { formFieldPath: d, comment: c } = M(
|
|
234
|
+
e,
|
|
235
|
+
a.id
|
|
236
|
+
);
|
|
237
|
+
return { obs: a, formFieldPath: d, comment: c };
|
|
238
|
+
}),
|
|
239
|
+
...n.groupedObservations.flatMap((a) => {
|
|
240
|
+
const { formFieldPath: d } = M(e, a.id);
|
|
241
|
+
return (a.members ?? []).map((c) => {
|
|
242
|
+
const { comment: m } = M(e, c.id);
|
|
243
|
+
return { obs: c, formFieldPath: d, comment: m };
|
|
244
|
+
});
|
|
245
|
+
})
|
|
246
|
+
].filter(
|
|
247
|
+
({ formFieldPath: a }) => !a || a.includes(r)
|
|
248
|
+
);
|
|
249
|
+
}, Xe = ({
|
|
250
|
+
episodeOfCareUuids: e,
|
|
251
|
+
encounterUuids: r,
|
|
252
|
+
config: n
|
|
253
|
+
}) => {
|
|
254
|
+
const { t: a } = ee(), d = re(), [c, m] = k(!1), [t, b] = k(null), v = n?.numberOfVisits, _ = ae(
|
|
255
|
+
e,
|
|
256
|
+
r
|
|
257
|
+
), f = te(), {
|
|
258
|
+
data: $ = [],
|
|
259
|
+
isLoading: N,
|
|
260
|
+
isError: y,
|
|
261
|
+
error: Q,
|
|
262
|
+
refetch: z
|
|
263
|
+
} = C({
|
|
264
|
+
queryKey: ["forms", d, e],
|
|
265
|
+
queryFn: () => $e(d, void 0, v),
|
|
266
|
+
enabled: !!d && !_
|
|
267
|
+
}), O = h(() => !r || r.length === 0 ? $ : $.filter(
|
|
268
|
+
(i) => r.includes(i.encounterUuid)
|
|
269
|
+
), [$, r]), { data: T = [] } = C({
|
|
270
|
+
queryKey: ["observationForms"],
|
|
271
|
+
queryFn: () => ve()
|
|
272
|
+
}), I = L(
|
|
273
|
+
(i) => T.find((u) => u.name === i)?.uuid,
|
|
274
|
+
[T]
|
|
275
|
+
), A = h(() => {
|
|
276
|
+
if (t)
|
|
277
|
+
return I(t.formName);
|
|
278
|
+
}, [t, I]), { isLoading: X, error: S } = C({
|
|
279
|
+
queryKey: ["formMetadata", A],
|
|
280
|
+
queryFn: () => ge(A),
|
|
281
|
+
enabled: !!A && c
|
|
282
|
+
}), {
|
|
283
|
+
data: F,
|
|
284
|
+
isLoading: Y,
|
|
285
|
+
error: w
|
|
286
|
+
} = C({
|
|
287
|
+
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
288
|
+
queryFn: () => he(t.encounterUuid),
|
|
289
|
+
enabled: !!t?.encounterUuid && c
|
|
290
|
+
});
|
|
291
|
+
oe(
|
|
292
|
+
(i) => {
|
|
293
|
+
i.patientUUID === d && i.updatedConcepts.size > 0 && (z(), f.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
294
|
+
},
|
|
295
|
+
[d]
|
|
296
|
+
);
|
|
297
|
+
const D = h(() => !F || !t?.formName ? [] : Ke(
|
|
298
|
+
F,
|
|
299
|
+
t.formName
|
|
300
|
+
), [F, t?.formName]), x = h(
|
|
301
|
+
() => [
|
|
302
|
+
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
303
|
+
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
304
|
+
],
|
|
305
|
+
[a]
|
|
306
|
+
), J = h(
|
|
307
|
+
() => [
|
|
308
|
+
{ key: "recordedOn", sortable: !0 },
|
|
309
|
+
{ key: "recordedBy", sortable: !0 }
|
|
310
|
+
],
|
|
311
|
+
[]
|
|
312
|
+
), E = h(() => {
|
|
313
|
+
const i = O.reduce(
|
|
314
|
+
(u, l) => {
|
|
315
|
+
const g = l.formName;
|
|
316
|
+
u[g] ??= [];
|
|
317
|
+
const V = l.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
|
|
318
|
+
return u[g].push({
|
|
319
|
+
id: l.encounterUuid,
|
|
320
|
+
formName: l.formName,
|
|
321
|
+
recordedOn: ne(l.encounterDateTime, a, ue).formattedResult,
|
|
322
|
+
recordedBy: V ?? "--",
|
|
323
|
+
encounterDateTime: l.encounterDateTime,
|
|
324
|
+
encounterUuid: l.encounterUuid
|
|
325
|
+
}), u;
|
|
326
|
+
},
|
|
327
|
+
{}
|
|
328
|
+
);
|
|
329
|
+
return Object.entries(i).map(
|
|
330
|
+
([u, l]) => ({
|
|
331
|
+
formName: u,
|
|
332
|
+
records: l.sort(
|
|
333
|
+
(g, V) => V.encounterDateTime - g.encounterDateTime
|
|
334
|
+
)
|
|
335
|
+
})
|
|
336
|
+
).sort((u, l) => u.formName.localeCompare(l.formName));
|
|
337
|
+
}, [O, a]), G = L((i) => {
|
|
338
|
+
b(i), m(!0);
|
|
339
|
+
}, []), W = L(() => {
|
|
340
|
+
m(!1), b(null);
|
|
341
|
+
}, []), B = L(
|
|
342
|
+
(i, u) => {
|
|
343
|
+
switch (u) {
|
|
344
|
+
case "recordedOn":
|
|
345
|
+
return /* @__PURE__ */ s(se, { onClick: () => G(i), children: i.recordedOn });
|
|
346
|
+
case "recordedBy":
|
|
347
|
+
return i.recordedBy;
|
|
348
|
+
default:
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
[G]
|
|
353
|
+
);
|
|
354
|
+
return /* @__PURE__ */ p(H, { children: [
|
|
355
|
+
/* @__PURE__ */ s("div", { "data-testid": "forms-table", children: N || y || E.length === 0 || _ ? /* @__PURE__ */ s(
|
|
356
|
+
U,
|
|
357
|
+
{
|
|
358
|
+
headers: x,
|
|
359
|
+
ariaLabel: a("FORMS_HEADING"),
|
|
360
|
+
rows: [],
|
|
361
|
+
loading: N,
|
|
362
|
+
errorStateMessage: y ? Q?.message : void 0,
|
|
363
|
+
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
364
|
+
renderCell: B,
|
|
365
|
+
className: o.formsTableBody,
|
|
366
|
+
dataTestId: "forms-table"
|
|
367
|
+
}
|
|
368
|
+
) : /* @__PURE__ */ s(de, { align: "start", children: E.map((i, u) => {
|
|
369
|
+
const { formName: l, records: g } = i;
|
|
370
|
+
return /* @__PURE__ */ s(
|
|
371
|
+
me,
|
|
372
|
+
{
|
|
373
|
+
title: l,
|
|
374
|
+
className: o.customAccordianItem,
|
|
375
|
+
testId: `accordian-title-${l}`,
|
|
376
|
+
open: u === 0,
|
|
377
|
+
children: /* @__PURE__ */ s(
|
|
378
|
+
U,
|
|
379
|
+
{
|
|
380
|
+
headers: x,
|
|
381
|
+
ariaLabel: a("FORMS_HEADING"),
|
|
382
|
+
rows: g,
|
|
383
|
+
loading: !1,
|
|
384
|
+
errorStateMessage: "",
|
|
385
|
+
sortable: J,
|
|
386
|
+
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
387
|
+
renderCell: B,
|
|
388
|
+
className: o.formsTableBody,
|
|
389
|
+
dataTestId: `forms-table-${l}`
|
|
390
|
+
}
|
|
391
|
+
)
|
|
392
|
+
},
|
|
393
|
+
l
|
|
394
|
+
);
|
|
395
|
+
}) }) }),
|
|
396
|
+
c && t && /* @__PURE__ */ s(
|
|
397
|
+
ie,
|
|
398
|
+
{
|
|
399
|
+
id: "modalIdForActionAreaLayout",
|
|
400
|
+
open: c,
|
|
401
|
+
onRequestClose: W,
|
|
402
|
+
modalHeading: t.formName,
|
|
403
|
+
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
404
|
+
passiveModal: !0,
|
|
405
|
+
size: "md",
|
|
406
|
+
testId: "form-details-modal",
|
|
407
|
+
children: /* @__PURE__ */ s("div", { className: o.formContent, children: X || Y ? /* @__PURE__ */ s(le, { width: "100%", lineCount: 3 }) : S ? /* @__PURE__ */ s("div", { children: q(S).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
|
+
qe,
|
|
409
|
+
{
|
|
410
|
+
observation: i,
|
|
411
|
+
index: l,
|
|
412
|
+
formName: t.formName,
|
|
413
|
+
comment: u
|
|
414
|
+
},
|
|
415
|
+
`${i.id}`
|
|
416
|
+
)) }) : /* @__PURE__ */ s("div", { children: a("NO_FORM_DATA_AVAILABLE") }) })
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
] });
|
|
420
|
+
};
|
|
421
|
+
export {
|
|
422
|
+
Xe as default
|
|
423
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BCL6ByR_.js";
|
|
2
|
+
import { y as d, B as f, E as e } from "./index-BjYaBVts.js";
|
|
3
|
+
var p = (a) => {
|
|
4
|
+
const [r, t] = c({
|
|
5
|
+
prefix: "TanstackQueryDevtools"
|
|
6
|
+
}), n = d(), s = f(() => {
|
|
7
|
+
const o = r.theme_preference || l;
|
|
8
|
+
return o !== "system" ? o : n();
|
|
9
|
+
});
|
|
10
|
+
return e(i.Provider, {
|
|
11
|
+
value: a,
|
|
12
|
+
get children() {
|
|
13
|
+
return e(m, {
|
|
14
|
+
localStore: r,
|
|
15
|
+
setLocalStore: t,
|
|
16
|
+
get children() {
|
|
17
|
+
return e(u.Provider, {
|
|
18
|
+
value: s,
|
|
19
|
+
get children() {
|
|
20
|
+
return e(v, {
|
|
21
|
+
localStore: r,
|
|
22
|
+
setLocalStore: t
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}, C = p;
|
|
31
|
+
export {
|
|
32
|
+
C as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
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-BCL6ByR_.js";
|
|
2
|
+
import { y as v, B as C, E as e } from "./index-BjYaBVts.js";
|
|
3
|
+
var h = (t) => {
|
|
4
|
+
const [r, o] = s({
|
|
5
|
+
prefix: "TanstackQueryDevtools"
|
|
6
|
+
}), a = v(), l = C(() => {
|
|
7
|
+
const n = r.theme_preference || c;
|
|
8
|
+
return n !== "system" ? n : a();
|
|
9
|
+
});
|
|
10
|
+
return e(d.Provider, {
|
|
11
|
+
value: t,
|
|
12
|
+
get children() {
|
|
13
|
+
return e(u, {
|
|
14
|
+
disabled: !0,
|
|
15
|
+
localStore: r,
|
|
16
|
+
setLocalStore: o,
|
|
17
|
+
get children() {
|
|
18
|
+
return e(i.Provider, {
|
|
19
|
+
value: l,
|
|
20
|
+
get children() {
|
|
21
|
+
return e(m, {
|
|
22
|
+
get children() {
|
|
23
|
+
return e(P, {
|
|
24
|
+
localStore: r,
|
|
25
|
+
setLocalStore: o,
|
|
26
|
+
get onClose() {
|
|
27
|
+
return t.onClose;
|
|
28
|
+
},
|
|
29
|
+
showPanelViewOnly: !0
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}, p = h;
|
|
40
|
+
export {
|
|
41
|
+
p as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { jsxs as I, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { p as B, f as K, u as N, n as V, K as Q, a as w, e as x, Q as G, o as j, s as z, q as H, z as M, r as P, A as S, w as W, h as X, D as Y, _ as J, j as Z, x as ee } from "./index-BjYaBVts.js";
|
|
3
|
+
import { useRef as te, useEffect as $, useMemo as h } from "react";
|
|
4
|
+
const A = (t, d, i, l, s) => {
|
|
5
|
+
const a = W(t, d), r = a.value, o = X(r);
|
|
6
|
+
let n = r;
|
|
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 }));
|
|
8
|
+
const b = s("OBSERVATIONS_RECORDED_BY", {
|
|
9
|
+
provider: a.provider
|
|
10
|
+
}), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${p}-${i}-${d}` : `${v}-${p}-${i}-${d}`;
|
|
11
|
+
return /* @__PURE__ */ c(
|
|
12
|
+
Y,
|
|
13
|
+
{
|
|
14
|
+
header: a.header,
|
|
15
|
+
value: n,
|
|
16
|
+
info: b,
|
|
17
|
+
id: u,
|
|
18
|
+
testId: u,
|
|
19
|
+
ariaLabel: u
|
|
20
|
+
},
|
|
21
|
+
`obs-${t.id}`
|
|
22
|
+
);
|
|
23
|
+
}, ae = (t, d, i, l, s, a) => /* @__PURE__ */ c(
|
|
24
|
+
S,
|
|
25
|
+
{
|
|
26
|
+
title: t.display,
|
|
27
|
+
id: `grouped-obs-${t.display}-${l}`,
|
|
28
|
+
open: i,
|
|
29
|
+
children: t.members?.map(
|
|
30
|
+
(r, o) => A(r, o, s, a, d)
|
|
31
|
+
)
|
|
32
|
+
},
|
|
33
|
+
`grouped-obs-${t.id}`
|
|
34
|
+
), se = ({
|
|
35
|
+
groupedData: t,
|
|
36
|
+
title: d = ""
|
|
37
|
+
}) => {
|
|
38
|
+
const { t: i } = N(), l = (s, a, r) => {
|
|
39
|
+
const o = P(s.encounterDetails, i);
|
|
40
|
+
return /* @__PURE__ */ I(
|
|
41
|
+
S,
|
|
42
|
+
{
|
|
43
|
+
title: o,
|
|
44
|
+
id: `encounter-${s.encounterId}`,
|
|
45
|
+
open: a,
|
|
46
|
+
children: [
|
|
47
|
+
s.observations.map(
|
|
48
|
+
(n, b) => A(n, b, r, d, i)
|
|
49
|
+
),
|
|
50
|
+
s.groupedObservations.map(
|
|
51
|
+
(n, b) => ae(
|
|
52
|
+
n,
|
|
53
|
+
i,
|
|
54
|
+
a,
|
|
55
|
+
b,
|
|
56
|
+
r,
|
|
57
|
+
d
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
`encounter-${s.encounterId}`
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ c(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
id: "obs-by-encounter",
|
|
69
|
+
"data-testid": "obs-by-encounter-test-id",
|
|
70
|
+
"aria-label": "obs-by-encounter-aria-label",
|
|
71
|
+
children: t.map(
|
|
72
|
+
(s, a) => l(s, a === 0, a)
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}, re = "_observations_kfbhq_1", oe = "_title_kfbhq_12", T = {
|
|
77
|
+
observations: re,
|
|
78
|
+
title: oe
|
|
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 } = K(), { t: o } = N(), n = V({
|
|
81
|
+
queries: i.map((e) => ({
|
|
82
|
+
queryKey: ie(e),
|
|
83
|
+
queryFn: () => Q(e),
|
|
84
|
+
enabled: !!e
|
|
85
|
+
}))
|
|
86
|
+
});
|
|
87
|
+
$(() => {
|
|
88
|
+
n.forEach((e, m) => {
|
|
89
|
+
if (e.isError && !s.current.has(m)) {
|
|
90
|
+
const k = i[m];
|
|
91
|
+
r({
|
|
92
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
93
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: k }),
|
|
94
|
+
type: "error"
|
|
95
|
+
}), s.current.add(m);
|
|
96
|
+
} else e.isError || s.current.delete(m);
|
|
97
|
+
});
|
|
98
|
+
}, [n, i]);
|
|
99
|
+
const b = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = h(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), v = h(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
|
|
100
|
+
data: u,
|
|
101
|
+
isLoading: D,
|
|
102
|
+
isError: R,
|
|
103
|
+
refetch: _
|
|
104
|
+
} = w({
|
|
105
|
+
queryKey: ne(a, p),
|
|
106
|
+
queryFn: () => ee(a, p),
|
|
107
|
+
enabled: !!a && p.length > 0 && v
|
|
108
|
+
});
|
|
109
|
+
x(
|
|
110
|
+
(e) => {
|
|
111
|
+
e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
112
|
+
(m) => p.includes(m)
|
|
113
|
+
) && _();
|
|
114
|
+
},
|
|
115
|
+
[a, _]
|
|
116
|
+
), $(() => {
|
|
117
|
+
R && r({
|
|
118
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
119
|
+
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
120
|
+
type: "error"
|
|
121
|
+
});
|
|
122
|
+
}, [R]);
|
|
123
|
+
const f = h(() => {
|
|
124
|
+
if (!u) return [];
|
|
125
|
+
const e = G(u), m = j(e);
|
|
126
|
+
return z(m);
|
|
127
|
+
}, [u]), C = [
|
|
128
|
+
{ key: "name", header: "name" },
|
|
129
|
+
{ key: "value", header: "value" },
|
|
130
|
+
{ key: "form", header: "form" }
|
|
131
|
+
], g = D || !v, O = R && v, F = (!u || u.entry?.length === 0 || p.length === 0) && v, L = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = F ? o("NO_OBSERVATIONS_FOUND") : void 0, q = f.length > 0 && !g && !O, E = d.titleTranslationKey, y = E ? o(E) : "";
|
|
132
|
+
return /* @__PURE__ */ I(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
id: "observations",
|
|
136
|
+
"data-testid": E ? `observations-${y}` : "observations",
|
|
137
|
+
"aria-label": "observations-aria-label",
|
|
138
|
+
className: T.observations,
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ c(
|
|
141
|
+
H,
|
|
142
|
+
{
|
|
143
|
+
id: "observations-title",
|
|
144
|
+
testId: E ? `observations-title-${y}` : "observations-title",
|
|
145
|
+
title: y,
|
|
146
|
+
className: T.title,
|
|
147
|
+
children: /* @__PURE__ */ c("p", { children: y })
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
q ? /* @__PURE__ */ c(se, { groupedData: f, title: y }) : /* @__PURE__ */ c(
|
|
151
|
+
M,
|
|
152
|
+
{
|
|
153
|
+
headers: C,
|
|
154
|
+
rows: [],
|
|
155
|
+
ariaLabel: o("OBSERVATIONS"),
|
|
156
|
+
loading: g,
|
|
157
|
+
errorStateMessage: L,
|
|
158
|
+
emptyStateMessage: U,
|
|
159
|
+
dataTestId: "observations-table"
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
export {
|
|
167
|
+
ie as conceptUuidQueryKeys,
|
|
168
|
+
ce as default,
|
|
169
|
+
ne as observationsQueryKeys
|
|
170
|
+
};
|