diff --git a/Packages/worklist/components/worklist.styl b/Packages/worklist/components/worklist.styl index c3312062a..58f1ca69d 100644 --- a/Packages/worklist/components/worklist.styl +++ b/Packages/worklist/components/worklist.styl @@ -13,8 +13,6 @@ input.worklist-search height: 25px background-color: #888888 -// style="background-color: #444444; border-color:#444444;cursor:default;"> - #tblStudyList tr height: 45px diff --git a/Packages/worklist/components/worklistResult/worklistResult.html b/Packages/worklist/components/worklistResult/worklistResult.html index aa9c4631b..65de4d6bb 100644 --- a/Packages/worklist/components/worklistResult/worklistResult.html +++ b/Packages/worklist/components/worklistResult/worklistResult.html @@ -1,5 +1,4 @@ \ No newline at end of file diff --git a/Packages/worklist/components/worklistResult/worklistResult.js b/Packages/worklist/components/worklistResult/worklistResult.js index e0a2846b8..e64e12114 100644 --- a/Packages/worklist/components/worklistResult/worklistResult.js +++ b/Packages/worklist/components/worklistResult/worklistResult.js @@ -19,6 +19,7 @@ var studyDateFrom; var studyDateTo; var checkFrom = false; var checkTo = false; +var filter; /** * Transforms an input string into a search filter for @@ -72,7 +73,7 @@ function convertStringToStudyDate (dateStr) { */ function search() { // Create the filters to be used for the Worklist Search - var filter = { + filter = { patientName: getFilter($('#patientName').val()), patientId: getFilter($('#patientId').val()), accessionNumber: getFilter($('#patientAccessionNumber').val()) @@ -103,7 +104,6 @@ function search() { } }); }); - } Template.worklistResult.events({ @@ -112,5 +112,6 @@ Template.worklistResult.events({ }, 'onsearch': function(event) { search(); + } }); \ No newline at end of file diff --git a/Packages/worklist/components/worklistSearch/worklistSearch.html b/Packages/worklist/components/worklistSearch/worklistSearch.html deleted file mode 100644 index 6fac78fe0..000000000 --- a/Packages/worklist/components/worklistSearch/worklistSearch.html +++ /dev/null @@ -1,94 +0,0 @@ - \ No newline at end of file diff --git a/Packages/worklist/components/worklistSearch/worklistSearch.js b/Packages/worklist/components/worklistSearch/worklistSearch.js deleted file mode 100644 index 35531efae..000000000 --- a/Packages/worklist/components/worklistSearch/worklistSearch.js +++ /dev/null @@ -1,136 +0,0 @@ -// Retrieve all studies -search(); - -var studyDateFrom; -var studyDateTo; -var checkFrom = false; -var checkTo = false; - -/** - * Transforms an input string into a search filter for - * the Worklist Search call - * - * @param filter The input string to be searched for - * @returns {*} - */ -function getFilter(filter) { - if(filter && filter.length && filter.substr(filter.length - 1) !== '*') { - filter += '*'; - } - return filter; -} - -/** - * Search for a value in a string - */ -function isIndexOf(mainVal, searchVal) { - if (mainVal === undefined || mainVal === '' || mainVal.indexOf(searchVal) > -1){ - return true; - } - return false; -} - -/** - * Replace object if undefined - */ -function replaceUndefinedColumnValue (text) { - if (text == undefined || text === "undefined") { - return ""; - } else { - return 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 = y+"/"+m+"/"+d; - return new Date(newDateStr); -} - -/** - * Runs a search for studies matching the worklist query parameters - * Inserts the identified studies into the Studies Collection - */ -function search() { - // Create the filters to be used for the Worklist Search - var filter = { - patientName: getFilter($('#patientName').val()), - patientId: getFilter($('#patientId').val()), - accessionNumber: getFilter($('#patientAccessionNumber').val()) - }; - - // Make sure that modality has a reasonable value, since it is occasionally - // returned as 'undefined' - var modality = replaceUndefinedColumnValue($('#modality').val()); - - // Clear all current studies - WorklistStudies.remove({}); - - Meteor.call('WorklistSearch', filter, function(error, studies) { - if (!studies) { - return; - } - - // Loop through all identified studies - studies.forEach(function(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) || !checkFrom) && - (convertStringToStudyDate(study.studyDate) <= new Date(studyDateTo).setHours(0,0,0,0) || !checkTo)) { - - // Insert any matching studies into the Studies Collection - WorklistStudies.insert(study); - } - }); - }); - -} - -Template.worklistSearch.events({ - /** - * Searches for studies given the current state of the form controls - */ - 'click button#btnSearch' :function(event) { - studyDateFrom = $('#studyDateFrom').val(); - studyDateTo = $('#studyDateTo').val(); - checkFrom = $('#checkFrom').is(':checked'); - checkTo = $('#checkTo').is(':checked'); - search(); - }, - /** - * Searches for studies with a study date equal to Today - */ - 'click button#btnToday' :function(event) { - studyDateTo = new Date(); - studyDateFrom = studyDateTo; - checkFrom = true; - checkTo = true; - search(); - }, - - /** - * Searches for studies in the Last 7 Days - */ - 'click button#btnLastSevenDays' :function() { - studyDateTo = new Date(); - studyDateFrom = new Date(); - studyDateFrom.setDate(studyDateFrom.getDate()-7); - checkFrom = true; - checkTo = true; - search(); - }, - /** - * Clears all input data in the study search panel - */ - 'click button#btnClear' :function(event) { - $("#searchPanel .form-control").val(""); - $('#checkFrom').prop('checked', false); - $('#checkTo').prop('checked', false); - } -}); \ No newline at end of file diff --git a/Packages/worklist/components/worklistSearch/worklistSearch.styl b/Packages/worklist/components/worklistSearch/worklistSearch.styl deleted file mode 100644 index 4dd58b4cd..000000000 --- a/Packages/worklist/components/worklistSearch/worklistSearch.styl +++ /dev/null @@ -1,25 +0,0 @@ -/***********************************************/ -/* Search Panel */ -/***********************************************/ -#worklistSearchPanel - margin: 20px 0 - color: #888888 - background-color: #202020 - -#search-panel-head - background-color: #337ab7 - color: white - font-weight: 500 - font-size: 20px - line-height: 20px - box-shadow: 2px 2px 2px #888888 - -#btnSearch, #btnToday, #btnClear, #btnLastSevenDays - width: 100% - -#checkFrom, #checkTo - width: 20px - height: 20px - position: absolute - left: 20px - bottom: 22px \ No newline at end of file