Uat_Study
parent
cfd5387b77
commit
dc6123509c
|
@ -104,6 +104,47 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var result = await _readingMedicineQuestionAnswerRepository.SaveChangesAsync();
|
var result = await _readingMedicineQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
||||||
#region 取任务
|
#region 取任务
|
||||||
|
|
||||||
|
|
||||||
|
// 先判断是否是肿瘤学任务
|
||||||
|
if (taskInfo.ReadingCategory == ReadingCategory.Oncology)
|
||||||
|
{
|
||||||
|
var oncologyList = await _readingOncologyTaskInfoRepository.Where(x => x.OncologyTaskId == visitTaskfInfo.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.OncologyTaskId == x.TaskId).FirstOrDefault();
|
||||||
|
if (oncologyInfo != null)
|
||||||
|
{
|
||||||
|
x.OncologyEvaluationResult = oncologyInfo.EvaluationResult;
|
||||||
|
x.OncologyEvaluationReason = oncologyInfo.EvaluationResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (medicalReviewInfo.IsReadingTaskViewInOrder)
|
if (medicalReviewInfo.IsReadingTaskViewInOrder)
|
||||||
{
|
{
|
||||||
medicalReviewInfo.TaskList = await _visitTaskRepository
|
medicalReviewInfo.TaskList = await _visitTaskRepository
|
||||||
|
@ -134,62 +175,19 @@ namespace IRaCIS.Core.Application.Service
|
||||||
// 这里先只查裁判任务 访视和全局任务到后面查询
|
// 这里先只查裁判任务 访视和全局任务到后面查询
|
||||||
JudgeQuestionAnswerInfoList = x.JudgeResultTask.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).Select(y => new JudgeQuestionAnswerInfo()
|
JudgeQuestionAnswerInfoList = x.JudgeResultTask.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).Select(y => new JudgeQuestionAnswerInfo()
|
||||||
{
|
{
|
||||||
VisitTaskId=y.VisitTaskId,
|
VisitTaskId = y.VisitTaskId,
|
||||||
Answer = y.Answer,
|
Answer = y.Answer,
|
||||||
QuestionName = y.ReadingQuestionTrial.QuestionName,
|
QuestionName = y.ReadingQuestionTrial.QuestionName,
|
||||||
ShowOrder=y.ReadingQuestionTrial.ShowOrder,
|
ShowOrder = y.ReadingQuestionTrial.ShowOrder,
|
||||||
DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
|
DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
|
||||||
QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
|
QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
|
||||||
|
|
||||||
}).OrderBy(x=>x.ShowOrder).ToList(),
|
}).OrderBy(x => x.ShowOrder).ToList(),
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
// 这里处理 访视和全局任务 以及肿瘤学
|
|
||||||
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();
|
|
||||||
|
|
||||||
visitTaskAnswer.AddRange(await _readingGlobalTaskInfoRepository.Where(x => taskIds.Contains(x.GlobalTaskId)&&x.GlobalAnswerType==GlobalAnswerType.Question && x.TrialReadingQuestion.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
|
|
||||||
{
|
|
||||||
Answer = x.Answer,
|
|
||||||
VisitTaskId = x.GlobalTaskId,
|
|
||||||
DictionaryCode = x.TrialReadingQuestion.DictionaryCode,
|
|
||||||
ShowOrder = x.TrialReadingQuestion.ShowOrder,
|
|
||||||
QuestionGenre = x.TrialReadingQuestion.QuestionGenre,
|
|
||||||
QuestionName = x.TrialReadingQuestion.QuestionName
|
|
||||||
}).ToListAsync());
|
|
||||||
|
|
||||||
// 肿瘤学没有问题
|
|
||||||
var oncologyInfoList= await _readingOncologyTaskInfoRepository.Where(x => taskIds.Contains(x.OncologyTaskId)).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
medicalReviewInfo.TaskList.ForEach(x =>
|
|
||||||
{
|
|
||||||
var oncologyInfo = oncologyInfoList.Where(y => y.OncologyTaskId == x.TaskId).FirstOrDefault();
|
|
||||||
if (oncologyInfo != null)
|
|
||||||
{
|
|
||||||
x.OncologyEvaluationResult = oncologyInfo.EvaluationResult;
|
|
||||||
x.OncologyEvaluationReason = oncologyInfo.EvaluationResult;
|
|
||||||
}
|
|
||||||
x.JudgeQuestionAnswerInfoList = visitTaskAnswer.Where(y => y.VisitTaskId == x.TaskId).OrderBy(y => y.ShowOrder).ToList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
List<TaskInfo> otherTask = await _visitTaskRepository.Where(x => x.ArmEnum != Arm.JudgeArm && x.SubjectId == taskInfo.SubjectId
|
List<TaskInfo> otherTask = await _visitTaskRepository.Where(x => x.ArmEnum != Arm.JudgeArm && x.SubjectId == taskInfo.SubjectId
|
||||||
|
&& x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
|
||||||
&& x.DoctorUserId != taskInfo.DoctorUserId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReReadingApplyState != ReReadingApplyState.Agree)
|
&& x.DoctorUserId != taskInfo.DoctorUserId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReReadingApplyState != ReReadingApplyState.Agree)
|
||||||
.Where(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate)
|
.Where(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate)
|
||||||
.OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
|
.OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
|
||||||
|
@ -222,26 +220,26 @@ namespace IRaCIS.Core.Application.Service
|
||||||
SouceReadModuleId = x.SouceReadModuleId,
|
SouceReadModuleId = x.SouceReadModuleId,
|
||||||
SourceSubjectVisitId = x.SourceSubjectVisitId,
|
SourceSubjectVisitId = x.SourceSubjectVisitId,
|
||||||
SubjectId = x.SubjectId,
|
SubjectId = x.SubjectId,
|
||||||
JudgeQuestionAnswerInfoList = x.ArmEnum == Arm.JudgeArm ? x.JudgeResultTask.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).Select(y => new JudgeQuestionAnswerInfo()
|
// 这里先只查裁判任务 访视和全局任务到后面查询
|
||||||
|
JudgeQuestionAnswerInfoList = x.JudgeResultTask.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).Select(y => new JudgeQuestionAnswerInfo()
|
||||||
{
|
{
|
||||||
|
VisitTaskId = y.VisitTaskId,
|
||||||
Answer = y.Answer,
|
Answer = y.Answer,
|
||||||
QuestionName = y.ReadingQuestionTrial.QuestionName,
|
QuestionName = y.ReadingQuestionTrial.QuestionName,
|
||||||
|
ShowOrder = y.ReadingQuestionTrial.ShowOrder,
|
||||||
DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
|
DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
|
||||||
QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
|
QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
|
||||||
}).ToList() : x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).Select(y => new JudgeQuestionAnswerInfo()
|
|
||||||
{
|
}).OrderBy(x => x.ShowOrder).ToList(),
|
||||||
Answer = y.Answer,
|
|
||||||
QuestionName = y.ReadingQuestionTrial.QuestionName,
|
|
||||||
DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
|
|
||||||
QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
|
|
||||||
}).ToList()
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<TaskInfo> otherTask = await _visitTaskRepository.Where(x => x.ArmEnum != Arm.JudgeArm && x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId
|
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.DoctorUserId != taskInfo.DoctorUserId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReReadingApplyState != ReReadingApplyState.Agree
|
||||||
&&x.TrialReadingCriterionId== taskInfo.TrialReadingCriterionId
|
&& x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
|
||||||
)
|
)
|
||||||
.Where(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate)
|
.Where(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate)
|
||||||
.OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
|
.OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
|
||||||
|
@ -261,6 +259,41 @@ namespace IRaCIS.Core.Application.Service
|
||||||
x.OtherTaskId = otherTask.Where(y => y.SouceReadModuleId == x.SouceReadModuleId && y.SourceSubjectVisitId == x.SourceSubjectVisitId).Select(y => y.TaskId).FirstOrDefault();
|
x.OtherTaskId = otherTask.Where(y => y.SouceReadModuleId == x.SouceReadModuleId && y.SourceSubjectVisitId == x.SourceSubjectVisitId).Select(y => y.TaskId).FirstOrDefault();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 这里处理 访视和全局任务 以及肿瘤学
|
||||||
|
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();
|
||||||
|
|
||||||
|
visitTaskAnswer.AddRange(await _readingGlobalTaskInfoRepository.Where(x => taskIds.Contains(x.GlobalTaskId) && x.GlobalAnswerType == GlobalAnswerType.Question && x.TrialReadingQuestion.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo
|
||||||
|
{
|
||||||
|
Answer = x.Answer,
|
||||||
|
VisitTaskId = x.GlobalTaskId,
|
||||||
|
DictionaryCode = x.TrialReadingQuestion.DictionaryCode,
|
||||||
|
ShowOrder = x.TrialReadingQuestion.ShowOrder,
|
||||||
|
QuestionGenre = x.TrialReadingQuestion.QuestionGenre,
|
||||||
|
QuestionName = x.TrialReadingQuestion.QuestionName
|
||||||
|
}).ToListAsync());
|
||||||
|
|
||||||
|
medicalReviewInfo.TaskList.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.JudgeQuestionAnswerInfoList = visitTaskAnswer.Where(y => y.VisitTaskId == x.TaskId).OrderBy(y => y.ShowOrder).ToList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
return medicalReviewInfo;
|
return medicalReviewInfo;
|
||||||
|
|
||||||
|
|
|
@ -509,144 +509,23 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialReadQuestion
|
public class TrialReadQuestion :ReadingQuestionTrial
|
||||||
{
|
{
|
||||||
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
public int ShowOrder { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分页名称
|
/// 分页名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PageName { get; set; }
|
public string PageName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 问题名称
|
|
||||||
/// </summary>
|
|
||||||
public string QuestionName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 类型
|
|
||||||
/// </summary>
|
|
||||||
public string Type { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 父问题触发
|
|
||||||
/// </summary>
|
|
||||||
public string ParentTriggerValue { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 父问题名称
|
/// 父问题名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ParentQuestionName { get; set; }
|
public string ParentQuestionName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否是必须
|
|
||||||
/// </summary>
|
|
||||||
public IsRequired IsRequired { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否显示
|
|
||||||
/// </summary>
|
|
||||||
public ShowQuestion ShowQuestion { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 类型值
|
|
||||||
/// </summary>
|
|
||||||
public string TypeValue { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 单位
|
|
||||||
/// </summary>
|
|
||||||
public ValueUnit? Unit { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 自定义单位
|
|
||||||
/// </summary>
|
|
||||||
public string CustomUnit { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否启用
|
|
||||||
/// </summary>
|
|
||||||
public bool IsEnable { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否是裁判问题
|
|
||||||
/// </summary>
|
|
||||||
public bool IsJudgeQuestion { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
public string Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 分组
|
|
||||||
/// </summary>
|
|
||||||
public string GroupName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 答案分组
|
|
||||||
/// </summary>
|
|
||||||
public string AnswerGroup { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 答案组合
|
|
||||||
/// </summary>
|
|
||||||
public string AnswerCombination { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 裁判类型
|
|
||||||
/// </summary>
|
|
||||||
public JudgeTypeEnum JudgeType { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 关联Value
|
|
||||||
/// </summary>
|
|
||||||
public string RelevanceValue { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
public int? RelevanceShowOrder { get; set; }
|
public int? RelevanceShowOrder { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public int? ParentQuestionShowOrder { get; set; }
|
public int? ParentQuestionShowOrder { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 病灶类型
|
|
||||||
/// </summary>
|
|
||||||
public LesionType? LesionType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 最大问题数
|
|
||||||
/// </summary>
|
|
||||||
public int? MaxQuestionCount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否显示在Dicom阅片中
|
|
||||||
/// </summary>
|
|
||||||
public bool IsShowInDicom { get; set; } = false;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 序号标记
|
|
||||||
/// </summary>
|
|
||||||
public string OrderMark { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 自定义计算标记
|
|
||||||
/// </summary>
|
|
||||||
public CustomCalculateMark? CustomCalculateMark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 自定义计算标记
|
|
||||||
/// </summary>
|
|
||||||
public string CalculateQuestions { get; set; } = "[]";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialJudgeQuestion
|
public class TrialJudgeQuestion
|
||||||
|
|
Loading…
Reference in New Issue