diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index 900e69687..df5080e40 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -11,6 +11,7 @@ using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; using IRaCIS.Core.Infrastructure; +using IRaCIS.Core.Infrastructure.Extention; using MassTransit; using MassTransit.Initializers; using MathNet.Numerics; @@ -935,14 +936,19 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc //靶段标注上传,查看访视级别,上传绑定访视级别 if (inQuery.IsImageSegmentLabel == true) { + + var noneDicomSVList = await _noneDicomStudyReposiotry.Where(t => t.SubjectId == inQuery.SubjectId && t.Modality == "IVUS") + .Select(t => t.SubjectVisitId).Distinct().ToListAsync(); //存在ivus 和oct 这两种的项目 if (_readingQuestionCriterionTrialRepository.Where(t => t.TrialId == info.TrialId && (t.CriterionType == CriterionType.IVUS || t.CriterionType == CriterionType.OCT)).Distinct().Count() == 2 - && !_noneDicomStudyReposiotry.Any(t => t.SubjectId == inQuery.SubjectId && t.Modality == "IVUS")) + && noneDicomSVList.Count() != + _dicomStudyRepository.Where(t => t.SubjectId == inQuery.SubjectId).Select(t => t.SubjectVisitId).Distinct().Count()) { #region ivus 自动创建非dicom检查 var addList = await _dicomStudyRepository.Where(t => t.SubjectId == inQuery.SubjectId) + .Where(t => !noneDicomSVList.Contains(t.SubjectVisitId)) .Select(t => new NoneDicomStudyAddOrEdit() { TrialId = t.TrialId,