From 073ab6b16b425969bffff871291db0fc9dd860e9 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 23 Feb 2023 18:06:31 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A8=BD=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 22 +++++ .../Common/AuditingData.cs | 99 ++++++++++++++++--- 2 files changed, 107 insertions(+), 14 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 744bf86e9..16c5b2608 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -254,6 +254,13 @@ 访视读片任务 + + + 设置任务加急 + + + + Subject 任务类型 统计 +分配情况 @@ -5962,6 +5969,11 @@ 传了Id 就不查询这条数据 + + + 加急类型 + + 阅片工具 @@ -10444,6 +10456,16 @@ 后台查询模型 + + + 加急类型 + + + + + 任务加急备注 + + 文件名称 diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 7b1a2767c..047af8fc5 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -8,6 +8,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; using Newtonsoft.Json; +using SharpCompress.Common; using System; using System.Collections.Generic; using System.Linq; @@ -137,14 +138,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common //trialDics = await this._dbContext.Dictionary.Where(x => dictionaryIds.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync(); - + Guid id = entity.Id; - var oldentity = await _dbContext.Trial.Where(x => x.Id == id).Select(t => new { t.IsTrialBasicLogicConfirmed, t.IsTrialProcessConfirmed, - t.IsTrialUrgentConfirmed ,t.IsConfigureEmail}).FirstOrDefaultAsync(); + var oldentity = await _dbContext.Trial.Where(x => x.Id == id).Select(t => new + { + t.IsTrialBasicLogicConfirmed, + t.IsTrialProcessConfirmed, + t.IsTrialUrgentConfirmed, + t.IsConfigureEmail + }).FirstOrDefaultAsync(); switch (_userInfo.RequestUrl) { case "configTrialBasicInfo/ConfigTrialBasicInfoConfirm": - extraIdentification= $"/{oldentity.IsTrialBasicLogicConfirmed.ToString()}"; + extraIdentification = $"/{oldentity.IsTrialBasicLogicConfirmed.ToString()}"; break; case "configTrialBasicInfo/ConfigTrialUrgentInfoConfirm": @@ -153,7 +159,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common case "TrialEmailNoticeConfig/setTrialEmail": - extraIdentification = oldentity.IsConfigureEmail? "/EmailUpdate" : "/EmailSave"; + extraIdentification = oldentity.IsConfigureEmail ? "/EmailUpdate" : "/EmailSave"; break; } @@ -161,7 +167,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(item.Entity as Trial, type, x => new InspectionConvertDTO() { TrialId = x.Id, - ExtraIndentification= extraIdentification, + ExtraIndentification = extraIdentification, }, new { //TrialDicList = string.Join(",", trialDics) @@ -248,7 +254,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common //保存肿瘤学配置哪里 强行要将 评估结果(中间字典表的多条数据)存到标准稽查上 - var dicIdList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingCriterionDictionary)).Select(t => t.Entity as ReadingCriterionDictionary).Where(t=>t.CriterionId==entity.Id).Select(t=>t.DictionaryId).ToList(); + var dicIdList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingCriterionDictionary)).Select(t => t.Entity as ReadingCriterionDictionary).Where(t => t.CriterionId == entity.Id).Select(t => t.DictionaryId).ToList(); var dicValueList = new List(); if (dicIdList.Count() == 0) @@ -257,7 +263,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common } else { - dicValueList = await _dbContext.Dictionary.Where(t => dicIdList.Contains(t.Id) ).Select(t => t.Value).ToListAsync(); + dicValueList = await _dbContext.Dictionary.Where(t => dicIdList.Contains(t.Id)).Select(t => t.Value).ToListAsync(); } @@ -274,7 +280,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common }, new { EvaluationResultTypes = dicValueList.Count > 0 ? string.Join(",", dicValueList) : string.Empty - }) ; + }); } //系统标准问题 @@ -844,6 +850,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common + #region QC 质疑 一致性核查 + // Qc 问题答案 @@ -1038,6 +1046,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common }); } + #endregion // 中心调研表 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSiteSurvey))) @@ -1883,10 +1892,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common // 保存影像质量 、 修改整体肿瘤评估结果 、 非dicom 保存访视阅片结果 if (_userInfo.RequestUrl == "ReadingImageTask/changeDicomReadingQuestionAnswer" || _userInfo.RequestUrl == "ReadingImageTask/saveImageQuality" - || _userInfo.RequestUrl == "ReadingImageTask/saveVisitTaskQuestions") + || _userInfo.RequestUrl == "ReadingImageTask/saveVisitTaskQuestions" + || _userInfo.RequestUrl == "ReadingImageTask/changeCalculationAnswer") { var type = AuditOpt.Add; + var extraIdentification = string.Empty; + //具体的答案 var taskQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(t => t.Entity as ReadingTaskQuestionAnswer).ToList(); @@ -1896,7 +1908,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common t.QuestionName, QuestionId = t.Id, t.DictionaryCode, - t.ShowOrder + t.ShowOrder, + AnswerType = t.Type, }).OrderBy(t => t.ShowOrder).ToListAsync(); @@ -1904,9 +1917,56 @@ namespace IRaCIS.Core.Infra.EFCore.Common var cloneEntity = firstEntity.Clone(); + + + //保证Id 唯一 cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.ReadingQuestionCriterionTrialId.ToString(), firstEntity.ReadingQuestionTrialId.ToString(), firstEntity.VisitTaskId.ToString()); + + dynamic tableQuesionAndAnswerList = null; + //自定义特有标识 + if (await _dbContext.ReadingQuestionCriterionTrial.AnyAsync(t => t.Id == firstEntity.ReadingQuestionCriterionTrialId && t.CriterionType == CriterionType.SelfDefine)) + { + extraIdentification = "/Self"; + + //还会把病灶问题答案更新 + + var tableQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(t => t.Entity as ReadingTableQuestionAnswer).ToList(); + + + //获取表格问题名称 组合成数组 + var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t => + new + { + TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id + Type = t.ReadingQuestionTrial.QuestionName, //病灶类型 + t.ReadingQuestionTrial.Unit, + t.ReadingQuestionTrial.CustomUnit, + t.DictionaryCode, + t.QuestionName, + QuestionId = t.Id, + t.ShowOrder, + AnswerType= t.Type, + }) + .OrderBy(t => t.ShowOrder).ToListAsync(); + + tableQuesionAndAnswerList = tableQuestionAnswerList.Join(tableQuesionList, t => t.TableQuestionId, u => u.QuestionId, (t, u) => + new + { + //如果问题类型是附件 特殊处理 方便前端解析 + Answer= u.AnswerType== "upload"? "❄❅❆❇❈❉❊" +t.Answer:t.Answer, + u.QuestionName, + u.DictionaryCode, + u.ShowOrder, + t.RowId + } + ).OrderBy(t => t.RowId).ThenBy(t=>t.ShowOrder).ToList(); + + + + } + await InsertInspection(cloneEntity, type, x => new InspectionConvertDTO() { VisitTaskId = x.VisitTaskId, @@ -1915,9 +1975,16 @@ namespace IRaCIS.Core.Infra.EFCore.Common TrialReadingCriterionId = x.ReadingQuestionCriterionTrialId, - }, new { QuestionAnswerList = taskQuestionAnswerList.Join(quesionList, t => t.ReadingQuestionTrialId, u => u.QuestionId, (t, u) => new { t.Answer, u.DictionaryCode, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList() }); + ExtraIndentification = extraIdentification, + }, new { QuestionAnswerList = taskQuestionAnswerList.Join(quesionList, t => t.ReadingQuestionTrialId, u => u.QuestionId, (t, u) => + new { Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer, u.DictionaryCode, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList() + , + TableQuestionAndAnswerList = tableQuesionAndAnswerList + } + ); + } @@ -1946,7 +2013,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common t.DictionaryCode, t.QuestionName, QuestionId = t.Id, - t.ShowOrder + t.ShowOrder, + AnswerType = t.Type, + }) .OrderBy(t => t.ShowOrder).ToListAsync(); @@ -1991,7 +2060,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common tableQuestionAnswerList.Join(tableQuesionList, t => t.TableQuestionId, u => u.QuestionId, (t, u) => new { - t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/, + //如果问题类型是附件 特殊处理 方便前端解析 + Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer, + //t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/, u.QuestionName, u.DictionaryCode, u.ShowOrder From 7e831fcedba2d89778e5f7c04760ca1bc15dc639 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 23 Feb 2023 18:08:10 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 5628b98cc..c498eb29c 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -495,7 +495,7 @@ namespace IRaCIS.Core.Application.Contracts public string IP { get; set; } = String.Empty; - + [DictionaryTranslateAttribute("YesOrNo")] public bool IsDicomReUpload { get; set; } From 5fa60d16b674806404925ce3405f3e90b83a8ce9 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 24 Feb 2023 09:11:14 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20isbaseLine=20=E4=B8=BA?= =?UTF-8?q?=E5=8F=AF=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index c498eb29c..564311700 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -740,7 +740,7 @@ namespace IRaCIS.Core.Application.Contracts - public bool IsBaseline { get; set; } + public bool? IsBaseline { get; set; } [DictionaryTranslateAttribute("ExistDisease", nameof(SelftAnalysisExport.IsBaseline), "true")] From 18272935eac7f4daac06a64c7b6349d03633951a Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 24 Feb 2023 09:32:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=B8=80=E8=87=B4=E6=80=A7=E5=88=86?= =?UTF-8?q?=E6=9E=90=E5=AF=BC=E5=87=BA=E5=8E=BB=E9=99=A4=E5=9F=BA=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Common/ExcelExportService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 1749c0356..9050c4ea3 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -705,7 +705,7 @@ namespace IRaCIS.Core.Application.Service.Common var subjectQuerybal = _repository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsSelfAnalysis == true).Select(t => t.SubjectId).Distinct(); var allList = await _repository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && subjectQuerybal.Contains(t.SubjectId) && t.ReadingCategory == ReadingCategory.Visit) - .Where(t => t.IsSelfAnalysis == true || t.IsSelfAnalysis == null) //一致性分析的结果 + 正常任务的结果 + 仅仅访视的结果 + .Where(t => (t.IsSelfAnalysis == true || t.IsSelfAnalysis == null)&& t.VisitTaskNum>0) //一致性分析的结果 + 正常任务的结果 + 仅仅访视的结果 +去除基线 //.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId) //.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState) @@ -783,7 +783,7 @@ namespace IRaCIS.Core.Application.Service.Common var subjectQuerybal = _repository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsSelfAnalysis == false).Select(t => t.SubjectId).Distinct(); var allList = await _repository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && subjectQuerybal.Contains(t.SubjectId) && t.ReadingCategory == ReadingCategory.Visit) - .Where(t => t.IsSelfAnalysis == false || t.IsSelfAnalysis == null) //一致性分析的结果 + 正常任务的结果 +仅仅访视的结果 + .Where(t => (t.IsSelfAnalysis == false || t.IsSelfAnalysis == null) && t.VisitTaskNum > 0) //一致性分析的结果 + 正常任务的结果 +仅仅访视的结果 //.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId) //.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)