@bahmni/widgets 0.0.1-dev.145 → 0.0.1-dev.148
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-CLNSTNdY.js → FormsTable-qV6L_PQt.js} +51 -51
- package/dist/Observations-CzfBOJhf.js +164 -0
- package/dist/genericServiceRequest/GenericServiceRequestTable.d.ts.map +1 -1
- package/dist/genericServiceRequest/models.d.ts +7 -0
- package/dist/genericServiceRequest/models.d.ts.map +1 -1
- package/dist/{index-CJl-px0B.js → index-CfnOIq6g.js} +19908 -19189
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -17
- package/dist/labinvestigation/LabInvestigation.d.ts.map +1 -1
- package/dist/labinvestigation/models.d.ts +2 -0
- package/dist/labinvestigation/models.d.ts.map +1 -1
- package/dist/labinvestigation/utils.d.ts +2 -16
- package/dist/labinvestigation/utils.d.ts.map +1 -1
- package/dist/observations/__mocks__/observationTestData.d.ts.map +1 -1
- package/dist/observations/components/ObsByEncounter.d.ts.map +1 -1
- package/dist/observations/models.d.ts +4 -11
- package/dist/observations/models.d.ts.map +1 -1
- package/dist/observations/utils.d.ts +2 -2
- package/dist/observations/utils.d.ts.map +1 -1
- package/dist/programDetails/ProgramDetails.d.ts.map +1 -1
- package/dist/programDetails/__mocks__/mocks.d.ts.map +1 -1
- package/dist/programDetails/constants.d.ts +1 -0
- package/dist/programDetails/constants.d.ts.map +1 -1
- package/dist/programDetails/model.d.ts +4 -0
- package/dist/programDetails/model.d.ts.map +1 -1
- package/dist/programDetails/utils.d.ts +0 -1
- package/dist/programDetails/utils.d.ts.map +1 -1
- package/dist/radiologyInvestigation/RadiologyInvestigationTable.d.ts.map +1 -1
- package/dist/radiologyInvestigation/__mocks__/mocks.d.ts.map +1 -1
- package/dist/radiologyInvestigation/models.d.ts +4 -0
- package/dist/radiologyInvestigation/models.d.ts.map +1 -1
- package/dist/radiologyInvestigation/utils.d.ts.map +1 -1
- package/dist/radiologyInvestigationReport/RadiologyInvestigationReport.d.ts +7 -0
- package/dist/radiologyInvestigationReport/RadiologyInvestigationReport.d.ts.map +1 -0
- package/dist/radiologyInvestigationReport/index.d.ts +2 -0
- package/dist/radiologyInvestigationReport/index.d.ts.map +1 -0
- package/dist/utils/Investigations.d.ts +18 -0
- package/dist/utils/Investigations.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/Observations-t9hyemAs.js +0 -339
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as b, jsx as
|
|
2
|
-
import { c as L, u as
|
|
1
|
+
import { jsxs as b, jsx as a, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { c as L, u as W, o as X, h as Z, f as ee, p as te, a as re, g as oe, b as ae, J as U, L as se, H as ne, d as de, t as ce, e as q, l as le } from "./index-CfnOIq6g.js";
|
|
3
3
|
import { useQuery as y } from "@tanstack/react-query";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as H, useMemo as g, useCallback as M } from "react";
|
|
5
5
|
import { useTranslation as me } from "react-i18next";
|
|
6
|
-
const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", ge = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", $e = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", Me = "_memberRow_1pd36_81", Le = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Te = "_abnormalValue_1pd36_102", Ae = "_commentSection_1pd36_110", Oe = "_commentText_1pd36_116", Re = "_nestedGroup_1pd36_125", we = "_nestedGroupLabel_1pd36_132", Ce = "_nestedGroupMembers_1pd36_141",
|
|
6
|
+
const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", ge = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", $e = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", Me = "_memberRow_1pd36_81", Le = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Te = "_abnormalValue_1pd36_102", Ae = "_commentSection_1pd36_110", Oe = "_commentText_1pd36_116", Re = "_nestedGroup_1pd36_125", we = "_nestedGroupLabel_1pd36_132", Ce = "_nestedGroupMembers_1pd36_141", o = {
|
|
7
7
|
formsTableBody: ie,
|
|
8
8
|
customAccordianItem: ue,
|
|
9
9
|
formContent: pe,
|
|
@@ -24,10 +24,10 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
24
24
|
nestedGroup: Re,
|
|
25
25
|
nestedGroupLabel: we,
|
|
26
26
|
nestedGroupMembers: Ce
|
|
27
|
-
}, Fe = "ABNORMAL",
|
|
27
|
+
}, Fe = "ABNORMAL", k = (e) => {
|
|
28
28
|
const s = e.concept?.units, c = e.concept?.lowNormal, t = e.concept?.hiNormal, u = c != null, n = t != null, l = u && n ? ` (${c} - ${t})` : u ? ` (>${c})` : n ? ` (<${t})` : "", r = e.interpretation && e.interpretation.toUpperCase() === Fe;
|
|
29
29
|
return { units: s, rangeString: l, isAbnormal: r };
|
|
30
|
-
},
|
|
30
|
+
}, P = ({
|
|
31
31
|
member: e,
|
|
32
32
|
depth: s = 0,
|
|
33
33
|
memberIndex: c = 0,
|
|
@@ -38,25 +38,25 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
38
38
|
return /* @__PURE__ */ b(
|
|
39
39
|
"div",
|
|
40
40
|
{
|
|
41
|
-
className:
|
|
41
|
+
className: o.nestedGroup,
|
|
42
42
|
"data-testid": `${l}obs-nested-group-${n}-${c}`,
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ a(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
|
-
className:
|
|
47
|
+
className: o.nestedGroupLabel,
|
|
48
48
|
"data-testid": `${l}obs-nested-group-label-${n}-${c}`,
|
|
49
49
|
style: { paddingLeft: `${s * 16}px` },
|
|
50
50
|
children: n
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ a(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
56
|
+
className: o.nestedGroupMembers,
|
|
57
57
|
"data-testid": `${l}obs-nested-group-members-${n}-${c}`,
|
|
58
|
-
children: e.groupMembers?.map((N, $) => /* @__PURE__ */
|
|
59
|
-
|
|
58
|
+
children: e.groupMembers?.map((N, $) => /* @__PURE__ */ a(
|
|
59
|
+
P,
|
|
60
60
|
{
|
|
61
61
|
member: N,
|
|
62
62
|
depth: s + 1,
|
|
@@ -70,11 +70,11 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
70
70
|
]
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
|
-
const { units: r, rangeString: _, isAbnormal: f } =
|
|
73
|
+
const { units: r, rangeString: _, isAbnormal: f } = k(e);
|
|
74
74
|
return /* @__PURE__ */ b(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
|
-
className:
|
|
77
|
+
className: o.memberRow,
|
|
78
78
|
"data-testid": `${l}obs-member-row-${n}-${c}`,
|
|
79
79
|
style: { paddingLeft: `${s * 16}px` },
|
|
80
80
|
children: [
|
|
@@ -82,8 +82,8 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
82
82
|
"p",
|
|
83
83
|
{
|
|
84
84
|
className: L(
|
|
85
|
-
|
|
86
|
-
f ?
|
|
85
|
+
o.memberLabel,
|
|
86
|
+
f ? o.abnormalValue : ""
|
|
87
87
|
),
|
|
88
88
|
"data-testid": `${l}obs-member-label-${n}-${c}`,
|
|
89
89
|
children: [
|
|
@@ -96,8 +96,8 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
96
96
|
"p",
|
|
97
97
|
{
|
|
98
98
|
className: L(
|
|
99
|
-
|
|
100
|
-
f ?
|
|
99
|
+
o.memberValue,
|
|
100
|
+
f ? o.abnormalValue : ""
|
|
101
101
|
),
|
|
102
102
|
"data-testid": `${l}obs-member-value-${n}-${c}`,
|
|
103
103
|
children: [
|
|
@@ -114,40 +114,40 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
114
114
|
index: s,
|
|
115
115
|
formName: c = ""
|
|
116
116
|
}) => {
|
|
117
|
-
const t = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: n, isAbnormal: l } =
|
|
117
|
+
const t = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: n, isAbnormal: l } = k(e), r = c ? `${c}-` : "";
|
|
118
118
|
return /* @__PURE__ */ b(
|
|
119
119
|
"div",
|
|
120
120
|
{
|
|
121
|
-
className:
|
|
121
|
+
className: o.observation,
|
|
122
122
|
"data-testid": `${r}observation-item-${e.conceptNameToDisplay}-${s}`,
|
|
123
123
|
children: [
|
|
124
124
|
/* @__PURE__ */ b(
|
|
125
125
|
"div",
|
|
126
126
|
{
|
|
127
|
-
className: t ?
|
|
127
|
+
className: t ? o.groupContainer : o.rowContainer,
|
|
128
128
|
"data-testid": `${r}observation-container-${e.conceptNameToDisplay}-${s}`,
|
|
129
129
|
children: [
|
|
130
130
|
/* @__PURE__ */ b(
|
|
131
131
|
"p",
|
|
132
132
|
{
|
|
133
133
|
className: L(
|
|
134
|
-
t ?
|
|
135
|
-
!t && l ?
|
|
134
|
+
t ? o.groupLabel : o.rowLabel,
|
|
135
|
+
!t && l ? o.abnormalValue : ""
|
|
136
136
|
),
|
|
137
137
|
"data-testid": `${r}observation-label-${e.conceptNameToDisplay}-${s}`,
|
|
138
138
|
children: [
|
|
139
139
|
e.conceptNameToDisplay,
|
|
140
|
-
!t && n && /* @__PURE__ */
|
|
140
|
+
!t && n && /* @__PURE__ */ a("span", { className: o.rangeInfo, children: n })
|
|
141
141
|
]
|
|
142
142
|
}
|
|
143
143
|
),
|
|
144
|
-
t ? /* @__PURE__ */
|
|
144
|
+
t ? /* @__PURE__ */ a(
|
|
145
145
|
"div",
|
|
146
146
|
{
|
|
147
|
-
className:
|
|
147
|
+
className: o.groupMembers,
|
|
148
148
|
"data-testid": `${r}observation-group-members-${e.conceptNameToDisplay}-${s}`,
|
|
149
|
-
children: e.groupMembers?.map((_, f) => /* @__PURE__ */
|
|
150
|
-
|
|
149
|
+
children: e.groupMembers?.map((_, f) => /* @__PURE__ */ a(
|
|
150
|
+
P,
|
|
151
151
|
{
|
|
152
152
|
member: _,
|
|
153
153
|
depth: 0,
|
|
@@ -161,8 +161,8 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
161
161
|
"p",
|
|
162
162
|
{
|
|
163
163
|
className: L(
|
|
164
|
-
|
|
165
|
-
l ?
|
|
164
|
+
o.rowValue,
|
|
165
|
+
l ? o.abnormalValue : ""
|
|
166
166
|
),
|
|
167
167
|
"data-testid": `${r}observation-value-${e.conceptNameToDisplay}-${s}`,
|
|
168
168
|
children: [
|
|
@@ -174,12 +174,12 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
174
174
|
]
|
|
175
175
|
}
|
|
176
176
|
),
|
|
177
|
-
e.comment && /* @__PURE__ */
|
|
177
|
+
e.comment && /* @__PURE__ */ a(
|
|
178
178
|
"div",
|
|
179
179
|
{
|
|
180
|
-
className:
|
|
180
|
+
className: o.commentSection,
|
|
181
181
|
"data-testid": `${r}observation-comment-${e.conceptNameToDisplay}-${s}`,
|
|
182
|
-
children: /* @__PURE__ */ b("span", { className:
|
|
182
|
+
children: /* @__PURE__ */ b("span", { className: o.commentText, children: [
|
|
183
183
|
e.comment,
|
|
184
184
|
e.providers?.[0]?.name && ` - by ${e.providers[0].name}`
|
|
185
185
|
] })
|
|
@@ -194,14 +194,14 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
194
194
|
encounterUuids: s,
|
|
195
195
|
config: c
|
|
196
196
|
}) => {
|
|
197
|
-
const { t } = me(), u =
|
|
197
|
+
const { t } = me(), u = W(), [n, l] = H(!1), [r, _] = H(null), f = c?.numberOfVisits, N = X(
|
|
198
198
|
e,
|
|
199
199
|
s
|
|
200
200
|
), {
|
|
201
201
|
data: $ = [],
|
|
202
202
|
isLoading: O,
|
|
203
203
|
isError: R,
|
|
204
|
-
error:
|
|
204
|
+
error: j
|
|
205
205
|
} = y({
|
|
206
206
|
queryKey: ["forms", u, e],
|
|
207
207
|
queryFn: () => Z(u, void 0, f),
|
|
@@ -219,7 +219,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
219
219
|
return F(r.formName);
|
|
220
220
|
}, [r, F]), {
|
|
221
221
|
data: Ee,
|
|
222
|
-
isLoading:
|
|
222
|
+
isLoading: K,
|
|
223
223
|
error: v
|
|
224
224
|
} = y({
|
|
225
225
|
queryKey: ["formMetadata", D],
|
|
@@ -227,7 +227,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
227
227
|
enabled: !!D && n
|
|
228
228
|
}), {
|
|
229
229
|
data: T,
|
|
230
|
-
isLoading:
|
|
230
|
+
isLoading: J,
|
|
231
231
|
error: E
|
|
232
232
|
} = y({
|
|
233
233
|
queryKey: ["formsEncounter", r?.encounterUuid],
|
|
@@ -256,7 +256,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
256
256
|
return m[h].push({
|
|
257
257
|
id: i.encounterUuid,
|
|
258
258
|
formName: i.formName,
|
|
259
|
-
recordedOn:
|
|
259
|
+
recordedOn: oe(i.encounterDateTime, t, le).formattedResult,
|
|
260
260
|
recordedBy: A ?? "--",
|
|
261
261
|
encounterDateTime: i.encounterDateTime,
|
|
262
262
|
encounterUuid: i.encounterUuid
|
|
@@ -280,7 +280,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
280
280
|
(d, p) => {
|
|
281
281
|
switch (p) {
|
|
282
282
|
case "recordedOn":
|
|
283
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ a(ae, { onClick: () => S(d), children: d.recordedOn });
|
|
284
284
|
case "recordedBy":
|
|
285
285
|
return d.recordedBy;
|
|
286
286
|
default:
|
|
@@ -290,29 +290,29 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
290
290
|
[S]
|
|
291
291
|
);
|
|
292
292
|
return /* @__PURE__ */ b(Y, { children: [
|
|
293
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ a("div", { "data-testid": "forms-table", children: O || R || V.length === 0 || N ? /* @__PURE__ */ a(
|
|
294
294
|
U,
|
|
295
295
|
{
|
|
296
296
|
headers: B,
|
|
297
297
|
ariaLabel: t("FORMS_HEADING"),
|
|
298
298
|
rows: [],
|
|
299
299
|
loading: O,
|
|
300
|
-
errorStateMessage: R ?
|
|
300
|
+
errorStateMessage: R ? j?.message : void 0,
|
|
301
301
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
302
302
|
renderCell: G,
|
|
303
|
-
className:
|
|
303
|
+
className: o.formsTableBody,
|
|
304
304
|
dataTestId: "forms-table"
|
|
305
305
|
}
|
|
306
|
-
) : /* @__PURE__ */
|
|
306
|
+
) : /* @__PURE__ */ a(se, { align: "start", children: V.map((d, p) => {
|
|
307
307
|
const { formName: m, records: i } = d;
|
|
308
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ a(
|
|
309
309
|
ne,
|
|
310
310
|
{
|
|
311
311
|
title: m,
|
|
312
|
-
className:
|
|
312
|
+
className: o.customAccordianItem,
|
|
313
313
|
testId: `accordian-title-${m}`,
|
|
314
314
|
open: p === 0,
|
|
315
|
-
children: /* @__PURE__ */
|
|
315
|
+
children: /* @__PURE__ */ a(
|
|
316
316
|
U,
|
|
317
317
|
{
|
|
318
318
|
headers: B,
|
|
@@ -323,7 +323,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
323
323
|
sortable: x,
|
|
324
324
|
emptyStateMessage: t("FORMS_UNAVAILABLE"),
|
|
325
325
|
renderCell: G,
|
|
326
|
-
className:
|
|
326
|
+
className: o.formsTableBody,
|
|
327
327
|
dataTestId: `forms-table-${m}`
|
|
328
328
|
}
|
|
329
329
|
)
|
|
@@ -331,7 +331,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
331
331
|
m
|
|
332
332
|
);
|
|
333
333
|
}) }) }),
|
|
334
|
-
n && r && /* @__PURE__ */
|
|
334
|
+
n && r && /* @__PURE__ */ a(
|
|
335
335
|
de,
|
|
336
336
|
{
|
|
337
337
|
id: "modalIdForActionAreaLayout",
|
|
@@ -342,7 +342,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
342
342
|
passiveModal: !0,
|
|
343
343
|
size: "md",
|
|
344
344
|
testId: "form-details-modal",
|
|
345
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ a("div", { className: o.formContent, children: K || J ? /* @__PURE__ */ a(ce, { width: "100%", lineCount: 3 }) : v ? /* @__PURE__ */ a("div", { children: q(v).message ?? t("ERROR_FETCHING_FORM_METADATA") }) : E ? /* @__PURE__ */ a("div", { children: q(E).message ?? t("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ a("div", { className: o.formDetailsContainer, children: I.map((d, p) => /* @__PURE__ */ a(
|
|
346
346
|
ve,
|
|
347
347
|
{
|
|
348
348
|
observation: d,
|
|
@@ -350,7 +350,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
350
350
|
formName: r.formName
|
|
351
351
|
},
|
|
352
352
|
`${d.concept.uuid}`
|
|
353
|
-
)) }) : /* @__PURE__ */
|
|
353
|
+
)) }) : /* @__PURE__ */ a("div", { children: t("NO_FORM_DATA_AVAILABLE") }) })
|
|
354
354
|
}
|
|
355
355
|
)
|
|
356
356
|
] });
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { jsx as d, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
+
import { i as V, V as N, j as q, D as k, _ as w, x as K, k as Q, u as M, m as G, n as j, r as H, q as P, s as J, v as Y, O as x, J as z } from "./index-CfnOIq6g.js";
|
|
3
|
+
import { useQueries as W, useQuery as X } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as Z, useEffect as _, useMemo as O } from "react";
|
|
5
|
+
import { useTranslation as S } from "react-i18next";
|
|
6
|
+
const D = (e, c, a, l, t) => {
|
|
7
|
+
const s = q(e, c), o = s.value, r = k(o);
|
|
8
|
+
let n = o;
|
|
9
|
+
r === "Image" && (n = /* @__PURE__ */ d(K, { imageSrc: o, alt: o, id: `${o}-img` })), r === "Video" && (n = /* @__PURE__ */ d(Q, { id: `${o}-video`, videoSrc: o }));
|
|
10
|
+
const u = t("OBSERVATIONS_RECORDED_BY", {
|
|
11
|
+
provider: s.provider
|
|
12
|
+
}), m = e.display, b = e.observationValue?.isAbnormal ? "abnormal-obs" : "obs", y = l ? `${l}-${b}-${m}-${a}-${c}` : `${b}-${m}-${a}-${c}`;
|
|
13
|
+
return /* @__PURE__ */ d(
|
|
14
|
+
w,
|
|
15
|
+
{
|
|
16
|
+
header: s.header,
|
|
17
|
+
value: n,
|
|
18
|
+
info: u,
|
|
19
|
+
id: y,
|
|
20
|
+
testId: y,
|
|
21
|
+
ariaLabel: y
|
|
22
|
+
},
|
|
23
|
+
`obs-${e.id}`
|
|
24
|
+
);
|
|
25
|
+
}, ee = (e, c, a, l, t, s) => /* @__PURE__ */ d(
|
|
26
|
+
N,
|
|
27
|
+
{
|
|
28
|
+
title: e.display,
|
|
29
|
+
id: `grouped-obs-${e.display}-${l}`,
|
|
30
|
+
open: a,
|
|
31
|
+
children: e.members?.map(
|
|
32
|
+
(o, r) => D(o, r, t, s, c)
|
|
33
|
+
)
|
|
34
|
+
},
|
|
35
|
+
`grouped-obs-${e.id}`
|
|
36
|
+
), te = ({
|
|
37
|
+
groupedData: e,
|
|
38
|
+
title: c = ""
|
|
39
|
+
}) => {
|
|
40
|
+
const { t: a } = S(), l = (t, s, o) => {
|
|
41
|
+
const r = V(t.encounterDetails, a);
|
|
42
|
+
return /* @__PURE__ */ $(
|
|
43
|
+
N,
|
|
44
|
+
{
|
|
45
|
+
title: r,
|
|
46
|
+
id: `encounter-${t.encounterId}`,
|
|
47
|
+
open: s,
|
|
48
|
+
children: [
|
|
49
|
+
t.observations.map(
|
|
50
|
+
(n, u) => D(n, u, o, c, a)
|
|
51
|
+
),
|
|
52
|
+
t.groupedObservations.map(
|
|
53
|
+
(n, u) => ee(
|
|
54
|
+
n,
|
|
55
|
+
a,
|
|
56
|
+
s,
|
|
57
|
+
u,
|
|
58
|
+
o,
|
|
59
|
+
c
|
|
60
|
+
)
|
|
61
|
+
)
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
`encounter-${t.encounterId}`
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ d(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
id: "obs-by-encounter",
|
|
71
|
+
"data-testid": "obs-by-encounter-test-id",
|
|
72
|
+
"aria-label": "obs-by-encounter-aria-label",
|
|
73
|
+
children: e.map(
|
|
74
|
+
(t, s) => l(t, s === 0, s)
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}, se = "_observations_kfbhq_1", oe = "_title_kfbhq_12", I = {
|
|
79
|
+
observations: se,
|
|
80
|
+
title: oe
|
|
81
|
+
}, re = (e) => ["conceptUuid", e], ae = (e, c) => ["observations", e, ...c], ue = ({ config: e }) => {
|
|
82
|
+
const c = e, { conceptNames: a = [], conceptUuid: l = [] } = c, t = Z(/* @__PURE__ */ new Set()), s = M(), { addNotification: o } = G(), { t: r } = S(), n = W({
|
|
83
|
+
queries: a.map((i) => ({
|
|
84
|
+
queryKey: re(i),
|
|
85
|
+
queryFn: () => j(i),
|
|
86
|
+
enabled: !!i
|
|
87
|
+
}))
|
|
88
|
+
});
|
|
89
|
+
_(() => {
|
|
90
|
+
n.forEach((i, v) => {
|
|
91
|
+
if (i.isError && !t.current.has(v)) {
|
|
92
|
+
const L = a[v];
|
|
93
|
+
o({
|
|
94
|
+
title: r("ERROR_DEFAULT_TITLE"),
|
|
95
|
+
message: r("ERROR_FETCHING_CONCEPT", { conceptName: L }),
|
|
96
|
+
type: "error"
|
|
97
|
+
}), t.current.add(v);
|
|
98
|
+
} else i.isError || t.current.delete(v);
|
|
99
|
+
});
|
|
100
|
+
}, [n, a]);
|
|
101
|
+
const u = O(() => n.map((i) => i.data?.uuid).filter((i) => !!i), [n]), m = O(() => [.../* @__PURE__ */ new Set([...u, ...l])], [u, l]), p = O(() => a.length === 0 ? !0 : n.every((i) => !i.isLoading), [n, a.length]), {
|
|
102
|
+
data: b,
|
|
103
|
+
isLoading: y,
|
|
104
|
+
isError: h
|
|
105
|
+
} = X({
|
|
106
|
+
queryKey: ae(s, m),
|
|
107
|
+
queryFn: () => H(s, m),
|
|
108
|
+
enabled: !!s && m.length > 0 && p
|
|
109
|
+
});
|
|
110
|
+
_(() => {
|
|
111
|
+
h && o({
|
|
112
|
+
title: r("ERROR_DEFAULT_TITLE"),
|
|
113
|
+
message: r("ERROR_FETCHING_OBSERVATIONS"),
|
|
114
|
+
type: "error"
|
|
115
|
+
});
|
|
116
|
+
}, [h]);
|
|
117
|
+
const g = O(() => {
|
|
118
|
+
if (!b) return [];
|
|
119
|
+
const i = P(b), v = J(i);
|
|
120
|
+
return Y(v);
|
|
121
|
+
}, [b]), U = [
|
|
122
|
+
{ key: "name", header: "name" },
|
|
123
|
+
{ key: "value", header: "value" },
|
|
124
|
+
{ key: "form", header: "form" }
|
|
125
|
+
], R = y || !p, T = h && p, B = (!b || b.entry?.length === 0 || m.length === 0) && p, C = T ? r("ERROR_FETCHING_OBSERVATIONS") : null, A = B ? r("NO_OBSERVATIONS_FOUND") : void 0, F = g.length > 0 && !R && !T, f = c.titleTranslationKey, E = f ? r(f) : "";
|
|
126
|
+
return /* @__PURE__ */ $(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
id: "observations",
|
|
130
|
+
"data-testid": f ? `observations-${E}` : "observations",
|
|
131
|
+
"aria-label": "observations-aria-label",
|
|
132
|
+
className: I.observations,
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ d(
|
|
135
|
+
x,
|
|
136
|
+
{
|
|
137
|
+
id: "observations-title",
|
|
138
|
+
testId: f ? `observations-title-${E}` : "observations-title",
|
|
139
|
+
title: E,
|
|
140
|
+
className: I.title,
|
|
141
|
+
children: /* @__PURE__ */ d("p", { children: E })
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
F ? /* @__PURE__ */ d(te, { groupedData: g, title: E }) : /* @__PURE__ */ d(
|
|
145
|
+
z,
|
|
146
|
+
{
|
|
147
|
+
headers: U,
|
|
148
|
+
rows: [],
|
|
149
|
+
ariaLabel: r("OBSERVATIONS"),
|
|
150
|
+
loading: R,
|
|
151
|
+
errorStateMessage: C,
|
|
152
|
+
emptyStateMessage: A,
|
|
153
|
+
dataTestId: "observations-table"
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
export {
|
|
161
|
+
re as conceptUuidQueryKeys,
|
|
162
|
+
ue as default,
|
|
163
|
+
ae as observationsQueryKeys
|
|
164
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericServiceRequestTable.d.ts","sourceRoot":"","sources":["../../src/genericServiceRequest/GenericServiceRequestTable.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"GenericServiceRequestTable.d.ts","sourceRoot":"","sources":["../../src/genericServiceRequest/GenericServiceRequestTable.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,eAAO,MAAM,8BAA8B,GACzC,cAAc,MAAM,EACpB,aAAa,MAAM,EACnB,iBAAiB,MAAM,EAAE,6EAEoD,CAAC;AAehF;;;GAGG;AACH,QAAA,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmOrD,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export declare enum ServiceRequestStatus {
|
|
2
|
+
Active = "active",
|
|
3
|
+
Completed = "completed",
|
|
4
|
+
Revoked = "revoked",
|
|
5
|
+
Unknown = "unknown"
|
|
6
|
+
}
|
|
7
|
+
export declare const STATUS_TRANSLATION_MAP: Record<ServiceRequestStatus, string>;
|
|
1
8
|
export interface ServiceRequestViewModel {
|
|
2
9
|
id: string;
|
|
3
10
|
testName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/genericServiceRequest/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/genericServiceRequest/models.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAKvE,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|