Remove tabbed layout in favour of current Lesion Tracker design (OHIF-49)
This commit is contained in:
1 parent
8b364ce9d0
commit
82e374b1e3
48 files changed
+371
-511
No files matched your search
@@ -5,8 +5,10 @@
|
||||
</div>
|
||||
<div class="dialogContent">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-striped active" role="progressbar" style="width:{{progressStatus}}">
|
||||
{{progressStatus}}
|
||||
<div class="progress-bar progress-bar-striped active"
|
||||
role="progressbar"
|
||||
style="width:{{progressStatus}}">
|
||||
{{formatNumberPrecision progressStatus 0}}%
|
||||
</div>
|
||||
</div>
|
||||
<div id="message">
|
||||
|
||||
@@ -1,56 +1,69 @@
|
||||
progressDialog = {
|
||||
'show': function(title, numberOfTotal) {
|
||||
Session.set("progressDialogSettings", { title: title, numberOfCompleted: 0, numberOfTotal: numberOfTotal });
|
||||
show: function(title, numberOfTotal) {
|
||||
Session.set('progressDialogSettings', {
|
||||
title: title,
|
||||
numberOfCompleted: 0,
|
||||
numberOfTotal: numberOfTotal
|
||||
});
|
||||
|
||||
$('#progressDialog').css('display', 'block');
|
||||
},
|
||||
'update': function(numberOfCompleted) {
|
||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||
update: function(numberOfCompleted) {
|
||||
var progressDialogSettings = Session.get('progressDialogSettings');
|
||||
progressDialogSettings.numberOfCompleted = numberOfCompleted;
|
||||
|
||||
Session.set("progressDialogSettings", progressDialogSettings);
|
||||
Session.set('progressDialogSettings', progressDialogSettings);
|
||||
|
||||
if (progressDialogSettings.numberOfCompleted === progressDialogSettings.numberOfTotal) {
|
||||
progressDialog.close();
|
||||
}
|
||||
},
|
||||
'close': function() {
|
||||
Session.set("progressDialogSettings", { title: "", numberOfCompleted: 0, numberOfTotal: 1 });
|
||||
close: function() {
|
||||
Session.set('progressDialogSettings', {
|
||||
title: '',
|
||||
numberOfCompleted: 0,
|
||||
numberOfTotal: 1
|
||||
});
|
||||
|
||||
$('#progressDialog').css('display', 'none');
|
||||
},
|
||||
'setMessage': function(message) {
|
||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||
setMessage: function(message) {
|
||||
let progressDialogSettings = Session.get('progressDialogSettings');
|
||||
progressDialogSettings.message = message;
|
||||
Session.set("progressDialogSettings", progressDialogSettings);
|
||||
Session.set('progressDialogSettings', progressDialogSettings);
|
||||
}
|
||||
};
|
||||
|
||||
Template.progressDialog.helpers({
|
||||
'progressDialogTitle': function () {
|
||||
if (Session.get("progressDialogSettings") && Session.get("progressDialogSettings").title) {
|
||||
return Session.get("progressDialogSettings").title;
|
||||
progressDialogTitle() {
|
||||
var settings = Session.get('progressDialogSettings');
|
||||
if (!settings) {
|
||||
return;
|
||||
}
|
||||
|
||||
return "";
|
||||
return settings.title;
|
||||
},
|
||||
'progressStatus': function() {
|
||||
var numberOfCompleted = 0;
|
||||
if (Session.get("progressDialogSettings") && Session.get("progressDialogSettings").numberOfCompleted) {
|
||||
numberOfCompleted = Session.get("progressDialogSettings").numberOfCompleted;
|
||||
|
||||
progressStatus() {
|
||||
const settings = Session.get('progressDialogSettings');
|
||||
if (!settings) {
|
||||
return;
|
||||
}
|
||||
|
||||
var numberofTotal = 1;
|
||||
if (Session.get("progressDialogSettings") && Session.get("progressDialogSettings").numberOfTotal) {
|
||||
numberofTotal = Session.get("progressDialogSettings").numberOfTotal;
|
||||
if (settings.numberOfCompleted === undefined ||
|
||||
settings.numberOfTotal === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return parseInt((numberOfCompleted / numberofTotal) * 100) + "%";
|
||||
return settings.numberOfCompleted / settings.numberOfTotal;
|
||||
},
|
||||
'progressMessage': function() {
|
||||
var progressDialogSettings = Session.get("progressDialogSettings");
|
||||
if (progressDialogSettings && progressDialogSettings.message) {
|
||||
return progressDialogSettings.message;
|
||||
|
||||
progressMessage() {
|
||||
var settings = Session.get('progressDialogSettings');
|
||||
if (!settings) {
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
return settings.message;
|
||||
}
|
||||
});
|
||||
@@ -1,12 +1,4 @@
|
||||
<template name="worklist">
|
||||
<ul class="nav noselect" role="tablist" id="tablist">
|
||||
<li role="presentation" class="tabTitle active">
|
||||
<a data-target="#worklistTab" role="tab" data-toggle="tab">Study List</a>
|
||||
</li>
|
||||
{{#each worklistTabs }}
|
||||
{{>tabTitle }}
|
||||
{{/each }}
|
||||
</ul>
|
||||
<div id="worklistTabs" class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="worklistTab">
|
||||
<div class="worklistContainer">
|
||||
|
||||
@@ -12,59 +12,6 @@ body
|
||||
background-color: black
|
||||
margin: 0 auto
|
||||
color: white
|
||||
|
||||
#tabs
|
||||
width: 100%
|
||||
|
||||
#tablist
|
||||
border-bottom: 1px solid #424242
|
||||
background-color: #202020
|
||||
height: 41px
|
||||
|
||||
a:hover
|
||||
background-color: transparent
|
||||
|
||||
.tabTitle
|
||||
background-color: #202020
|
||||
border-color: #424242
|
||||
float: left
|
||||
line-height: 30px
|
||||
|
||||
&:hover
|
||||
color: black
|
||||
background-color: white
|
||||
|
||||
button.close
|
||||
color: black
|
||||
|
||||
&.active
|
||||
background-color: #424242
|
||||
border-color: #424242
|
||||
|
||||
&:hover
|
||||
background-color: #424242
|
||||
cursor: none
|
||||
|
||||
a
|
||||
color: white
|
||||
|
||||
button.close
|
||||
color: white
|
||||
|
||||
a
|
||||
padding: 5px 15px
|
||||
cursor: pointer
|
||||
color: #424242
|
||||
text-decoration: none
|
||||
|
||||
button.close
|
||||
margin: 4px 0 4px 8px
|
||||
text-shadow: none
|
||||
color: white
|
||||
text-decoration: none
|
||||
|
||||
&:hover
|
||||
color: red
|
||||
|
||||
.tab-content
|
||||
width: 100%
|
||||
|
||||
@@ -8,8 +8,8 @@ Template.worklistResult.helpers({
|
||||
* Returns a sorted instance of the WorklistStudies Collection
|
||||
* by Patient name and Study Date in Ascending order.
|
||||
*/
|
||||
studies: function() {
|
||||
var sortOption = Session.get('sortOption');
|
||||
studies() {
|
||||
const sortOption = Session.get('sortOption');
|
||||
if (sortOption) {
|
||||
return WorklistStudies.find({}, {
|
||||
sort: sortOption
|
||||
@@ -24,22 +24,24 @@ Template.worklistResult.helpers({
|
||||
});
|
||||
},
|
||||
|
||||
numberOfStudies: function() {
|
||||
numberOfStudies() {
|
||||
return WorklistStudies.find().count();
|
||||
},
|
||||
|
||||
showLoadingText: function() {
|
||||
showLoadingText() {
|
||||
return Session.get('searchResults').showLoadingText;
|
||||
},
|
||||
|
||||
showNotFoundMessage: function() {
|
||||
showNotFoundMessage() {
|
||||
return Session.get('searchResults').showNotFoundMessage;
|
||||
},
|
||||
|
||||
sortingColumnsIcons: function() {
|
||||
var sortingColumnsIcons = {};
|
||||
Object.keys(Template.instance().sortingColumns.keys).forEach(function(key) {
|
||||
var value = Template.instance().sortingColumns.get(key);
|
||||
sortingColumnsIcons() {
|
||||
const instance = Template.instance();
|
||||
|
||||
let sortingColumnsIcons = {};
|
||||
Object.keys(instance.sortingColumns.keys).forEach(key => {
|
||||
const value = instance.sortingColumns.get(key);
|
||||
|
||||
if (value === 1) {
|
||||
sortingColumnsIcons[key] = 'fa fa-fw fa-sort-up';
|
||||
@@ -102,10 +104,10 @@ function replaceUndefinedColumnValue(text) {
|
||||
* Convert string to study date
|
||||
*/
|
||||
function convertStringToStudyDate(dateStr) {
|
||||
var y = dateStr.substring(0, 4);
|
||||
var m = dateStr.substring(4, 6);
|
||||
var d = dateStr.substring(6, 8);
|
||||
var newDateStr = m + '/' + d + '/' + y;
|
||||
const y = dateStr.substring(0, 4);
|
||||
const m = dateStr.substring(4, 6);
|
||||
const d = dateStr.substring(6, 8);
|
||||
const newDateStr = m + '/' + d + '/' + y;
|
||||
return new Date(newDateStr);
|
||||
}
|
||||
|
||||
@@ -115,7 +117,7 @@ function convertStringToStudyDate(dateStr) {
|
||||
*/
|
||||
function search() {
|
||||
// Show loading message
|
||||
var searchResults = Session.get('searchResults');
|
||||
let searchResults = Session.get('searchResults');
|
||||
searchResults.showLoadingText = true;
|
||||
searchResults.showNotFoundMessage = false;
|
||||
Session.set('searchResults', searchResults);
|
||||
@@ -130,12 +132,12 @@ function search() {
|
||||
|
||||
// Make sure that modality has a reasonable value, since it is occasionally
|
||||
// returned as 'undefined'
|
||||
var modality = replaceUndefinedColumnValue($('input#modality').val());
|
||||
const modality = replaceUndefinedColumnValue($('input#modality').val());
|
||||
|
||||
// Clear all current studies
|
||||
WorklistStudies.remove({});
|
||||
|
||||
Meteor.call('WorklistSearch', filter, function(error, studies) {
|
||||
Meteor.call('WorklistSearch', filter, (error, studies) => {
|
||||
if (error) {
|
||||
log.warn(error);
|
||||
return;
|
||||
@@ -150,7 +152,7 @@ function search() {
|
||||
}
|
||||
|
||||
// Loop through all identified studies
|
||||
studies.forEach(function(study) {
|
||||
studies.forEach(study => {
|
||||
// Search the rest of the parameters that aren't done via the server call
|
||||
if (isIndexOf(study.modalities, modality) &&
|
||||
(new Date(studyDateFrom).setHours(0, 0, 0, 0) <= convertStringToStudyDate(study.studyDate) || !studyDateFrom || studyDateFrom === '') &&
|
||||
@@ -173,36 +175,38 @@ function search() {
|
||||
});
|
||||
}
|
||||
|
||||
Template.worklistResult.onCreated(function() {
|
||||
this.sortOption = new ReactiveVar();
|
||||
this.sortingColumns = new ReactiveDict();
|
||||
Template.worklistResult.onCreated(() => {
|
||||
let instance = Template.instance();
|
||||
instance.sortOption = new ReactiveVar();
|
||||
instance.sortingColumns = new ReactiveDict();
|
||||
|
||||
// Retrieve all studies
|
||||
search();
|
||||
|
||||
// Set sortOption
|
||||
var sortOptionSession = Session.get('sortOption');
|
||||
const sortOptionSession = Session.get('sortOption');
|
||||
if (sortOptionSession) {
|
||||
this.sortingColumns.set(sortOptionSession);
|
||||
instance.sortingColumns.set(sortOptionSession);
|
||||
} else {
|
||||
this.sortingColumns.set('patientName', 1);
|
||||
this.sortingColumns.set('studyDate', 1);
|
||||
this.sortingColumns.set('patientId', 0);
|
||||
this.sortingColumns.set('accessionNumber', 0);
|
||||
this.sortingColumns.set('studyDescription', 0);
|
||||
this.sortingColumns.set('modality', 0);
|
||||
this.sortingColumns.set('numberOfStudyRelatedInstances', 0);
|
||||
instance.sortingColumns.set({
|
||||
patientName: 1,
|
||||
studyDate: 1,
|
||||
patientId: 0,
|
||||
accessionNumber: 0,
|
||||
studyDescription: 0,
|
||||
modality: 0,
|
||||
numberOfStudyRelatedInstances: 0
|
||||
});
|
||||
}
|
||||
|
||||
var self = this;
|
||||
if (Worklist.subscriptions) {
|
||||
Worklist.subscriptions.forEach(function(collectionName) {
|
||||
self.subscribe(collectionName);
|
||||
Worklist.subscriptions.forEach(collectionName => {
|
||||
instance.subscribe(collectionName);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Template.worklistResult.onRendered(function() {
|
||||
Template.worklistResult.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
// Initialize daterangepicker
|
||||
@@ -215,29 +219,33 @@ Template.worklistResult.onRendered(function() {
|
||||
});
|
||||
});
|
||||
|
||||
function resetSortingColumns(template, sortingColumn) {
|
||||
Object.keys(template.sortingColumns.keys).forEach(function(key) {
|
||||
function resetSortingColumns(instance, sortingColumn) {
|
||||
Object.keys(instance.sortingColumns.keys).forEach(key => {
|
||||
if (key !== sortingColumn) {
|
||||
template.sortingColumns.set(key, null);
|
||||
instance.sortingColumns.set(key, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Template.worklistResult.events({
|
||||
'keydown input': function(e) {
|
||||
if (e.which === 13) { // Enter
|
||||
'keydown input'(event) {
|
||||
if (event.which === 13) { // Enter
|
||||
search();
|
||||
}
|
||||
},
|
||||
'onsearch input': function() {
|
||||
|
||||
'onsearch input'() {
|
||||
search();
|
||||
},
|
||||
'change #studyDate': function(e, template) {
|
||||
var dateRange = $(e.currentTarget).val();
|
||||
|
||||
'change #studyDate'(event) {
|
||||
let dateRange = $(event.currentTarget).val();
|
||||
|
||||
// Remove all space chars
|
||||
dateRange = dateRange.replace(/ /g, '');
|
||||
|
||||
// Split dateRange into subdates
|
||||
var dates = dateRange.split('-');
|
||||
const dates = dateRange.split('-');
|
||||
studyDateFrom = dates[0];
|
||||
studyDateTo = dates[1];
|
||||
|
||||
@@ -245,23 +253,26 @@ Template.worklistResult.events({
|
||||
search();
|
||||
}
|
||||
},
|
||||
'click div.sortingCell': function(e, template) {
|
||||
var elementId = e.currentTarget.id;
|
||||
// Remove _ from id
|
||||
var columnName = elementId.replace('_', '');
|
||||
|
||||
var sortOption = {};
|
||||
resetSortingColumns(template, columnName);
|
||||
var columnObject = template.sortingColumns.get(columnName);
|
||||
'click div.sortingCell'(event, instance) {
|
||||
const elementId = event.currentTarget.id;
|
||||
|
||||
// Remove _ from id
|
||||
const columnName = elementId.replace('_', '');
|
||||
|
||||
let sortOption = {};
|
||||
resetSortingColumns(instance, columnName);
|
||||
|
||||
const columnObject = instance.sortingColumns.get(columnName);
|
||||
if (columnObject) {
|
||||
template.sortingColumns.set(columnName, columnObject * -1);
|
||||
instance.sortingColumns.set(columnName, columnObject * -1);
|
||||
sortOption[columnName] = columnObject * -1;
|
||||
} else {
|
||||
template.sortingColumns.set(columnName, 1);
|
||||
instance.sortingColumns.set(columnName, 1);
|
||||
sortOption[columnName] = 1;
|
||||
}
|
||||
|
||||
template.sortOption.set(sortOption);
|
||||
instance.sortOption.set(sortOption);
|
||||
Session.set('sortOption', sortOption);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Template.worklistToolbar.onCreated(() => {
|
||||
Meteor.call('importSupported', function(error, result) {
|
||||
Meteor.call('importSupported', (error, result) => {
|
||||
if (error || !result) {
|
||||
Session.set('importSupported', false);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user