Skip to content

Commit

Permalink
Remove duplicate CDS Hooks REMS Admin endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
jtquach1 committed May 21, 2024
1 parent 926808f commit 3155775
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/views/Patient/PatientView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ function PatientView(props: PatientViewProps) {

const [cdsHook, setCDSHook] = useState<Hook | null>(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<Patient | null>(null);
Expand Down

0 comments on commit 3155775

Please sign in to comment.