From 3917e34a74af77f8f2809a3d1929da89a7a562f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elo=C3=ADzio=20Salgado?= Date: Fri, 10 Feb 2017 19:22:10 -0200 Subject: [PATCH] Moving loadStudy logic from Hanging Protocols to StudyMetadataSource --- Packages/ohif-hanging-protocols/client/protocolEngine.js | 6 +++--- .../ohif-study-list/client/lib/OHIFStudyMetadataSource.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Packages/ohif-hanging-protocols/client/protocolEngine.js b/Packages/ohif-hanging-protocols/client/protocolEngine.js index a675fc70b..4fa26ff8e 100644 --- a/Packages/ohif-hanging-protocols/client/protocolEngine.js +++ b/Packages/ohif-hanging-protocols/client/protocolEngine.js @@ -417,9 +417,6 @@ HP.ProtocolEngine = class ProtocolEngine { // Check if study metadata is already in studies list if (this.studies.find(study => study.getStudyInstanceUID() === priorStudyInstanceUID)) { - // Update the viewport to refresh layout manager with new study - this.updateViewports(); - return; } @@ -433,6 +430,9 @@ HP.ProtocolEngine = class ProtocolEngine { // Re-match images this.matchImages(viewport); + + // Update the viewport to refresh layout manager with new study + this.updateViewports(); }, error => { OHIF.log.warn(error); throw new OHIFError(`ProtocolEngine::matchImages could not get study metadata for studyInstanceUID: ${priorStudyInstanceUID}`); diff --git a/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js b/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js index 0909eb906..ac780a1c7 100644 --- a/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js +++ b/Packages/ohif-study-list/client/lib/OHIFStudyMetadataSource.js @@ -36,7 +36,7 @@ export class OHIFStudyMetadataSource extends OHIF.viewerbase.StudyMetadataSource }); if (!alreadyLoaded) { - this._updateStudyCollections(study); + OHIFStudyMetadataSource._updateStudyCollections(study); } resolve(study); @@ -53,7 +53,7 @@ export class OHIFStudyMetadataSource extends OHIF.viewerbase.StudyMetadataSource // Set studyMetadata display sets studyMetadata.setDisplaySets(displaySets); - this._updateStudyCollections(studyMetadata); + OHIFStudyMetadataSource._updateStudyCollections(studyMetadata); resolve(studyMetadata); }, reject); }); @@ -65,7 +65,7 @@ export class OHIFStudyMetadataSource extends OHIF.viewerbase.StudyMetadataSource // Set some studyInfo properties studyInfo.selected = true; - studyInfo.displaySets = displaySets; + studyInfo.displaySets = studyMetadata.getDisplaySets(); // Insert new study info object in Studies TypeSafeCollection OHIF.viewer.Studies.insert(studyInfo);