ohif-viewer/Packages/ohif-lesiontracker/client/lib/studylist/studylistModification.js

32 lines
1002 B
JavaScript
Raw Normal View History

import { Meteor } from 'meteor/meteor';
2017-03-17 02:39:41 +01:00
import { Router } from 'meteor/iron:router';
import { OHIF } from 'meteor/ohif:core';
Meteor.startup(function() {
if (!OHIF.studylist) return;
2017-03-15 22:46:07 +01:00
OHIF.studylist.callbacks.dblClickOnStudy = dblClickOnStudy;
OHIF.studylist.callbacks.middleClickOnStudy = dblClickOnStudy;
2017-03-15 22:46:07 +01:00
OHIF.studylist.timepointApi = new OHIF.measurements.TimepointApi();
});
/**
* Lesion Tracker method including Timepoints / other studies
*/
const dblClickOnStudy = data => {
// Find the relevant timepoint given the clicked-on study
2017-03-15 22:46:07 +01:00
const timepointApi = OHIF.studylist.timepointApi;
if (!timepointApi) {
OHIF.log.warn('No timepoint api on dbl-clicked study?');
return;
}
const timepoint = timepointApi.study(data.studyInstanceUid)[0];
if (timepoint) {
2017-03-17 02:39:41 +01:00
Router.go('viewerTimepoint', { timepointId: timepoint.timepointId });
} else {
2017-03-17 02:39:41 +01:00
Router.go('viewerStudies', { studyInstanceUids: data.studyInstanceUid });
}
};