From c806132fe740612943a013a9bcdb104ab58b08c3 Mon Sep 17 00:00:00 2001 From: CynthiaKamau Date: Wed, 16 Nov 2022 11:30:16 +0300 Subject: [PATCH] (refactor) Updated outpatient label to serivce queues (#473) * (refactor) Updated outpatient label to serivce queues * updated status column to show queue name instead of concept name --- .../esm-outpatient-app/__mocks__/active-visits.mock.ts | 8 ++++---- .../src/active-visits/active-visits-table.component.tsx | 2 +- .../src/active-visits/active-visits-table.resource.ts | 4 ++-- packages/esm-outpatient-app/src/index.ts | 7 +++++++ packages/esm-outpatient-app/src/outpatient-link.tsx | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/esm-outpatient-app/__mocks__/active-visits.mock.ts b/packages/esm-outpatient-app/__mocks__/active-visits.mock.ts index 9b65afc4f..34a184f29 100644 --- a/packages/esm-outpatient-app/__mocks__/active-visits.mock.ts +++ b/packages/esm-outpatient-app/__mocks__/active-visits.mock.ts @@ -19,8 +19,8 @@ export const mockVisitQueueEntries = [ endedAt: null, queue: { uuid: '6a97bd65-3a9a-4fab-ae8f-be59dd4ddd87', - display: 'TRIAGE QUEUE', - name: 'TRIAGE QUEUE', + display: 'Triage', + name: 'Triage', description: 'Queue for patients waiting for triage', service: { display: 'Triage', @@ -67,8 +67,8 @@ export const mockVisitQueueEntries = [ endedAt: null, queue: { uuid: 'c187d78b-5c54-49bf-a0f8-b7fb6034d36d', - display: 'Consultation queue', - name: 'Consultation queue', + display: 'Clinical Consultation', + name: 'Clinical Consultation', description: 'A queue for patients for a clincal consultation i.e. Doctor, Clinician', service: { display: 'Clinical Consultation', diff --git a/packages/esm-outpatient-app/src/active-visits/active-visits-table.component.tsx b/packages/esm-outpatient-app/src/active-visits/active-visits-table.component.tsx index 64f814b1f..a2985363f 100644 --- a/packages/esm-outpatient-app/src/active-visits/active-visits-table.component.tsx +++ b/packages/esm-outpatient-app/src/active-visits/active-visits-table.component.tsx @@ -223,7 +223,7 @@ function ActiveVisitsTable() { } }; - const buildStatusString = (status: string, service: QueueService) => { + const buildStatusString = (status: string, service: string) => { if (!status || !service) { return ''; } diff --git a/packages/esm-outpatient-app/src/active-visits/active-visits-table.resource.ts b/packages/esm-outpatient-app/src/active-visits/active-visits-table.resource.ts index e6356ad76..a2ebf950d 100644 --- a/packages/esm-outpatient-app/src/active-visits/active-visits-table.resource.ts +++ b/packages/esm-outpatient-app/src/active-visits/active-visits-table.resource.ts @@ -75,7 +75,7 @@ export interface MappedVisitQueueEntry { priority: MappedQueuePriority; priorityComment: string; priorityUuid: string; - service: QueueService; + service: string; status: QueueStatus; statusUuid: string; visitStartDateTime: string; @@ -198,7 +198,7 @@ export function useVisitQueueEntries(currServiceName: string): UseVisitQueueEntr : visitQueueEntry.queueEntry.priority.display, priorityComment: visitQueueEntry.queueEntry.priorityComment, priorityUuid: visitQueueEntry.queueEntry.priority.uuid, - service: visitQueueEntry.queueEntry.queue.service.display, + service: visitQueueEntry?.queueEntry.queue.name, status: visitQueueEntry.queueEntry.status.display, statusUuid: visitQueueEntry.queueEntry.status.uuid, waitTime: visitQueueEntry.queueEntry.startedAt diff --git a/packages/esm-outpatient-app/src/index.ts b/packages/esm-outpatient-app/src/index.ts index 2a3879cb7..6a7ddeef4 100644 --- a/packages/esm-outpatient-app/src/index.ts +++ b/packages/esm-outpatient-app/src/index.ts @@ -135,6 +135,13 @@ function setupOpenMRS() { moduleName, }), }, + { + id: 'service-queue-entries-table', + load: getAsyncLifecycle(() => import('./active-visits/active-visits-table.component'), { + featureName: 'view list of patients in queue', + moduleName, + }), + }, ], }; } diff --git a/packages/esm-outpatient-app/src/outpatient-link.tsx b/packages/esm-outpatient-app/src/outpatient-link.tsx index fbc504bda..07e24e114 100644 --- a/packages/esm-outpatient-app/src/outpatient-link.tsx +++ b/packages/esm-outpatient-app/src/outpatient-link.tsx @@ -5,5 +5,5 @@ import { spaBasePath } from './constants'; export default function OutpatientAppLink() { const { t } = useTranslation(); - return {t('outpatient', 'Outpatient')}; + return {t('serviceQueues', 'Service Queues')}; }