修改
This commit is contained in:
@@ -266,4 +266,26 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
/// </summary>
|
||||
public bool ExixtsUnevaluableState { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IRECIST新病灶Dto
|
||||
/// </summary>
|
||||
public class IRECISTNewLesionAssessmentDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 上一次任务的新病灶评估为iUPD
|
||||
/// </summary>
|
||||
public bool LastTaskNewLesioniUPD { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IRECIST整体肿瘤评估
|
||||
/// </summary>
|
||||
public class IRECISTTargetLesionEvaluateDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 上一次任务的评估为iUPD或者iCPD
|
||||
/// </summary>
|
||||
public bool LastTaskLesioniUPDOriCPD { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
ReadingCalculateDto readingData = new ReadingCalculateDto()
|
||||
{
|
||||
SubjectId = visitTask.SubjectId,
|
||||
TaskBlindName= visitTask.TaskBlindName,
|
||||
TaskBlindName = visitTask.TaskBlindName,
|
||||
IsConvertedTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(x => x.IsConvertedTask).FirstOrDefaultAsync(),
|
||||
VisitTaskId = visitTaskId,
|
||||
SubjectVisitId = visitTask.SourceSubjectVisitId!.Value,
|
||||
QuestionInfo = questionInfos,
|
||||
|
||||
+471
-45
@@ -448,32 +448,57 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
//被评估为NE的单个靶病灶
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NETarget,GetStringFun=GetNETarget},
|
||||
|
||||
// 与前一访视SOD相比变化量
|
||||
// 与前一访视SOD相比变化量
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.LastVisitSODChange,GetDecimalNullFun=GetLastTaskSODChange},
|
||||
|
||||
//新靶病灶直径之和(iSOD)
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.ISOD,GetDecimalNullFun=GetiSODData},
|
||||
|
||||
// 与前一访视相比iSOD变化量
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.LastVisitiSODChange,GetDecimalNullFun=GetISODChange},
|
||||
// 与前一访视相比iSOD变化量
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.LastVisitiSODChange,GetDecimalNullFun=GetISODChange},
|
||||
|
||||
//靶病灶评估
|
||||
// 靶病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.TargetLesion,GetStringFun=GetTargetLesionEvaluate},
|
||||
|
||||
// IRECIST靶病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.TargetLesion,GetStringFun=GetIRECISTTargetLesionEvaluate,IsConvertedTask=true},
|
||||
|
||||
//非靶病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NoTargetLesion,GetStringFun=GetNoTargetLesionEvaluate},
|
||||
|
||||
//新病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NewLesionEvaluation,GetStringFun=GetNewLesionEvaluate},
|
||||
//IRECIST非靶病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NoTargetLesion,GetStringFun=GetIRECISTNoTargetLesionEvaluate,IsConvertedTask=true},
|
||||
|
||||
// IRECIST新靶病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NewTargetLesion,GetStringFun=GetNewTargetLesionEvaluate,IsConvertedTask=true},
|
||||
|
||||
// IRECIST新非靶病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NewNoTargetLesion,GetStringFun=GetNewNoTargetLesionEvaluate,IsConvertedTask=true},
|
||||
|
||||
// IRECIST其它既往新病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.OtherNewTargetLesion,GetStringFun=GetOtherNewTargetLesionEvaluate,IsConvertedTask=true},
|
||||
|
||||
// IRECIST触发iRECIST后新病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.IRECISTNewTargetLesion,GetStringFun=GetNewLesionAfterTriggeringiRECSITAssessment,IsConvertedTask=true},
|
||||
|
||||
//IRECIST新病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NewLesionEvaluation,GetStringFun=GetNewLesionAssessment,IsConvertedTask=true},
|
||||
|
||||
//整体肿瘤评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetTumor},
|
||||
|
||||
//IRECIST整体肿瘤评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetIRECSITTargetLesionEvaluate,IsConvertedTask=true},
|
||||
|
||||
//是否存在疾病
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.ExistDisease,GetStringFun=GetIsExistDisease},
|
||||
|
||||
};
|
||||
|
||||
// 过滤转化的
|
||||
|
||||
calculateList = calculateList.Where(x => x.IsConvertedTask == inDto.IsConvertedTask).ToList();
|
||||
|
||||
// 没有靶病灶只计算最后几个
|
||||
if (inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).Sum(x => x.TableRowInfoList.Count()) == 0)
|
||||
{
|
||||
@@ -2176,6 +2201,407 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
return result.GetEnumInt();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取新病灶评估
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取新病灶评估
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// if(新靶病灶为ND&&新非靶病灶为ND&&其它既往新病灶为ND&&不存在触发iRECIST后新病灶)
|
||||
/// {
|
||||
/// 疗效为 ND
|
||||
/// }
|
||||
/// else if (新靶病灶为iCPD||新非靶病灶为iCPD)
|
||||
/// {
|
||||
/// 疗效为 iCPD
|
||||
/// }
|
||||
/// else if (前一访视新病灶评估为iCPD && (新靶病灶有存在病灶 || 新非靶病灶有存在状态病灶 || 其它既往新病灶有存在的病灶 || 触发iRECIST后新病灶有存在病灶))
|
||||
/// {
|
||||
/// 疗效为 iCPD
|
||||
/// }
|
||||
/// else if (前一访视新病灶评估为iUPD && 新靶病灶上个访视评估为NE,本次访视评估为iUPD)
|
||||
/// {
|
||||
/// 疗效为 iCPD
|
||||
/// }
|
||||
/// else if (前一访视新病灶评估为iUPD && 新非靶病灶上个访视评估为NE,本次访视评估为iUPD)
|
||||
/// {
|
||||
/// 疗效为 iCPD
|
||||
/// }
|
||||
/// else if (前一访视新病灶评估为iUPD && 其它既往新病灶上个访视评估为NE或疑似,本次访视评估为iUPD)
|
||||
/// {
|
||||
/// 疗效为 iCPD
|
||||
/// }
|
||||
/// else if (前一访视新病灶评估为iUPD && 触发iRECIST后新病灶评估上个访视评估为NE或否或疑似,本次访视评估为是)
|
||||
/// {
|
||||
/// 疗效为 iCPD
|
||||
/// }
|
||||
/// else if (新靶病灶评估为iUPD || 新非靶病灶评估为iUPD || 其它既往新病灶评估为iUPD || 触发iRECIST后新病灶评估上个访视评估为是)
|
||||
/// {
|
||||
/// 疗效为 iUPD
|
||||
/// }
|
||||
/// else if (新靶病灶、新非靶病灶、其它既往新病灶任一项评估为NE)
|
||||
/// {
|
||||
/// 疗效为 NE
|
||||
/// }
|
||||
/// else if (其它既往新病灶或触发iRECIST后新病灶评估为“疑似”)
|
||||
/// {
|
||||
/// 疗效为 疑似
|
||||
/// }
|
||||
/// </remarks>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetNewLesionAssessment(ReadingCalculateDto inDto)
|
||||
{
|
||||
|
||||
NewLesionAssessment? result = null;
|
||||
var lastVisitTaskId = await GetLastVisitTaskId(inDto);
|
||||
ReadingCalculateDto lastTaskCalculateDto = await _generalCalculateService.GetReadingCalculateDto(lastVisitTaskId);
|
||||
IRECISTNewLesionAssessmentDto data = new IRECISTNewLesionAssessmentDto()
|
||||
{
|
||||
//上一次任务的新病灶评估为iUPD
|
||||
LastTaskNewLesioniUPD = lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewLesionEvaluation && x.Answer.EqEnum(NewLesionAssessment.iCPD)),
|
||||
};
|
||||
|
||||
// if(新靶病灶为ND&&新非靶病灶为ND&&其它既往新病灶为ND&&不存在触发iRECIST后新病灶)
|
||||
if(inDto.QuestionInfo.Any(x=>x.QuestionType==QuestionType.NewTargetLesion&&x.Answer.EqEnum(NewTargetLesionAssessment.ND))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.ND))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.ND))
|
||||
&& inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TriggeringIRECSIT).SelectMany(x => x.TableRowInfoList).Count()==0)
|
||||
{
|
||||
// 疗效为 ND
|
||||
result = NewLesionAssessment.ND;
|
||||
}
|
||||
// else if (新靶病灶为iCPD||新非靶病灶为iCPD)
|
||||
else if(inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.iCPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.iCPD)))
|
||||
{
|
||||
// 疗效为 iCPD
|
||||
result = NewLesionAssessment.iCPD;
|
||||
}
|
||||
// else if (前一访视新病灶评估为iCPD && (新靶病灶有存在病灶 || 新非靶病灶有存在状态病灶 || 其它既往新病灶有存在的病灶 || 触发iRECIST后新病灶有存在病灶))
|
||||
else if(data.LastTaskNewLesioniUPD&&
|
||||
(inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewTargetLesion).SelectMany(x => x.TableRowInfoList).Count() > 0
|
||||
|| inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewNonTargetLesion).SelectMany(x => x.TableRowInfoList).Count() > 0
|
||||
|| inDto.QuestionInfo.Where(x => x.LesionType == LesionType.OtherPreviousNewLesion).SelectMany(x => x.TableRowInfoList).Count() > 0
|
||||
|| inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TriggeringIRECSIT).SelectMany(x => x.TableRowInfoList).Count() > 0
|
||||
)
|
||||
)
|
||||
{
|
||||
// 疗效为 iCPD
|
||||
result = NewLesionAssessment.iCPD;
|
||||
}
|
||||
// else if (前一访视新病灶评估为iUPD && 新靶病灶上个访视评估为NE,本次访视评估为iUPD)
|
||||
else if(data.LastTaskNewLesioniUPD &&
|
||||
lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.NE))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.iUPD))
|
||||
)
|
||||
{
|
||||
// 疗效为 iCPD
|
||||
result = NewLesionAssessment.iCPD;
|
||||
}
|
||||
// else if (前一访视新病灶评估为iUPD && 新非靶病灶上个访视评估为NE,本次访视评估为iUPD)
|
||||
else if(data.LastTaskNewLesioniUPD
|
||||
&& lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.NE))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.iUPD))
|
||||
)
|
||||
{
|
||||
// 疗效为 iCPD
|
||||
result = NewLesionAssessment.iCPD;
|
||||
}
|
||||
// else if (前一访视新病灶评估为iUPD && 其它既往新病灶上个访视评估为NE或疑似,本次访视评估为iUPD)
|
||||
else if (data.LastTaskNewLesioniUPD
|
||||
&& lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && (x.Answer.EqEnum(OtherPreviousNewLesionAssessment.NE)|| x.Answer.EqEnum(OtherPreviousNewLesionAssessment.Equivocal)))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.iUPD))
|
||||
)
|
||||
{
|
||||
// 疗效为 iCPD
|
||||
result = NewLesionAssessment.iCPD;
|
||||
}
|
||||
// else if (前一访视新病灶评估为iUPD && 触发iRECIST后新病灶评估上个访视评估为NE或否或疑似,本次访视评估为是)
|
||||
else if(data.LastTaskNewLesioniUPD
|
||||
&& lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && (x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.NE)|| x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.No) || x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Equivocal)))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Yes))
|
||||
)
|
||||
{
|
||||
// 疗效为 iCPD
|
||||
result = NewLesionAssessment.iCPD;
|
||||
}
|
||||
// else if (新靶病灶评估为iUPD || 新非靶病灶评估为iUPD || 其它既往新病灶评估为iUPD || 触发iRECIST后新病灶评估上个访视评估为是)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.iUPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.iUPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.iUPD))
|
||||
|| lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Yes))
|
||||
)
|
||||
{
|
||||
// 疗效为 iUPD
|
||||
result = NewLesionAssessment.iUPD;
|
||||
}
|
||||
// else if (新靶病灶、新非靶病灶、其它既往新病灶任一项评估为NE)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.NE))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.NE))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.NE))
|
||||
)
|
||||
{
|
||||
// 疗效为 NE
|
||||
result = NewLesionAssessment.NE;
|
||||
}
|
||||
// else if (其它既往新病灶或触发iRECIST后新病灶评估为“疑似”)
|
||||
else if (
|
||||
inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.Equivocal))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Equivocal))
|
||||
)
|
||||
{
|
||||
// 疗效为 疑似
|
||||
result = NewLesionAssessment.Suspected;
|
||||
}
|
||||
|
||||
|
||||
return result == null ? string.Empty : ((NewLesionAssessment)result).GetEnumInt();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region iRECSIT整体肿瘤评估
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// if(上一访视评估为iUPD或iCPD&&靶病灶评估、非靶病灶评估或新病灶评估任一项为iCPD)
|
||||
/// {
|
||||
/// 疗效为 iCPD
|
||||
/// }
|
||||
/// else if (上一访视评估为iUPD或iCPD&&靶病灶评估、非靶病灶评估或新病灶评估任一项从前一访视非iUPD结果评估为当前访视iUPD)
|
||||
/// {
|
||||
/// 疗效为 iCPD
|
||||
/// }
|
||||
/// else if (靶病灶评估为iUPD || 非靶病灶评估为iUPD || 新病灶评估为iUPD)
|
||||
/// {
|
||||
/// 疗效为 iUPD
|
||||
/// }
|
||||
/// else if ((靶病灶评估为iCR || 非靶病灶评估为iCR) && 新病灶评估为ND)
|
||||
/// {
|
||||
/// 疗效为 iCR
|
||||
/// }
|
||||
/// else if (靶病灶评估为iPR && 非靶病灶评估为iCR,iNN,NE或ND && 新病灶评估为ND或疑似或NE)
|
||||
/// {
|
||||
/// 疗效为 iPR
|
||||
/// }
|
||||
/// else if (靶病灶评估为iPR && 非靶病灶评估为iNN或NE && 新病灶评估为否或疑似或NE)
|
||||
/// {
|
||||
/// 疗效为 iPR
|
||||
/// }
|
||||
/// else if (靶病灶评估为iPR && 非靶病灶评估为iCR或ND && 新病灶评估为疑似或NE)
|
||||
/// {
|
||||
/// 疗效为 iPR
|
||||
/// }
|
||||
/// else if (靶病灶评估为ND && 非靶病灶评估为iCR && 新病灶评估为疑似或NE)
|
||||
/// {
|
||||
/// 疗效为 iPR
|
||||
/// }
|
||||
/// else if (靶病灶评估为iSD && 非靶病灶评估为iCR,iNN,NE或ND && 新病灶评估为ND或疑似或NE)
|
||||
/// {
|
||||
/// 疗效为 iSD
|
||||
/// }
|
||||
/// else if (靶病灶评估为ND && 非靶病灶评估为iNN && 新病灶评估为ND或疑似或NE)
|
||||
/// {
|
||||
/// 疗效为 iNN
|
||||
/// }
|
||||
/// else if (靶病灶评估为ND && 非靶病灶评估为ND && 新病灶评估为ND或疑似)
|
||||
/// {
|
||||
/// 疗效为 ND
|
||||
/// }
|
||||
/// else if (靶病灶评估为NE && 非靶病灶评估为iCR,iNN,NE或ND && 新病灶评估为ND或疑似或NE)
|
||||
/// {
|
||||
/// 疗效为 NE
|
||||
/// }
|
||||
/// else if (靶病灶评估为ND && 非靶病灶评估为NE && 新病灶评估为否或疑似或NE)
|
||||
/// {
|
||||
/// 疗效为 NE
|
||||
/// }
|
||||
/// else if (靶病灶评估为ND && 非靶病灶评估为ND && 新病灶评估为NE)
|
||||
/// {
|
||||
/// 疗效为 NE
|
||||
/// }
|
||||
/// </remarks>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetIRECSITTargetLesionEvaluate(ReadingCalculateDto inDto)
|
||||
{
|
||||
|
||||
var lastVisitTaskId = await GetLastVisitTaskId(inDto);
|
||||
ReadingCalculateDto lastTaskCalculateDto = await _generalCalculateService.GetReadingCalculateDto(lastVisitTaskId);
|
||||
OverallAssessment? result = null;
|
||||
IRECISTTargetLesionEvaluateDto data = new IRECISTTargetLesionEvaluateDto()
|
||||
{
|
||||
LastTaskLesioniUPDOriCPD = lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.Tumor && (x.Answer.EqEnum(OverallAssessment.iCPD) || x.Answer.EqEnum(OverallAssessment.iUPD))),
|
||||
};
|
||||
|
||||
// if(上一访视评估为iUPD或iCPD&&靶病灶评估、非靶病灶评估或新病灶评估任一项为iCPD)
|
||||
if (data.LastTaskLesioniUPDOriCPD
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.iCPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iCPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.iCPD))))
|
||||
{
|
||||
// 疗效为 iCPD
|
||||
result = OverallAssessment.iCPD;
|
||||
|
||||
}
|
||||
// else if (上一访视评估为iUPD或iCPD&&靶病灶评估、非靶病灶评估或新病灶评估任一项从前一访视非iUPD结果评估为当前访视iUPD)
|
||||
if (data.LastTaskLesioniUPDOriCPD
|
||||
&& (lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && !x.Answer.EqEnum(TargetAssessment.iUPD))
|
||||
|| lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && !x.Answer.EqEnum(NoTargetAssessment.iUPD))
|
||||
|| lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && !x.Answer.EqEnum(NewTargetLesionAssessment.iUPD)))
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.iUPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iUPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.iUPD)))
|
||||
)
|
||||
{
|
||||
// 疗效为 iCPD
|
||||
result = OverallAssessment.iCPD;
|
||||
}
|
||||
// else if (靶病灶评估为iUPD || 非靶病灶评估为iUPD || 新病灶评估为iUPD)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.iUPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iUPD))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.iUPD)))
|
||||
{
|
||||
// 疗效为 iUPD
|
||||
result = OverallAssessment.iUPD;
|
||||
}
|
||||
// else if ((靶病灶评估为iCR || 非靶病灶评估为iCR) && 新病灶评估为ND)
|
||||
else if (
|
||||
(inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.iCR))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iCR)))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.ND))
|
||||
)
|
||||
{
|
||||
// 疗效为 iCR
|
||||
result = OverallAssessment.iCR;
|
||||
}
|
||||
// else if (靶病灶评估为iPR && 非靶病灶评估为iCR,iNN,NE或ND && 新病灶评估为ND或疑似或NE)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.iPR))
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iCR))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iNN))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.NE))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.ND))
|
||||
) && (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.ND))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.Suspected))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.NE))
|
||||
))
|
||||
{
|
||||
// 疗效为 iPR
|
||||
result = OverallAssessment.iPR;
|
||||
}
|
||||
// else if (靶病灶评估为iPR && 非靶病灶评估为iNN或NE && 新病灶评估为否或疑似或NE)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.iPR))
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iNN))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.NE))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.ND))
|
||||
) && (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.No))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.Suspected))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.NE))
|
||||
))
|
||||
{
|
||||
// 疗效为 iPR
|
||||
result = OverallAssessment.iPR;
|
||||
}
|
||||
// else if (靶病灶评估为iPR && 非靶病灶评估为iCR或ND && 新病灶评估为疑似或NE)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.iPR))
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iCR))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.ND))
|
||||
) && (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.Suspected))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.NE))
|
||||
))
|
||||
{
|
||||
// 疗效为 iPR
|
||||
result = OverallAssessment.iPR;
|
||||
}
|
||||
// else if (靶病灶评估为ND && 非靶病灶评估为iCR && 新病灶评估为疑似或NE)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.ND))
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iCR))
|
||||
) && (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.Suspected))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.NE))
|
||||
))
|
||||
{
|
||||
// 疗效为 iPR
|
||||
result = OverallAssessment.iPR;
|
||||
}
|
||||
// else if (靶病灶评估为iSD && 非靶病灶评估为iCR,iNN,NE或ND && 新病灶评估为ND或疑似或NE)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.iSD))
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iCR))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iNN))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.NE))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.ND))
|
||||
) && (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.Suspected))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.NE))
|
||||
))
|
||||
{
|
||||
// 疗效为 iSD
|
||||
result = OverallAssessment.iSD;
|
||||
}
|
||||
// else if (靶病灶评估为ND && 非靶病灶评估为iNN && 新病灶评估为ND或疑似或NE)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.ND))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iNN))
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.ND))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.Suspected))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.NE))
|
||||
))
|
||||
{
|
||||
// 疗效为 iNN
|
||||
result = OverallAssessment.iNN;
|
||||
}
|
||||
// else if (靶病灶评估为ND && 非靶病灶评估为ND && 新病灶评估为ND或疑似)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.ND))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.ND))
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.ND))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.Suspected))
|
||||
))
|
||||
{
|
||||
// 疗效为 ND
|
||||
result = OverallAssessment.ND;
|
||||
}
|
||||
// else if (靶病灶评估为NE && 非靶病灶评估为iCR,iNN,NE或ND && 新病灶评估为ND或疑似或NE)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.NE))
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iCR))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.iNN))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.NE))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.ND))
|
||||
) && (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.ND))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.Suspected))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.NE))
|
||||
))
|
||||
{
|
||||
// 疗效为 NE
|
||||
result = OverallAssessment.NE;
|
||||
}
|
||||
// else if (靶病灶评估为ND && 非靶病灶评估为NE && 新病灶评估为否或疑似或NE)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.ND))
|
||||
&& (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.NE))
|
||||
|
||||
) && (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.No))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.Suspected))
|
||||
|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.NE))
|
||||
))
|
||||
{
|
||||
// 疗效为 NE
|
||||
result = OverallAssessment.NE;
|
||||
}
|
||||
// else if (靶病灶评估为ND && 非靶病灶评估为ND && 新病灶评估为NE)
|
||||
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.ND))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && x.Answer.EqEnum(NoTargetAssessment.ND))
|
||||
&& inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewLesionAssessment.NE))
|
||||
|
||||
)
|
||||
{
|
||||
// 疗效为 NE
|
||||
result = OverallAssessment.NE;
|
||||
}
|
||||
|
||||
return result == null ? string.Empty : ((OverallAssessment)result).GetEnumInt();
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -2554,54 +2980,54 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取新病灶评估
|
||||
/// <summary>
|
||||
/// 获取新病灶评估
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetNewLesionEvaluate(ReadingCalculateDto inDto)
|
||||
{
|
||||
//#region 获取新病灶评估
|
||||
///// <summary>
|
||||
///// 获取新病灶评估
|
||||
///// </summary>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//public async Task<string> GetNewLesionEvaluate(ReadingCalculateDto inDto)
|
||||
//{
|
||||
|
||||
NewLesionAssessment result = NewLesionAssessment.No;
|
||||
if (inDto.IsBaseLine)
|
||||
{
|
||||
return NewLesionAssessment.NA.GetEnumInt();
|
||||
}
|
||||
// NewLesionAssessment result = NewLesionAssessment.No;
|
||||
// if (inDto.IsBaseLine)
|
||||
// {
|
||||
// return NewLesionAssessment.NA.GetEnumInt();
|
||||
// }
|
||||
|
||||
var tableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewLesions).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
// var tableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewLesions).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
|
||||
var tableQuestions = tableRows.SelectMany(x => x.TableQuestionList).ToList();
|
||||
// var tableQuestions = tableRows.SelectMany(x => x.TableQuestionList).ToList();
|
||||
|
||||
|
||||
|
||||
// 当前访视存在至少一个明确新病灶
|
||||
if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Exist)))
|
||||
{
|
||||
result = NewLesionAssessment.Yes;
|
||||
}
|
||||
//只要有任何一个新病灶状态为“无法评估”
|
||||
else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.UnableEvaluate)))
|
||||
{
|
||||
result = NewLesionAssessment.NE;
|
||||
}
|
||||
//当前访视不存在明确新病灶且存在至少一个疑似新病灶
|
||||
else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Exist)) &&
|
||||
tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Suspected))
|
||||
)
|
||||
{
|
||||
result = NewLesionAssessment.Suspected;
|
||||
}
|
||||
// // 当前访视存在至少一个明确新病灶
|
||||
// if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Exist)))
|
||||
// {
|
||||
// result = NewLesionAssessment.Yes;
|
||||
// }
|
||||
// //只要有任何一个新病灶状态为“无法评估”
|
||||
// else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.UnableEvaluate)))
|
||||
// {
|
||||
// result = NewLesionAssessment.NE;
|
||||
// }
|
||||
// //当前访视不存在明确新病灶且存在至少一个疑似新病灶
|
||||
// else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Exist)) &&
|
||||
// tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Suspected))
|
||||
// )
|
||||
// {
|
||||
// result = NewLesionAssessment.Suspected;
|
||||
// }
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
result = NewLesionAssessment.No;
|
||||
}
|
||||
return result.GetEnumInt();
|
||||
// else
|
||||
// {
|
||||
// result = NewLesionAssessment.No;
|
||||
// }
|
||||
// return result.GetEnumInt();
|
||||
|
||||
}
|
||||
#endregion
|
||||
//}
|
||||
//#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user