# HG changeset patch # User Sebastien Jodogne # Date 1681293269 -7200 # Node ID afe92108f463df0dea8ff2e6988cd79e3b3dea71 # Parent 261ce0ed85e6b40a731cb90f5038bcf525a4a022# Parent 0b183bb77c83b16a555cf7ebcb6ce7892969e14b integration mainline->db-protobuf diff -r 0b183bb77c83 -r afe92108f463 NEWS --- a/NEWS Wed Apr 12 11:54:08 2023 +0200 +++ b/NEWS Wed Apr 12 11:54:29 2023 +0200 @@ -1,11 +1,21 @@ Pending changes in the mainline =============================== +General +------- + +* Support for labels associated with patients, studies, series, and instances + REST API -------- * API version upgraded to 20 -* /system: added "UserMetadata" +* New URIs "/.../{id}/labels/{label}" to test/set/remove labels +* "/patients/{id}", "/studies/{id}", "/series/{id}" and "/instances/{id}" + contain the "Labels" field +* "/tools/find" now accepts the "Labels" and "LabelsConstraint" arguments +* "/tools/labels" lists all the labels that are associated with any resource +* "/system": added "UserMetadata" and "HasLabels" Plugins ------- @@ -16,6 +26,7 @@ Orthanc Explorer ---------------- +* Added support for labels * Added buttons to copy the URL of ZIP archives and DICOM files to the clipboard Maintenance @@ -23,7 +34,7 @@ * Enforce the existence of the patient/study/instance while creating its archive * Security: New configuration option "RestApiWriteToFileSystemEnabled" - to allow "/instances/../export" that is now disabled by default + to allow "/instances/../export" (the latter is now disabled by default) * Fix issue 214: VOILUTSequence is not returned in Wado-RS * Fix /tools/reset crashing when ExtraMainDicomTags were defined * Fix Housekeeper plugin infinite loop if Orthanc is empty. @@ -45,7 +56,7 @@ AcceptedTransferSyntaxes. * Made the default SQLite DB more robust wrt future updates like adding new columns in DB. -* Made the HTTP Client errors more verbose by including the url in the logs. +* Made the HTTP Client errors more verbose by including the URL in the logs. * Optimization: now using multiple threads to transcode files for asynchronous download of studies archive. * New configuration "KeepAliveTimeout" with a default value of 1 second. @@ -156,7 +167,7 @@ * Housekeeper plugin: Fix resume of previous processing * Added missing MOVEPatientRootQueryRetrieveInformationModel in DicomControlUserConnection::SetupPresentationContexts() -* Improved HttpClient error logging (add method + url) +* Improved HttpClient error logging (add method + URL) REST API -------- diff -r 0b183bb77c83 -r afe92108f463 OrthancFramework/Sources/SerializationToolbox.cpp --- a/OrthancFramework/Sources/SerializationToolbox.cpp Wed Apr 12 11:54:08 2023 +0200 +++ b/OrthancFramework/Sources/SerializationToolbox.cpp Wed Apr 12 11:54:29 2023 +0200 @@ -72,6 +72,21 @@ } + std::string SerializationToolbox::ReadString(const Json::Value& value, + const std::string& field, + const std::string& defaultValue) + { + if (value.isMember(field.c_str())) + { + return ReadString(value, field); + } + else + { + return defaultValue; + } + } + + int SerializationToolbox::ReadInteger(const Json::Value& value, const std::string& field) { diff -r 0b183bb77c83 -r afe92108f463 OrthancFramework/Sources/SerializationToolbox.h --- a/OrthancFramework/Sources/SerializationToolbox.h Wed Apr 12 11:54:08 2023 +0200 +++ b/OrthancFramework/Sources/SerializationToolbox.h Wed Apr 12 11:54:29 2023 +0200 @@ -38,6 +38,10 @@ static std::string ReadString(const Json::Value& value, const std::string& field); + static std::string ReadString(const Json::Value& value, + const std::string& field, + const std::string& defaultValue); + static int ReadInteger(const Json::Value& value, const std::string& field); diff -r 0b183bb77c83 -r afe92108f463 OrthancFramework/UnitTestsSources/DicomMapTests.cpp --- a/OrthancFramework/UnitTestsSources/DicomMapTests.cpp Wed Apr 12 11:54:08 2023 +0200 +++ b/OrthancFramework/UnitTestsSources/DicomMapTests.cpp Wed Apr 12 11:54:29 2023 +0200 @@ -716,7 +716,7 @@ DicomMap sequencesOnly; m.ExtractSequences(sequencesOnly); - ASSERT_EQ(1, sequencesOnly.GetSize()); + ASSERT_EQ(1u, sequencesOnly.GetSize()); ASSERT_TRUE(sequencesOnly.HasTag(0x0008, 0x1111)); ASSERT_TRUE(sequencesOnly.GetValue(0x0008, 0x1111).GetSequenceContent()[0].isMember("0008,1150")); @@ -724,7 +724,7 @@ DicomMap sequencesCopy; sequencesCopy.SetValue(0x0008, 0x1111, sequencesOnly.GetValue(0x0008, 0x1111)); - ASSERT_EQ(1, sequencesCopy.GetSize()); + ASSERT_EQ(1u, sequencesCopy.GetSize()); ASSERT_TRUE(sequencesCopy.HasTag(0x0008, 0x1111)); ASSERT_TRUE(sequencesCopy.GetValue(0x0008, 0x1111).GetSequenceContent()[0].isMember("0008,1150")); } diff -r 0b183bb77c83 -r afe92108f463 OrthancServer/CMakeLists.txt --- a/OrthancServer/CMakeLists.txt Wed Apr 12 11:54:08 2023 +0200 +++ b/OrthancServer/CMakeLists.txt Wed Apr 12 11:54:29 2023 +0200 @@ -228,16 +228,15 @@ ##################################################################### set(ORTHANC_EMBEDDED_FILES - CONFIGURATION_SAMPLE ${CMAKE_SOURCE_DIR}/Resources/Configuration.json - DICOM_CONFORMANCE_STATEMENT ${CMAKE_SOURCE_DIR}/Resources/DicomConformanceStatement.txt - FONT_UBUNTU_MONO_BOLD_16 ${CMAKE_SOURCE_DIR}/Resources/Fonts/UbuntuMonoBold-16.json - LUA_TOOLBOX ${CMAKE_SOURCE_DIR}/Resources/Toolbox.lua - PREPARE_DATABASE ${CMAKE_SOURCE_DIR}/Sources/Database/PrepareDatabase.sql - UPGRADE_DATABASE_3_TO_4 ${CMAKE_SOURCE_DIR}/Sources/Database/Upgrade3To4.sql - UPGRADE_DATABASE_4_TO_5 ${CMAKE_SOURCE_DIR}/Sources/Database/Upgrade4To5.sql - - INSTALL_TRACK_ATTACHMENTS_SIZE - ${CMAKE_SOURCE_DIR}/Sources/Database/InstallTrackAttachmentsSize.sql + CONFIGURATION_SAMPLE ${CMAKE_SOURCE_DIR}/Resources/Configuration.json + DICOM_CONFORMANCE_STATEMENT ${CMAKE_SOURCE_DIR}/Resources/DicomConformanceStatement.txt + FONT_UBUNTU_MONO_BOLD_16 ${CMAKE_SOURCE_DIR}/Resources/Fonts/UbuntuMonoBold-16.json + LUA_TOOLBOX ${CMAKE_SOURCE_DIR}/Resources/Toolbox.lua + PREPARE_DATABASE ${CMAKE_SOURCE_DIR}/Sources/Database/PrepareDatabase.sql + UPGRADE_DATABASE_3_TO_4 ${CMAKE_SOURCE_DIR}/Sources/Database/Upgrade3To4.sql + UPGRADE_DATABASE_4_TO_5 ${CMAKE_SOURCE_DIR}/Sources/Database/Upgrade4To5.sql + INSTALL_TRACK_ATTACHMENTS_SIZE ${CMAKE_SOURCE_DIR}/Sources/Database/InstallTrackAttachmentsSize.sql + INSTALL_LABELS_TABLE ${CMAKE_SOURCE_DIR}/Sources/Database/InstallLabelsTable.sql ) if (STANDALONE_BUILD) diff -r 0b183bb77c83 -r afe92108f463 OrthancServer/OrthancExplorer/explorer.css --- a/OrthancServer/OrthancExplorer/explorer.css Wed Apr 12 11:54:08 2023 +0200 +++ b/OrthancServer/OrthancExplorer/explorer.css Wed Apr 12 11:54:29 2023 +0200 @@ -63,3 +63,22 @@ .switch-container .ui-slider-switch { width: 100%; } + +.label { + display: inline-block; + background-color: gray; + margin: 5px; + padding: 5px; + border-radius: 10px; +} + +.label button { + background-color: transparent; + border: 0px; + cursor: pointer; + border-radius: 10px; +} + +.label button:hover { + background-color: lightgray; +} diff -r 0b183bb77c83 -r afe92108f463 OrthancServer/OrthancExplorer/explorer.html --- a/OrthancServer/OrthancExplorer/explorer.html Wed Apr 12 11:54:08 2023 +0200 +++ b/OrthancServer/OrthancExplorer/explorer.html Wed Apr 12 11:54:29 2023 +0200 @@ -81,6 +81,11 @@ +
+ + +
+