# HG changeset patch # User Sebastien Jodogne # Date 1730210759 0 # Node ID 0f4345cbe55804205ce0fd6fb2e156a2dbd7fe7d # Parent b8fb95937f221e6653f5eb13e972736d30c5ee41 GetChildrenPublicId() and LookupResourceAndParent() tagged as compatibility database primitives diff -r b8fb95937f22 -r 0f4345cbe558 OrthancServer/Sources/Database/Compatibility/GenericFind.cpp --- a/OrthancServer/Sources/Database/Compatibility/GenericFind.cpp Tue Oct 29 13:48:39 2024 +0000 +++ b/OrthancServer/Sources/Database/Compatibility/GenericFind.cpp Tue Oct 29 14:05:59 2024 +0000 @@ -56,7 +56,7 @@ } static void GetChildren(std::list& target, - IDatabaseWrapper::ITransaction& transaction, + IDatabaseWrapper::ICompatibilityTransaction& transaction, const std::list& resources) { target.clear(); @@ -71,6 +71,7 @@ static void GetChildrenIdentifiers(std::list& children, IDatabaseWrapper::ITransaction& transaction, + IDatabaseWrapper::ICompatibilityTransaction& compatibilityTransaction, const OrthancIdentifiers& identifiers, ResourceType topLevel, ResourceType bottomLevel) @@ -100,7 +101,7 @@ ResourceType nextLevel = GetChildResourceType(currentLevel); if (nextLevel == bottomLevel) { - GetChildren(children, transaction, currentResources); + GetChildren(children, compatibilityTransaction, currentResources); } else { @@ -209,7 +210,8 @@ !request.GetOrthancIdentifiers().HasSeriesId() && !request.GetOrthancIdentifiers().HasInstanceId()) { - GetChildrenIdentifiers(identifiers, transaction_, request.GetOrthancIdentifiers(), ResourceType_Patient, request.GetLevel()); + GetChildrenIdentifiers(identifiers, transaction_, compatibilityTransaction_, + request.GetOrthancIdentifiers(), ResourceType_Patient, request.GetLevel()); } else if (IsRequestWithoutContraint(request) && (request.GetLevel() == ResourceType_Series || @@ -219,7 +221,8 @@ !request.GetOrthancIdentifiers().HasSeriesId() && !request.GetOrthancIdentifiers().HasInstanceId()) { - GetChildrenIdentifiers(identifiers, transaction_, request.GetOrthancIdentifiers(), ResourceType_Study, request.GetLevel()); + GetChildrenIdentifiers(identifiers, transaction_, compatibilityTransaction_, + request.GetOrthancIdentifiers(), ResourceType_Study, request.GetLevel()); } else if (IsRequestWithoutContraint(request) && request.GetLevel() == ResourceType_Instance && @@ -228,7 +231,8 @@ request.GetOrthancIdentifiers().HasSeriesId() && !request.GetOrthancIdentifiers().HasInstanceId()) { - GetChildrenIdentifiers(identifiers, transaction_, request.GetOrthancIdentifiers(), ResourceType_Series, request.GetLevel()); + GetChildrenIdentifiers(identifiers, transaction_, compatibilityTransaction_, + request.GetOrthancIdentifiers(), ResourceType_Series, request.GetLevel()); } else if (request.GetMetadataConstraintsCount() == 0 && request.GetOrdering().empty() && @@ -393,7 +397,7 @@ if (request.IsRetrieveParentIdentifier()) { - if (!transaction_.LookupResourceAndParent(internalId, level, parent, identifier)) + if (!compatibilityTransaction_.LookupResourceAndParent(internalId, level, parent, identifier)) { return; // The resource is not available anymore } @@ -519,7 +523,7 @@ for (std::list::const_iterator it = currentIds.begin(); it != currentIds.end(); ++it) { std::list ids; - transaction_.GetChildrenPublicId(ids, *it); + compatibilityTransaction_.GetChildrenPublicId(ids, *it); for (std::list::const_iterator it2 = ids.begin(); it2 != ids.end(); ++it2) { diff -r b8fb95937f22 -r 0f4345cbe558 OrthancServer/Sources/Database/IDatabaseWrapper.h --- a/OrthancServer/Sources/Database/IDatabaseWrapper.h Tue Oct 29 13:48:39 2024 +0000 +++ b/OrthancServer/Sources/Database/IDatabaseWrapper.h Tue Oct 29 14:05:59 2024 +0000 @@ -210,9 +210,6 @@ virtual void GetChildrenInternalId(std::list& target, int64_t id) = 0; - virtual void GetChildrenPublicId(std::list& target, - int64_t id) = 0; - virtual void GetExportedResources(std::list& target /*out*/, bool& done /*out*/, int64_t since, @@ -336,16 +333,6 @@ /** - * Primitives introduced in Orthanc 1.5.4 - **/ - - virtual bool LookupResourceAndParent(int64_t& id, - ResourceType& type, - std::string& parentPublicId, - const std::string& publicId) = 0; - - - /** * Primitives introduced in Orthanc 1.12.0 **/ @@ -429,6 +416,18 @@ ResourceType resourceType, int64_t since, uint32_t limit) = 0; + + virtual void GetChildrenPublicId(std::list& target, + int64_t id) = 0; + + /** + * Primitives introduced in Orthanc 1.5.4 + **/ + + virtual bool LookupResourceAndParent(int64_t& id, + ResourceType& type, + std::string& parentPublicId, + const std::string& publicId) = 0; }; diff -r b8fb95937f22 -r 0f4345cbe558 OrthancServer/Sources/Database/StatelessDatabaseOperations.h --- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.h Tue Oct 29 13:48:39 2024 +0000 +++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.h Tue Oct 29 14:05:59 2024 +0000 @@ -165,12 +165,6 @@ transaction_.GetChildrenInternalId(target, id); } - void GetChildrenPublicId(std::list& target, - int64_t id) - { - transaction_.GetChildrenPublicId(target, id); - } - void GetExportedResources(std::list& target /*out*/, bool& done /*out*/, int64_t since, @@ -271,14 +265,6 @@ { return transaction_.LookupResource(id, type, publicId); } - - bool LookupResourceAndParent(int64_t& id, - ResourceType& type, - std::string& parentPublicId, - const std::string& publicId) - { - return transaction_.LookupResourceAndParent(id, type, parentPublicId, publicId); - } void ListLabels(std::set& target, int64_t id)