LT-162: Parse dicomWeb qidoRoot

This commit is contained in:
Aysel Afsar 2016-03-10 14:47:55 -05:00
parent 76a9f6a894
commit 2bb429a898
2 changed files with 15 additions and 4 deletions

View File

@ -9,9 +9,6 @@ Meteor.startup(function() {
dicomWeb: {
endpoints: [{
name: 'Orthanc',
host: 'localhost',
port: '8042',
aeTitle: 'Orthanc',
wadoUriRootNOTE: 'either this uri is not correct for wado-uri or wado-uri is not configured on orthanc currently',
wadoUriRoot: 'http://localhost:8043/wado',
qidoRoot: 'http://localhost:8042/dicom-web',

View File

@ -1,9 +1,23 @@
function parseUrl(url) {
var parser = document.createElement('a');
parser.href = url;
return parser;
}
Template.serverInformationModal.helpers({
serverInformation: function() {
var defaultServiceType = Meteor.settings && Meteor.settings.defaultServiceType || 'dicomWeb';
var serviceInfo = Meteor.settings[defaultServiceType];
if (defaultServiceType === 'dicomWeb') {
serviceInfo = serviceInfo["endpoints"];
var serverInformationDicom = [];
var endpoints = serviceInfo["endpoints"];
endpoints.forEach(function(endpoint) {
var parsedUrl = parseUrl(endpoint.qidoRoot);
serverInformationDicom.push({host: parsedUrl.hostname, port: parsedUrl.port, aeTitle: endpoint.name});
});
return serverInformationDicom;
}
return serviceInfo;
}