Replacing switchToTab with routes

This commit is contained in:
Bruno Alves de Faria committed 2017-03-21 10:16:47 -03:00
1 parent 0cf4dbf13f
commit 7718d31a77
46 files changed
+358 -753

No files matched your search

@@ -10,7 +10,7 @@ import { OHIF } from 'meteor/ohif:core';
OHIF.lesiontracker.openNewTabWithTimepoint = timepointId => {
const contentId = 'viewerTab';
const Timepoints = StudyList.timepointApi.timepoints;
const Timepoints = OHIF.studylist.timepointApi.timepoints;
const timepoint = Timepoints.findOne({
timepointId: timepointId
});
@@ -25,10 +25,8 @@ OHIF.lesiontracker.openNewTabWithTimepoint = timepointId => {
throw 'No studies found that are related to this timepoint';
}
ViewerData = window.ViewerData || ViewerData;
// Update the ViewerData global object
ViewerData[contentId] = {
// Update the OHIF.viewer.data global object
OHIF.viewer.data = {
contentId: contentId,
studyInstanceUids: data.studyInstanceUids,
timepointIds: data.timepointIds,
@@ -59,7 +57,7 @@ function getDataFromTimepoint(timepoint) {
// Otherwise, this is a follow-up exam, so we should also find the baseline timepoint,
// and all studies related to it. We also enforce that the Baseline should have a studyDate
// prior to the latest studyDate in the current (Follow-up) Timepoint.
const Timepoints = StudyList.timepointApi.timepoints;
const Timepoints = OHIF.studylist.timepointApi.timepoints;
const baseline = Timepoints.findOne({
timepointType: 'baseline',
patientId: timepoint.patientId,
@@ -2,11 +2,11 @@ import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
Meteor.startup(function() {
StudyList.callbacks.dblClickOnStudy = dblClickOnStudy;
StudyList.callbacks.middleClickOnStudy = dblClickOnStudy;
OHIF.studylist.callbacks.dblClickOnStudy = dblClickOnStudy;
OHIF.studylist.callbacks.middleClickOnStudy = dblClickOnStudy;
StudyList.timepointApi = new OHIF.measurements.TimepointApi();
StudyList.timepointApi.retrieveTimepoints();
OHIF.studylist.timepointApi = new OHIF.measurements.TimepointApi();
OHIF.studylist.timepointApi.retrieveTimepoints();
});
/**
@@ -14,7 +14,7 @@ Meteor.startup(function() {
*/
const dblClickOnStudy = data => {
// Find the relevant timepoint given the clicked-on study
const timepointApi = StudyList.timepointApi;
const timepointApi = OHIF.studylist.timepointApi;
if (!timepointApi) {
OHIF.log.warn('No timepoint api on dbl-clicked study?');
return;
@@ -37,10 +37,8 @@ const dblClickOnStudy = data => {
const openTab = studyInstanceUid => {
const contentId = 'viewerTab';
ViewerData = window.ViewerData || ViewerData;
// Update the ViewerData global object
ViewerData[contentId] = {
// Update the OHIF.viewer.data global object
OHIF.viewer.data = {
contentId: contentId,
isUnassociatedStudy: true,
studyInstanceUids: [studyInstanceUid]