# HG changeset patch # User Alain Mazy # Date 1687946081 -7200 # Node ID 65d55cc86a41581c5aaed58a89d1dfb6a8c2f1a0 # Parent 990cfa1018031bc8610417b59306ba7dd4b600f7 clarified error message diff -r 990cfa101803 -r 65d55cc86a41 OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp --- a/OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp Wed Jun 28 11:11:47 2023 +0200 +++ b/OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp Wed Jun 28 11:54:41 2023 +0200 @@ -762,11 +762,15 @@ (!modification_->IsReplaced(*mainPatientTag) || modification_->GetReplacementAsString(*mainPatientTag) != targetPatientTags.GetStringValue(*mainPatientTag, "", false))) { - throw OrthancException(ErrorCode_BadRequest, std::string("Trying to change patient tags in a study. The Patient already exists and has other studies. All the 'Replace' tags should match the existing patient main dicom tags. Try using /patients/../modify instead to modify the patient. Failing tag: ") + mainPatientTag->Format()); + throw OrthancException(ErrorCode_BadRequest, std::string("Trying to change patient tags in a study. " + "The Patient already exists and has other studies. All the 'Replace' tags should match the existing patient main dicom tags " + "and you should specify all Patient MainDicomTags in your query. Try using /patients/../modify instead to modify the patient. Failing tag: ") + mainPatientTag->Format()); } else if (!targetPatientTags.HasTag(*mainPatientTag) && modification_->IsReplaced(*mainPatientTag) ) { - throw OrthancException(ErrorCode_BadRequest, std::string("Trying to change patient tags in a study. The Patient already exists and has other studies. You are trying to replace a tag that is not defined yet in this patient. Try using /patients/../modify instead to modify the patient. Failing tag: ") + mainPatientTag->Format()); + throw OrthancException(ErrorCode_BadRequest, std::string("Trying to change patient tags in a study. " + "The Patient already exists and has other studies. You are trying to replace a tag that is not defined yet in this patient. " + "Try using /patients/../modify instead to modify the patient. Failing tag: ") + mainPatientTag->Format()); } } }