Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
c9eff0d0ac
|
@ -184,7 +184,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
public Guid? SourceSubjectVisitId { get; set; }
|
public Guid? SourceSubjectVisitId { get; set; }
|
||||||
public Guid? SouceReadModuleId { get; set; }
|
public Guid? SouceReadModuleId { get; set; }
|
||||||
|
|
||||||
|
//public bool IsAfterConvertedTask { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -146,11 +146,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var taskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == taskId && x.ReadingQuestionTrial.Type != "calculation").IgnoreAutoIncludes().AsNoTracking().ToListAsync();
|
var taskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == taskId && x.ReadingQuestionTrial.Type != "calculation").IgnoreAutoIncludes().AsNoTracking().ToListAsync();
|
||||||
|
|
||||||
taskAnswer.ForEach(x => {
|
taskAnswer.ForEach(x =>
|
||||||
|
{
|
||||||
|
|
||||||
x.VisitTaskId = taskInfo.Id;
|
x.VisitTaskId = taskInfo.Id;
|
||||||
|
|
||||||
x.Id= NewId.NextGuid();
|
x.Id = NewId.NextGuid();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -185,7 +186,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
case CriterionType.IRECIST1Point1:
|
case CriterionType.IRECIST1Point1:
|
||||||
//非靶病灶全部数据复制,不可更改。支持如果状态为:显著增大需要自动改为: 显著增大(iUPD)
|
//非靶病灶全部数据复制,不可更改。支持如果状态为:显著增大需要自动改为: 显著增大(iUPD)
|
||||||
var stateQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == originalTask.TrialReadingCriterionId
|
var stateQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == originalTask.TrialReadingCriterionId
|
||||||
&& x.ReadingQuestionTrial.LesionType == LesionType.NonTargetLesions && x.QuestionMark == QuestionMark.State).Select(x=>x.Id).FirstOrDefaultAsync();
|
&& x.ReadingQuestionTrial.LesionType == LesionType.NonTargetLesions && x.QuestionMark == QuestionMark.State).Select(x => x.Id).FirstOrDefaultAsync();
|
||||||
|
|
||||||
tableAnswer.ForEach(x =>
|
tableAnswer.ForEach(x =>
|
||||||
{
|
{
|
||||||
|
@ -215,7 +216,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var otherLesionTableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == otherLesionQuestion.Id).ToListAsync();
|
var otherLesionTableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == otherLesionQuestion.Id).ToListAsync();
|
||||||
|
|
||||||
// 找到病灶状态
|
// 找到病灶状态
|
||||||
var newstateQuestionId = newLesionTableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x=>x.Id).FirstOrDefault();
|
var newstateQuestionId = newLesionTableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Id).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
var stateAnswers = new List<string>() {
|
var stateAnswers = new List<string>() {
|
||||||
|
@ -224,7 +225,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
NewLesionState.UnableEvaluate.GetEnumInt()
|
NewLesionState.UnableEvaluate.GetEnumInt()
|
||||||
};
|
};
|
||||||
|
|
||||||
var needRowIds= tableAnswer.Where(x => x.TableQuestionId == newstateQuestionId && stateAnswers.Contains(x.Answer)).Select(x => x.RowId).Distinct().ToList();
|
var needRowIds = tableAnswer.Where(x => x.TableQuestionId == newstateQuestionId && stateAnswers.Contains(x.Answer)).Select(x => x.RowId).Distinct().ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -622,6 +623,38 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//private async Task<bool> IsConvertedTask(Guid trialReadingCriterionId, Guid subjectId, decimal visitTaskNum, Guid? doctorUserId)
|
||||||
|
//{
|
||||||
|
|
||||||
|
// var criterion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
|
||||||
|
// if (criterion.CriterionType == CriterionType.IRECIST1Point1)
|
||||||
|
// {
|
||||||
|
|
||||||
|
// if (doctorUserId == null)
|
||||||
|
// {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// if (await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.VisitTaskNum <= visitTaskNum && t.IsConvertedTask && t.TaskState == TaskState.Effect))
|
||||||
|
// {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
public DateTime GetSuggessFinishTime(bool isInOrder, UrgentType urgentType)
|
public DateTime GetSuggessFinishTime(bool isInOrder, UrgentType urgentType)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1401,6 +1434,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
taskUrgent = TaskUrgentType.VisitUrgent;
|
taskUrgent = TaskUrgentType.VisitUrgent;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCanEditUrgent = taskUrgent == TaskUrgentType.EnrollmentConfirm || taskUrgent == TaskUrgentType.PDProgress ? false : true;
|
bool isCanEditUrgent = taskUrgent == TaskUrgentType.EnrollmentConfirm || taskUrgent == TaskUrgentType.PDProgress ? false : true;
|
||||||
var newTask = await _visitTaskRepository.AddAsync(new VisitTask()
|
var newTask = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
{
|
{
|
||||||
|
@ -1434,6 +1468,18 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IsNeedClinicalDataSign = reReadingVisitTask.IsNeedClinicalDataSign,
|
IsNeedClinicalDataSign = reReadingVisitTask.IsNeedClinicalDataSign,
|
||||||
IsClinicalDataSign = reReadingVisitTask.IsClinicalDataSign,
|
IsClinicalDataSign = reReadingVisitTask.IsClinicalDataSign,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//生成的任务分配给原始医生
|
||||||
|
DoctorUserId = reReadingVisitTask.DoctorUserId,
|
||||||
|
TaskAllocationState = TaskAllocationState.Allocated,
|
||||||
|
AllocateTime = DateTime.Now,
|
||||||
|
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
|
||||||
|
|
||||||
|
//IR 重阅的任务这两个字段和之前任务保持一致
|
||||||
|
//IsConvertedTask = await IsConvertedTask(reReadingVisitTask.TrialReadingCriterionId, reReadingVisitTask.SubjectId, reReadingVisitTask.VisitTaskNum, reReadingVisitTask.DoctorUserId),
|
||||||
|
//BeforeConvertedTaskId = reReadingVisitTask.BeforeConvertedTaskId,
|
||||||
|
|
||||||
// TaskAllocationState = reReadingVisitTask.TaskAllocationState,
|
// TaskAllocationState = reReadingVisitTask.TaskAllocationState,
|
||||||
// AllocateTime = DateTime.Now,
|
// AllocateTime = DateTime.Now,
|
||||||
//DoctorUserId = reReadingVisitTask.DoctorUserId,
|
//DoctorUserId = reReadingVisitTask.DoctorUserId,
|
||||||
|
@ -1636,7 +1682,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var task1 = await _visitTaskRepository.AddAsync(new VisitTask()
|
var task1 = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
{
|
{
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
IsConvertedTask= originalTaskInfo.IsConvertedTask,
|
IsConvertedTask = originalTaskInfo.IsConvertedTask,
|
||||||
SubjectId = item.SubjectId,
|
SubjectId = item.SubjectId,
|
||||||
IsUrgent = originalTaskInfo.IsUrgent,
|
IsUrgent = originalTaskInfo.IsUrgent,
|
||||||
VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global],
|
VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global],
|
||||||
|
@ -1688,7 +1734,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
SubjectId = item.SubjectId,
|
SubjectId = item.SubjectId,
|
||||||
IsUrgent = originalTaskInfo.IsUrgent,
|
IsUrgent = originalTaskInfo.IsUrgent,
|
||||||
TaskName = item.ReadingName,
|
TaskName = item.ReadingName,
|
||||||
IsConvertedTask= originalTaskInfo.IsConvertedTask,
|
IsConvertedTask = originalTaskInfo.IsConvertedTask,
|
||||||
// 原任务是全局任务 加0.03 就好
|
// 原任务是全局任务 加0.03 就好
|
||||||
VisitTaskNum = originalTaskInfo.VisitTaskNum + 0.03m,
|
VisitTaskNum = originalTaskInfo.VisitTaskNum + 0.03m,
|
||||||
ArmEnum = Arm.TumorArm, //特殊
|
ArmEnum = Arm.TumorArm, //特殊
|
||||||
|
|
|
@ -1749,8 +1749,69 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 申请任务 重新生成 拷贝表单 必须放在影响的访视生成任务之前,因为会影响 IsConvertedTask 标志
|
||||||
|
|
||||||
|
|
||||||
|
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
|
{
|
||||||
|
TrialId = trialId,
|
||||||
|
|
||||||
|
ReadingCategory = GenerateTaskCategory.ReReading,
|
||||||
|
|
||||||
|
ReReadingTask = origenalTask,
|
||||||
|
|
||||||
|
//同步才可以
|
||||||
|
Action = (newTask) =>
|
||||||
|
{
|
||||||
|
//申请表 设置新任务Id
|
||||||
|
visitTaskReReadingAppply.NewReReadingTaskId = newTask.Id;
|
||||||
|
|
||||||
|
////生成的任务分配给原始医生
|
||||||
|
//newTask.DoctorUserId = origenalTask.DoctorUserId;
|
||||||
|
//newTask.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
|
//newTask.AllocateTime = DateTime.Now;
|
||||||
|
//newTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||||
|
|
||||||
|
|
||||||
|
//裁判任务 需要进行特殊处理 在重阅逻辑里面处理
|
||||||
|
|
||||||
|
|
||||||
|
//拷贝表单
|
||||||
|
if (visitTaskReReadingAppply.IsCopyOrigenalForms)
|
||||||
|
{
|
||||||
|
if (origenalTask.ReadingCategory == ReadingCategory.Visit)
|
||||||
|
{
|
||||||
|
var list = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||||
|
|
||||||
|
foreach (var item in list)
|
||||||
|
{
|
||||||
|
item.Id = Guid.Empty;
|
||||||
|
item.VisitTaskId = newTask.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(list).Result;
|
||||||
|
}
|
||||||
|
//else if (origenalTask.ReadingCategory == ReadingCategory.Global)
|
||||||
|
//{
|
||||||
|
// var list = _repository.Where<ReadingGlobalTaskInfo>(t => t.GlobalTaskId == origenalTask.Id).ToList();
|
||||||
|
|
||||||
|
// foreach (var item in list)
|
||||||
|
// {
|
||||||
|
// item.Id = Guid.Empty;
|
||||||
|
// item.GlobalTaskId = newTask.Id;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// _ = _repository.AddRangeAsync(list).Result;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
//有序阅片
|
//有序阅片
|
||||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||||
{
|
{
|
||||||
|
@ -1817,7 +1878,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
|
|
||||||
#region 这里时影响其他的任务 /*不包括申请的任务 申请的任务,在上面会统一处理*/
|
#region 这里时影响其他的任务 /*不包括申请的任务 申请的任务,在上面会统一处理*/
|
||||||
|
|
||||||
var influenceTaskList = await _visitTaskRepository.Where(filterExpression, true).ToListAsync();
|
var influenceTaskList = await _visitTaskRepository.Where(filterExpression, true).OrderBy(t=>t.VisitTaskNum).ToListAsync();
|
||||||
|
|
||||||
var trakingOrigenalTask = influenceTaskList.Where(t => t.Id == origenalTask.Id).FirstOrDefault();
|
var trakingOrigenalTask = influenceTaskList.Where(t => t.Id == origenalTask.Id).FirstOrDefault();
|
||||||
|
|
||||||
|
@ -1855,7 +1916,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Abandon });
|
trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Abandon });
|
||||||
}
|
}
|
||||||
|
|
||||||
//冻结的任务不生成任务 附加评估的任务在同意的时候生成
|
//冻结的任务不生成任务 影响的其他标准的附加评估的任务不立即生成 比如1.1基线 重阅
|
||||||
if ( influenceTask.ReadingCategory == ReadingCategory.Visit && beforeTaskState == TaskState.Effect && influenceTask.TrialReadingCriterionId== origenalTask.TrialReadingCriterionId)
|
if ( influenceTask.ReadingCategory == ReadingCategory.Visit && beforeTaskState == TaskState.Effect && influenceTask.TrialReadingCriterionId== origenalTask.TrialReadingCriterionId)
|
||||||
{
|
{
|
||||||
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
|
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
|
@ -1969,69 +2030,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 申请任务 重新生成 拷贝表单
|
|
||||||
|
|
||||||
|
|
||||||
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
|
|
||||||
{
|
|
||||||
TrialId = trialId,
|
|
||||||
|
|
||||||
ReadingCategory = GenerateTaskCategory.ReReading,
|
|
||||||
|
|
||||||
ReReadingTask = origenalTask,
|
|
||||||
|
|
||||||
//同步才可以
|
|
||||||
Action = (newTask) =>
|
|
||||||
{
|
|
||||||
//申请表 设置新任务Id
|
|
||||||
visitTaskReReadingAppply.NewReReadingTaskId = newTask.Id;
|
|
||||||
|
|
||||||
//生成的任务分配给原始医生
|
|
||||||
newTask.DoctorUserId = origenalTask.DoctorUserId;
|
|
||||||
newTask.TaskAllocationState = TaskAllocationState.Allocated;
|
|
||||||
newTask.AllocateTime = DateTime.Now;
|
|
||||||
newTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
|
||||||
|
|
||||||
|
|
||||||
//裁判任务 需要进行特殊处理 在重阅逻辑里面处理
|
|
||||||
|
|
||||||
|
|
||||||
//拷贝表单
|
|
||||||
if (visitTaskReReadingAppply.IsCopyOrigenalForms)
|
|
||||||
{
|
|
||||||
if (origenalTask.ReadingCategory == ReadingCategory.Visit)
|
|
||||||
{
|
|
||||||
var list = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
|
||||||
|
|
||||||
foreach (var item in list)
|
|
||||||
{
|
|
||||||
item.Id = Guid.Empty;
|
|
||||||
item.VisitTaskId = newTask.Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(list).Result;
|
|
||||||
}
|
|
||||||
//else if (origenalTask.ReadingCategory == ReadingCategory.Global)
|
|
||||||
//{
|
|
||||||
// var list = _repository.Where<ReadingGlobalTaskInfo>(t => t.GlobalTaskId == origenalTask.Id).ToList();
|
|
||||||
|
|
||||||
// foreach (var item in list)
|
|
||||||
// {
|
|
||||||
// item.Id = Guid.Empty;
|
|
||||||
// item.GlobalTaskId = newTask.Id;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// _ = _repository.AddRangeAsync(list).Result;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -9,6 +9,7 @@ using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using EntityFrameworkCore.Projectables;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Domain.Models
|
namespace IRaCIS.Core.Domain.Models
|
||||||
{
|
{
|
||||||
|
@ -355,15 +356,21 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
//前序任务需要签名 但是未签名
|
//前序任务需要签名 但是未签名
|
||||||
public bool IsFrontTaskNeedSignButNotSign { get; set; }
|
public bool IsFrontTaskNeedSignButNotSign { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
||||||
public Trial Trial { get; set; }
|
public Trial Trial { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[Projectable]
|
||||||
|
|
||||||
|
public bool IsAfterConvertedTask=>Subject.SubjectVisitTaskList.Where(t=>t.TrialReadingCriterionId == TrialReadingCriterionId
|
||||||
|
&& t.DoctorUserId==DoctorUserId && t.IsConvertedTask
|
||||||
|
&& t.TaskState==TaskState.Effect &&
|
||||||
|
t.VisitTaskNum<VisitTaskNum
|
||||||
|
&& t.IsSelfAnalysis==IsSelfAnalysis
|
||||||
|
&& t.ArmEnum==ArmEnum
|
||||||
|
).Any();
|
||||||
|
|
||||||
|
|
||||||
//影像质量 等等第一层级问题答案
|
//影像质量 等等第一层级问题答案
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
@ -116,6 +116,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
modelBuilder.Entity<VisitTask>().HasMany(t => t.GlobalVisitResultList).WithOne(s => s.GlobalVisitTask).HasForeignKey(t => t.GlobalTaskId);
|
modelBuilder.Entity<VisitTask>().HasMany(t => t.GlobalVisitResultList).WithOne(s => s.GlobalVisitTask).HasForeignKey(t => t.GlobalTaskId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
modelBuilder.Entity<Dictionary>().HasMany(t => t.ChildList).WithOne(t => t.Parent);
|
modelBuilder.Entity<Dictionary>().HasMany(t => t.ChildList).WithOne(t => t.Parent);
|
||||||
modelBuilder.Entity<SubjectUser>().HasMany(t => t.EarlierSubjectUserList).WithOne(t => t.OrignalSubjectUser);
|
modelBuilder.Entity<SubjectUser>().HasMany(t => t.EarlierSubjectUserList).WithOne(t => t.OrignalSubjectUser);
|
||||||
if (_userInfo.IsEn_Us)
|
if (_userInfo.IsEn_Us)
|
||||||
|
|
Loading…
Reference in New Issue