修改稽查

Uat_Study
{872297557@qq.com} 2022-12-06 15:55:09 +08:00
parent 4b10febbd2
commit dca82016ed
5 changed files with 109 additions and 97 deletions

View File

@ -250,9 +250,6 @@ namespace IRaCIS.Core.API.Controllers
var result = await _trialConfigService.ConfigTrialBasicInfo(opt.Data);
await _inspectionService.CompletedSign(singid, result);
return result;
}

View File

@ -90,7 +90,7 @@ namespace IRaCIS.Core.Application.ViewModel
public bool IsHaveGeneratedTask { get; set; }
public bool IsReReadingOrBackInfluenceAnalysis { get; set; }
public int? ValidVisitCount { get; set; }
}

View File

@ -444,6 +444,8 @@ namespace IRaCIS.Core.Application.Service
TrialSiteCode = t.TrialSite.TrialSiteCode,
SubjectId = t.Id,
IsReReadingOrBackInfluenceAnalysis=t.IsReReadingOrBackInfluenceAnalysis,
BlindSubjectCode = t.SubjectVisitTaskList.Where(t => t.IsAnalysisCreate && t.TrialReadingCriterionId == trialReadingCriterionId).OrderByDescending(t => t.BlindSubjectCode).Select(t => t.BlindSubjectCode).FirstOrDefault(),
IsHaveGeneratedTask = t.SubjectVisitTaskList.Any(c => c.DoctorUserId == doctorUserId && c.IsSelfAnalysis == true && c.TrialReadingCriterionId==trialReadingCriterionId),
@ -467,6 +469,7 @@ namespace IRaCIS.Core.Application.Service
SourceSubjectVisitId = c.SourceSubjectVisitId,
SouceReadModuleId = c.SouceReadModuleId,
TrialReadingCriterionId=c.TrialReadingCriterionId,
//自身一致性才有意义
@ -555,7 +558,7 @@ namespace IRaCIS.Core.Application.Service
SubjectCode = t.Code,
TrialSiteCode = t.TrialSite.TrialSiteCode,
SubjectId = t.Id,
IsReReadingOrBackInfluenceAnalysis = t.IsReReadingOrBackInfluenceAnalysis,
IsHaveGeneratedTask = t.SubjectVisitTaskList.Any(c => c.IsSelfAnalysis == false && c.TrialReadingCriterionId==trialReadingCriterionId),

View File

@ -878,7 +878,6 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Ok(true);
}
if (await _readingTableAnswerRowInfoRepository.AnyAsync(x => x.SplitRowId == deleteRowInfo.Id && x.MergeRowId == deleteRowInfo.Id))
{
throw new BusinessValidationFailedException($"当前病灶分裂出其他病灶或者其他病灶合并到了当前病灶,删除失败");
@ -903,11 +902,11 @@ namespace IRaCIS.Application.Services
measureDataStr = JsonConvert.SerializeObject(measureData);
}
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,
@ -1100,55 +1099,54 @@ namespace IRaCIS.Application.Services
await VerifyTaskIsSign(inDto.VisitTaskId);
// 修改编号
//// 修改编号
//var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
//// 获取标准表格外层问题
//var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId && x.LesionType != null && x.ReadingTableQuestionTrialList.Any(x => x.QuestionMark == QuestionMark.AutoId))
// .SelectMany(x => x.ReadingTableQuestionTrialList).Where(x => x.QuestionMark == QuestionMark.AutoId).Select(x => new
// {
// x.ReadingQuestionId,
// TableQuestionId = x.Id,
// 获取标准表格外层问题
var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId && x.LesionType != null && x.ReadingTableQuestionTrialList.Any(x => x.QuestionMark == QuestionMark.AutoId))
.SelectMany(x => x.ReadingTableQuestionTrialList).Where(x => x.QuestionMark == QuestionMark.AutoId).Select(x => new
{
x.ReadingQuestionId,
TableQuestionId = x.Id,
// }).ToListAsync();
}).ToListAsync();
//var questionIds = questionList.Select(x => x.ReadingQuestionId).ToList();
var questionIds = questionList.Select(x => x.ReadingQuestionId).ToList();
//var questionMarkList = await _readingQuestionTrialRepository.Where(x => questionIds.Contains(x.Id)).Select(x => new
//{
// QuestionId = x.Id,
// x.OrderMark,
var questionMarkList = await _readingQuestionTrialRepository.Where(x => questionIds.Contains(x.Id)).Select(x => new
{
QuestionId = x.Id,
x.OrderMark,
//}).ToListAsync();
}).ToListAsync();
//var rowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && questionIds.Contains(x.QuestionId)).ToListAsync();
//List<ReadingTableQuestionAnswer> questionAnswerList = new List<ReadingTableQuestionAnswer>();
//foreach (var item in questionList)
//{
// await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == item.ReadingQuestionId
// && x.TableQuestionId == item.TableQuestionId && x.VisitTaskId == inDto.VisitTaskId);
var rowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && questionIds.Contains(x.QuestionId)).ToListAsync();
List<ReadingTableQuestionAnswer> questionAnswerList = new List<ReadingTableQuestionAnswer>();
foreach (var item in questionList)
{
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.QuestionId == item.ReadingQuestionId
&& x.TableQuestionId == item.TableQuestionId && x.VisitTaskId == inDto.VisitTaskId);
// var orderMark = questionMarkList.Where(x => x.QuestionId == item.ReadingQuestionId).Select(x => x.OrderMark).FirstOrDefault();
var orderMark = questionMarkList.Where(x => x.QuestionId == item.ReadingQuestionId).Select(x => x.OrderMark).FirstOrDefault();
// foreach (var row in rowInfo.Where(x => x.QuestionId == item.ReadingQuestionId))
// {
// questionAnswerList.Add(new ReadingTableQuestionAnswer()
// {
// Answer = orderMark + row.RowIndex.GetLesionMark(),
// Id = NewId.NextGuid(),
// QuestionId = item.ReadingQuestionId,
// RowId = row.Id,
// RowIndex = row.RowIndex,
// TableQuestionId = item.TableQuestionId,
// TrialId = taskInfo.TrialId,
// VisitTaskId = taskInfo.Id,
foreach (var row in rowInfo.Where(x => x.QuestionId == item.ReadingQuestionId))
{
questionAnswerList.Add(new ReadingTableQuestionAnswer()
{
Answer = orderMark + row.RowIndex.GetLesionMark(),
Id = NewId.NextGuid(),
QuestionId = item.ReadingQuestionId,
RowId = row.Id,
RowIndex = row.RowIndex,
TableQuestionId = item.TableQuestionId,
TrialId = taskInfo.TrialId,
VisitTaskId = taskInfo.Id,
});
}
}
await _readingTableQuestionAnswerRepository.AddRangeAsync(questionAnswerList);
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
// });
// }
//}
//await _readingTableQuestionAnswerRepository.AddRangeAsync(questionAnswerList);
//await _readingTableQuestionAnswerRepository.SaveChangesAsync();
@ -1272,7 +1270,8 @@ namespace IRaCIS.Application.Services
}
else if (inDto.SubjectId != null)
{
var subjectTaskList = (await _visitTaskService.GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto() {
var subjectTaskList = (await _visitTaskService.GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto()
{
TrialId = inDto.TrialId,
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
})).Item2;

View File

@ -464,9 +464,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
//任务
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitTask)))
{
@ -485,6 +482,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//Dicom 阅片 签名
if (_userInfo.RequestUrl == "ReadingImageTask/SubmitDicomVisitTask")
{
//跳转阅片结果需要该参数
var subjectCode=_dbContext.Subject.Where(t=>t.Id==entity.SubjectId).Select(t=>t.Code).First();
obj = new { SubjectCode = subjectCode };
}
#region 裁判、肿瘤学、全局 都是通用的
//裁判任务
@ -591,13 +596,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common
#region 阅片结果
#region Resisit1.1
#region 暂时不区分标准
//保存影像质量 多条记录,只记录一条稽查
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)))
{
//保存影像质量
if (_userInfo.RequestUrl == "ReadingImageTask/changeDicomReadingQuestionAnswer")
//1 保存影像质量 2:修改整体肿瘤评估结果
if (_userInfo.RequestUrl == "ReadingImageTask/changeDicomReadingQuestionAnswer/1" || _userInfo.RequestUrl == "ReadingImageTask/changeDicomReadingQuestionAnswer/2")
{
var type = AuditOpt.Add;
@ -608,7 +613,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => taskQuestionAnswerList.Select(k => k.ReadingQuestionTrialId).Contains(t.Id)).Select(t => new { t.QuestionName, QuestionId = t.Id, t.ShowOrder }).OrderBy(t => t.ShowOrder).ToListAsync();
var firstEntity = taskQuestionAnswerList.First();
var cloneEntity = firstEntity.Clone();
@ -632,8 +636,17 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
//病灶这里操作
if(entitys.Any(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)))
{
//删除病灶接口
if(_userInfo.RequestUrl == "ReadingImageTask/deleteReadingRowAnswer")
{
}
}
#endregion