From 7e454467d18ce45cd9fff23dc386225b78122ca7 Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Wed, 8 Jul 2026 14:42:20 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E8=B5=8B=E5=80=BC=E5=88=86=E5=89=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../IRaCIS.Core.Application.xml | 6 +-
.../General/GeneralCalculateService.cs | 68 ++++++++++++++++++-
2 files changed, 69 insertions(+), 5 deletions(-)
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 4083d5c21..6ea8aa5ab 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -17537,17 +17537,17 @@
- 质疑
+ ����
- 一致性核查
+ һ���Ժ˲�
- 复制
+ ����
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
index 01f7dc0b0..a97a7be6d 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
@@ -1,4 +1,5 @@
-using DocumentFormat.OpenXml.Drawing.Spreadsheet;
+using Amazon.Runtime.Internal.Transform;
+using DocumentFormat.OpenXml.Drawing.Spreadsheet;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Application.ViewModel;
@@ -10,6 +11,7 @@ using MassTransit.Saga;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using MiniExcelLibs;
+using System.Collections.Immutable;
using System.Data;
using System.IO;
using System.Text;
@@ -18,6 +20,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
public class GeneralCalculateService(IRepository _readingTableQuestionAnswerRepository,
IRepository _visitTaskRepository,
+ IRepository _segmentationRepository,
+ IRepository _segmentRepository,
+ IRepository _segmentBindingRepository,
+
IRepository _readingTaskQuestionMarkRepository,
IRepository _readingNoneDicomMarkRepository,
IRepository _readingNoneDicomMarkBindingRepository,
@@ -255,7 +261,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var questionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == historyTaskId).ToListAsync();
var noneDicomMarkList = await _readingNoneDicomMarkRepository.Where(x => x.VisitTaskId == historyTaskId).ToListAsync();
var noneDicomMarkBindingList = await _readingNoneDicomMarkBindingRepository.Where(x => x.VisitTaskId == historyTaskId).ToListAsync();
-
+ Dictionary lesionRelationship = new Dictionary() { };
foreach (var item in tableRowList)
{
if (item.SplitOrMergeType == SplitOrMergeType.Merged)
@@ -272,6 +278,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
if (historyRow != null)
{
+ lesionRelationship.Add(historyRow.Id, item.Id);
item.StudyId = historyRow.StudyId;
item.SeriesId = historyRow.SeriesId;
item.InstanceId = historyRow.InstanceId;
@@ -380,6 +387,63 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
item.Id = NewId.NextGuid();
}
+
+ #region 分割
+ Dictionary segmentationRelationship = new Dictionary() { };
+ var segmentationList = _segmentationRepository.Where(t => t.VisitTaskId == historyTaskId).ToList();
+
+ foreach (var item in segmentationList)
+ {
+
+ var newSegmentationId = NewId.NextSequentialGuid();
+ segmentationRelationship.Add(item.Id, newSegmentationId);
+ item.Id = newSegmentationId;
+ item.VisitTaskId = taskinfo.Id;
+ }
+
+
+ Dictionary segmentRelationship = new Dictionary() { };
+ var segmentList = _segmentRepository.Where(t => t.VisitTaskId == historyTaskId).ToList();
+ foreach (var item in segmentList)
+ {
+ var newSegmentationId = NewId.NextSequentialGuid();
+ segmentRelationship.Add(item.Id, newSegmentationId);
+ if (segmentationRelationship.ContainsKey(item.SegmentationId))
+ {
+ item.SegmentationId = segmentationRelationship[item.SegmentationId];
+ }
+ item.Id = newSegmentationId;
+ item.VisitTaskId = taskinfo.Id;
+ }
+
+ var segmentBindingList = _segmentBindingRepository.Where(x => x.VisitTaskId == historyTaskId).ToList();
+
+ foreach (var item in segmentBindingList)
+ {
+ if (segmentationRelationship.ContainsKey(item.SegmentationId))
+ {
+ item.SegmentationId = segmentationRelationship[item.SegmentationId];
+ }
+ if (segmentRelationship.ContainsKey(item.SegmentId))
+ {
+ item.SegmentId = segmentRelationship[item.SegmentId];
+ }
+
+ if (item.RowId != null && lesionRelationship.ContainsKey(item.RowId.Value))
+ {
+ item.RowId = lesionRelationship[item.RowId.Value];
+ }
+ item.Id = NewId.NextSequentialGuid();
+ item.VisitTaskId = taskinfo.Id;
+ }
+
+
+ _ = _segmentationRepository.AddRangeAsync(segmentationList).Result;
+ _ = _segmentRepository.AddRangeAsync(segmentList).Result;
+ _ = _segmentBindingRepository.AddRangeAsync(segmentBindingList).Result;
+ #endregion
+
+
await _readingNoneDicomMarkRepository.AddRangeAsync(noneDicomMarkList);
From 651fa35018a1ddbde16076fd7437733d15d1b7c3 Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Wed, 8 Jul 2026 14:52:46 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=A4=8D?=
=?UTF-8?q?=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ReadingCalculate/SelfDefineCalculateService.cs | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs
index c2b4a34f5..7aa60d1c6 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs
@@ -296,11 +296,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
}
}
- if(trialReadingCriterion.IsOncologyReading)
- {
- await _generalCalculateService.CopyHistoryAnswer(taskinfo, addRowList, addTableQuestionAnswerList);
- }
-
+
+ // 自定义的复制
+ await _generalCalculateService.CopyHistoryAnswer(taskinfo, addRowList, addTableQuestionAnswerList);
+
await _readingTableAnswerRowInfoRepository.AddRangeAsync(addRowList);
await _readingTableQuestionAnswerRepository.AddRangeAsync(addTableQuestionAnswerList);
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
From db693de576d7bab3762b4963c0ed3a184f7fe0fa Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Wed, 8 Jul 2026 14:55:34 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E5=A4=87=E6=B3=A8=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ReadingCalculate/General/GeneralCalculateService.cs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
index a97a7be6d..adf68ca7a 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
@@ -262,6 +262,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var noneDicomMarkList = await _readingNoneDicomMarkRepository.Where(x => x.VisitTaskId == historyTaskId).ToListAsync();
var noneDicomMarkBindingList = await _readingNoneDicomMarkBindingRepository.Where(x => x.VisitTaskId == historyTaskId).ToListAsync();
Dictionary lesionRelationship = new Dictionary() { };
+
+ // 这里后续还要添加病灶 比如现在是访视三 要把失效任务访视三的 在访视三的病灶添加过来
+ // 同时自定义的 除了根据器官判断还需要根据 复制前值的答案相不相等
foreach (var item in tableRowList)
{
if (item.SplitOrMergeType == SplitOrMergeType.Merged)
From c19eb5bab759e7b84ea388725be49f1b2580897c Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Wed, 8 Jul 2026 14:57:55 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=A1=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ReadingCalculate/General/GeneralCalculateService.cs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
index adf68ca7a..831b93073 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
@@ -231,6 +231,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
return;
}
+ // 如果有表格问题或者外层问题答案就不复制了
+ if ((await _readingTableQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == taskinfo.Id))
+ || (await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == taskinfo.Id)))
+ {
+ return;
+ }
+
if (taskinfo.IsCopyLesionAnswer)
{
var historyTaskId = await _visitTaskRepository.Where(x =>