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:
Evren Ozkan authored and Erik Ziegler committed 2016-11-15 08:24:30 +01:00
1 parent 5cbf08ea4f
commit c7089416bc
2 files changed
+22 -64

No files matched your search

@@ -65,6 +65,22 @@ Template.viewer.onCreated(() => {
instance.data.timepointApi = new OHIF.measurements.TimepointApi(instance.data.currentTimepointId);
const timepointsPromise = instance.data.timepointApi.retrieveTimepoints();
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);
});