Test.EIImageViewer
parent
cc0933da8a
commit
25d07ecf8b
|
@ -92,6 +92,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
public Guid SubjectId { get; set; }
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
public bool IsBaseLine { get; set; }
|
||||||
|
|
||||||
public Guid VisitTaskId { get; set; }
|
public Guid VisitTaskId { get; set; }
|
||||||
|
|
||||||
public Guid CriterionId { 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)
|
foreach (var calculate in calculateList)
|
||||||
{
|
{
|
||||||
var item=inDto.QuestionInfo.FirstOrDefault(x => x.QuestionType == calculate.QuestionType);
|
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);
|
var value = await calculate.GetDecimalNullFun(inDto);
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
item.Answer = string.Empty;
|
if (typeNAList.Contains(item.QuestionType ?? QuestionType.SOD))
|
||||||
|
{
|
||||||
|
item.Answer = "NA";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item.Answer = string.Empty;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
||||||
|
@ -276,6 +293,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task<ReadingCalculateDto> GetReadingCalculateDto(Guid visitTaskId)
|
public async Task<ReadingCalculateDto> GetReadingCalculateDto(Guid visitTaskId)
|
||||||
{
|
{
|
||||||
var visitTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
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();
|
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()
|
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,
|
QuestionInfo = questionInfos,
|
||||||
CriterionId = criterionId,
|
CriterionId = criterionId,
|
||||||
TrialId = visitTask.TrialId,
|
TrialId = visitTask.TrialId,
|
||||||
|
IsBaseLine = subjectVisit!.IsBaseLine,
|
||||||
DoctorUserId = visitTask.DoctorUserId,
|
DoctorUserId = visitTask.DoctorUserId,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -525,6 +544,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetLowVisit(ReadingCalculateDto inDto)
|
public async Task<string> GetLowVisit(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
|
if (inDto.IsBaseLine)
|
||||||
|
{
|
||||||
|
return "NA";
|
||||||
|
}
|
||||||
|
|
||||||
var decimalAnswerList = await GetVisitTaskAnswerList(inDto);
|
var decimalAnswerList = await GetVisitTaskAnswerList(inDto);
|
||||||
return decimalAnswerList.OrderBy(x => x.SOD).Select(x => x.VisitName).FirstOrDefault() ?? string.Empty;
|
return decimalAnswerList.OrderBy(x => x.SOD).Select(x => x.VisitName).FirstOrDefault() ?? string.Empty;
|
||||||
}
|
}
|
||||||
|
@ -560,6 +584,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetIsAddFive(ReadingCalculateDto inDto)
|
public async Task<string> GetIsAddFive(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
|
if (inDto.IsBaseLine)
|
||||||
|
{
|
||||||
|
return "NA";
|
||||||
|
}
|
||||||
|
|
||||||
var LastVisitTaskId = await this.GetLastVisitTaskId(inDto);
|
var LastVisitTaskId = await this.GetLastVisitTaskId(inDto);
|
||||||
|
|
||||||
|
@ -596,6 +624,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetNETarget(ReadingCalculateDto inDto)
|
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");
|
var result = inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer == "NE");
|
||||||
|
|
||||||
return result ? "有" : "无";
|
return result ? "有" : "无";
|
||||||
|
@ -611,6 +644,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetTumor(ReadingCalculateDto inDto)
|
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 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 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();
|
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)
|
public async Task<string> GetTargetLesionEvaluate(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
||||||
|
if (inDto.IsBaseLine)
|
||||||
|
{
|
||||||
|
return "NA";
|
||||||
|
}
|
||||||
if (tableQuestion.Count() == 0)
|
if (tableQuestion.Count() == 0)
|
||||||
{
|
{
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
@ -942,7 +984,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetNoTargetLesionEvaluate(ReadingCalculateDto inDto)
|
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();
|
var tableQuestions = tableRows.SelectMany(x => x.TableQuestionList).ToList();
|
||||||
|
|
||||||
|
@ -995,7 +1042,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetNewLesionEvaluate(ReadingCalculateDto inDto)
|
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();
|
var tableQuestions = tableRows.SelectMany(x => x.TableQuestionList).ToList();
|
||||||
|
|
||||||
|
|
|
@ -53,15 +53,24 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
public static decimal IsNullOrEmptyReturn0(this string value)
|
public static decimal IsNullOrEmptyReturn0(this string value)
|
||||||
{
|
{
|
||||||
if (value == null || value == string.Empty)
|
try
|
||||||
{
|
{
|
||||||
return 0;
|
if (value == null || value == string.Empty || value == "NA")
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return decimal.Parse(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (Exception)
|
||||||
{
|
{
|
||||||
return decimal.Parse(value);
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue