- Return modalities attribute by merging modality and modalitiesInStudy attributes to be able to filter if only modality tag exists

- Remove modality tag in filter object and filter modalities of studies returned from WorklistSearch method
This commit is contained in:
Aysel Afsar committed 2016-03-16 21:23:48 -04:00
1 parent a5d4c6d0eb
commit a2c0dbefc3
5 files changed
+49 -8

No files matched your search

@@ -71,6 +71,20 @@ function isIndexOf(mainVal, searchVal) {
return false;
}
/**
* Replace object if undefined
*/
function replaceUndefinedColumnValue(text) {
if (text === undefined || text === 'undefined') {
return '';
} else {
return text.toUpperCase();
}
}
/**
/**
* Convert string to study date
*/
@@ -98,10 +112,13 @@ function search() {
patientName: getFilter($('input#patientName').val()),
patientId: getFilter($('input#patientId').val()),
accessionNumber: getFilter($('input#accessionNumber').val()),
studyDescription: getFilter($('input#studyDescription').val()),
modality: getFilter($('input#modality').val())
studyDescription: getFilter($('input#studyDescription').val())
};
// Make sure that modality has a reasonable value, since it is occasionally
// returned as 'undefined'
var modality = replaceUndefinedColumnValue($('input#modality').val());
// Clear all current studies
WorklistStudies.remove({});
@@ -121,9 +138,9 @@ function search() {
// Loop through all identified studies
studies.forEach(function(study) {
// Search the rest of the parameters that aren't done via the server call
if ((new Date(studyDateFrom).setHours(0, 0, 0, 0) <= convertStringToStudyDate(study.studyDate) || !studyDateFrom || studyDateFrom === "") &&
if (isIndexOf(study.modalities, modality) &&
(new Date(studyDateFrom).setHours(0, 0, 0, 0) <= convertStringToStudyDate(study.studyDate) || !studyDateFrom || studyDateFrom === "") &&
(convertStringToStudyDate(study.studyDate) <= new Date(studyDateTo).setHours(0, 0, 0, 0) || !studyDateTo || studyDateTo === "")) {
// Convert numberOfStudyRelatedInstance string into integer