diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 52d4d3f49..f748685ee 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -2545,6 +2545,48 @@ + + + 获取系统表格问题 + + + + + + + 新增或修改系统表格问题 + + + + + + + 删除系统表格问题 + + + + + + + 获取项目表格问题 + + + + + + + 新增或修改项目表格问题 + + + + + + + 删除项目表格问题 + + + + 名称 @@ -2760,6 +2802,11 @@ 临床问题基本信息 + + + Id + + 问题名称 @@ -2815,6 +2862,21 @@ 是否必填 + + + 父问题Id + + + + + 父问题触发值 + + + + + 显示类型 + + 查询临床数据基类 @@ -2845,6 +2907,16 @@ 项目临床数据Id + + + 自定义计算标记 + + + + + 自定义计算问题 + + 获取系统临床数据 @@ -2865,6 +2937,126 @@ 获取系统分组 + + + 问题名称 + + + + + 问题英文名称 + + + + + 临床问题类型(分组,单选。) + + + + + 问题标识 + + + + + 最大长度 + + + + + 临床数据选项类型(无,自定义) + + + + + 自定义选项 + + + + + 字典Code + + + + + 排序 + + + + + 是否必填 + + + + + 创建时间 + + + + + 创建人 + + + + + 外层问题Id + + + + + 项目临床数据问题 + + + + + 项目临床数据Id + + + + + 自定义计算标记 + + + + + 自定义计算问题 + + + + + 系统临床数据问题 + + + + + 系统临床数据Id + + + + + 查询临床数据基类 + + + + + 问题名称 + + + + + 外层问题Id + + + + + 获取项目临床数据 + + + + + 获取系统临床数据 + + 项目中心Code diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs index 61e7d00cd..316b1c952 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs @@ -23,12 +23,21 @@ namespace IRaCIS.Core.Application.Service private readonly IRepository _systemClinicalQuestionRepository; + + private readonly IRepository _systemClinicalTableQuestionRepository; + + private readonly IRepository _trialClinicalTableQuestionRepository; + public ClinicalQuestionService(IRepository trialClinicalQuestionRepository, + IRepository systemClinicalTableQuestionRepository, + IRepository trialClinicalTableQuestionRepository, IRepository systemClinicalQuestionRepository ) { + _systemClinicalTableQuestionRepository = systemClinicalTableQuestionRepository; _trialClinicalQuestionRepository = trialClinicalQuestionRepository; - _systemClinicalQuestionRepository = systemClinicalQuestionRepository; + _trialClinicalTableQuestionRepository = trialClinicalTableQuestionRepository; + _systemClinicalQuestionRepository = systemClinicalQuestionRepository; } @@ -154,5 +163,106 @@ namespace IRaCIS.Core.Application.Service } #endregion + #region 系统表格问题 + + /// + /// 获取系统表格问题 + /// + /// + /// + [HttpPost] + public async Task> GetSystemClinicalTableQuestionList(SystemClinicalTableQuestionQuery inQuery) + { + + var systemClinicalTableQuestionQueryable = this._systemClinicalTableQuestionRepository + .Where(x=>x.QuestionId==inQuery.QuestionId) + .ProjectTo(_mapper.ConfigurationProvider); + + var pageList = await systemClinicalTableQuestionQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(SystemClinicalTableQuestion.ShowOrder) : inQuery.SortField, + inQuery.Asc); + + return pageList; + } + + + /// + /// 新增或修改系统表格问题 + /// + /// + /// + [HttpPost] + public async Task AddOrUpdateSystemClinicalTableQuestion(SystemClinicalTableQuestionDto inDto) + { + + var entity = await _systemClinicalTableQuestionRepository.InsertOrUpdateAsync(inDto, true); + + return ResponseOutput.Ok(entity.Id.ToString()); + + } + + /// + /// 删除系统表格问题 + /// + /// + /// + [HttpDelete("{id:guid}")] + public async Task DeleteSystemClinicalTableQuestion(Guid id) + { + var success = await _systemClinicalTableQuestionRepository.DeleteFromQueryAsync(t => t.Id == id, true); + return ResponseOutput.Ok(); + } + #endregion + + + #region 项目表格问题 + + /// + /// 获取项目表格问题 + /// + /// + /// + [HttpPost] + public async Task> GetTrialClinicalTableQuestionList(TrialClinicalTableQuestionQuery inQuery) + { + + var trialClinicalTableQuestionQueryable = this._trialClinicalTableQuestionRepository + .Where(x => x.QuestionId == inQuery.QuestionId) + .ProjectTo(_mapper.ConfigurationProvider); + + var pageList = await trialClinicalTableQuestionQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TrialClinicalTableQuestion.ShowOrder) : inQuery.SortField, + inQuery.Asc); + + return pageList; + } + + + /// + /// 新增或修改项目表格问题 + /// + /// + /// + [HttpPost] + public async Task AddOrUpdateTrialClinicalTableQuestion(TrialClinicalTableQuestionDto inDto) + { + + var entity = await _trialClinicalTableQuestionRepository.InsertOrUpdateAsync(inDto, true); + + return ResponseOutput.Ok(entity.Id.ToString()); + + } + + /// + /// 删除项目表格问题 + /// + /// + /// + [HttpDelete("{id:guid}")] + public async Task DeleteTrialClinicalTableQuestion(Guid id) + { + var success = await _trialClinicalTableQuestionRepository.DeleteFromQueryAsync(t => t.Id == id, true); + return ResponseOutput.Ok(); + } + #endregion + } } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs index bb1b9348f..bc469e571 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs @@ -7,12 +7,16 @@ using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { + + #region 外层问题 /// /// 临床问题基本信息 /// public class ClinicalQuestionBase { - + /// + /// Id + /// public Guid? Id { get; set; } /// @@ -69,6 +73,21 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// 是否必填 /// public bool IsRequired { get; set; } = false; + + /// + /// 父问题Id + /// + public Guid? ParentId { get; set; } + + /// + /// 父问题触发值 + /// + public string ParentTriggerValue { get; set; } = string.Empty; + + /// + /// 显示类型 + /// + public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show; } /// @@ -103,12 +122,22 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// 项目临床数据问题 /// - public class TrialClinicalQuestionDto: ClinicalQuestionBase + public class TrialClinicalQuestionDto : ClinicalQuestionBase { /// /// 项目临床数据Id /// public Guid TrialClinicalId { get; set; } + + /// + /// 自定义计算标记 + /// + public ClinicalCalculateMark? ClinicalCalculateMarkEnum { get; set; } + + /// + /// 自定义计算问题 + /// + public string CalculateQuestions { get; set; } = "[]"; } @@ -140,4 +169,153 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public Guid SystemClinicalId { get; set; } } + #endregion + + + #region 表格问题 + public class ClinicalTableQuestionBase + + { + + public Guid? Id { get; set; } + + /// + /// 问题名称 + /// + public string QuestionName { get; set; } = string.Empty; + + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; + + /// + /// 临床问题类型(分组,单选。) + /// + public ClinicalTableQuestionType ClinicalTableQuestionTypeEnum { get; set; } + + /// + /// 问题标识 + /// + public ClinicalTableQuestionMark? ClinicalTableQuestionMarkEnum { get; set; } + + /// + /// 最大长度 + /// + public int? MaxAnswerLength { get; set; } + + /// + /// 临床数据选项类型(无,自定义) + /// + public ClinicalOptionType ClinicalOptionTypeEnum { get; set; } + + /// + /// 自定义选项 + /// + public string TypeValue { get; set; } + + /// + /// 字典Code + /// + public string DictionaryCode { get; set; } = string.Empty; + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 是否必填 + /// + public bool IsRequired { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人 + /// + public Guid CreateUserId { get; set; } + + /// + /// 外层问题Id + /// + public Guid QuestionId { get; set; } + } + + + + /// + /// 项目临床数据问题 + /// + public class TrialClinicalTableQuestionDto : ClinicalTableQuestionBase + { + /// + /// 项目临床数据Id + /// + public Guid TrialClinicalId { get; set; } + + /// + /// 自定义计算标记 + /// + public ClinicalCalculateMark? ClinicalCalculateMarkEnum { get; set; } + + /// + /// 自定义计算问题 + /// + public string CalculateQuestions { get; set; } = "[]"; + } + + + + /// + /// 系统临床数据问题 + /// + public class SystemClinicalTableQuestionDto : ClinicalTableQuestionBase + { + /// + /// 系统临床数据Id + /// + public Guid SystemClinicalId { get; set; } + } + + + + /// + /// 查询临床数据基类 + /// + public class ClinicalTableQuestionQueryBase : PageInput + { + /// + /// 问题名称 + /// + public string QuestionName { get; set; } = string.Empty; + + /// + /// 外层问题Id + /// + public Guid QuestionId { get; set; } + } + + /// + /// 获取项目临床数据 + /// + public class TrialClinicalTableQuestionQuery : ClinicalTableQuestionQueryBase + { + + } + + /// + /// 获取系统临床数据 + /// + public class SystemClinicalTableQuestionQuery : ClinicalTableQuestionQueryBase + { + + } + + + #endregion + } diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 394b24dc2..d1c6e3868 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -20,6 +20,15 @@ namespace IRaCIS.Core.Application.Service #region 临床问题 CreateMap(); CreateMap(); + + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); #endregion CreateMap(); diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 78e3a6234..975ff7279 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -16,6 +16,95 @@ namespace IRaCIS.Core.Domain.Share public static readonly string Group = "group"; } + /// + /// 临床表格问题标识 + /// + public enum ClinicalTableQuestionMark + { + } + + /// + /// 临床表格问题类型 + /// + public enum ClinicalTableQuestionType + { + + /// + /// 单行文本框 + /// + Input = 3, + + /// + /// 多行文本框 + /// + TextArea = 4, + + /// + /// 单选题 + /// + Select = 5, + + /// + /// 多选题 + /// + Multiple = 6, + + /// + /// 时间 + /// + Time = 7 + } + + /// + /// 临床数据计算标记 + /// + public enum ClinicalCalculateMark + { + + /// + /// + + /// + Add = 1, + + /// + /// - + /// + Subtract = 2, + + /// + /// × + /// + Multiply = 3, + + /// + /// ÷ + /// + Divide = 4, + } + + + /// + /// 临床数据问题显示 + /// + public enum ClinicalQuestionShow + { + + /// + /// 显示 + /// + Show = 0, + + /// + /// 依赖父问题 + /// + Rely = 1, + + /// + /// 隐藏 + /// + Hide = 2 + } + /// /// 临床数据问题类型 /// diff --git a/IRaCIS.Core.Domain/Reading/ClinicalQuestion/SystemClinicalQuestion.cs b/IRaCIS.Core.Domain/Reading/ClinicalQuestion/SystemClinicalQuestion.cs index b22866c60..50e7e5fce 100644 --- a/IRaCIS.Core.Domain/Reading/ClinicalQuestion/SystemClinicalQuestion.cs +++ b/IRaCIS.Core.Domain/Reading/ClinicalQuestion/SystemClinicalQuestion.cs @@ -87,6 +87,21 @@ namespace IRaCIS.Core.Domain.Models /// public Guid CreateUserId { get; set; } + /// + /// 父问题Id + /// + public Guid? ParentId { get; set; } + + /// + /// 父问题触发值 + /// + public string ParentTriggerValue { get; set; } = string.Empty; + + /// + /// 显示类型 + /// + public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show; + } diff --git a/IRaCIS.Core.Domain/Reading/ClinicalQuestion/SystemClinicalTableQuestion.cs b/IRaCIS.Core.Domain/Reading/ClinicalQuestion/SystemClinicalTableQuestion.cs new file mode 100644 index 000000000..8a7eccaed --- /dev/null +++ b/IRaCIS.Core.Domain/Reading/ClinicalQuestion/SystemClinicalTableQuestion.cs @@ -0,0 +1,91 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-06-19 11:32:48 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + /// 系统临床表格问题 + /// + [Table("SystemClinicalTableQuestion")] + public class SystemClinicalTableQuestion : Entity, IAuditAdd + { + /// + /// 系统临床数据Id + /// + public Guid SystemClinicalId { get; set; } + + /// + /// 问题名称 + /// + public string QuestionName { get; set; } = string.Empty; + + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; + + /// + /// 临床问题类型(分组,单选。) + /// + public ClinicalTableQuestionType ClinicalTableQuestionTypeEnum { get; set; } + + /// + /// 问题标识 + /// + public ClinicalTableQuestionMark? ClinicalTableQuestionMarkEnum { get; set; } + + /// + /// 最大长度 + /// + public int? MaxAnswerLength { get; set; } + + /// + /// 临床数据选项类型(无,自定义) + /// + public ClinicalOptionType ClinicalOptionTypeEnum { get; set; } + + /// + /// 自定义选项 + /// + public string TypeValue { get; set; } + + /// + /// 字典Code + /// + public string DictionaryCode { get; set; } = string.Empty; + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 是否必填 + /// + public bool IsRequired { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人 + /// + public Guid CreateUserId { get; set; } + + /// + /// 外层问题Id + /// + public Guid QuestionId { get; set; } + + } + + +} diff --git a/IRaCIS.Core.Domain/Reading/ClinicalQuestion/TrialClinicalQuestion.cs b/IRaCIS.Core.Domain/Reading/ClinicalQuestion/TrialClinicalQuestion.cs index c8ba501ce..81f1e4da6 100644 --- a/IRaCIS.Core.Domain/Reading/ClinicalQuestion/TrialClinicalQuestion.cs +++ b/IRaCIS.Core.Domain/Reading/ClinicalQuestion/TrialClinicalQuestion.cs @@ -77,6 +77,11 @@ namespace IRaCIS.Core.Domain.Models /// public bool IsRequired { get; set; } = false; + /// + /// 系统临床问题Id + /// + public Guid? SystemClinicalQuestionId { get; set; } + /// /// 创建时间 /// @@ -87,6 +92,30 @@ namespace IRaCIS.Core.Domain.Models /// public Guid CreateUserId { get; set; } + /// + /// 父问题Id + /// + public Guid? ParentId { get; set; } + + /// + /// 父问题触发值 + /// + public string ParentTriggerValue { get; set; } = string.Empty; + + /// + /// 显示类型 + /// + public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show; + + /// + /// 自定义计算标记 + /// + public ClinicalCalculateMark? ClinicalCalculateMarkEnum { get; set; } + + /// + /// 自定义计算问题 + /// + public string CalculateQuestions { get; set; } = "[]"; } diff --git a/IRaCIS.Core.Domain/Reading/ClinicalQuestion/TrialClinicalTableQuestion.cs b/IRaCIS.Core.Domain/Reading/ClinicalQuestion/TrialClinicalTableQuestion.cs new file mode 100644 index 000000000..129dc32a5 --- /dev/null +++ b/IRaCIS.Core.Domain/Reading/ClinicalQuestion/TrialClinicalTableQuestion.cs @@ -0,0 +1,101 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-06-19 11:32:48 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + /// 项目临床表格问题 + /// + [Table("TrialClinicalTableQuestion")] + public class TrialClinicalTableQuestion : Entity, IAuditAdd + { + /// + /// 项目临床数据Id + /// + public Guid TrialClinicalId { get; set; } + + /// + /// 问题名称 + /// + public string QuestionName { get; set; } = string.Empty; + + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; + + /// + /// 临床问题类型(分组,单选。) + /// + public ClinicalTableQuestionType ClinicalTableQuestionTypeEnum { get; set; } + + /// + /// 问题标识 + /// + public ClinicalTableQuestionMark? ClinicalTableQuestionMarkEnum { get; set; } + + /// + /// 最大长度 + /// + public int? MaxAnswerLength { get; set; } + + /// + /// 临床数据选项类型(无,自定义) + /// + public ClinicalOptionType ClinicalOptionTypeEnum { get; set; } + + /// + /// 自定义选项 + /// + public string TypeValue { get; set; } + + /// + /// 字典Code + /// + public string DictionaryCode { get; set; } = string.Empty; + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 是否必填 + /// + public bool IsRequired { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人 + /// + public Guid CreateUserId { get; set; } + + /// + /// 外层问题Id + /// + public Guid QuestionId { get; set; } + + /// + /// 自定义计算标记 + /// + public ClinicalCalculateMark? ClinicalCalculateMarkEnum { get; set; } + + /// + /// 自定义计算问题 + /// + public string CalculateQuestions { get; set; } = "[]"; + + } + + +} diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 1d89987cd..b5c3bed5e 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -407,6 +407,10 @@ namespace IRaCIS.Core.Infra.EFCore public virtual DbSet TrialClinicalQuestion { get; set; } public virtual DbSet SystemClinicalQuestion { get; set; } + + public virtual DbSet SystemClinicalTableQuestion { get; set; } + + public virtual DbSet TrialClinicalTableQuestion { get; set; } #endregion diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude index 8242235de..6405bb42a 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 = "TrialClinicalQuestion"; + public static readonly string TableName = "SystemClinicalTableQuestion"; //ļ service Ƿҳ } #>