@bahmni/home-app 0.0.1-dev.265
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/LICENSE +9 -0
- package/README.md +32 -0
- package/dist/App.d.ts +3 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/DocumentsTable-CTpGjHXi-CEXWNnsk.js +227 -0
- package/dist/FormsTable-BIz1A-5g-BXV42F9l.js +197 -0
- package/dist/LNWAZHJI-_P9WHzM-.js +33 -0
- package/dist/MWZ6AO7Z-lJQzRAr2.js +42 -0
- package/dist/Observations-Cf7HY6Zc-BqUt4hsD.js +213 -0
- package/dist/YPM2AS64-C65wOvkm.js +8975 -0
- package/dist/components/AppTile/AppTile.d.ts +10 -0
- package/dist/components/AppTile/AppTile.d.ts.map +1 -0
- package/dist/components/AppTile/__tests__/__mocks__/AppTileMocks.d.ts +7 -0
- package/dist/components/AppTile/__tests__/__mocks__/AppTileMocks.d.ts.map +1 -0
- package/dist/components/AppTile/index.d.ts +2 -0
- package/dist/components/AppTile/index.d.ts.map +1 -0
- package/dist/components/HomePage/HomePage.d.ts +3 -0
- package/dist/components/HomePage/HomePage.d.ts.map +1 -0
- package/dist/components/HomePage/index.d.ts +2 -0
- package/dist/components/HomePage/index.d.ts.map +1 -0
- package/dist/components/HomePageGrid/HomePageGrid.d.ts +3 -0
- package/dist/components/HomePageGrid/HomePageGrid.d.ts.map +1 -0
- package/dist/components/HomePageGrid/__tests__/__mocks__/homePageGridMocks.d.ts +5 -0
- package/dist/components/HomePageGrid/__tests__/__mocks__/homePageGridMocks.d.ts.map +1 -0
- package/dist/components/HomePageGrid/index.d.ts +2 -0
- package/dist/components/HomePageGrid/index.d.ts.map +1 -0
- package/dist/components/HomePageHeader/HomePageHeader.d.ts +3 -0
- package/dist/components/HomePageHeader/HomePageHeader.d.ts.map +1 -0
- package/dist/components/HomePageHeader/index.d.ts +2 -0
- package/dist/components/HomePageHeader/index.d.ts.map +1 -0
- package/dist/components/UserProfileMenu/UserProfileMenu.d.ts +3 -0
- package/dist/components/UserProfileMenu/UserProfileMenu.d.ts.map +1 -0
- package/dist/components/UserProfileMenu/index.d.ts +2 -0
- package/dist/components/UserProfileMenu/index.d.ts.map +1 -0
- package/dist/config/tanstackQuery.d.ts +3 -0
- package/dist/config/tanstackQuery.d.ts.map +1 -0
- package/dist/constants/app.d.ts +5 -0
- package/dist/constants/app.d.ts.map +1 -0
- package/dist/index-Bnf-KqF-.js +10135 -0
- package/dist/index-C4fEzRab.js +166198 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/locales/locale_en.json +15 -0
- package/dist/locales/locale_es.json +15 -0
- package/dist/routes/index.d.ts +4 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/model.d.ts +8 -0
- package/dist/routes/model.d.ts.map +1 -0
- package/package.json +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License,
|
|
3
|
+
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
|
|
4
|
+
* obtain one at http://mozilla.org/MPL/2.0/. Bahmni is also distributed under
|
|
5
|
+
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
|
|
6
|
+
*
|
|
7
|
+
* Copyright 2025. Thoughtworks, Inc. Thoughtworks is a registered trademark
|
|
8
|
+
* and the Thoughtworks graphic logo is a trademark of Thoughtworks Inc.
|
|
9
|
+
*/
|
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @bahmni/home-app
|
|
2
|
+
|
|
3
|
+
Home page module for Bahmni, built with React and Bahmni Design System. Part of the `bahmni-apps-frontend` monorepo.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
Provides the Bahmni home page - the landing screen after login. Displays the app tile grid for navigating to clinical, registration, and appointments modules, along with the header, location selector, and user profile menu.
|
|
8
|
+
|
|
9
|
+
## Development
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Run unit tests
|
|
13
|
+
yarn nx test @bahmni/home-app
|
|
14
|
+
|
|
15
|
+
# Build
|
|
16
|
+
yarn nx build @bahmni/home-app
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Tech Stack
|
|
20
|
+
|
|
21
|
+
- React 19, React Router 7
|
|
22
|
+
- TanStack Query for data fetching
|
|
23
|
+
- i18n via `@bahmni/services`
|
|
24
|
+
- Design system via `@bahmni/design-system`
|
|
25
|
+
|
|
26
|
+
## Package Exports
|
|
27
|
+
|
|
28
|
+
| Export | Description |
|
|
29
|
+
|--------|-------------|
|
|
30
|
+
| `@bahmni/home-app` | `HomeApp` component |
|
|
31
|
+
| `@bahmni/home-app/styles` | Compiled CSS (widgets + app styles) |
|
|
32
|
+
| `@bahmni/home-app/locales/*` | i18n locale files |
|
package/dist/App.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAmBA,wBAAgB,GAAG,4CAuClB;AAED,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { d as K, u as Q, a as W, F as J, b as X, m as Z, c as ee, r as te } from "./index-C4fEzRab.js";
|
|
3
|
+
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
|
+
import { useState as m, useCallback as h, useEffect as O, useMemo as T } from "react";
|
|
5
|
+
const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", me = "_documentImage_1voj8_50", d = {
|
|
6
|
+
documentsTableBody: ne,
|
|
7
|
+
viewAttachmentsLink: oe,
|
|
8
|
+
documentViewerContainer: re,
|
|
9
|
+
attachmentItem: de,
|
|
10
|
+
attachmentCounter: se,
|
|
11
|
+
attachmentError: ce,
|
|
12
|
+
documentIframe: ie,
|
|
13
|
+
documentImage: me
|
|
14
|
+
}, le = {
|
|
15
|
+
documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
|
|
16
|
+
documentType: "DOCUMENTS_TYPE",
|
|
17
|
+
uploadedOn: "DOCUMENTS_UPLOADED_ON",
|
|
18
|
+
uploadedBy: "DOCUMENTS_UPLOADED_BY",
|
|
19
|
+
action: "DOCUMENTS_ACTION"
|
|
20
|
+
};
|
|
21
|
+
function j(a) {
|
|
22
|
+
return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
|
|
23
|
+
}
|
|
24
|
+
function ue(a, g) {
|
|
25
|
+
return a.map((s) => ({
|
|
26
|
+
key: s,
|
|
27
|
+
header: g(le[s])
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
const _e = [
|
|
31
|
+
"documentIdentifier",
|
|
32
|
+
"documentType",
|
|
33
|
+
"uploadedOn",
|
|
34
|
+
"uploadedBy",
|
|
35
|
+
"action"
|
|
36
|
+
], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], fe = ({ config: a, encounterUuids: g }) => {
|
|
37
|
+
const [s, w] = m(!1), [o, L] = m(
|
|
38
|
+
null
|
|
39
|
+
), [R, I] = m(
|
|
40
|
+
/* @__PURE__ */ new Set()
|
|
41
|
+
), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = m(1), [l, k] = m($), [F, y] = m(void 0), b = h((e) => {
|
|
42
|
+
L(e), w(!0);
|
|
43
|
+
}, []), V = h(() => {
|
|
44
|
+
w(!1), L(null), I(/* @__PURE__ */ new Set());
|
|
45
|
+
}, []), M = h((e) => {
|
|
46
|
+
I((t) => new Set(t).add(e));
|
|
47
|
+
}, []), { data: u, isLoading: H, isError: D, error: v } = ae({
|
|
48
|
+
queryKey: [
|
|
49
|
+
"documents",
|
|
50
|
+
E,
|
|
51
|
+
g,
|
|
52
|
+
C,
|
|
53
|
+
l
|
|
54
|
+
],
|
|
55
|
+
enabled: !!E,
|
|
56
|
+
queryFn: () => J(
|
|
57
|
+
E,
|
|
58
|
+
g,
|
|
59
|
+
l,
|
|
60
|
+
C
|
|
61
|
+
)
|
|
62
|
+
});
|
|
63
|
+
O(() => {
|
|
64
|
+
u && y(u.total);
|
|
65
|
+
}, [u]), O(() => {
|
|
66
|
+
A(1), y(void 0);
|
|
67
|
+
}, [E]), O(() => {
|
|
68
|
+
D && U({
|
|
69
|
+
title: n("ERROR_DEFAULT_TITLE"),
|
|
70
|
+
message: v?.message ?? "",
|
|
71
|
+
type: "error"
|
|
72
|
+
});
|
|
73
|
+
}, [D, v, U, n]), O(() => {
|
|
74
|
+
const e = new AbortController();
|
|
75
|
+
return (async () => {
|
|
76
|
+
if (!s || !o) return;
|
|
77
|
+
const t = /* @__PURE__ */ new Set(), c = B(o);
|
|
78
|
+
for (let i = 0; i < c.length; i++) {
|
|
79
|
+
const S = j(c[i].url);
|
|
80
|
+
try {
|
|
81
|
+
(await fetch(S, {
|
|
82
|
+
method: "HEAD",
|
|
83
|
+
signal: e.signal
|
|
84
|
+
})).ok || t.add(i);
|
|
85
|
+
} catch (N) {
|
|
86
|
+
N instanceof Error && N.name !== "AbortError" && t.add(i);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
e.signal.aborted || I(t);
|
|
90
|
+
})(), () => e.abort();
|
|
91
|
+
}, [s, o]);
|
|
92
|
+
const q = h(
|
|
93
|
+
(e, t) => {
|
|
94
|
+
t !== l ? (k(t), A(1), y(void 0)) : A(e);
|
|
95
|
+
},
|
|
96
|
+
[l]
|
|
97
|
+
), f = T(
|
|
98
|
+
() => a?.fields ?? _e,
|
|
99
|
+
[a?.fields]
|
|
100
|
+
), P = T(() => [...u?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [u]), z = T(() => ue(f, n), [f, n]), x = T(
|
|
101
|
+
() => f.map((e) => ({
|
|
102
|
+
key: e,
|
|
103
|
+
sortable: e !== "action"
|
|
104
|
+
})),
|
|
105
|
+
[f]
|
|
106
|
+
), _ = T(
|
|
107
|
+
() => o ? B(o) : [],
|
|
108
|
+
[o]
|
|
109
|
+
), G = h(
|
|
110
|
+
(e, t) => {
|
|
111
|
+
switch (t) {
|
|
112
|
+
case "documentIdentifier":
|
|
113
|
+
return /* @__PURE__ */ r("span", { children: e.documentIdentifier });
|
|
114
|
+
case "documentType":
|
|
115
|
+
return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
116
|
+
case "uploadedOn":
|
|
117
|
+
return Z(
|
|
118
|
+
e.uploadedOn,
|
|
119
|
+
n,
|
|
120
|
+
!0
|
|
121
|
+
).formattedResult || n("DOCUMENTS_NOT_AVAILABLE");
|
|
122
|
+
case "uploadedBy":
|
|
123
|
+
return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
|
|
124
|
+
case "action":
|
|
125
|
+
return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
|
|
126
|
+
X,
|
|
127
|
+
{
|
|
128
|
+
onClick: () => b(e),
|
|
129
|
+
className: d.viewAttachmentsLink,
|
|
130
|
+
"data-testid": `view-attachments-${e.id}`,
|
|
131
|
+
children: n("DOCUMENTS_VIEW_ATTACHMENTS")
|
|
132
|
+
}
|
|
133
|
+
) : "--";
|
|
134
|
+
default:
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
[b, n]
|
|
139
|
+
);
|
|
140
|
+
return /* @__PURE__ */ p(Y, { children: [
|
|
141
|
+
/* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
|
|
142
|
+
ee,
|
|
143
|
+
{
|
|
144
|
+
headers: z,
|
|
145
|
+
ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
|
|
146
|
+
rows: P,
|
|
147
|
+
loading: H,
|
|
148
|
+
errorStateMessage: D ? v?.message : null,
|
|
149
|
+
sortable: x,
|
|
150
|
+
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
|
+
renderCell: G,
|
|
152
|
+
className: d.documentsTableBody,
|
|
153
|
+
dataTestId: "documents-table",
|
|
154
|
+
pageSize: l,
|
|
155
|
+
totalItems: F,
|
|
156
|
+
page: C,
|
|
157
|
+
onPageChange: q
|
|
158
|
+
}
|
|
159
|
+
) }),
|
|
160
|
+
s && o && /* @__PURE__ */ r(
|
|
161
|
+
te,
|
|
162
|
+
{
|
|
163
|
+
id: "modalIdForActionAreaLayout",
|
|
164
|
+
portalId: "main-display-area",
|
|
165
|
+
open: s,
|
|
166
|
+
onRequestClose: V,
|
|
167
|
+
modalHeading: o.documentIdentifier,
|
|
168
|
+
passiveModal: !0,
|
|
169
|
+
size: "lg",
|
|
170
|
+
testId: "document-view-modal",
|
|
171
|
+
children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: _.map((e, t) => {
|
|
172
|
+
const c = j(e.url), i = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), N = R.has(t);
|
|
173
|
+
return c === "#" || N ? /* @__PURE__ */ p(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
className: d.attachmentError,
|
|
177
|
+
"data-testid": `attachment-error-${t}`,
|
|
178
|
+
children: [
|
|
179
|
+
_.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
180
|
+
t + 1,
|
|
181
|
+
"/",
|
|
182
|
+
_.length
|
|
183
|
+
] }),
|
|
184
|
+
/* @__PURE__ */ r("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
`${o.id}-${e.url}`
|
|
188
|
+
) : /* @__PURE__ */ p(
|
|
189
|
+
"div",
|
|
190
|
+
{
|
|
191
|
+
className: d.attachmentItem,
|
|
192
|
+
"data-testid": `attachment-item-${t}`,
|
|
193
|
+
children: [
|
|
194
|
+
_.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
|
|
195
|
+
t + 1,
|
|
196
|
+
"/",
|
|
197
|
+
_.length
|
|
198
|
+
] }),
|
|
199
|
+
S ? /* @__PURE__ */ r(
|
|
200
|
+
"img",
|
|
201
|
+
{
|
|
202
|
+
src: c,
|
|
203
|
+
alt: o.documentIdentifier,
|
|
204
|
+
className: d.documentImage,
|
|
205
|
+
onError: () => M(t)
|
|
206
|
+
}
|
|
207
|
+
) : /* @__PURE__ */ r(
|
|
208
|
+
"iframe",
|
|
209
|
+
{
|
|
210
|
+
src: i ? `${c}#toolbar=0` : c,
|
|
211
|
+
className: d.documentIframe,
|
|
212
|
+
title: o.documentIdentifier,
|
|
213
|
+
onError: () => M(t)
|
|
214
|
+
}
|
|
215
|
+
)
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
`${o.id}-${e.url}`
|
|
219
|
+
);
|
|
220
|
+
}) })
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
] });
|
|
224
|
+
};
|
|
225
|
+
export {
|
|
226
|
+
fe as default
|
|
227
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { jsx as s, jsxs as J, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { u as Z, d as ee, e as re, j as ae, B as te, P as oe, k as se, X as ne, R as q, m as de, b as ie, c as U, A as me, _ as ue, r as le, Y as ce, I as fe } from "./index-C4fEzRab.js";
|
|
3
|
+
import { useQueryClient as ye, useQuery as c } from "@tanstack/react-query";
|
|
4
|
+
import { useState as S, useMemo as d, useCallback as f } from "react";
|
|
5
|
+
const pe = "_formsTableBody_ourq9_5", be = "_customAccordianItem_ourq9_10", I = {
|
|
6
|
+
formsTableBody: pe,
|
|
7
|
+
customAccordianItem: be
|
|
8
|
+
}, ge = (m) => m ? m.extension?.find(
|
|
9
|
+
(n) => n.url === fe
|
|
10
|
+
)?.valueString : void 0, Oe = ({
|
|
11
|
+
episodeOfCareUuids: m,
|
|
12
|
+
encounterUuids: n,
|
|
13
|
+
config: C
|
|
14
|
+
}) => {
|
|
15
|
+
const { t: o } = Z(), u = ee(), [l, h] = S(!1), [t, O] = S(null), { numberOfVisits: k, hideThumbnail: j = !1 } = C ?? {}, B = re(
|
|
16
|
+
m,
|
|
17
|
+
n
|
|
18
|
+
), x = ye(), {
|
|
19
|
+
data: y = [],
|
|
20
|
+
isLoading: _,
|
|
21
|
+
isError: E,
|
|
22
|
+
error: H,
|
|
23
|
+
refetch: K
|
|
24
|
+
} = c({
|
|
25
|
+
queryKey: ["forms", u, m],
|
|
26
|
+
queryFn: () => ae(u, void 0, k),
|
|
27
|
+
enabled: !!u && !B
|
|
28
|
+
}), T = d(() => !n || n.length === 0 ? y : y.filter(
|
|
29
|
+
(e) => n.includes(e.encounterUuid)
|
|
30
|
+
), [y, n]), { data: R = [] } = c({
|
|
31
|
+
queryKey: ["observationForms"],
|
|
32
|
+
queryFn: () => te()
|
|
33
|
+
}), F = f(
|
|
34
|
+
(e) => R.find((r) => r.name === e)?.uuid,
|
|
35
|
+
[R]
|
|
36
|
+
), p = d(() => {
|
|
37
|
+
if (t)
|
|
38
|
+
return F(t.formName);
|
|
39
|
+
}, [t, F]), {
|
|
40
|
+
isLoading: V,
|
|
41
|
+
isError: $,
|
|
42
|
+
error: b
|
|
43
|
+
} = c({
|
|
44
|
+
queryKey: ["formMetadata", p],
|
|
45
|
+
queryFn: () => oe(p),
|
|
46
|
+
enabled: !!p && l
|
|
47
|
+
}), {
|
|
48
|
+
data: g,
|
|
49
|
+
isLoading: w,
|
|
50
|
+
isError: P,
|
|
51
|
+
error: N
|
|
52
|
+
} = c({
|
|
53
|
+
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
54
|
+
queryFn: () => se(t.encounterUuid),
|
|
55
|
+
enabled: !!t?.encounterUuid && l
|
|
56
|
+
});
|
|
57
|
+
ne(
|
|
58
|
+
(e) => {
|
|
59
|
+
e.patientUUID === u && e.updatedConcepts.size > 0 && (K(), x.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
60
|
+
},
|
|
61
|
+
[u]
|
|
62
|
+
);
|
|
63
|
+
const Q = d(() => !g?.entry || !t?.formName ? [] : g.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
|
|
64
|
+
const r = ge(e);
|
|
65
|
+
return !r || r.includes(t.formName);
|
|
66
|
+
}), [g, t?.formName]), Y = d(() => {
|
|
67
|
+
if (b)
|
|
68
|
+
return q(b).message;
|
|
69
|
+
if (N)
|
|
70
|
+
return q(N).message;
|
|
71
|
+
}, [b, N]), L = d(
|
|
72
|
+
() => [
|
|
73
|
+
{ key: "recordedOn", header: o("RECORDED_ON") },
|
|
74
|
+
{ key: "recordedBy", header: o("RECORDED_BY") }
|
|
75
|
+
],
|
|
76
|
+
[o]
|
|
77
|
+
), z = d(
|
|
78
|
+
() => [
|
|
79
|
+
{ key: "recordedOn", sortable: !0 },
|
|
80
|
+
{ key: "recordedBy", sortable: !0 }
|
|
81
|
+
],
|
|
82
|
+
[]
|
|
83
|
+
), M = d(() => {
|
|
84
|
+
const e = T.reduce(
|
|
85
|
+
(r, a) => {
|
|
86
|
+
const i = a.formName;
|
|
87
|
+
r[i] ??= [];
|
|
88
|
+
const A = a.providers.map((X) => X.providerName).filter(Boolean).join(", ");
|
|
89
|
+
return r[i].push({
|
|
90
|
+
id: a.encounterUuid,
|
|
91
|
+
formName: a.formName,
|
|
92
|
+
recordedOn: de(a.encounterDateTime, o, !0).formattedResult,
|
|
93
|
+
recordedBy: A ?? "--",
|
|
94
|
+
encounterDateTime: a.encounterDateTime,
|
|
95
|
+
encounterUuid: a.encounterUuid
|
|
96
|
+
}), r;
|
|
97
|
+
},
|
|
98
|
+
{}
|
|
99
|
+
);
|
|
100
|
+
return Object.entries(e).map(
|
|
101
|
+
([r, a]) => ({
|
|
102
|
+
formName: r,
|
|
103
|
+
records: a.sort(
|
|
104
|
+
(i, A) => A.encounterDateTime - i.encounterDateTime
|
|
105
|
+
)
|
|
106
|
+
})
|
|
107
|
+
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
108
|
+
}, [T, o]), v = f((e) => {
|
|
109
|
+
O(e), h(!0);
|
|
110
|
+
}, []), G = f(() => {
|
|
111
|
+
h(!1), O(null);
|
|
112
|
+
}, []), D = f(
|
|
113
|
+
(e, r) => {
|
|
114
|
+
switch (r) {
|
|
115
|
+
case "recordedOn":
|
|
116
|
+
return /* @__PURE__ */ s(ie, { onClick: () => v(e), children: e.recordedOn });
|
|
117
|
+
case "recordedBy":
|
|
118
|
+
return e.recordedBy;
|
|
119
|
+
default:
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
[v]
|
|
124
|
+
);
|
|
125
|
+
return /* @__PURE__ */ J(W, { children: [
|
|
126
|
+
/* @__PURE__ */ s("div", { id: "forms-table", "data-testid": "forms-table", children: _ || E || M.length === 0 || B ? /* @__PURE__ */ s(
|
|
127
|
+
U,
|
|
128
|
+
{
|
|
129
|
+
headers: L,
|
|
130
|
+
ariaLabel: o("FORMS_HEADING"),
|
|
131
|
+
rows: [],
|
|
132
|
+
loading: _,
|
|
133
|
+
errorStateMessage: E ? H?.message : void 0,
|
|
134
|
+
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
135
|
+
renderCell: D,
|
|
136
|
+
className: I.formsTableBody,
|
|
137
|
+
dataTestId: "forms-table"
|
|
138
|
+
}
|
|
139
|
+
) : /* @__PURE__ */ s(me, { align: "start", children: M.map((e, r) => {
|
|
140
|
+
const { formName: a, records: i } = e;
|
|
141
|
+
return /* @__PURE__ */ s(
|
|
142
|
+
ue,
|
|
143
|
+
{
|
|
144
|
+
title: a,
|
|
145
|
+
className: I.customAccordianItem,
|
|
146
|
+
testId: `accordian-title-${a}`,
|
|
147
|
+
open: r === 0,
|
|
148
|
+
children: /* @__PURE__ */ s(
|
|
149
|
+
U,
|
|
150
|
+
{
|
|
151
|
+
headers: L,
|
|
152
|
+
ariaLabel: o("FORMS_HEADING"),
|
|
153
|
+
rows: i,
|
|
154
|
+
loading: !1,
|
|
155
|
+
errorStateMessage: "",
|
|
156
|
+
sortable: z,
|
|
157
|
+
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
158
|
+
renderCell: D,
|
|
159
|
+
className: I.formsTableBody,
|
|
160
|
+
dataTestId: `forms-table-${a}`
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
},
|
|
164
|
+
a
|
|
165
|
+
);
|
|
166
|
+
}) }) }),
|
|
167
|
+
l && t && /* @__PURE__ */ s(
|
|
168
|
+
le,
|
|
169
|
+
{
|
|
170
|
+
id: "modalIdForActionAreaLayout",
|
|
171
|
+
portalId: "main-display-area",
|
|
172
|
+
open: l,
|
|
173
|
+
onRequestClose: G,
|
|
174
|
+
modalHeading: t.formName,
|
|
175
|
+
modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
|
|
176
|
+
passiveModal: !0,
|
|
177
|
+
size: "md",
|
|
178
|
+
testId: "form-details-modal",
|
|
179
|
+
children: /* @__PURE__ */ s(
|
|
180
|
+
ce,
|
|
181
|
+
{
|
|
182
|
+
observations: Q,
|
|
183
|
+
isLoading: V || w,
|
|
184
|
+
isError: $ || P,
|
|
185
|
+
errorMessage: Y,
|
|
186
|
+
emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
|
|
187
|
+
testIdPrefix: t.formName,
|
|
188
|
+
hideThumbnail: j
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
] });
|
|
194
|
+
};
|
|
195
|
+
export {
|
|
196
|
+
Oe as default
|
|
197
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-C65wOvkm.js";
|
|
2
|
+
import { M as d, O as f, Q as e } from "./index-C4fEzRab.js";
|
|
3
|
+
var p = (a) => {
|
|
4
|
+
const [r, t] = c({
|
|
5
|
+
prefix: "TanstackQueryDevtools"
|
|
6
|
+
}), n = d(), s = f(() => {
|
|
7
|
+
const o = r.theme_preference || l;
|
|
8
|
+
return o !== "system" ? o : n();
|
|
9
|
+
});
|
|
10
|
+
return e(i.Provider, {
|
|
11
|
+
value: a,
|
|
12
|
+
get children() {
|
|
13
|
+
return e(m, {
|
|
14
|
+
localStore: r,
|
|
15
|
+
setLocalStore: t,
|
|
16
|
+
get children() {
|
|
17
|
+
return e(u.Provider, {
|
|
18
|
+
value: s,
|
|
19
|
+
get children() {
|
|
20
|
+
return e(v, {
|
|
21
|
+
localStore: r,
|
|
22
|
+
setLocalStore: t
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}, C = p;
|
|
31
|
+
export {
|
|
32
|
+
C as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
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-C65wOvkm.js";
|
|
2
|
+
import { M as v, O as C, Q as e } from "./index-C4fEzRab.js";
|
|
3
|
+
var h = (t) => {
|
|
4
|
+
const [r, o] = s({
|
|
5
|
+
prefix: "TanstackQueryDevtools"
|
|
6
|
+
}), a = v(), l = C(() => {
|
|
7
|
+
const n = r.theme_preference || c;
|
|
8
|
+
return n !== "system" ? n : a();
|
|
9
|
+
});
|
|
10
|
+
return e(d.Provider, {
|
|
11
|
+
value: t,
|
|
12
|
+
get children() {
|
|
13
|
+
return e(u, {
|
|
14
|
+
disabled: !0,
|
|
15
|
+
localStore: r,
|
|
16
|
+
setLocalStore: o,
|
|
17
|
+
get children() {
|
|
18
|
+
return e(i.Provider, {
|
|
19
|
+
value: l,
|
|
20
|
+
get children() {
|
|
21
|
+
return e(m, {
|
|
22
|
+
get children() {
|
|
23
|
+
return e(P, {
|
|
24
|
+
localStore: r,
|
|
25
|
+
setLocalStore: o,
|
|
26
|
+
get onClose() {
|
|
27
|
+
return t.onClose;
|
|
28
|
+
},
|
|
29
|
+
showPanelViewOnly: !0
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}, p = h;
|
|
40
|
+
export {
|
|
41
|
+
p as default
|
|
42
|
+
};
|