Uat_Study
parent
c5bf938be3
commit
e3f7250d12
|
@ -473,7 +473,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
// 间隔天数
|
// 间隔天数
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.DaysBetween,GetIntFun=GetNumberOfDaysBetween},
|
new ReadingCalculateData (){QuestionType=QuestionType.DaysBetween,GetIntFun=GetNumberOfDaysBetween},
|
||||||
|
|
||||||
// 自治疗后第二个访视点以来持续的新骨病变数量
|
// 访视点肿瘤评估
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.SiteVisitForTumorEvaluation,GetStringFun=GetSiteVisitForTumorEvaluation},
|
new ReadingCalculateData (){QuestionType=QuestionType.SiteVisitForTumorEvaluation,GetStringFun=GetSiteVisitForTumorEvaluation},
|
||||||
|
|
||||||
|
|
||||||
|
@ -718,11 +718,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetSiteVisitForTumorEvaluation(ReadingCalculateDto inDto)
|
public async Task<string> GetSiteVisitForTumorEvaluation(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
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();
|
||||||
var alwaysNewLesionsCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.AlwaysNewLesionsCount).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
var alwaysNewLesionsCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.AlwaysNewLesionsCount).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
if (newLesionsCount == 0 &&
|
|
||||||
|
if (isPD)
|
||||||
|
{
|
||||||
|
return VisitTumorEvaluation.PD.GetEnumInt();
|
||||||
|
}else if (newLesionsCount == 0 &&
|
||||||
baseLineLesionsCount == 0 &&
|
baseLineLesionsCount == 0 &&
|
||||||
alwaysNewLesionsCount == 0)
|
alwaysNewLesionsCount == 0)
|
||||||
{
|
{
|
||||||
|
@ -739,7 +743,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task ChangeLastTaskSiteVisitForTumorEvaluation(ReadingCalculateDto inDto)
|
public async Task<bool> ChangeLastTaskSiteVisitForTumorEvaluation(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||||
var taskList =await GetSiteVisitForTumorList(inDto);
|
var taskList =await GetSiteVisitForTumorList(inDto);
|
||||||
|
@ -752,41 +756,51 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
if (lastTask != null)
|
if (lastTask != null)
|
||||||
{
|
{
|
||||||
var lastTasknewLesionsCount = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == newLesionsCountQuestionId).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
|
||||||
if (lastTask.VisitTaskNum == 1m)
|
#region 1、基线后第一个访视:新病灶计数≥ 2个;2、基线后第二个访视(应满足访视间隔6周以上,否则顺延)新病灶≥ 2个;
|
||||||
|
//1、基线后第一个访视:新病灶计数≥ 2个;2、基线后第二个访视(应满足访视间隔6周以上,否则顺延)新病灶≥ 2个;
|
||||||
|
|
||||||
|
|
||||||
|
var firstVisit = taskList.FirstOrDefault();
|
||||||
|
|
||||||
|
//基线后第二个访视(应满足访视间隔6周以上,否则顺延)
|
||||||
|
var secondVisit = taskList.Where(x => x.VisitTaskNum >= 2 && x.EarliestScanDate >= baseLineTask.LatestScanDate.AddDays(42)).FirstOrDefault();
|
||||||
|
if (secondVisit != null)
|
||||||
{
|
{
|
||||||
//基线后第二个访视(应满足访视间隔6周以上,否则顺延)
|
|
||||||
var secondVisit = taskList.Where(x => x.VisitTaskNum >= 2 && x.EarliestScanDate >= baseLineTask.LatestScanDate.AddDays(42)).FirstOrDefault();
|
var firstTaskNewLesionsCount = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == firstVisit.VisitTaskId && x.ReadingQuestionTrialId == newLesionsCountQuestionId).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
||||||
if (secondVisit != null)
|
|
||||||
|
// 第二访视数量
|
||||||
|
var secondVisitLesionsCount = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == newLesionsCountQuestionId).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
||||||
|
|
||||||
|
// 判断是否是当前访视 当前访视还未入库
|
||||||
|
if (secondVisit.VisitTaskId == inDto.VisitTaskId)
|
||||||
{
|
{
|
||||||
|
secondVisitLesionsCount = (inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0();
|
||||||
// 第二访视数量
|
|
||||||
var secondVisitLesionsCount = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == newLesionsCountQuestionId).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
|
||||||
|
|
||||||
// 判断是否是当前访视
|
|
||||||
if (secondVisit.VisitTaskId == inDto.VisitTaskId)
|
|
||||||
{
|
|
||||||
secondVisitLesionsCount = (inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lastTasknewLesionsCount >= 2 && secondVisitLesionsCount >= 2)
|
|
||||||
{
|
|
||||||
isPDResult = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
if (firstTaskNewLesionsCount >= 2 && secondVisitLesionsCount >= 2)
|
||||||
else
|
|
||||||
{
|
|
||||||
var thisVisitTaskNewLesionsCount= (inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0();
|
|
||||||
|
|
||||||
var thisVisitTask = taskList.LastOrDefault();
|
|
||||||
|
|
||||||
if (lastTasknewLesionsCount >= 2 && thisVisitTaskNewLesionsCount >= 2&&lastTask.LatestScanDate.AddDays(42)<= thisVisitTask.EarliestScanDate)
|
|
||||||
{
|
{
|
||||||
isPDResult = true;
|
isPDResult = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (lastTask.VisitTaskNum >= 2m)
|
||||||
|
{
|
||||||
|
|
||||||
|
var lastTasknewLesionsCount = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == newLesionsCountQuestionId).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
||||||
|
var thisVisitTaskNewLesionsCount = (inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0();
|
||||||
|
|
||||||
|
var thisVisitTask = taskList.LastOrDefault();
|
||||||
|
|
||||||
|
if (lastTasknewLesionsCount >= 2 && thisVisitTaskNewLesionsCount >= 2 && lastTask.LatestScanDate.AddDays(42) <= thisVisitTask.EarliestScanDate)
|
||||||
|
{
|
||||||
|
isPDResult = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isPDResult)
|
if (isPDResult)
|
||||||
|
@ -800,6 +814,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return isPDResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -265,15 +265,17 @@ namespace IRaCIS.Core.Application.Services
|
||||||
|
|
||||||
// 非Dicom
|
// 非Dicom
|
||||||
|
|
||||||
//var noDicomStudyList = _noneDicomStudyRepository.Where(x => x.TrialId == trialId && x.SubjectVisitId == sujectVisitId).Select(x => new VisitStudyDTO()
|
var noDicomStudyList = _noneDicomStudyRepository.Where(x => x.TrialId == trialId && x.SubjectVisitId == sujectVisitId).Select(x => new VisitStudyDTO()
|
||||||
//{
|
{
|
||||||
// InstanceCount = x.FileCount,
|
InstanceCount = x.FileCount,
|
||||||
// Modalities = x.Modalities,
|
|
||||||
// SeriesCount = x.SeriesCount,
|
//
|
||||||
// StudyCode = x.StudyCode,
|
Modalities = string.Empty,
|
||||||
// StudyId = x.Id,
|
SeriesCount = 1,
|
||||||
// IsDicom = false,
|
StudyCode = x.StudyCode,
|
||||||
//}).ToListAsync();
|
StudyId = x.Id,
|
||||||
|
IsDicom = false,
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
return studyList;
|
return studyList;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue