# HG changeset patch # User Sebastien Jodogne # Date 1579184912 -3600 # Node ID 085283445db0d255ca0604b0f1c602bfb13b8a06 # Parent a77e7839012ac2355d3136b0c8736edf193a1605 AllowNAction in remote modality parameters diff -r a77e7839012a -r 085283445db0 Core/DicomNetworking/RemoteModalityParameters.cpp --- a/Core/DicomNetworking/RemoteModalityParameters.cpp Thu Jan 16 12:50:06 2020 +0100 +++ b/Core/DicomNetworking/RemoteModalityParameters.cpp Thu Jan 16 15:28:32 2020 +0100 @@ -48,6 +48,7 @@ static const char* KEY_ALLOW_GET = "AllowGet"; static const char* KEY_ALLOW_MOVE = "AllowMove"; static const char* KEY_ALLOW_STORE = "AllowStore"; +static const char* KEY_ALLOW_N_ACTION = "AllowNAction"; static const char* KEY_HOST = "Host"; static const char* KEY_MANUFACTURER = "Manufacturer"; static const char* KEY_PORT = "Port"; @@ -66,6 +67,7 @@ allowFind_ = true; allowMove_ = true; allowGet_ = true; + allowNAction_ = true; // For storage commitment } @@ -211,6 +213,11 @@ { allowMove_ = SerializationToolbox::ReadBoolean(serialized, KEY_ALLOW_MOVE); } + + if (serialized.isMember(KEY_ALLOW_N_ACTION)) + { + allowNAction_ = SerializationToolbox::ReadBoolean(serialized, KEY_ALLOW_N_ACTION); + } } @@ -233,6 +240,9 @@ case DicomRequestType_Store: return allowStore_; + case DicomRequestType_NAction: + return allowNAction_; + default: throw OrthancException(ErrorCode_ParameterOutOfRange); } @@ -264,6 +274,10 @@ allowStore_ = allowed; break; + case DicomRequestType_NAction: + allowNAction_ = allowed; + break; + default: throw OrthancException(ErrorCode_ParameterOutOfRange); } @@ -276,7 +290,8 @@ !allowStore_ || !allowFind_ || !allowGet_ || - !allowMove_); + !allowMove_ || + !allowNAction_); } @@ -296,6 +311,7 @@ target[KEY_ALLOW_FIND] = allowFind_; target[KEY_ALLOW_GET] = allowGet_; target[KEY_ALLOW_MOVE] = allowMove_; + target[KEY_ALLOW_N_ACTION] = allowNAction_; } else { diff -r a77e7839012a -r 085283445db0 Core/DicomNetworking/RemoteModalityParameters.h --- a/Core/DicomNetworking/RemoteModalityParameters.h Thu Jan 16 12:50:06 2020 +0100 +++ b/Core/DicomNetworking/RemoteModalityParameters.h Thu Jan 16 15:28:32 2020 +0100 @@ -53,6 +53,7 @@ bool allowFind_; bool allowMove_; bool allowGet_; + bool allowNAction_; void Clear(); diff -r a77e7839012a -r 085283445db0 Core/Enumerations.cpp --- a/Core/Enumerations.cpp Thu Jan 16 12:50:06 2020 +0100 +++ b/Core/Enumerations.cpp Thu Jan 16 15:28:32 2020 +0100 @@ -860,6 +860,10 @@ return "Store"; break; + case DicomRequestType_NAction: + return "N-Action"; + break; + default: throw OrthancException(ErrorCode_ParameterOutOfRange); } diff -r a77e7839012a -r 085283445db0 Core/Enumerations.h --- a/Core/Enumerations.h Thu Jan 16 12:50:06 2020 +0100 +++ b/Core/Enumerations.h Thu Jan 16 15:28:32 2020 +0100 @@ -622,7 +622,8 @@ DicomRequestType_Find, DicomRequestType_Get, DicomRequestType_Move, - DicomRequestType_Store + DicomRequestType_Store, + DicomRequestType_NAction }; enum TransferSyntax diff -r a77e7839012a -r 085283445db0 OrthancServer/OrthancRestApi/OrthancRestModalities.cpp --- a/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp Thu Jan 16 12:50:06 2020 +0100 +++ b/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp Thu Jan 16 15:28:32 2020 +0100 @@ -1106,8 +1106,6 @@ static void PeerSystem(RestApiGetCall& call) { - ServerContext& context = OrthancRestApi::GetContext(call); - std::string remote = call.GetUriComponent("id", ""); OrthancConfiguration::ReaderLock lock; diff -r a77e7839012a -r 085283445db0 Resources/Configuration.json --- a/Resources/Configuration.json Thu Jan 16 12:50:06 2020 +0100 +++ b/Resources/Configuration.json Thu Jan 16 15:28:32 2020 +0100 @@ -219,7 +219,8 @@ // "AllowEcho" : false, // "AllowFind" : false, // "AllowMove" : false, - // "AllowStore" : true + // "AllowStore" : true, + // "AllowNAction" : false // Allow storage commitment (new in 1.6.0) //} }, diff -r a77e7839012a -r 085283445db0 UnitTestsSources/MultiThreadingTests.cpp --- a/UnitTestsSources/MultiThreadingTests.cpp Thu Jan 16 12:50:06 2020 +0100 +++ b/UnitTestsSources/MultiThreadingTests.cpp Thu Jan 16 15:28:32 2020 +0100 @@ -1897,6 +1897,7 @@ ASSERT_TRUE(modality.IsRequestAllowed(DicomRequestType_Get)); ASSERT_TRUE(modality.IsRequestAllowed(DicomRequestType_Store)); ASSERT_TRUE(modality.IsRequestAllowed(DicomRequestType_Move)); + ASSERT_TRUE(modality.IsRequestAllowed(DicomRequestType_NAction)); } s = Json::nullValue; @@ -1925,6 +1926,7 @@ ASSERT_TRUE(modality.IsRequestAllowed(DicomRequestType_Get)); ASSERT_TRUE(modality.IsRequestAllowed(DicomRequestType_Store)); ASSERT_TRUE(modality.IsRequestAllowed(DicomRequestType_Move)); + ASSERT_TRUE(modality.IsRequestAllowed(DicomRequestType_NAction)); } s["Port"] = "46"; @@ -1944,8 +1946,9 @@ operations.insert(DicomRequestType_Get); operations.insert(DicomRequestType_Move); operations.insert(DicomRequestType_Store); + operations.insert(DicomRequestType_NAction); - ASSERT_EQ(5u, operations.size()); + ASSERT_EQ(6u, operations.size()); for (std::set::const_iterator it = operations.begin(); it != operations.end(); ++it)