@openmrs/esm-appointments-app 8.2.2-pre.4810 → 8.2.2-pre.4813
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 +7 -7
- package/dist/1644.js +1 -1
- package/dist/1901.js +1 -1
- package/dist/2016.js +1 -1
- package/dist/236.js +1 -1
- package/dist/2753.js +1 -1
- package/dist/2753.js.map +1 -1
- package/dist/2757.js +1 -1
- package/dist/2923.js +1 -1
- package/dist/310.js +1 -1
- package/dist/3260.js +1 -1
- package/dist/3260.js.map +1 -1
- package/dist/3574.js +1 -1
- package/dist/3581.js +1 -1
- package/dist/3652.js +1 -1
- package/dist/3952.js +1 -1
- package/dist/3952.js.map +1 -1
- package/dist/4272.js +1 -1
- package/dist/4378.js +1 -1
- package/dist/4460.js +1 -1
- package/dist/4705.js +1 -1
- package/dist/5240.js +1 -1
- package/dist/529.js +1 -1
- package/dist/5336.js +1 -1
- package/dist/539.js +1 -1
- package/dist/5673.js +1 -1
- package/dist/5711.js +1 -1
- package/dist/5737.js +1 -1
- package/dist/5833.js +1 -1
- package/dist/5910.js +1 -1
- package/dist/5962.js +1 -1
- package/dist/6179.js +1 -1
- package/dist/646.js +1 -1
- package/dist/6497.js +1 -1
- package/dist/6566.js +1 -1
- package/dist/6727.js +1 -1
- package/dist/681.js +1 -1
- package/dist/681.js.map +1 -1
- package/dist/744.js +1 -1
- package/dist/7807.js +1 -1
- package/dist/8271.js +1 -1
- package/dist/8319.js +1 -1
- package/dist/8323.js +1 -1
- package/dist/8607.js +1 -1
- package/dist/8607.js.map +1 -1
- package/dist/8615.js +2 -0
- package/dist/8615.js.map +1 -0
- package/dist/8788.js +1 -1
- package/dist/899.js +1 -1
- package/dist/9190.js +1 -1
- package/dist/9261.js +1 -1
- package/dist/9269.js +1 -1
- package/dist/9579.js +1 -1
- package/dist/main.js +1 -1
- package/dist/openmrs-esm-appointments-app.js.buildmanifest.json +146 -146
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/appointments/appointment-tabs.component.tsx +1 -1
- package/src/appointments/common-components/appointments-table.component.tsx +22 -1
- package/src/appointments/common-components/appointments-table.scss +26 -0
- package/src/appointments/scheduled/appointments-list.component.tsx +9 -2
- package/src/appointments/scheduled/early-appointments.component.tsx +1 -1
- package/src/appointments/scheduled/scheduled-appointments.component.tsx +2 -2
- package/src/appointments/utils.tsx +3 -3
- package/src/appointments.component.tsx +2 -2
- package/src/appointments.test.tsx +1 -6
- package/src/header/appointments-header.component.tsx +26 -17
- package/src/header/appointments-header.scss +0 -11
- package/src/hooks/useClinicalMetrics.ts +2 -2
- package/src/metrics/appointments-metrics.component.tsx +3 -3
- package/translations/am.json +2 -2
- package/translations/ar.json +2 -2
- package/translations/bn.json +2 -2
- package/translations/de.json +2 -2
- package/translations/en.json +2 -2
- package/translations/es.json +2 -2
- package/translations/fr.json +2 -2
- package/translations/he.json +2 -2
- package/translations/hi.json +2 -2
- package/translations/hi_IN.json +2 -2
- package/translations/id.json +2 -2
- package/translations/it.json +2 -2
- package/translations/km.json +2 -2
- package/translations/ku.json +2 -2
- package/translations/lg.json +2 -2
- package/translations/ne.json +2 -2
- package/translations/pt.json +2 -2
- package/translations/pt_BR.json +2 -2
- package/translations/qu.json +2 -2
- package/translations/ru_RU.json +2 -2
- package/translations/si.json +2 -2
- package/translations/sw.json +2 -2
- package/translations/sw_KE.json +2 -2
- package/translations/tr.json +2 -2
- package/translations/tr_TR.json +2 -2
- package/translations/uk.json +2 -2
- package/translations/uz.json +2 -2
- package/translations/uz_UZ.json +2 -2
- package/translations/vi.json +2 -2
- package/translations/zh.json +2 -2
- package/translations/zh_CN.json +2 -2
- package/dist/8199.js +0 -2
- package/dist/8199.js.map +0 -1
- /package/dist/{8199.js.LICENSE.txt → 8615.js.LICENSE.txt} +0 -0
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"home-appointments","slot":"homepage-widgets-slot","component":"homeAppointments","order":1},{"name":"clinical-appointments-dashboard-link","slot":"homepage-dashboard-slot","component":"appointmentsDashboardLink","meta":{"name":"appointments","slot":"clinical-appointments-dashboard-slot","title":"Appointments"}},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"name":"appointments-calendar-dashboard-link","slot":"calendar-dashboard-slot","component":"appointmentsCalendarDashboardLink"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"early-appointments-panel","component":"earlyAppointments"},{"name":"appointments-form-workspace","component":"appointmentsFormWorkspace","meta":{"title":{"key":"createNewAppointment","default":"Create new appointment"}}},{"name":"patient-appointments-summary-dashboard","component":"patientAppointmentsSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":11,"meta":{"columns":1,"columnSpan":1,"hideDashboardTitle":true,"path":"Appointments","slot":"patient-chart-appointments-dashboard-slot","title":"Appointments"}},{"name":"patientAppointments-details-widget","component":"patientAppointmentsDetailedSummary","slot":"patient-chart-appointments-dashboard-slot","meta":{"columnSpan":1}},{"name":"patient-upcoming-appointment-widget","component":"patientUpcomingAppointmentsWidget","slot":"visit-form-top-slot"},{"name":"edit-appointments-form","component":"appointmentsForm","meta":{"title":{"key":"editAppointment","default":"Edit Appointment"}}},{"name":"search-patient","component":"searchPatient"},{"name":"create-appointment","component":"appointmentsForm","meta":{"title":{"key":"appointmentForm","default":"Appointment Form"}}},{"name":"add-appointment","component":"appointmentsForm","meta":{"title":{"key":"createNewAppointment","default":"Create new appointment"}}},{"name":"home-appointments-tile","slot":"home-metrics-tiles-slot","component":"homeAppointmentsTile"}],"modals":[{"name":"end-appointment-modal","component":"endAppointmentModal"},{"name":"patient-appointment-cancel-confirmation-dialog","component":"patientAppointmentsCancelConfirmationDialog"}],"version":"8.2.2-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"home-appointments","slot":"homepage-widgets-slot","component":"homeAppointments","order":1},{"name":"clinical-appointments-dashboard-link","slot":"homepage-dashboard-slot","component":"appointmentsDashboardLink","meta":{"name":"appointments","slot":"clinical-appointments-dashboard-slot","title":"Appointments"}},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"name":"appointments-calendar-dashboard-link","slot":"calendar-dashboard-slot","component":"appointmentsCalendarDashboardLink"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsList"},{"name":"early-appointments-panel","component":"earlyAppointments"},{"name":"appointments-form-workspace","component":"appointmentsFormWorkspace","meta":{"title":{"key":"createNewAppointment","default":"Create new appointment"}}},{"name":"patient-appointments-summary-dashboard","component":"patientAppointmentsSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":11,"meta":{"columns":1,"columnSpan":1,"hideDashboardTitle":true,"path":"Appointments","slot":"patient-chart-appointments-dashboard-slot","title":"Appointments"}},{"name":"patientAppointments-details-widget","component":"patientAppointmentsDetailedSummary","slot":"patient-chart-appointments-dashboard-slot","meta":{"columnSpan":1}},{"name":"patient-upcoming-appointment-widget","component":"patientUpcomingAppointmentsWidget","slot":"visit-form-top-slot"},{"name":"edit-appointments-form","component":"appointmentsForm","meta":{"title":{"key":"editAppointment","default":"Edit Appointment"}}},{"name":"search-patient","component":"searchPatient"},{"name":"create-appointment","component":"appointmentsForm","meta":{"title":{"key":"appointmentForm","default":"Appointment Form"}}},{"name":"add-appointment","component":"appointmentsForm","meta":{"title":{"key":"createNewAppointment","default":"Create new appointment"}}},{"name":"home-appointments-tile","slot":"home-metrics-tiles-slot","component":"homeAppointmentsTile"}],"modals":[{"name":"end-appointment-modal","component":"endAppointmentModal"},{"name":"patient-appointment-cancel-confirmation-dialog","component":"patientAppointmentsCancelConfirmationDialog"}],"version":"8.2.2-pre.4813"}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ import UnscheduledAppointments from './unscheduled/unscheduled-appointments.comp
|
|
|
8
8
|
import styles from './appointment-tabs.scss';
|
|
9
9
|
|
|
10
10
|
interface AppointmentTabsProps {
|
|
11
|
-
appointmentServiceType: string;
|
|
11
|
+
appointmentServiceType: string[];
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const AppointmentTabs: React.FC<AppointmentTabsProps> = ({ appointmentServiceType }) => {
|
|
@@ -53,9 +53,15 @@ interface AppointmentsTableProps {
|
|
|
53
53
|
appointments: Array<Appointment>;
|
|
54
54
|
isLoading: boolean;
|
|
55
55
|
tableHeading: string;
|
|
56
|
+
hasActiveFilters?: boolean;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
const AppointmentsTable: React.FC<AppointmentsTableProps> = ({
|
|
59
|
+
const AppointmentsTable: React.FC<AppointmentsTableProps> = ({
|
|
60
|
+
appointments,
|
|
61
|
+
isLoading,
|
|
62
|
+
tableHeading,
|
|
63
|
+
hasActiveFilters,
|
|
64
|
+
}) => {
|
|
59
65
|
const { t } = useTranslation();
|
|
60
66
|
const [pageSize, setPageSize] = useState(25);
|
|
61
67
|
const [searchString, setSearchString] = useState('');
|
|
@@ -113,6 +119,21 @@ const AppointmentsTable: React.FC<AppointmentsTableProps> = ({ appointments, isL
|
|
|
113
119
|
return <DataTableSkeleton role="progressbar" row={5} />;
|
|
114
120
|
}
|
|
115
121
|
|
|
122
|
+
if (hasActiveFilters && !appointments?.length) {
|
|
123
|
+
return (
|
|
124
|
+
<div className={styles.filterEmptyState}>
|
|
125
|
+
<Layer level={0}>
|
|
126
|
+
<Tile className={styles.filterEmptyStateTile}>
|
|
127
|
+
<p className={styles.filterEmptyStateContent}>
|
|
128
|
+
{t('noMatchingAppointments', 'No matching appointments found')}
|
|
129
|
+
</p>
|
|
130
|
+
<p className={styles.filterEmptyStateHelper}>{t('checkFilters', 'Check the filters above')}</p>
|
|
131
|
+
</Tile>
|
|
132
|
+
</Layer>
|
|
133
|
+
</div>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
116
137
|
if (!appointments?.length) {
|
|
117
138
|
return (
|
|
118
139
|
<EmptyState
|
|
@@ -131,3 +131,29 @@ html[dir='rtl'] {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
+
|
|
135
|
+
.filterEmptyState {
|
|
136
|
+
display: flex;
|
|
137
|
+
justify-content: center;
|
|
138
|
+
align-items: center;
|
|
139
|
+
margin: layout.$spacing-05 0;
|
|
140
|
+
padding: layout.$spacing-08 0;
|
|
141
|
+
text-align: center;
|
|
142
|
+
border: 1px solid $ui-03;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.filterEmptyStateTile {
|
|
146
|
+
margin: auto;
|
|
147
|
+
width: fit-content;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.filterEmptyStateContent {
|
|
151
|
+
@include type.type-style('heading-compact-02');
|
|
152
|
+
color: $text-02;
|
|
153
|
+
margin-bottom: layout.$spacing-03;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.filterEmptyStateHelper {
|
|
157
|
+
@include type.type-style('body-compact-01');
|
|
158
|
+
color: $text-02;
|
|
159
|
+
}
|
|
@@ -4,7 +4,7 @@ import { useAppointmentList } from '../../hooks/useAppointmentList';
|
|
|
4
4
|
import AppointmentsTable from '../common-components/appointments-table.component';
|
|
5
5
|
|
|
6
6
|
interface AppointmentsListProps {
|
|
7
|
-
appointmentServiceType?: string;
|
|
7
|
+
appointmentServiceType?: string[];
|
|
8
8
|
status?: string;
|
|
9
9
|
title: string;
|
|
10
10
|
date: string;
|
|
@@ -27,7 +27,14 @@ const AppointmentsList: React.FC<AppointmentsListProps> = ({
|
|
|
27
27
|
const activeAppointments = filterCancelled
|
|
28
28
|
? appointments.filter((appointment) => appointment.status !== 'Cancelled')
|
|
29
29
|
: appointments;
|
|
30
|
-
return
|
|
30
|
+
return (
|
|
31
|
+
<AppointmentsTable
|
|
32
|
+
appointments={activeAppointments}
|
|
33
|
+
isLoading={isLoading}
|
|
34
|
+
tableHeading={title}
|
|
35
|
+
hasActiveFilters={appointmentServiceType?.length > 0 || filterCancelled}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
31
38
|
};
|
|
32
39
|
|
|
33
40
|
export default AppointmentsList;
|
|
@@ -18,7 +18,7 @@ import styles from './scheduled-appointments.scss';
|
|
|
18
18
|
dayjs.extend(isSameOrBefore);
|
|
19
19
|
|
|
20
20
|
interface ScheduledAppointmentsProps {
|
|
21
|
-
appointmentServiceType?: string;
|
|
21
|
+
appointmentServiceType?: string[];
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
type DateType = 'pastDate' | 'today' | 'futureDate';
|
|
@@ -141,7 +141,7 @@ function ExtensionWrapper({
|
|
|
141
141
|
}: {
|
|
142
142
|
extension: ConnectedExtension;
|
|
143
143
|
currentTab: string;
|
|
144
|
-
appointmentServiceType: string;
|
|
144
|
+
appointmentServiceType: string[];
|
|
145
145
|
date: string;
|
|
146
146
|
dateType: DateType;
|
|
147
147
|
showExtensionTab: (extension: string) => void;
|
|
@@ -73,8 +73,8 @@ export function useAppointmentSearchResults(data: Appointment[], searchString: s
|
|
|
73
73
|
}, [searchString, data]);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
export function filterByServiceType(appointmentList: any[], appointmentServiceType: string) {
|
|
77
|
-
return appointmentServiceType
|
|
78
|
-
? appointmentList.filter(({ service }) => service
|
|
76
|
+
export function filterByServiceType(appointmentList: any[], appointmentServiceType: string[]) {
|
|
77
|
+
return appointmentServiceType?.length > 0
|
|
78
|
+
? appointmentList.filter(({ service }) => appointmentServiceType.includes(service.uuid))
|
|
79
79
|
: appointmentList;
|
|
80
80
|
}
|
|
@@ -10,7 +10,7 @@ import SelectedDateContext from './hooks/selectedDateContext';
|
|
|
10
10
|
|
|
11
11
|
const Appointments: React.FC = () => {
|
|
12
12
|
const { t } = useTranslation();
|
|
13
|
-
const [appointmentServiceType, setAppointmentServiceType] = useState(
|
|
13
|
+
const [appointmentServiceType, setAppointmentServiceType] = useState<string[]>([]);
|
|
14
14
|
const [selectedDate, setSelectedDate] = useState(dayjs().startOf('day').format(omrsDateFormat));
|
|
15
15
|
|
|
16
16
|
const params = useParams();
|
|
@@ -23,7 +23,7 @@ const Appointments: React.FC = () => {
|
|
|
23
23
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
if (params.serviceType) {
|
|
26
|
-
setAppointmentServiceType(params.serviceType);
|
|
26
|
+
setAppointmentServiceType([params.serviceType]);
|
|
27
27
|
}
|
|
28
28
|
}, [params.serviceType]);
|
|
29
29
|
|
|
@@ -11,12 +11,7 @@ describe('Appointments', () => {
|
|
|
11
11
|
|
|
12
12
|
expect(screen.getByRole('button', { name: /appointments calendar/i })).toBeInTheDocument();
|
|
13
13
|
expect(screen.getByPlaceholderText(/dd-mmm-yyyy/i)).toBeInTheDocument();
|
|
14
|
-
expect(
|
|
15
|
-
screen.getByRole('combobox', {
|
|
16
|
-
name: /select service type/i,
|
|
17
|
-
}),
|
|
18
|
-
).toBeInTheDocument();
|
|
19
|
-
expect(screen.getByRole('listbox', { name: /view/i })).toBeInTheDocument();
|
|
14
|
+
expect(screen.getByText(/filter appointments by service type/i)).toBeInTheDocument();
|
|
20
15
|
expect(screen.getByText(/appointment metrics/i)).toBeInTheDocument();
|
|
21
16
|
expect(screen.getByText(/scheduled appointments/i)).toBeInTheDocument();
|
|
22
17
|
expect(screen.getByText(/highest volume service/i)).toBeInTheDocument();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
1
|
+
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { DatePicker, DatePickerInput,
|
|
4
|
+
import { DatePicker, DatePickerInput, MultiSelect } from '@carbon/react';
|
|
5
5
|
import { PageHeader, PageHeaderContent, AppointmentsPictogram } from '@openmrs/esm-framework';
|
|
6
6
|
import { omrsDateFormat } from '../constants';
|
|
7
7
|
import { useAppointmentServices } from '../hooks/useAppointmentService';
|
|
@@ -10,7 +10,7 @@ import styles from './appointments-header.scss';
|
|
|
10
10
|
|
|
11
11
|
interface AppointmentHeaderProps {
|
|
12
12
|
title: string;
|
|
13
|
-
appointmentServiceType?: string;
|
|
13
|
+
appointmentServiceType?: string[];
|
|
14
14
|
onChange?: (evt) => void;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -19,6 +19,22 @@ const AppointmentsHeader: React.FC<AppointmentHeaderProps> = ({ title, appointme
|
|
|
19
19
|
const { selectedDate, setSelectedDate } = useContext(SelectedDateContext);
|
|
20
20
|
const { serviceTypes } = useAppointmentServices();
|
|
21
21
|
|
|
22
|
+
const [selectedItems, setSelectedItems] = useState([]);
|
|
23
|
+
|
|
24
|
+
const handleMultiSelectChange = useCallback(
|
|
25
|
+
({ selectedItems }) => {
|
|
26
|
+
const selectedUuids = selectedItems.map((item) => item.id);
|
|
27
|
+
setSelectedItems(selectedUuids);
|
|
28
|
+
onChange?.(selectedUuids);
|
|
29
|
+
},
|
|
30
|
+
[onChange],
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const serviceTypeOptions = useMemo(
|
|
34
|
+
() => serviceTypes?.map((item) => ({ id: item.uuid, label: item.name })) ?? [],
|
|
35
|
+
[serviceTypes],
|
|
36
|
+
);
|
|
37
|
+
|
|
22
38
|
return (
|
|
23
39
|
<PageHeader className={styles.header} data-testid="appointments-header">
|
|
24
40
|
<PageHeaderContent illustration={<AppointmentsPictogram />} title={title} />
|
|
@@ -37,20 +53,13 @@ const AppointmentsHeader: React.FC<AppointmentHeaderProps> = ({ title, appointme
|
|
|
37
53
|
/>
|
|
38
54
|
</DatePicker>
|
|
39
55
|
{typeof onChange === 'function' && (
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
label={t('selectServiceType', 'Select service type')}
|
|
48
|
-
onChange={({ selectedItem }) => onChange(selectedItem?.uuid)}
|
|
49
|
-
selectedItem={
|
|
50
|
-
serviceTypes.find((service) => service.uuid === appointmentServiceType) || { name: 'All', uuid: '' }
|
|
51
|
-
}
|
|
52
|
-
size="sm"
|
|
53
|
-
titleText={t('view', 'View')}
|
|
56
|
+
<MultiSelect
|
|
57
|
+
id="serviceTypeMultiSelect"
|
|
58
|
+
label={t('filterAppointmentsByServiceType', 'Filter appointments by service type')}
|
|
59
|
+
items={serviceTypeOptions}
|
|
60
|
+
itemToString={(item) => (item ? item.label : '')}
|
|
61
|
+
onChange={handleMultiSelectChange}
|
|
62
|
+
initialSelectedItems={serviceTypeOptions.length > 0 ? [serviceTypeOptions[0].id] : []}
|
|
54
63
|
type="inline"
|
|
55
64
|
/>
|
|
56
65
|
)}
|
|
@@ -22,17 +22,6 @@
|
|
|
22
22
|
row-gap: layout.$spacing-01;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
.dropdown {
|
|
26
|
-
:global(.cds--list-box__field) {
|
|
27
|
-
width: 14rem;
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
:global(.cds--dropdown--inline .cds--list-box__menu) {
|
|
32
|
-
left: -(layout.$spacing-10);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
25
|
// Overriding styles for RTL support
|
|
37
26
|
html[dir='rtl'] {
|
|
38
27
|
.date-and-location {
|
|
@@ -61,7 +61,7 @@ export function useAllAppointmentsByDate() {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export const useScheduledAppointment = (serviceUuid: string) => {
|
|
64
|
+
export const useScheduledAppointment = (serviceUuid: string[]) => {
|
|
65
65
|
const { selectedDate } = useContext(SelectedDateContext);
|
|
66
66
|
const url = `${restBaseUrl}/appointment/all?forDate=${selectedDate}`;
|
|
67
67
|
|
|
@@ -70,7 +70,7 @@ export const useScheduledAppointment = (serviceUuid: string) => {
|
|
|
70
70
|
}>(url, openmrsFetch);
|
|
71
71
|
|
|
72
72
|
const totalScheduledAppointments = !isEmpty(serviceUuid)
|
|
73
|
-
? data?.data?.filter((appt) => appt?.service?.uuid
|
|
73
|
+
? data?.data?.filter((appt) => serviceUuid.includes(appt?.service?.uuid))?.length ?? 0
|
|
74
74
|
: data?.data?.length ?? 0;
|
|
75
75
|
|
|
76
76
|
return {
|
|
@@ -9,7 +9,7 @@ import styles from './appointments-metrics.scss';
|
|
|
9
9
|
import SelectedDateContext from '../hooks/selectedDateContext';
|
|
10
10
|
|
|
11
11
|
interface AppointmentMetricsProps {
|
|
12
|
-
appointmentServiceType: string;
|
|
12
|
+
appointmentServiceType: string[];
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const AppointmentsMetrics: React.FC<AppointmentMetricsProps> = ({ appointmentServiceType }) => {
|
|
@@ -27,10 +27,10 @@ const AppointmentsMetrics: React.FC<AppointmentMetricsProps> = ({ appointmentSer
|
|
|
27
27
|
const { appointmentList: pendingAppointments } = useAppointmentList('Scheduled');
|
|
28
28
|
|
|
29
29
|
const filteredArrivedAppointments = appointmentServiceType
|
|
30
|
-
? arrivedAppointments.filter(({ service }) => service.uuid
|
|
30
|
+
? arrivedAppointments.filter(({ service }) => appointmentServiceType.includes(service.uuid))
|
|
31
31
|
: arrivedAppointments;
|
|
32
32
|
const filteredPendingAppointments = appointmentServiceType
|
|
33
|
-
? pendingAppointments.filter(({ service }) => service.uuid
|
|
33
|
+
? pendingAppointments.filter(({ service }) => appointmentServiceType.includes(service.uuid))
|
|
34
34
|
: pendingAppointments;
|
|
35
35
|
|
|
36
36
|
if (error) {
|
package/translations/am.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"endTime": "End Time",
|
|
90
90
|
"errorCreatingAppointmentService": "Error creating appointment service",
|
|
91
91
|
"expected": "Expected",
|
|
92
|
+
"filterAppointmentsByServiceType": "Filter appointments by service type",
|
|
92
93
|
"filterTable": "Filter table",
|
|
93
94
|
"gender": "Gender",
|
|
94
95
|
"highestServiceVolume": "Highest volume service: {{time}}",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"noContent": "No Content",
|
|
109
110
|
"noCurrentAppointments": "There are no appointments scheduled for today to display for this patient",
|
|
110
111
|
"noEncountersFound": "No encounters found",
|
|
112
|
+
"noMatchingAppointments": "No matching appointments found",
|
|
111
113
|
"noPastAppointments": "There are no past appointments to display for this patient",
|
|
112
114
|
"noPreviousVisitFound": "No previous visit found",
|
|
113
115
|
"notArrived": "Not arrived",
|
|
@@ -143,7 +145,6 @@
|
|
|
143
145
|
"selectOption": "Select an option",
|
|
144
146
|
"selectProvider": "Select a provider",
|
|
145
147
|
"selectService": "Select a service",
|
|
146
|
-
"selectServiceType": "Select service type",
|
|
147
148
|
"service": "Service",
|
|
148
149
|
"serviceName": "Service name",
|
|
149
150
|
"serviceType": "Service Type",
|
|
@@ -161,7 +162,6 @@
|
|
|
161
162
|
"upcoming": "Upcoming",
|
|
162
163
|
"upcomingAppointments": "Upcoming appointments",
|
|
163
164
|
"updateError": "Error updating upcoming appointment",
|
|
164
|
-
"view": "View",
|
|
165
165
|
"vitals": "Vitals",
|
|
166
166
|
"week": "Week",
|
|
167
167
|
"yes": "Yes"
|
package/translations/ar.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"endTime": "وقت الانتهاء",
|
|
90
90
|
"errorCreatingAppointmentService": "Error creating appointment service",
|
|
91
91
|
"expected": "Expected",
|
|
92
|
+
"filterAppointmentsByServiceType": "Filter appointments by service type",
|
|
92
93
|
"filterTable": "Filter table",
|
|
93
94
|
"gender": "الجنس",
|
|
94
95
|
"highestServiceVolume": "Highest volume service: {{time}}",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"noContent": "No Content",
|
|
109
110
|
"noCurrentAppointments": "لا توجد مواعيد مجدولة لهذا المريض اليوم",
|
|
110
111
|
"noEncountersFound": "لم يتم العثور على لقاءات",
|
|
112
|
+
"noMatchingAppointments": "No matching appointments found",
|
|
111
113
|
"noPastAppointments": "لا توجد مواعيد سابقة لعرضها لهذا المريض\"",
|
|
112
114
|
"noPreviousVisitFound": "لم يتم العثور على زيارة سابقة",
|
|
113
115
|
"notArrived": "لم يصل",
|
|
@@ -143,7 +145,6 @@
|
|
|
143
145
|
"selectOption": "اختر خيارًا",
|
|
144
146
|
"selectProvider": "Select a provider",
|
|
145
147
|
"selectService": "اختر الخدمة",
|
|
146
|
-
"selectServiceType": "اختر نوع الخدمة",
|
|
147
148
|
"service": "خدمة",
|
|
148
149
|
"serviceName": "اسم الخدمة",
|
|
149
150
|
"serviceType": "نوع الخدمة",
|
|
@@ -161,7 +162,6 @@
|
|
|
161
162
|
"upcoming": "القادمة",
|
|
162
163
|
"upcomingAppointments": "المواعيد القادمة",
|
|
163
164
|
"updateError": "Error updating upcoming appointment",
|
|
164
|
-
"view": "عرض",
|
|
165
165
|
"vitals": "العلامات الحيوية",
|
|
166
166
|
"week": "Week",
|
|
167
167
|
"yes": "نعم"
|
package/translations/bn.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"endTime": "End Time",
|
|
90
90
|
"errorCreatingAppointmentService": "Error creating appointment service",
|
|
91
91
|
"expected": "Expected",
|
|
92
|
+
"filterAppointmentsByServiceType": "Filter appointments by service type",
|
|
92
93
|
"filterTable": "Filter table",
|
|
93
94
|
"gender": "Gender",
|
|
94
95
|
"highestServiceVolume": "Highest volume service: {{time}}",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"noContent": "No Content",
|
|
109
110
|
"noCurrentAppointments": "There are no appointments scheduled for today to display for this patient",
|
|
110
111
|
"noEncountersFound": "No encounters found",
|
|
112
|
+
"noMatchingAppointments": "No matching appointments found",
|
|
111
113
|
"noPastAppointments": "There are no past appointments to display for this patient",
|
|
112
114
|
"noPreviousVisitFound": "No previous visit found",
|
|
113
115
|
"notArrived": "Not arrived",
|
|
@@ -143,7 +145,6 @@
|
|
|
143
145
|
"selectOption": "Select an option",
|
|
144
146
|
"selectProvider": "Select a provider",
|
|
145
147
|
"selectService": "Select a service",
|
|
146
|
-
"selectServiceType": "Select service type",
|
|
147
148
|
"service": "Service",
|
|
148
149
|
"serviceName": "Service name",
|
|
149
150
|
"serviceType": "Service Type",
|
|
@@ -161,7 +162,6 @@
|
|
|
161
162
|
"upcoming": "Upcoming",
|
|
162
163
|
"upcomingAppointments": "Upcoming appointments",
|
|
163
164
|
"updateError": "Error updating upcoming appointment",
|
|
164
|
-
"view": "View",
|
|
165
165
|
"vitals": "Vitals",
|
|
166
166
|
"week": "Week",
|
|
167
167
|
"yes": "Yes"
|
package/translations/de.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"endTime": "End Time",
|
|
90
90
|
"errorCreatingAppointmentService": "Error creating appointment service",
|
|
91
91
|
"expected": "Expected",
|
|
92
|
+
"filterAppointmentsByServiceType": "Filter appointments by service type",
|
|
92
93
|
"filterTable": "Filter table",
|
|
93
94
|
"gender": "Gender",
|
|
94
95
|
"highestServiceVolume": "Highest volume service: {{time}}",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"noContent": "No Content",
|
|
109
110
|
"noCurrentAppointments": "There are no appointments scheduled for today to display for this patient",
|
|
110
111
|
"noEncountersFound": "No encounters found",
|
|
112
|
+
"noMatchingAppointments": "No matching appointments found",
|
|
111
113
|
"noPastAppointments": "There are no past appointments to display for this patient",
|
|
112
114
|
"noPreviousVisitFound": "No previous visit found",
|
|
113
115
|
"notArrived": "Not arrived",
|
|
@@ -143,7 +145,6 @@
|
|
|
143
145
|
"selectOption": "Select an option",
|
|
144
146
|
"selectProvider": "Select a provider",
|
|
145
147
|
"selectService": "Select a service",
|
|
146
|
-
"selectServiceType": "Select service type",
|
|
147
148
|
"service": "Service",
|
|
148
149
|
"serviceName": "Service name",
|
|
149
150
|
"serviceType": "Service Type",
|
|
@@ -161,7 +162,6 @@
|
|
|
161
162
|
"upcoming": "Upcoming",
|
|
162
163
|
"upcomingAppointments": "Upcoming appointments",
|
|
163
164
|
"updateError": "Error updating upcoming appointment",
|
|
164
|
-
"view": "View",
|
|
165
165
|
"vitals": "Vitals",
|
|
166
166
|
"week": "Week",
|
|
167
167
|
"yes": "Yes"
|
package/translations/en.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"endTime": "End Time",
|
|
90
90
|
"errorCreatingAppointmentService": "Error creating appointment service",
|
|
91
91
|
"expected": "Expected",
|
|
92
|
+
"filterAppointmentsByServiceType": "Filter appointments by service type",
|
|
92
93
|
"filterTable": "Filter table",
|
|
93
94
|
"gender": "Gender",
|
|
94
95
|
"highestServiceVolume": "Highest volume service: {{time}}",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"noContent": "No Content",
|
|
109
110
|
"noCurrentAppointments": "There are no appointments scheduled for today to display for this patient",
|
|
110
111
|
"noEncountersFound": "No encounters found",
|
|
112
|
+
"noMatchingAppointments": "No matching appointments found",
|
|
111
113
|
"noPastAppointments": "There are no past appointments to display for this patient",
|
|
112
114
|
"noPreviousVisitFound": "No previous visit found",
|
|
113
115
|
"notArrived": "Not arrived",
|
|
@@ -143,7 +145,6 @@
|
|
|
143
145
|
"selectOption": "Select an option",
|
|
144
146
|
"selectProvider": "Select a provider",
|
|
145
147
|
"selectService": "Select a service",
|
|
146
|
-
"selectServiceType": "Select service type",
|
|
147
148
|
"service": "Service",
|
|
148
149
|
"serviceName": "Service name",
|
|
149
150
|
"serviceType": "Service Type",
|
|
@@ -161,7 +162,6 @@
|
|
|
161
162
|
"upcoming": "Upcoming",
|
|
162
163
|
"upcomingAppointments": "Upcoming appointments",
|
|
163
164
|
"updateError": "Error updating upcoming appointment",
|
|
164
|
-
"view": "View",
|
|
165
165
|
"vitals": "Vitals",
|
|
166
166
|
"week": "Week",
|
|
167
167
|
"yes": "Yes"
|
package/translations/es.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"endTime": "Hora de finalización",
|
|
90
90
|
"errorCreatingAppointmentService": "Error al crear el servicio de cita",
|
|
91
91
|
"expected": "Esperado",
|
|
92
|
+
"filterAppointmentsByServiceType": "Filter appointments by service type",
|
|
92
93
|
"filterTable": "Filtrar tabla",
|
|
93
94
|
"gender": "Género",
|
|
94
95
|
"highestServiceVolume": "Servicio de mayor volumen: {{time}}",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"noContent": "No hay Contenido",
|
|
109
110
|
"noCurrentAppointments": "No hay citas programadas para hoy para mostrar para este paciente.",
|
|
110
111
|
"noEncountersFound": "No se encontraron encuentros",
|
|
112
|
+
"noMatchingAppointments": "No matching appointments found",
|
|
111
113
|
"noPastAppointments": "No hay citas anteriores para mostrar para este paciente",
|
|
112
114
|
"noPreviousVisitFound": "No se encontraron consultas anteriores",
|
|
113
115
|
"notArrived": "No ha llegado",
|
|
@@ -143,7 +145,6 @@
|
|
|
143
145
|
"selectOption": "Seleccione una opción",
|
|
144
146
|
"selectProvider": "Seleccione un proveedor de la salud",
|
|
145
147
|
"selectService": "Seleccione un servicio",
|
|
146
|
-
"selectServiceType": "Seleccionar tipo de servicio",
|
|
147
148
|
"service": "Servicio",
|
|
148
149
|
"serviceName": "Nombre del servicio",
|
|
149
150
|
"serviceType": "Tipo de Servicio",
|
|
@@ -161,7 +162,6 @@
|
|
|
161
162
|
"upcoming": "Próximas",
|
|
162
163
|
"upcomingAppointments": "Próximas citas",
|
|
163
164
|
"updateError": "Error updating upcoming appointment",
|
|
164
|
-
"view": "Ver",
|
|
165
165
|
"vitals": "Signos Vitales",
|
|
166
166
|
"week": "Semana",
|
|
167
167
|
"yes": "Sí"
|
package/translations/fr.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"endTime": "Heure de fin",
|
|
90
90
|
"errorCreatingAppointmentService": " Erreur lors de la création du service de rendez-vous",
|
|
91
91
|
"expected": "Prévus:",
|
|
92
|
+
"filterAppointmentsByServiceType": "Filter appointments by service type",
|
|
92
93
|
"filterTable": "Filtrer le tableau",
|
|
93
94
|
"gender": "Genre",
|
|
94
95
|
"highestServiceVolume": "Service le plus utilisé: {{time}}",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"noContent": "Pas de Contenu",
|
|
109
110
|
"noCurrentAppointments": "Il n'y a pas de rendez-vous à afficher aujourd'hui pour ce patient",
|
|
110
111
|
"noEncountersFound": "Aucune consultation trouvée",
|
|
112
|
+
"noMatchingAppointments": "No matching appointments found",
|
|
111
113
|
"noPastAppointments": "Il n'y a pas de rendez-vous passé à afficher pour ce patient",
|
|
112
114
|
"noPreviousVisitFound": "Aucune visite précédente trouvée",
|
|
113
115
|
"notArrived": "Pas arrivé(s)",
|
|
@@ -143,7 +145,6 @@
|
|
|
143
145
|
"selectOption": "Sélectionner une option",
|
|
144
146
|
"selectProvider": "Sélectionnez un prestataire",
|
|
145
147
|
"selectService": "Sélectionner un service",
|
|
146
|
-
"selectServiceType": "Sélectionner un type de service",
|
|
147
148
|
"service": "Service",
|
|
148
149
|
"serviceName": "Nom du service",
|
|
149
150
|
"serviceType": "Type de service",
|
|
@@ -161,7 +162,6 @@
|
|
|
161
162
|
"upcoming": "À venir",
|
|
162
163
|
"upcomingAppointments": "À venir rendez-vous",
|
|
163
164
|
"updateError": "Error updating upcoming appointment",
|
|
164
|
-
"view": "Vue",
|
|
165
165
|
"vitals": "Signes Vitaux",
|
|
166
166
|
"week": "Semaine",
|
|
167
167
|
"yes": "Oui"
|
package/translations/he.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"endTime": "שעת סיום",
|
|
90
90
|
"errorCreatingAppointmentService": "שגיאה ביצירת שירות התור",
|
|
91
91
|
"expected": "צפוי",
|
|
92
|
+
"filterAppointmentsByServiceType": "Filter appointments by service type",
|
|
92
93
|
"filterTable": "סינון הטבלה",
|
|
93
94
|
"gender": "מגדר",
|
|
94
95
|
"highestServiceVolume": "השירות הכי עמוס: {{time}}",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"noContent": "אין תוכן",
|
|
109
110
|
"noCurrentAppointments": "אין תורים מתוזמנים להצגה עבור מטופל זה ליום הזה",
|
|
110
111
|
"noEncountersFound": "לא נמצאו פגישות",
|
|
112
|
+
"noMatchingAppointments": "No matching appointments found",
|
|
111
113
|
"noPastAppointments": "אין תורי עבר להצגה עבור מטופל/ת אלה",
|
|
112
114
|
"noPreviousVisitFound": "לא נמצא ביקור קודם",
|
|
113
115
|
"notArrived": "לא הגיע/ה",
|
|
@@ -143,7 +145,6 @@
|
|
|
143
145
|
"selectOption": "בחירת אפשרות",
|
|
144
146
|
"selectProvider": "בחירת ספק",
|
|
145
147
|
"selectService": "בחירת שירות",
|
|
146
|
-
"selectServiceType": "בחירת סוג שירות",
|
|
147
148
|
"service": "שירות",
|
|
148
149
|
"serviceName": "שם השירות",
|
|
149
150
|
"serviceType": "סוג השירות",
|
|
@@ -161,7 +162,6 @@
|
|
|
161
162
|
"upcoming": "בקרוב",
|
|
162
163
|
"upcomingAppointments": "תורים עתידיים",
|
|
163
164
|
"updateError": "Error updating upcoming appointment",
|
|
164
|
-
"view": "הצגה",
|
|
165
165
|
"vitals": "מדדים",
|
|
166
166
|
"week": "Week",
|
|
167
167
|
"yes": "כן"
|
package/translations/hi.json
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"endTime": "End Time",
|
|
90
90
|
"errorCreatingAppointmentService": "Error creating appointment service",
|
|
91
91
|
"expected": "Expected",
|
|
92
|
+
"filterAppointmentsByServiceType": "Filter appointments by service type",
|
|
92
93
|
"filterTable": "Filter table",
|
|
93
94
|
"gender": "Gender",
|
|
94
95
|
"highestServiceVolume": "Highest volume service: {{time}}",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"noContent": "No Content",
|
|
109
110
|
"noCurrentAppointments": "There are no appointments scheduled for today to display for this patient",
|
|
110
111
|
"noEncountersFound": "No encounters found",
|
|
112
|
+
"noMatchingAppointments": "No matching appointments found",
|
|
111
113
|
"noPastAppointments": "There are no past appointments to display for this patient",
|
|
112
114
|
"noPreviousVisitFound": "No previous visit found",
|
|
113
115
|
"notArrived": "Not arrived",
|
|
@@ -143,7 +145,6 @@
|
|
|
143
145
|
"selectOption": "Select an option",
|
|
144
146
|
"selectProvider": "Select a provider",
|
|
145
147
|
"selectService": "Select a service",
|
|
146
|
-
"selectServiceType": "Select service type",
|
|
147
148
|
"service": "Service",
|
|
148
149
|
"serviceName": "Service name",
|
|
149
150
|
"serviceType": "Service Type",
|
|
@@ -161,7 +162,6 @@
|
|
|
161
162
|
"upcoming": "Upcoming",
|
|
162
163
|
"upcomingAppointments": "Upcoming appointments",
|
|
163
164
|
"updateError": "Error updating upcoming appointment",
|
|
164
|
-
"view": "View",
|
|
165
165
|
"vitals": "Vitals",
|
|
166
166
|
"week": "Week",
|
|
167
167
|
"yes": "Yes"
|