fix(dicomlocal): navigate /local to the work list and /localbasic to the (basic) viewer (#3389)

* fix(dicomlocal): navigate /local to the work list and /localbasic to the (basic) viewer
For TMTV, consider both the forward and back slash separator for modalities.

* Fix to TMTV isValidMode method.

* PR feedback:
- replace forward slashes with back slashes for modalities in the WorkList instead of in the Mode.

* Added query.series to DicomLocalDataSource.
This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2023-05-15 16:23:53 -04:00
1 parent af8bb27575
commit 52eb0edd6f
4 files changed
+33 -11

No files matched your search

+7 -4
View File
@@ -40,7 +40,11 @@ const getLoadButton = (onDrop, text, isDir) => {
);
};
function Local() {
type LocalProps = {
modePath: string;
};
function Local({ modePath }: LocalProps) {
const navigate = useNavigate();
const dropzoneRef = useRef();
const [dropInitiated, setDropInitiated] = React.useState(false);
@@ -64,8 +68,6 @@ function Local() {
'@ohif/extension-dicom-microscopy'
);
let modePath = 'viewer';
const onDrop = async acceptedFiles => {
const studies = await filesToStudies(acceptedFiles, dataSource);
@@ -93,8 +95,9 @@ function Local() {
// Todo: navigate to work list and let user select a mode
studies.forEach(id => query.append('StudyInstanceUIDs', id));
query.append('datasources', 'dicomlocal');
navigate(`/${modePath}/dicomlocal?${decodeURIComponent(query.toString())}`);
navigate(`/${modePath}?${decodeURIComponent(query.toString())}`);
};
// Set body style
@@ -339,7 +339,11 @@ function WorkList({
{appConfig.loadedModes.map((mode, i) => {
const isFirst = i === 0;
const isValidMode = mode.isValidMode({ modalities });
const modalitiesToCheck = modalities.replaceAll('/', '\\');
const isValidMode = mode.isValidMode({
modalities: modalitiesToCheck,
});
// TODO: Modes need a default/target route? We mostly support a single one for now.
// We should also be using the route path, but currently are not
// mode.routeName
+5 -1
View File
@@ -19,7 +19,11 @@ const bakedInRoutes = [
},
{
path: '/local',
children: Local,
children: Local.bind(null, { modePath: '' }), // navigate to the worklist
},
{
path: '/localbasic',
children: Local.bind(null, { modePath: 'viewer' }),
},
];