From f5fb83ab377631cbb89f3c68549e4be32fa3f6f3 Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Tue, 14 Jun 2022 16:10:00 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E8=87=B4=E6=80=A7?=
=?UTF-8?q?=E6=A0=B8=E6=9F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Allocation/DTO/VisitTaskViewModel.cs | 29 ++++++++++-
.../Service/Allocation/VisitTaskService.cs | 49 ++++++++++++++++---
.../Service/Allocation/_MapConfig.cs | 12 +++++
.../ConsistencyVerificationHandler.cs | 10 ++--
.../Allocation/AllocationRelation.cs | 10 ++++
IRaCIS.Core.Domain/Allocation/VisitTask.cs | 11 +++++
6 files changed, 106 insertions(+), 15 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs
index 21369726d..c4ac19116 100644
--- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs
@@ -66,12 +66,11 @@ namespace IRaCIS.Core.Application.ViewModel
public class ReadingTaskView: VisitTaskView
{
+ public ReadingTaskState ReadingTaskState { get; set; }
//建议完成时间
public int SuggesteDays { get; set; }
- public ReadingTaskState ReadingTaskState { get; set; }
-
public DateTime? SignTime { get; set; }
//是否回退过
@@ -79,6 +78,30 @@ namespace IRaCIS.Core.Application.ViewModel
}
+ public class ReReadingTaskView : VisitTaskView
+ {
+
+ public ReadingTaskState ReadingTaskState { get; set; }
+
+ //建议完成时间
+ public int SuggesteDays { get; set; }
+
+ public DateTime? SignTime { get; set; }
+
+
+ //重阅原始编号
+ public string ReReadingOriginalTaskCode { get; set; }
+
+
+ public RequestReturnType RequestReturnType { get; set; }
+ public DateTime? RequestReturnTime { get; set; }
+ public string RequestReturnReason { get; set; } = string.Empty;
+
+
+
+ }
+
+
public class HistoryReadingDoctorUser
{
@@ -118,6 +141,8 @@ namespace IRaCIS.Core.Application.ViewModel
public DateTime? BeginAllocateDate { get; set; }
public DateTime? EndAllocateDate { get; set; }
+
+ public Guid? OriginalReReadingId { get; set; }
}
public class SubjectAssignQuery : PageInput
diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
index f509e0eb0..69708be83 100644
--- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs
@@ -117,7 +117,7 @@ namespace IRaCIS.Core.Application.Service
///
- /// 获取影像阅片列表 相比而言多了几个字段 和配置信息
+ /// 获取影像阅片列表 (排除重阅的) 相比而言多了几个字段 和配置信息
///
///
///
@@ -130,7 +130,6 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
- .WhereIf(queryVisitTask.ReadingCategory == null, t => t.ReadingCategory != ReadingCategory.Judge)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
@@ -147,6 +146,40 @@ namespace IRaCIS.Core.Application.Service
return (pageList, trialTaskConfig);
}
+ ///
+ /// 获取重阅影像阅片列表
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task> GetReReadingTaskList(VisitTaskQuery queryVisitTask)
+ {
+
+
+ var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId)
+ .WhereIf(queryVisitTask.OriginalReReadingId != null, t => t.OriginalReReadingId == queryVisitTask.OriginalReReadingId)
+ .WhereIf(queryVisitTask.OriginalReReadingId == null, t => t.OriginalReReadingId != null)
+
+ .WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
+ .WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
+ .WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
+ .WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
+ .WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
+ .WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
+ .WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
+ .WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
+ .WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
+ .WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate.Value.AddDays(1))
+ .ProjectTo(_mapper.ConfigurationProvider);
+
+ var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId) };
+
+ var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
+
+ return pageList;
+ }
+
+
///
@@ -391,12 +424,12 @@ namespace IRaCIS.Core.Application.Service
waitAllocationDoctorList.ForEach(doctor =>
{
- integerPlan += (int)Math.Floor((double)(subjectCount * doctor.PlanReadingRatio ) / 100);
+ integerPlan += (int)Math.Floor((double)(subjectCount * doctor.PlanReadingRatio) / 100);
});
- var specialSubjectCount = subjectCount - integerPlan;
+ var specialSubjectCount = subjectCount - integerPlan;
//按照医生维度 分配Subject
foreach (var doctor in waitAllocationDoctorList)
@@ -465,7 +498,7 @@ namespace IRaCIS.Core.Application.Service
});
- var specialSubjectCount = (subjectCount * 2) - integerPlan;
+ var specialSubjectCount = (subjectCount * 2) - integerPlan;
//按照医生维度 分配Subject
foreach (var doctor in waitAllocationDoctorList)
@@ -485,7 +518,7 @@ namespace IRaCIS.Core.Application.Service
var yuShu = (subjectCount * doctor.PlanReadingRatio * 2) % 100;
- if ( yuShu != 0)
+ if (yuShu != 0)
{
if (specialSubjectCount > 0)
{
@@ -496,7 +529,7 @@ namespace IRaCIS.Core.Application.Service
}
-
+
//如果计划的数量 大于已经分配的数量 那么该医生 可以分配新的Subject
if (planSubjectCount > hasAssignedSubjectCount)
@@ -509,7 +542,7 @@ namespace IRaCIS.Core.Application.Service
//取需要分配的数量 并且没有分配给其他医生的包括自己
var assignSubjectIdList = subjectList.Where(t => !hasAssignedSubjectIdList.Contains(t.SubjectId) && !otherExceptDoctorIdList.Contains(t.SubjectId))
- .Select(t => t.SubjectId).Take((planSubjectCount - hasAssignedSubjectCount) ).ToList();
+ .Select(t => t.SubjectId).Take((planSubjectCount - hasAssignedSubjectCount)).ToList();
foreach (var assignSubjectId in assignSubjectIdList)
{
diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs
index 1295f8c85..9e487f179 100644
--- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs
@@ -63,6 +63,18 @@ namespace IRaCIS.Core.Application.Service
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName));
+ CreateMap()
+ .ForMember(o => o.ReReadingOriginalTaskCode, t => t.MapFrom(u => u.OriginalReReadingTask.TaskCode))
+
+ .ForMember(o => o.SiteId, t => t.MapFrom(u => u.Subject.SiteId))
+ .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
+ .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
+ .ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
+ .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
+ .ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
+ .ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName));
+
+
diff --git a/IRaCIS.Core.Application/_MediatR/Handlers/ConsistencyVerificationHandler.cs b/IRaCIS.Core.Application/_MediatR/Handlers/ConsistencyVerificationHandler.cs
index 95b903a94..812980303 100644
--- a/IRaCIS.Core.Application/_MediatR/Handlers/ConsistencyVerificationHandler.cs
+++ b/IRaCIS.Core.Application/_MediatR/Handlers/ConsistencyVerificationHandler.cs
@@ -161,8 +161,8 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
}
else
{
-
- dialogMsg.AppendLine($"
存在问题如下:");
+ dialogMsg.AppendLine($"
");
+ dialogMsg.AppendLine($"
存在问题如下:");
num = 0;
foreach (var item in dbExceptExcel)
@@ -174,14 +174,14 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
foreach (var item in excelExceptDB)
{
num++;
- dialogMsg.AppendLine($"
{num}.IRC 缺少{item.StudyDate}的;{item.Modality}影像检查 ");
+ dialogMsg.AppendLine($"
{num}.IRC 缺少{item.StudyDate}的{item.Modality}影像检查 ");
}
-
+ dialogMsg.AppendLine($"
");
dialogMsg.AppendLine(@$"
说明:为高效解决/处理以上全部质疑问题,麻烦您准确核实实际影像检查情况。请注意影像日期与实际检查的日期可能会不一致,部分检查(如PET -CT)可能同时存在多种模态影像。准确核实后,请回复该访视正确的影像检查情况。");
dbSV.CheckResult = "根据导入的一致性核查数据,请确认本访视以下不一致检查项信息:" + String.Join(" | ", dbExceptExcel.Select(t => $"EDC 缺少:{t.StudyDate} {t.Modality} ")) + " | "
- + String.Join(" | ", excelExceptDB.Select(t => $"IRC 缺少:{t.StudyDate} {t.Modality}"));
+ + String.Join(" | ", excelExceptDB.Select(t => $"IRC 缺少:{t.StudyDate} {t.Modality}"));
//新增一致性核查质疑记录
diff --git a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs
index e1e0d4323..0c580ddb2 100644
--- a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs
+++ b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs
@@ -80,6 +80,16 @@ namespace IRaCIS.Core.Domain.Share
HaveSigned=2
}
+ public enum RequestReturnType
+ {
+ Default = 0,
+
+ DocotorApply = 1,
+
+ TrialGroupApply = 2
+ }
+
+
diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs
index 92dd47efb..9f48dbd10 100644
--- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs
+++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs
@@ -139,6 +139,17 @@ namespace IRaCIS.Core.Domain.Models
//是否回退过
public bool IsReturned { get; set; }
+ //是否 重阅
+ public bool IsReReading { get; set; }
+
+ //重阅原始任务Id
+ public Guid? OriginalReReadingId { get; set; }
+
+ public VisitTask OriginalReReadingTask { get; set; }
+
+ public RequestReturnType RequestReturnType { get; set; }
+ public DateTime? RequestReturnTime { get; set; }
+ public string RequestReturnReason { get; set; } = string.Empty;
}
}