comparison OrthancServer/ServerContext.cpp @ 1427:d710ea64f0fd

Custom setting of the local AET during C-Store SCU (both in Lua and in the REST API)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 29 Jun 2015 12:42:54 +0200
parents b22ba8c5edbe
children 461e7554bff7
comparison
equal deleted inserted replaced
1426:2cf9a12c995a 1427:d710ea64f0fd
77 provider_(*this), 77 provider_(*this),
78 dicomCache_(provider_, DICOM_CACHE_SIZE), 78 dicomCache_(provider_, DICOM_CACHE_SIZE),
79 scheduler_(Configuration::GetGlobalIntegerParameter("LimitJobs", 10)), 79 scheduler_(Configuration::GetGlobalIntegerParameter("LimitJobs", 10)),
80 plugins_(NULL), 80 plugins_(NULL),
81 pluginsManager_(NULL), 81 pluginsManager_(NULL),
82 queryRetrieveArchive_(Configuration::GetGlobalIntegerParameter("QueryRetrieveSize", 10)) 82 queryRetrieveArchive_(Configuration::GetGlobalIntegerParameter("QueryRetrieveSize", 10)),
83 { 83 defaultLocalAet_(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC"))
84 scu_.SetLocalApplicationEntityTitle(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC")); 84 {
85
86 uint64_t s = Configuration::GetGlobalIntegerParameter("DicomAssociationCloseDelay", 5); // In seconds 85 uint64_t s = Configuration::GetGlobalIntegerParameter("DicomAssociationCloseDelay", 5); // In seconds
87 scu_.SetMillisecondsBeforeClose(s * 1000); // Milliseconds are expected here 86 scu_.SetMillisecondsBeforeClose(s * 1000); // Milliseconds are expected here
88 87
89 lua_.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX); 88 lua_.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX);
90 lua_.SetHttpProxy(Configuration::GetGlobalStringParameter("HttpProxy", "")); 89 lua_.SetHttpProxy(Configuration::GetGlobalStringParameter("HttpProxy", ""));
138 return new DeleteInstanceCommand(context); 137 return new DeleteInstanceCommand(context);
139 } 138 }
140 139
141 if (operation == "store-scu") 140 if (operation == "store-scu")
142 { 141 {
142 std::string localAet;
143 if (parameters.isMember("LocalAet"))
144 {
145 localAet = parameters["LocalAet"].asString();
146 }
147 else
148 {
149 localAet = context.GetDefaultLocalApplicationEntityTitle();
150 }
151
143 std::string modality = parameters["Modality"].asString(); 152 std::string modality = parameters["Modality"].asString();
144 LOG(INFO) << "Lua script to send instance " << parameters["Instance"].asString() 153 LOG(INFO) << "Lua script to send instance " << parameters["Instance"].asString()
145 << " to modality " << modality << " using Store-SCU"; 154 << " to modality " << modality << " using Store-SCU";
146 return new StoreScuCommand(context, Configuration::GetModalityUsingSymbolicName(modality), true); 155 return new StoreScuCommand(context, localAet,
156 Configuration::GetModalityUsingSymbolicName(modality), true);
147 } 157 }
148 158
149 if (operation == "store-peer") 159 if (operation == "store-peer")
150 { 160 {
151 std::string peer = parameters["Peer"].asString(); 161 std::string peer = parameters["Peer"].asString();