private static void ValidateInstanceIdentifiersAreNotDuplicate()

in src/Microsoft.Health.Dicom.Core/Messages/Retrieve/RetrieveRequestValidator.cs [47:69]


        private static void ValidateInstanceIdentifiersAreNotDuplicate(ResourceType resourceType, string studyInstanceUid, string seriesInstanceUid = null, string sopInstanceUid = null)
        {
            switch (resourceType)
            {
                case ResourceType.Series:
                    if (studyInstanceUid == seriesInstanceUid)
                    {
                        throw new BadRequestException(DicomCoreResource.DuplicatedUidsNotAllowed);
                    }

                    break;
                case ResourceType.Frames:
                case ResourceType.Instance:
                    if ((studyInstanceUid == seriesInstanceUid) ||
                        (studyInstanceUid == sopInstanceUid) ||
                        (seriesInstanceUid == sopInstanceUid))
                    {
                        throw new BadRequestException(DicomCoreResource.DuplicatedUidsNotAllowed);
                    }

                    break;
            }
        }