PWV-1: Refactoring ohif:studylist package

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-11-15 08:24:01 +01:00
1 parent 984ef94403
commit 4d79bf84a8
79 files changed
+450 -551

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
import './publications.js';
import './validateServerConfiguration.js';
import './lib';
import './methods';
import './services';
@@ -0,0 +1,2 @@
import './remoteGetValue.js';
import './encodeQueryData.js';
@@ -1,4 +1,4 @@
import { StudyImportStatus } from '../../both/collections';
import { OHIF } from 'meteor/ohif:core';
var fs = Npm.require('fs');
var fiber = Npm.require('fibers');
@@ -73,14 +73,14 @@ Meteor.methods({
*/
createStudyImportStatus: function() {
var studyImportStatus = { numberOfStudiesImported: 0, numberOfStudiesFailed: 0 };
return StudyImportStatus.insert(studyImportStatus);
return OHIF.studylist.collections.StudyImportStatus.insert(studyImportStatus);
},
/**
* Remove the study import status item from the collection
* @param id Collection id of the study import status in the collection
*/
removeStudyImportStatus: function(id) {
StudyImportStatus.remove(id);
OHIF.studylist.collections.StudyImportStatus.remove(id);
}
});
@@ -96,16 +96,16 @@ function importStudiesDIMSE(studiesToImport, studyImportStatusId) {
try {
// Update the import status
if (err) {
StudyImportStatus.update({_id: studyImportStatusId}, {$inc: {'numberOfStudiesFailed': 1}});
OHIF.studylist.collections.StudyImportStatus.update({_id: studyImportStatusId}, {$inc: {'numberOfStudiesFailed': 1}});
console.log("Failed to import study via DIMSE: ", file, err);
} else {
StudyImportStatus.update({_id: studyImportStatusId}, {$inc: {'numberOfStudiesImported': 1}});
OHIF.studylist.collections.StudyImportStatus.update({_id: studyImportStatusId}, {$inc: {'numberOfStudiesImported': 1}});
console.log("Study successfully imported via DIMSE: ", file);
}
} catch(error) {
StudyImportStatus.update({_id: studyImportStatusId}, {$inc: {'numberOfStudiesFailed': 1}});
OHIF.studylist.collections.StudyImportStatus.update({_id: studyImportStatusId}, {$inc: {'numberOfStudiesFailed': 1}});
console.log("Failed to import study via DIMSE: ", file, error);
} finally {
// The import operation of this file is completed, so delete it if still exists
@@ -116,7 +116,7 @@ function importStudiesDIMSE(studiesToImport, studyImportStatusId) {
}).run();
} catch(error) {
StudyImportStatus.update({_id: studyImportStatusId}, {$inc: {'numberOfStudiesFailed': 1}});
OHIF.studylist.collections.StudyImportStatus.update({_id: studyImportStatusId}, {$inc: {'numberOfStudiesFailed': 1}});
console.log("Failed to import study via DIMSE: ", file, error);
}
@@ -0,0 +1,3 @@
import './getStudyMetadata.js';
import './importStudies.js';
import './studylistSearch.js';
@@ -1,5 +1,8 @@
import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
Meteor.publish('studyImportStatus', () => {
return StudyImportStatus.find();
return OHIF.studylist.collections.StudyImportStatus.find();
});
Meteor.publish('servers', () => {
@@ -0,0 +1,16 @@
import './namespace.js';
// DICOMWeb instance, study, and metadata retrieval
import './qido/instances.js';
import './qido/studies.js';
import './wado/retrieveMetadata.js';
// DIMSE instance, study, and metadata retrieval
import './dimse/instances.js';
import './dimse/studies.js';
import './dimse/retrieveMetadata.js';
// Study, instance, and metadata retrieval from remote PACS via Orthanc as a proxy
import './remote/instances.js';
import './remote/studies.js';
import './remote/retrieveMetadata.js';