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? SouceReadModuleId { get; set; }
|
||||
|
||||
|
||||
//public bool IsAfterConvertedTask { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -146,7 +146,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
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;
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
||||
|
@ -1401,6 +1434,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
taskUrgent = TaskUrgentType.VisitUrgent;
|
||||
}
|
||||
|
||||
bool isCanEditUrgent = taskUrgent == TaskUrgentType.EnrollmentConfirm || taskUrgent == TaskUrgentType.PDProgress ? false : true;
|
||||
var newTask = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||
{
|
||||
|
@ -1434,6 +1468,18 @@ namespace IRaCIS.Core.Application.Service
|
|||
IsNeedClinicalDataSign = reReadingVisitTask.IsNeedClinicalDataSign,
|
||||
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,
|
||||
// AllocateTime = DateTime.Now,
|
||||
//DoctorUserId = reReadingVisitTask.DoctorUserId,
|
||||
|
|
|
@ -1749,8 +1749,69 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
#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)
|
||||
{
|
||||
|
@ -1817,7 +1878,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
|
||||
#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();
|
||||
|
||||
|
@ -1855,7 +1916,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
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)
|
||||
{
|
||||
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
|
||||
|
|
|
@ -9,6 +9,7 @@ using System.ComponentModel.DataAnnotations;
|
|||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using EntityFrameworkCore.Projectables;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Models
|
||||
{
|
||||
|
@ -355,15 +356,21 @@ namespace IRaCIS.Core.Domain.Models
|
|||
//前序任务需要签名 但是未签名
|
||||
public bool IsFrontTaskNeedSignButNotSign { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
|
||||
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]
|
||||
|
|
|
@ -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<Dictionary>().HasMany(t => t.ChildList).WithOne(t => t.Parent);
|
||||
modelBuilder.Entity<SubjectUser>().HasMany(t => t.EarlierSubjectUserList).WithOne(t => t.OrignalSubjectUser);
|
||||
if (_userInfo.IsEn_Us)
|
||||
|
|
Loading…
Reference in New Issue