@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
package/dist/index.js
CHANGED
|
@@ -152,6 +152,7 @@
|
|
|
152
152
|
"INVESTIGATIONS_SEARCH_ARIA_LABEL": "Search for investigations/prcedures",
|
|
153
153
|
"INVESTIGATIONS_SEARCH_PLACEHOLDER": "Search to add investigations/procedures",
|
|
154
154
|
"INVESTIGATION_ALREADY_SELECTED": "(Already selected)",
|
|
155
|
+
"INVESTIGATION_ALREADY_ADDED": "Investigation is already ordered",
|
|
155
156
|
"INVESTIGATION_PANEL": "Panel",
|
|
156
157
|
"INVESTIGATION_PRIORITY_URGENT": "Urgent",
|
|
157
158
|
"IN_PROGRESS_STATUS": "In progress",
|
|
@@ -151,6 +151,7 @@
|
|
|
151
151
|
"INVESTIGATIONS_SEARCH_ARIA_LABEL": "Buscar investigaciones/procedimientos",
|
|
152
152
|
"INVESTIGATIONS_SEARCH_PLACEHOLDER": "Busque para agregar investigaciones/procedimientos",
|
|
153
153
|
"INVESTIGATION_ALREADY_SELECTED": "(Ya seleccionado)",
|
|
154
|
+
"INVESTIGATION_ALREADY_ADDED": "La investigación ya está ordenada",
|
|
154
155
|
"INVESTIGATION_PANEL": "Panel",
|
|
155
156
|
"INVESTIGATION_PRIORITY_URGENT": "Urgente",
|
|
156
157
|
"IN_PROGRESS_STATUS": "En progreso",
|
|
@@ -7,6 +7,7 @@ export interface ServiceRequestState {
|
|
|
7
7
|
updateNote: (category: string, serviceRequestId: string, note: string) => void;
|
|
8
8
|
reset: () => void;
|
|
9
9
|
getState: () => ServiceRequestState;
|
|
10
|
+
isSelectedInCategory: (category: string, conceptCode: string) => boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare const useServiceRequestStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ServiceRequestState>>;
|
|
12
13
|
export default useServiceRequestStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceRequestStore.d.ts","sourceRoot":"","sources":["../../src/stores/serviceRequestStore.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,mBAAmB;IAClC,uBAAuB,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAEjE,iBAAiB,EAAE,CACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,KACZ,IAAI,CAAC;IACV,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,cAAc,EAAE,CACd,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,+BAA+B,KACtC,IAAI,CAAC;IACV,UAAU,EAAE,CACV,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,IAAI,EAAE,MAAM,KACT,IAAI,CAAC;IACV,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"serviceRequestStore.d.ts","sourceRoot":"","sources":["../../src/stores/serviceRequestStore.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,mBAAmB;IAClC,uBAAuB,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAEjE,iBAAiB,EAAE,CACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,KACZ,IAAI,CAAC;IACV,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,cAAc,EAAE,CACd,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,+BAA+B,KACtC,IAAI,CAAC;IACV,UAAU,EAAE,CACV,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,IAAI,EAAE,MAAM,KACT,IAAI,CAAC;IACV,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,mBAAmB,CAAC;IACpC,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC;CAC1E;AAED,eAAO,MAAM,sBAAsB,kFA6HlC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import { jsx as o, jsxs as p, Fragment as J } from "react/jsx-runtime";
|
|
2
|
-
import { u as Q, C as Y, K as W, a as f, H as Z, R as ee, q as V, O as re, T as ae, L as oe, b as ne, w as $, G as te, I as N, c as se, n as de, o as ie, r as me } from "./index-DwCJMWny.js";
|
|
3
|
-
import { useState as x, useMemo as _, useCallback as g } 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", ge = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", he = "_rowLabel_1pd36_58", ye = "_rowValue_1pd36_67", ve = "_groupMembers_1pd36_75", Me = "_memberRow_1pd36_81", Le = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Ce = "_abnormalValue_1pd36_102", Oe = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Te = "_nestedGroup_1pd36_125", Fe = "_nestedGroupLabel_1pd36_132", De = "_nestedGroupMembers_1pd36_141", r = {
|
|
6
|
-
formsTableBody: ce,
|
|
7
|
-
customAccordianItem: ue,
|
|
8
|
-
formContent: pe,
|
|
9
|
-
formDetailsContainer: be,
|
|
10
|
-
observation: _e,
|
|
11
|
-
groupContainer: fe,
|
|
12
|
-
rowContainer: ge,
|
|
13
|
-
groupLabel: Ne,
|
|
14
|
-
rowLabel: he,
|
|
15
|
-
rowValue: ye,
|
|
16
|
-
groupMembers: ve,
|
|
17
|
-
memberRow: Me,
|
|
18
|
-
memberLabel: Le,
|
|
19
|
-
memberValue: Ae,
|
|
20
|
-
abnormalValue: Ce,
|
|
21
|
-
commentSection: Oe,
|
|
22
|
-
commentText: Re,
|
|
23
|
-
nestedGroup: Te,
|
|
24
|
-
nestedGroupLabel: Fe,
|
|
25
|
-
nestedGroupMembers: De
|
|
26
|
-
}, we = "ABNORMAL", U = (e) => {
|
|
27
|
-
const i = e.concept?.units, m = e.concept?.lowNormal, a = e.concept?.hiNormal, l = m != null, c = a != null, u = l && c ? ` (${m} - ${a})` : l ? ` (>${m})` : c ? ` (<${a})` : "", t = e.interpretation && e.interpretation.toUpperCase() === we;
|
|
28
|
-
return { units: i, rangeString: u, isAbnormal: t };
|
|
29
|
-
}, q = ({
|
|
30
|
-
member: e,
|
|
31
|
-
depth: i = 0
|
|
32
|
-
}) => {
|
|
33
|
-
const m = e.groupMembers && e.groupMembers.length > 0, a = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name;
|
|
34
|
-
if (m)
|
|
35
|
-
return /* @__PURE__ */ p("div", { className: r.nestedGroup, children: [
|
|
36
|
-
/* @__PURE__ */ o(
|
|
37
|
-
"div",
|
|
38
|
-
{
|
|
39
|
-
className: r.nestedGroupLabel,
|
|
40
|
-
style: { paddingLeft: `${i * 16}px` },
|
|
41
|
-
children: a
|
|
42
|
-
}
|
|
43
|
-
),
|
|
44
|
-
/* @__PURE__ */ o("div", { className: r.nestedGroupMembers, children: e.groupMembers?.map((t) => /* @__PURE__ */ o(
|
|
45
|
-
q,
|
|
46
|
-
{
|
|
47
|
-
member: t,
|
|
48
|
-
depth: i + 1
|
|
49
|
-
},
|
|
50
|
-
`${t.concept.uuid}`
|
|
51
|
-
)) })
|
|
52
|
-
] });
|
|
53
|
-
const { units: l, rangeString: c, isAbnormal: u } = U(e);
|
|
54
|
-
return /* @__PURE__ */ p(
|
|
55
|
-
"div",
|
|
56
|
-
{
|
|
57
|
-
className: r.memberRow,
|
|
58
|
-
style: { paddingLeft: `${i * 16}px` },
|
|
59
|
-
children: [
|
|
60
|
-
/* @__PURE__ */ p(
|
|
61
|
-
"p",
|
|
62
|
-
{
|
|
63
|
-
className: N(
|
|
64
|
-
r.memberLabel,
|
|
65
|
-
u ? r.abnormalValue : ""
|
|
66
|
-
),
|
|
67
|
-
children: [
|
|
68
|
-
a,
|
|
69
|
-
c
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
),
|
|
73
|
-
/* @__PURE__ */ p(
|
|
74
|
-
"p",
|
|
75
|
-
{
|
|
76
|
-
className: N(
|
|
77
|
-
r.memberValue,
|
|
78
|
-
u ? r.abnormalValue : ""
|
|
79
|
-
),
|
|
80
|
-
children: [
|
|
81
|
-
e.valueAsString,
|
|
82
|
-
l && ` ${l}`
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
}, Be = ({
|
|
90
|
-
observation: e,
|
|
91
|
-
index: i
|
|
92
|
-
}) => {
|
|
93
|
-
const m = e.groupMembers && e.groupMembers.length > 0, { units: a, rangeString: l, isAbnormal: c } = U(e);
|
|
94
|
-
return /* @__PURE__ */ p(
|
|
95
|
-
"div",
|
|
96
|
-
{
|
|
97
|
-
className: r.observation,
|
|
98
|
-
children: [
|
|
99
|
-
/* @__PURE__ */ p(
|
|
100
|
-
"div",
|
|
101
|
-
{
|
|
102
|
-
className: m ? r.groupContainer : r.rowContainer,
|
|
103
|
-
children: [
|
|
104
|
-
/* @__PURE__ */ p(
|
|
105
|
-
"p",
|
|
106
|
-
{
|
|
107
|
-
className: N(
|
|
108
|
-
m ? r.groupLabel : r.rowLabel,
|
|
109
|
-
!m && c ? r.abnormalValue : ""
|
|
110
|
-
),
|
|
111
|
-
children: [
|
|
112
|
-
e.conceptNameToDisplay,
|
|
113
|
-
!m && l && /* @__PURE__ */ o("span", { className: r.rangeInfo, children: l })
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
m ? /* @__PURE__ */ o("div", { className: r.groupMembers, children: e.groupMembers?.map((u) => /* @__PURE__ */ o(
|
|
118
|
-
q,
|
|
119
|
-
{
|
|
120
|
-
member: u,
|
|
121
|
-
depth: 0
|
|
122
|
-
},
|
|
123
|
-
`${u.concept.uuid}`
|
|
124
|
-
)) }) : /* @__PURE__ */ p(
|
|
125
|
-
"p",
|
|
126
|
-
{
|
|
127
|
-
className: N(
|
|
128
|
-
r.rowValue,
|
|
129
|
-
c ? r.abnormalValue : ""
|
|
130
|
-
),
|
|
131
|
-
children: [
|
|
132
|
-
e.valueAsString,
|
|
133
|
-
a && ` ${a}`
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
),
|
|
140
|
-
e.comment && /* @__PURE__ */ o("div", { className: r.commentSection, children: /* @__PURE__ */ p("span", { className: r.commentText, children: [
|
|
141
|
-
e.comment,
|
|
142
|
-
e.providers?.[0]?.name && ` - by ${e.providers[0].name}`
|
|
143
|
-
] }) })
|
|
144
|
-
]
|
|
145
|
-
},
|
|
146
|
-
`${e.concept.uuid}-${i}`
|
|
147
|
-
);
|
|
148
|
-
}, $e = ({
|
|
149
|
-
episodeOfCareUuids: e,
|
|
150
|
-
encounterUuids: i,
|
|
151
|
-
config: m
|
|
152
|
-
}) => {
|
|
153
|
-
const { t: a } = Q(), l = Y(), [c, u] = x(!1), [t, L] = x(null), H = m?.numberOfVisits, A = W(
|
|
154
|
-
e,
|
|
155
|
-
i
|
|
156
|
-
), {
|
|
157
|
-
data: h = [],
|
|
158
|
-
isLoading: C,
|
|
159
|
-
isError: O,
|
|
160
|
-
error: k
|
|
161
|
-
} = f({
|
|
162
|
-
queryKey: ["forms", l, e],
|
|
163
|
-
queryFn: () => se(l, void 0, H),
|
|
164
|
-
enabled: !!l && !A
|
|
165
|
-
}), R = _(() => !i || i.length === 0 ? h : h.filter(
|
|
166
|
-
(n) => i.includes(n.encounterUuid)
|
|
167
|
-
), [h, i]), { data: T = [] } = f({
|
|
168
|
-
queryKey: ["observationForms"],
|
|
169
|
-
queryFn: de
|
|
170
|
-
}), F = g(
|
|
171
|
-
(n) => T.find((s) => s.name === n)?.uuid,
|
|
172
|
-
[T]
|
|
173
|
-
), y = _(() => {
|
|
174
|
-
if (t)
|
|
175
|
-
return F(t.formName);
|
|
176
|
-
}, [t, F]), {
|
|
177
|
-
data: Ee,
|
|
178
|
-
isLoading: K,
|
|
179
|
-
error: D
|
|
180
|
-
} = f({
|
|
181
|
-
queryKey: ["formMetadata", y],
|
|
182
|
-
queryFn: () => ie(y),
|
|
183
|
-
enabled: !!y && c
|
|
184
|
-
}), {
|
|
185
|
-
data: v,
|
|
186
|
-
isLoading: j,
|
|
187
|
-
error: w
|
|
188
|
-
} = f({
|
|
189
|
-
queryKey: ["formsEncounter", t?.encounterUuid],
|
|
190
|
-
queryFn: () => me(t.encounterUuid, !0),
|
|
191
|
-
enabled: !!t?.encounterUuid && c
|
|
192
|
-
}), B = _(() => !v?.observations || !t?.formName ? [] : v.observations.filter(
|
|
193
|
-
(n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(t.formName)
|
|
194
|
-
), [v?.observations, t?.formName]), E = _(
|
|
195
|
-
() => [
|
|
196
|
-
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
197
|
-
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
198
|
-
],
|
|
199
|
-
[a]
|
|
200
|
-
), P = _(
|
|
201
|
-
() => [
|
|
202
|
-
{ key: "recordedOn", sortable: !0 },
|
|
203
|
-
{ key: "recordedBy", sortable: !0 }
|
|
204
|
-
],
|
|
205
|
-
[]
|
|
206
|
-
), I = _(() => {
|
|
207
|
-
const n = R.reduce(
|
|
208
|
-
(s, d) => {
|
|
209
|
-
const b = d.formName;
|
|
210
|
-
s[b] ??= [];
|
|
211
|
-
const M = d.providers.map((z) => z.providerName).filter(Boolean).join(", ");
|
|
212
|
-
return s[b].push({
|
|
213
|
-
id: d.encounterUuid,
|
|
214
|
-
formName: d.formName,
|
|
215
|
-
recordedOn: Z(d.encounterDateTime, a, te).formattedResult,
|
|
216
|
-
recordedBy: M ?? "--",
|
|
217
|
-
encounterDateTime: d.encounterDateTime,
|
|
218
|
-
encounterUuid: d.encounterUuid
|
|
219
|
-
}), s;
|
|
220
|
-
},
|
|
221
|
-
{}
|
|
222
|
-
);
|
|
223
|
-
return Object.entries(n).map(
|
|
224
|
-
([s, d]) => ({
|
|
225
|
-
formName: s,
|
|
226
|
-
records: d.sort(
|
|
227
|
-
(b, M) => M.encounterDateTime - b.encounterDateTime
|
|
228
|
-
)
|
|
229
|
-
})
|
|
230
|
-
).sort((s, d) => s.formName.localeCompare(d.formName));
|
|
231
|
-
}, [R, a]), S = g((n) => {
|
|
232
|
-
L(n), u(!0);
|
|
233
|
-
}, []), X = g(() => {
|
|
234
|
-
u(!1), L(null);
|
|
235
|
-
}, []), G = g(
|
|
236
|
-
(n, s) => {
|
|
237
|
-
switch (s) {
|
|
238
|
-
case "recordedOn":
|
|
239
|
-
return /* @__PURE__ */ o(ee, { onClick: () => S(n), children: n.recordedOn });
|
|
240
|
-
case "recordedBy":
|
|
241
|
-
return n.recordedBy;
|
|
242
|
-
default:
|
|
243
|
-
return null;
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
[S]
|
|
247
|
-
);
|
|
248
|
-
return /* @__PURE__ */ p(J, { children: [
|
|
249
|
-
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: C || O || I.length === 0 || A ? /* @__PURE__ */ o(
|
|
250
|
-
V,
|
|
251
|
-
{
|
|
252
|
-
headers: E,
|
|
253
|
-
ariaLabel: a("FORMS_HEADING"),
|
|
254
|
-
rows: [],
|
|
255
|
-
loading: C,
|
|
256
|
-
errorStateMessage: O ? k?.message : void 0,
|
|
257
|
-
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
258
|
-
renderCell: G,
|
|
259
|
-
className: r.formsTableBody,
|
|
260
|
-
"data-testid": "sortable-data-table"
|
|
261
|
-
}
|
|
262
|
-
) : /* @__PURE__ */ o(re, { align: "start", children: I.map((n, s) => {
|
|
263
|
-
const { formName: d, records: b } = n;
|
|
264
|
-
return /* @__PURE__ */ o(
|
|
265
|
-
ae,
|
|
266
|
-
{
|
|
267
|
-
title: d,
|
|
268
|
-
className: r.customAccordianItem,
|
|
269
|
-
testId: `accordian-title-${d}`,
|
|
270
|
-
open: s === 0,
|
|
271
|
-
children: /* @__PURE__ */ o(
|
|
272
|
-
V,
|
|
273
|
-
{
|
|
274
|
-
headers: E,
|
|
275
|
-
ariaLabel: a("FORMS_HEADING"),
|
|
276
|
-
rows: b,
|
|
277
|
-
loading: !1,
|
|
278
|
-
errorStateMessage: "",
|
|
279
|
-
sortable: P,
|
|
280
|
-
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
281
|
-
renderCell: G,
|
|
282
|
-
className: r.formsTableBody,
|
|
283
|
-
"data-testid": "forms-data-table"
|
|
284
|
-
}
|
|
285
|
-
)
|
|
286
|
-
},
|
|
287
|
-
d
|
|
288
|
-
);
|
|
289
|
-
}) }) }),
|
|
290
|
-
c && t && le(
|
|
291
|
-
/* @__PURE__ */ o(
|
|
292
|
-
oe,
|
|
293
|
-
{
|
|
294
|
-
id: "formDetailsModal",
|
|
295
|
-
open: c,
|
|
296
|
-
onRequestClose: X,
|
|
297
|
-
modalHeading: t.formName,
|
|
298
|
-
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
299
|
-
passiveModal: !0,
|
|
300
|
-
size: "md",
|
|
301
|
-
testId: "form-details-modal",
|
|
302
|
-
children: /* @__PURE__ */ o("div", { className: r.formContent, children: K || j ? /* @__PURE__ */ o(ne, { width: "100%", lineCount: 3 }) : D ? /* @__PURE__ */ o("div", { children: $(D).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ o("div", { children: $(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : B.length > 0 ? /* @__PURE__ */ o("div", { className: r.formDetailsContainer, children: B.map((n, s) => /* @__PURE__ */ o(
|
|
303
|
-
Be,
|
|
304
|
-
{
|
|
305
|
-
observation: n,
|
|
306
|
-
index: s
|
|
307
|
-
},
|
|
308
|
-
`${n.concept.uuid}`
|
|
309
|
-
)) }) : /* @__PURE__ */ o("div", { children: a("NO_FORM_DATA_AVAILABLE") }) })
|
|
310
|
-
}
|
|
311
|
-
),
|
|
312
|
-
document.getElementById("actionAreaLayout") ?? document.body
|
|
313
|
-
)
|
|
314
|
-
] });
|
|
315
|
-
};
|
|
316
|
-
export {
|
|
317
|
-
$e as default
|
|
318
|
-
};
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import { jsxs as S, jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { C as M, d as F, u as T, e as G, f as B, a as Q, J as U, q as k, X as x, D as _, Q as K, A as X, g as H, h as J, t as j } from "./index-DwCJMWny.js";
|
|
3
|
-
import { useRef as P, useEffect as O, useMemo as m } from "react";
|
|
4
|
-
const W = "normal", Y = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", Z = "A", z = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ee = (e, n) => e?.date ? x(e.date, n).formattedResult : n("DATE_ERROR_PARSE"), te = (e) => {
|
|
5
|
-
if (!e.observationValue?.value)
|
|
6
|
-
return "";
|
|
7
|
-
const { value: n, unit: t } = e.observationValue;
|
|
8
|
-
return t ? `${n} ${t}` : String(n);
|
|
9
|
-
}, ne = (e) => {
|
|
10
|
-
const n = e.display;
|
|
11
|
-
if (!e.observationValue)
|
|
12
|
-
return String(n);
|
|
13
|
-
const { unit: t, referenceRange: o } = e.observationValue;
|
|
14
|
-
if (!o)
|
|
15
|
-
return String(n);
|
|
16
|
-
const { low: r, high: i } = o;
|
|
17
|
-
if (r && i) {
|
|
18
|
-
const a = r.unit ? `${r.value} ${r.unit}` : t ? `${r.value} ${t}` : String(r.value), s = i.unit ? `${i.value} ${i.unit}` : t ? `${i.value} ${t}` : String(i.value);
|
|
19
|
-
return `${n} (${a} - ${s})`;
|
|
20
|
-
}
|
|
21
|
-
if (r) {
|
|
22
|
-
const a = r.unit ? `${r.value} ${r.unit}` : t ? `${r.value} ${t}` : String(r.value);
|
|
23
|
-
return `${n} (>${a})`;
|
|
24
|
-
}
|
|
25
|
-
if (i) {
|
|
26
|
-
const a = i.unit ? `${i.value} ${i.unit}` : t ? `${i.value} ${t}` : String(i.value);
|
|
27
|
-
return `${n} (<${a})`;
|
|
28
|
-
}
|
|
29
|
-
return n;
|
|
30
|
-
}, re = (e, n) => ({
|
|
31
|
-
index: n,
|
|
32
|
-
header: ne(e),
|
|
33
|
-
value: te(e),
|
|
34
|
-
provider: e.encounter?.provider
|
|
35
|
-
}), h = (e) => (typeof e == "string" ? e : e?.reference)?.split("/")?.pop();
|
|
36
|
-
function oe(e) {
|
|
37
|
-
return !e.interpretation || e.interpretation.length === 0 ? !1 : e.interpretation.some(
|
|
38
|
-
(n) => n.coding?.some(
|
|
39
|
-
(t) => t.system === z && t.code === Z
|
|
40
|
-
)
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
function ie(e) {
|
|
44
|
-
const {
|
|
45
|
-
valueQuantity: n,
|
|
46
|
-
valueCodeableConcept: t,
|
|
47
|
-
valueString: o,
|
|
48
|
-
valueBoolean: r,
|
|
49
|
-
valueInteger: i,
|
|
50
|
-
referenceRange: a
|
|
51
|
-
} = e, s = oe(e);
|
|
52
|
-
if (n) {
|
|
53
|
-
const u = {
|
|
54
|
-
value: n.value ?? "",
|
|
55
|
-
unit: n.unit,
|
|
56
|
-
type: "quantity",
|
|
57
|
-
isAbnormal: s
|
|
58
|
-
};
|
|
59
|
-
if (a && a.length > 0) {
|
|
60
|
-
const d = a.find(
|
|
61
|
-
(p) => p.type?.coding?.some(
|
|
62
|
-
(v) => v.system === Y && v.code === W
|
|
63
|
-
)
|
|
64
|
-
);
|
|
65
|
-
d && (d.low || d.high) && (u.referenceRange = {
|
|
66
|
-
low: d.low ? {
|
|
67
|
-
value: d.low.value,
|
|
68
|
-
unit: d.low.unit
|
|
69
|
-
} : void 0,
|
|
70
|
-
high: d.high ? {
|
|
71
|
-
value: d.high.value,
|
|
72
|
-
unit: d.high.unit
|
|
73
|
-
} : void 0
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return u;
|
|
77
|
-
}
|
|
78
|
-
if (t)
|
|
79
|
-
return {
|
|
80
|
-
value: t.text ?? t.coding[0].display,
|
|
81
|
-
type: "codeable",
|
|
82
|
-
isAbnormal: s
|
|
83
|
-
};
|
|
84
|
-
if (o)
|
|
85
|
-
return {
|
|
86
|
-
value: o,
|
|
87
|
-
type: "string",
|
|
88
|
-
isAbnormal: s
|
|
89
|
-
};
|
|
90
|
-
if (r !== void 0)
|
|
91
|
-
return {
|
|
92
|
-
value: r,
|
|
93
|
-
type: "boolean",
|
|
94
|
-
isAbnormal: s
|
|
95
|
-
};
|
|
96
|
-
if (i !== void 0)
|
|
97
|
-
return {
|
|
98
|
-
value: i,
|
|
99
|
-
type: "integer",
|
|
100
|
-
isAbnormal: s
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function ae(e, n) {
|
|
104
|
-
const t = n.get(e);
|
|
105
|
-
if (t)
|
|
106
|
-
return {
|
|
107
|
-
id: t.id ?? e,
|
|
108
|
-
type: t.type?.[0]?.coding?.[0]?.display ?? "Unknown",
|
|
109
|
-
date: t.period?.start ?? "",
|
|
110
|
-
provider: t.participant?.[0]?.individual?.display,
|
|
111
|
-
location: t.location?.[0]?.location?.display
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
function A(e, n, t) {
|
|
115
|
-
const o = h(e.encounter), r = (e.hasMember ?? []).map((i) => h(i)).map((i) => i ? t.get(i) : void 0).filter((i) => !!i).map(
|
|
116
|
-
(i) => A(i, n, t)
|
|
117
|
-
);
|
|
118
|
-
return {
|
|
119
|
-
id: e.id,
|
|
120
|
-
display: e.code?.text ?? e.code?.coding?.[0]?.display ?? "",
|
|
121
|
-
observationValue: ie(e),
|
|
122
|
-
effectiveDateTime: e.effectiveDateTime,
|
|
123
|
-
issued: e.issued,
|
|
124
|
-
encounter: o ? ae(o, n) : void 0,
|
|
125
|
-
members: r.length > 0 ? r : void 0
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
function se(e) {
|
|
129
|
-
const n = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
|
|
130
|
-
e.entry?.forEach(({ resource: a }) => {
|
|
131
|
-
a?.id && (a.resourceType === "Encounter" ? n.set(a.id, a) : a.resourceType === "Observation" && (t.set(a.id, a), a.hasMember?.forEach((s) => {
|
|
132
|
-
const u = h(s);
|
|
133
|
-
u && o.add(u);
|
|
134
|
-
})));
|
|
135
|
-
});
|
|
136
|
-
const r = [], i = [];
|
|
137
|
-
return t.forEach((a, s) => {
|
|
138
|
-
if (o.has(s)) return;
|
|
139
|
-
const u = A(
|
|
140
|
-
a,
|
|
141
|
-
n,
|
|
142
|
-
t
|
|
143
|
-
);
|
|
144
|
-
u.members?.length ? i.push({ ...u, children: u.members }) : r.push(u);
|
|
145
|
-
}), { observations: r, groupedObservations: i };
|
|
146
|
-
}
|
|
147
|
-
function ue(e) {
|
|
148
|
-
const n = /* @__PURE__ */ new Map();
|
|
149
|
-
return e.observations.forEach((t) => {
|
|
150
|
-
if (!t.encounter?.id) return;
|
|
151
|
-
const o = t.encounter.id;
|
|
152
|
-
n.has(o) || n.set(o, {
|
|
153
|
-
observations: [],
|
|
154
|
-
groupedObservations: []
|
|
155
|
-
}), n.get(o).observations.push(t);
|
|
156
|
-
}), e.groupedObservations.forEach((t) => {
|
|
157
|
-
if (!t.encounter?.id) return;
|
|
158
|
-
const o = t.encounter.id;
|
|
159
|
-
n.has(o) || n.set(o, {
|
|
160
|
-
observations: [],
|
|
161
|
-
groupedObservations: []
|
|
162
|
-
}), n.get(o).groupedObservations.push(t);
|
|
163
|
-
}), Array.from(n.entries()).map(([t, o]) => {
|
|
164
|
-
const r = o.observations[0]?.encounter ?? o.groupedObservations[0]?.encounter;
|
|
165
|
-
return {
|
|
166
|
-
encounterId: t,
|
|
167
|
-
encounterDetails: r,
|
|
168
|
-
observations: o.observations,
|
|
169
|
-
groupedObservations: o.groupedObservations
|
|
170
|
-
};
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
function le(e) {
|
|
174
|
-
return [...e].sort((n, t) => {
|
|
175
|
-
const o = n.encounterDetails?.date, r = t.encounterDetails?.date;
|
|
176
|
-
return !o && !r ? 0 : o ? r ? new Date(r).getTime() - new Date(o).getTime() : -1 : 1;
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
const I = (e, n, t) => {
|
|
180
|
-
const o = re(e, n), r = o.value, i = K(r);
|
|
181
|
-
let a = r;
|
|
182
|
-
i === "Image" && (a = /* @__PURE__ */ c(H, { imageSrc: r, alt: r, id: `${r}-img` })), i === "Video" && (a = /* @__PURE__ */ c(J, { id: `${r}-video`, videoSrc: r }));
|
|
183
|
-
const s = t("OBSERVATIONS_RECORDED_BY", {
|
|
184
|
-
provider: o.provider
|
|
185
|
-
}), u = e.observationValue?.isAbnormal ? `abnormal-obs-${e.id}` : `obs-${e.id}`;
|
|
186
|
-
return /* @__PURE__ */ c(
|
|
187
|
-
X,
|
|
188
|
-
{
|
|
189
|
-
header: o.header,
|
|
190
|
-
value: a,
|
|
191
|
-
info: s,
|
|
192
|
-
id: u,
|
|
193
|
-
testId: `${u}-test-id`,
|
|
194
|
-
ariaLabel: `${u}-aria-label`
|
|
195
|
-
},
|
|
196
|
-
`obs-${e.id}`
|
|
197
|
-
);
|
|
198
|
-
}, de = (e, n, t) => /* @__PURE__ */ c(
|
|
199
|
-
_,
|
|
200
|
-
{
|
|
201
|
-
title: e.display,
|
|
202
|
-
id: `grouped-obs-${e.id}`,
|
|
203
|
-
open: t,
|
|
204
|
-
children: e.children.map(
|
|
205
|
-
(o, r) => I(o, r, n)
|
|
206
|
-
)
|
|
207
|
-
},
|
|
208
|
-
`grouped-obs-${e.id}`
|
|
209
|
-
), ce = ({
|
|
210
|
-
groupedData: e
|
|
211
|
-
}) => {
|
|
212
|
-
const { t: n } = T(), t = (o, r) => {
|
|
213
|
-
const i = ee(o.encounterDetails, n);
|
|
214
|
-
return /* @__PURE__ */ S(
|
|
215
|
-
_,
|
|
216
|
-
{
|
|
217
|
-
title: i,
|
|
218
|
-
id: `encounter-${o.encounterId}`,
|
|
219
|
-
open: r,
|
|
220
|
-
children: [
|
|
221
|
-
o.observations.map(
|
|
222
|
-
(a, s) => I(a, s, n)
|
|
223
|
-
),
|
|
224
|
-
o.groupedObservations.map(
|
|
225
|
-
(a) => de(a, n, r)
|
|
226
|
-
)
|
|
227
|
-
]
|
|
228
|
-
},
|
|
229
|
-
`encounter-${o.encounterId}`
|
|
230
|
-
);
|
|
231
|
-
};
|
|
232
|
-
return /* @__PURE__ */ c(
|
|
233
|
-
"div",
|
|
234
|
-
{
|
|
235
|
-
id: "obs-by-encounter",
|
|
236
|
-
"data-testid": "obs-by-encounter-test-id",
|
|
237
|
-
"aria-label": "obs-by-encounter-aria-label",
|
|
238
|
-
children: e.map(
|
|
239
|
-
(o, r) => t(o, r === 0)
|
|
240
|
-
)
|
|
241
|
-
}
|
|
242
|
-
);
|
|
243
|
-
}, ve = "_observations_kfbhq_1", pe = "_title_kfbhq_12", R = {
|
|
244
|
-
observations: ve,
|
|
245
|
-
title: pe
|
|
246
|
-
}, ge = (e) => ["conceptUuid", e], be = (e, n) => ["observations", e, ...n], ye = ({ config: e }) => {
|
|
247
|
-
const n = e, { conceptNames: t = [], conceptUuid: o = [] } = n, r = P(/* @__PURE__ */ new Set()), i = M(), { addNotification: a } = F(), { t: s } = T(), u = G({
|
|
248
|
-
queries: t.map((l) => ({
|
|
249
|
-
queryKey: ge(l),
|
|
250
|
-
queryFn: () => B(l),
|
|
251
|
-
enabled: !!l
|
|
252
|
-
}))
|
|
253
|
-
});
|
|
254
|
-
O(() => {
|
|
255
|
-
u.forEach((l, g) => {
|
|
256
|
-
if (l.isError && !r.current.has(g)) {
|
|
257
|
-
const L = t[g];
|
|
258
|
-
a({
|
|
259
|
-
title: s("ERROR_DEFAULT_TITLE"),
|
|
260
|
-
message: s("ERROR_FETCHING_CONCEPT", { conceptName: L }),
|
|
261
|
-
type: "error"
|
|
262
|
-
}), r.current.add(g);
|
|
263
|
-
} else l.isError || r.current.delete(g);
|
|
264
|
-
});
|
|
265
|
-
}, [u, t]);
|
|
266
|
-
const d = m(() => u.map((l) => l.data?.uuid).filter((l) => !!l), [u]), p = m(() => [.../* @__PURE__ */ new Set([...d, ...o])], [d, o]), v = m(() => t.length === 0 ? !0 : u.every((l) => !l.isLoading), [u, t.length]), {
|
|
267
|
-
data: b,
|
|
268
|
-
isLoading: D,
|
|
269
|
-
isError: f
|
|
270
|
-
} = Q({
|
|
271
|
-
queryKey: be(i, p),
|
|
272
|
-
queryFn: () => j(i, p),
|
|
273
|
-
enabled: !!i && p.length > 0 && v
|
|
274
|
-
});
|
|
275
|
-
O(() => {
|
|
276
|
-
f && a({
|
|
277
|
-
title: s("ERROR_DEFAULT_TITLE"),
|
|
278
|
-
message: s("ERROR_FETCHING_OBSERVATIONS"),
|
|
279
|
-
type: "error"
|
|
280
|
-
});
|
|
281
|
-
}, [f]);
|
|
282
|
-
const y = m(() => {
|
|
283
|
-
if (!b) return [];
|
|
284
|
-
const l = se(b), g = ue(l);
|
|
285
|
-
return le(g);
|
|
286
|
-
}, [b]), w = [
|
|
287
|
-
{ key: "name", header: "name" },
|
|
288
|
-
{ key: "value", header: "value" },
|
|
289
|
-
{ key: "form", header: "form" }
|
|
290
|
-
], $ = D || !v, E = f && v, N = (!b || b.entry?.length === 0 || p.length === 0) && v, C = E ? s("ERROR_FETCHING_OBSERVATIONS") : null, V = N ? s("NO_OBSERVATIONS_FOUND") : void 0, q = y.length > 0 && !$ && !E;
|
|
291
|
-
return /* @__PURE__ */ S(
|
|
292
|
-
"div",
|
|
293
|
-
{
|
|
294
|
-
id: "observations",
|
|
295
|
-
"data-testid": "observations-test-id",
|
|
296
|
-
"aria-label": "observations-aria-label",
|
|
297
|
-
className: R.observations,
|
|
298
|
-
children: [
|
|
299
|
-
/* @__PURE__ */ c(
|
|
300
|
-
U,
|
|
301
|
-
{
|
|
302
|
-
id: "observations-title",
|
|
303
|
-
testId: "observations-title-test-id",
|
|
304
|
-
title: s(n.titleTranslationKey),
|
|
305
|
-
className: R.title,
|
|
306
|
-
children: /* @__PURE__ */ c("p", { children: s(n.titleTranslationKey) })
|
|
307
|
-
}
|
|
308
|
-
),
|
|
309
|
-
q ? /* @__PURE__ */ c(ce, { groupedData: y }) : /* @__PURE__ */ c(
|
|
310
|
-
k,
|
|
311
|
-
{
|
|
312
|
-
headers: w,
|
|
313
|
-
rows: [],
|
|
314
|
-
ariaLabel: s("OBSERVATIONS"),
|
|
315
|
-
loading: $,
|
|
316
|
-
errorStateMessage: C,
|
|
317
|
-
emptyStateMessage: V
|
|
318
|
-
}
|
|
319
|
-
)
|
|
320
|
-
]
|
|
321
|
-
}
|
|
322
|
-
);
|
|
323
|
-
};
|
|
324
|
-
export {
|
|
325
|
-
ge as conceptUuidQueryKeys,
|
|
326
|
-
ye as default,
|
|
327
|
-
be as observationsQueryKeys
|
|
328
|
-
};
|