feat(errorHandling): Create fallback page for Server, Study and Series (#3592)
This commit is contained in:
1 parent
9c51f17c60
commit
19408c987f
6 files changed
+100
-1
No files matched your search
@@ -2,6 +2,7 @@ import React, { useState, useEffect, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { StudyBrowser, useImageViewer, useViewportGrid } from '@ohif/ui';
|
||||
import { utils } from '@ohif/core';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
const { sortStudyInstances, formatDate } = utils;
|
||||
|
||||
@@ -21,6 +22,8 @@ function PanelStudyBrowser({
|
||||
displaySetService,
|
||||
uiNotificationService,
|
||||
} = servicesManager.services;
|
||||
const navigate = useNavigate();
|
||||
|
||||
// Normally you nest the components so the tree isn't so deep, and the data
|
||||
// doesn't have to have such an intense shape. This works well enough for now.
|
||||
// Tabs --> Studies --> DisplaySets --> Thumbnails
|
||||
@@ -69,6 +72,11 @@ function PanelStudyBrowser({
|
||||
studyInstanceUid: StudyInstanceUID,
|
||||
});
|
||||
|
||||
if (!qidoForStudyUID?.length) {
|
||||
navigate('/notfoundstudy', '_self');
|
||||
throw new Error('Invalid study URL');
|
||||
}
|
||||
|
||||
let qidoStudiesForPatient = qidoForStudyUID;
|
||||
|
||||
// try to fetch the prior studies based on the patientID if the
|
||||
|
||||
Reference in new issue
Block a user