|
|
|
|
@ -4,7 +4,6 @@ using IRaCIS.Core.Application.Filter;
|
|
|
|
|
using IRaCIS.Core.Application.Helper;
|
|
|
|
|
using IRaCIS.Core.Application.Interfaces;
|
|
|
|
|
using IRaCIS.Core.Application.Service.ImageAndDoc;
|
|
|
|
|
using IRaCIS.Core.Application.Service.OAuth;
|
|
|
|
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
|
|
|
|
using IRaCIS.Core.Application.Service.ReadingCalculate.Interface;
|
|
|
|
|
using IRaCIS.Core.Application.ViewModel;
|
|
|
|
|
@ -102,7 +101,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.RowId == mark.RowId && x.TableQuestionId == mark.TableQuestionId);
|
|
|
|
|
await _readingTaskQuestionMarkRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new ReadingTaskQuestionMark()
|
|
|
|
|
{
|
|
|
|
|
InstanceId = null,
|
|
|
|
|
InstanceId=null,
|
|
|
|
|
SeriesId = null,
|
|
|
|
|
StudyId = null,
|
|
|
|
|
MarkTool = string.Empty,
|
|
|
|
|
@ -118,7 +117,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
OtherNumberOfFrames = null,
|
|
|
|
|
OtherMeasureData = string.Empty,
|
|
|
|
|
});
|
|
|
|
|
var result = await _readingTaskQuestionMarkRepository.SaveChangesAsync();
|
|
|
|
|
var result= await _readingTaskQuestionMarkRepository.SaveChangesAsync();
|
|
|
|
|
|
|
|
|
|
await _readingCalculateService.CalculateTask(new CalculateTaskInDto()
|
|
|
|
|
{
|
|
|
|
|
@ -146,7 +145,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
SeriesId = null,
|
|
|
|
|
StudyId = null,
|
|
|
|
|
MarkTool = string.Empty,
|
|
|
|
|
// PicturePath = string.Empty, 稽查需要显示截图
|
|
|
|
|
// PicturePath = string.Empty, 稽查需要显示截图
|
|
|
|
|
NumberOfFrames = null,
|
|
|
|
|
MeasureData = string.Empty,
|
|
|
|
|
OrderMarkName = string.Empty,
|
|
|
|
|
@ -452,7 +451,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// <param name="inDto"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
public async Task ChangeCalculationAnswer(ChangeCalculationAnswerInDto inDto)
|
|
|
|
|
{
|
|
|
|
|
var visitTask = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
|
|
|
|
@ -528,7 +527,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// <param name="inDto"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
public async Task ReadClinicalData(ReadClinicalDataInDto inDto)
|
|
|
|
|
{
|
|
|
|
|
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask
|
|
|
|
|
@ -905,7 +904,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
var criterionIdInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == trialReadingCriterionId).FirstNotNullAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var groupIds = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && (x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.BasicTable)).Select(x => x.GroupId).Distinct().ToListAsync();
|
|
|
|
|
var groupIds = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId &&( x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.BasicTable)).Select(x => x.GroupId).Distinct().ToListAsync();
|
|
|
|
|
|
|
|
|
|
var questionIds = await _readingQuestionTrialRepository
|
|
|
|
|
.Where(x => x.IsShowInDicom)
|
|
|
|
|
@ -1089,7 +1088,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
x.IsFirstChangeTask = x.VisitTaskId == inDto.VisitTaskId;
|
|
|
|
|
});
|
|
|
|
|
result.AddRange(questionMark);
|
|
|
|
|
result = result.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).ThenBy(x => x.OrderMarkName).ToList();
|
|
|
|
|
result= result.OrderBy(x=>x.ShowOrder).ThenBy(x=>x.RowIndex).ThenBy(x => x.OrderMarkName).ToList();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1440,7 +1439,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
item.TableQuestions.Questions = tableQuestionLists.Where(x => x.ReadingQuestionId == item.Id).OrderBy(x => x.ShowOrder).ToList();
|
|
|
|
|
item.TableQuestions.Questions.ForEach(x =>
|
|
|
|
|
{
|
|
|
|
|
x.RelationQuestions = _mapper.Map<List<GetTrialReadingQuestionOutDto>>(tableQuestionLists.Where(z => (z.DependParentId ?? default(Guid)) == x.Id));
|
|
|
|
|
x.RelationQuestions= _mapper.Map<List<GetTrialReadingQuestionOutDto>>(tableQuestionLists.Where(z => (z.DependParentId ?? default(Guid)) == x.Id));
|
|
|
|
|
x.RelationQuestions.ForEach(y =>
|
|
|
|
|
{
|
|
|
|
|
y.Childrens = new List<GetTrialReadingQuestionOutDto>();
|
|
|
|
|
@ -1561,7 +1560,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
{
|
|
|
|
|
FloatParseHandling = FloatParseHandling.Double,
|
|
|
|
|
};
|
|
|
|
|
answers.Add("TableQuestionMarkList", rowInfo == null ? "[]" : JsonConvert.SerializeObject(TableQuestionMarkList.Where(x => x.RowId == rowInfo.Id).ToList(), settings));
|
|
|
|
|
answers.Add("TableQuestionMarkList", rowInfo == null ? "[]" : JsonConvert.SerializeObject(TableQuestionMarkList.Where(x=>x.RowId== rowInfo.Id).ToList(), settings));
|
|
|
|
|
answers.Add("RowId", rowInfo == null ? string.Empty : rowInfo.Id.ToString());
|
|
|
|
|
answers.Add("MarkTool", rowInfo.MarkTool);
|
|
|
|
|
answers.Add("StudyId", rowInfo.StudyId.ToString());
|
|
|
|
|
@ -1610,7 +1609,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
public async Task SplitLesion(SplitLesionInDto inDto)
|
|
|
|
|
{
|
|
|
|
|
await VerifyTaskIsSign(inDto.VisitTaskId);
|
|
|
|
|
@ -1848,7 +1847,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
public async Task<IResponseOutput> SaveImageQuality(ChangeDicomReadingQuestionAnswerInDto inDto)
|
|
|
|
|
{
|
|
|
|
|
inDto.UpdateMark = true;
|
|
|
|
|
@ -1907,7 +1906,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// <param name="inDto"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
public async Task<IResponseOutput> ChangeDicomReadingQuestionAnswer(ChangeDicomReadingQuestionAnswerInDto inDto)
|
|
|
|
|
{
|
|
|
|
|
await VerifyTaskIsSign(inDto.VisitTaskId);
|
|
|
|
|
@ -2024,7 +2023,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// <param name="inDto"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
public async Task<IResponseOutput> DeleteReadingRowAnswer(DeleteReadingRowAnswerInDto inDto)
|
|
|
|
|
{
|
|
|
|
|
await VerifyTaskIsSign(inDto.VisitTaskId);
|
|
|
|
|
@ -2213,7 +2212,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("/SubmitTaskRowInfo/{param}")]
|
|
|
|
|
public async Task<SubmitTableQuestionOutDto> SubmitTaskRowInfo(SubmitTableQuestionInDto inDto, string param)
|
|
|
|
|
public async Task<SubmitTableQuestionOutDto> SubmitTaskRowInfo(SubmitTableQuestionInDto inDto,string param)
|
|
|
|
|
{
|
|
|
|
|
inDto.ComputationTrigger = (ComputationTrigger)int.Parse(param);
|
|
|
|
|
|
|
|
|
|
@ -2227,7 +2226,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// <param name="inDto"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
public async Task<SubmitTableQuestionOutDto> SubmitTableQuestion(SubmitTableQuestionInDto inDto)
|
|
|
|
|
{
|
|
|
|
|
SubmitTableQuestionOutDto result = new SubmitTableQuestionOutDto();
|
|
|
|
|
@ -2414,7 +2413,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
&& x.QuestionId == inDto.QuestionId
|
|
|
|
|
).CountAsync()) + 1))
|
|
|
|
|
{
|
|
|
|
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_MaxQuestion", _userInfo.IsEn_Us ? questionInfo.QuestionEnName : questionInfo.QuestionName, questionInfo.MaxQuestionCount]);
|
|
|
|
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_MaxQuestion", _userInfo.IsEn_Us? questionInfo.QuestionEnName:questionInfo.QuestionName, questionInfo.MaxQuestionCount]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -2626,7 +2625,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="inDto"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
public async Task<IResponseOutput> SubmitDicomVisitTask(SubmitDicomVisitTaskInDto inDto)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
@ -2711,7 +2710,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
|
|
|
|
|
var criterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskInfo.TrialReadingCriterionId).FirstNotNullAsync();
|
|
|
|
|
|
|
|
|
|
var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId && x.Type != "group")
|
|
|
|
|
var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId&&x.Type != "group")
|
|
|
|
|
.WhereIf(taskInfo.SourceSubjectVisit.IsBaseLine, x => ((x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show) && (x.LimitEdit == LimitEdit.None || x.LimitEdit == LimitEdit.OnlyBaseLine)))
|
|
|
|
|
.WhereIf(!taskInfo.SourceSubjectVisit.IsBaseLine, x => ((x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show) && (x.LimitEdit == LimitEdit.None || x.LimitEdit == LimitEdit.OnlyVisit)))
|
|
|
|
|
.WhereIf(taskInfo.TrialReadingCriterion.CriterionType == CriterionType.PCWG3, x => x.QuestionType != QuestionType.SiteVisitForTumorEvaluation)
|
|
|
|
|
@ -2989,7 +2988,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
List<Guid> remainingItems = taskList.Select(x => x.Id).Except(cacheSkipIds).ToList();
|
|
|
|
|
|
|
|
|
|
//受试者随机固定排序
|
|
|
|
|
taskList = taskList.Where(x => remainingItems.Contains(x.Id)).OrderBy(t => t.TaskBlindName).ToList();
|
|
|
|
|
taskList = taskList.Where(x => remainingItems.Contains(x.Id)).OrderBy(t=>t.TaskBlindName).ToList();
|
|
|
|
|
|
|
|
|
|
// 当前受试者没有就找其他受试者
|
|
|
|
|
if (taskList.Count() == 0)
|
|
|
|
|
@ -3049,7 +3048,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
var query = _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == trialReadingCriterionId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.DoctorUserId == _userInfo.UserRoleId
|
|
|
|
|
&& x.TrialReadingCriterionId == trialReadingCriterionId
|
|
|
|
|
&& x.TaskState == TaskState.Effect)
|
|
|
|
|
.Where(x => !cacheSkipIds.Contains(x.Id));
|
|
|
|
|
.Where(x=> !cacheSkipIds.Contains(x.Id));
|
|
|
|
|
var count = await query.CountAsync();
|
|
|
|
|
if (count == 0)
|
|
|
|
|
{
|
|
|
|
|
@ -3274,9 +3273,12 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<bool> ResetReadingRestTime([FromServices] IRepository<UserLog> _userLogRepository)
|
|
|
|
|
public async Task<bool> ResetReadingRestTime(Guid? userID)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (userID == null)
|
|
|
|
|
{
|
|
|
|
|
userID = _userInfo.UserRoleId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//int readingMinute = 120; // 为60整数
|
|
|
|
|
int restMinute = 10; //
|
|
|
|
|
@ -3296,9 +3298,6 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
{
|
|
|
|
|
await _fusionCache.SetAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.UserRoleId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, OptType = UserOptType.WebUnlock }, true);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -3526,7 +3525,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
public async Task AddReadingTask(Guid visitTaskId, Guid? trialId = null)
|
|
|
|
|
{
|
|
|
|
|
// ****** 先生成阅片期 阅片期任务阅片完成之后生成肿瘤学的 如果没有阅片期 直接生成肿瘤学 *********////
|
|
|
|
|
|