From 86546558bdc237f34f7bc354ee65c8c1aa562b85 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 26 Aug 2022 17:48:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Reading/Dto/OrganInfoViewModel.cs | 5 +++++ .../Service/Reading/OrganInfoService.cs | 12 ++++++++++++ 2 files changed, 17 insertions(+) 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()