* Adding a better error handling for DICOMWeb getJson method * Adding a better error handling for DICOMWeb getBulkData method * Fixinf some typos. Using console.error to log errors * Better error handling for DIMSE connections * Using meteor error in StudyListSearch to better display same error in the client * Using Meteor.Error for a better pattern. Added an error message in the study list. created connection error types to DICOMWeb connection errors * Changing error types for server connection. Added better errors for DIMSE server on sockets * Improving viewer response to error being throw when not finding server to display studies * OHIF-168: adding catches clauses for retrieveStudyMetada method * OHIF-168: fixing typo in DIMSE.js * OHIF-168: setting the session variable to false when starting a new studylist search * OHIF-168: Using OHIF.log instead of console * OHIF-168: removing parsing into string for OHIF.log in Connection.js * OHIF-168: improving error message visibility in study viewer
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
import { Meteor } from 'meteor/meteor';
|
|
import { OHIF } from 'meteor/ohif:core';
|
|
|
|
Meteor.methods({
|
|
/**
|
|
* Retrieves Study metadata given a Study Instance UID
|
|
* This Meteor method is available from both the client and the server
|
|
*/
|
|
GetStudyMetadata: function(studyInstanceUid) {
|
|
OHIF.log.info('GetStudyMetadata(%s)', studyInstanceUid);
|
|
|
|
// Get the server data. This is user-defined in the config.json files or through servers
|
|
// configuration modal
|
|
const server = OHIF.servers.getCurrentServer();
|
|
|
|
if (!server) {
|
|
throw new Meteor.Error('improper-server-config', 'No properly configured server was available over DICOMWeb or DIMSE.');
|
|
}
|
|
|
|
try {
|
|
if (server.type === 'dicomWeb') {
|
|
return Services.WADO.RetrieveMetadata(server, studyInstanceUid);
|
|
} else if (server.type === 'dimse') {
|
|
return Services.DIMSE.RetrieveMetadata(studyInstanceUid);
|
|
}
|
|
} catch (error) {
|
|
OHIF.log.trace();
|
|
|
|
throw error;
|
|
}
|
|
}
|
|
});
|