Isolating ohif:study-list package from measurements and lesiontracker
This commit is contained in:
parent
ddc45df4bd
commit
fda272fd7d
@ -320,7 +320,7 @@ const initHangingProtocol = () => {
|
|||||||
const layoutManager = OHIF.viewerbase.layoutManager;
|
const layoutManager = OHIF.viewerbase.layoutManager;
|
||||||
|
|
||||||
// Instantiate StudyMetadataSource: necessary for Hanging Protocol to get study metadata
|
// Instantiate StudyMetadataSource: necessary for Hanging Protocol to get study metadata
|
||||||
const studyMetadataSource = new OHIF.studylist.classes.OHIFStudyMetadataSource();
|
const studyMetadataSource = new OHIF.studies.classes.OHIFStudyMetadataSource();
|
||||||
|
|
||||||
// Creates Protocol Engine object with required arguments
|
// Creates Protocol Engine object with required arguments
|
||||||
const ProtocolEngine = new HP.ProtocolEngine(layoutManager, studyMetadataList, [], studyMetadataSource);
|
const ProtocolEngine = new HP.ProtocolEngine(layoutManager, studyMetadataList, [], studyMetadataSource);
|
||||||
|
|||||||
@ -25,7 +25,7 @@ const initHangingProtocol = () => {
|
|||||||
const layoutManager = OHIF.viewerbase.layoutManager;
|
const layoutManager = OHIF.viewerbase.layoutManager;
|
||||||
|
|
||||||
// Instantiate StudyMetadataSource: necessary for Hanging Protocol to get study metadata
|
// Instantiate StudyMetadataSource: necessary for Hanging Protocol to get study metadata
|
||||||
const studyMetadataSource = new OHIF.studylist.classes.OHIFStudyMetadataSource();
|
const studyMetadataSource = new OHIF.studies.classes.OHIFStudyMetadataSource();
|
||||||
|
|
||||||
// Get prior studies map
|
// Get prior studies map
|
||||||
const studyPriorsMap = OHIF.studylist.functions.getStudyPriorsMap(studyMetadataList);
|
const studyPriorsMap = OHIF.studylist.functions.getStudyPriorsMap(studyMetadataList);
|
||||||
|
|||||||
@ -3,6 +3,8 @@ import { Router } from 'meteor/iron:router';
|
|||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
|
||||||
Meteor.startup(function() {
|
Meteor.startup(function() {
|
||||||
|
if (!OHIF.studylist) return;
|
||||||
|
|
||||||
OHIF.studylist.callbacks.dblClickOnStudy = dblClickOnStudy;
|
OHIF.studylist.callbacks.dblClickOnStudy = dblClickOnStudy;
|
||||||
OHIF.studylist.callbacks.middleClickOnStudy = dblClickOnStudy;
|
OHIF.studylist.callbacks.middleClickOnStudy = dblClickOnStudy;
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,6 @@ Package.onUse(function(api) {
|
|||||||
api.use('ohif:design');
|
api.use('ohif:design');
|
||||||
api.use('ohif:core');
|
api.use('ohif:core');
|
||||||
api.use('ohif:studies');
|
api.use('ohif:studies');
|
||||||
api.use('ohif:study-list');
|
|
||||||
api.use('ohif:cornerstone');
|
api.use('ohif:cornerstone');
|
||||||
api.use('ohif:measurements');
|
api.use('ohif:measurements');
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { Meteor } from 'meteor/meteor';
|
import { Meteor } from 'meteor/meteor';
|
||||||
import { Router } from 'meteor/iron:router';
|
|
||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,6 +68,8 @@ const removeTimepointAssociations = event => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Meteor.startup(() => {
|
Meteor.startup(() => {
|
||||||
|
if (!OHIF.studylist) return;
|
||||||
|
|
||||||
OHIF.studylist.dropdown.setItems([{
|
OHIF.studylist.dropdown.setItems([{
|
||||||
action: OHIF.studylist.viewStudies,
|
action: OHIF.studylist.viewStudies,
|
||||||
text: 'View',
|
text: 'View',
|
||||||
|
|||||||
@ -6,72 +6,75 @@ import { OHIF } from 'meteor/ohif:core';
|
|||||||
// default StudyListStudy template.
|
// default StudyListStudy template.
|
||||||
// See https://github.com/aldeed/meteor-template-extension
|
// See https://github.com/aldeed/meteor-template-extension
|
||||||
const defaultTemplate = 'studylistStudy';
|
const defaultTemplate = 'studylistStudy';
|
||||||
Template.longitudinalStudyListStudy.replaces(defaultTemplate);
|
|
||||||
|
|
||||||
// Add the TimepointName helper to the default template. The
|
if (OHIF.studylist) {
|
||||||
// HTML of this template is replaced with that of longitudinalStudyListStudy
|
Template.longitudinalStudyListStudy.replaces(defaultTemplate);
|
||||||
Template[defaultTemplate].helpers({
|
|
||||||
timepointName() {
|
// Add the TimepointName helper to the default template. The
|
||||||
const instance = Template.instance();
|
// HTML of this template is replaced with that of longitudinalStudyListStudy
|
||||||
const timepointApi = OHIF.studylist.timepointApi;
|
Template[defaultTemplate].helpers({
|
||||||
if (!timepointApi) {
|
timepointName() {
|
||||||
return;
|
const instance = Template.instance();
|
||||||
|
const timepointApi = OHIF.studylist.timepointApi;
|
||||||
|
if (!timepointApi) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const timepoint = timepointApi.study(instance.data.studyInstanceUid)[0];
|
||||||
|
if (!timepoint) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return timepointApi.name(timepoint);
|
||||||
|
},
|
||||||
|
|
||||||
|
reviewerTip() {
|
||||||
|
const instance = Template.instance();
|
||||||
|
const timepointApi = OHIF.studylist.timepointApi;
|
||||||
|
if (!timepointApi || !window.Reviewers) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const timepoint = timepointApi.study(instance.data.studyInstanceUid);
|
||||||
|
if (!timepoint) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const timepointReviewers = window.Reviewers.findOne({ timepointId: timepoint.timepointId });
|
||||||
|
if (!timepointReviewers) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return getReviewerTipText(timepointReviewers.reviewers);
|
||||||
}
|
}
|
||||||
|
|
||||||
const timepoint = timepointApi.study(instance.data.studyInstanceUid)[0];
|
|
||||||
if (!timepoint) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return timepointApi.name(timepoint);
|
|
||||||
},
|
|
||||||
|
|
||||||
reviewerTip() {
|
|
||||||
const instance = Template.instance();
|
|
||||||
const timepointApi = OHIF.studylist.timepointApi;
|
|
||||||
if (!timepointApi || !window.Reviewers) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const timepoint = timepointApi.study(instance.data.studyInstanceUid);
|
|
||||||
if (!timepoint) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const timepointReviewers = window.Reviewers.findOne({ timepointId: timepoint.timepointId });
|
|
||||||
if (!timepointReviewers) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getReviewerTipText(timepointReviewers.reviewers);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function getReviewerTipText(reviewers) {
|
|
||||||
if (!reviewers || !reviewers.length) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const newReviewers = reviewers.filter(function(reviewer) {
|
|
||||||
return reviewer.userId !== Meteor.userId();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!newReviewers.length) {
|
function getReviewerTipText(reviewers) {
|
||||||
return;
|
if (!reviewers || !reviewers.length) {
|
||||||
}
|
|
||||||
|
|
||||||
let tipText = 'The study is being reviewed by ';
|
|
||||||
newReviewers.forEach(function(reviewer, index) {
|
|
||||||
if (reviewer.userId === Meteor.userId()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index > 0) {
|
const newReviewers = reviewers.filter(function(reviewer) {
|
||||||
tipText += ',';
|
return reviewer.userId !== Meteor.userId();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!newReviewers.length) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tipText += reviewer.userName;
|
let tipText = 'The study is being reviewed by ';
|
||||||
});
|
newReviewers.forEach(function(reviewer, index) {
|
||||||
|
if (reviewer.userId === Meteor.userId()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return tipText;
|
if (index > 0) {
|
||||||
|
tipText += ',';
|
||||||
|
}
|
||||||
|
|
||||||
|
tipText += reviewer.userName;
|
||||||
|
});
|
||||||
|
|
||||||
|
return tipText;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ Package.onUse(function(api) {
|
|||||||
api.use('ohif:core');
|
api.use('ohif:core');
|
||||||
api.use('ohif:select-tree');
|
api.use('ohif:select-tree');
|
||||||
api.use('ohif:log');
|
api.use('ohif:log');
|
||||||
api.use('ohif:study-list');
|
api.use('ohif:studies');
|
||||||
api.use('ohif:hanging-protocols');
|
api.use('ohif:hanging-protocols');
|
||||||
api.use('ohif:viewerbase');
|
api.use('ohif:viewerbase');
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
import { OHIFStudyMetadataSource } from './OHIFStudyMetadataSource';
|
||||||
|
import { OHIFStudySummary } from './OHIFStudySummary';
|
||||||
|
|
||||||
|
OHIF.studies.classes = {
|
||||||
|
OHIFStudyMetadataSource,
|
||||||
|
OHIFStudySummary
|
||||||
|
};
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
import './classes';
|
||||||
import './loadStudy';
|
import './loadStudy';
|
||||||
import './retrieveStudiesMetadata';
|
import './retrieveStudiesMetadata';
|
||||||
import './retrieveStudyMetadata';
|
import './retrieveStudyMetadata';
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
import 'meteor/ohif:viewerbase';
|
import 'meteor/ohif:viewerbase';
|
||||||
// Local Dependencies
|
|
||||||
import { OHIFStudySummary } from './OHIFStudySummary';
|
|
||||||
|
|
||||||
const { StudyMetadata, StudySummary } = OHIF.viewerbase.metadata;
|
const { StudyMetadata, StudySummary } = OHIF.viewerbase.metadata;
|
||||||
const PATIENT_ID = 'x00100020';
|
const PATIENT_ID = 'x00100020';
|
||||||
@ -40,7 +38,7 @@ const getStudyPriors = study => {
|
|||||||
|
|
||||||
// Create an OHIFStudySummary object for each prior study found
|
// Create an OHIFStudySummary object for each prior study found
|
||||||
cursor.forEach(study => {
|
cursor.forEach(study => {
|
||||||
const summary = new OHIFStudySummary(study, null, study.studyInstanceUid);
|
const summary = new OHIF.studies.classes.OHIFStudySummary(study, null, study.studyInstanceUid);
|
||||||
priorStudies.push(summary);
|
priorStudies.push(summary);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,6 @@
|
|||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
import { Router } from 'meteor/iron:router';
|
import { Router } from 'meteor/iron:router';
|
||||||
|
|
||||||
// Classes
|
|
||||||
import { OHIFStudyMetadataSource } from './OHIFStudyMetadataSource';
|
|
||||||
import { OHIFStudySummary } from './OHIFStudySummary';
|
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
import { getStudyPriors } from './getStudyPriors';
|
import { getStudyPriors } from './getStudyPriors';
|
||||||
import { getStudyPriorsMap } from './getStudyPriorsMap';
|
import { getStudyPriorsMap } from './getStudyPriorsMap';
|
||||||
@ -14,10 +10,15 @@ OHIF.studylist.functions = {
|
|||||||
getStudyPriorsMap
|
getStudyPriorsMap
|
||||||
};
|
};
|
||||||
|
|
||||||
OHIF.studylist.classes = {
|
// Add deprecation notice to the OHIF.studylist.classes namespace
|
||||||
OHIFStudyMetadataSource,
|
const note = 'OHIF.studylist.classes is deprecated.';
|
||||||
OHIFStudySummary
|
const instructions = 'Please use OHIF.studies.classes instead.';
|
||||||
};
|
Object.defineProperty(OHIF.studylist, 'classes', {
|
||||||
|
get() {
|
||||||
|
OHIF.log.warn(`${note}\n${instructions}`);
|
||||||
|
return OHIF.studies.classes;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const dblClickOnStudy = data => {
|
const dblClickOnStudy = data => {
|
||||||
Router.go('viewerStudies', { studyInstanceUids: data.studyInstanceUid });
|
Router.go('viewerStudies', { studyInstanceUids: data.studyInstanceUid });
|
||||||
|
|||||||
@ -36,7 +36,7 @@ const initHangingProtocol = () => {
|
|||||||
const layoutManager = OHIF.viewerbase.layoutManager;
|
const layoutManager = OHIF.viewerbase.layoutManager;
|
||||||
|
|
||||||
// Instantiate StudyMetadataSource: necessary for Hanging Protocol to get study metadata
|
// Instantiate StudyMetadataSource: necessary for Hanging Protocol to get study metadata
|
||||||
const studyMetadataSource = new OHIF.studylist.classes.OHIFStudyMetadataSource();
|
const studyMetadataSource = new OHIF.studies.classes.OHIFStudyMetadataSource();
|
||||||
|
|
||||||
// Creates Protocol Engine object with required arguments
|
// Creates Protocol Engine object with required arguments
|
||||||
const ProtocolEngine = new HP.ProtocolEngine(layoutManager, studyMetadataList, [], studyMetadataSource);
|
const ProtocolEngine = new HP.ProtocolEngine(layoutManager, studyMetadataList, [], studyMetadataSource);
|
||||||
@ -92,7 +92,7 @@ Template.viewer.onCreated(() => {
|
|||||||
displaySets = OHIF.viewerbase.sortingManager.getDisplaySets(studyMetadata);
|
displaySets = OHIF.viewerbase.sortingManager.getDisplaySets(studyMetadata);
|
||||||
study.displaySets = displaySets;
|
study.displaySets = displaySets;
|
||||||
}
|
}
|
||||||
|
|
||||||
study.selected = true;
|
study.selected = true;
|
||||||
OHIF.viewer.Studies.insert(study);
|
OHIF.viewer.Studies.insert(study);
|
||||||
OHIF.viewer.StudyMetadataList.insert(studyMetadata);
|
OHIF.viewer.StudyMetadataList.insert(studyMetadata);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user