diff --git a/LesionTracker/client/components/viewer.js b/LesionTracker/client/components/viewer.js index cbd42c469..732712c2c 100644 --- a/LesionTracker/client/components/viewer.js +++ b/LesionTracker/client/components/viewer.js @@ -238,6 +238,11 @@ Template.viewer.onCreated(function() { // Clear the toolData for this timepoint var imageId = data.timepoints[timepointId].imageId; removeToolDataWithMeasurementId(imageId, toolType, measurementId); + + // Set reviewer for this timepoint + if (data.timepoints[timepointId].studyInstanceUid) { + Meteor.call('setReviewer',data.timepoints[timepointId].studyInstanceUid); + } }); // Sync database data with toolData for all the measurements diff --git a/Packages/lesiontracker/client/components/lesionTrackerWorklistStudy/lesionTrackerWorklistStudy.js b/Packages/lesiontracker/client/components/lesionTrackerWorklistStudy/lesionTrackerWorklistStudy.js index 2d2336639..100a12bb0 100644 --- a/Packages/lesiontracker/client/components/lesionTrackerWorklistStudy/lesionTrackerWorklistStudy.js +++ b/Packages/lesiontracker/client/components/lesionTrackerWorklistStudy/lesionTrackerWorklistStudy.js @@ -84,15 +84,16 @@ function getReviewerTipText(reviewers) { } // Observe changes on WorklistTabs +// remove the current user from Reviewers if tab is removed WorklistTabs.find().observe({ removed: function(tab) { - var timepointId = tab.timepointId; - if (!timepointId) { - return; + var contentId = tab.contentid; + var timepointIds = ViewerData[contentId].timepointIds; + if (timepointIds.length > 0) { + timepointIds.forEach(function(timepointId) { + // Remove the current user from Reviewers + Meteor.call('removeReviewer', timepointId); + }); } - - // Remove the current user from Reviewers - Meteor.call('removeReviewer', timepointId); - } }); \ No newline at end of file diff --git a/Packages/lesiontracker/client/components/userAccountMenu/userAccountMenu.js b/Packages/lesiontracker/client/components/userAccountMenu/userAccountMenu.js index fbba498ee..0064b4eab 100644 --- a/Packages/lesiontracker/client/components/userAccountMenu/userAccountMenu.js +++ b/Packages/lesiontracker/client/components/userAccountMenu/userAccountMenu.js @@ -45,6 +45,8 @@ Template.userAccountMenu.events({ $('#serverInformationModal').modal('show'); }, 'click #logoutButton': function() { + // Remove reviewers info for the user + Meteor.call('removeUserFromReviewers', Meteor.userId()); Meteor.logout(function() { Router.go('/entrySignIn'); }); diff --git a/Packages/lesiontracker/lib/syncMeasurementAndToolData.js b/Packages/lesiontracker/lib/syncMeasurementAndToolData.js index c5e58a867..f1b5686a9 100644 --- a/Packages/lesiontracker/lib/syncMeasurementAndToolData.js +++ b/Packages/lesiontracker/lib/syncMeasurementAndToolData.js @@ -12,11 +12,6 @@ syncMeasurementAndToolData = function(measurement) { // Sync the Cornerstone ToolData with this Measurement's timepoint-specific data syncTimepointDataWithToolData(measurement, timepointData, imageId, toolType); - - // Set reviewer for this timepoint - if (measurement.timepoints[key].studyInstanceUid) { - Meteor.call('setReviewer',measurement.timepoints[key].studyInstanceUid); - } }); };