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);