diff --git a/.env b/.env index 98e1bf056..da5570f6e 100644 --- a/.env +++ b/.env @@ -1,3 +1,2 @@ REACT_APP_USE_MOCK_API=false -REACT_APP_ENABLE_PERMISSIONS=true -REACT_APP_ORTHANC_EXPLORER=https://orthanc.uni2growcameroun.com/app/explorer.html \ No newline at end of file +REACT_APP_ENABLE_PERMISSIONS=true \ No newline at end of file diff --git a/.env.development b/.env.development index fe343002b..9975eae53 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,2 @@ REACT_APP_USE_MOCK_API=true -REACT_APP_ENABLE_PERMISSIONS=false -REACT_APP_ORTHANC_EXPLORER=https://orthanc.uni2growcameroun.com/app/explorer.html \ No newline at end of file +REACT_APP_ENABLE_PERMISSIONS=false \ No newline at end of file diff --git a/src/components/accessories/radiology/hooks/index.ts b/src/components/accessories/radiology/hooks/index.ts index f2fea30b6..e7b6edf88 100644 --- a/src/components/accessories/radiology/hooks/index.ts +++ b/src/components/accessories/radiology/hooks/index.ts @@ -1 +1 @@ -export * from "./useViewMore"; +export * from "./useViewInOrthanc"; diff --git a/src/components/accessories/radiology/hooks/useViewInOrthanc.ts b/src/components/accessories/radiology/hooks/useViewInOrthanc.ts new file mode 100644 index 000000000..c41cd045a --- /dev/null +++ b/src/components/accessories/radiology/hooks/useViewInOrthanc.ts @@ -0,0 +1,17 @@ +import { useCallback } from "react"; + +export const useViewInOrthanc = (level: "study" | "series" | "instance") => { + /** + * Todo: Use value provided by the backend + */ + const ORTHANC_EXPLORER = + "https://orthanc.uni2growcameroun.com/app/explorer.html"; + const handleViewInOrthanc = useCallback( + (row: any) => () => { + window.open(`${ORTHANC_EXPLORER}#${level}?uuid=${row.id}`, "_blank"); + }, + [level] + ); + + return handleViewInOrthanc; +}; diff --git a/src/components/accessories/radiology/hooks/useViewMore.ts b/src/components/accessories/radiology/hooks/useViewMore.ts deleted file mode 100644 index 3ce9f3d56..000000000 --- a/src/components/accessories/radiology/hooks/useViewMore.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { useCallback } from "react"; - -export const useViewMore = (level: "study" | "series" | "instance") => { - const handleViewMore = useCallback( - (row: any) => () => { - window.open( - `${process.env.REACT_APP_ORTHANC_EXPLORER}#${level}?uuid=${row.id}`, - "_blank" - ); - }, - [level] - ); - - return handleViewMore; -}; diff --git a/src/components/accessories/radiology/series/Series.tsx b/src/components/accessories/radiology/series/Series.tsx index 17e6a4d8e..3e6750640 100644 --- a/src/components/accessories/radiology/series/Series.tsx +++ b/src/components/accessories/radiology/series/Series.tsx @@ -1,4 +1,4 @@ -import { ChevronLeft, Visibility } from "@mui/icons-material"; +import { ChevronLeft, OpenInNew } from "@mui/icons-material"; import { Backdrop, Button, @@ -23,7 +23,7 @@ import { getStudySeriesWithInstances, getStudySeriesWithInstancesReset, } from "state/radiology"; -import { useViewMore } from "../hooks"; +import { useViewInOrthanc } from "../hooks"; import { Instances } from "./instances/Instances"; import { Preview } from "./preview/Preview"; import "./styles.scss"; @@ -138,7 +138,7 @@ export const Series = () => { } }, [previewState.status, setOpenPreview]); - const handleViewSeries = useViewMore("series"); + const handleViewSeries = useViewInOrthanc("series"); return (
+
{study.title} {study.date && " | " + study.date}
)} @@ -193,9 +193,9 @@ export const Series = () => { isCollapsabile={true} renderCustomActions={(row) => (