Improving response criteria mechanism
This commit is contained in:
parent
6edd34ea5e
commit
6e2dfacd3a
@ -156,9 +156,6 @@ class ConformanceCriteria {
|
||||
|
||||
const promise = OHIF.studylist.retrieveStudyMetadata(studyInstanceUid);
|
||||
promise.then(study => {
|
||||
cornerstone.loadImage(imageId).then(image => {
|
||||
console.warn('>>>>LOADED', image);
|
||||
});
|
||||
const metadata = OHIF.viewer.metadataProvider.getMetadata(imageId);
|
||||
data[measurementType].push({
|
||||
measurement,
|
||||
@ -179,6 +176,10 @@ class ConformanceCriteria {
|
||||
});
|
||||
}
|
||||
|
||||
static setEvaluationDefinitions(evaluationKey, evaluationDefinitions) {
|
||||
evaluations[evaluationKey] = evaluationDefinitions;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
OHIF.measurements.ConformanceCriteria = ConformanceCriteria;
|
||||
|
||||
@ -79,4 +79,8 @@ export class CriteriaEvaluator {
|
||||
return nonconformities;
|
||||
}
|
||||
|
||||
static setCriterion(criterionKey, criterionDefinitions) {
|
||||
Criteria[criterionKey] = criterionDefinitions;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,13 +10,34 @@ export const MaxTargetsSchema = {
|
||||
minimum: 1
|
||||
}
|
||||
},
|
||||
locationIn: {
|
||||
label: 'Filter to evaluate only measurements with the specified locations',
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string'
|
||||
},
|
||||
minItems: 1,
|
||||
uniqueItems: true
|
||||
},
|
||||
locationNotIn: {
|
||||
label: 'Filter to evaluate only measurements without the specified locations',
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string'
|
||||
},
|
||||
minItems: 1,
|
||||
uniqueItems: true
|
||||
},
|
||||
required: ['limit']
|
||||
};
|
||||
|
||||
/* MaxTargetsCriterion
|
||||
* Check if the number of target measurements exceeded the limit allowed
|
||||
* Options
|
||||
* Options:
|
||||
* limit: Max targets allowed in study
|
||||
* locationIn: Filter to evaluate only measurements with the specified locations
|
||||
* locationNotIn: Filter to evaluate only measurements without the specified locations
|
||||
* message: Message to be displayed in case of nonconformity
|
||||
*/
|
||||
export class MaxTargetsCriterion extends BaseCriterion {
|
||||
|
||||
@ -25,12 +46,17 @@ export class MaxTargetsCriterion extends BaseCriterion {
|
||||
}
|
||||
|
||||
evaluate(data) {
|
||||
const measurementNumbers = _.uniq(_.map(data.targets, target => {
|
||||
return target.measurement.measurementNumber;
|
||||
}));
|
||||
const { options } = this;
|
||||
const measurementNumbers = [];
|
||||
_.each(data.targets, target => {
|
||||
const { location } = target.measurement;
|
||||
if (options.locationIn && options.locationIn.indexOf(location) === -1) return;
|
||||
if (options.locationNotIn && options.locationNotIn.indexOf(location) > -1) return;
|
||||
measurementNumbers.push(target.measurement.measurementNumber);
|
||||
});
|
||||
|
||||
let message;
|
||||
if (measurementNumbers.length > this.options.limit) {
|
||||
let message = options.message;
|
||||
if (!message && measurementNumbers.length > this.options.limit) {
|
||||
message = `The study should not have more than ${this.options.limit} targets.`;
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ export const MaxTargetsPerOrganSchema = {
|
||||
/*
|
||||
* MaxTargetsPerOrganCriterion
|
||||
* Check if the number of target measurements per organ exceeded the limit allowed
|
||||
* Options
|
||||
* Options:
|
||||
* limit: Max targets allowed in study
|
||||
*/
|
||||
export class MaxTargetsPerOrganCriterion extends BaseCriterion {
|
||||
|
||||
@ -80,4 +80,4 @@ export class ModalityCriterion extends BaseCriterion {
|
||||
return this.generateResponse(message, measurements);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
import * as recistEvaluation from './recist.json';
|
||||
|
||||
export const recist = recistEvaluation;
|
||||
export const recist = recistEvaluation;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user