Uat_Study
he 2022-08-26 17:48:50 +08:00
parent 2229521640
commit 86546558bd
2 changed files with 17 additions and 0 deletions

View File

@ -175,6 +175,11 @@ namespace IRaCIS.Core.Application.ViewModel
/// </summary> /// </summary>
public OrganType? OrganType { get; set; } public OrganType? OrganType { get; set; }
/// <summary>
/// 病灶类型
/// </summary>
public LesionType? LesionType { get; set; }
public bool? IsEnable { get; set; } public bool? IsEnable { get; set; }
} }

View File

@ -213,8 +213,20 @@ namespace IRaCIS.Core.Application.Service
[HttpPost] [HttpPost]
public async Task<List<GetTrialOrganListOutDto>> GetTrialOrganList(GetTrialOrganListInDto inDto) public async Task<List<GetTrialOrganListOutDto>> GetTrialOrganList(GetTrialOrganListInDto inDto)
{ {
List<OrganType> organs = new List<OrganType>();
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) 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) 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) .Where(x => x.TrialId == inDto.TrialId)
on data.Id equals trialData.OrganInfoId on data.Id equals trialData.OrganInfoId
select new GetTrialOrganListOutDto() select new GetTrialOrganListOutDto()