diff --git a/Packages/hangingprotocols/client/components/protocolEditor/protocolEditor.styl b/Packages/hangingprotocols/client/components/protocolEditor/protocolEditor.styl
index 49e77c206..df0d5f262 100644
--- a/Packages/hangingprotocols/client/components/protocolEditor/protocolEditor.styl
+++ b/Packages/hangingprotocols/client/components/protocolEditor/protocolEditor.styl
@@ -8,7 +8,7 @@ $height = 20px
padding: 10px
position: absolute
top: 0
- background: $primaryBackgroundCOlor
+ background: $primaryBackgroundColor
.navigationButtons
ul
diff --git a/Packages/hangingprotocols/client/components/ruleEntryDialog/ruleEntryDialog.js b/Packages/hangingprotocols/client/components/ruleEntryDialog/ruleEntryDialog.js
index 2abf6d019..6b752565a 100644
--- a/Packages/hangingprotocols/client/components/ruleEntryDialog/ruleEntryDialog.js
+++ b/Packages/hangingprotocols/client/components/ruleEntryDialog/ruleEntryDialog.js
@@ -211,13 +211,16 @@ Template.ruleEntryDialog.onCreated(function() {
Template.ruleEntryDialog.onRendered(function() {
// Initialize the Comparators Select2 box
- var template = this;
+ var template = Template.instance();
template.$('.comparators').select2();
// Get the default Comparator from the Select2 box and use it to
// initialize the comparatorId ReactiveVar
var comparatorId = template.$('.comparators').val();
template.comparatorId.set(comparatorId);
+
+ const dialog = template.$('.ruleEntryDialog');
+ dialog.draggable();
});
Template.ruleEntryDialog.helpers({
diff --git a/Packages/hangingprotocols/client/components/ruleEntryDialog/ruleEntryDialog.styl b/Packages/hangingprotocols/client/components/ruleEntryDialog/ruleEntryDialog.styl
index 4adffef89..51b5164a5 100644
--- a/Packages/hangingprotocols/client/components/ruleEntryDialog/ruleEntryDialog.styl
+++ b/Packages/hangingprotocols/client/components/ruleEntryDialog/ruleEntryDialog.styl
@@ -1,3 +1,5 @@
+@import "{design}/app.styl"
+
.ruleEntryDialog
display: none
position: absolute
@@ -6,15 +8,19 @@
left: 0
right: 0
z-index: 100
- width: 50%
- max-width: 400px
+ width: 350px
height: 230px
margin: auto
- border-radius: 5px
- padding: 10px 20px 10px 20px
+ padding: 10px
background-color: rgba(255,255,255,1)
outline: none
+ opacity: 0.95
+ border-radius: 8px
+ border: 1px solid $uiBorderColor
+ background: $uiGrayDarkest
+ color: $textSecondaryColor
+
.dialogContent
text-align: center
margin-bottom: 10px
@@ -33,4 +39,9 @@
input.currentValue
width: 95%
- text-align: center
\ No newline at end of file
+ text-align: center
+ padding: 4px
+ color: black
+ height: 30px
+ border-radius: 2px
+ border: 0
\ No newline at end of file
diff --git a/Packages/hangingprotocols/client/components/settingEntryDialog/settingEntryDialog.js b/Packages/hangingprotocols/client/components/settingEntryDialog/settingEntryDialog.js
index 37a3367e3..6106bde76 100644
--- a/Packages/hangingprotocols/client/components/settingEntryDialog/settingEntryDialog.js
+++ b/Packages/hangingprotocols/client/components/settingEntryDialog/settingEntryDialog.js
@@ -113,6 +113,12 @@ Template.settingEntryDialog.onCreated(function() {
template.setting = new ReactiveVar();
});
+Template.settingEntryDialog.onRendered(function() {
+ const template = this;
+ const dialog = template.$('.settingEntryDialog');
+ dialog.draggable();
+});
+
Template.settingEntryDialog.events({
/**
* Save a setting that is being edited
diff --git a/Packages/hangingprotocols/client/components/settingEntryDialog/settingEntryDialog.styl b/Packages/hangingprotocols/client/components/settingEntryDialog/settingEntryDialog.styl
index 6e3445534..31d543b13 100644
--- a/Packages/hangingprotocols/client/components/settingEntryDialog/settingEntryDialog.styl
+++ b/Packages/hangingprotocols/client/components/settingEntryDialog/settingEntryDialog.styl
@@ -1,3 +1,5 @@
+@import "{design}/app.styl"
+
.settingEntryDialog
display: none
position: absolute
@@ -6,15 +8,18 @@
left: 0
right: 0
z-index: 100
- width: 50%
- max-width: 400px
- height: 230px
+ width: 300px
+ height: 200px
margin: auto
- border-radius: 5px
- padding: 10px 20px 10px 20px
- background-color: rgba(255,255,255,1)
+ padding: 10px
outline: none
+ opacity: 0.95
+ border-radius: 8px
+ border: 1px solid $uiBorderColor
+ background: $uiGrayDarkest
+ color: $textSecondaryColor
+
.dialogContent
text-align: center
margin-bottom: 10px
@@ -33,4 +38,9 @@
input.currentValue
width: 95%
- text-align: center
\ No newline at end of file
+ text-align: center
+ padding: 4px
+ color: black
+ height: 30px
+ border-radius: 2px
+ border: 0
\ No newline at end of file
diff --git a/Packages/hangingprotocols/client/components/stageSortable/stageSortable.styl b/Packages/hangingprotocols/client/components/stageSortable/stageSortable.styl
index d58b2409e..e1a3713be 100644
--- a/Packages/hangingprotocols/client/components/stageSortable/stageSortable.styl
+++ b/Packages/hangingprotocols/client/components/stageSortable/stageSortable.styl
@@ -46,6 +46,7 @@
.addStage
margin: 10px 0
text-align: center
+ color: $defaultColor
#addStage
transition(all 0.1s ease)
diff --git a/Packages/hangingprotocols/client/components/textEntryDialog/textEntryDialog.js b/Packages/hangingprotocols/client/components/textEntryDialog/textEntryDialog.js
index 7de55c9cc..7e3edff13 100644
--- a/Packages/hangingprotocols/client/components/textEntryDialog/textEntryDialog.js
+++ b/Packages/hangingprotocols/client/components/textEntryDialog/textEntryDialog.js
@@ -57,6 +57,12 @@ openTextEntryDialog = function(title, instructions, currentValue, doneCallback)
});
};
+Template.textEntryDialog.onRendered(() => {
+ const instance = Template.instance();
+ const dialog = instance.$('.settingEntryDialog');
+ dialog.draggable();
+});
+
Template.textEntryDialog.events({
/**
* Save the user-specified text
diff --git a/Packages/hangingprotocols/client/components/textEntryDialog/textEntryDialog.styl b/Packages/hangingprotocols/client/components/textEntryDialog/textEntryDialog.styl
index 4eec60db8..8ae55fe18 100644
--- a/Packages/hangingprotocols/client/components/textEntryDialog/textEntryDialog.styl
+++ b/Packages/hangingprotocols/client/components/textEntryDialog/textEntryDialog.styl
@@ -1,3 +1,5 @@
+@import "{design}/app.styl"
+
.textEntryDialog
display: none
position: absolute
@@ -6,15 +8,18 @@
left: 0
right: 0
z-index: 100
- width: 50%
- max-width: 400px
+ width: 300px
height: 170px
margin: auto
- border-radius: 5px
- padding: 10px 20px 10px 20px
- background-color: rgba(255,255,255,1)
+ padding: 10px
outline: none
+ opacity: 0.95
+ border-radius: 8px
+ border: 1px solid $uiBorderColor
+ background: $uiGrayDarkest
+ color: $textSecondaryColor
+
.dialogContent
margin-bottom: 10px
@@ -26,4 +31,9 @@
input.currentValue
width: 95%
- text-align: left
\ No newline at end of file
+ text-align: left
+ padding: 4px
+ color: black
+ height: 30px
+ border-radius: 2px
+ border: 0
\ No newline at end of file
diff --git a/Packages/hangingprotocols/package.js b/Packages/hangingprotocols/package.js
index 3ad8aae32..e63f915bf 100755
--- a/Packages/hangingprotocols/package.js
+++ b/Packages/hangingprotocols/package.js
@@ -5,7 +5,7 @@ Package.describe({
});
Package.onUse(function(api) {
- api.versionsFrom('1.3.5.1');
+ api.versionsFrom('1.4');
api.use('ecmascript');
api.use('standard-app-packages');
diff --git a/Packages/lesiontracker/client/components/lesionTracker/lesionTracker.js b/Packages/lesiontracker/client/components/lesionTracker/lesionTracker.js
index 131622596..af0c1fa32 100644
--- a/Packages/lesiontracker/client/components/lesionTracker/lesionTracker.js
+++ b/Packages/lesiontracker/client/components/lesionTracker/lesionTracker.js
@@ -1,24 +1,11 @@
-// Define the ViewerData global object
-// If there is currently any Session data for this object,
-// use this to repopulate the variable
-ViewerData = Session.get('ViewerData') || {};
-
const worklistContentId = 'worklistTab';
const viewerContentId = 'viewerTab';
-Template.lesionTracker.onRendered(() => {
- const templateData = Template.currentData();
- if (templateData && templateData.studyInstanceUid) {
- const studyInstanceUid = templateData.studyInstanceUid;
- openNewTab(studyInstanceUid, studyInstanceUid);
- } else {
- // If there is a tab set as active in the Session,
- // switch to that now.
- const contentId = Session.get('activeContentId');
-
- // TODO: Fix this it seems to be forcing two switches
- switchToTab(contentId);
- }
+// Define the ViewerData global object
+// If there is currently any Session data for this object,
+// use this to repopulate the variable
+Template.lesionTracker.onCreated(() => {
+ ViewerData = Session.get('ViewerData') || {};
});
Template.lesionTracker.events({
@@ -33,8 +20,6 @@ Template.lesionTracker.events({
}
});
-Session.set('defaultSignInMessage', 'Tumor tracking in your browser.');
-
Template.lesionTracker.helpers({
studyListToggleText() {
const contentId = Session.get('activeContentId');
@@ -52,7 +37,10 @@ Template.lesionTracker.helpers({
return 'Study list';
}
},
+
onStudyList() {
return (Session.get('activeContentId') === 'worklistTab');
}
});
+
+Session.set('defaultSignInMessage', 'Tumor tracking in your browser.');
\ No newline at end of file
diff --git a/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.js b/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.js
index dfb9bd2f6..e9a66b178 100644
--- a/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.js
+++ b/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.js
@@ -135,6 +135,7 @@ function exportSelectedStudies() {
* Loads multiple unassociated studies in the Viewer
*/
function viewStudies() {
+ console.log('viewStudies');
var selectedStudies = WorklistSelectedStudies.find({}, {
sort: {
studyDate: 1
diff --git a/Packages/lesiontracker/lib/worklist/openNewTabWithTimepoint.js b/Packages/lesiontracker/lib/worklist/openNewTabWithTimepoint.js
index ec99e6449..2571bcdaa 100644
--- a/Packages/lesiontracker/lib/worklist/openNewTabWithTimepoint.js
+++ b/Packages/lesiontracker/lib/worklist/openNewTabWithTimepoint.js
@@ -6,6 +6,7 @@
* @param title The title to be used for the tab heading
*/
openNewTabWithTimepoint = function(timepointId, title) {
+ console.log('openNewTabWithTimepoint');
var contentId = 'viewerTab';
var timepoint = Timepoints.findOne({
diff --git a/Packages/lesiontracker/lib/worklist/worklistModification.js b/Packages/lesiontracker/lib/worklist/worklistModification.js
index 11fec351a..4cb81162c 100644
--- a/Packages/lesiontracker/lib/worklist/worklistModification.js
+++ b/Packages/lesiontracker/lib/worklist/worklistModification.js
@@ -68,5 +68,6 @@ function open(studyInstanceUid, title) {
};
// Switch to the new tab
+ console.log('open');
switchToTab(contentid);
}
diff --git a/Packages/ohif-core/package.js b/Packages/ohif-core/package.js
index 67663fa32..2f08ef057 100644
--- a/Packages/ohif-core/package.js
+++ b/Packages/ohif-core/package.js
@@ -5,7 +5,7 @@ Package.describe({
});
Package.onUse(function(api) {
- api.versionsFrom('1.3.5.1');
+ api.versionsFrom('1.4');
api.use('ecmascript');
api.use('standard-app-packages');
diff --git a/Packages/viewerbase/client/components/viewer/cineDialog/cineDialog.styl b/Packages/viewerbase/client/components/viewer/cineDialog/cineDialog.styl
index 770cf6f98..c71318f76 100644
--- a/Packages/viewerbase/client/components/viewer/cineDialog/cineDialog.styl
+++ b/Packages/viewerbase/client/components/viewer/cineDialog/cineDialog.styl
@@ -11,14 +11,14 @@ $borderColor = rgba(77, 99, 110, 0.81)
bottom: 3px
right: 3px
- overflow: hidden
+ overflow: hidden
padding: 10px
width: 300px
height: 175px
opacity: 0.95
border-radius: 8px
- border: 1px solid $borderColor;
+ border: 1px solid $uiBorderColor
background: $uiGrayDarkest
color: $textSecondaryColor
diff --git a/Packages/viewerbase/lib/toolManager.js b/Packages/viewerbase/lib/toolManager.js
index 12d9f9ae8..d4b3042c7 100644
--- a/Packages/viewerbase/lib/toolManager.js
+++ b/Packages/viewerbase/lib/toolManager.js
@@ -25,16 +25,16 @@ function configureTools() {
cornerstoneTools.panMultiTouch.setConfiguration(multiTouchPanConfig);
// Set the text box background color
- cornerstoneTools.textStyle.setBackgroundColor('black');
+ cornerstoneTools.textStyle.setBackgroundColor('rgba(0, 0, 0, 0.95)');
// Set the tool width
cornerstoneTools.toolStyle.setToolWidth(2);
// Set color for inactive tools
- cornerstoneTools.toolColors.setToolColor('rgb(255, 255, 0)');
+ cornerstoneTools.toolColors.setToolColor('#ff00ff'); //rgb(255, 255, 0)');
// Set color for active tools
- cornerstoneTools.toolColors.setActiveColor('rgb(0, 255, 0)');
+ cornerstoneTools.toolColors.setActiveColor('#00ffff'); //rgb(0, 255, 0)'
}
toolManager = {
diff --git a/Packages/worklist/client/components/tabTitle/tabTitle.js b/Packages/worklist/client/components/tabTitle/tabTitle.js
index 484912b79..8633cd25a 100644
--- a/Packages/worklist/client/components/tabTitle/tabTitle.js
+++ b/Packages/worklist/client/components/tabTitle/tabTitle.js
@@ -6,6 +6,8 @@ Template.tabTitle.events({
* @param e The click event used to close the tab
*/
'click .close': function(e) {
+ console.log('click .close');
+
// Identify the tab title DOM node
var tab = $(e.currentTarget).parents('a[data-toggle="tab"]').eq(0);
diff --git a/Packages/worklist/client/components/worklist.js b/Packages/worklist/client/components/worklist.js
index 039c244eb..a0080d5ee 100644
--- a/Packages/worklist/client/components/worklist.js
+++ b/Packages/worklist/client/components/worklist.js
@@ -30,10 +30,11 @@ Template.worklist.onRendered(() => {
} else {
// If there is a tab set as active in the Session,
// switch to that now.
+ console.log('worklist onRendered');
const contentId = Session.get('activeContentId');
-
- // TODO: FIx this it seems to be forcing two switches
- switchToTab(contentId);
+ if (contentId !== 'worklistTab') {
+ switchToTab(contentId);
+ }
}
Meteor.subscribe('hangingprotocols');
diff --git a/Packages/worklist/client/components/worklistResult/worklistResult.html b/Packages/worklist/client/components/worklistResult/worklistResult.html
index 519d6e823..80bd352d7 100644
--- a/Packages/worklist/client/components/worklistResult/worklistResult.html
+++ b/Packages/worklist/client/components/worklistResult/worklistResult.html
@@ -15,31 +15,29 @@
- {{#if showLoadingText}}
+ {{#if session "showLoadingText"}}
{{>loadingText}}
{{/if}}
- {{#if showNotFoundMessage}}
+ {{#unless numberOfStudies}}
No matching results
- {{/if}}
+ {{/unless}}
\ No newline at end of file
diff --git a/Packages/worklist/client/components/worklistResult/worklistResult.js b/Packages/worklist/client/components/worklistResult/worklistResult.js
index 15de0a20f..5edb2c79c 100644
--- a/Packages/worklist/client/components/worklistResult/worklistResult.js
+++ b/Packages/worklist/client/components/worklistResult/worklistResult.js
@@ -1,7 +1,4 @@
-Session.setDefault('searchResults', {
- showLoadingText: true,
- showNotFoundMessage: false
-});
+Session.setDefault('showLoadingText', true);
Template.worklistResult.helpers({
/**
@@ -28,14 +25,6 @@ Template.worklistResult.helpers({
return WorklistStudies.find().count();
},
- showLoadingText() {
- return Session.get('searchResults').showLoadingText;
- },
-
- showNotFoundMessage() {
- return Session.get('searchResults').showNotFoundMessage;
- },
-
sortingColumnsIcons() {
const instance = Template.instance();
@@ -116,18 +105,19 @@ function convertStringToStudyDate(dateStr) {
* Inserts the identified studies into the WorklistStudies Collection
*/
function search() {
+ console.log('search()');
+
// Show loading message
- let searchResults = Session.get('searchResults');
- searchResults.showLoadingText = true;
- searchResults.showNotFoundMessage = false;
- Session.set('searchResults', searchResults);
+ Session.set('showLoadingText', true);
// Create the filters to be used for the Worklist Search
filter = {
patientName: getFilter($('input#patientName').val()),
patientId: getFilter($('input#patientId').val()),
accessionNumber: getFilter($('input#accessionNumber').val()),
- studyDescription: getFilter($('input#studyDescription').val())
+ studyDescription: getFilter($('input#studyDescription').val()),
+ studyDateFrom: studyDateFrom,
+ studyDateTo: studyDateTo
};
// Make sure that modality has a reasonable value, since it is occasionally
@@ -138,14 +128,14 @@ function search() {
WorklistStudies.remove({});
Meteor.call('WorklistSearch', filter, (error, studies) => {
+ console.log('WorklistSearch');
if (error) {
log.warn(error);
return;
}
// Hide loading text
- searchResults.showLoadingText = false;
- Session.set('searchResults', searchResults);
+ Session.set('showLoadingText', false);
if (!studies) {
return;
@@ -165,13 +155,6 @@ function search() {
WorklistStudies.insert(study);
}
});
-
- if (WorklistStudies.find().count() === 0) {
- // Show studyNotFound text
- searchResults.showNotFoundMessage = true;
- Session.set('searchResults', searchResults);
- }
-
});
}
@@ -180,9 +163,6 @@ Template.worklistResult.onCreated(() => {
instance.sortOption = new ReactiveVar();
instance.sortingColumns = new ReactiveDict();
- // Retrieve all studies
- search();
-
// Set sortOption
const sortOptionSession = Session.get('sortOption');
if (sortOptionSession) {
@@ -217,6 +197,9 @@ Template.worklistResult.onRendered(() => {
'Last 30 Days': [moment().subtract(29, 'days'), moment()]
}
});
+
+ // Retrieve all studies
+ search();
});
function resetSortingColumns(instance, sortingColumn) {
diff --git a/Packages/worklist/client/components/worklistResult/worklistResult.styl b/Packages/worklist/client/components/worklistResult/worklistResult.styl
index 68de969c8..f6671e5f3 100644
--- a/Packages/worklist/client/components/worklistResult/worklistResult.styl
+++ b/Packages/worklist/client/components/worklistResult/worklistResult.styl
@@ -50,6 +50,7 @@ $bodyCellHeight = 40px
width: 100%
padding: 0 $tablePadding
position: absolute
+ overflow: hidden
z-index: 2
.loadingTextDiv
@@ -117,6 +118,7 @@ $bodyCellHeight = 40px
box-sizing: border-box
transition(all 0.15s ease)
+ placeholder-color($inputPlaceholderColor)
&.invisible
visibility: hidden
@@ -124,20 +126,6 @@ $bodyCellHeight = 40px
&:active, &:hover
background-color: $inputBackgroundColor
- &::-webkit-input-placeholder /* WebKit, Blink, Edge */
- color: $inputPlaceholderColor
-
- &:-moz-placeholder /* Mozilla Firefox 4 to 18 */
- color: $inputPlaceholderColor
- opacity: 1
-
- &::-moz-placeholder /* Mozilla Firefox 19+ */
- color: $inputPlaceholderColor
- opacity: 1
-
- &:-ms-input-placeholder /* Internet Explorer 10-11 */
- color: $inputPlaceholderColor
-
::-webkit-datetime-edit-year-field:not([aria-valuenow]),
::-webkit-datetime-edit-month-field:not([aria-valuenow]),
::-webkit-datetime-edit-day-field:not([aria-valuenow])
@@ -176,3 +164,29 @@ $bodyCellHeight = 40px
border-top: 1px solid #436270
border-bottom: 1px solid #436270
background-color: $hoverColor
+
+
+@media only screen and (max-width: 1000px)
+ $tablePaddingMediumScreen = 10px
+ #studyListContainer
+ padding: 0
+
+ table#tblStudyList
+ thead > tr > th
+ &:first-child
+ padding-left: $tablePaddingMediumScreen
+
+ &:last-child
+ padding-right: $tablePaddingMediumScreen
+
+ tbody > tr > td
+ &:first-child
+ padding-left: $tablePaddingMediumScreen
+
+ &:last-child
+ padding-right: $tablePaddingMediumScreen
+
+ th.accessionNumber, td.accessionNumber,
+ th.modalities, td.modalities,
+ th.numberOfStudyRelatedInstances, td.numberOfStudyRelatedInstances
+ display: none
\ No newline at end of file
diff --git a/Packages/worklist/client/components/worklistStudy/worklistStudy.html b/Packages/worklist/client/components/worklistStudy/worklistStudy.html
index cf79d4324..bda1d9ba7 100644
--- a/Packages/worklist/client/components/worklistStudy/worklistStudy.html
+++ b/Packages/worklist/client/components/worklistStudy/worklistStudy.html
@@ -1,31 +1,25 @@
- |
+ |
{{formatPN patientName}}
|
-
+ |
{{patientId}}
|
- {{#unless isTouchDevice}}
-
+ |
{{accessionNumber}}
|
- {{/unless}}
-
+ |
{{formatDA studyDate}}
|
- {{#unless isTouchDevice}}
-
+ |
{{modalities}}
|
- {{/unless}}
-
+ |
{{studyDescription}}
|
- {{#unless isTouchDevice}}
-
+ |
{{numberOfStudyRelatedInstances}}
|
- {{/unless}}
\ No newline at end of file
diff --git a/Packages/worklist/client/lib/openNewTab.js b/Packages/worklist/client/lib/openNewTab.js
index 05b9b11e2..a6847fc01 100644
--- a/Packages/worklist/client/lib/openNewTab.js
+++ b/Packages/worklist/client/lib/openNewTab.js
@@ -6,6 +6,8 @@
* @param title The title to be used for the tab heading
*/
openNewTab = function(studyInstanceUid, title) {
+ console.log('openNewTab');
+
// Generate a unique ID to represent this tab
// We can't just use the Mongo entry ID because
// then it will change after hot-reloading.
diff --git a/Packages/worklist/package.js b/Packages/worklist/package.js
index f3719da64..10a2b62a2 100644
--- a/Packages/worklist/package.js
+++ b/Packages/worklist/package.js
@@ -22,6 +22,7 @@ Package.onUse(function (api) {
api.use('gilbertwat:bootstrap3-daterangepicker');
// Our custom packages
+ api.use('ohif:core');
api.use('design');
api.use('dicomweb');
api.use('dimseservice');
diff --git a/Packages/worklist/server/services/qido/studies.js b/Packages/worklist/server/services/qido/studies.js
index b00bc7dac..13e42ed5f 100644
--- a/Packages/worklist/server/services/qido/studies.js
+++ b/Packages/worklist/server/services/qido/studies.js
@@ -1,3 +1,21 @@
+/**
+ * Creates a QIDO date string for a date range query
+ * Assumes the year is positive, at most 4 digits long.
+ *
+ * @param date The Date object to be formatted
+ * @returns {string} The formatted date string
+ */
+function dateToString(date) {
+ if(!date) return "";
+ var year = date.getFullYear().toString();
+ var month = (date.getMonth() + 1).toString();
+ var day = date.getDate().toString();
+ year = "0".repeat(4-year.length).concat(year);
+ month= "0".repeat(2-month.length).concat(month);
+ day = "0".repeat(2-day.length).concat(day);
+ return "".concat(year,month,day);
+}
+
/**
* Produces a QIDO URL given server details and a set of specified search filter
* items
@@ -19,8 +37,15 @@ function filterToQIDOURL(server, filter) {
AccessionNumber: filter.accessionNumber,
StudyDescription: filter.studyDescription,
limit: filter.limit || 20,
- includefield: server.qidoSupportsIncludeField ? 'all' : commaSeparatedFields
+ includefield: server.qidoSupportsIncludeField ? commaSeparatedFields : 'all'
};
+
+ // build the StudyDate range parameter
+ if (filter.studyDateFrom || filter.sutydDateTo) {
+ var date = "".concat(dateToString(new Date(filter.studyDateFrom)), "-", dateToString(new Date(filter.studyDateTo)));
+ parameters.StudyDate = date;
+ }
+
return server.qidoRoot + '/studies?' + encodeQueryData(parameters);
}
@@ -33,6 +58,10 @@ function filterToQIDOURL(server, filter) {
function resultDataToStudies(resultData) {
var studies = [];
+ if (!resultData || !resultData.length) {
+ return;
+ }
+
resultData.forEach(function(study) {
studies.push({
studyInstanceUid: DICOMWeb.getString(study['0020000D']),
@@ -55,6 +84,7 @@ function resultDataToStudies(resultData) {
modalities: DICOMWeb.getString(DICOMWeb.getModalities(study['00080060'], study['00080061']))
});
});
+
return studies;
}