修改
This commit is contained in:
@@ -92,6 +92,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public bool IsBaseLine { get; set; }
|
||||
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public Guid CriterionId { get; set; }
|
||||
|
||||
@@ -136,6 +136,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
};
|
||||
|
||||
|
||||
var typeNAList = new List<QuestionType>
|
||||
{
|
||||
QuestionType.SODChange,
|
||||
QuestionType.SODPercent,
|
||||
QuestionType.LowestIncrease,
|
||||
QuestionType.LowPercent,
|
||||
};
|
||||
|
||||
foreach (var calculate in calculateList)
|
||||
{
|
||||
var item=inDto.QuestionInfo.FirstOrDefault(x => x.QuestionType == calculate.QuestionType);
|
||||
@@ -157,7 +165,16 @@ namespace IRaCIS.Core.Application.Service
|
||||
var value = await calculate.GetDecimalNullFun(inDto);
|
||||
if (value == null)
|
||||
{
|
||||
item.Answer = string.Empty;
|
||||
if (typeNAList.Contains(item.QuestionType ?? QuestionType.SOD))
|
||||
{
|
||||
item.Answer = "NA";
|
||||
}
|
||||
else
|
||||
{
|
||||
item.Answer = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
@@ -276,6 +293,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
public async Task<ReadingCalculateDto> GetReadingCalculateDto(Guid visitTaskId)
|
||||
{
|
||||
var visitTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == (visitTask.SourceSubjectVisitId ?? default(Guid))).FirstOrDefaultAsync();
|
||||
var criterionId = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == visitTask.TrialId && x.IsConfirm).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
List<QuestionInfo> questionInfos = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId).Select(x => new QuestionInfo()
|
||||
{
|
||||
@@ -323,6 +341,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
QuestionInfo = questionInfos,
|
||||
CriterionId = criterionId,
|
||||
TrialId = visitTask.TrialId,
|
||||
IsBaseLine = subjectVisit!.IsBaseLine,
|
||||
DoctorUserId = visitTask.DoctorUserId,
|
||||
};
|
||||
|
||||
@@ -525,6 +544,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetLowVisit(ReadingCalculateDto inDto)
|
||||
{
|
||||
if (inDto.IsBaseLine)
|
||||
{
|
||||
return "NA";
|
||||
}
|
||||
|
||||
var decimalAnswerList = await GetVisitTaskAnswerList(inDto);
|
||||
return decimalAnswerList.OrderBy(x => x.SOD).Select(x => x.VisitName).FirstOrDefault() ?? string.Empty;
|
||||
}
|
||||
@@ -560,6 +584,10 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetIsAddFive(ReadingCalculateDto inDto)
|
||||
{
|
||||
if (inDto.IsBaseLine)
|
||||
{
|
||||
return "NA";
|
||||
}
|
||||
|
||||
var LastVisitTaskId = await this.GetLastVisitTaskId(inDto);
|
||||
|
||||
@@ -596,6 +624,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetNETarget(ReadingCalculateDto inDto)
|
||||
{
|
||||
if (inDto.IsBaseLine)
|
||||
{
|
||||
return "NA";
|
||||
}
|
||||
|
||||
var result = inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer == "NE");
|
||||
|
||||
return result ? "有" : "无";
|
||||
@@ -611,6 +644,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetTumor(ReadingCalculateDto inDto)
|
||||
{
|
||||
|
||||
if (inDto.IsBaseLine)
|
||||
{
|
||||
return "NA";
|
||||
}
|
||||
|
||||
var targetLesion = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.TargetLesion).Select(x => x.Answer).FirstOrDefault();
|
||||
var noTargetLesion = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NoTargetLesion).Select(x => x.Answer).FirstOrDefault();
|
||||
var newLesions = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesions).Select(x => x.Answer).FirstOrDefault();
|
||||
@@ -802,7 +841,10 @@ namespace IRaCIS.Core.Application.Service
|
||||
public async Task<string> GetTargetLesionEvaluate(ReadingCalculateDto inDto)
|
||||
{
|
||||
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
|
||||
if (inDto.IsBaseLine)
|
||||
{
|
||||
return "NA";
|
||||
}
|
||||
if (tableQuestion.Count() == 0)
|
||||
{
|
||||
return string.Empty;
|
||||
@@ -942,7 +984,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetNoTargetLesionEvaluate(ReadingCalculateDto inDto)
|
||||
{
|
||||
var tableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NonTargetLesions).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
if (inDto.IsBaseLine)
|
||||
{
|
||||
return "NA";
|
||||
}
|
||||
|
||||
var tableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NonTargetLesions).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
|
||||
var tableQuestions = tableRows.SelectMany(x => x.TableQuestionList).ToList();
|
||||
|
||||
@@ -995,7 +1042,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetNewLesionEvaluate(ReadingCalculateDto inDto)
|
||||
{
|
||||
var tableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewLesions).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
if (inDto.IsBaseLine)
|
||||
{
|
||||
return "NA";
|
||||
}
|
||||
|
||||
var tableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewLesions).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
|
||||
var tableQuestions = tableRows.SelectMany(x => x.TableQuestionList).ToList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user