@bahmni/widgets 0.0.1-dev.310 → 0.0.1-dev.312
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/{DocumentsTable-GbqzPQ80.js → DocumentsTable-CQX3VBx9.js} +3 -3
- package/dist/{FormsTable-FqoT_KVW.js → FormsTable-CTCi2T2q.js} +42 -42
- package/dist/{Observations-B01vmnHA.js → Observations-CkBi-I0o.js} +19 -19
- package/dist/commandPalette/CommandPalette.d.ts +3 -0
- package/dist/commandPalette/CommandPalette.d.ts.map +1 -0
- package/dist/commandPalette/CommandPaletteContext.d.ts +12 -0
- package/dist/commandPalette/CommandPaletteContext.d.ts.map +1 -0
- package/dist/commandPalette/CommandPaletteProvider.d.ts +13 -0
- package/dist/commandPalette/CommandPaletteProvider.d.ts.map +1 -0
- package/dist/commandPalette/PatientCommandItem.d.ts +12 -0
- package/dist/commandPalette/PatientCommandItem.d.ts.map +1 -0
- package/dist/commandPalette/index.d.ts +5 -0
- package/dist/commandPalette/index.d.ts.map +1 -0
- package/dist/commandPalette/models.d.ts +40 -0
- package/dist/commandPalette/models.d.ts.map +1 -0
- package/dist/commandPalette/useCommandPalette.d.ts +3 -0
- package/dist/commandPalette/useCommandPalette.d.ts.map +1 -0
- package/dist/commandPalette/useCommandPaletteKeyboard.d.ts +3 -0
- package/dist/commandPalette/useCommandPaletteKeyboard.d.ts.map +1 -0
- package/dist/commandPalette/useCommandPaletteSearch.d.ts +10 -0
- package/dist/commandPalette/useCommandPaletteSearch.d.ts.map +1 -0
- package/dist/commandPalette/useDebounce.d.ts +2 -0
- package/dist/commandPalette/useDebounce.d.ts.map +1 -0
- package/dist/commandPalette/utils.d.ts +24 -0
- package/dist/commandPalette/utils.d.ts.map +1 -0
- package/dist/genericServiceRequest/GenericServiceRequestTable.d.ts.map +1 -1
- package/dist/genericServiceRequest/__tests__/__mocks__/serviceRequestMocks.d.ts +15 -0
- package/dist/genericServiceRequest/__tests__/__mocks__/serviceRequestMocks.d.ts.map +1 -0
- package/dist/{index-CDaZ5sPl.js → index-CvF-qMtP.js} +40160 -35017
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -39
- package/dist/registry/widgetMap.d.ts.map +1 -1
- package/dist/tasks/TaskList.d.ts +9 -0
- package/dist/tasks/TaskList.d.ts.map +1 -0
- package/dist/tasks/__tests__/__mocks__/taskListMocks.d.ts +16 -0
- package/dist/tasks/__tests__/__mocks__/taskListMocks.d.ts.map +1 -0
- package/dist/tasks/index.d.ts +2 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/models.d.ts +28 -0
- package/dist/tasks/models.d.ts.map +1 -0
- package/package.json +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as T, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { u as W, a as Z,
|
|
2
|
+
import { u as W, a as Z, S as X, Z as J, $ as x, j as ee, P as te } from "./index-CvF-qMtP.js";
|
|
3
3
|
import { useQuery as ne } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
|
|
5
5
|
import { useTranslation as ae } from "react-i18next";
|
|
@@ -39,7 +39,7 @@ const Te = [
|
|
|
39
39
|
null
|
|
40
40
|
), [F, A] = l(
|
|
41
41
|
/* @__PURE__ */ new Set()
|
|
42
|
-
), f = W(), { t: o } = ae(), { addNotification: w } = Z(),
|
|
42
|
+
), f = W(), { t: o } = ae(), { addNotification: w } = Z(), $ = Number(n?.pageSize) || 5, [N, C] = l(1), [u, V] = l($), [k, O] = l(void 0), v = _((e) => {
|
|
43
43
|
U(e), L(!0);
|
|
44
44
|
}, []), H = _(() => {
|
|
45
45
|
L(!1), U(null), A(/* @__PURE__ */ new Set());
|
|
@@ -92,7 +92,7 @@ const Te = [
|
|
|
92
92
|
}, [d, s]);
|
|
93
93
|
const j = _(
|
|
94
94
|
(e, t) => {
|
|
95
|
-
t !== u ? (
|
|
95
|
+
t !== u ? (V(t), C(1), O(void 0)) : C(e);
|
|
96
96
|
},
|
|
97
97
|
[u]
|
|
98
98
|
), D = p(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i, jsxs as te, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useQueryClient as ge, useQuery as
|
|
4
|
-
import { useState as
|
|
2
|
+
import { X as se, u as ae, H as ne, s as de, r as ie, n as ce, F as le, w as me, M as k, $ as ue, Z as fe, j as x, T as ye, R as pe, P as be, O as he } from "./index-CvF-qMtP.js";
|
|
3
|
+
import { useQueryClient as ge, useQuery as b } from "@tanstack/react-query";
|
|
4
|
+
import { useState as H, useMemo as d, useCallback as h } from "react";
|
|
5
5
|
import { useTranslation as Fe } from "react-i18next";
|
|
6
6
|
const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", v = {
|
|
7
7
|
formsTableBody: Ne,
|
|
@@ -13,31 +13,31 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
13
13
|
encounterUuids: c,
|
|
14
14
|
config: g
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: n } = Fe(), u = ae(), [y, M] =
|
|
17
|
-
numberOfVisits:
|
|
18
|
-
hideThumbnail:
|
|
19
|
-
forms:
|
|
20
|
-
} = g ?? {},
|
|
16
|
+
const { t: n } = Fe(), u = ae(), [y, M] = H(!1), [a, I] = H(null), {
|
|
17
|
+
numberOfVisits: P,
|
|
18
|
+
hideThumbnail: j = !1,
|
|
19
|
+
forms: p
|
|
20
|
+
} = g ?? {}, A = ne(
|
|
21
21
|
m,
|
|
22
22
|
c
|
|
23
|
-
),
|
|
23
|
+
), w = ge(), {
|
|
24
24
|
data: D = [],
|
|
25
25
|
isLoading: T,
|
|
26
26
|
isError: B,
|
|
27
|
-
error:
|
|
27
|
+
error: $,
|
|
28
28
|
refetch: K
|
|
29
|
-
} =
|
|
29
|
+
} = b({
|
|
30
30
|
queryKey: ["forms", u, m],
|
|
31
|
-
queryFn: () => de(u, void 0,
|
|
32
|
-
enabled: !!u && !
|
|
31
|
+
queryFn: () => de(u, void 0, P),
|
|
32
|
+
enabled: !!u && !A
|
|
33
33
|
}), R = d(() => {
|
|
34
34
|
let e = D;
|
|
35
35
|
return c && c.length > 0 && (e = e.filter(
|
|
36
36
|
(t) => c.includes(t.encounterUuid)
|
|
37
|
-
)), Array.isArray(
|
|
38
|
-
(t) =>
|
|
37
|
+
)), Array.isArray(p) && p.length > 0 && (e = e.filter(
|
|
38
|
+
(t) => p.some((r) => r.toLowerCase() === t.formName.toLowerCase())
|
|
39
39
|
)), e;
|
|
40
|
-
}, [D, c,
|
|
40
|
+
}, [D, c, p]), { data: _ = [] } = b({
|
|
41
41
|
queryKey: ["observationForms"],
|
|
42
42
|
queryFn: () => ie()
|
|
43
43
|
}), L = h(
|
|
@@ -48,33 +48,33 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
48
48
|
return L(a.formName);
|
|
49
49
|
}, [a, L]), {
|
|
50
50
|
data: l,
|
|
51
|
-
isLoading:
|
|
52
|
-
isError:
|
|
51
|
+
isLoading: V,
|
|
52
|
+
isError: z,
|
|
53
53
|
error: N
|
|
54
|
-
} =
|
|
54
|
+
} = b({
|
|
55
55
|
queryKey: ["formMetadata", F],
|
|
56
56
|
queryFn: () => ce(F),
|
|
57
57
|
enabled: !!F && y
|
|
58
58
|
}), {
|
|
59
59
|
data: O,
|
|
60
|
-
isLoading:
|
|
61
|
-
isError:
|
|
60
|
+
isLoading: G,
|
|
61
|
+
isError: Q,
|
|
62
62
|
error: E
|
|
63
|
-
} =
|
|
63
|
+
} = b({
|
|
64
64
|
queryKey: ["formsEncounterFHIR", a?.encounterUuid],
|
|
65
65
|
queryFn: () => le(a.encounterUuid),
|
|
66
66
|
enabled: !!a?.encounterUuid && y
|
|
67
67
|
});
|
|
68
68
|
me(
|
|
69
69
|
(e) => {
|
|
70
|
-
e.patientUUID === u && e.updatedConcepts.size > 0 && (K(),
|
|
70
|
+
e.patientUUID === u && e.updatedConcepts.size > 0 && (K(), w.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
71
71
|
},
|
|
72
72
|
[u]
|
|
73
73
|
);
|
|
74
|
-
const
|
|
74
|
+
const X = d(() => !O?.entry || !a?.formName ? [] : O.entry.filter((t) => t.resource?.resourceType === "Observation").map((t) => t.resource).filter((t) => {
|
|
75
75
|
const r = Ee(t);
|
|
76
76
|
return !r || r.includes(a.formName);
|
|
77
|
-
}), [O, a?.formName]),
|
|
77
|
+
}), [O, a?.formName]), Z = d(() => {
|
|
78
78
|
if (!l?.schema) return;
|
|
79
79
|
const e = [], t = (r) => {
|
|
80
80
|
(r ?? []).forEach((o) => {
|
|
@@ -85,7 +85,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
85
85
|
return t(
|
|
86
86
|
l.schema.controls ?? []
|
|
87
87
|
), e.length > 0 ? e : void 0;
|
|
88
|
-
}, [l]),
|
|
88
|
+
}, [l]), Y = d(() => {
|
|
89
89
|
if (!l?.schema) return;
|
|
90
90
|
const e = {}, t = (r, o) => {
|
|
91
91
|
for (const s of r)
|
|
@@ -99,7 +99,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
99
99
|
l.schema.controls ?? [],
|
|
100
100
|
null
|
|
101
101
|
), Object.keys(e).length > 0 ? e : void 0;
|
|
102
|
-
}, [l]),
|
|
102
|
+
}, [l]), J = d(() => {
|
|
103
103
|
if (N)
|
|
104
104
|
return k(N).message;
|
|
105
105
|
if (E)
|
|
@@ -110,7 +110,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
110
110
|
{ key: "recordedBy", header: n("RECORDED_BY") }
|
|
111
111
|
],
|
|
112
112
|
[n]
|
|
113
|
-
),
|
|
113
|
+
), W = d(
|
|
114
114
|
() => [
|
|
115
115
|
{ key: "recordedOn", sortable: !0 },
|
|
116
116
|
{ key: "recordedBy", sortable: !0 }
|
|
@@ -142,9 +142,9 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
142
142
|
})
|
|
143
143
|
).sort((r, o) => r.formName.localeCompare(o.formName));
|
|
144
144
|
}, [R, n]), q = h((e) => {
|
|
145
|
-
|
|
145
|
+
I(e), M(!0);
|
|
146
146
|
}, []), ee = h(() => {
|
|
147
|
-
M(!1),
|
|
147
|
+
M(!1), I(null);
|
|
148
148
|
}, []), U = h(
|
|
149
149
|
(e, t) => {
|
|
150
150
|
switch (t) {
|
|
@@ -159,14 +159,14 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
159
159
|
[q]
|
|
160
160
|
);
|
|
161
161
|
return /* @__PURE__ */ te(oe, { children: [
|
|
162
|
-
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: T || B || S.length === 0 ||
|
|
162
|
+
/* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: T || B || S.length === 0 || A ? /* @__PURE__ */ i(
|
|
163
163
|
x,
|
|
164
164
|
{
|
|
165
165
|
headers: C,
|
|
166
166
|
ariaLabel: n("FORMS_HEADING"),
|
|
167
167
|
rows: [],
|
|
168
168
|
loading: T,
|
|
169
|
-
errorStateMessage: B ?
|
|
169
|
+
errorStateMessage: B ? $?.message : void 0,
|
|
170
170
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
171
171
|
renderCell: U,
|
|
172
172
|
className: v.formsTableBody,
|
|
@@ -175,7 +175,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
175
175
|
) : /* @__PURE__ */ i(ye, { align: "start", children: S.map((e, t) => {
|
|
176
176
|
const { formName: r, records: o } = e;
|
|
177
177
|
return /* @__PURE__ */ i(
|
|
178
|
-
|
|
178
|
+
pe,
|
|
179
179
|
{
|
|
180
180
|
title: r,
|
|
181
181
|
className: v.customAccordianItem,
|
|
@@ -189,7 +189,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
189
189
|
rows: o,
|
|
190
190
|
loading: !1,
|
|
191
191
|
errorStateMessage: "",
|
|
192
|
-
sortable:
|
|
192
|
+
sortable: W,
|
|
193
193
|
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
194
194
|
renderCell: U,
|
|
195
195
|
className: v.formsTableBody,
|
|
@@ -201,7 +201,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
201
201
|
);
|
|
202
202
|
}) }) }),
|
|
203
203
|
y && a && /* @__PURE__ */ i(
|
|
204
|
-
|
|
204
|
+
be,
|
|
205
205
|
{
|
|
206
206
|
id: "modalIdForActionAreaLayout",
|
|
207
207
|
portalId: "main-display-area",
|
|
@@ -215,15 +215,15 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
|
|
|
215
215
|
children: /* @__PURE__ */ i(
|
|
216
216
|
he,
|
|
217
217
|
{
|
|
218
|
-
observations:
|
|
219
|
-
isLoading:
|
|
220
|
-
isError:
|
|
221
|
-
errorMessage:
|
|
218
|
+
observations: X,
|
|
219
|
+
isLoading: V || G,
|
|
220
|
+
isError: z || Q,
|
|
221
|
+
errorMessage: J,
|
|
222
222
|
emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
|
|
223
223
|
testIdPrefix: a.formName,
|
|
224
|
-
hideThumbnail:
|
|
225
|
-
controlOrder:
|
|
226
|
-
sectionMap:
|
|
224
|
+
hideThumbnail: j,
|
|
225
|
+
controlOrder: Z,
|
|
226
|
+
sectionMap: Y
|
|
227
227
|
}
|
|
228
228
|
)
|
|
229
229
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as d, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import { f as
|
|
2
|
+
import { f as Q, J as D, t as H, b as K, c as V, d as k, e as j, Q as q, u as G, a as P, g as J, L as z, w as X, h as Y, i as W, k as Z, o as x, j as ee } from "./index-CvF-qMtP.js";
|
|
3
3
|
import { useQueries as te, useQuery as se } from "@tanstack/react-query";
|
|
4
|
-
import { useRef as oe, useEffect as
|
|
4
|
+
import { useRef as oe, useEffect as S, useMemo as g } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
6
|
const F = (t, i, c, l, u, r) => {
|
|
7
|
-
const s =
|
|
7
|
+
const s = H(t, i, u), o = s.value, a = K(o);
|
|
8
8
|
let n = o;
|
|
9
9
|
a === "Image" && (n = /* @__PURE__ */ d(
|
|
10
10
|
k,
|
|
@@ -15,18 +15,18 @@ const F = (t, i, c, l, u, r) => {
|
|
|
15
15
|
hideThumbnail: r
|
|
16
16
|
}
|
|
17
17
|
)), a === "Video" && (n = /* @__PURE__ */ d(
|
|
18
|
-
|
|
18
|
+
j,
|
|
19
19
|
{
|
|
20
20
|
id: `${o}-video`,
|
|
21
21
|
videoSrc: o,
|
|
22
22
|
hideThumbnail: r
|
|
23
23
|
}
|
|
24
|
-
)), a === "PDF" && (n = /* @__PURE__ */ d(
|
|
24
|
+
)), a === "PDF" && (n = /* @__PURE__ */ d(q, { id: `${o}-pdf`, src: o }));
|
|
25
25
|
const b = u("OBSERVATIONS_RECORDED_BY", {
|
|
26
26
|
provider: s.provider
|
|
27
27
|
}), p = t.display, m = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", y = l ? `${l}-${m}-${p}-${c}-${i}` : `${m}-${p}-${c}-${i}`;
|
|
28
28
|
return /* @__PURE__ */ d(
|
|
29
|
-
|
|
29
|
+
V,
|
|
30
30
|
{
|
|
31
31
|
header: s.header,
|
|
32
32
|
value: n,
|
|
@@ -61,7 +61,7 @@ const F = (t, i, c, l, u, r) => {
|
|
|
61
61
|
hideThumbnail: c
|
|
62
62
|
}) => {
|
|
63
63
|
const { t: l } = U(), u = (r, s, o) => {
|
|
64
|
-
const a =
|
|
64
|
+
const a = Q(r.encounterDetails, l);
|
|
65
65
|
return /* @__PURE__ */ N(
|
|
66
66
|
D,
|
|
67
67
|
{
|
|
@@ -106,7 +106,7 @@ const F = (t, i, c, l, u, r) => {
|
|
|
106
106
|
)
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
|
-
}, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z",
|
|
109
|
+
}, ne = "Observations-module_observations__RKSyo", ie = "Observations-module_title__TJL3z", C = {
|
|
110
110
|
observations: ne,
|
|
111
111
|
title: ie
|
|
112
112
|
}, ce = (t) => ["conceptUuid", t], le = (t, i) => ["observations", t, ...i], ve = ({ config: t }) => {
|
|
@@ -121,7 +121,7 @@ const F = (t, i, c, l, u, r) => {
|
|
|
121
121
|
enabled: !!e
|
|
122
122
|
}))
|
|
123
123
|
});
|
|
124
|
-
|
|
124
|
+
S(() => {
|
|
125
125
|
n.forEach((e, v) => {
|
|
126
126
|
if (e.isError && !r.current.has(v)) {
|
|
127
127
|
const R = c[v];
|
|
@@ -150,7 +150,7 @@ const F = (t, i, c, l, u, r) => {
|
|
|
150
150
|
) && T();
|
|
151
151
|
},
|
|
152
152
|
[s, T]
|
|
153
|
-
),
|
|
153
|
+
), S(() => {
|
|
154
154
|
h && o({
|
|
155
155
|
title: a("ERROR_DEFAULT_TITLE"),
|
|
156
156
|
message: a("ERROR_FETCHING_OBSERVATIONS"),
|
|
@@ -161,18 +161,18 @@ const F = (t, i, c, l, u, r) => {
|
|
|
161
161
|
if (!m) return [];
|
|
162
162
|
const e = Y(m), v = W(e);
|
|
163
163
|
return Z(v);
|
|
164
|
-
}, [m]),
|
|
164
|
+
}, [m]), L = [
|
|
165
165
|
{ key: "name", header: "name" },
|
|
166
166
|
{ key: "value", header: "value" },
|
|
167
167
|
{ key: "form", header: "form" }
|
|
168
|
-
],
|
|
168
|
+
], $ = y || !f, I = h && f, B = (!m || m.entry?.length === 0 || p.length === 0) && f, A = I ? a("ERROR_FETCHING_OBSERVATIONS") : null, w = B ? a("NO_OBSERVATIONS_FOUND") : void 0, M = _.length > 0 && !$ && !I, O = i.titleTranslationKey, E = O ? a(O) : "";
|
|
169
169
|
return /* @__PURE__ */ N(
|
|
170
170
|
"div",
|
|
171
171
|
{
|
|
172
172
|
id: "observations",
|
|
173
173
|
"data-testid": O ? `observations-${E}` : "observations",
|
|
174
174
|
"aria-label": "observations-aria-label",
|
|
175
|
-
className:
|
|
175
|
+
className: C.observations,
|
|
176
176
|
children: [
|
|
177
177
|
/* @__PURE__ */ d(
|
|
178
178
|
x,
|
|
@@ -180,11 +180,11 @@ const F = (t, i, c, l, u, r) => {
|
|
|
180
180
|
id: "observations-title",
|
|
181
181
|
testId: O ? `observations-title-${E}` : "observations-title",
|
|
182
182
|
title: E,
|
|
183
|
-
className:
|
|
183
|
+
className: C.title,
|
|
184
184
|
children: /* @__PURE__ */ d("p", { children: E })
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
|
|
187
|
+
M ? /* @__PURE__ */ d(
|
|
188
188
|
ae,
|
|
189
189
|
{
|
|
190
190
|
groupedData: _,
|
|
@@ -194,12 +194,12 @@ const F = (t, i, c, l, u, r) => {
|
|
|
194
194
|
) : /* @__PURE__ */ d(
|
|
195
195
|
ee,
|
|
196
196
|
{
|
|
197
|
-
headers:
|
|
197
|
+
headers: L,
|
|
198
198
|
rows: [],
|
|
199
199
|
ariaLabel: a("OBSERVATIONS"),
|
|
200
|
-
loading:
|
|
201
|
-
errorStateMessage:
|
|
202
|
-
emptyStateMessage:
|
|
200
|
+
loading: $,
|
|
201
|
+
errorStateMessage: A,
|
|
202
|
+
emptyStateMessage: w,
|
|
203
203
|
dataTestId: "observations-table"
|
|
204
204
|
}
|
|
205
205
|
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandPalette.d.ts","sourceRoot":"","sources":["../../src/commandPalette/CommandPalette.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgC,MAAM,OAAO,CAAC;AA4BrD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAuSlC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NavItem, PatientAction, PatientFieldsConfig, SearchAnnotation } from './models';
|
|
2
|
+
export interface CommandPaletteContextType {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
toggle: () => void;
|
|
5
|
+
setOpen: (open: boolean) => void;
|
|
6
|
+
navItems: NavItem[];
|
|
7
|
+
patientActions: PatientAction[];
|
|
8
|
+
patientFieldsConfig: PatientFieldsConfig;
|
|
9
|
+
searchAnnotations: SearchAnnotation[];
|
|
10
|
+
}
|
|
11
|
+
export declare const CommandPaletteContext: import('react').Context<CommandPaletteContextType | null>;
|
|
12
|
+
//# sourceMappingURL=CommandPaletteContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandPaletteContext.d.ts","sourceRoot":"","sources":["../../src/commandPalette/CommandPaletteContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,qBAAqB,2DACqB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { NavItem, PatientAction, PatientFieldsConfig, SearchAnnotation, TriggerConfig } from './models';
|
|
3
|
+
interface CommandPaletteProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
navItems: NavItem[];
|
|
6
|
+
patientActions: PatientAction[];
|
|
7
|
+
patientFieldsConfig: PatientFieldsConfig;
|
|
8
|
+
trigger: TriggerConfig;
|
|
9
|
+
searchAnnotations: SearchAnnotation[];
|
|
10
|
+
}
|
|
11
|
+
export declare const CommandPaletteProvider: React.FC<CommandPaletteProviderProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=CommandPaletteProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandPaletteProvider.d.ts","sourceRoot":"","sources":["../../src/commandPalette/CommandPaletteProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,UAAU,2BAA2B;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC;IACvB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC;AA2CD,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAMxE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PatientSearchResult } from '@bahmni/services';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { PatientAction, PatientFieldsConfig } from './models';
|
|
4
|
+
export interface PatientCommandItemProps {
|
|
5
|
+
patient: PatientSearchResult;
|
|
6
|
+
patientFieldsConfig: PatientFieldsConfig;
|
|
7
|
+
patientActions: PatientAction[];
|
|
8
|
+
activeActionIndex: number;
|
|
9
|
+
onNavigate: (path: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const PatientCommandItem: React.FC<PatientCommandItemProps>;
|
|
12
|
+
//# sourceMappingURL=PatientCommandItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PatientCommandItem.d.ts","sourceRoot":"","sources":["../../src/commandPalette/PatientCommandItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EACV,aAAa,EAEb,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAIlB,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAsHhE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CommandPaletteProvider } from './CommandPaletteProvider';
|
|
2
|
+
export { useCommandPalette } from './useCommandPalette';
|
|
3
|
+
export type { CommandPaletteContextType } from './CommandPaletteContext';
|
|
4
|
+
export type { AnnotationSearchType, NavItem, PatientAction, PatientActionContext, PatientFieldKey, PatientFieldsConfig, SearchAnnotation, TriggerConfig, } from './models';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commandPalette/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,YAAY,EACV,oBAAoB,EACpB,OAAO,EACP,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,GACd,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type PatientFieldKey = 'name' | 'identifier' | 'age' | 'gender' | 'birthDate' | 'addressFieldValue' | 'extraIdentifiers' | 'customAttribute' | 'activeVisitUuid';
|
|
2
|
+
export interface NavItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
path: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
newTab?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PatientActionContext {
|
|
10
|
+
patientUuid: string;
|
|
11
|
+
patientIdentifier?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface PatientAction {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
getPath: (context: PatientActionContext) => string;
|
|
18
|
+
basePath: string;
|
|
19
|
+
}
|
|
20
|
+
export interface PatientFieldsConfig {
|
|
21
|
+
primaryFields: PatientFieldKey[];
|
|
22
|
+
additionalFields: PatientFieldKey[];
|
|
23
|
+
}
|
|
24
|
+
export type AnnotationSearchType = 'patientAttribute' | 'patientNameOrId';
|
|
25
|
+
export interface SearchAnnotation {
|
|
26
|
+
prefix: string;
|
|
27
|
+
label: string;
|
|
28
|
+
searchType?: AnnotationSearchType;
|
|
29
|
+
fieldType: 'person' | 'address';
|
|
30
|
+
fieldsToSearch: string[];
|
|
31
|
+
}
|
|
32
|
+
export type TriggerConfig = {
|
|
33
|
+
type: 'combination';
|
|
34
|
+
keys: string[];
|
|
35
|
+
} | {
|
|
36
|
+
type: 'double';
|
|
37
|
+
keys: string[];
|
|
38
|
+
interval?: number;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/commandPalette/models.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,YAAY,GACZ,KAAK,GACL,QAAQ,GACR,WAAW,GACX,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,MAAM,CAAC;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,gBAAgB,EAAE,eAAe,EAAE,CAAC;CACrC;AAED,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,SAAS,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChC,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCommandPalette.d.ts","sourceRoot":"","sources":["../../src/commandPalette/useCommandPalette.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE,wBAAgB,iBAAiB,IAAI,yBAAyB,CAQ7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCommandPaletteKeyboard.d.ts","sourceRoot":"","sources":["../../src/commandPalette/useCommandPaletteKeyboard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,IAAI,EAClB,OAAO,EAAE,aAAa,GACrB,IAAI,CAyCN"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PatientSearchResult } from '@bahmni/services';
|
|
2
|
+
import { SearchAnnotation } from './models';
|
|
3
|
+
interface CommandPaletteSearchState {
|
|
4
|
+
patients: PatientSearchResult[];
|
|
5
|
+
loading: boolean;
|
|
6
|
+
error: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function useCommandPaletteSearch(searchTerm: string, activeAnnotation?: SearchAnnotation | null): CommandPaletteSearchState;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=useCommandPaletteSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCommandPaletteSearch.d.ts","sourceRoot":"","sources":["../../src/commandPalette/useCommandPaletteSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,UAAU,yBAAyB;IACjC,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,gBAAgB,GAAE,gBAAgB,GAAG,IAAW,GAC/C,yBAAyB,CAkE3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebounce.d.ts","sourceRoot":"","sources":["../../src/commandPalette/useDebounce.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAE,MAAY,GAAG,CAAC,CAc/D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PatientSearchResult } from '@bahmni/services';
|
|
2
|
+
import { PatientFieldKey } from './models';
|
|
3
|
+
export interface FieldDef {
|
|
4
|
+
labelKey: string;
|
|
5
|
+
getValue: (p: PatientSearchResult) => string | null | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare const FIELD_LABEL_KEYS: {
|
|
8
|
+
readonly name: "COMMAND_PALETTE_FIELD_NAME";
|
|
9
|
+
readonly identifier: "COMMAND_PALETTE_FIELD_ID";
|
|
10
|
+
readonly age: "COMMAND_PALETTE_FIELD_AGE";
|
|
11
|
+
readonly gender: "COMMAND_PALETTE_FIELD_GENDER";
|
|
12
|
+
readonly birthDate: "COMMAND_PALETTE_FIELD_DOB";
|
|
13
|
+
readonly addressFieldValue: "COMMAND_PALETTE_FIELD_ADDRESS";
|
|
14
|
+
readonly extraIdentifiers: "COMMAND_PALETTE_FIELD_EXTRA_IDS";
|
|
15
|
+
readonly customAttribute: "COMMAND_PALETTE_FIELD_ATTRIBUTE";
|
|
16
|
+
readonly activeVisitUuid: "COMMAND_PALETTE_FIELD_ACTIVE_VISIT";
|
|
17
|
+
};
|
|
18
|
+
export declare const PATIENT_FIELD_MAP: Record<PatientFieldKey, FieldDef>;
|
|
19
|
+
export declare const filterItems: (value: string, search: string) => number;
|
|
20
|
+
export declare function getInitials(givenName: string, familyName: string): string;
|
|
21
|
+
export declare function buildPrimaryText(patient: PatientSearchResult, primaryFields: PatientFieldKey[]): string;
|
|
22
|
+
export declare const DEFAULT_DOUBLE_INTERVAL = 350;
|
|
23
|
+
export declare function matchesKeys(e: KeyboardEvent, keys: string[]): boolean;
|
|
24
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/commandPalette/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,mBAAmB,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACjE;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;CAUuB,CAAC;AAErD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,eAAe,EAAE,QAAQ,CAsC/D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MAI3D,CAAC;AAEF,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAIzE;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,eAAe,EAAE,GAC/B,MAAM,CAKR;AAED,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAqB3C,wBAAgB,WAAW,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAWrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericServiceRequestTable.d.ts","sourceRoot":"","sources":["../../src/genericServiceRequest/GenericServiceRequestTable.tsx"],"names":[],"mappings":"AAmBA,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":"AAmBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAehD,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,CA0QrD,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Bundle, ServiceRequest } from 'fhir/r4';
|
|
2
|
+
import { ServiceRequestViewModel } from '../../models';
|
|
3
|
+
export declare const mockOrderTypes: {
|
|
4
|
+
results: {
|
|
5
|
+
uuid: string;
|
|
6
|
+
display: string;
|
|
7
|
+
conceptClasses: {
|
|
8
|
+
uuid: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}[];
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
export declare const mockServiceRequestBundle: Bundle<ServiceRequest>;
|
|
14
|
+
export declare const mockServiceRequests: ServiceRequestViewModel[];
|
|
15
|
+
//# sourceMappingURL=serviceRequestMocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serviceRequestMocks.d.ts","sourceRoot":"","sources":["../../../../src/genericServiceRequest/__tests__/__mocks__/serviceRequestMocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,cAAc;;;;;;;;;CAuB1B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,cAAc,CA4C3D,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,uBAAuB,EAW/C,CAAC"}
|