From b0f4b6a3d5200ddc31f06b3fe4a9a9c15ec0ef41 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 1 Aug 2025 09:15:34 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/_MapConfig.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 8536e2455..a756d131b 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -767,7 +767,9 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.CreateUserName, u => u.MapFrom(s => s.CreateUserRole.UserName)) .ForMember(d => d.CreateUserFullName, u => u.MapFrom(s => s.CreateUserRole.FullName)); - CreateMap(); + CreateMap() + .ForMember(d => d.ModalityForEdit, u => u.MapFrom(s => s.Modality)) + .ForMember(d => d.BodyPartForEdit, u => u.MapFrom(s => s.BodyPart)); } } From 24a082c0f0f461e8e76fac6e5c9b6afc5b96a8c9 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 1 Aug 2025 11:04:32 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8B=E4=B8=80=E4=B8=AA=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 9 ++- .../Service/QC/QCOperationService.cs | 66 +++++++++---------- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 9193531bf..7e51cdbf9 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -17990,7 +17990,14 @@ - + + + 因为不区分任务类型,按照同类型没找到,要自动切换到下一种类型,必须包一层 + + + + + 获取下一个质控任务 diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index e9ba9e2e4..80e32e670 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -1254,70 +1254,70 @@ namespace IRaCIS.Core.Application.Image.QA public async Task CollectNextIQCQuality(GetNextIQCQualityInDto inDto) { + var nextIQCQuality = await this.GetNextIQCQuality(inDto); + + if (nextIQCQuality.VisitId != null && nextIQCQuality.IsReceived == false) + { + var visit = await _subjectVisitRepository.Where(x => x.Id == nextIQCQuality.VisitId).FirstNotNullAsync(); + if (!visit.IsTake) + { + await ObtainOrCancelQCTask(inDto.TrialId, nextIQCQuality.VisitId.Value, true); + } + } + + return nextIQCQuality; + + } + + /// + /// 因为不区分任务类型,按照同类型没找到,要自动切换到下一种类型,必须包一层 + /// + /// + /// + [HttpPost] + public async Task GetNextIQCQuality(GetNextIQCQualityInDto inDto) + { var trialConfig = await _trialRepository - .Select(t => new { TrialId = t.Id, t.IsIQCAutoNextTask, t.IsIQCAutoTaskDistinguishType }) - .FirstOrDefaultAsync(t => t.TrialId == inDto.TrialId) - .IfNullThrowException(); + .Select(t => new { TrialId = t.Id, t.IsIQCAutoNextTask, t.IsIQCAutoTaskDistinguishType }) + .FirstOrDefaultAsync(t => t.TrialId == inDto.TrialId) + .IfNullThrowException(); var isDistinguishType = trialConfig.IsIQCAutoNextTask && trialConfig.IsIQCAutoTaskDistinguishType; - if (isDistinguishType == false) { //不区分任务类型,也要按照当前任务类型给,没找到,按照默认规则给任务 无质疑 普通质控任务 - var nextIQCQuality = await this.GetNextIQCQuality(inDto, true); + var nextIQCQuality = await this.GetNextIQCTask(inDto, true); + //没找到 if (nextIQCQuality.VisitId == null) { - nextIQCQuality = await this.GetNextIQCQuality(inDto, false); + nextIQCQuality = await this.GetNextIQCTask(inDto, false); - if (nextIQCQuality.VisitId != null && nextIQCQuality.IsReceived == false) - { - var visit = await _subjectVisitRepository.Where(x => x.Id == nextIQCQuality.VisitId).FirstNotNullAsync(); - if (!visit.IsTake) - { - await ObtainOrCancelQCTask(inDto.TrialId, nextIQCQuality.VisitId.Value, true); - } + return nextIQCQuality; - } } return nextIQCQuality; - } else { //区分任务类型,那么按照当前任务类型给,没找到就结束 - var nextIQCQuality = await this.GetNextIQCQuality(inDto, true); - - if (nextIQCQuality.VisitId != null && nextIQCQuality.IsReceived == false) - { - var visit = await _subjectVisitRepository.Where(x => x.Id == nextIQCQuality.VisitId).FirstNotNullAsync(); - if (!visit.IsTake) - { - await ObtainOrCancelQCTask(inDto.TrialId, nextIQCQuality.VisitId.Value, true); - } - - } + var nextIQCQuality = await this.GetNextIQCTask(inDto, true); return nextIQCQuality; - } - - - - - } + /// /// 获取下一个质控任务 /// /// /// [HttpPost] - public async Task GetNextIQCQuality(GetNextIQCQualityInDto inDto, bool isDistinguishType) + public async Task GetNextIQCTask(GetNextIQCQualityInDto inDto, bool isDistinguishType) { var trialConfig = await _trialRepository .Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification, t.IsIQCAutoNextTask, t.IsIQCAutoTaskDistinguishType }) From 33e84a05efac54cde0792a9460c9e45fc1a5d374 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 1 Aug 2025 13:52:37 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8B=E4=B8=80=E4=B8=AA=E4=BB=BB=E5=8A=A1-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 2 +- .../Service/QC/QCOperationService.cs | 17 +++++++++-------- .../ClinicalData/ReadingClinicalDataService.cs | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 7e51cdbf9..e02a527cb 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -6625,7 +6625,7 @@ 一致性分析临床数据签名 - + kimjnyhujikljkljkl diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index 80e32e670..473b8fa05 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -13,6 +13,7 @@ using Newtonsoft.Json; using Org.BouncyCastle.Asn1.Cmp; using System.ComponentModel.DataAnnotations; using System.Data; +using System.Linq.Dynamic.Core; namespace IRaCIS.Core.Application.Image.QA { @@ -1360,11 +1361,12 @@ namespace IRaCIS.Core.Application.Image.QA var visitList = await _subjectVisitRepository .Where(t => t.Subject.Status != SubjectStatus.EndOfVisit) .WhereIf(isDistinguishType, t => isSecondReview == true ? t.SecondReviewState == SecondReviewState.WaitAudit : t.SecondReviewState == SecondReviewState.None) - .WhereIf(isDistinguishType, t => ishaveQCChallenge == true ? t.QCChallengeList.Any() : !t.QCChallengeList.Any()) + .WhereIf(isDistinguishType, t => ishaveQCChallenge == true ? t.QCChallengeList.Any() : !t.QCChallengeList.Any()) .Where(x => !x.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None)) - .Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.SecondReviewState == SecondReviewState.None - && x.TrialId == inDto.TrialId && x.PreliminaryAuditUserId != _userInfo.UserRoleId && (x.CurrentActionUserId == _userInfo.UserRoleId || (x.AuditState != AuditStateEnum.PrimaryQCPassed && !x.IsTake))) - .Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.UserRoleId) + .Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId && x.CurrentActionUserId == null) + //.WhereIf(isSecondReview, t => t.PreliminaryAuditUserId != null) + //.WhereIf(isSecondReview == false, t => t.PreliminaryAuditUserId == null) + //.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.UserRoleId) .Select(t => new { t.IsUrgent, SubjectCode = t.Subject.Code, t.SubjectId, t.Id, t.VisitNum, IshaveQCChallenge = t.QCChallengeList.Any(), t.SecondReviewState }) .OrderBy(t => t.IshaveQCChallenge).ThenBy(t => t.SecondReviewState).ThenBy(x => x.IsUrgent).ThenBy(x => x.SubjectCode).ThenBy(x => x.VisitNum).ToListAsync(); @@ -1400,10 +1402,9 @@ namespace IRaCIS.Core.Application.Image.QA .WhereIf(isDistinguishType, t => isSecondReview == true ? t.SecondReviewState == SecondReviewState.WaitAudit : t.SecondReviewState == SecondReviewState.None) .WhereIf(isDistinguishType, t => ishaveQCChallenge == true ? t.QCChallengeList.Any() : !t.QCChallengeList.Any()) .Where(x => !x.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None)) - .Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId && - ((x.CurrentActionUserId == _userInfo.UserRoleId) || (!x.IsTake && x.AuditState != AuditStateEnum.QCPassed && (x.PreliminaryAuditUserId != _userInfo.UserRoleId))) - ) - .Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.UserRoleId) + .Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId && x.CurrentActionUserId == null) + .WhereIf(isSecondReview == false, t => t.AuditState >= AuditStateEnum.PrimaryQCPassed ? t.PreliminaryAuditUserId != _userInfo.UserRoleId : true) + //.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.UserRoleId) .Select(t => new { t.IsUrgent, SubjectCode = t.Subject.Code, t.SubjectId, t.Id, t.VisitNum, IshaveQCChallenge = t.QCChallengeList.Any(), t.SecondReviewState }) .OrderBy(t => t.IshaveQCChallenge).ThenBy(t => t.SecondReviewState).ThenBy(x => x.IsUrgent).ThenBy(x => x.SubjectCode).ThenBy(x => x.VisitNum).ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs index e025973fe..244cc6bfd 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs @@ -1221,7 +1221,7 @@ namespace IRaCIS.Core.Application.Service /// 一致性分析临床数据签名 /// /// - /// + /// kimjnyhujikljkljkl [HttpPost] public async Task SignConsistencyAnalysisReadingClinicalData(SignConsistencyAnalysisReadingClinicalDataInDto inDto) { From a11edc30539d84996302953d0609b14d208ac855 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 1 Aug 2025 14:36:52 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8B=E4=B8=80=E4=B8=AA=E4=BB=BB=E5=8A=A1-3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/QCOperationService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index 473b8fa05..3dc04ad1d 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -1365,7 +1365,7 @@ namespace IRaCIS.Core.Application.Image.QA .Where(x => !x.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None)) .Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId && x.CurrentActionUserId == null) //.WhereIf(isSecondReview, t => t.PreliminaryAuditUserId != null) - //.WhereIf(isSecondReview == false, t => t.PreliminaryAuditUserId == null) + .WhereIf(isSecondReview == false, t => t.AuditState != AuditStateEnum.QCPassed) //.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.UserRoleId) .Select(t => new { t.IsUrgent, SubjectCode = t.Subject.Code, t.SubjectId, t.Id, t.VisitNum, IshaveQCChallenge = t.QCChallengeList.Any(), t.SecondReviewState }) .OrderBy(t => t.IshaveQCChallenge).ThenBy(t => t.SecondReviewState).ThenBy(x => x.IsUrgent).ThenBy(x => x.SubjectCode).ThenBy(x => x.VisitNum).ToListAsync(); @@ -1404,6 +1404,7 @@ namespace IRaCIS.Core.Application.Image.QA .Where(x => !x.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None)) .Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId && x.CurrentActionUserId == null) .WhereIf(isSecondReview == false, t => t.AuditState >= AuditStateEnum.PrimaryQCPassed ? t.PreliminaryAuditUserId != _userInfo.UserRoleId : true) + .WhereIf(isSecondReview == false, t => t.AuditState != AuditStateEnum.QCPassed) //.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.UserRoleId) .Select(t => new { t.IsUrgent, SubjectCode = t.Subject.Code, t.SubjectId, t.Id, t.VisitNum, IshaveQCChallenge = t.QCChallengeList.Any(), t.SecondReviewState }) .OrderBy(t => t.IshaveQCChallenge).ThenBy(t => t.SecondReviewState).ThenBy(x => x.IsUrgent).ThenBy(x => x.SubjectCode).ThenBy(x => x.VisitNum).ToListAsync();