2017-06-16 21:36:34 +02:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
|
import { OHIF } from 'meteor/ohif:core';
|
|
|
|
|
|
2015-10-13 14:14:50 +02:00
|
|
|
Meteor.methods({
|
2015-11-16 17:49:35 +01:00
|
|
|
/**
|
|
|
|
|
* Use the specified filter to conduct a search from the DICOM server
|
2016-09-29 17:25:04 +02:00
|
|
|
*
|
2015-11-16 17:49:35 +01:00
|
|
|
* @param filter
|
|
|
|
|
*/
|
2016-08-15 15:34:36 +02:00
|
|
|
StudyListSearch(filter) {
|
2016-09-29 17:25:04 +02:00
|
|
|
// Get the server data. This is user-defined in the config.json files or through servers
|
|
|
|
|
// configuration modal
|
2017-06-16 21:36:34 +02:00
|
|
|
const server = OHIF.servers.getCurrentServer();
|
2015-11-16 17:49:35 +01:00
|
|
|
|
2016-09-29 17:25:04 +02:00
|
|
|
if (!server) {
|
|
|
|
|
throw 'No properly configured server was available over DICOMWeb or DIMSE.';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (server.type === 'dicomWeb') {
|
2016-01-13 16:17:32 +01:00
|
|
|
return Services.QIDO.Studies(server, filter);
|
2016-09-29 17:25:04 +02:00
|
|
|
} else if (server.type === 'dimse') {
|
2016-01-13 16:17:32 +01:00
|
|
|
return Services.DIMSE.Studies(filter);
|
|
|
|
|
}
|
2015-11-16 17:49:35 +01:00
|
|
|
}
|
2016-01-13 16:17:32 +01:00
|
|
|
});
|