LT-73 Move export tool and progress dialog component to OHIFViewer
This commit is contained in:
parent
c5651e7e04
commit
9970b8795b
@ -51,5 +51,4 @@ check
|
|||||||
aldeed:template-extension@4.0.0
|
aldeed:template-extension@4.0.0
|
||||||
zuuk:stale-session
|
zuuk:stale-session
|
||||||
gilbertwat:bootstrap3-daterangepicker
|
gilbertwat:bootstrap3-daterangepicker
|
||||||
silentcicero:jszip
|
|
||||||
email
|
email
|
||||||
|
|||||||
@ -83,6 +83,7 @@ rwatts:uuid@0.0.2
|
|||||||
service-configuration@1.0.5
|
service-configuration@1.0.5
|
||||||
session@1.1.1
|
session@1.1.1
|
||||||
sha@1.0.4
|
sha@1.0.4
|
||||||
|
silentcicero:jszip@0.0.4
|
||||||
spacebars@1.0.7
|
spacebars@1.0.7
|
||||||
spacebars-compiler@1.0.7
|
spacebars-compiler@1.0.7
|
||||||
srp@1.0.4
|
srp@1.0.4
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
<div id="viewer">
|
<div id="viewer">
|
||||||
{{> studyBrowser }}
|
{{> studyBrowser }}
|
||||||
<div class='viewerMain'>
|
<div class='viewerMain'>
|
||||||
{{ > toolbar }}
|
{{> toolbar }}
|
||||||
{{ > imageViewerViewports }}
|
{{> imageViewerViewports }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|||||||
@ -45,6 +45,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{{>timeoutCountdownDialog}}
|
{{>timeoutCountdownDialog}}
|
||||||
{{>lesionTrackerProgressDialog}}
|
{{>progressDialog}}
|
||||||
{{>yield }}
|
{{>yield }}
|
||||||
</template>
|
</template>
|
||||||
@ -85,26 +85,5 @@ function exportSelectedStudies() {
|
|||||||
}
|
}
|
||||||
}).fetch() || [];
|
}).fetch() || [];
|
||||||
|
|
||||||
if (selectedStudies.length < 1) {
|
exportStudies(selectedStudies);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var studiesToExport = [];
|
|
||||||
var numberOfStudiesToQuery = selectedStudies.length;
|
|
||||||
|
|
||||||
progressDialog.show("Querying Studies...", numberOfStudiesToQuery);
|
|
||||||
|
|
||||||
selectedStudies.forEach(function(selectedStudy) {
|
|
||||||
getStudyMetadata(selectedStudy.studyInstanceUid, function(study) {
|
|
||||||
studiesToExport.push(study);
|
|
||||||
|
|
||||||
var numberOfStudiesQueried = studiesToExport.length;
|
|
||||||
|
|
||||||
progressDialog.update(numberOfStudiesQueried);
|
|
||||||
|
|
||||||
if (numberOfStudiesQueried === numberOfStudiesToQuery) {
|
|
||||||
exportStudies(studiesToExport);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
@ -129,10 +129,6 @@ Package.onUse(function(api) {
|
|||||||
api.addFiles('client/components/lesionTrackerViewportOverlay/lesionTrackerViewportOverlay.styl', 'client');
|
api.addFiles('client/components/lesionTrackerViewportOverlay/lesionTrackerViewportOverlay.styl', 'client');
|
||||||
api.addFiles('client/components/lesionTrackerViewportOverlay/lesionTrackerViewportOverlay.js', 'client');
|
api.addFiles('client/components/lesionTrackerViewportOverlay/lesionTrackerViewportOverlay.js', 'client');
|
||||||
|
|
||||||
api.addFiles('client/components/lesionTrackerProgressDialog/lesionTrackerProgressDialog.html', 'client');
|
|
||||||
api.addFiles('client/components/lesionTrackerProgressDialog/lesionTrackerProgressDialog.styl', 'client');
|
|
||||||
api.addFiles('client/components/lesionTrackerProgressDialog/lesionTrackerProgressDialog.js', 'client');
|
|
||||||
|
|
||||||
// Server functions
|
// Server functions
|
||||||
api.addFiles('server/collections.js', 'server');
|
api.addFiles('server/collections.js', 'server');
|
||||||
api.addFiles('server/removeCollections.js', [ 'server' ]);
|
api.addFiles('server/removeCollections.js', [ 'server' ]);
|
||||||
@ -171,8 +167,6 @@ Package.onUse(function(api) {
|
|||||||
api.addFiles('lib/handleMeasurementModified.js', 'client');
|
api.addFiles('lib/handleMeasurementModified.js', 'client');
|
||||||
api.addFiles('lib/handleMeasurementRemoved.js', 'client');
|
api.addFiles('lib/handleMeasurementRemoved.js', 'client');
|
||||||
|
|
||||||
api.addFiles('lib/exportStudies.js', 'client');
|
|
||||||
|
|
||||||
|
|
||||||
// Export global functions
|
// Export global functions
|
||||||
api.export('pixelSpacingAutorunCheck', 'client');
|
api.export('pixelSpacingAutorunCheck', 'client');
|
||||||
@ -195,7 +189,6 @@ Package.onUse(function(api) {
|
|||||||
api.export('getTrialCriteriaConstraints', 'client');
|
api.export('getTrialCriteriaConstraints', 'client');
|
||||||
api.export('calculateTotalLesionBurden', 'client');
|
api.export('calculateTotalLesionBurden', 'client');
|
||||||
api.export('convertToNonTarget', 'client');
|
api.export('convertToNonTarget', 'client');
|
||||||
api.export('exportStudies', 'client');
|
|
||||||
api.export('setTimepointActiveTool', 'client');
|
api.export('setTimepointActiveTool', 'client');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template name="lesionTrackerProgressDialog">
|
<template name="progressDialog">
|
||||||
<div id="lesionTrackerProgressDialog" tabindex="0">
|
<div id="progressDialog" tabindex="0">
|
||||||
<div class="dialogHeader">
|
<div class="dialogHeader">
|
||||||
<h5>{{progressDialogTitle}}</h5>
|
<h5>{{progressDialogTitle}}</h5>
|
||||||
</div>
|
</div>
|
||||||
@ -2,7 +2,7 @@ progressDialog = {
|
|||||||
'show': function(title, numberOfTotal) {
|
'show': function(title, numberOfTotal) {
|
||||||
Session.set("progressDialogSettings", { title: title, numberOfCompleted: 0, numberOfTotal: numberOfTotal });
|
Session.set("progressDialogSettings", { title: title, numberOfCompleted: 0, numberOfTotal: numberOfTotal });
|
||||||
|
|
||||||
$('#lesionTrackerProgressDialog').css('display', 'block');
|
$('#progressDialog').css('display', 'block');
|
||||||
},
|
},
|
||||||
'update': function(numberOfCompleted) {
|
'update': function(numberOfCompleted) {
|
||||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||||
@ -16,11 +16,11 @@ progressDialog = {
|
|||||||
},
|
},
|
||||||
'close': function() {
|
'close': function() {
|
||||||
Session.set("progressDialogSettings", { title: "", numberOfCompleted: 0, numberOfTotal: 1 });
|
Session.set("progressDialogSettings", { title: "", numberOfCompleted: 0, numberOfTotal: 1 });
|
||||||
$('#lesionTrackerProgressDialog').css('display', 'none');
|
$('#progressDialog').css('display', 'none');
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Template.lesionTrackerProgressDialog.helpers({
|
Template.progressDialog.helpers({
|
||||||
'progressDialogTitle': function () {
|
'progressDialogTitle': function () {
|
||||||
if (Session.get("progressDialogSettings") && Session.get("progressDialogSettings").title) {
|
if (Session.get("progressDialogSettings") && Session.get("progressDialogSettings").title) {
|
||||||
return Session.get("progressDialogSettings").title;
|
return Session.get("progressDialogSettings").title;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#lesionTrackerProgressDialog
|
#progressDialog
|
||||||
display: none
|
display: none
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 0
|
top: 0
|
||||||
@ -3,19 +3,44 @@
|
|||||||
* @param studiesToExport Studies to export
|
* @param studiesToExport Studies to export
|
||||||
*/
|
*/
|
||||||
exportStudies = function(studiesToExport) {
|
exportStudies = function(studiesToExport) {
|
||||||
|
if (studiesToExport.length < 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var studiesQueried = [];
|
||||||
|
var numberOfStudiesToQuery = studiesToExport.length;
|
||||||
|
|
||||||
|
progressDialog.show("Querying Studies...", numberOfStudiesToQuery);
|
||||||
|
|
||||||
|
studiesToExport.forEach(function(selectedStudy) {
|
||||||
|
getStudyMetadata(selectedStudy.studyInstanceUid, function(study) {
|
||||||
|
studiesQueried.push(study);
|
||||||
|
|
||||||
|
var numberOfStudiesQueried = studiesQueried.length;
|
||||||
|
|
||||||
|
progressDialog.update(numberOfStudiesQueried);
|
||||||
|
|
||||||
|
if (numberOfStudiesQueried === numberOfStudiesToQuery) {
|
||||||
|
exportQueriedStudies(studiesQueried);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function exportQueriedStudies(studiesToExport) {
|
||||||
var numberOfFilesToExport = getNumberOfFilesToExport(studiesToExport);
|
var numberOfFilesToExport = getNumberOfFilesToExport(studiesToExport);
|
||||||
|
|
||||||
progressDialog.show("Exporting Studies...", numberOfFilesToExport);
|
progressDialog.show("Exporting Studies...", numberOfFilesToExport);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
exportStudiesInternal(studiesToExport, numberOfFilesToExport);
|
exportQueriedStudiesInternal(studiesToExport, numberOfFilesToExport);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
progressDialog.close();
|
progressDialog.close();
|
||||||
console.error("Failed to export studies: " + err.message);
|
console.error("Failed to export studies: " + err.message);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
function exportStudiesInternal(studiesToExport, numberOfFilesToExport) {
|
function exportQueriedStudiesInternal(studiesToExport, numberOfFilesToExport) {
|
||||||
var zip = new JSZip();
|
var zip = new JSZip();
|
||||||
|
|
||||||
var exportFailed = false;
|
var exportFailed = false;
|
||||||
@ -110,6 +110,10 @@ Package.onUse(function(api) {
|
|||||||
api.addFiles('client/components/viewer/toolbar/toolbar.js', 'client');
|
api.addFiles('client/components/viewer/toolbar/toolbar.js', 'client');
|
||||||
api.addFiles('client/components/viewer/toolbar/toolbar.styl', 'client');
|
api.addFiles('client/components/viewer/toolbar/toolbar.styl', 'client');
|
||||||
|
|
||||||
|
api.addFiles('client/components/basic/progressDialog/progressDialog.html', 'client');
|
||||||
|
api.addFiles('client/components/basic/progressDialog/progressDialog.styl', 'client');
|
||||||
|
api.addFiles('client/components/basic/progressDialog/progressDialog.js', 'client');
|
||||||
|
|
||||||
// Library functions
|
// Library functions
|
||||||
api.addFiles('lib/accountsConfig.js', 'client');
|
api.addFiles('lib/accountsConfig.js', 'client');
|
||||||
api.addFiles('lib/createStacks.js', 'client');
|
api.addFiles('lib/createStacks.js', 'client');
|
||||||
@ -131,6 +135,7 @@ Package.onUse(function(api) {
|
|||||||
api.addFiles('lib/resizeViewportElements.js', 'client');
|
api.addFiles('lib/resizeViewportElements.js', 'client');
|
||||||
api.addFiles('lib/setFocusToActiveViewport.js', 'client');
|
api.addFiles('lib/setFocusToActiveViewport.js', 'client');
|
||||||
api.addFiles('lib/updateAllViewports.js', 'client');
|
api.addFiles('lib/updateAllViewports.js', 'client');
|
||||||
|
api.addFiles('lib/exportStudies.js', 'client');
|
||||||
api.addFiles('lib/encodeQueryData.js', 'server');
|
api.addFiles('lib/encodeQueryData.js', 'server');
|
||||||
|
|
||||||
//api.export('accountsConfig', 'client');
|
//api.export('accountsConfig', 'client');
|
||||||
@ -149,6 +154,7 @@ Package.onUse(function(api) {
|
|||||||
api.export('updateOrientationMarkers', 'client');
|
api.export('updateOrientationMarkers', 'client');
|
||||||
api.export('setFocusToActiveViewport', 'client');
|
api.export('setFocusToActiveViewport', 'client');
|
||||||
api.export('updateAllViewports', 'client');
|
api.export('updateAllViewports', 'client');
|
||||||
|
api.export('exportStudies', 'client');
|
||||||
api.export('encodeQueryData', 'server');
|
api.export('encodeQueryData', 'server');
|
||||||
|
|
||||||
// Viewer management objects
|
// Viewer management objects
|
||||||
@ -158,6 +164,7 @@ Package.onUse(function(api) {
|
|||||||
// Global objects
|
// Global objects
|
||||||
api.export('OHIF', 'client');
|
api.export('OHIF', 'client');
|
||||||
api.export('ClientId', 'client');
|
api.export('ClientId', 'client');
|
||||||
|
api.export('progressDialog', 'client');
|
||||||
|
|
||||||
// Collections
|
// Collections
|
||||||
api.export('ViewerStudies', 'client');
|
api.export('ViewerStudies', 'client');
|
||||||
|
|||||||
@ -12,7 +12,9 @@
|
|||||||
</a>
|
</a>
|
||||||
<a class="disabled"><i class="fa fa-trash fa-lg"></i> Delete</a>
|
<a class="disabled"><i class="fa fa-trash fa-lg"></i> Delete</a>
|
||||||
<a class="disabled"><i class="fa fa-send-o fa-lg"></i> Send</a>
|
<a class="disabled"><i class="fa fa-send-o fa-lg"></i> Send</a>
|
||||||
<a class="disabled"><i class="fa fa-exchange fa-lg"></i> Export</a>
|
<a id="exportSelectedStudies" type="button"
|
||||||
|
title="Export Selected Studies">
|
||||||
|
<i class="fa fa-exchange fa-lg"></i> Export</a>
|
||||||
<a class="disabled"><i class="fa fa-download fa-lg"></i> Download</a>
|
<a class="disabled"><i class="fa fa-download fa-lg"></i> Download</a>
|
||||||
<a class="disabled"><i class="fa fa-photo fa-lg"></i> View Series Details</a>
|
<a class="disabled"><i class="fa fa-photo fa-lg"></i> View Series Details</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@ -12,6 +12,8 @@ function closeHandler(dialog) {
|
|||||||
* @param e
|
* @param e
|
||||||
*/
|
*/
|
||||||
openStudyContextMenu = function(e) {
|
openStudyContextMenu = function(e) {
|
||||||
|
Worklist.functions['exportSelectedStudies'] = exportSelectedStudies;
|
||||||
|
|
||||||
Template.studyContextMenu.study = $(e.currentTarget);
|
Template.studyContextMenu.study = $(e.currentTarget);
|
||||||
|
|
||||||
var dialog = $('#studyContextMenu');
|
var dialog = $('#studyContextMenu');
|
||||||
@ -55,6 +57,19 @@ openStudyContextMenu = function(e) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exports all selected studies on the worklist
|
||||||
|
*/
|
||||||
|
function exportSelectedStudies() {
|
||||||
|
var selectedStudies = WorklistSelectedStudies.find({}, {
|
||||||
|
sort: {
|
||||||
|
studyDate: 1
|
||||||
|
}
|
||||||
|
}).fetch() || [];
|
||||||
|
|
||||||
|
exportStudies(selectedStudies);
|
||||||
|
}
|
||||||
|
|
||||||
Template.studyContextMenu.events({
|
Template.studyContextMenu.events({
|
||||||
'click a': function(e) {
|
'click a': function(e) {
|
||||||
var study = Template.studyContextMenu.study;
|
var study = Template.studyContextMenu.study;
|
||||||
|
|||||||
@ -3,9 +3,9 @@
|
|||||||
<li role="presentation" class="tabTitle active">
|
<li role="presentation" class="tabTitle active">
|
||||||
<a data-target="#worklistTab" role="tab" data-toggle="tab">Study List</a>
|
<a data-target="#worklistTab" role="tab" data-toggle="tab">Study List</a>
|
||||||
</li>
|
</li>
|
||||||
{{ #each worklistTabs }}
|
{{#each worklistTabs }}
|
||||||
{{ >tabTitle }}
|
{{>tabTitle }}
|
||||||
{{ /each }}
|
{{/each }}
|
||||||
</ul>
|
</ul>
|
||||||
<div id="worklistTabs" class="tab-content">
|
<div id="worklistTabs" class="tab-content">
|
||||||
<div role="tabpanel" class="tab-pane active" id="worklistTab">
|
<div role="tabpanel" class="tab-pane active" id="worklistTab">
|
||||||
@ -13,12 +13,13 @@
|
|||||||
{{> worklistResult }}
|
{{> worklistResult }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ #each worklistTabs }}
|
{{#each worklistTabs }}
|
||||||
{{ >tabContent }}
|
{{>tabContent }}
|
||||||
{{ /each }}
|
{{/each }}
|
||||||
</div>
|
</div>
|
||||||
{{#each additionalTemplates}}
|
{{#each additionalTemplates}}
|
||||||
{{> UI.dynamic template=this}}
|
{{> UI.dynamic template=this}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{ >studyContextMenu }}
|
{{>studyContextMenu }}
|
||||||
|
{{>progressDialog}}
|
||||||
</template>
|
</template>
|
||||||
@ -13,6 +13,7 @@ Package.onUse(function (api) {
|
|||||||
api.use('http');
|
api.use('http');
|
||||||
api.use('practicalmeteor:loglevel');
|
api.use('practicalmeteor:loglevel');
|
||||||
api.use('rwatts:uuid');
|
api.use('rwatts:uuid');
|
||||||
|
api.use('silentcicero:jszip');
|
||||||
|
|
||||||
// Our custom packages
|
// Our custom packages
|
||||||
api.use('dicomweb');
|
api.use('dicomweb');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user