diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 8bc5aa0b1..626acf394 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -467,6 +467,31 @@ 排序字段 + + + 项目中心Code + + + + + 受试者Code + + + + + 模块类型 + + + + + 状态 + + + + + 任务名称 + + 阅片配置的类型 @@ -627,6 +652,11 @@ 中心Id + + + 项目中心Id + + 是否为末次访视 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs index 57797a266..b258c2bac 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs @@ -14,7 +14,31 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid? SubjectId { get; set; } - + /// + /// 项目中心Code + /// + public string? TrialSiteCode { get; set; } + + /// + /// 受试者Code + /// + public string? SubjectCode { get; set; } + + /// + /// 模块类型 + /// + public ModuleTypeEnum? ModuleType { get; set; } + + /// + /// 状态 + /// + public ReadModuleEnum? Status { get; set; } + + /// + /// 任务名称 + /// + public string? Name { get; set; } + } public class GetSubjectReadVisitsOutDto @@ -229,6 +253,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string SiteCode { get; set; } + /// + /// 项目中心Id + /// + public string TrialSiteCode { get; set; } + /// /// 是否为末次访视 /// @@ -306,7 +335,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public string SubjectCode { get; set; } - public string SiteCode { get; set; } + public string TrialSiteCode { get; set; } + + public Guid SiteId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs index a06c58180..b58784e6c 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs @@ -61,10 +61,13 @@ namespace IRaCIS.Application.Services { var subjectQuery = _subjectRepository.WhereIf(dto.TrialId!=null, x => x.TrialId == dto.TrialId) .WhereIf(dto.SubjectId != null, x => x.Id == dto.SubjectId) - .Include(x => x.SubjectVisitList).Include(x=>x.Site).Include(x => x.TrialSite) + .Include(x => x.SubjectVisitList).Include(x => x.Site).Include(x => x.TrialSite) + //.WhereIf(dto.TrialSiteCode != null, x => x.TrialSite.TrialSiteCode == dto.TrialSiteCode) + // .WhereIf(dto.SubjectCode != null, x => x.Code == dto.SubjectCode) + .Select(x => new GetReadModuleDtoOut { - SiteCode = x.TrialSite.TrialSiteCode, + TrialSiteCode = x.TrialSite.TrialSiteCode, SiteId = x.SiteId, SubjectCode = x.Code, SubjectId = x.Id, @@ -79,7 +82,7 @@ namespace IRaCIS.Application.Services Status= ReadingCommon.GetVisitSubmitStateEnum(y), // 状态 CreateTime = y.CreateTime, // 创建时间 SubjectCode = y.Subject.Code, // 受试者code - SiteCode = x.TrialSite.TrialSiteCode, // 中心Code + TrialSiteCode = x.TrialSite.TrialSiteCode, // 中心Code VisitNum=y.VisitNum, IsFinalVisit=y.IsFinalVisit, // 是否为末次评估 @@ -94,6 +97,7 @@ namespace IRaCIS.Application.Services }); + var pageList = await subjectQuery.ToPagedListAsync(dto.PageIndex, dto.PageSize, dto.SortField == null|| dto.SortField==string.Empty ? "SiteCode" : dto.SortField, @@ -125,7 +129,7 @@ namespace IRaCIS.Application.Services ModuleType=y.ModuleType, Status= ReadingCommon.GetVisitSubmitStateEnum(y.SubjectVisit), SubjectCode= x.SubjectCode, - SiteCode=x.SiteCode, + TrialSiteCode = x.TrialSiteCode, SubjectVisitId= y.SubjectVisitId, SubjectVisitName=y.SubjectVisit?.VisitName, // 截止访视名称 CutOffVisitId = y.SubjectVisitId, // 截止访视 @@ -136,9 +140,29 @@ namespace IRaCIS.Application.Services })); - x.Data.OrderBy(y => y.ModuleType); + x.Data= x.Data.OrderBy(y => y.ModuleType).ThenBy(x=>x.VisitNum).ToList(); }); + pageList.CurrentPageData.ForEach(x => { + + if (dto.ModuleType != null) + { + x.Data = x.Data.Where(y => y.ModuleType == dto.ModuleType).ToList(); + } + if (dto.Status != null) + { + x.Data = x.Data.Where(y => y.Status == dto.Status).ToList(); + } + + if (dto.Name != null) + { + x.Data = x.Data.Where(y => y.Name.Contains(y.Name)).ToList(); + } + }); + + + + return (pageList, new { MaxLength = pageList.CurrentPageData.ToList().Max(x => x.Data.Count) diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 87a456412..255a7bd3c 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -26,20 +26,22 @@ namespace IRaCIS.Core.Domain.Share.Reading /// Read = 2, + /// + /// 全局阅片 + /// + Global = 3, + /// /// 裁判 /// - Referee = 3, + Referee = 4, /// /// 肿瘤学 /// - Oncology = 4, + Oncology = 5, - /// - /// 全局阅片 - /// - Global = 5, + } public enum ReadingSetType