diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs index 26693ce86..65660d199 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs @@ -31,8 +31,10 @@ namespace IRaCIS.Core.Application.ViewModel { public Guid? Id { get; set; } public Guid CriterionId { get; set; } - public string NidusType { get; set; } - public string NidusTypeCN { get; set; } + /// + /// 病灶类型 + /// + public LesionType LesionType { get; set; } public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } } @@ -65,12 +67,7 @@ namespace IRaCIS.Core.Application.ViewModel /// /// 病灶类型 /// - public string NidusType { get; set; } - - /// - /// 病灶类型 - /// - public string NidusTypeCN { get; set; } + public LesionType LesionType { get; set; } /// @@ -110,7 +107,10 @@ namespace IRaCIS.Core.Application.ViewModel { public Guid TrialId { get; set; } - public Guid? CriterionNidusId { get; set; } + /// + /// 病灶类型 + /// + public LesionType? LesionType { get; set; } public bool? IsEnable { get; set; } } @@ -127,19 +127,14 @@ namespace IRaCIS.Core.Application.ViewModel public string? TULOC { get; set; } public string? TULAT { get; set; } - public Guid? CriterionNidusId { get; set; } + public bool IsEnable { get; set; } /// /// 病灶类型 /// - public string NidusType { get; set; } - - /// - /// 病灶类型 - /// - public string NidusTypeCN { get; set; } + public LesionType LesionType { get; set; } /// /// 备注 @@ -150,8 +145,11 @@ namespace IRaCIS.Core.Application.ViewModel ///OrganInfoQuery 列表查询参数模型 public class OrganInfoQuery { - - public Guid? CriterionNidusId { get; set; } + + /// + /// 病灶类型 + /// + public LesionType? LesionType { get; set; } public Guid? CriterionId { get; set; } @@ -179,14 +177,14 @@ namespace IRaCIS.Core.Application.ViewModel public bool IsLymphNodes { get; set; } /// - /// 标准 病灶类型 + /// 病灶类型 /// - public Guid CriterionNidusId { get; set; } + public LesionType LesionType { get; set; } /// /// 标准 病灶类型 /// - public Guid CriterionId { get; set; } + public Guid SystemCriterionId { get; set; } public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs b/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs index ae9ec5b58..27b53fab8 100644 --- a/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs +++ b/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs @@ -92,8 +92,7 @@ namespace IRaCIS.Core.Application.Service { var organInfoQueryable = _organInfoRepository - .WhereIf(inQuery.CriterionNidusId != null, x => x.CriterionNidusId == inQuery.CriterionNidusId) - .WhereIf(inQuery.CriterionId != null, x => x.CriterionId == inQuery.CriterionId) + .WhereIf(inQuery.LesionType != null, x => x.LesionType == inQuery.LesionType) .ProjectTo(_mapper.ConfigurationProvider); return await organInfoQueryable.ToListAsync(); } @@ -170,13 +169,12 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task> GetTrialOrganList(GetTrialOrganListInDto inDto) { - var organInfoQueryable = from data in _organInfoRepository.WhereIf(inDto.CriterionNidusId !=null, x => x.CriterionNidusId == inDto.CriterionNidusId) + var organInfoQueryable = from data in _organInfoRepository.WhereIf(inDto.LesionType != null, x => x.LesionType == inDto.LesionType) join trialData in _organTrialInfoRepository.WhereIf(inDto.IsEnable != null, x => x.IsEnable == inDto.IsEnable) .Where(x => x.TrialId == inDto.TrialId) on data.Id equals trialData.OrganInfoId - join criterionNidus in _criterionNidusRepository.AsQueryable() on trialData.CriterionNidusId equals criterionNidus.Id into criterionNidustemp - from leftcriterionNidus in criterionNidustemp.DefaultIfEmpty() + select new GetTrialOrganListOutDto() @@ -186,49 +184,50 @@ namespace IRaCIS.Core.Application.Service TULAT = data.TULAT, TULOC = data.TULOC, Remark= data.Remark, - CriterionNidusId = data.CriterionNidusId, - IsEnable= trialData.IsEnable, - NidusType= leftcriterionNidus.NidusType, - NidusTypeCN= leftcriterionNidus.NidusTypeCN, - }; - - - return await organInfoQueryable.ToListAsync(); - } - - - - /// - /// 获取项目勾选器官信息 - /// - /// - /// - [HttpPost] - public async Task> GetTrialCheckOrganList(GetTrialOrganListInDto inDto) - { - var organInfoQueryable = from data in _organInfoRepository.WhereIf(inDto.CriterionNidusId != null, x => x.CriterionNidusId == inDto.CriterionNidusId) - join trialData in _organTrialInfoRepository.WhereIf(inDto.IsEnable != null, x => x.IsEnable == inDto.IsEnable) - .Where(x => x.TrialId == inDto.TrialId) - on data.Id equals trialData.OrganInfoId into jtemp - from leftjoin in jtemp.DefaultIfEmpty() - select new GetTrialCheckOrganList() - { - Id = data.Id, - Part = data.Part, - TULAT = data.TULAT, - TULOC = data.TULOC, - IsCheckd= leftjoin!=null, - Remark = data.Remark, - CriterionNidusId = data.CriterionNidusId, - IsEnable = leftjoin.IsEnable, - + IsEnable= trialData.IsEnable, + LesionType= trialData.LesionType, }; return await organInfoQueryable.ToListAsync(); } + + #region 注释 + ///// + ///// 获取项目勾选器官信息 + ///// + ///// + ///// + //[HttpPost] + //public async Task> GetTrialCheckOrganList(GetTrialOrganListInDto inDto) + //{ + // var organInfoQueryable = from data in _organInfoRepository.WhereIf(inDto.CriterionNidusId != null, x => x.CriterionNidusId == inDto.CriterionNidusId) + // join trialData in _organTrialInfoRepository.WhereIf(inDto.IsEnable != null, x => x.IsEnable == inDto.IsEnable) + // .Where(x => x.TrialId == inDto.TrialId) + // on data.Id equals trialData.OrganInfoId into jtemp + // from leftjoin in jtemp.DefaultIfEmpty() + // select new GetTrialCheckOrganList() + // { + // Id = data.Id, + // Part = data.Part, + // TULAT = data.TULAT, + // TULOC = data.TULOC, + + // IsCheckd= leftjoin!=null, + // Remark = data.Remark, + // CriterionNidusId = data.CriterionNidusId, + // IsEnable = leftjoin.IsEnable, + + // }; + + + // return await organInfoQueryable.ToListAsync(); + //} + #endregion + + /// /// 同步系统器官到项目 /// @@ -254,8 +253,7 @@ namespace IRaCIS.Core.Application.Service { Id = x.Id, CriterionId = trialCriterionId, - NidusType = x.NidusType, - NidusTypeCN = x.NidusTypeCN, + LesionType = x.LesionType, OriginalId = x.Id, }).ToListAsync(); @@ -264,9 +262,9 @@ namespace IRaCIS.Core.Application.Service await _criterionNidusRepository.AddRangeAsync(criterionNidusList); await _organTrialInfoRepository.BatchDeleteNoTrackingAsync(x => x.TrialId == inDto.TrialId); var originalIds = criterionNidusList.Select(x => x.OriginalId).Distinct().ToList(); - List organTrialInfoList = await _organInfoRepository.Where(x =>x.CriterionId== inDto.SystemCriterionId).Select(x => new OrganTrialInfo() + List organTrialInfoList = await _organInfoRepository.Where(x =>x.SystemCriterionId== inDto.SystemCriterionId).Select(x => new OrganTrialInfo() { - CriterionNidusId = x.CriterionNidusId, + LesionType=x.LesionType, Id = x.Id, IsEnable = true, OrganInfoId = x.Id, @@ -276,11 +274,7 @@ namespace IRaCIS.Core.Application.Service criterionNidusList.ForEach(x => x.Id = NewId.NextGuid()); - organTrialInfoList.ForEach(x => - { - - x.CriterionNidusId = criterionNidusList.Where(y => y.OriginalId == x.OrganInfoId).Select(x => x.Id).FirstOrDefault(); - }); + await _organTrialInfoRepository.AddRangeAsync(organTrialInfoList); diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index b689a7f76..3c3372405 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -132,9 +132,7 @@ namespace IRaCIS.Core.Application.Service CreateMap().ReverseMap(); CreateMap(); - CreateMap() - .ForMember(d => d.NidusType, u => u.MapFrom(s => s.CriterionNidus.NidusType)) - .ForMember(d => d.NidusTypeCN, u => u.MapFrom(s => s.CriterionNidus.NidusTypeCN)); + CreateMap(); #endregion } } diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 43c70267b..47742ced1 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -155,7 +155,7 @@ namespace IRaCIS.Core.Domain.Share Hydrothorax = 2, } - public enum OrganType + public enum LesionType { /// /// 非靶和新病灶 diff --git a/IRaCIS.Core.Domain/Reading/CriterionLesion.cs b/IRaCIS.Core.Domain/Reading/CriterionLesion.cs index 3555c70af..edd164f50 100644 --- a/IRaCIS.Core.Domain/Reading/CriterionLesion.cs +++ b/IRaCIS.Core.Domain/Reading/CriterionLesion.cs @@ -24,17 +24,12 @@ namespace IRaCIS.Core.Domain.Models /// /// 病灶类型 /// - public string NidusType { get; set; } - - /// - /// 病灶类型 - /// - public string NidusTypeCN { get; set; } - - /// - /// CreateTime - /// - public DateTime CreateTime { get; set; } + public LesionType LesionType { get; set; } + + /// + /// CreateTime + /// + public DateTime CreateTime { get; set; } /// /// CreateUserId diff --git a/IRaCIS.Core.Domain/Reading/OrganInfo.cs b/IRaCIS.Core.Domain/Reading/OrganInfo.cs index 12ae232a3..f75daa716 100644 --- a/IRaCIS.Core.Domain/Reading/OrganInfo.cs +++ b/IRaCIS.Core.Domain/Reading/OrganInfo.cs @@ -44,15 +44,14 @@ namespace IRaCIS.Core.Domain.Models public bool IsLymphNodes { get; set; } /// - /// 标准 病灶类型 + /// 病灶类型 /// - public Guid? CriterionNidusId { get; set; } - + public LesionType LesionType { get; set; } /// /// 标准Id /// - public Guid CriterionId { get; set; } + public Guid SystemCriterionId { get; set; } /// /// 创建时间 @@ -64,8 +63,6 @@ namespace IRaCIS.Core.Domain.Models /// public Guid CreateUserId { get; set; } - [ForeignKey("CriterionNidusId")] - public CriterionNidus CriterionNidus { get; set; } } diff --git a/IRaCIS.Core.Domain/Reading/OrganTrialInfo.cs b/IRaCIS.Core.Domain/Reading/OrganTrialInfo.cs index f99cabc65..5bdae8412 100644 --- a/IRaCIS.Core.Domain/Reading/OrganTrialInfo.cs +++ b/IRaCIS.Core.Domain/Reading/OrganTrialInfo.cs @@ -40,9 +40,9 @@ namespace IRaCIS.Core.Domain.Models /// - /// 标准 病灶类型 + /// 病灶类型 /// - public Guid? CriterionNidusId { get; set; } + public LesionType LesionType { get; set; } }