nonTarget tool is added

This commit is contained in:
Evren Ozkan committed 2015-11-09 08:08:50 -05:00
1 parent 02a5b2fc53
commit db21685473
16 files changed
+814 -20

No files matched your search

@@ -0,0 +1,32 @@
#nonTargetLesionLocationDialog {
background: transparent;
}
#modal-dialog-container-nonTargetLesion {
position: absolute;
border: none;
}
#btnCloseNonTargetLesionPopup {
outline: 0;
border: none;
background-color: transparent;
}
#selectNonTargetLesionLocation, #selectNonTargetLesionLocationResponse {
width: 80%;
}
.dialogContent, .lesionLocation, .locationResponse {
margin-bottom: 20px;
}
.elementContainer {
width: 100%;
margin: 0 auto;
float: none;
}
.locationOK {
text-align: center;
}
@@ -0,0 +1,40 @@
<template name="nonTargetLesionDialog">
<div class="modal fade" id="nonTargetLesionLocationDialog">
<div id="modal-dialog-container-nonTargetLesion" class="modal-dialog modal-sm">
<div class="modal-content" style="padding: 10px;">
<div class="dialogHeader">
<div style="float:left;"><h4>Select Lesion Location</h4></div>
<div style="float:right;"><button class="btn" id="btnCloseNonTargetLesionPopup"><i class="fa fa-close"></i></button></div>
</div>
<div class="dialogContent">
<div class="lesionLocation">
<div class="elementContainer">
<label>Lesion Location</label>
</div>
<div class="elementContainer">
<select id="selectNonTargetLesionLocation">
<option value="-1"></option>
</select>
</div>
</div>
<div class="locationResponse">
<div class="elementContainer">
<label>Response</label>
</div>
<div class="elementContainer">
<select id="selectNonTargetLesionLocationResponse">
<option value="-1"></option>
</select>
</div>
</div>
<div class="locationOK">
<button class="btn" id="nonTargetLesionOK">OK</button>
</div>
</div>
</div>
</div>
</div>
</template>
@@ -0,0 +1,133 @@
//fill selectLesionLocation element
var lesionLocationsArray = [{
location: "Brain Brainstem",
hasDescription: false,
description: ""
}, {
location: "Brain Cerebellum Left",
hasDescription: false,
description: ""
}, {
location: "Brain Cerebrum Left",
hasDescription: false,
description: ""
}, {
location: "Brain Cerebrum Right",
hasDescription: false,
description: ""
}, {
location: "Brain Multiple Sites",
hasDescription: false,
description: ""
}];
var lesionLocationsResponseArray = [
{
text: "Complete response",
code: "CR",
description: ""
},
{
text: "Progressive disease",
code: "PD",
description: ""
},
{
text: "Stable disease",
code: "SD",
description: ""
},
{
text: "Non-measurable",
code: "NM",
description: ""
},
{
text: "Unknown",
code: "UN",
description: ""
},
{
text: "Not Evaluable",
code: "NE",
description: ""
},
{
text: "Non-CR/Non-PD",
code: "NN",
description: ""
},
{
text: "Excluded",
code: "EX",
description: ""
}
];
Template.nonTargetLesionDialog.onRendered(function() {
function fillSelectLesionLocation() {
var el = $("#selectNonTargetLesionLocation");
el.find('option:not(:first)').remove();
$.each(lesionLocationsArray, function(key, value) {
el.append("<option value='" + key + "'>" + value.location + "</option>");
});
}
function fillResponses() {
var el = $("#selectNonTargetLesionLocationResponse");
el.find('option:not(:first)').remove();
$.each(lesionLocationsResponseArray, function(key, value) {
el.append("<option value='" + value.code + "'>" + value.code +" - "+value.text + "</option>");
});
}
// Fill dropdown
fillSelectLesionLocation();
// Fill location responses
fillResponses();
});
Template.nonTargetLesionDialog.events({
'click button#btnCloseNonTargetLesionPopup': function(e) {
$("#nonTargetLesionLocationDialog").modal("hide");
},
'click button#nonTargetLesionOK': function() {
// Set activeModule parameters in index.html
$("#nonTargetLesionLocationDialog").modal("hide");
var lesionData = Session.get("nonTargetLesionData");
// Get selected location data
var selectedLocationIndex = $("#selectNonTargetLesionLocation").val();
if (selectedLocationIndex < 0) {
return;
}
// Get selected location data
var locationObj = lesionLocationsArray[selectedLocationIndex];
lesionData.location = $("#selectNonTargetLesionLocation :selected").text();
lesionData.measurementText = $("#selectNonTargetLesionLocationResponse").val();
// Select first option
$("#selectNonTargetLesionLocation").val($("#selectNonTargetLesionLocation option:first").val());
$("#selectNonTargetLesionLocationResponse").val($("#selectNonTargetLesionLocationResponse option:first").val());
if (typeof lesionData.locationUID !== 'undefined') {
measurementManagerDAL.updateTimepointData(lesionData);
return;
}
// Adds location data to trialPatientLocations array and returns locationUID
var locationUID = measurementManagerDAL.addNewLocation(locationObj);
// Linkk locationUID with activeLesionMeasurementData
lesionData.locationUID = locationUID;
measurementManagerDAL.addLesionData(lesionData);
}
});