@kenyaemr/esm-appointments-app 7.0.2-pre.65
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 +42 -0
- package/dist/130.js +2 -0
- package/dist/130.js.LICENSE.txt +3 -0
- package/dist/130.js.map +1 -0
- package/dist/152.js +1 -0
- package/dist/152.js.map +1 -0
- package/dist/224.js +1 -0
- package/dist/224.js.map +1 -0
- package/dist/255.js +2 -0
- package/dist/255.js.LICENSE.txt +9 -0
- package/dist/255.js.map +1 -0
- package/dist/271.js +1 -0
- package/dist/303.js +1 -0
- package/dist/303.js.map +1 -0
- package/dist/309.js +1 -0
- package/dist/309.js.map +1 -0
- package/dist/319.js +1 -0
- package/dist/4.js +1 -0
- package/dist/4.js.map +1 -0
- package/dist/445.js +2 -0
- package/dist/445.js.LICENSE.txt +54 -0
- package/dist/445.js.map +1 -0
- package/dist/460.js +1 -0
- package/dist/501.js +1 -0
- package/dist/501.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/591.js +2 -0
- package/dist/591.js.LICENSE.txt +32 -0
- package/dist/591.js.map +1 -0
- package/dist/644.js +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/757.js +1 -0
- package/dist/784.js +2 -0
- package/dist/784.js.LICENSE.txt +9 -0
- package/dist/784.js.map +1 -0
- package/dist/788.js +1 -0
- package/dist/807.js +1 -0
- package/dist/833.js +1 -0
- package/dist/857.js +2 -0
- package/dist/857.js.LICENSE.txt +5 -0
- package/dist/857.js.map +1 -0
- package/dist/904.js +1 -0
- package/dist/904.js.map +1 -0
- package/dist/kenyaemr-esm-appointments-app.js +1 -0
- package/dist/kenyaemr-esm-appointments-app.js.buildmanifest.json +699 -0
- package/dist/kenyaemr-esm-appointments-app.js.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +64 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +3 -0
- package/package.json +57 -0
- package/src/admin/appointment-services/appointment-services-hook.ts +31 -0
- package/src/admin/appointment-services/appointment-services-validation.ts +17 -0
- package/src/admin/appointment-services/appointment-services.component.tsx +182 -0
- package/src/admin/appointment-services/appointment-services.scss +25 -0
- package/src/appointments/appointment-tabs.component.tsx +48 -0
- package/src/appointments/appointment-tabs.scss +53 -0
- package/src/appointments/appointment-tabs.test.tsx +55 -0
- package/src/appointments/common-components/appointments-actions.component.tsx +86 -0
- package/src/appointments/common-components/appointments-actions.scss +4 -0
- package/src/appointments/common-components/appointments-actions.test.tsx +201 -0
- package/src/appointments/common-components/appointments-table.component.tsx +277 -0
- package/src/appointments/common-components/appointments-table.scss +133 -0
- package/src/appointments/common-components/appointments-table.test.tsx +134 -0
- package/src/appointments/common-components/checkin-button.component.tsx +43 -0
- package/src/appointments/common-components/end-appointment-modal.component.tsx +104 -0
- package/src/appointments/common-components/end-appointment-modal.test.tsx +80 -0
- package/src/appointments/common-components/location-select-option.component.tsx +48 -0
- package/src/appointments/details/appointment-details.component.tsx +91 -0
- package/src/appointments/details/appointment-details.scss +81 -0
- package/src/appointments/details/appointment-details.test.tsx +103 -0
- package/src/appointments/scheduled/appointments-list.component.tsx +33 -0
- package/src/appointments/scheduled/early-appointments.component.tsx +32 -0
- package/src/appointments/scheduled/scheduled-appointments.component.tsx +215 -0
- package/src/appointments/scheduled/scheduled-appointments.scss +4 -0
- package/src/appointments/unscheduled/unscheduled-appointments.component.tsx +146 -0
- package/src/appointments/unscheduled/unscheduled-appointments.test.tsx +131 -0
- package/src/appointments/utils.tsx +80 -0
- package/src/appointments.component.tsx +44 -0
- package/src/appointments.test.tsx +15 -0
- package/src/calendar/appointments-calendar-view-view.scss +24 -0
- package/src/calendar/appointments-calendar-view.component.tsx +36 -0
- package/src/calendar/appointments-calendar-view.test.tsx +22 -0
- package/src/calendar/header/calendar-header.component.tsx +34 -0
- package/src/calendar/header/calendar-header.scss +32 -0
- package/src/calendar/monthly/days-of-week.component.tsx +16 -0
- package/src/calendar/monthly/days-of-week.scss +33 -0
- package/src/calendar/monthly/monthly-calendar-view.component.tsx +34 -0
- package/src/calendar/monthly/monthly-header.module.scss +14 -0
- package/src/calendar/monthly/monthly-header.module.tsx +40 -0
- package/src/calendar/monthly/monthly-view-workload.scss +188 -0
- package/src/calendar/monthly/monthly-workload-view-expanded.component.tsx +42 -0
- package/src/calendar/monthly/monthly-workload-view.component.tsx +109 -0
- package/src/config-schema.ts +151 -0
- package/src/constants.ts +55 -0
- package/src/createDashboardLink.component.tsx +39 -0
- package/src/dashboard.meta.ts +21 -0
- package/src/declarations.d.ts +4 -0
- package/src/empty-state/empty-data-illustration.component.tsx +39 -0
- package/src/empty-state/empty-state.component.tsx +32 -0
- package/src/empty-state/empty-state.scss +69 -0
- package/src/form/appointments-form.component.tsx +891 -0
- package/src/form/appointments-form.resource.ts +165 -0
- package/src/form/appointments-form.scss +113 -0
- package/src/form/appointments-form.test.tsx +212 -0
- package/src/header/appointments-header.component.tsx +79 -0
- package/src/header/appointments-header.scss +95 -0
- package/src/header/appointments-illustration.component.tsx +22 -0
- package/src/helpers/excel.ts +61 -0
- package/src/helpers/functions.ts +82 -0
- package/src/helpers/index.ts +2 -0
- package/src/helpers/time.tsx +15 -0
- package/src/home/home-appointments.component.tsx +22 -0
- package/src/home/home-appointments.scss +10 -0
- package/src/hooks/patientAppointmentContext.ts +15 -0
- package/src/hooks/selectedDateContext.ts +10 -0
- package/src/hooks/useAppointmentList.ts +48 -0
- package/src/hooks/useAppointmentService.ts +11 -0
- package/src/hooks/useAppointmentsCalendar.ts +68 -0
- package/src/hooks/useClinicalMetrics.ts +79 -0
- package/src/hooks/useDefaultLocation.ts +14 -0
- package/src/hooks/useOverlay.tsx +45 -0
- package/src/hooks/usePatientAppointmentHistory.ts +49 -0
- package/src/hooks/useProviders.ts +18 -0
- package/src/hooks/useTodaysVisits.ts +19 -0
- package/src/hooks/useUnscheduledAppointments.ts +45 -0
- package/src/index.ts +111 -0
- package/src/metrics/appointments-metrics.component.tsx +71 -0
- package/src/metrics/appointments-metrics.scss +15 -0
- package/src/metrics/appointments-metrics.test.tsx +49 -0
- package/src/metrics/metrics-card.component.tsx +76 -0
- package/src/metrics/metrics-card.scss +77 -0
- package/src/metrics/metrics-header.component.tsx +62 -0
- package/src/metrics/metrics-header.scss +33 -0
- package/src/past-visit/encounter-list.component.tsx +54 -0
- package/src/past-visit/past-visit.component.tsx +106 -0
- package/src/past-visit/past-visit.resource.ts +25 -0
- package/src/past-visit/past-visit.scss +106 -0
- package/src/patient-appointments/patient-appointments-action-menu.component.tsx +65 -0
- package/src/patient-appointments/patient-appointments-action-menu.scss +7 -0
- package/src/patient-appointments/patient-appointments-base.component.tsx +165 -0
- package/src/patient-appointments/patient-appointments-base.scss +85 -0
- package/src/patient-appointments/patient-appointments-base.test.tsx +91 -0
- package/src/patient-appointments/patient-appointments-cancel-modal.component.tsx +66 -0
- package/src/patient-appointments/patient-appointments-detailed-summary.component.tsx +15 -0
- package/src/patient-appointments/patient-appointments-header.scss +27 -0
- package/src/patient-appointments/patient-appointments-header.tsx +42 -0
- package/src/patient-appointments/patient-appointments-overview.component.tsx +35 -0
- package/src/patient-appointments/patient-appointments-overview.scss +7 -0
- package/src/patient-appointments/patient-appointments-table.scss +0 -0
- package/src/patient-appointments/patient-appointments-table.tsx +128 -0
- package/src/patient-appointments/patient-appointments.resource.ts +72 -0
- package/src/patient-appointments/patient-upcoming-appointments-card.component.tsx +122 -0
- package/src/patient-appointments/patient-upcoming-appointments-card.scss +46 -0
- package/src/patient-search/patient-search.component.tsx +34 -0
- package/src/patient-search/patient-search.scss +23 -0
- package/src/root.component.tsx +26 -0
- package/src/root.scss +50 -0
- package/src/routes.json +153 -0
- package/src/scheduled-appointments-config-schema.ts +169 -0
- package/src/types/index.ts +189 -0
- package/src/workload/monthly-view-workload/monthly-view.component.tsx +69 -0
- package/src/workload/monthly-view-workload/monthly-workload.scss +223 -0
- package/src/workload/monthly-view-workload/monthlyWorkCard.tsx +45 -0
- package/src/workload/workload-card.component.tsx +31 -0
- package/src/workload/workload.component.tsx +47 -0
- package/src/workload/workload.resource.ts +78 -0
- package/src/workload/workload.scss +92 -0
- package/translations/am.json +148 -0
- package/translations/ar.json +148 -0
- package/translations/en.json +159 -0
- package/translations/es.json +148 -0
- package/translations/fr.json +148 -0
- package/translations/he.json +148 -0
- package/translations/km.json +148 -0
- package/translations/zh.json +148 -0
- package/translations/zh_CN.json +148 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Type, restBaseUrl, validators } from '@openmrs/esm-framework';
|
|
2
|
+
import { spaHomePage } from './constants';
|
|
3
|
+
|
|
4
|
+
export const configSchema = {
|
|
5
|
+
concepts: {
|
|
6
|
+
visitQueueNumberAttributeUuid: {
|
|
7
|
+
_type: Type.String,
|
|
8
|
+
_description: 'The UUID of the visit attribute that contains the visit queue number.',
|
|
9
|
+
_default: 'c61ce16f-272a-41e7-9924-4c555d0932c5',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
appointmentTypes: {
|
|
13
|
+
_type: Type.Array,
|
|
14
|
+
_description: 'Configurable appointment types (types of appointments)',
|
|
15
|
+
_default: ['Scheduled'],
|
|
16
|
+
},
|
|
17
|
+
appointmentStatuses: {
|
|
18
|
+
_type: Type.Array,
|
|
19
|
+
_description: 'Configurable appointment status (status of appointments)',
|
|
20
|
+
_default: ['Requested', 'Scheduled', 'CheckedIn', 'Completed', 'Cancelled', 'Missed'],
|
|
21
|
+
},
|
|
22
|
+
daysOfTheWeek: {
|
|
23
|
+
_type: Type.Array,
|
|
24
|
+
_description: 'Configurable days of the week',
|
|
25
|
+
_default: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
|
26
|
+
},
|
|
27
|
+
useBahmniAppointmentsUI: {
|
|
28
|
+
_type: Type.Boolean,
|
|
29
|
+
_description: 'Open links in Bahmni Appointments UI instead of O3 UI',
|
|
30
|
+
_default: false,
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
useFullViewPrivilege: {
|
|
34
|
+
_type: Type.Boolean,
|
|
35
|
+
_description: "If set to 'false', will always display the full view, disregarding any privilege",
|
|
36
|
+
_default: false,
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
fullViewPrivilege: {
|
|
40
|
+
_type: Type.String,
|
|
41
|
+
_description: 'Name of the privilege to display the full view of the Appointments dashboard widget.',
|
|
42
|
+
_default: "Today's Appointments Widget: Display Full View",
|
|
43
|
+
},
|
|
44
|
+
bahmniAppointmentsUiBaseUrl: {
|
|
45
|
+
_type: Type.String,
|
|
46
|
+
_description: 'Configurable base URL that points to the Bahmni Appointments UI',
|
|
47
|
+
_default: '/appointments',
|
|
48
|
+
},
|
|
49
|
+
appointmentsBaseUrl: {
|
|
50
|
+
_type: Type.String,
|
|
51
|
+
_description: 'Configurable alternative URL for the Appointments UI. Eg, the Bahmni Appointments UI URL',
|
|
52
|
+
_default: `${spaHomePage}`,
|
|
53
|
+
},
|
|
54
|
+
hiddenFormFields: {
|
|
55
|
+
_type: Type.Array,
|
|
56
|
+
_description: 'Array of form controls to be hidden on form load',
|
|
57
|
+
_default: [],
|
|
58
|
+
},
|
|
59
|
+
showServiceQueueFields: {
|
|
60
|
+
_type: Type.Boolean,
|
|
61
|
+
_description: 'Whether start visit form should display service queue fields`',
|
|
62
|
+
_default: false,
|
|
63
|
+
},
|
|
64
|
+
defaultFacilityUrl: {
|
|
65
|
+
_type: Type.String,
|
|
66
|
+
_default: `${restBaseUrl}/kenyaemr/default-facility`,
|
|
67
|
+
_description: 'Custom URL to load default facility if it is not in the session',
|
|
68
|
+
},
|
|
69
|
+
customPatientChartUrl: {
|
|
70
|
+
_type: Type.String,
|
|
71
|
+
_description: `Template URL that will be used when clicking on the patient name in the queues table.
|
|
72
|
+
Available argument: patientUuid, openmrsSpaBase, openBase
|
|
73
|
+
(openmrsSpaBase and openBase are available to any <ConfigurableLink>)`,
|
|
74
|
+
_default: '${openmrsSpaBase}/patient/${patientUuid}/chart',
|
|
75
|
+
_validators: [validators.isUrlWithTemplateParameters(['patientUuid'])],
|
|
76
|
+
},
|
|
77
|
+
patientIdentifierType: {
|
|
78
|
+
_type: Type.String,
|
|
79
|
+
_description: 'The name of the patient identifier type to be used for the patient identifier field',
|
|
80
|
+
_default: '',
|
|
81
|
+
},
|
|
82
|
+
showUnscheduledAppointmentsTab: {
|
|
83
|
+
_type: Type.Boolean,
|
|
84
|
+
_description:
|
|
85
|
+
'Whether to show the Unscheduled Appointments tab. Note that configuring this to true requires a custom unscheduledAppointment endpoint not currently available',
|
|
86
|
+
_default: false,
|
|
87
|
+
},
|
|
88
|
+
allowAllDayAppointments: {
|
|
89
|
+
_type: Type.Boolean,
|
|
90
|
+
_description: 'Whether to allow scheduling of all-day appointments (vs appointments with start time and end time)',
|
|
91
|
+
_default: false,
|
|
92
|
+
},
|
|
93
|
+
checkInButton: {
|
|
94
|
+
enabled: {
|
|
95
|
+
_type: Type.Boolean,
|
|
96
|
+
_description: 'Whether the check-in button on the "Appointments" list should be enabled',
|
|
97
|
+
_default: true,
|
|
98
|
+
},
|
|
99
|
+
showIfActiveVisit: {
|
|
100
|
+
_type: Type.Boolean,
|
|
101
|
+
_description: 'Whether to show the check-in button if the patient currently has an active visit',
|
|
102
|
+
_default: false,
|
|
103
|
+
},
|
|
104
|
+
customUrl: {
|
|
105
|
+
_type: Type.String,
|
|
106
|
+
_description: 'Custom URL to open when clicking the check-in button (instead of thes start visit form)',
|
|
107
|
+
_default: '',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
checkOutButton: {
|
|
111
|
+
enabled: {
|
|
112
|
+
_type: Type.Boolean,
|
|
113
|
+
_description: 'Whether the check-out button on the "Appointments" list should be disabled',
|
|
114
|
+
_default: true,
|
|
115
|
+
},
|
|
116
|
+
customUrl: {
|
|
117
|
+
_type: Type.String,
|
|
118
|
+
_description: 'Custom URL to open when clicking the check-out button',
|
|
119
|
+
_default: '',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export interface ConfigObject {
|
|
125
|
+
concepts: {
|
|
126
|
+
visitQueueNumberAttributeUuid: string;
|
|
127
|
+
};
|
|
128
|
+
appointmentTypes: Array<string>;
|
|
129
|
+
daysOfTheWeek: Array<string>;
|
|
130
|
+
appointmentStatuses: Array<string>;
|
|
131
|
+
useBahmniAppointmentsUI: boolean;
|
|
132
|
+
useFullViewPrivilege: boolean;
|
|
133
|
+
fullViewPrivilege: string;
|
|
134
|
+
appointmentComments: Array<string>;
|
|
135
|
+
hiddenFormFields: Array<string>;
|
|
136
|
+
showServiceQueueFields: boolean;
|
|
137
|
+
defaultFacilityUrl: string;
|
|
138
|
+
customPatientChartUrl: string;
|
|
139
|
+
patientIdentifierType: string;
|
|
140
|
+
showUnscheduledAppointmentsTab: boolean;
|
|
141
|
+
allowAllDayAppointments: boolean;
|
|
142
|
+
checkInButton: {
|
|
143
|
+
enabled: boolean;
|
|
144
|
+
showIfActiveVisit: boolean;
|
|
145
|
+
customUrl: string;
|
|
146
|
+
};
|
|
147
|
+
checkOutButton: {
|
|
148
|
+
enabled: boolean;
|
|
149
|
+
customUrl: string;
|
|
150
|
+
};
|
|
151
|
+
}
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const spaRoot = window['getOpenmrsSpaBase'];
|
|
2
|
+
export const basePath = '/appointments';
|
|
3
|
+
export const spaHomePage = ` ${window.getOpenmrsSpaBase()}home`;
|
|
4
|
+
export const omrsDateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZZ';
|
|
5
|
+
export const appointmentLocationTagName = 'Appointment Location';
|
|
6
|
+
|
|
7
|
+
export const moduleName = '@openmrs/esm-appointments-app';
|
|
8
|
+
|
|
9
|
+
export const datePickerPlaceHolder = 'dd/mm/yyyy';
|
|
10
|
+
export const dateFormat = 'DD/MM/YYYY';
|
|
11
|
+
export const datePickerFormat = 'd/m/Y';
|
|
12
|
+
export const weekDays = [
|
|
13
|
+
{
|
|
14
|
+
id: 'MONDAY',
|
|
15
|
+
label: 'Monday',
|
|
16
|
+
labelCode: 'monday',
|
|
17
|
+
order: 0,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'TUESDAY',
|
|
21
|
+
label: 'Tuesday',
|
|
22
|
+
labelCode: 'tuesday',
|
|
23
|
+
order: 1,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'WEDNESDAY',
|
|
27
|
+
label: 'Wednesday',
|
|
28
|
+
labelCode: 'wednesday',
|
|
29
|
+
order: 2,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'THURSDAY',
|
|
33
|
+
label: 'Thursday',
|
|
34
|
+
labelCode: 'thursday',
|
|
35
|
+
order: 3,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'FRIDAY',
|
|
39
|
+
label: 'Friday',
|
|
40
|
+
labelCode: 'friday',
|
|
41
|
+
order: 4,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'SATURDAY',
|
|
45
|
+
label: 'Saturday',
|
|
46
|
+
labelCode: 'saturday',
|
|
47
|
+
order: 5,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'SUNDAY',
|
|
51
|
+
label: 'Sunday',
|
|
52
|
+
labelCode: 'sunday',
|
|
53
|
+
order: 6,
|
|
54
|
+
},
|
|
55
|
+
];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { ConfigurableLink } from '@openmrs/esm-framework';
|
|
4
|
+
import { BrowserRouter, useLocation } from 'react-router-dom';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
|
|
7
|
+
export interface DashboardLinkConfig {
|
|
8
|
+
name: string;
|
|
9
|
+
title: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: DashboardLinkConfig }) {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
const { name } = dashboardLinkConfig;
|
|
15
|
+
const location = useLocation();
|
|
16
|
+
const spaBasePath = `${window.spaBase}/home`;
|
|
17
|
+
|
|
18
|
+
const navLink = useMemo(() => {
|
|
19
|
+
const pathArray = location.pathname.split('/home');
|
|
20
|
+
const lastElement = pathArray[pathArray.length - 1];
|
|
21
|
+
return decodeURIComponent(lastElement);
|
|
22
|
+
}, [location.pathname]);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<ConfigurableLink
|
|
26
|
+
className={classNames('cds--side-nav__link', {
|
|
27
|
+
'active-left-nav-link': navLink.match(name),
|
|
28
|
+
})}
|
|
29
|
+
to={`${spaBasePath}/${name}`}>
|
|
30
|
+
{t('appointments', 'Appointments')}
|
|
31
|
+
</ConfigurableLink>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const createDashboardLink = (dashboardLinkConfig: DashboardLinkConfig) => () => (
|
|
36
|
+
<BrowserRouter>
|
|
37
|
+
<DashboardExtension dashboardLinkConfig={dashboardLinkConfig} />
|
|
38
|
+
</BrowserRouter>
|
|
39
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Calendar } from '@carbon/react/icons';
|
|
2
|
+
|
|
3
|
+
export const dashboardMeta = {
|
|
4
|
+
name: 'appointments',
|
|
5
|
+
slot: 'clinical-appointments-dashboard-slot',
|
|
6
|
+
title: 'Appointments',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const appointmentCalendarDashboardMeta = {
|
|
10
|
+
name: 'calendar',
|
|
11
|
+
slot: 'clinical-appointments-dashboard-slot',
|
|
12
|
+
title: 'Appointments Calendar',
|
|
13
|
+
renderIcon: Calendar,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const patientChartDashboardMeta = {
|
|
17
|
+
slot: 'patient-chart-appointments-dashboard-slot',
|
|
18
|
+
columns: 1,
|
|
19
|
+
title: 'Appointments',
|
|
20
|
+
path: 'Appointments',
|
|
21
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export const EmptyDataIllustration = ({ width = '64', height = '64' }) => {
|
|
4
|
+
return (
|
|
5
|
+
<svg width={width} height={height} viewBox="0 0 64 64">
|
|
6
|
+
<title>Empty data illustration</title>
|
|
7
|
+
<g fill="none" fillRule="evenodd">
|
|
8
|
+
<path
|
|
9
|
+
d="M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z"
|
|
10
|
+
fill="#F4F4F4"
|
|
11
|
+
/>
|
|
12
|
+
<path
|
|
13
|
+
d="M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z"
|
|
14
|
+
fill="#8D8D8D"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
d="M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z"
|
|
18
|
+
fill="#C6C6C6"
|
|
19
|
+
/>
|
|
20
|
+
<circle fill="#C6C6C6" cx={17.636} cy={2.314} r={1.855} />
|
|
21
|
+
<circle fill="#FFF" fillRule="nonzero" cx={17.636} cy={2.314} r={1.175} />
|
|
22
|
+
<path
|
|
23
|
+
d="M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z"
|
|
24
|
+
fill="#F4F4F4"
|
|
25
|
+
/>
|
|
26
|
+
<path
|
|
27
|
+
d="M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z"
|
|
28
|
+
fill="#8D8D8D"
|
|
29
|
+
/>
|
|
30
|
+
<path
|
|
31
|
+
d="M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z"
|
|
32
|
+
fill="#C6C6C6"
|
|
33
|
+
/>
|
|
34
|
+
<circle fill="#C6C6C6" cx={40.218} cy={9.755} r={1.855} />
|
|
35
|
+
<circle fill="#FFF" fillRule="nonzero" cx={40.218} cy={9.755} r={1.13} />
|
|
36
|
+
</g>
|
|
37
|
+
</svg>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Layer, Tile } from '@carbon/react';
|
|
3
|
+
import { Trans } from 'react-i18next';
|
|
4
|
+
import { EmptyDataIllustration } from './empty-data-illustration.component';
|
|
5
|
+
import { useLayoutType } from '@openmrs/esm-framework';
|
|
6
|
+
import styles from './empty-state.scss';
|
|
7
|
+
|
|
8
|
+
export interface EmptyStateProps {
|
|
9
|
+
displayText: string;
|
|
10
|
+
headerTitle: string;
|
|
11
|
+
launchForm?(): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const EmptyState: React.FC<EmptyStateProps> = ({ headerTitle, displayText, launchForm }) => {
|
|
15
|
+
const isTablet = useLayoutType() === 'tablet';
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Layer>
|
|
19
|
+
<Tile className={styles.tile}>
|
|
20
|
+
<div className={isTablet ? styles.tabletHeading : styles.desktopHeading}>
|
|
21
|
+
<h4>{headerTitle}</h4>
|
|
22
|
+
</div>
|
|
23
|
+
<EmptyDataIllustration />
|
|
24
|
+
<p className={styles.content}>
|
|
25
|
+
<Trans i18nKey="emptyStateText" displayText={displayText}>
|
|
26
|
+
There are no <span className={styles.displayText}>{{ displayText } as any}</span> to display
|
|
27
|
+
</Trans>
|
|
28
|
+
</p>
|
|
29
|
+
</Tile>
|
|
30
|
+
</Layer>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@import '~@openmrs/esm-styleguide/src/vars';
|
|
4
|
+
|
|
5
|
+
.content {
|
|
6
|
+
@include type.type-style('heading-compact-01');
|
|
7
|
+
color: $text-02;
|
|
8
|
+
margin-top: layout.$spacing-05;
|
|
9
|
+
margin-bottom: layout.$spacing-03;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.displayText {
|
|
13
|
+
text-transform: lowercase;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.desktopHeading {
|
|
17
|
+
h4 {
|
|
18
|
+
@include type.type-style('heading-compact-02');
|
|
19
|
+
color: $text-02;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.tabletHeading {
|
|
24
|
+
h4 {
|
|
25
|
+
@include type.type-style('heading-03');
|
|
26
|
+
color: $text-02;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.desktopHeading,
|
|
31
|
+
.tabletHeading {
|
|
32
|
+
text-align: left;
|
|
33
|
+
text-transform: capitalize;
|
|
34
|
+
margin-bottom: layout.$spacing-05;
|
|
35
|
+
|
|
36
|
+
h4:after {
|
|
37
|
+
content: '';
|
|
38
|
+
display: block;
|
|
39
|
+
width: 2rem;
|
|
40
|
+
padding-top: 0.188rem;
|
|
41
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.heading:after {
|
|
46
|
+
content: '';
|
|
47
|
+
display: block;
|
|
48
|
+
width: 2rem;
|
|
49
|
+
padding-top: 0.188rem;
|
|
50
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.tile {
|
|
54
|
+
text-align: center;
|
|
55
|
+
border: 1px solid $ui-03;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.header4 {
|
|
59
|
+
@include type.type-style('heading-compact-01');
|
|
60
|
+
margin-bottom: 1rem;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Overriding styles for RTL support
|
|
64
|
+
html[dir='rtl'] {
|
|
65
|
+
.desktopHeading,
|
|
66
|
+
.tabletHeading {
|
|
67
|
+
text-align: right;
|
|
68
|
+
}
|
|
69
|
+
}
|