Fixed bug LT-85 (Location Response Selections). Work on LT-9 and LT-12
This commit is contained in:
1 parent
28cee350ff
commit
220ff065dc
44 files changed
+1515
-824
No files matched your search
@@ -0,0 +1,8 @@
|
||||
<template name="confirmDeleteDialog">
|
||||
<div id="confirmDeleteDialog">
|
||||
<h5>Remove Measurement?</h5>
|
||||
<p>Are you sure you would like to remove this measurement?</p>
|
||||
<button id="cancel" class="btn btn-link">Cancel</button>
|
||||
<button id="confirm" class="btn btn-primary">OK</button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,51 @@
|
||||
function closeHandler() {
|
||||
// Hide the lesion dialog
|
||||
$("#confirmDeleteDialog").css('display', 'none');
|
||||
|
||||
// Remove the backdrop
|
||||
$(".removableBackdrop").remove();
|
||||
|
||||
// Remove the callback from the template data
|
||||
delete Template.confirmDeleteDialog.doneCallback;
|
||||
}
|
||||
|
||||
showConfirmDialog = function(doneCallback) {
|
||||
// Show the backdrop
|
||||
UI.render(Template.removableBackdrop, document.body);
|
||||
|
||||
// Make sure the context menu is closed when the user clicks away
|
||||
$(".removableBackdrop").one('mousedown touchstart', function() {
|
||||
closeHandler();
|
||||
});
|
||||
|
||||
$("#confirmDeleteDialog").css('display', 'block');
|
||||
|
||||
if (doneCallback && typeof doneCallback === 'function') {
|
||||
Template.confirmDeleteDialog.doneCallback = doneCallback;
|
||||
}
|
||||
};
|
||||
|
||||
Template.confirmDeleteDialog.events({
|
||||
'click #cancel, click #close': function() {
|
||||
closeHandler();
|
||||
},
|
||||
'click #confirm': function() {
|
||||
var doneCallback = Template.confirmDeleteDialog.doneCallback;
|
||||
|
||||
if (doneCallback && typeof doneCallback === 'function') {
|
||||
doneCallback();
|
||||
}
|
||||
|
||||
closeHandler();
|
||||
},
|
||||
'keypress #confirmDeleteDialog': function(e) {
|
||||
if (this.keyPressAllowed === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If Enter is pressed, close the dialog
|
||||
if (e.which === 13) {
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
#confirmDeleteDialog
|
||||
display: none
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
right: 0
|
||||
z-index: 100
|
||||
width: 300px
|
||||
height: fit-content
|
||||
margin: auto
|
||||
border-radius: 5px
|
||||
padding: 10px 20px 10px 20px
|
||||
background-color: rgba(255,255,255,1)
|
||||
|
||||
.btn
|
||||
outline: none
|
||||
text-decoration: none
|
||||
|
||||
#cancel
|
||||
float: left
|
||||
|
||||
#confirm
|
||||
float: right
|
||||
+25
-17
@@ -23,7 +23,7 @@ function setLesionNumberCallback(measurementData, eventData, doneCallback) {
|
||||
|
||||
// Get a lesion number for this lesion, depending on whether or not the same lesion previously
|
||||
// exists at a different timepoint
|
||||
var lesionNumber = measurementManagerDAL.getNewLesionNumber(measurementData.timepointID, isTarget=true);
|
||||
var lesionNumber = LesionManager.getNewLesionNumber(measurementData.timepointID, isTarget=true);
|
||||
measurementData.lesionNumber = lesionNumber;
|
||||
|
||||
// Set lesion number
|
||||
@@ -57,13 +57,13 @@ function getLesionLocationCallback(measurementData, eventData) {
|
||||
|
||||
// Find out if this lesion number is already added in the lesion manager for another timepoint
|
||||
// If it is, stop here because we don't need the dialog.
|
||||
var locationUID = measurementManagerDAL.lesionNumberExists(measurementData);
|
||||
var locationUID = LesionManager.lesionNumberExists(measurementData);
|
||||
if (locationUID) {
|
||||
// Add an ID value to the tool data to link it to the Measurements collection
|
||||
measurementData.id = 'notready';
|
||||
|
||||
measurementData.locationUID = locationUID;
|
||||
measurementManagerDAL.updateTimepointData(measurementData);
|
||||
LesionManager.updateLesionData(measurementData);
|
||||
closeHandler();
|
||||
return;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ function getLesionLocationCallback(measurementData, eventData) {
|
||||
dialog.css(dialogProperty);
|
||||
}
|
||||
|
||||
function changeLesionLocationCallback(measurementData, eventData, doneCallback) {
|
||||
changeLesionLocationCallback = function(measurementData, eventData, doneCallback) {
|
||||
Template.lesionLocationDialog.measurementData = measurementData;
|
||||
Template.lesionLocationDialog.doneCallback = doneCallback;
|
||||
|
||||
@@ -107,21 +107,22 @@ function changeLesionLocationCallback(measurementData, eventData, doneCallback)
|
||||
});
|
||||
|
||||
// Show the lesion location dialog above
|
||||
var dialogProperty = {
|
||||
top: eventData.currentPoints.page.y - dialog.outerHeight() - 40,
|
||||
left: eventData.currentPoints.page.x - dialog.outerWidth() / 2,
|
||||
var dialogProperty = {
|
||||
display: 'block'
|
||||
};
|
||||
|
||||
// Device is touch device or not
|
||||
// If device is touch device, set position center of screen vertically and horizontally
|
||||
if (isTouchDevice()) {
|
||||
if (!eventData || isTouchDevice()) {
|
||||
// add dialogMobile class to provide a black,transparent background
|
||||
dialog.addClass("dialogMobile");
|
||||
dialogProperty.top = 0;
|
||||
dialogProperty.left = 0;
|
||||
dialogProperty.right = 0;
|
||||
dialogProperty.bottom = 0;
|
||||
} else {
|
||||
dialogProperty.top = eventData.currentPoints.page.y - dialog.outerHeight() - 40;
|
||||
dialogProperty.left = eventData.currentPoints.page.x - dialog.outerWidth() / 2;
|
||||
}
|
||||
|
||||
dialog.css(dialogProperty);
|
||||
@@ -131,20 +132,24 @@ function changeLesionLocationCallback(measurementData, eventData, doneCallback)
|
||||
return;
|
||||
}
|
||||
|
||||
LesionLocations.update({},
|
||||
{$set: {selected: false}},
|
||||
{ multi: true });
|
||||
|
||||
var currentLocation = LesionLocations.findOne({
|
||||
id: measurement.locationId
|
||||
});
|
||||
|
||||
LesionLocations.update({},
|
||||
{$set: {selected: false}},
|
||||
{ multi: true });
|
||||
if (!currentLocation) {
|
||||
return;
|
||||
}
|
||||
|
||||
LesionLocations.update(currentLocation._id, {
|
||||
$set: {
|
||||
selected: true
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var config = {
|
||||
setLesionNumberCallback: setLesionNumberCallback,
|
||||
@@ -189,6 +194,7 @@ Template.lesionLocationDialog.events({
|
||||
measurementData.id = 'notready';
|
||||
|
||||
// Link locationUID with active lesion measurementData
|
||||
measurementData.location = locationObj.location;
|
||||
measurementData.locationId = locationObj.id;
|
||||
measurementData.locationUID = id;
|
||||
|
||||
@@ -196,7 +202,7 @@ Template.lesionLocationDialog.events({
|
||||
measurementData.isTarget = true;
|
||||
|
||||
// Adds lesion data to timepoints array
|
||||
measurementManagerDAL.addLesionData(measurementData);
|
||||
LesionManager.updateLesionData(measurementData);
|
||||
} else {
|
||||
Measurements.update(measurementData.id, {
|
||||
$set: {
|
||||
@@ -219,10 +225,12 @@ Template.lesionLocationDialog.events({
|
||||
var doneCallback = Template.lesionLocationDialog.doneCallback;
|
||||
var dialog = Template.lesionLocationDialog.dialog;
|
||||
|
||||
if (doneCallback && typeof doneCallback === 'function') {
|
||||
var deleteTool = true;
|
||||
doneCallback(measurementData, deleteTool);
|
||||
}
|
||||
showConfirmDialog(function() {
|
||||
if (doneCallback && typeof doneCallback === 'function') {
|
||||
var deleteTool = true;
|
||||
doneCallback(measurementData, deleteTool);
|
||||
}
|
||||
});
|
||||
|
||||
closeHandler(dialog);
|
||||
},
|
||||
|
||||
+1
@@ -7,6 +7,7 @@
|
||||
right: 0
|
||||
z-index: 100
|
||||
width: 300px
|
||||
margin: auto
|
||||
border-radius: 5px
|
||||
padding: 10px 20px 10px 20px
|
||||
background-color: rgba(255,255,255,1)
|
||||
|
||||
@@ -1,221 +1,17 @@
|
||||
/**
|
||||
* Activates a set of lesions when lesion table row is clicked
|
||||
*
|
||||
* @param measurementId The unique key for a specific Measurement
|
||||
*/
|
||||
activateLesion = function(measurementId, templateData) {
|
||||
|
||||
// Set background color of selected row
|
||||
$("tr[data-measurementid="+measurementId+"]").addClass("selectedRow").siblings().removeClass("selectedRow");
|
||||
|
||||
var measurementData = Measurements.findOne(measurementId);
|
||||
|
||||
// If there is no measurement with this ID, stop here
|
||||
if (!measurementData) {
|
||||
log.warn('No Measurements entry associated to an ID in a lesion table row');
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the timepoint data from this Measurement
|
||||
var timepoints = measurementData.timepoints;
|
||||
|
||||
// Get all non-dummy timepoint entries in the Measurement
|
||||
// TODO=Re-evaluate this approach to populating viewports with timepoints
|
||||
// What is the desired behaviour here?
|
||||
var timepointsWithEntries = [];
|
||||
Object.keys(timepoints).forEach(function(key) {
|
||||
var timepoint = timepoints[key];
|
||||
|
||||
if (timepoint.imageId === "" ||
|
||||
timepoint.studyInstanceUid === "" ||
|
||||
timepoint.seriesInstanceUid === "") {
|
||||
return;
|
||||
}
|
||||
|
||||
timepointsWithEntries.push(timepoint);
|
||||
});
|
||||
|
||||
// If there are no non-dummy timepoint entries, stop here
|
||||
if (!timepointsWithEntries.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Loop through the viewports and display each timepoint
|
||||
$(".imageViewerViewport").each(function(viewportIndex, element) {
|
||||
// Stop if we run out of timepoints before viewports
|
||||
if (viewportIndex >= timepointsWithEntries.length) {
|
||||
// Update the element anyway, to remove any other highlights that are present
|
||||
deactivateAllToolData(element, 'lesion');
|
||||
deactivateAllToolData(element, 'nonTarget');
|
||||
cornerstone.updateImage(element);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Find measurements related to the Nth timepoint
|
||||
// TODO=Re-evaluate this approach to populating viewports with timepoints
|
||||
// What is the desired behaviour here?
|
||||
var measurementAtTimepoint = timepointsWithEntries[viewportIndex];
|
||||
|
||||
// Find the image that is currently in this viewport
|
||||
var enabledElement = cornerstone.getEnabledElement(element);
|
||||
if (!enabledElement || !enabledElement.image) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If there is no measurement data to display, stop here
|
||||
if (!measurementAtTimepoint) {
|
||||
// Update the element anyway, to remove any other highlights that are present
|
||||
deactivateAllToolData(element, 'lesion');
|
||||
deactivateAllToolData(element, 'nonTarget');
|
||||
cornerstone.updateImage(element);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check which study and series are required to display the measurement at this timepoint
|
||||
var requiredSeriesData = {
|
||||
seriesInstanceUid: measurementAtTimepoint.seriesInstanceUid,
|
||||
studyInstanceUid: measurementAtTimepoint.studyInstanceUid
|
||||
};
|
||||
|
||||
// Check if the study / series we need is already the one in the viewport
|
||||
var currentSeriesData = OHIF.viewer.loadedSeriesData[viewportIndex];
|
||||
if (currentSeriesData.seriesInstanceUid === measurementAtTimepoint.seriesInstanceUid &&
|
||||
currentSeriesData.studyInstanceUid === measurementAtTimepoint.studyInstanceUid) {
|
||||
// If it is, activate the measurements in this viewport and stop here
|
||||
activateMeasurements(element, measurementId, templateData, viewportIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, re-render the viewport with the required study/series, then
|
||||
// add an onRendered callback to activate the measurements
|
||||
rerenderViewportWithNewSeries(element, requiredSeriesData, function(element) {
|
||||
activateMeasurements(element, measurementId, templateData, viewportIndex);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns timepoint object based on timepoint id of the enabled element
|
||||
*
|
||||
* @param timepoints
|
||||
* @param enabledElement
|
||||
* @returns {*|{}} Timepoint object based on timepoint id of the enabled element (or an empty Object)
|
||||
*/
|
||||
function getTimepointObject(imageId) {
|
||||
var study = cornerstoneTools.metaData.get('study', imageId);
|
||||
return Timepoints.findOne({timepointName: study.studyDate});
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch to the image of the correct image index
|
||||
* Activate the selected measurement on the switched image (color to be green)
|
||||
* Deactivate all other measurements on the switched image (color to be white)
|
||||
*/
|
||||
function activateMeasurements(element, measurementId, templateData, viewportIndex) {
|
||||
// TODO=Switch this to use the new CornerstoneToolMeasurementModified event,
|
||||
// Once it has 'modified on activation' set up
|
||||
|
||||
var enabledElement = cornerstone.getEnabledElement(element);
|
||||
var imageId = enabledElement.image.imageId;
|
||||
var timepointData = getTimepointObject(imageId);
|
||||
var measurementData = Measurements.findOne(measurementId);
|
||||
|
||||
var measurementAtTimepoint = measurementData.timepoints[timepointData.timepointID];
|
||||
if (!measurementAtTimepoint) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If type is active, load image and activate lesion
|
||||
// If type is inactive, update lesions of enabledElement as inactive
|
||||
//TODO: !stackData.currentImageIdIndex returns incorrect value
|
||||
// Get loadedSeriesData currentImageIdIndex from ViewerData
|
||||
var contentId = templateData.contentId;
|
||||
var viewerData = ViewerData[contentId];
|
||||
var elementCurrentImageIdIndex = viewerData.loadedSeriesData[viewportIndex].currentImageIdIndex;
|
||||
|
||||
var stackToolDataSource = cornerstoneTools.getToolState(element, 'stack');
|
||||
var stackData = stackToolDataSource.data[0];
|
||||
var imageIds = stackData.imageIds;
|
||||
var imageIdIndex = imageIds.indexOf(measurementAtTimepoint.imageId);
|
||||
|
||||
if (imageIdIndex < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (imageIdIndex === elementCurrentImageIdIndex){
|
||||
activateTool(element, measurementData, timepointData.timepointID);
|
||||
} else {
|
||||
cornerstone.loadAndCacheImage(imageIds[imageIdIndex]).then(function(image) {
|
||||
cornerstone.displayImage(element, image);
|
||||
activateTool(element, measurementData, timepointData.timepointID);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Activates a specific tool data instance and deactivates all other
|
||||
* target and non-target measurement data
|
||||
*
|
||||
* @param element
|
||||
* @param measurementData
|
||||
* @param timepointID
|
||||
*/
|
||||
function activateTool(element, measurementData, timepointID) {
|
||||
deactivateAllToolData(element, 'lesion');
|
||||
deactivateAllToolData(element, 'nonTarget');
|
||||
|
||||
var toolType = measurementData.isTarget ? 'lesion' : 'nonTarget';
|
||||
var toolData = cornerstoneTools.getToolState(element, toolType);
|
||||
if (!toolData) {
|
||||
return;
|
||||
}
|
||||
|
||||
var measurementAtTimepoint = measurementData.timepoints[timepointID];
|
||||
|
||||
for (var i = 0; i < toolData.data.length; i++) {
|
||||
data = toolData.data[i];
|
||||
|
||||
// When click a row of table measurements, measurement will be active and color will be green
|
||||
// TODO= Remove this with the measurementId once it is in the tool data
|
||||
if (data.seriesInstanceUid === measurementAtTimepoint.seriesInstanceUid &&
|
||||
data.studyInstanceUid === measurementAtTimepoint.studyInstanceUid &&
|
||||
data.lesionNumber === measurementData.lesionNumber &&
|
||||
data.isTarget == measurementData.isTarget) {
|
||||
|
||||
data.active = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cornerstone.updateImage(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets all tool data entries value for 'active' to false
|
||||
* This is used to remove the active color on entire sets of tools
|
||||
*
|
||||
* @param element The Cornerstone element that is being used
|
||||
* @param toolType The tooltype of the tools that will be deactivated
|
||||
*/
|
||||
function deactivateAllToolData(element, toolType) {
|
||||
var toolData = cornerstoneTools.getToolState(element, toolType);
|
||||
if (!toolData) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < toolData.data.length; i++) {
|
||||
var data = toolData.data[i];
|
||||
data.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
Template.lesionTable.helpers({
|
||||
'measurement': function() {
|
||||
return Measurements.find({}, {sort: {number: 1}});
|
||||
return Measurements.find({}, {
|
||||
sort: {
|
||||
lesionNumber: 1
|
||||
}
|
||||
});
|
||||
},
|
||||
'timepoints': function() {
|
||||
return Timepoints.find({}, {sort: {timepointName: 1}});
|
||||
return Timepoints.find({}, {
|
||||
sort: {
|
||||
timepointName: 1
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -224,9 +20,8 @@ Template.lesionTable.events({
|
||||
// Retrieve the lesion id from the DOM data for this row
|
||||
var measurementId = $(e.currentTarget).data('measurementid');
|
||||
|
||||
activateLesion(measurementId,template.data);
|
||||
activateLesion(measurementId, template.data);
|
||||
},
|
||||
|
||||
'mousedown div#dragbar': function(e, template) {
|
||||
var pY = e.pageY;
|
||||
var draggableParent = $(e.currentTarget).parent();
|
||||
@@ -235,7 +30,6 @@ Template.lesionTable.events({
|
||||
|
||||
$(document).on('mouseup', function(e) {
|
||||
template.dragging.set(false);
|
||||
console.log(e.pageY);
|
||||
$(document).off('mouseup').off('mousemove');
|
||||
});
|
||||
|
||||
@@ -244,7 +38,7 @@ Template.lesionTable.events({
|
||||
var newHeight = startHeight - topPosition;
|
||||
|
||||
// Min lesion table height = 5px
|
||||
if(newHeight < 5) {
|
||||
if (newHeight < 5) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -256,76 +50,67 @@ Template.lesionTable.events({
|
||||
var viewportAndLesionTableHeight = $("#viewportAndLesionTable").height();
|
||||
var newPercentageHeightofLesionTable = (startHeight - topPosition) / viewportAndLesionTableHeight * 100;
|
||||
var newPercentageHeightofViewermain = 100 - newPercentageHeightofLesionTable;
|
||||
$(".viewerMain").height(newPercentageHeightofViewermain+"%");
|
||||
$(".viewerMain").height(newPercentageHeightofViewermain + "%");
|
||||
|
||||
// Resize viewport
|
||||
resizeViewportElements();
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Template.lesionTable.onCreated(function(){
|
||||
this.dragging = new ReactiveVar(false);
|
||||
// Bind document mouse events
|
||||
// $(document).on('mousemove', dragbarMove);
|
||||
Template.lesionTable.onCreated(function() {
|
||||
this.dragging = new ReactiveVar(false);
|
||||
});
|
||||
|
||||
Template.lesionTable.onDestroyed(function(){
|
||||
Template.lesionTable.onRendered(function() {
|
||||
var self = this;
|
||||
|
||||
});
|
||||
// Track ViewerData to get active timepoints
|
||||
// Put a visual indicator (<) in timepoint header in lesion table for active timepoints
|
||||
// timepointLoaded property is used to put indicator for loaded timepoints in viewport
|
||||
self.autorun(function() {
|
||||
// Get study dates of imageViewerViewport elements
|
||||
var loadedStudyDates = {
|
||||
patientId: "",
|
||||
dates: []
|
||||
};
|
||||
|
||||
// Track ViewerData to get active timepoints
|
||||
// Put a visual indicator(<) in timepoint header in lesion table for active timepoints
|
||||
// timepointLoaded property is used to put indicator for loaded timepoints in viewport
|
||||
Tracker.autorun(function () {
|
||||
var allViewerData = Session.get('ViewerData');
|
||||
var contentId = Session.get('activeContentId');
|
||||
if(allViewerData && contentId) {
|
||||
var viewerData = allViewerData[contentId];
|
||||
if (viewerData) {
|
||||
// Get study dates of imageViewerViewport elements
|
||||
var loadedStudyDates = {
|
||||
patientId: "",
|
||||
dates: []
|
||||
};
|
||||
|
||||
$(".imageViewerViewport").each(function(viewportIndex, element) {
|
||||
var enabledElement = cornerstone.getEnabledElement(element);
|
||||
if(enabledElement && enabledElement.image){
|
||||
var imageId = enabledElement.image.imageId;
|
||||
var study = cornerstoneTools.metaData.get('study', imageId);
|
||||
var studyDate = study.studyDate;
|
||||
loadedStudyDates.patientId = study.patientId;
|
||||
// Check studyDate is added before
|
||||
if (loadedStudyDates.dates.indexOf(studyDate) < 0) {
|
||||
loadedStudyDates.dates.push(studyDate);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// If study date is loaded into viewport, set timepointLoaded property in Timepoints collection as true
|
||||
// Else set timepointLoaded property as false
|
||||
if(loadedStudyDates.dates.length) {
|
||||
var timepoints = Timepoints.find({patientId: loadedStudyDates.patientId}).fetch();
|
||||
timepoints.forEach(function(timepoint){
|
||||
var timepointLoaded = false;
|
||||
if(loadedStudyDates.dates.indexOf(timepoint.timepointName) > -1) {
|
||||
timepointLoaded = true;
|
||||
}
|
||||
|
||||
Timepoints.update(timepoint._id,{
|
||||
$set: {
|
||||
timepointLoaded: timepointLoaded
|
||||
}
|
||||
});
|
||||
});
|
||||
$(".imageViewerViewport").each(function(viewportIndex, element) {
|
||||
var enabledElement = cornerstone.getEnabledElement(element);
|
||||
if (!enabledElement || !enabledElement.image) {
|
||||
return;
|
||||
}
|
||||
|
||||
var imageId = enabledElement.image.imageId;
|
||||
var study = cornerstoneTools.metaData.get('study', imageId);
|
||||
var studyDate = study.studyDate;
|
||||
loadedStudyDates.patientId = study.patientId;
|
||||
|
||||
// Check whether or not studyDate has been added before
|
||||
if (loadedStudyDates.dates.indexOf(studyDate) < 0) {
|
||||
loadedStudyDates.dates.push(studyDate);
|
||||
}
|
||||
});
|
||||
|
||||
// If study date is loaded into viewport, set timepointLoaded property in Timepoints collection as true
|
||||
// Else set timepointLoaded property as false
|
||||
if (loadedStudyDates.dates.length) {
|
||||
var timepoints = Timepoints.find({
|
||||
patientId: loadedStudyDates.patientId
|
||||
}).fetch();
|
||||
|
||||
timepoints.forEach(function(timepoint) {
|
||||
var timepointLoaded = false;
|
||||
if (loadedStudyDates.dates.indexOf(timepoint.timepointName) > -1) {
|
||||
timepointLoaded = true;
|
||||
}
|
||||
|
||||
Timepoints.update(timepoint._id, {
|
||||
$set: {
|
||||
timepointLoaded: timepointLoaded
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
<template name="lesionTableRow">
|
||||
<tr id="{{lesionNumber}}" class="lesionTableRow" data-measurementid="{{_id}}">
|
||||
<td class='lesionNumber'>{{number}}</td>
|
||||
<td class='location'>{{location}}</td>
|
||||
<td class='lesionNumber'>{{lesionNumber}}</td>
|
||||
<td class='location' tabindex="0">{{location}}</td>
|
||||
<td class='target'>{{#if isTarget}} Y {{else}} N {{/if}}</td>
|
||||
<!--Each time point as a column-->
|
||||
{{# each timepoints }}
|
||||
|
||||
@@ -3,3 +3,40 @@ Template.lesionTableRow.helpers({
|
||||
return Timepoints.find({}, {sort: {timepointName: 1}});
|
||||
}
|
||||
});
|
||||
|
||||
function doneCallback(measurementData, deleteTool) {
|
||||
// If a Lesion or Non-Target is removed via a dialog
|
||||
// opened by the Lesion Table, we should clear the data for
|
||||
// the specified Timepoint Cell
|
||||
if (deleteTool === true) {
|
||||
Meteor.call("removeMeasurement", measurementData.id, function(error, response) {
|
||||
console.log('Removed!');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Template.lesionTableRow.events({
|
||||
'dblclick .location': function() {
|
||||
log.info('Double clicked on Lesion Location cell');
|
||||
|
||||
var measurementData = this;
|
||||
|
||||
// TODO = Fix this weird issue? Need to set toolData's ID properly..
|
||||
measurementData.id = this._id;
|
||||
|
||||
changeLesionLocationCallback(measurementData, null, doneCallback);
|
||||
},
|
||||
'keypress .location': function(e) {
|
||||
var keyCode = e.keyCode;
|
||||
if (keyCode === keys.DELETE ||
|
||||
(keyCode === keys.D && e.ctrlKey === true)) {
|
||||
var currentMeasurement = Template.parentData(1);
|
||||
var currentTimepointID = this.timepointID;
|
||||
|
||||
showConfirmDialog(function() {
|
||||
log.info('Removing Lesion: ' + currentMeasurement._id);
|
||||
clearMeasurementTimepointData(currentMeasurement._id, currentTimepointID);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
.lesionTableRow .location
|
||||
&:hover
|
||||
font-weight: bold
|
||||
+9
-1
@@ -1,3 +1,11 @@
|
||||
<template name="lesionTableTimepointCell">
|
||||
<td class="lesionTableTimepointCell">{{longestDiameter}}</td>
|
||||
{{ #if hasDataAtThisTimepoint }}
|
||||
{{ #if isTarget }}
|
||||
<td class="lesionTableTimepointCell target" tabindex="1">{{displayData}}</td>
|
||||
{{ else }}
|
||||
<td class="lesionTableTimepointCell nonTarget" tabindex="2">{{displayData}}</td>
|
||||
{{ /if }}
|
||||
{{ else }}
|
||||
<td class="lesionTableTimepointCell empty"></td>
|
||||
{{ /if }}
|
||||
</template>
|
||||
+79
-2
@@ -1,5 +1,13 @@
|
||||
Template.lesionTableTimepointCell.helpers({
|
||||
'longestDiameter': function() {
|
||||
'hasDataAtThisTimepoint': function() {
|
||||
// This simple function just checks whether or not timepoint data
|
||||
// exists for this Measurement at this Timepoint
|
||||
var lesionData = Template.parentData(1);
|
||||
return (lesionData &&
|
||||
lesionData.timepoints &&
|
||||
lesionData.timepoints[this.timepointID]);
|
||||
},
|
||||
'displayData': function() {
|
||||
// Search Measurements by lesion and timepoint
|
||||
var lesionData = Template.parentData(1);
|
||||
if (!lesionData ||
|
||||
@@ -8,6 +16,75 @@ Template.lesionTableTimepointCell.helpers({
|
||||
return;
|
||||
}
|
||||
|
||||
return lesionData.timepoints[this.timepointID].longestDiameter;
|
||||
var data = lesionData.timepoints[this.timepointID];
|
||||
|
||||
if (lesionData.isTarget === true) {
|
||||
// TODO = Add short axis data here
|
||||
//return 'LD: ' + data.longestDiameter;
|
||||
return data.longestDiameter;
|
||||
} else {
|
||||
return data.response;
|
||||
}
|
||||
},
|
||||
'isTarget': function() {
|
||||
var lesionData = Template.parentData(1);
|
||||
return lesionData.isTarget;
|
||||
}
|
||||
});
|
||||
|
||||
function doneCallback(measurementData, deleteTool) {
|
||||
// If a Lesion or Non-Target is removed via a dialog
|
||||
// opened by the Lesion Table, we should clear the data for
|
||||
// the specified Timepoint Cell
|
||||
if (deleteTool === true) {
|
||||
log.info('Confirm clicked!');
|
||||
clearMeasurementTimepointData(measurementData.id, measurementData.timepointID);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete a lesion if Ctrl+D or DELETE is pressed while a lesion is selected
|
||||
var keys = {
|
||||
D: 68,
|
||||
DELETE: 46
|
||||
};
|
||||
|
||||
Template.lesionTableTimepointCell.events({
|
||||
'dblclick .lesionTableTimepointCell': function() {
|
||||
log.info('Double clicked on a timepoint cell');
|
||||
// Search Measurements by lesion and timepoint
|
||||
var currentMeasurement = Template.parentData(1);
|
||||
|
||||
// Create some fake measurement data
|
||||
var currentTimepointID = this.timepointID;
|
||||
|
||||
var timepointData = currentMeasurement.timepoints[currentTimepointID];
|
||||
var measurementData = {
|
||||
id: currentMeasurement._id,
|
||||
timepointID: currentTimepointID,
|
||||
response: timepointData.response,
|
||||
imageId: timepointData.imageId,
|
||||
handles: timepointData.handles,
|
||||
seriesInstanceUid: timepointData.seriesInstanceUid,
|
||||
studyInstanceUid: timepointData.studyInstanceUid
|
||||
};
|
||||
|
||||
if (currentMeasurement.isTarget) {
|
||||
showConfirmDialog(function() {
|
||||
log.info('Confirm clicked!');
|
||||
clearMeasurementTimepointData(currentMeasurement._id, currentTimepointID);
|
||||
});
|
||||
} else {
|
||||
changeNonTargetResponse(measurementData, null, doneCallback);
|
||||
}
|
||||
},
|
||||
'keypress .lesionTableTimepointCell': function(e) {
|
||||
var keyCode = e.keyCode;
|
||||
if (keyCode === keys.DELETE ||
|
||||
(keyCode === keys.D && e.ctrlKey === true)) {
|
||||
var currentMeasurement = Template.parentData(1);
|
||||
log.info('Removing Lesion: ' + currentMeasurement._id);
|
||||
// TODO = Add confirm dialog first!
|
||||
clearMeasurementTimepointData(currentMeasurement._id, this.timepointID);
|
||||
}
|
||||
}
|
||||
});
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
.lesionTableTimepointCell
|
||||
&:hover
|
||||
font-weight: bold
|
||||
.nonTarget
|
||||
&:hover
|
||||
color: red
|
||||
|
||||
|
||||
+11
-4
@@ -18,7 +18,11 @@
|
||||
<select id="selectNonTargetLesionLocationResponse">
|
||||
<option value="-1"></option>
|
||||
{{ #each locationResponses}}
|
||||
<option value='{{code}}'>{{code}} - {{text}}</option>
|
||||
{{ #if code }}
|
||||
<option value='{{code}}'>{{code}} - {{text}}</option>
|
||||
{{ else }}
|
||||
<option value={{text}}}>{{text}}</option>
|
||||
{{ /if }}
|
||||
{{ /each}}
|
||||
</select>
|
||||
</div>
|
||||
@@ -38,7 +42,7 @@
|
||||
<select id="selectNonTargetLesionLocation">
|
||||
<option value="-1"></option>
|
||||
{{ #each lesionLocations}}
|
||||
<option value='{{_id}}'>{{location}}</option>
|
||||
<option value='{{_id}}' selected={{selected}}>{{location}}</option>
|
||||
{{ /each}}
|
||||
</select>
|
||||
</div>
|
||||
@@ -47,13 +51,16 @@
|
||||
<select id="selectNonTargetLesionLocationResponse">
|
||||
<option value="-1"></option>
|
||||
{{ #each locationResponses}}
|
||||
<option value='{{code}}'>{{code}} - {{text}}</option>
|
||||
{{ #if code }}
|
||||
<option value={{code}} selected={{selected}}>{{code}} - {{text}}</option>
|
||||
{{ else }}
|
||||
<option value={{text}}} selected={{selected}}>{{text}}</option>
|
||||
{{ /if }}
|
||||
{{ /each}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="locationOK">
|
||||
<button class="btn btn-link" id="removeLesion">Remove</button>
|
||||
|
||||
<button class="btn btn-primary" id="nonTargetLesionOK">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+82
-32
@@ -26,7 +26,7 @@ function setLesionNumberCallback(measurementData, eventData, doneCallback) {
|
||||
|
||||
// Get a lesion number for this lesion, depending on whether or not the same lesion previously
|
||||
// exists at a different timepoint
|
||||
var lesionNumber = measurementManagerDAL.getNewLesionNumber(measurementData.timepointID, isTarget=false);
|
||||
var lesionNumber = LesionManager.getNewLesionNumber(measurementData.timepointID, isTarget=false);
|
||||
measurementData.lesionNumber = lesionNumber;
|
||||
|
||||
// Set lesion number
|
||||
@@ -63,19 +63,20 @@ function getLesionLocationCallback(measurementData, eventData) {
|
||||
|
||||
// Find out if this lesion number is already added in the lesion manager for another timepoint
|
||||
// If it is, disable selector location
|
||||
var locationUID = measurementManagerDAL.lesionNumberExists(measurementData);
|
||||
var locationUID = LesionManager.lesionNumberExists(measurementData);
|
||||
if (locationUID) {
|
||||
// Add an ID value to the tool data to link it to the Measurements collection
|
||||
measurementData.id = 'notready';
|
||||
|
||||
measurementData.locationUID = locationUID;
|
||||
|
||||
// Disable the selection of a new location
|
||||
disableLocationSelection(measurementData.locationUID);
|
||||
}
|
||||
|
||||
// Disable selector location to prevent selecting a new location
|
||||
function disableLocationSelection(locationUID) {
|
||||
var locationName = measurementManagerDAL.getLocationName(locationUID);
|
||||
var locationName = LesionManager.getLocationName(locationUID);
|
||||
selectorLocation.find('option').each(function() {
|
||||
if ($(this).text() === locationName) {
|
||||
// Select location in locations dropdown list
|
||||
@@ -88,8 +89,8 @@ function getLesionLocationCallback(measurementData, eventData) {
|
||||
|
||||
// Show the nonTargetLesion dialog above
|
||||
var dialogProperty = {
|
||||
top: eventData.currentPoints.page.y,
|
||||
left: eventData.currentPoints.page.x,
|
||||
top: eventData.currentPoints.page.y - dialog.outerHeight() - 40,
|
||||
left: eventData.currentPoints.page.x - dialog.outerWidth() / 2,
|
||||
display: 'block'
|
||||
};
|
||||
|
||||
@@ -107,7 +108,7 @@ function getLesionLocationCallback(measurementData, eventData) {
|
||||
dialog.css(dialogProperty);
|
||||
}
|
||||
|
||||
function changeLesionLocationCallback(measurementData, eventData, doneCallback) {
|
||||
changeNonTargetLocationCallback = function(measurementData, eventData, doneCallback) {
|
||||
Template.nonTargetLesionDialog.measurementData = measurementData;
|
||||
Template.nonTargetLesionDialog.doneCallback = doneCallback;
|
||||
|
||||
@@ -132,7 +133,6 @@ function changeLesionLocationCallback(measurementData, eventData, doneCallback)
|
||||
var selectorLocation = dialog.find("select#selectNonTargetLesionLocation");
|
||||
var selectorResponse = dialog.find("select#selectNonTargetLesionLocationResponse");
|
||||
|
||||
log.info(measurementData);
|
||||
selectorLocation.find("option:first").prop("selected", "selected");
|
||||
selectorResponse.find("option:first").prop("selected", "selected");
|
||||
|
||||
@@ -141,29 +141,75 @@ function changeLesionLocationCallback(measurementData, eventData, doneCallback)
|
||||
|
||||
// Show the nonTargetLesion dialog above
|
||||
var dialogProperty = {
|
||||
top: eventData.currentPoints.page.y,
|
||||
left: eventData.currentPoints.page.x,
|
||||
display: 'block'
|
||||
};
|
||||
|
||||
// Device is touch device or not
|
||||
// If device is touch device, set position center of screen vertically and horizontally
|
||||
if (isTouchDevice()) {
|
||||
if (!eventData || isTouchDevice()) {
|
||||
// add dialogMobile class to provide a black,transparent background
|
||||
dialog.addClass("dialogMobile");
|
||||
dialogProperty.top = 0;
|
||||
dialogProperty.left = 0;
|
||||
dialogProperty.right = 0;
|
||||
dialogProperty.bottom = 0;
|
||||
} else {
|
||||
dialogProperty.top = eventData.currentPoints.page.y - dialog.outerHeight() - 40;
|
||||
dialogProperty.left = eventData.currentPoints.page.x - dialog.outerWidth() / 2;
|
||||
}
|
||||
|
||||
dialog.css(dialogProperty);
|
||||
}
|
||||
|
||||
var measurement = Measurements.findOne(measurementData.id);
|
||||
if (!measurement) {
|
||||
return;
|
||||
}
|
||||
|
||||
LesionLocations.update({},
|
||||
{$set: {selected: false}},
|
||||
{ multi: true });
|
||||
|
||||
var currentLocation = LesionLocations.findOne({
|
||||
id: measurement.locationId
|
||||
});
|
||||
|
||||
if (!currentLocation) {
|
||||
return;
|
||||
}
|
||||
|
||||
LesionLocations.update(currentLocation._id, {
|
||||
$set: {
|
||||
selected: true
|
||||
}
|
||||
});
|
||||
|
||||
LocationResponses.update({},
|
||||
{$set: {selected: false}},
|
||||
{ multi: true });
|
||||
|
||||
var response = measurement.timepoints[measurementData.timepointID].response;
|
||||
|
||||
// TODO = Standardize this. Searching by code probably isn't the best, we should use
|
||||
// some sort of UID
|
||||
var currentResponse = LocationResponses.findOne({
|
||||
code: response
|
||||
});
|
||||
|
||||
if (!currentResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
LocationResponses.update(currentResponse._id, {
|
||||
$set: {
|
||||
selected: true
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var config = {
|
||||
setLesionNumberCallback: setLesionNumberCallback,
|
||||
getLesionLocationCallback: getLesionLocationCallback,
|
||||
changeLesionLocationCallback: changeLesionLocationCallback
|
||||
changeLesionLocationCallback: changeNonTargetLocationCallback
|
||||
};
|
||||
|
||||
cornerstoneTools.nonTarget.setConfiguration(config);
|
||||
@@ -205,22 +251,8 @@ Template.nonTargetLesionDialog.events({
|
||||
id = PatientLocations.insert({location: locationObj.location});
|
||||
}
|
||||
|
||||
if (!measurementData.id) {
|
||||
// Add an ID value to the tool data to link it to the Measurements collection
|
||||
measurementData.id = 'notready';
|
||||
|
||||
// Link locationUID with active lesion measurementData
|
||||
measurementData.locationUID = id;
|
||||
|
||||
/// Set the isTarget value to true, since this is the target-lesion dialog callback
|
||||
measurementData.isTarget = false;
|
||||
|
||||
// measurementText is set from location response list
|
||||
measurementData.measurementText = responseOptionId;
|
||||
|
||||
// Adds lesion data to timepoints array
|
||||
measurementManagerDAL.addLesionData(measurementData);
|
||||
} else {
|
||||
if (measurementData.id) {
|
||||
// Update the location data
|
||||
Measurements.update(measurementData.id, {
|
||||
$set: {
|
||||
location: locationObj.location,
|
||||
@@ -228,8 +260,24 @@ Template.nonTargetLesionDialog.events({
|
||||
locationUID: id
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Add an ID value to the tool data to link it to the Measurements collection
|
||||
measurementData.id = 'notready';
|
||||
}
|
||||
|
||||
// Link locationUID with active lesion measurementData
|
||||
measurementData.locationUID = id;
|
||||
|
||||
/// Set the isTarget value to true, since this is the target-lesion dialog callback
|
||||
measurementData.isTarget = false;
|
||||
|
||||
// measurementText is set from location response list
|
||||
measurementData.measurementText = responseOptionId;
|
||||
measurementData.response = responseOptionId;
|
||||
|
||||
// Adds lesion data to timepoints array
|
||||
LesionManager.updateLesionData(measurementData);
|
||||
|
||||
// Close the dialog
|
||||
closeHandler(dialog);
|
||||
},
|
||||
@@ -238,10 +286,12 @@ Template.nonTargetLesionDialog.events({
|
||||
var doneCallback = Template.nonTargetLesionDialog.doneCallback;
|
||||
var dialog = Template.nonTargetLesionDialog.dialog;
|
||||
|
||||
if (doneCallback && typeof doneCallback === 'function') {
|
||||
var deleteTool = true;
|
||||
doneCallback(measurementData, deleteTool);
|
||||
}
|
||||
showConfirmDialog(function() {
|
||||
if (doneCallback && typeof doneCallback === 'function') {
|
||||
var deleteTool = true;
|
||||
doneCallback(measurementData, deleteTool);
|
||||
}
|
||||
});
|
||||
|
||||
closeHandler(dialog);
|
||||
},
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<template name="nonTargetResponseDialog">
|
||||
<div id="nonTargetResponseDialog">
|
||||
<div class="dialogHeader">
|
||||
<h5>Select Response</h5>
|
||||
</div>
|
||||
<div class="dialogContent">
|
||||
<div class="locationResponse">
|
||||
<label>Response</label>
|
||||
<select id="selectNonTargetLesionLocationResponse">
|
||||
<option value="-1"></option>
|
||||
{{ #each locationResponses}}
|
||||
{{ #if code }}
|
||||
<option value={{code}} selected={{selected}}>{{code}} - {{text}}</option>
|
||||
{{ else }}
|
||||
<option value={{text}} selected={{selected}}>{{text}}</option>
|
||||
{{ /if }}
|
||||
{{ /each}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="locationOK">
|
||||
<button class="btn btn-link" id="removeLesion">Remove</button>
|
||||
<button class="btn btn-primary" id="nonTargetLesionOK">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
function closeHandler(dialog) {
|
||||
// Hide the lesion dialog
|
||||
$(dialog).css('display', 'none');
|
||||
|
||||
// Remove the backdrop
|
||||
$(".removableBackdrop").remove();
|
||||
}
|
||||
|
||||
changeNonTargetResponse = function(measurementData, eventData, doneCallback) {
|
||||
Template.nonTargetResponseDialog.measurementData = measurementData;
|
||||
Template.nonTargetResponseDialog.doneCallback = doneCallback;
|
||||
|
||||
// Get the non-target lesion location dialog
|
||||
var dialog = $("#nonTargetResponseDialog");
|
||||
Template.nonTargetResponseDialog.dialog = dialog;
|
||||
|
||||
// Show the backdrop
|
||||
UI.render(Template.removableBackdrop, document.body);
|
||||
|
||||
// Make sure the context menu is closed when the user clicks away
|
||||
$(".removableBackdrop").one('mousedown touchstart', function() {
|
||||
closeHandler(dialog);
|
||||
|
||||
if (doneCallback && typeof doneCallback === 'function') {
|
||||
var deleteTool = true;
|
||||
doneCallback(measurementData, deleteTool);
|
||||
}
|
||||
});
|
||||
|
||||
// Show the nonTargetLesion dialog above
|
||||
var dialogProperty = {
|
||||
display: 'block'
|
||||
};
|
||||
|
||||
// Device is touch device or not
|
||||
// If device is touch device, set position center of screen vertically and horizontally
|
||||
if (!eventData || isTouchDevice()) {
|
||||
// add dialogMobile class to provide a black,transparent background
|
||||
dialog.addClass("dialogMobile");
|
||||
dialogProperty.top = 0;
|
||||
dialogProperty.left = 0;
|
||||
dialogProperty.right = 0;
|
||||
dialogProperty.bottom = 0;
|
||||
} else {
|
||||
dialogProperty.top = eventData.currentPoints.page.y - dialog.outerHeight() - 40;
|
||||
dialogProperty.left = eventData.currentPoints.page.x - dialog.outerWidth() / 2;
|
||||
}
|
||||
|
||||
dialog.css(dialogProperty);
|
||||
|
||||
var measurement = Measurements.findOne(measurementData.id);
|
||||
if (!measurement) {
|
||||
return;
|
||||
}
|
||||
|
||||
var response = measurement.timepoints[measurementData.timepointID].response;
|
||||
|
||||
// TODO = Standardize this. Searching by code probably isn't the best, we should use
|
||||
// some sort of UID
|
||||
var currentResponse = LocationResponses.findOne({
|
||||
code: response
|
||||
});
|
||||
|
||||
if (!currentResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
LocationResponses.update(currentResponse._id, {
|
||||
$set: {
|
||||
selected: true
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Template.nonTargetResponseDialog.events({
|
||||
'click #nonTargetLesionOK': function() {
|
||||
var dialog = Template.nonTargetResponseDialog.dialog;
|
||||
var measurementData = Template.nonTargetResponseDialog.measurementData;
|
||||
|
||||
// Find the select option box
|
||||
var selectorResponse = dialog.find("select#selectNonTargetLesionLocationResponse");
|
||||
|
||||
// Get the current value of the selector
|
||||
var responseOptionId = selectorResponse.find("option:selected").val();
|
||||
|
||||
// If the selected response option is still the default (-1)
|
||||
// then stop here
|
||||
if (responseOptionId < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!measurementData.id) {
|
||||
// Add an ID value to the tool data to link it to the Measurements collection
|
||||
measurementData.id = 'notready';
|
||||
}
|
||||
|
||||
/// Set the isTarget value to true, since this is the target-lesion dialog callback
|
||||
measurementData.isTarget = false;
|
||||
|
||||
// measurementText is set from location response list
|
||||
measurementData.measurementText = responseOptionId;
|
||||
measurementData.response = responseOptionId;
|
||||
|
||||
// Adds lesion data to timepoints array
|
||||
LesionManager.updateLesionData(measurementData);
|
||||
|
||||
// Close the dialog
|
||||
closeHandler(dialog);
|
||||
},
|
||||
'click #removeLesion': function() {
|
||||
var measurementData = Template.nonTargetResponseDialog.measurementData;
|
||||
var doneCallback = Template.nonTargetResponseDialog.doneCallback;
|
||||
var dialog = Template.nonTargetResponseDialog.dialog;
|
||||
|
||||
showConfirmDialog(function() {
|
||||
if (doneCallback && typeof doneCallback === 'function') {
|
||||
var deleteTool = true;
|
||||
doneCallback(measurementData, deleteTool);
|
||||
}
|
||||
});
|
||||
|
||||
closeHandler(dialog);
|
||||
},
|
||||
'click #btnCloseLesionPopup': function() {
|
||||
var dialog = Template.nonTargetResponseDialog.dialog;
|
||||
closeHandler(dialog);
|
||||
},
|
||||
'keypress #nonTargetResponseDialog': function(e) {
|
||||
var dialog = Template.nonTargetResponseDialog.dialog;
|
||||
|
||||
// If Enter is pressed, close the dialog
|
||||
if (e.which === 13) {
|
||||
closeHandler(dialog);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Template.nonTargetResponseDialog.helpers({
|
||||
'locationResponses': function() {
|
||||
return LocationResponses.find();
|
||||
}
|
||||
});
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
#nonTargetResponseDialog
|
||||
display: none
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
right: 0
|
||||
z-index: 100
|
||||
width: 300px
|
||||
height: 150px
|
||||
border-radius: 5px
|
||||
padding: 10px 20px 10px 20px
|
||||
background-color: rgba(255,255,255,1)
|
||||
|
||||
#selectNonTargetLesionLocationResponse
|
||||
width: 100%
|
||||
|
||||
.dialogContent, .locationResponse
|
||||
margin-bottom: 20px
|
||||
|
||||
.locationOK
|
||||
text-align: center
|
||||
|
||||
Reference in new issue
Block a user