diff --git a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs index ef3bbfa8..2780dbab 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs @@ -1,5 +1,6 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure.Extention; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Application.Contracts { @@ -17,6 +18,22 @@ namespace IRaCIS.Application.Contracts } + public class GetTrialConfigDictionaryListInDto + { + [NotDefault] + public Guid TrialId { get; set; } + + //public + } + + public class AddTrialConfigDictionaryListInDto + { + [NotDefault] + public Guid TrialId { get; set; } + + public List DictionaryIds { get; set; } + } + public class AddOrEditBasicDic { diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs index 908bc33a..14b631a7 100644 --- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs +++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs @@ -19,10 +19,12 @@ namespace IRaCIS.Application.Services private readonly IRepository _trialDictionaryRepository; private readonly IRepository _doctorRepository; private readonly IRepository _trialRepository; + private readonly IRepository _trialConfigDictionaryRepository; private readonly IReadingQuestionService _readingQuestionService; public DictionaryService(IRepository sysDicRepository, IRepository doctorDictionaryRepository, IRepository trialDictionaryRepository, IRepository doctorRepository, IRepository trialRepository, + IRepository trialConfigDictionaryRepository, IReadingQuestionService readingQuestionService @@ -33,6 +35,7 @@ namespace IRaCIS.Application.Services _trialDictionaryRepository = trialDictionaryRepository; _doctorRepository = doctorRepository; _trialRepository = trialRepository; + this._trialConfigDictionaryRepository = trialConfigDictionaryRepository; this._readingQuestionService = readingQuestionService; } @@ -133,6 +136,32 @@ namespace IRaCIS.Application.Services } + /// + /// 批量添加项目字典 + /// + /// + /// + public async Task AddTrialConfigDictionaryList(AddTrialConfigDictionaryListInDto inDto) + { + + await _trialConfigDictionaryRepository.AddRangeAsync(inDto.DictionaryIds.Select(x => new TrialConfigDictionary() { + TrialId = inDto.TrialId, + DictionaryId = x + + })); + + await _trialConfigDictionaryRepository.SaveChangesAsync(); + + return ResponseOutput.Ok(true); + } + + + //public async Task<> GetTrialConfigDictionaryList() + //{ + + //} + + /// /// 获取子项数组 /// diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index aa8cbf33..c41c7a69 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -790,6 +790,7 @@ namespace IRaCIS.Application.Services x.ArmEnum == taskInfo.ArmEnum && x.DoctorUserId == taskInfo.DoctorUserId && x.ReadingTaskState == ReadingTaskState.HaveSigned && + x.TrialReadingCriterionId== taskInfo.TrialReadingCriterionId&& x.TaskState == TaskState.Effect && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.ReadingCategory == ReadingCategory.Visit) || x.Id == inDto.VisitTaskId) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index 3b9f7394..c5cb766c 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -318,6 +318,13 @@ namespace IRaCIS.Core.Application [HttpPost] public async Task SetCriterionReadingInfo(SetCriterionReadingInfoInDto inDto) { + ArbitrationRule arbitration = ArbitrationRule.NA; + + if (inDto.IsArbitrationReading) + { + arbitration = inDto.IsGlobalReading ? ArbitrationRule.Reading : ArbitrationRule.Visit; + } + await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial() { ReadingTool=inDto.ReadingTool, @@ -329,7 +336,7 @@ namespace IRaCIS.Core.Application IsReadingShowPreviousResults = inDto.IsReadingShowPreviousResults, GlobalUpdateType=inDto.GlobalUpdateType, ImagePlatform=inDto.ImagePlatform, - ArbitrationRule= inDto.IsReadingTaskViewInOrder? ArbitrationRule.Visit:ArbitrationRule.NA, + ArbitrationRule= arbitration, ReadingType = inDto.ReadingType, IsGlobalReading = inDto.IsGlobalReading, IsArbitrationReading = inDto.IsArbitrationReading, diff --git a/IRaCIS.Core.Domain/Trial/TrialConfigDictionary.cs b/IRaCIS.Core.Domain/Trial/TrialConfigDictionary.cs new file mode 100644 index 00000000..f1946ce7 --- /dev/null +++ b/IRaCIS.Core.Domain/Trial/TrialConfigDictionary.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using IRaCIS.Core.Domain.Share; +using Newtonsoft.Json; + +namespace IRaCIS.Core.Domain.Models +{ + /// + ///TrialConfigDictionary + /// + [Table("TrialConfigDictionary")] + public class TrialConfigDictionary : Entity, IAuditAdd + { + /// + /// TrialId + /// + public Guid TrialId { get; set; } + + /// + /// DictionaryId + /// + public Guid DictionaryId { get; set; } + + /// + /// CreateTime + /// + public DateTime CreateTime { get; set; } + + /// + /// CreateUserId + /// + public Guid CreateUserId { get; set; } + + [JsonIgnore] + [ForeignKey("DictionaryId")] + public Dictionary Dictionary { get; set; } + + } + + +} diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 469c57d5..47c00c53 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -319,7 +319,7 @@ namespace IRaCIS.Core.Infra.EFCore #region Trial public virtual DbSet Trial { get; set; } - + public virtual DbSet TrialConfigDictionary { get; set; } public virtual DbSet TrialDictionary { get; set; } public virtual DbSet TrialDetail { get; set; } public virtual DbSet UserTrial { get; set; } diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude index fc72b7d1..5c66ebf5 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 = "SystemClinicalDataCriterion,TrialClinicalDataCriterion"; + public static readonly string TableName = "TrialConfigDictionary"; //ļ service Ƿҳ } #>