@kenyaemr/esm-appointments-app 7.0.3-pre.88 → 7.0.3-pre.94
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/.turbo/turbo-build.log +23 -22
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/23.js +2 -0
- package/dist/23.js.map +1 -0
- package/dist/265.js +1 -1
- package/dist/271.js +1 -1
- package/dist/319.js +1 -1
- package/dist/460.js +1 -1
- package/dist/529.js +1 -1
- package/dist/574.js +1 -1
- package/dist/581.js +1 -0
- package/dist/581.js.map +1 -0
- package/dist/644.js +1 -1
- package/dist/646.js +2 -0
- package/dist/646.js.map +1 -0
- package/dist/757.js +1 -1
- package/dist/788.js +1 -1
- package/dist/807.js +1 -1
- package/dist/833.js +1 -1
- package/dist/85.js +1 -0
- package/dist/85.js.map +1 -0
- package/dist/89.js +1 -0
- package/dist/89.js.map +1 -0
- package/dist/kenyaemr-esm-appointments-app.js +1 -1
- package/dist/kenyaemr-esm-appointments-app.js.buildmanifest.json +167 -143
- package/dist/kenyaemr-esm-appointments-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/admin/appointment-services/appointment-services.scss +5 -5
- package/src/appointments/appointment-tabs.scss +6 -7
- package/src/appointments/appointment-tabs.test.tsx +4 -11
- package/src/appointments/common-components/appointments-actions.test.tsx +121 -74
- package/src/appointments/common-components/appointments-table.scss +6 -6
- package/src/appointments/common-components/appointments-table.test.tsx +30 -32
- package/src/appointments/common-components/end-appointment.test.tsx +20 -19
- package/src/appointments/details/appointment-details.component.tsx +1 -1
- package/src/appointments/details/appointment-details.scss +13 -13
- package/src/appointments/details/appointment-details.test.tsx +49 -48
- package/src/appointments/scheduled/scheduled-appointments.component.tsx +1 -1
- package/src/appointments/scheduled/scheduled-appointments.scss +3 -1
- package/src/appointments/unscheduled/unscheduled-appointments.test.tsx +35 -37
- package/src/appointments.component.tsx +0 -1
- package/src/calendar/appointments-calendar-view-view.scss +3 -4
- package/src/calendar/appointments-calendar-view.test.tsx +1 -5
- package/src/calendar/header/calendar-header.scss +4 -4
- package/src/calendar/monthly/days-of-week.scss +1 -1
- package/src/calendar/monthly/monthly-view-workload.scss +10 -10
- package/src/config-schema.ts +88 -90
- package/src/empty-state/empty-state.scss +4 -4
- package/src/form/appointments-form.component.tsx +58 -26
- package/src/form/appointments-form.resource.ts +2 -2
- package/src/form/appointments-form.scss +11 -11
- package/src/form/appointments-form.test.tsx +42 -43
- package/src/header/appointments-header.scss +12 -12
- package/src/home/home-appointments.scss +0 -1
- package/src/homepage-tile/appointments-tile.component.tsx +23 -0
- package/src/homepage-tile/appointments-tile.scss +39 -0
- package/src/homepage-tile/appointments.resource.ts +15 -0
- package/src/hooks/useClinicalMetrics.ts +1 -1
- package/src/hooks/useDefaultLocation.ts +1 -1
- package/src/hooks/usePatientAppointmentHistory.ts +1 -1
- package/src/hooks/useProviders.ts +1 -1
- package/src/index.ts +5 -0
- package/src/metrics/appointments-metrics.scss +0 -1
- package/src/metrics/appointments-metrics.test.tsx +25 -31
- package/src/metrics/metrics-card.component.tsx +6 -33
- package/src/metrics/metrics-card.scss +8 -8
- package/src/metrics/metrics-header.scss +1 -1
- package/src/past-visit/past-visit.component.tsx +1 -1
- package/src/past-visit/past-visit.resource.ts +1 -1
- package/src/past-visit/past-visit.scss +19 -14
- package/src/patient-appointments/patient-appointments-action-menu.scss +6 -0
- package/src/patient-appointments/patient-appointments-base.component.tsx +6 -6
- package/src/patient-appointments/patient-appointments-base.scss +24 -29
- package/src/patient-appointments/patient-appointments-base.test.tsx +13 -11
- package/src/patient-appointments/patient-appointments-header.scss +4 -5
- package/src/patient-appointments/patient-appointments-overview.component.tsx +2 -2
- package/src/patient-appointments/patient-appointments-overview.scss +0 -1
- package/src/patient-appointments/patient-appointments.resource.ts +1 -1
- package/src/patient-appointments/patient-upcoming-appointments-card.component.tsx +3 -3
- package/src/patient-appointments/patient-upcoming-appointments-card.scss +11 -10
- package/src/patient-search/patient-search.scss +15 -14
- package/src/routes.json +5 -0
- package/src/types/index.ts +4 -0
- package/src/workload/monthly-view-workload/monthly-workload.scss +21 -6
- package/src/workload/monthly-view-workload/monthlyWorkCard.tsx +2 -2
- package/src/workload/workload.scss +3 -3
- package/translations/am.json +2 -0
- package/translations/ar.json +2 -0
- package/translations/en.json +2 -0
- package/translations/es.json +2 -0
- package/translations/fr.json +30 -28
- package/translations/he.json +2 -0
- package/translations/km.json +2 -0
- package/translations/zh.json +2 -0
- package/translations/zh_CN.json +2 -0
- package/dist/224.js +0 -1
- package/dist/224.js.map +0 -1
- package/dist/445.js +0 -2
- package/dist/445.js.map +0 -1
- package/dist/857.js +0 -2
- package/dist/857.js.map +0 -1
- package/dist/904.js +0 -1
- package/dist/904.js.map +0 -1
- package/src/root.scss +0 -50
- /package/dist/{857.js.LICENSE.txt → 23.js.LICENSE.txt} +0 -0
- /package/dist/{445.js.LICENSE.txt → 646.js.LICENSE.txt} +0 -0
- /package/src/helpers/{time.tsx → time.ts} +0 -0
- /package/src/patient-appointments/{patient-appointments-table.tsx → patient-appointments-table.component.tsx} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
@use '@carbon/colors';
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@use '@carbon/
|
|
4
|
-
@
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
4
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
5
|
|
|
6
6
|
.header {
|
|
7
7
|
@include type.type-style('body-compact-02');
|
|
8
8
|
color: $text-02;
|
|
9
|
-
height:
|
|
9
|
+
height: layout.$spacing-12;
|
|
10
10
|
background-color: $ui-02;
|
|
11
11
|
border-bottom: 1px solid $ui-03;
|
|
12
12
|
display: flex;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
.right-justified-items {
|
|
23
23
|
@include type.type-style('body-compact-02');
|
|
24
24
|
color: $text-02;
|
|
25
|
-
margin:
|
|
25
|
+
margin: layout.$spacing-03;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.page-name {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.page-labels {
|
|
33
|
-
margin:
|
|
33
|
+
margin: layout.$spacing-05 0;
|
|
34
34
|
|
|
35
35
|
p:first-of-type {
|
|
36
|
-
margin-bottom:
|
|
36
|
+
margin-bottom: layout.$spacing-02;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
display: flex;
|
|
48
48
|
align-items: center;
|
|
49
49
|
justify-content: flex-end;
|
|
50
|
-
margin-top:
|
|
50
|
+
margin-top: layout.$spacing-02;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.value {
|
|
54
|
-
margin-left:
|
|
54
|
+
margin-left: layout.$spacing-02;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.middot {
|
|
58
|
-
margin: 0
|
|
58
|
+
margin: 0 layout.$spacing-03;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.view {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
.datePicker {
|
|
66
66
|
background-color: transparent;
|
|
67
|
-
width:
|
|
67
|
+
width: layout.$spacing-13;
|
|
68
68
|
border: none;
|
|
69
69
|
& > input {
|
|
70
70
|
color: colors.$blue-10;
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
:global(.cds--dropdown--inline .cds--list-box__menu) {
|
|
81
|
-
left: -
|
|
81
|
+
left: -(layout.$spacing-10);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tile } from '@carbon/react';
|
|
3
|
+
import styles from './appointments-tile.scss';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import useAppointmentsData from './appointments.resource';
|
|
6
|
+
|
|
7
|
+
const AppointmentsTile: React.FC = () => {
|
|
8
|
+
const { data: appointmentsData } = useAppointmentsData();
|
|
9
|
+
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Tile className={styles.tileContainer}>
|
|
14
|
+
<header className={styles.tileHeader}>{t('scheduledForToday', 'Scheduled For Today')}</header>
|
|
15
|
+
<div className={styles.displayDetails}>
|
|
16
|
+
<div className={styles.countLabel}>{t('patients', 'Patients')}</div>
|
|
17
|
+
<div className={styles.displayData}>{appointmentsData?.length ?? 0}</div>
|
|
18
|
+
</div>
|
|
19
|
+
</Tile>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default AppointmentsTile;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@carbon/colors';
|
|
4
|
+
@use '@carbon/layout';
|
|
5
|
+
|
|
6
|
+
.tileContainer {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
align-items: space-between;
|
|
10
|
+
background-color: colors.$white;
|
|
11
|
+
border: 1px solid colors.$gray-20;
|
|
12
|
+
height: 7.875rem;
|
|
13
|
+
padding: layout.$spacing-05;
|
|
14
|
+
margin: layout.$spacing-03;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tileHeader {
|
|
18
|
+
@include type.type-style('heading-01');
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
line-height: 1.28572;
|
|
21
|
+
letter-spacing: 0.16px;
|
|
22
|
+
color: colors.$gray-70;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.displayDetails {
|
|
26
|
+
margin-top: layout.$spacing-06;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.displayData {
|
|
30
|
+
font-size: 1.75rem;
|
|
31
|
+
font-weight: 400;
|
|
32
|
+
line-height: 1.28572;
|
|
33
|
+
color: colors.$black;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.countLabel {
|
|
37
|
+
@include type.type-style('label-01');
|
|
38
|
+
color: $text-02;
|
|
39
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWR from 'swr';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
|
|
5
|
+
const useAppointmentsData = () => {
|
|
6
|
+
const appointmentDate = dayjs(new Date().setHours(0, 0, 0, 0)).toISOString();
|
|
7
|
+
|
|
8
|
+
const url = `${restBaseUrl}/appointment/all?forDate=${appointmentDate}`;
|
|
9
|
+
|
|
10
|
+
const { data, error, isLoading } = useSWR<{ data: Array<any> }>(url, openmrsFetch);
|
|
11
|
+
|
|
12
|
+
return { data: data?.data, error, isLoading };
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default useAppointmentsData;
|
|
@@ -42,7 +42,7 @@ export function usePatientAppointmentHistory(patientUuid: string) {
|
|
|
42
42
|
|
|
43
43
|
return {
|
|
44
44
|
appointmentsCount: { missedAppointments, completedAppointments, cancelledAppointments, upcomingAppointments },
|
|
45
|
-
|
|
45
|
+
error,
|
|
46
46
|
isLoading,
|
|
47
47
|
isValidating,
|
|
48
48
|
};
|
package/src/index.ts
CHANGED
|
@@ -109,3 +109,8 @@ export const endAppointmentModal = getAsyncLifecycle(
|
|
|
109
109
|
() => import('./appointments/common-components/end-appointment.modal'),
|
|
110
110
|
options,
|
|
111
111
|
);
|
|
112
|
+
|
|
113
|
+
export const homeAppointmentsTile = getAsyncLifecycle(
|
|
114
|
+
() => import('./homepage-tile/appointments-tile.component'),
|
|
115
|
+
options,
|
|
116
|
+
);
|
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
3
|
+
import { type FetchResponse, openmrsFetch } from '@openmrs/esm-framework';
|
|
4
4
|
import { mockAppointmentMetrics, mockProvidersCount, mockStartTime } from '__mocks__';
|
|
5
5
|
import AppointmentsMetrics from './appointments-metrics.component';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const mockOpenmrsFetch = jest.mocked(openmrsFetch);
|
|
8
8
|
|
|
9
|
-
jest.mock('../hooks/useClinicalMetrics', () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
startDate: mockStartTime.startTime,
|
|
29
|
-
})),
|
|
30
|
-
};
|
|
31
|
-
});
|
|
9
|
+
jest.mock('../hooks/useClinicalMetrics', () => ({
|
|
10
|
+
...jest.requireActual('../hooks/useClinicalMetrics'),
|
|
11
|
+
useClinicalMetrics: jest.fn().mockReturnValue({
|
|
12
|
+
highestServiceLoad: mockAppointmentMetrics.highestServiceLoad,
|
|
13
|
+
isLoading: mockAppointmentMetrics.isLoading,
|
|
14
|
+
error: mockAppointmentMetrics.error,
|
|
15
|
+
}),
|
|
16
|
+
useAllAppointmentsByDate: jest.fn().mockReturnValue({
|
|
17
|
+
totalProviders: mockProvidersCount.totalProviders,
|
|
18
|
+
isLoading: mockProvidersCount.isLoading,
|
|
19
|
+
error: mockProvidersCount.error,
|
|
20
|
+
}),
|
|
21
|
+
useScheduledAppointment: jest.fn().mockReturnValue({
|
|
22
|
+
totalScheduledAppointments: mockAppointmentMetrics.totalAppointments,
|
|
23
|
+
}),
|
|
24
|
+
useAppointmentDate: jest.fn().mockReturnValue({
|
|
25
|
+
startDate: mockStartTime.startTime,
|
|
26
|
+
}),
|
|
27
|
+
}));
|
|
32
28
|
|
|
33
29
|
describe('Appointment metrics', () => {
|
|
34
30
|
it('renders metrics from the appointments list', async () => {
|
|
35
|
-
|
|
31
|
+
mockOpenmrsFetch.mockResolvedValueOnce({
|
|
32
|
+
data: [],
|
|
33
|
+
} as unknown as FetchResponse);
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
render(<AppointmentsMetrics appointmentServiceType="consultation-service-uuid" />);
|
|
38
36
|
|
|
39
37
|
await screen.findByText(/appointment metrics/i);
|
|
40
38
|
expect(screen.getByText(/scheduled appointments/i)).toBeInTheDocument();
|
|
@@ -43,7 +41,3 @@ describe('Appointment metrics', () => {
|
|
|
43
41
|
expect(screen.getByText(/4/i)).toBeInTheDocument();
|
|
44
42
|
});
|
|
45
43
|
});
|
|
46
|
-
|
|
47
|
-
function renderAppointmentMetrics() {
|
|
48
|
-
render(<AppointmentsMetrics appointmentServiceType="consultation-service-uuid" />);
|
|
49
|
-
}
|
|
@@ -1,41 +1,23 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useContext, useMemo } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
|
|
5
5
|
dayjs.extend(isSameOrBefore);
|
|
6
6
|
import isEmpty from 'lodash-es/isEmpty';
|
|
7
|
-
import { ConfigurableLink } from '@openmrs/esm-framework';
|
|
8
|
-
import { ArrowRight } from '@carbon/react/icons';
|
|
9
|
-
import { basePath, spaHomePage } from '../constants';
|
|
10
7
|
import styles from './metrics-card.scss';
|
|
8
|
+
import SelectedDateContext from '../hooks/selectedDateContext';
|
|
11
9
|
|
|
12
10
|
interface MetricsCardProps {
|
|
13
11
|
label: string;
|
|
14
12
|
value: number;
|
|
15
13
|
headerLabel: string;
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
view?: string;
|
|
18
14
|
count?: { pendingAppointments: Array<any>; arrivedAppointments: Array<any> };
|
|
19
|
-
appointmentDate?: string;
|
|
20
15
|
}
|
|
21
16
|
|
|
22
|
-
const MetricsCard: React.FC<MetricsCardProps> = ({
|
|
23
|
-
label,
|
|
24
|
-
value,
|
|
25
|
-
headerLabel,
|
|
26
|
-
children,
|
|
27
|
-
view,
|
|
28
|
-
count,
|
|
29
|
-
appointmentDate,
|
|
30
|
-
}) => {
|
|
17
|
+
const MetricsCard: React.FC<MetricsCardProps> = ({ label, value, headerLabel, count }) => {
|
|
31
18
|
const { t } = useTranslation();
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
const metricsLink = {
|
|
35
|
-
patients: 'appointments-list/scheduled',
|
|
36
|
-
highVolume: 'appointments-list/high-volume-service',
|
|
37
|
-
providers: 'appointments-list/providers-link',
|
|
38
|
-
};
|
|
19
|
+
const { selectedDate } = useContext(SelectedDateContext);
|
|
20
|
+
const isSelectedDateInPast = useMemo(() => dayjs(selectedDate).isBefore(dayjs(), 'date'), [selectedDate]);
|
|
39
21
|
|
|
40
22
|
return (
|
|
41
23
|
<article className={styles.container}>
|
|
@@ -43,16 +25,7 @@ const MetricsCard: React.FC<MetricsCardProps> = ({
|
|
|
43
25
|
<div className={styles.tileHeader}>
|
|
44
26
|
<div className={styles.headerLabelContainer}>
|
|
45
27
|
<label className={styles.headerLabel}>{headerLabel}</label>
|
|
46
|
-
{children}
|
|
47
28
|
</div>
|
|
48
|
-
{view && (
|
|
49
|
-
<div className={styles.link}>
|
|
50
|
-
<ConfigurableLink className={styles.link} to={`${spaHomePage}${basePath}/${metricsLink[view]}`}>
|
|
51
|
-
<span style={{ fontSize: '0.825rem', marginRight: '0.325rem' }}>{t('view', 'View')}</span>{' '}
|
|
52
|
-
<ArrowRight size={16} className={styles.viewListBtn} />
|
|
53
|
-
</ConfigurableLink>
|
|
54
|
-
</div>
|
|
55
|
-
)}
|
|
56
29
|
</div>
|
|
57
30
|
<div className={styles.metricsGrid}>
|
|
58
31
|
<div>
|
|
@@ -62,7 +35,7 @@ const MetricsCard: React.FC<MetricsCardProps> = ({
|
|
|
62
35
|
{!isEmpty(count) && (
|
|
63
36
|
<div className={styles.countGrid}>
|
|
64
37
|
<span>{t('checkedIn', 'Checked in')}</span>
|
|
65
|
-
<span>{
|
|
38
|
+
<span>{isSelectedDateInPast ? t('missed', 'Missed') : t('notArrived', 'Not arrived')}</span>
|
|
66
39
|
<p style={{ color: '#319227' }}>{count.arrivedAppointments?.length}</p>
|
|
67
40
|
<p style={{ color: '#da1e28' }}>{count.pendingAppointments?.length}</p>
|
|
68
41
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@use '@carbon/styles/scss/spacing';
|
|
2
|
-
@use '@carbon/styles/scss/type';
|
|
3
1
|
@use '@carbon/colors';
|
|
4
|
-
@
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
4
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
5
|
|
|
6
6
|
.container {
|
|
7
7
|
flex-grow: 1;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
.tileContainer {
|
|
11
11
|
border: 1px solid $ui-03;
|
|
12
12
|
height: 7.875rem;
|
|
13
|
-
padding:
|
|
13
|
+
padding: layout.$spacing-05;
|
|
14
14
|
display: flex;
|
|
15
15
|
justify-content: space-between;
|
|
16
16
|
flex-direction: column;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
display: flex;
|
|
21
21
|
justify-content: space-between;
|
|
22
22
|
align-items: baseline;
|
|
23
|
-
margin-bottom:
|
|
23
|
+
margin-bottom: layout.$spacing-03;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.headerLabel {
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
display: grid;
|
|
62
62
|
grid-template-columns: 1fr 1fr;
|
|
63
63
|
justify-self: flex-end;
|
|
64
|
-
column-gap:
|
|
65
|
-
row-gap:
|
|
66
|
-
margin:
|
|
64
|
+
column-gap: layout.$spacing-03;
|
|
65
|
+
row-gap: layout.$spacing-03;
|
|
66
|
+
margin: layout.$spacing-03;
|
|
67
67
|
|
|
68
68
|
& > span {
|
|
69
69
|
font-size: 0.625rem !important;
|
|
@@ -25,7 +25,7 @@ export interface FormattedEncounter {
|
|
|
25
25
|
|
|
26
26
|
const PastVisit: React.FC<PastVisitProps> = ({ patientUuid }) => {
|
|
27
27
|
const { t } = useTranslation();
|
|
28
|
-
const { data: pastVisits,
|
|
28
|
+
const { data: pastVisits, error, isLoading } = usePastVisits(patientUuid);
|
|
29
29
|
const [selectedTabIndex, setSelectedTabIndex] = useState(0);
|
|
30
30
|
const isTablet = useLayoutType() === 'tablet';
|
|
31
31
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
5
|
.wrapper {
|
|
6
|
-
margin-top:
|
|
6
|
+
margin-top: layout.$spacing-03;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.bodyShort02 {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
.date {
|
|
18
18
|
@include type.type-style('label-01');
|
|
19
19
|
color: $text-02;
|
|
20
|
-
margin: 0
|
|
20
|
+
margin: layout.$spacing-03 0 layout.$spacing-02;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.visitType {
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
.container {
|
|
28
28
|
background-color: $ui-background;
|
|
29
29
|
border: 1px solid $grey-2;
|
|
30
|
-
padding:
|
|
31
|
-
margin:
|
|
30
|
+
padding: layout.$spacing-05;
|
|
31
|
+
margin: layout.$spacing-05 0 layout.$spacing-05;
|
|
32
32
|
width: 100%;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.tabs > :global(.cds--tab-content) {
|
|
36
|
-
padding:
|
|
36
|
+
padding: layout.$spacing-05 0 !important;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.header::after {
|
|
40
40
|
content: '';
|
|
41
41
|
display: block;
|
|
42
|
-
width:
|
|
42
|
+
width: layout.$spacing-07;
|
|
43
43
|
padding-top: 0.188rem;
|
|
44
44
|
border-bottom: 0.375rem solid var(--brand-03);
|
|
45
45
|
}
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.verticalTabs {
|
|
58
|
-
margin:
|
|
58
|
+
margin: layout.$spacing-04 0;
|
|
59
59
|
|
|
60
60
|
&:global(.cds--tabs--scrollable .cds--tabs--scrollable__nav-item + .cds--tabs--scrollable__nav-item) {
|
|
61
|
-
margin-left:
|
|
61
|
+
margin-left: 0;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
|
|
69
69
|
.desktopTabs {
|
|
70
70
|
button {
|
|
71
|
-
height:
|
|
71
|
+
height: layout.$spacing-07;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.tabletTabs {
|
|
76
76
|
button {
|
|
77
|
-
height:
|
|
77
|
+
height: layout.$spacing-09;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -98,9 +98,14 @@
|
|
|
98
98
|
|
|
99
99
|
.tabContent {
|
|
100
100
|
border-top: 1px solid $ui-03;
|
|
101
|
-
padding:
|
|
101
|
+
padding: layout.$spacing-05 0;
|
|
102
102
|
width: 70%;
|
|
103
103
|
}
|
|
104
|
+
|
|
104
105
|
.textColor {
|
|
105
106
|
color: $color-blue-60-2;
|
|
106
107
|
}
|
|
108
|
+
|
|
109
|
+
.text02 {
|
|
110
|
+
color: $text-02;
|
|
111
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useContext, useState } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
2
|
import dayjs from 'dayjs';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Button, ContentSwitcher, DataTableSkeleton, InlineLoading, Layer, Switch, Tile } from '@carbon/react';
|
|
5
5
|
import { Add } from '@carbon/react/icons';
|
|
6
6
|
import { launchWorkspace, useLayoutType } from '@openmrs/esm-framework';
|
|
7
7
|
import { CardHeader, EmptyDataIllustration, ErrorState, launchPatientWorkspace } from '@openmrs/esm-patient-common-lib';
|
|
8
8
|
import { usePatientAppointments } from './patient-appointments.resource';
|
|
9
|
-
import PatientAppointmentsTable from './patient-appointments-table';
|
|
9
|
+
import PatientAppointmentsTable from './patient-appointments-table.component';
|
|
10
10
|
import styles from './patient-appointments-base.scss';
|
|
11
11
|
|
|
12
12
|
import PatientAppointmentContext, { PatientAppointmentContextTypes } from '../hooks/patientAppointmentContext';
|
|
@@ -32,7 +32,7 @@ const PatientAppointmentsBase: React.FC<PatientAppointmentsBaseProps> = ({ patie
|
|
|
32
32
|
const startDate = dayjs(new Date().toISOString()).subtract(6, 'month').toISOString();
|
|
33
33
|
const {
|
|
34
34
|
data: appointmentsData,
|
|
35
|
-
|
|
35
|
+
error,
|
|
36
36
|
isLoading,
|
|
37
37
|
isValidating,
|
|
38
38
|
} = usePatientAppointments(patientUuid, startDate, new AbortController());
|
|
@@ -49,10 +49,10 @@ const PatientAppointmentsBase: React.FC<PatientAppointmentsBaseProps> = ({ patie
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
if (isLoading) return <DataTableSkeleton role="progressbar" compact={!isTablet} zebra />;
|
|
52
|
-
if (
|
|
53
|
-
return <ErrorState headerTitle={headerTitle} error={
|
|
52
|
+
if (error) {
|
|
53
|
+
return <ErrorState headerTitle={headerTitle} error={error} />;
|
|
54
54
|
}
|
|
55
|
-
if (Object.keys(appointmentsData)?.length) {
|
|
55
|
+
if (appointmentsData && Object.keys(appointmentsData)?.length) {
|
|
56
56
|
return (
|
|
57
57
|
<div className={styles.widgetCard}>
|
|
58
58
|
<CardHeader title={headerTitle}>
|