Uat_Study
parent
528a8dbf6e
commit
882cecc497
|
@ -167,7 +167,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
if (typeNAList.Contains(item.QuestionType ?? QuestionType.SOD))
|
if (typeNAList.Contains(item.QuestionType ?? QuestionType.SOD))
|
||||||
{
|
{
|
||||||
item.Answer = "NA";
|
item.Answer = nameof(YesOrNoOrNa.NA);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -379,13 +380,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
foreach (var item in tableQuestion)
|
foreach (var item in tableQuestion)
|
||||||
{
|
{
|
||||||
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && (x.Answer == "是"||x.Answer.ToLower()=="true".ToLower())))
|
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph &&x.Answer.EqEnum(YesOrNoOrNa.Yes)))
|
||||||
{
|
{
|
||||||
// 淋巴结的短径
|
// 淋巴结的短径
|
||||||
result += (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0();
|
result += (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && (x.Answer == "是" || x.Answer.ToLower() == "true".ToLower())))
|
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes)))
|
||||||
{
|
{
|
||||||
// 非淋巴结的长径
|
// 非淋巴结的长径
|
||||||
result += item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
result += item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
|
@ -420,7 +421,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
foreach (var item in tableQuestion)
|
foreach (var item in tableQuestion)
|
||||||
{
|
{
|
||||||
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && (x.Answer == "是" || x.Answer.ToLower() == "false".ToLower())))
|
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes)))
|
||||||
{
|
{
|
||||||
// 非淋巴结的长径
|
// 非淋巴结的长径
|
||||||
result += item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
result += item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
|
@ -546,7 +547,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
if (inDto.IsBaseLine)
|
if (inDto.IsBaseLine)
|
||||||
{
|
{
|
||||||
return "NA";
|
return nameof(YesOrNoOrNa.NA);
|
||||||
}
|
}
|
||||||
|
|
||||||
var decimalAnswerList = await GetVisitTaskAnswerList(inDto);
|
var decimalAnswerList = await GetVisitTaskAnswerList(inDto);
|
||||||
|
@ -562,17 +563,20 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetIsLymphTarget(ReadingCalculateDto inDto)
|
public async Task<string> GetIsLymphTarget(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
|
var result = string.Empty;
|
||||||
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
||||||
|
|
||||||
foreach (var item in tableQuestion)
|
foreach (var item in tableQuestion)
|
||||||
{
|
{
|
||||||
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && (x.Answer == "是" || x.Answer.ToLower() == "true".ToLower())))
|
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(IsLymph.Yes)))
|
||||||
{
|
{
|
||||||
return "是";
|
result= IsLymph.Yes.GetEnumInt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "否";
|
result = IsLymph.No.GetEnumInt();
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -586,14 +590,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
if (inDto.IsBaseLine)
|
if (inDto.IsBaseLine)
|
||||||
{
|
{
|
||||||
return "NA";
|
return nameof(YesOrNoOrNa.NA);
|
||||||
}
|
}
|
||||||
|
|
||||||
var LastVisitTaskId = await this.GetLastVisitTaskId(inDto);
|
var LastVisitTaskId = await this.GetLastVisitTaskId(inDto);
|
||||||
|
|
||||||
var questionIds = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).Select(x => x.QuestionId).ToList();
|
var questionIds = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).Select(x => x.QuestionId).ToList();
|
||||||
var lastQuestionAsnwer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == LastVisitTaskId && questionIds.Contains(x.QuestionId)).Include(x=>x.ReadingQuestionTrial).Include(x => x.ReadingTableQuestionTrial).ToListAsync();
|
var lastQuestionAsnwer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == LastVisitTaskId && questionIds.Contains(x.QuestionId)).Include(x=>x.ReadingQuestionTrial).Include(x => x.ReadingTableQuestionTrial).ToListAsync();
|
||||||
var rowIndexs = lastQuestionAsnwer.Where(x=>x.ReadingTableQuestionTrial.QuestionMark==QuestionMark.IsLymph&& (x.Answer == "是" || x.Answer.ToLower() == "true".ToLower())).Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList();
|
var rowIndexs = lastQuestionAsnwer.Where(x=>x.ReadingTableQuestionTrial.QuestionMark==QuestionMark.IsLymph&& x.Answer.EqEnum(YesOrNoOrNa.Yes)).Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList();
|
||||||
var thisQuestionAsnwer = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
var thisQuestionAsnwer = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
||||||
|
|
||||||
var isExists = false;
|
var isExists = false;
|
||||||
|
@ -610,7 +614,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return isExists?"是":"否";
|
return isExists? nameof(YesOrNoOrNa.Yes) : nameof(YesOrNoOrNa.No);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -625,12 +629,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
if (inDto.IsBaseLine)
|
if (inDto.IsBaseLine)
|
||||||
{
|
{
|
||||||
return "NA";
|
return nameof(ExistOrNA.NA);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.NE));
|
var result = inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.NE));
|
||||||
|
|
||||||
return result ? "有" : "无";
|
return result ? nameof(ExistOrNA.Exist) : nameof(ExistOrNA.NotExist);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -646,7 +650,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
if (inDto.IsBaseLine)
|
if (inDto.IsBaseLine)
|
||||||
{
|
{
|
||||||
return "NA";
|
return nameof(YesOrNoOrNa.NA);
|
||||||
}
|
}
|
||||||
|
|
||||||
var targetLesion = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.TargetLesion).Select(x => x.Answer).FirstOrDefault();
|
var targetLesion = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.TargetLesion).Select(x => x.Answer).FirstOrDefault();
|
||||||
|
@ -842,7 +846,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
||||||
if (inDto.IsBaseLine)
|
if (inDto.IsBaseLine)
|
||||||
{
|
{
|
||||||
return "NA";
|
return nameof(TargetAssessment.NA);
|
||||||
}
|
}
|
||||||
if (tableQuestion.Count() == 0)
|
if (tableQuestion.Count() == 0)
|
||||||
{
|
{
|
||||||
|
@ -875,7 +879,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
LowChangeBigger5 = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.LowestIncrease).Sum(x => x.Answer.IsNullOrEmptyReturn0()) >= 5,
|
LowChangeBigger5 = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.LowestIncrease).Sum(x => x.Answer.IsNullOrEmptyReturn0()) >= 5,
|
||||||
|
|
||||||
// 被评估为NE的单个靶病灶 是否存在状态为不可评估的靶病灶
|
// 被评估为NE的单个靶病灶 是否存在状态为不可评估的靶病灶
|
||||||
ExixtsNETargetLesion = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer == "不可评估"),
|
ExixtsNETargetLesion = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(TargetState.UnableEvaluate)),
|
||||||
|
|
||||||
//// 上次访视点整体肿瘤评估
|
//// 上次访视点整体肿瘤评估
|
||||||
LastTargetLesionEvaluate = string.Empty,
|
LastTargetLesionEvaluate = string.Empty,
|
||||||
|
@ -887,7 +891,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CurrenShortBigger10 = true,
|
CurrenShortBigger10 = true,
|
||||||
|
|
||||||
// 该淋巴结靶病灶短径绝对增加值≥5 mm
|
// 该淋巴结靶病灶短径绝对增加值≥5 mm
|
||||||
IsAddFive = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.IsAddFive && x.Answer == "是").Count() > 0,
|
IsAddFive = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.IsAddFive && x.Answer.EqEnum(YesOrNoOrNa.Yes)).Count() > 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -895,7 +899,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
foreach (var item in tableQuestion)
|
foreach (var item in tableQuestion)
|
||||||
{
|
{
|
||||||
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && (x.Answer == "是" || x.Answer.ToLower() == "true".ToLower())))
|
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes)))
|
||||||
{
|
{
|
||||||
// 淋巴结的短径
|
// 淋巴结的短径
|
||||||
resultData.DiameterLessThan10 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10;
|
resultData.DiameterLessThan10 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10;
|
||||||
|
@ -904,7 +908,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
resultData.CurrenShortBigger10 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() >= 10;
|
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 == "否" || x.Answer.ToLower() == "false".ToLower())))
|
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && !x.Answer.EqEnum(YesOrNoOrNa.Yes)))
|
||||||
{
|
{
|
||||||
// 当前访视点非淋巴结病灶
|
// 当前访视点非淋巴结病灶
|
||||||
resultData.CurrentMajoreBigger0 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() > 0;
|
resultData.CurrentMajoreBigger0 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() > 0;
|
||||||
|
@ -921,10 +925,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string result = string.Empty;
|
TargetAssessment result = TargetAssessment.NA;
|
||||||
if (resultData.SumOfDiameter == 0 && resultData.DiameterLessThan10 && !resultData.ExixtsNETargetLesion)
|
if (resultData.SumOfDiameter == 0 && resultData.DiameterLessThan10 && !resultData.ExixtsNETargetLesion)
|
||||||
{
|
{
|
||||||
result = "CR";
|
result = TargetAssessment.CR;
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
(resultData.SODPercentBigger30 && resultData.LowPercentLess20 && !resultData.ExixtsNETargetLesion)
|
(resultData.SODPercentBigger30 && resultData.LowPercentLess20 && !resultData.ExixtsNETargetLesion)
|
||||||
|
@ -932,7 +936,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
(resultData.SODPercentBigger30 && resultData.LowChangeLess5 && !resultData.ExixtsNETargetLesion)
|
(resultData.SODPercentBigger30 && resultData.LowChangeLess5 && !resultData.ExixtsNETargetLesion)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
result = "PR";
|
result = TargetAssessment.PR;
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
(resultData.SODPercentLess30 && resultData.LowPercentLess20 && !resultData.ExixtsNETargetLesion)
|
(resultData.SODPercentLess30 && resultData.LowPercentLess20 && !resultData.ExixtsNETargetLesion)
|
||||||
|
@ -940,11 +944,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
(resultData.SODPercentLess30 && resultData.LowChangeLess5 && !resultData.ExixtsNETargetLesion)
|
(resultData.SODPercentLess30 && resultData.LowChangeLess5 && !resultData.ExixtsNETargetLesion)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
result = "SD";
|
result = TargetAssessment.SD;
|
||||||
}
|
}
|
||||||
else if (resultData.LowPercentBigger20 && resultData.LowChangeBigger5)
|
else if (resultData.LowPercentBigger20 && resultData.LowChangeBigger5)
|
||||||
{
|
{
|
||||||
result = "PD";
|
result = TargetAssessment.PD;
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
(resultData.LowPercentLess20 && resultData.ExixtsNETargetLesion)
|
(resultData.LowPercentLess20 && resultData.ExixtsNETargetLesion)
|
||||||
|
@ -952,25 +956,25 @@ namespace IRaCIS.Core.Application.Service
|
||||||
(resultData.LowPercentBigger20 && resultData.LowChangeLess5 && resultData.ExixtsNETargetLesion)
|
(resultData.LowPercentBigger20 && resultData.LowChangeLess5 && resultData.ExixtsNETargetLesion)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
result = "NE";
|
result = TargetAssessment.NE;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (!resultData.ExixtsNETargetLesion)
|
else if (!resultData.ExixtsNETargetLesion)
|
||||||
{
|
{
|
||||||
result = "ND";
|
result = TargetAssessment.ND;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (
|
else if (
|
||||||
(resultData.LastTargetLesionEvaluate == "CR" && resultData.CurrenShortBigger10 && resultData.IsAddFive)
|
(resultData.LastTargetLesionEvaluate.EqEnum(TargetAssessment.CR) && resultData.CurrenShortBigger10 && resultData.IsAddFive)
|
||||||
||
|
||
|
||||||
(resultData.LastTargetLesionEvaluate == "CR" && resultData.CurrentMajoreBigger0)
|
(resultData.LastTargetLesionEvaluate.EqEnum(TargetAssessment.CR) && resultData.CurrentMajoreBigger0)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
result = "PD";
|
result = TargetAssessment.PD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result.GetEnumInt();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -983,9 +987,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetNoTargetLesionEvaluate(ReadingCalculateDto inDto)
|
public async Task<string> GetNoTargetLesionEvaluate(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
NoTargetAssessment result = NoTargetAssessment.NA;
|
||||||
|
|
||||||
if (inDto.IsBaseLine)
|
if (inDto.IsBaseLine)
|
||||||
{
|
{
|
||||||
return "NA";
|
return result.GetEnumInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
var tableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NonTargetLesions).SelectMany(x => x.TableRowInfoList).ToList();
|
var tableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NonTargetLesions).SelectMany(x => x.TableRowInfoList).ToList();
|
||||||
|
@ -993,42 +1000,44 @@ namespace IRaCIS.Core.Application.Service
|
||||||
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 == "显著增大"))
|
if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Increase)))
|
||||||
{
|
{
|
||||||
return "PD";
|
result = NoTargetAssessment.PD;
|
||||||
}
|
}
|
||||||
//所有单个病灶/病灶组状态评估状态为“消失”
|
//所有单个病灶/病灶组状态评估状态为“消失”
|
||||||
else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer != "消失"))
|
else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss) ))
|
||||||
{
|
{
|
||||||
return "PD";
|
result = NoTargetAssessment.PD;
|
||||||
}
|
}
|
||||||
// 任意单个病灶/病灶组评估为“无法评估”并且没有“显著增大”
|
// 任意单个病灶/病灶组评估为“无法评估”并且没有“显著增大”
|
||||||
else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer == "无法评估") &&
|
else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Increase)) &&
|
||||||
!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer != "显著增大")
|
!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && !x.Answer.EqEnum(NoTargetState.Increase) )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return "NE";
|
result = NoTargetAssessment.NE;
|
||||||
}
|
}
|
||||||
// 基线时没有非靶病灶
|
// 基线时没有非靶病灶
|
||||||
else if (tableQuestions.Count() == 0)
|
else if (tableQuestions.Count() == 0)
|
||||||
{
|
{
|
||||||
return "ND";
|
result = NoTargetAssessment.ND;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 所有单个病灶/病灶组评估为”存在”或者有些评估为“消失”有些评估为“存在”,且没有“显著增大”和“无法评估”的病灶
|
// 所有单个病灶/病灶组评估为”存在”或者有些评估为“消失”有些评估为“存在”,且没有“显著增大”和“无法评估”的病灶
|
||||||
|
|
||||||
else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer != "存在")
|
else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && !x.Answer.EqEnum(NoTargetState.Exist))
|
||||||
|| (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer == "存在" || x.Answer == "消失") && !tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && (x.Answer != "显著增大" || x.Answer != "无法评估")))
|
|| (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Exist) || x.Answer.EqEnum(NoTargetState.Loss)) && !tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && (x.Answer != "显著增大" || x.Answer != "无法评估")))
|
||||||
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return "NN";
|
result = NoTargetAssessment.NN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result.GetEnumInt();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1041,9 +1050,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetNewLesionEvaluate(ReadingCalculateDto inDto)
|
public async Task<string> GetNewLesionEvaluate(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
NewLesionAssessment result = NewLesionAssessment.NA;
|
||||||
if (inDto.IsBaseLine)
|
if (inDto.IsBaseLine)
|
||||||
{
|
{
|
||||||
return "NA";
|
return result.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();
|
||||||
|
@ -1053,27 +1064,28 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
// 当前访视存在至少一个明确新病灶
|
// 当前访视存在至少一个明确新病灶
|
||||||
if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer == "明确"))
|
if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Exist)))
|
||||||
{
|
{
|
||||||
return "是";
|
result= NewLesionAssessment.Yes;
|
||||||
}
|
}
|
||||||
//当前访视不存在明确新病灶且存在至少一个疑似新病灶
|
//当前访视不存在明确新病灶且存在至少一个疑似新病灶
|
||||||
else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer != "明确") ||
|
else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && !x.Answer.EqEnum(NewLesionState.Exist)) ||
|
||||||
tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer == "疑似")
|
tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Suspected))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return "疑似";
|
result = NewLesionAssessment.Suspected;
|
||||||
}
|
}
|
||||||
|
|
||||||
//只要有任何一个新病灶状态为“无法评估”
|
//只要有任何一个新病灶状态为“无法评估”
|
||||||
else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer == "无法评估"))
|
else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.UnableEvaluate)))
|
||||||
{
|
{
|
||||||
return "NE";
|
result = NewLesionAssessment.NE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return "否";
|
result = NewLesionAssessment.No;
|
||||||
}
|
}
|
||||||
|
return result.GetEnumInt();
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -16,6 +16,221 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
public static readonly string Group = "group";
|
public static readonly string Group = "group";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否存在或者NA
|
||||||
|
/// </summary>
|
||||||
|
public enum ExistOrNA
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 不存在
|
||||||
|
/// </summary>
|
||||||
|
NotExist = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 存在
|
||||||
|
/// </summary>
|
||||||
|
Exist = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NA
|
||||||
|
/// </summary>
|
||||||
|
NA = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否存在(是否存在和NA)
|
||||||
|
/// </summary>
|
||||||
|
public enum YesOrNoOrNa
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 否
|
||||||
|
/// </summary>
|
||||||
|
No = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是
|
||||||
|
/// </summary>
|
||||||
|
Yes = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NA
|
||||||
|
/// </summary>
|
||||||
|
NA = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否淋巴结
|
||||||
|
/// </summary>
|
||||||
|
public enum IsLymph
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 否
|
||||||
|
/// </summary>
|
||||||
|
No = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是
|
||||||
|
/// </summary>
|
||||||
|
Yes = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 整体肿瘤评估
|
||||||
|
/// </summary>
|
||||||
|
public enum OverallAssessment
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// CR
|
||||||
|
/// </summary>
|
||||||
|
CR = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ND
|
||||||
|
/// </summary>
|
||||||
|
ND = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NE
|
||||||
|
/// </summary>
|
||||||
|
NE = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NN
|
||||||
|
/// </summary>
|
||||||
|
NN = 3,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PD
|
||||||
|
/// </summary>
|
||||||
|
PD = 4,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PR
|
||||||
|
/// </summary>
|
||||||
|
PR = 5,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SD
|
||||||
|
/// </summary>
|
||||||
|
SD = 6,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NA
|
||||||
|
/// </summary>
|
||||||
|
NA = 6
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 新病灶评估
|
||||||
|
/// </summary>
|
||||||
|
public enum NewLesionAssessment
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是
|
||||||
|
/// </summary>
|
||||||
|
Yes = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 疑似
|
||||||
|
/// </summary>
|
||||||
|
Suspected = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NE
|
||||||
|
/// </summary>
|
||||||
|
NE = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 否
|
||||||
|
/// </summary>
|
||||||
|
No = 3,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NA
|
||||||
|
/// </summary>
|
||||||
|
NA = 4
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 非靶病灶评估
|
||||||
|
/// </summary>
|
||||||
|
public enum NoTargetAssessment
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// PD
|
||||||
|
/// </summary>
|
||||||
|
PD = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// CR
|
||||||
|
/// </summary>
|
||||||
|
CR = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NE
|
||||||
|
/// </summary>
|
||||||
|
NE = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ND
|
||||||
|
/// </summary>
|
||||||
|
ND = 3,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NN
|
||||||
|
/// </summary>
|
||||||
|
NN = 4,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NA
|
||||||
|
/// </summary>
|
||||||
|
NA = 5
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 靶病灶评估
|
||||||
|
/// </summary>
|
||||||
|
public enum TargetAssessment
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// CR
|
||||||
|
/// </summary>
|
||||||
|
CR = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PR
|
||||||
|
/// </summary>
|
||||||
|
PR = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SD
|
||||||
|
/// </summary>
|
||||||
|
SD = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PD
|
||||||
|
/// </summary>
|
||||||
|
PD = 3,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NE
|
||||||
|
/// </summary>
|
||||||
|
NE = 4,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ND
|
||||||
|
/// </summary>
|
||||||
|
ND = 5,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NA
|
||||||
|
/// </summary>
|
||||||
|
NA = 6
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -38,6 +38,20 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取枚举Int值
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetEnumInt<T>(this T value) where T : Enum
|
||||||
|
{
|
||||||
|
|
||||||
|
return ((int)(object)value).ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 字符匹配枚举
|
/// 字符匹配枚举
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -49,7 +63,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return int.Parse(value) == int.Parse(enumValue.ToString());
|
return int.Parse(value) == (int)(object)enumValue;
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue