From a8cd00b962a320f8fdb9a4e10e214c928fad54c4 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 26 Aug 2022 10:33:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E5=B1=9E=E6=80=A7=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Domain/Image/DicomSeries.cs | 3 +- IRaCIS.Core.Domain/Image/DicomStudy.cs | 9 +++- IRaCIS.Core.Domain/QC/CheckChallengeDialog.cs | 4 +- .../QC/ClinicalData/PreviousHistory.cs | 2 +- .../QC/ClinicalData/PreviousOther.cs | 2 +- IRaCIS.Core.Domain/QC/ConsistencyCheckFile.cs | 2 +- IRaCIS.Core.Domain/QC/QCChallenge.cs | 6 ++- IRaCIS.Core.Domain/QC/QCChallengeDialog.cs | 2 + IRaCIS.Core.Domain/QC/TrialQCQuestion.cs | 7 +-- .../QC/TrialQCQuestionAnswer.cs | 1 + .../SiteSurvey/TrialSiteSurvey.cs | 18 ++++--- .../Common/AuditingData.cs | 49 ++++++++++++++----- 12 files changed, 71 insertions(+), 34 deletions(-) diff --git a/IRaCIS.Core.Domain/Image/DicomSeries.cs b/IRaCIS.Core.Domain/Image/DicomSeries.cs index 3eba3eaf8..7971e61e0 100644 --- a/IRaCIS.Core.Domain/Image/DicomSeries.cs +++ b/IRaCIS.Core.Domain/Image/DicomSeries.cs @@ -8,10 +8,11 @@ namespace IRaCIS.Core.Domain.Models [Table("DicomSeries")] public class DicomSeries : Entity, IAuditAdd, IAuditUpdate, ISoftDelete { + [JsonIgnore] [ForeignKey("StudyId")] public DicomStudy DicomStudy { get; set; } - + [JsonIgnore] public List DicomInstanceList { get; set; } diff --git a/IRaCIS.Core.Domain/Image/DicomStudy.cs b/IRaCIS.Core.Domain/Image/DicomStudy.cs index 0a9fcf130..4693699b3 100644 --- a/IRaCIS.Core.Domain/Image/DicomStudy.cs +++ b/IRaCIS.Core.Domain/Image/DicomStudy.cs @@ -10,10 +10,13 @@ namespace IRaCIS.Core.Domain.Models { //一个检查 由多个人管理 //public List TrialSiteUserList { get; set; } = new List(); - + [JsonIgnore] public List DicomStudyMonitorList { get; set; } = new List(); + [JsonIgnore] public List StudyDTFList { get; set;} = new List(); + [JsonIgnore] public TrialSite TrialSite { get; set; } + [JsonIgnore] public Site Site { get; set; } [DatabaseGenerated(DatabaseGeneratedOption.Identity)] @@ -68,6 +71,7 @@ namespace IRaCIS.Core.Domain.Models public Guid CreateUserId { get; set; } public DateTime CreateTime { get; set; } = DateTime.Now; + [JsonIgnore] [ForeignKey("CreateUserId")] public User Uploader { get; set; } @@ -90,10 +94,11 @@ namespace IRaCIS.Core.Domain.Models public string CheckResult { get; set; }=string.Empty; - + [JsonIgnore] [ForeignKey("SubjectId")] public Subject Subject { get; set; } + [JsonIgnore] [ForeignKey("SubjectVisitId")] public SubjectVisit SubjectVisit { get; set; } diff --git a/IRaCIS.Core.Domain/QC/CheckChallengeDialog.cs b/IRaCIS.Core.Domain/QC/CheckChallengeDialog.cs index 07f072cb0..db7815e24 100644 --- a/IRaCIS.Core.Domain/QC/CheckChallengeDialog.cs +++ b/IRaCIS.Core.Domain/QC/CheckChallengeDialog.cs @@ -10,8 +10,8 @@ namespace IRaCIS.Core.Domain.Models public class CheckChallengeDialog : Entity, IAuditAdd { public string TalkContent { get; set; } = string.Empty; - - public SubjectVisit SubjectVisit { get; set; } + [JsonIgnore] + public SubjectVisit SubjectVisit { get; set; } public Guid SubjectVisitId { get; set; } public User CreateUser { get; set; } diff --git a/IRaCIS.Core.Domain/QC/ClinicalData/PreviousHistory.cs b/IRaCIS.Core.Domain/QC/ClinicalData/PreviousHistory.cs index a89108e35..15a25680c 100644 --- a/IRaCIS.Core.Domain/QC/ClinicalData/PreviousHistory.cs +++ b/IRaCIS.Core.Domain/QC/ClinicalData/PreviousHistory.cs @@ -14,7 +14,7 @@ namespace IRaCIS.Core.Domain.Models [Table("PreviousHistory")] public class PreviousHistory : Entity, IAuditAddWithUserName { - + [JsonIgnore] public SubjectVisit SubjectVisit { get; set; } /// /// CreateUserId diff --git a/IRaCIS.Core.Domain/QC/ClinicalData/PreviousOther.cs b/IRaCIS.Core.Domain/QC/ClinicalData/PreviousOther.cs index ebc99613a..0fb545383 100644 --- a/IRaCIS.Core.Domain/QC/ClinicalData/PreviousOther.cs +++ b/IRaCIS.Core.Domain/QC/ClinicalData/PreviousOther.cs @@ -15,7 +15,7 @@ namespace IRaCIS.Core.Domain.Models public class PreviousOther : Entity, IAuditAddWithUserName { - + [JsonIgnore] public SubjectVisit SubjectVisit { get; set; } /// /// CreateUserId diff --git a/IRaCIS.Core.Domain/QC/ConsistencyCheckFile.cs b/IRaCIS.Core.Domain/QC/ConsistencyCheckFile.cs index 51fd9a461..ac90904b7 100644 --- a/IRaCIS.Core.Domain/QC/ConsistencyCheckFile.cs +++ b/IRaCIS.Core.Domain/QC/ConsistencyCheckFile.cs @@ -42,7 +42,7 @@ namespace IRaCIS.Core.Domain.Models /// public Guid TrialId { get; set; } - + [JsonIgnore] /// /// 创建人 /// diff --git a/IRaCIS.Core.Domain/QC/QCChallenge.cs b/IRaCIS.Core.Domain/QC/QCChallenge.cs index 1fae9a98d..3464196aa 100644 --- a/IRaCIS.Core.Domain/QC/QCChallenge.cs +++ b/IRaCIS.Core.Domain/QC/QCChallenge.cs @@ -7,6 +7,7 @@ namespace IRaCIS.Core.Domain.Models { public class QCChallenge : Entity, IAuditAdd { + [JsonIgnore] [ForeignKey("CreateUserId")] public User CreateUser { get; set; } @@ -42,6 +43,7 @@ namespace IRaCIS.Core.Domain.Models public Guid? LatestReplyUserId { get; set; } + [JsonIgnore] [ForeignKey("LatestReplyUserId")] public User LatestReplyUser { get; set; } public string ChallengeCode { get; set; } @@ -70,11 +72,11 @@ namespace IRaCIS.Core.Domain.Models public string ChallengeType { get; set; } = string.Empty; - + [JsonIgnore] //导航属性 [ForeignKey("SubjectVisitId")] public SubjectVisit SubjectVisit { get; set; } - + [JsonIgnore] public List DialogList { get; set; } = new List(); diff --git a/IRaCIS.Core.Domain/QC/QCChallengeDialog.cs b/IRaCIS.Core.Domain/QC/QCChallengeDialog.cs index 96311bbaf..f0402c334 100644 --- a/IRaCIS.Core.Domain/QC/QCChallengeDialog.cs +++ b/IRaCIS.Core.Domain/QC/QCChallengeDialog.cs @@ -6,6 +6,7 @@ namespace IRaCIS.Core.Domain.Models { public class QCChallengeDialog : Entity, IAuditAdd { + [JsonIgnore] public QCChallenge QCChallenge { get; set; } public string TalkContent { get; set; } = string.Empty; @@ -13,6 +14,7 @@ namespace IRaCIS.Core.Domain.Models public Guid SubjectVisitId { get; set; } + [JsonIgnore] [ForeignKey("CreateUserId")] public User CreateUser { get; set; } diff --git a/IRaCIS.Core.Domain/QC/TrialQCQuestion.cs b/IRaCIS.Core.Domain/QC/TrialQCQuestion.cs index 961422a92..9cb735782 100644 --- a/IRaCIS.Core.Domain/QC/TrialQCQuestion.cs +++ b/IRaCIS.Core.Domain/QC/TrialQCQuestion.cs @@ -13,7 +13,8 @@ namespace IRaCIS.Core.Domain.Models /// [Table("TrialQCQuestion")] public class TrialQCQuestion : Entity, IAuditUpdate, IAuditAdd - { + { + [JsonIgnore] public Trial Trial { get; set; } /// @@ -48,7 +49,7 @@ namespace IRaCIS.Core.Domain.Models public Guid? ParentId { get; set; } - + [JsonIgnore] [ForeignKey("ParentId")] public TrialQCQuestion ParentQCQuestion { get; set; } @@ -100,8 +101,8 @@ namespace IRaCIS.Core.Domain.Models public bool? IsConfirm { get; set; } - + [JsonIgnore] public List TrialQCQuestionAnswerList { get; set; } diff --git a/IRaCIS.Core.Domain/QC/TrialQCQuestionAnswer.cs b/IRaCIS.Core.Domain/QC/TrialQCQuestionAnswer.cs index 58ec5c1e8..6dc4f6ea5 100644 --- a/IRaCIS.Core.Domain/QC/TrialQCQuestionAnswer.cs +++ b/IRaCIS.Core.Domain/QC/TrialQCQuestionAnswer.cs @@ -72,6 +72,7 @@ namespace IRaCIS.Core.Domain.Models public Guid TrialQCQuestionConfigureId { get; set; } + [JsonIgnore] public TrialQCQuestion TrialQCQuestionConfigure { get; set; } } diff --git a/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs b/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs index be84b0329..71113d256 100644 --- a/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs +++ b/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs @@ -20,16 +20,17 @@ namespace IRaCIS.Core.Domain.Models public TrialSiteSurveyEnum State { get; set; } = TrialSiteSurveyEnum.ToSubmit; - // 必须 { get; set; } 否则 翻译出错 + // 必须 { get; set; } 否则 翻译出错 + [JsonIgnore] public List TrialSiteUserSurveyList { get; set; } =new List(); + [JsonIgnore] + public List TrialSiteEquipmentSurveyList { get; set; } = new List(); - public List TrialSiteEquipmentSurveyList { get; set; } = new List(); - - + [JsonIgnore] public TrialSite TrialSite { get; set; } - - public Trial Trial { get; set; } - + [JsonIgnore] + public Trial Trial { get; set; } + [JsonIgnore] public Site Site { get; set; } public DateTime? DeletedTime { get; set; } @@ -142,8 +143,9 @@ namespace IRaCIS.Core.Domain.Models public DateTime? ReviewerTime { get; set; } + [JsonIgnore] public User ReviewerUser { get; set; } - + [JsonIgnore] public User PreliminaryUser { get; set; } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index b05455b56..f83022605 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -179,7 +179,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common { var entity = item.Entity as TrialQCQuestion; var paretName = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync(); - await InsertInspection(entity, type, null, new + await InsertInspection(entity, type, x => new InspectionConvertDTO() + { + ObjectRelationParentId = x.TrialId + }, new { QuestionName = entity.QuestionName, Type = entity.Type, @@ -197,7 +200,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common // 检查 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomStudy))) { - await InsertInspection(item.Entity as DicomStudy, type); + await InsertInspection(item.Entity as DicomStudy, type, x => new InspectionConvertDTO() + { + ObjectRelationParentId=x.SubjectVisitId + }); } // 序列 @@ -209,7 +215,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common { dicomStudy = await _dbContext.DicomStudys.AsNoTracking().FirstOrDefaultAsync(x => x.Id == entity.StudyId); } - await InsertInspection(item.Entity as DicomSeries, type, null, new + await InsertInspection(item.Entity as DicomSeries, type, x => new InspectionConvertDTO() + { + ObjectRelationParentId = x.StudyId + }, new { StudyCode = dicomStudy?.StudyCode, Modalities = dicomStudy?.Modalities, @@ -231,6 +240,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common TrialId = subjectvisit.TrialId, SubjectId = subjectvisit.SubjectId, + ObjectRelationParentId=x.SubjectVisitId, + }, new { Type = "既往手术史" @@ -249,6 +260,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common SubjectVisitName = subjectvisit.VisitName, TrialId = subjectvisit.TrialId, SubjectId = subjectvisit.SubjectId, + + ObjectRelationParentId = x.SubjectVisitId, }, new { Type = "既往放疗史" @@ -267,6 +280,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common SubjectVisitName = subjectvisit.VisitName, TrialId = subjectvisit.TrialId, SubjectId = subjectvisit.SubjectId, + + ObjectRelationParentId = x.SubjectVisitId, }, new { Type = "其他治疗史" @@ -293,6 +308,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common SubjectId = subjectvisit.SubjectId, SubjectVisitName = subjectvisit.VisitName, BlindName = subjectvisit.BlindName, + + ObjectRelationParentId=x.SubjectVisitId }, new { ChallengeCode = entity.ChallengeCode, @@ -303,11 +320,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common } - //Qc 问题 - foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(QCQuestion))) - { - await InsertInspection(item.Entity as QCQuestion, type); - } + // 一致性核查文件 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ConsistencyCheckFile))) @@ -315,6 +328,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(item.Entity as ConsistencyCheckFile, type, x => new InspectionConvertDTO() { CreateTime = x.CreateTime, + + ObjectRelationParentId=x.TrialId + }); } @@ -405,8 +421,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(entity, type, x => new InspectionConvertDTO() { GeneralId = entity.SubjectVisitId, - //byzhouhang - ObjectRelationParentId = entity.SubjectVisitId, + TrialId = subjectvisit.TrialId, SubjectVisitId = x.SubjectVisitId, SiteId = subjectvisit.SiteId, @@ -415,6 +430,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common BlindName = subjectvisit.BlindName, Reason = reason, CreateTime = x.CreateTime, + + //byzhouhang + ObjectRelationParentId = entity.SubjectVisitId, }, new { CheckState = subjectvisit.CheckState, @@ -442,8 +460,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(entity, type, x => new InspectionConvertDTO() { GeneralId = qCChallenge.Id, - //byzhouhang - ObjectRelationParentId = qCChallenge.Id, + TrialId = subjectvisit.TrialId, SubjectVisitId = x.SubjectVisitId, @@ -452,6 +469,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common SubjectVisitName = subjectvisit.VisitName, BlindName = subjectvisit.BlindName, Reason = reason, + //byzhouhang + ObjectRelationParentId = qCChallenge.Id, }, new { AuditState = subjectvisit.AuditState, @@ -494,7 +513,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common }); } - + //Qc 问题 + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(QCQuestion))) + { + await InsertInspection(item.Entity as QCQuestion, type); + } // 项目文档 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialDocument)))