Skip to content

Commit

Permalink
Fix formatting of encounter ID
Browse files Browse the repository at this point in the history
  • Loading branch information
amrit110 committed Nov 21, 2024
1 parent 90e29e8 commit 16f6d46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ui/src/app/components/clinical-notes-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ const ClinicalNotesTable: React.FC<ClinicalNotesTableProps> = ({ notes, patientI
router.push(`/note/${patientId}/${noteId}`);
}, [router, patientId]);

const formatEncounterId = (encounterId: string | number): string => {
const numericId = parseInt(encounterId.toString(), 10);
return numericId === -1 ? 'N/A' : numericId.toString();
};

return (
<Box overflowX="auto">
<Table variant="simple" size="sm">
Expand Down Expand Up @@ -49,7 +54,7 @@ const ClinicalNotesTable: React.FC<ClinicalNotesTableProps> = ({ notes, patientI
</Td>
<Td borderColor={tableBorderColor}>
<Badge colorScheme="purple">
{note.encounter_id === '-1' ? 'N/A' : note.encounter_id}
{formatEncounterId(note.encounter_id)}
</Badge>
</Td>
<Td borderColor={tableBorderColor}>
Expand Down

0 comments on commit 16f6d46

Please sign in to comment.