Uat_Study
he 2022-12-23 17:37:00 +08:00 committed by {872297557@qq.com}
parent 217fef2338
commit 24deaa829b
3 changed files with 48 additions and 26 deletions

View File

@ -181,20 +181,28 @@ namespace IRaCIS.Application.Services
}).ToList(); }).ToList();
x.AgreeOrNot = new List<GlobalQuestionInfo>() if (criterionType != CriterionType.PCWG3)
{ {
new GlobalQuestionInfo() x.AgreeOrNot = new List<GlobalQuestionInfo>()
{ {
Answer = globalReadingQuestion.Where(y => y.TaskId == x.VisitTaskId && y.GlobalAnswerType == GlobalAnswerType.AgreeOrNot).Select(x => x.Answer).FirstOrDefault() ?? string.Empty, new GlobalQuestionInfo()
QuestionName = "", {
Type = "input", Answer = globalReadingQuestion.Where(y => y.TaskId == x.VisitTaskId && y.GlobalAnswerType == GlobalAnswerType.AgreeOrNot).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
GlobalAnswerType=GlobalAnswerType.AgreeOrNot, QuestionName = "",
GlobalReadingShowType= GlobalReadingShowType.AllShow, Type = "input",
} GlobalAnswerType=GlobalAnswerType.AgreeOrNot,
GlobalReadingShowType= GlobalReadingShowType.AllShow,
}
};
}
else
{
x.AgreeOrNot = new List<GlobalQuestionInfo>() { };
}
};
List<GetGlobalQuestionType> questionTypes = new List<GetGlobalQuestionType>() List<GetGlobalQuestionType> questionTypes = new List<GetGlobalQuestionType>()
{ {

View File

@ -1205,7 +1205,7 @@ namespace IRaCIS.Application.Services
BlindName = rowInfo.BlindName, BlindName = rowInfo.BlindName,
IsDicomReading = rowInfo.IsDicomReading, IsDicomReading = rowInfo.IsDicomReading,
IsCurrentTaskAdd = isCurrentTaskAdd, IsCurrentTaskAdd = isCurrentTaskAdd,
FristAddTaskNum = rowInfo.FristAddTaskNum,
OrganInfoId=rowInfo.OrganInfoId, OrganInfoId=rowInfo.OrganInfoId,
PicturePath = rowInfo.PicturePath, PicturePath = rowInfo.PicturePath,
NumberOfFrames=rowInfo.NumberOfFrames, NumberOfFrames=rowInfo.NumberOfFrames,

View File

@ -524,7 +524,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
} }
break; break;
case QuestionType.AlwaysNewLesionsCount: case QuestionType.AlwaysNewLesionsCount:
if (inDto.VisitTaskNum >= 2) if (inDto.VisitTaskNum >1)
{ {
item.Answer = (await calculate.GetIntFun(inDto)).ToString(); item.Answer = (await calculate.GetIntFun(inDto)).ToString();
} }
@ -534,14 +534,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
} }
break; break;
case QuestionType.NewBoneLesionsCount: case QuestionType.NewBoneLesionsCount:
if (inDto.VisitTaskNum >= 3) item.Answer = (await calculate.GetIntFun(inDto)).ToString();
{
item.Answer = (await calculate.GetIntFun(inDto)).ToString();
}
else
{
item.Answer = nameof(YesOrNoOrNa.NA);
}
break; break;
case QuestionType.DaysBetween: case QuestionType.DaysBetween:
item.Answer = (await calculate.GetIntFun(inDto)).ToString(); item.Answer = (await calculate.GetIntFun(inDto)).ToString();
@ -673,14 +666,28 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
/// <returns></returns> /// <returns></returns>
public async Task<int> GetNewBoneLesionCount(ReadingCalculateDto inDto) public async Task<int> GetNewBoneLesionCount(ReadingCalculateDto inDto)
{ {
if (inDto.VisitTaskNum < 3)
var taskList = await GetSiteVisitForTumorList(inDto);
var findindex = taskList.OrderBy(x => x.VisitTaskNum).ToList().FindIndex(x => x.VisitTaskId == inDto.VisitTaskId);
var lastCount = 0;
if (findindex < 2)
{ {
return 0; return -1;
} }
var result= inDto.QuestionInfo.Where(x => x.LesionType == LesionType.AlwaysNewLesions).SelectMany(x => x.TableRowInfoList) else if (findindex > 2)
.Where(x =>x.FristAddTaskNum>=2&& x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.State && y.Answer == EvaluationOfState.Exists.GetEnumInt())) {
var lastTask = taskList.Where(x => x.VisitTaskNum < inDto.VisitTaskNum && x.VisitTaskId != inDto.VisitTaskId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault();
var cewBoneLesionsCountQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewBoneLesionsCount).Select(x => x.QuestionId).FirstOrDefault();
lastCount =(int) (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == cewBoneLesionsCountQuestionId).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
}
var result= inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewLesions).SelectMany(x => x.TableRowInfoList)
.Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.State && y.Answer == EvaluationOfState.Exists.GetEnumInt()))
.Count(); .Count();
return result;
return lastCount+ result;
} }
#endregion #endregion
@ -737,6 +744,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{ {
return VisitTumorEvaluation.NA.GetEnumInt(); return VisitTumorEvaluation.NA.GetEnumInt();
} }
//如果日期未知,不需要计算肿瘤评估结果;
if (await GetNumberOfDaysBetween(inDto) == -1)
{
return string.Empty;
}
var isPD= await ChangeLastTaskSiteVisitForTumorEvaluation(inDto); var isPD= await ChangeLastTaskSiteVisitForTumorEvaluation(inDto);
var newLesionsCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); var newLesionsCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
var baseLineLesionsCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.BaseLineLesionsCount).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); var baseLineLesionsCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.BaseLineLesionsCount).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
@ -858,6 +871,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
siteVisitForTumorList = await _visitTaskRepository.Where(x => (x.ReadingCategory == ReadingCategory.Visit && siteVisitForTumorList = await _visitTaskRepository.Where(x => (x.ReadingCategory == ReadingCategory.Visit &&
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId && x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
x.DoctorUserId== taskinfo.DoctorUserId&&
x.IsAnalysisCreate==inDto.IsAnalysisCreate&& x.IsAnalysisCreate==inDto.IsAnalysisCreate&&
x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTaskNum <= taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect && x.ArmEnum == taskinfo.ArmEnum x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTaskNum <= taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect && x.ArmEnum == taskinfo.ArmEnum
)||x.Id== inDto.VisitTaskId).OrderByDescending(x => x.VisitTaskNum).Select(x => new SiteVisitForTumor() )||x.Id== inDto.VisitTaskId).OrderByDescending(x => x.VisitTaskNum).Select(x => new SiteVisitForTumor()