计算修改
parent
785641cc47
commit
ad0b3d4c28
|
|
@ -323,6 +323,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public string BlindName { get; set; }
|
public string BlindName { get; set; }
|
||||||
|
|
||||||
public decimal SOD { get; set; }
|
public decimal SOD { get; set; }
|
||||||
|
public decimal SpleenLength { get; set; }
|
||||||
|
|
||||||
public decimal VisitTaskNum { get; set; }
|
public decimal VisitTaskNum { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,12 +116,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId && x.ShowQuestion != ShowQuestion.Hide).ToListAsync();
|
var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId && x.ShowQuestion != ShowQuestion.Hide).ToListAsync();
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync();
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo<TableAnsweRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo<TableAnsweRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto
|
result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto
|
||||||
{
|
{
|
||||||
LesionType = x.Key.Value,
|
LesionType = x.Key.Value,
|
||||||
Count = x.ToList().Count()
|
Count = x.ToList().Count()
|
||||||
}).ToList();
|
}).ToList();
|
||||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
|
|
||||||
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
|
|
@ -141,10 +141,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
QuestionId = x.Id,
|
QuestionId = x.Id,
|
||||||
GroupName = x.GroupName,
|
GroupName = x.GroupName,
|
||||||
GroupEnName=x.GroupEnName,
|
GroupEnName = x.GroupEnName,
|
||||||
IsShowInDicom = x.IsShowInDicom,
|
IsShowInDicom = x.IsShowInDicom,
|
||||||
Type = x.Type,
|
Type = x.Type,
|
||||||
GroupId=x.GroupId,
|
GroupId = x.GroupId,
|
||||||
QuestionType = x.QuestionType,
|
QuestionType = x.QuestionType,
|
||||||
LesionType = x.LesionType,
|
LesionType = x.LesionType,
|
||||||
QuestionGenre = x.QuestionGenre,
|
QuestionGenre = x.QuestionGenre,
|
||||||
|
|
@ -155,19 +155,19 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
ShowOrder = x.ShowOrder,
|
ShowOrder = x.ShowOrder,
|
||||||
ValueType = x.ValueType,
|
ValueType = x.ValueType,
|
||||||
Unit = x.Unit,
|
Unit = x.Unit,
|
||||||
CustomUnit=x.CustomUnit,
|
CustomUnit = x.CustomUnit,
|
||||||
ReportLayType= ReportLayType.Group,
|
ReportLayType = ReportLayType.Group,
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
// 分组
|
// 分组
|
||||||
foreach (var item in questions)
|
foreach (var item in questions)
|
||||||
{
|
{
|
||||||
item.Childrens = questionList.Where(x => x.GroupId==item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
|
item.Childrens = questionList.Where(x => x.GroupId == item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
|
||||||
{
|
{
|
||||||
GroupName = x.GroupName,
|
GroupName = x.GroupName,
|
||||||
QuestionId = x.Id,
|
QuestionId = x.Id,
|
||||||
IsShowInDicom = x.IsShowInDicom,
|
IsShowInDicom = x.IsShowInDicom,
|
||||||
GroupEnName=x.GroupEnName,
|
GroupEnName = x.GroupEnName,
|
||||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
|
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
|
||||||
LesionType = x.LesionType,
|
LesionType = x.LesionType,
|
||||||
QuestionGenre = x.QuestionGenre,
|
QuestionGenre = x.QuestionGenre,
|
||||||
|
|
@ -180,7 +180,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
OrderMark = x.OrderMark,
|
OrderMark = x.OrderMark,
|
||||||
ValueType = x.ValueType,
|
ValueType = x.ValueType,
|
||||||
Unit = x.Unit,
|
Unit = x.Unit,
|
||||||
CustomUnit=x.CustomUnit,
|
CustomUnit = x.CustomUnit,
|
||||||
ReportLayType = ReportLayType.Question,
|
ReportLayType = ReportLayType.Question,
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
|
@ -194,12 +194,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
|
||||||
question.Answer.Add(new TaskQuestionAnswer()
|
question.Answer.Add(new TaskQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = answer==null?string.Empty:answer.Answer,
|
Answer = answer == null ? string.Empty : answer.Answer,
|
||||||
IsGlobalChange = answer == null ? false : answer.IsGlobalChange,
|
IsGlobalChange = answer == null ? false : answer.IsGlobalChange,
|
||||||
GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer,
|
GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer,
|
||||||
TaskName = task.TaskName,
|
TaskName = task.TaskName,
|
||||||
VisitTaskId = task.VisitTaskId,
|
VisitTaskId = task.VisitTaskId,
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -234,7 +234,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
Type = x.Type,
|
Type = x.Type,
|
||||||
LesionType = question.LesionType,
|
LesionType = question.LesionType,
|
||||||
TableQuestionType = x.TableQuestionType,
|
TableQuestionType = x.TableQuestionType,
|
||||||
RowId=row.RowId,
|
RowId = row.RowId,
|
||||||
IsShowInDicom = question.IsShowInDicom,
|
IsShowInDicom = question.IsShowInDicom,
|
||||||
DataSource = x.DataSource,
|
DataSource = x.DataSource,
|
||||||
DictionaryCode = x.DictionaryCode,
|
DictionaryCode = x.DictionaryCode,
|
||||||
|
|
@ -271,13 +271,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
switch (tableQuestion.QuestionMark)
|
switch (tableQuestion.QuestionMark)
|
||||||
{
|
{
|
||||||
case QuestionMark.Organ:
|
case QuestionMark.Organ:
|
||||||
taskQuestionAnswer.Answer= organInfo.TULOCEN;
|
taskQuestionAnswer.Answer = organInfo.TULOCEN;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case QuestionMark.Location:
|
case QuestionMark.Location:
|
||||||
if (organInfo.IsCanEditPosition)
|
if (organInfo.IsCanEditPosition)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -288,7 +288,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
case QuestionMark.Part:
|
case QuestionMark.Part:
|
||||||
|
|
||||||
taskQuestionAnswer.Answer = organInfo.PartEN;
|
taskQuestionAnswer.Answer = organInfo.PartEN;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -304,7 +304,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
case QuestionMark.Location:
|
case QuestionMark.Location:
|
||||||
if (organInfo.IsCanEditPosition)
|
if (organInfo.IsCanEditPosition)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -354,7 +354,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
public async Task TestCalculate(Guid visitTaskId, QuestionType type)
|
public async Task TestCalculate(Guid visitTaskId, QuestionType type)
|
||||||
{
|
{
|
||||||
ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(visitTaskId);
|
ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(visitTaskId);
|
||||||
await ReadingCalculate(readingData,new List<QuestionType>() { type});
|
await ReadingCalculate(readingData, new List<QuestionType>() { type });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -391,9 +391,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
x.VisitTaskId
|
x.VisitTaskId
|
||||||
}).OrderBy(x => x.Answer).Select(x => x.VisitTaskId).FirstOrDefault();
|
}).OrderBy(x => x.Answer).Select(x => x.VisitTaskId).FirstOrDefault();
|
||||||
|
|
||||||
if (lowPddTaskid != null&& lowPddTaskid!=default(Guid))
|
if (lowPddTaskid != null && lowPddTaskid != default(Guid))
|
||||||
{
|
{
|
||||||
|
|
||||||
var lowPPDAnswerList = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)
|
var lowPPDAnswerList = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)
|
||||||
&& x.QuestionId == inDto.QuestionId
|
&& x.QuestionId == inDto.QuestionId
|
||||||
&& x.RowIndex == inDto.RowIndex).Include(x => x.ReadingTableQuestionTrial)
|
&& x.RowIndex == inDto.RowIndex).Include(x => x.ReadingTableQuestionTrial)
|
||||||
|
|
@ -448,7 +448,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <param name="calculateType"></param>
|
/// <param name="calculateType"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task ReadingCalculate(ReadingCalculateDto inDto,List<QuestionType> calculateType=null)
|
public async Task ReadingCalculate(ReadingCalculateDto inDto, List<QuestionType> calculateType = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
||||||
|
|
@ -461,6 +461,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
//垂直径乘积之和(SPD)
|
//垂直径乘积之和(SPD)
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.SPD,GetDecimalFun=GetSPD},
|
new ReadingCalculateData (){QuestionType=QuestionType.SPD,GetDecimalFun=GetSPD},
|
||||||
|
|
||||||
|
// 与基线相比SPD变化的百分比
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.SPDChange,GetDecimalFun=CompareBaselineSPD},
|
||||||
|
|
||||||
|
// 与基线相比脾肿大增加的百分比
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.SplenoncusChange,GetDecimalFun=GetSplenoncusChange},
|
||||||
|
|
||||||
|
// 与最低点相比脾脏垂直径长度的增加值
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.SplenoncusAdd,GetDecimalFun=GetSplenoncusAdd},
|
||||||
|
|
||||||
|
// 与基线相比脾垂直径变化值
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.SplenoncusDiameterChange,GetDecimalFun=GetSplenoncusDiameterChange},
|
||||||
|
|
||||||
|
// 脾肿垂直径最低点访视
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.LowestSplenoncusVisit,GetStringFun=GetLowestSplenoncusVisit},
|
||||||
|
|
||||||
////靶病灶径线之和(SOD)
|
////靶病灶径线之和(SOD)
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.SOD,GetDecimalNullFun=GetSODData},
|
//new ReadingCalculateData (){QuestionType=QuestionType.SOD,GetDecimalNullFun=GetSODData},
|
||||||
|
|
||||||
|
|
@ -528,7 +543,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var isNeedDeleteTypes = calculateList.Where(x => !questionTypes.Contains(x.QuestionType)).Select(x => x.QuestionType).ToList();
|
var isNeedDeleteTypes = calculateList.Where(x => !questionTypes.Contains(x.QuestionType)).Select(x => x.QuestionType).ToList();
|
||||||
|
|
||||||
|
|
||||||
var isNeedDeleteIds = inDto.QuestionInfo.Where(x =>x.QuestionType!=null&& isNeedDeleteTypes.Contains(x.QuestionType.Value)).Select(x => x.QuestionId).ToList();
|
var isNeedDeleteIds = inDto.QuestionInfo.Where(x => x.QuestionType != null && isNeedDeleteTypes.Contains(x.QuestionType.Value)).Select(x => x.QuestionId).ToList();
|
||||||
|
|
||||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && isNeedDeleteIds.Contains(x.ReadingQuestionTrialId), x => new ReadingTaskQuestionAnswer
|
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && isNeedDeleteIds.Contains(x.ReadingQuestionTrialId), x => new ReadingTaskQuestionAnswer
|
||||||
{
|
{
|
||||||
|
|
@ -540,7 +555,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
calculateList = calculateList.Where(x => questionTypes.Contains(x.QuestionType)).ToList();
|
calculateList = calculateList.Where(x => questionTypes.Contains(x.QuestionType)).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -626,7 +641,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||||
|
|
@ -705,7 +720,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Answer == string.Empty || x.Answer == null)
|
var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Answer == string.Empty || x.Answer == null)
|
||||||
&& x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State
|
&& x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State
|
||||||
|
|
@ -773,7 +788,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 将上一次的访视病灶添加到这一次
|
#region 将上一次的访视病灶添加到这一次
|
||||||
|
|
||||||
|
|
@ -799,9 +814,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
var LastVisitTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
var LastVisitTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
||||||
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
|
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
|
||||||
x.IsAnalysisCreate== taskinfo.IsAnalysisCreate&&
|
x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
||||||
x.DoctorUserId == taskinfo.DoctorUserId &&
|
x.DoctorUserId == taskinfo.DoctorUserId &&
|
||||||
x.IsSelfAnalysis== taskinfo.IsSelfAnalysis &&
|
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
||||||
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
|
||||||
).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
|
).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
@ -829,7 +844,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
x.SeriesId = null;
|
x.SeriesId = null;
|
||||||
x.InstanceId = null;
|
x.InstanceId = null;
|
||||||
x.MeasureData = string.Empty;
|
x.MeasureData = string.Empty;
|
||||||
x.PicturePath= string.Empty;
|
x.PicturePath = string.Empty;
|
||||||
});
|
});
|
||||||
|
|
||||||
tableRowAnswers.ForEach(x =>
|
tableRowAnswers.ForEach(x =>
|
||||||
|
|
@ -859,10 +874,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var addList= _mapper.Map<List<ReadingTableAnswerRowInfo>>(tableRowAnswers);
|
|
||||||
|
var addList = _mapper.Map<List<ReadingTableAnswerRowInfo>>(tableRowAnswers);
|
||||||
|
|
||||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList);
|
await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList);
|
||||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
@ -1229,29 +1244,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
#region 修改其他标准
|
#region 修改其他标准
|
||||||
|
|
||||||
#region 修改与整个访视期间SOD最低点相比增加的值(mm)
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 修改与整个访视期间SOD最低点相比增加的值(mm)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task ChangeAllLowestIncrease(ChangeAllTaskDto inDto)
|
|
||||||
{
|
|
||||||
var visitTaskList = await GetVisitTaskAnswerList(inDto.calculateDto);
|
|
||||||
|
|
||||||
var lowSod = (await GetLowSODVisit(inDto.calculateDto)).Select(x => x.SOD).OrderBy(x => x).FirstOrDefault();
|
|
||||||
|
|
||||||
foreach (var item in visitTaskList.Where(x => x.VisitTaskId != inDto.calculateDto.BaseLineTaskId))
|
|
||||||
{
|
|
||||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == inDto.QuestionId, x => new ReadingTaskQuestionAnswer()
|
|
||||||
{
|
|
||||||
Answer = (item.SOD - lowSod).ToString()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
#region 修改整个访视期间SOD最低点相比增加的百分比
|
#region 修改整个访视期间SOD最低点相比增加的百分比
|
||||||
|
|
@ -1298,7 +1291,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
// 找到所有访视任务的Id
|
// 找到所有访视任务的Id
|
||||||
|
|
||||||
var visitTaskIds = await _visitTaskRepository.Where(x => x.IsAnalysisCreate == inDto.IsAnalysisCreate &&
|
var visitTaskIds = await _visitTaskRepository.Where(x => x.IsAnalysisCreate == inDto.IsAnalysisCreate &&
|
||||||
x.ReadingCategory == ReadingCategory.Visit &&
|
x.ReadingCategory == ReadingCategory.Visit &&
|
||||||
x.TrialReadingCriterionId == inDto.calculateDto.TrialReadingCriterionId &&
|
x.TrialReadingCriterionId == inDto.calculateDto.TrialReadingCriterionId &&
|
||||||
x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == inDto.calculateDto.ArmEnum).Select(x => x.Id).ToListAsync();
|
x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == inDto.calculateDto.ArmEnum).Select(x => x.Id).ToListAsync();
|
||||||
|
|
@ -1343,7 +1336,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
private async Task<Guid> GetBaseLineTaskId(ReadingCalculateDto inDto)
|
private async Task<Guid> GetBaseLineTaskId(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
if (this.BaseLineTaskId == null)
|
if (this.BaseLineTaskId == null)
|
||||||
{
|
{
|
||||||
this.BaseLineTaskId = await _visitTaskRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ReadingCategory == ReadingCategory.Visit
|
this.BaseLineTaskId = await _visitTaskRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ReadingCategory == ReadingCategory.Visit
|
||||||
&& x.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
|
&& x.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
|
||||||
|
|
||||||
|
|
@ -1367,7 +1360,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task<decimal> GetBaseLineSOD(ReadingCalculateDto inDto)
|
private async Task<decimal> GetBaseLineSOD(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
if (await _visitTaskRepository.AnyAsync(x => x.Id == inDto.VisitTaskId && x.SourceSubjectVisit.IsBaseLine && x.IsAnalysisCreate==inDto.IsAnalysisCreate && x.ArmEnum == inDto.ArmEnum))
|
if (await _visitTaskRepository.AnyAsync(x => x.Id == inDto.VisitTaskId && x.SourceSubjectVisit.IsBaseLine && x.IsAnalysisCreate == inDto.IsAnalysisCreate && x.ArmEnum == inDto.ArmEnum))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1376,9 +1369,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var baseLineTaskId = await _visitTaskRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ReadingCategory == ReadingCategory.Visit
|
var baseLineTaskId = await _visitTaskRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ReadingCategory == ReadingCategory.Visit
|
||||||
&& x.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
|
&& x.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
|
||||||
|
|
||||||
x.SourceSubjectVisit.IsBaseLine && x.TaskState == TaskState.Effect &&
|
x.SourceSubjectVisit.IsBaseLine && x.TaskState == TaskState.Effect &&
|
||||||
x.IsAnalysisCreate == inDto.IsAnalysisCreate
|
x.IsAnalysisCreate == inDto.IsAnalysisCreate
|
||||||
&&x.DoctorUserId==inDto.DoctorUserId
|
&& x.DoctorUserId == inDto.DoctorUserId
|
||||||
&& x.IsSelfAnalysis == inDto.IsSelfAnalysis && x.ArmEnum == inDto.ArmEnum)
|
&& x.IsSelfAnalysis == inDto.IsSelfAnalysis && x.ArmEnum == inDto.ArmEnum)
|
||||||
.Select(x => x.Id).FirstOrDefaultAsync();
|
.Select(x => x.Id).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
@ -1428,9 +1421,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
visitTaskAnswerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId != inDto.VisitTaskId && x.VisitTask.ReadingCategory == ReadingCategory.Visit
|
visitTaskAnswerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId != inDto.VisitTaskId && x.VisitTask.ReadingCategory == ReadingCategory.Visit
|
||||||
&& x.VisitTask.IsAnalysisCreate == inDto.IsAnalysisCreate
|
&& x.VisitTask.IsAnalysisCreate == inDto.IsAnalysisCreate
|
||||||
&& x.VisitTask.IsSelfAnalysis == inDto.IsSelfAnalysis
|
&& x.VisitTask.IsSelfAnalysis == inDto.IsSelfAnalysis
|
||||||
&&x.VisitTask.VisitTaskNum<inDto.VisitTaskNum
|
&& x.VisitTask.VisitTaskNum < inDto.VisitTaskNum
|
||||||
&& x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId
|
&& x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId
|
||||||
&& x.SubjectId == inDto.SubjectId && x.VisitTask.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTask.ArmEnum == inDto.ArmEnum && x.VisitTask.TaskState == TaskState.Effect && x.ReadingQuestionTrial.QuestionType == QuestionType.SOD)
|
&& x.SubjectId == inDto.SubjectId && x.VisitTask.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTask.ArmEnum == inDto.ArmEnum && x.VisitTask.TaskState == TaskState.Effect && x.ReadingQuestionTrial.QuestionType == QuestionType.SpleenLength)
|
||||||
.Select(x => new VisitTaskAnswerInfo
|
.Select(x => new VisitTaskAnswerInfo
|
||||||
{
|
{
|
||||||
VisitTaskId = x.VisitTaskId,
|
VisitTaskId = x.VisitTaskId,
|
||||||
|
|
@ -1438,21 +1431,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
VisitName = x.VisitTask.SourceSubjectVisit.VisitName,
|
VisitName = x.VisitTask.SourceSubjectVisit.VisitName,
|
||||||
BlindName = x.VisitTask.TaskBlindName,
|
BlindName = x.VisitTask.TaskBlindName,
|
||||||
|
|
||||||
SOD = x.Answer.IsNullOrEmptyReturn0(),
|
SpleenLength = x.Answer.IsNullOrEmptyReturn0(),
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
// 这里是需要加上自己的 基线不用管
|
//// 这里是需要加上自己的 基线不用管
|
||||||
if (visitTaskAnswerList.Count > 0)
|
//if (visitTaskAnswerList.Count > 0)
|
||||||
{
|
//{
|
||||||
visitTaskAnswerList.Add(new VisitTaskAnswerInfo()
|
// visitTaskAnswerList.Add(new VisitTaskAnswerInfo()
|
||||||
{
|
// {
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
// VisitTaskId = inDto.VisitTaskId,
|
||||||
BlindName=inDto.TaskBlindName,
|
// BlindName = inDto.TaskBlindName,
|
||||||
QuestionId = visitTaskAnswerList[0].QuestionId,
|
// QuestionId = visitTaskAnswerList[0].QuestionId,
|
||||||
VisitName = inDto.VisitName,
|
// VisitName = inDto.VisitName,
|
||||||
SOD = (await GetSODData(inDto)).ToString().IsNullOrEmptyReturn0(),
|
// SOD = (await GetSODData(inDto)).ToString().IsNullOrEmptyReturn0(),
|
||||||
});
|
// });
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1479,7 +1472,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
x.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
|
x.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
|
||||||
x.TaskState == TaskState.Effect &&
|
x.TaskState == TaskState.Effect &&
|
||||||
x.IsAnalysisCreate == inDto.IsAnalysisCreate
|
x.IsAnalysisCreate == inDto.IsAnalysisCreate
|
||||||
&& x.SourceSubjectVisitId == lastVisitId && x.ArmEnum==inDto.ArmEnum).Select(x => x.Id).FirstOrDefaultAsync();
|
&& x.SourceSubjectVisitId == lastVisitId && x.ArmEnum == inDto.ArmEnum).Select(x => x.Id).FirstOrDefaultAsync();
|
||||||
|
|
||||||
return LastVisitTaskId;
|
return LastVisitTaskId;
|
||||||
}
|
}
|
||||||
|
|
@ -1505,8 +1498,138 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 与基线相比SPD变化的百分比
|
||||||
|
/// <summary>
|
||||||
|
/// 与基线相比SPD变化的百分比
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<decimal> CompareBaselineSPD(ReadingCalculateDto inDto)
|
||||||
|
{
|
||||||
|
if (inDto.IsBaseLine)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
var baseLineTaskId = await GetBaseLineTaskId(inDto);
|
||||||
|
|
||||||
|
var baseLineSpd = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SPD).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
||||||
|
|
||||||
|
var presentSpd = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SPD).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
|
if (baseLineSpd != 0)
|
||||||
|
{
|
||||||
|
return (presentSpd - baseLineSpd) / baseLineSpd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 与基线相比脾肿大增加的百分比
|
||||||
|
/// <summary>
|
||||||
|
/// 与基线相比脾肿大增加的百分比
|
||||||
|
/// [(当前垂直径-130)-(基线垂直径-130)]/(基线垂直径-130)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<decimal> GetSplenoncusChange(ReadingCalculateDto inDto)
|
||||||
|
{
|
||||||
|
if (inDto.IsBaseLine)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
var baseLineTaskId = await GetBaseLineTaskId(inDto);
|
||||||
|
|
||||||
|
var baseLineSpleenLength = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
||||||
|
|
||||||
|
var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
|
if (baseLineSpleenLength - 130 != 0)
|
||||||
|
{
|
||||||
|
return (presentSpleenLength - 130 - (baseLineSpleenLength - 130)) / (baseLineSpleenLength - 130);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 与最低点相比脾脏垂直径长度的增加值
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 与最低点相比脾脏垂直径长度的增加值
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<decimal> GetSplenoncusAdd(ReadingCalculateDto inDto)
|
||||||
|
{
|
||||||
|
var TaskAnswer = await GetVisitTaskAnswerList(inDto);
|
||||||
|
if (inDto.IsBaseLine)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var presentSpd = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
|
var lowSplenoncus = TaskAnswer.OrderBy(x => x.SpleenLength).Select(x => x.SpleenLength).FirstOrDefault();
|
||||||
|
return presentSpd - lowSplenoncus;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 脾肿垂直径最低点访视
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 脾肿垂直径最低点访视
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<string> GetLowestSplenoncusVisit(ReadingCalculateDto inDto)
|
||||||
|
{
|
||||||
|
var taskAnswer = await GetVisitTaskAnswerList(inDto);
|
||||||
|
if (inDto.IsBaseLine)
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var lowSplenoncus = taskAnswer.OrderBy(x => x.SpleenLength).FirstOrDefault();
|
||||||
|
return lowSplenoncus.VisitTaskNum;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 与最低点相比脾脏垂直径长度的增加值
|
||||||
|
/// <summary>
|
||||||
|
/// 与最低点相比脾脏垂直径长度的增加值
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<decimal> GetSplenoncusDiameterChange(ReadingCalculateDto inDto)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (inDto.IsBaseLine)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseLineTaskId = await GetBaseLineTaskId(inDto);
|
||||||
|
var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
|
var baseLineSpleenLength = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
||||||
|
|
||||||
|
return presentSpleenLength - baseLineSpleenLength;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 获取靶病灶评估
|
#region 获取靶病灶评估
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取靶病灶评估
|
/// 获取靶病灶评估
|
||||||
|
|
|
||||||
|
|
@ -1976,6 +1976,70 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ImageQualityAssessment=44,
|
ImageQualityAssessment=44,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Forrest出血部位
|
||||||
|
/// </summary>
|
||||||
|
ForrestBleedingSite = 45,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Forrest评估结果
|
||||||
|
/// </summary>
|
||||||
|
ForrestAssessment = 46,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 肝脏状态
|
||||||
|
/// </summary>
|
||||||
|
LiverState = 47,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 脾脏长度
|
||||||
|
/// </summary>
|
||||||
|
SpleenLength = 48,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 脾脏状态
|
||||||
|
/// </summary>
|
||||||
|
SplenicStatus = 49,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 存在PET图像
|
||||||
|
/// </summary>
|
||||||
|
ExistPET = 50,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 肝脏血池SUVmax
|
||||||
|
/// </summary>
|
||||||
|
LiverSUVmax = 51,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 纵膈血池SUVmax
|
||||||
|
/// </summary>
|
||||||
|
MediastinumSUVmax = 52,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SUVmax
|
||||||
|
/// </summary>
|
||||||
|
SUVmax = 53,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SUVmax所在病灶
|
||||||
|
/// </summary>
|
||||||
|
SUVmaxLesion = 54,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PET 5PS评分
|
||||||
|
/// </summary>
|
||||||
|
PET5PS = 55,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 与基线相比摄取值变化
|
||||||
|
/// </summary>
|
||||||
|
UptakeChange = 56,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 骨髓中是否存在局灶性 FDG亲和病灶的证据
|
||||||
|
/// </summary>
|
||||||
|
EvidenceFocalFDG = 57,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue