@bahmni/clinical-app 0.0.1-dev.122 → 0.0.1-dev.124
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-D1MPelYk-DXgBfwvB.js +362 -0
- package/dist/{LNWAZHJI-C_dlG_LE.js → LNWAZHJI-DJjZUpma.js} +2 -2
- package/dist/{MWZ6AO7Z-DN8ct8ry.js → MWZ6AO7Z-BLBwC_XA.js} +2 -2
- package/dist/Observations-PGz2aygq-BDT11cmO.js +337 -0
- package/dist/{YPM2AS64-CmoJrkTn.js → YPM2AS64-WVGvLIXB.js} +1 -1
- package/dist/components/consultationPad/ConsultationPad.d.ts.map +1 -1
- package/dist/components/dashboardContainer/DashboardContainer.d.ts.map +1 -1
- package/dist/components/dashboardSection/DashboardSection.d.ts.map +1 -1
- 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/conditionsAndDiagnoses/SelectedDiagnosisItem.d.ts.map +1 -1
- package/dist/components/forms/encounterDetails/EncounterDetails.d.ts.map +1 -1
- package/dist/components/forms/investigations/InvestigationsForm.d.ts.map +1 -1
- package/dist/components/forms/investigations/SelectedInvestigationItem.d.ts.map +1 -1
- package/dist/components/forms/medications/MedicationsForm.d.ts.map +1 -1
- package/dist/components/forms/medications/SelectedMedicationItem.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationFormsContainer.d.ts.map +1 -1
- package/dist/components/forms/vaccinations/SelectedVaccinationItem.d.ts.map +1 -1
- package/dist/components/forms/vaccinations/VaccinationForm.d.ts.map +1 -1
- package/dist/components/patientHeader/ConsultationActionButton.d.ts.map +1 -1
- package/dist/components/patientHeader/PatientHeader.d.ts.map +1 -1
- package/dist/{index-DwCJMWny.js → index-j3_DWPjg.js} +22023 -21589
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +1 -0
- package/dist/locales/locale_es.json +1 -0
- package/dist/stores/serviceRequestStore.d.ts +1 -0
- package/dist/stores/serviceRequestStore.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/FormsTable-1YKJ9smH-BM7aXhYn.js +0 -318
- package/dist/Observations-DUCNXnZJ-BOPLq1MC.js +0 -328
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { u as J, C as Q, Y as W, a as h, H as Z, R as ee, q as G, O as re, L as ae, b as oe, c as te, w as x, G as ne, I as v, d as se, n as me, o as de, r as ie } from "./index-j3_DWPjg.js";
|
|
3
|
+
import { useState as q, useMemo as N, useCallback as y } from "react";
|
|
4
|
+
import { createPortal as le } from "react-dom";
|
|
5
|
+
const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", Ne = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", ge = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", ve = "_memberRow_1pd36_81", Me = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Le = "_abnormalValue_1pd36_102", Te = "_commentSection_1pd36_110", Oe = "_commentText_1pd36_116", Re = "_nestedGroup_1pd36_125", Ce = "_nestedGroupLabel_1pd36_132", De = "_nestedGroupMembers_1pd36_141", o = {
|
|
6
|
+
formsTableBody: ce,
|
|
7
|
+
customAccordianItem: ue,
|
|
8
|
+
formContent: pe,
|
|
9
|
+
formDetailsContainer: be,
|
|
10
|
+
observation: _e,
|
|
11
|
+
groupContainer: fe,
|
|
12
|
+
rowContainer: Ne,
|
|
13
|
+
groupLabel: $e,
|
|
14
|
+
rowLabel: ge,
|
|
15
|
+
rowValue: he,
|
|
16
|
+
groupMembers: ye,
|
|
17
|
+
memberRow: ve,
|
|
18
|
+
memberLabel: Me,
|
|
19
|
+
memberValue: Ae,
|
|
20
|
+
abnormalValue: Le,
|
|
21
|
+
commentSection: Te,
|
|
22
|
+
commentText: Oe,
|
|
23
|
+
nestedGroup: Re,
|
|
24
|
+
nestedGroupLabel: Ce,
|
|
25
|
+
nestedGroupMembers: De
|
|
26
|
+
}, Fe = "ABNORMAL", U = (e) => {
|
|
27
|
+
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() === Fe;
|
|
28
|
+
return { units: s, rangeString: c, isAbnormal: a };
|
|
29
|
+
}, H = ({
|
|
30
|
+
member: e,
|
|
31
|
+
depth: s = 0,
|
|
32
|
+
memberIndex: d = 0,
|
|
33
|
+
formName: r = ""
|
|
34
|
+
}) => {
|
|
35
|
+
const u = e.groupMembers && e.groupMembers.length > 0, m = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name, c = r ? `${r}-` : "";
|
|
36
|
+
if (u)
|
|
37
|
+
return /* @__PURE__ */ p(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: o.nestedGroup,
|
|
41
|
+
"data-testid": `${c}obs-nested-group-${m}-${d}`,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ t(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: o.nestedGroupLabel,
|
|
47
|
+
"data-testid": `${c}obs-nested-group-label-${m}-${d}`,
|
|
48
|
+
style: { paddingLeft: `${s * 16}px` },
|
|
49
|
+
children: m
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ t(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: o.nestedGroupMembers,
|
|
56
|
+
"data-testid": `${c}obs-nested-group-members-${m}-${d}`,
|
|
57
|
+
children: e.groupMembers?.map(($, g) => /* @__PURE__ */ t(
|
|
58
|
+
H,
|
|
59
|
+
{
|
|
60
|
+
member: $,
|
|
61
|
+
depth: s + 1,
|
|
62
|
+
memberIndex: g,
|
|
63
|
+
formName: r
|
|
64
|
+
},
|
|
65
|
+
`${$.concept.uuid}`
|
|
66
|
+
))
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
const { units: a, rangeString: b, isAbnormal: _ } = U(e);
|
|
73
|
+
return /* @__PURE__ */ p(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
className: o.memberRow,
|
|
77
|
+
"data-testid": `${c}obs-member-row-${m}-${d}`,
|
|
78
|
+
style: { paddingLeft: `${s * 16}px` },
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ p(
|
|
81
|
+
"p",
|
|
82
|
+
{
|
|
83
|
+
className: v(
|
|
84
|
+
o.memberLabel,
|
|
85
|
+
_ ? o.abnormalValue : ""
|
|
86
|
+
),
|
|
87
|
+
"data-testid": `${c}obs-member-label-${m}-${d}`,
|
|
88
|
+
children: [
|
|
89
|
+
m,
|
|
90
|
+
b
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ p(
|
|
95
|
+
"p",
|
|
96
|
+
{
|
|
97
|
+
className: v(
|
|
98
|
+
o.memberValue,
|
|
99
|
+
_ ? o.abnormalValue : ""
|
|
100
|
+
),
|
|
101
|
+
"data-testid": `${c}obs-member-value-${m}-${d}`,
|
|
102
|
+
children: [
|
|
103
|
+
e.valueAsString,
|
|
104
|
+
a && ` ${a}`
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}, we = ({
|
|
112
|
+
observation: e,
|
|
113
|
+
index: s,
|
|
114
|
+
formName: d = ""
|
|
115
|
+
}) => {
|
|
116
|
+
const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: m, isAbnormal: c } = U(e), a = d ? `${d}-` : "";
|
|
117
|
+
return /* @__PURE__ */ p(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
className: o.observation,
|
|
121
|
+
"data-testid": `${a}observation-item-${e.conceptNameToDisplay}-${s}`,
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ p(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
className: r ? o.groupContainer : o.rowContainer,
|
|
127
|
+
"data-testid": `${a}observation-container-${e.conceptNameToDisplay}-${s}`,
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ p(
|
|
130
|
+
"p",
|
|
131
|
+
{
|
|
132
|
+
className: v(
|
|
133
|
+
r ? o.groupLabel : o.rowLabel,
|
|
134
|
+
!r && c ? o.abnormalValue : ""
|
|
135
|
+
),
|
|
136
|
+
"data-testid": `${a}observation-label-${e.conceptNameToDisplay}-${s}`,
|
|
137
|
+
children: [
|
|
138
|
+
e.conceptNameToDisplay,
|
|
139
|
+
!r && m && /* @__PURE__ */ t("span", { className: o.rangeInfo, children: m })
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
r ? /* @__PURE__ */ t(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
className: o.groupMembers,
|
|
147
|
+
"data-testid": `${a}observation-group-members-${e.conceptNameToDisplay}-${s}`,
|
|
148
|
+
children: e.groupMembers?.map((b, _) => /* @__PURE__ */ t(
|
|
149
|
+
H,
|
|
150
|
+
{
|
|
151
|
+
member: b,
|
|
152
|
+
depth: 0,
|
|
153
|
+
memberIndex: _,
|
|
154
|
+
formName: d
|
|
155
|
+
},
|
|
156
|
+
`${b.concept.uuid}`
|
|
157
|
+
))
|
|
158
|
+
}
|
|
159
|
+
) : /* @__PURE__ */ p(
|
|
160
|
+
"p",
|
|
161
|
+
{
|
|
162
|
+
className: v(
|
|
163
|
+
o.rowValue,
|
|
164
|
+
c ? o.abnormalValue : ""
|
|
165
|
+
),
|
|
166
|
+
"data-testid": `${a}observation-value-${e.conceptNameToDisplay}-${s}`,
|
|
167
|
+
children: [
|
|
168
|
+
e.valueAsString,
|
|
169
|
+
u && ` ${u}`
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
e.comment && /* @__PURE__ */ t(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
className: o.commentSection,
|
|
180
|
+
"data-testid": `${a}observation-comment-${e.conceptNameToDisplay}-${s}`,
|
|
181
|
+
children: /* @__PURE__ */ p("span", { className: o.commentText, children: [
|
|
182
|
+
e.comment,
|
|
183
|
+
e.providers?.[0]?.name && ` - by ${e.providers[0].name}`
|
|
184
|
+
] })
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
`${e.concept.uuid}-${s}`
|
|
190
|
+
);
|
|
191
|
+
}, Ge = ({
|
|
192
|
+
episodeOfCareUuids: e,
|
|
193
|
+
encounterUuids: s,
|
|
194
|
+
config: d
|
|
195
|
+
}) => {
|
|
196
|
+
const { t: r } = J(), u = Q(), [m, c] = q(!1), [a, b] = q(null), _ = d?.numberOfVisits, $ = W(
|
|
197
|
+
e,
|
|
198
|
+
s
|
|
199
|
+
), {
|
|
200
|
+
data: g = [],
|
|
201
|
+
isLoading: T,
|
|
202
|
+
isError: O,
|
|
203
|
+
error: k
|
|
204
|
+
} = h({
|
|
205
|
+
queryKey: ["forms", u, e],
|
|
206
|
+
queryFn: () => se(u, void 0, _),
|
|
207
|
+
enabled: !!u && !$
|
|
208
|
+
}), R = N(() => !s || s.length === 0 ? g : g.filter(
|
|
209
|
+
(n) => s.includes(n.encounterUuid)
|
|
210
|
+
), [g, s]), { data: C = [] } = h({
|
|
211
|
+
queryKey: ["observationForms"],
|
|
212
|
+
queryFn: me
|
|
213
|
+
}), D = y(
|
|
214
|
+
(n) => C.find((l) => l.name === n)?.uuid,
|
|
215
|
+
[C]
|
|
216
|
+
), M = N(() => {
|
|
217
|
+
if (a)
|
|
218
|
+
return D(a.formName);
|
|
219
|
+
}, [a, D]), {
|
|
220
|
+
data: Ie,
|
|
221
|
+
isLoading: j,
|
|
222
|
+
error: F
|
|
223
|
+
} = h({
|
|
224
|
+
queryKey: ["formMetadata", M],
|
|
225
|
+
queryFn: () => de(M),
|
|
226
|
+
enabled: !!M && m
|
|
227
|
+
}), {
|
|
228
|
+
data: A,
|
|
229
|
+
isLoading: K,
|
|
230
|
+
error: w
|
|
231
|
+
} = h({
|
|
232
|
+
queryKey: ["formsEncounter", a?.encounterUuid],
|
|
233
|
+
queryFn: () => ie(a.encounterUuid, !0),
|
|
234
|
+
enabled: !!a?.encounterUuid && m
|
|
235
|
+
}), I = N(() => !A?.observations || !a?.formName ? [] : A.observations.filter(
|
|
236
|
+
(n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(a.formName)
|
|
237
|
+
), [A?.observations, a?.formName]), E = N(
|
|
238
|
+
() => [
|
|
239
|
+
{ key: "recordedOn", header: r("FORM_RECORDED_ON") },
|
|
240
|
+
{ key: "recordedBy", header: r("FORM_RECORDED_BY") }
|
|
241
|
+
],
|
|
242
|
+
[r]
|
|
243
|
+
), P = N(
|
|
244
|
+
() => [
|
|
245
|
+
{ key: "recordedOn", sortable: !0 },
|
|
246
|
+
{ key: "recordedBy", sortable: !0 }
|
|
247
|
+
],
|
|
248
|
+
[]
|
|
249
|
+
), B = N(() => {
|
|
250
|
+
const n = R.reduce(
|
|
251
|
+
(l, i) => {
|
|
252
|
+
const f = i.formName;
|
|
253
|
+
l[f] ??= [];
|
|
254
|
+
const L = i.providers.map((Y) => Y.providerName).filter(Boolean).join(", ");
|
|
255
|
+
return l[f].push({
|
|
256
|
+
id: i.encounterUuid,
|
|
257
|
+
formName: i.formName,
|
|
258
|
+
recordedOn: Z(i.encounterDateTime, r, ne).formattedResult,
|
|
259
|
+
recordedBy: L ?? "--",
|
|
260
|
+
encounterDateTime: i.encounterDateTime,
|
|
261
|
+
encounterUuid: i.encounterUuid
|
|
262
|
+
}), l;
|
|
263
|
+
},
|
|
264
|
+
{}
|
|
265
|
+
);
|
|
266
|
+
return Object.entries(n).map(
|
|
267
|
+
([l, i]) => ({
|
|
268
|
+
formName: l,
|
|
269
|
+
records: i.sort(
|
|
270
|
+
(f, L) => L.encounterDateTime - f.encounterDateTime
|
|
271
|
+
)
|
|
272
|
+
})
|
|
273
|
+
).sort((l, i) => l.formName.localeCompare(i.formName));
|
|
274
|
+
}, [R, r]), S = y((n) => {
|
|
275
|
+
b(n), c(!0);
|
|
276
|
+
}, []), X = y(() => {
|
|
277
|
+
c(!1), b(null);
|
|
278
|
+
}, []), V = y(
|
|
279
|
+
(n, l) => {
|
|
280
|
+
switch (l) {
|
|
281
|
+
case "recordedOn":
|
|
282
|
+
return /* @__PURE__ */ t(ee, { onClick: () => S(n), children: n.recordedOn });
|
|
283
|
+
case "recordedBy":
|
|
284
|
+
return n.recordedBy;
|
|
285
|
+
default:
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
[S]
|
|
290
|
+
);
|
|
291
|
+
return /* @__PURE__ */ p(z, { children: [
|
|
292
|
+
/* @__PURE__ */ t("div", { "data-testid": "forms-table", children: T || O || B.length === 0 || $ ? /* @__PURE__ */ t(
|
|
293
|
+
G,
|
|
294
|
+
{
|
|
295
|
+
headers: E,
|
|
296
|
+
ariaLabel: r("FORMS_HEADING"),
|
|
297
|
+
rows: [],
|
|
298
|
+
loading: T,
|
|
299
|
+
errorStateMessage: O ? k?.message : void 0,
|
|
300
|
+
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
301
|
+
renderCell: V,
|
|
302
|
+
className: o.formsTableBody,
|
|
303
|
+
dataTestId: "forms-table"
|
|
304
|
+
}
|
|
305
|
+
) : /* @__PURE__ */ t(re, { align: "start", children: B.map((n, l) => {
|
|
306
|
+
const { formName: i, records: f } = n;
|
|
307
|
+
return /* @__PURE__ */ t(
|
|
308
|
+
ae,
|
|
309
|
+
{
|
|
310
|
+
title: i,
|
|
311
|
+
className: o.customAccordianItem,
|
|
312
|
+
testId: `accordian-title-${i}`,
|
|
313
|
+
open: l === 0,
|
|
314
|
+
children: /* @__PURE__ */ t(
|
|
315
|
+
G,
|
|
316
|
+
{
|
|
317
|
+
headers: E,
|
|
318
|
+
ariaLabel: r("FORMS_HEADING"),
|
|
319
|
+
rows: f,
|
|
320
|
+
loading: !1,
|
|
321
|
+
errorStateMessage: "",
|
|
322
|
+
sortable: P,
|
|
323
|
+
emptyStateMessage: r("FORMS_UNAVAILABLE"),
|
|
324
|
+
renderCell: V,
|
|
325
|
+
className: o.formsTableBody,
|
|
326
|
+
dataTestId: `forms-table-${i}`
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
},
|
|
330
|
+
i
|
|
331
|
+
);
|
|
332
|
+
}) }) }),
|
|
333
|
+
m && a && le(
|
|
334
|
+
/* @__PURE__ */ t(
|
|
335
|
+
oe,
|
|
336
|
+
{
|
|
337
|
+
id: "formDetailsModal",
|
|
338
|
+
open: m,
|
|
339
|
+
onRequestClose: X,
|
|
340
|
+
modalHeading: a.formName,
|
|
341
|
+
modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
|
|
342
|
+
passiveModal: !0,
|
|
343
|
+
size: "md",
|
|
344
|
+
testId: "form-details-modal",
|
|
345
|
+
children: /* @__PURE__ */ t("div", { className: o.formContent, children: j || K ? /* @__PURE__ */ t(te, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: x(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ t("div", { children: x(w).message ?? r("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: I.map((n, l) => /* @__PURE__ */ t(
|
|
346
|
+
we,
|
|
347
|
+
{
|
|
348
|
+
observation: n,
|
|
349
|
+
index: l,
|
|
350
|
+
formName: a.formName
|
|
351
|
+
},
|
|
352
|
+
`${n.concept.uuid}`
|
|
353
|
+
)) }) : /* @__PURE__ */ t("div", { children: r("NO_FORM_DATA_AVAILABLE") }) })
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
document.getElementById("actionAreaLayout") ?? document.body
|
|
357
|
+
)
|
|
358
|
+
] });
|
|
359
|
+
};
|
|
360
|
+
export {
|
|
361
|
+
Ge as default
|
|
362
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-
|
|
2
|
-
import { i as d, j as f, k as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-WVGvLIXB.js";
|
|
2
|
+
import { i as d, j as f, k as e } from "./index-j3_DWPjg.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 i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-
|
|
2
|
-
import { i as v, j as C, k as e } from "./index-
|
|
1
|
+
import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-WVGvLIXB.js";
|
|
2
|
+
import { i as v, j as C, k as e } from "./index-j3_DWPjg.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|