changeset 6717:452e7ad09e80

removed safeguard associated with LookupIdentifierExact()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 14 Apr 2026 10:51:15 +0200
parents ba2ac5b743bb
children 5974e02f23ce 92fc8268cff1
files NEWS OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp OrthancServer/Sources/Search/DicomTagConstraint.cpp
diffstat 3 files changed, 23 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Tue Apr 14 09:29:09 2026 +0200
+++ b/NEWS	Tue Apr 14 10:51:15 2026 +0200
@@ -4,8 +4,8 @@
 General
 -------
 
-* New configuration option "LoaderThreads", shared by actions that require loading multiple files,
-  enabling the parallel loading of multiple DICOM instances, including:
+* New configuration option "LoaderThreads", shared by actions that require loading multiple
+  DICOM instances, enabling the parallel loading of files from the storage area, including:
   - downloading ZIP archive/media,
   - performing a C-Store to a remote modality,
   - performing a peer transfer to a remote Orthanc,
@@ -19,8 +19,8 @@
 * New configuration option "MaximumFileSizeInArchiveMB" to limit the file size in ZIP/gzip archives.
   Default value is set to 4GB.
 * New experimental configuration "PatientLevelEnabled".
-* Added basic support for High Throughput JPEG 2000 transfer syntaxes. Orthanc is
-  currently not able to compress/decompress or preview these images.
+* Basic support for High Throughput JPEG 2000 transfer syntaxes. Orthanc will not be able to
+  compress/decompress or preview these images without a plugin.
 
 REST API
 --------
@@ -47,7 +47,7 @@
 Lua
 ---
 
-* Added a new "OutgoingCStoreInstanceFilter()" function.
+* Added a new "OutgoingCStoreInstanceFilter()" callback.
 
 Plugins
 -------
@@ -75,7 +75,7 @@
   through the "filename" argument of "{...}/file" or "{...}/archive" routes
   (credits: Pavel Kohout, Aisle Research, https://www.aisle.com/)
 * Fix "LimitFindResults" and "LimitFindInstances" configurations that were not
-  applied to C-FIND (bug introduced in 1.12.5)
+  properly applied to C-Find (bug introduced in 1.12.5)
 * Allow multiple calls to "/queries/../answers/../retrieve" in parallel
   https://discourse.orthanc-server.org/t/synchronous-jobs-limited-to-one-at-a-time/6365
 * Fix "/tools/lookup" and "OrthancPluginLookupPatient()" that were considering
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp	Tue Apr 14 09:29:09 2026 +0200
+++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp	Tue Apr 14 10:51:15 2026 +0200
@@ -1220,7 +1220,7 @@
     if (!isIdentical) // if an exact match can not be ensured because some values contained characters that are removed from the DicomIdentifier table during normalization,
                       // search in the MainDicomTags table instead.
     {
-      dbConstraint.reset(c.ConvertToDatabaseConstraint(isIdentical, level, DicomTagType_Identifier));
+      dbConstraint.reset(c.ConvertToDatabaseConstraint(isIdentical, level, DicomTagType_Main));
     }
 
     request.GetDicomTagConstraints().AddConstraint(dbConstraint.release());
--- a/OrthancServer/Sources/Search/DicomTagConstraint.cpp	Tue Apr 14 09:29:09 2026 +0200
+++ b/OrthancServer/Sources/Search/DicomTagConstraint.cpp	Tue Apr 14 10:51:15 2026 +0200
@@ -160,10 +160,22 @@
     caseSensitive_(constraint.IsCaseSensitive()),
     mandatory_(constraint.IsMandatory())
   {
-#if defined(ORTHANC_ENABLE_LUA) && ORTHANC_ENABLE_LUA != 0
-    assert(constraint.IsIdentifier() ==
-           ServerToolbox::IsIdentifier(constraint.GetTag(), constraint.GetLevel()));
-#endif
+    /**
+     * WARNING: Since Orthanc 1.12.11, the following assumption
+     * doesn't always hold anymore:
+     *
+     * assert(constraint.IsIdentifier() == ServerToolbox::IsIdentifier(constraint.GetTag(), constraint.GetLevel()))
+     *
+     * This is a consequence of the following changeset that applies
+     * some normalization to the PatientID tag:
+     * https://orthanc.uclouvain.be/hg/orthanc/rev/72aca3bddaf7
+     *
+     * Note that all the identifier tags (PatientID, StudyInstanceUID,
+     * AccessionNumber, SeriesInstanceUID, and SOPInstanceUID) are
+     * duplicated between the "DicomIdentifiers" and "MainDicomTags"
+     * tables in the database (since at least Orthanc 1.3.2), so this
+     * shouldn't be an issue.
+     **/
     
     if (constraint.IsIdentifier())
     {