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
|
||||
zuuk:stale-session
|
||||
gilbertwat:bootstrap3-daterangepicker
|
||||
silentcicero:jszip
|
||||
email
|
||||
|
||||
@ -83,6 +83,7 @@ rwatts:uuid@0.0.2
|
||||
service-configuration@1.0.5
|
||||
session@1.1.1
|
||||
sha@1.0.4
|
||||
silentcicero:jszip@0.0.4
|
||||
spacebars@1.0.7
|
||||
spacebars-compiler@1.0.7
|
||||
srp@1.0.4
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
<div id="viewer">
|
||||
{{> studyBrowser }}
|
||||
<div class='viewerMain'>
|
||||
{{ > toolbar }}
|
||||
{{ > imageViewerViewports }}
|
||||
{{> toolbar }}
|
||||
{{> imageViewerViewports }}
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
|
||||
@ -45,6 +45,6 @@
|
||||
</a>
|
||||
</div>
|
||||
{{>timeoutCountdownDialog}}
|
||||
{{>lesionTrackerProgressDialog}}
|
||||
{{>progressDialog}}
|
||||
{{>yield }}
|
||||
</template>
|
||||
@ -85,26 +85,5 @@ function exportSelectedStudies() {
|
||||
}
|
||||
}).fetch() || [];
|
||||
|
||||
if (selectedStudies.length < 1) {
|
||||
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);
|
||||
}
|
||||
});
|
||||
});
|
||||
exportStudies(selectedStudies);
|
||||
}
|
||||
@ -129,10 +129,6 @@ Package.onUse(function(api) {
|
||||
api.addFiles('client/components/lesionTrackerViewportOverlay/lesionTrackerViewportOverlay.styl', '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
|
||||
api.addFiles('server/collections.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/handleMeasurementRemoved.js', 'client');
|
||||
|
||||
api.addFiles('lib/exportStudies.js', 'client');
|
||||
|
||||
|
||||
// Export global functions
|
||||
api.export('pixelSpacingAutorunCheck', 'client');
|
||||
@ -195,7 +189,6 @@ Package.onUse(function(api) {
|
||||
api.export('getTrialCriteriaConstraints', 'client');
|
||||
api.export('calculateTotalLesionBurden', 'client');
|
||||
api.export('convertToNonTarget', 'client');
|
||||
api.export('exportStudies', 'client');
|
||||
api.export('setTimepointActiveTool', 'client');
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template name="lesionTrackerProgressDialog">
|
||||
<div id="lesionTrackerProgressDialog" tabindex="0">
|
||||
<template name="progressDialog">
|
||||
<div id="progressDialog" tabindex="0">
|
||||
<div class="dialogHeader">
|
||||
<h5>{{progressDialogTitle}}</h5>
|
||||
</div>
|
||||
@ -2,7 +2,7 @@ progressDialog = {
|
||||
'show': function(title, numberOfTotal) {
|
||||
Session.set("progressDialogSettings", { title: title, numberOfCompleted: 0, numberOfTotal: numberOfTotal });
|
||||
|
||||
$('#lesionTrackerProgressDialog').css('display', 'block');
|
||||
$('#progressDialog').css('display', 'block');
|
||||
},
|
||||
'update': function(numberOfCompleted) {
|
||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||
@ -16,11 +16,11 @@ progressDialog = {
|
||||
},
|
||||
'close': function() {
|
||||
Session.set("progressDialogSettings", { title: "", numberOfCompleted: 0, numberOfTotal: 1 });
|
||||
$('#lesionTrackerProgressDialog').css('display', 'none');
|
||||
$('#progressDialog').css('display', 'none');
|
||||
},
|
||||
};
|
||||
|
||||
Template.lesionTrackerProgressDialog.helpers({
|
||||
Template.progressDialog.helpers({
|
||||
'progressDialogTitle': function () {
|
||||
if (Session.get("progressDialogSettings") && Session.get("progressDialogSettings").title) {
|
||||
return Session.get("progressDialogSettings").title;
|
||||
@ -1,4 +1,4 @@
|
||||
#lesionTrackerProgressDialog
|
||||
#progressDialog
|
||||
display: none
|
||||
position: absolute
|
||||
top: 0
|
||||
@ -3,19 +3,44 @@
|
||||
* @param studiesToExport Studies to export
|
||||
*/
|
||||
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);
|
||||
|
||||
progressDialog.show("Exporting Studies...", numberOfFilesToExport);
|
||||
|
||||
try {
|
||||
exportStudiesInternal(studiesToExport, numberOfFilesToExport);
|
||||
exportQueriedStudiesInternal(studiesToExport, numberOfFilesToExport);
|
||||
} catch (err) {
|
||||
progressDialog.close();
|
||||
console.error("Failed to export studies: " + err.message);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function exportStudiesInternal(studiesToExport, numberOfFilesToExport) {
|
||||
function exportQueriedStudiesInternal(studiesToExport, numberOfFilesToExport) {
|
||||
var zip = new JSZip();
|
||||
|
||||
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.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
|
||||
api.addFiles('lib/accountsConfig.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/setFocusToActiveViewport.js', 'client');
|
||||
api.addFiles('lib/updateAllViewports.js', 'client');
|
||||
api.addFiles('lib/exportStudies.js', 'client');
|
||||
api.addFiles('lib/encodeQueryData.js', 'server');
|
||||
|
||||
//api.export('accountsConfig', 'client');
|
||||
@ -149,6 +154,7 @@ Package.onUse(function(api) {
|
||||
api.export('updateOrientationMarkers', 'client');
|
||||
api.export('setFocusToActiveViewport', 'client');
|
||||
api.export('updateAllViewports', 'client');
|
||||
api.export('exportStudies', 'client');
|
||||
api.export('encodeQueryData', 'server');
|
||||
|
||||
// Viewer management objects
|
||||
@ -158,6 +164,7 @@ Package.onUse(function(api) {
|
||||
// Global objects
|
||||
api.export('OHIF', 'client');
|
||||
api.export('ClientId', 'client');
|
||||
api.export('progressDialog', 'client');
|
||||
|
||||
// Collections
|
||||
api.export('ViewerStudies', 'client');
|
||||
|
||||
@ -12,7 +12,9 @@
|
||||
</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-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-photo fa-lg"></i> View Series Details</a>
|
||||
</li>
|
||||
|
||||
@ -12,6 +12,8 @@ function closeHandler(dialog) {
|
||||
* @param e
|
||||
*/
|
||||
openStudyContextMenu = function(e) {
|
||||
Worklist.functions['exportSelectedStudies'] = exportSelectedStudies;
|
||||
|
||||
Template.studyContextMenu.study = $(e.currentTarget);
|
||||
|
||||
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({
|
||||
'click a': function(e) {
|
||||
var study = Template.studyContextMenu.study;
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||
<li role="presentation" class="tabTitle active">
|
||||
<a data-target="#worklistTab" role="tab" data-toggle="tab">Study List</a>
|
||||
</li>
|
||||
{{ #each worklistTabs }}
|
||||
{{ >tabTitle }}
|
||||
{{ /each }}
|
||||
{{#each worklistTabs }}
|
||||
{{>tabTitle }}
|
||||
{{/each }}
|
||||
</ul>
|
||||
<div id="worklistTabs" class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="worklistTab">
|
||||
@ -13,12 +13,13 @@
|
||||
{{> worklistResult }}
|
||||
</div>
|
||||
</div>
|
||||
{{ #each worklistTabs }}
|
||||
{{ >tabContent }}
|
||||
{{ /each }}
|
||||
{{#each worklistTabs }}
|
||||
{{>tabContent }}
|
||||
{{/each }}
|
||||
</div>
|
||||
{{#each additionalTemplates}}
|
||||
{{> UI.dynamic template=this}}
|
||||
{{/each}}
|
||||
{{ >studyContextMenu }}
|
||||
{{>studyContextMenu }}
|
||||
{{>progressDialog}}
|
||||
</template>
|
||||
@ -13,6 +13,7 @@ Package.onUse(function (api) {
|
||||
api.use('http');
|
||||
api.use('practicalmeteor:loglevel');
|
||||
api.use('rwatts:uuid');
|
||||
api.use('silentcicero:jszip');
|
||||
|
||||
// Our custom packages
|
||||
api.use('dicomweb');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user