LT-290 Baseline and followup is never opened in 1x2 layout
- Fix a bug by passing the matched protocols with their scores to be used in getBestMatch function - Set timepointType property in studies array which is passed to the hanging protocol engine by matching their studyInstanceUid with timepoints - Update lesionTrackerHangingProtocol rules to show baseline and followup properly
This commit is contained in:
parent
5cbf08ea4f
commit
c7089416bc
@ -65,6 +65,22 @@ Template.viewer.onCreated(() => {
|
|||||||
instance.data.timepointApi = new OHIF.measurements.TimepointApi(instance.data.currentTimepointId);
|
instance.data.timepointApi = new OHIF.measurements.TimepointApi(instance.data.currentTimepointId);
|
||||||
const timepointsPromise = instance.data.timepointApi.retrieveTimepoints();
|
const timepointsPromise = instance.data.timepointApi.retrieveTimepoints();
|
||||||
timepointsPromise.then(() => {
|
timepointsPromise.then(() => {
|
||||||
|
const timepoints = instance.data.timepointApi.all();
|
||||||
|
|
||||||
|
// Set timepointType in studies to be used in hanging protocol engine
|
||||||
|
timepoints.forEach(function(timepoint) {
|
||||||
|
timepoint.studyInstanceUids.forEach(function(studyInstanceUid) {
|
||||||
|
const study = _.find(instance.data.studies, function (element) {
|
||||||
|
return element.studyInstanceUid === studyInstanceUid;
|
||||||
|
});
|
||||||
|
if (!study) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
study.timepointType = timepoint.timepointType;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
Session.set('TimepointsReady', true);
|
Session.set('TimepointsReady', true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +1,11 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
// Define Baseline protocol
|
// Define Baseline protocol
|
||||||
var proto = new HP.Protocol('LT_Baseline');
|
var proto = new HP.Protocol('LT_Baseline');
|
||||||
proto.locked = true;
|
proto.locked = true;
|
||||||
|
|
||||||
var studyDescription = new HP.ProtocolMatchingRule();
|
|
||||||
studyDescription.required = true;
|
|
||||||
studyDescription.attribute = 'studyDescription';
|
|
||||||
studyDescription.constraint = {
|
|
||||||
contains: {
|
|
||||||
value: 'CT'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var isBaseline = new HP.ProtocolMatchingRule();
|
var isBaseline = new HP.ProtocolMatchingRule();
|
||||||
isBaseline.required = true;
|
isBaseline.required = true;
|
||||||
|
isBaseline.weight = 1;
|
||||||
isBaseline.attribute = 'timepointType';
|
isBaseline.attribute = 'timepointType';
|
||||||
isBaseline.constraint = {
|
isBaseline.constraint = {
|
||||||
equals: {
|
equals: {
|
||||||
@ -20,7 +13,6 @@ isBaseline.constraint = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
proto.addProtocolMatchingRule(studyDescription);
|
|
||||||
proto.addProtocolMatchingRule(isBaseline);
|
proto.addProtocolMatchingRule(isBaseline);
|
||||||
|
|
||||||
var oneByOne = new HP.ViewportStructure('grid', {
|
var oneByOne = new HP.ViewportStructure('grid', {
|
||||||
@ -40,26 +32,7 @@ baseline.constraint = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var body = new HP.SeriesMatchingRule();
|
|
||||||
body.attribute = 'seriesDescription';
|
|
||||||
body.weight = 5;
|
|
||||||
body.constraint = {
|
|
||||||
contains: {
|
|
||||||
value: 'Body'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var chest = new HP.SeriesMatchingRule();
|
|
||||||
chest.attribute = 'seriesDescription';
|
|
||||||
chest.constraint = {
|
|
||||||
contains: {
|
|
||||||
value: 'CHEST'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
single.studyMatchingRules.push(baseline);
|
single.studyMatchingRules.push(baseline);
|
||||||
single.seriesMatchingRules.push(body);
|
|
||||||
single.seriesMatchingRules.push(chest);
|
|
||||||
|
|
||||||
var first = new HP.Stage(oneByOne, 'oneByOne');
|
var first = new HP.Stage(oneByOne, 'oneByOne');
|
||||||
first.viewports.push(single);
|
first.viewports.push(single);
|
||||||
@ -69,22 +42,14 @@ proto.addStage(first);
|
|||||||
HP.lesionTrackerBaselineProtocol = proto;
|
HP.lesionTrackerBaselineProtocol = proto;
|
||||||
HP.lesionTrackerBaselineProtocol.id = 'lesionTrackerBaselineProtocol';
|
HP.lesionTrackerBaselineProtocol.id = 'lesionTrackerBaselineProtocol';
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
// Define Followup Protocol
|
// Define Followup Protocol
|
||||||
var proto = new HP.Protocol('LT_BaselineFollowup');
|
var proto = new HP.Protocol('LT_BaselineFollowup');
|
||||||
proto.locked = true;
|
proto.locked = true;
|
||||||
|
|
||||||
var studyDescription = new HP.ProtocolMatchingRule();
|
|
||||||
studyDescription.required = true;
|
|
||||||
studyDescription.attribute = 'studyDescription';
|
|
||||||
studyDescription.constraint = {
|
|
||||||
contains: {
|
|
||||||
value: 'CT'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var isFollowup = new HP.ProtocolMatchingRule();
|
var isFollowup = new HP.ProtocolMatchingRule();
|
||||||
isFollowup.required = true;
|
isFollowup.required = true;
|
||||||
|
isFollowup.weight = 2;
|
||||||
isFollowup.attribute = 'timepointType';
|
isFollowup.attribute = 'timepointType';
|
||||||
isFollowup.constraint = {
|
isFollowup.constraint = {
|
||||||
equals: {
|
equals: {
|
||||||
@ -92,7 +57,6 @@ isFollowup.constraint = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
proto.addProtocolMatchingRule(studyDescription);
|
|
||||||
proto.addProtocolMatchingRule(isFollowup);
|
proto.addProtocolMatchingRule(isFollowup);
|
||||||
|
|
||||||
var oneByTwo = new HP.ViewportStructure('grid', {
|
var oneByTwo = new HP.ViewportStructure('grid', {
|
||||||
@ -122,30 +86,8 @@ followup.constraint = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var body = new HP.SeriesMatchingRule();
|
left.studyMatchingRules.push(followup);
|
||||||
body.attribute = 'seriesDescription';
|
right.studyMatchingRules.push(baseline);
|
||||||
body.weight = 5;
|
|
||||||
body.constraint = {
|
|
||||||
contains: {
|
|
||||||
value: 'Body'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var chest = new HP.SeriesMatchingRule();
|
|
||||||
chest.attribute = 'seriesDescription';
|
|
||||||
chest.constraint = {
|
|
||||||
contains: {
|
|
||||||
value: 'CHEST'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
left.studyMatchingRules.push(baseline);
|
|
||||||
//left.seriesMatchingRules.push(body);
|
|
||||||
//left.seriesMatchingRules.push(chest);
|
|
||||||
|
|
||||||
right.studyMatchingRules.push(followup);
|
|
||||||
//right.seriesMatchingRules.push(body);
|
|
||||||
//right.seriesMatchingRules.push(chest);
|
|
||||||
|
|
||||||
var first = new HP.Stage(oneByTwo, 'oneByTwo');
|
var first = new HP.Stage(oneByTwo, 'oneByTwo');
|
||||||
first.viewports.push(left);
|
first.viewports.push(left);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user