Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
This commit is contained in:
+36
-22
@@ -78,6 +78,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
/// 上一次访视Id
|
||||
/// </summary>
|
||||
public Guid? lastVisitTaskId;
|
||||
|
||||
/// <summary>
|
||||
/// 首次转变的任务ID
|
||||
/// </summary>
|
||||
public Guid? firstChangeTaskId;
|
||||
#endregion
|
||||
|
||||
#region 删除病灶获取起始病灶序号
|
||||
@@ -484,8 +489,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
//被评估为NE的单个靶病灶
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NETarget,GetStringFun=GetNETarget},
|
||||
|
||||
// 与前一访视SOD相比变化量
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.LastVisitSODChange,GetDecimalNullFun=GetLastTaskSODChange,IsConvertedTask=true},
|
||||
// 与触发iRECIST访视相比SOD变化量
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.ComparedTriggeringSODChange,GetDecimalNullFun=GetComparedTriggeringSODChange,IsConvertedTask=true},
|
||||
|
||||
// 新靶病灶直径之和(iSOD)
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.ISOD,GetDecimalNullFun=GetiSODData,IsConvertedTask=true},
|
||||
@@ -579,6 +584,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
{
|
||||
QuestionType.ISOD,
|
||||
QuestionType.ComparedTriggeringiSODChange,
|
||||
QuestionType.ComparedTriggeringSODChange,
|
||||
QuestionType.TargetLesion,
|
||||
QuestionType.NoTargetLesion,
|
||||
QuestionType.NewLesions,
|
||||
@@ -1321,7 +1327,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal?> GetLastTaskSODChange(ReadingCalculateDto inDto)
|
||||
public async Task<decimal?> GetComparedTriggeringSODChange(ReadingCalculateDto inDto)
|
||||
{
|
||||
var lastTaskId = await this.GetLastVisitTaskId(inDto);
|
||||
var lastSOD = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SOD).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
||||
@@ -1658,17 +1664,25 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
private async Task<Guid> GetFirstChangeTaskId(ReadingCalculateDto inDto)
|
||||
{
|
||||
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
var firstChangeTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
||||
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
|
||||
x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
||||
x.DoctorUserId == taskinfo.DoctorUserId &&
|
||||
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
||||
x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == taskinfo.ArmEnum
|
||||
&& x.BeforeConvertedTaskId!=null && x.TaskState == TaskState.Effect
|
||||
).OrderBy(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
|
||||
return firstChangeTaskId;
|
||||
if (firstChangeTaskId != null)
|
||||
{
|
||||
return firstChangeTaskId.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
var taskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
||||
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
|
||||
x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
||||
x.DoctorUserId == taskinfo.DoctorUserId &&
|
||||
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
||||
x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == taskinfo.ArmEnum
|
||||
&& x.BeforeConvertedTaskId != null && x.TaskState == TaskState.Effect
|
||||
).OrderBy(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
firstChangeTaskId = taskId;
|
||||
return taskId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
@@ -1723,7 +1737,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
var lastVisitTaskId = await GetLastVisitTaskId(inDto);
|
||||
var targetLesionQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.TargetLesion).Select(x => x.QuestionId).FirstOrDefault();
|
||||
|
||||
var firstChangeTaskId = await GetFirstChangeTaskId(inDto);
|
||||
var sodQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SOD).Select(x => x.QuestionId).FirstOrDefault();
|
||||
IRECISTTargetLesionDto resultData = new IRECISTTargetLesionDto()
|
||||
{
|
||||
@@ -1738,7 +1752,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
MeetRECISTPD = (await GetTargetLesionEvaluate(inDto)) == TargetAssessment.PD.GetEnumInt(),
|
||||
|
||||
// 本次访视SOD与触发iRECIST访视相比本次访视SOD增加不小于5mm
|
||||
SODTiggerAddGreaterThan5 = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ComparedTriggeringiSODChange).Sum(x => x.Answer.IsNullOrEmptyReturn0()) >= 5,
|
||||
SODTiggerAddGreaterThan5 = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ComparedTriggeringSODChange).Sum(x => x.Answer.IsNullOrEmptyReturn0()) >= 5,
|
||||
|
||||
|
||||
//比整体访视期间最低点SOD增加≥20 %
|
||||
LowSodAddGreaterThan20Percent = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.LowPercent).Sum(x => x.Answer.IsNullOrEmptyReturn0()) >= 20,
|
||||
@@ -1991,7 +2006,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
/// {
|
||||
/// 疗效为 ND
|
||||
/// }
|
||||
/// else if (上一访视新靶病灶评估为“iUPD” && 满足iSOD增加5mm)
|
||||
/// else if (上一访视新靶病灶评估为“iUPD” && 与触发iRECIS任务iSod增加大于5mm)
|
||||
/// {
|
||||
/// 疗效为 iCPD
|
||||
/// }
|
||||
@@ -2032,9 +2047,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
LastTaskNewTargetLesion = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastVisitTaskId && x.ReadingQuestionTrialId == newTargetLesionQuestionId)
|
||||
.Select(x => x.Answer).FirstOrDefaultAsync()) ?? string.Empty,
|
||||
|
||||
//SOD增加5mm以上
|
||||
ISODAdd5mm = await GetiSODData(inDto) - (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastVisitTaskId && x.ReadingQuestionTrialId == isodQuestionId)
|
||||
.Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0() >= 5,
|
||||
//与触发iRECIS任务iSod增加大于5mm
|
||||
ISODAdd5mm = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ComparedTriggeringiSODChange).Sum(x => x.Answer.IsNullOrEmptyReturn0()) >= 5,
|
||||
|
||||
//有"存在"状态的新靶病灶
|
||||
HaveExixtsState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)),
|
||||
@@ -2084,8 +2098,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
// 疗效为 ND
|
||||
result = NewTargetLesionAssessment.ND;
|
||||
}
|
||||
// else if (上一访视新靶病灶评估为“iUPD” && 满足iSOD增加5mm)
|
||||
else if(data.LastTaskNewTargetLesion.EqEnum(NewTargetLesionAssessment.iUPD)&&data.ISODAdd5mm)
|
||||
// else if (上一访视新靶病灶评估为“iUPD” && 与触发iRECIS任务iSod增加大于5mm)
|
||||
else if (data.LastTaskNewTargetLesion.EqEnum(NewTargetLesionAssessment.iUPD)&&data.ISODAdd5mm)
|
||||
{
|
||||
// 疗效为 iCPD
|
||||
result = NewTargetLesionAssessment.iCPD;
|
||||
|
||||
Reference in New Issue
Block a user