# HG changeset patch # User Sebastien Jodogne # Date 1714212893 -7200 # Node ID df7324d6e72802b66462f95f81fa5948f4d335ee # Parent 77570cce8855c0579f7e6da51a3267cd1d9fcbb5 removed redundant FindResponse::parent_ diff -r 77570cce8855 -r df7324d6e728 OrthancServer/Sources/Database/FindResponse.h --- a/OrthancServer/Sources/Database/FindResponse.h Sat Apr 27 11:31:39 2024 +0200 +++ b/OrthancServer/Sources/Database/FindResponse.h Sat Apr 27 12:14:53 2024 +0200 @@ -84,8 +84,7 @@ private: FindRequest::ResponseContent responseContent_; // what has been requested ResourceType level_; - std::string parent_; // TODO-FIND: Remove this, as it is redundant with "identifiers_" - OrthancIdentifiers identifiers_; // TODO-FIND: not convenient to use here. A simple resourceId seems enough + OrthancIdentifiers identifiers_; std::unique_ptr dicomMap_; std::list children_; std::string childInstanceId_; @@ -162,16 +161,6 @@ return children_; } - void SetParent(const std::string& parent) - { - parent_ = parent; - } - - const std::string& GetParent() const - { - return parent_; - } - void AddLabel(const std::string& label) { labels_.insert(label); @@ -204,6 +193,12 @@ return false; } + void SetIdentifier(ResourceType level, + const std::string& id) + { + identifiers_.SetLevel(level, id); + } + // TODO-FIND: add other getters and setters }; diff -r 77570cce8855 -r df7324d6e728 OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp --- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Sat Apr 27 11:31:39 2024 +0200 +++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Sat Apr 27 12:14:53 2024 +0200 @@ -1257,7 +1257,7 @@ while (statement.Step()) { const std::string& resourceId = statement.ColumnString(0); - items[resourceId]->SetParent(statement.ColumnString(1)); + items[resourceId]->SetIdentifier(GetParentResourceType(request.GetLevel()), statement.ColumnString(1)); } } diff -r 77570cce8855 -r df7324d6e728 OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp --- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Sat Apr 27 11:31:39 2024 +0200 +++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Sat Apr 27 12:14:53 2024 +0200 @@ -3884,7 +3884,7 @@ if (item.HasResponseContent(FindRequest::ResponseContent_Parent)) { - parentId_ = item.GetParent(); + parentId_ = item.GetIdentifiers().GetLevel(GetParentResourceType(level)); } if (item.HasResponseContent(FindRequest::ResponseContent_Metadata))