@openmrs/esm-active-visits-app 3.0.2-pre.316 → 3.0.2-pre.339
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/415.js +1 -1
- package/dist/415.js.map +1 -1
- package/dist/897.js +1 -1
- package/dist/897.js.map +1 -1
- package/dist/openmrs-esm-active-visits-app.js.buildmanifest.json +6 -6
- package/package.json +2 -2
- package/src/active-visits-widget/active-visits.component.tsx +2 -4
- package/src/active-visits-widget/active-visits.resource.tsx +5 -8
- package/src/visits-summary/visit-detail.component.tsx +3 -2
- package/src/visits-summary/visit.resource.ts +1 -1
|
@@ -225,9 +225,9 @@
|
|
|
225
225
|
"initial": false,
|
|
226
226
|
"entry": false,
|
|
227
227
|
"recorded": false,
|
|
228
|
-
"size":
|
|
228
|
+
"size": 92115,
|
|
229
229
|
"sizes": {
|
|
230
|
-
"javascript":
|
|
230
|
+
"javascript": 92115
|
|
231
231
|
},
|
|
232
232
|
"names": [],
|
|
233
233
|
"idHints": [],
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
"auxiliaryFiles": [
|
|
241
241
|
"415.js.map"
|
|
242
242
|
],
|
|
243
|
-
"hash": "
|
|
243
|
+
"hash": "e621859cbec0364fb02c",
|
|
244
244
|
"childrenByOrder": {}
|
|
245
245
|
},
|
|
246
246
|
{
|
|
@@ -392,10 +392,10 @@
|
|
|
392
392
|
"initial": false,
|
|
393
393
|
"entry": false,
|
|
394
394
|
"recorded": false,
|
|
395
|
-
"size":
|
|
395
|
+
"size": 95886,
|
|
396
396
|
"sizes": {
|
|
397
397
|
"consume-shared": 42,
|
|
398
|
-
"javascript":
|
|
398
|
+
"javascript": 95844
|
|
399
399
|
},
|
|
400
400
|
"names": [],
|
|
401
401
|
"idHints": [],
|
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
"auxiliaryFiles": [
|
|
409
409
|
"897.js.map"
|
|
410
410
|
],
|
|
411
|
-
"hash": "
|
|
411
|
+
"hash": "ccc49cdb974163fd1890",
|
|
412
412
|
"childrenByOrder": {}
|
|
413
413
|
},
|
|
414
414
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-active-visits-app",
|
|
3
|
-
"version": "3.0.2-pre.
|
|
3
|
+
"version": "3.0.2-pre.339",
|
|
4
4
|
"description": "Active visits widget microfrontend for the OpenMRS SPA",
|
|
5
5
|
"browser": "dist/openmrs-esm-active-visits-app.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"react-router-dom": "5.x",
|
|
52
52
|
"rxjs": "6.x"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "aed64eca1589e28b4f53a49475dfce8d047fac31"
|
|
55
55
|
}
|
|
@@ -28,9 +28,9 @@ import {
|
|
|
28
28
|
parseDate,
|
|
29
29
|
} from '@openmrs/esm-framework';
|
|
30
30
|
import { useTranslation } from 'react-i18next';
|
|
31
|
+
import { EmptyDataIllustration } from './empty-data-illustration.component';
|
|
31
32
|
import { ActiveVisit, useActiveVisits } from './active-visits.resource';
|
|
32
33
|
import styles from './active-visits.scss';
|
|
33
|
-
import { EmptyDataIllustration } from './empty-data-illustration.component';
|
|
34
34
|
|
|
35
35
|
interface PaginationData {
|
|
36
36
|
goTo: (page: number) => void;
|
|
@@ -42,11 +42,9 @@ const ActiveVisitsTable = () => {
|
|
|
42
42
|
const { t } = useTranslation();
|
|
43
43
|
const config = useConfig();
|
|
44
44
|
const layout = useLayoutType();
|
|
45
|
-
|
|
46
45
|
const { data: activeVisits, isError, isLoading, isValidating } = useActiveVisits();
|
|
47
|
-
|
|
48
46
|
const desktopView = layout === 'desktop';
|
|
49
|
-
const pageSizes = config?.activeVisits?.pageSizes ?? [10, 20, 50];
|
|
47
|
+
const pageSizes = config?.activeVisits?.pageSizes ?? [10, 20, 30, 40, 50];
|
|
50
48
|
const [currentPageSize, setPageSize] = useState(config?.activeVisits?.pageSize ?? 10);
|
|
51
49
|
const [searchString, setSearchString] = useState('');
|
|
52
50
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import useSWR from 'swr';
|
|
2
|
-
import { openmrsFetch, Visit, SessionUser } from '@openmrs/esm-framework';
|
|
3
2
|
import dayjs from 'dayjs';
|
|
3
|
+
import { openmrsFetch, Visit, SessionUser } from '@openmrs/esm-framework';
|
|
4
4
|
|
|
5
5
|
export interface ActiveVisit {
|
|
6
6
|
age: string;
|
|
@@ -17,8 +17,8 @@ export interface ActiveVisit {
|
|
|
17
17
|
|
|
18
18
|
export function useActiveVisits() {
|
|
19
19
|
const { data: currentUserSession } = useCurrentSession();
|
|
20
|
-
const sessionLocation = currentUserSession?.data?.sessionLocation?.uuid;
|
|
21
20
|
const startDate = dayjs().format('YYYY-MM-DD');
|
|
21
|
+
const sessionLocation = currentUserSession?.data?.sessionLocation?.uuid;
|
|
22
22
|
|
|
23
23
|
const customRepresentation =
|
|
24
24
|
'custom:(uuid,patient:(uuid,identifiers:(identifier,uuid),person:(age,display,gender,uuid)),' +
|
|
@@ -27,11 +27,8 @@ export function useActiveVisits() {
|
|
|
27
27
|
startDate +
|
|
28
28
|
'&location=' +
|
|
29
29
|
sessionLocation;
|
|
30
|
-
|
|
31
|
-
const { data, error, isValidating } = useSWR<{ data: { results: Array<Visit> } }, Error>(
|
|
32
|
-
`/ws/rest/v1/visit?includeInactive=false&v=${customRepresentation}`,
|
|
33
|
-
openmrsFetch,
|
|
34
|
-
);
|
|
30
|
+
const url = `/ws/rest/v1/visit?includeInactive=false&v=${customRepresentation}`;
|
|
31
|
+
const { data, error, isValidating } = useSWR<{ data: { results: Array<Visit> } }, Error>(url, openmrsFetch);
|
|
35
32
|
|
|
36
33
|
const mapVisitProperties = (visit: Visit): ActiveVisit => ({
|
|
37
34
|
age: visit?.patient?.person?.age,
|
|
@@ -41,7 +38,7 @@ export function useActiveVisits() {
|
|
|
41
38
|
location: visit?.location?.uuid,
|
|
42
39
|
name: visit?.patient?.person?.display,
|
|
43
40
|
patientUuid: visit?.patient?.uuid,
|
|
44
|
-
visitStartTime: visit
|
|
41
|
+
visitStartTime: visit?.startDatetime,
|
|
45
42
|
visitType: visit?.visitType?.display,
|
|
46
43
|
visitUuid: visit.uuid,
|
|
47
44
|
});
|
|
@@ -15,8 +15,7 @@ interface VisitDetailComponentProps {
|
|
|
15
15
|
const VisitDetailComponent: React.FC<VisitDetailComponentProps> = ({ visitUuid, patientUuid }) => {
|
|
16
16
|
const { t } = useTranslation();
|
|
17
17
|
const [listView, setView] = useState(true);
|
|
18
|
-
|
|
19
|
-
const { data: visit, isError, isLoading, isValidating } = useVisit(visitUuid);
|
|
18
|
+
const { visit, isError, isLoading, isValidating } = useVisit(visitUuid);
|
|
20
19
|
|
|
21
20
|
const encounters = useMemo(
|
|
22
21
|
() =>
|
|
@@ -65,6 +64,8 @@ const VisitDetailComponent: React.FC<VisitDetailComponentProps> = ({ visitUuid,
|
|
|
65
64
|
{!listView && <VisitSummary encounters={visit.encounters} patientUuid={patientUuid} />}
|
|
66
65
|
</div>
|
|
67
66
|
);
|
|
67
|
+
} else {
|
|
68
|
+
return null;
|
|
68
69
|
}
|
|
69
70
|
};
|
|
70
71
|
|