Uat_Study
parent
8cf077d9f1
commit
5ea5323112
|
@ -893,6 +893,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
public Guid GlobalTaskId { get; set; }
|
public Guid GlobalTaskId { get; set; }
|
||||||
|
|
||||||
|
public Guid? OtherGlobalTaskId { get; set; }
|
||||||
|
|
||||||
public ReadingTaskState ReadingTaskState { get; set; }
|
public ReadingTaskState ReadingTaskState { get; set; }
|
||||||
|
|
||||||
public string GlobalUpdateType { get; set; }
|
public string GlobalUpdateType { get; set; }
|
||||||
|
|
|
@ -396,12 +396,21 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public bool IsSendMessage { get; set; }
|
public bool IsSendMessage { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public GetOncologyReadingInfoOutDto OncologyInfo { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public GetGlobalReadingInfoOutDto GlobalInfo { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public GetJudgeReadingInfoOutDto JudgeInfo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否关闭
|
/// 是否关闭
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsClosedDialog { get; set; }
|
public bool IsClosedDialog { get; set; }
|
||||||
|
|
||||||
public List<CriterionDictionaryInfo> OncologyAssessTypeList { get; set; }
|
|
||||||
|
|
||||||
public List<TaskInfo> TaskList { get; set; } = new List<TaskInfo>();
|
public List<TaskInfo> TaskList { get; set; } = new List<TaskInfo>();
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,12 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
|
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
|
||||||
|
|
||||||
|
Task<GetOncologyReadingInfoOutDto> GetOncologyReadingInfo(GetOncologyReadingInfoInDto inDto);
|
||||||
|
|
||||||
|
Task<GetJudgeReadingInfoOutDto> GetJudgeReadingInfo(GetJudgeReadingInfo inDto);
|
||||||
|
|
||||||
|
Task<GetGlobalReadingInfoOutDto> GetGlobalReadingInfo(GetGlobalReadingInfoInDto inDto);
|
||||||
|
|
||||||
|
|
||||||
Task<List<DicomReadingQuestionAnswer>> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId);
|
Task<List<DicomReadingQuestionAnswer>> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId);
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
private readonly IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository;
|
private readonly IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository;
|
||||||
private readonly IRepository<ReadingOncologyTaskInfo> _readingOncologyTaskInfoRepository;
|
private readonly IRepository<ReadingOncologyTaskInfo> _readingOncologyTaskInfoRepository;
|
||||||
private readonly IRepository<ReadingCriterionDictionary> _readingCriterionDictionaryRepository;
|
private readonly IRepository<ReadingCriterionDictionary> _readingCriterionDictionaryRepository;
|
||||||
|
|
||||||
|
private readonly IReadingImageTaskService _iReadingImageTaskService;
|
||||||
private readonly IRepository<User> _userTaskRepository;
|
private readonly IRepository<User> _userTaskRepository;
|
||||||
private readonly IVisitTaskService _visitTaskService;
|
private readonly IVisitTaskService _visitTaskService;
|
||||||
private readonly IRepository<TaskMedicalReview> _taskMedicalReviewRepository;
|
private readonly IRepository<TaskMedicalReview> _taskMedicalReviewRepository;
|
||||||
|
@ -37,9 +39,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
private readonly IRepository<ReadingMedicineSystemQuestion> _readingMedicineSystemQuestionRepository;
|
private readonly IRepository<ReadingMedicineSystemQuestion> _readingMedicineSystemQuestionRepository;
|
||||||
|
|
||||||
public ReadingMedicalReviewService(
|
public ReadingMedicalReviewService(
|
||||||
IRepository<ReadingMedicineTrialQuestion> readingMedicineTrialQuestionRepository,
|
IRepository<ReadingMedicineTrialQuestion> readingMedicineTrialQuestionRepository,
|
||||||
IRepository<Trial> trialRepository,
|
IRepository<Trial> trialRepository,
|
||||||
IRepository<VisitTask> visitTaskRepository,
|
IRepository<VisitTask> visitTaskRepository,
|
||||||
|
IReadingImageTaskService readingImageTaskService,
|
||||||
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository,
|
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository,
|
||||||
IRepository<ReadingGlobalTaskInfo> readingGlobalTaskInfoRepository,
|
IRepository<ReadingGlobalTaskInfo> readingGlobalTaskInfoRepository,
|
||||||
IRepository<ReadingOncologyTaskInfo> readingOncologyTaskInfoRepository,
|
IRepository<ReadingOncologyTaskInfo> readingOncologyTaskInfoRepository,
|
||||||
|
@ -55,6 +58,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
this._readingMedicineTrialQuestionRepository = readingMedicineTrialQuestionRepository;
|
this._readingMedicineTrialQuestionRepository = readingMedicineTrialQuestionRepository;
|
||||||
this._trialRepository = trialRepository;
|
this._trialRepository = trialRepository;
|
||||||
|
this._iReadingImageTaskService = readingImageTaskService;
|
||||||
this._visitTaskRepository = visitTaskRepository;
|
this._visitTaskRepository = visitTaskRepository;
|
||||||
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
|
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
|
||||||
this._readingGlobalTaskInfoRepository = readingGlobalTaskInfoRepository;
|
this._readingGlobalTaskInfoRepository = readingGlobalTaskInfoRepository;
|
||||||
|
@ -118,111 +122,97 @@ namespace IRaCIS.Core.Application.Service
|
||||||
#region 取任务
|
#region 取任务
|
||||||
|
|
||||||
|
|
||||||
// 先判断是否是肿瘤学任务
|
switch (taskInfo.ReadingCategory)
|
||||||
if (taskInfo.ReadingCategory == ReadingCategory.Oncology)
|
|
||||||
{
|
{
|
||||||
var oncologyList = await _readingOncologyTaskInfoRepository.Where(x => x.OncologyTaskId == taskInfo.Id).ToListAsync();
|
case ReadingCategory.Oncology:
|
||||||
|
medicalReviewInfo.OncologyInfo = await _iReadingImageTaskService.GetOncologyReadingInfo(new GetOncologyReadingInfoInDto()
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
x.OncologyEvaluationResult = oncologyInfo.EvaluationResult;
|
VisitTaskId= taskInfo.Id
|
||||||
x.OncologyEvaluationReason = oncologyInfo.EvaluationReason;
|
});
|
||||||
}
|
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.DoctorUserId == taskInfo.DoctorUserId &&
|
||||||
&& x.ParentCode == ReadingCommon.CriterionDictionary.OncologyAssess
|
x.ReadingTaskState == ReadingTaskState.HaveSigned &&
|
||||||
)
|
x.ReReadingApplyState != ReReadingApplyState.Agree
|
||||||
.Select(x => new CriterionDictionaryInfo()
|
).OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
|
||||||
{
|
|
||||||
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()
|
|
||||||
{
|
{
|
||||||
VisitTaskId = y.VisitTaskId,
|
TaskId = x.Id,
|
||||||
Answer = y.Answer,
|
IsCurrentTask = x.Id == taskInfo.Id,
|
||||||
QuestionName = y.ReadingQuestionTrial.QuestionName,
|
ReadingCategory = x.ReadingCategory,
|
||||||
ShowOrder = y.ReadingQuestionTrial.ShowOrder,
|
TaskBlindName = x.TaskBlindName,
|
||||||
DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
|
ArmEnum = x.ArmEnum,
|
||||||
QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
|
TaskName = x.TaskName,
|
||||||
|
SouceReadModuleId = x.SouceReadModuleId,
|
||||||
}).OrderBy(x => x.ShowOrder).ToList(),
|
SourceSubjectVisitId = x.SourceSubjectVisitId,
|
||||||
}).ToListAsync();
|
JudgeVisitTaskId = x.JudgeVisitTaskId,
|
||||||
|
JudgeResultArm = x.JudgeResultTask.ArmEnum,
|
||||||
|
SubjectId = x.SubjectId,
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
List<TaskInfo> otherTask = await _visitTaskRepository.Where(x => x.ArmEnum != Arm.JudgeArm && x.SubjectId == taskInfo.SubjectId
|
List<TaskInfo> otherTask = await _visitTaskRepository.Where(x =>
|
||||||
&& x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
|
x.SubjectId == taskInfo.SubjectId
|
||||||
&&x.TaskState==TaskState.Effect
|
&& x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
|
||||||
&& x.ArmEnum == taskInfo.ArmEnum
|
&& x.TaskState == TaskState.Effect
|
||||||
&& x.DoctorUserId != taskInfo.DoctorUserId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReReadingApplyState != ReReadingApplyState.Agree)
|
&&x.ReadingCategory == ReadingCategory.Visit
|
||||||
.Where(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate)
|
&& x.IsAnalysisCreate == taskInfo.IsAnalysisCreate
|
||||||
.OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
|
&& 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,
|
TaskId = x.Id,
|
||||||
IsCurrentTask = x.Id == taskInfo.Id,
|
IsCurrentTask = x.Id == taskInfo.Id,
|
||||||
|
@ -232,131 +222,75 @@ namespace IRaCIS.Core.Application.Service
|
||||||
TaskName = x.TaskName,
|
TaskName = x.TaskName,
|
||||||
SouceReadModuleId = x.SouceReadModuleId,
|
SouceReadModuleId = x.SouceReadModuleId,
|
||||||
SourceSubjectVisitId = x.SourceSubjectVisitId,
|
SourceSubjectVisitId = x.SourceSubjectVisitId,
|
||||||
|
SubjectId = x.SubjectId,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
medicalReviewInfo.TaskList.ForEach(x =>
|
List<TaskInfo> 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();
|
medicalReviewInfo.TaskList.ForEach(x =>
|
||||||
if (otherTaskInfo != null)
|
|
||||||
{
|
{
|
||||||
x.OtherTaskId = otherTaskInfo.TaskId;
|
var otherTaskInfo = otherTask.Where(y => y.SouceReadModuleId == x.SouceReadModuleId && y.SourceSubjectVisitId == x.SourceSubjectVisitId).FirstOrDefault();
|
||||||
x.OtherArmEnum = otherTaskInfo.ArmEnum;
|
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()
|
|
||||||
{
|
var taskIds = medicalReviewInfo.TaskList.Select(x => x.TaskId).ToList();
|
||||||
TaskId = x.Id,
|
|
||||||
IsCurrentTask = x.Id == taskInfo.Id,
|
// 找访视
|
||||||
ReadingCategory = x.ReadingCategory,
|
var visitTaskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
|
||||||
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()
|
|
||||||
{
|
{
|
||||||
VisitTaskId = y.VisitTaskId,
|
Answer = x.Answer,
|
||||||
Answer = y.Answer,
|
VisitTaskId = x.VisitTaskId,
|
||||||
QuestionName = y.ReadingQuestionTrial.QuestionName,
|
DictionaryCode = x.ReadingQuestionTrial.DictionaryCode,
|
||||||
ShowOrder = y.ReadingQuestionTrial.ShowOrder,
|
ShowOrder = x.ReadingQuestionTrial.ShowOrder,
|
||||||
DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
|
QuestionGenre = x.ReadingQuestionTrial.QuestionGenre,
|
||||||
QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
|
QuestionName = x.ReadingQuestionTrial.QuestionName
|
||||||
|
|
||||||
}).OrderBy(x => x.ShowOrder).ToList(),
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<TaskInfo> 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,
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
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 =>
|
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.IsGlobalChange = globalChangeAnswer.Any(y => y.TaskId == x.TaskId);
|
||||||
x.OtherArmEnum = otherTaskInfo.ArmEnum;
|
x.JudgeQuestionAnswerInfoList = visitTaskAnswer.Where(y => y.VisitTaskId == x.TaskId).OrderBy(y => y.ShowOrder).ToList();
|
||||||
}
|
});
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 这里处理 访视和全局任务 以及肿瘤学
|
|
||||||
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();
|
|
||||||
|
|
||||||
|
|
||||||
medicalReviewInfo.TaskList.ForEach(x =>
|
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
|
#endregion
|
||||||
return medicalReviewInfo;
|
return medicalReviewInfo;
|
||||||
|
|
||||||
|
|
|
@ -95,9 +95,11 @@ namespace IRaCIS.Application.Services
|
||||||
ReadingTaskState = taskInfo.ReadingTaskState,
|
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 其他按照分组
|
// 一致性分析按照doctorId 其他按照分组
|
||||||
|
|
||||||
result.TaskList = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
result.TaskList = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
||||||
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
|
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
|
||||||
x.SubjectId == taskInfo.SubjectId && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.TaskState == TaskState.Effect && x.VisitTaskNum < taskInfo.VisitTaskNum)
|
x.SubjectId == taskInfo.SubjectId && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.TaskState == TaskState.Effect && x.VisitTaskNum < taskInfo.VisitTaskNum)
|
||||||
|
|
Loading…
Reference in New Issue