表格问题病灶

This commit is contained in:
he
2024-12-23 17:45:42 +08:00
parent e22a015fcb
commit 3cde829319
12 changed files with 18526 additions and 2 deletions
@@ -394,6 +394,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class TableRowInfo
{
public Guid RowId { get; set; }
public decimal RowIndex { get; set; }
public decimal FristAddTaskNum { get; set; }
@@ -446,6 +446,60 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
}
/// <summary>
/// 保存表格问题标记
/// </summary>
public class SaveTableQuestionMarkInDto
{
public string Answer { get; set; }
public Guid VisitTaskId { get; set; }
public Guid QuestionId { get; set; }
public Guid? InstanceId { get; set; }
public Guid? SeriesId { get; set; }
public Guid? StudyId { get; set; }
public string MarkTool { get; set; } = string.Empty;
public string PicturePath { get; set; } = string.Empty;
public int? NumberOfFrames { get; set; }
public string MeasureData { get; set; } = string.Empty;
public Guid FirstAddTaskId
{
get
{
return this.VisitTaskId;
}
}
public QuestionType? QuestionType { get; set; }
public string OrderMarkName { get; set; } = string.Empty;
public Guid? OtherInstanceId { get; set; }
public Guid? OtherSeriesId { get; set; }
public Guid? OtherStudyId { get; set; }
public Guid? RowId { get; set; }
[NotDefault]
public Guid TableQuestionId { get; set; }
[NotDefault]
public decimal RowIndex { get; set; }
public string OtherMarkTool { get; set; } = string.Empty;
public string OtherPicturePath { get; set; } = string.Empty;
public int? OtherNumberOfFrames { get; set; }
public string OtherMeasureData { get; set; } = string.Empty;
}
public class GetPreviousOtherPicturePathInDto
{
@@ -996,6 +1050,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public string? OrderMark { get; set; }
public List<ReadingTaskQuestionMark> TableQuestionMarkList = new List<ReadingTaskQuestionMark>();
public string? OrderMarkName { get; set; }
@@ -83,6 +83,46 @@ namespace IRaCIS.Core.Application.Service
}
#endregion
/// <summary>
/// 保存表格问题标记
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<SaveTableQuestionMarkInDto> SaveTableQuestionMark(SaveTableQuestionMarkInDto inDto)
{
var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x =>x.VisitTaskId==inDto.VisitTaskId&&x.QuestionId==inDto.QuestionId&& x.RowId == inDto.RowId.Value && x.TableQuestionId == inDto.TableQuestionId);
await _readingTableQuestionAnswerRepository.AddAsync(new ReadingTableQuestionAnswer()
{
Answer = inDto.Answer,
QuestionId = inDto.QuestionId,
TableQuestionId = inDto.TableQuestionId,
VisitTaskId = inDto.VisitTaskId,
TrialId = visitTaskInfo.TrialId,
RowIndex = inDto.RowIndex,
RowId = inDto.RowId.Value,
});
await _readingTaskQuestionMarkRepository.BatchDeleteNoTrackingAsync(x=>x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && x.RowId == inDto.RowId.Value && x.TableQuestionId == inDto.TableQuestionId);
var readingTaskQuestionMark = _mapper.Map<ReadingTaskQuestionMark>(inDto);
await _readingTaskQuestionMarkRepository.AddAsync(readingTaskQuestionMark);
await _readingTaskQuestionMarkRepository.SaveChangesAsync();
await _readingCalculateService.CalculateTask(new CalculateTaskInDto()
{
IsChangeOtherTask = false,
VisitTaskId = inDto.VisitTaskId,
ComputationTrigger = ComputationTrigger.SaveTableQuestionMark,
});
return inDto;
}
/// <summary>
/// 获取既往病灶的OtherPicture
/// </summary>
@@ -934,7 +974,12 @@ namespace IRaCIS.Core.Application.Service
.ToListAsync();
var tableQuestionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
result.ForEach(x =>
{
x.TableQuestionMarkList = tableQuestionMarkList.Where(y => y.RowId == x.RowId).ToList();
});
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
@@ -66,6 +66,7 @@ namespace IRaCIS.Core.Application.Service
#endregion
CreateMap<VisitTask, VisitTaskDto>();
CreateMap<SaveTableQuestionMarkInDto, ReadingTaskQuestionMark>();
CreateMap<SubmitTableQuestionInDto, ReadingTableAnswerRowInfo>()
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
.ForAllMembers(opts => opts.Condition((src, dest, srcMember) => srcMember != null));