LT-305: Add sorting function to properly order Measurement Table
This commit is contained in:
1 parent
0b77a1783a
commit
d6a3172bb3
7 files changed
+150
-25
No files matched your search
+1
-1
@@ -2,7 +2,7 @@
|
||||
<div class="measurementTableRow {{#unless rowItem.location}}warning{{/unless}}{{#if responseStatus}}response-status{{/if}}" data-measurementid="{{_id}}">
|
||||
<div class='measurementRowSidebar'>
|
||||
<div class="measurementNumber">
|
||||
{{rowItem.measurementNumber}}
|
||||
{{rowItem.measurementNumberOverall}}
|
||||
</div>
|
||||
{{#unless rowItem.location}}
|
||||
<div class="warning-icon">
|
||||
|
||||
+7
-2
@@ -58,14 +58,19 @@ Template.measurementTableRow.events({
|
||||
const measurement = instance.data.rowItem.entries[0];
|
||||
const toolType = measurement.toolType;
|
||||
const measurementNumber = measurement.measurementNumber;
|
||||
const api = instance.data.measurementApi;
|
||||
const measurementApi = instance.data.measurementApi;
|
||||
const timepointApi = instance.data.timepointApi;
|
||||
|
||||
// Remove all the measurements with the given type and number
|
||||
api.deleteMeasurements(measurementTypeId, {
|
||||
measurementApi.deleteMeasurements(measurementTypeId, {
|
||||
toolType,
|
||||
measurementNumber
|
||||
});
|
||||
|
||||
// Update the Overall Measurement Numbers for all Measurements
|
||||
const baseline = timepointApi.baseline();
|
||||
measurementApi.sortMeasurements(baseline.timepointId);
|
||||
|
||||
// Repaint the images on all viewports without the removed measurements
|
||||
_.each($('.imageViewerViewport'), element => cornerstone.updateImage(element));
|
||||
});
|
||||
|
||||
+15
-7
@@ -53,13 +53,18 @@ Template.measurementTableView.helpers({
|
||||
const groupObject = _.groupBy(data, entry => entry.measurementNumber);
|
||||
|
||||
// Reformat the data for display in the table
|
||||
return Object.keys(groupObject).map(key => ({
|
||||
measurementTypeId: measurementTypeId,
|
||||
measurementNumber: key,
|
||||
location: OHIF.measurements.getLocation(groupObject[key]),
|
||||
responseStatus: false, // TODO: Get the latest timepoint and determine the response status
|
||||
entries: groupObject[key]
|
||||
}));
|
||||
return Object.keys(groupObject).map(key => {
|
||||
const anEntry = groupObject[key][0];
|
||||
|
||||
return {
|
||||
measurementTypeId: measurementTypeId,
|
||||
measurementNumber: key,
|
||||
measurementNumberOverall: anEntry.measurementNumberOverall,
|
||||
location: OHIF.measurements.getLocation(groupObject[key]),
|
||||
responseStatus: false, // TODO: Get the latest timepoint and determine the response status
|
||||
entries: groupObject[key]
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
newMeasurements(measurementType) {
|
||||
@@ -104,9 +109,12 @@ Template.measurementTableView.helpers({
|
||||
|
||||
// Reformat the data for display in the table
|
||||
return Object.keys(groupObject).map(key => {
|
||||
const anEntry = groupObject[key][0];
|
||||
|
||||
return {
|
||||
measurementTypeId: measurementTypeId,
|
||||
measurementNumber: key,
|
||||
measurementNumberOverall: anEntry.measurementNumberOverall,
|
||||
location: OHIF.measurements.getLocation(groupObject[key]),
|
||||
responseStatus: false, // TODO: Get the latest timepoint and determine the response status
|
||||
entries: groupObject[key]
|
||||
|
||||
Reference in new issue
Block a user