diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 1d33c13ab..af9a259f5 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -101,14 +101,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// public string Translationunit(string answerType, ValueUnit? unit, string customUnit, List unitDataList, string? answer) { - if (answer == null|| answer==string.Empty) + if (answer == null || answer == string.Empty) { return string.Empty; } if (answerType == "upload") { - return "❄❅❆❇❈❉❊"+ answer; + return "❄❅❆❇❈❉❊" + answer; } if (unit == ValueUnit.Custom) @@ -231,7 +231,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(item.Entity as Trial, type, x => new InspectionConvertDTO() { TrialId = x.Id, - + ExtraIndentification = extraIdentification, }, new { @@ -281,9 +281,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(entity, type, x => new InspectionConvertDTO() { VisitTaskId = entity.VisitTaskId, - TrialReadingCriterionId=entity.TrialReadingCriterionId, - SubjectVisitId= entity.SubjectVisitId, - SubjectId=entity.SubjectId, + TrialReadingCriterionId = entity.TrialReadingCriterionId, + SubjectVisitId = entity.SubjectVisitId, + SubjectId = entity.SubjectId, TrialId = entity.TrialId, ObjectRelationParentId = entity.VisitTaskId, @@ -549,9 +549,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common ExtraIndentification = extraIdentification - }, new { ParentQuestionShowOrder = parentQuestionShowOrder, - OperatingTime=DateTime.Now, - RelavantQuestionShowOrder = relavantQuestionShowOrder }); + }, new + { + ParentQuestionShowOrder = parentQuestionShowOrder, + OperatingTime = DateTime.Now, + RelavantQuestionShowOrder = relavantQuestionShowOrder + }); } //系统标准表格问题 @@ -1369,9 +1372,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common } else { - isHaveQuestion = await _dbContext.TaskMedicalReview.Where(x => x.Id == entity.TaskMedicalReviewId).Select(t => t.IsHaveQuestion).FirstOrDefaultAsync(); + isHaveQuestion = await _dbContext.TaskMedicalReview.Where(x => x.Id == entity.TaskMedicalReviewId).Select(t => t.IsHaveQuestion).FirstOrDefaultAsync(); } - + var extraIdentification = string.Empty; @@ -1389,13 +1392,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common { IsDistinctionInterface = false, VisitTaskId = entity.VisitTaskId, - + ObjectRelationParentId = entity.TaskMedicalReviewId, ExtraIndentification = extraIdentification - },new { - IsHaveQuestion= isHaveQuestion, + }, new + { + IsHaveQuestion = isHaveQuestion, }); } @@ -2015,7 +2019,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var isDistinctionInterface = true; - var reason = type== AuditOpt.Add? entity.ApplyReason: entity.ResultRemark; + var reason = type == AuditOpt.Add ? entity.ApplyReason : entity.ResultRemark; #region 处理标识 @@ -2109,8 +2113,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common extraIdentification = "/DeleteNoneDicomFileZero"; } - - if(_userInfo.RequestUrl== "QCOperation/addCheckChallengeReply" || _userInfo.RequestUrl == "QCOperation/UploadVisitCheckExcel") + + if (_userInfo.RequestUrl == "QCOperation/addCheckChallengeReply" || _userInfo.RequestUrl == "QCOperation/UploadVisitCheckExcel") { if (entity.CheckChallengeState == CheckChanllengeTypeEnum.CRCWaitPMReply || entity.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply) { @@ -2258,7 +2262,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common { ObjectRelationParentId = x.SubjectVisitId, ExtraIndentification = extraIdentification, - Reason=entity.ModifyReason + Reason = entity.ModifyReason }); } @@ -2278,12 +2282,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common armEnum = await _dbContext.VisitTask.Where(x => x.Id == entity.VisitTaskId).Select(x => x.ArmEnum).FirstOrDefaultAsync(); } - var noneDicomStudy = await _dbContext.NoneDicomStudy.Where(x => x.Id == entity.NoneDicomStudyId).IgnoreQueryFilters().FirstNotNullAsync(); + //var noneDicomStudy = await _dbContext.NoneDicomStudy.FindAsync(entity.NoneDicomStudyId); await InsertInspection(item.Entity as NoneDicomStudyFile, type, x => new InspectionConvertDTO() { - SubjectVisitId = noneDicomStudy.SubjectVisitId, - SubjectId = noneDicomStudy.SubjectId, + //SubjectVisitId = noneDicomStudy.SubjectVisitId, + //SubjectId = noneDicomStudy.SubjectId, ObjectRelationParentId = x.VisitTaskId, ObjectRelationParentId2 = x.NoneDicomStudyId, ObjectRelationParentId3 = x.OriginNoneDicomStudyId, @@ -2523,16 +2527,16 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = item.Entity as ReadingClinicalDataPDF; - string extraIndentification=string.Empty; + string extraIndentification = string.Empty; if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) { - extraIndentification= "/PM"; + extraIndentification = "/PM"; } var clinicalData = await _dbContext.ReadingClinicalData.Where(t => t.Id == entity.ReadingClinicalDataId).FirstOrDefaultAsync(); - if(clinicalData==null) + if (clinicalData == null) { clinicalData = entitys.Where(x => x.Entity.GetType() == typeof(ReadingClinicalData)).Select(x => x.Entity as ReadingClinicalData).FirstOrDefault(); @@ -2549,7 +2553,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var trialReadingCriterionIdList = await _dbContext.TrialClinicalDataSetCriterion.Where(t => t.TrialClinicalDataSetId == clinicalDataTrialSet.Id).Select(t => t.TrialReadingCriterionId).ToListAsync(); - var trialReadingCriterionId=await _dbContext.ReadModule.Where(t => t.Id == clinicalData.ReadingId).Select(t => t.TrialReadingCriterionId).FirstOrDefaultAsync(); + var trialReadingCriterionId = await _dbContext.ReadModule.Where(t => t.Id == clinicalData.ReadingId).Select(t => t.TrialReadingCriterionId).FirstOrDefaultAsync(); //阅片标准 @@ -2753,7 +2757,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common ); } - + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingConsistentClinicalData))) { @@ -3275,14 +3279,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common bool isDistinctionInterface = true; - var customPrefix=string.Empty; + var customPrefix = string.Empty; // 对于一个标记绑定两个问题的不计稽查 var existsMark = await _dbContext.ReadingTaskQuestionMark.AnyAsync(t => t.MarkId == entity.MarkId); // 自定义表格 和问题添加标记的时候 要记录为 添加标记 if ((_userInfo.RequestUrl == "SaveTaskQuestion/-10" - || _userInfo.RequestUrl == "saveTableQuestionMark/-10") && type== "Add"&&!existsMark) + || _userInfo.RequestUrl == "saveTableQuestionMark/-10") && type == "Add" && !existsMark) { isDistinctionInterface = false; customPrefix = "ReadingImageTask/submitCustomTag"; @@ -3302,7 +3306,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common TableQuestionName = tableQuestionName, Answer = answer, LiverSegmentation = liverSegmentation, - },string.Empty, customPrefix); + }, string.Empty, customPrefix); } //保存影像质量 多条记录,只记录一条稽查 @@ -3409,7 +3413,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var markList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionMark)).Select(x => x.Entity as ReadingTaskQuestionMark).ToList(); var questionids = taskQuestionAnswerList.Select(x => x.ReadingQuestionTrialId as Guid?).ToList(); - var mark= markList.Where(x=> questionids.Contains(x.QuestionId)).FirstOrDefault(); + var mark = markList.Where(x => questionids.Contains(x.QuestionId)).FirstOrDefault(); var markName = string.Empty; if (mark != null) { @@ -3420,7 +3424,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common string otherPicturePath = mark != null ? mark.OtherPicturePath : string.Empty; - if (_userInfo.AuditIdentification== "DeleteMark") + if (_userInfo.AuditIdentification == "DeleteMark") { markName = string.Empty; picturePath = string.Empty; @@ -3428,7 +3432,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common } // 这里本来就批量展示问题的 现在又需要单个展示 - var thisQuestinonAnswer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(x => x.Entity as ReadingTaskQuestionAnswer).FirstOrDefault(); + var thisQuestinonAnswer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(x => x.Entity as ReadingTaskQuestionAnswer).FirstOrDefault(); var question = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == thisQuestinonAnswer.ReadingQuestionTrialId).FirstOrDefaultAsync(); @@ -3437,14 +3441,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common if (thisQuestinonAnswer != null) { questionName = _userInfo.IsEn_Us ? question.QuestionEnName : question.QuestionName; - questionAnswer = Translationunit(question.Type, question.Unit, question.CustomUnit, unitDataList, thisQuestinonAnswer.Answer) ; + questionAnswer = Translationunit(question.Type, question.Unit, question.CustomUnit, unitDataList, thisQuestinonAnswer.Answer); } await InsertInspection(cloneEntity, type, x => new InspectionConvertDTO() { VisitTaskId = x.VisitTaskId, - GeneralId = IdentifierHelper.CreateGuid(cloneEntity.VisitTaskId.ToString(), cloneEntity.ReadingQuestionTrialId.ToString(),"ReadingTaskQuestionAnswer"), + GeneralId = IdentifierHelper.CreateGuid(cloneEntity.VisitTaskId.ToString(), cloneEntity.ReadingQuestionTrialId.ToString(), "ReadingTaskQuestionAnswer"), ObjectRelationParentId = x.VisitTaskId, @@ -3457,7 +3461,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common MarkName = markName, PicturePath = picturePath, - OtherPicturePath= otherPicturePath, + OtherPicturePath = otherPicturePath, QuestinonAnswer = questionAnswer, QuestionName = questionName, QuestionAnswerList = taskQuestionAnswerList.Join(quesionList, @@ -3501,8 +3505,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common var markList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionMark)).Select(x => x.Entity as ReadingTaskQuestionMark).ToList(); - - var mark = markList.Where(x => x.RowId== entity.RowId&&x.TableQuestionId==entity.TableQuestionId).FirstOrDefault(); + + var mark = markList.Where(x => x.RowId == entity.RowId && x.TableQuestionId == entity.TableQuestionId).FirstOrDefault(); var markName = string.Empty; if (mark != null) { @@ -3524,19 +3528,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common }, new { - Answer= Translationunit(tableQuestion.Type, tableQuestion.Unit, tableQuestion.CustomUnit, unitDataList, entity.Answer), + Answer = Translationunit(tableQuestion.Type, tableQuestion.Unit, tableQuestion.CustomUnit, unitDataList, entity.Answer), MarkName = markName, PicturePath = mark != null ? mark.PicturePath : string.Empty, QuestionName = questionName, RowMark = rowMark, - TableQuestionName = _userInfo.IsEn_Us ? tableQuestion.QuestionEnName : tableQuestion.QuestionName, + TableQuestionName = _userInfo.IsEn_Us ? tableQuestion.QuestionEnName : tableQuestion.QuestionName, }, _userInfo.AuditIdentification); } - + } - + //病灶这里操作 ReadingTableAnswerRowInfo ReadingTableQuestionAnswer @@ -3602,7 +3606,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common entity.RowMark = entity.OrderMark; - + string extraIdentification = string.Empty; @@ -3917,7 +3921,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common extraIdentification = "/" + (int)entity.ReReadingApplyState; - + break; @@ -3942,7 +3946,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common if (entity.PMBackReason.IsNotNullOrEmpty()) { extraIdentification = "/" + "Reason"; - reason= entity.PMBackReason; + reason = entity.PMBackReason; } break; @@ -4124,7 +4128,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common VisitTaskId = x.Id, IsDistinctionInterface = isDistinctionInterface, - Reason= reason, + Reason = reason, ExtraIndentification = extraIdentification, ObjectRelationParentId = entity.SourceSubjectVisitId != null ? entity.SourceSubjectVisitId : entity.SouceReadModuleId, @@ -4389,7 +4393,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// /// 自定义前缀 某些接口需要用同一个稽查 /// - public string GetInspectionRecordIdentification(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false, string auditIdentification = "",string customPrefix="") + public string GetInspectionRecordIdentification(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false, string auditIdentification = "", string customPrefix = "") { //var entityType = _dbContext.Model.FindEntityType(entityObj.GetType()); //var tableName = entityType.GetTableName();