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;
|
||||
|
||||
// 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
|
||||
const ProtocolEngine = new HP.ProtocolEngine(layoutManager, studyMetadataList, [], studyMetadataSource);
|
||||
|
||||
@ -25,7 +25,7 @@ const initHangingProtocol = () => {
|
||||
const layoutManager = OHIF.viewerbase.layoutManager;
|
||||
|
||||
// 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
|
||||
const studyPriorsMap = OHIF.studylist.functions.getStudyPriorsMap(studyMetadataList);
|
||||
|
||||
@ -3,6 +3,8 @@ import { Router } from 'meteor/iron:router';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
Meteor.startup(function() {
|
||||
if (!OHIF.studylist) return;
|
||||
|
||||
OHIF.studylist.callbacks.dblClickOnStudy = dblClickOnStudy;
|
||||
OHIF.studylist.callbacks.middleClickOnStudy = dblClickOnStudy;
|
||||
|
||||
|
||||
@ -22,7 +22,6 @@ Package.onUse(function(api) {
|
||||
api.use('ohif:design');
|
||||
api.use('ohif:core');
|
||||
api.use('ohif:studies');
|
||||
api.use('ohif:study-list');
|
||||
api.use('ohif:cornerstone');
|
||||
api.use('ohif:measurements');
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Router } from 'meteor/iron:router';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
/**
|
||||
@ -69,6 +68,8 @@ const removeTimepointAssociations = event => {
|
||||
};
|
||||
|
||||
Meteor.startup(() => {
|
||||
if (!OHIF.studylist) return;
|
||||
|
||||
OHIF.studylist.dropdown.setItems([{
|
||||
action: OHIF.studylist.viewStudies,
|
||||
text: 'View',
|
||||
|
||||
@ -6,72 +6,75 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
// default StudyListStudy template.
|
||||
// See https://github.com/aldeed/meteor-template-extension
|
||||
const defaultTemplate = 'studylistStudy';
|
||||
Template.longitudinalStudyListStudy.replaces(defaultTemplate);
|
||||
|
||||
// Add the TimepointName helper to the default template. The
|
||||
// HTML of this template is replaced with that of longitudinalStudyListStudy
|
||||
Template[defaultTemplate].helpers({
|
||||
timepointName() {
|
||||
const instance = Template.instance();
|
||||
const timepointApi = OHIF.studylist.timepointApi;
|
||||
if (!timepointApi) {
|
||||
return;
|
||||
if (OHIF.studylist) {
|
||||
Template.longitudinalStudyListStudy.replaces(defaultTemplate);
|
||||
|
||||
// Add the TimepointName helper to the default template. The
|
||||
// HTML of this template is replaced with that of longitudinalStudyListStudy
|
||||
Template[defaultTemplate].helpers({
|
||||
timepointName() {
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
|
||||
let tipText = 'The study is being reviewed by ';
|
||||
newReviewers.forEach(function(reviewer, index) {
|
||||
if (reviewer.userId === Meteor.userId()) {
|
||||
function getReviewerTipText(reviewers) {
|
||||
if (!reviewers || !reviewers.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (index > 0) {
|
||||
tipText += ',';
|
||||
const newReviewers = reviewers.filter(function(reviewer) {
|
||||
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:select-tree');
|
||||
api.use('ohif:log');
|
||||
api.use('ohif:study-list');
|
||||
api.use('ohif:studies');
|
||||
api.use('ohif:hanging-protocols');
|
||||
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 './retrieveStudiesMetadata';
|
||||
import './retrieveStudyMetadata';
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import 'meteor/ohif:viewerbase';
|
||||
// Local Dependencies
|
||||
import { OHIFStudySummary } from './OHIFStudySummary';
|
||||
|
||||
const { StudyMetadata, StudySummary } = OHIF.viewerbase.metadata;
|
||||
const PATIENT_ID = 'x00100020';
|
||||
@ -40,7 +38,7 @@ const getStudyPriors = study => {
|
||||
|
||||
// Create an OHIFStudySummary object for each prior study found
|
||||
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);
|
||||
});
|
||||
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { Router } from 'meteor/iron:router';
|
||||
|
||||
// Classes
|
||||
import { OHIFStudyMetadataSource } from './OHIFStudyMetadataSource';
|
||||
import { OHIFStudySummary } from './OHIFStudySummary';
|
||||
|
||||
// Functions
|
||||
import { getStudyPriors } from './getStudyPriors';
|
||||
import { getStudyPriorsMap } from './getStudyPriorsMap';
|
||||
@ -14,10 +10,15 @@ OHIF.studylist.functions = {
|
||||
getStudyPriorsMap
|
||||
};
|
||||
|
||||
OHIF.studylist.classes = {
|
||||
OHIFStudyMetadataSource,
|
||||
OHIFStudySummary
|
||||
};
|
||||
// Add deprecation notice to the OHIF.studylist.classes namespace
|
||||
const note = 'OHIF.studylist.classes is deprecated.';
|
||||
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 => {
|
||||
Router.go('viewerStudies', { studyInstanceUids: data.studyInstanceUid });
|
||||
|
||||
@ -36,7 +36,7 @@ const initHangingProtocol = () => {
|
||||
const layoutManager = OHIF.viewerbase.layoutManager;
|
||||
|
||||
// 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
|
||||
const ProtocolEngine = new HP.ProtocolEngine(layoutManager, studyMetadataList, [], studyMetadataSource);
|
||||
@ -92,7 +92,7 @@ Template.viewer.onCreated(() => {
|
||||
displaySets = OHIF.viewerbase.sortingManager.getDisplaySets(studyMetadata);
|
||||
study.displaySets = displaySets;
|
||||
}
|
||||
|
||||
|
||||
study.selected = true;
|
||||
OHIF.viewer.Studies.insert(study);
|
||||
OHIF.viewer.StudyMetadataList.insert(studyMetadata);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user