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:
parent
af8bb27575
commit
52eb0edd6f
@ -1,4 +1,4 @@
|
|||||||
import { DicomMetadataStore, IWebApiDataSource } from '@ohif/core';
|
import { DicomMetadataStore, IWebApiDataSource, utils } from '@ohif/core';
|
||||||
import OHIF from '@ohif/core';
|
import OHIF from '@ohif/core';
|
||||||
import dcmjs from 'dcmjs';
|
import dcmjs from 'dcmjs';
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ function createDicomLocalApi(dicomLocalConfig) {
|
|||||||
date: firstInstance.StudyDate,
|
date: firstInstance.StudyDate,
|
||||||
description: firstInstance.StudyDescription,
|
description: firstInstance.StudyDescription,
|
||||||
mrn: firstInstance.PatientID,
|
mrn: firstInstance.PatientID,
|
||||||
patientName: { Alphabetic: firstInstance.PatientName },
|
patientName: utils.formatPN(firstInstance.PatientName),
|
||||||
studyInstanceUid: firstInstance.StudyInstanceUID,
|
studyInstanceUid: firstInstance.StudyInstanceUID,
|
||||||
time: firstInstance.StudyTime,
|
time: firstInstance.StudyTime,
|
||||||
//
|
//
|
||||||
@ -103,9 +103,20 @@ function createDicomLocalApi(dicomLocalConfig) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
series: {
|
series: {
|
||||||
// mapParams: mapParams.bind(),
|
search: studyInstanceUID => {
|
||||||
search: () => {
|
const study = DicomMetadataStore.getStudy(studyInstanceUID);
|
||||||
console.debug(' DICOMLocal QUERY SERIES SEARCH');
|
return study.series.map(aSeries => {
|
||||||
|
const firstInstance = aSeries?.instances[0];
|
||||||
|
return {
|
||||||
|
studyInstanceUid: studyInstanceUID,
|
||||||
|
seriesInstanceUid: firstInstance.SeriesInstanceUID,
|
||||||
|
modality: firstInstance.Modality,
|
||||||
|
seriesNumber: firstInstance.SeriesNumber,
|
||||||
|
seriesDate: firstInstance.SeriesDate,
|
||||||
|
numSeriesInstances: aSeries.instances.length,
|
||||||
|
description: firstInstance.SeriesDescription,
|
||||||
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
instances: {
|
instances: {
|
||||||
|
|||||||
@ -40,7 +40,11 @@ const getLoadButton = (onDrop, text, isDir) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function Local() {
|
type LocalProps = {
|
||||||
|
modePath: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
function Local({ modePath }: LocalProps) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const dropzoneRef = useRef();
|
const dropzoneRef = useRef();
|
||||||
const [dropInitiated, setDropInitiated] = React.useState(false);
|
const [dropInitiated, setDropInitiated] = React.useState(false);
|
||||||
@ -64,8 +68,6 @@ function Local() {
|
|||||||
'@ohif/extension-dicom-microscopy'
|
'@ohif/extension-dicom-microscopy'
|
||||||
);
|
);
|
||||||
|
|
||||||
let modePath = 'viewer';
|
|
||||||
|
|
||||||
const onDrop = async acceptedFiles => {
|
const onDrop = async acceptedFiles => {
|
||||||
const studies = await filesToStudies(acceptedFiles, dataSource);
|
const studies = await filesToStudies(acceptedFiles, dataSource);
|
||||||
|
|
||||||
@ -93,8 +95,9 @@ function Local() {
|
|||||||
|
|
||||||
// Todo: navigate to work list and let user select a mode
|
// Todo: navigate to work list and let user select a mode
|
||||||
studies.forEach(id => query.append('StudyInstanceUIDs', id));
|
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
|
// Set body style
|
||||||
|
|||||||
@ -339,7 +339,11 @@ function WorkList({
|
|||||||
{appConfig.loadedModes.map((mode, i) => {
|
{appConfig.loadedModes.map((mode, i) => {
|
||||||
const isFirst = i === 0;
|
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.
|
// 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
|
// We should also be using the route path, but currently are not
|
||||||
// mode.routeName
|
// mode.routeName
|
||||||
|
|||||||
@ -19,7 +19,11 @@ const bakedInRoutes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/local',
|
path: '/local',
|
||||||
children: Local,
|
children: Local.bind(null, { modePath: '' }), // navigate to the worklist
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/localbasic',
|
||||||
|
children: Local.bind(null, { modePath: 'viewer' }),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user