Merge branch 'studyDate'
This commit is contained in:
commit
7174dfe73f
@ -2,6 +2,7 @@
|
|||||||
<div id="viewer">
|
<div id="viewer">
|
||||||
{{ >lesionLocationDialog }}
|
{{ >lesionLocationDialog }}
|
||||||
{{ >nonTargetLesionDialog}}
|
{{ >nonTargetLesionDialog}}
|
||||||
|
{{ >studyDateList}}
|
||||||
|
|
||||||
{{ >hidingPanel }}
|
{{ >hidingPanel }}
|
||||||
<div id="viewportAndLesionTable">
|
<div id="viewportAndLesionTable">
|
||||||
|
|||||||
@ -83,7 +83,12 @@ Template.viewer.onCreated(function() {
|
|||||||
|
|
||||||
Session.set('activeViewport', ViewerData[contentId].activeViewport || 0);
|
Session.set('activeViewport', ViewerData[contentId].activeViewport || 0);
|
||||||
|
|
||||||
Session.set("studies", this.data.studies);
|
// Update the ViewerStudies collection with the loaded studies
|
||||||
|
ViewerStudies = new Meteor.Collection(null);
|
||||||
|
this.data.studies.forEach(function(study) {
|
||||||
|
study.selected = true;
|
||||||
|
ViewerStudies.insert(study);
|
||||||
|
});
|
||||||
|
|
||||||
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer("CornerstoneNewImage", cornerstoneTools.updateImageSynchronizer);
|
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer("CornerstoneNewImage", cornerstoneTools.updateImageSynchronizer);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -88,7 +88,12 @@ Template.viewer.onCreated(function() {
|
|||||||
|
|
||||||
Session.set('activeViewport', ViewerData[contentId].activeViewport || 0);
|
Session.set('activeViewport', ViewerData[contentId].activeViewport || 0);
|
||||||
|
|
||||||
Session.set("studies", this.data.studies);
|
// Update the ViewerStudies collection with the loaded studies
|
||||||
|
ViewerStudies = new Meteor.Collection(null);
|
||||||
|
this.data.studies.forEach(function(study) {
|
||||||
|
study.selected = true;
|
||||||
|
ViewerStudies.insert(study);
|
||||||
|
});
|
||||||
|
|
||||||
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer("CornerstoneNewImage", cornerstoneTools.updateImageSynchronizer);
|
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer("CornerstoneNewImage", cornerstoneTools.updateImageSynchronizer);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -12,7 +12,8 @@ var hangingProtocol;
|
|||||||
* @returns {Array}
|
* @returns {Array}
|
||||||
*/
|
*/
|
||||||
function defaultHangingProtocol(inputData) {
|
function defaultHangingProtocol(inputData) {
|
||||||
var studies = inputData.studies;
|
// TODO = Update this to use Collection logic
|
||||||
|
var studies = inputData.studies.find().fetch();
|
||||||
var viewportRows = inputData.viewportRows;
|
var viewportRows = inputData.viewportRows;
|
||||||
var viewportColumns = inputData.viewportColumns;
|
var viewportColumns = inputData.viewportColumns;
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
<template name="studyDateList">
|
||||||
|
<select id="selectStudyDate">
|
||||||
|
{{#each patientStudies}}
|
||||||
|
<option value="{{studyInstanceUid}}">{{studyDate}}</option>
|
||||||
|
{{/each}}
|
||||||
|
</select>
|
||||||
|
</template>
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
|
||||||
|
Template.studyDateList.onCreated(function(){
|
||||||
|
|
||||||
|
// All studies of this patient at different dates
|
||||||
|
this.patientStudies = [];
|
||||||
|
this.selectedDate = "";
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Template.studyDateList.onRendered(function(){
|
||||||
|
// Add Study dates to Timepoints
|
||||||
|
this.patientStudies.forEach(function(study) {
|
||||||
|
Timepoints.insert({
|
||||||
|
timepointID: uuid.v4(),
|
||||||
|
timepointName: study.studyDate
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Selected date option
|
||||||
|
$('#selectStudyDate option[value="'+this.selectedDate+'"]').prop('selected', true);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.studyDateList.helpers({
|
||||||
|
patientStudies: function(){
|
||||||
|
var self = Template.instance();
|
||||||
|
|
||||||
|
var studyData = this.studies[0]; // study which is loaded in tab
|
||||||
|
self.selectedDate = studyData.studyDate;
|
||||||
|
|
||||||
|
// TODO= Fix this! This won't work to retrieve all studies
|
||||||
|
// related to this patient. We will need to do a real search
|
||||||
|
// since the WorklistStudies Collection only contains the studies on-screen
|
||||||
|
|
||||||
|
var studies = WorklistStudies.find({}).fetch(); // All studies list
|
||||||
|
var patientStudies = []; // Holds studies of patient
|
||||||
|
|
||||||
|
// Get all studies of patient with patientID
|
||||||
|
studies.forEach(function(study) {
|
||||||
|
if (studyData.patientId === study.patientId) {
|
||||||
|
patientStudies.push(study);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
self.patientStudies = patientStudies;
|
||||||
|
return patientStudies;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Template.studyDateList.events({
|
||||||
|
'change select#selectStudyDate': function(e, template) {
|
||||||
|
var studyInstanceUid = $(e.currentTarget).val();
|
||||||
|
|
||||||
|
Meteor.call('GetStudyMetadata', studyInstanceUid, function(error, study) {
|
||||||
|
sortStudy(study);
|
||||||
|
|
||||||
|
// Set "Selected" to false for the entire collection
|
||||||
|
ViewerStudies.update({},
|
||||||
|
{$set: {selected: false}},
|
||||||
|
{ multi: true });
|
||||||
|
|
||||||
|
// Check if this study already exists in the ViewerStudies collection
|
||||||
|
// of loaded studies. If it does, set it's 'selected' value to true.
|
||||||
|
var existingStudy = ViewerStudies.findOne({studyInstanceUid: studyInstanceUid});
|
||||||
|
if (existingStudy) {
|
||||||
|
// Set the current finding in the collection to true
|
||||||
|
ViewerStudies.update(existingStudy._id, {
|
||||||
|
$set: {selected: true}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the study does not exist, add the 'selected' key to the object
|
||||||
|
// with the value True, and insert it into the ViewerStudies Collection
|
||||||
|
study.selected = true;
|
||||||
|
ViewerStudies.insert(study);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -39,6 +39,12 @@ Package.onUse(function (api) {
|
|||||||
api.addFiles('components/nonTargetLesionDialog/nonTargetLesionDialog.css', 'client');
|
api.addFiles('components/nonTargetLesionDialog/nonTargetLesionDialog.css', 'client');
|
||||||
api.addFiles('components/nonTargetLesionDialog/nonTargetLesionDialog.js', 'client');
|
api.addFiles('components/nonTargetLesionDialog/nonTargetLesionDialog.js', 'client');
|
||||||
|
|
||||||
|
api.addFiles('components/studyDateList/studyDateList.html', 'client');
|
||||||
|
api.addFiles('components/studyDateList/studyDateList.js', 'client');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Library functions
|
// Library functions
|
||||||
api.addFiles('lib/uuid.js', 'client');
|
api.addFiles('lib/uuid.js', 'client');
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
Template.imageThumbnail.onRendered(function() {
|
Template.imageThumbnail.onRendered(function() {
|
||||||
var instance = this.data.stack.instances[0];
|
var instance = this.data.stack.instances[0];
|
||||||
var element = this.find('.imageThumbnail');
|
var element = this.find('.imageThumbnail');
|
||||||
|
|
||||||
|
cornerstone.disable(element);
|
||||||
|
$(element).find('canvas').remove();
|
||||||
|
|
||||||
cornerstone.enable(element);
|
cornerstone.enable(element);
|
||||||
|
|
||||||
var imageId = getImageId(instance);
|
var imageId = getImageId(instance);
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
Template.studyBrowser.helpers({
|
Template.studyBrowser.helpers({
|
||||||
studies : function() {
|
studies : function() {
|
||||||
var studies = Session.get('studies');
|
return ViewerStudies.find({selected: true});
|
||||||
|
}
|
||||||
var array = [];
|
|
||||||
studies.forEach(function(study, index) {
|
|
||||||
array.push({
|
|
||||||
studyIndex: index,
|
|
||||||
study: study
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return array;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
@ -190,6 +190,7 @@ function thumbnailDragEndHandler(e, target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Template.thumbnailEntry.onRendered(function() {
|
Template.thumbnailEntry.onRendered(function() {
|
||||||
|
console.log(this.data);
|
||||||
var entry = this.find('.thumbnailEntry');
|
var entry = this.find('.thumbnailEntry');
|
||||||
$(entry).data('seriesInstanceUid', Template.parentData(0).seriesInstanceUid);
|
$(entry).data('seriesInstanceUid', Template.parentData(0).seriesInstanceUid);
|
||||||
$(entry).data('studyInstanceUid', Template.parentData(1).studyInstanceUid);
|
$(entry).data('studyInstanceUid', Template.parentData(1).studyInstanceUid);
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
Template.thumbnails.helpers({
|
Template.thumbnails.helpers({
|
||||||
thumbnails: function() {
|
thumbnails: function() {
|
||||||
var stacks = createStacks(this.study);
|
var study = this;
|
||||||
var studyIndex = this.studyIndex;
|
var stacks = createStacks(study);
|
||||||
|
|
||||||
var array = [];
|
var array = [];
|
||||||
stacks.forEach(function(stack, index) {
|
stacks.forEach(function(stack, index) {
|
||||||
array.push({
|
array.push({
|
||||||
thumbnailIndex: index * (studyIndex + 1),
|
thumbnailIndex: index,
|
||||||
stack: stack
|
stack: stack
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -399,30 +399,31 @@ Template.imageViewerViewport.onRendered(function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve the current set of studies from the Meteor Session
|
// Look through the ViewerStudies collection for a
|
||||||
var studies = Session.get('studies');
|
// study with this studyInstanceUid
|
||||||
|
var study = ViewerStudies.findOne({
|
||||||
|
studyInstanceUid: this.data.studyInstanceUid
|
||||||
|
});
|
||||||
|
|
||||||
// Look through every study and their series' until we find the
|
// If we didn't find anything, stop here
|
||||||
// series that matches the seriesInstanceUid and studyInstanceUid
|
if (!study) {
|
||||||
var studyInstanceUid = this.data.studyInstanceUid;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
data.study = study;
|
||||||
|
|
||||||
|
// Look through this study for a series with this seriesInstanceUid
|
||||||
var seriesInstanceUid = this.data.seriesInstanceUid;
|
var seriesInstanceUid = this.data.seriesInstanceUid;
|
||||||
studies.every(function(study) {
|
study.seriesList.every(function(series) {
|
||||||
if (study.studyInstanceUid === studyInstanceUid) {
|
if (series.seriesInstanceUid === seriesInstanceUid) {
|
||||||
data.study = study;
|
data.series = series;
|
||||||
study.seriesList.every(function(series) {
|
|
||||||
if (series.seriesInstanceUid === seriesInstanceUid) {
|
|
||||||
data.series = series;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
// If we didn't find anything, stop here
|
// If we didn't find anything, stop here
|
||||||
if (!data.study || !data.series) {
|
if (!data.series) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,8 +21,6 @@ Template.imageViewerViewports.helpers({
|
|||||||
viewportArray: function() {
|
viewportArray: function() {
|
||||||
log.info("imageViewerViewports viewportArray");
|
log.info("imageViewerViewports viewportArray");
|
||||||
|
|
||||||
var studies = Session.get('studies');
|
|
||||||
|
|
||||||
var viewportRows = this.viewportRows || 1;
|
var viewportRows = this.viewportRows || 1;
|
||||||
var viewportColumns = this.viewportColumns || 1;
|
var viewportColumns = this.viewportColumns || 1;
|
||||||
|
|
||||||
@ -49,7 +47,7 @@ Template.imageViewerViewports.helpers({
|
|||||||
var inputData = {
|
var inputData = {
|
||||||
viewportColumns: viewportColumns,
|
viewportColumns: viewportColumns,
|
||||||
viewportRows: viewportRows,
|
viewportRows: viewportRows,
|
||||||
studies: studies
|
studies: ViewerStudies
|
||||||
};
|
};
|
||||||
var hangingProtocolViewportData = hangingProtocol(inputData);
|
var hangingProtocolViewportData = hangingProtocol(inputData);
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,9 @@ var StudyMetaData = {};
|
|||||||
// Create the WorklistTabs collection
|
// Create the WorklistTabs collection
|
||||||
WorklistTabs = new Meteor.Collection(null);
|
WorklistTabs = new Meteor.Collection(null);
|
||||||
|
|
||||||
|
// Create the WorklistStudies collection
|
||||||
|
WorklistStudies = new Meteor.Collection(null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves study metadata using a server call, and fires a callback
|
* Retrieves study metadata using a server call, and fires a callback
|
||||||
* when completed.
|
* when completed.
|
||||||
@ -105,9 +108,6 @@ switchToTab = function(contentId) {
|
|||||||
studies: [study]
|
studies: [study]
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update the Session variable with the loaded studies
|
|
||||||
Session.set('studies', data.studies);
|
|
||||||
|
|
||||||
// Remove the loading text template that is inside the tab container by default
|
// Remove the loading text template that is inside the tab container by default
|
||||||
container.innerHTML = "";
|
container.innerHTML = "";
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
// This is a client-side only Collection which
|
// This is a client-side only Collection which
|
||||||
// Stores the list of studies in the Worklist
|
// Stores the list of studies in the Worklist
|
||||||
Studies = new Mongo.Collection(null);
|
Studies = new Mongo.Collection(null);
|
||||||
|
PatientStudies = new Mongo.Collection(null);
|
||||||
|
|
||||||
Template.worklistResult.helpers({
|
Template.worklistResult.helpers({
|
||||||
/**
|
/**
|
||||||
@ -9,6 +10,6 @@ Template.worklistResult.helpers({
|
|||||||
* by Patient name and Study Date in Ascending order.
|
* by Patient name and Study Date in Ascending order.
|
||||||
*/
|
*/
|
||||||
studies : function() {
|
studies : function() {
|
||||||
return Studies.find({}, {sort: {patientName : 1, studyDate : 1}});
|
return WorklistStudies.find({}, {sort: {patientName : 1, studyDate : 1}});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -69,7 +69,7 @@ function search() {
|
|||||||
var modality = replaceUndefinedColumnValue($('#modality').val());
|
var modality = replaceUndefinedColumnValue($('#modality').val());
|
||||||
|
|
||||||
// Clear all current studies
|
// Clear all current studies
|
||||||
Studies.remove({});
|
WorklistStudies.remove({});
|
||||||
|
|
||||||
Meteor.call('WorklistSearch', filter, function(error, studies) {
|
Meteor.call('WorklistSearch', filter, function(error, studies) {
|
||||||
if (!studies) {
|
if (!studies) {
|
||||||
@ -85,7 +85,7 @@ function search() {
|
|||||||
(convertStringToStudyDate(study.studyDate) <= new Date(studyDateTo).setHours(0,0,0,0) || !checkTo)) {
|
(convertStringToStudyDate(study.studyDate) <= new Date(studyDateTo).setHours(0,0,0,0) || !checkTo)) {
|
||||||
|
|
||||||
// Insert any matching studies into the Studies Collection
|
// Insert any matching studies into the Studies Collection
|
||||||
Studies.insert(study);
|
WorklistStudies.insert(study);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -57,7 +57,8 @@ Package.onUse(function (api) {
|
|||||||
// Export the global ViewerData object
|
// Export the global ViewerData object
|
||||||
api.export('ViewerData', 'client');
|
api.export('ViewerData', 'client');
|
||||||
|
|
||||||
// Export the WorklistTabs Collection
|
// Export the Collections
|
||||||
api.export('WorklistTabs', 'client');
|
api.export('WorklistTabs', 'client');
|
||||||
|
api.export('WorklistStudies', 'client');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user