PWV-84: Making New Targets and New Non-Targets always visible
This commit is contained in:
parent
67a525167b
commit
0cb54a1e8c
@ -5,14 +5,17 @@ import { retrieveMeasurements, storeMeasurements, retrieveTimepoints, storeTimep
|
||||
import { validateMeasurements } from './dataValidation';
|
||||
import { FieldLesionLocation, FieldLesionLocationResponse } from 'meteor/ohif:lesiontracker/both/schema/fields';
|
||||
|
||||
const newMeasurementTool = {
|
||||
id: 'newLesions',
|
||||
name: 'New Lesions'
|
||||
};
|
||||
|
||||
OHIF.measurements.MeasurementApi.setConfiguration({
|
||||
measurementTools: measurementTools,
|
||||
newMeasurementTool: newMeasurementTool,
|
||||
measurementTools,
|
||||
newLesions: [{
|
||||
id: 'newTargets',
|
||||
name: 'New Targets',
|
||||
toolGroupId: 'targets'
|
||||
}, {
|
||||
id: 'newNonTargets',
|
||||
name: 'New Non-Targets',
|
||||
toolGroupId: 'nonTargets'
|
||||
}],
|
||||
dataExchange: {
|
||||
retrieve: retrieveMeasurements,
|
||||
store: storeMeasurements
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { Viewerbase } from 'meteor/ohif:viewerbase';
|
||||
|
||||
@ -19,20 +20,14 @@ Template.measurementTableHeaderRow.helpers({
|
||||
// Skip New Lesions section
|
||||
const instance = Template.instance();
|
||||
const { toolGroup, measurementRows, timepointApi, measurementApi } = instance.data;
|
||||
if (!measurementRows) {
|
||||
return;
|
||||
}
|
||||
if (!measurementRows) return;
|
||||
|
||||
const config = OHIF.measurements.MeasurementApi.getConfiguration();
|
||||
if (toolGroup.id === config.newMeasurementTool.id) {
|
||||
return;
|
||||
}
|
||||
if (config.newLesions && config.newLesions.find(o => o.id === toolGroup.id)) return;
|
||||
|
||||
const current = timepointApi.current();
|
||||
const prior = timepointApi.prior();
|
||||
if (!prior) {
|
||||
return true;
|
||||
}
|
||||
if (!prior) return true;
|
||||
|
||||
const currentFilter = { timepointId: current.timepointId };
|
||||
const priorFilter = { timepointId: prior.timepointId };
|
||||
|
||||
@ -12,11 +12,11 @@
|
||||
{{/each}}
|
||||
{{/each}}
|
||||
|
||||
{{#if config.newMeasurementTool}}
|
||||
{{#let toolGroup=(getNewToolGroup config.newMeasurementTool)}}
|
||||
{{#let newMeasure=(newMeasurements toolGroup)}}
|
||||
{{#if newMeasure.length}}
|
||||
{{#let collection=newMeasure}}
|
||||
{{#each newLesionGroup in config.newLesions}}
|
||||
{{#let toolGroup=(getNewLesionsToolGroup newLesionGroup)}}
|
||||
{{#let newMeasurements=(newLesionsMeasurements toolGroup)}}
|
||||
{{#if newMeasurements.length}}
|
||||
{{#let collection=newMeasurements}}
|
||||
{{>measurementTableHeaderRow (clone this
|
||||
toolGroup=toolGroup
|
||||
measurementRows=collection)}}
|
||||
@ -28,7 +28,7 @@
|
||||
{{/if}}
|
||||
{{/let}}
|
||||
{{/let}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
{{/let}}
|
||||
{{#if or (hasMeasurements 'targets') (hasMeasurements 'nonTargets')}}
|
||||
<div class="report-area">
|
||||
|
||||
@ -37,22 +37,19 @@ Template.measurementTableView.helpers({
|
||||
return group && !!group.measurementRows.length;
|
||||
},
|
||||
|
||||
getNewToolGroup(tool) {
|
||||
getNewLesionsToolGroup(newLesionGroup) {
|
||||
const configuration = OHIF.measurements.MeasurementApi.getConfiguration();
|
||||
const trialCriteriaType = OHIF.lesiontracker.TrialCriteriaTypes.findOne({ selected: true });
|
||||
const trialCriteriaTypeId = trialCriteriaType.id.toLowerCase();
|
||||
const toolGroupId = trialCriteriaTypeId === 'recist' ? 'nonTargets' : 'targets';
|
||||
const toolGroup = _.findWhere(configuration.measurementTools, { id: toolGroupId });
|
||||
const toolGroup = _.findWhere(configuration.measurementTools, { id: newLesionGroup.toolGroupId });
|
||||
|
||||
return {
|
||||
id: tool.id,
|
||||
name: tool.name,
|
||||
id: newLesionGroup.id,
|
||||
name: newLesionGroup.name,
|
||||
childTools: toolGroup.childTools,
|
||||
measurementTypeId: toolGroup.id
|
||||
};
|
||||
},
|
||||
|
||||
newMeasurements(toolGroup) {
|
||||
newLesionsMeasurements(toolGroup) {
|
||||
const { measurementApi, timepointApi } = Template.instance().data;
|
||||
const current = timepointApi.current();
|
||||
const baseline = timepointApi.baseline();
|
||||
@ -60,7 +57,6 @@ Template.measurementTableView.helpers({
|
||||
if (!measurementApi || !timepointApi || !current || !baseline) return;
|
||||
|
||||
// If this is a baseline, stop here since there are no new measurements to display
|
||||
|
||||
if (!current || current.timepointType === 'baseline') {
|
||||
OHIF.log.info('Skipping New Measurements section');
|
||||
return;
|
||||
@ -80,9 +76,7 @@ Template.measurementTableView.helpers({
|
||||
// Retrieve all the data for this Measurement type which
|
||||
// do NOT match the Measurement Numbers obtained above
|
||||
const data = measurementApi.fetch(measurementTypeId, {
|
||||
measurementNumber: {
|
||||
$nin: numbers
|
||||
}
|
||||
measurementNumber: { $nin: numbers }
|
||||
});
|
||||
|
||||
// Group the Measurements by Measurement Number
|
||||
|
||||
Loading…
Reference in New Issue
Block a user