@bahmni/clinical-app 0.0.1-dev.111 → 0.0.1-dev.112
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/App.d.ts.map +1 -1
- package/dist/{FormsTable-_SaCdgPn-CIHogBsE.js → FormsTable-D_uTj2t_-DXySbczc.js} +39 -39
- package/dist/{LNWAZHJI-Bd-QE2uY.js → LNWAZHJI-BTHhevQt.js} +2 -2
- package/dist/{MWZ6AO7Z-f3gZE6ym.js → MWZ6AO7Z-ofNJBXWb.js} +2 -2
- package/dist/{Observations-DdD1GVgI-DQFa_iWz.js → Observations-BcmAe8sT-BXwjq1fy.js} +39 -39
- package/dist/{YPM2AS64-BBCBmCB4.js → YPM2AS64-CqvF70vT.js} +1 -1
- package/dist/components/consultationPad/ConsultationPad.d.ts.map +1 -1
- package/dist/components/forms/encounterDetails/EncounterDetails.d.ts +5 -1
- package/dist/components/forms/encounterDetails/EncounterDetails.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationForms.d.ts +3 -0
- package/dist/components/forms/observations/ObservationForms.d.ts.map +1 -1
- package/dist/components/patientHeader/ConsultationActionButton.d.ts.map +1 -1
- package/dist/hooks/useEncounterSession.d.ts +7 -1
- package/dist/hooks/useEncounterSession.d.ts.map +1 -1
- package/dist/hooks/usePinnedObservationForms.d.ts +8 -1
- package/dist/hooks/usePinnedObservationForms.d.ts.map +1 -1
- package/dist/{index-COAEscDN.js → index-CKC1_vgU.js} +18784 -18745
- package/dist/index.js +1 -1
- package/dist/services/pinnedFormsService.d.ts +4 -2
- package/dist/services/pinnedFormsService.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA8B,MAAM,OAAO,CAAC;AASnD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EA2CxB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as o, jsxs as p, Fragment as
|
|
2
|
-
import { u as Y, T as W, K as X, a as f, _ as Z,
|
|
1
|
+
import { jsx as o, jsxs as p, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { u as Y, T as W, K as X, a as f, _ as Z, O as ee, Q as I, b as re, c as ae, D as oe, C as ne, w as G, q as te, L as N, S as se, d as de, R as ie, e as me } from "./index-CKC1_vgU.js";
|
|
3
3
|
import { useState as x, useMemo as b, useCallback as g } from "react";
|
|
4
4
|
import { createPortal as le } from "react-dom";
|
|
5
|
-
const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", _e = "_formDetailsContainer_1pd36_25", be = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", ge = "_rowContainer_1pd36_43",
|
|
5
|
+
const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", _e = "_formDetailsContainer_1pd36_25", be = "_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", Le = "_memberRow_1pd36_81", Me = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Oe = "_abnormalValue_1pd36_102", Ce = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Te = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Fe = "_nestedGroupMembers_1pd36_141", r = {
|
|
6
6
|
formsTableBody: ce,
|
|
7
7
|
customAccordianItem: ue,
|
|
8
8
|
formContent: pe,
|
|
@@ -10,23 +10,23 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
10
10
|
observation: be,
|
|
11
11
|
groupContainer: fe,
|
|
12
12
|
rowContainer: ge,
|
|
13
|
-
groupLabel:
|
|
14
|
-
rowLabel:
|
|
13
|
+
groupLabel: Ne,
|
|
14
|
+
rowLabel: he,
|
|
15
15
|
rowValue: ye,
|
|
16
16
|
groupMembers: ve,
|
|
17
17
|
memberRow: Le,
|
|
18
18
|
memberLabel: Me,
|
|
19
19
|
memberValue: Ae,
|
|
20
20
|
abnormalValue: Oe,
|
|
21
|
-
commentSection:
|
|
22
|
-
commentText:
|
|
23
|
-
nestedGroup:
|
|
21
|
+
commentSection: Ce,
|
|
22
|
+
commentText: Re,
|
|
23
|
+
nestedGroup: Te,
|
|
24
24
|
nestedGroupLabel: De,
|
|
25
25
|
nestedGroupMembers: Fe
|
|
26
26
|
}, we = "ABNORMAL", U = (e) => {
|
|
27
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
28
|
return { units: i, rangeString: u, isAbnormal: t };
|
|
29
|
-
},
|
|
29
|
+
}, q = ({
|
|
30
30
|
member: e,
|
|
31
31
|
depth: i = 0
|
|
32
32
|
}) => {
|
|
@@ -42,7 +42,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
42
42
|
}
|
|
43
43
|
),
|
|
44
44
|
/* @__PURE__ */ o("div", { className: r.nestedGroupMembers, children: e.groupMembers?.map((t) => /* @__PURE__ */ o(
|
|
45
|
-
|
|
45
|
+
q,
|
|
46
46
|
{
|
|
47
47
|
member: t,
|
|
48
48
|
depth: i + 1
|
|
@@ -60,7 +60,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
60
60
|
/* @__PURE__ */ p(
|
|
61
61
|
"p",
|
|
62
62
|
{
|
|
63
|
-
className:
|
|
63
|
+
className: N(
|
|
64
64
|
r.memberLabel,
|
|
65
65
|
u ? r.abnormalValue : ""
|
|
66
66
|
),
|
|
@@ -73,7 +73,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
73
73
|
/* @__PURE__ */ p(
|
|
74
74
|
"p",
|
|
75
75
|
{
|
|
76
|
-
className:
|
|
76
|
+
className: N(
|
|
77
77
|
r.memberValue,
|
|
78
78
|
u ? r.abnormalValue : ""
|
|
79
79
|
),
|
|
@@ -86,7 +86,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
86
86
|
]
|
|
87
87
|
}
|
|
88
88
|
);
|
|
89
|
-
},
|
|
89
|
+
}, Se = ({
|
|
90
90
|
observation: e,
|
|
91
91
|
index: i
|
|
92
92
|
}) => {
|
|
@@ -104,7 +104,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
104
104
|
/* @__PURE__ */ p(
|
|
105
105
|
"p",
|
|
106
106
|
{
|
|
107
|
-
className:
|
|
107
|
+
className: N(
|
|
108
108
|
m ? r.groupLabel : r.rowLabel,
|
|
109
109
|
!m && c ? r.abnormalValue : ""
|
|
110
110
|
),
|
|
@@ -115,7 +115,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
115
115
|
}
|
|
116
116
|
),
|
|
117
117
|
m ? /* @__PURE__ */ o("div", { className: r.groupMembers, children: e.groupMembers?.map((u) => /* @__PURE__ */ o(
|
|
118
|
-
|
|
118
|
+
q,
|
|
119
119
|
{
|
|
120
120
|
member: u,
|
|
121
121
|
depth: 0
|
|
@@ -124,7 +124,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
124
124
|
)) }) : /* @__PURE__ */ p(
|
|
125
125
|
"p",
|
|
126
126
|
{
|
|
127
|
-
className:
|
|
127
|
+
className: N(
|
|
128
128
|
r.rowValue,
|
|
129
129
|
c ? r.abnormalValue : ""
|
|
130
130
|
),
|
|
@@ -150,31 +150,31 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
150
150
|
encounterUuids: i,
|
|
151
151
|
config: m
|
|
152
152
|
}) => {
|
|
153
|
-
const { t: a } = Y(), l = W(), [c, u] = x(!1), [t, M] = x(null),
|
|
153
|
+
const { t: a } = Y(), l = W(), [c, u] = x(!1), [t, M] = x(null), k = m?.numberOfVisits, A = X(
|
|
154
154
|
e,
|
|
155
155
|
i
|
|
156
156
|
), {
|
|
157
|
-
data:
|
|
157
|
+
data: h = [],
|
|
158
158
|
isLoading: O,
|
|
159
|
-
isError:
|
|
159
|
+
isError: C,
|
|
160
160
|
error: K
|
|
161
161
|
} = f({
|
|
162
162
|
queryKey: ["forms", l, e],
|
|
163
|
-
queryFn: () => se(l, void 0,
|
|
163
|
+
queryFn: () => se(l, void 0, k),
|
|
164
164
|
enabled: !!l && !A
|
|
165
|
-
}),
|
|
165
|
+
}), R = b(() => !i || i.length === 0 ? h : h.filter(
|
|
166
166
|
(n) => i.includes(n.encounterUuid)
|
|
167
|
-
), [
|
|
167
|
+
), [h, i]), { data: T = [] } = f({
|
|
168
168
|
queryKey: ["observationForms"],
|
|
169
169
|
queryFn: de
|
|
170
170
|
}), D = g(
|
|
171
|
-
(n) =>
|
|
172
|
-
[
|
|
171
|
+
(n) => T.find((s) => s.name === n)?.uuid,
|
|
172
|
+
[T]
|
|
173
173
|
), y = b(() => {
|
|
174
174
|
if (t)
|
|
175
175
|
return D(t.formName);
|
|
176
176
|
}, [t, D]), {
|
|
177
|
-
data:
|
|
177
|
+
data: Be,
|
|
178
178
|
isLoading: H,
|
|
179
179
|
error: F
|
|
180
180
|
} = f({
|
|
@@ -189,9 +189,9 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
189
189
|
queryKey: ["formsEncounter", t?.encounterUuid],
|
|
190
190
|
queryFn: () => me(t.encounterUuid, !0),
|
|
191
191
|
enabled: !!t?.encounterUuid && c
|
|
192
|
-
}),
|
|
192
|
+
}), S = b(() => !v?.observations || !t?.formName ? [] : v.observations.filter(
|
|
193
193
|
(n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(t.formName)
|
|
194
|
-
), [v?.observations, t?.formName]),
|
|
194
|
+
), [v?.observations, t?.formName]), B = b(
|
|
195
195
|
() => [
|
|
196
196
|
{ key: "recordedOn", header: a("FORM_RECORDED_ON") },
|
|
197
197
|
{ key: "recordedBy", header: a("FORM_RECORDED_BY") }
|
|
@@ -203,12 +203,12 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
203
203
|
{ key: "recordedBy", sortable: !0 }
|
|
204
204
|
],
|
|
205
205
|
[]
|
|
206
|
-
),
|
|
207
|
-
const n =
|
|
206
|
+
), E = b(() => {
|
|
207
|
+
const n = R.reduce(
|
|
208
208
|
(s, d) => {
|
|
209
209
|
const _ = d.formName;
|
|
210
210
|
s[_] ??= [];
|
|
211
|
-
const L = d.providers.map((
|
|
211
|
+
const L = d.providers.map((Q) => Q.providerName).filter(Boolean).join(", ");
|
|
212
212
|
return s[_].push({
|
|
213
213
|
id: d.encounterUuid,
|
|
214
214
|
formName: d.formName,
|
|
@@ -228,7 +228,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
228
228
|
)
|
|
229
229
|
})
|
|
230
230
|
).sort((s, d) => s.formName.localeCompare(d.formName));
|
|
231
|
-
}, [
|
|
231
|
+
}, [R, a]), V = g((n) => {
|
|
232
232
|
M(n), u(!0);
|
|
233
233
|
}, []), P = g(() => {
|
|
234
234
|
u(!1), M(null);
|
|
@@ -245,21 +245,21 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
245
245
|
},
|
|
246
246
|
[V]
|
|
247
247
|
);
|
|
248
|
-
return /* @__PURE__ */ p(
|
|
249
|
-
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: O ||
|
|
248
|
+
return /* @__PURE__ */ p(z, { children: [
|
|
249
|
+
/* @__PURE__ */ o("div", { "data-testid": "forms-table", children: O || C || E.length === 0 || A ? /* @__PURE__ */ o(
|
|
250
250
|
I,
|
|
251
251
|
{
|
|
252
|
-
headers:
|
|
252
|
+
headers: B,
|
|
253
253
|
ariaLabel: a("FORMS_HEADING"),
|
|
254
254
|
rows: [],
|
|
255
255
|
loading: O,
|
|
256
|
-
errorStateMessage:
|
|
256
|
+
errorStateMessage: C ? K?.message : void 0,
|
|
257
257
|
emptyStateMessage: a("FORMS_UNAVAILABLE"),
|
|
258
258
|
renderCell: $,
|
|
259
259
|
className: r.formsTableBody,
|
|
260
260
|
"data-testid": "sortable-data-table"
|
|
261
261
|
}
|
|
262
|
-
) : /* @__PURE__ */ o(re, { align: "start", children:
|
|
262
|
+
) : /* @__PURE__ */ o(re, { align: "start", children: E.map((n, s) => {
|
|
263
263
|
const { formName: d, records: _ } = n;
|
|
264
264
|
return /* @__PURE__ */ o(
|
|
265
265
|
ae,
|
|
@@ -271,7 +271,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
271
271
|
children: /* @__PURE__ */ o(
|
|
272
272
|
I,
|
|
273
273
|
{
|
|
274
|
-
headers:
|
|
274
|
+
headers: B,
|
|
275
275
|
ariaLabel: a("FORMS_HEADING"),
|
|
276
276
|
rows: _,
|
|
277
277
|
loading: !1,
|
|
@@ -299,8 +299,8 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
|
|
|
299
299
|
passiveModal: !0,
|
|
300
300
|
size: "md",
|
|
301
301
|
testId: "form-details-modal",
|
|
302
|
-
children: /* @__PURE__ */ o("div", { className: r.formContent, children: H || j ? /* @__PURE__ */ o(ne, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ o("div", { children: G(F).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ o("div", { children: G(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) :
|
|
303
|
-
|
|
302
|
+
children: /* @__PURE__ */ o("div", { className: r.formContent, children: H || j ? /* @__PURE__ */ o(ne, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ o("div", { children: G(F).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ o("div", { children: G(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : S.length > 0 ? /* @__PURE__ */ o("div", { className: r.formDetailsContainer, children: S.map((n, s) => /* @__PURE__ */ o(
|
|
303
|
+
Se,
|
|
304
304
|
{
|
|
305
305
|
observation: n,
|
|
306
306
|
index: s
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-
|
|
2
|
-
import {
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CqvF70vT.js";
|
|
2
|
+
import { H as d, I as f, J as e } from "./index-CKC1_vgU.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 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-CqvF70vT.js";
|
|
2
|
+
import { H as v, I as C, J as e } from "./index-CKC1_vgU.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as D, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { f as F, n as w, r as H, g as I, h as J, i as P, j as K, k as z, l as G, m as j, o as W, s as T, p as Q, t as X, v as Y, T as Z, x as ee, u as N, y as te, a as se, U as re, Q as ne, z as ie, A as M, B as oe, V as ae, E as ue, F as ce, G as le } from "./index-CKC1_vgU.js";
|
|
3
3
|
import * as R from "react";
|
|
4
|
-
import { useRef as de, useEffect as
|
|
4
|
+
import { useRef as de, useEffect as C, useMemo as S } from "react";
|
|
5
5
|
function _(e, t) {
|
|
6
6
|
const s = new Set(t);
|
|
7
7
|
return e.filter((r) => !s.has(r));
|
|
@@ -10,7 +10,7 @@ function he(e, t, s) {
|
|
|
10
10
|
const r = e.slice(0);
|
|
11
11
|
return r[t] = s, r;
|
|
12
12
|
}
|
|
13
|
-
var pe = class extends
|
|
13
|
+
var pe = class extends F {
|
|
14
14
|
#r;
|
|
15
15
|
#e;
|
|
16
16
|
#n;
|
|
@@ -96,7 +96,7 @@ var pe = class extends H {
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
#l(e, t) {
|
|
99
|
-
return t ? ((!this.#s || this.#e !== this.#a || t !== this.#o) && (this.#o = t, this.#a = this.#e, this.#s =
|
|
99
|
+
return t ? ((!this.#s || this.#e !== this.#a || t !== this.#o) && (this.#o = t, this.#a = this.#e, this.#s = H(
|
|
100
100
|
this.#s,
|
|
101
101
|
t(e)
|
|
102
102
|
)), this.#s) : e;
|
|
@@ -112,7 +112,7 @@ var pe = class extends H {
|
|
|
112
112
|
observer: o
|
|
113
113
|
}) : s.push({
|
|
114
114
|
defaultedQueryOptions: n,
|
|
115
|
-
observer: new
|
|
115
|
+
observer: new I(this.#r, n)
|
|
116
116
|
});
|
|
117
117
|
}), s;
|
|
118
118
|
}
|
|
@@ -175,16 +175,16 @@ function fe({
|
|
|
175
175
|
) ? u.flatMap((c, h) => {
|
|
176
176
|
const d = a[h];
|
|
177
177
|
if (d) {
|
|
178
|
-
const O = new
|
|
178
|
+
const O = new I(r, d);
|
|
179
179
|
if (T(d, c))
|
|
180
|
-
return
|
|
181
|
-
X(c, n) &&
|
|
180
|
+
return Q(d, O, o);
|
|
181
|
+
X(c, n) && Q(d, O, o);
|
|
182
182
|
}
|
|
183
183
|
return [];
|
|
184
184
|
}) : [];
|
|
185
185
|
if (E.length > 0)
|
|
186
186
|
throw Promise.all(E);
|
|
187
|
-
const
|
|
187
|
+
const m = u.find(
|
|
188
188
|
(c, h) => {
|
|
189
189
|
const d = a[h];
|
|
190
190
|
return d && Y({
|
|
@@ -196,11 +196,11 @@ function fe({
|
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
);
|
|
199
|
-
if (
|
|
200
|
-
throw
|
|
199
|
+
if (m?.error)
|
|
200
|
+
throw m.error;
|
|
201
201
|
return f(v());
|
|
202
202
|
}
|
|
203
|
-
const be = "normal", ve = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ge = "A",
|
|
203
|
+
const be = "normal", ve = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ge = "A", me = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ye = (e, t) => e?.date ? ie(e.date, t).formattedResult : t("DATE_ERROR_PARSE"), Oe = (e) => {
|
|
204
204
|
const { value: t, unit: s } = e.observationValue;
|
|
205
205
|
return s ? `${t} ${s}` : String(t);
|
|
206
206
|
}, Re = (e) => {
|
|
@@ -230,7 +230,7 @@ const be = "normal", ve = "http://terminology.hl7.org/CodeSystem/referencerange-
|
|
|
230
230
|
function Se(e) {
|
|
231
231
|
return !e.interpretation || e.interpretation.length === 0 ? !1 : e.interpretation.some(
|
|
232
232
|
(t) => t.coding?.some(
|
|
233
|
-
(s) => s.system ===
|
|
233
|
+
(s) => s.system === me && s.code === ge
|
|
234
234
|
)
|
|
235
235
|
);
|
|
236
236
|
}
|
|
@@ -319,7 +319,7 @@ function Te(e) {
|
|
|
319
319
|
u.members?.length ? o.push({ ...u, children: u.members }) : n.push(u);
|
|
320
320
|
}), { observations: n, groupedObservations: o };
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function Qe(e) {
|
|
323
323
|
const t = /* @__PURE__ */ new Map();
|
|
324
324
|
return e.observations.forEach((s) => {
|
|
325
325
|
if (!s.encounter?.id) return;
|
|
@@ -345,7 +345,7 @@ function Ce(e) {
|
|
|
345
345
|
};
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function Ce(e) {
|
|
349
349
|
return [...e].sort((t, s) => {
|
|
350
350
|
const r = t.encounterDetails?.date, n = s.encounterDetails?.date;
|
|
351
351
|
return !r && !n ? 0 : r ? n ? new Date(n).getTime() - new Date(r).getTime() : -1 : 1;
|
|
@@ -385,8 +385,8 @@ const k = (e, t, s) => {
|
|
|
385
385
|
groupedData: e
|
|
386
386
|
}) => {
|
|
387
387
|
const { t } = N(), s = (r, n) => {
|
|
388
|
-
const o =
|
|
389
|
-
return /* @__PURE__ */
|
|
388
|
+
const o = ye(r.encounterDetails, t);
|
|
389
|
+
return /* @__PURE__ */ D(
|
|
390
390
|
M,
|
|
391
391
|
{
|
|
392
392
|
title: o,
|
|
@@ -415,10 +415,10 @@ const k = (e, t, s) => {
|
|
|
415
415
|
)
|
|
416
416
|
}
|
|
417
417
|
);
|
|
418
|
-
},
|
|
419
|
-
observations:
|
|
420
|
-
title:
|
|
421
|
-
}, Ne = (e) => ["conceptUuid", e], Me = (e, t) => ["observations", e, ...t],
|
|
418
|
+
}, De = "_observations_kfbhq_1", Ie = "_title_kfbhq_12", A = {
|
|
419
|
+
observations: De,
|
|
420
|
+
title: Ie
|
|
421
|
+
}, Ne = (e) => ["conceptUuid", e], Me = (e, t) => ["observations", e, ...t], Ve = ({ config: e }) => {
|
|
422
422
|
const t = e, { conceptNames: s = [], conceptUuid: r = [] } = t, n = de(/* @__PURE__ */ new Set()), o = Z(), { addNotification: a } = ee(), { t: i } = N(), u = fe({
|
|
423
423
|
queries: s.map((l) => ({
|
|
424
424
|
queryKey: Ne(l),
|
|
@@ -426,44 +426,44 @@ const k = (e, t, s) => {
|
|
|
426
426
|
enabled: !!l
|
|
427
427
|
}))
|
|
428
428
|
});
|
|
429
|
-
|
|
430
|
-
u.forEach((l,
|
|
431
|
-
if (l.isError && !n.current.has(
|
|
432
|
-
const U = s[
|
|
429
|
+
C(() => {
|
|
430
|
+
u.forEach((l, y) => {
|
|
431
|
+
if (l.isError && !n.current.has(y)) {
|
|
432
|
+
const U = s[y];
|
|
433
433
|
a({
|
|
434
434
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
435
435
|
message: i("ERROR_FETCHING_CONCEPT", { conceptName: U }),
|
|
436
436
|
type: "error"
|
|
437
|
-
}), n.current.add(
|
|
438
|
-
} else l.isError || n.current.delete(
|
|
437
|
+
}), n.current.add(y);
|
|
438
|
+
} else l.isError || n.current.delete(y);
|
|
439
439
|
});
|
|
440
440
|
}, [u, s]);
|
|
441
441
|
const f = S(() => u.map((l) => l.data?.uuid).filter((l) => !!l), [u]), v = S(() => [.../* @__PURE__ */ new Set([...f, ...r])], [f, r]), b = S(() => s.length === 0 ? !0 : u.every((l) => !l.isLoading), [u, s.length]), {
|
|
442
442
|
data: g,
|
|
443
443
|
isLoading: E,
|
|
444
|
-
isError:
|
|
444
|
+
isError: m
|
|
445
445
|
} = se({
|
|
446
446
|
queryKey: Me(o, v),
|
|
447
447
|
queryFn: () => le(o, v),
|
|
448
448
|
enabled: !!o && v.length > 0 && b
|
|
449
449
|
});
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
C(() => {
|
|
451
|
+
m && a({
|
|
452
452
|
title: i("ERROR_DEFAULT_TITLE"),
|
|
453
453
|
message: i("ERROR_FETCHING_OBSERVATIONS"),
|
|
454
454
|
type: "error"
|
|
455
455
|
});
|
|
456
|
-
}, [
|
|
456
|
+
}, [m]);
|
|
457
457
|
const c = S(() => {
|
|
458
458
|
if (!g) return [];
|
|
459
|
-
const l = Te(g),
|
|
460
|
-
return
|
|
459
|
+
const l = Te(g), y = Qe(l);
|
|
460
|
+
return Ce(y);
|
|
461
461
|
}, [g]), h = [
|
|
462
462
|
{ key: "name", header: "name" },
|
|
463
463
|
{ key: "value", header: "value" },
|
|
464
464
|
{ key: "form", header: "form" }
|
|
465
|
-
], d = E || !b, O =
|
|
466
|
-
return /* @__PURE__ */
|
|
465
|
+
], d = E || !b, O = m && b, x = (!g || g.entry?.length === 0 || v.length === 0) && b, V = O ? i("ERROR_FETCHING_OBSERVATIONS") : null, L = x ? i("NO_OBSERVATIONS_FOUND") : void 0, B = c.length > 0 && !d && !O;
|
|
466
|
+
return /* @__PURE__ */ D(
|
|
467
467
|
"div",
|
|
468
468
|
{
|
|
469
469
|
id: "observations",
|
|
@@ -488,8 +488,8 @@ const k = (e, t, s) => {
|
|
|
488
488
|
rows: [],
|
|
489
489
|
ariaLabel: i("OBSERVATIONS"),
|
|
490
490
|
loading: d,
|
|
491
|
-
errorStateMessage:
|
|
492
|
-
emptyStateMessage:
|
|
491
|
+
errorStateMessage: V,
|
|
492
|
+
emptyStateMessage: L
|
|
493
493
|
}
|
|
494
494
|
)
|
|
495
495
|
]
|
|
@@ -498,6 +498,6 @@ const k = (e, t, s) => {
|
|
|
498
498
|
};
|
|
499
499
|
export {
|
|
500
500
|
Ne as conceptUuidQueryKeys,
|
|
501
|
-
|
|
501
|
+
Ve as default,
|
|
502
502
|
Me as observationsQueryKeys
|
|
503
503
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as we, N as z, P as xt, W as B, I as q, J as y, X as Ro, Y as ye, Z as R, $ as _, a0 as k, a1 as N, a2 as A, a3 as bs, a4 as ir, a5 as $e, a6 as U, a7 as Hn, a8 as Vn, a9 as dt, aa as D, ab as xs, ac as cn, ad as Be, ae as ws, af as qt, ag as zt, ah as $s, ai as Cs, aj as $n, ak as Ss, al as Nr, am as Bt, an as zo, ao as ks, ap as Es, aq as j, ar as Ur, as as Ms, at as Ds, au as sr, av as As, aw as Ts, ax as zn, ay as Fs, az as Is, aA as Z, aB as Ps, aC as Ls } from "./index-CKC1_vgU.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsultationPad.d.ts","sourceRoot":"","sources":["../../../src/components/consultationPad/ConsultationPad.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAoB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConsultationPad.d.ts","sourceRoot":"","sources":["../../../src/components/consultationPad/ConsultationPad.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAoB,MAAM,OAAO,CAAC;AA0CzC,UAAU,oBAAoB;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAwanD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { ActivePractitionerContextType } from '@bahmni/widgets';
|
|
1
2
|
import { default as React } from 'react';
|
|
2
|
-
declare const _default: React.NamedExoticComponent<{
|
|
3
|
+
declare const _default: React.NamedExoticComponent<{
|
|
4
|
+
/** Pre-fetched practitioner state to avoid redundant API calls */
|
|
5
|
+
practitionerState: ActivePractitionerContextType;
|
|
6
|
+
}>;
|
|
3
7
|
export default _default;
|
|
4
8
|
//# sourceMappingURL=EncounterDetails.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EncounterDetails.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/encounterDetails/EncounterDetails.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EncounterDetails.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/encounterDetails/EncounterDetails.tsx"],"names":[],"mappings":"AAcA,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAA6B,MAAM,OAAO,CAAC;;IAahD,kEAAkE;uBAC/C,6BAA6B;;AA+UlD,wBAA4C"}
|
|
@@ -7,6 +7,9 @@ interface ObservationFormsProps {
|
|
|
7
7
|
pinnedForms: ObservationForm[];
|
|
8
8
|
updatePinnedForms: (newPinnedForms: ObservationForm[]) => Promise<void>;
|
|
9
9
|
isPinnedFormsLoading: boolean;
|
|
10
|
+
allForms: ObservationForm[];
|
|
11
|
+
isAllFormsLoading: boolean;
|
|
12
|
+
observationFormsError: Error | null;
|
|
10
13
|
}
|
|
11
14
|
/**
|
|
12
15
|
* ObservationForms component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservationForms.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/observations/ObservationForms.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAyC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ObservationForms.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/observations/ObservationForms.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAyC,MAAM,OAAO,CAAC;AAW9D,UAAU,qBAAqB;IAC7B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,eAAe,EAAE,CAAC;IAClC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAE1C,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,iBAAiB,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,oBAAoB,EAAE,OAAO,CAAC;IAE9B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,KAAK,GAAG,IAAI,CAAC;CACrC;AAED;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAqRrD,CAAC;AAIF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsultationActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/patientHeader/ConsultationActionButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsultationActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/patientHeader/ConsultationActionButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,6BAA6B;IACrC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACvE;AAED;;;;;;GAMG;AACH,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAwBrE,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { Provider } from '@bahmni/services';
|
|
1
2
|
import { Encounter } from 'fhir/r4';
|
|
3
|
+
interface UseEncounterSessionOptions {
|
|
4
|
+
/** The practitioner to use for session filtering */
|
|
5
|
+
practitioner: Provider | null;
|
|
6
|
+
}
|
|
2
7
|
interface UseEncounterSessionReturn {
|
|
3
8
|
hasActiveSession: boolean;
|
|
4
9
|
activeEncounter: Encounter | null;
|
|
@@ -11,8 +16,9 @@ interface UseEncounterSessionReturn {
|
|
|
11
16
|
/**
|
|
12
17
|
* Hook to manage encounter session state
|
|
13
18
|
* Determines if there's an active encounter session for the current patient
|
|
19
|
+
* @param options - Options containing the practitioner to use for session filtering
|
|
14
20
|
* @returns Object containing session state and utilities
|
|
15
21
|
*/
|
|
16
|
-
export declare function useEncounterSession(): UseEncounterSessionReturn;
|
|
22
|
+
export declare function useEncounterSession(options: UseEncounterSessionOptions): UseEncounterSessionReturn;
|
|
17
23
|
export {};
|
|
18
24
|
//# sourceMappingURL=useEncounterSession.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEncounterSession.d.ts","sourceRoot":"","sources":["../../src/hooks/useEncounterSession.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useEncounterSession.d.ts","sourceRoot":"","sources":["../../src/hooks/useEncounterSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,UAAU,0BAA0B;IAClC,oDAAoD;IACpD,YAAY,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC/B;AAED,UAAU,yBAAyB;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;;;;GAKG;AAEH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,GAClC,yBAAyB,CAyF3B"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { ObservationForm } from '@bahmni/services';
|
|
2
|
-
|
|
2
|
+
interface UsePinnedObservationFormsOptions {
|
|
3
|
+
/** User UUID required for loading and saving pinned forms */
|
|
4
|
+
userUuid?: string | null;
|
|
5
|
+
/** Whether available forms are currently loading */
|
|
6
|
+
isFormsLoading?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function usePinnedObservationForms(availableForms: ObservationForm[], options?: UsePinnedObservationFormsOptions): {
|
|
3
9
|
pinnedForms: ObservationForm[];
|
|
4
10
|
updatePinnedForms: (newPinnedForms: ObservationForm[]) => Promise<void>;
|
|
5
11
|
isLoading: boolean;
|
|
@@ -8,4 +14,5 @@ export declare function usePinnedObservationForms(): {
|
|
|
8
14
|
message: string;
|
|
9
15
|
} | null;
|
|
10
16
|
};
|
|
17
|
+
export {};
|
|
11
18
|
//# sourceMappingURL=usePinnedObservationForms.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePinnedObservationForms.d.ts","sourceRoot":"","sources":["../../src/hooks/usePinnedObservationForms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"usePinnedObservationForms.d.ts","sourceRoot":"","sources":["../../src/hooks/usePinnedObservationForms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAOtE,UAAU,gCAAgC;IACxC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,oDAAoD;IACpD,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AACD,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,eAAe,EAAE,EACjC,OAAO,CAAC,EAAE,gCAAgC;;wCAgFjB,eAAe,EAAE;;;eA3EE,MAAM;iBAAW,MAAM;;EA0GpE"}
|