@openmrs/esm-appointments-app 5.2.2-pre.2638 → 5.2.2-pre.2643
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 +1 -1
- package/dist/574.js +1 -1
- package/dist/636.js +1 -1
- package/dist/636.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-appointments-app.js.buildmanifest.json +9 -9
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/helpers/functions.ts +13 -11
- package/src/home-appointments/appointment-actions.component.tsx +2 -1
- package/src/home-appointments/appointments-list.component.tsx +5 -6
- package/src/home-appointments/appointments-list.scss +0 -10
- package/src/home-appointments/appointments-table.resource.ts +1 -1
- package/src/types/index.ts +3 -2
- package/translations/en.json +0 -2
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"initial": true,
|
|
81
81
|
"entry": true,
|
|
82
82
|
"recorded": false,
|
|
83
|
-
"size":
|
|
83
|
+
"size": 4544644,
|
|
84
84
|
"sizes": {
|
|
85
85
|
"consume-shared": 252,
|
|
86
|
-
"javascript":
|
|
86
|
+
"javascript": 4523720,
|
|
87
87
|
"share-init": 252,
|
|
88
88
|
"runtime": 20420
|
|
89
89
|
},
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"auxiliaryFiles": [
|
|
101
101
|
"main.js.map"
|
|
102
102
|
],
|
|
103
|
-
"hash": "
|
|
103
|
+
"hash": "96b80387c4e42970",
|
|
104
104
|
"childrenByOrder": {}
|
|
105
105
|
},
|
|
106
106
|
{
|
|
@@ -294,9 +294,9 @@
|
|
|
294
294
|
"initial": false,
|
|
295
295
|
"entry": false,
|
|
296
296
|
"recorded": false,
|
|
297
|
-
"size":
|
|
297
|
+
"size": 5234,
|
|
298
298
|
"sizes": {
|
|
299
|
-
"javascript":
|
|
299
|
+
"javascript": 5234
|
|
300
300
|
},
|
|
301
301
|
"names": [],
|
|
302
302
|
"idHints": [],
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
"574.js"
|
|
309
309
|
],
|
|
310
310
|
"auxiliaryFiles": [],
|
|
311
|
-
"hash": "
|
|
311
|
+
"hash": "7c473cf93645fc94",
|
|
312
312
|
"childrenByOrder": {}
|
|
313
313
|
},
|
|
314
314
|
{
|
|
@@ -396,9 +396,9 @@
|
|
|
396
396
|
"initial": false,
|
|
397
397
|
"entry": false,
|
|
398
398
|
"recorded": false,
|
|
399
|
-
"size":
|
|
399
|
+
"size": 480351,
|
|
400
400
|
"sizes": {
|
|
401
|
-
"javascript":
|
|
401
|
+
"javascript": 480183,
|
|
402
402
|
"consume-shared": 168
|
|
403
403
|
},
|
|
404
404
|
"names": [],
|
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
"auxiliaryFiles": [
|
|
413
413
|
"636.js.map"
|
|
414
414
|
],
|
|
415
|
-
"hash": "
|
|
415
|
+
"hash": "8934a46fceaded54",
|
|
416
416
|
"childrenByOrder": {}
|
|
417
417
|
},
|
|
418
418
|
{
|
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":"check-in-appointment-modal","slot":"todays-appointment-slot","component":"checkInModal"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"early-appointments-panel","component":"earlyAppointments"}],"version":"5.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":"check-in-appointment-modal","slot":"todays-appointment-slot","component":"checkInModal"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"early-appointments-panel","component":"earlyAppointments"}],"version":"5.2.2-pre.2643"}
|
package/package.json
CHANGED
package/src/helpers/functions.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { formatDate, parseDate
|
|
3
|
-
import
|
|
1
|
+
import dayjs, { type Dayjs } from 'dayjs';
|
|
2
|
+
import { formatDate, parseDate } from '@openmrs/esm-framework';
|
|
3
|
+
import { type AppointmentSummary, type Appointment } from '../types';
|
|
4
4
|
import { configSchema } from '../config-schema';
|
|
5
5
|
|
|
6
6
|
export const getHighestAppointmentServiceLoad = (appointmentSummary: Array<any> = []) => {
|
|
@@ -29,18 +29,18 @@ export const getServiceCountByAppointmentType = (
|
|
|
29
29
|
|
|
30
30
|
function getAppointmentDuration(startTime = 0, endTime = 0) {
|
|
31
31
|
const diff = endTime - startTime;
|
|
32
|
-
|
|
32
|
+
const minutes = Math.floor(diff / 60000);
|
|
33
33
|
return minutes + 'min';
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function formatAMPM(date) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
let hours = date.getHours();
|
|
38
|
+
let minutes = date.getMinutes();
|
|
39
|
+
let ampm = hours >= 12 ? 'PM' : 'AM';
|
|
40
40
|
hours = hours % 12;
|
|
41
41
|
hours = hours ? hours : 12; // the hour '0' should be '12'
|
|
42
42
|
minutes = minutes < 10 ? '0' + minutes : minutes;
|
|
43
|
-
|
|
43
|
+
const strTime = hours + ':' + minutes + ' ' + ampm;
|
|
44
44
|
return strTime;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -64,9 +64,11 @@ export const mapAppointmentProperties = (appointment: Appointment, t?: Function)
|
|
|
64
64
|
comments: appointment.comments ? appointment.comments : '--',
|
|
65
65
|
appointmentNumber: appointment.appointmentNumber,
|
|
66
66
|
color: appointment?.service?.color ?? '',
|
|
67
|
-
identifier: appointment?.patient?.identifiers?.
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
identifier: appointment?.patient?.identifiers?.length
|
|
68
|
+
? appointment.patient.identifiers.find(
|
|
69
|
+
(identifier) => identifier.identifierName === configSchema.patientIdentifierType._default,
|
|
70
|
+
).identifier
|
|
71
|
+
: appointment.patient?.identifier,
|
|
70
72
|
duration: appointment.service?.durationMins
|
|
71
73
|
? appointment?.service?.durationMins + t('minutes', 'min')
|
|
72
74
|
: getAppointmentDuration(appointment.startDateTime, appointment.endDateTime),
|
|
@@ -96,7 +96,8 @@ export const ActionsMenu = ({ appointment, useBahmniUI }: ActionMenuProps) => {
|
|
|
96
96
|
return (
|
|
97
97
|
<Layer>
|
|
98
98
|
<OverflowMenu
|
|
99
|
-
|
|
99
|
+
align="left"
|
|
100
|
+
aria-label="Options"
|
|
100
101
|
selectorPrimaryFocus={'#editPatientDetails'}
|
|
101
102
|
size={isDesktop ? 'sm' : 'lg'}
|
|
102
103
|
flipped>
|
|
@@ -32,9 +32,9 @@ import { EmptyDataIllustration } from './empty-data-illustration.component';
|
|
|
32
32
|
import { launchCheckInAppointmentModal, handleComplete } from './common';
|
|
33
33
|
import { SeeAllAppointmentsLink, AddAppointmentLink, ViewCalendarLink } from './links.component';
|
|
34
34
|
import { type Appointment, type MappedHomeAppointment } from '../types';
|
|
35
|
+
import { type ConfigObject } from '../config-schema';
|
|
35
36
|
import { useTodaysAppointments } from './appointments-table.resource';
|
|
36
37
|
import styles from './appointments-list.scss';
|
|
37
|
-
import { type ConfigObject } from '../config-schema';
|
|
38
38
|
|
|
39
39
|
interface PaginationData {
|
|
40
40
|
goTo: (page: number) => void;
|
|
@@ -78,7 +78,7 @@ const RenderStatus = ({ status, t, appointmentUuid, mutate }: RenderStatusProps)
|
|
|
78
78
|
);
|
|
79
79
|
case 'CheckedIn':
|
|
80
80
|
return (
|
|
81
|
-
<Button kind="ghost"
|
|
81
|
+
<Button kind="ghost" onClick={() => handleComplete(appointmentUuid, mutate, t)}>
|
|
82
82
|
{t('complete', 'Complete')}
|
|
83
83
|
</Button>
|
|
84
84
|
);
|
|
@@ -87,7 +87,6 @@ const RenderStatus = ({ status, t, appointmentUuid, mutate }: RenderStatusProps)
|
|
|
87
87
|
<Button
|
|
88
88
|
size="sm"
|
|
89
89
|
kind="ghost"
|
|
90
|
-
className={styles.actionButton}
|
|
91
90
|
disabled={status === 'CheckedIn'}
|
|
92
91
|
onClick={() => launchCheckInAppointmentModal(appointmentUuid)}>
|
|
93
92
|
{t('checkIn', 'Check In')}
|
|
@@ -185,7 +184,7 @@ const AppointmentsBaseTable = () => {
|
|
|
185
184
|
identifier: {
|
|
186
185
|
content: (
|
|
187
186
|
<div className={styles.nameContainer}>
|
|
188
|
-
<span
|
|
187
|
+
<span>{appointment.identifier}</span>
|
|
189
188
|
</div>
|
|
190
189
|
),
|
|
191
190
|
sortKey: appointment.identifier,
|
|
@@ -205,7 +204,7 @@ const AppointmentsBaseTable = () => {
|
|
|
205
204
|
},
|
|
206
205
|
actionButton: {
|
|
207
206
|
content: (
|
|
208
|
-
<span
|
|
207
|
+
<span>
|
|
209
208
|
<RenderStatus status={appointment.status} appointmentUuid={appointment.id} t={t} mutate={mutate} />
|
|
210
209
|
</span>
|
|
211
210
|
),
|
|
@@ -286,7 +285,7 @@ const AppointmentsBaseTable = () => {
|
|
|
286
285
|
sortRow={handleSorting}
|
|
287
286
|
overflowMenuOnHover={isDesktop(layout)}
|
|
288
287
|
rows={tableRows}
|
|
289
|
-
size={isDesktop(layout) ? '
|
|
288
|
+
size={isDesktop(layout) ? 'lg' : 'sm'}
|
|
290
289
|
useZebraStyles={true}>
|
|
291
290
|
{({ rows, headers, getHeaderProps, getTableProps, getRowProps }) => {
|
|
292
291
|
return (
|
|
@@ -84,15 +84,6 @@
|
|
|
84
84
|
width: max-content;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
.identifier {
|
|
88
|
-
font-weight: 700;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.actionButton {
|
|
92
|
-
position: static;
|
|
93
|
-
padding: layout.$spacing-03 layout.$spacing-05 layout.$spacing-03 0;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
87
|
.serviceColor {
|
|
97
88
|
border-radius: 50%;
|
|
98
89
|
margin-right: layout.$spacing-03;
|
|
@@ -135,7 +126,6 @@
|
|
|
135
126
|
.missedIcon,
|
|
136
127
|
.cancelIcon {
|
|
137
128
|
width: 8rem;
|
|
138
|
-
padding: layout.$spacing-03 layout.$spacing-05 layout.$spacing-03 0;
|
|
139
129
|
display: flex;
|
|
140
130
|
align-items: center;
|
|
141
131
|
height: layout.$spacing-09;
|
|
@@ -3,9 +3,9 @@ import useSWR from 'swr';
|
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
6
|
-
import { AppointmentService, Appointment } from '../types';
|
|
7
6
|
import { useAppointmentDate, mapAppointmentProperties } from '../helpers';
|
|
8
7
|
import { omrsDateFormat } from '../constants';
|
|
8
|
+
import type { AppointmentService, Appointment } from '../types';
|
|
9
9
|
|
|
10
10
|
export function useTodaysAppointments() {
|
|
11
11
|
const { t } = useTranslation();
|
package/src/types/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenmrsResource } from '@openmrs/esm-framework';
|
|
2
|
-
import { amPm } from '../helpers';
|
|
1
|
+
import { type OpenmrsResource } from '@openmrs/esm-framework';
|
|
2
|
+
import { type amPm } from '../helpers';
|
|
3
3
|
|
|
4
4
|
export enum SearchTypes {
|
|
5
5
|
BASIC = 'basic',
|
|
@@ -15,6 +15,7 @@ export interface Appointment {
|
|
|
15
15
|
endDateTime: Date | number | any;
|
|
16
16
|
location: OpenmrsResource;
|
|
17
17
|
patient: {
|
|
18
|
+
identifier: string;
|
|
18
19
|
identifiers: Array<Identifier>;
|
|
19
20
|
name: string;
|
|
20
21
|
uuid: string;
|
package/translations/en.json
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"actions": "Actions",
|
|
3
3
|
"add": "Add",
|
|
4
4
|
"addNewAppointment": "Add new appointment",
|
|
5
|
-
"addNewClinicDay": "Add new clinic day",
|
|
6
5
|
"addPatientToQueue": "Add patient to queue",
|
|
7
6
|
"age": "Age",
|
|
8
7
|
"all": "All",
|
|
@@ -74,7 +73,6 @@
|
|
|
74
73
|
"errorCheckingAppoitment": "Error checking in the appointment",
|
|
75
74
|
"errorCreatingAppointmentService": "Error creating appointment service",
|
|
76
75
|
"expected": "Expected",
|
|
77
|
-
"filter": "Filter",
|
|
78
76
|
"gender": "Gender",
|
|
79
77
|
"highestServiceVolume": "High volume service: {{time}}",
|
|
80
78
|
"home": "Home",
|