diff --git a/LesionTracker/client/components/viewer/viewer.js b/LesionTracker/client/components/viewer/viewer.js index a3817bb41..1b87b9f7c 100644 --- a/LesionTracker/client/components/viewer/viewer.js +++ b/LesionTracker/client/components/viewer/viewer.js @@ -92,7 +92,7 @@ Template.viewer.onCreated(() => { OHIF.log.info('Setting default ViewerData'); OHIF.viewer.loadedSeriesData = {}; ViewerData[contentId].loadedSeriesData = {}; - Session.set('ViewerData', ViewerData); + Session.setPersistent('ViewerData', ViewerData); } Session.set('activeViewport', ViewerData[contentId].activeViewport || false); diff --git a/LesionTracker/client/routes.js b/LesionTracker/client/routes.js index 2c9b9ea01..ac8a8e6c2 100644 --- a/LesionTracker/client/routes.js +++ b/LesionTracker/client/routes.js @@ -15,9 +15,7 @@ Router.configure({ Router.onBeforeAction('loading'); -const data = { - additionalTemplates: [] -}; +const data = {}; const routerOptions = { data }; @@ -29,7 +27,7 @@ Router.route('/', function() { } else { const contentId = Session.get('activeContentId'); if (!contentId) { - Session.set('activeContentId', 'studylistTab'); + Session.setPersistent('activeContentId', 'studylistTab'); } this.render('app', routerOptions); diff --git a/OHIFViewer/client/head.html b/OHIFViewer/client/head.html index 7fc632e9a..e27ae1f97 100644 --- a/OHIFViewer/client/head.html +++ b/OHIFViewer/client/head.html @@ -3,6 +3,7 @@ OHIF Viewer + diff --git a/OHIFViewer/public/images/logo.png b/OHIFViewer/public/images/logo.png new file mode 100644 index 000000000..fc83b1354 Binary files /dev/null and b/OHIFViewer/public/images/logo.png differ diff --git a/Packages/ohif-lesiontracker/client/lib/studylist/openNewTabWithTimepoint.js b/Packages/ohif-lesiontracker/client/lib/studylist/openNewTabWithTimepoint.js index 75e1391a3..3b5900362 100644 --- a/Packages/ohif-lesiontracker/client/lib/studylist/openNewTabWithTimepoint.js +++ b/Packages/ohif-lesiontracker/client/lib/studylist/openNewTabWithTimepoint.js @@ -7,7 +7,7 @@ import { OHIF } from 'meteor/ohif:core'; * @param timepointId The UID of the Timepoint to be opened * @param title The title to be used for the tab heading */ -OHIF.lesiontracker.openNewTabWithTimepoint = (timepointId, title) => { +OHIF.lesiontracker.openNewTabWithTimepoint = timepointId => { const contentId = 'viewerTab'; const Timepoints = StudyList.timepointApi.timepoints; @@ -29,7 +29,6 @@ OHIF.lesiontracker.openNewTabWithTimepoint = (timepointId, title) => { // Update the ViewerData global object ViewerData[contentId] = { - title: title, contentId: contentId, studyInstanceUids: data.studyInstanceUids, timepointIds: data.timepointIds, diff --git a/Packages/ohif-lesiontracker/client/lib/studylist/studylistModification.js b/Packages/ohif-lesiontracker/client/lib/studylist/studylistModification.js index 2ecc2b964..969d548c4 100644 --- a/Packages/ohif-lesiontracker/client/lib/studylist/studylistModification.js +++ b/Packages/ohif-lesiontracker/client/lib/studylist/studylistModification.js @@ -1,9 +1,9 @@ +import { Meteor } from 'meteor/meteor'; import { OHIF } from 'meteor/ohif:core'; -import { Viewerbase } from 'meteor/ohif:viewerbase'; Meteor.startup(function() { - StudyList.callbacks['dblClickOnStudy'] = dblClickOnStudy; - StudyList.callbacks['middleClickOnStudy'] = dblClickOnStudy; + StudyList.callbacks.dblClickOnStudy = dblClickOnStudy; + StudyList.callbacks.middleClickOnStudy = dblClickOnStudy; StudyList.timepointApi = new OHIF.measurements.TimepointApi(); StudyList.timepointApi.retrieveTimepoints(); @@ -12,28 +12,21 @@ Meteor.startup(function() { /** * Lesion Tracker method including Timepoints / other studies */ -function dblClickOnStudy(data) { - // Use the formatPN template helper to clean up the patient name - let title = Viewerbase.helpers.formatPN(data.patientName); - - const instance = Template.instance(); - +const dblClickOnStudy = data => { // Find the relevant timepoint given the clicked-on study const timepointApi = StudyList.timepointApi; if (!timepointApi) { - console.log('No timepoint api on dbl-clicked study?'); + OHIF.log.warn('No timepoint api on dbl-clicked study?'); return; } const timepoint = timepointApi.study(data.studyInstanceUid)[0]; if (timepoint) { - // Add the Timepoint name to the Patient name to create the tab title - title += ' ' + timepointApi.name(timepoint); - OHIF.lesiontracker.openNewTabWithTimepoint(timepoint.timepointId, title); + OHIF.lesiontracker.openNewTabWithTimepoint(timepoint.timepointId); } else { - open(data.studyInstanceUid, title); + openTab(data.studyInstanceUid); } -} +}; /** * Opens a study @@ -41,14 +34,13 @@ function dblClickOnStudy(data) { * @param studyInstanceUid The UID of the Study to be opened * @param title The title to be used for the tab heading */ -function open(studyInstanceUid, title) { +const openTab = studyInstanceUid => { const contentId = 'viewerTab'; ViewerData = window.ViewerData || ViewerData; // Update the ViewerData global object ViewerData[contentId] = { - title: title, contentId: contentId, isUnassociatedStudy: true, studyInstanceUids: [studyInstanceUid] @@ -56,4 +48,4 @@ function open(studyInstanceUid, title) { // Switch to the new tab switchToTab(contentId); -} +}; diff --git a/Packages/ohif-measurements/client/components/longitudinal/dropdown.js b/Packages/ohif-measurements/client/components/longitudinal/dropdown.js index 1e21d67e4..a37c90838 100644 --- a/Packages/ohif-measurements/client/components/longitudinal/dropdown.js +++ b/Packages/ohif-measurements/client/components/longitudinal/dropdown.js @@ -43,7 +43,6 @@ const viewStudies = () => { return; } - const title = selectedStudies[0].patientName; const studyInstanceUids = selectedStudies.map(study => study.studyInstanceUid); const contentId = 'viewerTab'; @@ -51,7 +50,6 @@ const viewStudies = () => { // Update the ViewerData global object ViewerData[contentId] = { - title: title, contentId: contentId, studyInstanceUids: studyInstanceUids }; diff --git a/Packages/ohif-study-list/client/components/studyContextMenu/index.js b/Packages/ohif-study-list/client/components/studyContextMenu/index.js deleted file mode 100644 index e4a89ca87..000000000 --- a/Packages/ohif-study-list/client/components/studyContextMenu/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import './studyContextMenu.html'; -import './studyContextMenu.js'; diff --git a/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.html b/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.html deleted file mode 100644 index 79bbbf412..000000000 --- a/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.html +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.js b/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.js deleted file mode 100644 index 3125edcb6..000000000 --- a/Packages/ohif-study-list/client/components/studyContextMenu/studyContextMenu.js +++ /dev/null @@ -1,23 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { OHIF } from 'meteor/ohif:core'; - -Meteor.startup(() => { - OHIF.studylist.dropdown.setItems([{ - action: OHIF.studylist.viewSeriesDetails, - text: 'View Series Details' - }, { - text: 'Anonymize', - disabled: true - }, { - text: 'Send', - disabled: true, - separatorAfter: true - }, { - text: 'Delete', - disabled: true - }, { - action: OHIF.studylist.exportSelectedStudies, - text: 'Export', - title: 'Export Selected Studies' - }]); -}); diff --git a/Packages/ohif-study-list/client/components/studylist/studylist.html b/Packages/ohif-study-list/client/components/studylist/studylist.html index 10e47b76c..4e51ec4c0 100644 --- a/Packages/ohif-study-list/client/components/studylist/studylist.html +++ b/Packages/ohif-study-list/client/components/studylist/studylist.html @@ -10,7 +10,4 @@ - {{#each templateName in additionalTemplates}} - {{>Template.dynamic template=templateName}} - {{/each}} diff --git a/Packages/ohif-study-list/client/components/studylist/studylist.js b/Packages/ohif-study-list/client/components/studylist/studylist.js index 130989f79..df7e47527 100644 --- a/Packages/ohif-study-list/client/components/studylist/studylist.js +++ b/Packages/ohif-study-list/client/components/studylist/studylist.js @@ -31,7 +31,7 @@ Template.studylist.onRendered(() => { const instance = Template.instance(); if (instance.data && instance.data.studyInstanceUid) { const studyInstanceUid = instance.data.studyInstanceUid; - openNewTab(studyInstanceUid, studyInstanceUid); + openNewTab(studyInstanceUid); } else { // If there is a tab set as active in the Session, // switch to that now. diff --git a/Packages/ohif-study-list/client/lib/openNewTab.js b/Packages/ohif-study-list/client/lib/openNewTab.js index 8c4841555..07f84399d 100644 --- a/Packages/ohif-study-list/client/lib/openNewTab.js +++ b/Packages/ohif-study-list/client/lib/openNewTab.js @@ -1,22 +1,23 @@ +import { Random } from 'meteor/random'; +import { OHIF } from 'meteor/ohif:core'; + /** * Opens a new tab in the tabbed studylist environment using * a given study and new tab title. * * @param studyInstanceUid The UID of the Study to be opened - * @param title The title to be used for the tab heading */ -openNewTab = function(studyInstanceUid, title) { - console.log('openNewTab'); - +const openNewTab = studyInstanceUid => { + OHIF.log.info('openNewTab'); + // Generate a unique ID to represent this tab // We can't just use the Mongo entry ID because // then it will change after hot-reloading. - var contentId = Random.id(); + const contentId = Random.id(); // Update the ViewerData global object ViewerData = window.ViewerData || ViewerData; ViewerData[contentId] = { - title: title, contentId: contentId, studyInstanceUids: [studyInstanceUid] }; diff --git a/Packages/ohif-study-list/client/lib/studylist.js b/Packages/ohif-study-list/client/lib/studylist.js index 977e7ccad..a3c5966d9 100644 --- a/Packages/ohif-study-list/client/lib/studylist.js +++ b/Packages/ohif-study-list/client/lib/studylist.js @@ -22,9 +22,7 @@ StudyList.callbacks.dblClickOnStudy = dblClickOnStudy; StudyList.callbacks.middleClickOnStudy = dblClickOnStudy; function dblClickOnStudy(data) { - // Use the formatPN template helper to clean up the patient name - var title = Viewerbase.helpers.formatPN(data.patientName); - openNewTab(data.studyInstanceUid, title); + openNewTab(data.studyInstanceUid); } let currentServerChangeHandlerFirstRun = true; diff --git a/Packages/ohif-user-management/client/lib/getName.js b/Packages/ohif-user-management/client/lib/getName.js index 2f0190a27..97914f8d8 100644 --- a/Packages/ohif-user-management/client/lib/getName.js +++ b/Packages/ohif-user-management/client/lib/getName.js @@ -2,6 +2,8 @@ import { Meteor } from 'meteor/meteor'; import { OHIF } from 'meteor/ohif:core'; OHIF.user.getName = () => { + const user = Meteor.user(); + if (!user) return ''; const nameSplit = Meteor.user().profile.fullName.split(' '); const lastName = nameSplit[nameSplit.length - 1]; nameSplit[nameSplit.length - 1] = lastName.substr(0, 1) + '.'; diff --git a/Packages/ohif-viewerbase/package.js b/Packages/ohif-viewerbase/package.js index 7aebf54cc..2e5bb940c 100644 --- a/Packages/ohif-viewerbase/package.js +++ b/Packages/ohif-viewerbase/package.js @@ -14,6 +14,7 @@ Package.onUse(function(api) { api.use('stylus'); api.use('momentjs:moment'); api.use('validatejs'); + api.use('u2622:persistent-session'); // Our custom packages api.use('ohif:design');