-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(url): Add SeriesInstanceUIDs wado query param (#3746)
- Loading branch information
1 parent
013068b
commit b694228
Showing
5 changed files
with
114 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
extensions/default/src/DicomWebDataSource/utils/retrieveMetadataFiltered.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import RetrieveMetadata from '../wado/retrieveMetadata'; | ||
|
||
/** | ||
* Retrieve metadata filtered. | ||
* | ||
* @param {*} dicomWebClient The DICOMWebClient instance to be used for series load | ||
* @param {*} StudyInstanceUID The UID of the Study to be retrieved | ||
* @param {*} 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 | ||
*/ | ||
function retrieveMetadataFiltered( | ||
dicomWebClient, | ||
StudyInstanceUID, | ||
enableStudyLazyLoad, | ||
filters, | ||
sortCriteria, | ||
sortFunction | ||
) { | ||
const { SeriesInstanceUIDs } = filters; | ||
|
||
return new Promise((resolve, reject) => { | ||
const promises = SeriesInstanceUIDs.map(uid => { | ||
const seriesSpecificFilters = Object.assign({}, filters, { | ||
seriesInstanceUID: uid, | ||
}); | ||
|
||
return RetrieveMetadata( | ||
dicomWebClient, | ||
StudyInstanceUID, | ||
enableStudyLazyLoad, | ||
seriesSpecificFilters, | ||
sortCriteria, | ||
sortFunction | ||
); | ||
}); | ||
|
||
Promise.all(promises).then(results => { | ||
const aggregatedResult = { preLoadData: [], promises: [] }; | ||
|
||
results.forEach(({ preLoadData, promises }) => { | ||
aggregatedResult.preLoadData = aggregatedResult.preLoadData.concat(preLoadData); | ||
aggregatedResult.promises = aggregatedResult.promises.concat(promises); | ||
}); | ||
|
||
resolve(aggregatedResult); | ||
}, reject); | ||
}); | ||
} | ||
|
||
export default retrieveMetadataFiltered; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters