# HG changeset patch # User Sebastien Jodogne # Date 1581590040 -3600 # Node ID 6e5b3ae8825ce7e68ba508f0d835e7e596988a6c # Parent 4c1d2ff7ddd0870a7a4950d5b7be8a6b26abe1a7 handling of StorageCommitmentFailureReason_ClassInstanceConflict in the default SCP diff -r 4c1d2ff7ddd0 -r 6e5b3ae8825c OrthancServer/ServerJobs/StorageCommitmentScpJob.cpp --- a/OrthancServer/ServerJobs/StorageCommitmentScpJob.cpp Thu Feb 13 10:42:30 2020 +0100 +++ b/OrthancServer/ServerJobs/StorageCommitmentScpJob.cpp Thu Feb 13 11:34:00 2020 +0100 @@ -275,8 +275,7 @@ { throw OrthancException(ErrorCode_InternalError); } - - if (lookupHandler_.get() != NULL) + else if (lookupHandler_.get() != NULL) { return lookupHandler_->Lookup(sopClassUids_[index], sopInstanceUids_[index]); } @@ -285,6 +284,8 @@ // This is the default implementation of Orthanc (if no storage // commitment plugin is installed) bool success = false; + StorageCommitmentFailureReason reason = + StorageCommitmentFailureReason_NoSuchObjectInstance /* 0x0112 == 274 */; try { @@ -301,10 +302,18 @@ ServerContext::DicomCacheLocker locker(context_, orthancId[0]); if (locker.GetDicom().GetTagValue(a, DICOM_TAG_SOP_CLASS_UID) && locker.GetDicom().GetTagValue(b, DICOM_TAG_SOP_INSTANCE_UID) && - a == sopClassUids_[index] && b == sopInstanceUids_[index]) { - success = true; + if (a == sopClassUids_[index]) + { + success = true; + reason = StorageCommitmentFailureReason_Success; + } + else + { + // Mismatch in the SOP class UID + reason = StorageCommitmentFailureReason_ClassInstanceConflict /* 0x0119 */; + } } } } @@ -315,9 +324,7 @@ LOG(INFO) << " Storage commitment SCP job: " << (success ? "Success" : "Failure") << " while looking for " << sopClassUids_[index] << " / " << sopInstanceUids_[index]; - return (success ? - StorageCommitmentFailureReason_Success : - StorageCommitmentFailureReason_NoSuchObjectInstance /* 0x0112 == 274 */); + return reason; } }