# HG changeset patch # User Alain Mazy # Date 1782916842 -7200 # Node ID 317326336ac63f925447d23b7ea16756724ef163 # Parent c60dae105872b05b2f5582ac4c82a1795c62ff5d fix sequence handling in C-Find answers diff -r c60dae105872 -r 317326336ac6 NEWS --- a/NEWS Mon Jun 29 16:00:46 2026 +0200 +++ b/NEWS Wed Jul 01 16:40:42 2026 +0200 @@ -19,6 +19,11 @@ - StoreKeyValue(storeId, key, value) - value = GetKeyValue(storeId, key) - DeleteKeyValue(storeId, key) +* C-Find SCP: When Orthanc was requested a sequence in a C-Find, Orthanc was actually not returning + any sequences in the C-Find answer if the matched resource did contain the requested sequence and + was returning an empty sequence if the matched resource did not contain the requestes sequence. + Orthanc now returns the full sequence content when the matched resource contains the requested sequence. + REST API -------- diff -r c60dae105872 -r 317326336ac6 OrthancServer/Sources/OrthancFindRequestHandler.cpp --- a/OrthancServer/Sources/OrthancFindRequestHandler.cpp Mon Jun 29 16:00:46 2026 +0200 +++ b/OrthancServer/Sources/OrthancFindRequestHandler.cpp Wed Jul 01 16:40:42 2026 +0200 @@ -41,25 +41,22 @@ namespace Orthanc { + static void CopySequence(ParsedDicomFile& dicom, const DicomTag& tag, - const Json::Value& source, + const Json::Value& sequenceContent, const std::string& defaultPrivateCreator, const std::map& privateCreators) { - if (source.type() == Json::objectValue && - source.isMember("Type") && - source.isMember("Value") && - source["Type"].asString() == "Sequence" && - source["Value"].type() == Json::arrayValue) + if (sequenceContent.isArray()) { - Json::Value content = Json::arrayValue; + Json::Value simplifiedContent = Json::arrayValue; - for (Json::Value::ArrayIndex i = 0; i < source["Value"].size(); i++) + for (Json::Value::ArrayIndex i = 0; i < sequenceContent.size(); i++) { Json::Value item; - Toolbox::SimplifyDicomAsJson(item, source["Value"][i], DicomToJsonFormat_Short); - content.append(item); + Toolbox::SimplifyDicomAsJson(item, sequenceContent[i], DicomToJsonFormat_Short); + simplifiedContent.append(item); } if (tag.IsPrivate()) @@ -68,16 +65,16 @@ if (found != privateCreators.end()) { - dicom.Replace(tag, content, false, DicomReplaceMode_InsertIfAbsent, found->second.c_str()); + dicom.Replace(tag, simplifiedContent, false, DicomReplaceMode_InsertIfAbsent, found->second.c_str()); } else { - dicom.Replace(tag, content, false, DicomReplaceMode_InsertIfAbsent, defaultPrivateCreator); + dicom.Replace(tag, simplifiedContent, false, DicomReplaceMode_InsertIfAbsent, defaultPrivateCreator); } } else { - dicom.Replace(tag, content, false, DicomReplaceMode_InsertIfAbsent, "" /* no private creator */); + dicom.Replace(tag, simplifiedContent, false, DicomReplaceMode_InsertIfAbsent, "" /* no private creator */); } } }