diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 351e54999..e8303a6e1 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -2129,6 +2129,53 @@ 是否是系统数据 + + + 医学审核问题 + + + + + 获取系统的医学审核问题 + + + + + + + 新增或修改系统医学审核问题 + + + + + + + 删除系统的医学审核问题 + + + + + + + 获取项目的医学审核问题 + + + + + + + 新增或修改项目医学审核问题 + + + + + + + 删除项目的医学审核问题 + + + + 项目外部人员 录入流程相关 @@ -2431,6 +2478,103 @@ SystemNoticeAddOrEdit 列表查询参数模型 + + + 类型 + + + + + 父问题触发 + + + + + 问题名称 + + + + + 是否是必须 + + + + + 排序 + + + + + 父问题ID + + + + + 类型值 + + + + + 是否启用 + + + + ReadingMedicineSystemQuestionQuery 列表查询参数模型 + + + ReadingMedicineSystemQuestionAddOrEdit 列表查询参数模型 + + + + 类型 + + + + + 父问题触发 + + + + + 问题名称 + + + + + 是否是必须 + + + + + 排序 + + + + + 父问题ID + + + + + 类型值 + + + + + 是否启用 + + + + ReadingMedicineTrialQuestionQuery 列表查询参数模型 + + + + 项目Id + + + + ReadingMedicineTrialQuestionAddOrEdit 列表查询参数模型 + TrialExternalUserView 列表视图模型 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs new file mode 100644 index 000000000..5d162b35b --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs @@ -0,0 +1,166 @@ +using System; +using IRaCIS.Core.Domain.Share; +using System.Collections.Generic; +namespace IRaCIS.Core.Application.ViewModel +{ + + public class ReadingMedicineSystemQuestionView + { + public Guid Id { get; set; } + + /// + /// 类型 + /// + public string Type { get; set; } + + /// + /// 父问题触发 + /// + public string ParentTriggerValue { get; set; } + + /// + /// 问题名称 + /// + public string QuestionName { get; set; } + + /// + /// 是否是必须 + /// + public bool IsRequired { get; set; } + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 父问题ID + /// + public Guid? ParentId { get; set; } + + /// + /// 类型值 + /// + public string TypeValue { get; set; } + + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } + } + + ///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; } + + } + + /// ReadingMedicineSystemQuestionAddOrEdit 列表查询参数模型 + public class ReadingMedicineSystemQuestionAddOrEdit + { + public Guid? Id { get; set; } + + /// + /// 类型 + /// + public string Type { get; set; } + + /// + /// 父问题触发 + /// + public string ParentTriggerValue { get; set; } + + /// + /// 问题名称 + /// + public string QuestionName { get; set; } + + /// + /// 是否是必须 + /// + public bool IsRequired { get; set; } + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 父问题ID + /// + public Guid? ParentId { get; set; } + + /// + /// 类型值 + /// + public string TypeValue { get; set; } + + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } + } + + public class ReadingMedicineTrialQuestionView + { + public Guid Id { get; set; } + public DateTime CreateTime { get; set; } + public string Type { get; set; } + public string ParentTriggerValue { get; set; } + public string QuestionName { get; set; } + public Guid UpdateUserId { get; set; } + public string TypeValue { get; set; } + public Guid CreateUserId { get; set; } + public Guid TrialId { get; set; } + public DateTime UpdateTime { get; set; } + public bool IsEnable { get; set; } + public bool IsRequired { get; set; } + public int ShowOrder { get; set; } + public Guid? ParentId { get; set; } + public bool? IsConfirm { get; set; } + } + + ///ReadingMedicineTrialQuestionQuery 列表查询参数模型 + public class ReadingMedicineTrialQuestionQuery:PageInput + { + /// + /// 项目Id + /// + public Guid TrialId { get; set; } + + public string Type { get; set; } + + public string ParentTriggerValue { get; set; } + + public string QuestionName { get; set; } + + public string TypeValue { get; set; } + + } + + /// ReadingMedicineTrialQuestionAddOrEdit 列表查询参数模型 + public class ReadingMedicineTrialQuestionAddOrEdit + { + public Guid Id { get; set; } + + public string Type { get; set; } + public string ParentTriggerValue { get; set; } + public string QuestionName { get; set; } + public string TypeValue { get; set; } + public Guid TrialId { get; set; } + + public bool IsEnable { get; set; } + public bool IsRequired { get; set; } + public int ShowOrder { get; set; } + public Guid? ParentId { get; set; } + public bool? IsConfirm { get; set; } + } + + +} + + diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index b9928fea9..9d5b599c0 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -41,16 +41,16 @@ namespace IRaCIS.Application.Services public ReadingImageTaskService( - IMapper mapper, - IRepository noneDicomStudyRepository, + IMapper mapper, + IRepository noneDicomStudyRepository, IRepository visitTaskRepository, - IRepository TrialRepository, + IRepository TrialRepository, IVisitTaskHelpeService visitTaskHelpeService, - IRepository subjectVisitRepository, - IRepository subjectRepository, - IRepository readingJudgeInfoRepository, - IRepository readModuleRepository, - IRepository readingTaskQuestionAnswerRepository, + IRepository subjectVisitRepository, + IRepository subjectRepository, + IRepository readingJudgeInfoRepository, + IRepository readModuleRepository, + IRepository readingTaskQuestionAnswerRepository, IRepository readingQuestionCriterionTrialRepository, IRepository readingQuestionTrialRepository ) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs new file mode 100644 index 000000000..daa4c5353 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/ReadingMedicineQuestionService.cs @@ -0,0 +1,122 @@ + +using IRaCIS.Core.Domain.Models; +using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Infra.EFCore.Common; + +namespace IRaCIS.Core.Application.Service +{ + /// + /// 医学审核问题 + /// + [ ApiExplorerSettings(GroupName = "Reading")] + public class ReadingMedicineQuestionService: BaseService + { + + private readonly IRepository _readingMedicineTrialQuestionRepository; + private readonly IRepository _readingMedicineSystemQuestionRepository; + + public ReadingMedicineQuestionService( + IRepository readingMedicineTrialQuestionRepository, + IRepository readingMedicineSystemQuestionRepository + ) + { + this._readingMedicineTrialQuestionRepository = readingMedicineTrialQuestionRepository; + this._readingMedicineSystemQuestionRepository = readingMedicineSystemQuestionRepository; + } + + + /// + /// 获取系统的医学审核问题 + /// + /// + /// + [HttpPost] + public async Task> GetReadingMedicineSystemQuestionList(ReadingMedicineSystemQuestionQuery inDto) + { + var query = _readingMedicineSystemQuestionRepository.AsQueryable() + .WhereIf(!inDto.TypeValue.IsNullOrEmpty(), x => x.TypeValue.Contains(inDto.TypeValue)) + .WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue)) + .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) + .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) + .ProjectTo(_mapper.ConfigurationProvider); + return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField.IsNullOrEmpty() ? nameof(ReadingMedicineSystemQuestionView.ShowOrder) : inDto.SortField, + inDto.Asc); + } + + /// + /// 新增或修改系统医学审核问题 + /// + /// + /// + [HttpPost] + public async Task AddOrUpdateReadingMedicineSystemQuestion(ReadingMedicineSystemQuestionAddOrEdit addOrEditReadingMedicineSystemQuestion) + { + var entity = await _readingMedicineSystemQuestionRepository.InsertOrUpdateAsync(addOrEditReadingMedicineSystemQuestion); + await _readingMedicineSystemQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Ok(entity.Id.ToString()); + } + + /// + /// 删除系统的医学审核问题 + /// + /// + /// + [HttpDelete("{id:guid}")] + public async Task DeleteReadingMedicineSystemQuestion(Guid id) + { + var success = await _readingMedicineSystemQuestionRepository.DeleteFromQueryAsync(t => t.Id == id); + var result = await _readingMedicineSystemQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Result(result); + } + + /// + /// 获取项目的医学审核问题 + /// + /// + /// + [HttpPost] + public async Task> GetReadingMedicineTrialQuestionList(ReadingMedicineTrialQuestionQuery inDto) + { + var query = _readingMedicineTrialQuestionRepository.AsQueryable() + .Where(x=>x.TrialId==inDto.TrialId) + .WhereIf(!inDto.TypeValue.IsNullOrEmpty(), x => x.TypeValue.Contains(inDto.TypeValue)) + .WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue)) + .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) + .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) + .ProjectTo(_mapper.ConfigurationProvider); + return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField.IsNullOrEmpty() ? nameof(ReadingMedicineTrialQuestionView.ShowOrder) : inDto.SortField, + inDto.Asc); + } + + /// + /// 新增或修改项目医学审核问题 + /// + /// + /// + [HttpPost] + public async Task AddOrUpdateReadingMedicineTrialQuestion(ReadingMedicineTrialQuestionAddOrEdit addOrEditReadingMedicineTrialQuestion) + { + var entity = await _readingMedicineTrialQuestionRepository.InsertOrUpdateAsync(addOrEditReadingMedicineTrialQuestion); + await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Ok(entity.Id.ToString()); + + } + + /// + /// 删除项目的医学审核问题 + /// + /// + /// + [HttpDelete("{id:guid}")] + public async Task DeleteReadingMedicineTrialQuestion(Guid id) + { + var success = await _readingMedicineTrialQuestionRepository.DeleteFromQueryAsync(t => t.Id == id); + var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Result(result); + } + + + } +} diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs index b37619c7f..219894afd 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs @@ -118,46 +118,7 @@ namespace IRaCIS.Application.Services return ResponseOutput.Ok(); } - ///// - ///// 设置系统问题标准是否生效 - ///// - ///// - ///// - //public async Task SetSystemReadingQuestionCriterionIsIsEnable(SetSystemReadingQuestionCriterionIsIsEnable inDto) - //{ - // await _readingQuestionCriterionSystemRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new ReadingQuestionCriterionSystem() - // { - // IsEnable = inDto.IsEnable - // }); - - // var result =await _readingQuestionCriterionSystemRepository.SaveChangesAsync(); - - // return ResponseOutput.Ok(result); - //} - - ///// - ///// 验证系统问题是否设置裁判答案 - ///// - ///// - ///// - //public async Task VerifySystemQuestionIsSetJudgeAnswer(VerifySystemQuestionIsSetJudgeAnswerInDto inDto) - //{ - // var result = await _readingQuestionTrialRepository.AnyAsync(x => x.ReadingQuestionSystemId == inDto.Id&&x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None); - // return ResponseOutput.Ok(result); - //} - - - ///// - ///// 验证项目问题是否设置裁判答案 - ///// - ///// - ///// - //public async Task VerifyTrialQuestionIsSetJudgeAnswer(VerifySystemQuestionIsSetJudgeAnswerInDto inDto) - //{ - // var result = await _readingQuestionTrialRepository.AnyAsync(x => x.Id == inDto.Id && x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None); - // return ResponseOutput.Ok(result); - //} - + /// /// 设置系统问题标准是否完成配置 /// @@ -166,11 +127,6 @@ namespace IRaCIS.Application.Services public async Task SetSystemReadingQuestionCriterionIsCompleteConfig(SetSystemReadingQuestionCriterionIsIsCompleteConfig inDto) { - //if (!inDto.IsCompleteConfig && await _readingQuestionCriterionTrialRepository.AnyAsync(x => x.ReadingQuestionCriterionSystemId == inDto.Id)) - //{ - // ResponseOutput.NotOk("当前标准已经运用到项目,操作失败"); - //} - if (!inDto.IsCompleteConfig) { var trialCriterionIds =await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.Id).Select(x => x.Id).ToListAsync(); @@ -401,9 +357,6 @@ namespace IRaCIS.Application.Services return ResponseOutput.Ok(entity.Id.ToString()); } - - - /// /// 获取系统问题 /// diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index cabf20880..1b7dd7e90 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -82,7 +82,13 @@ namespace IRaCIS.Core.Application.Service .ForMember(x => x.TaskId, y => y.MapFrom(z => z.Id)); #endregion + #region 医学审核 + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + #endregion } diff --git a/IRaCIS.Core.Domain/Reading/ReadingMedicineSystemQuestion.cs b/IRaCIS.Core.Domain/Reading/ReadingMedicineSystemQuestion.cs new file mode 100644 index 000000000..a96bbf35e --- /dev/null +++ b/IRaCIS.Core.Domain/Reading/ReadingMedicineSystemQuestion.cs @@ -0,0 +1,80 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2022-06-29 13:54:08 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + /// 阅片医学审核系统问题 + /// + [Table("ReadingMedicineSystemQuestion")] + public class ReadingMedicineSystemQuestion : Entity, IAuditUpdate, IAuditAdd + { + + /// + /// 类型 + /// + public string Type { get; set; } + + /// + /// 父问题触发 + /// + public string ParentTriggerValue { get; set; } + + /// + /// 问题名称 + /// + public string QuestionName { get; set; } + + /// + /// 是否是必须 + /// + public bool IsRequired { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 父问题ID + /// + public Guid? ParentId { get; set; } + + /// + /// 更新时间 + /// + public DateTime UpdateTime { get; set; } + + /// + /// 类型值 + /// + public string TypeValue { get; set; } + + /// + /// 修改人 + /// + public Guid UpdateUserId { get; set; } + + /// + /// 创建人 + /// + public Guid CreateUserId { get; set; } + + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } + + } +} diff --git a/IRaCIS.Core.Domain/Reading/ReadingMedicineTrialQuestion.cs b/IRaCIS.Core.Domain/Reading/ReadingMedicineTrialQuestion.cs new file mode 100644 index 000000000..01a722583 --- /dev/null +++ b/IRaCIS.Core.Domain/Reading/ReadingMedicineTrialQuestion.cs @@ -0,0 +1,92 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2022-06-29 14:04:36 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + ///阅片医学审核项目问题 + /// + [Table("ReadingMedicineTrialQuestion")] + public class ReadingMedicineTrialQuestion : Entity, IAuditUpdate, IAuditAdd + { + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 类型 + /// + public string Type { get; set; } + + /// + /// 父问题触发值 + /// + public string ParentTriggerValue { get; set; } + + /// + /// 问题名称 + /// + public string QuestionName { get; set; } + + /// + /// 修改人 + /// + public Guid UpdateUserId { get; set; } + + /// + /// 类型值 + /// + public string TypeValue { get; set; } + + /// + /// 创建人 + /// + public Guid CreateUserId { get; set; } + + /// + /// 项目ID + /// + public Guid TrialId { get; set; } + + /// + /// 修改时间 + /// + public DateTime UpdateTime { get; set; } + + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } + + /// + /// 是否必须 + /// + public bool IsRequired { get; set; } + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 父问题 + /// + public Guid? ParentId { get; set; } + + /// + /// 是否确认 + /// + public bool? IsConfirm { get; set; } + + } + + +} diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 61efb57fe..a6e6b9fb0 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -211,7 +211,11 @@ namespace IRaCIS.Core.Infra.EFCore public virtual DbSet ClinicalDataTrialSet { get; set; } public virtual DbSet ClinicalDataSystemSet { get; set; } - + + public virtual DbSet ReadingMedicineSystemQuestion { get; set; } + + public virtual DbSet ReadingMedicineTrialQuestion { get; set; } + #endregion #region Subject and Visit and study