comparison OrthancServer/OrthancInitialization.cpp @ 519:1b2cdc855bd3

Parameter for PACS manufacturer, support for ClearCanvas
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 20 Aug 2013 13:39:42 +0200
parents bdbde1fbfab3
children 60d90e48e809
comparison
equal deleted inserted replaced
517:b2b56b4e33b0 519:1b2cdc855bd3
228 228
229 229
230 void GetDicomModality(const std::string& name, 230 void GetDicomModality(const std::string& name,
231 std::string& aet, 231 std::string& aet,
232 std::string& address, 232 std::string& address,
233 int& port) 233 int& port,
234 ModalityManufacturer& manufacturer)
234 { 235 {
235 boost::mutex::scoped_lock lock(globalMutex_); 236 boost::mutex::scoped_lock lock(globalMutex_);
236 237
237 if (!configuration_->isMember("DicomModalities")) 238 if (!configuration_->isMember("DicomModalities"))
238 { 239 {
239 throw OrthancException(""); 240 throw OrthancException("");
240 } 241 }
241 242
242 const Json::Value& modalities = (*configuration_) ["DicomModalities"]; 243 const Json::Value& modalities = (*configuration_) ["DicomModalities"];
243 if (modalities.type() != Json::objectValue || 244 if (modalities.type() != Json::objectValue ||
244 !modalities.isMember(name)) 245 !modalities.isMember(name) ||
246 (modalities[name].size() != 3 && modalities[name].size() != 4))
245 { 247 {
246 throw OrthancException(""); 248 throw OrthancException("");
247 } 249 }
248 250
249 try 251 try
250 { 252 {
251 aet = modalities[name].get(0u, "").asString(); 253 aet = modalities[name].get(0u, "").asString();
252 address = modalities[name].get(1u, "").asString(); 254 address = modalities[name].get(1u, "").asString();
253 port = modalities[name].get(2u, "").asInt(); 255 port = modalities[name].get(2u, "").asInt();
256
257 if (modalities[name].size() == 4)
258 {
259 manufacturer = StringToModalityManufacturer(modalities[name].get(3u, "").asString());
260 }
261 else
262 {
263 manufacturer = ModalityManufacturer_Generic;
264 }
254 } 265 }
255 catch (...) 266 catch (...)
256 { 267 {
257 throw OrthancException("Badly formatted DICOM modality"); 268 throw OrthancException("Badly formatted DICOM modality");
258 } 269 }