This commit is contained in:
he
2022-11-18 14:05:54 +08:00
parent ee7e6d4541
commit 8e29769df4
13 changed files with 110 additions and 15 deletions
@@ -94,6 +94,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public bool CurrenShortBigger10 { get; set; }
/// <summary>
/// 淋巴结非靶病灶状态全部为消失
/// </summary>
public bool NonTargetStateIsLoss { get; set; }
/// <summary>
/// 该淋巴结靶病灶短径绝对增加值≥5 mm
/// </summary>
@@ -99,6 +99,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public ValueOfType? ValueType { get; set; }
/// <summary>
/// 自定义单位
/// </summary>
public string CustomUnit { get; set; } = string.Empty;
/// <summary>
/// 单位
/// </summary>
@@ -299,6 +299,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public ValueUnit? Unit { get; set; }
/// <summary>
/// 自定义单位
/// </summary>
public string CustomUnit { get; set; } = string.Empty;
/// <summary>
/// 数据来源
/// </summary>
@@ -834,6 +839,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public ValueUnit? Unit { get; set; }
/// <summary>
/// 自定义单位
/// </summary>
public string CustomUnit { get; set; } = string.Empty;
/// <summary>
/// 自定义计算标记
/// </summary>
@@ -1553,6 +1563,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public ValueUnit? Unit { get; set; }
/// <summary>
/// 自定义单位
/// </summary>
public string CustomUnit { get; set; } = string.Empty;
/// <summary>
/// 自定义计算标记
/// </summary>
@@ -431,6 +431,8 @@ namespace IRaCIS.Application.Services
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
//if (taskinfo.TaskState != TaskState.Effect)
//{
// throw new BusinessValidationFailedException($"当前任务已失效!");
@@ -448,8 +450,14 @@ namespace IRaCIS.Application.Services
#region
var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId)
.ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider).Where(x => x.IsShowInDicom && (x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.Group)).OrderBy(x => x.ShowOrder).ToListAsync();
var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId).ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
if (!criterionInfo.IseCRFShowInDicomReading)
{
qusetionList= qusetionList.Where(x => x.IsShowInDicom && (x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.Group)).OrderBy(x => x.ShowOrder).ToList();
}
var usedGurops = qusetionList.Where(x => x.Type == ReadingQestionType.Table).Select(x => x.GroupName).ToList();
qusetionList = qusetionList.Where(x => usedGurops.Contains(x.GroupName)).ToList();
@@ -150,6 +150,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
QuestionName = x.QuestionName,
ShowOrder = x.ShowOrder,
ValueType = x.ValueType,
CustomUnit=x.CustomUnit,
Unit = x.Unit,
ReportLayType=ReportLayType.Group,
}).ToList();
@@ -174,6 +175,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
OrderMark = x.OrderMark,
ValueType = x.ValueType,
Unit = x.Unit,
CustomUnit=x.Unit,
ReportLayType = ReportLayType.Question,
}).ToList();
@@ -128,6 +128,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
ShowOrder = x.ShowOrder,
ValueType = x.ValueType,
Unit = x.Unit,
CustomUnit=x.CustomUnit,
ReportLayType= ReportLayType.Group,
}).ToList();
@@ -150,6 +151,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
OrderMark = x.OrderMark,
ValueType = x.ValueType,
Unit = x.Unit,
CustomUnit=x.CustomUnit,
ReportLayType = ReportLayType.Question,
}).ToList();
@@ -1347,11 +1349,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 至少一个淋巴结靶病灶短径≥10 mm
CurrenShortBigger10 = true,
//淋巴结非靶病灶状态全部为消失
NonTargetStateIsLoss = true,
// 该淋巴结靶病灶短径绝对增加值≥5 mm
IsAddFive = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.IsAddFive && x.Answer.EqEnum(YesOrNoOrNa.Yes)).Count() > 0,
};
var nonTargetTableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NonTargetLesions).SelectMany(x => x.TableRowInfoList).ToList();
foreach (var item in nonTargetTableQuestion)
{
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes)))
{
// 淋巴结非靶病灶状态全部为消失
resultData.NonTargetStateIsLoss = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Answer).FirstOrDefault()== NoTargetState.Loss.GetEnumInt();
}
}
foreach (var item in tableQuestion)
@@ -1361,8 +1375,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 淋巴结的短径
resultData.DiameterLessThan10 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10;
// 至少一个淋巴结靶病灶短径≥10 mm
resultData.CurrenShortBigger10 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() >= 10;
}
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && !x.Answer.EqEnum(YesOrNoOrNa.Yes)))
@@ -1426,7 +1439,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
result = TargetAssessment.PR;
}
if (resultData.SumOfDiameter == 0 && resultData.DiameterLessThan10)
if (resultData.SumOfDiameter == 0 && resultData.DiameterLessThan10&&resultData.NonTargetStateIsLoss)
{
result = TargetAssessment.CR;
}
@@ -128,6 +128,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
ShowOrder = x.ShowOrder,
ValueType = x.ValueType,
Unit = x.Unit,
CustomUnit=x.CustomUnit,
ReportLayType = ReportLayType.Group,
}).ToList();
@@ -150,6 +151,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
OrderMark = x.OrderMark,
ValueType = x.ValueType,
Unit = x.Unit,
CustomUnit=x.CustomUnit,
ReportLayType = ReportLayType.Question,
}).ToList();
@@ -555,6 +555,16 @@ namespace IRaCIS.Core.Application.Contracts
/// </summary>
public string TypeValue { get; set; }
/// <summary>
/// 单位
/// </summary>
public ValueUnit? Unit { get; set; }
/// <summary>
/// 自定义单位
/// </summary>
public string CustomUnit { get; set; } = string.Empty;
/// <summary>
/// 是否启用
/// </summary>
@@ -723,6 +733,11 @@ namespace IRaCIS.Core.Application.Contracts
/// </summary>
public int? DigitPlaces { get; set; }
/// <summary>
/// eCRF报告是否显示在图像页面
/// </summary>
public bool IseCRFShowInDicomReading { get; set; } = false;
public bool IsFromSystem { get; set; } = false;
@@ -895,6 +910,11 @@ namespace IRaCIS.Core.Application.Contracts
/// </summary>
public Guid TrialReadingCriterionId { get; set; }
/// <summary>
/// eCRF报告是否显示在图像页面
/// </summary>
public bool IseCRFShowInDicomReading { get; set; }
public string GlobalUpdateType { get; set; } = string.Empty;
@@ -386,15 +386,14 @@ namespace IRaCIS.Core.Application
result.ReadingCriterionPageList = await _readingCriterionPageRepository.Where(x => x.TrialId == inDto.TrialId).ProjectTo<ReadingCriterionPageDto>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync();
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id==inDto.TrialReadingCriterionId).FirstOrDefaultAsync();
result.ReadingInfoSignTime = trialCriterion.ReadingInfoSignTime;
if (trialCriterion != null)
{
result.DigitPlaces = trialCriterion.DigitPlaces;
result.TrialCriterionId = trialCriterion.Id;
result.FormType = trialCriterion.FormType;
result.IsFromSystem = trialCriterion.ReadingQuestionCriterionSystemId != null;
result.IsMustGlobalReading = trialCriterion.IsMustGlobalReading;
result.IsSystemCriterion = trialCriterion.ReadingQuestionCriterionSystemId != null;
};
result.DigitPlaces = trialCriterion.DigitPlaces;
result.TrialCriterionId = trialCriterion.Id;
result.FormType = trialCriterion.FormType;
result.IsFromSystem = trialCriterion.ReadingQuestionCriterionSystemId != null;
result.IsMustGlobalReading = trialCriterion.IsMustGlobalReading;
result.IsSystemCriterion = trialCriterion.ReadingQuestionCriterionSystemId != null;
result.TrialQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm && x.TrialId == inDto.TrialId&&x.ReadingQuestionCriterionTrialId == result.TrialCriterionId
&&x.ReadingCriterionPageId==null)
@@ -466,6 +465,7 @@ namespace IRaCIS.Core.Application
IsReadingShowPreviousResults = inDto.IsReadingShowPreviousResults,
GlobalUpdateType=inDto.GlobalUpdateType,
ImagePlatform=inDto.ImagePlatform,
IseCRFShowInDicomReading=inDto.IseCRFShowInDicomReading,
ArbitrationRule= arbitration,
ReadingType = inDto.ReadingType,
IsGlobalReading = inDto.IsGlobalReading,