Adjusting new targets criterion
This commit is contained in:
parent
0cb54a1e8c
commit
ef4a8d8684
@ -9,8 +9,8 @@
|
||||
{{/if}}
|
||||
<div class="type">{{toolGroup.name}}</div>
|
||||
<div class="max {{#if gt numberOfMeasurements maxNumMeasurements}}warning{{/if}}">
|
||||
{{#if and maxNumMeasurements (eq toolGroup.id 'targets')}}
|
||||
<p class="maxNumMeasurements">Max {{maxNumMeasurements}}</p>
|
||||
{{#if getMax toolGroup.id}}
|
||||
<p class="maxNumMeasurements">Max {{getMax toolGroup.id}}</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="numberOfMeasurements">{{numberOfMeasurements}}</div>
|
||||
|
||||
@ -9,11 +9,15 @@ Template.measurementTableHeaderRow.helpers({
|
||||
return measurementRows.length ? measurementRows.length : null;
|
||||
},
|
||||
|
||||
maxNumMeasurements() {
|
||||
getMax(toolGroupId) {
|
||||
const { conformanceCriteria } = Template.instance().data;
|
||||
if (!conformanceCriteria) return;
|
||||
|
||||
return conformanceCriteria.maxTargets.get();
|
||||
if (toolGroupId === 'targets') {
|
||||
return conformanceCriteria.maxTargets.get();
|
||||
} else if (toolGroupId === 'newTargets') {
|
||||
return conformanceCriteria.maxNewTargets.get();
|
||||
}
|
||||
},
|
||||
|
||||
anyUnmarkedLesionsLeft() {
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
@import "{ohif:design}/app"
|
||||
|
||||
.measurementTableView.scrollArea
|
||||
height: calc(100% - 105px)
|
||||
// height: calc(100% - 105px)
|
||||
height: calc(100% - 50px)
|
||||
overflow-x: hidden
|
||||
overflow-y: auto
|
||||
margin-right: -36px
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template name="measurementTableWarningsDialog">
|
||||
{{#dialogSimple (extend this dialogClass='modal-sm' title='Criteria nonconformities')}}
|
||||
{{#dialogSimple (extend this class='themed' dialogClass='modal-sm' title='Criteria nonconformities')}}
|
||||
<ol>
|
||||
{{#each message in this.messages}}
|
||||
<li>{{message}}</li>
|
||||
|
||||
@ -15,6 +15,7 @@ class ConformanceCriteria {
|
||||
this.nonconformities = new ReactiveVar();
|
||||
this.groupedNonConformities = new ReactiveVar();
|
||||
this.maxTargets = new ReactiveVar(null);
|
||||
this.maxNewTargets = new ReactiveVar(null);
|
||||
|
||||
const validate = _.debounce(trialCriteriaType => {
|
||||
if (!Session.get('MeasurementsReady')) return;
|
||||
@ -45,6 +46,7 @@ class ConformanceCriteria {
|
||||
mergedData.nonTargets = mergedData.nonTargets.concat(followupData.nonTargets);
|
||||
|
||||
this.maxTargets.set(null);
|
||||
this.maxNewTargets.set(null);
|
||||
const resultBoth = this.validateTimepoint('both', trialCriteriaType, mergedData);
|
||||
const resultBaseline = this.validateTimepoint('baseline', trialCriteriaType, baselineData);
|
||||
const resultFollowup = this.validateTimepoint('followup', trialCriteriaType, followupData);
|
||||
@ -101,11 +103,16 @@ class ConformanceCriteria {
|
||||
let nonconformities = [];
|
||||
|
||||
evaluators.forEach(evaluator => {
|
||||
const maxTargets = evaluator.getMaxTargets();
|
||||
const maxTargets = evaluator.getMaxTargets(false);
|
||||
const maxNewTargets = evaluator.getMaxTargets(true);
|
||||
if (maxTargets) {
|
||||
this.maxTargets.set(maxTargets);
|
||||
}
|
||||
|
||||
if (maxNewTargets) {
|
||||
this.maxNewTargets.set(maxNewTargets);
|
||||
}
|
||||
|
||||
const result = evaluator.evaluate(data);
|
||||
nonconformities = nonconformities.concat(result);
|
||||
});
|
||||
|
||||
@ -24,10 +24,11 @@ export class CriteriaEvaluator {
|
||||
});
|
||||
}
|
||||
|
||||
getMaxTargets() {
|
||||
getMaxTargets(newTarget=false) {
|
||||
let result = 0;
|
||||
_.each(this.criteria, criterion => {
|
||||
if (criterion instanceof Criteria.MaxTargetsCriterion) {
|
||||
const newTargetMatch = newTarget === !!criterion.options.newTarget;
|
||||
if (criterion instanceof Criteria.MaxTargetsCriterion && newTargetMatch) {
|
||||
const { limit } = criterion.options;
|
||||
if (limit > result) {
|
||||
result = limit;
|
||||
|
||||
@ -7,7 +7,7 @@ export const MaxTargetsSchema = {
|
||||
limit: {
|
||||
label: 'Max targets allowed in study',
|
||||
type: 'integer',
|
||||
minimum: 1
|
||||
minimum: 0
|
||||
},
|
||||
newTarget: {
|
||||
label: 'Flag to evaluate only new targets',
|
||||
@ -64,9 +64,11 @@ export class MaxTargetsCriterion extends BaseCriterion {
|
||||
});
|
||||
|
||||
let message;
|
||||
if (measurementNumbers.length > this.options.limit) {
|
||||
if (measurementNumbers.length > options.limit) {
|
||||
const increment = options.newTarget ? 'new ' : '';
|
||||
message = options.message || `The study should not have more than ${this.options.limit} ${increment}targets.`;
|
||||
const plural = options.limit === 1 ? '' : 's';
|
||||
const amount = options.limit === 0 ? '' : `more than ${options.limit}`;
|
||||
message = options.message || `The study should not have ${amount} ${increment}target${plural}.`;
|
||||
}
|
||||
|
||||
return this.generateResponse(message);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user