LT-91: Missing "selected study" emphasis in lesion table column header (work-in-progress)
This commit is contained in:
parent
91bd8cab47
commit
75269e43f1
@ -69,48 +69,58 @@ Template.lesionTable.onRendered(function() {
|
|||||||
// Put a visual indicator (<) in timepoint header in lesion table for 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
|
// timepointLoaded property is used to put indicator for loaded timepoints in viewport
|
||||||
self.autorun(function() {
|
self.autorun(function() {
|
||||||
// Get study dates of imageViewerViewport elements
|
var ViewerData = Session.get("ViewerData");
|
||||||
var loadedStudyDates = {
|
var contentId = Session.get("activeContentId");
|
||||||
patientId: "",
|
if (contentId) {
|
||||||
dates: []
|
var viewerData = ViewerData[contentId];
|
||||||
};
|
if (viewerData) {
|
||||||
|
if (viewerData.loadedSeriesData) {
|
||||||
|
// Get study dates of imageViewerViewport elements
|
||||||
|
var loadedStudyDates = {
|
||||||
|
patientId: "",
|
||||||
|
dates: []
|
||||||
|
};
|
||||||
|
|
||||||
$(".imageViewerViewport").each(function(viewportIndex, element) {
|
$(".imageViewerViewport").each(function(viewportIndex, element) {
|
||||||
var enabledElement = cornerstone.getEnabledElement(element);
|
var enabledElement = cornerstone.getEnabledElement(element);
|
||||||
if (!enabledElement || !enabledElement.image) {
|
if (!enabledElement || !enabledElement.image) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var imageId = enabledElement.image.imageId;
|
var imageId = enabledElement.image.imageId;
|
||||||
var study = cornerstoneTools.metaData.get('study', imageId);
|
var study = cornerstoneTools.metaData.get('study', imageId);
|
||||||
var studyDate = study.studyDate;
|
var studyDate = study.studyDate;
|
||||||
loadedStudyDates.patientId = study.patientId;
|
loadedStudyDates.patientId = study.patientId;
|
||||||
|
|
||||||
// Check whether or not studyDate has been added before
|
// Check whether or not studyDate has been added before
|
||||||
if (loadedStudyDates.dates.indexOf(studyDate) < 0) {
|
if (loadedStudyDates.dates.indexOf(studyDate) < 0) {
|
||||||
loadedStudyDates.dates.push(studyDate);
|
loadedStudyDates.dates.push(studyDate);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// If study date is loaded into viewport, set timepointLoaded property in Timepoints collection as true
|
// If study date is loaded into viewport, set timepointLoaded property in Timepoints collection as true
|
||||||
// Else set timepointLoaded property as false
|
// Else set timepointLoaded property as false
|
||||||
if (loadedStudyDates.dates.length) {
|
if (loadedStudyDates.dates.length) {
|
||||||
var timepoints = Timepoints.find({
|
var timepoints = Timepoints.find({
|
||||||
patientId: loadedStudyDates.patientId
|
patientId: loadedStudyDates.patientId
|
||||||
}).fetch();
|
}).fetch();
|
||||||
|
|
||||||
timepoints.forEach(function(timepoint) {
|
timepoints.forEach(function(timepoint) {
|
||||||
var timepointLoaded = false;
|
var timepointLoaded = false;
|
||||||
if (loadedStudyDates.dates.indexOf(timepoint.timepointName) > -1) {
|
if (loadedStudyDates.dates.indexOf(timepoint.timepointName) > -1) {
|
||||||
timepointLoaded = true;
|
timepointLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Timepoints.update(timepoint._id, {
|
Timepoints.update(timepoint._id, {
|
||||||
$set: {
|
$set: {
|
||||||
timepointLoaded: timepointLoaded
|
timepointLoaded: timepointLoaded
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Loading…
Reference in New Issue
Block a user