修改
This commit is contained in:
@@ -294,16 +294,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// 对象ID
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "ReadingId为null")]
|
||||
public Guid ReadingId { get; set; }
|
||||
public Guid? ReadingId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "SubjectId为null")]
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是访视
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "IsVisit为null")]
|
||||
public bool IsVisit { get; set; }
|
||||
public bool? IsVisit { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
public class AddOrUpdateReadingQuestionCriterionSystemInDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准ID
|
||||
/// </summary>
|
||||
public Guid CriterionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准
|
||||
/// </summary>
|
||||
public string CriterionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class ReadingQuestionCriterionSystemViewInDto:PageInput
|
||||
{
|
||||
public string CriterionName { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class ReadingQuestionSystemView
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统标准Id
|
||||
/// </summary>
|
||||
public Guid ReadingQuestionCriterionSystem { 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 ReadingQuestionSystemViewInDto : PageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统标准Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "ReadingQuestionCriterionSystemId为null")]
|
||||
public Guid ReadingQuestionCriterionSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 问题名称
|
||||
/// </summary>
|
||||
public string QuestionName { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class AddOrUpdateReadingQuestionSystemInDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统标准Id
|
||||
/// </summary>
|
||||
public Guid ReadingQuestionCriterionSystem { 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>
|
||||
/// 返回的对象
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准ID
|
||||
/// </summary>
|
||||
public Guid CriterionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准
|
||||
/// </summary>
|
||||
public string CriterionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -149,8 +149,8 @@ namespace IRaCIS.Application.Services
|
||||
var usedIdsQuery = _readingClinicalDataRepository.Where(x => x.ReadingId == inDto.ReadingId && x.Id != inDto.ReadingClinicalDataId).Select(x => x.ClinicalDataTrialSetId);
|
||||
List<GetTrialClinicalDataSelectOutDto> clinicalList = await _clinicalDataTrialSetRepository.Where(x=>x.TrialId==inDto.TrialId&&x.IsConfirm&&x.ClinicalDataSetName!= "既往局部治疗史")
|
||||
.Where(x=> !usedIdsQuery.Contains(x.Id))
|
||||
.WhereIf(inDto.IsVisit,x=>x.ClinicalDataLevel == ClinicalLevel.Subject||x.ClinicalDataLevel== ClinicalLevel.SubjectVisit)
|
||||
.WhereIf(!inDto.IsVisit, x => x.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataLevel == ClinicalLevel.Read)
|
||||
.WhereIf(inDto.IsVisit.Value,x=>x.ClinicalDataLevel == ClinicalLevel.Subject||x.ClinicalDataLevel== ClinicalLevel.SubjectVisit)
|
||||
.WhereIf(!inDto.IsVisit.Value, x => x.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataLevel == ClinicalLevel.Read)
|
||||
|
||||
.Select(x => new GetTrialClinicalDataSelectOutDto()
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Domain.Share.Reading;
|
||||
using MassTransit;
|
||||
using IRaCIS.Core.Application.Service.Reading;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
@@ -21,42 +22,113 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
||||
public IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
|
||||
private readonly IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystemRepository;
|
||||
private readonly IRepository<ReadingQuestionSystem> _readingQuestionSystemRepository;
|
||||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||
private readonly IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository;
|
||||
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||
|
||||
public ReadingQuestionService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||
|
||||
|
||||
IRepository<ReadingQuestionCriterionSystem> readingQuestionCriterionSystemRepository,
|
||||
IRepository<ReadingQuestionSystem> readingQuestionSystemRepository,
|
||||
IRepository<ClinicalDataTrialSet> ClinicalDataTrialSetRepository,
|
||||
IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
|
||||
IRepository<PreviousPDF> previousPDFRepository
|
||||
)
|
||||
{
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
|
||||
this._readingQuestionCriterionSystemRepository = readingQuestionCriterionSystemRepository;
|
||||
this._readingQuestionSystemRepository = readingQuestionSystemRepository;
|
||||
_clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository;
|
||||
_clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository;
|
||||
this._previousPDFRepository = previousPDFRepository;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增修改
|
||||
/// 新增修改系统问题标准
|
||||
/// </summary>
|
||||
/// <param name="indto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingQuestionCriterionSystem(AddOrUpdateReadingQuestionCriterionSystemInDto indto)
|
||||
{
|
||||
var entity = await _clinicalDataTrialSetRepository.InsertOrUpdateAsync(indto,true);
|
||||
var entity = await _readingQuestionCriterionSystemRepository.InsertOrUpdateAsync(indto,true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取系统问题标准
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ReadingQuestionCriterionSystemView>> GetReadingQuestionCriterionSystemList(ReadingQuestionCriterionSystemViewInDto inDto)
|
||||
{
|
||||
var query= _readingQuestionCriterionSystemRepository.AsQueryable()
|
||||
.WhereIf(!inDto.CriterionName.IsNullOrEmpty(), x => x.CriterionName.Contains(inDto.CriterionName))
|
||||
.ProjectTo<ReadingQuestionCriterionSystemView>(_mapper.ConfigurationProvider);
|
||||
return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(ReadingQuestionCriterionSystemView.CriterionName) : inDto.SortField,
|
||||
inDto.Asc);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除系统问题标准
|
||||
/// </summary>
|
||||
/// <param name="readingQuestionCriterionSystemId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{readingQuestionCriterionSystemId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteReadingQuestionCriterionSystem(Guid readingQuestionCriterionSystemId)
|
||||
{
|
||||
await _readingQuestionCriterionSystemRepository.DeleteFromQueryAsync(t => t.Id == readingQuestionCriterionSystemId);
|
||||
var success = await _readingQuestionCriterionSystemRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增修改系统问题
|
||||
/// </summary>
|
||||
/// <param name="indto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingQuestionSystem(AddOrUpdateReadingQuestionSystemInDto indto)
|
||||
{
|
||||
var entity = await _readingQuestionSystemRepository.InsertOrUpdateAsync(indto, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取系统问题
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ReadingQuestionSystemView>> GetReadingQuestionSystemList(ReadingQuestionSystemViewInDto inDto)
|
||||
{
|
||||
var query = _readingQuestionSystemRepository.AsQueryable()
|
||||
.Where(x=>x.ReadingQuestionCriterionSystemId==inDto.ReadingQuestionCriterionSystemId)
|
||||
.WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName))
|
||||
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type))
|
||||
.ProjectTo<ReadingQuestionSystemView>(_mapper.ConfigurationProvider);
|
||||
return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(ReadingQuestionSystemView.QuestionName) : inDto.SortField,
|
||||
inDto.Asc);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除系统问题
|
||||
/// </summary>
|
||||
/// <param name="readingQuestionSystemId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{readingQuestionSystemId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteReadingQuestionSystem(Guid readingQuestionSystemId)
|
||||
{
|
||||
await _readingQuestionSystemRepository.DeleteFromQueryAsync(t => t.Id == readingQuestionSystemId);
|
||||
var success = await _readingQuestionSystemRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Reading
|
||||
{
|
||||
public class AddOrUpdateReadingQuestionCriterionSystemInDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准ID
|
||||
/// </summary>
|
||||
public Guid CriterionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准
|
||||
/// </summary>
|
||||
public string CriterionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
//.ForMember(d => d.FileCount, u => u.MapFrom(s => s.ReadingClinicalDataPDFList.Count()));
|
||||
|
||||
CreateMap<ReadingClinicalDataPDF, GetReadingClinicalDataPDFListOutDto>();
|
||||
|
||||
|
||||
//.ForMember(d => d.SiteNames, u => u.MapFrom(s => s.ReadingPeriodSites.SelectMany(x => x.Site.SiteName).ToList()));
|
||||
|
||||
@@ -51,7 +50,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
CreateMap<ReadModuleAddOrEdit, ReadModule>();
|
||||
|
||||
#region 阅片问题
|
||||
|
||||
CreateMap<AddOrUpdateReadingQuestionCriterionSystemInDto, ReadingQuestionCriterionSystem>();
|
||||
CreateMap<ReadingQuestionCriterionSystem, ReadingQuestionCriterionSystemView>();
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user