Uat_Study
he 2022-11-07 10:48:14 +08:00
parent 7c2d4ca29a
commit 6a11188f5c
7 changed files with 84 additions and 14 deletions

View File

@ -2572,6 +2572,11 @@
字典code
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetSystemReadingQuestionOutDto.DefaultValue">
<summary>
默认值
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetSystemReadingQuestionOutDto.Type">
<summary>
类型

View File

@ -578,13 +578,14 @@ namespace IRaCIS.Application.Services
orders.ForEach(x =>
{
Dictionary<string, string> answers = new Dictionary<string, string>();
var rowAnswer = thisAnswer.Where(y => y.RowIndex == x).OrderBy(y => y.ShowOrder).ToList();
var rowInfo = tableAnsweRowInfos.Where(y => y.RowIndex == x && y.QuestionId == item.Id).FirstOrDefault();
var rowAnswer = thisAnswer.Where(y => y.RowId == rowInfo.Id).OrderBy(y => y.ShowOrder).ToList();
rowAnswer.ForEach(z =>
{
answers.Add(z.TableQuestionId.ToString(), z.Answer);
});
var rowInfo = tableAnsweRowInfos.Where(y => y.RowIndex == x && y.QuestionId == item.Id).FirstOrDefault();
answers.Add("BlindName", rowInfo.BlindName);
answers.Add("IsDicomReading", rowInfo.IsDicomReading.ToString());
@ -781,6 +782,7 @@ namespace IRaCIS.Application.Services
throw new BusinessValidationFailedException($"当前病灶分裂出其他病灶或者其他病灶合并到了当前病灶,删除失败");
}
var index = await _readingCalculateService.GetDeleteLesionStatrIndex(inDto);
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.RowId == inDto.RowId);
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.Id == inDto.RowId);
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
@ -788,27 +790,18 @@ namespace IRaCIS.Application.Services
var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId).OrderBy(x => x.RowIndex).ToListAsync();
var index = 1;
foreach (var item in rowInfoList.Where(x => x.RowIndex % 1 == 0))
{
await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == item.RowIndex && x.QuestionId == inDto.QuestionId, x => new ReadingTableQuestionAnswer()
{
RowIndex = index
});
await _readingTableAnswerRowInfoRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == item.RowIndex && x.QuestionId == inDto.QuestionId, x => new ReadingTableAnswerRowInfo()
{
RowIndex = index
});
var spiltList = rowInfoList.Where(x => x.RowIndex % 1 != 0 && x.RowIndex > item.RowIndex && x.RowIndex < Math.Floor(item.RowIndex + 1)).OrderBy(x => x.RowIndex).ToList();
decimal spiltindex = 0.01M;
foreach (var spiltitem in spiltList)
{
@ -816,8 +809,6 @@ namespace IRaCIS.Application.Services
{
RowIndex = index + spiltindex
});
await _readingTableAnswerRowInfoRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == spiltitem.RowIndex && x.QuestionId == inDto.QuestionId, x => new ReadingTableAnswerRowInfo()
{
RowIndex = index + spiltindex

View File

@ -46,6 +46,12 @@ namespace IRaCIS.Core.Application.Service
/// <returns></returns>
Task<GetReadingReportEvaluationOutDto> GetReadingReportEvaluation(GetReadingReportEvaluationInDto indto);
/// <summary>
/// 删除病灶获取起始病灶序号
/// </summary>
/// <returns></returns>
Task<int> GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto);
}
}

View File

@ -44,5 +44,12 @@ namespace IRaCIS.Core.Application.Service
/// <param name="indto"></param>
/// <returns></returns>
Task<GetReadingReportEvaluationOutDto> GetReadingReportEvaluation(GetReadingReportEvaluationInDto indto);
/// <summary>
/// 删除病灶获取起始病灶序号
/// </summary>
/// <returns></returns>
Task<int> GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto);
}
}

View File

@ -55,6 +55,29 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
private List<SiteVisitForTumor> siteVisitForTumorList = null;
#region 删除病灶获取起始病灶序号
/// <summary>
/// 删除病灶获取起始病灶序号
/// </summary>
/// <returns></returns>
public async Task<int> GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto)
{
var rowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).Include(x => x.ReadingQuestionTrial).FirstNotNullAsync();
if (rowInfo.ReadingQuestionTrial.LesionType == LesionType.NewLesions)
{
var minIndex= await _readingTableAnswerRowInfoRepository.Where(x => x.QuestionId == rowInfo.QuestionId && x.VisitTaskId == inDto.VisitTaskId).OrderBy(x => x.RowIndex).Select(x=>x.RowIndex).FirstOrDefaultAsync();
return (int)minIndex;
}
else
{
return 1;
}
}
#endregion
#region 获取阅片报告
/// <summary>
/// 获取阅片报告
@ -265,6 +288,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
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();
// 上一次的表格答案
var copyTableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == LastVisitTaskId
).Select(x => new CopyTableAnswerDto()
{
@ -277,6 +301,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
TrialId = x.TrialId
}).ToListAsync();
// 上一次的行信息
var tableRowAnswers = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == LastVisitTaskId).ProjectTo<CopyTableAnswerRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
tableRowAnswers.ForEach(x =>
@ -317,9 +342,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
try
{
// 新病灶外层问题
var newLesionQuestion = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.NewLesions && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
// 既往病灶外层问题
var alwaysNewLesionsQuestion = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.AlwaysNewLesions && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
// 新病灶表格问题
var newLesionTableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == newLesionQuestion.Id).ToListAsync();
// 既往病灶表格问题
var alwaysNewLesionsTableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == alwaysNewLesionsQuestion.Id).ToListAsync();
Dictionary<Guid, Guid> alwaysTableQuestionIdDic = new Dictionary<Guid, Guid>();

View File

@ -64,6 +64,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
private decimal? sODData;
#endregion
#region 删除病灶获取起始病灶序号
/// <summary>
/// 删除病灶获取起始病灶序号RECIST1Point1 固定是1
/// </summary>
/// <returns></returns>
public async Task<int> GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto)
{
return 1;
}
#endregion
#region 获取阅片报告
/// <summary>

View File

@ -192,6 +192,25 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
return new GetReadingReportEvaluationOutDto();
}
}
/// <summary>
/// 删除病灶获取起始病灶序号
/// </summary>
/// <returns></returns>
public async Task<int> GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto)
{
var service = await this.GetService(inDto.VisitTaskId);
if (service != null)
{
return await service.GetDeleteLesionStatrIndex(inDto);
}
else
{
return 1;
}
}
}