Skip to content

Commit

Permalink
KHP3-4011 Add column to denote patient previous location in in queue (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
CynthiaKamau authored Aug 30, 2023
1 parent 0a29603 commit 3dbcfde
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down Expand Up @@ -213,6 +218,9 @@ function ActiveVisitsTable() {
</>
),
},
locationComingFrom: {
content: <span className={styles.statusContainer}>{entry?.locationComingFrom}</span>,
},
status: {
content: (
<span className={styles.statusContainer}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export interface VisitQueueEntry {
uuid: string;
visit: Visit;
sortWeight: number;
locationComingFrom: {
name: string;
};
}

export interface MappedVisitQueueEntry {
Expand Down Expand Up @@ -99,6 +102,7 @@ export interface MappedVisitQueueEntry {
sortWeight: number;
visitQueueNumber: string;
identifiers: Array<Identifer>;
locationComingFrom: string;
}

interface UseVisitQueueEntries {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -310,6 +315,7 @@ export async function updateQueueEntry(
},
startedAt: toDateObjectStrict(toOmrsIsoString(new Date())),
sortWeight: sortWeight,
locationComingFrom: previousQueueUuid,
},
},
});
Expand Down

0 comments on commit 3dbcfde

Please sign in to comment.