diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 9929211b8..c79b2a661 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1269,7 +1269,6 @@ namespace IRaCIS.Core.Application.Service.Allocation var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == trialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsAutoCreate, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync()).IfNullThrowException(); - foreach (var task in taskList) { @@ -1340,7 +1339,7 @@ namespace IRaCIS.Core.Application.Service.Allocation && t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.RequestReReadingType == RequestReReadingType.DocotorApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default)) { //---当前为有序阅片,该受试者已有访视已申请重阅还未处理,暂不能继续申请重阅 - return ResponseOutput.NotOk(_localizer["VisitTask_SequentialReading"]); + throw new BusinessValidationFailedException(_localizer["VisitTask_SequentialReading"]); } @@ -1358,7 +1357,7 @@ namespace IRaCIS.Core.Application.Service.Allocation .AnyAsync(t => t.VisitTaskNum == task.VisitTaskNum)) { //---当前为有序阅片,影像存在问题,项目组已申请回退,暂不能申请重阅 - return ResponseOutput.NotOk(_localizer["VisitTask_ImageProblem"]); + throw new BusinessValidationFailedException(_localizer["VisitTask_ImageProblem"]); } } @@ -1539,19 +1538,30 @@ namespace IRaCIS.Core.Application.Service.Allocation //是否是一致性分析任务 正常申请 会影响一致性分析任务 filterExpression = filterExpression.And(t => t.IsAnalysisCreate == origenalTask.IsAnalysisCreate); + //附加评估 IR 和PM 看到的影响列表不一样 - - //附加评估 IR 和PM 看到的影响列表不一样 //1.1 有附加评估,会影响其他标准的任务 + //1.1 有附加评估,会影响其他标准的任务 if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment) { - if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM) + // PM申请 SPM / CPM审批 + if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.TrialGroupApply && (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM)) { filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); } + //IR 申请 PM审批 else { - filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId); + // 1.1 基线任务影响BM任务 + if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && _subjectVisitRepository.Any(t => t.Id == origenalTask.SourceSubjectVisitId && t.IsBaseLine == true)) + { + filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); + } + // 1.1 非基线任务不影响BM任务 + else + { + filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId); + } } } else @@ -1761,7 +1771,7 @@ namespace IRaCIS.Core.Application.Service.Allocation //有序阅片 if (criterionConfig.IsReadingTaskViewInOrder) - { + { #region 有序 IR 申请 重阅 影响的其他访视查询 @@ -2025,7 +2035,7 @@ namespace IRaCIS.Core.Application.Service.Allocation else { - + //1.当前任务及裁判任务 //2.影响当前阅片人的任务 filterExpression = filterExpression.And(t => t.Id == origenalTask.Id || t.Id == origenalTask.JudgeVisitTaskId); @@ -2225,19 +2235,13 @@ namespace IRaCIS.Core.Application.Service.Allocation Expression> filterExpression = t => t.TrialId == trialId && t.SubjectId == task.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.TaskAllocationState == TaskAllocationState.Allocated; - - //附加评估 IR 和PM 看到的影响列表不一样 + if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment) { - if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM) - { - filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); - } - else - { + //影像退回,必定影响两个标准的任务 + filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); + - filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId); - } } else { @@ -2580,14 +2584,29 @@ namespace IRaCIS.Core.Application.Service.Allocation //附加评估 IR 和PM 看到的影响列表不一样 if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment) { - if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM) - { - filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); - } - else + + // IR 申请 PM 同意 + if (((_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && applyId != null && await _visitTaskReReadingRepository.AnyAsync(t => t.Id == applyId && t.CreateUser.UserTypeEnum == UserTypeEnum.IndependentReviewer)) + || (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && applyId == null))) { - filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId); + // 1.1 基线任务影响BM任务 + if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && _subjectVisitRepository.Any(t=>t.Id==filterObj.SourceSubjectVisitId && t.IsBaseLine==true)) + { + filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); + } + // 1.1 非基线任务不影响BM任务 + else + { + filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId); + } + + } + //(1、PM回退,PM申请重阅,SPM同意回退) + else + { + filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); + } } else @@ -2611,13 +2630,30 @@ namespace IRaCIS.Core.Application.Service.Allocation { - + //if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment) + //{ + // if(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) + // { + // filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); + // } + // else + // { + // filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId); + // } - //当前任务及其之后的所有访视任务、全局任务、裁判任务、肿瘤学阅片任务 + //} + //else + //{ + // //默认影响的都是该标准的任务 + // filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId); + //} - //有序 - if (criterionConfig.IsReadingTaskViewInOrder) + + //当前任务及其之后的所有访视任务、全局任务、裁判任务、肿瘤学阅片任务 + + //有序 + if (criterionConfig.IsReadingTaskViewInOrder) { switch (filterObj.ReadingCategory) diff --git a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs index d34d74da1..11194fc09 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs @@ -144,6 +144,7 @@ namespace IRaCIS.Core.Application.ViewModel public string Value { get; set; } = string.Empty; public string ValueCN { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; + public string DescriptionCN { get; set; } = string.Empty; public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } public DateTime UpdateTime { get; set; } diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs index 03049fff2..dfd96079c 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -375,8 +375,10 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public string CreateUserRealName { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; + public string DescriptionCN { get; set; } = string.Empty; public string ModuleTypeName { get; set; } = string.Empty; + public string ModuleTypeNameCN { get; set; } = string.Empty; public string SignText { get; set; } = string.Empty; @@ -386,6 +388,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public bool? InPlan { get; set; } public string OptType { get; set; } = string.Empty; + public string OptTypeCN { get; set; } = string.Empty; public Guid? FrontAuditConfigId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 8daf7cccd..f257b22dd 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -17,6 +17,7 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share.Management; using System.Text.Json.Nodes; using IRaCIS.Application.Contracts; +using IRaCIS.Core.Infrastructure.Extention; namespace IRaCIS.Core.Application.Service { @@ -767,7 +768,7 @@ namespace IRaCIS.Core.Application.Service //处理动态翻译 会在数组中提供 一个属性 “DictionaryCode” 这个是默认约束,做稽查的时候记得注意,免得配置麻烦 - var dynamicTranslateInfoList = tableConfigList.Where(t => t.IsDynamicTranslate && t.IsList).Select(t => new { t.ListName, t.ColumnValue }).Distinct().ToList(); + var dynamicTranslateInfoList = tableConfigList.Where(t => t.IsDynamicTranslate && t.IsList).Select(t => new { t.ListName, t.ColumnValue }).Distinct().ToList(); var dynamicDictionaryNameList = new List(); @@ -780,6 +781,19 @@ namespace IRaCIS.Core.Application.Service dynamicDictionaryNameList = dynamicDictionaryNameList.Distinct().ToList(); } + var specialDynamicColumnValueList = new List(); + if (tableConfigList.Any(t => t.IsDynamicTranslate && t.IsList == false)) + { + // 兼容之前数组的那种方式 实际配置只会配置一条 + specialDynamicColumnValueList = tableConfigList.Where(t => t.IsDynamicTranslate && t.IsList == false) + .Select(t => t.ColumnValue ).Distinct().ToList(); + + var dicNames= arrays.Where(t=>!string.IsNullOrEmpty( t["DictionaryCode"].ToString()) ).Select(t => t["DictionaryCode"].ToString()).Distinct().ToList(); + + dictionaryNameList.AddRange(dicNames); + } + + var allDictionaryNameList = dictionaryNameList.Union(dynamicDictionaryNameList).Distinct(); @@ -801,6 +815,12 @@ namespace IRaCIS.Core.Application.Service jsonObject[translateInfo.ColumnValue] = translateDataList[translateInfo.TranslateDictionaryName].Where(t => t.Code.ToLower() == jsonObject[translateInfo.ColumnValue]?.ToString().ToLower()).Select(t => t.ValueCN).FirstOrDefault(); } + foreach (var specialDynamicColumnValue in specialDynamicColumnValueList) + { + jsonObject[specialDynamicColumnValue] = + translateDataList[jsonObject["DictionaryCode"].ToString()].Where(t => t.Code.ToLower() == jsonObject[specialDynamicColumnValue]?.ToString().ToLower()).Select(t => t.ValueCN).FirstOrDefault(); + } + //处理动态翻译 foreach (var dynamicTranslateInfo in dynamicTranslateInfoList) @@ -818,7 +838,7 @@ namespace IRaCIS.Core.Application.Service var dicName = innerObject["DictionaryCode"]?.ToString(); - if(dicName!=null && !string.IsNullOrEmpty(dicName)) + if (dicName != null && !string.IsNullOrEmpty(dicName)) { innerObject[dynamicTranslateInfo.ColumnValue] = translateDataList[dicName].Where(t => t.Code.ToLower() == innerObject[dynamicTranslateInfo.ColumnValue].ToString().ToLower()).Select(t => t.ValueCN).FirstOrDefault(); @@ -827,7 +847,7 @@ namespace IRaCIS.Core.Application.Service } - jsonObject[dynamicTranslateInfo.ListName] = JToken.FromObject(innberJsonList) ; + jsonObject[dynamicTranslateInfo.ListName] = JToken.FromObject(innberJsonList); } @@ -1170,8 +1190,8 @@ namespace IRaCIS.Core.Application.Service [HttpGet] public async Task> GetModuleTypeDescriptionList(Guid moduleTypeId) { - var result = await _frontAuditConfigRepository.Where(x => x.ModuleTypeId == moduleTypeId && x.ObjectTypeId != null && x.OptTypeId != null && x.Description.Length > 0).Select(x => new { x.Description, x.Sort }).OrderBy(t => t.Sort).ToListAsync(); - return result.Select(t => t.Description).Distinct().ToList(); + var result = await _frontAuditConfigRepository.Where(x => x.ModuleTypeId == moduleTypeId && x.ObjectTypeId != null && x.OptTypeId != null && x.Description.Length > 0).Select(x => new { x.Description, x.DescriptionCN, x.Sort }).OrderBy(t => t.Sort).Select(t => _userInfo.IsEn_Us? t.Description:t.DescriptionCN).Distinct().ToListAsync(); + return result; } /// @@ -1200,6 +1220,7 @@ namespace IRaCIS.Core.Application.Service CreateTime = data.CreateTime, CreateUserId = data.CreateUserId, Description = data.Description, + DescriptionCN=data.DescriptionCN, IsConfig = data.IsConfig, IsEnable = data.IsEnable, ModuleTypeId = data.ModuleTypeId, diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index 4ce983a98..7aed50550 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -138,7 +138,11 @@ namespace IRaCIS.Core.Application.Service.Inspection ResearchProgramNo = leftrial.ResearchProgramNo, ObjectTypeId = data.ObjectTypeId, Description = leftfrontAuditConfig.Description, - ModuleTypeName = leftmoduleTypec.ValueCN, + DescriptionCN=leftfrontAuditConfig.DescriptionCN, + + ModuleTypeName = leftmoduleTypec.Value, + ModuleTypeNameCN=leftmoduleTypec.ValueCN, + SignText = lefttrialSign.SignText, Identification = leftfrontAuditConfig.Identification, FrontAuditConfigId = leftfrontAuditConfig.Id, @@ -149,6 +153,7 @@ namespace IRaCIS.Core.Application.Service.Inspection //IsFrontAdd=data.IsFrontAdd, BatchId = data.BatchId, OptType = leftOptType.Value, + OptTypeCN = leftOptType.ValueCN, ObjectRelationParentId = data.ObjectRelationParentId, GeneralId = data.GeneralId, diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs index 7819c196b..6c41c6688 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs @@ -585,10 +585,11 @@ namespace IRaCIS.Core.Application.Service TrialId = inDto.TrialId, TaskIdList = new List() { - visitTaskId - + visitTaskId } }); + + await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(x => !x.IsClosedDialog && x.Id == inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { IsClosedDialog = true, @@ -598,9 +599,7 @@ namespace IRaCIS.Core.Application.Service IsApplyHeavyReading = true, FileName = inDto.FileName, ImagePath = JsonConvert.SerializeObject(inDto.FileList), - DisagreeReason = inDto.DisagreeReason, - - + DisagreeReason = inDto.DisagreeReason, }); } diff --git a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs index 535bee927..1604fa680 100644 --- a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs +++ b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs @@ -24,6 +24,8 @@ namespace IRaCIS.Core.Domain.Models public string Description { get; set; } = String.Empty; + public string DescriptionCN { get; set; } = String.Empty; + public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 84dadffff..bfed26f00 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -2375,11 +2375,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common //保存影像质量 多条记录,只记录一条稽查 if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer))) { - // 保存影像质量 、 修改整体肿瘤评估结果 、 非dicom 保存访视阅片结果 + // 保存影像质量 、 修改整体肿瘤评估结果 、 非dicom 保存访视阅片结果 、附加评估 if (_userInfo.RequestUrl == "ReadingImageTask/changeDicomReadingQuestionAnswer" || _userInfo.RequestUrl == "ReadingImageTask/saveImageQuality" || _userInfo.RequestUrl == "ReadingImageTask/saveVisitTaskQuestions" - || _userInfo.RequestUrl == "ReadingImageTask/changeCalculationAnswer") + || _userInfo.RequestUrl == "ReadingImageTask/changeCalculationAnswer" + || _userInfo.RequestUrl == "ReadingImageTask/submitTaskAdditionalQuestion") { var type = AuditOpt.Add; @@ -2389,7 +2390,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var taskQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(t => t.Entity as ReadingTaskQuestionAnswer).ToList(); //获取问题名称 组合成数组 - var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => taskQuestionAnswerList.Select(k => k.ReadingQuestionTrialId).Contains(t.Id)).Select(t => new + var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => taskQuestionAnswerList.Select(k => k.ReadingQuestionTrialId).Contains(t.Id)).IgnoreQueryFilters().Select(t => new { t.QuestionName, QuestionId = t.Id,