From aee5c17591620177971478aa267445d5532f7cfa Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 5 Mar 2024 14:49:54 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=8C=BB=E5=AD=A6=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DTO/TaskMedicalReviewViewModel.cs | 4 +++- .../Allocation/TaskMedicalReviewService.cs | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs index 596012789..d9ae0afef 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs @@ -113,7 +113,9 @@ namespace IRaCIS.Core.Application.ViewModel public bool IsGetBeRead { get; set; } = false; - public string SubjectCode { get; set; } = String.Empty; + public bool IsGetNextMedicalReviewTask { get; set; } = false; + + public string SubjectCode { get; set; } = String.Empty; public string TrialSiteCode { get; set; } = String.Empty; public string TaskName { get; set; } = String.Empty; diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs index 472d7f8b0..b0de77951 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs @@ -152,6 +152,7 @@ namespace IRaCIS.Core.Application.Service Id=inDto.MedicalReviewId, SubjectId= medicalReview.VisitTask.SubjectId, TrialReadingCriterionId = medicalReview.VisitTask.TrialReadingCriterionId, + IsGetNextMedicalReviewTask = true, PageIndex=1, PageSize=1, })).Data; @@ -168,7 +169,8 @@ namespace IRaCIS.Core.Application.Service IsGetBeRead = true, Id = inDto.MedicalReviewId, TrialReadingCriterionId = medicalReview.VisitTask.TrialReadingCriterionId, - PageIndex = 1, + IsGetNextMedicalReviewTask = true, + PageIndex = 1, PageSize = 1, })).Data; @@ -196,7 +198,15 @@ namespace IRaCIS.Core.Application.Service { var taskMedicalReviewQueryable = _taskMedicalReviewRepository.Where(t => t.VisitTask.TrialId == inQuery.TrialId && t.MedicalManagerUserId == _userInfo.Id&&t.VisitTask.TrialReadingCriterionId==inQuery.TrialReadingCriterionId) - .WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId) + + .WhereIf(inQuery.IsGetNextMedicalReviewTask, + x=>x.AuditState!= MedicalReviewAuditState.HaveSigned & + + ( x.ReadingMedicalReviewDialogList.Count()==0|| + + x.ReadingMedicalReviewDialogList.Count()>0&& + x.ReadingMedicalReviewDialogList.OrderByDescending(x=>x.CreateTime).FirstOrDefault().UserTypeEnumInt==(int)UserTypeEnum.IndependentReviewer)) + .WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId) .WhereIf(inQuery.SiteId != null, t => t.VisitTask.Subject.SiteId == inQuery.SiteId) .WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode)) .WhereIf(inQuery.Id != null, t => t.Id != inQuery.Id) @@ -210,9 +220,11 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.IsInvalid != null, t => t.IsInvalid == inQuery.IsInvalid) .WhereIf(inQuery.IsGetBeRead,x=>!x.IsInvalid&&x.AuditState!= MedicalReviewAuditState.HaveSigned) .WhereIf(inQuery.TrialReadingCriterionId != null, t => t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) + .OrderBy(x=>x.VisitTask.SubjectId).ThenBy(x=>x.VisitTask.ArmEnum).ThenBy(x=>x.VisitTask.VisitTaskNum) .ProjectTo(_mapper.ConfigurationProvider); + - var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TaskMedicalReviewView.Id) : inQuery.SortField, inQuery.Asc); + var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize,new string[] { } ); return ResponseOutput.Ok(pageList, new { From 7584f4a5b43a6aaef997d74467e370327bd114f3 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 5 Mar 2024 14:53:23 +0800 Subject: [PATCH 2/5] =?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/Allocation/TaskMedicalReviewService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs index b0de77951..02081e74b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs @@ -224,7 +224,7 @@ namespace IRaCIS.Core.Application.Service .ProjectTo(_mapper.ConfigurationProvider); - var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize,new string[] { } ); + var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize,new string[] { "SubjectId asc" } ); return ResponseOutput.Ok(pageList, new { From db2f3cc85a90af4a68be86613c02ef226609ad3b Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 5 Mar 2024 14:57:16 +0800 Subject: [PATCH 3/5] =?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/Allocation/TaskMedicalReviewService.cs | 2 +- .../_IRaCIS/IQueryablePageListExtensions.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs index 02081e74b..b0de77951 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs @@ -224,7 +224,7 @@ namespace IRaCIS.Core.Application.Service .ProjectTo(_mapper.ConfigurationProvider); - var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize,new string[] { "SubjectId asc" } ); + var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize,new string[] { } ); return ResponseOutput.Ok(pageList, new { diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs index ee6aa1189..ef697e09b 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs @@ -201,9 +201,13 @@ namespace IRaCIS.Core.Infrastructure.Extention return new PageOutput() { CurrentPageData = new T[0] }; } - var sortString = string.Join(',', sortArray); + if(sortArray.Count()>0) + { + var sortString = string.Join(',', sortArray); - source = source.OrderBy(sortString); + source = source.OrderBy(sortString); + } + source = source.Skip((pageNumber - 1) * pageSize); var items = await source From ef032b548eb06518b883b8fb1a57c3e06bcac81a Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 5 Mar 2024 17:13:38 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ReadingCalculate/LuganoCalculateService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index 5b6489826..92c7f4814 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -795,7 +795,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }).ToListAsync(); - var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.Answer == TargetState.UnableEvaluate.GetEnumInt() + var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && + (x.Answer == TargetState.UnableEvaluate.GetEnumInt()|| x.Answer == TargetState.Loss.GetEnumInt()) && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State ) .Select(x => x.RowId).Distinct().ToListAsync(); From f88ef2f3fc7407f6716ac3e75ce2dae8cc87daa3 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 5 Mar 2024 18:05:08 +0800 Subject: [PATCH 5/5] =?UTF-8?q?lugano=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ReadingCalculate/LuganoCalculateService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index 92c7f4814..4fab256f0 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -1214,7 +1214,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate break; case SplitOrMergeType.MergeMain: case SplitOrMergeType.MergeMained: - x.SplitOrMergeType = SplitOrMergeType.MergeMain; + x.SplitOrMergeType = SplitOrMergeType.MergeMained; break; default: x.SplitOrMergeType = null;