From 149cca011aa3a80e1f5163cb908c9d6d71614ae6 Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Mon, 15 Sep 2025 11:31:08 +0800
Subject: [PATCH 1/9] =?UTF-8?q?PWCG=20=E8=AE=A1=E7=AE=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ReadingCalculate/PCWG3CalculateService.cs | 92 +++++++------------
1 file changed, 33 insertions(+), 59 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs
index 243c56325..50469b1a3 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs
@@ -7,6 +7,7 @@ using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infra.EFCore.Common;
using IRaCIS.Core.Infrastructure;
using MassTransit;
+using MassTransit.Initializers;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
@@ -1110,7 +1111,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
}
///
- /// 修改上一次访视结果
+ /// 修改上一次访视结果 并且计算是不是PD
///
///
///
@@ -1125,75 +1126,48 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var isPDResult = false;
+ // 先判断有没有上一个任务
if (lastTask != null)
{
+ // 查看历史有没有PD
+ var taskIdList = taskList.Select(x => x.VisitTaskId).ToList();
- #region 1、基线后第一个访视:新病灶计数≥ 2个;2、基线后第二个访视(应满足访视间隔6周以上,否则顺延)新病灶≥ 2个;
- //1、基线后第一个访视:新病灶计数≥ 2个;2、基线后第二个访视(应满足访视间隔6周以上,否则顺延)新病灶≥ 2个;
-
-
- var firstVisit = taskList.FirstOrDefault();
- if (baseLineTask != null && baseLineTask.StudyTime != null)
+ var pdTaskList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId!=inDto.VisitTaskId&& taskIdList.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.QuestionType == QuestionType.SiteVisitForTumorEvaluation && x.Answer == VisitTumorEvaluation.PD.GetEnumInt()).OrderByDescending(x=>x.VisitTask.VisitTaskNum).ToListAsync();
+
+ // 当前访视新病灶数量
+ var thisNewLesionsCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
+ // 历史有PD
+ if (pdTaskList.Count() > 0&& thisNewLesionsCount >= 2)
{
- //基线后第二个访视(应满足访视间隔6周以上,否则顺延)
- var secondVisit = taskList.Where(x => x.VisitTaskNum >= 2 && x.StudyTime >= baseLineTask.StudyTime.Value.AddDays(42)).FirstOrDefault();
- if (secondVisit != null)
+ // 满足以下所有条件:1、前序访视已经确定为PD;2、当前访视,新病灶≥2个;
+ isPDResult = true;
+ }
+ else
+ {
+ // 满足以下所有条件:1、前序访视没有评估为PD,2、前一个访视:新病灶计数≥2个;3、当前访视:新病灶2个:4.前后2个访视间隔6周以上。
+
+ var lastStudyDate = taskList.Where(x=>x.VisitTaskId==lastTask.VisitTaskId).Select(x=>x.StudyTime).FirstOrDefault();
+ var thisStudyDate= taskList.Where(x => x.VisitTaskId == inDto.VisitTaskId).Select(x => x.StudyTime).FirstOrDefault();
+
+ var lastNewLesionsStr=await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == newLesionsCountQuestionId).Select(x => x.Answer).FirstOrDefaultAsync();
+
+ var lastNewLesionsCount = lastNewLesionsStr.IsNullOrEmptyReturn0();
+ if (lastStudyDate != null && thisStudyDate != null)
{
-
- var firstTaskNewLesionsCount = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == firstVisit!.VisitTaskId && x.ReadingQuestionTrialId == newLesionsCountQuestionId).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
-
- // 第二访视数量
- var secondVisitLesionsCount = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == newLesionsCountQuestionId).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
-
- // 判断是否是当前访视 当前访视还未入库
- if (secondVisit.VisitTaskId == inDto.VisitTaskId)
- {
- secondVisitLesionsCount = (inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0();
- }
-
- if (firstTaskNewLesionsCount >= 2 && secondVisitLesionsCount >= 2)
- {
- isPDResult = true;
- }
- }
-
- #endregion
-
-
-
- if (lastTask.VisitTaskNum >= 2m)
- {
-
- var lastTasknewLesionsCount = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == newLesionsCountQuestionId).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
- var thisVisitTaskNewLesionsCount = (inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0();
-
- var thisVisitTask = taskList.LastOrDefault();
-
- if (thisVisitTask != null && thisVisitTask.StudyTime != null && lastTask.StudyTime != null &&
-
-
- lastTasknewLesionsCount >= 2 && thisVisitTaskNewLesionsCount >= 2 && lastTask.StudyTime.Value.AddDays(42) <= thisVisitTask.StudyTime)
+ if (lastNewLesionsCount >= 2 && thisNewLesionsCount >= 2 && thisStudyDate.Value > lastStudyDate.Value.AddDays(42))
{
+ var visitForTumorEvaluationQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SiteVisitForTumorEvaluation).Select(x => x.QuestionId).FirstOrDefault();
+ await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == visitForTumorEvaluationQuestionId, x => new ReadingTaskQuestionAnswer
+ {
+ Answer = VisitTumorEvaluation.PD.GetEnumInt(),
+ });
isPDResult = true;
}
}
+
}
-
+
}
- if (isPDResult)
- {
- var visitForTumorEvaluationQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SiteVisitForTumorEvaluation).Select(x => x.QuestionId).FirstOrDefault();
-
- if (lastTask != null)
- {
- await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == visitForTumorEvaluationQuestionId, x => new ReadingTaskQuestionAnswer
- {
- Answer = VisitTumorEvaluation.PD.GetEnumInt(),
- });
- }
- }
-
-
return isPDResult;
}
From 334e51d9fd43167752002243970e4681d843e312 Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Mon, 15 Sep 2025 11:43:47 +0800
Subject: [PATCH 2/9] =?UTF-8?q?MRECISTHCC=20=E5=90=8C=E6=AD=A5=E7=97=85?=
=?UTF-8?q?=E7=81=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ReadingCalculate/MRECISTHCCCalculateService.cs | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs
index 18f2a5a0f..64c693147 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs
@@ -1372,13 +1372,24 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
TrialId = x.TrialId,
}).ToListAsync();
+
+ // 肛门淋巴结
+ var portalOrgan = await _organInfoRepository.Where(x => x.SystemCriterionId == trialReadingCriterion.ReadingQuestionCriterionSystemId &&
+
+ x.Part == "肝门淋巴结" &&
+
+ x.IsLymphNodes == IsLymph.Yes
+ ).FirstOrDefaultAsync();
+
foreach (var item in recistTableAnswers)
{
var rowinfo = tableRowAnswers.Where(y => y.OriginalId == item.RowId).FirstOrDefault();
- if (rowinfo != null)
+ if (rowinfo != null && portalOrgan!=null && rowinfo.OriginalId== portalOrgan.Id)
{
item.QuestionId = rowinfo.QuestionId;
+
+
var IslymphNode= recistTableAnswers.Where(x=>x.RowId== item.RowId&&x.QuestionMark==QuestionMark.IsLymph).Select(x=>x.Answer).FirstIsNullReturnEmpty().EqEnum(YesOrNoOrNa.Yes);
var minorAxis= recistTableAnswers.Where(x => x.RowId == item.RowId && x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturn0();
From 6b97d1ce68aae0a32dab7ea577558a3faa7bd6c4 Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Mon, 15 Sep 2025 13:14:00 +0800
Subject: [PATCH 3/9] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
index 2fae61170..5dee7d4fe 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
@@ -2814,7 +2814,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|| _userInfo.RequestUrl.Contains("SaveTaskQuestion")
|| _userInfo.RequestUrl == "ReadingImageTask/saveVisitTaskQuestions"
|| _userInfo.RequestUrl == "ReadingImageTask/changeCalculationAnswer"
- || _userInfo.RequestUrl == "ReadingImageTask/submitTaskAdditionalQuestion")
+ || _userInfo.RequestUrl == "ReadingImageTask/submitTaskAdditionalQuestion"
+ || _userInfo.RequestUrl == "ReadingImageTask/changeReportAnswer")
{
var type = AuditOpt.Add;
@@ -2829,6 +2830,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//具体的答案
var taskQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(t => t.Entity as ReadingTaskQuestionAnswer).ToList();
+ var taskIds = taskQuestionAnswerList.Select(x => x.VisitTaskId).Distinct().ToList();
+
+ var taskList=await _dbContext.VisitTask.Where(t => taskIds.Contains(t.Id)).ToListAsync();
+
//获取问题名称 组合成数组
var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => taskQuestionAnswerList.Select(k => k.ReadingQuestionTrialId).Contains(t.Id)).IgnoreQueryFilters().Select(t => new
{
@@ -2917,12 +2922,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common
(t, u) =>
new
{
+ TaskName = taskList.FirstOrDefault(k=>k.Id==t.VisitTaskId)?.TaskName,
+ VisitTaskNum = taskList.FirstOrDefault(k => k.Id == t.VisitTaskId)?.VisitTaskNum,
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
u.DictionaryCode,
u.QuestionName,
u.QuestionEnName,
u.ShowOrder
- }).OrderBy(t => t.ShowOrder).ToList()
+ }).OrderBy(t => t.VisitTaskNum).ThenBy(t => t.ShowOrder).ToList()
,
TableQuestionAndAnswerList = tableQuesionAndAnswerList
}
From f887699341b2b1e88d57ba80c570629ac6b40448 Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Mon, 15 Sep 2025 13:47:51 +0800
Subject: [PATCH 4/9] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
index 5dee7d4fe..730bb7f96 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
@@ -2904,11 +2904,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
+ var visitTaskId = taskList.OrderByDescending(x => x.VisitTaskNum).FirstOrDefault()?.Id;
+
await InsertInspection(cloneEntity, type, x => new InspectionConvertDTO()
{
- VisitTaskId = x.VisitTaskId,
+ VisitTaskId = visitTaskId,
- ObjectRelationParentId = x.VisitTaskId,
+ ObjectRelationParentId = visitTaskId,
TrialReadingCriterionId = x.ReadingQuestionCriterionTrialId,
From ef1b76f98c8ff3fca08a0a63f2be04c5714b943f Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Mon, 15 Sep 2025 14:25:17 +0800
Subject: [PATCH 5/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../IRaCIS.Core.Application.xml | 2 +-
.../MRECISTHCCCalculateService.cs | 19 +++++++++++--------
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 2741af6d0..d497e69d9 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -4849,7 +4849,7 @@
- 修改上一次访视结果
+ 修改上一次访视结果 并且计算是不是PD
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs
index 64c693147..0251bf7c8 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs
@@ -1384,20 +1384,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
foreach (var item in recistTableAnswers)
{
var rowinfo = tableRowAnswers.Where(y => y.OriginalId == item.RowId).FirstOrDefault();
- if (rowinfo != null && portalOrgan!=null && rowinfo.OriginalId== portalOrgan.Id)
+ if (rowinfo != null)
{
item.QuestionId = rowinfo.QuestionId;
-
- var IslymphNode= recistTableAnswers.Where(x=>x.RowId== item.RowId&&x.QuestionMark==QuestionMark.IsLymph).Select(x=>x.Answer).FirstIsNullReturnEmpty().EqEnum(YesOrNoOrNa.Yes);
- var minorAxis= recistTableAnswers.Where(x => x.RowId == item.RowId && x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturn0();
-
- var iSbetween15and20= minorAxis >= 15 && minorAxis < 20;
- if (item.QuestionMark == QuestionMark.State && IslymphNode && iSbetween15and20 && rowinfo.LesionType == LesionType.TargetLesion)
+ if (portalOrgan != null && rowinfo.OriginalId == portalOrgan.Id)
{
- item.Answer = string.Empty;
+ var IslymphNode = recistTableAnswers.Where(x => x.RowId == item.RowId && x.QuestionMark == QuestionMark.IsLymph).Select(x => x.Answer).FirstIsNullReturnEmpty().EqEnum(YesOrNoOrNa.Yes);
+ var minorAxis = recistTableAnswers.Where(x => x.RowId == item.RowId && x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturn0();
+
+ var iSbetween15and20 = minorAxis >= 15 && minorAxis < 20;
+ if (item.QuestionMark == QuestionMark.State && IslymphNode && iSbetween15and20 && rowinfo.LesionType == LesionType.TargetLesion)
+ {
+ item.Answer = string.Empty;
+ }
}
+
}
From 05244cdaf7a82426a8bc6d2870f699d5199db552 Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Mon, 15 Sep 2025 14:35:18 +0800
Subject: [PATCH 6/9] =?UTF-8?q?res=20=E5=90=8C=E6=AD=A5=E7=97=85=E7=81=B6?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Service/ReadingCalculate/MRECISTHCCCalculateService.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs
index 0251bf7c8..e1b262991 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs
@@ -1389,7 +1389,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
item.QuestionId = rowinfo.QuestionId;
- if (portalOrgan != null && rowinfo.OriginalId == portalOrgan.Id)
+ if (portalOrgan != null && rowinfo.OrganInfoId == portalOrgan.Id)
{
var IslymphNode = recistTableAnswers.Where(x => x.RowId == item.RowId && x.QuestionMark == QuestionMark.IsLymph).Select(x => x.Answer).FirstIsNullReturnEmpty().EqEnum(YesOrNoOrNa.Yes);
var minorAxis = recistTableAnswers.Where(x => x.RowId == item.RowId && x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturn0();
From bab20666afd029e979e99d92815ebd05612c836b Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Mon, 15 Sep 2025 15:51:50 +0800
Subject: [PATCH 7/9] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Common/AuditingData.cs | 54 +++++++++++++------
1 file changed, 38 insertions(+), 16 deletions(-)
diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
index 730bb7f96..d5b43b808 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
@@ -1,4 +1,5 @@
-using IRaCIS.Core.Domain.Models;
+using Hangfire.Storage.Monitoring;
+using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Infrastructure.Extention;
@@ -2906,6 +2907,40 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var visitTaskId = taskList.OrderByDescending(x => x.VisitTaskNum).FirstOrDefault()?.Id;
+ var objList = new List