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