@kenyaemr/esm-service-queues-app 8.1.1-pre.124 → 8.1.2-pre.152
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 +26 -26
- package/dist/1006.js +1 -0
- package/dist/1006.js.map +1 -0
- package/dist/1060.js +1 -0
- package/dist/1060.js.map +1 -0
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/1325.js +1 -0
- package/dist/1325.js.map +1 -0
- package/dist/1644.js +1 -0
- package/dist/1727.js +1 -0
- package/dist/1727.js.map +1 -0
- package/dist/1800.js +1 -0
- package/dist/1800.js.map +1 -0
- package/dist/236.js +1 -1
- package/dist/2757.js +1 -0
- package/dist/{282.js → 2760.js} +1 -1
- package/dist/2760.js.map +1 -0
- package/dist/2784.js +2 -0
- package/dist/2784.js.map +1 -0
- package/dist/3199.js +1 -0
- package/dist/3199.js.map +1 -0
- package/dist/3372.js +2 -0
- package/dist/3372.js.map +1 -0
- package/dist/3574.js +1 -0
- package/dist/3604.js +1 -0
- package/dist/3604.js.map +1 -0
- package/dist/3652.js +1 -0
- package/dist/3760.js +1 -0
- package/dist/3760.js.map +1 -0
- package/dist/3818.js +1 -0
- package/dist/3818.js.map +1 -0
- package/dist/3828.js +1 -0
- package/dist/3828.js.map +1 -0
- package/dist/4272.js +1 -0
- package/dist/4378.js +1 -0
- package/dist/443.js +1 -0
- package/dist/443.js.map +1 -0
- package/dist/4460.js +1 -0
- package/dist/4705.js +1 -0
- package/dist/4911.js +1 -0
- package/dist/4911.js.map +1 -0
- package/dist/5236.js +1 -0
- package/dist/5236.js.map +1 -0
- package/dist/5240.js +1 -0
- package/dist/5282.js +1 -0
- package/dist/5282.js.map +1 -0
- package/dist/5336.js +1 -0
- package/dist/539.js +1 -0
- package/dist/5673.js +1 -0
- package/dist/5711.js +1 -0
- package/dist/5737.js +1 -0
- package/dist/5833.js +1 -0
- package/dist/6566.js +1 -0
- package/dist/6578.js +2 -0
- package/dist/{660.js.LICENSE.txt → 6578.js.LICENSE.txt} +5 -0
- package/dist/6578.js.map +1 -0
- package/dist/6591.js +2 -0
- package/dist/6591.js.map +1 -0
- package/dist/6670.js +1 -0
- package/dist/6670.js.map +1 -0
- package/dist/6727.js +1 -0
- package/dist/744.js +1 -0
- package/dist/752.js +1 -1
- package/dist/752.js.map +1 -1
- package/dist/7807.js +1 -0
- package/dist/8271.js +1 -0
- package/dist/8319.js +1 -0
- package/dist/8788.js +1 -0
- package/dist/899.js +1 -0
- package/dist/9261.js +1 -0
- package/dist/9392.js +1 -0
- package/dist/9392.js.map +1 -0
- package/dist/9993.js +1 -0
- package/dist/9993.js.map +1 -0
- package/dist/kenyaemr-esm-service-queues-app.js +1 -1
- package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +541 -234
- package/dist/kenyaemr-esm-service-queues-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +5 -0
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package-lock.json +5892 -0
- package/package.json +8 -5
- package/src/active-visits/active-visits-table.resource.ts +0 -62
- package/src/active-visits/change-status-dialog.component.tsx +10 -3
- package/src/active-visits/change-status-dialog.scss +29 -1
- package/src/active-visits/change-status-dialog.test.tsx +11 -3
- package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +53 -54
- package/src/add-provider-queue-room/add-provider-queue-room.scss +28 -0
- package/src/add-provider-queue-room/add-provider-queue-room.test.tsx +1 -1
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.component.tsx +1 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.scss +29 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.test.tsx +4 -1
- package/src/config-schema.ts +28 -8
- package/src/create-queue-entry/create-queue-entry.workspace.tsx +99 -0
- package/src/create-queue-entry/existing-visit-form/existing-visit-form.component.tsx +73 -0
- package/src/{patient-search/visit-form-queue-fields/visit-form-queue-fields.component.tsx → create-queue-entry/queue-fields/queue-fields.component.tsx} +76 -50
- package/src/create-queue-entry/queue-fields/queue-fields.resource.ts +63 -0
- package/src/{patient-search/visit-form-queue-fields/visit-form-queue-fields.scss → create-queue-entry/queue-fields/queue-fields.scss} +0 -4
- package/src/{patient-search/visit-form-queue-fields/visit-form-queue-fields.test.tsx → create-queue-entry/queue-fields/queue-fields.test.tsx} +37 -17
- package/src/create-queue-entry/queue-fields/visit-form-queue-fields.extension.tsx +31 -0
- package/src/hooks/useQueueEntries.ts +13 -12
- package/src/index.ts +8 -14
- package/src/patient-info/patient-info.component.tsx +10 -8
- package/src/patient-queue-header/patient-queue-header.component.tsx +18 -13
- package/src/patient-queue-metrics/metrics-header.component.tsx +4 -4
- package/src/queue-entry-table-components/queue-priority.component.tsx +16 -11
- package/src/queue-entry-table-components/queue-priority.scss +5 -0
- package/src/queue-entry-table-components/transition-entry.component.tsx +1 -1
- package/src/queue-patient-linelists/queue-linelist-base-table.component.tsx +1 -1
- package/src/queue-patient-linelists/queue-linelist-filter.workspace.tsx +13 -12
- package/src/queue-patient-linelists/scheduled-appointments-table.component.tsx +1 -1
- package/src/queue-rooms/queue-room-form.test.tsx +2 -2
- package/src/queue-rooms/queue-room-form.workspace.tsx +1 -1
- package/src/queue-screen/queue-screen.test.tsx +11 -4
- package/src/queue-services/queue-service-form.test.tsx +76 -16
- package/src/queue-services/queue-service-form.workspace.tsx +131 -131
- package/src/queue-services/queue-service.resource.ts +7 -2
- package/src/queue-table/cells/columns.resource.ts +10 -7
- package/src/queue-table/cells/queue-table-visit-attribute-queue-number-cell.component.tsx +1 -0
- package/src/queue-table/default-queue-table.component.tsx +13 -13
- package/src/queue-table/default-queue-table.test.tsx +3 -3
- package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.scss +28 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actions.modal.tsx +8 -2
- package/src/queue-table/queue-entry-actions/queue-entry-confirm-action.modal.tsx +2 -1
- package/src/queue-table/queue-entry-actions/queue-entry-confirm-action.scss +29 -0
- package/src/queue-table/queue-table.component.tsx +1 -1
- package/src/queue-table/queue-table.scss +12 -2
- package/src/queue-table/queue-table.test.tsx +10 -1
- package/src/remove-queue-entry-dialog/remove-queue-entry.component.tsx +16 -4
- package/src/remove-queue-entry-dialog/remove-queue-entry.scss +29 -0
- package/src/routes.json +4 -8
- package/src/transition-latest-queue-entry/transition-latest-queue-entry.resource.ts +2 -10
- package/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +41 -32
- package/src/transition-queue-entry/transition-queue-entry-dialog.scss +28 -0
- package/src/types/index.ts +0 -8
- package/src/views/queue-tables-for-all-statuses.component.tsx +12 -15
- package/translations/am.json +5 -78
- package/translations/ar.json +5 -78
- package/translations/de.json +235 -0
- package/translations/en.json +9 -86
- package/translations/es.json +3 -76
- package/translations/fr.json +5 -78
- package/translations/he.json +5 -78
- package/translations/hi.json +235 -0
- package/translations/hi_IN.json +235 -0
- package/translations/id.json +235 -0
- package/translations/it.json +235 -0
- package/translations/km.json +5 -78
- package/translations/ne.json +235 -0
- package/translations/pt.json +235 -0
- package/translations/pt_BR.json +235 -0
- package/translations/qu.json +235 -0
- package/translations/si.json +235 -0
- package/translations/sw.json +235 -0
- package/translations/sw_KE.json +235 -0
- package/translations/tr.json +235 -0
- package/translations/tr_TR.json +235 -0
- package/translations/uk.json +235 -0
- package/translations/vi.json +235 -0
- package/translations/zh.json +6 -79
- package/translations/zh_CN.json +5 -78
- package/dist/169.js +0 -1
- package/dist/169.js.map +0 -1
- package/dist/199.js +0 -1
- package/dist/199.js.map +0 -1
- package/dist/236.js.map +0 -1
- package/dist/271.js +0 -1
- package/dist/282.js.map +0 -1
- package/dist/319.js +0 -1
- package/dist/325.js +0 -1
- package/dist/325.js.map +0 -1
- package/dist/366.js +0 -1
- package/dist/366.js.map +0 -1
- package/dist/372.js +0 -2
- package/dist/372.js.map +0 -1
- package/dist/392.js +0 -1
- package/dist/392.js.map +0 -1
- package/dist/460.js +0 -1
- package/dist/501.js +0 -1
- package/dist/501.js.map +0 -1
- package/dist/574.js +0 -1
- package/dist/591.js +0 -2
- package/dist/591.js.map +0 -1
- package/dist/6.js +0 -1
- package/dist/6.js.map +0 -1
- package/dist/60.js +0 -1
- package/dist/60.js.map +0 -1
- package/dist/604.js +0 -1
- package/dist/604.js.map +0 -1
- package/dist/644.js +0 -1
- package/dist/660.js +0 -2
- package/dist/660.js.map +0 -1
- package/dist/670.js +0 -1
- package/dist/670.js.map +0 -1
- package/dist/727.js +0 -1
- package/dist/727.js.map +0 -1
- package/dist/748.js +0 -1
- package/dist/748.js.map +0 -1
- package/dist/757.js +0 -1
- package/dist/760.js +0 -1
- package/dist/760.js.map +0 -1
- package/dist/784.js +0 -2
- package/dist/784.js.map +0 -1
- package/dist/788.js +0 -1
- package/dist/800.js +0 -1
- package/dist/800.js.map +0 -1
- package/dist/807.js +0 -1
- package/dist/818.js +0 -1
- package/dist/818.js.map +0 -1
- package/dist/828.js +0 -1
- package/dist/828.js.map +0 -1
- package/dist/833.js +0 -1
- package/dist/911.js +0 -1
- package/dist/911.js.map +0 -1
- package/dist/940.js +0 -1
- package/dist/940.js.map +0 -1
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.component.tsx +0 -228
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.scss +0 -32
- package/src/patient-search/advanced-search.component.tsx +0 -191
- package/src/patient-search/advanced-search.scss +0 -154
- package/src/patient-search/advanced-search.test.tsx +0 -26
- package/src/patient-search/basic-search.component.tsx +0 -112
- package/src/patient-search/basic-search.scss +0 -139
- package/src/patient-search/basic-search.test.tsx +0 -18
- package/src/patient-search/empty-data-illustration.component.tsx +0 -41
- package/src/patient-search/hooks/useActivePatientEnrollment.tsx +0 -29
- package/src/patient-search/hooks/useDefaultLocation.ts +0 -14
- package/src/patient-search/hooks/usePatients.tsx +0 -25
- package/src/patient-search/hooks/useRecommendedVisitTypes.tsx +0 -35
- package/src/patient-search/hooks/useScheduledVisits.ts +0 -52
- package/src/patient-search/patient-scheduled-visits.component.tsx +0 -315
- package/src/patient-search/patient-scheduled-visits.scss +0 -131
- package/src/patient-search/patient-scheduled-visits.test.tsx +0 -39
- package/src/patient-search/patient-search.workspace.tsx +0 -135
- package/src/patient-search/search-illustration.component.tsx +0 -27
- package/src/patient-search/search-results.component.tsx +0 -75
- package/src/patient-search/search-results.scss +0 -80
- package/src/patient-search/search-results.test.tsx +0 -69
- package/src/patient-search/search.resource.ts +0 -10
- package/src/patient-search/visit-form/existing-visit-form.component.tsx +0 -112
- package/src/patient-search/visit-form/queue.resource.ts +0 -64
- package/src/patient-search/visit-form/visit-form.component.tsx +0 -337
- package/src/patient-search/visit-form/visit-type-selector.component.tsx +0 -153
- package/src/patient-search/visit-form/visit-type-selector.scss +0 -100
- package/src/patient-search/visit-form/visit-type-selector.test.tsx +0 -84
- package/src/visits-missing-inqueue/visits-missing-inqueue.component.tsx +0 -277
- package/src/visits-missing-inqueue/visits-missing-inqueue.resource.ts +0 -93
- package/src/visits-missing-inqueue/visits-missing-inqueue.scss +0 -111
- /package/dist/{784.js.LICENSE.txt → 2784.js.LICENSE.txt} +0 -0
- /package/dist/{372.js.LICENSE.txt → 3372.js.LICENSE.txt} +0 -0
- /package/dist/{591.js.LICENSE.txt → 6591.js.LICENSE.txt} +0 -0
- /package/src/{patient-search/patient-search.scss → create-queue-entry/create-queue-entry.scss} +0 -0
- /package/src/{patient-search/visit-form/visit-form.scss → create-queue-entry/existing-visit-form/existing-visit-form.scss} +0 -0
- /package/src/{patient-search → create-queue-entry}/hooks/useQueueLocations.tsx +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenyaemr/esm-service-queues-app",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.2-pre.152",
|
|
4
4
|
"description": "Outpatient front-end module for the OpenMRS SPA",
|
|
5
5
|
"browser": "dist/kenyaemr-esm-service-queues-app.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -37,11 +37,14 @@
|
|
|
37
37
|
"url": "https://github.com/openmrs/openmrs-esm-patient-management/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@carbon/react": "
|
|
41
|
-
"
|
|
40
|
+
"@carbon/react": "^1.71.0",
|
|
41
|
+
"@hookform/resolvers": "^3.9.1",
|
|
42
|
+
"lodash-es": "^4.17.15",
|
|
43
|
+
"react-hook-form": "^7.54.0",
|
|
44
|
+
"zod": "^3.24.1"
|
|
42
45
|
},
|
|
43
46
|
"peerDependencies": {
|
|
44
|
-
"@openmrs/esm-framework": "
|
|
47
|
+
"@openmrs/esm-framework": "6.x",
|
|
45
48
|
"react": "^18.1.0",
|
|
46
49
|
"react-i18next": "11.x",
|
|
47
50
|
"react-router-dom": "6.x",
|
|
@@ -50,5 +53,5 @@
|
|
|
50
53
|
"devDependencies": {
|
|
51
54
|
"webpack": "^5.74.0"
|
|
52
55
|
},
|
|
53
|
-
"stableVersion": "8.
|
|
56
|
+
"stableVersion": "8.0.2"
|
|
54
57
|
}
|
|
@@ -193,68 +193,6 @@ export function useServiceQueueEntries(service: string, locationUuid: string) {
|
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
export async function postQueueEntry(
|
|
197
|
-
visitUuid: string,
|
|
198
|
-
queueUuid: string,
|
|
199
|
-
patientUuid: string,
|
|
200
|
-
priority: string,
|
|
201
|
-
status: string,
|
|
202
|
-
sortWeight: number,
|
|
203
|
-
locationUuid: string,
|
|
204
|
-
visitQueueNumberAttributeUuid: string,
|
|
205
|
-
) {
|
|
206
|
-
const abortController = new AbortController();
|
|
207
|
-
|
|
208
|
-
await Promise.all([generateVisitQueueNumber(locationUuid, visitUuid, queueUuid, visitQueueNumberAttributeUuid)]);
|
|
209
|
-
|
|
210
|
-
return openmrsFetch(`${restBaseUrl}/visit-queue-entry`, {
|
|
211
|
-
method: 'POST',
|
|
212
|
-
headers: {
|
|
213
|
-
'Content-Type': 'application/json',
|
|
214
|
-
},
|
|
215
|
-
signal: abortController.signal,
|
|
216
|
-
body: {
|
|
217
|
-
visit: { uuid: visitUuid },
|
|
218
|
-
queueEntry: {
|
|
219
|
-
status: {
|
|
220
|
-
uuid: status,
|
|
221
|
-
},
|
|
222
|
-
priority: {
|
|
223
|
-
uuid: priority,
|
|
224
|
-
},
|
|
225
|
-
queue: {
|
|
226
|
-
uuid: queueUuid,
|
|
227
|
-
},
|
|
228
|
-
patient: {
|
|
229
|
-
uuid: patientUuid,
|
|
230
|
-
},
|
|
231
|
-
startedAt: new Date(),
|
|
232
|
-
sortWeight: sortWeight,
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export async function generateVisitQueueNumber(
|
|
239
|
-
location: string,
|
|
240
|
-
visitUuid: string,
|
|
241
|
-
queueUuid: string,
|
|
242
|
-
visitQueueNumberAttributeUuid: string,
|
|
243
|
-
) {
|
|
244
|
-
const abortController = new AbortController();
|
|
245
|
-
|
|
246
|
-
await openmrsFetch(
|
|
247
|
-
`${restBaseUrl}/queue-entry-number?location=${location}&queue=${queueUuid}&visit=${visitUuid}&visitAttributeType=${visitQueueNumberAttributeUuid}`,
|
|
248
|
-
{
|
|
249
|
-
method: 'GET',
|
|
250
|
-
headers: {
|
|
251
|
-
'Content-Type': 'application/json',
|
|
252
|
-
},
|
|
253
|
-
signal: abortController.signal,
|
|
254
|
-
},
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
196
|
export function serveQueueEntry(servicePointName: string, ticketNumber: string, status: string) {
|
|
259
197
|
const abortController = new AbortController();
|
|
260
198
|
|
|
@@ -25,7 +25,7 @@ import { type ConfigObject } from '../config-schema';
|
|
|
25
25
|
import { useQueues } from '../hooks/useQueues';
|
|
26
26
|
import { updateQueueEntry } from './active-visits-table.resource';
|
|
27
27
|
import { useMutateQueueEntries } from '../hooks/useQueueEntries';
|
|
28
|
-
import { useQueueLocations } from '../
|
|
28
|
+
import { useQueueLocations } from '../create-queue-entry/hooks/useQueueLocations';
|
|
29
29
|
import styles from './change-status-dialog.scss';
|
|
30
30
|
|
|
31
31
|
interface ChangeStatusDialogProps {
|
|
@@ -46,7 +46,7 @@ const ChangeStatus: React.FC<ChangeStatusDialogProps> = ({ queueEntry, closeModa
|
|
|
46
46
|
service: z.string({ required_error: t('serviceIsRequired', 'Service is required') }),
|
|
47
47
|
status: z.string({ required_error: t('statusIsRequired', 'Status is required') }),
|
|
48
48
|
}),
|
|
49
|
-
[],
|
|
49
|
+
[t],
|
|
50
50
|
);
|
|
51
51
|
|
|
52
52
|
type ChangeStatusForm = z.infer<typeof schema>;
|
|
@@ -106,7 +106,13 @@ const ChangeStatus: React.FC<ChangeStatusDialogProps> = ({ queueEntry, closeModa
|
|
|
106
106
|
const onError = (errors) => console.error(errors);
|
|
107
107
|
|
|
108
108
|
if (Object.keys(queueEntry)?.length === 0) {
|
|
109
|
-
return
|
|
109
|
+
return (
|
|
110
|
+
<ModalHeader
|
|
111
|
+
className={styles.modalHeader}
|
|
112
|
+
closeModal={closeModal}
|
|
113
|
+
title={t('patientNotInQueue', 'The patient is not in the queue')}
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
110
116
|
}
|
|
111
117
|
|
|
112
118
|
if (Object.keys(queueEntry)?.length > 0) {
|
|
@@ -114,6 +120,7 @@ const ChangeStatus: React.FC<ChangeStatusDialogProps> = ({ queueEntry, closeModa
|
|
|
114
120
|
<div>
|
|
115
121
|
<Form onSubmit={handleSubmit(onSubmit, onError)}>
|
|
116
122
|
<ModalHeader
|
|
123
|
+
className={styles.modalHeader}
|
|
117
124
|
closeModal={closeModal}
|
|
118
125
|
title={t('movePatientToNextService', 'Move patient to the next service?')}
|
|
119
126
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
1
2
|
@use '@carbon/layout';
|
|
2
3
|
@use '@carbon/type';
|
|
3
|
-
@use '@carbon/colors';
|
|
4
4
|
|
|
5
5
|
.radioButtonGroup {
|
|
6
6
|
display: flex;
|
|
@@ -45,3 +45,31 @@ section {
|
|
|
45
45
|
color: colors.$red-60;
|
|
46
46
|
@include type.type-style('label-01');
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
.modalHeader {
|
|
50
|
+
:global {
|
|
51
|
+
.cds--modal-close-button {
|
|
52
|
+
position: absolute;
|
|
53
|
+
inset-block-start: 0;
|
|
54
|
+
inset-inline-end: 0;
|
|
55
|
+
margin: 0;
|
|
56
|
+
margin-top: calc(-1 * #{layout.$spacing-05});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.cds--modal-close {
|
|
60
|
+
background-color: rgba(0, 0, 0, 0);
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
background-color: var(--cds-layer-hover);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.cds--popover--left > .cds--popover > .cds--popover-content {
|
|
68
|
+
transform: translate(-4rem, 0.85rem);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.cds--popover--left > .cds--popover > .cds--popover-caret {
|
|
72
|
+
transform: translate(-3.75rem, 1.25rem);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -14,18 +14,18 @@ import { configSchema, type ConfigObject } from '../config-schema';
|
|
|
14
14
|
import { updateQueueEntry } from './active-visits-table.resource';
|
|
15
15
|
import ChangeStatus from './change-status-dialog.component';
|
|
16
16
|
|
|
17
|
-
const mockUseConfig = jest.mocked(useConfig<ConfigObject>);
|
|
18
17
|
const mockShowSnackbar = jest.mocked(showSnackbar);
|
|
19
18
|
const mockUpdateQueueEntry = jest.mocked(updateQueueEntry);
|
|
20
|
-
const
|
|
19
|
+
const mockUseConfig = jest.mocked(useConfig<ConfigObject>);
|
|
21
20
|
const mockUseLocations = jest.mocked(useLocations);
|
|
21
|
+
const mockUseSession = jest.mocked(useSession);
|
|
22
22
|
|
|
23
23
|
jest.mock('./active-visits-table.resource', () => ({
|
|
24
24
|
...jest.requireActual('./active-visits-table.resource'),
|
|
25
25
|
updateQueueEntry: jest.fn(),
|
|
26
26
|
}));
|
|
27
27
|
|
|
28
|
-
jest.mock('../
|
|
28
|
+
jest.mock('../create-queue-entry/hooks/useQueueLocations', () => {
|
|
29
29
|
return {
|
|
30
30
|
useQueueLocations: jest.fn().mockReturnValue({
|
|
31
31
|
queueLocations: mockLocations.data?.results.map((location) => ({ ...location, id: location.uuid })),
|
|
@@ -40,6 +40,8 @@ jest.mock('../hooks/useQueues', () => {
|
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
describe('ChangeStatusDialog', () => {
|
|
43
|
+
let consoleSpy: jest.SpyInstance;
|
|
44
|
+
|
|
43
45
|
beforeEach(() => {
|
|
44
46
|
mockUseConfig.mockReturnValue({
|
|
45
47
|
...getDefaultsFromConfigSchema(configSchema),
|
|
@@ -47,6 +49,12 @@ describe('ChangeStatusDialog', () => {
|
|
|
47
49
|
} as ConfigObject);
|
|
48
50
|
mockUseLocations.mockReturnValue(mockLocations.data.results);
|
|
49
51
|
mockUseSession.mockReturnValue(mockSession.data);
|
|
52
|
+
|
|
53
|
+
consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
afterEach(() => {
|
|
57
|
+
consoleSpy.mockRestore();
|
|
50
58
|
});
|
|
51
59
|
|
|
52
60
|
it('should update a queue entry and display toast message', async () => {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
SelectItem,
|
|
14
14
|
} from '@carbon/react';
|
|
15
15
|
import { showSnackbar } from '@openmrs/esm-framework';
|
|
16
|
-
import { useQueueLocations } from '../
|
|
16
|
+
import { useQueueLocations } from '../create-queue-entry/hooks/useQueueLocations';
|
|
17
17
|
import {
|
|
18
18
|
addProviderToQueueRoom,
|
|
19
19
|
updateProviderToQueueRoom,
|
|
@@ -35,20 +35,21 @@ import useQueueServices from '../hooks/useQueueService';
|
|
|
35
35
|
import styles from './add-provider-queue-room.scss';
|
|
36
36
|
|
|
37
37
|
interface AddProviderQueueRoomProps {
|
|
38
|
-
providerUuid: string;
|
|
39
38
|
closeModal: () => void;
|
|
39
|
+
providerUuid: string;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
const AddProviderQueueRoom: React.FC<AddProviderQueueRoomProps> = ({
|
|
42
|
+
const AddProviderQueueRoom: React.FC<AddProviderQueueRoomProps> = ({ closeModal, providerUuid }) => {
|
|
43
43
|
const { t } = useTranslation();
|
|
44
|
-
|
|
44
|
+
const { providerRoom } = useProvidersQueueRoom(providerUuid);
|
|
45
|
+
const currentIsPermanentProviderQueueRoom = useIsPermanentProviderQueueRoom() ?? false;
|
|
45
46
|
const currentLocationName = useSelectedQueueLocationName();
|
|
46
47
|
const currentLocationUuid = useSelectedQueueLocationUuid();
|
|
47
48
|
const currentService = useSelectedService();
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
const [queueRoomUuid, setQueueRoomUuid] = useState('');
|
|
49
|
+
|
|
50
|
+
const [isMissingQueueRoom, setIsMissingQueueRoom] = useState(false);
|
|
51
51
|
const [queueProviderMapUuid, setQueueProviderMapUuid] = useState('');
|
|
52
|
+
const [queueRoomUuid, setQueueRoomUuid] = useState('');
|
|
52
53
|
|
|
53
54
|
useEffect(() => {
|
|
54
55
|
if (providerRoom?.length > 0) {
|
|
@@ -58,10 +59,9 @@ const AddProviderQueueRoom: React.FC<AddProviderQueueRoomProps> = ({ providerUui
|
|
|
58
59
|
}, [providerRoom]);
|
|
59
60
|
|
|
60
61
|
const { mutate } = useProvidersQueueRoom(providerUuid);
|
|
61
|
-
const { services } = useQueueServices();
|
|
62
|
-
const { rooms } = useQueueRooms(currentLocationUuid, currentService?.serviceUuid);
|
|
63
62
|
const { queueLocations } = useQueueLocations();
|
|
64
|
-
const
|
|
63
|
+
const { rooms } = useQueueRooms(currentLocationUuid, currentService?.serviceUuid);
|
|
64
|
+
const { services } = useQueueServices();
|
|
65
65
|
|
|
66
66
|
const handleServiceChange = ({ selectedItem }) => {
|
|
67
67
|
localStorage.setItem('queueServiceName', selectedItem.name);
|
|
@@ -90,19 +90,17 @@ const AddProviderQueueRoom: React.FC<AddProviderQueueRoomProps> = ({ providerUui
|
|
|
90
90
|
|
|
91
91
|
if (providerRoom?.length > 0) {
|
|
92
92
|
updateProviderToQueueRoom(queueProviderMapUuid, queueRoomUuid, providerUuid).then(
|
|
93
|
-
(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
mutate();
|
|
105
|
-
}
|
|
93
|
+
() => {
|
|
94
|
+
showSnackbar({
|
|
95
|
+
isLowContrast: true,
|
|
96
|
+
title: t('updateRoom', 'Update room'),
|
|
97
|
+
kind: 'success',
|
|
98
|
+
subtitle: t('queueRoomUpdatedSuccessfully', 'Queue room updated successfully'),
|
|
99
|
+
});
|
|
100
|
+
closeModal();
|
|
101
|
+
localStorage.setItem('lastUpdatedQueueRoomTimestamp', new Date().toString());
|
|
102
|
+
updatedSelectedQueueRoomTimestamp(new Date());
|
|
103
|
+
mutate();
|
|
106
104
|
},
|
|
107
105
|
(error) => {
|
|
108
106
|
showSnackbar({
|
|
@@ -116,19 +114,17 @@ const AddProviderQueueRoom: React.FC<AddProviderQueueRoomProps> = ({ providerUui
|
|
|
116
114
|
);
|
|
117
115
|
} else {
|
|
118
116
|
addProviderToQueueRoom(queueRoomUuid, providerUuid).then(
|
|
119
|
-
(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
mutate();
|
|
131
|
-
}
|
|
117
|
+
() => {
|
|
118
|
+
showSnackbar({
|
|
119
|
+
isLowContrast: true,
|
|
120
|
+
title: t('addRoom', 'Add room'),
|
|
121
|
+
kind: 'success',
|
|
122
|
+
subtitle: t('queueRoomAddedSuccessfully', 'Queue room added successfully'),
|
|
123
|
+
});
|
|
124
|
+
closeModal();
|
|
125
|
+
localStorage.setItem('lastUpdatedQueueRoomTimestamp', new Date().toString());
|
|
126
|
+
updatedSelectedQueueRoomTimestamp(new Date());
|
|
127
|
+
mutate();
|
|
132
128
|
},
|
|
133
129
|
(error) => {
|
|
134
130
|
showSnackbar({
|
|
@@ -144,36 +140,40 @@ const AddProviderQueueRoom: React.FC<AddProviderQueueRoomProps> = ({ providerUui
|
|
|
144
140
|
|
|
145
141
|
return (
|
|
146
142
|
<div>
|
|
147
|
-
<ModalHeader
|
|
143
|
+
<ModalHeader
|
|
144
|
+
className={styles.modalHeader}
|
|
145
|
+
closeModal={closeModal}
|
|
146
|
+
title={t('addAProviderQueueRoom', 'Add a provider queue room?')}
|
|
147
|
+
/>
|
|
148
148
|
<ModalBody>
|
|
149
149
|
<Form onSubmit={onSubmit}>
|
|
150
150
|
<section className={styles.section}>
|
|
151
151
|
<Dropdown
|
|
152
|
-
id="queueLocation"
|
|
153
152
|
aria-label={t('selectQueueLocation', 'Select a queue location')}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
type="default"
|
|
153
|
+
id="queueLocation"
|
|
154
|
+
initialSelectedItem={{ uuid: currentLocationUuid, name: currentLocationName }}
|
|
157
155
|
items={queueLocations}
|
|
158
156
|
itemToString={(item) => (item ? item.name : '')}
|
|
157
|
+
label=""
|
|
159
158
|
onChange={handleQueueLocationChange}
|
|
160
159
|
size="md"
|
|
161
|
-
|
|
160
|
+
titleText={t('queueLocation', 'Queue location')}
|
|
161
|
+
type="default"
|
|
162
162
|
/>
|
|
163
163
|
</section>
|
|
164
164
|
|
|
165
165
|
<section className={styles.section}>
|
|
166
166
|
<Dropdown
|
|
167
|
-
id="service"
|
|
168
167
|
aria-label={t('selectService', 'Select a service')}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
titleText={t('queueService', 'Queue service')}
|
|
168
|
+
id="service"
|
|
169
|
+
initialSelectedItem={{ uuid: currentService?.serviceUuid, display: currentService?.serviceDisplay }}
|
|
172
170
|
items={services ?? []}
|
|
173
171
|
itemToString={(item) => (item ? item.display : '')}
|
|
172
|
+
label=""
|
|
174
173
|
onChange={handleServiceChange}
|
|
175
174
|
size="md"
|
|
176
|
-
|
|
175
|
+
titleText={t('queueService', 'Queue service')}
|
|
176
|
+
type="default"
|
|
177
177
|
/>
|
|
178
178
|
</section>
|
|
179
179
|
|
|
@@ -181,15 +181,14 @@ const AddProviderQueueRoom: React.FC<AddProviderQueueRoomProps> = ({ providerUui
|
|
|
181
181
|
<div className={styles.sectionTitle}>{t('queueRoom', 'Queue room')}</div>
|
|
182
182
|
<div className={styles.filterContainer}>
|
|
183
183
|
<Select
|
|
184
|
-
labelText={t('selectRoom', 'Select a room')}
|
|
185
184
|
id="service"
|
|
186
185
|
invalidText="Required"
|
|
187
|
-
|
|
188
|
-
defaultValue={queueRoomUuid}
|
|
186
|
+
labelText={t('selectRoom', 'Select a room')}
|
|
189
187
|
onChange={(event) => {
|
|
190
188
|
setQueueRoomUuid(event.target.value);
|
|
191
189
|
localStorage.setItem('lastUpdatedQueueRoomTimestamp', new Date().toString());
|
|
192
|
-
}}
|
|
190
|
+
}}
|
|
191
|
+
value={queueRoomUuid}>
|
|
193
192
|
{!queueRoomUuid ? <SelectItem text={t('chooseRoom', 'Select a room')} value="" /> : null}
|
|
194
193
|
{rooms?.length > 0 &&
|
|
195
194
|
rooms.map((room) => (
|
|
@@ -213,11 +212,11 @@ const AddProviderQueueRoom: React.FC<AddProviderQueueRoomProps> = ({ providerUui
|
|
|
213
212
|
|
|
214
213
|
<section className={styles.section}>
|
|
215
214
|
<Checkbox
|
|
216
|
-
onChange={handleRetainLocation}
|
|
217
215
|
checked={currentIsPermanentProviderQueueRoom}
|
|
218
|
-
labelText={t('retainLocation', 'Retain location')}
|
|
219
|
-
id="retianLocation"
|
|
220
216
|
className={styles.checkbox}
|
|
217
|
+
id="retainLocation"
|
|
218
|
+
labelText={t('retainLocation', 'Retain location')}
|
|
219
|
+
onChange={handleRetainLocation}
|
|
221
220
|
/>
|
|
222
221
|
</section>
|
|
223
222
|
</Form>
|
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
@use '@carbon/type';
|
|
3
3
|
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
|
+
.modalHeader {
|
|
6
|
+
:global {
|
|
7
|
+
.cds--modal-close-button {
|
|
8
|
+
position: absolute;
|
|
9
|
+
inset-block-start: 0;
|
|
10
|
+
inset-inline-end: 0;
|
|
11
|
+
margin: 0;
|
|
12
|
+
margin-top: calc(-1 * #{layout.$spacing-05});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.cds--modal-close {
|
|
16
|
+
background-color: rgba(0, 0, 0, 0);
|
|
17
|
+
|
|
18
|
+
&:hover {
|
|
19
|
+
background-color: var(--cds-layer-hover);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.cds--popover--left > .cds--popover > .cds--popover-content {
|
|
24
|
+
transform: translate(-4rem, 0.85rem);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.cds--popover--left > .cds--popover > .cds--popover-caret {
|
|
28
|
+
transform: translate(-3.75rem, 1.25rem);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
5
33
|
.section {
|
|
6
34
|
margin: layout.$spacing-03;
|
|
7
35
|
}
|
|
@@ -39,7 +39,7 @@ jest.mock('../hooks/useQueues', () => {
|
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
jest.mock('../
|
|
42
|
+
jest.mock('../create-queue-entry/hooks/useQueueLocations', () => ({
|
|
43
43
|
useQueueLocations: jest.fn().mockReturnValue({
|
|
44
44
|
queueLocations: [
|
|
45
45
|
{ id: '1GHI12', name: 'Location 1' },
|
|
@@ -45,6 +45,7 @@ const ClearQueueEntriesDialog: React.FC<ClearQueueEntriesDialogProps> = ({ queue
|
|
|
45
45
|
return (
|
|
46
46
|
<div>
|
|
47
47
|
<ModalHeader
|
|
48
|
+
className={styles.modalHeader}
|
|
48
49
|
closeModal={closeModal}
|
|
49
50
|
label={t('serviceQueue', 'Service queue')}
|
|
50
51
|
title={t('clearAllQueueEntries', 'Clear all queue entries?')}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
1
2
|
@use '@carbon/type';
|
|
2
3
|
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
3
4
|
|
|
@@ -5,3 +6,31 @@
|
|
|
5
6
|
@include type.type-style('heading-compact-01');
|
|
6
7
|
color: $ui-05;
|
|
7
8
|
}
|
|
9
|
+
|
|
10
|
+
.modalHeader {
|
|
11
|
+
:global {
|
|
12
|
+
.cds--modal-close-button {
|
|
13
|
+
position: absolute;
|
|
14
|
+
inset-block-start: 0;
|
|
15
|
+
inset-inline-end: 0;
|
|
16
|
+
margin: 0;
|
|
17
|
+
margin-top: calc(-1 * #{layout.$spacing-05});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cds--modal-close {
|
|
21
|
+
background-color: rgba(0, 0, 0, 0);
|
|
22
|
+
|
|
23
|
+
&:hover {
|
|
24
|
+
background-color: var(--cds-layer-hover);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.cds--popover--left > .cds--popover > .cds--popover-content {
|
|
29
|
+
transform: translate(-4rem, 0.85rem);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.cds--popover--left > .cds--popover > .cds--popover-caret {
|
|
33
|
+
transform: translate(-3.75rem, 1.25rem);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -12,7 +12,10 @@ const defaultProps = {
|
|
|
12
12
|
closeModal: mockCloseModal,
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
jest.mock('./clear-queue-entries-dialog.resource')
|
|
15
|
+
jest.mock('./clear-queue-entries-dialog.resource', () => ({
|
|
16
|
+
batchClearQueueEntries: jest.fn(),
|
|
17
|
+
}));
|
|
18
|
+
|
|
16
19
|
jest.mock('../hooks/useQueueEntries', () => ({
|
|
17
20
|
useMutateQueueEntries: () => ({ mutateQueueEntries: jest.fn() }),
|
|
18
21
|
}));
|
package/src/config-schema.ts
CHANGED
|
@@ -23,8 +23,8 @@ type ColumnType = (typeof columnTypes)[number];
|
|
|
23
23
|
const statusIcons = ['Group', 'InProgress'] as const;
|
|
24
24
|
type StatusIcon = (typeof statusIcons)[number];
|
|
25
25
|
|
|
26
|
-
// Options from https://react.carbondesignsystem.com/?path=/docs/components-tag--overview
|
|
27
|
-
const
|
|
26
|
+
// Options from https://react.carbondesignsystem.com/?path=/docs/components-tag--overview plus orange for priority tags
|
|
27
|
+
const priorityTagColors = [
|
|
28
28
|
'red',
|
|
29
29
|
'magenta',
|
|
30
30
|
'purple',
|
|
@@ -32,13 +32,14 @@ const carbonTagColors = [
|
|
|
32
32
|
'teal',
|
|
33
33
|
'cyan',
|
|
34
34
|
'gray',
|
|
35
|
+
'orange',
|
|
35
36
|
'green',
|
|
36
37
|
'warm-gray',
|
|
37
38
|
'cool-gray',
|
|
38
39
|
'high-contrast',
|
|
39
40
|
'outline',
|
|
40
41
|
] as const;
|
|
41
|
-
type
|
|
42
|
+
type PriorityTagColor = (typeof priorityTagColors)[number];
|
|
42
43
|
|
|
43
44
|
const tagStyles = ['bold'] as const;
|
|
44
45
|
type TagStyle = (typeof tagStyles)[number];
|
|
@@ -46,10 +47,29 @@ type TagStyle = (typeof tagStyles)[number];
|
|
|
46
47
|
// equal to columnTypes but without extension
|
|
47
48
|
export const builtInColumns = columnTypes.filter((columnType) => columnType !== 'extension');
|
|
48
49
|
const defaultIdentifierTypeUuid = '05a29f94-c0ed-11e2-94be-8c13b969e334'; // OpenMRS ID
|
|
50
|
+
const defaultPriorityUuid = 'f4620bfa-3625-4883-bd3f-84c2cce14470';
|
|
51
|
+
const defaultEmergencyPriorityUuid = '04f6f7e0-e3cb-4e13-a133-4479f759574e';
|
|
52
|
+
const defaultUrgentPriorityUuid = 'dc3492ef-24a5-4fd9-b58d-4fd2acf7071f';
|
|
49
53
|
|
|
50
54
|
export const defaultColumnConfig: ColumnConfig = {
|
|
51
55
|
identifierTypeUuid: defaultIdentifierTypeUuid,
|
|
52
|
-
priorityConfigs: [
|
|
56
|
+
priorityConfigs: [
|
|
57
|
+
{
|
|
58
|
+
conceptUuid: defaultEmergencyPriorityUuid,
|
|
59
|
+
style: null,
|
|
60
|
+
color: 'red',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
conceptUuid: defaultPriorityUuid,
|
|
64
|
+
style: null,
|
|
65
|
+
color: 'green',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
conceptUuid: defaultUrgentPriorityUuid,
|
|
69
|
+
style: null,
|
|
70
|
+
color: 'orange',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
53
73
|
statusConfigs: [],
|
|
54
74
|
visitQueueNumberAttributeUuid: null,
|
|
55
75
|
};
|
|
@@ -70,7 +90,7 @@ export const configSchema = {
|
|
|
70
90
|
defaultPriorityConceptUuid: {
|
|
71
91
|
_type: Type.ConceptUuid,
|
|
72
92
|
_description: 'The UUID of the default priority for the queues eg Not urgent.',
|
|
73
|
-
_default:
|
|
93
|
+
_default: defaultPriorityUuid,
|
|
74
94
|
},
|
|
75
95
|
defaultStatusConceptUuid: {
|
|
76
96
|
_type: Type.ConceptUuid,
|
|
@@ -93,7 +113,7 @@ export const configSchema = {
|
|
|
93
113
|
emergencyPriorityConceptUuid: {
|
|
94
114
|
_type: Type.ConceptUuid,
|
|
95
115
|
_description: 'The UUID of the priority with the highest sort weight for the queues eg Emergency.',
|
|
96
|
-
_default:
|
|
116
|
+
_default: defaultEmergencyPriorityUuid,
|
|
97
117
|
},
|
|
98
118
|
heightUuid: {
|
|
99
119
|
_type: Type.ConceptUuid,
|
|
@@ -262,7 +282,7 @@ export const configSchema = {
|
|
|
262
282
|
_type: Type.String,
|
|
263
283
|
_description:
|
|
264
284
|
'The color of the tag. This is based on the "type" field of the Carbon Design System "Tag" component.',
|
|
265
|
-
_validators: [validators.oneOf(
|
|
285
|
+
_validators: [validators.oneOf(priorityTagColors)],
|
|
266
286
|
_default: 'gray',
|
|
267
287
|
},
|
|
268
288
|
style: {
|
|
@@ -447,7 +467,7 @@ export interface PatientIdentifierColumnConfig {
|
|
|
447
467
|
}
|
|
448
468
|
export interface PriorityConfig {
|
|
449
469
|
conceptUuid: string;
|
|
450
|
-
color:
|
|
470
|
+
color: PriorityTagColor;
|
|
451
471
|
style: TagStyle;
|
|
452
472
|
}
|
|
453
473
|
|