Improving new study browser and moving studies services to ohif:studies
This commit is contained in:
1 parent
0b51a53976
commit
eb372bed03
54 files changed
+560
-495
No files matched your search
@@ -1,42 +1,12 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
const note = 'OHIF.studylist.retrieveStudiesMetadata is deprecated.';
|
||||
const instructions = 'Please use OHIF.studies.retrieveStudiesMetadata instead.';
|
||||
|
||||
/**
|
||||
* Retrieves metaData for multiple studies at once.
|
||||
*
|
||||
* This function calls retrieveStudyMetadata several times, asynchronously,
|
||||
* and waits for all of the results to be returned.
|
||||
*
|
||||
* @param studyInstanceUids The UIDs of the Studies to be retrieved
|
||||
* @return Promise
|
||||
* @deprecated Please use OHIF.studies.retrieveStudiesMetadata instead
|
||||
*/
|
||||
OHIF.studylist.retrieveStudiesMetadata = (studyInstanceUids, seriesInstanceUids, doneCallback, failCallback) => {
|
||||
// // Check to make sure studyInstanceUids were actually input
|
||||
// if (!studyInstanceUids || !studyInstanceUids.length) {
|
||||
// if (failCallback && typeof failCallback === 'function') {
|
||||
// failCallback('No studyInstanceUids were input');
|
||||
// }
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
|
||||
// Create an empty array to store the Promises for each metaData retrieval call
|
||||
const promises = [];
|
||||
|
||||
// Loop through the array of studyInstanceUids
|
||||
studyInstanceUids.forEach(function(studyInstanceUid) {
|
||||
// Send the call, and attach doneCallbacks and failCallbacks
|
||||
// which can resolve or reject the related promise based on its outcome
|
||||
const promise = OHIF.studylist.retrieveStudyMetadata(studyInstanceUid, seriesInstanceUids);
|
||||
|
||||
// Add the current promise to the array of promises
|
||||
promises.push(promise);
|
||||
});
|
||||
|
||||
// When all of the promises are complete, this callback runs
|
||||
const promise = Promise.all(promises);
|
||||
|
||||
// Warn the error on console if some retrieval failed
|
||||
promise.catch(error => OHIF.log.warn(error));
|
||||
|
||||
return promise;
|
||||
OHIF.studylist.retrieveStudiesMetadata = function() {
|
||||
OHIF.log.warn(`${note}\n${instructions}`);
|
||||
OHIF.studies.retrieveStudiesMetadata.apply(this, arguments);
|
||||
};
|
||||
Reference in new issue
Block a user