feat(url): Add SeriesInstanceUIDs wado query param (#3746)
This commit is contained in:
1 parent
013068bcb0
commit
b694228dd5
5 files changed
+114
-24
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import retrieveMetadataFiltered from './utils/retrieveMetadataFiltered.js';
|
||||
import RetrieveMetadata from './wado/retrieveMetadata.js';
|
||||
|
||||
const moduleName = 'RetrieveStudyMetadata';
|
||||
@@ -5,14 +6,17 @@ const moduleName = 'RetrieveStudyMetadata';
|
||||
const StudyMetaDataPromises = new Map();
|
||||
|
||||
/**
|
||||
* Retrieves study metadata
|
||||
* Retrieves study metadata.
|
||||
*
|
||||
* @param {Object} server Object with server configuration parameters
|
||||
* @param {Object} dicomWebClient The DICOMWebClient instance to be used for series load
|
||||
* @param {string} StudyInstanceUID The UID of the Study to be retrieved
|
||||
* @param {boolean} enabledStudyLazyLoad Whether the study metadata should be loaded asynchronously.
|
||||
* @param {function} storeInstancesCallback A callback used to store the retrieved instance metadata.
|
||||
* @param {Object} [filters] - Object containing filters to be applied on retrieve metadata process
|
||||
* @param {string} [filter.seriesInstanceUID] - series instance uid to filter results against
|
||||
* @param {boolean} enableStudyLazyLoad Whether the study metadata should be loaded asynchronously.
|
||||
* @param {Object} [filters] Object containing filters to be applied on retrieve metadata process
|
||||
* @param {string} [filters.seriesInstanceUID] Series instance uid to filter results against
|
||||
* @param {array} [filters.SeriesInstanceUIDs] Series instance uids to filter results against
|
||||
* @param {function} [sortCriteria] Sort criteria function
|
||||
* @param {function} [sortFunction] Sort function
|
||||
*
|
||||
* @returns {Promise} that will be resolved with the metadata or rejected with the error
|
||||
*/
|
||||
export function retrieveStudyMetadata(
|
||||
@@ -39,19 +43,32 @@ export function retrieveStudyMetadata(
|
||||
return StudyMetaDataPromises.get(StudyInstanceUID);
|
||||
}
|
||||
|
||||
// Create a promise to handle the data retrieval
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
RetrieveMetadata(
|
||||
let promise;
|
||||
|
||||
if (filters && filters.SeriesInstanceUIDs) {
|
||||
promise = retrieveMetadataFiltered(
|
||||
dicomWebClient,
|
||||
StudyInstanceUID,
|
||||
enableStudyLazyLoad,
|
||||
filters,
|
||||
sortCriteria,
|
||||
sortFunction
|
||||
).then(function (data) {
|
||||
resolve(data);
|
||||
}, reject);
|
||||
});
|
||||
);
|
||||
} else {
|
||||
// Create a promise to handle the data retrieval
|
||||
promise = new Promise((resolve, reject) => {
|
||||
RetrieveMetadata(
|
||||
dicomWebClient,
|
||||
StudyInstanceUID,
|
||||
enableStudyLazyLoad,
|
||||
filters,
|
||||
sortCriteria,
|
||||
sortFunction
|
||||
).then(function (data) {
|
||||
resolve(data);
|
||||
}, reject);
|
||||
});
|
||||
}
|
||||
|
||||
// Store the promise in cache
|
||||
StudyMetaDataPromises.set(StudyInstanceUID, promise);
|
||||
@@ -61,10 +78,9 @@ export function retrieveStudyMetadata(
|
||||
|
||||
/**
|
||||
* Delete the cached study metadata retrieval promise to ensure that the browser will
|
||||
* re-retrieve the study metadata when it is next requested
|
||||
* re-retrieve the study metadata when it is next requested.
|
||||
*
|
||||
* @param {String} StudyInstanceUID The UID of the Study to be removed from cache
|
||||
*
|
||||
*/
|
||||
export function deleteStudyMetadataPromise(StudyInstanceUID) {
|
||||
if (StudyMetaDataPromises.has(StudyInstanceUID)) {
|
||||
|
||||
Reference in new issue
Block a user