LT-254: Display maximum number of target measurements in Lesion Table based on Trial Criteria
This commit is contained in:
parent
a58e237418
commit
7cb8ed6c9f
@ -1,8 +1,13 @@
|
|||||||
Template.caseProgress.onCreated(function caseProgressOnCreated() {
|
Template.caseProgress.onCreated(function caseProgressOnCreated() {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
|
|
||||||
|
instance.progressPercent = new ReactiveVar();
|
||||||
|
instance.progressText = new ReactiveVar();
|
||||||
|
instance.isLocked = new ReactiveVar();
|
||||||
|
|
||||||
if (!instance.data.currentTimepointId) {
|
if (!instance.data.currentTimepointId) {
|
||||||
throw 'Case Progress has no timepointId';
|
console.warn('Case has no timepointId');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentTimepointId = instance.data.currentTimepointId;
|
const currentTimepointId = instance.data.currentTimepointId;
|
||||||
@ -12,10 +17,6 @@ Template.caseProgress.onCreated(function caseProgressOnCreated() {
|
|||||||
|
|
||||||
const timepointType = timepoint.timepointType;
|
const timepointType = timepoint.timepointType;
|
||||||
|
|
||||||
instance.progressPercent = new ReactiveVar();
|
|
||||||
instance.progressText = new ReactiveVar();
|
|
||||||
|
|
||||||
instance.isLocked = new ReactiveVar();
|
|
||||||
instance.isLocked.set(timepoint.isLocked);
|
instance.isLocked.set(timepoint.isLocked);
|
||||||
|
|
||||||
if (timepointType === 'baseline') {
|
if (timepointType === 'baseline') {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template name="lesionTableHeaderRow">
|
<template name="lesionTableHeaderRow">
|
||||||
<div class="lesionTableHeaderRow">
|
<div class="lesionTableHeaderRow">
|
||||||
<div class="add">
|
<div class="add js-setTool">
|
||||||
<svg>
|
<svg>
|
||||||
<use xlink:href=/packages/lesiontracker/assets/icons.svg#icon-ui-add></use>
|
<use xlink:href=/packages/lesiontracker/assets/icons.svg#icon-ui-add></use>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
@ -1,38 +1,75 @@
|
|||||||
|
const toolTypesById = {
|
||||||
|
target: 'bidirectional',
|
||||||
|
nonTarget: 'nonTarget',
|
||||||
|
newLesion: 'bidirectional'
|
||||||
|
};
|
||||||
|
|
||||||
|
const namesById = {
|
||||||
|
target: 'Targets',
|
||||||
|
nonTarget: 'Non-Targets',
|
||||||
|
newLesion: 'New Lesions'
|
||||||
|
};
|
||||||
|
|
||||||
|
Template.lesionTableHeaderRow.onCreated(() => {
|
||||||
|
const instance = Template.instance();
|
||||||
|
instance.maxNumLesions = new ReactiveVar();
|
||||||
|
|
||||||
|
if (!instance.data.currentTimepointId) {
|
||||||
|
console.warn('Case has no timepointId');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Give the header a proper name
|
||||||
|
instance.data.type = namesById[instance.data.id];
|
||||||
|
|
||||||
|
const currentTimepointId = instance.data.currentTimepointId;
|
||||||
|
const timepoint = Timepoints.findOne({
|
||||||
|
timepointId: currentTimepointId
|
||||||
|
});
|
||||||
|
|
||||||
|
const timepointType = timepoint.timepointType;
|
||||||
|
|
||||||
|
// TODO: Check if we have criteria where maximum limits are applied to
|
||||||
|
// Non-Targets and/or New Lesions
|
||||||
|
if (timepointType === 'baseline' && instance.data.id === 'target') {
|
||||||
|
instance.autorun(() => {
|
||||||
|
// Identify which Trial Conformance Criteria are currently being used
|
||||||
|
// Note that there may be more than one.
|
||||||
|
const criteriaTypes = TrialCriteriaTypes.find({
|
||||||
|
selected: true
|
||||||
|
}).map(function(criteria) {
|
||||||
|
return criteria.id;
|
||||||
|
});
|
||||||
|
|
||||||
|
const currentConstraints = getTrialCriteriaConstraints(criteriaTypes);
|
||||||
|
if (!currentConstraints) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Fix Trial Conformance Criteria, it appears that totalNumberOfLesions
|
||||||
|
// is applied to both Targets and Non-Targets, when it should typically only be
|
||||||
|
// for Targets
|
||||||
|
const criteria = currentConstraints[timepointType];
|
||||||
|
const maxNumLesions = criteria.group.totalNumberOfLesions.numericality.lessThanOrEqualTo;
|
||||||
|
instance.maxNumLesions.set(maxNumLesions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Template.lesionTableHeaderRow.helpers({
|
Template.lesionTableHeaderRow.helpers({
|
||||||
numberOfLesions: function() {
|
numberOfLesions: function() {
|
||||||
var instance = Template.instance();
|
const instance = Template.instance();
|
||||||
return instance.data.measurements.count();
|
return instance.data.measurements.count();
|
||||||
},
|
},
|
||||||
maxNumLesions: function() {
|
maxNumLesions: function() {
|
||||||
var instance = Template.instance();
|
return Template.instance().maxNumLesions.get();
|
||||||
var lesionType = instance.id;
|
|
||||||
|
|
||||||
// TODO: Check what we are annotating
|
|
||||||
var timepointType = 'baseline';
|
|
||||||
|
|
||||||
// Identify which Trial Conformance Criteria are currently being used
|
|
||||||
// Note that there may be more than one.
|
|
||||||
var criteriaTypes = TrialCriteriaTypes.find({
|
|
||||||
selected: true
|
|
||||||
}).map(function(criteria) {
|
|
||||||
return criteria.id;
|
|
||||||
});
|
|
||||||
|
|
||||||
var currentConstraints = getTrialCriteriaConstraints(criteriaTypes);
|
|
||||||
if (!currentConstraints) {
|
|
||||||
// For testing
|
|
||||||
return 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
var criteria = currentConstraints[timepointType][lesionType];
|
|
||||||
|
|
||||||
return criteria.group.totalNumberOfLesions;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.lesionTableHeaderRow.events({
|
Template.lesionTableHeaderRow.events({
|
||||||
'click .add': function() {
|
'click .js-setTool': function(event, instance) {
|
||||||
console.log('Add was clicked');
|
const id = instance.data.id;
|
||||||
// TODO: Set active tool to new type
|
const toolType = toolTypesById[id];
|
||||||
|
toolManager.setActiveTool(toolType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -34,6 +34,12 @@ $headerRowHeight = 63px
|
|||||||
height: $headerRowHeight
|
height: $headerRowHeight
|
||||||
max-width: 11px
|
max-width: 11px
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
fill: $hoverColor
|
||||||
|
|
||||||
|
&:active
|
||||||
|
fill: $activeColor
|
||||||
|
|
||||||
.type
|
.type
|
||||||
color: $textSecondaryColor
|
color: $textSecondaryColor
|
||||||
font-size: 22px
|
font-size: 22px
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
<template name="lesionTableView">
|
<template name="lesionTableView">
|
||||||
<div class="lesionTableView scrollArea">
|
<div class="lesionTableView scrollArea">
|
||||||
{{>lesionTableHeaderRow id="target" type="Targets" measurements=targets}}
|
{{>lesionTableHeaderRow id="target" measurements=targets currentTimepointId=currentTimepointId}}
|
||||||
{{#each target in targets}}
|
{{#each target in targets}}
|
||||||
{{>lesionTableRow (extend this rowItem=target)}}
|
{{>lesionTableRow (extend this rowItem=target)}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
{{>lesionTableHeaderRow id="nonTarget" type="Non-targets" measurements=nonTargets}}
|
{{>lesionTableHeaderRow id="nonTarget" measurements=nonTargets currentTimepointId=currentTimepointId}}
|
||||||
{{#each nonTarget in nonTargets}}
|
{{#each nonTarget in nonTargets}}
|
||||||
{{>lesionTableRow (extend this rowItem=nonTarget)}}
|
{{>lesionTableRow (extend this rowItem=nonTarget)}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
{{>lesionTableHeaderRow id="newLesions" type="New lesions" measurements=newLesions}}
|
{{>lesionTableHeaderRow id="newLesion" measurements=newLesions currentTimepointId=currentTimepointId}}
|
||||||
{{#each newLesion in newLesions}}
|
{{#each newLesion in newLesions}}
|
||||||
{{>lesionTableRow (extend this rowItem=newLesion)}}
|
{{>lesionTableRow (extend this rowItem=newLesion)}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
@ -340,7 +340,8 @@ getTrialCriteriaConstraints = function(criteriaTypes, imageId) {
|
|||||||
var criteria;
|
var criteria;
|
||||||
if (!imageId) {
|
if (!imageId) {
|
||||||
criteria = TrialCriteriaConstraints[criteriaType]();
|
criteria = TrialCriteriaConstraints[criteriaType]();
|
||||||
return criteria;
|
allCriteria.push(criteria);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, retrieve the series metaData to identify the modality of the image
|
// Otherwise, retrieve the series metaData to identify the modality of the image
|
||||||
|
|||||||
@ -27,7 +27,7 @@ openNewTabWithTimepoint = function(timepointId, title) {
|
|||||||
// Update the ViewerData global object
|
// Update the ViewerData global object
|
||||||
ViewerData[contentId] = {
|
ViewerData[contentId] = {
|
||||||
title: title,
|
title: title,
|
||||||
contentId: contentId,
|
contentid: contentId,
|
||||||
studyInstanceUids: data.studyInstanceUids,
|
studyInstanceUids: data.studyInstanceUids,
|
||||||
timepointIds: data.timepointIds,
|
timepointIds: data.timepointIds,
|
||||||
currentTimepointId: timepointId
|
currentTimepointId: timepointId
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user