Compare commits
60 Commits
Test_IRC_N
...
EICS-V1.11
Author | SHA1 | Date |
---|---|---|
|
e4ad1c0653 | |
|
84df49ca07 | |
|
400edd0b70 | |
|
c4add1ecc8 | |
|
d5879e28d7 | |
|
37e083face | |
|
290506a060 | |
|
1b4bc3690a | |
|
6374781d26 | |
|
b28013a02f | |
|
fe429d2bdc | |
|
d63af2ed20 | |
|
cebf9875b1 | |
|
131681a0b3 | |
|
f833adc710 | |
|
df80d1e551 | |
|
82dc092247 | |
|
44894fcaa9 | |
|
083bebdc03 | |
|
e808764dd6 | |
|
77d198cb09 | |
|
180b02b28c | |
|
c49a74d742 | |
|
c76fc8f052 | |
|
14875dfacc | |
|
0a68788c0f | |
|
b17e5d9ff3 | |
|
05ce4b7155 | |
|
c8bbb3da48 | |
|
65de108ecd | |
|
d20c306219 | |
|
e69991ae37 | |
|
e1e2544ee3 | |
|
318333bae4 | |
|
d569de4dfe | |
|
05627ff126 | |
|
627618c854 | |
|
2711c5eb04 | |
|
a6982f79c3 | |
|
2a542949cd | |
|
a8ccbce76f | |
|
df7cf30aed | |
|
0664fbdfb7 | |
|
0a6ee05417 | |
|
f9bd8c3f5c | |
|
cb83c2a737 | |
|
fdd9afd4f0 | |
|
53d26c0445 | |
|
40d035e7a7 | |
|
a13807ae5f | |
|
9d5aaf1e26 | |
|
c347d08e2b | |
|
87f2d0e429 | |
|
89d009fcbf | |
|
7d65cf5051 | |
|
e74427c45c | |
|
e8825c7efa | |
|
628e0ad034 | |
|
2f3f639918 | |
|
87caf24dd1 |
|
@ -10525,6 +10525,11 @@
|
||||||
阅片版本
|
阅片版本
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionCriterionTrialInDto.ReadingToolList">
|
||||||
|
<summary>
|
||||||
|
阅片工具
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionCriterionSystemInDto.CriterionGroup">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionCriterionSystemInDto.CriterionGroup">
|
||||||
<summary>
|
<summary>
|
||||||
标准分组
|
标准分组
|
||||||
|
@ -13307,7 +13312,7 @@
|
||||||
阅片期配置
|
阅片期配置
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingPeriodSetService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitStage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodPlan},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Site},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingPeriodSetService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitStage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Contracts.IReadingImageTaskService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodPlan},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Site},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||||
<summary>
|
<summary>
|
||||||
阅片期配置
|
阅片期配置
|
||||||
</summary>
|
</summary>
|
||||||
|
@ -13379,7 +13384,7 @@
|
||||||
生成的阅片模块(在大列表上展示的) 阅片期
|
生成的阅片模块(在大列表上展示的) 阅片期
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadModuleService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModuleView},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadModuleService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModuleView},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Application.Contracts.IReadingImageTaskService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||||
<summary>
|
<summary>
|
||||||
生成的阅片模块(在大列表上展示的) 阅片期
|
生成的阅片模块(在大列表上展示的) 阅片期
|
||||||
</summary>
|
</summary>
|
||||||
|
|
|
@ -216,6 +216,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
//public bool IsAfterConvertedTask { get; set; }
|
//public bool IsAfterConvertedTask { get; set; }
|
||||||
|
|
||||||
public string PMBackReason { get; set; }
|
public string PMBackReason { get; set; }
|
||||||
|
|
||||||
|
public int? RandomOrder { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -482,6 +484,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
public string? RequestReReadingReason { get; set; }
|
public string? RequestReReadingReason { get; set; }
|
||||||
|
|
||||||
public ExportResult? ReadingExportType { get; set; }
|
public ExportResult? ReadingExportType { get; set; }
|
||||||
|
|
||||||
|
public int? RandomOrder { get; set; }
|
||||||
|
public bool? IsRandomOrderList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -908,6 +913,30 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
CancelAssign = 4,
|
CancelAssign = 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SetRandomTaskOrderCommand
|
||||||
|
{
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialReadingCriterionId { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public Guid DoctorUserId { get; set; }
|
||||||
|
|
||||||
|
public bool IsAutoSet { get; set; }
|
||||||
|
|
||||||
|
public List<VisitTaskOrderCommand> SetList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class VisitTaskOrderCommand
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public int? RandomOrder { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,12 +51,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
return await ExcelExportHelper.ExportTemplateAsync(new ExportTemplateServiceDto()
|
return await ExcelExportHelper.ExportTemplateAsync(new ExportTemplateServiceDto()
|
||||||
{
|
{
|
||||||
Data=inDto.Data,
|
Data = inDto.Data,
|
||||||
commonDocumentRepository= _commonDocumentRepository,
|
commonDocumentRepository = _commonDocumentRepository,
|
||||||
TemplateCode=inDto.TemplateCode,
|
TemplateCode = inDto.TemplateCode,
|
||||||
ExportFileName=inDto.ExportFileName,
|
ExportFileName = inDto.ExportFileName,
|
||||||
hostEnvironment=_hostEnvironment,
|
hostEnvironment = _hostEnvironment,
|
||||||
IsEnglish=_userInfo.IsEn_Us,
|
IsEnglish = _userInfo.IsEn_Us,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -757,24 +757,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
if (trialReadingCriterionConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject)
|
if (trialReadingCriterionConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject)
|
||||||
{
|
{
|
||||||
var allocateSubjectArmList = _visitTaskRepository.Where(t => t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TrialId == trialId && t.DoctorUserId != null && t.ArmEnum != Arm.JudgeArm)
|
|
||||||
.Select(t => new { t.DoctorUserId, t.ArmEnum }).Distinct().ToList();
|
|
||||||
|
|
||||||
//当前任务没有分配医生,初次分配 不处理 只生成任务,后续根据生成的任务 再进行分配
|
|
||||||
if (allocateSubjectArmList.Count == 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//并且配置了医生
|
|
||||||
if (assignConfigList.Count > 0 && trialReadingCriterionConfig.IsFollowVisitAutoAssign)
|
|
||||||
{
|
|
||||||
|
|
||||||
#region 后续访视 未分配的进行再次分配,重置的或者失效的 需要重新生成新的任务 (PM 有序退回 或者PM 有序 申请重阅)
|
|
||||||
|
|
||||||
|
|
||||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||||
|
{
|
||||||
|
#region 当前访视处理
|
||||||
|
|
||||||
|
//配置了医生
|
||||||
|
if (assignConfigList.Count > 0)
|
||||||
{
|
{
|
||||||
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
||||||
|
|
||||||
|
@ -813,6 +803,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 后续访视处理
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//后续最近的未一致性核查通过的访视任务
|
//后续最近的未一致性核查通过的访视任务
|
||||||
var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||||
|
@ -867,13 +864,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
if (arm1 != null)
|
if (arm1 != null)
|
||||||
{
|
{
|
||||||
|
arm1.IsUrgent = visit.IsUrgent;
|
||||||
|
arm1.TaskUrgentType = urgentType;
|
||||||
|
arm1.IsCanEditUrgentState = isCanEdit;
|
||||||
|
|
||||||
//有可能仅仅只分配了一个Subject 未分配 那么
|
//有可能仅仅只分配了一个Subject 未分配 那么
|
||||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||||
{
|
{
|
||||||
arm1.IsUrgent = visit.IsUrgent;
|
|
||||||
arm1.TaskUrgentType = urgentType;
|
|
||||||
arm1.IsCanEditUrgentState = isCanEdit;
|
|
||||||
arm1.TaskAllocationState = TaskAllocationState.Allocated;
|
arm1.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
arm1.AllocateTime = DateTime.Now;
|
arm1.AllocateTime = DateTime.Now;
|
||||||
arm1.DoctorUserId = task1.DoctorUserId;
|
arm1.DoctorUserId = task1.DoctorUserId;
|
||||||
|
@ -885,9 +882,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
|
var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
|
var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
{
|
{
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
|
@ -909,15 +903,21 @@ namespace IRaCIS.Core.Application.Service
|
||||||
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
||||||
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
||||||
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
||||||
TaskAllocationState = TaskAllocationState.Allocated,
|
|
||||||
AllocateTime = DateTime.Now,
|
|
||||||
DoctorUserId = task1!.DoctorUserId,
|
|
||||||
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
|
|
||||||
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
||||||
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
||||||
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||||
|
{
|
||||||
|
taskOne.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
|
taskOne.AllocateTime = DateTime.Now;
|
||||||
|
taskOne. DoctorUserId = task1!.DoctorUserId;
|
||||||
|
taskOne. SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
@ -934,13 +934,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
|
var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
|
||||||
if (arm2 != null)
|
if (arm2 != null)
|
||||||
{
|
|
||||||
//有可能仅仅只分配了一个Subject
|
|
||||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
|
||||||
{
|
{
|
||||||
arm2.IsUrgent = visit.IsUrgent;
|
arm2.IsUrgent = visit.IsUrgent;
|
||||||
arm2.TaskUrgentType = urgentType;
|
arm2.TaskUrgentType = urgentType;
|
||||||
arm2.IsCanEditUrgentState = isCanEdit;
|
arm2.IsCanEditUrgentState = isCanEdit;
|
||||||
|
|
||||||
|
//有可能仅仅只分配了一个Subject
|
||||||
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||||
|
{
|
||||||
arm2.TaskAllocationState = TaskAllocationState.Allocated;
|
arm2.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
arm2.AllocateTime = DateTime.Now;
|
arm2.AllocateTime = DateTime.Now;
|
||||||
arm2.DoctorUserId = task2.DoctorUserId;
|
arm2.DoctorUserId = task2.DoctorUserId;
|
||||||
|
@ -975,17 +976,20 @@ namespace IRaCIS.Core.Application.Service
|
||||||
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
||||||
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
||||||
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
||||||
TaskAllocationState = TaskAllocationState.Allocated,
|
|
||||||
|
|
||||||
AllocateTime = DateTime.Now,
|
|
||||||
DoctorUserId = task2!.DoctorUserId,
|
|
||||||
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
|
|
||||||
|
|
||||||
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
||||||
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
||||||
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||||
|
{
|
||||||
|
taskTwo.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
|
taskTwo.AllocateTime = DateTime.Now;
|
||||||
|
taskTwo.DoctorUserId = task2!.DoctorUserId;
|
||||||
|
taskTwo.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||||
|
}
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
@ -994,10 +998,15 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//无序的时候 生成任务并分配出去
|
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
//无序的时候 生成任务并分配出去
|
||||||
|
if (assignConfigList.Count > 0 && trialReadingCriterionConfig.IsFollowVisitAutoAssign)
|
||||||
{
|
{
|
||||||
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
||||||
|
|
||||||
|
@ -1018,21 +1027,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
task2.AllocateTime = DateTime.Now;
|
task2.AllocateTime = DateTime.Now;
|
||||||
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
//后续访视不自动分配,或者配置的医生数量不足,就不进行分配
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ using IRaCIS.Core.Infrastructure;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System.Linq.Dynamic.Core;
|
using System.Linq.Dynamic.Core;
|
||||||
using Subject = IRaCIS.Core.Domain.Models.Subject;
|
using Subject = IRaCIS.Core.Domain.Models.Subject;
|
||||||
|
|
||||||
|
@ -74,7 +75,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
return await _visitTaskRepository.SaveChangesAsync();
|
return await _visitTaskRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<TrialReadingCriterionDto>> GetTrialCriterionList(Guid trialId, bool isHaveSigned = true, bool? isAutoCreate = null)
|
public async Task<List<TrialReadingCriterionDto>> GetTrialCriterionList(Guid trialId, bool isHaveSigned = true, bool? isAutoCreate = null, bool? isRandom = null)
|
||||||
{
|
{
|
||||||
var list = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm)
|
var list = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm)
|
||||||
|
|
||||||
|
@ -107,7 +108,8 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
|
|
||||||
return list.AsQueryable().WhereIf(isHaveSigned == true, t => t.ReadingInfoSignTime != null)
|
return list.AsQueryable().WhereIf(isHaveSigned == true, t => t.ReadingInfoSignTime != null)
|
||||||
.WhereIf(isAutoCreate == false, t => t.IsAutoCreate == isAutoCreate).ToList();
|
.WhereIf(isAutoCreate == false, t => t.IsAutoCreate == isAutoCreate)
|
||||||
|
.WhereIf(isRandom == true, t => t.IsReadingTaskViewInOrder == ReadingOrder.Random).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -761,6 +763,8 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
|
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
|
||||||
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
||||||
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
||||||
|
.WhereIf(inQuery.RandomOrder != null, t => t.RandomOrder == inQuery.RandomOrder)
|
||||||
|
.WhereIf(inQuery.IsRandomOrderList == true, t => (t.ReadingTaskState == ReadingTaskState.WaitReading || t.ReadingTaskState==ReadingTaskState.Reading) && t.TaskAllocationState==TaskAllocationState.Allocated)
|
||||||
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
|
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var defalutSortArray = new string[] { nameof(ReadingTaskView.IsUrgent) + " desc", nameof(ReadingTaskView.SubjectCode), nameof(ReadingTaskView.VisitTaskNum) };
|
var defalutSortArray = new string[] { nameof(ReadingTaskView.IsUrgent) + " desc", nameof(ReadingTaskView.SubjectCode), nameof(ReadingTaskView.VisitTaskNum) };
|
||||||
|
@ -1005,6 +1009,10 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
if (critrion.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
if (critrion.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||||
{
|
{
|
||||||
|
var extralObj = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.TrialExtraConfigJsonStr }).FirstOrDefault();
|
||||||
|
|
||||||
|
var extralConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(extralObj?.TrialExtraConfigJsonStr) ?? new TrialExtraConfig();
|
||||||
|
|
||||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect)
|
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect)
|
||||||
|
|
||||||
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
||||||
|
@ -1012,7 +1020,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
||||||
|
|
||||||
// 前序 不存在 未一致性核查未通过的
|
// 前序 不存在 未一致性核查未通过的
|
||||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum >= sv.VisitNum))
|
.Where(t => !t.Subject.SubjectVisitList.Where(t => extralConfig.IsOpenLostVistRead ? t.IsLostVisit == false : true).Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum >= sv.VisitNum))
|
||||||
//.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
//.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
||||||
//t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
//t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
||||||
//.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
//.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
||||||
|
@ -1035,14 +1043,15 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
UnReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
UnReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
||||||
|
|
||||||
//未读 里可读任务量
|
//未读 里可读任务量
|
||||||
UnReadCanReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)
|
UnReadCanReadTaskCount = x.Where(t => extralConfig.IsOpenLostVistRead ? true : t.IsFrontTaskNeedSignButNotSign == false).Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)
|
||||||
//不能对包含聚合或子查询的表达式执行聚合函数
|
//不能对包含聚合或子查询的表达式执行聚合函数
|
||||||
//&& !x.Any(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false && t.VisitTaskNum<y.VisitTaskNum )
|
//&& !x.Any(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false && t.VisitTaskNum<y.VisitTaskNum )
|
||||||
).Count(),
|
).Count(),
|
||||||
|
|
||||||
|
|
||||||
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
.Where(t => extralConfig.IsOpenLostVistRead ? true : t.IsFrontTaskNeedSignButNotSign == false)
|
||||||
|
.Where(y => /*y.IsFrontTaskNeedSignButNotSign == false &&*/ (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||||
.OrderBy(x => x.VisitTaskNum)
|
.OrderBy(x => x.VisitTaskNum)
|
||||||
.Select(u => new IRUnreadTaskView()
|
.Select(u => new IRUnreadTaskView()
|
||||||
{
|
{
|
||||||
|
@ -1055,7 +1064,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
ReadingCategory = u.ReadingCategory,
|
ReadingCategory = u.ReadingCategory,
|
||||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||||
ArmEnum = u.ArmEnum,
|
ArmEnum = u.ArmEnum,
|
||||||
IsExistUnprocessedFeedback=u.UserFeedBackList.Any(t => t.State ==0),
|
IsExistUnprocessedFeedback = u.UserFeedBackList.Any(t => t.State == 0),
|
||||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||||
|
@ -2244,7 +2253,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
var originalVisitTaskId = item.VisitTaskId;
|
var originalVisitTaskId = item.VisitTaskId;
|
||||||
var originalFristAddTaskId = item.FristAddTaskId;
|
var originalFristAddTaskId = item.FristAddTaskId;
|
||||||
|
|
||||||
var newRowId= NewId.NextSequentialGuid();
|
var newRowId = NewId.NextSequentialGuid();
|
||||||
|
|
||||||
foreach (var mark in readingTaskQuestionMarkList)
|
foreach (var mark in readingTaskQuestionMarkList)
|
||||||
{
|
{
|
||||||
|
@ -2285,7 +2294,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
public async Task<IResponseOutput> PMSetTaskBack(Guid trialId, Guid taskId,string pmBackReason)
|
public async Task<IResponseOutput> PMSetTaskBack(Guid trialId, Guid taskId, string pmBackReason)
|
||||||
{
|
{
|
||||||
|
|
||||||
//var trialConfig = (await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.IsReadingTaskViewInOrder, t.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException();
|
//var trialConfig = (await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.IsReadingTaskViewInOrder, t.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
@ -2616,7 +2625,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
private bool IsSpmOrCPM()
|
private bool IsSpmOrCPM()
|
||||||
{
|
{
|
||||||
return _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM ;
|
return _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -2942,6 +2951,88 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region 完全随机设置序号
|
||||||
|
[HttpPost]
|
||||||
|
[UnitOfWork]
|
||||||
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
public async Task<IResponseOutput> SetRandomTaskOrder(SetRandomTaskOrderCommand inCommand)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (inCommand.IsAutoSet)
|
||||||
|
{
|
||||||
|
//找到所有的已分配的,未阅片的,生效的 非一致性分析
|
||||||
|
|
||||||
|
var needRandomOrderList = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId)
|
||||||
|
.Where(t => t.TaskAllocationState == TaskAllocationState.Allocated && t.ReadingTaskState == ReadingTaskState.WaitReading && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
||||||
|
.Select(t => t.Id).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
//var haveSignOrderList = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId)
|
||||||
|
// .Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SignTime != null && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
||||||
|
// .Select(t => t.RandomOrder).ToList();
|
||||||
|
|
||||||
|
//已阅,阅片中任务的序号
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId
|
||||||
|
&& t.DoctorUserId == inCommand.DoctorUserId && t.ReadingTaskState != ReadingTaskState.WaitReading, u => new VisitTask() { RandomOrder = null });
|
||||||
|
|
||||||
|
//随机赋值编号 比如要处理5个任务,实例化一个包含1-5的数组,每次随机取出一个
|
||||||
|
List<int> availableNumbers = Enumerable.Range(1, needRandomOrderList.Count).ToList();
|
||||||
|
Random rng = new Random();
|
||||||
|
foreach (var id in needRandomOrderList)
|
||||||
|
{
|
||||||
|
int randomIndex = rng.Next(availableNumbers.Count);
|
||||||
|
|
||||||
|
var num = availableNumbers[randomIndex];
|
||||||
|
|
||||||
|
var order = 11 + 5 * (num - 1);
|
||||||
|
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, t => new VisitTask() { RandomOrder = order });
|
||||||
|
|
||||||
|
availableNumbers.RemoveAt(randomIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var item in inCommand.SetList)
|
||||||
|
{
|
||||||
|
var task = await _visitTaskRepository.Where(t => t.Id == item.Id).Select(t => new { t.RandomOrder, t.ReadingTaskState, t.TaskAllocationState, t.DoctorUserId }).FirstNotNullAsync();
|
||||||
|
|
||||||
|
if (task.ReadingTaskState != ReadingTaskState.WaitReading || task.DoctorUserId != inCommand.DoctorUserId
|
||||||
|
|| task.TaskAllocationState != TaskAllocationState.Allocated)
|
||||||
|
{
|
||||||
|
//"任务不符合设置阅片序号条件"
|
||||||
|
return ResponseOutput.NotOk(_localizer["VisitTask_NotRandomOrderTask"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置交换序号的任务,可能不符合条件
|
||||||
|
|
||||||
|
//没有序号,直接设置
|
||||||
|
if (task.RandomOrder == null)
|
||||||
|
{
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, t => new VisitTask() { RandomOrder = item.RandomOrder });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!_visitTaskRepository.Any(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId
|
||||||
|
&& t.TaskAllocationState == TaskAllocationState.Allocated && t.ReadingTaskState == ReadingTaskState.WaitReading && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||||
|
&& t.RandomOrder == item.RandomOrder))
|
||||||
|
{
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, t => new VisitTask() { RandomOrder = item.RandomOrder });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//"序号已被占用!"
|
||||||
|
return ResponseOutput.NotOk(_localizer["VisitTask_RandomOrderUserd"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
#region 暂时废弃
|
#region 暂时废弃
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -361,7 +361,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
var systemDocQuery =
|
var systemDocQuery =
|
||||||
from sysDoc in _systemDocumentRepository.AsQueryable(false)
|
from sysDoc in _systemDocumentRepository.AsQueryable(false)
|
||||||
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
|
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
|
||||||
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
|
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.Status == UserStateEnum.Enable && t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
|
||||||
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
|
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
|
||||||
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
|
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
|
||||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
|
@ -1304,8 +1304,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
|
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
|
||||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||||
|
|
||||||
|
.WhereIf(inQuery.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||||
|
.WhereIf(inQuery.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned)
|
||||||
|
|
||||||
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||||
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
|
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||||
|
@ -1314,27 +1316,51 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||||
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
||||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||||
|
.WhereIf(inQuery.ReReadingApplyState != null, t => t.ReReadingApplyState == inQuery.ReReadingApplyState)
|
||||||
|
|
||||||
|
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.Complete, t => t.IsClinicalDataSign && t.IsNeedClinicalDataSign == true)
|
||||||
|
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NotComplete, t => t.IsClinicalDataSign == false && t.IsNeedClinicalDataSign == true)
|
||||||
|
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NA, t => t.IsNeedClinicalDataSign == false)
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode) || t.BlindSubjectCode.Contains(inQuery.SubjectCode))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
|
||||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
|
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
|
||||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
|
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
|
||||||
|
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
||||||
|
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
||||||
|
.WhereIf(inQuery.RandomOrder != null, t => t.RandomOrder == inQuery.RandomOrder)
|
||||||
|
.WhereIf(inQuery.IsRandomOrderList == true, t => (t.ReadingTaskState == ReadingTaskState.WaitReading || t.ReadingTaskState == ReadingTaskState.Reading) && t.TaskAllocationState == TaskAllocationState.Allocated)
|
||||||
|
|
||||||
.ProjectTo<ReadingTaskExportDto>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<ReadingTaskExportDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
//var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
//var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
||||||
|
|
||||||
list = list.OrderBy(t => t.TrialSiteCode).ThenBy(t => t.SubjectCode).ThenBy(t => t.VisitTaskNum).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
|
||||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||||
|
|
||||||
|
|
||||||
|
if (inQuery.IsRandomOrderList == true)
|
||||||
|
{
|
||||||
|
list = list.OrderBy(t => t.RandomOrder).ToList();
|
||||||
|
|
||||||
|
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||||
|
|
||||||
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialTaskRandomOrderList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
list = list.OrderBy(t => t.TrialSiteCode).ThenBy(t => t.SubjectCode).ThenBy(t => t.VisitTaskNum).ToList();
|
||||||
|
|
||||||
|
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||||
|
|
||||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -799,7 +799,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
var systemDocQuery =
|
var systemDocQuery =
|
||||||
from sysDoc in _systemDocumentRepository.AsQueryable(false)
|
from sysDoc in _systemDocumentRepository.AsQueryable(false)
|
||||||
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
|
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
|
||||||
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
|
from identityUser in _identityUserRepository.AsQueryable(false).Where(t =>t.Status== UserStateEnum.Enable && t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
|
||||||
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
|
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
|
||||||
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
|
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
|
||||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
|
|
|
@ -13,6 +13,7 @@ using MassTransit.Initializers;
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -901,8 +902,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
var query = _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect)
|
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId)
|
||||||
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
|
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
|
||||||
|
.WhereIf(inQuery.VisitTaskId == null, t => t.TaskState == TaskState.Effect)//从待阅列表进入,要筛选出有效的,任务可能重阅了,也要看到该任务的的
|
||||||
.WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId)
|
.WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId)
|
||||||
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
|
|
@ -897,6 +897,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
/*string.Format("{0}分钟", (ReadingDurationTimeSpan)?.TotalMinutes)*/;
|
/*string.Format("{0}分钟", (ReadingDurationTimeSpan)?.TotalMinutes)*/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int? RandomOrder { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -798,6 +798,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public ReadingVersion? ReadingVersionEnum { get; set; }
|
public ReadingVersion? ReadingVersionEnum { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public ReadingTool? ReadingTool { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 阅片工具
|
||||||
|
/// </summary>
|
||||||
|
public List<string> ReadingToolList { get; set; } = new List<string>();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
public interface IReadingImageTaskService
|
public interface IReadingImageTaskService
|
||||||
{
|
{
|
||||||
|
Task TriggerJudgeQuestion(Guid visitTaskId);
|
||||||
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
|
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
|
||||||
|
|
||||||
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
|
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
|
||||||
|
|
|
@ -393,6 +393,12 @@ namespace IRaCIS.Core.Application.Service.RC
|
||||||
|
|
||||||
indto.ReadingVersionEnum=(ReadingVersion)maxDic;
|
indto.ReadingVersionEnum=(ReadingVersion)maxDic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
indto.ReadingTool = ReadingTool.Dicom;
|
||||||
|
indto.ReadingToolList = new List<string>()
|
||||||
|
{
|
||||||
|
"Length", "Bidirectional", "RectangleROI", "ArrowAnnotate", "CircleROI"
|
||||||
|
};
|
||||||
var entity = await _readingQuestionCriterionTrialRepository.InsertOrUpdateAsync(indto, true);
|
var entity = await _readingQuestionCriterionTrialRepository.InsertOrUpdateAsync(indto, true);
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
|
public async Task<IResponseOutput> BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
|
||||||
{
|
{
|
||||||
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
||||||
|
@ -94,7 +94,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
})).ToList();
|
})).ToList();
|
||||||
|
|
||||||
await _readingGlobalTaskInfoRepository.AddRangeAsync(answers);
|
await _readingGlobalTaskInfoRepository.AddRangeAsync(answers);
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
await _visitTaskRepository.UpdatePartialFromEFAutoAsync(inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
||||||
var result = await _readingGlobalTaskInfoRepository.SaveChangesAsync();
|
var result = await _readingGlobalTaskInfoRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> SaveGlobalReadingInfo(SaveGlobalReadingInfoInDto inDto)
|
public async Task<IResponseOutput> SaveGlobalReadingInfo(SaveGlobalReadingInfoInDto inDto)
|
||||||
{
|
{
|
||||||
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
||||||
|
@ -301,7 +301,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
LimitEdit = y.LimitEdit,
|
LimitEdit = y.LimitEdit,
|
||||||
MaxAnswerLength = y.MaxAnswerLength,
|
MaxAnswerLength = y.MaxAnswerLength,
|
||||||
FileType = y.FileType,
|
FileType = y.FileType,
|
||||||
Unit=y.Unit,
|
Unit = y.Unit,
|
||||||
QuestionGenre = y.QuestionGenre,
|
QuestionGenre = y.QuestionGenre,
|
||||||
ShowOrder = y.ShowOrder,
|
ShowOrder = y.ShowOrder,
|
||||||
DictionaryCode = y.DictionaryCode,
|
DictionaryCode = y.DictionaryCode,
|
||||||
|
|
|
@ -647,7 +647,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IsCurrentTask = x.Id == inDto.VisitTaskId,
|
IsCurrentTask = x.Id == inDto.VisitTaskId,
|
||||||
IsConvertedTask = x.IsConvertedTask,
|
IsConvertedTask = x.IsConvertedTask,
|
||||||
IsFirstChangeTask = x.BeforeConvertedTaskId != null,
|
IsFirstChangeTask = x.BeforeConvertedTaskId != null,
|
||||||
IsExistUnprocessedFeedback=x.UserFeedBackList.Any(y => y.State == 0),
|
IsExistUnprocessedFeedback = x.UserFeedBackList.Any(y => y.State == 0),
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
@ -3034,7 +3034,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var subjectTaskList = (await _visitTaskService.GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
|
var subjectTaskList = (await _visitTaskService.GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
|
||||||
{
|
{
|
||||||
TrialId = inDto.TrialId,
|
TrialId = inDto.TrialId,
|
||||||
|
SubjectId = inDto.SubjectId,
|
||||||
TrialReadingCriterionId = trialReadingCriterionId!.Value,
|
TrialReadingCriterionId = trialReadingCriterionId!.Value,
|
||||||
|
SubjectCode = inDto.SubjectCode,
|
||||||
PageIndex = 1,
|
PageIndex = 1,
|
||||||
PageSize = 99999,
|
PageSize = 99999,
|
||||||
|
|
||||||
|
@ -3117,24 +3119,45 @@ namespace IRaCIS.Core.Application.Service
|
||||||
&& x.TrialReadingCriterionId == trialReadingCriterionId
|
&& x.TrialReadingCriterionId == trialReadingCriterionId
|
||||||
&& x.TaskState == TaskState.Effect)
|
&& x.TaskState == TaskState.Effect)
|
||||||
.Where(x => !cacheSkipIds.Contains(x.Id));
|
.Where(x => !cacheSkipIds.Contains(x.Id));
|
||||||
var count = await query.CountAsync();
|
|
||||||
if (count == 0)
|
//如果是随机阅片
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
|
||||||
}
|
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
var skipcount = 0;
|
var skipcount = 0;
|
||||||
if (count >= 2)
|
|
||||||
{
|
|
||||||
skipcount = random.Next(0, count - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var minRandomOrder = query.Where(t => t.RandomOrder != null).Select(t => t.RandomOrder).MinOrDefault();
|
||||||
|
|
||||||
|
//以随机序号优先,阅片中优先先给IR
|
||||||
|
if (minRandomOrder != null)
|
||||||
|
{
|
||||||
|
query = query.Where(x => x.RandomOrder == minRandomOrder);
|
||||||
|
skipcount = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//没有随机序号的,那么就按照阅片中最新的时间给
|
||||||
var maxReadingTime = query.MaxOrDefault(x => x.FirstReadingTime);
|
var maxReadingTime = query.MaxOrDefault(x => x.FirstReadingTime);
|
||||||
if (maxReadingTime != null)
|
if (maxReadingTime != null)
|
||||||
{
|
{
|
||||||
query = query.Where(x => x.FirstReadingTime == maxReadingTime);
|
query = query.Where(x => x.FirstReadingTime == maxReadingTime);
|
||||||
skipcount = 0;
|
skipcount = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var count = await query.CountAsync();
|
||||||
|
if (count >= 2)
|
||||||
|
{
|
||||||
|
skipcount = random.Next(0, count - 1);
|
||||||
|
}
|
||||||
|
if (count == 0)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
task = await query
|
task = await query
|
||||||
.Select(x => new GetReadingTaskDto()
|
.Select(x => new GetReadingTaskDto()
|
||||||
{
|
{
|
||||||
|
@ -3155,6 +3178,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//触发任务随机编号
|
||||||
|
|
||||||
|
await _downloadAndUploadService.SubejctRandomReadingTaskNameDeal(task.SubjectId, task.TrialReadingCriterionId);
|
||||||
|
|
||||||
|
task.TaskBlindName = await _visitTaskRepository.Where(t => t.Id == task.VisitTaskId).Select(t => t.TaskBlindName).FirstOrDefaultAsync() ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
if (task.SubjectCode.IsNullOrEmpty())
|
if (task.SubjectCode.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
|
@ -3235,7 +3266,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
task.SubjectCode = blindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : blindSubjectCode;
|
task.SubjectCode = blindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : blindSubjectCode;
|
||||||
task.ExistsManual = (await GetManualList(new GetManualListInDto() { TrialId = visitTaskInfo.TrialId })).Count > 0;
|
task.ExistsManual = (await GetManualList(new GetManualListInDto() { TrialId = visitTaskInfo.TrialId })).Count > 0;
|
||||||
task.ReadingTaskState = visitTaskInfo.ReadingTaskState;
|
task.ReadingTaskState = visitTaskInfo.ReadingTaskState;
|
||||||
task.IsShowStudyName= trialInfo.IsShowStudyName;
|
task.IsShowStudyName = trialInfo.IsShowStudyName;
|
||||||
task.IsBaseLine = isBaseLine;
|
task.IsBaseLine = isBaseLine;
|
||||||
task.ReadingVersionEnum = criterionInfo.ReadingVersionEnum;
|
task.ReadingVersionEnum = criterionInfo.ReadingVersionEnum;
|
||||||
task.ReadingToolList = criterionInfo.ReadingToolList;
|
task.ReadingToolList = criterionInfo.ReadingToolList;
|
||||||
|
@ -3271,7 +3302,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||||
await _readingTaskQuestionMarkRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
await _readingTaskQuestionMarkRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||||
await _readingCustomTagRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
await _readingCustomTagRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
|
||||||
{
|
{
|
||||||
ReadingTaskState = ReadingTaskState.WaitReading
|
ReadingTaskState = ReadingTaskState.WaitReading
|
||||||
});
|
});
|
||||||
|
@ -3351,7 +3382,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<bool> ResetReadingRestTime(Guid? userRoleId)
|
public async Task<bool> ResetReadingRestTime(Guid? userRoleId)
|
||||||
{
|
{
|
||||||
var roleId = (userRoleId != null && userRoleId != Guid.Empty) ? (Guid) userRoleId : _userInfo.UserRoleId;
|
var roleId = (userRoleId != null && userRoleId != Guid.Empty) ? (Guid)userRoleId : _userInfo.UserRoleId;
|
||||||
|
|
||||||
//int readingMinute = 120; // 为60整数
|
//int readingMinute = 120; // 为60整数
|
||||||
int restMinute = 10; //
|
int restMinute = 10; //
|
||||||
|
|
|
@ -346,7 +346,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var relatedVisitTaskIds = JsonConvert.SerializeObject(relatedVisitTaskIdList);
|
var relatedVisitTaskIds = JsonConvert.SerializeObject(relatedVisitTaskIdList);
|
||||||
|
|
||||||
// 这里先保存 签名的时候 会统一创建关系
|
// 这里先保存 签名的时候 会统一创建关系
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask()
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask()
|
||||||
{
|
{
|
||||||
RelatedVisitTaskIds = relatedVisitTaskIds
|
RelatedVisitTaskIds = relatedVisitTaskIds
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
using IRaCIS.Core.Application.Filter;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
@ -25,6 +27,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IRepository<DicomInstance> _dicomInstanceRepository,
|
IRepository<DicomInstance> _dicomInstanceRepository,
|
||||||
IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository,
|
IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository,
|
||||||
IRepository<ReadingClinicalData> _readingClinicalDataRepository,
|
IRepository<ReadingClinicalData> _readingClinicalDataRepository,
|
||||||
|
IReadingImageTaskService _readingImageTaskService,
|
||||||
IRepository<ReadingPeriodSet> _readingPeriodSetRepository,
|
IRepository<ReadingPeriodSet> _readingPeriodSetRepository,
|
||||||
IRepository<ReadModule> _readModuleRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
IRepository<ReadModule> _readModuleRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
||||||
{
|
{
|
||||||
|
@ -64,7 +67,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var resultlist = await visitQuery.WhereIf(finalVisitNum != null && finalVisitNum != 0, x => x.VisitNum <= finalVisitNum)
|
var resultlist = await visitQuery.WhereIf(finalVisitNum != null && finalVisitNum != 0, x => x.VisitNum <= finalVisitNum)
|
||||||
.Where(x => x.VisitNum > mixReadVisitNum|| x.VisitNum==thisVisitNum)
|
.Where(x => x.VisitNum > mixReadVisitNum|| x.VisitNum==thisVisitNum)
|
||||||
.Where(x => !x.IsBaseLine) // 排除基线
|
//.Where(x => !x.IsBaseLine) // 排除基线
|
||||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
||||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.ImageReading, x => readModulequery.Where(y => y.Id != inDto.Id && y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() == 0)
|
.WhereIf(inDto.ReadingSetType == ReadingSetType.ImageReading, x => readModulequery.Where(y => y.Id != inDto.Id && y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() == 0)
|
||||||
.Select(x => new GetSubjectReadVisitsOutDto()
|
.Select(x => new GetSubjectReadVisitsOutDto()
|
||||||
|
@ -94,6 +97,29 @@ namespace IRaCIS.Core.Application.Service
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadModule_CRCConfirmCanNtoEdit"]);
|
throw new BusinessValidationFailedException(_localizer["ReadModule_CRCConfirmCanNtoEdit"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModule.TrialReadingCriterionId).Select(x => new
|
||||||
|
{
|
||||||
|
x.ReadingType,
|
||||||
|
x.IsArbitrationReading,
|
||||||
|
x.IsReadingPeriod,
|
||||||
|
x.ArbitrationRule,
|
||||||
|
x.IsGlobalReading,
|
||||||
|
x.IsOncologyReading,
|
||||||
|
}).FirstNotNullAsync();
|
||||||
|
|
||||||
|
// 如果生成了 访视级别的阅片期裁判 不让修改
|
||||||
|
if (criterionInfo.IsArbitrationReading && criterionInfo.IsReadingPeriod && !criterionInfo.IsGlobalReading && criterionInfo.ArbitrationRule == ArbitrationRule.Reading)
|
||||||
|
{
|
||||||
|
if (await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == readModule.SubjectVisitId && x.ReadingCategory == ReadingCategory.Judge))
|
||||||
|
{
|
||||||
|
//---当前阅片已生成裁判任务,操作失败。
|
||||||
|
throw new BusinessValidationFailedException(_localizer["ReadModule_JudgeTaskGenerated"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new ReadModule()
|
await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new ReadModule()
|
||||||
{
|
{
|
||||||
SubjectVisitId = inDto.SubjectVisitIdId,
|
SubjectVisitId = inDto.SubjectVisitIdId,
|
||||||
|
@ -499,8 +525,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
#region 方式二
|
#region 方式二
|
||||||
|
|
||||||
var subjectVisitQuery = _subjectVisitRepository.Where(t => t.TrialId == inQuery.TrialId).Where(t => t.IsLostVisit == false)
|
var subjectVisitQuery = _subjectVisitRepository.Where(t => t.TrialId == inQuery.TrialId)/*.Where(t => t.IsLostVisit == false)*/
|
||||||
.Where(sv => sv.Subject.FinalSubjectVisitId == null ? true : sv.VisitNum < sv.Subject.LatestSubjectVisit.VisitNum).Select(sv => new ReadModuleView()
|
.Where(sv => sv.Subject.FinalSubjectVisitId == null ? true : sv.VisitNum <= sv.Subject.LatestSubjectVisit.VisitNum).Select(sv => new ReadModuleView()
|
||||||
{
|
{
|
||||||
Id = sv.Id,
|
Id = sv.Id,
|
||||||
CreateTime = sv.CreateTime,
|
CreateTime = sv.CreateTime,
|
||||||
|
@ -885,7 +911,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var resultlist = await visitQuery.WhereIf(finalVisitNum != 0, x => x.VisitNum <= finalVisitNum)
|
var resultlist = await visitQuery.WhereIf(finalVisitNum != 0, x => x.VisitNum <= finalVisitNum)
|
||||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
||||||
.Where(x => x.VisitNum > maxReadVisitNum)
|
.Where(x => x.VisitNum > maxReadVisitNum)
|
||||||
.Where(x => !x.IsBaseLine) // 排除基线
|
//.Where(x => !x.IsBaseLine) // 排除基线
|
||||||
.Where(x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == inDto.ReadingSetType).Count() == 0).OrderBy(x => finalVisitNum)
|
.Where(x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == inDto.ReadingSetType).Count() == 0).OrderBy(x => finalVisitNum)
|
||||||
.Select(x => new GetSubjectReadVisitsOutDto()
|
.Select(x => new GetSubjectReadVisitsOutDto()
|
||||||
{
|
{
|
||||||
|
@ -954,6 +980,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
&& !x.IsAnalysisCreate && x.TrialReadingCriterionId == dto.TrialReadingCriterionId
|
&& !x.IsAnalysisCreate && x.TrialReadingCriterionId == dto.TrialReadingCriterionId
|
||||||
|
|
||||||
).ToListAsync();
|
).ToListAsync();
|
||||||
|
|
||||||
|
// 生成全局阅片任务 具体是否需要生成在_visitTaskHelpeService里面有逻辑判断
|
||||||
foreach (var taskInfo in taskListInfo)
|
foreach (var taskInfo in taskListInfo)
|
||||||
{
|
{
|
||||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
|
@ -974,6 +1002,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生成裁判任务 是否需要生成函数里面有逻辑判断
|
||||||
|
if (taskListInfo.Count() > 0)
|
||||||
|
{
|
||||||
|
await _readingImageTaskService.TriggerJudgeQuestion(taskListInfo[0].Id);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ModuleTypeEnum.Oncology:
|
case ModuleTypeEnum.Oncology:
|
||||||
|
@ -1066,6 +1101,15 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var readModule = await _readModuleRepository.Where(x => x.Id == readModuleId).FirstNotNullAsync();
|
var readModule = await _readModuleRepository.Where(x => x.Id == readModuleId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModule.TrialReadingCriterionId).Select(x => new
|
||||||
|
{
|
||||||
|
x.ReadingType,
|
||||||
|
x.IsArbitrationReading,
|
||||||
|
x.IsReadingPeriod,
|
||||||
|
x.ArbitrationRule,
|
||||||
|
x.IsGlobalReading,
|
||||||
|
x.IsOncologyReading,
|
||||||
|
}).FirstNotNullAsync();
|
||||||
|
|
||||||
if (await _readingClinicalDataRepository.Where(t => t.ReadingId == readModuleId).AnyAsync(t => t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned))
|
if (await _readingClinicalDataRepository.Where(t => t.ReadingId == readModuleId).AnyAsync(t => t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned))
|
||||||
{
|
{
|
||||||
|
@ -1094,6 +1138,17 @@ namespace IRaCIS.Core.Application.Service
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadModule_TaskGenerated"]);
|
throw new BusinessValidationFailedException(_localizer["ReadModule_TaskGenerated"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果生成了 访视级别的阅片期裁判 不让删除
|
||||||
|
if (criterionInfo.IsArbitrationReading && criterionInfo.IsReadingPeriod && !criterionInfo.IsGlobalReading && criterionInfo.ArbitrationRule == ArbitrationRule.Reading)
|
||||||
|
{
|
||||||
|
if (await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == readModule.SubjectVisitId && x.ReadingCategory == ReadingCategory.Judge))
|
||||||
|
{
|
||||||
|
//---当前阅片已生成裁判任务,操作失败。
|
||||||
|
throw new BusinessValidationFailedException(_localizer["ReadModule_JudgeTaskGenerated"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => readModuleId == x.SouceReadModuleId, x => new VisitTask()
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => readModuleId == x.SouceReadModuleId, x => new VisitTask()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using IRaCIS.Core.Application.Filter;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
@ -17,6 +18,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IRepository<ReadModule> _readModuleRepository,
|
IRepository<ReadModule> _readModuleRepository,
|
||||||
IRepository<VisitStage> _visitStageRepository,
|
IRepository<VisitStage> _visitStageRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
|
IReadingImageTaskService _readingImageTaskService,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
IVisitTaskHelpeService _visitTaskHelpeService,
|
IVisitTaskHelpeService _visitTaskHelpeService,
|
||||||
|
@ -165,6 +167,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
await _readModuleRepository.AddRangeAsync(readModules);
|
||||||
|
|
||||||
|
await _readModuleRepository.SaveChangesAsync();
|
||||||
|
|
||||||
// 判断是否要添加肿瘤学或者全局阅片任务
|
// 判断是否要添加肿瘤学或者全局阅片任务
|
||||||
var subjectVisitIds = readModules.Select(x => x.SubjectVisitId).ToList();
|
var subjectVisitIds = readModules.Select(x => x.SubjectVisitId).ToList();
|
||||||
|
@ -201,6 +206,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据SourceSubjectVisitId 分组
|
||||||
|
var visitTaskid = taskInfoList.GroupBy(x => x.SourceSubjectVisitId).Select(x => x.Max(y => y.Id)).ToList();
|
||||||
|
// 生成裁判任务 是否需要生成函数里面有逻辑判断
|
||||||
|
foreach (var item in visitTaskid)
|
||||||
|
{
|
||||||
|
await _readingImageTaskService.TriggerJudgeQuestion(item);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ReadingSetType.TumorReading:
|
case ReadingSetType.TumorReading:
|
||||||
|
@ -269,7 +282,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
await _readModuleRepository.AddRangeAsync(readModules);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -443,13 +456,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
List<GetReadingVisitListOutDto> result = await _visitStageRepository.Where(x => x.TrialId == inDto.TrialId)
|
List<GetReadingVisitListOutDto> result = await _visitStageRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => globalVisitNum.Contains(x.VisitNum))
|
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => globalVisitNum.Contains(x.VisitNum))
|
||||||
.Where(x => x.VisitNum > 0)// 不能是基线
|
//.Where(x => x.VisitNum > 0)// 不能是基线
|
||||||
.Where(x => x.VisitNum == thisVisitNum || x.VisitNum >= maxVisitNum).Select(x => new GetReadingVisitListOutDto()
|
.Where(x => x.VisitNum == thisVisitNum || x.VisitNum >= maxVisitNum).Select(x => new GetReadingVisitListOutDto()
|
||||||
{
|
{
|
||||||
VisitName = x.VisitName,
|
VisitName = x.VisitName,
|
||||||
VisitNum = x.VisitNum,
|
VisitNum = x.VisitNum,
|
||||||
VisitStageId = x.Id,
|
VisitStageId = x.Id,
|
||||||
}).ToListAsync();
|
}).OrderBy(x=>x.VisitNum).ToListAsync();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -729,6 +729,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]);
|
throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
List<QuestionMark?> questionMarkList = new List<QuestionMark?>() { QuestionMark.FirstMeasurement, QuestionMark.SecondMeasurement, QuestionMark.ThirdMeasurement };
|
||||||
|
var measuredValueList = rowInfo.SelectMany(x => x.TableQuestionList).Where(x =>x.Answer.IsNotNullOrEmpty()&& questionMarkList.Contains(x.QuestionMark)).Select(x => decimal.Parse(x.Answer)).ToList();
|
||||||
|
if (measuredValueList.Any(x => x > 100))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["MRIPDFF_MeasurementGT100"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw new BusinessValidationFailedException(_localizer["MRIPDFF_MeasurementGT100"]);
|
||||||
|
}
|
||||||
|
|
||||||
var notableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsMeasurable && x.Answer.EqEnum(YesOrNoOrNa.No))).ToList();
|
var notableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsMeasurable && x.Answer.EqEnum(YesOrNoOrNa.No))).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -828,7 +828,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
||||||
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
||||||
|
|
||||||
if (inDto.ComputationTrigger != ComputationTrigger.PatchDataStatistics)
|
List< ComputationTrigger > computationTriggers = new List<ComputationTrigger>()
|
||||||
|
{
|
||||||
|
ComputationTrigger.PatchDataStatistics,
|
||||||
|
ComputationTrigger.SaveEICRFQuestions,
|
||||||
|
|
||||||
|
};
|
||||||
|
if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
||||||
{
|
{
|
||||||
// 计算斑块统计数据
|
// 计算斑块统计数据
|
||||||
await this.CalculatePatchDataStatistics(inDto);
|
await this.CalculatePatchDataStatistics(inDto);
|
||||||
|
|
|
@ -261,11 +261,18 @@ namespace IRaCIS.Application.Contracts
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 项目术语配置
|
/// <summary>
|
||||||
|
/// 打开失访可读
|
||||||
|
/// </summary>
|
||||||
|
public bool IsOpenLostVistRead { get; set; } = false;
|
||||||
|
|
||||||
|
|
||||||
|
#region 视图模型返回 项目术语配置 ,实际数据库没有配置
|
||||||
public List<TrialObjectNameConfig> TrialObjectNameList { get; set; }
|
public List<TrialObjectNameConfig> TrialObjectNameList { get; set; }
|
||||||
|
public CollectImagesType CollectImagesEnum { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public CollectImagesType CollectImagesEnum { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialPacsInfo
|
public class TrialPacsInfo
|
||||||
|
|
|
@ -2903,6 +2903,11 @@ public enum PET5PSScore
|
||||||
/// 保存肝脏分段
|
/// 保存肝脏分段
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SaveLiverSegments = 11,
|
SaveLiverSegments = 11,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存eCRF
|
||||||
|
/// </summary>
|
||||||
|
SaveEICRFQuestions=12,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -288,4 +288,13 @@ public class VisitTask : BaseFullAuditEntity
|
||||||
|
|
||||||
[Comment("退回原因")]
|
[Comment("退回原因")]
|
||||||
public string PMBackReason { get; set; }
|
public string PMBackReason { get; set; }
|
||||||
|
|
||||||
|
#region 完全随机增加字段
|
||||||
|
|
||||||
|
[Comment("完全随机阅片号")]
|
||||||
|
public int? RandomOrder { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,29 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 翻译单位
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="answerType">答案类型</param>
|
||||||
|
/// <param name="unit">单位</param>
|
||||||
|
/// <param name="customUnit">自定义单位</param>
|
||||||
|
/// <param name="unitDataList">单位字典</param>
|
||||||
|
/// <param name="answer">答案</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string Translationunit(string answerType, ValueUnit? unit, string customUnit, List<UnitData> unitDataList,string? answer)
|
||||||
|
{
|
||||||
|
if (answerType == "upload")
|
||||||
|
{
|
||||||
|
return "❄❅❆❇❈❉❊";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unit == ValueUnit.Custom)
|
||||||
|
{
|
||||||
|
return answer + customUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
return answer + unitDataList.Where(y => y.Unit == unit).Select(x => x.UnitName).FirstIsNullReturnEmpty();
|
||||||
|
}
|
||||||
public string GetEntityAuditOpt(EntityEntry entityEntry)
|
public string GetEntityAuditOpt(EntityEntry entityEntry)
|
||||||
{
|
{
|
||||||
if (entityEntry.State == EntityState.Added)
|
if (entityEntry.State == EntityState.Added)
|
||||||
|
@ -188,7 +210,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
//TrialDicList = string.Join(",", trialDics)
|
//TrialDicList = string.Join(",", trialDics)
|
||||||
|
|
||||||
ImageFormatListStr = string.Join("|", entity.ImageFormatList),
|
ImageFormatListStr = string.Join("|", entity.ImageFormatList),
|
||||||
StudyNamesStr = string.Join("|", entity.StudyNameList.Where(x => x.IsChoose).Select(x=>_userInfo.IsEn_Us?x.EnName:x.Name )),
|
StudyNamesStr = string.Join("|", entity.StudyNameList.Where(x => x.IsChoose).Select(x => _userInfo.IsEn_Us ? x.EnName : x.Name)),
|
||||||
|
|
||||||
CriterionNames = string.Join(",", criterionNameList.Union(memoryCriterionNameList).Distinct()),
|
CriterionNames = string.Join(",", criterionNameList.Union(memoryCriterionNameList).Distinct()),
|
||||||
|
|
||||||
|
@ -2018,10 +2040,23 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomStudy)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomStudy)))
|
||||||
{
|
{
|
||||||
var type = GetEntityAuditOpt(item);
|
var type = GetEntityAuditOpt(item);
|
||||||
|
var extraIdentification = string.Empty;
|
||||||
|
|
||||||
|
switch (_userInfo.RequestUrl)
|
||||||
|
{
|
||||||
|
case "QCOperation/updateModality":
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator)
|
||||||
|
{
|
||||||
|
extraIdentification = "/2";
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
await InsertInspection<DicomStudy>(item.Entity as DicomStudy, type, x => new InspectionConvertDTO()
|
await InsertInspection<DicomStudy>(item.Entity as DicomStudy, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
ObjectRelationParentId = x.SubjectVisitId
|
ObjectRelationParentId = x.SubjectVisitId,
|
||||||
|
ExtraIndentification = extraIdentification
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3013,6 +3048,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
QuestionId = t.Id,
|
QuestionId = t.Id,
|
||||||
t.DictionaryCode,
|
t.DictionaryCode,
|
||||||
t.Unit,
|
t.Unit,
|
||||||
|
t.CustomUnit,
|
||||||
t.ShowOrder,
|
t.ShowOrder,
|
||||||
AnswerType = t.Type,
|
AnswerType = t.Type,
|
||||||
}).OrderBy(t => t.ShowOrder).ToListAsync();
|
}).OrderBy(t => t.ShowOrder).ToListAsync();
|
||||||
|
@ -3045,8 +3081,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
||||||
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
||||||
t.ReadingQuestionTrial.Unit,
|
t.Unit,
|
||||||
t.ReadingQuestionTrial.CustomUnit,
|
t.CustomUnit,
|
||||||
t.DictionaryCode,
|
t.DictionaryCode,
|
||||||
t.QuestionName,
|
t.QuestionName,
|
||||||
t.QuestionEnName,
|
t.QuestionEnName,
|
||||||
|
@ -3060,7 +3096,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
//如果问题类型是附件 特殊处理 方便前端解析
|
//如果问题类型是附件 特殊处理 方便前端解析
|
||||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer,
|
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
|
||||||
u.QuestionName,
|
u.QuestionName,
|
||||||
u.QuestionEnName,
|
u.QuestionEnName,
|
||||||
u.DictionaryCode,
|
u.DictionaryCode,
|
||||||
|
@ -3091,8 +3127,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
(t, u) =>
|
(t, u) =>
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty()
|
Answer = Translationunit(u.AnswerType, u.Unit,u.CustomUnit, unitDataList, t.Answer),
|
||||||
,
|
|
||||||
u.DictionaryCode,
|
u.DictionaryCode,
|
||||||
u.QuestionName,
|
u.QuestionName,
|
||||||
u.QuestionEnName,
|
u.QuestionEnName,
|
||||||
|
@ -3152,6 +3187,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
|
|
||||||
Unit = (ValueUnit)int.Parse(x.Code),
|
Unit = (ValueUnit)int.Parse(x.Code),
|
||||||
|
UnitName = x.Value.ToString(),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
//获取表格问题名称 组合成数组
|
//获取表格问题名称 组合成数组
|
||||||
|
@ -3160,8 +3196,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
||||||
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
||||||
t.ReadingQuestionTrial.Unit,
|
t.Unit,
|
||||||
t.ReadingQuestionTrial.CustomUnit,
|
t.CustomUnit,
|
||||||
t.DictionaryCode,
|
t.DictionaryCode,
|
||||||
t.QuestionName,
|
t.QuestionName,
|
||||||
t.QuestionEnName,
|
t.QuestionEnName,
|
||||||
|
@ -3197,10 +3233,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
entity.RowMark = entity.OrderMark + entity.RowIndex.GetLesionMark();
|
entity.RowMark = entity.OrderMark + entity.RowIndex.GetLesionMark();
|
||||||
|
|
||||||
|
string extraIdentification = string.Empty;
|
||||||
|
|
||||||
|
var readingQuestion = await _dbContext.ReadingQuestionTrial.Where(t => t.Id == entity.QuestionId).Include(x=>x.ReadingQuestionCriterionTrial).FirstNotNullAsync();
|
||||||
|
if (readingQuestion.ReadingQuestionCriterionTrial.CriterionGroup == CriterionGroup.Nontumorous)
|
||||||
|
{
|
||||||
|
extraIdentification = "/Nontumorous";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await InsertInspection<ReadingTableAnswerRowInfo>(entity, type, x => new InspectionConvertDTO()
|
await InsertInspection<ReadingTableAnswerRowInfo>(entity, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
|
ExtraIndentification = extraIdentification,
|
||||||
VisitTaskId = x.VisitTaskId,
|
VisitTaskId = x.VisitTaskId,
|
||||||
|
|
||||||
ObjectRelationParentId = x.VisitTaskId,
|
ObjectRelationParentId = x.VisitTaskId,
|
||||||
|
@ -3220,7 +3265,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
//如果问题类型是附件 特殊处理 方便前端解析
|
//如果问题类型是附件 特殊处理 方便前端解析
|
||||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty(),
|
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
|
||||||
//t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
|
//t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
|
||||||
u.QuestionName,
|
u.QuestionName,
|
||||||
u.QuestionEnName,
|
u.QuestionEnName,
|
||||||
|
@ -3228,7 +3273,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
u.ShowOrder
|
u.ShowOrder
|
||||||
}
|
}
|
||||||
).OrderBy(t => t.ShowOrder).ToList()
|
).OrderBy(t => t.ShowOrder).ToList()
|
||||||
},_userInfo.AuditIdentification);
|
}, _userInfo.AuditIdentification);
|
||||||
|
|
||||||
|
|
||||||
////添加/修改病灶接口 只会对单个病灶进行操作
|
////添加/修改病灶接口 只会对单个病灶进行操作
|
||||||
|
@ -3489,18 +3534,24 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
isDistinctionInterface = false;
|
|
||||||
switch (_userInfo.RequestUrl)
|
switch (_userInfo.RequestUrl)
|
||||||
{
|
{
|
||||||
//申请重阅
|
//申请重阅
|
||||||
case "VisitTask/applyReReading":
|
case "VisitTask/applyReReading":
|
||||||
|
|
||||||
|
|
||||||
extraIdentification = "/" + (int)entity.ReReadingApplyState;
|
extraIdentification = "/" + (int)entity.ReReadingApplyState;
|
||||||
|
|
||||||
//PM 申请重阅,区分不了是否有SPM参与
|
//PM 申请重阅,区分不了是否有SPM参与
|
||||||
|
|
||||||
if (entity.ReReadingApplyState== ReReadingApplyState.TrialGroupHaveApplyed)
|
if (entity.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||||
{
|
{
|
||||||
var hasSPM = _dbContext.VisitTaskReReading.Any(t => t.OriginalReReadingTaskId == entity.Id);
|
|
||||||
|
//var hasSPM = _dbContext.VisitTaskReReading.Any(t => t.OriginalReReadingTaskId == entity.Id);
|
||||||
|
|
||||||
|
var hasSPM = entitys.Where(x => x.Entity.GetType() == typeof(VisitTaskReReading))
|
||||||
|
.Select(t => t.Entity as VisitTaskReReading).Any(t => t.OriginalReReadingTaskId == entity.Id);
|
||||||
|
|
||||||
|
|
||||||
if (!hasSPM)
|
if (!hasSPM)
|
||||||
{
|
{
|
||||||
|
@ -3515,6 +3566,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
//同意重阅
|
//同意重阅
|
||||||
case "VisitTask/ConfirmReReading":
|
case "VisitTask/ConfirmReReading":
|
||||||
|
|
||||||
|
|
||||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
||||||
{
|
{
|
||||||
extraIdentification = "/" + 1;
|
extraIdentification = "/" + 1;
|
||||||
|
@ -3536,26 +3588,34 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
case "ReadingImageTask/SubmitVisitTaskQuestions":
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//访视任务-- 非Dicom 阅片
|
//访视任务-- 非Dicom 阅片
|
||||||
if (_userInfo.RequestUrl == "ReadingImageTask/SubmitVisitTaskQuestions" && entity.ReadingTaskState != ReadingTaskState.HaveSigned && type == AuditOpt.Update)
|
if (entity.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||||
{
|
{
|
||||||
//提交访视任务的时候 会多次更新同一个记录 只记录最后一次
|
//提交访视任务的时候 会多次更新同一个记录 只记录最后一次
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
//Dicom 阅片 签名
|
//Dicom 阅片 签名
|
||||||
if (_userInfo.RequestUrl == "ReadingImageTask/SubmitDicomVisitTask")
|
case "ReadingImageTask/SubmitDicomVisitTask":
|
||||||
{
|
|
||||||
//跳转阅片结果需要该参数
|
//跳转阅片结果需要该参数
|
||||||
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
||||||
|
|
||||||
obj.SubjectCode = subjectCode;
|
obj.SubjectCode = subjectCode;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "ReadingImageTask/resetReadingTask":
|
||||||
|
//跳转阅片结果需要该参数
|
||||||
|
|
||||||
|
obj.IsReadingReset = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 裁判、肿瘤学、全局 都是通用的
|
#region 裁判、肿瘤学、全局 都是通用的
|
||||||
|
@ -3576,10 +3636,46 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2";
|
obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
//增加进入阅片中的稽查
|
||||||
|
|
||||||
|
//重置阅片也会从待阅片 变为阅片中,因为复制病灶依赖这个改变
|
||||||
|
if (obj.IsReadingReset != true)
|
||||||
|
{
|
||||||
|
if (entity.ReadingTaskState == ReadingTaskState.Reading)
|
||||||
|
{
|
||||||
|
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.ReadingTaskState == ReadingTaskState.WaitReading))
|
||||||
|
{
|
||||||
|
isDistinctionInterface = false;
|
||||||
|
extraIdentification = "/ChangeToReading";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (entity.IsReadClinicalData == true)
|
||||||
|
{
|
||||||
|
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.IsReadClinicalData == false))
|
||||||
|
{
|
||||||
|
isDistinctionInterface = false;
|
||||||
|
extraIdentification = "/ReadClinicalData";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(entity.TaskBlindName.Contains("Timepoint Ran"))
|
||||||
|
{
|
||||||
|
if(_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => !t.TaskBlindName.Contains("Timepoint Ran")))
|
||||||
|
{
|
||||||
|
isDistinctionInterface = false;
|
||||||
|
extraIdentification = "/TriggerSystemBlindingName";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 通过链接跳转 2022 12-19
|
#region 通过链接跳转 2022 12-19
|
||||||
|
@ -3697,7 +3793,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
/// <param name="expression">表达式</param>
|
/// <param name="expression">表达式</param>
|
||||||
/// <param name="otherItem">其他对象</param>
|
/// <param name="otherItem">其他对象</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task InsertInspection<T>(T entityObj, string type, Expression<Func<T, InspectionConvertDTO>> expression = null, object otherItem = null,string auditIdentification = "") where T : Entity
|
public async Task InsertInspection<T>(T entityObj, string type, Expression<Func<T, InspectionConvertDTO>> expression = null, object otherItem = null, string auditIdentification = "") where T : Entity
|
||||||
{
|
{
|
||||||
|
|
||||||
InspectionConvertDTO inspection = new InspectionConvertDTO();
|
InspectionConvertDTO inspection = new InspectionConvertDTO();
|
||||||
|
@ -3924,7 +4020,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
/// 获取稽查记录的标识符 部分业务会进行特殊处理
|
/// 获取稽查记录的标识符 部分业务会进行特殊处理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public string GetInspectionRecordIdentification<T>(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false,string auditIdentification="")
|
public string GetInspectionRecordIdentification<T>(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false, string auditIdentification = "")
|
||||||
{
|
{
|
||||||
//var entityType = _dbContext.Model.FindEntityType(entityObj.GetType());
|
//var entityType = _dbContext.Model.FindEntityType(entityObj.GetType());
|
||||||
//var tableName = entityType.GetTableName();
|
//var tableName = entityType.GetTableName();
|
||||||
|
@ -3943,11 +4039,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
//自定义 标识后面 补充由代码上层的 extraIdentification 附加
|
//自定义 标识后面 补充由代码上层的 extraIdentification 附加
|
||||||
if (isSelfDefine)
|
if (isSelfDefine)
|
||||||
{
|
{
|
||||||
result= $"{_userInfo.RequestUrl}/{entityTypeName}";
|
result = $"{_userInfo.RequestUrl}/{entityTypeName}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result= $"{_userInfo.RequestUrl}/{entityTypeName}/{type}";
|
result = $"{_userInfo.RequestUrl}/{entityTypeName}/{type}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
public string CutOffVisitName { get; set; }
|
public string CutOffVisitName { get; set; }
|
||||||
|
|
||||||
public string SelectResult { get; set; }
|
public string SelectResult { get; set; }
|
||||||
|
|
||||||
|
public bool? IsReadingReset { get;set; }
|
||||||
}
|
}
|
||||||
public class InspectionConvertDTO : DataInspection
|
public class InspectionConvertDTO : DataInspection
|
||||||
{
|
{
|
||||||
|
|
19756
IRaCIS.Core.Infra.EFCore/Migrations/20250613024223_addRandomOrder.Designer.cs
generated
Normal file
19756
IRaCIS.Core.Infra.EFCore/Migrations/20250613024223_addRandomOrder.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,70 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addRandomOrder : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "RandomOrder",
|
||||||
|
table: "VisitTask",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
comment: "完全随机阅片号");
|
||||||
|
|
||||||
|
//migrationBuilder.CreateIndex(
|
||||||
|
// name: "IX_NoneDicomStudy_TrialId",
|
||||||
|
// table: "NoneDicomStudy",
|
||||||
|
// column: "TrialId");
|
||||||
|
|
||||||
|
//migrationBuilder.CreateIndex(
|
||||||
|
// name: "IX_ClinicalForm_ReadingId",
|
||||||
|
// table: "ClinicalForm",
|
||||||
|
// column: "ReadingId");
|
||||||
|
|
||||||
|
//migrationBuilder.AddForeignKey(
|
||||||
|
// name: "FK_ClinicalForm_SubjectVisit_ReadingId",
|
||||||
|
// table: "ClinicalForm",
|
||||||
|
// column: "ReadingId",
|
||||||
|
// principalTable: "SubjectVisit",
|
||||||
|
// principalColumn: "Id");
|
||||||
|
|
||||||
|
//migrationBuilder.AddForeignKey(
|
||||||
|
// name: "FK_NoneDicomStudy_Trial_TrialId",
|
||||||
|
// table: "NoneDicomStudy",
|
||||||
|
// column: "TrialId",
|
||||||
|
// principalTable: "Trial",
|
||||||
|
// principalColumn: "Id",
|
||||||
|
// onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_ClinicalForm_SubjectVisit_ReadingId",
|
||||||
|
table: "ClinicalForm");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_NoneDicomStudy_Trial_TrialId",
|
||||||
|
table: "NoneDicomStudy");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_NoneDicomStudy_TrialId",
|
||||||
|
table: "NoneDicomStudy");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_ClinicalForm_ReadingId",
|
||||||
|
table: "ClinicalForm");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "RandomOrder",
|
||||||
|
table: "VisitTask");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -487,6 +487,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.HasIndex("CreateUserId");
|
b.HasIndex("CreateUserId");
|
||||||
|
|
||||||
|
b.HasIndex("ReadingId");
|
||||||
|
|
||||||
b.HasIndex("SubjectId");
|
b.HasIndex("SubjectId");
|
||||||
|
|
||||||
b.ToTable("ClinicalForm", t =>
|
b.ToTable("ClinicalForm", t =>
|
||||||
|
@ -3287,6 +3289,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.HasIndex("SubjectVisitId");
|
b.HasIndex("SubjectVisitId");
|
||||||
|
|
||||||
|
b.HasIndex("TrialId");
|
||||||
|
|
||||||
b.ToTable("NoneDicomStudy", t =>
|
b.ToTable("NoneDicomStudy", t =>
|
||||||
{
|
{
|
||||||
t.HasComment("影像 - 非dicom检查");
|
t.HasComment("影像 - 非dicom检查");
|
||||||
|
@ -14390,6 +14394,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasColumnType("nvarchar(2000)")
|
.HasColumnType("nvarchar(2000)")
|
||||||
.HasComment("既往任务Id 不包括自己");
|
.HasComment("既往任务Id 不包括自己");
|
||||||
|
|
||||||
|
b.Property<int?>("RandomOrder")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasComment("完全随机阅片号");
|
||||||
|
|
||||||
b.Property<int>("ReReadingApplyState")
|
b.Property<int>("ReReadingApplyState")
|
||||||
.HasColumnType("int")
|
.HasColumnType("int")
|
||||||
.HasComment("重阅状态");
|
.HasComment("重阅状态");
|
||||||
|
@ -14867,6 +14875,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.SubjectVisit", "SubjectVisit")
|
||||||
|
.WithMany("ClinicalFormList")
|
||||||
|
.HasForeignKey("ReadingId");
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.Subject", "Subject")
|
b.HasOne("IRaCIS.Core.Domain.Models.Subject", "Subject")
|
||||||
.WithMany("ClinicalFormList")
|
.WithMany("ClinicalFormList")
|
||||||
.HasForeignKey("SubjectId")
|
.HasForeignKey("SubjectId")
|
||||||
|
@ -14878,6 +14890,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
b.Navigation("Subject");
|
b.Navigation("Subject");
|
||||||
|
|
||||||
|
b.Navigation("SubjectVisit");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
|
||||||
|
@ -15467,6 +15481,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.Trial", null)
|
||||||
|
.WithMany("NoneDicomStudyList")
|
||||||
|
.HasForeignKey("TrialId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
b.Navigation("Subject");
|
b.Navigation("Subject");
|
||||||
|
@ -16573,7 +16593,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.VisitTask", "VisitTask")
|
b.HasOne("IRaCIS.Core.Domain.Models.VisitTask", "VisitTask")
|
||||||
.WithMany()
|
.WithMany("ReadingTaskQuestionMarkList")
|
||||||
.HasForeignKey("VisitTaskId")
|
.HasForeignKey("VisitTaskId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
@ -19241,6 +19261,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
{
|
{
|
||||||
b.Navigation("CheckChallengeDialogList");
|
b.Navigation("CheckChallengeDialogList");
|
||||||
|
|
||||||
|
b.Navigation("ClinicalFormList");
|
||||||
|
|
||||||
b.Navigation("NoneDicomStudyList");
|
b.Navigation("NoneDicomStudyList");
|
||||||
|
|
||||||
b.Navigation("PreviousHistoryList");
|
b.Navigation("PreviousHistoryList");
|
||||||
|
@ -19309,6 +19331,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Navigation("EnrollList");
|
b.Navigation("EnrollList");
|
||||||
|
|
||||||
|
b.Navigation("NoneDicomStudyList");
|
||||||
|
|
||||||
b.Navigation("ReadModuleList");
|
b.Navigation("ReadModuleList");
|
||||||
|
|
||||||
b.Navigation("ReadingClinicalDataList");
|
b.Navigation("ReadingClinicalDataList");
|
||||||
|
@ -19436,6 +19460,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Navigation("ReadingTaskQuestionAnswerList");
|
b.Navigation("ReadingTaskQuestionAnswerList");
|
||||||
|
|
||||||
|
b.Navigation("ReadingTaskQuestionMarkList");
|
||||||
|
|
||||||
b.Navigation("TaskInfluenceList");
|
b.Navigation("TaskInfluenceList");
|
||||||
|
|
||||||
b.Navigation("TaskMedicalReviewList");
|
b.Navigation("TaskMedicalReviewList");
|
||||||
|
|
|
@ -35,15 +35,19 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
Task<bool> UpdateAsync(TEntity entity, Expression<Func<TEntity, TEntity>> updateFactory,
|
Task<bool> UpdateAsync(TEntity entity, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, CancellationToken cancellationToken = default);
|
bool autoSave = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary> EF跟踪方式 会去数据库查询完整的实体,再更新部分字段 </summary>
|
/// <summary> EF跟踪方式 会去数据库查询完整的实体,再更新部分字段 一定会产生更新sql </summary>
|
||||||
Task<TEntity> UpdatePartialFromQueryAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
Task<TEntity> UpdatePartialFromQueryAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, CancellationToken cancellationToken = default);
|
bool autoSave = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary> 稽查用这个 EF跟踪方式 先查询出来所有实体,再更新部分字段 </summary>
|
/// <summary> 稽查用这个 EF跟踪方式 先查询出来所有实体,再更新部分字段 一定会产生更新sql</summary>
|
||||||
Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
||||||
Expression<Func<TEntity, TEntity>> updateFactory,
|
Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default);
|
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
|
/// <summary> EF跟踪方式 会去数据库查询完整的实体,再更新部分字段 根据是否修改了字段ef 自动判断是否生成sql</summary>
|
||||||
|
Task<TEntity> UpdatePartialFromEFAutoAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
|
bool autoSave = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
||||||
using Microsoft.EntityFrameworkCore.Query;
|
using Microsoft.EntityFrameworkCore.Query;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore
|
namespace IRaCIS.Core.Infra.EFCore
|
||||||
{
|
{
|
||||||
|
@ -167,6 +168,36 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
return searchEntity;
|
return searchEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<TEntity> UpdatePartialFromEFAutoAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
|
bool autoSave = false, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var searchEntity = await _dbSet.FindAsync(id);
|
||||||
|
|
||||||
|
if (searchEntity == null)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(I18n.T("Repository_UpdateError"));
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = ((MemberInitExpression)updateFactory.Body).Bindings.Select(mb => mb.Member.Name)
|
||||||
|
.Select(propName => typeof(TEntity).GetProperty(propName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)).ToList();
|
||||||
|
|
||||||
|
Func<TEntity, TEntity> func = updateFactory.Compile();
|
||||||
|
|
||||||
|
TEntity applyObj = func(searchEntity);
|
||||||
|
|
||||||
|
foreach (PropertyInfo prop in list)
|
||||||
|
{
|
||||||
|
object value = prop.GetValue(applyObj);
|
||||||
|
prop.SetValue(searchEntity, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
await SaveChangesAsync(autoSave);
|
||||||
|
|
||||||
|
return searchEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
public async Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
||||||
Expression<Func<TEntity, TEntity>> updateFactory,
|
Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default)
|
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default)
|
||||||
|
@ -191,6 +222,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>EF跟踪方式 删除</summary>
|
/// <summary>EF跟踪方式 删除</summary>
|
||||||
public async Task<bool> DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default)
|
public async Task<bool> DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
|
|
|
@ -232,6 +232,10 @@ public static class StaticData
|
||||||
|
|
||||||
public const string TrialReadingTaskList_Export = "TrialReadingTaskList_Export";
|
public const string TrialReadingTaskList_Export = "TrialReadingTaskList_Export";
|
||||||
|
|
||||||
|
public const string TrialTaskRandomOrderList_Export = "TrialTaskRandomOrderList_Export";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public const string TrialReReadingTaskList_Export = "TrialReReadingTaskList_Export";
|
public const string TrialReReadingTaskList_Export = "TrialReReadingTaskList_Export";
|
||||||
|
|
||||||
public const string TrialMedicalReviewList_Export = "TrialMedicalReviewList_Export";
|
public const string TrialMedicalReviewList_Export = "TrialMedicalReviewList_Export";
|
||||||
|
|
Loading…
Reference in New Issue