Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
d654775cce
|
@ -126,7 +126,7 @@ namespace IRaCIS.Core.Application.Filter
|
|||
//有可能匹配错误 "trialId":"","documentId":"b8180000-3e2c-0016-9fe0-08da33f96236" 从缓存里面验证下
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -3299,6 +3299,11 @@
|
|||
CreateUserId
|
||||
</summary>
|
||||
</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">
|
||||
<summary>
|
||||
问题标识
|
||||
|
|
|
@ -205,6 +205,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public List<ReadingCategory> ReadingCategoryList { get; set; }
|
||||
}
|
||||
|
||||
public class ConvertedRowInfo : ReadingTableAnswerRowInfo
|
||||
{
|
||||
public Guid OriginalId { get; set; }
|
||||
}
|
||||
public class GenerateTaskCommand
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
|
|
@ -16,6 +16,7 @@ using MassTransit;
|
|||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using System.Linq.Expressions;
|
||||
using IRaCIS.Core.Domain.Share.Reading;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
@ -36,7 +37,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
|
||||
private readonly IRepository<SubjectUser> _subjectUserRepository;
|
||||
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 IUserInfo _userInfo;
|
||||
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,
|
||||
IRepository<SubjectVisit> subjectVisitRepository,
|
||||
IRepository<ReadModule> readModuleRepository,
|
||||
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository,
|
||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
||||
IRepository<ReadingJudgeInfo> readingJudgeInfoRepository,
|
||||
IRepository<TaskAllocationRule> taskAllocationRuleRepository, IMapper mapper, IUserInfo userInfo, IRepository<VisitTaskReReading> visitTaskReReadingRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> trialReadingCriterionRepository, IRepository<ClinicalDataTrialSet> trialClinicalDataSetRepository, IRepository<ReadingClinicalData> readingClinicalDataRepository,
|
||||
|
@ -63,6 +69,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
_visitTaskRepository = visitTaskRepository;
|
||||
_trialRepository = trialRepository;
|
||||
this._readModuleRepository = readModuleRepository;
|
||||
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
|
||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||
this._readingTableQuestionAnswerRepository = readingTableQuestionAnswerRepository;
|
||||
_provider = provider;
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
this._readingJudgeInfoRepository = readingJudgeInfoRepository;
|
||||
|
@ -100,7 +109,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task AddConvertedTask(Guid taskId)
|
||||
{
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == taskId).IgnoreAutoIncludes().AsNoTracking().FirstNotNullAsync();
|
||||
taskInfo.ReadingTaskState = ReadingTaskState.WaitReading;
|
||||
taskInfo.ReadingTaskState = ReadingTaskState.Reading;
|
||||
taskInfo.IsConvertedTask = true;
|
||||
taskInfo.BeforeConvertedTaskId = taskId;
|
||||
taskInfo.Id = NewId.NextGuid();
|
||||
|
@ -125,6 +134,46 @@ namespace IRaCIS.Core.Application.Service
|
|||
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();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
public AllocationConfig()
|
||||
{
|
||||
|
||||
CreateMap<ReadingTableAnswerRowInfo, ConvertedRowInfo>()
|
||||
.ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id));
|
||||
|
||||
CreateMap<ConvertedRowInfo, ReadingTableAnswerRowInfo>();
|
||||
|
||||
|
||||
CreateMap<TaskAllocationRule, TaskAllocationRuleView>()
|
||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
||||
|
|
|
@ -173,7 +173,8 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
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))
|
||||
|
@ -197,7 +198,8 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
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);
|
||||
|
|
|
@ -543,7 +543,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public Guid? DeleteUserId { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 来自于哪个标记
|
||||
/// </summary>
|
||||
public string FromMark { get; set; } = string.Empty;
|
||||
|
||||
public string RowMark { get; set; } = string.Empty;
|
||||
}
|
||||
|
|
|
@ -718,17 +718,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||
|
||||
if (taskInfo.IsConvertedTask &&
|
||||
!(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))
|
||||
)
|
||||
if (taskInfo.IsConvertedTask &&taskInfo.BeforeConvertedTaskId!=null)
|
||||
{
|
||||
result.ForEach(x =>
|
||||
{
|
||||
|
@ -1153,7 +1143,7 @@ namespace IRaCIS.Application.Services
|
|||
});
|
||||
|
||||
|
||||
|
||||
answers.Add("LesionType", rowInfo.LesionType.ToString());
|
||||
answers.Add("BlindName", rowInfo.BlindName);
|
||||
answers.Add("IsFirstChangeTask", isFirstChangeTask.ToString());
|
||||
answers.Add("FromMark", rowInfo.FromMark);
|
||||
|
|
Loading…
Reference in New Issue