@bahmni/clinical-app 0.0.1-dev.133 → 0.0.1-dev.136
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/{FormsTable-CJbdqo4y-B9blNWHp.js → FormsTable-L_FgKUMC-C1KkFMxH.js} +76 -76
- package/dist/{LNWAZHJI-DUrdXauC.js → LNWAZHJI-C7RKIe7d.js} +10 -10
- package/dist/{MWZ6AO7Z-P9tJ9w5J.js → MWZ6AO7Z-CbAz-PcA.js} +4 -4
- package/dist/{Observations-DhWTpv8S-Ct-wbmv2.js → Observations-DvU3hHuI-C3-L60Ri.js} +28 -28
- package/dist/{YPM2AS64-CGwDk2ch.js → YPM2AS64-DZdqqRRh.js} +138 -138
- package/dist/components/forms/allergies/AllergiesForm.d.ts.map +1 -1
- package/dist/components/forms/allergies/SelectedAllergyItem.d.ts.map +1 -1
- package/dist/components/forms/conditionsAndDiagnoses/ConditionsAndDiagnoses.d.ts.map +1 -1
- package/dist/components/forms/investigations/InvestigationsForm.d.ts.map +1 -1
- package/dist/components/forms/medications/MedicationsForm.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationForms.d.ts.map +1 -1
- package/dist/components/forms/vaccinations/VaccinationForm.d.ts.map +1 -1
- package/dist/{index-Ob5I3MB5.js → index-tzJd4d2d.js} +36736 -35123
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +19 -0
- package/dist/locales/locale_es.json +19 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as t, jsxs as p, Fragment as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useState as
|
|
4
|
-
const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue = "_formContent_1pd36_18", pe = "_formDetailsContainer_1pd36_25", be = "_observation_1pd36_30", _e = "_groupContainer_1pd36_39", fe = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", Ne = "_rowLabel_1pd36_58", ge = "_rowValue_1pd36_67", he = "_groupMembers_1pd36_75",
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { u as z, y as Q, a as X, b as h, d as J, m as ee, $ as U, q as re, W as ae, F as oe, V as te, c as G, Z as ne, v, Y as se, U as me, K as de, e as ie } from "./index-tzJd4d2d.js";
|
|
3
|
+
import { useState as x, useMemo as $, useCallback as y } from "react";
|
|
4
|
+
const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue = "_formContent_1pd36_18", pe = "_formDetailsContainer_1pd36_25", be = "_observation_1pd36_30", _e = "_groupContainer_1pd36_39", fe = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", Ne = "_rowLabel_1pd36_58", ge = "_rowValue_1pd36_67", he = "_groupMembers_1pd36_75", ye = "_memberRow_1pd36_81", ve = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Me = "_abnormalValue_1pd36_102", Te = "_commentSection_1pd36_110", Le = "_commentText_1pd36_116", Ce = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Oe = "_nestedGroupMembers_1pd36_141", o = {
|
|
5
5
|
formsTableBody: le,
|
|
6
6
|
customAccordianItem: ce,
|
|
7
7
|
formContent: ue,
|
|
@@ -13,48 +13,48 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
13
13
|
rowLabel: Ne,
|
|
14
14
|
rowValue: ge,
|
|
15
15
|
groupMembers: he,
|
|
16
|
-
memberRow:
|
|
17
|
-
memberLabel:
|
|
16
|
+
memberRow: ye,
|
|
17
|
+
memberLabel: ve,
|
|
18
18
|
memberValue: Ae,
|
|
19
19
|
abnormalValue: Me,
|
|
20
20
|
commentSection: Te,
|
|
21
|
-
commentText:
|
|
21
|
+
commentText: Le,
|
|
22
22
|
nestedGroup: Ce,
|
|
23
23
|
nestedGroupLabel: De,
|
|
24
|
-
nestedGroupMembers:
|
|
25
|
-
},
|
|
26
|
-
const s = e.concept?.units,
|
|
24
|
+
nestedGroupMembers: Oe
|
|
25
|
+
}, Re = "ABNORMAL", q = (e) => {
|
|
26
|
+
const s = e.concept?.units, d = e.concept?.lowNormal, r = e.concept?.hiNormal, u = d != null, m = r != null, c = u && m ? ` (${d} - ${r})` : u ? ` (>${d})` : m ? ` (<${r})` : "", a = e.interpretation && e.interpretation.toUpperCase() === Re;
|
|
27
27
|
return { units: s, rangeString: c, isAbnormal: a };
|
|
28
|
-
},
|
|
28
|
+
}, K = ({
|
|
29
29
|
member: e,
|
|
30
30
|
depth: s = 0,
|
|
31
|
-
memberIndex:
|
|
31
|
+
memberIndex: d = 0,
|
|
32
32
|
formName: r = ""
|
|
33
33
|
}) => {
|
|
34
|
-
const u = e.groupMembers && e.groupMembers.length > 0,
|
|
34
|
+
const u = e.groupMembers && e.groupMembers.length > 0, m = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name, c = r ? `${r}-` : "";
|
|
35
35
|
if (u)
|
|
36
36
|
return /* @__PURE__ */ p(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
39
|
className: o.nestedGroup,
|
|
40
|
-
"data-testid": `${c}obs-nested-group-${
|
|
40
|
+
"data-testid": `${c}obs-nested-group-${m}-${d}`,
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ t(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
45
|
className: o.nestedGroupLabel,
|
|
46
|
-
"data-testid": `${c}obs-nested-group-label-${
|
|
46
|
+
"data-testid": `${c}obs-nested-group-label-${m}-${d}`,
|
|
47
47
|
style: { paddingLeft: `${s * 16}px` },
|
|
48
|
-
children:
|
|
48
|
+
children: m
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
51
|
/* @__PURE__ */ t(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
54
|
className: o.nestedGroupMembers,
|
|
55
|
-
"data-testid": `${c}obs-nested-group-members-${
|
|
55
|
+
"data-testid": `${c}obs-nested-group-members-${m}-${d}`,
|
|
56
56
|
children: e.groupMembers?.map((N, g) => /* @__PURE__ */ t(
|
|
57
|
-
|
|
57
|
+
K,
|
|
58
58
|
{
|
|
59
59
|
member: N,
|
|
60
60
|
depth: s + 1,
|
|
@@ -73,19 +73,19 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
73
73
|
"div",
|
|
74
74
|
{
|
|
75
75
|
className: o.memberRow,
|
|
76
|
-
"data-testid": `${c}obs-member-row-${
|
|
76
|
+
"data-testid": `${c}obs-member-row-${m}-${d}`,
|
|
77
77
|
style: { paddingLeft: `${s * 16}px` },
|
|
78
78
|
children: [
|
|
79
79
|
/* @__PURE__ */ p(
|
|
80
80
|
"p",
|
|
81
81
|
{
|
|
82
|
-
className:
|
|
82
|
+
className: v(
|
|
83
83
|
o.memberLabel,
|
|
84
84
|
_ ? o.abnormalValue : ""
|
|
85
85
|
),
|
|
86
|
-
"data-testid": `${c}obs-member-label-${
|
|
86
|
+
"data-testid": `${c}obs-member-label-${m}-${d}`,
|
|
87
87
|
children: [
|
|
88
|
-
|
|
88
|
+
m,
|
|
89
89
|
b
|
|
90
90
|
]
|
|
91
91
|
}
|
|
@@ -93,11 +93,11 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
93
93
|
/* @__PURE__ */ p(
|
|
94
94
|
"p",
|
|
95
95
|
{
|
|
96
|
-
className:
|
|
96
|
+
className: v(
|
|
97
97
|
o.memberValue,
|
|
98
98
|
_ ? o.abnormalValue : ""
|
|
99
99
|
),
|
|
100
|
-
"data-testid": `${c}obs-member-value-${
|
|
100
|
+
"data-testid": `${c}obs-member-value-${m}-${d}`,
|
|
101
101
|
children: [
|
|
102
102
|
e.valueAsString,
|
|
103
103
|
a && ` ${a}`
|
|
@@ -110,9 +110,9 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
110
110
|
}, Fe = ({
|
|
111
111
|
observation: e,
|
|
112
112
|
index: s,
|
|
113
|
-
formName:
|
|
113
|
+
formName: d = ""
|
|
114
114
|
}) => {
|
|
115
|
-
const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString:
|
|
115
|
+
const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: m, isAbnormal: c } = q(e), a = d ? `${d}-` : "";
|
|
116
116
|
return /* @__PURE__ */ p(
|
|
117
117
|
"div",
|
|
118
118
|
{
|
|
@@ -128,14 +128,14 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
128
128
|
/* @__PURE__ */ p(
|
|
129
129
|
"p",
|
|
130
130
|
{
|
|
131
|
-
className:
|
|
131
|
+
className: v(
|
|
132
132
|
r ? o.groupLabel : o.rowLabel,
|
|
133
133
|
!r && c ? o.abnormalValue : ""
|
|
134
134
|
),
|
|
135
135
|
"data-testid": `${a}observation-label-${e.conceptNameToDisplay}-${s}`,
|
|
136
136
|
children: [
|
|
137
137
|
e.conceptNameToDisplay,
|
|
138
|
-
!r &&
|
|
138
|
+
!r && m && /* @__PURE__ */ t("span", { className: o.rangeInfo, children: m })
|
|
139
139
|
]
|
|
140
140
|
}
|
|
141
141
|
),
|
|
@@ -145,12 +145,12 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
145
145
|
className: o.groupMembers,
|
|
146
146
|
"data-testid": `${a}observation-group-members-${e.conceptNameToDisplay}-${s}`,
|
|
147
147
|
children: e.groupMembers?.map((b, _) => /* @__PURE__ */ t(
|
|
148
|
-
|
|
148
|
+
K,
|
|
149
149
|
{
|
|
150
150
|
member: b,
|
|
151
151
|
depth: 0,
|
|
152
152
|
memberIndex: _,
|
|
153
|
-
formName:
|
|
153
|
+
formName: d
|
|
154
154
|
},
|
|
155
155
|
`${b.concept.uuid}`
|
|
156
156
|
))
|
|
@@ -158,7 +158,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
158
158
|
) : /* @__PURE__ */ p(
|
|
159
159
|
"p",
|
|
160
160
|
{
|
|
161
|
-
className:
|
|
161
|
+
className: v(
|
|
162
162
|
o.rowValue,
|
|
163
163
|
c ? o.abnormalValue : ""
|
|
164
164
|
),
|
|
@@ -187,59 +187,59 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
187
187
|
},
|
|
188
188
|
`${e.concept.uuid}-${s}`
|
|
189
189
|
);
|
|
190
|
-
},
|
|
190
|
+
}, Se = ({
|
|
191
191
|
episodeOfCareUuids: e,
|
|
192
192
|
encounterUuids: s,
|
|
193
|
-
config:
|
|
193
|
+
config: d
|
|
194
194
|
}) => {
|
|
195
|
-
const { t: r } =
|
|
195
|
+
const { t: r } = z(), u = Q(), [m, c] = x(!1), [a, b] = x(null), _ = d?.numberOfVisits, N = X(
|
|
196
196
|
e,
|
|
197
197
|
s
|
|
198
198
|
), {
|
|
199
199
|
data: g = [],
|
|
200
|
-
isLoading:
|
|
200
|
+
isLoading: L,
|
|
201
201
|
isError: C,
|
|
202
|
-
error:
|
|
202
|
+
error: k
|
|
203
203
|
} = h({
|
|
204
204
|
queryKey: ["forms", u, e],
|
|
205
205
|
queryFn: () => se(u, void 0, _),
|
|
206
206
|
enabled: !!u && !N
|
|
207
207
|
}), D = $(() => !s || s.length === 0 ? g : g.filter(
|
|
208
208
|
(n) => s.includes(n.encounterUuid)
|
|
209
|
-
), [g, s]), { data:
|
|
209
|
+
), [g, s]), { data: O = [] } = h({
|
|
210
210
|
queryKey: ["observationForms"],
|
|
211
|
-
queryFn: () =>
|
|
212
|
-
}),
|
|
213
|
-
(n) =>
|
|
214
|
-
[
|
|
211
|
+
queryFn: () => me()
|
|
212
|
+
}), R = y(
|
|
213
|
+
(n) => O.find((l) => l.name === n)?.uuid,
|
|
214
|
+
[O]
|
|
215
215
|
), A = $(() => {
|
|
216
216
|
if (a)
|
|
217
|
-
return
|
|
218
|
-
}, [a,
|
|
219
|
-
data:
|
|
220
|
-
isLoading:
|
|
217
|
+
return R(a.formName);
|
|
218
|
+
}, [a, R]), {
|
|
219
|
+
data: we,
|
|
220
|
+
isLoading: H,
|
|
221
221
|
error: F
|
|
222
222
|
} = h({
|
|
223
223
|
queryKey: ["formMetadata", A],
|
|
224
|
-
queryFn: () =>
|
|
225
|
-
enabled: !!A &&
|
|
224
|
+
queryFn: () => de(A),
|
|
225
|
+
enabled: !!A && m
|
|
226
226
|
}), {
|
|
227
227
|
data: M,
|
|
228
|
-
isLoading:
|
|
229
|
-
error:
|
|
228
|
+
isLoading: j,
|
|
229
|
+
error: w
|
|
230
230
|
} = h({
|
|
231
231
|
queryKey: ["formsEncounter", a?.encounterUuid],
|
|
232
232
|
queryFn: () => ie(a.encounterUuid, !0),
|
|
233
|
-
enabled: !!a?.encounterUuid &&
|
|
234
|
-
}),
|
|
233
|
+
enabled: !!a?.encounterUuid && m
|
|
234
|
+
}), I = $(() => !M?.observations || !a?.formName ? [] : M.observations.filter(
|
|
235
235
|
(n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(a.formName)
|
|
236
|
-
), [M?.observations, a?.formName]),
|
|
236
|
+
), [M?.observations, a?.formName]), V = $(
|
|
237
237
|
() => [
|
|
238
238
|
{ key: "recordedOn", header: r("FORM_RECORDED_ON") },
|
|
239
239
|
{ key: "recordedBy", header: r("FORM_RECORDED_BY") }
|
|
240
240
|
],
|
|
241
241
|
[r]
|
|
242
|
-
),
|
|
242
|
+
), P = $(
|
|
243
243
|
() => [
|
|
244
244
|
{ key: "recordedOn", sortable: !0 },
|
|
245
245
|
{ key: "recordedBy", sortable: !0 }
|
|
@@ -250,11 +250,11 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
250
250
|
(l, i) => {
|
|
251
251
|
const f = i.formName;
|
|
252
252
|
l[f] ??= [];
|
|
253
|
-
const T = i.providers.map((
|
|
253
|
+
const T = i.providers.map((Y) => Y.providerName).filter(Boolean).join(", ");
|
|
254
254
|
return l[f].push({
|
|
255
255
|
id: i.encounterUuid,
|
|
256
256
|
formName: i.formName,
|
|
257
|
-
recordedOn:
|
|
257
|
+
recordedOn: J(i.encounterDateTime, r, ne).formattedResult,
|
|
258
258
|
recordedBy: T ?? "--",
|
|
259
259
|
encounterDateTime: i.encounterDateTime,
|
|
260
260
|
encounterUuid: i.encounterUuid
|
|
@@ -270,34 +270,34 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
270
270
|
)
|
|
271
271
|
})
|
|
272
272
|
).sort((l, i) => l.formName.localeCompare(i.formName));
|
|
273
|
-
}, [D, r]),
|
|
273
|
+
}, [D, r]), S = y((n) => {
|
|
274
274
|
b(n), c(!0);
|
|
275
|
-
}, []),
|
|
275
|
+
}, []), W = y(() => {
|
|
276
276
|
c(!1), b(null);
|
|
277
|
-
}, []),
|
|
277
|
+
}, []), B = y(
|
|
278
278
|
(n, l) => {
|
|
279
279
|
switch (l) {
|
|
280
280
|
case "recordedOn":
|
|
281
|
-
return /* @__PURE__ */ t(ee, { onClick: () =>
|
|
281
|
+
return /* @__PURE__ */ t(ee, { onClick: () => S(n), children: n.recordedOn });
|
|
282
282
|
case "recordedBy":
|
|
283
283
|
return n.recordedBy;
|
|
284
284
|
default:
|
|
285
285
|
return null;
|
|
286
286
|
}
|
|
287
287
|
},
|
|
288
|
-
[
|
|
288
|
+
[S]
|
|
289
289
|
);
|
|
290
|
-
return /* @__PURE__ */ p(
|
|
291
|
-
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children:
|
|
292
|
-
|
|
290
|
+
return /* @__PURE__ */ p(Z, { children: [
|
|
291
|
+
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || C || E.length === 0 || N ? /* @__PURE__ */ t(
|
|
292
|
+
U,
|
|
293
293
|
{
|
|
294
|
-
headers:
|
|
294
|
+
headers: V,
|
|
295
295
|
ariaLabel: r("FORMS_HEADING"),
|
|
296
296
|
rows: [],
|
|
297
|
-
loading:
|
|
298
|
-
errorStateMessage: C ?
|
|
297
|
+
loading: L,
|
|
298
|
+
errorStateMessage: C ? k?.message : void 0,
|
|
299
299
|
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
300
|
-
renderCell:
|
|
300
|
+
renderCell: B,
|
|
301
301
|
className: o.formsTableBody,
|
|
302
302
|
dataTestId: "forms-table"
|
|
303
303
|
}
|
|
@@ -311,16 +311,16 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
311
311
|
testId: `accordian-title-${i}`,
|
|
312
312
|
open: l === 0,
|
|
313
313
|
children: /* @__PURE__ */ t(
|
|
314
|
-
|
|
314
|
+
U,
|
|
315
315
|
{
|
|
316
|
-
headers:
|
|
316
|
+
headers: V,
|
|
317
317
|
ariaLabel: r("FORMS_HEADING"),
|
|
318
318
|
rows: f,
|
|
319
319
|
loading: !1,
|
|
320
320
|
errorStateMessage: "",
|
|
321
|
-
sortable:
|
|
321
|
+
sortable: P,
|
|
322
322
|
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
323
|
-
renderCell:
|
|
323
|
+
renderCell: B,
|
|
324
324
|
className: o.formsTableBody,
|
|
325
325
|
dataTestId: `forms-table-${i}`
|
|
326
326
|
}
|
|
@@ -329,18 +329,18 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
329
329
|
i
|
|
330
330
|
);
|
|
331
331
|
}) }) }),
|
|
332
|
-
|
|
332
|
+
m && a && /* @__PURE__ */ t(
|
|
333
333
|
oe,
|
|
334
334
|
{
|
|
335
335
|
id: "modalIdForActionAreaLayout",
|
|
336
|
-
open:
|
|
337
|
-
onRequestClose:
|
|
336
|
+
open: m,
|
|
337
|
+
onRequestClose: W,
|
|
338
338
|
modalHeading: a.formName,
|
|
339
339
|
modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
|
|
340
340
|
passiveModal: !0,
|
|
341
341
|
size: "md",
|
|
342
342
|
testId: "form-details-modal",
|
|
343
|
-
children: /* @__PURE__ */ t("div", { className: o.formContent, children:
|
|
343
|
+
children: /* @__PURE__ */ t("div", { className: o.formContent, children: H || j ? /* @__PURE__ */ t(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: G(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ t("div", { children: G(w).message ?? r("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: I.map((n, l) => /* @__PURE__ */ t(
|
|
344
344
|
Fe,
|
|
345
345
|
{
|
|
346
346
|
observation: n,
|
|
@@ -354,5 +354,5 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
|
|
|
354
354
|
] });
|
|
355
355
|
};
|
|
356
356
|
export {
|
|
357
|
-
|
|
357
|
+
Se as default
|
|
358
358
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
3
|
-
var
|
|
4
|
-
const [r,
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DZdqqRRh.js";
|
|
2
|
+
import { n as p, o as d, p as e } from "./index-tzJd4d2d.js";
|
|
3
|
+
var f = (a) => {
|
|
4
|
+
const [r, o] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), n =
|
|
7
|
-
const
|
|
8
|
-
return
|
|
6
|
+
}), n = p(), s = d(() => {
|
|
7
|
+
const t = r.theme_preference || l;
|
|
8
|
+
return t !== "system" ? t : n();
|
|
9
9
|
});
|
|
10
10
|
return e(i.Provider, {
|
|
11
11
|
value: a,
|
|
12
12
|
get children() {
|
|
13
13
|
return e(m, {
|
|
14
14
|
localStore: r,
|
|
15
|
-
setLocalStore:
|
|
15
|
+
setLocalStore: o,
|
|
16
16
|
get children() {
|
|
17
17
|
return e(u.Provider, {
|
|
18
18
|
value: s,
|
|
19
19
|
get children() {
|
|
20
20
|
return e(v, {
|
|
21
21
|
localStore: r,
|
|
22
|
-
setLocalStore:
|
|
22
|
+
setLocalStore: o
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -27,7 +27,7 @@ var p = (a) => {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
}, C =
|
|
30
|
+
}, C = f;
|
|
31
31
|
export {
|
|
32
32
|
C as default
|
|
33
33
|
};
|
|
@@ -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-DZdqqRRh.js";
|
|
2
|
+
import { n as v, o as C, p as e } from "./index-tzJd4d2d.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -36,7 +36,7 @@ var h = (t) => {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
},
|
|
39
|
+
}, g = h;
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
g as default
|
|
42
42
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _, jsx as b } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useRef as z, useEffect as
|
|
2
|
+
import { y as k, f as B, u as I, g as U, h as x, b as H, i as K, $ as Q, P as j, j as w, k as P, w as G, H as X, M as Y, l as Z } from "./index-tzJd4d2d.js";
|
|
3
|
+
import { useRef as z, useEffect as S, useMemo as h } from "react";
|
|
4
4
|
const J = "normal", W = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ee = "A", te = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ne = (e, n) => e?.date ? j(e.date, n).formattedResult : n("DATE_ERROR_PARSE"), re = (e) => {
|
|
5
5
|
if (!e.observationValue?.value)
|
|
6
6
|
return "";
|
|
@@ -111,9 +111,9 @@ function ue(e, n) {
|
|
|
111
111
|
location: t.location?.[0]?.location?.display
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function A(e, n, t) {
|
|
115
115
|
const a = $(e.encounter), r = (e.hasMember ?? []).map((o) => $(o)).map((o) => o ? t.get(o) : void 0).filter((o) => !!o).map(
|
|
116
|
-
(o) =>
|
|
116
|
+
(o) => A(o, n, t)
|
|
117
117
|
);
|
|
118
118
|
return {
|
|
119
119
|
id: e.id,
|
|
@@ -136,7 +136,7 @@ function le(e) {
|
|
|
136
136
|
const r = [], o = [];
|
|
137
137
|
return t.forEach((i, s) => {
|
|
138
138
|
if (a.has(s)) return;
|
|
139
|
-
const u =
|
|
139
|
+
const u = A(
|
|
140
140
|
i,
|
|
141
141
|
n,
|
|
142
142
|
t
|
|
@@ -176,15 +176,15 @@ function ce(e) {
|
|
|
176
176
|
return !a && !r ? 0 : a ? r ? new Date(r).getTime() - new Date(a).getTime() : -1 : 1;
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
const
|
|
180
|
-
const o = ae(e, n), i = o.value, s =
|
|
179
|
+
const D = (e, n, t, a, r) => {
|
|
180
|
+
const o = ae(e, n), i = o.value, s = P(i);
|
|
181
181
|
let u = i;
|
|
182
|
-
s === "Image" && (u = /* @__PURE__ */ b(
|
|
182
|
+
s === "Image" && (u = /* @__PURE__ */ b(X, { imageSrc: i, alt: i, id: `${i}-img` })), s === "Video" && (u = /* @__PURE__ */ b(Y, { id: `${i}-video`, videoSrc: i }));
|
|
183
183
|
const l = r("OBSERVATIONS_RECORDED_BY", {
|
|
184
184
|
provider: o.provider
|
|
185
185
|
}), v = e.display, c = e.observationValue?.isAbnormal ? "abnormal-obs" : "obs", p = a ? `${a}-${c}-${v}-${t}-${n}` : `${c}-${v}-${t}-${n}`;
|
|
186
186
|
return /* @__PURE__ */ b(
|
|
187
|
-
|
|
187
|
+
G,
|
|
188
188
|
{
|
|
189
189
|
header: o.header,
|
|
190
190
|
value: u,
|
|
@@ -196,13 +196,13 @@ const A = (e, n, t, a, r) => {
|
|
|
196
196
|
`obs-${e.id}`
|
|
197
197
|
);
|
|
198
198
|
}, ve = (e, n, t, a, r, o) => /* @__PURE__ */ b(
|
|
199
|
-
|
|
199
|
+
w,
|
|
200
200
|
{
|
|
201
201
|
title: e.display,
|
|
202
202
|
id: `grouped-obs-${e.display}-${a}`,
|
|
203
203
|
open: t,
|
|
204
204
|
children: e.children.map(
|
|
205
|
-
(i, s) =>
|
|
205
|
+
(i, s) => D(i, s, r, o, n)
|
|
206
206
|
)
|
|
207
207
|
},
|
|
208
208
|
`grouped-obs-${e.id}`
|
|
@@ -213,14 +213,14 @@ const A = (e, n, t, a, r) => {
|
|
|
213
213
|
const { t } = I(), a = (r, o, i) => {
|
|
214
214
|
const s = ne(r.encounterDetails, t);
|
|
215
215
|
return /* @__PURE__ */ _(
|
|
216
|
-
|
|
216
|
+
w,
|
|
217
217
|
{
|
|
218
218
|
title: s,
|
|
219
219
|
id: `encounter-${r.encounterId}`,
|
|
220
220
|
open: o,
|
|
221
221
|
children: [
|
|
222
222
|
r.observations.map(
|
|
223
|
-
(u, l) =>
|
|
223
|
+
(u, l) => D(u, l, i, n, t)
|
|
224
224
|
),
|
|
225
225
|
r.groupedObservations.map(
|
|
226
226
|
(u, l) => ve(
|
|
@@ -248,24 +248,24 @@ const A = (e, n, t, a, r) => {
|
|
|
248
248
|
)
|
|
249
249
|
}
|
|
250
250
|
);
|
|
251
|
-
}, be = "_observations_kfbhq_1", ge = "_title_kfbhq_12",
|
|
251
|
+
}, be = "_observations_kfbhq_1", ge = "_title_kfbhq_12", T = {
|
|
252
252
|
observations: be,
|
|
253
253
|
title: ge
|
|
254
254
|
}, fe = (e) => ["conceptUuid", e], me = (e, n) => ["observations", e, ...n], Ee = ({ config: e }) => {
|
|
255
|
-
const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = z(/* @__PURE__ */ new Set()), o =
|
|
255
|
+
const n = e, { conceptNames: t = [], conceptUuid: a = [] } = n, r = z(/* @__PURE__ */ new Set()), o = k(), { addNotification: i } = B(), { t: s } = I(), u = U({
|
|
256
256
|
queries: t.map((d) => ({
|
|
257
257
|
queryKey: fe(d),
|
|
258
|
-
queryFn: () =>
|
|
258
|
+
queryFn: () => x(d),
|
|
259
259
|
enabled: !!d
|
|
260
260
|
}))
|
|
261
261
|
});
|
|
262
|
-
|
|
262
|
+
S(() => {
|
|
263
263
|
u.forEach((d, g) => {
|
|
264
264
|
if (d.isError && !r.current.has(g)) {
|
|
265
|
-
const
|
|
265
|
+
const L = t[g];
|
|
266
266
|
i({
|
|
267
267
|
title: s("ERROR_DEFAULT_TITLE"),
|
|
268
|
-
message: s("ERROR_FETCHING_CONCEPT", { conceptName:
|
|
268
|
+
message: s("ERROR_FETCHING_CONCEPT", { conceptName: L }),
|
|
269
269
|
type: "error"
|
|
270
270
|
}), r.current.add(g);
|
|
271
271
|
} else d.isError || r.current.delete(g);
|
|
@@ -275,12 +275,12 @@ const A = (e, n, t, a, r) => {
|
|
|
275
275
|
data: p,
|
|
276
276
|
isLoading: N,
|
|
277
277
|
isError: y
|
|
278
|
-
} =
|
|
278
|
+
} = H({
|
|
279
279
|
queryKey: me(o, v),
|
|
280
280
|
queryFn: () => Z(o, v),
|
|
281
281
|
enabled: !!o && v.length > 0 && c
|
|
282
282
|
});
|
|
283
|
-
|
|
283
|
+
S(() => {
|
|
284
284
|
y && i({
|
|
285
285
|
title: s("ERROR_DEFAULT_TITLE"),
|
|
286
286
|
message: s("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -291,18 +291,18 @@ const A = (e, n, t, a, r) => {
|
|
|
291
291
|
if (!p) return [];
|
|
292
292
|
const d = le(p), g = de(d);
|
|
293
293
|
return ce(g);
|
|
294
|
-
}, [p]),
|
|
294
|
+
}, [p]), V = [
|
|
295
295
|
{ key: "name", header: "name" },
|
|
296
296
|
{ key: "value", header: "value" },
|
|
297
297
|
{ key: "form", header: "form" }
|
|
298
|
-
], O = N || !c, R = y && c,
|
|
298
|
+
], O = N || !c, R = y && c, C = (!p || p.entry?.length === 0 || v.length === 0) && c, M = R ? s("ERROR_FETCHING_OBSERVATIONS") : null, q = C ? s("NO_OBSERVATIONS_FOUND") : void 0, F = E.length > 0 && !O && !R, m = n.titleTranslationKey, f = m ? s(m) : "";
|
|
299
299
|
return /* @__PURE__ */ _(
|
|
300
300
|
"div",
|
|
301
301
|
{
|
|
302
302
|
id: "observations",
|
|
303
303
|
"data-testid": m ? `observations-${f}` : "observations",
|
|
304
304
|
"aria-label": "observations-aria-label",
|
|
305
|
-
className:
|
|
305
|
+
className: T.observations,
|
|
306
306
|
children: [
|
|
307
307
|
/* @__PURE__ */ b(
|
|
308
308
|
K,
|
|
@@ -310,18 +310,18 @@ const A = (e, n, t, a, r) => {
|
|
|
310
310
|
id: "observations-title",
|
|
311
311
|
testId: m ? `observations-title-${f}` : "observations-title",
|
|
312
312
|
title: f,
|
|
313
|
-
className:
|
|
313
|
+
className: T.title,
|
|
314
314
|
children: /* @__PURE__ */ b("p", { children: f })
|
|
315
315
|
}
|
|
316
316
|
),
|
|
317
|
-
|
|
317
|
+
F ? /* @__PURE__ */ b(pe, { groupedData: E, title: f }) : /* @__PURE__ */ b(
|
|
318
318
|
Q,
|
|
319
319
|
{
|
|
320
|
-
headers:
|
|
320
|
+
headers: V,
|
|
321
321
|
rows: [],
|
|
322
322
|
ariaLabel: s("OBSERVATIONS"),
|
|
323
323
|
loading: O,
|
|
324
|
-
errorStateMessage:
|
|
324
|
+
errorStateMessage: M,
|
|
325
325
|
emptyStateMessage: q,
|
|
326
326
|
dataTestId: "observations-table"
|
|
327
327
|
}
|