病灶合并
parent
8b86bc6b3f
commit
df187bed58
|
@ -323,10 +323,22 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public Guid QuestionId { get; set; }
|
||||
|
||||
public Guid MainRowId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 融合的病灶
|
||||
/// </summary>
|
||||
public Guid MergeRowId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 融向的病灶
|
||||
/// </summary>
|
||||
public List<Guid> MeltingInToLesionList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 融合后病灶状态
|
||||
/// </summary>
|
||||
public string LesionState { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1467,52 +1467,21 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
await VerifyTaskIsSign(inDto.VisitTaskId);
|
||||
await this.VerifyIsBaseLineTask(inDto.VisitTaskId);
|
||||
|
||||
var rowsInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Id == inDto.MainRowId || x.Id == inDto.MergeRowId)).ToListAsync();
|
||||
|
||||
if (rowsInfo.Count != 2)
|
||||
var mergeRow =await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.MergeRowId).FirstNotNullAsync();
|
||||
if (inDto.LesionState != string.Empty)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NotaTask"]);
|
||||
}
|
||||
|
||||
|
||||
var minaid = rowsInfo.Where(x => x.Id == inDto.MainRowId).Select(x => x.Id).FirstOrDefault();
|
||||
var mergeid = rowsInfo.Where(x => x.Id == inDto.MergeRowId).Select(x => x.Id).FirstOrDefault();
|
||||
|
||||
List<QuestionMark?> needRemoveMark = new List<QuestionMark?>()
|
||||
await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.RowId == mergeRow.Id && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State, x => new ReadingTableQuestionAnswer()
|
||||
{
|
||||
QuestionMark.MajorAxis,
|
||||
QuestionMark.ShortAxis,
|
||||
};
|
||||
|
||||
var mainAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.RowId == minaid).Include(x => x.ReadingTableQuestionTrial).ToListAsync();
|
||||
|
||||
foreach (var item in mainAnswer)
|
||||
{
|
||||
await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.RowId == mergeid && x.TableQuestionId == item.TableQuestionId, x => new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = needRemoveMark.Contains(item.ReadingTableQuestionTrial.QuestionMark) ? string.Empty : item.Answer,
|
||||
Answer = inDto.LesionState,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(mergeid, x => new ReadingTableAnswerRowInfo()
|
||||
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(inDto.MergeRowId, x => new ReadingTableAnswerRowInfo()
|
||||
{
|
||||
MergeRowId = minaid,
|
||||
MeltingInToLesion=JsonConvert.SerializeObject(inDto.MeltingInToLesionList),
|
||||
SplitOrMergeType = SplitOrMergeType.Merge,
|
||||
});
|
||||
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(mergeid, x => new ReadingTableAnswerRowInfo()
|
||||
{
|
||||
MergeRowId = minaid,
|
||||
SplitOrMergeType = SplitOrMergeType.Merge,
|
||||
});
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1545,6 +1514,7 @@ namespace IRaCIS.Application.Services
|
|||
var result = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == rowinfo.VisitTaskId && x.QuestionId == rowinfo.QuestionId && x.Id != rowinfo.Id)
|
||||
// 筛选状态
|
||||
.Where(x => x.LesionAnswerList.Any(y => y.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && !needFilterState.Contains(y.Answer)))
|
||||
.Where(x=>x.SplitOrMergeType!=SplitOrMergeType.Split&&x.SplitOrMergeType!=SplitOrMergeType.SplitMain)
|
||||
.Select(x => new GetCanMergeLesionOutDto()
|
||||
{
|
||||
RowId = x.Id,
|
||||
|
|
|
@ -207,6 +207,24 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
public string MarkTool { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 融向的病灶
|
||||
/// </summary>
|
||||
public string MeltingInToLesion { get; set; } = "[]";
|
||||
|
||||
public List<Guid> MeltingInToLesionList { get {
|
||||
|
||||
try
|
||||
{
|
||||
return JsonConvert.DeserializeObject<List<Guid>>(this.MeltingInToLesion);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return new List<Guid>();
|
||||
}
|
||||
} }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("VisitTaskId")]
|
||||
|
|
Loading…
Reference in New Issue