Uat_Study
hang 2023-03-24 10:57:29 +08:00
commit d654775cce
8 changed files with 76 additions and 18 deletions

View File

@ -126,7 +126,7 @@ namespace IRaCIS.Core.Application.Filter
//有可能匹配错误 "trialId":"","documentId":"b8180000-3e2c-0016-9fe0-08da33f96236" 从缓存里面验证下 //有可能匹配错误 "trialId":"","documentId":"b8180000-3e2c-0016-9fe0-08da33f96236" 从缓存里面验证下
var cacheResultDic = _provider.GetAll<string>(new[] { matchResult.Value }); var cacheResultDic = _provider.GetAll<string>(new[] { matchResult.Value });
var trialStatusStr = cacheResultDic[matchResult.Value].Value; var trialStatusStr = cacheResultDic[matchResult.Value.ToLower()].Value;
if (!string.IsNullOrWhiteSpace(trialStatusStr)) if (!string.IsNullOrWhiteSpace(trialStatusStr))
{ {

View File

@ -3299,6 +3299,11 @@
CreateUserId CreateUserId
</summary> </summary>
</member> </member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableAnswerRowInfoBase.FromMark">
<summary>
来自于哪个标记
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CopyTableAnswerDto.QuestionMark"> <member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CopyTableAnswerDto.QuestionMark">
<summary> <summary>
问题标识 问题标识

View File

@ -205,6 +205,10 @@ namespace IRaCIS.Core.Application.ViewModel
public List<ReadingCategory> ReadingCategoryList { get; set; } public List<ReadingCategory> ReadingCategoryList { get; set; }
} }
public class ConvertedRowInfo : ReadingTableAnswerRowInfo
{
public Guid OriginalId { get; set; }
}
public class GenerateTaskCommand public class GenerateTaskCommand
{ {
public Guid TrialId { get; set; } public Guid TrialId { get; set; }

View File

@ -16,6 +16,7 @@ using MassTransit;
using IRaCIS.Core.Infra.EFCore.Common; using IRaCIS.Core.Infra.EFCore.Common;
using System.Linq.Expressions; using System.Linq.Expressions;
using IRaCIS.Core.Domain.Share.Reading; using IRaCIS.Core.Domain.Share.Reading;
using IRaCIS.Core.Application.Service.Reading.Dto;
namespace IRaCIS.Core.Application.Service namespace IRaCIS.Core.Application.Service
{ {
@ -36,7 +37,9 @@ namespace IRaCIS.Core.Application.Service
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository; private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
private readonly IRepository<SubjectUser> _subjectUserRepository; private readonly IRepository<SubjectUser> _subjectUserRepository;
private readonly IRepository<ReadModule> _readModuleRepository; private readonly IRepository<ReadModule> _readModuleRepository;
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
private readonly IMapper _mapper; private readonly IMapper _mapper;
private readonly IUserInfo _userInfo; private readonly IUserInfo _userInfo;
private readonly IRepository<VisitTaskReReading> _visitTaskReReadingRepository; private readonly IRepository<VisitTaskReReading> _visitTaskReReadingRepository;
@ -52,6 +55,9 @@ namespace IRaCIS.Core.Application.Service
public VisitTaskHelpeService(IRepository<VisitTask> visitTaskRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<Trial> trialRepository, IEasyCachingProvider provider, public VisitTaskHelpeService(IRepository<VisitTask> visitTaskRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<Trial> trialRepository, IEasyCachingProvider provider,
IRepository<SubjectVisit> subjectVisitRepository, IRepository<SubjectVisit> subjectVisitRepository,
IRepository<ReadModule> readModuleRepository, IRepository<ReadModule> readModuleRepository,
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository,
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
IRepository<ReadingJudgeInfo> readingJudgeInfoRepository, IRepository<ReadingJudgeInfo> readingJudgeInfoRepository,
IRepository<TaskAllocationRule> taskAllocationRuleRepository, IMapper mapper, IUserInfo userInfo, IRepository<VisitTaskReReading> visitTaskReReadingRepository, IRepository<TaskAllocationRule> taskAllocationRuleRepository, IMapper mapper, IUserInfo userInfo, IRepository<VisitTaskReReading> visitTaskReReadingRepository,
IRepository<ReadingQuestionCriterionTrial> trialReadingCriterionRepository, IRepository<ClinicalDataTrialSet> trialClinicalDataSetRepository, IRepository<ReadingClinicalData> readingClinicalDataRepository, IRepository<ReadingQuestionCriterionTrial> trialReadingCriterionRepository, IRepository<ClinicalDataTrialSet> trialClinicalDataSetRepository, IRepository<ReadingClinicalData> readingClinicalDataRepository,
@ -63,6 +69,9 @@ namespace IRaCIS.Core.Application.Service
_visitTaskRepository = visitTaskRepository; _visitTaskRepository = visitTaskRepository;
_trialRepository = trialRepository; _trialRepository = trialRepository;
this._readModuleRepository = readModuleRepository; this._readModuleRepository = readModuleRepository;
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
this._readingTableQuestionAnswerRepository = readingTableQuestionAnswerRepository;
_provider = provider; _provider = provider;
_subjectVisitRepository = subjectVisitRepository; _subjectVisitRepository = subjectVisitRepository;
this._readingJudgeInfoRepository = readingJudgeInfoRepository; this._readingJudgeInfoRepository = readingJudgeInfoRepository;
@ -100,7 +109,7 @@ namespace IRaCIS.Core.Application.Service
public async Task AddConvertedTask(Guid taskId) public async Task AddConvertedTask(Guid taskId)
{ {
var taskInfo = await _visitTaskRepository.Where(x => x.Id == taskId).IgnoreAutoIncludes().AsNoTracking().FirstNotNullAsync(); var taskInfo = await _visitTaskRepository.Where(x => x.Id == taskId).IgnoreAutoIncludes().AsNoTracking().FirstNotNullAsync();
taskInfo.ReadingTaskState = ReadingTaskState.WaitReading; taskInfo.ReadingTaskState = ReadingTaskState.Reading;
taskInfo.IsConvertedTask = true; taskInfo.IsConvertedTask = true;
taskInfo.BeforeConvertedTaskId = taskId; taskInfo.BeforeConvertedTaskId = taskId;
taskInfo.Id = NewId.NextGuid(); taskInfo.Id = NewId.NextGuid();
@ -125,6 +134,46 @@ namespace IRaCIS.Core.Application.Service
TaskState = TaskState.Freeze TaskState = TaskState.Freeze
}); });
var taskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == taskId && x.ReadingQuestionTrial.Type != "calculation").IgnoreAutoIncludes().AsNoTracking().ToListAsync();
taskAnswer.ForEach(x => {
x.VisitTaskId = taskInfo.Id;
x.Id= NewId.NextGuid();
});
var tableRowAnswers = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == taskId).AsNoTracking().ProjectTo<CopyTableAnswerRowInfo>(_mapper.ConfigurationProvider).IgnoreAutoIncludes().ToListAsync();
tableRowAnswers.ForEach(x =>
{
x.VisitTaskId = taskInfo.Id;
x.IsCurrentTaskAdd = false;
x.isf
x.Id = NewId.NextGuid();
});
tableRowAnswers.ForEach(x =>
{
x.SplitRowId = tableRowAnswers.Where(y => y.OriginalId == x.SplitRowId).Select(y => y.Id).FirstOrDefault();
x.MergeRowId = tableRowAnswers.Where(y => y.OriginalId == x.MergeRowId).Select(y => y.Id).FirstOrDefault();
});
var tableAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == taskId).IgnoreAutoIncludes().AsNoTracking().ToListAsync();
tableAnswer.ForEach(x =>
{
x.Id = NewId.NextGuid();
x.VisitTaskId = taskInfo.Id;
x.RowId = tableRowAnswers.Where(y => y.OriginalId == x.RowId).Select(x => x.Id).FirstOrDefault();
});
var addrowInfo = _mapper.Map<List<ReadingTableAnswerRowInfo>>(tableRowAnswers);
await _readingTaskQuestionAnswerRepository.AddRangeAsync(taskAnswer);
await _readingTableAnswerRowInfoRepository.AddRangeAsync(addrowInfo);
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswer);
await _visitTaskRepository.SaveChangesAsync(); await _visitTaskRepository.SaveChangesAsync();
} }

View File

@ -12,6 +12,11 @@ namespace IRaCIS.Core.Application.Service
public AllocationConfig() public AllocationConfig()
{ {
CreateMap<ReadingTableAnswerRowInfo, ConvertedRowInfo>()
.ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id));
CreateMap<ConvertedRowInfo, ReadingTableAnswerRowInfo>();
CreateMap<TaskAllocationRule, TaskAllocationRuleView>() CreateMap<TaskAllocationRule, TaskAllocationRuleView>()
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode)) .ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))

View File

@ -173,7 +173,8 @@ namespace IRaCIS.Application.Services
{ {
if (await _readingCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id)) if (await _readingCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id))
{ {
return ResponseOutput.NotOk("当前字典在标准中被引用,不允许删除!"); await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.DictionaryId == id);
//return ResponseOutput.NotOk("当前字典在标准中被引用,不允许删除!");
} }
if (await _dicRepository.AnyAsync(t => t.ParentId == id)) if (await _dicRepository.AnyAsync(t => t.ParentId == id))
@ -197,7 +198,8 @@ namespace IRaCIS.Application.Services
if (await _readingCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id)) if (await _readingCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id))
{ {
return ResponseOutput.NotOk("当前条目已经在阅片标准中被引用。"); await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.DictionaryId == id);
//return ResponseOutput.NotOk("当前条目已经在阅片标准中被引用。");
} }
var success = await _dicRepository.BatchDeleteNoTrackingAsync(t => t.Id == id); var success = await _dicRepository.BatchDeleteNoTrackingAsync(t => t.Id == id);

View File

@ -543,7 +543,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid? DeleteUserId { get; set; } public Guid? DeleteUserId { get; set; }
/// <summary>
/// 来自于哪个标记
/// </summary>
public string FromMark { get; set; } = string.Empty;
public string RowMark { get; set; } = string.Empty; public string RowMark { get; set; } = string.Empty;
} }

View File

@ -718,17 +718,7 @@ namespace IRaCIS.Application.Services
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
if (taskInfo.IsConvertedTask && if (taskInfo.IsConvertedTask &&taskInfo.BeforeConvertedTaskId!=null)
!(await _visitTaskRepository.AnyAsync(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate
&& x.IsSelfAnalysis == taskInfo.IsSelfAnalysis
&& x.VisitTaskNum < taskInfo.VisitTaskNum
&& x.DoctorUserId == taskInfo.DoctorUserId
&& x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
&& !x.IsConvertedTask
&& x.SubjectId == taskInfo.SubjectId
&& x.ArmEnum == taskInfo.ArmEnum &&
x.TaskState == TaskState.Effect))
)
{ {
result.ForEach(x => result.ForEach(x =>
{ {
@ -1153,7 +1143,7 @@ namespace IRaCIS.Application.Services
}); });
answers.Add("LesionType", rowInfo.LesionType.ToString());
answers.Add("BlindName", rowInfo.BlindName); answers.Add("BlindName", rowInfo.BlindName);
answers.Add("IsFirstChangeTask", isFirstChangeTask.ToString()); answers.Add("IsFirstChangeTask", isFirstChangeTask.ToString());
answers.Add("FromMark", rowInfo.FromMark); answers.Add("FromMark", rowInfo.FromMark);