feat: configuration to hook into XHR Error handling
* Error handling. * Fix error handling, add redirect example. * remove debugger * docs: whitelabeling and httpErrorHandler * bump dicomweb-client version * bump cornerstone-wado-image-loader version * Add more documentation around httpErrorHandler callback * test: add errorHandler as an expected top level export Co-authored-by: dannyrb <danny.ri.brown@gmail.com>
This commit is contained in:
1 parent
273f31ad56
commit
e96205de35
23 files changed
+227
-76
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import DICOMWeb from '../../../DICOMWeb/';
|
||||
import { api } from 'dicomweb-client';
|
||||
|
||||
import errorHandler from '../../../errorHandler';
|
||||
|
||||
/**
|
||||
* Parses data returned from a QIDO search and transforms it into
|
||||
* an array of series that are present in the study
|
||||
@@ -79,6 +81,7 @@ export default function Instances(server, StudyInstanceUID) {
|
||||
const config = {
|
||||
url: server.qidoRoot,
|
||||
headers: DICOMWeb.getAuthorizationHeader(server),
|
||||
errorInterceptor: errorHandler.getHTTPErrorHandler(),
|
||||
};
|
||||
const dicomWeb = new api.DICOMwebClient(config);
|
||||
const queryParams = getQIDOQueryParams(
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { api } from 'dicomweb-client';
|
||||
import DICOMWeb from '../../../DICOMWeb/';
|
||||
|
||||
import errorHandler from '../../../errorHandler';
|
||||
|
||||
/**
|
||||
* Creates a QIDO date string for a date range query
|
||||
* Assumes the year is positive, at most 4 digits long.
|
||||
@@ -115,6 +117,7 @@ export default function Studies(server, filter) {
|
||||
const config = {
|
||||
url: server.qidoRoot,
|
||||
headers: DICOMWeb.getAuthorizationHeader(server),
|
||||
errorInterceptor: errorHandler.getHTTPErrorHandler(),
|
||||
};
|
||||
|
||||
const dicomWeb = new api.DICOMwebClient(config);
|
||||
|
||||
@@ -9,6 +9,8 @@ import {
|
||||
addInstancesToStudy,
|
||||
} from './studyInstanceHelpers';
|
||||
|
||||
import errorHandler from '../../../errorHandler';
|
||||
|
||||
const { naturalizeDataset } = dcmjs.data.DicomMetaDictionary;
|
||||
|
||||
/**
|
||||
@@ -73,6 +75,7 @@ export default class RetrieveMetadataLoaderAsync extends RetrieveMetadataLoader
|
||||
const client = new api.DICOMwebClient({
|
||||
url: server.qidoRoot,
|
||||
headers: DICOMWeb.getAuthorizationHeader(server),
|
||||
errorInterceptor: errorHandler.getHTTPErrorHandler(),
|
||||
});
|
||||
|
||||
this.client = client;
|
||||
@@ -117,7 +120,7 @@ export default class RetrieveMetadataLoaderAsync extends RetrieveMetadataLoader
|
||||
|
||||
return {
|
||||
seriesInstanceUIDsMap,
|
||||
seriesData
|
||||
seriesData,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -155,11 +158,14 @@ export default class RetrieveMetadataLoaderAsync extends RetrieveMetadataLoader
|
||||
SeriesDescription: series.SeriesDescription,
|
||||
SeriesNumber: series.SeriesNumber,
|
||||
Modality: series.Modality,
|
||||
instances: []
|
||||
instances: [],
|
||||
};
|
||||
|
||||
if (study.series[idx]) {
|
||||
study.series[idx] = Object.assign(seriesDataFromQIDO, study.series[idx]);
|
||||
study.series[idx] = Object.assign(
|
||||
seriesDataFromQIDO,
|
||||
study.series[idx]
|
||||
);
|
||||
} else {
|
||||
study.series[idx] = seriesDataFromQIDO;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ import DICOMWeb from '../../../DICOMWeb/';
|
||||
import { createStudyFromSOPInstanceList } from './studyInstanceHelpers';
|
||||
import RetrieveMetadataLoader from './retrieveMetadataLoader';
|
||||
|
||||
import errorHandler from '../../../errorHandler';
|
||||
|
||||
/**
|
||||
* Class for sync load of study metadata.
|
||||
* It inherits from RetrieveMetadataLoader
|
||||
@@ -58,6 +60,7 @@ export default class RetrieveMetadataLoaderSync extends RetrieveMetadataLoader {
|
||||
const client = new api.DICOMwebClient({
|
||||
url: server.wadoRoot,
|
||||
headers: DICOMWeb.getAuthorizationHeader(server),
|
||||
errorInterceptor: errorHandler.getHTTPErrorHandler(),
|
||||
});
|
||||
|
||||
this.client = client;
|
||||
|
||||
Reference in new issue
Block a user