Skip to content

Commit 2e09028

Browse files
authored
Fixing the wait time under completion tab to stop counting (#273)
1 parent e87c616 commit 2e09028

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/esm-patient-queues-app/src/active-visits/patient-queues.resource.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,14 @@ export function usePatientQueueRequest(apiUrl: string) {
119119
priorityComment: queue.priorityComment,
120120
priority: queue.priorityComment === 'Urgent' ? 'Priority' : queue.priorityComment,
121121
priorityLevel: queue.priority,
122-
waitTime: queue.dateCreated ? `${dayjs().diff(dayjs(queue.dateCreated), 'minutes')}` : '--',
122+
waitTime:
123+
queue.status === 'COMPLETED'
124+
? queue.dateCreated && queue.dateChanged
125+
? `${dayjs(queue.dateChanged).diff(dayjs(queue.dateCreated), 'minutes')} Minutes`
126+
: '--'
127+
: queue.dateCreated
128+
? `${dayjs().diff(dayjs(queue.dateCreated), 'minutes')} Minutes`
129+
: '--',
123130
status: queue.status,
124131
patientAge: queue.patient?.person?.age,
125132
patientSex: queue.patient?.person?.gender === 'M' ? 'MALE' : 'FEMALE',

0 commit comments

Comments
 (0)