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