From 5ea5323112377968a396b46b39521bbd2f0f79ac Mon Sep 17 00:00:00 2001
From: he <10978375@qq.com>
Date: Thu, 29 Dec 2022 16:53:26 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Reading/Dto/ReadingImageTaskViewModel.cs | 2 +
.../Reading/Dto/ReadingMedicalReviewDto.cs | 11 +-
.../Interface/IReadingImageTaskService.cs | 6 +
.../ReadingMedicalReviewService.cs | 360 +++++++-----------
.../ReadingGlobalTaskService.cs | 6 +-
5 files changed, 169 insertions(+), 216 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
index 06c2a61a4..f2e3f24c0 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
@@ -893,6 +893,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
{
public Guid GlobalTaskId { get; set; }
+ public Guid? OtherGlobalTaskId { get; set; }
+
public ReadingTaskState ReadingTaskState { get; set; }
public string GlobalUpdateType { get; set; }
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs
index 74e0d4a43..41f2295c2 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs
@@ -396,12 +396,21 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public bool IsSendMessage { get; set; }
+
+ public GetOncologyReadingInfoOutDto OncologyInfo { get; set; }
+
+
+ public GetGlobalReadingInfoOutDto GlobalInfo { get; set; }
+
+
+ public GetJudgeReadingInfoOutDto JudgeInfo { get; set; }
+
///
/// 是否关闭
///
public bool IsClosedDialog { get; set; }
- public List OncologyAssessTypeList { get; set; }
+
public List TaskList { get; set; } = new List();
diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs
index f3490a7a7..79dfc0603 100644
--- a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs
@@ -15,6 +15,12 @@ namespace IRaCIS.Core.Application.Contracts
Task SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
+ Task GetOncologyReadingInfo(GetOncologyReadingInfoInDto inDto);
+
+ Task GetJudgeReadingInfo(GetJudgeReadingInfo inDto);
+
+ Task GetGlobalReadingInfo(GetGlobalReadingInfoInDto inDto);
+
Task> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId);
diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs
index 8c993e283..5f00c1bcc 100644
--- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs
@@ -28,6 +28,8 @@ namespace IRaCIS.Core.Application.Service
private readonly IRepository _readingGlobalTaskInfoRepository;
private readonly IRepository _readingOncologyTaskInfoRepository;
private readonly IRepository _readingCriterionDictionaryRepository;
+
+ private readonly IReadingImageTaskService _iReadingImageTaskService;
private readonly IRepository _userTaskRepository;
private readonly IVisitTaskService _visitTaskService;
private readonly IRepository _taskMedicalReviewRepository;
@@ -37,9 +39,10 @@ namespace IRaCIS.Core.Application.Service
private readonly IRepository _readingMedicineSystemQuestionRepository;
public ReadingMedicalReviewService(
- IRepository readingMedicineTrialQuestionRepository,
- IRepository trialRepository,
- IRepository visitTaskRepository,
+ IRepository readingMedicineTrialQuestionRepository,
+ IRepository trialRepository,
+ IRepository visitTaskRepository,
+ IReadingImageTaskService readingImageTaskService,
IRepository readingTaskQuestionAnswerRepository,
IRepository readingGlobalTaskInfoRepository,
IRepository readingOncologyTaskInfoRepository,
@@ -55,6 +58,7 @@ namespace IRaCIS.Core.Application.Service
{
this._readingMedicineTrialQuestionRepository = readingMedicineTrialQuestionRepository;
this._trialRepository = trialRepository;
+ this._iReadingImageTaskService = readingImageTaskService;
this._visitTaskRepository = visitTaskRepository;
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
this._readingGlobalTaskInfoRepository = readingGlobalTaskInfoRepository;
@@ -118,111 +122,97 @@ namespace IRaCIS.Core.Application.Service
#region 取任务
- // 先判断是否是肿瘤学任务
- if (taskInfo.ReadingCategory == ReadingCategory.Oncology)
+ switch (taskInfo.ReadingCategory)
{
- var oncologyList = await _readingOncologyTaskInfoRepository.Where(x => x.OncologyTaskId == taskInfo.Id).ToListAsync();
-
- var taskIds= oncologyList.Select(x=>x.VisitTaskId).ToList();
-
- medicalReviewInfo.TaskList = await _visitTaskRepository.Where(x=>
- taskIds.Contains(x.Id)
- ).OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
- {
- TaskId = x.Id,
- IsCurrentTask = x.Id == taskInfo.Id,
- ReadingCategory = x.ReadingCategory,
- TaskBlindName = x.TaskBlindName,
- ArmEnum = x.ArmEnum,
- TaskName = x.TaskName,
- SouceReadModuleId = x.SouceReadModuleId,
- SourceSubjectVisitId = x.SourceSubjectVisitId,
- JudgeVisitTaskId = x.JudgeVisitTaskId,
- JudgeResultArm = x.JudgeResultTask.ArmEnum,
- SubjectId = x.SubjectId,
- }).ToListAsync();
-
-
- medicalReviewInfo.TaskList.ForEach(x =>
- {
- var oncologyInfo = oncologyList.Where(y => y.VisitTaskId == x.TaskId).FirstOrDefault();
- if (oncologyInfo != null)
+ case ReadingCategory.Oncology:
+ medicalReviewInfo.OncologyInfo = await _iReadingImageTaskService.GetOncologyReadingInfo(new GetOncologyReadingInfoInDto()
{
- x.OncologyEvaluationResult = oncologyInfo.EvaluationResult;
- x.OncologyEvaluationReason = oncologyInfo.EvaluationReason;
- }
-
- });
+ VisitTaskId= taskInfo.Id
+ });
+ break;
+ case ReadingCategory.Judge:
+ medicalReviewInfo.JudgeInfo = await _iReadingImageTaskService.GetJudgeReadingInfo(new GetJudgeReadingInfo()
+ {
+ VisitTaskId = taskInfo.Id
+ });
+ break;
+ case ReadingCategory.Global:
+ medicalReviewInfo.GlobalInfo = await _iReadingImageTaskService.GetGlobalReadingInfo(new GetGlobalReadingInfoInDto()
+ {
+ VisitTaskId = taskInfo.Id
+ });
+ break;
+ case ReadingCategory.Visit:
+ // 有序
+ if (medicalReviewInfo.IsReadingTaskViewInOrder)
+ {
+ medicalReviewInfo.TaskList = await _visitTaskRepository
+
+ .Where(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate)
+ .Where(x => x.TaskState == TaskState.Effect || x.Id == taskInfo.Id)
+ .Where(x => x.SubjectId == taskInfo.SubjectId
+ && x.ArmEnum == taskInfo.ArmEnum
+ &&x.ReadingCategory== ReadingCategory.Visit
+ && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
- medicalReviewInfo.OncologyAssessTypeList = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId == taskInfo.TrialReadingCriterionId
- && x.ParentCode == ReadingCommon.CriterionDictionary.OncologyAssess
- )
- .Select(x => new CriterionDictionaryInfo()
- {
- Id = x.Id,
- DictionaryId = x.DictionaryId,
- ChildGroup = x.Dictionary.ChildGroup,
- Code = x.Dictionary.Code,
- Description = x.Dictionary.Description,
- ShowOrder = x.Dictionary.ShowOrder,
- ParentCode = x.Dictionary.Parent.Code,
- Value = x.Dictionary.Value,
- ValueCN = x.Dictionary.ValueCN
- }).OrderBy(x => x.ParentCode).ThenBy(x => x.ShowOrder).ToListAsync();
-
- }
- else
- {
- // 有序
- if (medicalReviewInfo.IsReadingTaskViewInOrder)
- {
- medicalReviewInfo.TaskList = await _visitTaskRepository
- .WhereIf(taskInfo.ArmEnum == Arm.JudgeArm, x => x.ArmEnum == Arm.JudgeArm)
- .WhereIf(taskInfo.ArmEnum != Arm.JudgeArm, x => x.ArmEnum != Arm.JudgeArm)
- .Where(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate)
- .Where(x => x.TaskState == TaskState.Effect||x.Id== taskInfo.Id)
- .Where(x => x.SubjectId == taskInfo.SubjectId
- && x.ArmEnum == taskInfo.ArmEnum
- && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
-
- && x.DoctorUserId == taskInfo.DoctorUserId &&
- x.ReadingTaskState == ReadingTaskState.HaveSigned &&
- x.ReReadingApplyState != ReReadingApplyState.Agree
- ).OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
- {
- TaskId = x.Id,
- IsCurrentTask = x.Id == taskInfo.Id,
- ReadingCategory = x.ReadingCategory,
- TaskBlindName = x.TaskBlindName,
- ArmEnum = x.ArmEnum,
- TaskName = x.TaskName,
- SouceReadModuleId = x.SouceReadModuleId,
- SourceSubjectVisitId = x.SourceSubjectVisitId,
- JudgeVisitTaskId = x.JudgeVisitTaskId,
- JudgeResultArm = x.JudgeResultTask.ArmEnum,
- SubjectId = x.SubjectId,
- // 这里先只查裁判任务 访视和全局任务到后面查询
- JudgeQuestionAnswerInfoList = x.JudgeResultTask.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).Select(y => new JudgeQuestionAnswerInfo()
+ && x.DoctorUserId == taskInfo.DoctorUserId &&
+ x.ReadingTaskState == ReadingTaskState.HaveSigned &&
+ x.ReReadingApplyState != ReReadingApplyState.Agree
+ ).OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
{
- VisitTaskId = y.VisitTaskId,
- Answer = y.Answer,
- QuestionName = y.ReadingQuestionTrial.QuestionName,
- ShowOrder = y.ReadingQuestionTrial.ShowOrder,
- DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
- QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
-
- }).OrderBy(x => x.ShowOrder).ToList(),
- }).ToListAsync();
+ TaskId = x.Id,
+ IsCurrentTask = x.Id == taskInfo.Id,
+ ReadingCategory = x.ReadingCategory,
+ TaskBlindName = x.TaskBlindName,
+ ArmEnum = x.ArmEnum,
+ TaskName = x.TaskName,
+ SouceReadModuleId = x.SouceReadModuleId,
+ SourceSubjectVisitId = x.SourceSubjectVisitId,
+ JudgeVisitTaskId = x.JudgeVisitTaskId,
+ JudgeResultArm = x.JudgeResultTask.ArmEnum,
+ SubjectId = x.SubjectId,
+ }).ToListAsync();
- List otherTask = await _visitTaskRepository.Where(x => x.ArmEnum != Arm.JudgeArm && x.SubjectId == taskInfo.SubjectId
- && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
- &&x.TaskState==TaskState.Effect
- && x.ArmEnum == taskInfo.ArmEnum
- && x.DoctorUserId != taskInfo.DoctorUserId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReReadingApplyState != ReReadingApplyState.Agree)
- .Where(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate)
- .OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
+ List otherTask = await _visitTaskRepository.Where(x =>
+ x.SubjectId == taskInfo.SubjectId
+ && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
+ && x.TaskState == TaskState.Effect
+ &&x.ReadingCategory == ReadingCategory.Visit
+ && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate
+ && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis
+ && x.DoctorUserId != taskInfo.DoctorUserId
+ && x.ReadingTaskState == ReadingTaskState.HaveSigned
+ && x.ReReadingApplyState != ReReadingApplyState.Agree)
+ .OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
+ {
+ TaskId = x.Id,
+ IsCurrentTask = x.Id == taskInfo.Id,
+ ReadingCategory = x.ReadingCategory,
+ TaskBlindName = x.TaskBlindName,
+ ArmEnum = x.ArmEnum,
+ TaskName = x.TaskName,
+ SouceReadModuleId = x.SouceReadModuleId,
+ SourceSubjectVisitId = x.SourceSubjectVisitId,
+ }).ToListAsync();
+
+ medicalReviewInfo.TaskList.ForEach(x =>
+ {
+
+ var otherTaskInfo = otherTask.Where(y => y.SouceReadModuleId == x.SouceReadModuleId && y.SourceSubjectVisitId == x.SourceSubjectVisitId).FirstOrDefault();
+ if (otherTaskInfo != null)
+ {
+ x.OtherTaskId = otherTaskInfo.TaskId;
+ x.OtherArmEnum = otherTaskInfo.ArmEnum;
+ }
+
+ });
+ }
+ // 无序
+ else
+ {
+ medicalReviewInfo.TaskList = await _visitTaskRepository.Where(x => x.Id == taskInfo.Id).Select(x => new TaskInfo()
{
TaskId = x.Id,
IsCurrentTask = x.Id == taskInfo.Id,
@@ -232,131 +222,75 @@ namespace IRaCIS.Core.Application.Service
TaskName = x.TaskName,
SouceReadModuleId = x.SouceReadModuleId,
SourceSubjectVisitId = x.SourceSubjectVisitId,
+ SubjectId = x.SubjectId,
}).ToListAsync();
- medicalReviewInfo.TaskList.ForEach(x =>
- {
+ List otherTask = await _visitTaskRepository.Where(x =>
+ x.SouceReadModuleId == taskInfo.SouceReadModuleId
+ && x.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId
+ && x.DoctorUserId != taskInfo.DoctorUserId
+ && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate
+ && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis
+ && x.ReadingTaskState == ReadingTaskState.HaveSigned
+ && x.ReReadingApplyState != ReReadingApplyState.Agree
+ && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
+ && x.TaskState == TaskState.Effect
+ )
+
+ .OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
+ {
+ TaskId = x.Id,
+ IsCurrentTask = x.Id == taskInfo.Id,
+ ReadingCategory = x.ReadingCategory,
+ TaskBlindName = x.TaskBlindName,
+ ArmEnum = x.ArmEnum,
+ TaskName = x.TaskName,
+ SouceReadModuleId = x.SouceReadModuleId,
+ SourceSubjectVisitId = x.SourceSubjectVisitId,
+ }).ToListAsync();
- var otherTaskInfo = otherTask.Where(y => y.SouceReadModuleId == x.SouceReadModuleId && y.SourceSubjectVisitId == x.SourceSubjectVisitId).FirstOrDefault();
- if (otherTaskInfo != null)
+ medicalReviewInfo.TaskList.ForEach(x =>
{
- x.OtherTaskId = otherTaskInfo.TaskId;
- x.OtherArmEnum = otherTaskInfo.ArmEnum;
- }
-
- });
- }
- // 无序
- else
- {
- medicalReviewInfo.TaskList = await _visitTaskRepository.Where(x => x.Id == taskInfo.Id).Select(x => new TaskInfo()
- {
- TaskId = x.Id,
- IsCurrentTask = x.Id == taskInfo.Id,
- ReadingCategory = x.ReadingCategory,
- TaskBlindName = x.TaskBlindName,
- ArmEnum = x.ArmEnum,
- TaskName = x.TaskName,
- SouceReadModuleId = x.SouceReadModuleId,
- SourceSubjectVisitId = x.SourceSubjectVisitId,
- SubjectId = x.SubjectId,
- // 这里先只查裁判任务 访视和全局任务到后面查询
- JudgeQuestionAnswerInfoList = x.JudgeResultTask.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).Select(y => new JudgeQuestionAnswerInfo()
+ var otherTaskInfo = otherTask.Where(y => y.SouceReadModuleId == x.SouceReadModuleId && y.SourceSubjectVisitId == x.SourceSubjectVisitId).FirstOrDefault();
+ if (otherTaskInfo != null)
+ {
+ x.OtherTaskId = otherTaskInfo.TaskId;
+ x.OtherArmEnum = otherTaskInfo.ArmEnum;
+ }
+
+ });
+ }
+
+ var taskIds = medicalReviewInfo.TaskList.Select(x => x.TaskId).ToList();
+
+ // 找访视
+ var visitTaskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
{
- VisitTaskId = y.VisitTaskId,
- Answer = y.Answer,
- QuestionName = y.ReadingQuestionTrial.QuestionName,
- ShowOrder = y.ReadingQuestionTrial.ShowOrder,
- DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
- QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
-
- }).OrderBy(x => x.ShowOrder).ToList(),
- }).ToListAsync();
-
-
-
-
-
- List otherTask = await _visitTaskRepository.Where(x => x.ArmEnum != Arm.JudgeArm && x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId
- && x.DoctorUserId != taskInfo.DoctorUserId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReReadingApplyState != ReReadingApplyState.Agree
- && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
- && x.TaskState==TaskState.Effect
- )
- .Where(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate)
- .OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
- {
- TaskId = x.Id,
- IsCurrentTask = x.Id == taskInfo.Id,
- ReadingCategory = x.ReadingCategory,
- TaskBlindName = x.TaskBlindName,
- ArmEnum = x.ArmEnum,
- TaskName = x.TaskName,
- SouceReadModuleId = x.SouceReadModuleId,
- SourceSubjectVisitId = x.SourceSubjectVisitId,
+ Answer = x.Answer,
+ VisitTaskId = x.VisitTaskId,
+ DictionaryCode = x.ReadingQuestionTrial.DictionaryCode,
+ ShowOrder = x.ReadingQuestionTrial.ShowOrder,
+ QuestionGenre = x.ReadingQuestionTrial.QuestionGenre,
+ QuestionName = x.ReadingQuestionTrial.QuestionName
}).ToListAsync();
-
- medicalReviewInfo.TaskList.ForEach(x =>
- {
- var otherTaskInfo = otherTask.Where(y => y.SouceReadModuleId == x.SouceReadModuleId && y.SourceSubjectVisitId == x.SourceSubjectVisitId).FirstOrDefault();
- if(otherTaskInfo!=null)
+ var globalChangeAnswer = await _readingGlobalTaskInfoRepository.Where(x => taskIds.Contains(x.GlobalTaskId) && x.Answer != string.Empty && x.GlobalAnswerType == GlobalAnswerType.Question && x.GlobalVisitTask.TaskState == TaskState.Effect).ToListAsync();
+ medicalReviewInfo.TaskList.ForEach(x =>
{
- x.OtherTaskId = otherTaskInfo.TaskId;
- x.OtherArmEnum = otherTaskInfo.ArmEnum;
- }
-
- });
- }
-
- // 这里处理 访视和全局任务 以及肿瘤学
- if (taskInfo.ArmEnum != Arm.JudgeArm)
- {
- var taskIds = medicalReviewInfo.TaskList.Select(x => x.TaskId).ToList();
-
- // 找访视
- var visitTaskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
- {
- Answer = x.Answer,
- VisitTaskId = x.VisitTaskId,
- DictionaryCode = x.ReadingQuestionTrial.DictionaryCode,
- ShowOrder = x.ReadingQuestionTrial.ShowOrder,
- QuestionGenre = x.ReadingQuestionTrial.QuestionGenre,
- QuestionName = x.ReadingQuestionTrial.QuestionName
- }).ToListAsync();
-
- var globalTaskAnswer = await (from global in _readingGlobalTaskInfoRepository.Where(x => taskIds.Contains(x.GlobalTaskId) && x.GlobalAnswerType == GlobalAnswerType.Question && x.TrialReadingQuestion.IsJudgeQuestion).Include(x=>x.TrialReadingQuestion)
- join taskAnswer in _readingTaskQuestionAnswerRepository.AsQueryable() on new { TaskId= global.TaskId, QuestionId=global.QuestionId??default(Guid),TaskNum=global.GlobalVisitTask.VisitTaskNum- 0.03m } equals new { TaskId=taskAnswer.VisitTaskId, QuestionId=taskAnswer.ReadingQuestionTrialId , TaskNum=taskAnswer.VisitTask.VisitTaskNum }
- select new JudgeQuestionAnswerInfo()
- {
- Answer = global.Answer.Trim().IsNullOrEmpty()? taskAnswer.Answer: global.Answer,
- VisitTaskId = global.GlobalTaskId,
- DictionaryCode = global.TrialReadingQuestion.DictionaryCode,
- ShowOrder = global.TrialReadingQuestion.ShowOrder,
- QuestionGenre = global.TrialReadingQuestion.QuestionGenre,
- QuestionName = global.TrialReadingQuestion.QuestionName
- }).ToListAsync();
-
-
- visitTaskAnswer.AddRange(globalTaskAnswer);
-
-
-
-
- var globalChangeAnswer = await _readingGlobalTaskInfoRepository.Where(x => taskIds.Contains(x.GlobalTaskId)&&x.Answer!=string.Empty && x.GlobalAnswerType == GlobalAnswerType.Question&&x.GlobalVisitTask.TaskState==TaskState.Effect).ToListAsync();
-
+ x.IsGlobalChange = globalChangeAnswer.Any(y => y.TaskId == x.TaskId);
+ x.JudgeQuestionAnswerInfoList = visitTaskAnswer.Where(y => y.VisitTaskId == x.TaskId).OrderBy(y => y.ShowOrder).ToList();
+ });
medicalReviewInfo.TaskList.ForEach(x =>
{
- x.IsGlobalChange = globalChangeAnswer.Any(y => y.TaskId == x.TaskId);
- x.JudgeQuestionAnswerInfoList = visitTaskAnswer.Where(y => y.VisitTaskId == x.TaskId).OrderBy(y => y.ShowOrder).ToList();
+
+ x.IsCurrentTask = x.TaskId == taskInfo.Id;
});
- }
+ break;
}
- medicalReviewInfo.TaskList.ForEach(x =>
- {
-
- x.IsCurrentTask = x.TaskId == taskInfo.Id;
- });
+
+
+
#endregion
return medicalReviewInfo;
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs
index 122b7115d..f454c98e5 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs
@@ -95,9 +95,11 @@ namespace IRaCIS.Application.Services
ReadingTaskState = taskInfo.ReadingTaskState,
};
-
+ result.OtherGlobalTaskId = await _visitTaskRepository.Where(x => x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate
+ && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis && x.TaskState == TaskState.Effect && x.DoctorUserId != taskInfo.DoctorUserId
+ ).Select(x => x.Id).FirstOrDefaultAsync();
// 一致性分析按照doctorId 其他按照分组
-
+
result.TaskList = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
x.SubjectId == taskInfo.SubjectId && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.TaskState == TaskState.Effect && x.VisitTaskNum < taskInfo.VisitTaskNum)