From 96462aa4bae35b3474cbbe702c343809b5fa56d0 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 3 Sep 2024 15:51:59 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=AD=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/UploadDownLoadController.cs | 14 ++-- .../Allocation/DTO/VisitTaskViewModel.cs | 18 ++++++ .../Service/Allocation/_MapConfig.cs | 1 + .../Service/QC/QCOperationService.cs | 12 ++-- .../ClinicalData/ClinicalAnswerService.cs | 2 +- .../ReadingPeriod/ReadingPeriodSetService.cs | 12 ++-- .../TrialSiteUser/TrialConfigService.cs | 64 +++++++++++-------- .../Service/WorkLoad/DoctorWorkloadService.cs | 2 +- IRaCIS.Core.Domain/Allocation/VisitTask.cs | 3 + 9 files changed, 82 insertions(+), 46 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index 85c21949f..df6500ede 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -519,9 +519,9 @@ namespace IRaCIS.Core.API.Controllers { fileName = realFileName; - if (!fileName.EndsWith(".xlsx") && !fileName.EndsWith(".csv") && !fileName.EndsWith(".xls")) + if (!fileName.EndsWith(".xlsx") && !fileName.EndsWith(".xls")) { - //---支持.xlsx、.xls、.csv格式的文件上传。 + //---支持.xlsx、.xls格式的文件上传。 throw new BusinessValidationFailedException(_localizer["UploadDownLoad_SupportedFormats"]); } @@ -944,11 +944,11 @@ namespace IRaCIS.Core.API.Controllers } var generateUserTypeList = new List() { "CRC", "CRA" }; - if (excelList.Any(t => !generateUserTypeList.Contains(t.UserTypeStr.ToUpper()))) - { - //用户类型仅能为 CRC,SR,CRA 请核查Excel数据 - throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidUserType"]); - } + //if (excelList.Any(t => !generateUserTypeList.Contains(t.UserTypeStr.ToUpper()))) + //{ + // //用户类型仅能为 CRC,SR,CRA 请核查Excel数据 + // throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidUserType"]); + //} if (excelList.Count == 0) { throw new BusinessValidationFailedException(_localizer["UploadDownLoad_NoValiddata"]); diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index 64e526983..d0ab9fc1a 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -26,6 +26,13 @@ namespace IRaCIS.Core.Application.ViewModel public bool IsUrgent { get; set; } + public bool? IsSelfAnalysis { get; set; } + + /// + /// 是否是一致性分析产生 + /// + public bool IsAnalysisCreate { get; set; } + /// /// 加急类型 /// @@ -203,6 +210,11 @@ namespace IRaCIS.Core.Application.ViewModel public bool IsHaveFeedBack { get; set; } + + /// + /// 是否手动生成 + /// + public bool IsManualGeneration { get; set; } //public bool IsAfterConvertedTask { get; set; } } @@ -258,6 +270,12 @@ namespace IRaCIS.Core.Application.ViewModel //产生重阅的根任务Id public Guid RootReReadingTaskId { get; set; } + /// + /// 是否是一致性分析产生 + /// + public bool IsAnalysisCreate { get; set; } + + public bool? IsSelfAnalysis { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index 00dc9b3ef..4b1424c80 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -145,6 +145,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.HistoryReadingDoctorUserList, t => t.MapFrom(u => u.JudgeVisitList)); CreateMap().IncludeBase() + .ForMember(o=>o.IsManualGeneration,t=> t.MapFrom(u => !u.TrialReadingCriterion.IsAutoCreate)) .ForMember(o => o.IsHaveFeedBack, t => t.MapFrom(u => u.UserFeedBackList.Any(t=>t.State==0))) ; diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index d2e56bddc..4b92a49df 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -2061,12 +2061,12 @@ namespace IRaCIS.Core.Application.Image.QA return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyConfirmation"]); } - if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId) - .AnyAsync(t => t.IsEnrollmentConfirm != command.IsEnrollmentConfirm && t.RequestBackState == RequestBackStateEnum.PM_AgressBack)) - { - //---该访视为回退访视,不允许修改PD确认状态 - return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyPDStatus"]); - } + // if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId) + //.AnyAsync(t => t.IsEnrollmentConfirm != command.IsEnrollmentConfirm && t.RequestBackState == RequestBackStateEnum.PM_AgressBack)) + // { + // //---该访视为回退访视,不允许修改PD确认状态 + // return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyPDStatus"]); + // } dbSubjectVisit.IsEnrollmentConfirm = command.IsEnrollmentConfirm.Value; } diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs index 7f79c8351..4dc4fb8d2 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs @@ -409,7 +409,7 @@ namespace IRaCIS.Core.Application.Service { if (await _readModuleRepository.AnyAsync(x =>x.SubjectId== inDto.SubjectId&& x.SubjectVisit.LatestScanDate <= clinicalForm.CheckDate && x.IsCRCConfirm)) { - throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_unableToAddOrUpdate"]); + throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_unableToAddOrUpdate", clinicalForm.CheckDate.Value.ToString("yyyy-MM-dd")]); } } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs index f12b7854d..fdd2ebc2f 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs @@ -138,11 +138,13 @@ namespace IRaCIS.Application.Services .Include(x => x.ReadingPeriodSet).Include(x => x.SubjectVisit).ToList(); var needAddVisitIds = plans.Select(x => x.SubjectVisitId).ToList(); - var repeatVisitNames = _readModuleRepository.Where(x => x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId && x.ReadingSetType == readingPeriodSet.ReadingSetType && needAddVisitIds.Contains(x.SubjectVisitId)).Select(x => x.Subject.Code + "的" + x.SubjectVisit.VisitName).ToList(); - if (repeatVisitNames.Count != 0) - { - return ResponseOutput.NotOk(_localizer["ReadingPeriodSet_AlreadyAdded", string.Join(",", repeatVisitNames)]); - } + var repeatVisitIds = _readModuleRepository.Where(x => x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId && x.ReadingSetType == readingPeriodSet.ReadingSetType && needAddVisitIds.Contains(x.SubjectVisitId)).Select(x => x.SubjectVisitId).ToList(); + + + plans = plans.Where(x => !repeatVisitIds.Contains(x.SubjectVisitId)).ToList(); + + + List readModules = new List(); foreach (var item in plans) { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index 4aff71f8a..070ad041b 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -117,6 +117,18 @@ namespace IRaCIS.Core.Application throw new BusinessValidationFailedException(_localizer["TrialConfig_JudgeTaskFail"]); } + var criterionFormType = trialCriterion.FormType; + var count = _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId) + .WhereIf(criterionFormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null) + .WhereIf(criterionFormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null).Count(); + + if (count == 0) + { + //---当前标准下未配置问题 + throw new BusinessValidationFailedException(_localizer["TrialConfig_StdConfigMissing"]); + } + + await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial() { IsSigned = true, @@ -505,40 +517,40 @@ namespace IRaCIS.Core.Application - /// - /// 设置项目阅片标准 - /// - /// - [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] - public async Task SetTrialReadingCriterion(SetTrialReadingCriterionInDto inDto) - { - if (inDto.IsSignSave) - { - var criterionFormType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => x.FormType).FirstOrDefaultAsync(); - var count = _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId) - .WhereIf(criterionFormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null) - .WhereIf(criterionFormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null).Count(); + ///// + ///// 设置项目阅片标准 + ///// + ///// + //[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] + //public async Task SetTrialReadingCriterion(SetTrialReadingCriterionInDto inDto) + //{ + // if (inDto.IsSignSave) + // { + // var criterionFormType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => x.FormType).FirstOrDefaultAsync(); + // var count = _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId) + // .WhereIf(criterionFormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null) + // .WhereIf(criterionFormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null).Count(); - if (count == 0) - { - //---当前标准下未配置问题 - throw new BusinessValidationFailedException(_localizer["TrialConfig_StdConfigMissing"]); - } - } + // if (count == 0) + // { + // //---当前标准下未配置问题 + // throw new BusinessValidationFailedException(_localizer["TrialConfig_StdConfigMissing"]); + // } + // } - await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial() - { - FormType = inDto.FormType, - }); + // await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial() + // { + // FormType = inDto.FormType, + // }); - var result = await _trialRepository.SaveChangesAsync(); + // var result = await _trialRepository.SaveChangesAsync(); - return ResponseOutput.Ok(result); - } + // return ResponseOutput.Ok(result); + //} /// /// 设置项目阅片信息 diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs b/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs index d22694297..3cd4da0a8 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs @@ -138,7 +138,7 @@ namespace IRaCIS.Application.Services if (readingCategoryList.Except(inDto.ReadingCategorys).Count() > 0) { //---已分配任务,不允许减少阅片类型 - return ResponseOutput.NotOk(_localizer["DoctorWorkload_AssignType"]); + //return ResponseOutput.NotOk(_localizer["DoctorWorkload_AssignType"]); } diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index fc102f03d..62a708ec6 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -397,6 +397,9 @@ namespace IRaCIS.Core.Domain.Models /// public bool IsHistoryConvertedTask { get; set; } = false; + /// + /// 是否是自身一致性 + /// public bool? IsSelfAnalysis { get; set; } public string BlindSubjectCode { get; set; } = string.Empty; From a2dd550a72f2d07ee29fc8d015553924928efbd3 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 3 Sep 2024 16:17:13 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/DTO/FrontAuditConfigViewModel.cs | 5 +++++ IRaCIS.Core.Domain/Common/FrontAuditConfig.cs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs index e1ca30669..13a4d84e2 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs @@ -150,6 +150,11 @@ namespace IRaCIS.Core.Application.ViewModel public DateTime UpdateTime { get; set; } public Guid UpdateUserId { get; set; } public string Code { get; set; } = string.Empty; + + /// + /// 字段的英文值 + /// + public string CodeEn { get; set; } = string.Empty; public Guid? ParentId { get; set; } public bool IsEnable { get; set; } public Guid? ModuleTypeId { get; set; } diff --git a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs index 69347fb0b..272ad5060 100644 --- a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs +++ b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs @@ -82,6 +82,12 @@ namespace IRaCIS.Core.Domain.Models public string Code { get; set; } = String.Empty; + /// + /// 字段的英文值 + /// + public string CodeEn { get; set; } = string.Empty; + + //前端渲染数组 数组名 和数组值 public string ChildDataLabel { get; set; } From 0a581db6d1dc064be1c00974d1cdfa648c5818c8 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 3 Sep 2024 17:07:31 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReadingTaskQuestionService.cs | 77 ++++--------------- 1 file changed, 16 insertions(+), 61 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs index e7d0f29e6..1af3c7979 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs @@ -47,78 +47,33 @@ namespace IRaCIS.Application.Services /// /// [HttpPost] - public async Task<(GetTrialReadingQuestionPageDto, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto) + public async Task<(GetReadingTableQuestionOutDto, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto) { - if (inDto.VisitTaskId != null) - { - //await AddDefaultValueToTask(inDto.VisitTaskId.Value); - } - - var result = new GetTrialReadingQuestionPageDto(); var readingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.ReadingTaskState).FirstOrDefaultAsync(); - - - var qusetionList = await GetReadingAnswerView(inDto.ReadingQuestionCriterionTrialId, inDto.VisitTaskId); - var formType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.ReadingQuestionCriterionTrialId).Select(x => x.FormType).FirstOrDefaultAsync(); - var groupList = new List(); - - var qusetionIds = qusetionList.Select(x => x.Id).ToList(); - var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId)) - .ProjectTo(_mapper.ConfigurationProvider,x=>new { - - isEn_Us=_userInfo.IsEn_Us - - }).OrderBy(x => x.ShowOrder).ToListAsync(); if (inDto.FormType != null) { formType = inDto.FormType.Value; } + var tableAnswers = await _readingTableQuestionAnswerRepository + .ProjectTo(_mapper.ConfigurationProvider) + .Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync(); - if (formType == FormType.MultiplePage) + var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + var organIds = tableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); + var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); + var result=await GetReadingTableQuestion(new GetReadingTableQuestionOrAnswerInDto() { - qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId != null).ToList(); - var readingCriterionPageIds = qusetionList.OrderBy(x => x.PageShowOrder).Select(x => x.ReadingCriterionPageId).Distinct().ToList(); - foreach (var item in readingCriterionPageIds) - { - var newPageQusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == item).ToList(); - var firstData = newPageQusetionList.FirstOrDefault(); - var page = new GetTrialReadingQuestionOutDto() - { - PageName = firstData!.PageName, - IsPage = true, - IsPublicPage = firstData.IsPublicPage, - }; - var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList(); - pageGroupList.ForEach(x => - { - this.FindChildQuestion(x, newPageQusetionList, tableQuestionList); - }); + TrialReadingCriterionId = inDto.ReadingQuestionCriterionTrialId, + TaskId = inDto.VisitTaskId, + TableAnswers = tableAnswers, + TableAnsweRowInfos = tableAnsweRowInfos, + OrganInfos = organList, + QuestionClassify = null, - page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); - groupList.Add(page); - } - - result.PublicPage = groupList.Where(x => x.IsPublicPage!.Value).ToList(); - result.MultiPage = groupList.Where(x => !x.IsPublicPage!.Value).ToList(); - } - else - { - qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList(); - - groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupId==null)).ToList(); - groupList.ForEach(x => - { - this.FindChildQuestion(x, qusetionList, tableQuestionList); - }); - - groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); - - result.SinglePage = groupList; - - - } + }); return (result, new From 72f0fd319350b8d96ddc0374baa0eb8569849eaf Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 3 Sep 2024 17:18:41 +0800 Subject: [PATCH 4/7] =?UTF-8?q?Revert=20"=E4=BF=AE=E6=94=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0a581db6d1dc064be1c00974d1cdfa648c5818c8. --- .../ReadingTaskQuestionService.cs | 77 +++++++++++++++---- 1 file changed, 61 insertions(+), 16 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs index 1af3c7979..e7d0f29e6 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs @@ -47,33 +47,78 @@ namespace IRaCIS.Application.Services /// /// [HttpPost] - public async Task<(GetReadingTableQuestionOutDto, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto) + public async Task<(GetTrialReadingQuestionPageDto, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto) { + if (inDto.VisitTaskId != null) + { + //await AddDefaultValueToTask(inDto.VisitTaskId.Value); + } + + var result = new GetTrialReadingQuestionPageDto(); var readingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.ReadingTaskState).FirstOrDefaultAsync(); + + + var qusetionList = await GetReadingAnswerView(inDto.ReadingQuestionCriterionTrialId, inDto.VisitTaskId); + var formType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.ReadingQuestionCriterionTrialId).Select(x => x.FormType).FirstOrDefaultAsync(); + var groupList = new List(); + + var qusetionIds = qusetionList.Select(x => x.Id).ToList(); + var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId)) + .ProjectTo(_mapper.ConfigurationProvider,x=>new { + + isEn_Us=_userInfo.IsEn_Us + + }).OrderBy(x => x.ShowOrder).ToListAsync(); if (inDto.FormType != null) { formType = inDto.FormType.Value; } - var tableAnswers = await _readingTableQuestionAnswerRepository - .ProjectTo(_mapper.ConfigurationProvider) - .Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync(); - var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - - var organIds = tableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); - var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); - var result=await GetReadingTableQuestion(new GetReadingTableQuestionOrAnswerInDto() + if (formType == FormType.MultiplePage) { + qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId != null).ToList(); + var readingCriterionPageIds = qusetionList.OrderBy(x => x.PageShowOrder).Select(x => x.ReadingCriterionPageId).Distinct().ToList(); + foreach (var item in readingCriterionPageIds) + { + var newPageQusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == item).ToList(); + var firstData = newPageQusetionList.FirstOrDefault(); + var page = new GetTrialReadingQuestionOutDto() + { + PageName = firstData!.PageName, + IsPage = true, + IsPublicPage = firstData.IsPublicPage, + }; - TrialReadingCriterionId = inDto.ReadingQuestionCriterionTrialId, - TaskId = inDto.VisitTaskId, - TableAnswers = tableAnswers, - TableAnsweRowInfos = tableAnsweRowInfos, - OrganInfos = organList, - QuestionClassify = null, + var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList(); + pageGroupList.ForEach(x => + { + this.FindChildQuestion(x, newPageQusetionList, tableQuestionList); + }); - }); + page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); + groupList.Add(page); + } + + result.PublicPage = groupList.Where(x => x.IsPublicPage!.Value).ToList(); + result.MultiPage = groupList.Where(x => !x.IsPublicPage!.Value).ToList(); + } + else + { + qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList(); + + groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupId==null)).ToList(); + groupList.ForEach(x => + { + this.FindChildQuestion(x, qusetionList, tableQuestionList); + }); + + groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); + + result.SinglePage = groupList; + + + } return (result, new From d49350a8cdae4dfac0034304eb6edc4b5afe1e1e Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 3 Sep 2024 17:24:17 +0800 Subject: [PATCH 5/7] =?UTF-8?q?Reapply=20"=E4=BF=AE=E6=94=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 72f0fd319350b8d96ddc0374baa0eb8569849eaf. --- .../ReadingTaskQuestionService.cs | 77 ++++--------------- 1 file changed, 16 insertions(+), 61 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs index e7d0f29e6..1af3c7979 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs @@ -47,78 +47,33 @@ namespace IRaCIS.Application.Services /// /// [HttpPost] - public async Task<(GetTrialReadingQuestionPageDto, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto) + public async Task<(GetReadingTableQuestionOutDto, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto) { - if (inDto.VisitTaskId != null) - { - //await AddDefaultValueToTask(inDto.VisitTaskId.Value); - } - - var result = new GetTrialReadingQuestionPageDto(); var readingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.ReadingTaskState).FirstOrDefaultAsync(); - - - var qusetionList = await GetReadingAnswerView(inDto.ReadingQuestionCriterionTrialId, inDto.VisitTaskId); - var formType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.ReadingQuestionCriterionTrialId).Select(x => x.FormType).FirstOrDefaultAsync(); - var groupList = new List(); - - var qusetionIds = qusetionList.Select(x => x.Id).ToList(); - var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId)) - .ProjectTo(_mapper.ConfigurationProvider,x=>new { - - isEn_Us=_userInfo.IsEn_Us - - }).OrderBy(x => x.ShowOrder).ToListAsync(); if (inDto.FormType != null) { formType = inDto.FormType.Value; } + var tableAnswers = await _readingTableQuestionAnswerRepository + .ProjectTo(_mapper.ConfigurationProvider) + .Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync(); - if (formType == FormType.MultiplePage) + var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + var organIds = tableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); + var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); + var result=await GetReadingTableQuestion(new GetReadingTableQuestionOrAnswerInDto() { - qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId != null).ToList(); - var readingCriterionPageIds = qusetionList.OrderBy(x => x.PageShowOrder).Select(x => x.ReadingCriterionPageId).Distinct().ToList(); - foreach (var item in readingCriterionPageIds) - { - var newPageQusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == item).ToList(); - var firstData = newPageQusetionList.FirstOrDefault(); - var page = new GetTrialReadingQuestionOutDto() - { - PageName = firstData!.PageName, - IsPage = true, - IsPublicPage = firstData.IsPublicPage, - }; - var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList(); - pageGroupList.ForEach(x => - { - this.FindChildQuestion(x, newPageQusetionList, tableQuestionList); - }); + TrialReadingCriterionId = inDto.ReadingQuestionCriterionTrialId, + TaskId = inDto.VisitTaskId, + TableAnswers = tableAnswers, + TableAnsweRowInfos = tableAnsweRowInfos, + OrganInfos = organList, + QuestionClassify = null, - page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); - groupList.Add(page); - } - - result.PublicPage = groupList.Where(x => x.IsPublicPage!.Value).ToList(); - result.MultiPage = groupList.Where(x => !x.IsPublicPage!.Value).ToList(); - } - else - { - qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList(); - - groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupId==null)).ToList(); - groupList.ForEach(x => - { - this.FindChildQuestion(x, qusetionList, tableQuestionList); - }); - - groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); - - result.SinglePage = groupList; - - - } + }); return (result, new From eae6be5fb4891e19f86f9299b7f35dfbacefd169 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 3 Sep 2024 17:52:48 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReadingImageTaskService.cs | 61 +++++++++++-------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index d805a5605..f9cdeaeac 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1106,38 +1106,51 @@ namespace IRaCIS.Application.Services //是否是预览 if (inDto.IsGetPreview == false) { - // 是否获取所有问题 - if (inDto.IsGetallQuestion) + switch (criterionInfo.ReadingTool) { - if (!criterionInfo.IseCRFShowInDicomReading) - { - qusetionList = qusetionList.Where(x => x.IsShowInDicom).OrderBy(x => x.ShowOrder).ToList(); - } - } - else - { - if (!criterionInfo.IseCRFShowInDicomReading) - { - qusetionList = qusetionList.Where(x => x.IsShowInDicom && (x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.Group)).OrderBy(x => x.ShowOrder).ToList(); - } - - - if (inDto.TaskId != null) - { - if (taskInfo.IsConvertedTask) + case ReadingTool.Dicom: + // 是否获取所有问题 + if (inDto.IsGetallQuestion) { - qusetionList = qusetionList.Where(x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.AfterShow).OrderBy(x => x.ShowOrder).ToList(); + if (!criterionInfo.IseCRFShowInDicomReading) + { + qusetionList = qusetionList.Where(x => x.IsShowInDicom).OrderBy(x => x.ShowOrder).ToList(); + } } else { - qusetionList = qusetionList.Where(x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.BeforeShow).OrderBy(x => x.ShowOrder).ToList(); + if (!criterionInfo.IseCRFShowInDicomReading) + { + qusetionList = qusetionList.Where(x => x.IsShowInDicom && (x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.Group)).OrderBy(x => x.ShowOrder).ToList(); + } + + + if (inDto.TaskId != null) + { + if (taskInfo.IsConvertedTask) + { + qusetionList = qusetionList.Where(x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.AfterShow).OrderBy(x => x.ShowOrder).ToList(); + } + else + { + qusetionList = qusetionList.Where(x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.BeforeShow).OrderBy(x => x.ShowOrder).ToList(); + } + + } + + var usedGuropIds = qusetionList.Where(x => x.Type == ReadingQestionType.Table).Select(x => x.GroupId).ToList(); + qusetionList = qusetionList.Where(x => usedGuropIds.Contains(x.Id) || usedGuropIds.Contains(x.GroupId)).ToList(); } + break; - } - - var usedGuropIds = qusetionList.Where(x => x.Type == ReadingQestionType.Table).Select(x => x.GroupId).ToList(); - qusetionList = qusetionList.Where(x => usedGuropIds.Contains(x.Id) || usedGuropIds.Contains(x.GroupId)).ToList(); + case ReadingTool.NoDicom: + if (!criterionInfo.IseCRFShowInDicomReading) + { + qusetionList = qusetionList.Where(x => x.IsShowInDicom && x.Type == ReadingQestionType.Group).OrderBy(x => x.ShowOrder).ToList(); + } + break; } + } From 327874d396db707d45fc6abdb3c69f5294ad55c8 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 3 Sep 2024 17:58:21 +0800 Subject: [PATCH 7/7] =?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/Reading/ReadingImageTask/ReadingImageTaskService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index f9cdeaeac..3ebd840cc 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1146,7 +1146,7 @@ namespace IRaCIS.Application.Services case ReadingTool.NoDicom: if (!criterionInfo.IseCRFShowInDicomReading) { - qusetionList = qusetionList.Where(x => x.IsShowInDicom && x.Type == ReadingQestionType.Group).OrderBy(x => x.ShowOrder).ToList(); + qusetionList = qusetionList.Where(x => x.IsShowInDicom).OrderBy(x => x.ShowOrder).ToList(); } break; }