# HG changeset patch # User Sebastien Jodogne # Date 1615821402 -3600 # Node ID 36bbf3169a27ca14520fd088233498345eaf7ec6 # Parent ff8170d17d90fe4f6996e77cc474f72d83cc8774 comments diff -r ff8170d17d90 -r 36bbf3169a27 OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp --- a/OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp Mon Mar 15 15:30:42 2021 +0100 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp Mon Mar 15 16:16:42 2021 +0100 @@ -119,23 +119,6 @@ // From the "ILookupResources" interface - void GetAllInternalIds(std::list& target, - ResourceType resourceType) ORTHANC_OVERRIDE - { - if (that_.extensions_.getAllInternalIds == NULL) - { - throw OrthancException(ErrorCode_DatabasePlugin, - "The database plugin does not implement the mandatory GetAllInternalIds() extension"); - } - - that_.ResetAnswers(); - CheckSuccess(that_.extensions_.getAllInternalIds(that_.GetContext(), that_.payload_, Plugins::Convert(resourceType))); - that_.ForwardAnswers(target); - } - - - - // From the "ILookupResources" interface void LookupIdentifier(std::list& result, ResourceType level, const DicomTag& tag, @@ -160,11 +143,6 @@ } - - /** - * Implementation of "ITransaction" - **/ - virtual void ApplyLookupResources(std::list& resourcesId, std::list* instancesId, const std::vector& lookup, @@ -241,15 +219,6 @@ } } } - - - virtual int64_t CreateResource(const std::string& publicId, - ResourceType type) ORTHANC_OVERRIDE - { - int64_t id; - CheckSuccess(that_.backend_.createResource(&id, that_.payload_, publicId.c_str(), Plugins::Convert(type))); - return id; - } virtual void AddAttachment(int64_t id, @@ -268,6 +237,7 @@ } + // From the "ICreateInstance" interface virtual void AttachChild(int64_t parent, int64_t child) ORTHANC_OVERRIDE { @@ -299,6 +269,16 @@ } + // From the "ICreateInstance" interface + virtual int64_t CreateResource(const std::string& publicId, + ResourceType type) ORTHANC_OVERRIDE + { + int64_t id; + CheckSuccess(that_.backend_.createResource(&id, that_.payload_, publicId.c_str(), Plugins::Convert(type))); + return id; + } + + virtual void DeleteAttachment(int64_t id, FileContentType attachment) ORTHANC_OVERRIDE { @@ -319,6 +299,23 @@ } + // From the "ILookupResources" interface + void GetAllInternalIds(std::list& target, + ResourceType resourceType) ORTHANC_OVERRIDE + { + if (that_.extensions_.getAllInternalIds == NULL) + { + throw OrthancException(ErrorCode_DatabasePlugin, + "The database plugin does not implement the mandatory GetAllInternalIds() extension"); + } + + that_.ResetAnswers(); + CheckSuccess(that_.extensions_.getAllInternalIds(that_.GetContext(), that_.payload_, Plugins::Convert(resourceType))); + that_.ForwardAnswers(target); + } + + + virtual void GetAllMetadata(std::map& target, int64_t id) ORTHANC_OVERRIDE { @@ -714,6 +711,7 @@ } + // From the "ILookupResources" interface virtual void LookupIdentifierRange(std::list& result, ResourceType level, const DicomTag& tag, @@ -871,6 +869,7 @@ } + // From the "ISetResourcesContent" interface virtual void SetIdentifierTag(int64_t id, const DicomTag& tag, const std::string& value) ORTHANC_OVERRIDE @@ -884,6 +883,7 @@ } + // From the "ISetResourcesContent" interface virtual void SetMainDicomTag(int64_t id, const DicomTag& tag, const std::string& value) ORTHANC_OVERRIDE @@ -913,6 +913,7 @@ } + // From the "ISetResourcesContent" interface virtual void SetResourcesContent(const Orthanc::ResourcesContent& content) ORTHANC_OVERRIDE { if (that_.extensions_.setResourcesContent == NULL) @@ -973,6 +974,7 @@ } + // From the "ICreateInstance" interface virtual void TagMostRecentPatient(int64_t patient) ORTHANC_OVERRIDE { if (that_.extensions_.tagMostRecentPatient != NULL) @@ -980,7 +982,6 @@ CheckSuccess(that_.extensions_.tagMostRecentPatient(that_.payload_, patient)); } } - }; diff -r ff8170d17d90 -r 36bbf3169a27 OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp --- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Mon Mar 15 15:30:42 2021 +0100 +++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Mon Mar 15 16:16:42 2021 +0100 @@ -380,6 +380,7 @@ } + // From the "ICreateInstance" interface virtual void AttachChild(int64_t parent, int64_t child) ORTHANC_OVERRIDE { @@ -429,6 +430,7 @@ } + // From the "ICreateInstance" interface virtual int64_t CreateResource(const std::string& publicId, ResourceType type) ORTHANC_OVERRIDE { @@ -968,6 +970,7 @@ } + // From the "ISetResourcesContent" interface virtual void SetIdentifierTag(int64_t id, const DicomTag& tag, const std::string& value) ORTHANC_OVERRIDE @@ -1003,6 +1006,7 @@ } + // From the "ISetResourcesContent" interface virtual void SetMainDicomTag(int64_t id, const DicomTag& tag, const std::string& value) ORTHANC_OVERRIDE @@ -1034,6 +1038,7 @@ } + // From the "ICreateInstance" interface virtual void TagMostRecentPatient(int64_t patient) ORTHANC_OVERRIDE { {