Skip to content

Commit

Permalink
(fix) Resolved crash in active-visit component due to missing patient…
Browse files Browse the repository at this point in the history
…Uuid on visit object (#799)
  • Loading branch information
donaldkibet authored Aug 30, 2023
1 parent 3dbcfde commit dc68fe9
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<React.Fragment key={index}>
<TableExpandRow {...getRowProps({ row })} data-testid={`activeVisitRow${visit.patientUuid}`}>
<TableExpandRow
{...getRowProps({ row })}
data-testid={`activeVisitRow${visit.patientUuid || 'unknown'}`}>
{row.cells.map((cell) => (
<TableCell key={cell.id} data-testid={cell.id}>
{cell.info.header === 'name' ? (
<PatientNameLink
from={fromPage}
to={`\${openmrsSpaBase}/patient/${visit.patientUuid}/chart/Patient%20Summary`}>
{cell.info.header === 'name' && visit.patientUuid ? (
<PatientNameLink from={fromPage} to={patientLink}>
{cell.value}
</PatientNameLink>
) : (
Expand Down

0 comments on commit dc68fe9

Please sign in to comment.