LT-32: Set lesion tool as active tool if timepoint is baseline otherwise window level when switch the tabs

This commit is contained in:
Aysel Afsar 2016-02-24 12:45:37 -05:00
parent 192e3c5988
commit f26fc22cef
4 changed files with 26 additions and 6 deletions

View File

@ -120,6 +120,7 @@ Template.viewer.onCreated(function() {
log.info('autorun viewer.js. Ready: ' + subscriptionsReady);
if (subscriptionsReady) {
TrialResponseCriteria.validateAllDelayed();
ViewerStudies.find().observe({
@ -260,6 +261,12 @@ Template.viewer.onCreated(function() {
TrialResponseCriteria.validateAll();
}
});
// Set active tool for timepoint
dataContext.timepointIds.forEach(function(timepointId) {
var timepoint = Timepoints.findOne({timepointId: timepointId});
setTimepointActiveTool(timepoint);
});
}
});
});

View File

@ -0,0 +1,10 @@
// If timepoint is baseline, sets lesion tool as active tool
// Else sets default tool
setTimepointActiveTool = function(timepoint) {
if ((timepoint.timepointType).toLowerCase() === "baseline") {
// Set active tool as lesion tool
toolManager.setActiveTool('lesion');
} else {
toolManager.setActiveTool(toolManager.getDefaultTool());
}
};

View File

@ -14,6 +14,8 @@ function dblClickOnStudy(data) {
studyInstanceUid: data.studyInstanceUid
});
console.log(study);
// Check if the study has been associated, and if not, just open it on its own
if (!study) {
// Open a new tab with this study
@ -28,17 +30,14 @@ function dblClickOnStudy(data) {
}
});
// Check timepointType whether or not baseline
if ((timepoint.timepointType).toLowerCase() === "baseline") {
// Set active tool as lesion tool
toolManager.setActiveTool('lesion');
}
if (!timepoint) {
openNewTab(data.studyInstanceUid, title);
return;
}
// Set active tool for timepoint
setTimepointActiveTool(timepoint);
// Add the Timepoint name to the Patient name to create the tab title
title += ' ' + getTimepointName(timepoint);

View File

@ -160,6 +160,8 @@ Package.onUse(function(api) {
api.addFiles('lib/clearTools.js', 'client');
api.addFiles('lib/calculateTotalLesionBurden.js', 'client');
api.addFiles('lib/convertToNonTarget.js', 'client');
api.addFiles('lib/setTimepointActiveTool.js', 'client');
api.addFiles('lib/syncMeasurementAndToolData.js', 'client');
api.addFiles('lib/syncImageMeasurementAndToolData.js', 'client');
@ -194,6 +196,8 @@ Package.onUse(function(api) {
api.export('calculateTotalLesionBurden', 'client');
api.export('convertToNonTarget', 'client');
api.export('exportStudies', 'client');
api.export('setTimepointActiveTool', 'client');
// Export global objects
api.export('TrialResponseCriteria', 'client');