Merged LesionTracker and OHIF Viewer, refactored out common components

This commit is contained in:
Erik Ziegler committed 2015-10-13 14:14:50 +02:00
1 parent 34adbe3fbc
commit b774c22593
144 files changed
+27820

No files matched your search

@@ -0,0 +1,88 @@
<template name="worklistSearch">
<!--Search Panel-->
<div class="panel panel-default">
<div class="panel-heading" id="search-panel-head">Search</div>
<div class="panel-body">
<div style="padding: 10px;">
<div class="row">
<div class="col-lg-8 col-md-8 col-xs-12">
<div class="row">
<div class="col-lg-3 col-md-3 col-xs-10">
<div class="form-group">
<label for="patientId">Patient ID</label>
<input type="text" class="form-control" id="patientId" placeholder="Patient ID">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-10">
<div class="form-group">
<label for="patientName">Name</label>
<input type="text" class="form-control" id="patientName" placeholder="Name">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-10">
<div class="form-group">
<label for="patientAccessionNumber">Accession #</label>
<input type="text" class="form-control" id="patientAccessionNumber" placeholder="Accession #">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-10">
<div class="form-group">
<label for="studyDescription">Study Description</label>
<input type="text" class="form-control" id="studyDescription" placeholder="Study Description">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3 col-md-3 col-xs-10">
<!--Add calendar ui-->
<div class="form-group">
<label for="">Study Date(from)</label>
<p><input type="checkbox" id="checkFrom"><input id="studyDateFrom" type="date" class="form-control" style="padding-left: 30px;"></p>
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-10">
<div class="form-group">
<label for="">Study Date(to)</label>
<p><input type="checkbox" id="checkTo"><input id="studyDateTo" type="date" class="form-control" style="padding-left:30px;"></p>
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-10">
<div class="form-group">
<label for="referringPhysician">Referring Physician</label>
<input type="text" class="form-control" id="referringPhysician" placeholder="Referring Physician">
</div>
</div>
<div class="col-lg-3 col-md-3 col-xs-10">
<div class="form-group">
<label for="modality">Modality</label>
<input type="text" class="form-control" id="modality" placeholder="Modality">
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-xs-12">
<div class="row" style="margin-top: 25px;margin-bottom: 25px;">
<div class="col-lg-4 col-md-6 col-xs-6">
<button class="btn btn-primary" id="btnSearch">Search</button>
</div>
<div class="col-lg-4 col-md-6 col-xs-6">
<button class="btn btn-primary" id="btnToday">Today</button>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 col-xs-6">
<button class="btn btn-primary" id="btnClear">Clear</button>
</div>
<div class="col-lg-4 col-md-6 col-xs-6">
<button class="btn btn-primary" id="btnLastSevenDays">Last 7 Days</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Search panel ends-->
</template>
@@ -0,0 +1,124 @@
//Get all studies
search();
var studyDateFrom;
var studyDateTo;
var checkFrom = false;
var checkTo = false;
function getFilter(filter) {
if(filter && filter.length && filter.substr(filter.length - 1) !== '*') {
filter += '*';
}
return filter;
}
//Search value
function isIndexOf(mainVal, searchVal) {
if(mainVal === undefined || mainVal === '' || mainVal.indexOf(searchVal) > -1){
return true;
}
return false;
}
//Replace object is 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;
var date_ = new Date(newDateStr);
return date_;
}
function search() {
var filter = {
patientName: getFilter($('#patientName').val()),
patientId: getFilter($('#patientId').val()),
accessionNumber: getFilter($('#patientAccessionNumber').val())
};
var modality = replaceUndefinedColumnValue($('#modality').val());
Studies.remove({});
Meteor.call('WorklistSearch', filter, function(error, studies) {
if (studies) {
studies.forEach(function(study) {
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)) {
Studies.insert(study);
}
});
}
});
}
Template.worklistSearch.events({
//Search
'click button#btnSearch' :function(event) {
studyDateFrom = $('#studyDateFrom').val();
studyDateTo = $('#studyDateTo').val();
checkFrom = $('#checkFrom').is(':checked');
checkTo = $('#checkTo').is(':checked');
search();
return false;
},
//Today
'click button#btnToday' :function(event) {
studyDateTo = new Date();
studyDateFrom = studyDateTo;
checkFrom = true;
checkTo = true;
search();
return false;
},
//Clear
'click button#btnClear' :function(event) {
$("#patientId").val("");
$("#patientName").val("");
$("#patientAccessionNumber").val("");
$("#studyDescription").val("");
$("#referringPhysician").val("");
$("#studyDateFrom").val("");
$("#studyDateTo").val("");
$("#modality").val("");
$('#checkFrom').prop('checked', false);
$('#checkTo').prop('checked', false);
},
//Last 7 Days
'click button#btnLastSevenDays' :function(event) {
studyDateTo = new Date();
studyDateFrom = new Date();
studyDateFrom.setDate(studyDateFrom.getDate()-7);
checkFrom = true;
checkTo = true;
search();
return false;
}
});
@@ -0,0 +1,35 @@
/***********************************************/
/* Search Panel */
/***********************************************/
#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;
}
/***********************************************/
/* Tabs */
/***********************************************/
.tab-pane{
position:absolute;
width: 100%;
height:100%;
}
.nav > li > a {
padding: 10px 5px;
}