From 3155775f691952c1b29af3d94194b1a541fc95fb Mon Sep 17 00:00:00 2001 From: Joyce Quach Date: Tue, 21 May 2024 13:54:37 -0400 Subject: [PATCH] Remove duplicate CDS Hooks REMS Admin endpoints --- src/views/Patient/PatientView.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/views/Patient/PatientView.tsx b/src/views/Patient/PatientView.tsx index a5671a4..3e2febf 100644 --- a/src/views/Patient/PatientView.tsx +++ b/src/views/Patient/PatientView.tsx @@ -82,12 +82,14 @@ function PatientView(props: PatientViewProps) { const [cdsHook, setCDSHook] = useState(null); - const cdsUrls = medicationRequestToRemsAdmins - .map( - ({ hookEndpoints }) => - hookEndpoints.find(endpoint => endpoint.hook === SupportedHooks.PATIENT_VIEW)?.remsAdmin + const cdsUrls = Array.from( + new Set( + medicationRequestToRemsAdmins.map( + ({ hookEndpoints }) => + hookEndpoints.find(({ hook }) => hook === SupportedHooks.PATIENT_VIEW)?.remsAdmin + ) ) - .filter(url => !!url) as string[]; + ).filter(url => !!url) as string[]; //Prefetch const [patient, setPatient] = useState(null);