修改
This commit is contained in:
@@ -7,7 +7,26 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
public class AddOrUpdateReadingQuestionCriterionSystemInDto
|
||||
|
||||
public class AddOrUpdateReadingQuestionCriterionTrialInDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准
|
||||
/// </summary>
|
||||
public string CriterionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; }
|
||||
}
|
||||
|
||||
public class AddOrUpdateReadingQuestionCriterionSystemInDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
@@ -32,21 +51,33 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// </summary>
|
||||
public class ReadingQuestionCriterionSystemViewInDto:PageInput
|
||||
{
|
||||
public string CriterionName { get; set; }
|
||||
public string CriterionName { get; set; }=String.Empty;
|
||||
}
|
||||
|
||||
|
||||
public class ReadingQuestionSystemView
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class ReadingQuestionCriterionTrialViewInDto : PageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public string CriterionName { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
public class ReadingQuestionTrialView
|
||||
{
|
||||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统标准Id
|
||||
/// </summary>
|
||||
public Guid ReadingQuestionCriterionSystem { get; set; }
|
||||
public Guid ReadingQuestionCriterionTrialId { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
@@ -87,12 +118,86 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public bool IsEnable { get; set; }
|
||||
}
|
||||
|
||||
public class ReadingQuestionSystemView
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统标准Id
|
||||
/// </summary>
|
||||
public Guid ReadingQuestionCriterionSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父问题触发
|
||||
/// </summary>
|
||||
public string ParentTriggerValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题名称
|
||||
/// </summary>
|
||||
public string QuestionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是必须
|
||||
/// </summary>
|
||||
public bool IsRequired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int ShowOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父问题ID
|
||||
/// </summary>
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 类型值
|
||||
/// </summary>
|
||||
public string TypeValue { get; set; }
|
||||
|
||||
public bool IsEnable { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class ReadingQuestionTrialViewInDto : PageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统标准Id
|
||||
/// </summary>
|
||||
[NotDefault]
|
||||
public Guid ReadingQuestionCriterionTrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 问题名称
|
||||
/// </summary>
|
||||
public string QuestionName { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class ReadingQuestionSystemViewInDto : PageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统标准Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "ReadingQuestionCriterionSystemId为null")]
|
||||
[NotDefault]
|
||||
public Guid ReadingQuestionCriterionSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -117,7 +222,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// <summary>
|
||||
/// 系统标准Id
|
||||
/// </summary>
|
||||
public Guid ReadingQuestionCriterionSystem { get; set; }
|
||||
public Guid ReadingQuestionCriterionSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
@@ -158,6 +263,63 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public bool IsEnable { get; set; } = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class AddOrUpdateReadingQuestionTrialInDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统标准Id
|
||||
/// </summary>
|
||||
public Guid ReadingQuestionCriterionTrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父问题触发
|
||||
/// </summary>
|
||||
public string ParentTriggerValue { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 问题名称
|
||||
/// </summary>
|
||||
public string QuestionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是必须
|
||||
/// </summary>
|
||||
public bool IsRequired { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int ShowOrder { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 父问题ID
|
||||
/// </summary>
|
||||
public Guid? ParentId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 类型值
|
||||
/// </summary>
|
||||
public string TypeValue { get; set; }
|
||||
|
||||
public bool IsEnable { get; set; } = false;
|
||||
}
|
||||
|
||||
|
||||
public class ReadingQuestionCriterionSystemView
|
||||
{
|
||||
/// <summary>
|
||||
@@ -180,4 +342,37 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class ReadingQuestionCriterionTrialView
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的对象
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统标准ID
|
||||
/// </summary>
|
||||
public Guid? ReadingQuestionCriterionSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准
|
||||
/// </summary>
|
||||
public string CriterionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是系统数据
|
||||
/// </summary>
|
||||
public bool IsSystemData {
|
||||
get {
|
||||
return this.ReadingQuestionCriterionSystemId != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,9 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
public IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystemRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
||||
private readonly IRepository<ReadingQuestionSystem> _readingQuestionSystemRepository;
|
||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||
private readonly IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository;
|
||||
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||
@@ -31,7 +33,9 @@ namespace IRaCIS.Application.Services
|
||||
public ReadingQuestionService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||
|
||||
IRepository<ReadingQuestionCriterionSystem> readingQuestionCriterionSystemRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
||||
IRepository<ReadingQuestionSystem> readingQuestionSystemRepository,
|
||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||
IRepository<ClinicalDataTrialSet> ClinicalDataTrialSetRepository,
|
||||
IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
|
||||
IRepository<PreviousPDF> previousPDFRepository
|
||||
@@ -39,7 +43,9 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
this._readingQuestionCriterionSystemRepository = readingQuestionCriterionSystemRepository;
|
||||
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
||||
this._readingQuestionSystemRepository = readingQuestionSystemRepository;
|
||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||
_clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository;
|
||||
_clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository;
|
||||
this._previousPDFRepository = previousPDFRepository;
|
||||
@@ -130,5 +136,88 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增修改项目问题标准(项目)
|
||||
/// </summary>
|
||||
/// <param name="indto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingQuestionCriterionTrial(AddOrUpdateReadingQuestionCriterionTrialInDto indto)
|
||||
{
|
||||
var entity = await _readingQuestionCriterionTrialRepository.InsertOrUpdateAsync(indto, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目问题标准(项目)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ReadingQuestionCriterionTrialView>> GetReadingQuestionCriterionTrialList(ReadingQuestionCriterionTrialViewInDto inDto)
|
||||
{
|
||||
var query = _readingQuestionCriterionTrialRepository.AsQueryable()
|
||||
.Where(x=>x.TrialId==inDto.TrialId)
|
||||
.WhereIf(!inDto.CriterionName.IsNullOrEmpty(), x => x.CriterionName.Contains(inDto.CriterionName))
|
||||
.ProjectTo<ReadingQuestionCriterionTrialView>(_mapper.ConfigurationProvider);
|
||||
return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(ReadingQuestionCriterionTrialView.CriterionName) : inDto.SortField,
|
||||
inDto.Asc);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除项目问题标准(项目)
|
||||
/// </summary>
|
||||
/// <param name="readingQuestionCriterionTrialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{readingQuestionCriterionTrialId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteReadingQuestionCriterionTrial(Guid readingQuestionCriterionTrialId)
|
||||
{
|
||||
await _readingQuestionCriterionTrialRepository.DeleteFromQueryAsync(t => t.Id == readingQuestionCriterionTrialId);
|
||||
var success = await _readingQuestionCriterionTrialRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增修改项目问题(项目)
|
||||
/// </summary>
|
||||
/// <param name="indto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingQuestionTrial(AddOrUpdateReadingQuestionTrialInDto indto)
|
||||
{
|
||||
var entity = await _readingQuestionTrialRepository.InsertOrUpdateAsync(indto, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目问题(项目)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ReadingQuestionTrialView>> GetReadingQuestionTrialList(ReadingQuestionTrialViewInDto inDto)
|
||||
{
|
||||
var query = _readingQuestionTrialRepository.AsQueryable()
|
||||
.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))
|
||||
.ProjectTo<ReadingQuestionTrialView>(_mapper.ConfigurationProvider);
|
||||
return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(ReadingQuestionTrialView.QuestionName) : inDto.SortField,
|
||||
inDto.Asc);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除项目问题(项目)
|
||||
/// </summary>
|
||||
/// <param name="readingQuestionTrialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{readingQuestionTrialId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteReadingQuestionTrial(Guid readingQuestionTrialId)
|
||||
{
|
||||
await _readingQuestionTrialRepository.DeleteFromQueryAsync(t => t.Id == readingQuestionTrialId);
|
||||
var success = await _readingQuestionTrialRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,18 @@ namespace IRaCIS.Core.Application.Service
|
||||
#region 阅片问题
|
||||
CreateMap<AddOrUpdateReadingQuestionCriterionSystemInDto, ReadingQuestionCriterionSystem>();
|
||||
CreateMap<ReadingQuestionCriterionSystem, ReadingQuestionCriterionSystemView>();
|
||||
|
||||
|
||||
CreateMap<AddOrUpdateReadingQuestionSystemInDto, ReadingQuestionSystem>();
|
||||
CreateMap<ReadingQuestionSystem, ReadingQuestionSystemView>();
|
||||
|
||||
|
||||
CreateMap<AddOrUpdateReadingQuestionCriterionTrialInDto, ReadingQuestionCriterionTrial>();
|
||||
CreateMap<ReadingQuestionCriterionTrial, ReadingQuestionCriterionTrialView>();
|
||||
|
||||
|
||||
CreateMap<AddOrUpdateReadingQuestionTrialInDto, ReadingQuestionTrial>();
|
||||
CreateMap<ReadingQuestionTrial, ReadingQuestionTrialView>();
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user