diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 412881ada..943c2fdf7 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -2175,6 +2175,20 @@ + + + 获取项目的其他医学审核问题 + + + + + + + 从系统里面选择问题添加到项目里面 + + + + 删除项目的医学审核问题 @@ -2527,6 +2541,11 @@ ReadingMedicineSystemQuestionQuery 列表查询参数模型 + + + 获取项目的其他问题 + + ReadingMedicineSystemQuestionAddOrEdit 列表查询参数模型 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs index 7333f6751..a43a0dd73 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs @@ -52,10 +52,10 @@ namespace IRaCIS.Core.Application.ViewModel ///ReadingMedicineSystemQuestionQuery 列表查询参数模型 public class ReadingMedicineSystemQuestionQuery:PageInput { - public string Type { get; set; } - public string ParentTriggerValue { get; set; } - public string QuestionName { get; set; } - public string TypeValue { get; set; } + public string Type { get; set; }=string.Empty; + public string ParentTriggerValue { get; set; } = string.Empty; + public string QuestionName { get; set; } = string.Empty; + public string TypeValue { get; set; } = string.Empty; } @@ -67,6 +67,13 @@ namespace IRaCIS.Core.Application.ViewModel public string QuestionName { get; set; } } + public class AddTrialDataFromSystemInDto + { + public Guid TrialId { get; set; } + + public List SystemQuestionIds { get; set; } + } + /// /// 获取项目的其他问题 /// @@ -151,15 +158,15 @@ namespace IRaCIS.Core.Application.ViewModel /// public Guid TrialId { get; set; } - public string Type { get; set; } + public string Type { get; set; } = string.Empty; - public string ParentTriggerValue { get; set; } + public string ParentTriggerValue { get; set; } = string.Empty; - public string QuestionName { get; set; } + public string QuestionName { get; set; } = string.Empty; - public string TypeValue { get; set; } + public string TypeValue { get; set; } = string.Empty; - } + } /// ReadingMedicineTrialQuestionAddOrEdit 列表查询参数模型 public class ReadingMedicineTrialQuestionAddOrEdit diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs index 175224cdf..ec8885a66 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Infra.EFCore.Common; +using MassTransit; namespace IRaCIS.Core.Application.Service { @@ -135,6 +136,31 @@ namespace IRaCIS.Core.Application.Service return questionList; } + /// + /// 从系统里面选择问题添加到项目里面 + /// + /// + /// + [HttpPost] + public async Task AddTrialDataFromSystem(AddTrialDataFromSystemInDto inDto) + { + var needList = _readingMedicineSystemQuestionRepository.Where(x => inDto.SystemQuestionIds.Contains(x.Id)) + .Select(x => new ReadingMedicineTrialQuestion() + { + Id = NewId.NextGuid(), + ShowOrder = x.ShowOrder, + IsEnable = x.IsEnable, + IsRequired = x.IsRequired, + QuestionName = x.QuestionName, + Type = x.Type, + TypeValue = x.TypeValue, + TrialId=inDto.TrialId, + }); + + await _readingMedicineTrialQuestionRepository.AddRangeAsync(needList); + var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Result(result); + } /// /// 删除项目的医学审核问题 diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 1b7dd7e90..e8c3ae35b 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -87,7 +87,7 @@ namespace IRaCIS.Core.Application.Service CreateMap(); CreateMap(); - CreateMap(); + CreateMap(); #endregion