From c9b6287b46d442dae15937434d95f061ecabea92 Mon Sep 17 00:00:00 2001
From: he <10978375@qq.com>
Date: Thu, 23 Feb 2023 14:51:01 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Allocation/DTO/VisitTaskViewModel.cs | 10 ++++
.../Allocation/VisitTaskHelpeService.cs | 18 ++++++-
.../Service/Allocation/VisitTaskService.cs | 18 +++++++
.../Service/QC/QCOperationService.cs | 52 +++++++++++++++++--
.../RECIST1Point1CalculateService.cs | 16 ++++++
.../WorkLoad/DTO/DoctorWorkLoadViewModel.cs | 16 ++++++
.../Allocation/AllocationRelation.cs | 26 ++++++++++
IRaCIS.Core.Domain/Allocation/VisitTask.cs | 10 ++++
8 files changed, 161 insertions(+), 5 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs
index 073f417e2..7c2c16e80 100644
--- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs
@@ -24,6 +24,16 @@ namespace IRaCIS.Core.Application.ViewModel
public decimal VisitTaskNum { get; set; }
+ public bool IsUrgent { get; set; }
+
+ ///
+ /// 加急类型
+ ///
+ public TaskUrgentType? TaskUrgentType { get; set; }
+
+
+ public string TaskUrgentRemake { get; set; } = string.Empty;
+
public ReadingCategory ReadingCategory { get; set; }
public TaskAllocationState TaskAllocationState { get; set; }
diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs
index 069c00c1c..c18290c30 100644
--- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs
@@ -158,6 +158,21 @@ namespace IRaCIS.Core.Application.Service
currentMaxCodeInt = currentMaxCodeInt + 1;
+ TaskUrgentType? taskUrgentType = null;
+
+ if (subjectVisit.PDState == PDStateEnum.PDProgress)
+ {
+ taskUrgentType = TaskUrgentType.PDProgress;
+ }
+ else if (subjectVisit.IsEnrollmentConfirm)
+ {
+ taskUrgentType = TaskUrgentType.EnrollmentConfirm;
+ }
+ else if (subjectVisit.IsUrgent)
+ {
+ taskUrgentType = TaskUrgentType.VisitUrgent;
+ }
+
task1 = await _visitTaskRepository.AddAsync(new VisitTask()
{
TrialId = trialId,
@@ -166,6 +181,7 @@ namespace IRaCIS.Core.Application.Service
TaskBlindName = blindTaskName,
TaskName = subjectVisit.VisitName,
VisitTaskNum = subjectVisit.VisitNum,
+ TaskUrgentType = taskUrgentType,
//CheckPassedTime = subjectVisit.CheckPassedTime,
ArmEnum = Arm.DoubleReadingArm1,//特殊
Code = currentMaxCodeInt,
@@ -176,7 +192,7 @@ namespace IRaCIS.Core.Application.Service
TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId,
IsNeedClinicalDataSign = isNeedClinicalDataSign,
IsClinicalDataSign = isClinicalDataSign
- });
+ }) ;
}
diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
index dc4cf1dad..15028cfd5 100644
--- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
@@ -66,6 +66,24 @@ namespace IRaCIS.Core.Application.Service.Allocation
_trialReadingCriterionRepository = trialReadingCriterionRepository;
}
+ ///
+ /// 设置任务加急
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task SetTaskUrgent(SetTaskUrgentInDto inDto)
+ {
+ await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
+ {
+ IsUrgent = inDto.IsUrgent,
+ TaskUrgentType = inDto.TaskUrgentType,
+ TaskUrgentRemake = inDto.TaskUrgentRemake,
+
+ });
+
+ return await _visitTaskRepository.SaveChangesAsync();
+ }
public async Task> GetTrialCriterionList(Guid trialId, bool isHaveSigned = true)
{
diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
index 197a3046a..fef04e659 100644
--- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
+++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
@@ -33,8 +33,7 @@ namespace IRaCIS.Core.Application.Image.QA
private readonly IRepository _qCChallengeDialogrepository;
private readonly IRepository _checkChallengeDialogrepository;
private readonly IRepository _trialRepository;
-
-
+ private readonly IRepository _visitTaskRepository;
private readonly IVisitTaskHelpeService _IVisitTaskHelpeService;
private readonly AsyncLock _mutex = new AsyncLock();
@@ -42,6 +41,7 @@ namespace IRaCIS.Core.Application.Image.QA
public QCOperationService(IRepository subjectVisitRepository,
IRepository qcChallengeRepository,
IRepository trialRepository,
+ IRepository visitTaskRepository,
IRepository dicomStudyRepository,
IRepository dicomSeriesrepository,
IRepository subjectRepository,
@@ -60,8 +60,8 @@ namespace IRaCIS.Core.Application.Image.QA
this._qCChallengeDialogrepository = qCChallengeDialogrepository;
this._checkChallengeDialogrepository = checkChallengeDialogrepository;
_trialRepository = trialRepository;
-
- _IVisitTaskHelpeService= visitTaskHelpeService;
+ this._visitTaskRepository = visitTaskRepository;
+ _IVisitTaskHelpeService = visitTaskHelpeService;
}
#region QC质疑 以及回复 关闭
@@ -1233,6 +1233,47 @@ namespace IRaCIS.Core.Application.Image.QA
//项目或者Subject IsUrgent 提交时 访视也设置为紧急
if (trialConfig.IsUrgent || dbSubjectVisit.Subject.IsUrgent || (dbSubjectVisit.PDState == PDStateEnum.PDProgress && !dbSubjectVisit.IsBaseLine) || (dbSubjectVisit.IsEnrollmentConfirm && dbSubjectVisit.IsBaseLine))
{
+ if (dbSubjectVisit.PDState == PDStateEnum.PDProgress)
+ {
+ await _subjectVisitRepository.BatchUpdateNoTrackingAsync(x => x.SubjectId == dbSubjectVisit.SubjectId && x.VisitNum < dbSubjectVisit.VisitNum, x => new SubjectVisit()
+ {
+ IsUrgent = true
+ });
+
+ await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.SourceSubjectVisitId == dbSubjectVisit.Id && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
+ {
+
+ IsUrgent = true,
+ TaskUrgentType = TaskUrgentType.PDProgress,
+ });
+
+
+ await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.SubjectId == dbSubjectVisit.SubjectId && x.VisitTaskNum < dbSubjectVisit.VisitNum && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
+ {
+
+ IsUrgent = true,
+ TaskUrgentType = TaskUrgentType.PDProgress,
+ });
+ }
+ else if (dbSubjectVisit.IsEnrollmentConfirm)
+ {
+ await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.SourceSubjectVisitId == dbSubjectVisit.Id && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
+ {
+
+ IsUrgent = true,
+ TaskUrgentType = TaskUrgentType.EnrollmentConfirm,
+ });
+ }
+ else
+ {
+ await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.SourceSubjectVisitId == dbSubjectVisit.Id && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
+ {
+
+ IsUrgent = true,
+ TaskUrgentType = TaskUrgentType.VisitUrgent,
+ });
+ }
+
dbSubjectVisit.IsUrgent = true;
@@ -1296,6 +1337,9 @@ namespace IRaCIS.Core.Application.Image.QA
//非基线设置为PD的话 或者设置为末次访视 根据配置自动生成阅片期
if (!dbSubjectVisit.IsBaseLine && dbSubjectVisit.PDState == PDStateEnum.PDProgress && dbSubjectVisit.IsFinalVisit)
{
+
+
+
//该标准需要添加阅片期
foreach (var trialReadingCriterionId in trialReadingCriterionIdList)
{
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs
index e328669e6..7b980ae67 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs
@@ -439,6 +439,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
};
+ // 没有靶病灶只计算最后几个
+ if (inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).Sum(x => x.TableRowInfoList.Count()) == 0)
+ {
+
+ List questionTypes = new List()
+ {
+ QuestionType.TargetLesion,
+ QuestionType.NoTargetLesion,
+ QuestionType.NewLesions,
+ QuestionType.Tumor,
+ QuestionType.ExistDisease,
+ };
+
+ calculateList = calculateList.Where(x => questionTypes.Contains(x.QuestionType)).ToList();
+ }
+
if (calculateType != null)
{
calculateList = calculateList.Where(x => calculateType.Contains(x.QuestionType)).ToList();
diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs b/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs
index 0fa52a4eb..fe2a4b76e 100644
--- a/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs
+++ b/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs
@@ -304,7 +304,23 @@ namespace IRaCIS.Application.Contracts
}
+ public class SetTaskUrgentInDto
+ {
+ public Guid VisitTaskId { get; set; }
+ public bool IsUrgent { get; set; }
+
+ ///
+ /// 加急类型
+ ///
+ public TaskUrgentType? TaskUrgentType { get; set; }
+
+
+ ///
+ /// 任务加急备注
+ ///
+ public string TaskUrgentRemake { get; set; } = string.Empty;
+ }
public class DoctorUserTask
{
public ReadingTaskState ReadingTaskState { get; set; }
diff --git a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs
index 6708bba73..2d0cc2095 100644
--- a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs
+++ b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs
@@ -300,6 +300,32 @@ namespace IRaCIS.Core.Domain.Share
}
+ ///
+ /// 任务加急状态
+ ///
+ public enum TaskUrgentType
+ {
+ ///
+ /// 入组确认
+ ///
+ EnrollmentConfirm=1,
+
+ ///
+ /// PD进展
+ ///
+ PDProgress=2,
+
+ ///
+ /// 访视加急
+ ///
+ VisitUrgent=3,
+
+ ///
+ /// 其他
+ ///
+ Other=4,
+ }
+
//public enum AnalysisType
//{
diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs
index ad5738adc..d02357bc6 100644
--- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs
+++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs
@@ -56,6 +56,16 @@ namespace IRaCIS.Core.Domain.Models
public bool IsUrgent { get; set; }
+ ///
+ /// 加急类型
+ ///
+ public TaskUrgentType? TaskUrgentType { get; set; }
+
+ ///
+ /// 任务加急类型
+ ///
+ public string TaskUrgentRemake { get; set; } = string.Empty;
+
///
/// 0 代表 单重阅片 产生的任务 否则就是双重 任务 1 任务 2
///