Mercurial > hg > orthanc
diff OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp @ 5342:65d55cc86a41
clarified error message
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 28 Jun 2023 11:54:41 +0200 |
parents | 0854cc13b4d5 |
children | f41e1f635c4d |
line wrap: on
line diff
--- 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()); } } }