@kenyaemr/esm-service-queues-app 8.1.1-pre.123 → 8.1.1-pre.124
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 +12 -12
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/574.js +1 -1
- package/dist/{665.js → 660.js} +2 -2
- package/dist/{665.js.map → 660.js.map} +1 -1
- package/dist/748.js +1 -1
- package/dist/748.js.map +1 -1
- package/dist/760.js +1 -1
- package/dist/760.js.map +1 -1
- package/dist/kenyaemr-esm-service-queues-app.js +1 -1
- package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +21 -21
- 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/patient-search/patient-scheduled-visits.component.tsx +43 -52
- package/src/patient-search/visit-form/visit-form.component.tsx +43 -50
- package/src/queue-table/default-queue-table.component.tsx +17 -16
- package/src/queue-table/queue-table-by-status-menu.component.tsx +1 -1
- package/src/queue-table/queue-table-metrics.component.tsx +6 -1
- package/src/queue-table/queue-table.component.tsx +11 -8
- package/src/queue-table/queue-table.scss +5 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.component.tsx +16 -15
- package/src/remove-queue-entry-dialog/remove-queue-entry.resource.ts +20 -26
- package/translations/en.json +2 -2
- /package/dist/{665.js.LICENSE.txt → 660.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","queue":"^2.4.0-0"},"extensions":[{"name":"outpatient-side-nav-ext","component":"outpatientSideNav","slot":"outpatient-sidebar-slot","online":true,"offline":true},{"name":"service-queues-dashboard-link","component":"serviceQueuesDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"service-queues","slot":"service-queues-dashboard-slot","title":"Service queues"},"online":true,"offline":true},{"name":"queue-table-by-status-menu-dashboard-link","component":"queueTableByStatusMenu","meta":{"name":"service-queues","slot":"service-queues-dashboard-slot","title":"Service queues"},"online":true,"offline":true},{"component":"root","name":"service-queues-dashboard","slot":"service-queues-dashboard-slot"},{"name":"patient-info-banner-slot","component":"patientInfoBannerSlot"},{"name":"remove-queue-entry","component":"removeQueueEntry"},{"name":"clear-all-queue-entries","component":"clearAllQueueEntries"},{"name":"previous-visit-summary-widget","component":"pastVisitSummary","slot":"previous-visit-summary-slot"},{"name":"active-visits-row-actions","component":"activeVisitsRowActions","slot":"queue-table-serve-patient-slot"},{"name":"visit-form-queue-fields","component":"visitFormQueueFields","slot":"visit-form-queue-slot"}],"modals":[{"name":"add-visit-to-queue-modal","component":"addVisitToQueueModal"},{"name":"add-provider-to-room-modal","component":"addProviderToRoomModal"},{"name":"edit-queue-entry-modal","component":"editQueueEntryModal"},{"name":"edit-queue-entry-status-modal","component":"editQueueEntryStatusModal"},{"name":"end-queue-entry-modal","component":"endQueueEntryModal"},{"name":"transition-patient-to-latest-queue-modal","component":"transitionPatientToLatestQueue"},{"name":"transition-queue-entry-modal","component":"transitionQueueEntryModal"},{"name":"transition-queue-entry-status-modal","component":"transitionQueueEntryStatusModal"},{"name":"undo-transition-queue-entry-modal","component":"undoTransitionQueueEntryModal"},{"name":"void-queue-entry-modal","component":"voidQueueEntryModal"}],"workspaces":[{"name":"service-queues-service-form","title":"addNewQueueService","component":"addNewQueueServiceWorkspace","type":"service-queues"},{"name":"service-queues-room-form","title":"addNewQueueServiceRoom","component":"addNewQueueServiceRoomWorkspace","type":"service-queues"},{"name":"service-queues-linelist-filter","title":"filter","component":"queueLinelistFilterWorkspace","type":"service-queues"},{"name":"service-queues-patient-search","title":"searchPatient","component":"patientSearchWorkspace","type":"service-queues"}],"version":"8.1.1-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0","queue":"^2.4.0-0"},"extensions":[{"name":"outpatient-side-nav-ext","component":"outpatientSideNav","slot":"outpatient-sidebar-slot","online":true,"offline":true},{"name":"service-queues-dashboard-link","component":"serviceQueuesDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"service-queues","slot":"service-queues-dashboard-slot","title":"Service queues"},"online":true,"offline":true},{"name":"queue-table-by-status-menu-dashboard-link","component":"queueTableByStatusMenu","meta":{"name":"service-queues","slot":"service-queues-dashboard-slot","title":"Service queues"},"online":true,"offline":true},{"component":"root","name":"service-queues-dashboard","slot":"service-queues-dashboard-slot"},{"name":"patient-info-banner-slot","component":"patientInfoBannerSlot"},{"name":"remove-queue-entry","component":"removeQueueEntry"},{"name":"clear-all-queue-entries","component":"clearAllQueueEntries"},{"name":"previous-visit-summary-widget","component":"pastVisitSummary","slot":"previous-visit-summary-slot"},{"name":"active-visits-row-actions","component":"activeVisitsRowActions","slot":"queue-table-serve-patient-slot"},{"name":"visit-form-queue-fields","component":"visitFormQueueFields","slot":"visit-form-queue-slot"}],"modals":[{"name":"add-visit-to-queue-modal","component":"addVisitToQueueModal"},{"name":"add-provider-to-room-modal","component":"addProviderToRoomModal"},{"name":"edit-queue-entry-modal","component":"editQueueEntryModal"},{"name":"edit-queue-entry-status-modal","component":"editQueueEntryStatusModal"},{"name":"end-queue-entry-modal","component":"endQueueEntryModal"},{"name":"transition-patient-to-latest-queue-modal","component":"transitionPatientToLatestQueue"},{"name":"transition-queue-entry-modal","component":"transitionQueueEntryModal"},{"name":"transition-queue-entry-status-modal","component":"transitionQueueEntryStatusModal"},{"name":"undo-transition-queue-entry-modal","component":"undoTransitionQueueEntryModal"},{"name":"void-queue-entry-modal","component":"voidQueueEntryModal"}],"workspaces":[{"name":"service-queues-service-form","title":"addNewQueueService","component":"addNewQueueServiceWorkspace","type":"service-queues"},{"name":"service-queues-room-form","title":"addNewQueueServiceRoom","component":"addNewQueueServiceRoomWorkspace","type":"service-queues"},{"name":"service-queues-linelist-filter","title":"filter","component":"queueLinelistFilterWorkspace","type":"service-queues"},{"name":"service-queues-patient-search","title":"searchPatient","component":"patientSearchWorkspace","type":"service-queues"}],"version":"8.1.1-pre.124"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import head from 'lodash-es/head';
|
|
4
|
-
import { first } from 'rxjs/operators';
|
|
5
4
|
import { useTranslation } from 'react-i18next';
|
|
6
5
|
import {
|
|
7
6
|
Button,
|
|
@@ -113,58 +112,50 @@ const ScheduledVisitsForVisitType: React.FC<{
|
|
|
113
112
|
const abortController = new AbortController();
|
|
114
113
|
|
|
115
114
|
saveVisit(payload, abortController)
|
|
116
|
-
.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
kind: 'error',
|
|
150
|
-
isLowContrast: false,
|
|
151
|
-
subtitle: error?.message,
|
|
152
|
-
});
|
|
153
|
-
setIsSubmitting(false);
|
|
154
|
-
},
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
(error) => {
|
|
159
|
-
showSnackbar({
|
|
160
|
-
title: t('startVisitError', 'Error starting visit'),
|
|
161
|
-
kind: 'error',
|
|
162
|
-
isLowContrast: false,
|
|
163
|
-
subtitle: error?.message,
|
|
115
|
+
.then((response) => {
|
|
116
|
+
postQueueEntry(
|
|
117
|
+
response.data.uuid,
|
|
118
|
+
patientId,
|
|
119
|
+
priority,
|
|
120
|
+
defaultStatus,
|
|
121
|
+
service,
|
|
122
|
+
appointment,
|
|
123
|
+
selectedQueueLocation,
|
|
124
|
+
visitQueueNumberAttributeUuid,
|
|
125
|
+
)
|
|
126
|
+
.then(() => {
|
|
127
|
+
showSnackbar({
|
|
128
|
+
kind: 'success',
|
|
129
|
+
title: t('startAVisit', 'Start a visit'),
|
|
130
|
+
subtitle: t(
|
|
131
|
+
'startVisitQueueSuccessfully',
|
|
132
|
+
'Patient has been added to active visits list and queue.',
|
|
133
|
+
`${hours} : ${minutes}`,
|
|
134
|
+
),
|
|
135
|
+
});
|
|
136
|
+
closeWorkspace();
|
|
137
|
+
setIsSubmitting(false);
|
|
138
|
+
mutateQueueEntries();
|
|
139
|
+
})
|
|
140
|
+
.catch((error) => {
|
|
141
|
+
showSnackbar({
|
|
142
|
+
title: t('queueEntryError', 'Error adding patient to the queue'),
|
|
143
|
+
kind: 'error',
|
|
144
|
+
isLowContrast: false,
|
|
145
|
+
subtitle: error?.message,
|
|
146
|
+
});
|
|
147
|
+
setIsSubmitting(false);
|
|
164
148
|
});
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
149
|
+
})
|
|
150
|
+
.catch((error) => {
|
|
151
|
+
showSnackbar({
|
|
152
|
+
title: t('startVisitError', 'Error starting visit'),
|
|
153
|
+
kind: 'error',
|
|
154
|
+
isLowContrast: false,
|
|
155
|
+
subtitle: error?.message,
|
|
156
|
+
});
|
|
157
|
+
setIsSubmitting(false);
|
|
158
|
+
});
|
|
168
159
|
}
|
|
169
160
|
},
|
|
170
161
|
[
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
|
-
import { first } from 'rxjs/operators';
|
|
4
3
|
import {
|
|
5
4
|
Button,
|
|
6
5
|
ButtonSet,
|
|
@@ -67,7 +66,7 @@ const VisitForm: React.FC<VisitFormProps> = ({ patientUuid, closeWorkspace }) =>
|
|
|
67
66
|
const [visitTime, setVisitTime] = useState(dayjs(new Date()).format('hh:mm'));
|
|
68
67
|
const state = useMemo(() => ({ patientUuid }), [patientUuid]);
|
|
69
68
|
const [ignoreChanges, setIgnoreChanges] = useState(true);
|
|
70
|
-
const { activePatientEnrollment
|
|
69
|
+
const { activePatientEnrollment } = useActivePatientEnrollment(patientUuid);
|
|
71
70
|
const [enrollment, setEnrollment] = useState<PatientProgram>(activePatientEnrollment[0]);
|
|
72
71
|
const { mutateQueueEntries } = useMutateQueueEntries();
|
|
73
72
|
const visitQueueNumberAttributeUuid = config.visitQueueNumberAttributeUuid;
|
|
@@ -116,56 +115,50 @@ const VisitForm: React.FC<VisitFormProps> = ({ patientUuid, closeWorkspace }) =>
|
|
|
116
115
|
|
|
117
116
|
const abortController = new AbortController();
|
|
118
117
|
|
|
119
|
-
saveVisit(payload, abortController)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
subtitle: error?.message,
|
|
156
|
-
});
|
|
157
|
-
},
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
(error) => {
|
|
118
|
+
saveVisit(payload, abortController).then((response) => {
|
|
119
|
+
// add new queue entry if visit created successfully
|
|
120
|
+
postQueueEntry(
|
|
121
|
+
response.data.uuid,
|
|
122
|
+
service,
|
|
123
|
+
patientUuid,
|
|
124
|
+
priority,
|
|
125
|
+
status,
|
|
126
|
+
sortWeight,
|
|
127
|
+
queueLocation,
|
|
128
|
+
visitQueueNumberAttributeUuid,
|
|
129
|
+
)
|
|
130
|
+
.then(() => {
|
|
131
|
+
showSnackbar({
|
|
132
|
+
kind: 'success',
|
|
133
|
+
isLowContrast: true,
|
|
134
|
+
title: t('startAVisit', 'Start a visit'),
|
|
135
|
+
subtitle: t(
|
|
136
|
+
'startVisitQueueSuccessfully',
|
|
137
|
+
'Patient has been added to active visits list and queue.',
|
|
138
|
+
`${hours} : ${minutes}`,
|
|
139
|
+
),
|
|
140
|
+
});
|
|
141
|
+
closeWorkspace();
|
|
142
|
+
setIsSubmitting(false);
|
|
143
|
+
mutateQueueEntries();
|
|
144
|
+
})
|
|
145
|
+
.catch((error) => {
|
|
146
|
+
showSnackbar({
|
|
147
|
+
title: t('queueEntryError', 'Error adding patient to the queue'),
|
|
148
|
+
kind: 'error',
|
|
149
|
+
subtitle: error?.message,
|
|
150
|
+
});
|
|
151
|
+
setIsSubmitting(false);
|
|
152
|
+
})
|
|
153
|
+
.catch((error) => {
|
|
162
154
|
showSnackbar({
|
|
163
155
|
title: t('startVisitError', 'Error starting visit'),
|
|
164
156
|
kind: 'error',
|
|
165
157
|
subtitle: error?.message,
|
|
166
158
|
});
|
|
167
|
-
|
|
168
|
-
|
|
159
|
+
setIsSubmitting(false);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
169
162
|
},
|
|
170
163
|
[
|
|
171
164
|
closeWorkspace,
|
|
@@ -181,9 +174,9 @@ const VisitForm: React.FC<VisitFormProps> = ({ patientUuid, closeWorkspace }) =>
|
|
|
181
174
|
],
|
|
182
175
|
);
|
|
183
176
|
|
|
184
|
-
const handleOnChange = () => {
|
|
177
|
+
const handleOnChange = useCallback(() => {
|
|
185
178
|
setIgnoreChanges((prevState) => !prevState);
|
|
186
|
-
};
|
|
179
|
+
}, []);
|
|
187
180
|
|
|
188
181
|
return (
|
|
189
182
|
<Form className={styles.form} onChange={handleOnChange} onSubmit={handleSubmit}>
|
|
@@ -133,17 +133,18 @@ function DefaultQueueTable() {
|
|
|
133
133
|
queueUuid={null}
|
|
134
134
|
statusUuid={null}
|
|
135
135
|
ExpandedRow={QueueTableExpandedRow}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
136
|
+
tableFilters={
|
|
137
|
+
<>
|
|
138
|
+
<QueueDropdownFilter /> <StatusDropdownFilter />
|
|
139
|
+
<TableToolbarSearch
|
|
140
|
+
className={styles.search}
|
|
141
|
+
onChange={(e) => setSearchTerm(e.target.value)}
|
|
142
|
+
placeholder={t('searchThisList', 'Search this list')}
|
|
143
|
+
size={isDesktop(layout) ? 'sm' : 'lg'}
|
|
144
|
+
/>
|
|
145
|
+
<ClearQueueEntries queueEntries={filteredQueueEntries} />
|
|
146
|
+
</>
|
|
147
|
+
}
|
|
147
148
|
/>
|
|
148
149
|
</div>
|
|
149
150
|
) : (
|
|
@@ -160,17 +161,17 @@ function QueueDropdownFilter() {
|
|
|
160
161
|
const layout = useLayoutType();
|
|
161
162
|
const { services } = useQueueServices();
|
|
162
163
|
const selectedService = useSelectedService();
|
|
163
|
-
|
|
164
|
+
|
|
165
|
+
const handleServiceChange = useCallback(({ selectedItem }) => {
|
|
164
166
|
updateSelectedService(selectedItem.uuid, selectedItem?.display);
|
|
165
|
-
|
|
166
|
-
};
|
|
167
|
+
}, []);
|
|
167
168
|
|
|
168
169
|
return (
|
|
169
170
|
<>
|
|
170
171
|
<div className={styles.filterContainer}>
|
|
171
172
|
<Dropdown
|
|
172
173
|
id="serviceFilter"
|
|
173
|
-
titleText={t('filterByService', 'Filter by service
|
|
174
|
+
titleText={t('filterByService', 'Filter by service:')}
|
|
174
175
|
label={selectedService?.serviceDisplay ?? t('all', 'All')}
|
|
175
176
|
type="inline"
|
|
176
177
|
items={[{ display: `${t('all', 'All')}` }, ...(services ?? [])]}
|
|
@@ -197,7 +198,7 @@ function StatusDropdownFilter() {
|
|
|
197
198
|
<div className={styles.filterContainer}>
|
|
198
199
|
<Dropdown
|
|
199
200
|
id="statusFilter"
|
|
200
|
-
titleText={t('filterByStatus', 'Filter by status
|
|
201
|
+
titleText={t('filterByStatus', 'Filter by status:')}
|
|
201
202
|
label={queueStatus?.statusDisplay ?? t('all', 'All')}
|
|
202
203
|
type="inline"
|
|
203
204
|
items={[{ display: `${t('all', 'All')}` }, ...(statuses ?? [])]}
|
|
@@ -18,7 +18,7 @@ export default function QueueTableByStatusMenu() {
|
|
|
18
18
|
<SideNavMenu title={t('serviceQueues', 'Service queues')} className={styles.queueTableByStatusNavMenu}>
|
|
19
19
|
<BrowserRouter>
|
|
20
20
|
{queues.map((queue) => (
|
|
21
|
-
<QueueTableByStatusLink queue={queue} />
|
|
21
|
+
<QueueTableByStatusLink key={queue.uuid} queue={queue} />
|
|
22
22
|
))}
|
|
23
23
|
</BrowserRouter>
|
|
24
24
|
</SideNavMenu>
|
|
@@ -20,7 +20,12 @@ function QueueTableMetrics({ selectedQueue }: QueueTableMetricsProps) {
|
|
|
20
20
|
<QueueTableMetricsCard value={count} headerLabel={t('totalPatients', 'Total Patients')} />
|
|
21
21
|
{allowedStatuses?.map((status) => {
|
|
22
22
|
return (
|
|
23
|
-
<QueueTableMetricsCard
|
|
23
|
+
<QueueTableMetricsCard
|
|
24
|
+
headerLabel={status.display}
|
|
25
|
+
key={status.uuid}
|
|
26
|
+
queueUuid={selectedQueue.uuid}
|
|
27
|
+
status={status.uuid}
|
|
28
|
+
/>
|
|
24
29
|
);
|
|
25
30
|
})}
|
|
26
31
|
</div>
|
|
@@ -46,7 +46,7 @@ interface QueueTableProps {
|
|
|
46
46
|
ExpandedRow?: FC<{ queueEntry: QueueEntry }>;
|
|
47
47
|
|
|
48
48
|
// if provided, adds addition table toolbar elements
|
|
49
|
-
|
|
49
|
+
tableFilters?: React.ReactNode;
|
|
50
50
|
|
|
51
51
|
isLoading?: boolean;
|
|
52
52
|
}
|
|
@@ -58,7 +58,7 @@ function QueueTable({
|
|
|
58
58
|
statusUuid,
|
|
59
59
|
queueTableColumnsOverride,
|
|
60
60
|
ExpandedRow,
|
|
61
|
-
|
|
61
|
+
tableFilters,
|
|
62
62
|
isLoading,
|
|
63
63
|
}: QueueTableProps) {
|
|
64
64
|
const { t } = useTranslation();
|
|
@@ -80,7 +80,7 @@ function QueueTable({
|
|
|
80
80
|
paginatedQueueEntries?.map((queueEntry) => {
|
|
81
81
|
const row: Record<string, JSX.Element | string> = { id: queueEntry.uuid };
|
|
82
82
|
columns.forEach(({ key, CellComponent }) => {
|
|
83
|
-
row[key] = <CellComponent queueEntry={queueEntry} />;
|
|
83
|
+
row[key] = <CellComponent key={key} queueEntry={queueEntry} />;
|
|
84
84
|
});
|
|
85
85
|
return row;
|
|
86
86
|
}) ?? [];
|
|
@@ -111,9 +111,9 @@ function QueueTable({
|
|
|
111
111
|
</span>
|
|
112
112
|
) : null}
|
|
113
113
|
|
|
114
|
-
{
|
|
114
|
+
{tableFilters && (
|
|
115
115
|
<TableToolbar {...getToolbarProps()}>
|
|
116
|
-
<TableToolbarContent className={styles.toolbarContent}>{
|
|
116
|
+
<TableToolbarContent className={styles.toolbarContent}>{tableFilters}</TableToolbarContent>
|
|
117
117
|
</TableToolbar>
|
|
118
118
|
)}
|
|
119
119
|
</div>
|
|
@@ -121,8 +121,8 @@ function QueueTable({
|
|
|
121
121
|
<TableHead>
|
|
122
122
|
<TableRow>
|
|
123
123
|
{ExpandedRow && <TableExpandHeader enableToggle {...getExpandHeaderProps()} />}
|
|
124
|
-
{headers.map((header
|
|
125
|
-
<TableHeader key={
|
|
124
|
+
{headers.map((header) => (
|
|
125
|
+
<TableHeader key={header.key} {...getHeaderProps({ header })}>
|
|
126
126
|
{header.header}
|
|
127
127
|
</TableHeader>
|
|
128
128
|
))}
|
|
@@ -146,7 +146,10 @@ function QueueTable({
|
|
|
146
146
|
))}
|
|
147
147
|
</Row>
|
|
148
148
|
{ExpandedRow && row.isExpanded && (
|
|
149
|
-
<TableExpandedRow
|
|
149
|
+
<TableExpandedRow
|
|
150
|
+
key={i}
|
|
151
|
+
className={styles.expandedActiveVisitRow}
|
|
152
|
+
colSpan={headers.length + 1}>
|
|
150
153
|
<ExpandedRow queueEntry={paginatedQueueEntries[i]} />
|
|
151
154
|
</TableExpandedRow>
|
|
152
155
|
)}
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.filterContainer {
|
|
31
|
+
label {
|
|
32
|
+
margin-right: layout.$spacing-03 !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
:global(.cds--dropdown__wrapper--inline) {
|
|
32
36
|
gap: 0;
|
|
33
37
|
}
|
|
@@ -97,6 +101,7 @@
|
|
|
97
101
|
.toolbarContent {
|
|
98
102
|
display: flex;
|
|
99
103
|
z-index: 1; // prevent dropdown from getting covered by table elements
|
|
104
|
+
column-gap: layout.$spacing-03;
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
:global(.cds--table-toolbar) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Button, ModalBody, ModalFooter, ModalHeader } from '@carbon/react';
|
|
4
4
|
import { parseDate, showSnackbar, useVisit } from '@openmrs/esm-framework';
|
|
@@ -20,7 +20,7 @@ const RemoveQueueEntryDialog: React.FC<RemoveQueueEntryDialogProps> = ({ queueEn
|
|
|
20
20
|
|
|
21
21
|
const { data: appointments } = useCheckedInAppointments(queueEntry.patientUuid, startOfDay);
|
|
22
22
|
|
|
23
|
-
const removeQueueEntry = () => {
|
|
23
|
+
const removeQueueEntry = useCallback(() => {
|
|
24
24
|
const endCurrentVisitPayload = {
|
|
25
25
|
location: currentVisit?.location?.uuid,
|
|
26
26
|
startDatetime: parseDate(currentVisit?.startDatetime),
|
|
@@ -37,25 +37,26 @@ const RemoveQueueEntryDialog: React.FC<RemoveQueueEntryDialogProps> = ({ queueEn
|
|
|
37
37
|
endCurrentVisitPayload,
|
|
38
38
|
queueEntry.visitUuid,
|
|
39
39
|
appointments,
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
)
|
|
41
|
+
.then(() => {
|
|
42
|
+
closeModal();
|
|
43
|
+
mutateQueueEntries();
|
|
44
|
+
showSnackbar({
|
|
45
|
+
isLowContrast: true,
|
|
46
|
+
kind: 'success',
|
|
47
|
+
subtitle: t('queueEntryRemovedSuccessfully', `Queue entry removed successfully`),
|
|
48
|
+
title: t('queueEntryRemoved', 'Queue entry removed'),
|
|
49
|
+
});
|
|
50
|
+
})
|
|
51
|
+
.catch((error) => {
|
|
50
52
|
showSnackbar({
|
|
51
53
|
title: t('removeQueueEntryError', 'Error removing queue entry'),
|
|
52
54
|
kind: 'error',
|
|
53
55
|
isLowContrast: false,
|
|
54
56
|
subtitle: error?.message,
|
|
55
57
|
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
};
|
|
58
|
+
});
|
|
59
|
+
}, [appointments, currentVisit, queueEntry]);
|
|
59
60
|
|
|
60
61
|
return (
|
|
61
62
|
<div>
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { openmrsFetch, restBaseUrl, updateVisit } from '@openmrs/esm-framework';
|
|
2
1
|
import dayjs from 'dayjs';
|
|
3
|
-
import { endPatientStatus } from '../active-visits/active-visits-table.resource';
|
|
4
|
-
import { type AppointmentsFetchResponse, type EndVisitPayload } from '../types';
|
|
5
2
|
import useSWR from 'swr';
|
|
3
|
+
import { openmrsFetch, restBaseUrl, updateVisit } from '@openmrs/esm-framework';
|
|
4
|
+
import { type AppointmentsFetchResponse, type EndVisitPayload } from '../types';
|
|
5
|
+
import { endPatientStatus } from '../active-visits/active-visits-table.resource';
|
|
6
6
|
import { omrsDateFormat, timeZone } from '../constants';
|
|
7
|
-
import { first } from 'rxjs/operators';
|
|
8
7
|
|
|
9
8
|
const statusChangeTime = dayjs(new Date()).format(omrsDateFormat);
|
|
10
9
|
|
|
11
10
|
export async function endQueueEntry(
|
|
12
11
|
queueUuid: string,
|
|
13
|
-
|
|
14
12
|
queueEntryUuid: string,
|
|
15
13
|
endedAt: Date,
|
|
16
14
|
endCurrentVisitPayload: EndVisitPayload,
|
|
@@ -21,31 +19,27 @@ export async function endQueueEntry(
|
|
|
21
19
|
|
|
22
20
|
if (endCurrentVisitPayload) {
|
|
23
21
|
if (appointments?.length) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
await Promise.all(
|
|
23
|
+
appointments.map(async (appointment) => {
|
|
24
|
+
await changeAppointmentStatus('Completed', appointment.uuid);
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
await
|
|
29
|
+
await endPatientStatus(queueUuid, queueEntryUuid, endedAt);
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(error) => {
|
|
38
|
-
return error;
|
|
39
|
-
},
|
|
40
|
-
);
|
|
31
|
+
try {
|
|
32
|
+
const response = await updateVisit(visitUuid, endCurrentVisitPayload, abortController);
|
|
33
|
+
return response.status;
|
|
34
|
+
} catch (error) {
|
|
35
|
+
return error;
|
|
36
|
+
}
|
|
41
37
|
} else {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return error;
|
|
48
|
-
});
|
|
38
|
+
try {
|
|
39
|
+
return await endPatientStatus(queueUuid, queueEntryUuid, endedAt);
|
|
40
|
+
} catch (error) {
|
|
41
|
+
return error;
|
|
42
|
+
}
|
|
49
43
|
}
|
|
50
44
|
}
|
|
51
45
|
|
package/translations/en.json
CHANGED
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"femaleLabelText": "Female",
|
|
84
84
|
"fields": "of the following fields",
|
|
85
85
|
"filter": "Filter",
|
|
86
|
-
"filterByService": "Filter by service
|
|
87
|
-
"filterByStatus": "Filter by status
|
|
86
|
+
"filterByService": "Filter by service:",
|
|
87
|
+
"filterByStatus": "Filter by status:",
|
|
88
88
|
"filterTable": "Filter table",
|
|
89
89
|
"firstName": "First name",
|
|
90
90
|
"firstNameSort": "First name (a-z)",
|
|
File without changes
|