Mercurial > hg > orthanc
changeset 5999:384f46a99abf attach-custom-data
cleanup
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Mon, 10 Feb 2025 16:21:26 +0100 |
parents | 984f46eb8e04 |
children | 91394d783aef |
files | OrthancFramework/Resources/CMake/OrthancFrameworkParameters.cmake OrthancFramework/Sources/FileStorage/StorageAccessor.cpp OrthancFramework/Sources/FileStorage/StorageAccessor.h OrthancServer/CMakeLists.txt OrthancServer/Plugins/Engine/OrthancPlugins.cpp OrthancServer/Plugins/Include/orthanc/OrthancCDatabasePlugin.h OrthancServer/Sources/Database/DowngradeFrom7to6.sql OrthancServer/Sources/ServerEnumerations.h |
diffstat | 8 files changed, 5 insertions(+), 435 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancFramework/Resources/CMake/OrthancFrameworkParameters.cmake Fri Jan 31 16:30:50 2025 +0100 +++ b/OrthancFramework/Resources/CMake/OrthancFrameworkParameters.cmake Mon Feb 10 16:21:26 2025 +0100 @@ -33,7 +33,7 @@ # * Orthanc 0.4.0 -> Orthanc 0.7.2 = version 3 # * Orthanc 0.7.3 -> Orthanc 0.8.4 = version 4 # * Orthanc 0.8.5 -> Orthanc 0.9.4 = version 5 -# * Orthanc 0.9.5 -> Orthanc 1.11.X = version 6 +# * Orthanc 0.9.5 -> mainline = version 6 set(ORTHANC_DATABASE_VERSION 6) # Version of the Orthanc API, can be retrieved from "/system" URI in
--- a/OrthancFramework/Sources/FileStorage/StorageAccessor.cpp Fri Jan 31 16:30:50 2025 +0100 +++ b/OrthancFramework/Sources/FileStorage/StorageAccessor.cpp Mon Feb 10 16:21:26 2025 +0100 @@ -861,20 +861,4 @@ } #endif - // bool StorageAccessor::HandlesCustomData() - // { - // return area_.HandlesCustomData(); - // } - - // void StorageAccessor::GetCustomData(std::string& customData, - // const std::string& uuid, - // const DicomInstanceToStore* instance, - // const void* content, - // size_t size, - // FileContentType type, - // bool compression) - // { - // area_.GetCustomData(customData, uuid, instance, content, size, type, compression); - // } - }
--- a/OrthancFramework/Sources/FileStorage/StorageAccessor.h Fri Jan 31 16:30:50 2025 +0100 +++ b/OrthancFramework/Sources/FileStorage/StorageAccessor.h Mon Feb 10 16:21:26 2025 +0100 @@ -133,21 +133,6 @@ StorageCache& cache, MetricsRegistry& metrics); - // FileInfo Write(const void* data, - // size_t size, - // FileContentType type, - // CompressionType compression, - // bool storeMd5, - // const std::string& uuid, - // const std::string& customData); - - // FileInfo Write(const std::string& data, - // FileContentType type, - // CompressionType compression, - // bool storeMd5, - // const std::string& uuid, - // const std::string& customData); - FileInfo WriteInstance(std::string& customData, const DicomInstanceToStore& instance, const void* data, @@ -167,14 +152,6 @@ bool storeMd5, const std::string& uuid); - // FileInfo Write(std::string& customData, - // const std::string& data, - // FileContentType type, - // CompressionType compression, - // bool storeMd5, - // const std::string& uuid, - // const std::string& customData); - void Read(std::string& content, const FileInfo& info); @@ -216,14 +193,6 @@ bool HandlesCustomData(); - // void GetCustomData(std::string& customData, - // const std::string& uuid, - // const DicomInstanceToStore* instance, - // const void* content, - // size_t size, - // FileContentType type, - // bool compression); - private: void ReadStartRangeInternal(std::string& target, const FileInfo& info,
--- a/OrthancServer/CMakeLists.txt Fri Jan 31 16:30:50 2025 +0100 +++ b/OrthancServer/CMakeLists.txt Mon Feb 10 16:21:26 2025 +0100 @@ -497,7 +497,7 @@ if (ENABLE_PLUGINS AND (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS OR BUILD_HOUSEKEEPER OR - BUILD_DELAYED_DELETION OR BUILD_MULTITENANT_DICOM OR BUILD_ADVANCED_STORAGE)) + BUILD_DELAYED_DELETION OR BUILD_MULTITENANT_DICOM)) set(PLUGINS_DEPENDENCIES_SOURCES ${BOOST_SOURCES} ${JSONCPP_SOURCES}
--- a/OrthancServer/Plugins/Engine/OrthancPlugins.cpp Fri Jan 31 16:30:50 2025 +0100 +++ b/OrthancServer/Plugins/Engine/OrthancPlugins.cpp Mon Feb 10 16:21:26 2025 +0100 @@ -929,7 +929,7 @@ }; - // New in Orthanc 1.12.0 + // New in Orthanc 1.12.7 class PluginStorageArea3 : public IStorageArea { private: @@ -1003,7 +1003,7 @@ remove2_ == NULL || readWhole2_ == NULL) { - throw OrthancException(ErrorCode_Plugin, "Storage area plugin doesn't implement all the required primitives (create, remove, readWhole"); + throw OrthancException(ErrorCode_Plugin, "Storage area plugin doesn't implement all the required primitives (createInstance, createAttachment, remove, readWhole"); } }
--- a/OrthancServer/Plugins/Include/orthanc/OrthancCDatabasePlugin.h Fri Jan 31 16:30:50 2025 +0100 +++ b/OrthancServer/Plugins/Include/orthanc/OrthancCDatabasePlugin.h Mon Feb 10 16:21:26 2025 +0100 @@ -63,7 +63,6 @@ _OrthancPluginDatabaseAnswerType_DeletedAttachment = 1, _OrthancPluginDatabaseAnswerType_DeletedResource = 2, _OrthancPluginDatabaseAnswerType_RemainingAncestor = 3, - _OrthancPluginDatabaseAnswerType_DeletedAttachment2 = 4, /* Return value */ _OrthancPluginDatabaseAnswerType_Attachment = 10, @@ -76,7 +75,6 @@ _OrthancPluginDatabaseAnswerType_String = 17, _OrthancPluginDatabaseAnswerType_MatchingResource = 18, /* New in Orthanc 1.5.2 */ _OrthancPluginDatabaseAnswerType_Metadata = 19, /* New in Orthanc 1.5.4 */ - _OrthancPluginDatabaseAnswerType_Attachment2 = 20, /* New in Orthanc 1.12.0 */ _OrthancPluginDatabaseAnswerType_INTERNAL = 0x7fffffff } _OrthancPluginDatabaseAnswerType; @@ -1364,342 +1362,6 @@ return context->InvokeService(context, _OrthancPluginService_RegisterDatabaseBackendV3, ¶ms); } - - // typedef struct - // { - // OrthancPluginDatabaseEventType type; - - // union - // { - // struct - // { - // /* For ""DeletedResource" and "RemainingAncestor" */ - // OrthancPluginResourceType level; - // const char* publicId; - // } resource; - - // /* For "DeletedAttachment" */ - // OrthancPluginAttachment2 attachment; - - // } content; - - // } OrthancPluginDatabaseEvent2; - - - // typedef struct - // { - // /** - // * Functions to read the answers inside a transaction - // **/ - - // OrthancPluginErrorCode (*readAnswersCount) (OrthancPluginDatabaseTransaction* transaction, - // uint32_t* target /* out */); - - // OrthancPluginErrorCode (*readAnswerAttachment2) (OrthancPluginDatabaseTransaction* transaction, - // OrthancPluginAttachment2* target /* out */, // new in v4 - // uint32_t index); - - // OrthancPluginErrorCode (*readAnswerChange) (OrthancPluginDatabaseTransaction* transaction, - // OrthancPluginChange* target /* out */, - // uint32_t index); - - // OrthancPluginErrorCode (*readAnswerDicomTag) (OrthancPluginDatabaseTransaction* transaction, - // uint16_t* group, - // uint16_t* element, - // const char** value, - // uint32_t index); - - // OrthancPluginErrorCode (*readAnswerExportedResource) (OrthancPluginDatabaseTransaction* transaction, - // OrthancPluginExportedResource* target /* out */, - // uint32_t index); - - // OrthancPluginErrorCode (*readAnswerInt32) (OrthancPluginDatabaseTransaction* transaction, - // int32_t* target /* out */, - // uint32_t index); - - // OrthancPluginErrorCode (*readAnswerInt64) (OrthancPluginDatabaseTransaction* transaction, - // int64_t* target /* out */, - // uint32_t index); - - // OrthancPluginErrorCode (*readAnswerMatchingResource) (OrthancPluginDatabaseTransaction* transaction, - // OrthancPluginMatchingResource* target /* out */, - // uint32_t index); - - // OrthancPluginErrorCode (*readAnswerMetadata) (OrthancPluginDatabaseTransaction* transaction, - // int32_t* metadata /* out */, - // const char** value /* out */, - // uint32_t index); - - // OrthancPluginErrorCode (*readAnswerString) (OrthancPluginDatabaseTransaction* transaction, - // const char** target /* out */, - // uint32_t index); - - // OrthancPluginErrorCode (*readEventsCount) (OrthancPluginDatabaseTransaction* transaction, - // uint32_t* target /* out */); - - // OrthancPluginErrorCode (*readEvent2) (OrthancPluginDatabaseTransaction* transaction, - // OrthancPluginDatabaseEvent2* event /* out */, // new in v4 - // uint32_t index); - - - - // /** - // * Functions to access the global database object - // * (cf. "IDatabaseWrapper" class in Orthanc) - // **/ - - // OrthancPluginErrorCode (*open) (void* database); - - // OrthancPluginErrorCode (*close) (void* database); - - // OrthancPluginErrorCode (*destructDatabase) (void* database); - - // OrthancPluginErrorCode (*getDatabaseVersion) (void* database, - // uint32_t* target /* out */); - - // OrthancPluginErrorCode (*hasRevisionsSupport) (void* database, - // uint8_t* target /* out */); - - // OrthancPluginErrorCode (*hasAttachmentCustomDataSupport) (void* database, // new in v4 - // uint8_t* target /* out */); - - // OrthancPluginErrorCode (*upgradeDatabase) (void* database, - // OrthancPluginStorageArea* storageArea, - // uint32_t targetVersion); - - // OrthancPluginErrorCode (*startTransaction) (void* database, - // OrthancPluginDatabaseTransaction** target /* out */, - // OrthancPluginDatabaseTransactionType type); - - // OrthancPluginErrorCode (*destructTransaction) (OrthancPluginDatabaseTransaction* transaction); - - - // /** - // * Functions to run operations within a database transaction - // * (cf. "IDatabaseWrapper::ITransaction" class in Orthanc) - // **/ - - // OrthancPluginErrorCode (*rollback) (OrthancPluginDatabaseTransaction* transaction); - - // OrthancPluginErrorCode (*commit) (OrthancPluginDatabaseTransaction* transaction, - // int64_t fileSizeDelta); - - // /* A call to "addAttachment()" guarantees that this attachment is not already existing ("INSERT") */ - // OrthancPluginErrorCode (*addAttachment2) (OrthancPluginDatabaseTransaction* transaction, - // int64_t id, - // const OrthancPluginAttachment2* attachment, // new in v4 - // int64_t revision); - - // OrthancPluginErrorCode (*clearChanges) (OrthancPluginDatabaseTransaction* transaction); - - // OrthancPluginErrorCode (*clearExportedResources) (OrthancPluginDatabaseTransaction* transaction); - - // OrthancPluginErrorCode (*clearMainDicomTags) (OrthancPluginDatabaseTransaction* transaction, - // int64_t resourceId); - - // OrthancPluginErrorCode (*createInstance) (OrthancPluginDatabaseTransaction* transaction, - // OrthancPluginCreateInstanceResult* target /* out */, - // const char* hashPatient, - // const char* hashStudy, - // const char* hashSeries, - // const char* hashInstance); - - // OrthancPluginErrorCode (*deleteAttachment) (OrthancPluginDatabaseTransaction* transaction, - // int64_t id, - // int32_t contentType); - - // OrthancPluginErrorCode (*deleteMetadata) (OrthancPluginDatabaseTransaction* transaction, - // int64_t id, - // int32_t metadataType); - - // OrthancPluginErrorCode (*deleteResource) (OrthancPluginDatabaseTransaction* transaction, - // int64_t id); - - // /* Answers are read using "readAnswerMetadata()" */ - // OrthancPluginErrorCode (*getAllMetadata) (OrthancPluginDatabaseTransaction* transaction, - // int64_t id); - - // /* Answers are read using "readAnswerString()" */ - // OrthancPluginErrorCode (*getAllPublicIds) (OrthancPluginDatabaseTransaction* transaction, - // OrthancPluginResourceType resourceType); - - // /* Answers are read using "readAnswerString()" */ - // OrthancPluginErrorCode (*getAllPublicIdsWithLimit) (OrthancPluginDatabaseTransaction* transaction, - // OrthancPluginResourceType resourceType, - // uint64_t since, - // uint64_t limit); - - // /* Answers are read using "readAnswerChange()" */ - // OrthancPluginErrorCode (*getChanges) (OrthancPluginDatabaseTransaction* transaction, - // uint8_t* targetDone /* out */, - // int64_t since, - // uint32_t maxResults); - - // /* Answers are read using "readAnswerInt64()" */ - // OrthancPluginErrorCode (*getChildrenInternalId) (OrthancPluginDatabaseTransaction* transaction, - // int64_t id); - - // /* Answers are read using "readAnswerString()" */ - // OrthancPluginErrorCode (*getChildrenMetadata) (OrthancPluginDatabaseTransaction* transaction, - // int64_t resourceId, - // int32_t metadata); - - // /* Answers are read using "readAnswerString()" */ - // OrthancPluginErrorCode (*getChildrenPublicId) (OrthancPluginDatabaseTransaction* transaction, - // int64_t id); - - // /* Answers are read using "readAnswerExportedResource()" */ - // OrthancPluginErrorCode (*getExportedResources) (OrthancPluginDatabaseTransaction* transaction, - // uint8_t* targetDone /* out */, - // int64_t since, - // uint32_t maxResults); - - // /* Answer is read using "readAnswerChange()" */ - // OrthancPluginErrorCode (*getLastChange) (OrthancPluginDatabaseTransaction* transaction); - - // OrthancPluginErrorCode (*getLastChangeIndex) (OrthancPluginDatabaseTransaction* transaction, - // int64_t* target /* out */); - - // /* Answer is read using "readAnswerExportedResource()" */ - // OrthancPluginErrorCode (*getLastExportedResource) (OrthancPluginDatabaseTransaction* transaction); - - // /* Answers are read using "readAnswerDicomTag()" */ - // OrthancPluginErrorCode (*getMainDicomTags) (OrthancPluginDatabaseTransaction* transaction, - // int64_t id); - - // /* Answer is read using "readAnswerString()" */ - // OrthancPluginErrorCode (*getPublicId) (OrthancPluginDatabaseTransaction* transaction, - // int64_t internalId); - - // OrthancPluginErrorCode (*getResourcesCount) (OrthancPluginDatabaseTransaction* transaction, - // uint64_t* target /* out */, - // OrthancPluginResourceType resourceType); - - // OrthancPluginErrorCode (*getResourceType) (OrthancPluginDatabaseTransaction* transaction, - // OrthancPluginResourceType* target /* out */, - // uint64_t resourceId); - - // OrthancPluginErrorCode (*getTotalCompressedSize) (OrthancPluginDatabaseTransaction* transaction, - // uint64_t* target /* out */); - - // OrthancPluginErrorCode (*getTotalUncompressedSize) (OrthancPluginDatabaseTransaction* transaction, - // uint64_t* target /* out */); - - // OrthancPluginErrorCode (*isDiskSizeAbove) (OrthancPluginDatabaseTransaction* transaction, - // uint8_t* target /* out */, - // uint64_t threshold); - - // OrthancPluginErrorCode (*isExistingResource) (OrthancPluginDatabaseTransaction* transaction, - // uint8_t* target /* out */, - // int64_t resourceId); - - // OrthancPluginErrorCode (*isProtectedPatient) (OrthancPluginDatabaseTransaction* transaction, - // uint8_t* target /* out */, - // int64_t resourceId); - - // /* Answers are read using "readAnswerInt32()" */ - // OrthancPluginErrorCode (*listAvailableAttachments) (OrthancPluginDatabaseTransaction* transaction, - // int64_t internalId); - - // OrthancPluginErrorCode (*logChange) (OrthancPluginDatabaseTransaction* transaction, - // int32_t changeType, - // int64_t resourceId, - // OrthancPluginResourceType resourceType, - // const char* date); - - // OrthancPluginErrorCode (*logExportedResource) (OrthancPluginDatabaseTransaction* transaction, - // OrthancPluginResourceType resourceType, - // const char* publicId, - // const char* modality, - // const char* date, - // const char* patientId, - // const char* studyInstanceUid, - // const char* seriesInstanceUid, - // const char* sopInstanceUid); - - // /* Answer is read using "readAnswerAttachment()" */ - // OrthancPluginErrorCode (*lookupAttachment) (OrthancPluginDatabaseTransaction* transaction, - // int64_t* revision /* out */, - // int64_t resourceId, - // int32_t contentType); - - // /* Answer is read using "readAnswerString()" */ - // OrthancPluginErrorCode (*lookupGlobalProperty) (OrthancPluginDatabaseTransaction* transaction, - // const char* serverIdentifier, - // int32_t property); - - // /* Answer is read using "readAnswerString()" */ - // OrthancPluginErrorCode (*lookupMetadata) (OrthancPluginDatabaseTransaction* transaction, - // int64_t* revision /* out */, - // int64_t id, - // int32_t metadata); - - // OrthancPluginErrorCode (*lookupParent) (OrthancPluginDatabaseTransaction* transaction, - // uint8_t* isExisting /* out */, - // int64_t* parentId /* out */, - // int64_t id); - - // OrthancPluginErrorCode (*lookupResource) (OrthancPluginDatabaseTransaction* transaction, - // uint8_t* isExisting /* out */, - // int64_t* id /* out */, - // OrthancPluginResourceType* type /* out */, - // const char* publicId); - - // /* Answers are read using "readAnswerMatchingResource()" */ - // OrthancPluginErrorCode (*lookupResources) (OrthancPluginDatabaseTransaction* transaction, - // uint32_t constraintsCount, - // const OrthancPluginDatabaseConstraint* constraints, - // OrthancPluginResourceType queryLevel, - // uint32_t limit, - // uint8_t requestSomeInstanceId); - - // /* The public ID of the parent resource is read using "readAnswerString()" */ - // OrthancPluginErrorCode (*lookupResourceAndParent) (OrthancPluginDatabaseTransaction* transaction, - // uint8_t* isExisting /* out */, - // int64_t* id /* out */, - // OrthancPluginResourceType* type /* out */, - // const char* publicId); - - // OrthancPluginErrorCode (*selectPatientToRecycle) (OrthancPluginDatabaseTransaction* transaction, - // uint8_t* patientAvailable /* out */, - // int64_t* patientId /* out */); - - // OrthancPluginErrorCode (*selectPatientToRecycle2) (OrthancPluginDatabaseTransaction* transaction, - // uint8_t* patientAvailable /* out */, - // int64_t* patientId /* out */, - // int64_t patientIdToAvoid); - - // OrthancPluginErrorCode (*setGlobalProperty) (OrthancPluginDatabaseTransaction* transaction, - // const char* serverIdentifier, - // int32_t property, - // const char* value); - - // /* In "setMetadata()", the metadata might already be existing ("INSERT OR REPLACE") */ - // OrthancPluginErrorCode (*setMetadata) (OrthancPluginDatabaseTransaction* transaction, - // int64_t id, - // int32_t metadata, - // const char* value, - // int64_t revision); - - // OrthancPluginErrorCode (*setProtectedPatient) (OrthancPluginDatabaseTransaction* transaction, - // int64_t id, - // uint8_t isProtected); - - // OrthancPluginErrorCode (*setResourcesContent) (OrthancPluginDatabaseTransaction* transaction, - // uint32_t countIdentifierTags, - // const OrthancPluginResourcesContentTags* identifierTags, - // uint32_t countMainDicomTags, - // const OrthancPluginResourcesContentTags* mainDicomTags, - // uint32_t countMetadata, - // const OrthancPluginResourcesContentMetadata* metadata); - - - // } OrthancPluginDatabaseBackendV4; - -/*<! @endcond */ - - - #ifdef __cplusplus } #endif
--- a/OrthancServer/Sources/Database/DowngradeFrom7to6.sql Fri Jan 31 16:30:50 2025 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ --- Orthanc - A Lightweight, RESTful DICOM Store --- Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics --- Department, University Hospital of Liege, Belgium --- Copyright (C) 2017-2022 Osimis S.A., Belgium --- Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium --- --- This program is free software: you can redistribute it and/or --- modify it under the terms of the GNU General Public License as --- published by the Free Software Foundation, either version 3 of the --- License, or (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, but --- WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see <http://www.gnu.org/licenses/>. - - --- --- This SQLite script updates the version of the Orthanc database from 6 to 7. --- - --- Add a new column to AttachedFiles - -ALTER TABLE AttachedFiles DROP COLUMN metadata; - --- update the triggers (back to v6) -DROP TRIGGER AttachedFileDeleted - -CREATE TRIGGER AttachedFileDeleted -AFTER DELETE ON AttachedFiles -BEGIN - SELECT SignalFileDeleted(old.uuid, old.fileType, old.uncompressedSize, - old.compressionType, old.compressedSize, - old.uncompressedMD5, old.compressedMD5); -END; - - --- Change the database version --- The "1" corresponds to the "GlobalProperty_DatabaseSchemaVersion" enumeration - -UPDATE GlobalProperties SET value="6" WHERE property=1; -
--- a/OrthancServer/Sources/ServerEnumerations.h Fri Jan 31 16:30:50 2025 +0100 +++ b/OrthancServer/Sources/ServerEnumerations.h Mon Feb 10 16:21:26 2025 +0100 @@ -171,7 +171,7 @@ GlobalProperty_AnonymizationSequence = 3, GlobalProperty_JobsRegistry = 5, GlobalProperty_GetTotalSizeIsFast = 6, // New in Orthanc 1.5.2 - GlobalProperty_SQLiteHasCustomDataAndRevision = 7, // New in Orthanc 1.12.0 + GlobalProperty_SQLiteHasCustomDataAndRevision = 7, // New in Orthanc 1.12.7 GlobalProperty_Modalities = 20, // New in Orthanc 1.5.0 GlobalProperty_Peers = 21, // New in Orthanc 1.5.0