LT-32: Set lesion tool as active tool if timepoint is baseline otherwise window level when switch the tabs
This commit is contained in:
parent
192e3c5988
commit
f26fc22cef
@ -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);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
10
Packages/lesiontracker/lib/setTimepointActiveTool.js
Normal file
10
Packages/lesiontracker/lib/setTimepointActiveTool.js
Normal 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());
|
||||
}
|
||||
};
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user