Fixing issues with locations onModified event
This commit is contained in:
parent
60a001043b
commit
a742c8036d
@ -112,6 +112,9 @@ Template.dialogNonTargetMeasurement.onRendered(() => {
|
||||
|
||||
// Update the location and response after confirming the dialog data
|
||||
instance.data.promise.then(formData => {
|
||||
measurementData.response = formData.response;
|
||||
measurementData.location = formData.location;
|
||||
|
||||
// Update the response for current measurement
|
||||
collection.update({
|
||||
_id: measurementData._id,
|
||||
|
||||
@ -21,8 +21,7 @@ Template.measurementLocationDialog.onCreated(() => {
|
||||
|
||||
OHIF.measurements.toggleLabelButton({
|
||||
instance,
|
||||
measurementId: measurementData._id,
|
||||
toolType: measurementData.toolType,
|
||||
measurement: measurementData,
|
||||
element: eventData.element,
|
||||
measurementApi,
|
||||
position: position,
|
||||
|
||||
@ -53,8 +53,7 @@ Template.measurementTableRow.events({
|
||||
// Show the measure flow for targets
|
||||
OHIF.measurements.toggleLabelButton({
|
||||
instance,
|
||||
measurementId: entry._id,
|
||||
toolType: entry.toolType,
|
||||
measurement: entry,
|
||||
element: document.body,
|
||||
measurementApi: instance.data.measurementApi,
|
||||
position: {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { $ } from 'meteor/jquery';
|
||||
import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
class MeasurementHandlers {
|
||||
@ -86,7 +87,10 @@ class MeasurementHandlers {
|
||||
|
||||
let measurement = Collection.findOne(measurementData._id);
|
||||
|
||||
// Update the collection data with the cornerstone measurement data
|
||||
const ignoredKeys = ['location', 'description', 'response'];
|
||||
Object.keys(measurementData).forEach(key => {
|
||||
if (_.contains(ignoredKeys, key)) return;
|
||||
measurement[key] = measurementData[key];
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,9 @@ import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
OHIF.measurements.toggleLabelButton = options => {
|
||||
const toolType = options.measurement.toolType;
|
||||
const measurementId = options.measurement._id;
|
||||
|
||||
const removeButtonView = () => {
|
||||
if (!options.instance.buttonView) {
|
||||
return;
|
||||
@ -18,8 +21,8 @@ OHIF.measurements.toggleLabelButton = options => {
|
||||
}
|
||||
|
||||
const measurementApi = options.measurementApi;
|
||||
const toolCollection = measurementApi.tools[options.toolType];
|
||||
const measurement = toolCollection.findOne(options.measurementId);
|
||||
const toolCollection = measurementApi.tools[toolType];
|
||||
const measurement = toolCollection.findOne(measurementId);
|
||||
|
||||
const data = {
|
||||
measurement,
|
||||
@ -30,7 +33,7 @@ OHIF.measurements.toggleLabelButton = options => {
|
||||
autoClick: options.autoClick,
|
||||
doneCallback: removeButtonView,
|
||||
updateCallback(location, description) {
|
||||
const groupId = measurementApi.toolsGroupsMap[measurement.toolType];
|
||||
const groupId = measurementApi.toolsGroupsMap[toolType];
|
||||
const config = OHIF.measurements.MeasurementApi.getConfiguration();
|
||||
const group = _.findWhere(config.measurementTools, { id: groupId });
|
||||
group.childTools.forEach(tool => {
|
||||
@ -46,6 +49,8 @@ OHIF.measurements.toggleLabelButton = options => {
|
||||
multi: true
|
||||
});
|
||||
});
|
||||
options.measurement.location = location;
|
||||
options.measurement.description = description;
|
||||
}
|
||||
};
|
||||
const view = Blaze.renderWithData(Template.measureFlow, data, options.element);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user