From 166b46f6a3e3fe04f26a83ece3ae2d477cb372f2 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 15 Sep 2023 15:25:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=A6=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingImageTaskViewModel.cs | 2 + .../ReadingImageTaskService.cs | 74 ++++++------------- .../Service/Reading/_MapConfig.cs | 1 + .../ReadingTableAnswerRowInfo.cs | 4 +- 4 files changed, 30 insertions(+), 51 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index ec08c286b..09137bf13 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -1841,6 +1841,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string MeasureData { get; set; } = string.Empty; + public string? OtherMeasureData { get; set; } = string.Empty; + public Guid? SeriesId { get; set; } public Guid? InstanceId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index c0ffe9314..fc7de77ad 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1284,6 +1284,7 @@ namespace IRaCIS.Application.Services answers.Add("FromMark", rowInfo.FromMark); answers.Add("IsDicomReading", rowInfo.IsDicomReading.ToString()); answers.Add("MeasureData", rowInfo == null ? string.Empty : rowInfo.MeasureData); + answers.Add("OtherMeasureData", rowInfo == null|| rowInfo.OtherMeasureData==null ? string.Empty : rowInfo.OtherMeasureData.ToString()); answers.Add("RowIndex", x.ToString()); answers.Add("RowId", rowInfo.Id.ToString()); answers.Add("MarkTool", rowInfo.MarkTool); @@ -1351,6 +1352,7 @@ namespace IRaCIS.Application.Services rowAnswer.SeriesId = null; rowAnswer.IsCurrentTaskAdd = true; rowAnswer.MeasureData = string.Empty; + rowAnswer.OtherMeasureData =null; List needRemoveMark = new List() { @@ -1591,6 +1593,13 @@ namespace IRaCIS.Application.Services measureData.data.remark = item.ReadingQuestionTrial.OrderMark + ((decimal)index).GetLesionMark(); measureDataStr = JsonConvert.SerializeObject(measureData); } + string? otherMeasureDataStr = null; + if (item.OtherMeasureData != null && item.OtherMeasureData != string.Empty) + { + dynamic otherMeasureData = JObject.Parse(item.OtherMeasureData); + otherMeasureData.data.remark = item.ReadingQuestionTrial.OrderMark + ((decimal)index).GetLesionMark(); + otherMeasureDataStr = JsonConvert.SerializeObject(otherMeasureData); + } @@ -1607,6 +1616,7 @@ namespace IRaCIS.Application.Services rowAnswerItem.RowIndex = index; rowAnswerItem.MeasureData = measureDataStr; + rowAnswerItem.OtherMeasureData = otherMeasureDataStr; } @@ -1632,7 +1642,13 @@ namespace IRaCIS.Application.Services spiltmeasureDataStr = JsonConvert.SerializeObject(spiltmeasureData); } - + string? spiltOtherMeasureDataStr = null; + if (item.OtherMeasureData != null && item.OtherMeasureData != string.Empty) + { + dynamic otherMeasureData = JObject.Parse(item.OtherMeasureData); + otherMeasureData.data.remark = item.ReadingQuestionTrial.OrderMark + ((decimal)index).GetLesionMark(); + spiltOtherMeasureDataStr = JsonConvert.SerializeObject(otherMeasureData); + } foreach (var answerItem in answerlist.Where(x => x.RowIndex == spiltitem.RowIndex)) { answerItem.RowIndex = index + spiltindex; @@ -1645,7 +1661,7 @@ namespace IRaCIS.Application.Services rowAnswerItem.RowIndex = index + spiltindex; rowAnswerItem.MeasureData = spiltmeasureDataStr; - + rowAnswerItem.OtherMeasureData = spiltOtherMeasureDataStr; } @@ -1965,39 +1981,18 @@ namespace IRaCIS.Application.Services } - ReadingTableAnswerRowInfo rowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == (inDto.RowId ?? default(Guid))).FirstOrDefaultAsync(); + ReadingTableAnswerRowInfo rowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == (inDto.RowId ?? default(Guid))).IgnoreAutoIncludes().FirstOrDefaultAsync(); rowInfo = rowInfo == null ? new ReadingTableAnswerRowInfo() : rowInfo; //await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.RowId == (inDto.RowId ?? default(Guid))); //await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => x.Id == (inDto.RowId ?? default(Guid))); - rowInfo.Id = inDto.RowId == null ? NewId.NextGuid() : inDto.RowId.Value; - rowInfo.TrialId = inDto.TrialId; - rowInfo.QuestionId = inDto.QuestionId; - rowInfo.MeasureData = inDto.MeasureData; - rowInfo.BlindName = inDto.BlindName; - rowInfo.IsDicomReading = inDto.IsDicomReading; - rowInfo.IsCurrentTaskAdd = isCurrentTaskAdd; - rowInfo.NumberOfFrames = inDto.NumberOfFrames; - rowInfo.MarkTool = inDto.MarkTool; - rowInfo.ReportMark = inDto.ReportMark; - rowInfo.FristAddTaskNum = taskinfo.VisitTaskNum; - rowInfo.FristAddTaskId = inDto.VisitTaskId; - rowInfo.PicturePath = inDto.PicturePath; - rowInfo.RowIndex = inDto.RowIndex; - rowInfo.FromMark = inDto.FromMark; - rowInfo.OrganInfoId = inDto.OrganInfoId; - rowInfo.InstanceId = inDto.InstanceId; - rowInfo.SeriesId = inDto.SeriesId; - rowInfo.VisitTaskId = inDto.VisitTaskId; - rowInfo.OrderMark = questionInfo.OrderMark; - rowInfo.StudyId = inDto.StudyId; - rowInfo.IsCanEditPosition = inDto.IsCanEditPosition; - rowInfo.WL = inDto.WL; - rowInfo.WW = inDto.WW; - result.RowId = rowInfo.Id; + _mapper.Map(inDto, rowInfo); + rowInfo.Id = inDto.RowId == null ? NewId.NextGuid() : inDto.RowId.Value; + + if (inDto.RowId == null) { @@ -2024,28 +2019,7 @@ namespace IRaCIS.Application.Services else { - await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(rowInfo.Id, x => new ReadingTableAnswerRowInfo() - { - TrialId = rowInfo.TrialId, - QuestionId = rowInfo.QuestionId, - MeasureData = rowInfo.MeasureData, - BlindName = rowInfo.BlindName, - IsDicomReading = rowInfo.IsDicomReading, - IsCurrentTaskAdd = isCurrentTaskAdd, - WL = rowInfo.WL, - WW = rowInfo.WW, - MarkTool = inDto.MarkTool, - OrganInfoId = rowInfo.OrganInfoId, - PicturePath = rowInfo.PicturePath, - NumberOfFrames = rowInfo.NumberOfFrames, - RowIndex = rowInfo.RowIndex, - InstanceId = rowInfo.InstanceId, - SeriesId = rowInfo.SeriesId, - VisitTaskId = rowInfo.VisitTaskId, - StudyId = rowInfo.StudyId, - IsCanEditPosition = rowInfo.IsCanEditPosition, - ReportMark = rowInfo.ReportMark - }) ; + await _readingTableAnswerRowInfoRepository.UpdateFromDTOAsync(rowInfo) ; foreach (var item in inDto.AnswerList) diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index c3949afda..89eb3a708 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -56,6 +56,7 @@ namespace IRaCIS.Core.Application.Service #endregion CreateMap(); + CreateMap(); CreateMap(); diff --git a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs index 5cd76574d..3bef86ea8 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs @@ -164,7 +164,9 @@ namespace IRaCIS.Core.Domain.Models public Guid? DeleteUserId { get; set; } - [JsonIgnore] + public string? OtherMeasureData { get; set; } = string.Empty; + + [JsonIgnore] [ForeignKey("SplitRowId")] public ReadingTableAnswerRowInfo SplitRow { get; set; } [JsonIgnore]