Updates for Timepoint assocation (LT-60) and Conformance Checks (LT-92, LT-93, LT-94)

This commit is contained in:
Erik Ziegler committed 2016-02-08 19:59:39 +01:00
1 parent 6c4eae3699
commit beaa56c0b3
144 files changed
+5050 -2416

No files matched your search

@@ -0,0 +1,54 @@
<template name="worklistResult">
<table id="tblStudyList" class="table table-striped noselect">
<thead>
<tr>
<th>
<h5>Patient Name</h5>
<input type="text" class="form-control worklist-search" id="patientName">
</th>
<th>
<h5>Patient ID</h5>
<input type="text" class="form-control worklist-search" id="patientId">
</th>
{{#unless isTouchDevice}}
<th>
<h5>Accession #</h5>
<input type="text" class="form-control worklist-search" id="accessionNumber">
</th>
{{/unless}}
<th>
<h5>Study Date</h5>
<input type="text" class="form-control worklist-search" id="studyDate">
</th>
{{#unless isTouchDevice}}
<th>
<h5>Modality</h5>
<input type="text" class="form-control worklist-search" id="modality">
</th>
{{/unless}}
<th>
<h5>Study Description</h5>
<input type="text" class="form-control worklist-search" id="studyDescription">
</th>
{{#unless isTouchDevice}}
<th>
<h5># Images</h5>
<input type="text" class="form-control worklist-search" id="numImages">
</th>
{{/unless}}
</tr>
</thead>
<tbody id="studyListData">
{{#each studies}}
{{ >worklistStudy }}
{{/each}}
</tbody>
</table>
{{ #unless studies.count }}
{{ >loadingText }}
{{ /unless }}
</template>
@@ -0,0 +1,128 @@
Template.worklistResult.helpers({
/**
* Returns a sorted instance of the WorklistStudies Collection
* by Patient name and Study Date in Ascending order.
*/
studies: function() {
return WorklistStudies.find({}, {
sort: {
patientName: 1,
studyDate: 1
}
});
}
});
// Retrieve all studies
search();
var studyDateFrom;
var studyDateTo;
var checkFrom = false;
var checkTo = false;
var filter;
/**
* 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 WorklistStudies Collection
*/
function search() {
// 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())
};
// 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({});
Meteor.call('WorklistSearch', filter, function(error, studies) {
if (error) {
log.warn(error);
return;
}
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 WorklistStudies Collection
WorklistStudies.insert(study);
}
});
});
}
Template.worklistResult.events({
'keydown input': function(e) {
if (e.which === 13) { // Enter
search();
}
},
'onsearch input': function() {
search();
}
});
@@ -0,0 +1,37 @@
table#tblStudyList
color: #888888
border-collapse: collapse
border-color: gray
thead
background-color: black
white-space: nowrap
&:hover
color: #888888
// TODO: Use padding instead of hidden inputs to keep titles
// at the same height in the header.
#numImages.worklist-search, #modality.worklist-search
visibility: hidden
tbody
tr
padding: 4px
border: 1px solid #282828
background-color: black
&:hover, &:active, &.active
background-color: #009BD2
color: white
td
// This selector is necessary to override bootstrap's 'table' class
color: white
background-color: #009BD2
&:nth-of-type(odd)
background-color: #202020
td
white-space: nowrap