ohif-viewer/Packages/ohif-study-list/client/lib/studylist.js
2017-01-29 22:11:17 -02:00

31 lines
799 B
JavaScript

import { Viewerbase } from 'meteor/ohif:viewerbase';
StudyList = {
functions: {},
callbacks: {}
};
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);
}
let currentServerChangeHandlerFirstRun = true;
const currentServerChangeHandler = () => {
if (currentServerChangeHandlerFirstRun) {
currentServerChangeHandlerFirstRun = false;
return;
}
switchToTab('studylistTab');
};
CurrentServer.find().observe({
added: currentServerChangeHandler,
changed: currentServerChangeHandler
});