private void ValidateDeleteResourcesRequest(DeleteResourcesRequest request) { UidValidator.Validate(request.StudyInstanceUid, nameof(request.StudyInstanceUid)); switch (request.ResourceType) { case ResourceType.Series: UidValidator.Validate(request.SeriesInstanceUid, nameof(request.SeriesInstanceUid)); break; case ResourceType.Instance: UidValidator.Validate(request.SeriesInstanceUid, nameof(request.SeriesInstanceUid)); UidValidator.Validate(request.SopInstanceUid, nameof(request.SopInstanceUid)); break; } }
private static void ValidateInstanceIdentifiersAreValid(ResourceType resourceType, string studyInstanceUid, string seriesInstanceUid, string sopInstanceUid) { UidValidator.Validate(studyInstanceUid, nameof(StudyInstanceUid)); switch (resourceType) { case ResourceType.Series: UidValidator.Validate(seriesInstanceUid, nameof(SeriesInstanceUid)); break; case ResourceType.Instance: case ResourceType.Frames: UidValidator.Validate(seriesInstanceUid, nameof(SeriesInstanceUid)); UidValidator.Validate(sopInstanceUid, nameof(SopInstanceUid)); break; } }
private static void ValidateRequestIdentifiers(QueryResourceRequest message) { switch (message.QueryResourceType) { case QueryResource.StudySeries: case QueryResource.StudyInstances: UidValidator.Validate(message.StudyInstanceUid, nameof(message.StudyInstanceUid)); break; case QueryResource.StudySeriesInstances: UidValidator.Validate(message.StudyInstanceUid, nameof(message.StudyInstanceUid)); UidValidator.Validate(message.SeriesInstanceUid, nameof(message.SeriesInstanceUid)); break; case QueryResource.AllStudies: case QueryResource.AllSeries: case QueryResource.AllInstances: break; default: Debug.Fail("A newly added query resource is not handled."); break; } }