# HG changeset patch # User Sebastien Jodogne # Date 1567004040 -7200 # Node ID 69e49fc044f8543a09df0cf7897aa74d36fec7ec # Parent d2b9981017c4eb7168ae3d26161ebb39ab7632f3 Fix generation of "SOP Instance UID" on split and merge diff -r d2b9981017c4 -r 69e49fc044f8 NEWS --- a/NEWS Wed Aug 28 15:19:04 2019 +0200 +++ b/NEWS Wed Aug 28 16:54:00 2019 +0200 @@ -7,6 +7,7 @@ * Security: If remote access is enabled, HTTP authentication is also enabled by default * Log an explicit error if uploading an empty DICOM file using REST API * Fix compatibility of LSB binaries with Ubuntu >= 18.04 +* Fix generation of "SOP Instance UID" on split and merge Version 1.5.7 (2019-06-25) diff -r d2b9981017c4 -r 69e49fc044f8 OrthancServer/ServerJobs/MergeStudyJob.cpp --- a/OrthancServer/ServerJobs/MergeStudyJob.cpp Wed Aug 28 15:19:04 2019 +0200 +++ b/OrthancServer/ServerJobs/MergeStudyJob.cpp Wed Aug 28 16:54:00 2019 +0200 @@ -137,6 +137,9 @@ modified->ReplacePlainString(DICOM_TAG_SERIES_INSTANCE_UID, targetSeriesUid->second); + // Fix since Orthanc 1.5.8: Assign new "SOPInstanceUID", as the instance has been modified + modified->ReplacePlainString(DICOM_TAG_SOP_INSTANCE_UID, FromDcmtkBridge::GenerateUniqueIdentifier(ResourceType_Instance)); + DicomInstanceToStore toStore; toStore.SetOrigin(origin_); toStore.SetParsedDicomFile(*modified); diff -r d2b9981017c4 -r 69e49fc044f8 OrthancServer/ServerJobs/SplitStudyJob.cpp --- a/OrthancServer/ServerJobs/SplitStudyJob.cpp Wed Aug 28 15:19:04 2019 +0200 +++ b/OrthancServer/ServerJobs/SplitStudyJob.cpp Wed Aug 28 16:54:00 2019 +0200 @@ -125,6 +125,9 @@ modified->ReplacePlainString(DICOM_TAG_STUDY_INSTANCE_UID, targetStudyUid_); modified->ReplacePlainString(DICOM_TAG_SERIES_INSTANCE_UID, targetSeriesUid->second); + // Fix since Orthanc 1.5.8: Assign new "SOPInstanceUID", as the instance has been modified + modified->ReplacePlainString(DICOM_TAG_SOP_INSTANCE_UID, FromDcmtkBridge::GenerateUniqueIdentifier(ResourceType_Instance)); + if (targetStudy_.empty()) { targetStudy_ = modified->GetHasher().HashStudy(); diff -r d2b9981017c4 -r 69e49fc044f8 Plugins/Engine/OrthancPlugins.cpp --- a/Plugins/Engine/OrthancPlugins.cpp Wed Aug 28 15:19:04 2019 +0200 +++ b/Plugins/Engine/OrthancPlugins.cpp Wed Aug 28 16:54:00 2019 +0200 @@ -2113,6 +2113,12 @@ } else { + if (result.size() > 1) + { + LOG(WARNING) << "LookupResource(): Multiple resources match the query (instead of 0 or 1), which indicates " + << "your DICOM database breaks the DICOM model of the real world"; + } + throw OrthancException(ErrorCode_UnknownResource); } }