diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 09fc4aa49..4c4f10281 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -9,6 +9,35 @@ using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { + + public class ReadingCriterionPageView + { + public Guid Id { get; set; } + public Guid TrialId { get; set; } + public string PageName { get; set; } + public bool IsEnable { get; set; } + + } + + + public class ReadingCriterionPageQuery + { + /// PageName + public string PageName { get; set; } + + } + + + public class ReadingCriterionPageAddOrEdit + { + public Guid? Id { get; set; } + public Guid TrialId { get; set; } + public string PageName { get; set; } + public bool IsEnable { get; set; } + + } + + public class AddOrUpdateReadingQuestionCriterionTrialInDto { public Guid? Id { get; set; } @@ -124,6 +153,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid TrialId { get; set; } public string CriterionName { get; set; } = string.Empty; + + + } @@ -194,6 +226,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// 是否是裁判问题 /// public bool IsJudgeQuestion { get; set; } + + /// + /// 标准分页Id + /// + public Guid? ReadingCriterionPageId { get; set; } } public class ReadingQuestionSystemView @@ -285,6 +322,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// 问题名称 /// public string QuestionName { get; set; } = string.Empty; + + + + public Guid? ReadingCriterionPageId { get; set; } } /// diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs index 954d16325..562678d81 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 _readingCriterionPageRepository; private readonly IRepository _trialRepository; private readonly IReadingImageTaskService _readingImageTaskService; private readonly IRepository _readingTaskQuestionAnswer; @@ -45,6 +46,7 @@ namespace IRaCIS.Application.Services IRepository ClinicalDataTrialSetRepository, IRepository ClinicalDataSystemSetRepository, IRepository dictionaryRepository, + IRepository readingCriterionPageRepository, IRepository trialRepository, IReadingImageTaskService readingImageTaskService, IRepository readingTaskQuestionAnswer, @@ -59,12 +61,40 @@ namespace IRaCIS.Application.Services this._clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository; this._clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository; this._dictionaryRepository = dictionaryRepository; + this._readingCriterionPageRepository = readingCriterionPageRepository; this._trialRepository = trialRepository; this._readingImageTaskService = readingImageTaskService; this._readingTaskQuestionAnswer = readingTaskQuestionAnswer; this._previousPDFRepository = previousPDFRepository; } + + /// + /// 新增修改项目标准分页 + /// + /// + /// + [HttpPost] + public async Task AddOrUpdateReadingCriterionPage(ReadingCriterionPageAddOrEdit addOrEditReadingCriterionPage) + { + + var entity = await _readingCriterionPageRepository.InsertOrUpdateAsync(addOrEditReadingCriterionPage, true); + return ResponseOutput.Ok(entity.Id.ToString()); + + } + + /// + /// 删除标准分页 + /// + /// + /// + [HttpDelete("{Id:guid}")] + public async Task DeleteReadingCriterionPage(Guid Id) + { + var success = await _readingCriterionPageRepository.DeleteFromQueryAsync(t => t.Id == Id, true); + return ResponseOutput.Ok(); + } + ///// ///// 新增修改系统问题标准 ///// @@ -626,6 +656,7 @@ namespace IRaCIS.Application.Services var query = _readingQuestionCriterionTrialRepository.AsQueryable() .Where(x=>x.TrialId==inDto.TrialId) .WhereIf(!inDto.CriterionName.IsNullOrEmpty(), x => x.CriterionName.Contains(inDto.CriterionName)) + .ProjectTo(_mapper.ConfigurationProvider); return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(ReadingQuestionCriterionTrialView.CriterionName) : inDto.SortField, inDto.Asc); @@ -679,6 +710,7 @@ namespace IRaCIS.Application.Services .Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId) .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) + .WhereIf(inDto.ReadingCriterionPageId!=null, x => x.ReadingCriterionPageId==inDto.ReadingCriterionPageId) .ProjectTo(_mapper.ConfigurationProvider); return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, "GroupName ASC,ShowOrder", inDto.Asc); diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 04e67c787..d8afb5960 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -50,6 +50,10 @@ namespace IRaCIS.Core.Application.Service CreateMap(); #region 阅片问题 + + + + CreateMap(); CreateMap(); CreateMap() .ForMember(d => d.QuestionCount, u => u.MapFrom(s => s.ReadingQuestionSystemList.Count())) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs index a817e8dcf..de1654a02 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs @@ -292,27 +292,21 @@ namespace IRaCIS.Core.Application.Contracts /// public Guid TrialId { get; set; } - - /// /// 阅片平台 /// public int ImagePlatform { get; set; } = 1; - /// /// 任务组织级别 /// public ReadingTaskViewMethod ReadingTaskViewEnum { get; set; } - /// /// 影像是否有标注 /// public bool IsImageStandard { get; set; } - - /// /// IR阅片是否显示受试者信息 /// @@ -333,8 +327,10 @@ namespace IRaCIS.Core.Application.Contracts /// public int ArbitrationRule { get; set; } = 2; - - + /// + /// 项目标准Id + /// + public List TrialCriterionId { get; set; } ///// ///// 全局阅片 @@ -366,23 +362,109 @@ namespace IRaCIS.Core.Application.Contracts ///// //public bool IsReadingTaskViewInOrder { get; set; } = true; - - /// - /// 项目标准集合 + /// 项目分页 /// - public List TrialReadingCriterionList { get; set; } + public List ReadingCriterionPageList { get; set; } /// /// 项目裁判问题集合 /// public List TrialJudgeQuestionList { get; set; } + + + /// + /// 项目问题集合 + /// + public List TrialQuestionList { get; set; } + } + + + public class TrialReadQuestion + { + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 分页名称 + /// + public string PageName { get; set; } + + /// + /// 问题名称 + /// + public string QuestionName { get; set; } + + /// + /// 类型 + /// + public string Type { get; set; } + + /// + /// 父问题触发 + /// + public string ParentTriggerValue { get; set; } + + /// + /// 父问题名称 + /// + public string ParentQuestionName { get; set; } + + /// + /// 是否是必须 + /// + public bool IsRequired { get; set; } + + /// + /// 类型值 + /// + public string TypeValue { get; set; } + + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } + + /// + /// 是否是裁判问题 + /// + public bool IsJudgeQuestion { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } + + /// + /// 分组 + /// + public string GroupName { get; set; } + + /// + /// 答案分组 + /// + public string AnswerGroup { get; set; } = string.Empty; + + /// + /// 答案组合 + /// + public string AnswerCombination { get; set; } = string.Empty; + + /// + /// 裁判类型 + /// + public JudgeTypeEnum JudgeType { get; set; } + } public class TrialJudgeQuestion { + + public Guid ReadingQuestionCriterionTrialId { get; set; } public Guid QuestionId { get; set; } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index 8efb79399..d4727097d 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -19,6 +19,7 @@ namespace IRaCIS.Core.Application private readonly IRepository _readingQuestionCriterionTrialRepository; private readonly IRepository _readingQuestionTrialRepository; private readonly IRepository _clinicalDataTrialSetRepository; + private readonly IRepository _readingCriterionPageRepository; private readonly IEasyCachingProvider _provider; private readonly IRepository _taskAllocationRuleRepository; @@ -28,6 +29,7 @@ namespace IRaCIS.Core.Application IRepository readingQuestionCriterionTrialRepository, IRepository readingQuestionTrialRepository, IRepository clinicalDataTrialSetRepository, + IRepository readingCriterionPageRepository, IRepository taskAllocationRuleRepository, IEasyCachingProvider provider ) @@ -38,6 +40,7 @@ namespace IRaCIS.Core.Application this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository; this._readingQuestionTrialRepository = readingQuestionTrialRepository; this._clinicalDataTrialSetRepository = clinicalDataTrialSetRepository; + this._readingCriterionPageRepository = readingCriterionPageRepository; this._provider = provider; } @@ -51,13 +54,9 @@ namespace IRaCIS.Core.Application { GetTrialReadingInfoOutDto trialInfo= await _trialRepository.Where(x=>x.Id==inDto.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstNotNullAsync(); - trialInfo.TrialReadingCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).Select(x => new TrialReadingCriterion() - { - CriterionName = x.CriterionName, - Id = x.Id - }).ToListAsync(); - - trialInfo.TrialJudgeQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm && x.IsJudgeQuestion) + trialInfo.ReadingCriterionPageList = await _readingCriterionPageRepository.Where(x => x.TrialId == inDto.TrialId).ToListAsync(); + trialInfo.TrialCriterionId = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).Select(x => x.Id).ToListAsync(); + trialInfo.TrialJudgeQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm && x.IsJudgeQuestion && x.TrialId == inDto.TrialId) .Select(x => new TrialJudgeQuestion() { AnswerCombination = x.AnswerCombination, @@ -68,6 +67,11 @@ namespace IRaCIS.Core.Application ReadingQuestionCriterionTrialId = x.ReadingQuestionCriterionTrialId }).ToListAsync(); + trialInfo.TrialQuestionList= await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm&&x.TrialId==inDto.TrialId) + .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + + return trialInfo; } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs index 94b4f9adf..eaafa13f3 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs @@ -228,6 +228,12 @@ namespace IRaCIS.Core.Application.Service + CreateMap() + .ForMember(t => t.PageName, u => u.MapFrom(c => c.ReadingCriterionPage.PageName)) + .ForMember(t => t.ParentQuestionName, u => u.MapFrom(c => c.ParentReadingQuestionTrial.QuestionName)); + + + CreateMap() .ForMember(t => t.TrialSiteUserList, u => u.Ignore()); diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionPage.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionPage.cs new file mode 100644 index 000000000..13d809e25 --- /dev/null +++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionPage.cs @@ -0,0 +1,49 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2022-07-13 09:48:30 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Collections.Generic; + +namespace IRaCIS.Core.Domain.Models +{ + /// + ///阅片标准分页 + /// + [Table("ReadingCriterionPage")] + public class ReadingCriterionPage : Entity, IAuditAdd + { + /// + /// 项目ID + /// + public Guid TrialId { get; set; } + + /// + /// 分页名称 + /// + public string PageName { get; set; } + + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建用户ID + /// + public Guid CreateUserId { get; set; } + + public List ReadingQuestionList { get; set; } = new List(); + + + } +} diff --git a/IRaCIS.Core.Domain/Reading/ReadingQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingQuestionTrial.cs index d065d9b75..4bba4385d 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingQuestionTrial.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingQuestionTrial.cs @@ -112,6 +112,17 @@ namespace IRaCIS.Core.Domain.Models /// public Guid CreateUserId { get; set; } + /// + /// 标准分页Id + /// + public Guid? ReadingCriterionPageId { get; set; } + + /// + /// 分页标准 + /// + [ForeignKey("ReadingCriterionPageId")] + public ReadingCriterionPage ReadingCriterionPage { get; set; } + [ForeignKey("ParentId")] public ReadingQuestionTrial ParentReadingQuestionTrial { get; set; } diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude index 960756260..43d2fb565 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 = "EnrollReadingCategory"; + public static readonly string TableName = "ReadingCriterionPage"; //ļ service Ƿҳ } #> diff --git a/IRaCIS.Core.Test/TT_Template/Services_New/TaskConsistentRuleService.cs b/IRaCIS.Core.Test/TT_Template/Services_New/TaskConsistentRuleService.cs deleted file mode 100644 index 64ff26bb3..000000000 --- a/IRaCIS.Core.Test/TT_Template/Services_New/TaskConsistentRuleService.cs +++ /dev/null @@ -1,64 +0,0 @@ -//-------------------------------------------------------------------- -// 此代码由T4模板自动生成 byzhouhang 20210918 -// 生成时间 2022-07-01 15:37:24 -// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 -//-------------------------------------------------------------------- - -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Application.ViewModel; -namespace IRaCIS.Core.Application.Service -{ - /// - /// TaskConsistentRuleService - /// - [ ApiExplorerSettings(GroupName = "Test")] - public class TaskConsistentRuleService: BaseService, ITaskConsistentRuleService - { - - private readonly IRepository _taskConsistentRuleRepository; - - public TaskConsistentRuleService(IRepository taskConsistentRuleRepository) - { - _taskConsistentRuleRepository = taskConsistentRuleRepository; - } - - - public async Task> GetTaskConsistentRuleList(TaskConsistentRuleQuery inQuery) - { - - - var taskConsistentRuleQueryable = _taskConsistentRuleRepository - .ProjectTo(_mapper.ConfigurationProvider); - - return await taskConsistentRuleQueryable.ToListAsync(); - } - - - public async Task AddOrUpdateTaskConsistentRule(TaskConsistentRuleAddOrEdit addOrEditTaskConsistentRule) - { - // 在此处拷贝automapper 映射 - - - CreateMap(); - // CreateMap< TaskConsistentRule,TaskConsistentRuleAddOrEdit>().ReverseMap(); - - - var entity = await _taskConsistentRuleRepository.InsertOrUpdateAsync(addOrEditTaskConsistentRule, true); - - return ResponseOutput.Ok(entity.Id.ToString()); - - } - - - [HttpDelete("{taskConsistentRuleId:guid}")] - public async Task DeleteTaskConsistentRule(Guid taskConsistentRuleId) - { - var success = await _taskConsistentRuleRepository.DeleteFromQueryAsync(t => t.Id == taskConsistentRuleId,true); - return ResponseOutput.Ok(); - } - - - } -}