From a6c81418a426dc04bc58d638090a121f711bda27 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 1 Sep 2022 14:25:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BF=E8=A7=86=20=E5=92=8C=E8=82=BF?= =?UTF-8?q?=E7=98=A4=E5=AD=A6=E9=98=85=E7=89=87=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/ReadingTaskQuestionAnswer.cs | 2 + .../Common/AuditingData.cs | 42 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/IRaCIS.Core.Domain/Reading/ReadingTaskQuestionAnswer.cs b/IRaCIS.Core.Domain/Reading/ReadingTaskQuestionAnswer.cs index 11b9df2ed..922c31186 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingTaskQuestionAnswer.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingTaskQuestionAnswer.cs @@ -59,9 +59,11 @@ namespace IRaCIS.Core.Domain.Models /// public Guid CreateUserId { get; set; } + [JsonIgnore] [ForeignKey("VisitTaskId")] public VisitTask VisitTask { get; set; } + [JsonIgnore] [ForeignKey("ReadingQuestionTrialId")] public ReadingQuestionTrial ReadingQuestionTrial { get; set; } } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 6ad47e325..9fbe30196 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -263,6 +263,48 @@ namespace IRaCIS.Core.Infra.EFCore.Common } + //肿瘤学阅片结果 + + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingOncologyTaskInfo))) + { + var type =AuditOpt.Add; + + var entity = item.Entity as ReadingOncologyTaskInfo; + + await InsertInspection(entity, type, x => new InspectionConvertDTO() + { + VisitTaskId = entity.VisitTaskId, + + ObjectRelationParentId = entity.VisitTaskId, + + }); + } + // 全局 阅片结果 + + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingGlobalTaskInfo))) + { + var type = AuditOpt.Add; + + var entity = item.Entity as ReadingGlobalTaskInfo; + + var questionName = string.Empty; + if(entity.QuestionId != null) + { + questionName= await _dbContext.ReadingQuestionTrial.Where(t => t.Id == entity.QuestionId).Select(t => t.QuestionName).FirstOrDefaultAsync(); + } + + await InsertInspection(entity, type, x => new InspectionConvertDTO() + { + VisitTaskId = entity.TaskId, + + ObjectRelationParentId = entity.TaskId, + + },new { QuestionName= questionName }); + } + + + + // Qc 问题答案 if (entitys.Any(x => x.Entity.GetType() == typeof(TrialQCQuestionAnswer))) {