Fix lesion table ordering, new lesion numbering
This commit is contained in:
parent
e4547f121d
commit
8afcb1a1a9
@ -127,15 +127,17 @@ var LesionManager = (function() {
|
||||
isTarget: isTarget
|
||||
}, {
|
||||
sort: {lesionNumber: 1}
|
||||
});
|
||||
}).fetch();
|
||||
|
||||
// If measurements exist, find the last lesion number
|
||||
// from the given timepoint
|
||||
var lesionNumberCounter = 1;
|
||||
|
||||
// Search through Measurements to see which ones
|
||||
// already have data for this Timepoint
|
||||
measurements.forEach(function(measurement) {
|
||||
// Search through every Measurement to see which ones
|
||||
// already have data for this Timepoint, if we find one that
|
||||
// doesn't have data, we will stop there and use that as the
|
||||
// current Measurement
|
||||
measurements.every(function(measurement) {
|
||||
// If this measurement has no data for this Timepoint,
|
||||
// use this as the current Measurement
|
||||
if (!measurement.timepoints[timepointID]) {
|
||||
@ -144,6 +146,7 @@ var LesionManager = (function() {
|
||||
}
|
||||
|
||||
lesionNumberCounter++;
|
||||
return true;
|
||||
});
|
||||
return lesionNumberCounter;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ Template.lesionTable.helpers({
|
||||
'measurement': function() {
|
||||
return Measurements.find({}, {
|
||||
sort: {
|
||||
lesionNumber: 1
|
||||
lesionNumberAbsolute: 1
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user