Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
commit
c11e319472
|
@ -32,7 +32,9 @@ namespace IRaCIS.Core.Application.Filter
|
|||
|
||||
if (context.Exception.GetType() == typeof(BusinessValidationFailedException))
|
||||
{
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(context.Exception.Message,ApiResponseCodeEnum.BusinessValidationFailed));
|
||||
var error = context.Exception as BusinessValidationFailedException;
|
||||
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(context.Exception.Message, error!.Code));
|
||||
}
|
||||
else if(context.Exception.GetType() == typeof(QueryBusinessObjectNotExistException))
|
||||
{
|
||||
|
|
|
@ -2404,7 +2404,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// 分组ID
|
||||
/// </summary>
|
||||
public Guid? GroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统标准Id
|
||||
/// </summary>
|
||||
public Guid ReadingQuestionCriterionSystemId { get; set; }
|
||||
|
|
|
@ -530,6 +530,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var maxOrder = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId).OrderByDescending(x => x.ShowOrder).Select(x => x.ShowOrder).FirstOrDefaultAsync();
|
||||
List<TrialDataFromSystem> needList = await _readingMedicineSystemQuestionRepository
|
||||
.Where(x=>x.IsEnable)
|
||||
.Where(x=>x.LanguageType==inDto.LanguageType)
|
||||
.Where(x =>needAddCategory.Contains(x.ReadingCategory) && x.CriterionTypeEnum == criterionInfo.CriterionType)
|
||||
.Select(x => new TrialDataFromSystem()
|
||||
|
@ -554,6 +555,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
if (!needList.Any(x => x.ReadingCategory == item))
|
||||
{
|
||||
needList.AddRange(await _readingMedicineSystemQuestionRepository
|
||||
.Where(x => x.IsEnable)
|
||||
.Where(x => x.LanguageType == inDto.LanguageType)
|
||||
.Where(x => x.ReadingCategory == item && x.IsGeneral)
|
||||
.Select(x => new TrialDataFromSystem()
|
||||
|
@ -561,6 +563,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
ShowOrder = x.ShowOrder,
|
||||
IsEnable = x.IsEnable,
|
||||
|
||||
LanguageType = x.LanguageType,
|
||||
IsRequired = x.IsRequired,
|
||||
QuestionName = x.QuestionName,
|
||||
|
|
|
@ -1543,8 +1543,13 @@ namespace IRaCIS.Application.Services
|
|||
Answer = TargetState.Loss.GetEnumInt(),
|
||||
});
|
||||
|
||||
await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => inDto.MergeRowIdList.Contains(x.RowId) &&( x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis || x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.ShortAxis), x => new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = "0",
|
||||
});
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x=> inDto.MergeRowIdList.Contains(x.Id), x => new ReadingTableAnswerRowInfo()
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x=> inDto.MergeRowIdList.Contains(x.Id), x => new ReadingTableAnswerRowInfo()
|
||||
{
|
||||
MergeRowId=inDto.MergeMainRowId,
|
||||
SplitOrMergeType = SplitOrMergeType.Merge,
|
||||
|
@ -1587,29 +1592,29 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
var rowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).Include(x=>x.ReadingQuestionTrial).FirstNotNullAsync();
|
||||
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == rowinfo.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
// 需要排除的状态
|
||||
var needFilterState = new List<string>();
|
||||
|
||||
switch (rowinfo.ReadingQuestionTrial.LesionType)
|
||||
var query = _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == rowinfo.VisitTaskId && x.QuestionId == rowinfo.QuestionId && x.Id != rowinfo.Id)
|
||||
.Where(x => x.SplitOrMergeType != SplitOrMergeType.Split && x.SplitOrMergeType != SplitOrMergeType.SplitMain);
|
||||
|
||||
switch (taskInfo.TrialReadingCriterion.CriterionType)
|
||||
{
|
||||
//状态为“消失”、“无法评估”的靶病灶不可融合;
|
||||
case LesionType.TargetLesion:
|
||||
needFilterState = new List<string>() {
|
||||
TargetState.Loss.GetEnumInt(),
|
||||
TargetState.UnableEvaluate.GetEnumInt(),
|
||||
string.Empty,
|
||||
};
|
||||
|
||||
case CriterionType.Lugano2014:
|
||||
query = query.Where(x => x.MeasureData == string.Empty ||
|
||||
(x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && y.Answer == TargetState.Loss.GetEnumInt()) &&
|
||||
x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.IsLymph && y.Answer == ReadingYesOrNo.No.GetEnumInt())
|
||||
));
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var result = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == rowinfo.VisitTaskId && x.QuestionId == rowinfo.QuestionId && x.Id != rowinfo.Id)
|
||||
// 筛选状态
|
||||
.Where(x => x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && !needFilterState.Contains(y.Answer)))
|
||||
.Where(x=>x.SplitOrMergeType!=SplitOrMergeType.Split&&x.SplitOrMergeType!=SplitOrMergeType.SplitMain)
|
||||
.Select(x => new GetCanMergeLesionOutDto()
|
||||
var result = await query
|
||||
.Select(x => new GetCanMergeLesionOutDto()
|
||||
{
|
||||
RowId = x.Id,
|
||||
RowIndex = x.RowIndex,
|
||||
|
@ -2600,7 +2605,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
if (currentSubject == null)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]);
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
|
||||
task = currentSubject.UnReadCanReadTaskList.Select(x => new GetReadingTaskDto()
|
||||
|
@ -2627,7 +2632,7 @@ namespace IRaCIS.Application.Services
|
|||
var count = await query.CountAsync();
|
||||
if (count == 0)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]);
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
Random random = new Random();
|
||||
var skipcount = 0;
|
||||
|
@ -2653,7 +2658,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
if (task == null)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]);
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
|
||||
if (task.SubjectCode.IsNullOrEmpty())
|
||||
|
|
|
@ -285,7 +285,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
//qusetionList = qusetionList.Where(x => x.ParentId == null).ToList();
|
||||
|
||||
groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
|
||||
groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group ).ToList();
|
||||
groupList.ForEach(x =>
|
||||
{
|
||||
this.FindSystemChildQuestion(x, qusetionList, tableQuestionList);
|
||||
|
@ -308,7 +308,7 @@ namespace IRaCIS.Application.Services
|
|||
/// <param name="tableQuestions"></param>
|
||||
public void FindSystemChildQuestion(GetSystemReadingQuestionOutDto item, List<GetSystemReadingQuestionOutDto> questionlists, List<TableQuestionDataInfo> tableQuestions)
|
||||
{
|
||||
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName)).ToList();
|
||||
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupId == item.Id)).ToList();
|
||||
|
||||
item.Childrens.AddRange(tableQuestions.Where(x => x.ReadingQuestionId == item.Id).Select(x => new GetSystemReadingQuestionOutDto
|
||||
{
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
using System;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using System;
|
||||
|
||||
namespace IRaCIS.Core.Infrastructure
|
||||
{
|
||||
public class BusinessValidationFailedException : Exception
|
||||
{
|
||||
|
||||
public BusinessValidationFailedException()
|
||||
public ApiResponseCodeEnum Code { get; set; }
|
||||
|
||||
public BusinessValidationFailedException()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public BusinessValidationFailedException( string message) : base(message)
|
||||
public BusinessValidationFailedException(string message, ApiResponseCodeEnum code = ApiResponseCodeEnum.BusinessValidationFailed) : base(message)
|
||||
{
|
||||
}
|
||||
Code = code;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace IRaCIS.Core.Infrastructure.Extention
|
|||
NeedTips = 5,
|
||||
|
||||
|
||||
CloseCurrentWindows=6,
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue