Uat_Study
parent
be94cda987
commit
7d16c8649b
|
@ -32,6 +32,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
public bool IsChangeOtherTask { get; set; }
|
||||
|
||||
public List<QuestionInfo> QuestionInfo { get; set; } = new List<QuestionInfo>();
|
||||
|
||||
|
||||
|
|
|
@ -185,6 +185,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public List<DicomReadingQuestionAnswer> Childrens = new List<DicomReadingQuestionAnswer>();
|
||||
}
|
||||
|
||||
public class DeleteReadingRowAnswerInDto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public Guid QuestionId { get; set; }
|
||||
|
||||
public int RowIndex { get; set; }
|
||||
}
|
||||
|
||||
public class GetDicomReadingQuestionAnswerInDto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
|
|
@ -105,6 +105,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
SubjectVisitId = visitTask.SourceSubjectVisitId.Value,
|
||||
QuestionInfo = questionInfos,
|
||||
CriterionId= criterionId,
|
||||
IsChangeOtherTask=inDto.IsChangeOtherTask,
|
||||
TrialId=visitTask.TrialId,
|
||||
};
|
||||
await ReadingCalculate(readingData);
|
||||
|
@ -118,7 +119,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <returns></returns>
|
||||
public async Task ReadingCalculate(ReadingCalculateDto inDto)
|
||||
{
|
||||
|
||||
// 找到所有访视任务的Id
|
||||
|
||||
var visitTaskIds = await _visitTaskRepository.Where(x => !x.IsAnalysisCreate && x.ReadingCategory == ReadingCategory.Visit &&
|
||||
x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.Id).ToListAsync();
|
||||
|
||||
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
||||
foreach (var item in inDto.QuestionInfo.Where(x => x.QuestionType != null))
|
||||
{
|
||||
|
@ -174,11 +179,16 @@ namespace IRaCIS.Core.Application.Service
|
|||
break;
|
||||
// 整个访视期间最低点访视名称 其他任务需要改
|
||||
case QuestionType.LowVisit:
|
||||
var answer = (await GetLowVisit(inDto)).ToString();
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = (await GetLowVisit(inDto)).ToString(),
|
||||
Answer = answer,
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
if (inDto.IsChangeOtherTask)
|
||||
{
|
||||
await this.ChangeAllVisitTaskAnswer(visitTaskIds, item.QuestionId, answer);
|
||||
}
|
||||
break;
|
||||
// 是否存在非淋巴结靶病灶
|
||||
case QuestionType.IsLymphTarget:
|
||||
|
@ -487,6 +497,24 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
#region 通用方法
|
||||
|
||||
#region 修改所有访视任务的答案
|
||||
/// <summary>
|
||||
/// 修改所有访视任务的答案
|
||||
/// </summary>
|
||||
/// <param name="visitTaskGuids"></param>
|
||||
/// <param name="questionId"></param>
|
||||
/// <param name="answer"></param>
|
||||
/// <returns></returns>
|
||||
private async Task ChangeAllVisitTaskAnswer(List<Guid> visitTaskGuids, Guid questionId, string answer)
|
||||
{
|
||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => visitTaskGuids.Contains(x.VisitTaskId) && x.ReadingQuestionTrialId == questionId, x => new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = answer
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取基线SOD
|
||||
/// <summary>
|
||||
/// 获取基线SOD
|
||||
|
|
|
@ -116,13 +116,10 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> ChangeDicomReadingQuestionAnswer(ChangeDicomReadingQuestionAnswerInDto inDto)
|
||||
{
|
||||
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||
var criterionId = await _readingQuestionCriterionTrialRepository.Where(x => x.IsConfirm && x.TrialId == taskInfo.TrialId).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
|
||||
var questionIds = inDto.Answers.Select(x => x.Id).ToList();
|
||||
await _readingTaskQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && questionIds.Contains(x.ReadingQuestionTrialId));
|
||||
|
||||
var needAddAnswer = inDto.Answers.Select(x => new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
|
||||
|
@ -134,14 +131,46 @@ namespace IRaCIS.Application.Services
|
|||
VisitTaskId = inDto.VisitTaskId,
|
||||
|
||||
}).ToList();
|
||||
|
||||
await _readingTaskQuestionAnswerRepository.AddRangeAsync(needAddAnswer);
|
||||
|
||||
await _readingTaskQuestionAnswerRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除表格行数据
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> DeleteReadingRowAnswer(DeleteReadingRowAnswerInDto inDto)
|
||||
{
|
||||
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == inDto.RowIndex && x.QuestionId == inDto.QuestionId);
|
||||
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == inDto.RowIndex && x.QuestionId == inDto.QuestionId);
|
||||
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
|
||||
|
||||
var indexs =await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId).Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToListAsync();
|
||||
|
||||
var index = 1;
|
||||
foreach (var item in indexs)
|
||||
{
|
||||
await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == item && x.QuestionId == inDto.QuestionId, x => new ReadingTableQuestionAnswer()
|
||||
{
|
||||
RowIndex = index
|
||||
});
|
||||
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == item && x.QuestionId == inDto.QuestionId, x => new ReadingTableAnswerRowInfo()
|
||||
{
|
||||
RowIndex = index
|
||||
});
|
||||
|
||||
index++;
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取DIcom阅片问题答案
|
||||
/// </summary>
|
||||
|
@ -1640,7 +1669,7 @@ namespace IRaCIS.Application.Services
|
|||
TypeValue = x.TypeValue,
|
||||
RelevanceId = x.RelevanceId,
|
||||
IsRequired = x.IsRequired,
|
||||
RelevanceValue = x.RelevanceValue,
|
||||
RelevanceValue = x.RelevanceValue,
|
||||
ImageCount = 0,
|
||||
ParentId = item.Id,
|
||||
DataTableColumn = x.DataTableColumn,
|
||||
|
|
Loading…
Reference in New Issue