From c67dcb1d5c7be4480e585ee9b7b01d3da7c6d345 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Tue, 4 Jul 2023 15:24:34 +0800 Subject: [PATCH] =?UTF-8?q?S-002=20=E4=B8=B4=E5=BA=8A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ClinicalData/ClinicalAnswerService.cs | 36 +++++++++++-------- .../Service/Reading/Dto/ClinicalAnswerDto.cs | 2 +- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs index 67f17a800..902957aa5 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs @@ -433,20 +433,24 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpPost] - public async Task> GetCRCConfirmList(GetCRCConfirmListInDto inDto) + public async Task> GetCRCConfirmList(GetCRCConfirmListInDto inDto) { - List result = await _readModuleRepository.Where(x => x.TrialId == inDto.TrialId) - .WhereIf(inDto.ReadModuleId!=null,x=>x.Id==inDto.ReadModuleId) - .Select(x => new GetCRCConfirmListOutDto() - { - SubjectId= x.SubjectId, - IsCRCConfirm = x.IsCRCConfirm, - LatestScanDate = x.SubjectVisit.LatestScanDate, - ReadingSetType = x.ReadingSetType, - IsPMConfirm = x.IsPMConfirm, - SubjectCode=x.Subject.Code, - ReadModuleId = x.Id, - }).OrderBy(x => x.LatestScanDate).ToListAsync(); + var query = _readModuleRepository.Where(x => x.TrialId == inDto.TrialId) + .WhereIf(inDto.ReadModuleId != null, x => x.Id == inDto.ReadModuleId) + .Select(x => new GetCRCConfirmListOutDto() + { + SubjectId = x.SubjectId, + IsCRCConfirm = x.IsCRCConfirm, + LatestScanDate = x.SubjectVisit.LatestScanDate, + ReadingSetType = x.ReadingSetType, + IsPMConfirm = x.IsPMConfirm, + SubjectCode = x.Subject.Code, + ReadModuleId = x.Id, + }); + + + var result = await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, string.IsNullOrWhiteSpace(inDto.SortField) ? nameof(GetCRCConfirmListOutDto.LatestScanDate) : inDto.SortField, inDto.Asc); + var formList = await _clinicalFormRepository.Where(x => x.TrialId == inDto.TrialId) .Where(x => x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC) .Where(x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.ImageRead || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.OncologyRead) @@ -461,7 +465,7 @@ namespace IRaCIS.Core.Application.Service ClinicalDataSetEnName=x.ClinicalDataTrialSet.ClinicalDataSetEnName, }).ToListAsync(); var confirmList = await _readModuleCriterionFromRepository.Where(x => x.TrialId == inDto.TrialId).Include(x=>x.ClinicalForm).Include(x=>x.ClinicalForm.ClinicalDataTrialSet).ToListAsync(); - result.ForEach(x => + result.CurrentPageData.ForEach(x => { if (x.IsCRCConfirm) { @@ -516,8 +520,10 @@ namespace IRaCIS.Core.Application.Service { ReadModuleId = inDto.ReadModuleId, TrialId = inDto.TrialId, + PageIndex=1, + PageSize=9999, - })).SelectMany(x => x.ClinicalFormIdList).ToList(); + })).CurrentPageData.SelectMany(x => x.ClinicalFormIdList).ToList(); result.ForEach(x => { diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalAnswerDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalAnswerDto.cs index ec8eceddd..fdb9f218a 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalAnswerDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalAnswerDto.cs @@ -99,7 +99,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string Answer { get; set; } = string.Empty; } - public class GetCRCConfirmListInDto + public class GetCRCConfirmListInDto:PageInput { public Guid TrialId { get; set; }