diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs index e5ea8f0ed..f76b9f9d0 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs @@ -175,6 +175,11 @@ namespace IRaCIS.Core.Application.ViewModel /// public OrganType? OrganType { get; set; } + /// + /// 病灶类型 + /// + public LesionType? LesionType { get; set; } + public bool? IsEnable { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs b/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs index 47187a60f..2f2907a16 100644 --- a/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs +++ b/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs @@ -213,8 +213,20 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task> GetTrialOrganList(GetTrialOrganListInDto inDto) { + + List organs = new List(); + + if (inDto.LesionType != null) + { + var criterion = await _readingQuestionCriterionTrial.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync(); + organs = await _criterionNidusRepository.Where(x => x.CriterionId == (criterion==null?default(Guid): criterion.Id) && x.LesionType == inDto.LesionType) + .Select(x => x.OrganType).ToListAsync(); + } + var organInfoQueryable = from data in _organInfoRepository.WhereIf(inDto.OrganType != null, x => x.OrganType == inDto.OrganType) join trialData in _organTrialInfoRepository.WhereIf(inDto.IsEnable != null, x => x.IsEnable == inDto.IsEnable) + .WhereIf(inDto.LesionType != null, x => organs.Contains(x.OrganType)) + .WhereIf(inDto.IsEnable != null, x => x.IsEnable == inDto.IsEnable) .Where(x => x.TrialId == inDto.TrialId) on data.Id equals trialData.OrganInfoId select new GetTrialOrganListOutDto()