Adapting OHIFStudyMetadataSource to use new retrieveMetadata call from ohif:study-list package.
This commit is contained in:
parent
7dff1a815e
commit
e1cc8adbad
@ -13,9 +13,7 @@ export class OHIFStudyMetadataSource extends OHIF.viewerbase.StudyMetadataSource
|
|||||||
* @return {Promise} A Promise object
|
* @return {Promise} A Promise object
|
||||||
*/
|
*/
|
||||||
getByInstanceUID(studyInstanceUID) {
|
getByInstanceUID(studyInstanceUID) {
|
||||||
return new Promise((resolve, reject) => {
|
return OHIF.studylist.retrieveStudyMetadata(studyInstanceUID);
|
||||||
getStudyMetadata(studyInstanceUID, resolve, reject);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -13,6 +13,11 @@ const StudyMetaDataPromises = new Map();
|
|||||||
* @returns {Promise} that will be resolved with the metadata or rejected with the error
|
* @returns {Promise} that will be resolved with the metadata or rejected with the error
|
||||||
*/
|
*/
|
||||||
OHIF.studylist.retrieveStudyMetadata = studyInstanceUid => {
|
OHIF.studylist.retrieveStudyMetadata = studyInstanceUid => {
|
||||||
|
|
||||||
|
// @TODO: Whenever a study metadata request has failed, its related promise will be rejected once and for all
|
||||||
|
// and further requests for that metadata will always fail. On failure, we probably need to remove the
|
||||||
|
// corresponding promise from the "StudyMetaDataPromises" map...
|
||||||
|
|
||||||
// If the StudyMetaDataPromises cache already has a pending or resolved promise related to the
|
// If the StudyMetaDataPromises cache already has a pending or resolved promise related to the
|
||||||
// given studyInstanceUid, then that promise is returned
|
// given studyInstanceUid, then that promise is returned
|
||||||
if (StudyMetaDataPromises.has(studyInstanceUid)) {
|
if (StudyMetaDataPromises.has(studyInstanceUid)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user