diff --git a/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs b/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs index 11159c5cd..eaa357c55 100644 --- a/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs +++ b/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs @@ -9,7 +9,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using static BeetleX.Redis.Commands.HSCAN; using static IRaCIS.Core.Application.Service.Common.SystemMonitor; namespace IRaCIS.Core.Application.Helper diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj b/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj index 72dc549f8..ab2113cba 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj @@ -63,10 +63,10 @@ - + + - - + @@ -74,22 +74,22 @@ - - - + + + - + true - + - + diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index ef44e414d..2b89f02a7 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -543,9 +543,19 @@ + + + 项目列表导出---new + + + + + + + - getDocumentConfirmList 培训记录导出 + getDocumentConfirmList 培训记录导出--new diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 4898ac25c..f9c504632 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -290,7 +290,7 @@ namespace IRaCIS.Core.Application.Service.Allocation { foreach (var command in cancelCommand.CancelList.Where(t => t.IsCancelAssign)) { - if (await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == cancelCommand.TrialReadingCriterionId && t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState != ReadingTaskState.WaitReading)) + if (await _visitTaskRepository.AnyAsync(t => t.TaskState==TaskState.Effect && t.TrialReadingCriterionId == cancelCommand.TrialReadingCriterionId && t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState != ReadingTaskState.WaitReading)) { //---当前医生已开始做该Subject 该标准的任务,不允许取消分配 throw new BusinessValidationFailedException(_localizer["VisitTask_DoctorConfigNotFound"]); diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index 8ae10c42c..00dc9b3ef 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -104,7 +104,7 @@ namespace IRaCIS.Core.Application.Service CreateMap().IncludeBase() - .ForMember(o => o.IsHaveReading, t => t.MapFrom(u => u.Subject.SubjectVisitTaskList.Any(t => t.ReadingTaskState != ReadingTaskState.WaitReading && t.TrialReadingCriterionId==u.TrialReadingCriterionId && t.DoctorUserId==u.DoctorUserId))); + .ForMember(o => o.IsHaveReading, t => t.MapFrom(u => u.Subject.SubjectVisitTaskList.Any(t => t.ReadingTaskState != ReadingTaskState.WaitReading && t.TrialReadingCriterionId==u.TrialReadingCriterionId && t.DoctorUserId==u.DoctorUserId && t.TaskState == TaskState.Effect))); CreateMap(); diff --git a/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs b/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs index 0171c67c2..59038b64f 100644 --- a/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs @@ -119,7 +119,7 @@ namespace IRaCIS.Core.Application.Service var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, dbbeforeEntity.Path); - if (File.Exists(filePath)) + if (File.Exists(filePath) && dbbeforeEntity.Path!=addOrEditCommonDocument.Path) { File.Delete(filePath); } diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index bea2328b0..f3c6f7f5b 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -16,6 +16,7 @@ using MiniExcelLibs; using MiniExcelLibs.OpenXml; using NPOI.HPSF; using NPOI.HSSF.UserModel; +using NPOI.SS.Formula.Functions; using NPOI.XSSF.UserModel; using System; using System.Collections.Generic; @@ -615,9 +616,9 @@ namespace IRaCIS.Core.Application.Service.Common .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) // CRC 只负责他管理site的受试者 - .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id)) + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id)) .ProjectTo(_mapper.ConfigurationProvider) - .WhereIf(inQuery.IsMissingImages == true, t => t.MissingSubmmitCount> 0) + .WhereIf(inQuery.IsMissingImages == true, t => t.MissingSubmmitCount > 0) .WhereIf(inQuery.IsMissingImages == false, t => t.MissingSubmmitCount == 0) ; @@ -1041,7 +1042,7 @@ namespace IRaCIS.Core.Application.Service.Common [FromServices] IRepository _trialRepository) { var list = await _repository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false) - //.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null) + //.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null) .WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState) .WhereIf(queryVisitTask.ArmEnum != null, t => t.ArmEnum == queryVisitTask.ArmEnum) @@ -1440,7 +1441,7 @@ namespace IRaCIS.Core.Application.Service.Common list.Add(new ExportDocumentDes() { Code = StaticData.Export.PCWG3Point1DetailedOfEvaluatedLesion_Export, ExportCatogory = ExportCatogory.DetailedOfEvaluatedLesion }); } - var result = _repository.Where(t => list.Select(c => c.Code).Contains(t.Code)).Select(c => new ExportDocumentDes() { Code = c.Code, FileName = c.Name }).ToList(); + var result = _repository.Where(t => list.Select(c => c.Code).Contains(t.Code)).Select(c => new ExportDocumentDes() { Code = c.Code, FileName = _userInfo.IsEn_Us ? c.Name : c.NameCN }).ToList(); foreach (var item in list) { @@ -1451,63 +1452,156 @@ namespace IRaCIS.Core.Application.Service.Common public List DealJudgeMark(ArbitrationRule arbitrationRule, IEnumerable list) where T : OverallTumorEvaluationExport { - //处理裁判标记 - - var resultList = list.Where(t => t.ReadingCategory != ReadingCategory.Judge).ToList(); + //处理访视任务的裁判标记 + var resultExceptJudgeList = list.Where(t => t.ReadingCategory != ReadingCategory.Judge).ToList(); + var judegeList = list.Where(t => t.ReadingCategory == ReadingCategory.Judge).ToList(); if (arbitrationRule == ArbitrationRule.Visit) { - foreach (var item in resultList) + foreach (var item in resultExceptJudgeList) { - item.IsGenerateJudge = list.FirstOrDefault(t => t.ReadingCategory == ReadingCategory.Judge && t.SubjectCode == item.SubjectCode + item.IsGenerateJudge = judegeList.FirstOrDefault(t => t.SubjectCode == item.SubjectCode && (t.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Judge]) == item.VisitTaskNum)?.JudgeArmEnum == item.ArmEnum ? true : false; } + //如果没有产生裁判,默认选择R1 + + //找到没有裁判的访视任务 + var notJudgeList = resultExceptJudgeList.GroupBy(t => new { t.SubjectCode, t.VisitTaskNum }).Where(g => g.All(t => t.IsGenerateJudge == false)).Select(g => new { g.Key.SubjectCode, g.Key.VisitTaskNum }).ToList(); + + foreach (var item in resultExceptJudgeList) + { + if (notJudgeList.Any(t => t.SubjectCode == item.SubjectCode && t.VisitTaskNum == item.VisitTaskNum) && item.ArmEnum == Arm.DoubleReadingArm1) + { + item.IsGenerateJudge = true; + } + } + } if (arbitrationRule == ArbitrationRule.Reading) { - //先确定裁判选定的是谁 - foreach (var item in resultList) + //处理访视裁判标记 + foreach (var visitItem in resultExceptJudgeList.Where(t => t.ReadingCategory == ReadingCategory.Visit)) { - //以最后一次裁判为准 找到最大的裁判的裁判选择的Arm,相同就设置裁判标记 - item.IsGenerateJudge = list.Where(t => t.ReadingCategory == ReadingCategory.Judge && t.SubjectCode == item.SubjectCode && t.VisitTaskNum > item.VisitTaskNum - ).OrderByDescending(t => t.VisitTaskNum).FirstOrDefault()?.JudgeArmEnum == item.ArmEnum ? true : false; + //默认设置为false 只处理为true 和 空的情况 + visitItem.IsGenerateJudge = false; - } - //全局裁判了,选择了那个全局,那么对应全局下面的访视 设置裁判标记 - foreach (var item in resultList.Where(t => t.ReadingCategory == ReadingCategory.Visit)) - { + if (judegeList.Count > 0) + { - var selectJudegeGlobalList = resultList.Where(t => t.ReadingCategory == ReadingCategory.Global && t.IsGenerateJudge == true).ToList(); + var maxFinishedJudge = judegeList.Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned).FirstOrDefault(); - //全局修改了答案,那么给访视上赋值全局的结果 并且取的是最后的全局 - var existGlobalAnswer = selectJudegeGlobalList.Where(t => t.SubjectCode == item.SubjectCode).SelectMany(t => t.GlobalTaskAnswerList).Where(t => t.VisitTaskId == item.Id) - .OrderByDescending(t => t.GlobalTaskVisitNum).FirstOrDefault()?.Answer; + var maxNotFinishedJudge = judegeList.Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned).FirstOrDefault(); - item.OverallTumorEvaluationResult = string.IsNullOrEmpty(existGlobalAnswer) ? item.OverallTumorEvaluationResult : existGlobalAnswer; + if (maxFinishedJudge == null && maxNotFinishedJudge != null) + { + //仅有一个未完成的全局裁判,那么都是null + if (visitItem.VisitTaskNum < maxNotFinishedJudge.VisitTaskNum) + { + visitItem.IsGenerateJudge = null; + } + } + else if (maxFinishedJudge != null && maxNotFinishedJudge == null) + { + //全局裁判都完成了,那么以最后一次裁判选择的为准 - item.IsGenerateJudge = true; - } + if (visitItem.ArmEnum == maxFinishedJudge.JudgeArmEnum && visitItem.VisitTaskNum < maxFinishedJudge.VisitTaskNum) + { + visitItem.IsGenerateJudge = true; + } + + else if (visitItem.ArmEnum == Arm.DoubleReadingArm1) + { + visitItem.IsGenerateJudge = true; + } + } + else + { + //两个都不为null 肯定是不同的裁判 + + //在完成裁判之后的,和未完成裁判之前的 + if (visitItem.VisitTaskNum < maxNotFinishedJudge.VisitTaskNum && visitItem.VisitTaskNum > maxFinishedJudge.VisitTaskNum) + { + visitItem.IsGenerateJudge = null; + } + + else if (visitItem.ArmEnum == maxFinishedJudge.JudgeArmEnum && visitItem.VisitTaskNum < maxFinishedJudge.VisitTaskNum) + { + visitItem.IsGenerateJudge = true; + } + + else if (visitItem.ArmEnum == Arm.DoubleReadingArm1) + { + visitItem.IsGenerateJudge = true; + } + + } + } + else + { + //不存在裁判 将R1设置 + if (visitItem.ArmEnum == Arm.DoubleReadingArm1) + { + visitItem.IsGenerateJudge = true; + } + } + #region 全局的维度考虑 - } + //// 该阅片人 subject 已完成的最大的全局(全局都是已完成的任务,裁判可能完成了,可能没完成) + //var subjectMaxGlobal = resultExceptJudgeList.Where(t => t.ReadingCategory == ReadingCategory.Global && t.SubjectCode == item.SubjectCode && t.ArmEnum == item.ArmEnum).OrderByDescending(t => t.VisitTaskNum).FirstOrDefault(); - //如果没有产生裁判,默认选择R1 + ////没有全局 + //if (subjectMaxGlobal == null) + //{ + // //这个时候肯定没有裁判 默认选择R1 - //找到没有裁判的访视任务 - var notJudgeList = resultList.GroupBy(t => new { t.SubjectCode, t.VisitTaskNum }).Where(g => g.All(t => t.IsGenerateJudge == false)).Select(g => new { g.Key.SubjectCode, g.Key.VisitTaskNum }).ToList(); + // if (item.ArmEnum == Arm.DoubleReadingArm1) + // { + // item.IsGenerateJudge = true; + // } - foreach (var item in resultList) - { - if (notJudgeList.Any(t => t.SubjectCode == item.SubjectCode && t.VisitTaskNum == item.VisitTaskNum) && item.ArmEnum == Arm.DoubleReadingArm1) - { - item.IsGenerateJudge = true; + + //} + ////有全局 + //else + //{ + // //判断当前受试者已完成的最大的全局是否有裁判 + // var existSubjectMaxGlobalJudge = judegeList.Where(t => t.SubjectCode == item.SubjectCode && t.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Judge] == subjectMaxGlobal.VisitTaskNum).FirstOrDefault(); + + // //最大的全局没有裁判(有一个做完了,有一个没做,或者都做完了,没产生裁判) + // if (existSubjectMaxGlobalJudge == null) + // { + // //找到最大的全局裁判 + // var maxJudgedGlobal= judegeList.Where(t => t.SubjectCode == item.SubjectCode ).OrderByDescending(t => t.VisitTaskNum).FirstOrDefault(); + + + // } + // else + // { + // //将该裁判选择的全局的阅片人之前的裁判标记都设置为是 + + // //是否是裁判选择的 + // if (item.ArmEnum == existSubjectMaxGlobalJudge.JudgeArmEnum) + // { + // //是否是裁判选择之前的 + // if (item.VisitTaskNum < existSubjectMaxGlobalJudge.VisitTaskNum) + // { + // item.IsGenerateJudge = true; + + // } + // } + + // } + + //} + + #endregion } } - - return resultList; + return resultExceptJudgeList; } @@ -1539,8 +1633,10 @@ namespace IRaCIS.Core.Application.Service.Common throw new Exception(_localizer["ExcelExport_UnsupportedExport"]); } - var list = await _repository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingTaskState == ReadingTaskState.HaveSigned) + var list = await _repository.Where(t => t.TrialId == queryVisitTask.TrialId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect) + //访视和全局查询已签名完成的,裁判可以是未签名,未完成的 + .Where(t => (t.ReadingTaskState == ReadingTaskState.HaveSigned && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Judge)) //.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId) //.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState) //.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis) @@ -1667,10 +1763,6 @@ namespace IRaCIS.Core.Application.Service.Common var query = _repository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingTaskState == ReadingTaskState.HaveSigned) - //.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId) - //.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState) - //.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis) - .WhereIf(queryVisitTask.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == queryVisitTask.TrialReadingCriterionId) .WhereIf(queryVisitTask.TrialSiteId != null, t => t.Subject.TrialSiteId == queryVisitTask.TrialSiteId) diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index e1c0a65ad..f71f70f4a 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -322,7 +322,7 @@ namespace IRaCIS.Application.Services }; - await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.UnloginUseEmailResetPassword, messageToSend, emailConfigFunc); + await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.ReviewerLogin, messageToSend, emailConfigFunc); //此时不知道用户 var sucessHandle = GetEmailSuccessHandle(Guid.Empty, verificationCode, emailAddress); diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 759578cd3..795cb8553 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -16,7 +16,6 @@ using EasyCaching.Core; using IRaCIS.Core.Application.Contracts; using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO; using IRaCIS.Core.Application.Auth; -using BeetleX.Redis.Commands; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Application.Helper; diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 7740b145b..d5981a4a3 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -935,6 +935,9 @@ namespace IRaCIS.Core.Application.Contracts public string SubjectCode { get; set; } = String.Empty; public Guid Id { get; set; } + + public Guid DoctorUserId { get; set; } + public string TaskName { get; set; } public string TaskBlindName { get; set; } @@ -947,6 +950,8 @@ namespace IRaCIS.Core.Application.Contracts public Arm ArmEnum { get; set; } public string UserName { get; set; } + public ReadingTaskState ReadingTaskState { get; set; } + public ReadingCategory ReadingCategory { get; set; } [DictionaryTranslateAttribute("ExistDisease", CriterionType.RECIST1Point1, nameof(OverallTumorEvaluationExport.IsBaseline), "true")] @@ -961,15 +966,17 @@ namespace IRaCIS.Core.Application.Contracts public Arm? JudgeArmEnum { get; set; } + //public Guid? JudgeResultTaskId { get; set; } + //根据裁判的任务结果 设置访视任务的这个字段 该字段表示 裁判认同该任务的结果 [DictionaryTranslateAttribute("YesOrNo")] - public bool IsGenerateJudge { get; set; } + public bool? IsGenerateJudge { get; set; } - [JsonIgnore] + //[JsonIgnore] - public List GlobalTaskAnswerList { get; set; } + //public List GlobalTaskAnswerList { get; set; } } diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index d9c9aa987..b1bfd53c1 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -192,15 +192,14 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.OverallTumorEvaluationResult, t => t.MapFrom(u => criterionType == CriterionType.RECIST1Point1 ?( u.SourceSubjectVisit.IsBaseLine==true ? u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.ExistDisease).FirstOrDefault()!.Answer: - u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).FirstOrDefault()!.Answer) + u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).Select(t=>t.IsGlobalChange?t.GlobalChangeAnswer:t.Answer).FirstOrDefault()) : criterionType == CriterionType.PCWG3 ? u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.SiteVisitForTumorEvaluation).FirstOrDefault()!.Answer : String.Empty )) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code)) .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)) - .ForMember(o => o.GlobalTaskAnswerList, t => t.MapFrom(u => u.GlobalVisitResultList.Where(t=>t.GlobalAnswerType== GlobalAnswerType.Question) - .Select(c=>new GlobalAnswerInfo() { GlobalTaskVisitNum=c.VisitTask.VisitTaskNum,VisitTaskId=c.TaskId ,Answer=c.Answer}))) + //.ForMember(o => o.GlobalTaskAnswerList, t => t.MapFrom(u => u.GlobalVisitResultList.Where(t=>t.GlobalAnswerType== GlobalAnswerType.Question).Select(c=>new GlobalAnswerInfo() { GlobalTaskVisitNum=c.VisitTask.VisitTaskNum,VisitTaskId=c.TaskId ,Answer=c.Answer}))) ; diff --git a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs index e6b07c261..82f19867c 100644 --- a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs +++ b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs @@ -442,9 +442,9 @@ namespace IRaCIS.Core.Application.Service join subjectCriteriaEvaluationVisitFilter in _subjectCriteriaEvaluationVisitFilterRepository .Where(t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) - .WhereIf(inQuery.ImageDeterminationResultState != null, t => t.ImageDeterminationResultState == inQuery.ImageDeterminationResultState) - .WhereIf(inQuery.ImageFilterState != null, t => t.ImageFilterState == inQuery.ImageFilterState) - .WhereIf(inQuery.IsGeneratedTask != null, t => t.IsGeneratedTask == inQuery.IsGeneratedTask) + .WhereIf(inQuery.ImageDeterminationResultState != null, t => t.ImageDeterminationResultState == inQuery.ImageDeterminationResultState) + .WhereIf(inQuery.ImageFilterState != null, t => t.ImageFilterState == inQuery.ImageFilterState) + .WhereIf(inQuery.IsGeneratedTask != null, t => t.IsGeneratedTask == inQuery.IsGeneratedTask) on subjectVisit.Id equals subjectCriteriaEvaluationVisitFilter.SubjectVisitId //into d from subjectCriteriaEvaluationVisitFilter in d.DefaultIfEmpty() @@ -687,7 +687,7 @@ namespace IRaCIS.Core.Application.Service var subjectVisit = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == command.SubjectVisitId); //仅仅影响该标准自己的任务 - Expression> filterExpression = t => t.TrialId == command.TrialId && t.SubjectId == command.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated + Expression> filterExpression = t => t.TrialId == command.TrialId && t.SubjectId == command.SubjectId && t.TaskState == TaskState.Effect /*&& t.TaskAllocationState == TaskAllocationState.Allocated*/ && t.TrialReadingCriterionId == command.TrialReadingCriterionId; //有序 diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs index f33e41df5..aa9c99440 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs @@ -12,7 +12,6 @@ using System.Linq.Dynamic.Core; using Microsoft.Extensions.Logging; using IRaCIS.Core.Infrastructure.Extention; using System.Linq; -using BeetleX.Redis.Commands; using NPOI.SS.Formula.Functions; namespace IRaCIS.Application.Services diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs index b0e1be07c..a29e92960 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs @@ -145,9 +145,21 @@ namespace IRaCIS.Core.Application.Service await client.AddRequestAsync(new DicomCEchoRequest()); - await client.SendAsync(); + // 创建一个超时任务,设置超时时间为1秒 + var timeoutTask = Task.Delay(TimeSpan.FromSeconds(3)); + + // 发送 DICOM 请求 + var sendTask = client.SendAsync(); + + // 等待任务完成,若超时任务先完成则抛出超时异常 + if (await Task.WhenAny(sendTask, timeoutTask) == timeoutTask) + { + throw new TimeoutException("DICOM 请求超时。"); + } + find.IsTestOK = true; + await _dicomAERepository.SaveChangesAsync(); return true;