From 14875dfacc2b7059ed86715732e9c6ded66e8a5f Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Mon, 16 Jun 2025 15:59:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BA=86=E8=A3=81?= =?UTF-8?q?=E5=88=A4=E4=BB=BB=E5=8A=A1=20=E9=98=85=E7=89=87=E6=9C=9F?= =?UTF-8?q?=E4=B8=8D=E8=AE=A9=E5=88=A0=E9=99=A4=E5=92=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReadingPeriod/ReadModuleService.cs | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs index 51e661adf..ffdf23c5d 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs @@ -97,6 +97,29 @@ namespace IRaCIS.Core.Application.Service throw new BusinessValidationFailedException(_localizer["ReadModule_CRCConfirmCanNtoEdit"]); } + var readModule = await _readModuleRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync(); + + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModule.TrialReadingCriterionId).Select(x => new + { + x.ReadingType, + x.IsArbitrationReading, + x.IsReadingPeriod, + x.ArbitrationRule, + x.IsGlobalReading, + x.IsOncologyReading, + }).FirstNotNullAsync(); + + // 如果生成了 访视级别的阅片期裁判 不让修改 + if (criterionInfo.IsArbitrationReading && criterionInfo.IsReadingPeriod && !criterionInfo.IsGlobalReading && criterionInfo.ArbitrationRule == ArbitrationRule.Reading) + { + if (await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == readModule.SubjectVisitId && x.ReadingCategory == ReadingCategory.Judge)) + { + //---当前阅片已生成裁判任务,操作失败。 + throw new BusinessValidationFailedException(_localizer["ReadModule_JudgeTaskGenerated"]); + } + } + + await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new ReadModule() { SubjectVisitId = inDto.SubjectVisitIdId, @@ -1078,6 +1101,15 @@ namespace IRaCIS.Core.Application.Service var readModule = await _readModuleRepository.Where(x => x.Id == readModuleId).FirstNotNullAsync(); + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModule.TrialReadingCriterionId).Select(x => new + { + x.ReadingType, + x.IsArbitrationReading, + x.IsReadingPeriod, + x.ArbitrationRule, + x.IsGlobalReading, + x.IsOncologyReading, + }).FirstNotNullAsync(); if (await _readingClinicalDataRepository.Where(t => t.ReadingId == readModuleId).AnyAsync(t => t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned)) { @@ -1106,6 +1138,17 @@ namespace IRaCIS.Core.Application.Service throw new BusinessValidationFailedException(_localizer["ReadModule_TaskGenerated"]); } + // 如果生成了 访视级别的阅片期裁判 不让删除 + if (criterionInfo.IsArbitrationReading && criterionInfo.IsReadingPeriod && !criterionInfo.IsGlobalReading && criterionInfo.ArbitrationRule == ArbitrationRule.Reading) + { + if (await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == readModule.SubjectVisitId && x.ReadingCategory == ReadingCategory.Judge)) + { + //---当前阅片已生成裁判任务,操作失败。 + throw new BusinessValidationFailedException(_localizer["ReadModule_JudgeTaskGenerated"]); + } + } + + await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => readModuleId == x.SouceReadModuleId, x => new VisitTask() { From c76fc8f05257e26457e636ae16c65e5c748f318e Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Mon, 16 Jun 2025 16:46:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=98=85=E7=89=87?= =?UTF-8?q?=E6=9C=9F=E9=80=89=E6=8B=A9=E8=AE=BF=E8=A7=86=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Reading/ReadingPeriod/ReadModuleService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs index ffdf23c5d..ed95af6ff 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs @@ -67,7 +67,7 @@ namespace IRaCIS.Core.Application.Service var resultlist = await visitQuery.WhereIf(finalVisitNum != null && finalVisitNum != 0, x => x.VisitNum <= finalVisitNum) .Where(x => x.VisitNum > mixReadVisitNum|| x.VisitNum==thisVisitNum) - .Where(x => !x.IsBaseLine) // 排除基线 + //.Where(x => !x.IsBaseLine) // 排除基线 .WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0) .WhereIf(inDto.ReadingSetType == ReadingSetType.ImageReading, x => readModulequery.Where(y => y.Id != inDto.Id && y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() == 0) .Select(x => new GetSubjectReadVisitsOutDto()