# HG changeset patch # User Alain Mazy # Date 1683715955 -7200 # Node ID e0e2aee4453e861f066bfd293242b6b9a7db0ad6 # Parent ef6d4e794401921d32e8a49c7b912894addf3e1b Modality worklists plugin: allow searching on private tags (exact match only) diff -r ef6d4e794401 -r e0e2aee4453e NEWS --- a/NEWS Wed May 10 11:54:59 2023 +0200 +++ b/NEWS Wed May 10 12:52:35 2023 +0200 @@ -7,6 +7,7 @@ * Fix decoding of YBR_FULL RLE images for which the "Planar Configuration" tag (0028,0006) equals 1 * Made Orthanc more resilient to common spelling errors in SpecificCharacterSet +* Modality worklists plugin: allow searching on private tags (exact match only) * Upgraded dependencies for static builds: - boost 1.82.0 diff -r ef6d4e794401 -r e0e2aee4453e OrthancServer/Sources/Search/HierarchicalMatcher.cpp --- a/OrthancServer/Sources/Search/HierarchicalMatcher.cpp Wed May 10 11:54:59 2023 +0200 +++ b/OrthancServer/Sources/Search/HierarchicalMatcher.cpp Wed May 10 12:52:35 2023 +0200 @@ -248,6 +248,8 @@ { std::unique_ptr target(new DcmDataset); + std::string currentPrivateCreator = ""; + for (std::set::const_iterator it = flatTags_.begin(); it != flatTags_.end(); ++it) { @@ -257,13 +259,19 @@ if (source.findAndGetElement(tag, element).good() && element != NULL) { - if (it->IsPrivate()) + if (tag.isPrivateReservation()) { - throw OrthancException(ErrorCode_NotImplemented, - "Not applicable to private tags: " + it->Format()); + OFString privateCreator; + element->getOFString(privateCreator, 0, false); + currentPrivateCreator = privateCreator.c_str(); } - - std::unique_ptr cloned(FromDcmtkBridge::CreateElementForTag(*it, "" /* no private creator */)); + else if (!it->IsPrivate()) + { + // reset the private creator as soon as we reach the end of the current private block + currentPrivateCreator = ""; + } + + std::unique_ptr cloned(FromDcmtkBridge::CreateElementForTag(*it, currentPrivateCreator.c_str())); cloned->copyFrom(*element); target->insert(cloned.release()); }