Uat_Study
parent
c68b1b877f
commit
93b74ccef3
|
@ -304,6 +304,60 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 验证医学审核问题
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
|
public async Task<IResponseOutput> VerifyReadingMedicineQuestion(ConfirmReadingMedicineQuestionInDto inDto)
|
||||||
|
{
|
||||||
|
var readingMedicineQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||||
|
.Select(x => new TrialQuestion()
|
||||||
|
{
|
||||||
|
Id = x.Id,
|
||||||
|
ReadingCategory = x.ReadingCategory,
|
||||||
|
ParentShowOrder = (int?)x.ParentQuestion.ShowOrder,
|
||||||
|
ShowOrder = x.ShowOrder,
|
||||||
|
}).ToListAsync();
|
||||||
|
if (readingMedicineQuestionList.Count == 0)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("当前未添加医学审核问题。请先添加医学审核问题,再进行确认。");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (readingMedicineQuestionList.Count() != readingMedicineQuestionList.Select(t => t.ShowOrder).Distinct().Count())
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("影像医学审核问题显示序号不能重复。");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (readingMedicineQuestionList.Where(t => t.ParentShowOrder != null).Any(t => t.ParentShowOrder > t.ShowOrder))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("父问题的显示序号要比子问题的显示序号小,请确认。");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var trialInfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
if (trialInfo.IsGlobalReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Global))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("当前项目启用了全局阅片,但未配置全局医学审核问题");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trialInfo.IsArbitrationReading ?? false && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Judge))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("当前项目启用了仲裁阅片,但未配置仲裁医学审核问题");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trialInfo.IsClinicalReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Oncology))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("当前项目启用了肿瘤学阅片,但未配置肿瘤学医学审核问题");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 确认医学审核问题
|
/// 确认医学审核问题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -311,7 +365,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task<IResponseOutput> ConfirmReadingMedicineQuestion(ConfirmReadingMedicineQuestionInDto inDto)
|
public async Task<IResponseOutput> ConfirmReadingMedicineQuestion(ConfirmReadingMedicineQuestionInDto inDto)
|
||||||
{
|
{
|
||||||
var readingMedicineQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId)
|
var readingMedicineQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||||
.Select(x => new TrialQuestion() {
|
.Select(x => new TrialQuestion()
|
||||||
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
ReadingCategory = x.ReadingCategory,
|
ReadingCategory = x.ReadingCategory,
|
||||||
ParentShowOrder = (int?)x.ParentQuestion.ShowOrder,
|
ParentShowOrder = (int?)x.ParentQuestion.ShowOrder,
|
||||||
|
@ -352,7 +407,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await _readingMedicineTrialQuestionRepository.BatchUpdateNoTrackingAsync(x => x.TrialId == inDto.TrialId, x => new ReadingMedicineTrialQuestion()
|
await _readingMedicineTrialQuestionRepository.BatchUpdateNoTrackingAsync(x => x.TrialId == inDto.TrialId, x => new ReadingMedicineTrialQuestion()
|
||||||
{
|
{
|
||||||
IsConfirm = true
|
IsConfirm = true
|
||||||
|
|
Loading…
Reference in New Issue