diff --git a/packages/esm-active-visits-app/src/active-visits-widget/active-visits.component.tsx b/packages/esm-active-visits-app/src/active-visits-widget/active-visits.component.tsx index 6bf2042b3..2177e2285 100644 --- a/packages/esm-active-visits-app/src/active-visits-widget/active-visits.component.tsx +++ b/packages/esm-active-visits-app/src/active-visits-widget/active-visits.component.tsx @@ -247,15 +247,21 @@ const ActiveVisitsTable = () => { {rows.map((row, index) => { const visit = activeVisits.find((visit) => visit.id === row.id); + if (!visit) { + return null; + } + + const patientLink = `$\{openmrsSpaBase}/patient/${visit.patientUuid}/chart/Patient%20Summary`; + return ( - + {row.cells.map((cell) => ( - {cell.info.header === 'name' ? ( - + {cell.info.header === 'name' && visit.patientUuid ? ( + {cell.value} ) : (