From f4b9e009a0963647197ef32d1d2bdd2895745f25 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Wed, 17 Aug 2022 15:35:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Reading/Dto/OrganInfoViewModel.cs | 5 + .../Service/Reading/OrganInfoService.cs | 6 +- .../Service/Reading/ReadingQuestionService.cs | 6 + IRaCIS.Core.Domain/Reading/OrganInfo.cs | 6 + .../Reading/ReadingTableQuestionTrial.cs | 131 ++++++++++++++++++ .../Context/IRaCISDBContext.cs | 2 + IRaCIS.Core.Test/DbHelper.ttinclude | 2 +- 7 files changed, 155 insertions(+), 3 deletions(-) create mode 100644 IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs index a72477e57..8e6028578 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs @@ -163,6 +163,11 @@ namespace IRaCIS.Core.Application.ViewModel /// public Guid CriterionNidusId { get; set; } + /// + /// 标准 病灶类型 + /// + public Guid CriterionId { get; set; } + public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs b/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs index b2d63ec87..85c7da578 100644 --- a/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs +++ b/IRaCIS.Core.Application/Service/Reading/OrganInfoService.cs @@ -244,17 +244,19 @@ namespace IRaCIS.Core.Application.Service await _criterionNidusRepository.BatchDeleteNoTrackingAsync(x => x.CriterionId == trialCriterionId); List criterionNidusList = await _criterionNidusRepository.Where(x => x.CriterionId == inDto.SystemCriterionId).Select(x => new CriterionNidusData() { - Id = NewId.NextGuid(), + Id = x.Id, CriterionId = trialCriterionId, NidusType = x.NidusType, NidusTypeCN = x.NidusTypeCN, OriginalId = x.Id, }).ToListAsync(); + criterionNidusList.ForEach(x => x.Id = NewId.NextGuid()); + await _criterionNidusRepository.AddRangeAsync(criterionNidusList); await _organTrialInfoRepository.BatchDeleteNoTrackingAsync(x => x.TrialId == inDto.TrialId); var originalIds = criterionNidusList.Select(x => x.OriginalId).Distinct().ToList(); - List organTrialInfoList = await _organInfoRepository.Where(x => originalIds.Contains(x.CriterionNidusId)).Select(x => new OrganTrialInfo() + List organTrialInfoList = await _organInfoRepository.Where(x =>x.CriterionId== inDto.SystemCriterionId).Select(x => new OrganTrialInfo() { CriterionNidusId = x.CriterionNidusId, Id = NewId.NextGuid(), diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs index 69f53cbae..f4924cbc7 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs @@ -31,6 +31,7 @@ namespace IRaCIS.Application.Services private readonly IRepository _clinicalDataTrialSetRepository; private readonly IRepository _clinicalDataSystemSetRepository; private readonly IRepository _dictionaryRepository; + private readonly IRepository _readingTableQuestionTrialRepository; private readonly IRepository _readingCriterionPageRepository; private readonly IRepository _trialRepository; private readonly IRepository _readingTableQuestionSystemRepository; @@ -46,6 +47,7 @@ namespace IRaCIS.Application.Services IRepository ClinicalDataTrialSetRepository, IRepository ClinicalDataSystemSetRepository, IRepository dictionaryRepository, + IRepository readingTableQuestionTrialRepository, IRepository readingCriterionPageRepository, IRepository trialRepository, IRepository readingTableQuestionSystemRepository, @@ -61,6 +63,7 @@ namespace IRaCIS.Application.Services this._clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository; this._clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository; this._dictionaryRepository = dictionaryRepository; + this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository; this._readingCriterionPageRepository = readingCriterionPageRepository; this._trialRepository = trialRepository; this._readingTableQuestionSystemRepository = readingTableQuestionSystemRepository; @@ -322,6 +325,9 @@ namespace IRaCIS.Application.Services { SynchronizeTime = DateTime.Now }); + + + //var list await _readingQuestionTrialRepository.SaveChangesAsync(); } } diff --git a/IRaCIS.Core.Domain/Reading/OrganInfo.cs b/IRaCIS.Core.Domain/Reading/OrganInfo.cs index dd7189d89..2b0a9d145 100644 --- a/IRaCIS.Core.Domain/Reading/OrganInfo.cs +++ b/IRaCIS.Core.Domain/Reading/OrganInfo.cs @@ -48,6 +48,12 @@ namespace IRaCIS.Core.Domain.Models /// public Guid CriterionNidusId { get; set; } + + /// + /// 标准Id + /// + public Guid CriterionId { get; set; } + /// /// 创建时间 /// diff --git a/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs new file mode 100644 index 000000000..b7c181a47 --- /dev/null +++ b/IRaCIS.Core.Domain/Reading/ReadingTableQuestionTrial.cs @@ -0,0 +1,131 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2022-08-17 14:36:04 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + /// 项目阅片问题 + /// + [Table("ReadingTableQuestionTrial")] + public class ReadingTableQuestionTrial : Entity, IAuditAdd + { + /// + /// TrialId + /// + public Guid TrialId { get; set; } + + /// + /// ReadingQuestionId + /// + public Guid ReadingQuestionId { get; set; } + + /// + /// Type + /// + public string Type { get; set; } + + /// + /// ParentId + /// + public Guid? ParentId { get; set; } + + /// + /// ParentTriggerValue + /// + public string ParentTriggerValue { get; set; } + + /// + /// QuestionName + /// + public string QuestionName { get; set; } + + /// + /// IsRequired + /// + public int IsRequired { get; set; } + + /// + /// ShowOrder + /// + public int ShowOrder { get; set; } + + /// + /// TypeValue + /// + public string TypeValue { get; set; } + + /// + /// IsEnable + /// + public bool IsEnable { get; set; } + + /// + /// CreateTime + /// + public DateTime CreateTime { get; set; } + + /// + /// CreateUserId + /// + public Guid CreateUserId { get; set; } + + /// + /// Remark + /// + public string Remark { get; set; } + + /// + /// RelevanceId + /// + public Guid? RelevanceId { get; set; } + + /// + /// RelevanceValue + /// + public string RelevanceValue { get; set; } + + /// + /// ShowQuestion + /// + public int ShowQuestion { get; set; } + + /// + /// MaxRowCount + /// + public int? MaxRowCount { get; set; } + + /// + /// DataTableName + /// + public string DataTableName { get; set; } + + /// + /// DataTableColumn + /// + public string DataTableColumn { get; set; } + + /// + /// TableQuestionType + /// + public int TableQuestionType { get; set; } + + /// + /// DependParentId + /// + public Guid? DependParentId { get; set; } + + /// + /// IsDepend + /// + public int IsDepend { get; set; } + + } + + +} diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index d573b54f8..322cb6fe9 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -247,6 +247,8 @@ namespace IRaCIS.Core.Infra.EFCore public virtual DbSet CriterionNidus { get; set; } + public virtual DbSet ReadingTableQuestionTrial { get; set; } + #endregion #region Subject and Visit and study diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude index 05632f135..7c295999f 100644 --- a/IRaCIS.Core.Test/DbHelper.ttinclude +++ b/IRaCIS.Core.Test/DbHelper.ttinclude @@ -4,7 +4,7 @@ public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"; public static readonly string DbDatabase = "IRaCIS_New_Tet"; //ַ,ƴ - public static readonly string TableName = "CriterionNidus"; + public static readonly string TableName = "ReadingTableQuestionTrial"; //ļ service Ƿҳ } #>