changeset 6059:ea2f3d9323e6 attach-custom-data

integration mainline->attach-custom-data
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 25 Mar 2025 20:42:19 +0100 (7 weeks ago)
parents 3f560fa6db5b (current diff) bfdb4930b69d (diff)
children 4a8c4559dc95
files NEWS
diffstat 4 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Tue Mar 25 20:41:02 2025 +0100
+++ b/NEWS	Tue Mar 25 20:42:19 2025 +0100
@@ -20,6 +20,7 @@
 * All routes accepting a "transcode" url argument or a "Transcode" field in the payload now also
   accepts a "lossy-quality" url argument or a "LossyQuality" field to define the compression quality factor.
   If not specified, the "DicomLossyTranscodingQuality" configuration is taken into account.
+* Fix OpenAPI documentation for /modalities/../get
 
 Plugins
 -------
@@ -32,7 +33,9 @@
 
 * In the "ExtendedFind" mode:
   - optimized "tools/find" when "StorageAccessMode" is set to "Never".
-  - "tools/find" is now returning results when e.g, ordering instances against a metadata they don't have
+  - "tools/find" is now returning results when e.g, ordering instances against a metadata they don't have.
+  - Get SOPClassUID from metadata when available -> this fixes display of PDF files in Stone when 
+    "StorageAccessOnFind" is set to "Never".
 * Fixed interpretation of returnUnsupportedImage in /preview route. 
 * GET /series/../study now also contain LastUpdate field:
   https://discourse.orthanc-server.org/t/lastupdate-coherency/5524
@@ -40,6 +43,12 @@
 * Enabled support of the 1.2.840.10008.1.2.1.99 transfer syntax
   (Deflated Explicit VR Little Endian) in static builds + fix length of saved files.
   https://discourse.orthanc-server.org/t/transcoding-to-deflated-transfer-syntax-fails/5489
+* When anonymizing a resource while forcing some value with the 'Replace' fields, the tag
+  0012,0063 was cleared out because the DICOM Anonymization profile was not strictly followed.
+  From now on:
+  - 0012,0063 will contain "Orthanc {version} - {Anonymization profile}" if no 'Replace' is used.
+  - 0012,0063 will contain "Orthanc {version}" if 'Replace' is used.
+  (https://orthanc.uclouvain.be/bugs/show_bug.cgi?id=240)
 * Housekeeper plugin:
   - When encountering an error, the housekeeper now skips the resource and continues processing.
 * Orthanc Explorer:
--- a/OrthancFramework/Sources/DicomFormat/DicomTag.h	Tue Mar 25 20:41:02 2025 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomTag.h	Tue Mar 25 20:42:19 2025 +0100
@@ -106,8 +106,9 @@
   static const DicomTag DICOM_TAG_SOP_CLASS_UID(0x0008, 0x0016);
   static const DicomTag DICOM_TAG_MEDIA_STORAGE_SOP_CLASS_UID(0x0002, 0x0002);
   static const DicomTag DICOM_TAG_MEDIA_STORAGE_SOP_INSTANCE_UID(0x0002, 0x0003);
+  static const DicomTag DICOM_TAG_PATIENT_IDENTITY_REMOVED(0x0012, 0x0062);
   static const DicomTag DICOM_TAG_DEIDENTIFICATION_METHOD(0x0012, 0x0063);
-
+  
   // DICOM tags used for fMRI (thanks to Will Ryder)
   static const DicomTag DICOM_TAG_NUMBER_OF_TEMPORAL_POSITIONS(0x0020, 0x0105);
   static const DicomTag DICOM_TAG_TEMPORAL_POSITION_IDENTIFIER(0x0020, 0x0100);
--- a/OrthancFramework/Sources/DicomParsing/DicomModification.cpp	Tue Mar 25 20:41:02 2025 +0100
+++ b/OrthancFramework/Sources/DicomParsing/DicomModification.cpp	Tue Mar 25 20:42:19 2025 +0100
@@ -47,6 +47,9 @@
 static const std::string ORTHANC_DEIDENTIFICATION_METHOD_2023b =
   "Orthanc " ORTHANC_VERSION " - PS 3.15-2023b Table E.1-1 Basic Profile";
 
+static const std::string ORTHANC_UNSAFE_DEIDENTIFICATION =
+  "Orthanc " ORTHANC_VERSION;
+
 namespace Orthanc
 {
   namespace
@@ -434,8 +437,7 @@
           it->second->asString() == ORTHANC_DEIDENTIFICATION_METHOD_2021b ||
           it->second->asString() == ORTHANC_DEIDENTIFICATION_METHOD_2023b)
       {
-        delete it->second;
-        replacements_.erase(it);
+        ReplaceInternal(DICOM_TAG_DEIDENTIFICATION_METHOD, ORTHANC_UNSAFE_DEIDENTIFICATION);
       }
     }
   }
@@ -916,7 +918,7 @@
     }
 
     // Set the PatientIdentityRemoved tag
-    ReplaceInternal(DicomTag(0x0012, 0x0062), "YES");
+    ReplaceInternal(DICOM_TAG_PATIENT_IDENTITY_REMOVED, "YES");
 
     // (*) Choose a random patient name and ID
     uids_.insert(DICOM_TAG_PATIENT_ID);
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp	Tue Mar 25 20:41:02 2025 +0100
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp	Tue Mar 25 20:42:19 2025 +0100
@@ -1699,8 +1699,8 @@
                          "negotiation to certain SOPClassUID or to present uncommon SOPClassUID during "
                          "the DICOM negotiation.  By default, "
                          "Orhanc will propose the most 120 common SOPClassUIDs.", true)
-        .SetRequestField(KEY_QUERY, RestApiCallDocumentation::Type_JsonObject,
-                         "A query object identifying all the DICOM resources to be retrieved", true)
+        .SetRequestField(KEY_LEVEL, RestApiCallDocumentation::Type_String,
+                         "Level of the query (`Patient`, `Study`, `Series` or `Instance`)", true)
         .SetRequestField(KEY_LOCAL_AET, RestApiCallDocumentation::Type_String,
                          "Local AET that is used for this commands, defaults to `DicomAet` configuration option. "
                          "Ignored if `DicomModalities` already sets `LocalAet` for this modality.", false)