Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
commit
3529ab6cb6
|
@ -419,13 +419,30 @@ namespace IRaCIS.Core.API.Controllers
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重置并同步项目阅片标准
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/ReadingCriterion/ResetAndAsyncCriterion")]
|
||||
[UnitOfWork]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
|
||||
/// <summary>
|
||||
/// CRC RequestToQC 批量提交
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/QCOperation/CRCRequestToQC")]
|
||||
public async Task<IResponseOutput> ResetAndAsyncCriterion(DataInspectionDto<ResetAndAsyncCriterionInDto> opt)
|
||||
{
|
||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||
var result = await _trialConfigService.ResetAndAsyncCriterion(opt.Data);
|
||||
await _inspectionService.CompletedSign(singid, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CRC RequestToQC 批量提交
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/QCOperation/CRCRequestToQC")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> CRCRequestToQC(DataInspectionDto<CRCRequestToQCCommand> opt)
|
||||
|
|
|
@ -208,6 +208,12 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.ResetAndAsyncCriterion(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.ResetAndAsyncCriterionInDto})">
|
||||
<summary>
|
||||
重置并同步项目阅片标准
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.CRCRequestToQC(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Contracts.CRCRequestToQCCommand})">
|
||||
<summary>
|
||||
CRC RequestToQC 批量提交
|
||||
|
|
|
@ -11923,6 +11923,13 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.ResetAndAsyncCriterion(IRaCIS.Core.Application.Service.Reading.Dto.ResetAndAsyncCriterionInDto)">
|
||||
<summary>
|
||||
重置并同步标准
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.AsyncTrialCriterionDictionary(IRaCIS.Core.Application.Contracts.AsyncTrialCriterionDictionaryInDto)">
|
||||
<summary>
|
||||
同步项目标准字典信息
|
||||
|
|
|
@ -232,6 +232,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public List<string> CodeList { get; set; }
|
||||
}
|
||||
|
||||
public class ResetAndAsyncCriterionInDto
|
||||
{
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
}
|
||||
public class ResetAndAsyncCriterionOutDto
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class SetSystemGlobalInfoInDto
|
||||
{
|
||||
|
|
|
@ -5,6 +5,8 @@ using IRaCIS.Core.Infrastructure;
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using Panda.DynamicWebApi.Attributes;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.RC
|
||||
{
|
||||
|
@ -22,7 +24,8 @@ namespace IRaCIS.Core.Application.Service.RC
|
|||
private readonly IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository;
|
||||
private readonly IRepository<ReadingTrialCriterionDictionary> _readingTrialCriterionDictionaryRepository;
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<SystemCriterionDictionaryCode> _systemCriterionDictionaryCodeRepository;
|
||||
private readonly ITrialConfigService _trialConfigService;
|
||||
private readonly IRepository<SystemCriterionDictionaryCode> _systemCriterionDictionaryCodeRepository;
|
||||
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
|
||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||
|
||||
|
@ -35,7 +38,8 @@ namespace IRaCIS.Core.Application.Service.RC
|
|||
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
||||
IRepository<ReadingTrialCriterionDictionary> readingTrialCriterionDictionaryRepository,
|
||||
IRepository<VisitTask> visitTaskRepository,
|
||||
IRepository<SystemCriterionDictionaryCode> systemCriterionDictionaryCodeRepository,
|
||||
ITrialConfigService trialConfigService,
|
||||
IRepository<SystemCriterionDictionaryCode> systemCriterionDictionaryCodeRepository,
|
||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||
|
@ -50,7 +54,8 @@ namespace IRaCIS.Core.Application.Service.RC
|
|||
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
|
||||
this._readingTrialCriterionDictionaryRepository = readingTrialCriterionDictionaryRepository;
|
||||
this._visitTaskRepository = visitTaskRepository;
|
||||
this._systemCriterionDictionaryCodeRepository = systemCriterionDictionaryCodeRepository;
|
||||
this._trialConfigService = trialConfigService;
|
||||
this._systemCriterionDictionaryCodeRepository = systemCriterionDictionaryCodeRepository;
|
||||
this._readingTableQuestionAnswerRepository = readingTableQuestionAnswerRepository;
|
||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||
this._readingTaskQuestionAnswer = readingTaskQuestionAnswer;
|
||||
|
@ -123,12 +128,13 @@ namespace IRaCIS.Core.Application.Service.RC
|
|||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置系统全局阅片阅片信息
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
|
||||
/// <summary>
|
||||
/// 设置系统全局阅片阅片信息
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> SetSystemGlobalInfo(SetSystemGlobalInfoInDto inDto)
|
||||
{
|
||||
|
|
|
@ -2968,7 +2968,7 @@ namespace IRaCIS.Application.Services
|
|||
typeChangeDic.Add(ModuleTypeEnum.Referee, ReadingCategory.Judge);
|
||||
typeChangeDic.Add(ModuleTypeEnum.Oncology, ReadingCategory.Oncology);
|
||||
#endregion
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
List<ReadingGenerataTaskDTO> needReadList = new List<ReadingGenerataTaskDTO>();
|
||||
if (!taskInfo.IsAnalysisCreate)
|
||||
{
|
||||
|
@ -2988,7 +2988,10 @@ namespace IRaCIS.Application.Services
|
|||
ReadModuleId = x.Id,
|
||||
ReadingCategory = typeChangeDic[x.ModuleType],
|
||||
}).ToListAsync();
|
||||
if (needReadList.Any(x => x.ReadingCategory == ReadingCategory.Global))
|
||||
|
||||
|
||||
|
||||
if (needReadList.Any(x => x.ReadingCategory == ReadingCategory.Global)&& taskInfo.TrialReadingCriterion.IsGlobalReading)
|
||||
{
|
||||
needReadList = needReadList.Where(x => x.ReadingCategory != ReadingCategory.Oncology).ToList();
|
||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||
|
@ -3002,7 +3005,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
else if (needReadList.Any(x => x.ReadingCategory == ReadingCategory.Oncology))
|
||||
{
|
||||
// 添加肿瘤学
|
||||
// 添加肿瘤学
|
||||
if (await _visitTaskRepository.AnyAsync(x => x.Id == visitTaskId && x.JudgeVisitTaskId == null))
|
||||
{
|
||||
await AddOncologyTask(needReadList.First().ReadModuleId);
|
||||
|
|
|
@ -376,41 +376,75 @@ namespace IRaCIS.Application.Services
|
|||
if (readModuleInfo != null)
|
||||
{
|
||||
// 先找到对应的全局阅片模块Id
|
||||
var globalreadModuleId = await _readModuleRepository.Where(x => x.SubjectVisitId == readModuleInfo.SubjectVisitId &&
|
||||
var globalreadModule = await _readModuleRepository.Where(x => x.SubjectVisitId == readModuleInfo.SubjectVisitId &&
|
||||
x.TrialReadingCriterionId== readModuleInfo.TrialReadingCriterionId&&
|
||||
x.ModuleType == ModuleTypeEnum.Global).Include(x=>x.SubjectVisit).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
|
||||
// 找到一个全局阅片任务是否有裁判任务
|
||||
|
||||
var judgeVisitTaskId = await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalreadModuleId && x.TaskState == TaskState.Effect
|
||||
&& x.ReadingCategory == ReadingCategory.Global
|
||||
&& x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.JudgeVisitTaskId).FirstOrDefaultAsync();
|
||||
|
||||
// 要判断是否为老裁判任务的Id
|
||||
if (judgeVisitTaskId != null)
|
||||
x.ModuleType == ModuleTypeEnum.Global).Include(x=>x.SubjectVisit).FirstOrDefaultAsync();
|
||||
// 获取系统配置
|
||||
var readingType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModuleInfo.TrialReadingCriterionId).Select(x => x.ReadingType).FirstOrDefaultAsync();
|
||||
if (globalreadModule != null)
|
||||
{
|
||||
// 如果不存在有效的裁判
|
||||
if (!(await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId && x.TaskState == TaskState.Effect)))
|
||||
// 找到一个全局阅片任务是否有裁判任务
|
||||
|
||||
var judgeVisitTaskId = await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalreadModule.Id && x.TaskState == TaskState.Effect
|
||||
&& x.ReadingCategory == ReadingCategory.Global
|
||||
&& x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.JudgeVisitTaskId).FirstOrDefaultAsync();
|
||||
|
||||
// 要判断是否为老裁判任务的Id
|
||||
if (judgeVisitTaskId != null)
|
||||
{
|
||||
judgeVisitTaskId = null;
|
||||
// 如果不存在有效的裁判
|
||||
if (!(await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId && x.TaskState == TaskState.Effect)))
|
||||
{
|
||||
judgeVisitTaskId = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 判断阅片是否完成
|
||||
if (judgeVisitTaskId == null && (await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalreadModule.Id && x.TaskState == TaskState.Effect && x.ReadingCategory == ReadingCategory.Global
|
||||
&& x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate && x.TrialReadingCriterionId == readModuleInfo.TrialReadingCriterionId
|
||||
).CountAsync() == (int)readingType))
|
||||
{
|
||||
|
||||
finishReading = true;
|
||||
}
|
||||
else if (judgeVisitTaskId != null && (await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId.Value && x.JudgeResultTaskId != null && x.ReadingTaskState == ReadingTaskState.HaveSigned)))
|
||||
{
|
||||
finishReading = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取系统配置
|
||||
var readingType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModuleInfo.TrialReadingCriterionId).Select(x => x.ReadingType).FirstOrDefaultAsync();
|
||||
else {
|
||||
|
||||
// 判断阅片是否完成
|
||||
if (judgeVisitTaskId == null && (await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalreadModuleId && x.TaskState == TaskState.Effect && x.ReadingCategory == ReadingCategory.Global
|
||||
&& x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate && x.TrialReadingCriterionId == readModuleInfo.TrialReadingCriterionId
|
||||
).CountAsync() == (int)readingType))
|
||||
{
|
||||
var judgeVisitTaskId = await _visitTaskRepository.Where(x => x.SourceSubjectVisitId == readModuleInfo.SubjectVisitId && x.TaskState == TaskState.Effect
|
||||
&&x.TrialReadingCriterionId== readModuleInfo.TrialReadingCriterionId
|
||||
&& x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.JudgeVisitTaskId).FirstOrDefaultAsync();
|
||||
// 要判断是否为老裁判任务的Id
|
||||
if (judgeVisitTaskId != null)
|
||||
{
|
||||
// 如果不存在有效的裁判
|
||||
if (!(await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId && x.TaskState == TaskState.Effect)))
|
||||
{
|
||||
judgeVisitTaskId = null;
|
||||
}
|
||||
}
|
||||
|
||||
finishReading = true;
|
||||
}
|
||||
else if (judgeVisitTaskId != null && (await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId.Value&&x.JudgeResultTaskId!=null && x.ReadingTaskState == ReadingTaskState.HaveSigned)))
|
||||
{
|
||||
finishReading = true;
|
||||
}
|
||||
// 判断阅片是否完成
|
||||
if (judgeVisitTaskId == null && (await _visitTaskRepository.Where(x => x.SourceSubjectVisitId == readModuleInfo.SubjectVisitId && x.TaskState == TaskState.Effect
|
||||
&& x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate && x.TrialReadingCriterionId == readModuleInfo.TrialReadingCriterionId
|
||||
).CountAsync() == (int)readingType))
|
||||
{
|
||||
|
||||
finishReading = true;
|
||||
}
|
||||
else if (judgeVisitTaskId != null && (await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId.Value && x.JudgeResultTaskId != null && x.ReadingTaskState == ReadingTaskState.HaveSigned)))
|
||||
{
|
||||
finishReading = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (finishReading)
|
||||
{
|
||||
|
|
|
@ -303,7 +303,7 @@ namespace IRaCIS.Application.Services
|
|||
var readModulequery = _readModuleRepository.AsQueryable().Where(x=>x.TrialReadingCriterionId == inDto.TrialReadingCriterionId);
|
||||
|
||||
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.IsBaseLine) // 排除基线
|
||||
.Where(x => readModulequery.Where(y => y.SubjectVisitId == x.Id&& y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == inDto.ReadingSetType).Count() == 0).OrderBy(x => finalVisitNum)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using IRaCIS.Core.Application.Contracts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
|
||||
namespace IRaCIS.Application.Interfaces
|
||||
{
|
||||
|
@ -20,6 +21,11 @@ namespace IRaCIS.Application.Interfaces
|
|||
|
||||
Task<IResponseOutput> TrialConfigSignatureConfirm(SignConfirmDTO signConfirmDTO);
|
||||
|
||||
Task<IResponseOutput> AsyncTrialCriterionDictionary(AsyncTrialCriterionDictionaryInDto inDto);
|
||||
|
||||
}
|
||||
Task<IResponseOutput> ResetAndAsyncCriterion(ResetAndAsyncCriterionInDto inDto);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -194,12 +194,33 @@ namespace IRaCIS.Core.Application
|
|||
return trialInfo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 同步项目标准字典信息
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
/// <summary>
|
||||
/// 重置并同步标准
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> ResetAndAsyncCriterion(ResetAndAsyncCriterionInDto inDto)
|
||||
{
|
||||
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial
|
||||
{
|
||||
SynchronizeOriginalTime = null,
|
||||
SynchronizeTime = DateTime.Now.AddYears(-20),
|
||||
IsSigned = false,
|
||||
ReadingInfoSignTime = null,
|
||||
|
||||
});
|
||||
|
||||
await AsyncTrialCriterionDictionary(new AsyncTrialCriterionDictionaryInDto() { TrialReadingCriterionId = inDto.TrialReadingCriterionId });
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 同步项目标准字典信息
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AsyncTrialCriterionDictionary(AsyncTrialCriterionDictionaryInDto inDto)
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue