项目状态 标准修改

Test.EIImageViewer
hang 2023-03-14 17:57:20 +08:00
parent 6635e3b3b8
commit 6aee86990e
2 changed files with 57 additions and 52 deletions

View File

@ -131,10 +131,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
QuestionId = x.Id,
GroupName = x.GroupName,
GroupEnName=x.GroupEnName,
GroupEnName = x.GroupEnName,
IsShowInDicom = x.IsShowInDicom,
Type = x.Type,
GroupId=x.GroupId,
GroupId = x.GroupId,
QuestionType = x.QuestionType,
LesionType = x.LesionType,
QuestionGenre = x.QuestionGenre,
@ -145,19 +145,19 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
ShowOrder = x.ShowOrder,
ValueType = x.ValueType,
Unit = x.Unit,
CustomUnit=x.CustomUnit,
ReportLayType= ReportLayType.Group,
CustomUnit = x.CustomUnit,
ReportLayType = ReportLayType.Group,
}).ToList();
// 分组
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,
QuestionId = x.Id,
IsShowInDicom = x.IsShowInDicom,
GroupEnName=x.GroupEnName,
GroupEnName = x.GroupEnName,
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
LesionType = x.LesionType,
QuestionGenre = x.QuestionGenre,
@ -170,7 +170,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
OrderMark = x.OrderMark,
ValueType = x.ValueType,
Unit = x.Unit,
CustomUnit=x.CustomUnit,
CustomUnit = x.CustomUnit,
ReportLayType = ReportLayType.Question,
}).ToList();
@ -184,12 +184,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
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,
GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer,
TaskName = task.TaskName,
VisitTaskId = task.VisitTaskId,
});
}
@ -224,7 +224,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
Type = x.Type,
LesionType = question.LesionType,
TableQuestionType = x.TableQuestionType,
RowId=row.RowId,
RowId = row.RowId,
IsShowInDicom = question.IsShowInDicom,
DataSource = x.DataSource,
DictionaryCode = x.DictionaryCode,
@ -261,13 +261,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
switch (tableQuestion.QuestionMark)
{
case QuestionMark.Organ:
taskQuestionAnswer.Answer= organInfo.TULOCEN;
taskQuestionAnswer.Answer = organInfo.TULOCEN;
break;
case QuestionMark.Location:
if (organInfo.IsCanEditPosition)
{
}
else
{
@ -278,7 +278,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
case QuestionMark.Part:
taskQuestionAnswer.Answer = organInfo.PartEN;
break;
}
@ -294,7 +294,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
case QuestionMark.Location:
if (organInfo.IsCanEditPosition)
{
}
else
{
@ -344,7 +344,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
public async Task TestCalculate(Guid visitTaskId, QuestionType type)
{
ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(visitTaskId);
await ReadingCalculate(readingData,new List<QuestionType>() { type});
await ReadingCalculate(readingData, new List<QuestionType>() { type });
}
@ -384,7 +384,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
/// <param name="inDto"></param>
/// <param name="calculateType"></param>
/// <returns></returns>
public async Task ReadingCalculate(ReadingCalculateDto inDto,List<QuestionType> calculateType=null)
public async Task ReadingCalculate(ReadingCalculateDto inDto, List<QuestionType> calculateType = null)
{
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
@ -423,20 +423,24 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
//被评估为NE的单个靶病灶
new ReadingCalculateData (){QuestionType=QuestionType.NETarget,GetStringFun=GetNETarget},
//靶病灶评估
new ReadingCalculateData (){QuestionType=QuestionType.TargetLesion,GetStringFun=GetTargetLesionEvaluate},
//非靶病灶评估
new ReadingCalculateData (){QuestionType=QuestionType.NoTargetLesion,GetStringFun=GetNoTargetLesionEvaluate},
#region 疗效不自动计算
// //靶病灶评估
// new ReadingCalculateData (){QuestionType=QuestionType.TargetLesion,GetStringFun=GetTargetLesionEvaluate},
//是否存在新病灶
new ReadingCalculateData (){QuestionType=QuestionType.NewLesions,GetStringFun=GetNewLesionEvaluate},
////非靶病灶评估
// new ReadingCalculateData (){QuestionType=QuestionType.NoTargetLesion,GetStringFun=GetNoTargetLesionEvaluate},
//整体肿瘤评估
new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetTumor},
////是否存在新病灶
// new ReadingCalculateData (){QuestionType=QuestionType.NewLesions,GetStringFun=GetNewLesionEvaluate},
//是否存在疾病
new ReadingCalculateData (){QuestionType=QuestionType.ExistDisease,GetStringFun=GetIsExistDisease},
// //整体肿瘤评估
// new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetTumor},
// //是否存在疾病
// new ReadingCalculateData (){QuestionType=QuestionType.ExistDisease,GetStringFun=GetIsExistDisease},
#endregion
};
@ -457,7 +461,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
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
{
@ -469,7 +473,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
calculateList = calculateList.Where(x => questionTypes.Contains(x.QuestionType)).ToList();
}
@ -555,7 +559,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
}
}
needAddList.Add(new ReadingTaskQuestionAnswer()
@ -695,7 +699,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
}
#region 将上一次的访视病灶添加到这一次
@ -721,9 +725,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var LastVisitTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
x.IsAnalysisCreate== taskinfo.IsAnalysisCreate&&
x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
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
).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
@ -751,7 +755,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
x.SeriesId = null;
x.InstanceId = null;
x.MeasureData = string.Empty;
x.PicturePath= string.Empty;
x.PicturePath = string.Empty;
});
tableRowAnswers.ForEach(x =>
@ -781,10 +785,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 _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
@ -1220,7 +1224,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
// 找到所有访视任务的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.TrialReadingCriterionId == inDto.calculateDto.TrialReadingCriterionId &&
x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == inDto.calculateDto.ArmEnum).Select(x => x.Id).ToListAsync();
@ -1263,7 +1267,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
/// <returns></returns>
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;
}
@ -1272,9 +1276,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var baseLineTaskId = await _visitTaskRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ReadingCategory == ReadingCategory.Visit
&& x.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
x.SourceSubjectVisit.IsBaseLine && x.TaskState == TaskState.Effect &&
x.SourceSubjectVisit.IsBaseLine && x.TaskState == TaskState.Effect &&
x.IsAnalysisCreate == inDto.IsAnalysisCreate
&&x.DoctorUserId==inDto.DoctorUserId
&& x.DoctorUserId == inDto.DoctorUserId
&& x.IsSelfAnalysis == inDto.IsSelfAnalysis && x.ArmEnum == inDto.ArmEnum)
.Select(x => x.Id).FirstOrDefaultAsync();
@ -1324,7 +1328,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
visitTaskAnswerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId != inDto.VisitTaskId && x.VisitTask.ReadingCategory == ReadingCategory.Visit
&& x.VisitTask.IsAnalysisCreate == inDto.IsAnalysisCreate
&& x.VisitTask.IsSelfAnalysis == inDto.IsSelfAnalysis
&&x.VisitTask.VisitTaskNum<inDto.VisitTaskNum
&& x.VisitTask.VisitTaskNum < inDto.VisitTaskNum
&& x.SubjectId == inDto.SubjectId && x.VisitTask.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTask.ArmEnum == inDto.ArmEnum && x.VisitTask.TaskState == TaskState.Effect && x.ReadingQuestionTrial.QuestionType == QuestionType.SOD)
.Select(x => new VisitTaskAnswerInfo
{
@ -1342,7 +1346,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
visitTaskAnswerList.Add(new VisitTaskAnswerInfo()
{
VisitTaskId = inDto.VisitTaskId,
BlindName=inDto.TaskBlindName,
BlindName = inDto.TaskBlindName,
QuestionId = visitTaskAnswerList[0].QuestionId,
VisitName = inDto.VisitName,
SOD = (await GetSODData(inDto)).ToString().IsNullOrEmptyReturn0(),
@ -1374,7 +1378,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
x.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
x.TaskState == TaskState.Effect &&
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;
}
@ -1530,7 +1534,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes)))
{
// 淋巴结非靶病灶状态全部为消失
resultData.NonTargetStateIsLoss = resultData.NonTargetStateIsLoss&& item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Answer).FirstOrDefault()== NoTargetState.Loss.GetEnumInt();
resultData.NonTargetStateIsLoss = resultData.NonTargetStateIsLoss && item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Answer).FirstOrDefault() == NoTargetState.Loss.GetEnumInt();
}
}
@ -1540,10 +1544,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes)))
{
// 淋巴结的短径
resultData.DiameterLessThan10 = resultData.DiameterLessThan10&&(item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10;
resultData.DiameterLessThan10 = resultData.DiameterLessThan10 && (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10;
var shortIsBigger10 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() >= 10;
resultData.CurrenShortBigger10= resultData.CurrenShortBigger10|| shortIsBigger10;
resultData.CurrenShortBigger10 = resultData.CurrenShortBigger10 || shortIsBigger10;
if (shortIsBigger10)
{
@ -1556,7 +1560,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && !x.Answer.EqEnum(YesOrNoOrNa.Yes)))
{
// 当前访视点非淋巴结病灶至少一个非淋巴结靶病灶的长径
resultData.CurrentMajoreBigger0 = resultData.CurrentMajoreBigger0|| (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() > 0;
resultData.CurrentMajoreBigger0 = resultData.CurrentMajoreBigger0 || (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() > 0;
}
}
@ -1621,7 +1625,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
//if (当前访视点淋巴结病灶,至少一个淋巴结靶病灶短径≥10 mm 并且该淋巴结靶病灶短径绝对增加值≥5 mm)
// 换句话说 就是 短径≥10 的病灶 和 短径增加值≥5的病灶 的交集数量大于0
if (resultData.ShortBigger10Indexs.Intersect(resultData.AddFiveIndexs).ToList().Count()>0)
if (resultData.ShortBigger10Indexs.Intersect(resultData.AddFiveIndexs).ToList().Count() > 0)
{
//靶病灶疗效为 PD
result = TargetAssessment.PD;
@ -1735,11 +1739,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
result = NoTargetAssessment.NN;
}
//所有单个病灶/病灶组状态评估状态为“消失”
else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss))== tableQuestions.Count(x=> x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State)>0)
else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss)) == tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) > 0)
{
result = NoTargetAssessment.CR;
}
// 基线时没有非靶病灶
else if (tableQuestions.Count() == 0)
{
@ -1795,7 +1799,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
result = NewLesionAssessment.Suspected;
}
else
{
result = NewLesionAssessment.No;

View File

@ -259,7 +259,7 @@ namespace IRaCIS.Application.Services
var success = await _repository.SaveChangesAsync();
_provider.Set(trial.Id.ToString(), StaticData.TrialState.TrialInitializing, TimeSpan.FromDays(7));
_provider.Set(trial.Id.ToString(), StaticData.TrialState.TrialOngoing, TimeSpan.FromDays(7));
return ResponseOutput.Ok(trial);
}
@ -301,6 +301,7 @@ namespace IRaCIS.Application.Services
_mapper.Map(updateModel, trial);
var success = await _repository.SaveChangesAsync();
return ResponseOutput.Ok(trial);
}