代码修改
This commit is contained in:
@@ -23,12 +23,21 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
private readonly IRepository<SystemClinicalQuestion> _systemClinicalQuestionRepository;
|
||||
|
||||
|
||||
private readonly IRepository<SystemClinicalTableQuestion> _systemClinicalTableQuestionRepository;
|
||||
|
||||
private readonly IRepository<TrialClinicalTableQuestion> _trialClinicalTableQuestionRepository;
|
||||
|
||||
public ClinicalQuestionService(IRepository<TrialClinicalQuestion> trialClinicalQuestionRepository,
|
||||
IRepository<SystemClinicalTableQuestion> systemClinicalTableQuestionRepository,
|
||||
IRepository<TrialClinicalTableQuestion> trialClinicalTableQuestionRepository,
|
||||
IRepository<SystemClinicalQuestion> systemClinicalQuestionRepository
|
||||
)
|
||||
{
|
||||
_systemClinicalTableQuestionRepository = systemClinicalTableQuestionRepository;
|
||||
_trialClinicalQuestionRepository = trialClinicalQuestionRepository;
|
||||
_systemClinicalQuestionRepository = systemClinicalQuestionRepository;
|
||||
_trialClinicalTableQuestionRepository = trialClinicalTableQuestionRepository;
|
||||
_systemClinicalQuestionRepository = systemClinicalQuestionRepository;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,5 +163,106 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 系统表格问题
|
||||
|
||||
/// <summary>
|
||||
/// 获取系统表格问题
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SystemClinicalTableQuestionDto>> GetSystemClinicalTableQuestionList(SystemClinicalTableQuestionQuery inQuery)
|
||||
{
|
||||
|
||||
var systemClinicalTableQuestionQueryable = this._systemClinicalTableQuestionRepository
|
||||
.Where(x=>x.QuestionId==inQuery.QuestionId)
|
||||
.ProjectTo<SystemClinicalTableQuestionDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await systemClinicalTableQuestionQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(SystemClinicalTableQuestion.ShowOrder) : inQuery.SortField,
|
||||
inQuery.Asc);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增或修改系统表格问题
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateSystemClinicalTableQuestion(SystemClinicalTableQuestionDto inDto)
|
||||
{
|
||||
|
||||
var entity = await _systemClinicalTableQuestionRepository.InsertOrUpdateAsync(inDto, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除系统表格问题
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{id:guid}")]
|
||||
public async Task<IResponseOutput> DeleteSystemClinicalTableQuestion(Guid id)
|
||||
{
|
||||
var success = await _systemClinicalTableQuestionRepository.DeleteFromQueryAsync(t => t.Id == id, true);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 项目表格问题
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目表格问题
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialClinicalTableQuestionDto>> GetTrialClinicalTableQuestionList(TrialClinicalTableQuestionQuery inQuery)
|
||||
{
|
||||
|
||||
var trialClinicalTableQuestionQueryable = this._trialClinicalTableQuestionRepository
|
||||
.Where(x => x.QuestionId == inQuery.QuestionId)
|
||||
.ProjectTo<TrialClinicalTableQuestionDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await trialClinicalTableQuestionQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TrialClinicalTableQuestion.ShowOrder) : inQuery.SortField,
|
||||
inQuery.Asc);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增或修改项目表格问题
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialClinicalTableQuestion(TrialClinicalTableQuestionDto inDto)
|
||||
{
|
||||
|
||||
var entity = await _trialClinicalTableQuestionRepository.InsertOrUpdateAsync(inDto, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除项目表格问题
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{id:guid}")]
|
||||
public async Task<IResponseOutput> DeleteTrialClinicalTableQuestion(Guid id)
|
||||
{
|
||||
var success = await _trialClinicalTableQuestionRepository.DeleteFromQueryAsync(t => t.Id == id, true);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,16 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
|
||||
#region 外层问题
|
||||
/// <summary>
|
||||
/// 临床问题基本信息
|
||||
/// </summary>
|
||||
public class ClinicalQuestionBase
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -69,6 +73,21 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// 是否必填
|
||||
/// </summary>
|
||||
public bool IsRequired { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 父问题Id
|
||||
/// </summary>
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父问题触发值
|
||||
/// </summary>
|
||||
public string ParentTriggerValue { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 显示类型
|
||||
/// </summary>
|
||||
public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -103,12 +122,22 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// <summary>
|
||||
/// 项目临床数据问题
|
||||
/// </summary>
|
||||
public class TrialClinicalQuestionDto: ClinicalQuestionBase
|
||||
public class TrialClinicalQuestionDto : ClinicalQuestionBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目临床数据Id
|
||||
/// </summary>
|
||||
public Guid TrialClinicalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算标记
|
||||
/// </summary>
|
||||
public ClinicalCalculateMark? ClinicalCalculateMarkEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算问题
|
||||
/// </summary>
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题名称
|
||||
/// </summary>
|
||||
public string QuestionName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 问题英文名称
|
||||
/// </summary>
|
||||
public string QuestionEnName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 临床问题类型(分组,单选。)
|
||||
/// </summary>
|
||||
public ClinicalTableQuestionType ClinicalTableQuestionTypeEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题标识
|
||||
/// </summary>
|
||||
public ClinicalTableQuestionMark? ClinicalTableQuestionMarkEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大长度
|
||||
/// </summary>
|
||||
public int? MaxAnswerLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 临床数据选项类型(无,自定义)
|
||||
/// </summary>
|
||||
public ClinicalOptionType ClinicalOptionTypeEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义选项
|
||||
/// </summary>
|
||||
public string TypeValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字典Code
|
||||
/// </summary>
|
||||
public string DictionaryCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int ShowOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否必填
|
||||
/// </summary>
|
||||
public bool IsRequired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外层问题Id
|
||||
/// </summary>
|
||||
public Guid QuestionId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 项目临床数据问题
|
||||
/// </summary>
|
||||
public class TrialClinicalTableQuestionDto : ClinicalTableQuestionBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目临床数据Id
|
||||
/// </summary>
|
||||
public Guid TrialClinicalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算标记
|
||||
/// </summary>
|
||||
public ClinicalCalculateMark? ClinicalCalculateMarkEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算问题
|
||||
/// </summary>
|
||||
public string CalculateQuestions { get; set; } = "[]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 系统临床数据问题
|
||||
/// </summary>
|
||||
public class SystemClinicalTableQuestionDto : ClinicalTableQuestionBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统临床数据Id
|
||||
/// </summary>
|
||||
public Guid SystemClinicalId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询临床数据基类
|
||||
/// </summary>
|
||||
public class ClinicalTableQuestionQueryBase : PageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 问题名称
|
||||
/// </summary>
|
||||
public string QuestionName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 外层问题Id
|
||||
/// </summary>
|
||||
public Guid QuestionId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目临床数据
|
||||
/// </summary>
|
||||
public class TrialClinicalTableQuestionQuery : ClinicalTableQuestionQueryBase
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取系统临床数据
|
||||
/// </summary>
|
||||
public class SystemClinicalTableQuestionQuery : ClinicalTableQuestionQueryBase
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,15 @@ namespace IRaCIS.Core.Application.Service
|
||||
#region 临床问题
|
||||
CreateMap<TrialClinicalQuestion, TrialClinicalQuestionDto>();
|
||||
CreateMap<TrialClinicalQuestionDto, TrialClinicalQuestion>();
|
||||
|
||||
CreateMap<SystemClinicalQuestion, SystemClinicalQuestionDto>();
|
||||
CreateMap<SystemClinicalQuestionDto, SystemClinicalQuestion>();
|
||||
|
||||
CreateMap<SystemClinicalTableQuestion, SystemClinicalTableQuestionDto>();
|
||||
CreateMap<SystemClinicalTableQuestionDto, SystemClinicalTableQuestion>();
|
||||
|
||||
CreateMap<TrialClinicalTableQuestion, TrialClinicalTableQuestionDto>();
|
||||
CreateMap<TrialClinicalTableQuestionDto, TrialClinicalTableQuestion>();
|
||||
#endregion
|
||||
|
||||
CreateMap<VisitTask, VisitTaskDto>();
|
||||
|
||||
Reference in New Issue
Block a user