LT-293: send proper timepoint id to server when removing an association and update the view, removing this associations
This commit is contained in:
1 parent
998cdce9fb
commit
987be26047
5 files changed
+90
-23
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
import { measurementTools } from './measurementTools';
|
||||
import { retrieveMeasurements, storeMeasurements, retrieveTimepoints, storeTimepoints } from './dataExchange';
|
||||
import { retrieveMeasurements, storeMeasurements, retrieveTimepoints, storeTimepoints, removeTimepoint, updateTimepoint } from './dataExchange';
|
||||
import { validateMeasurements } from './dataValidation';
|
||||
|
||||
console.log('OHIF-LesionTracker: Defining Configuration for Measurements');
|
||||
@@ -26,6 +26,8 @@ OHIF.measurements.MeasurementApi.setConfiguration({
|
||||
OHIF.measurements.TimepointApi.setConfiguration({
|
||||
dataExchange: {
|
||||
retrieve: retrieveTimepoints,
|
||||
store: storeTimepoints
|
||||
store: storeTimepoints,
|
||||
remove: removeTimepoint,
|
||||
update: updateTimepoint
|
||||
}
|
||||
});
|
||||
@@ -64,3 +64,34 @@ export const storeTimepoints = (timepointData) => {
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export const updateTimepoint = (timepointData, query) => {
|
||||
console.log('updateTimepoint');
|
||||
console.log(timepointData);
|
||||
console.log(query);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
Meteor.call('updateTimepoint', timepointData, query, (error, response) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export const removeTimepoint = timepointData => {
|
||||
console.log('removeTimepoint');
|
||||
console.log(timepointData);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
Meteor.call('removeTimepoint', timepointData, (error, response) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -37,6 +37,19 @@ Meteor.methods({
|
||||
});
|
||||
},
|
||||
|
||||
removeTimepoint(timepointData) {
|
||||
OHIF.log.info('Removing Timepoint off the Server');
|
||||
OHIF.log.info(JSON.stringify(timepointData, null, 2));
|
||||
Timepoints.remove(timepointData);
|
||||
},
|
||||
|
||||
updateTimepoint(timepointData, query) {
|
||||
OHIF.log.info('Updating Timepoint on the Server');
|
||||
OHIF.log.info(JSON.stringify(timepointData, null, 2));
|
||||
OHIF.log.info(JSON.stringify(query, null, 2));
|
||||
Timepoints.update(timepointData, query);
|
||||
},
|
||||
|
||||
retrieveTimepoints(filter) {
|
||||
OHIF.log.info('Retrieving Timepoints from the Server');
|
||||
return Timepoints.find(filter || {}).fetch();
|
||||
|
||||
Reference in new issue
Block a user