@bahmni/widgets 0.0.1-dev.204 → 0.0.1-dev.208
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-utC6I1yG.js +228 -0
- package/dist/{FormsTable-DnubypOq.js → FormsTable-Dx7SyDA0.js} +36 -36
- package/dist/{Observations-BjhWa-1M.js → Observations-By99vmvd.js} +16 -16
- package/dist/conditions/ConditionsTable.d.ts +2 -1
- package/dist/conditions/ConditionsTable.d.ts.map +1 -1
- package/dist/diagnoses/DiagnosesTable.d.ts +2 -1
- package/dist/diagnoses/DiagnosesTable.d.ts.map +1 -1
- package/dist/documents/DocumentsTable.d.ts.map +1 -1
- package/dist/{index-juFovBb5.js → index-BkpQMBIh.js} +18914 -18332
- package/dist/index.css +1 -1
- package/dist/index.js +16 -16
- package/dist/patientPrograms/PatientProgramsTable.d.ts +2 -7
- package/dist/patientPrograms/PatientProgramsTable.d.ts.map +1 -1
- package/dist/patientPrograms/index.d.ts +1 -1
- package/dist/patientPrograms/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/DocumentsTable-DOeNKrdl.js +0 -204
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a3 as s, a1 as t,
|
|
1
|
+
import { a3 as s, a1 as t, A as o, a0 as r, B as n, $ as g, C as l, D as P, K as c, I as d, M as v, Q as A, U as T, P as b, N as C, O as p, H as f, G as I, S as W, _ as u, V as S, a5 as m, a4 as D, ab as N, aa as R, a7 as U, a8 as y, a9 as h, a6 as x, ac as G, a2 as H, Y as L, a as O, u as V, W as _ } from "./index-BkpQMBIh.js";
|
|
2
2
|
import "react";
|
|
3
3
|
export {
|
|
4
4
|
s as ActivePractitionerContext,
|
|
@@ -12,27 +12,27 @@ export {
|
|
|
12
12
|
c as GenericServiceRequestTable,
|
|
13
13
|
d as LabInvestigation,
|
|
14
14
|
v as MedicationsTable,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
A as NotificationProvider,
|
|
16
|
+
T as NotificationServiceComponent,
|
|
17
|
+
b as PatientDetails,
|
|
18
18
|
C as PatientProgramsTable,
|
|
19
19
|
p as ProgramDetails,
|
|
20
20
|
f as RadiologyInvestigationReport,
|
|
21
21
|
I as RadiologyInvestigationTable,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
W as SearchPatient,
|
|
23
|
+
u as UserPrivilegeProvider,
|
|
24
|
+
S as VitalFlowSheet,
|
|
25
25
|
m as createConfigHook,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
D as createConfigProvider,
|
|
27
|
+
N as getAllWidgetConfigs,
|
|
28
|
+
R as getAllWidgetTypes,
|
|
29
|
+
U as getWidget,
|
|
30
30
|
y as getWidgetConfig,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
h as hasWidget,
|
|
32
|
+
x as registerWidget,
|
|
33
|
+
G as resetWidgetRegistry,
|
|
34
|
+
H as useActivePractitioner,
|
|
35
|
+
L as useHasPrivilege,
|
|
36
36
|
O as useNotification,
|
|
37
37
|
V as usePatientUUID,
|
|
38
38
|
_ as useUserPrivilege
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
interface PatientProgramsTableProps {
|
|
4
|
-
config: {
|
|
5
|
-
fields: string[];
|
|
6
|
-
};
|
|
7
|
-
}
|
|
2
|
+
import { WidgetProps } from '../registry/model';
|
|
8
3
|
/**
|
|
9
4
|
* Component to display patient programs using SortableDataTable
|
|
10
5
|
*/
|
|
11
|
-
declare const PatientProgramsTable: React.FC<
|
|
6
|
+
declare const PatientProgramsTable: React.FC<WidgetProps>;
|
|
12
7
|
export default PatientProgramsTable;
|
|
13
8
|
//# sourceMappingURL=PatientProgramsTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatientProgramsTable.d.ts","sourceRoot":"","sources":["../../src/patientPrograms/PatientProgramsTable.tsx"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"PatientProgramsTable.d.ts","sourceRoot":"","sources":["../../src/patientPrograms/PatientProgramsTable.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;GAEG;AACH,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAkL/C,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as PatientProgramsTable
|
|
1
|
+
export { default as PatientProgramsTable } from './PatientProgramsTable';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patientPrograms/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patientPrograms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { jsx as s, jsxs as l, Fragment as k } from "react/jsx-runtime";
|
|
2
|
-
import { u as V, a as H, v as P, F as q, W as z, c as G, y as W } from "./index-juFovBb5.js";
|
|
3
|
-
import { useQuery as Y } from "@tanstack/react-query";
|
|
4
|
-
import { useState as C, useCallback as E, useEffect as L, useMemo as f } from "react";
|
|
5
|
-
import { useTranslation as K } from "react-i18next";
|
|
6
|
-
const Q = "_documentsTableBody_1voj8_1", X = "_viewAttachmentsLink_1voj8_11", J = "_documentViewerContainer_1voj8_15", Z = "_attachmentItem_1voj8_23", x = "_attachmentCounter_1voj8_27", ee = "_attachmentError_1voj8_36", te = "_documentIframe_1voj8_44", ne = "_documentImage_1voj8_50", c = {
|
|
7
|
-
documentsTableBody: Q,
|
|
8
|
-
viewAttachmentsLink: X,
|
|
9
|
-
documentViewerContainer: J,
|
|
10
|
-
attachmentItem: Z,
|
|
11
|
-
attachmentCounter: x,
|
|
12
|
-
attachmentError: ee,
|
|
13
|
-
documentIframe: te,
|
|
14
|
-
documentImage: ne
|
|
15
|
-
}, ae = {
|
|
16
|
-
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
17
|
-
documentType: "DOCUMENTS_TYPE",
|
|
18
|
-
uploadedOn: "DOCUMENTS_UPLOADED_ON",
|
|
19
|
-
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
20
|
-
action: "DOCUMENTS_ACTION"
|
|
21
|
-
};
|
|
22
|
-
function M(t) {
|
|
23
|
-
return !t || t.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${t}`;
|
|
24
|
-
}
|
|
25
|
-
function oe(t, u) {
|
|
26
|
-
return t.map((d) => ({
|
|
27
|
-
key: d,
|
|
28
|
-
header: u(ae[d])
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
const re = [
|
|
32
|
-
"documentIdentifier",
|
|
33
|
-
"documentType",
|
|
34
|
-
"uploadedOn",
|
|
35
|
-
"uploadedBy",
|
|
36
|
-
"action"
|
|
37
|
-
], se = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, U = (t) => t.attachments.length > 0 ? t.attachments : t.documentUrl ? [{ url: t.documentUrl, contentType: t.contentType }] : [], ue = ({ config: t, encounterUuids: u }) => {
|
|
38
|
-
const [d, g] = C(!1), [a, O] = C(
|
|
39
|
-
null
|
|
40
|
-
), [w, T] = C(
|
|
41
|
-
/* @__PURE__ */ new Set()
|
|
42
|
-
), p = V(), { t: n } = K(), { addNotification: y } = H(), S = E((e) => {
|
|
43
|
-
O(e), g(!0);
|
|
44
|
-
}, []), b = E(() => {
|
|
45
|
-
g(!1), O(null), T(/* @__PURE__ */ new Set());
|
|
46
|
-
}, []), v = E((e) => {
|
|
47
|
-
T((o) => new Set(o).add(e));
|
|
48
|
-
}, []), { data: B, isLoading: j, isError: I, error: A } = Y({
|
|
49
|
-
queryKey: ["documents", p, u],
|
|
50
|
-
enabled: !!p,
|
|
51
|
-
queryFn: () => P(p, u)
|
|
52
|
-
});
|
|
53
|
-
L(() => {
|
|
54
|
-
I && y({
|
|
55
|
-
title: n("ERROR_DEFAULT_TITLE"),
|
|
56
|
-
message: A?.message ?? "",
|
|
57
|
-
type: "error"
|
|
58
|
-
});
|
|
59
|
-
}, [I, A, y, n]), L(() => {
|
|
60
|
-
const e = new AbortController();
|
|
61
|
-
return (async () => {
|
|
62
|
-
if (!d || !a) return;
|
|
63
|
-
const r = /* @__PURE__ */ new Set(), _ = U(a);
|
|
64
|
-
for (let m = 0; m < _.length; m++) {
|
|
65
|
-
const N = M(_[m].url);
|
|
66
|
-
try {
|
|
67
|
-
(await fetch(N, {
|
|
68
|
-
method: "HEAD",
|
|
69
|
-
signal: e.signal
|
|
70
|
-
})).ok || r.add(m);
|
|
71
|
-
} catch (D) {
|
|
72
|
-
D instanceof Error && D.name !== "AbortError" && r.add(m);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
e.signal.aborted || T(r);
|
|
76
|
-
})(), () => e.abort();
|
|
77
|
-
}, [d, a]);
|
|
78
|
-
const h = f(
|
|
79
|
-
() => t?.fields ?? re,
|
|
80
|
-
[t?.fields]
|
|
81
|
-
), F = f(() => oe(h, n), [h, n]), R = f(
|
|
82
|
-
() => h.map((e) => ({
|
|
83
|
-
key: e,
|
|
84
|
-
sortable: e !== "action"
|
|
85
|
-
})),
|
|
86
|
-
[h]
|
|
87
|
-
), i = f(
|
|
88
|
-
() => a ? U(a) : [],
|
|
89
|
-
[a]
|
|
90
|
-
), $ = E(
|
|
91
|
-
(e, o) => {
|
|
92
|
-
switch (o) {
|
|
93
|
-
case "documentIdentifier":
|
|
94
|
-
return /* @__PURE__ */ s("span", { children: e.documentIdentifier });
|
|
95
|
-
case "documentType":
|
|
96
|
-
return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
97
|
-
case "uploadedOn":
|
|
98
|
-
return z(
|
|
99
|
-
e.uploadedOn,
|
|
100
|
-
n,
|
|
101
|
-
!0
|
|
102
|
-
).formattedResult || n("DOCUMENTS_NOT_AVAILABLE");
|
|
103
|
-
case "uploadedBy":
|
|
104
|
-
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
105
|
-
case "action":
|
|
106
|
-
return e.attachments.length > 0 || !!e.documentUrl ? /* @__PURE__ */ s(
|
|
107
|
-
q,
|
|
108
|
-
{
|
|
109
|
-
onClick: () => S(e),
|
|
110
|
-
className: c.viewAttachmentsLink,
|
|
111
|
-
"data-testid": `view-attachments-${e.id}`,
|
|
112
|
-
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
113
|
-
}
|
|
114
|
-
) : "--";
|
|
115
|
-
default:
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
[S, n]
|
|
120
|
-
);
|
|
121
|
-
return /* @__PURE__ */ l(k, { children: [
|
|
122
|
-
/* @__PURE__ */ s("div", { "data-testid": "documents-table", children: /* @__PURE__ */ s(
|
|
123
|
-
G,
|
|
124
|
-
{
|
|
125
|
-
headers: F,
|
|
126
|
-
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
127
|
-
rows: B ?? [],
|
|
128
|
-
loading: j,
|
|
129
|
-
errorStateMessage: I ? A?.message : null,
|
|
130
|
-
sortable: R,
|
|
131
|
-
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
132
|
-
renderCell: $,
|
|
133
|
-
className: c.documentsTableBody,
|
|
134
|
-
dataTestId: "documents-table"
|
|
135
|
-
}
|
|
136
|
-
) }),
|
|
137
|
-
d && a && /* @__PURE__ */ s(
|
|
138
|
-
W,
|
|
139
|
-
{
|
|
140
|
-
id: "modalIdForActionAreaLayout",
|
|
141
|
-
portalId: "main-display-area",
|
|
142
|
-
open: d,
|
|
143
|
-
onRequestClose: b,
|
|
144
|
-
modalHeading: a.documentIdentifier,
|
|
145
|
-
passiveModal: !0,
|
|
146
|
-
size: "lg",
|
|
147
|
-
testId: "document-view-modal",
|
|
148
|
-
children: /* @__PURE__ */ s("div", { className: c.documentViewerContainer, children: i.map((e, o) => {
|
|
149
|
-
const r = M(e.url), _ = e.contentType?.toLowerCase().includes("pdf"), m = (e.contentType?.toLowerCase().includes("image") ?? !1) || se.test(e.url ?? ""), N = w.has(o);
|
|
150
|
-
return r === "#" || N ? /* @__PURE__ */ l(
|
|
151
|
-
"div",
|
|
152
|
-
{
|
|
153
|
-
className: c.attachmentError,
|
|
154
|
-
"data-testid": `attachment-error-${o}`,
|
|
155
|
-
children: [
|
|
156
|
-
i.length > 1 && /* @__PURE__ */ l("p", { className: c.attachmentCounter, children: [
|
|
157
|
-
o + 1,
|
|
158
|
-
"/",
|
|
159
|
-
i.length
|
|
160
|
-
] }),
|
|
161
|
-
/* @__PURE__ */ s("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
`${a.id}-${e.url}`
|
|
165
|
-
) : /* @__PURE__ */ l(
|
|
166
|
-
"div",
|
|
167
|
-
{
|
|
168
|
-
className: c.attachmentItem,
|
|
169
|
-
"data-testid": `attachment-item-${o}`,
|
|
170
|
-
children: [
|
|
171
|
-
i.length > 1 && /* @__PURE__ */ l("p", { className: c.attachmentCounter, children: [
|
|
172
|
-
o + 1,
|
|
173
|
-
"/",
|
|
174
|
-
i.length
|
|
175
|
-
] }),
|
|
176
|
-
m ? /* @__PURE__ */ s(
|
|
177
|
-
"img",
|
|
178
|
-
{
|
|
179
|
-
src: r,
|
|
180
|
-
alt: a.documentIdentifier,
|
|
181
|
-
className: c.documentImage,
|
|
182
|
-
onError: () => v(o)
|
|
183
|
-
}
|
|
184
|
-
) : /* @__PURE__ */ s(
|
|
185
|
-
"iframe",
|
|
186
|
-
{
|
|
187
|
-
src: _ ? `${r}#toolbar=0` : r,
|
|
188
|
-
className: c.documentIframe,
|
|
189
|
-
title: a.documentIdentifier,
|
|
190
|
-
onError: () => v(o)
|
|
191
|
-
}
|
|
192
|
-
)
|
|
193
|
-
]
|
|
194
|
-
},
|
|
195
|
-
`${a.id}-${e.url}`
|
|
196
|
-
);
|
|
197
|
-
}) })
|
|
198
|
-
}
|
|
199
|
-
)
|
|
200
|
-
] });
|
|
201
|
-
};
|
|
202
|
-
export {
|
|
203
|
-
ue as default
|
|
204
|
-
};
|