LT-408: New Lesion section heading is missing from the measurement table

This commit is contained in:
Leonardo Campos 2017-02-15 21:02:30 -02:00
parent 6b17deabcb
commit 7c37e2070a
3 changed files with 23 additions and 16 deletions

View File

@ -1,5 +1,6 @@
import { Template } from 'meteor/templating'; import { Template } from 'meteor/templating';
import { OHIF } from 'meteor/ohif:core'; import { OHIF } from 'meteor/ohif:core';
import { Viewerbase } from 'meteor/ohif:viewerbase';
Template.measurementTableHeaderRow.helpers({ Template.measurementTableHeaderRow.helpers({
numberOfMeasurements() { numberOfMeasurements() {
@ -47,6 +48,6 @@ Template.measurementTableHeaderRow.helpers({
Template.measurementTableHeaderRow.events({ Template.measurementTableHeaderRow.events({
'click .js-setTool'(event, instance) { 'click .js-setTool'(event, instance) {
const { toolGroup } = instance.data; const { toolGroup } = instance.data;
toolManager.setActiveTool(toolGroup.childTools[0].cornerstoneToolType); Viewerbase.toolManager.setActiveTool(toolGroup.childTools[0].cornerstoneToolType);
} }
}); });

View File

@ -13,16 +13,13 @@
{{/each}} {{/each}}
{{#if config.newMeasurementTool}} {{#if config.newMeasurementTool}}
{{#let measurementType=(getNewMeasurementType config.newMeasurementTool)}} {{#let toolGroup=(getNewToolGroup config.newMeasurementTool)}}
{{#let newMeasure=(newMeasurements measurementType)}} {{#let newMeasure=(newMeasurements toolGroup)}}
{{#if newMeasure.length}} {{#if newMeasure.length}}
{{#let collection=newMeasure}} {{#let collection=newMeasure}}
{{>measurementTableHeaderRow {{>measurementTableHeaderRow (clone this
measurementType=measurementType toolGroup=toolGroup
measurements=collection measurementRows=collection)}}
currentTimepointId=currentTimepointId
timepointApi=timepointApi
measurementApi=measurementApi}}
{{#each entry in collection}} {{#each entry in collection}}
{{>measurementTableRow (clone this rowItem=entry)}} {{>measurementTableRow (clone this rowItem=entry)}}

View File

@ -31,18 +31,27 @@ Template.measurementTableView.helpers({
return !!group.measurementRows.length; return !!group.measurementRows.length;
}, },
getNewMeasurementType(tool) { getNewToolGroup(tool) {
// TODO: Check Conformance criteria here. const configuration = OHIF.measurements.MeasurementApi.getConfiguration();
// RECIST should be nonTargets, irRC should be targets const trialCriteriaType = TrialCriteriaTypes.findOne({ selected: true });
const trialCriteriaTypeId = trialCriteriaType.id.toLowerCase();
const trialToolGroupMap = {
recist: 'nonTargets',
irrc: 'targets'
};
const toolGroupId = trialToolGroupMap[trialCriteriaTypeId];
const toolGroup = _.findWhere(configuration.measurementTools, { id: toolGroupId });
return { return {
id: tool.id, id: tool.id,
name: tool.name, name: tool.name,
cornerstoneToolType: 'nonTarget', childTools: toolGroup.childTools,
measurementTypeId: 'nonTargets' measurementTypeId: toolGroup.id
}; };
}, },
newMeasurements(measurementType) { newMeasurements(toolGroup) {
const instance = Template.instance(); const instance = Template.instance();
const measurementApi = instance.data.measurementApi; const measurementApi = instance.data.measurementApi;
const timepointApi = instance.data.timepointApi; const timepointApi = instance.data.timepointApi;
@ -62,7 +71,7 @@ Template.measurementTableView.helpers({
// Retrieve all the data for this Measurement type (e.g. 'targets') // Retrieve all the data for this Measurement type (e.g. 'targets')
// which was recorded at baseline. // which was recorded at baseline.
const measurementTypeId = measurementType.measurementTypeId; const measurementTypeId = toolGroup.measurementTypeId;
const atBaseline = measurementApi.fetch(measurementTypeId, { const atBaseline = measurementApi.fetch(measurementTypeId, {
timepointId: baseline.timepointId timepointId: baseline.timepointId
}); });