diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index e4d2a025e..ffcf895b2 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -3799,6 +3799,21 @@ 1 Mint、2 PACS + + + 仲裁规则 + + + + + 阅片是否显示受试者信息 + + + + + 阅片是否显示既往结果 + + QC流程 0 不审,1 单审,2双审 @@ -3894,6 +3909,11 @@ 阅片信息签名时间 + + + 仲裁阅片 + + pageId diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index fe0fd27ff..c1e223dcb 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -337,25 +337,44 @@ namespace IRaCIS.Core.Application.Service var isReadingTaskViewInOrder = await _trialRepository.Where(x => x.Id == iRUnReadSubjectQuery.TrialId).Select(x => x.IsReadingTaskViewInOrder).FirstOrDefaultAsync(); if (isReadingTaskViewInOrder) { - var subjectQuery = _subjectRepository.Where(t => t.TrialId == trialId) - .Where(t => t.SubjectDoctorList.Any(t => t.DoctorUserId == _userInfo.Id)) - .WhereIf(!string.IsNullOrEmpty(iRUnReadSubjectQuery.SubjectCode), t => t.Code.Contains(iRUnReadSubjectQuery.SubjectCode)) - .Select(s => new IRUnReadSubjectView() - { - SubjectId = s.Id, - SubjectCode = s.Code, - UnReadTaskCount = s.SubjectVisitTaskList.Count(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.DoctorUserId == _userInfo.Id), - UnReadTaskList = s.SubjectVisitTaskList.Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.DoctorUserId == _userInfo.Id) - .Select(u => new IRUnreadTaskView() { Id = u.Id, IsUrgent = u.IsUrgent, SuggesteFinishedTime = u.SuggesteFinishedTime }).ToList(), - }) - .Where(t => t.UnReadTaskCount > 0); + // var subjectQuery = _subjectRepository.Where(t => t.TrialId == trialId) + //.Where(t => t.SubjectDoctorList.Any(t => t.DoctorUserId == _userInfo.Id)) + //.WhereIf(!string.IsNullOrEmpty(iRUnReadSubjectQuery.SubjectCode), t => t.Code.Contains(iRUnReadSubjectQuery.SubjectCode)) + //.Select(s => new IRUnReadSubjectView() + //{ + // SubjectId = s.Id, + // SubjectCode = s.Code, + // UnReadTaskCount = s.SubjectVisitTaskList.Count(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.DoctorUserId == _userInfo.Id), + // UnReadTaskList = s.SubjectVisitTaskList.Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.DoctorUserId == _userInfo.Id) + // .Select(u => new IRUnreadTaskView() { Id = u.Id, IsUrgent = u.IsUrgent, SuggesteFinishedTime = u.SuggesteFinishedTime }).ToList(), + //}) + // .Where(t => t.UnReadTaskCount > 0); - //var visitQuery=_visitTaskRepository.Where(x=>x.TrialId==trialId&&x.DoctorUserId== _userInfo.Id) - // .GroupBy(x=> new ) + var visitGroupQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.Id) + .Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned) + .GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode }); + var visitTaskQuery = visitGroupQuery.Select(x=> new IRUnReadSubjectView() { + SubjectId=x.Key.SubjectId, + SubjectCode=x.Key.BlindSubjectCode==null?x.Key.Code: x.Key.BlindSubjectCode, + UnReadTaskCount=x.Count(), + UnReadTaskList=x.Select(u => new IRUnreadTaskView() { Id = u.Id, IsUrgent = u.IsUrgent, SuggesteFinishedTime = u.SuggesteFinishedTime }).ToList(), + }); - var result = await subjectQuery.ToPagedListAsync(iRUnReadSubjectQuery.PageIndex, iRUnReadSubjectQuery.PageSize, String.IsNullOrEmpty(iRUnReadSubjectQuery.SortField) ? nameof(IRUnReadSubjectView.SubjectId) : iRUnReadSubjectQuery.SortField, iRUnReadSubjectQuery.Asc); + var totalCount = visitGroupQuery.Count(); + var currentPageData = await visitTaskQuery.OrderBy(x => x.SubjectCode).Skip((iRUnReadSubjectQuery.PageIndex - 1) * iRUnReadSubjectQuery.PageSize).Take(iRUnReadSubjectQuery.PageSize).ToListAsync(); + + var result = new PageOutput() + { + PageSize = iRUnReadSubjectQuery.PageSize, + PageIndex = iRUnReadSubjectQuery.PageIndex, + TotalCount = totalCount, + CurrentPageData= currentPageData, + }; + + /// 封装的方法有问题 + //var result = await visitQuery.ToPagedListAsync(iRUnReadSubjectQuery.PageIndex, iRUnReadSubjectQuery.PageSize, String.IsNullOrEmpty(iRUnReadSubjectQuery.SortField) ? nameof(IRUnReadSubjectView.SubjectId) : iRUnReadSubjectQuery.SortField, iRUnReadSubjectQuery.Asc); return (result, new { RandomReadInfo = new IRUnReadOutDto(),