From a50c933abb73277ffebf3cb2dab4b3c37ab078a7 Mon Sep 17 00:00:00 2001
From: he <10978375@qq.com>
Date: Mon, 20 Jun 2022 14:48:58 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Reading/Dto/ReadingImageTaskViewModel.cs | 2 ++
.../Reading/ReadingImageTaskService.cs | 35 +++++++++++--------
2 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
index ff453edc0..e8aa18592 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
@@ -36,6 +36,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
[NotDefault]
public Guid TrialId { get; set; }
+
+ public Guid? VisistTaskId { get; set; }
}
public class GetConfirmCriterionInDto
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs
index a10fa7f3f..f4878051b 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs
@@ -56,9 +56,23 @@ namespace IRaCIS.Application.Services
///
///
///
- private async Task GetNextTaskId(Guid? subjectId,Guid trialId)
+ private async Task GetNextTaskId(Guid? subjectId,Guid trialId,Guid? visistTaskId)
{
GetReadingTaskDto? task = new GetReadingTaskDto();
+
+ if (visistTaskId != null)
+ {
+ task = await _visitTaskRepository.Where(x => x.Id==visistTaskId).Select(x => new GetReadingTaskDto()
+ {
+ VisistTaskId = x.Id,
+ ReadingCategory = x.ReadingCategory,
+ VisistId = x.ReadingCategory == ReadingCategory.Visit ? x.SourceSubjectVisitId.Value : x.ReadModule.SubjectVisitId,
+ VisitNum = x.ReadingCategory == ReadingCategory.Visit ? x.SubjectVisit.VisitNum : x.ReadModule.VisitNum
+ }).FirstOrDefaultAsync();
+
+ task.SubjectId = await _subjectVisitRepository.Where(x => x.Id == task.VisistId).Select(x => x.SubjectId).FirstOrDefaultAsync();
+ return task;
+ }
if (subjectId != null)
{
task = await _visitTaskRepository.Where(x => x.TrialId == trialId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.SubjectId == subjectId.Value).Select(x => new GetReadingTaskDto()
@@ -109,7 +123,7 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<(List,object)> GetReadingImageFile(GetReadingImgInDto inDto)
{
- var task=await GetNextTaskId(inDto.SubjectId, inDto.TrialId);
+ var task=await GetNextTaskId(inDto.SubjectId, inDto.TrialId,inDto.VisistTaskId);
List visitIds = new List();
if (task.ReadingCategory == ReadingCategory.Visit)
{
@@ -120,14 +134,8 @@ namespace IRaCIS.Application.Services
// 阅片期取前面所有的图像
visitIds.AddRange(await _subjectVisitRepository.Where(x => x.VisitNum <= task.VisitNum && x.SubjectId == task.SubjectId).Select(x => x.Id).ToListAsync());
}
-
-
-
List result=await _noneDicomStudyRepository.Where(t => visitIds.Contains(t.SubjectVisitId))
-
.ProjectTo(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken }).ToListAsync();
-
-
return (result, new {
VisitTaskId= task.VisistTaskId
});
@@ -193,7 +201,7 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
- public async Task<(List, TaskState)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
+ public async Task<(List, object)> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
{
var readingTaskState = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TaskState).FirstOrDefaultAsync();
@@ -225,7 +233,10 @@ namespace IRaCIS.Application.Services
{
FindChildQuestion(x, qusetionList);
});
- return (groupList, readingTaskState);
+ return (groupList, new
+ {
+ readingTaskState = readingTaskState
+ });
}
@@ -291,9 +302,5 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Ok(result);
}
-
-
-
-
}
}