From 3dbcfdee6dc822c78610fd72602b575833a62183 Mon Sep 17 00:00:00 2001 From: CynthiaKamau Date: Wed, 30 Aug 2023 11:11:47 +0300 Subject: [PATCH] KHP3-4011 Add column to denote patient previous location in in queue (#776) --- .../active-visits/active-visits-table.component.tsx | 10 +++++++++- .../src/active-visits/active-visits-table.resource.ts | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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 06b7673c6..eeef1b6be 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 @@ -161,11 +161,16 @@ function ActiveVisitsTable() { }, { id: 3, + header: t('locationComingFrom', 'Coming from'), + key: 'locationComingFrom', + }, + { + id: 4, header: t('status', 'Status'), key: 'status', }, { - id: 4, + id: 5, header: t('waitTime', 'Wait time'), key: 'waitTime', }, @@ -213,6 +218,9 @@ function ActiveVisitsTable() { ), }, + locationComingFrom: { + content: {entry?.locationComingFrom}, + }, status: { content: ( 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 3829b9a14..cafcb3336 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 @@ -71,6 +71,9 @@ export interface VisitQueueEntry { uuid: string; visit: Visit; sortWeight: number; + locationComingFrom: { + name: string; + }; } export interface MappedVisitQueueEntry { @@ -99,6 +102,7 @@ export interface MappedVisitQueueEntry { sortWeight: number; visitQueueNumber: string; identifiers: Array; + locationComingFrom: string; } interface UseVisitQueueEntries { @@ -244,6 +248,7 @@ export function useVisitQueueEntries(currServiceName: string, locationUuid: stri (e) => e.attributeType.uuid === visitQueueNumberAttributeUuid, )?.value, identifiers: visitQueueEntry.queueEntry.patient?.identifiers, + locationComingFrom: visitQueueEntry.queueEntry?.locationComingFrom?.name, }); let mappedVisitQueueEntries; @@ -310,6 +315,7 @@ export async function updateQueueEntry( }, startedAt: toDateObjectStrict(toOmrsIsoString(new Date())), sortWeight: sortWeight, + locationComingFrom: previousQueueUuid, }, }, });