Mercurial > hg > orthanc
changeset 5342:65d55cc86a41
clarified error message
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 28 Jun 2023 11:54:41 +0200 |
parents | 990cfa101803 |
children | cba09fd1e234 566e8d32bd3a |
files | OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
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()); } } }