LT-115: Grouping tools schemas

This commit is contained in:
Bruno Alves de Faria committed 2017-01-02 16:32:09 -02:00
1 parent 0e857d3520
commit bd748eae32
14 files changed
+134 -59

No files matched your search

@@ -1,15 +1,9 @@
import { target } from './target';
import { targetCR } from './targetCR';
import { targetUN } from './targetUN';
import { nonTarget } from './nonTarget';
import { length } from './length';
import { ellipse } from './ellipse';
import { targets } from './toolGroups/targets';
import { nonTargets } from './toolGroups/nonTargets';
import { temp } from './toolGroups/temp';
export const measurementTools = [
target,
targetCR,
targetUN,
nonTarget,
length,
ellipse
targets,
nonTargets,
temp
];
@@ -0,0 +1,20 @@
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { nonTarget } from '../tools/nonTarget';
const NonTargetSchema = new SimpleSchema({
toolId: {
type: String,
label: 'Tool ID'
},
toolItemUid: {
type: String,
label: 'Tool Item UID'
}
});
export const nonTargets = {
id: 'nonTargets',
name: 'Non-Targets',
childTools: [nonTarget],
schema: NonTargetSchema
};
@@ -0,0 +1,22 @@
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { bidirectional } from '../tools/bidirectional';
import { targetCR } from '../tools/targetCR';
import { targetUN } from '../tools/targetUN';
const TargetSchema = new SimpleSchema({
toolId: {
type: String,
label: 'Tool ID'
},
toolItemUid: {
type: String,
label: 'Tool Item UID'
}
});
export const targets = {
id: 'targets',
name: 'Targets',
childTools: [bidirectional, targetCR, targetUN],
schema: TargetSchema
};
@@ -0,0 +1,21 @@
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { length } from '../tools/length';
import { ellipse } from '../tools/ellipse';
const TempSchema = new SimpleSchema({
toolId: {
type: String,
label: 'Tool ID'
},
toolItemUid: {
type: String,
label: 'Tool Item UID'
}
});
export const temp = {
id: 'temp',
name: 'Temporary',
childTools: [length, ellipse],
schema: TempSchema
};
@@ -3,7 +3,7 @@ import { MeasurementSchemaTypes } from 'meteor/ohif:measurements/both/schema/mea
const CornerstoneHandleSchema = MeasurementSchemaTypes.CornerstoneHandleSchema;
const TargetHandlesSchema = new SimpleSchema({
const BidirectionalHandlesSchema = new SimpleSchema({
start: {
type: CornerstoneHandleSchema,
label: 'Start'
@@ -26,11 +26,15 @@ const TargetHandlesSchema = new SimpleSchema({
},
});
const TargetSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
const BidirectionalSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMeasurement, {
handles: {
type: TargetHandlesSchema,
type: BidirectionalHandlesSchema,
label: 'Handles'
},
measurementNumber: {
type: Number,
label: 'Measurement Number'
},
location: {
type: String,
label: 'Location',
@@ -58,7 +62,7 @@ const TargetSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolMea
}
}]);
function displayFunction(data) {
const displayFunction = data => {
// Check whether this is a Nodal or Extranodal Measurement
// const targetType = 'target';
// const nodalType = data.isNodal ? 'nodal' : 'extraNodal';
@@ -79,19 +83,18 @@ function displayFunction(data) {
}
return data.longestDiameter;
}
};
export const target = {
id: 'targets',
name: 'Targets',
export const bidirectional = {
toolGroup: 'targets',
cornerstoneToolType: 'bidirectional',
schema: TargetSchema,
schema: BidirectionalSchema,
options: {
showInMeasurementTable: true,
measurementTableOptions: {
key: 'targets',
displayFunction: displayFunction
measurementTable: {
displayFunction
},
includeInCaseProgress: true,
caseProgress: {
include: true
}
}
};
@@ -23,6 +23,10 @@ const NonTargetSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneTool
type: NonTargetHandlesSchema,
label: 'Handles'
},
measurementNumber: {
type: Number,
label: 'Measurement Number'
},
response: {
type: String,
label: 'Response',
@@ -40,21 +44,16 @@ const NonTargetSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneTool
}
}]);
function displayFunction(data) {
return data.response;
}
export const nonTarget = {
id: 'nonTargets',
name: 'Non-Targets',
toolGroup: 'nonTargets',
cornerstoneToolType: 'nonTarget',
schema: NonTargetSchema,
displayFunction: displayFunction,
options: {
showInMeasurementTable: true,
measurementTableOptions: {
displayFunction: displayFunction
measurementTable: {
displayFunction: data => data.response
},
includeInCaseProgress: true,
caseProgress: {
include: true
}
}
};
@@ -23,11 +23,20 @@ const TargetCRSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolM
type: TargetCRHandlesSchema,
label: 'Handles'
},
measurementNumber: {
type: Number,
label: 'Measurement Number'
},
location: {
type: String,
label: 'Location',
optional: true
},
response: {
type: String,
label: 'Response',
optional: true // Optional because it is added after initial drawing, via a callback
},
description: {
type: String,
label: 'Description',
@@ -40,17 +49,16 @@ const TargetCRSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolM
}
}]);
function displayFunction(data) {
return data.location;
}
export const targetCR = {
id: 'targetsCR',
memberOf: 'targets',
name: 'CR Targets',
toolGroup: 'targets',
cornerstoneToolType: 'targetCR',
schema: TargetCRSchema,
options: {
includeInCaseProgress: true,
measurementTable: {
displayFunction: data => data.response
},
caseProgress: {
include: true
}
}
};
@@ -23,11 +23,20 @@ const TargetUNSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolM
type: TargetUNHandlesSchema,
label: 'Handles'
},
measurementNumber: {
type: Number,
label: 'Measurement Number'
},
location: {
type: String,
label: 'Location',
optional: true
},
response: {
type: String,
label: 'Response',
optional: true // Optional because it is added after initial drawing, via a callback
},
description: {
type: String,
label: 'Description',
@@ -40,17 +49,16 @@ const TargetUNSchema = new SimpleSchema([MeasurementSchemaTypes.CornerstoneToolM
}
}]);
function displayFunction(data) {
return data.location;
}
export const targetUN = {
id: 'targetsUN',
memberOf: 'targets',
name: 'UN Targets',
toolGroup: 'targets',
cornerstoneToolType: 'targetUN',
schema: TargetUNSchema,
options: {
includeInCaseProgress: true,
measurementTable: {
displayFunction: data => data.response
},
caseProgress: {
include: true
}
}
};