# HG changeset patch # User Alain Mazy # Date 1737452049 -3600 # Node ID 02f0953c027d8cb1265ea3db103df56f2532afa8 # Parent 2d482a49232ef1b55c81ac3a002ec8e6ee979879 doc AcceptedSopClasses diff -r 2d482a49232e -r 02f0953c027d OrthancServer/Resources/Configuration.json --- a/OrthancServer/Resources/Configuration.json Mon Jan 20 10:15:03 2025 +0100 +++ b/OrthancServer/Resources/Configuration.json Tue Jan 21 10:34:09 2025 +0100 @@ -207,11 +207,22 @@ // to all storage classes defined in DCMTK in case of // C-STORE SCP and to a reduced list of 120 common storage // classes in case of C-GET SCU. + // List of DCMTK default Storage SOP Classes: + // https://github.com/DCMTK/dcmtk/blob/410ffe2019b9db6a8f4036daac742a6f5e4d36c2/dcmdata/libsrc/dcuid.cc#L664 // Each entry can contain wildcards ("?" or "*") to add - // subsets of SOP classes that are defined in DCMTK. + // subsets of SOP classes that are defined in DCMTK defaults. + // "?" accepts any single character at that position. + // "*" accepts any string value at that position. // If you want to add a a SOP class that is not defined in - // DCMTK, you must add it explicitely. + // DCMTK defaults, you must add it explicitely. // (new in Orthanc 1.12.6) + // Example to add a non standard class + // and keep the default ones: + // "AcceptedSopClasses" : [ + // "1.3.12.2.1107.5.9.1", + // "1.2.840.*" + // ] + // Example to limit to 2 SOP Classes: // "AcceptedSopClasses" : [ // "1.2.840.10008.5.1.4.1.1.2", // "1.2.840.10008.5.1.4.1.1.4" diff -r 2d482a49232e -r 02f0953c027d OrthancServer/UnitTestsSources/ServerConfigTests.cpp --- a/OrthancServer/UnitTestsSources/ServerConfigTests.cpp Mon Jan 20 10:15:03 2025 +0100 +++ b/OrthancServer/UnitTestsSources/ServerConfigTests.cpp Tue Jan 21 10:34:09 2025 +0100 @@ -143,6 +143,32 @@ ASSERT_TRUE(s.find("1.2.3.4") != s.end()); } + { // accept the default ones + a custom one + acceptedStorageClasses.clear(); + acceptedStorageClasses.push_back("1.2.840.*"); + acceptedStorageClasses.push_back("1.2.3.4"); + rejectedStorageClasses.clear(); + context.SetAcceptedSopClasses(acceptedStorageClasses, rejectedStorageClasses); + + context.GetAcceptedSopClasses(s, 0); + ASSERT_LE(100u, s.size()); + ASSERT_TRUE(s.find("1.2.3.4") != s.end()); + ASSERT_TRUE(s.find("1.2.840.10008.5.1.4.1.1.12.2.1") != s.end()); + } + + { // test the ? in regex to replace a single char + acceptedStorageClasses.clear(); + acceptedStorageClasses.push_back("1.2.840.10008.5.1.4.1.1.12.2.?"); + acceptedStorageClasses.push_back("1.2.3.4"); + rejectedStorageClasses.clear(); + context.SetAcceptedSopClasses(acceptedStorageClasses, rejectedStorageClasses); + + context.GetAcceptedSopClasses(s, 0); + ASSERT_EQ(2u, s.size()); + ASSERT_TRUE(s.find("1.2.3.4") != s.end()); + ASSERT_TRUE(s.find("1.2.840.10008.5.1.4.1.1.12.2.1") != s.end()); + } + } context.Stop();