Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
dfecd1cb3b
|
@ -3494,6 +3494,11 @@
|
||||||
当新答案为空的时候 是否是有原数据
|
当新答案为空的时候 是否是有原数据
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GlobalVisitInfo.IsConvertedTask">
|
||||||
|
<summary>
|
||||||
|
是否是转变的任务(转为IRECIST)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GlobalQuestionInfo.QuestionType">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GlobalQuestionInfo.QuestionType">
|
||||||
<summary>
|
<summary>
|
||||||
问题类型
|
问题类型
|
||||||
|
|
|
@ -160,6 +160,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
x.VisitTaskId = taskInfo.Id;
|
x.VisitTaskId = taskInfo.Id;
|
||||||
x.IsCurrentTaskAdd = false;
|
x.IsCurrentTaskAdd = false;
|
||||||
|
x.FristAddTaskId = taskInfo.Id;
|
||||||
x.Id = NewId.NextGuid();
|
x.Id = NewId.NextGuid();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -213,20 +214,36 @@ namespace IRaCIS.Core.Application.Service
|
||||||
// 找到表格问题
|
// 找到表格问题
|
||||||
var otherLesionTableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == otherLesionQuestion.Id).ToListAsync();
|
var otherLesionTableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == otherLesionQuestion.Id).ToListAsync();
|
||||||
|
|
||||||
|
// 找到病灶状态
|
||||||
|
var newstateQuestionId = newLesionTableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x=>x.Id).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
|
var stateAnswers = new List<string>() {
|
||||||
|
NewLesionState.Loss.GetEnumInt(),
|
||||||
|
NewLesionState.Suspected.GetEnumInt(),
|
||||||
|
NewLesionState.UnableEvaluate.GetEnumInt()
|
||||||
|
};
|
||||||
|
|
||||||
|
var needRowIds= tableAnswer.Where(x => x.TableQuestionId == newstateQuestionId && stateAnswers.Contains(x.Answer)).Select(x => x.RowId).Distinct().ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
addrowInfo.ForEach(x =>
|
addrowInfo.ForEach(x =>
|
||||||
{
|
{
|
||||||
|
if (needRowIds.Contains(x.Id))
|
||||||
if (x.QuestionId == newLesionQuestion.Id)
|
|
||||||
{
|
{
|
||||||
x.QuestionId = otherLesionQuestion.Id;
|
x.QuestionId = otherLesionQuestion.Id;
|
||||||
x.OrderMark = otherLesionQuestion.OrderMark;
|
x.OrderMark = otherLesionQuestion.OrderMark;
|
||||||
x.RowMark = otherLesionQuestion.OrderMark + x.RowIndex.GetLesionMark();
|
x.RowMark = otherLesionQuestion.OrderMark + x.RowIndex.GetLesionMark();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
tableAnswer.ForEach(x =>
|
tableAnswer.ForEach(x =>
|
||||||
{
|
{
|
||||||
if (x.QuestionId == newLesionQuestion.Id)
|
if (needRowIds.Contains(x.RowId))
|
||||||
{
|
{
|
||||||
x.QuestionId = otherLesionQuestion.Id;
|
x.QuestionId = otherLesionQuestion.Id;
|
||||||
|
|
||||||
|
@ -1619,6 +1636,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var task1 = await _visitTaskRepository.AddAsync(new VisitTask()
|
var task1 = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
{
|
{
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
|
IsConvertedTask= originalTaskInfo.IsConvertedTask,
|
||||||
SubjectId = item.SubjectId,
|
SubjectId = item.SubjectId,
|
||||||
IsUrgent = originalTaskInfo.IsUrgent,
|
IsUrgent = originalTaskInfo.IsUrgent,
|
||||||
VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global],
|
VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global],
|
||||||
|
@ -1670,6 +1688,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
SubjectId = item.SubjectId,
|
SubjectId = item.SubjectId,
|
||||||
IsUrgent = originalTaskInfo.IsUrgent,
|
IsUrgent = originalTaskInfo.IsUrgent,
|
||||||
TaskName = item.ReadingName,
|
TaskName = item.ReadingName,
|
||||||
|
IsConvertedTask= originalTaskInfo.IsConvertedTask,
|
||||||
// 原任务是全局任务 加0.03 就好
|
// 原任务是全局任务 加0.03 就好
|
||||||
VisitTaskNum = originalTaskInfo.VisitTaskNum + 0.03m,
|
VisitTaskNum = originalTaskInfo.VisitTaskNum + 0.03m,
|
||||||
ArmEnum = Arm.TumorArm, //特殊
|
ArmEnum = Arm.TumorArm, //特殊
|
||||||
|
|
|
@ -1141,6 +1141,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public Arm ArmEnum { get; set; }
|
public Arm ArmEnum { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是转变的任务(转为IRECIST)
|
||||||
|
/// </summary>
|
||||||
|
public bool IsConvertedTask { get; set; } = false;
|
||||||
|
|
||||||
|
public bool IsFirstChangeTask { get; set; } = false;
|
||||||
|
|
||||||
public string AgreeOrNotAnswer
|
public string AgreeOrNotAnswer
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -224,6 +224,8 @@ namespace IRaCIS.Application.Services
|
||||||
VisitName = x.TaskName,
|
VisitName = x.TaskName,
|
||||||
BlindName = x.TaskBlindName,
|
BlindName = x.TaskBlindName,
|
||||||
VisitTaskId = x.Id,
|
VisitTaskId = x.Id,
|
||||||
|
IsConvertedTask = x.IsConvertedTask,
|
||||||
|
IsFirstChangeTask = x.IsConvertedTask && x.BeforeConvertedTaskId != null,
|
||||||
ArmEnum = taskInfo.ArmEnum,
|
ArmEnum = taskInfo.ArmEnum,
|
||||||
VisitNum = x.SourceSubjectVisit.VisitNum,
|
VisitNum = x.SourceSubjectVisit.VisitNum,
|
||||||
IsBaseLine = x.SourceSubjectVisit.IsBaseLine,
|
IsBaseLine = x.SourceSubjectVisit.IsBaseLine,
|
||||||
|
|
|
@ -1377,7 +1377,10 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
await VerifyTaskIsSign(inDto.VisitTaskId);
|
await VerifyTaskIsSign(inDto.VisitTaskId);
|
||||||
|
|
||||||
var deleteRowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).FirstNotNullAsync();
|
|
||||||
|
|
||||||
|
var deleteRowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
if (deleteRowInfo == null)
|
if (deleteRowInfo == null)
|
||||||
{
|
{
|
||||||
return ResponseOutput.Ok(true);
|
return ResponseOutput.Ok(true);
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
|
||||||
[ApiExplorerSettings(GroupName = "Reading")]
|
[ApiExplorerSettings(GroupName = "Reading")]
|
||||||
public class RECIST1Point1CalculateService : BaseService, ICriterionCalculateService
|
public class IRECIST1Point1CalculateService : BaseService, ICriterionCalculateService
|
||||||
{
|
{
|
||||||
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
|
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
|
||||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||||
|
@ -26,11 +26,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
private readonly IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository;
|
private readonly IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository;
|
||||||
private readonly IGeneralCalculateService _generalCalculateService;
|
private readonly IGeneralCalculateService _generalCalculateService;
|
||||||
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
|
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
|
||||||
|
|
||||||
public RECIST1Point1CalculateService(
|
public IRECIST1Point1CalculateService(
|
||||||
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
||||||
IRepository<VisitTask> visitTaskRepository,
|
IRepository<VisitTask> visitTaskRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
||||||
|
@ -39,7 +39,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||||
IRepository<OrganInfo> organInfoRepository,
|
IRepository<OrganInfo> organInfoRepository,
|
||||||
IRepository<SubjectVisit> subjectVisitRepository,
|
IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository,
|
IRepository<TumorAssessment_IRECIST1Point1> tumorAssessmentRepository,
|
||||||
IGeneralCalculateService generalCalculateService,
|
IGeneralCalculateService generalCalculateService,
|
||||||
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository
|
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository
|
||||||
)
|
)
|
||||||
|
@ -111,6 +111,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync();
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo<TableAnsweRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo<TableAnsweRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
var lesionsIndexs = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).GroupBy(x => new { x.QuestionId }).Select(x => new lesionsIndexDto()
|
||||||
|
{
|
||||||
|
QuestionId = x.Key.QuestionId,
|
||||||
|
Rowindexs = x.Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList()
|
||||||
|
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
|
|
||||||
|
@ -198,19 +205,27 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
var rowlist = tableAnsweRowInfos.Where(x => x.QuestionId == question.QuestionId).OrderBy(x => x.RowIndex).ToList();
|
var rowlist = tableAnsweRowInfos.Where(x => x.QuestionId == question.QuestionId).OrderBy(x => x.RowIndex).ToList();
|
||||||
|
|
||||||
|
question.Childrens = new List<ReadingReportDto>();
|
||||||
|
|
||||||
question.Childrens = rowlist.Select(x => new ReadingReportDto()
|
var rowoindexs = lesionsIndexs.Where(x => x.QuestionId == question.QuestionId).Select(x => x.Rowindexs.OrderBy(y => y).ToList()).FirstOrDefault();
|
||||||
|
rowoindexs = rowoindexs == null ? new List<decimal>() : rowoindexs;
|
||||||
|
foreach (var rowoindex in rowoindexs)
|
||||||
{
|
{
|
||||||
QuestionName = question.OrderMark + x.RowIndex.GetLesionMark(),
|
var rowinfo = rowlist.Where(x => x.RowIndex == rowoindex).FirstOrDefault();
|
||||||
SplitOrMergeLesionName = x.MergeName.IsNullOrEmpty() ? x.SplitName : x.MergeName,
|
question.Childrens.Add(new ReadingReportDto()
|
||||||
SplitOrMergeType = x.SplitOrMergeType,
|
{
|
||||||
LesionType = question.LesionType,
|
QuestionName = question.OrderMark + rowoindex.GetLesionMark(),
|
||||||
|
RowId = rowinfo?.Id,
|
||||||
IsShowInDicom = question.IsShowInDicom,
|
IsShowInDicom = question.IsShowInDicom,
|
||||||
IsCanEditPosition = x.IsCanEditPosition,
|
SplitOrMergeLesionName = rowinfo != null ? (rowinfo.MergeName.IsNullOrEmpty() ? rowinfo.SplitName : rowinfo.MergeName) : string.Empty,
|
||||||
RowIndex = x.RowIndex,
|
SplitOrMergeType = rowinfo != null ? (rowinfo.SplitOrMergeType) : null,
|
||||||
BlindName = x.BlindName,
|
LesionType = question.LesionType,
|
||||||
|
IsCanEditPosition = rowinfo != null ? (rowinfo.IsCanEditPosition) : false,
|
||||||
|
RowIndex = rowoindex,
|
||||||
|
BlindName = rowinfo != null ? rowinfo.BlindName : string.Empty,
|
||||||
ReportLayType = ReportLayType.Lesions,
|
ReportLayType = ReportLayType.Lesions,
|
||||||
}).ToList();
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach (var row in question.Childrens)
|
foreach (var row in question.Childrens)
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
|
||||||
[ApiExplorerSettings(GroupName = "Reading")]
|
[ApiExplorerSettings(GroupName = "Reading")]
|
||||||
public class IRECIST1Point1CalculateService : BaseService, ICriterionCalculateService
|
public class RECIST1Point1CalculateService : BaseService, ICriterionCalculateService
|
||||||
{
|
{
|
||||||
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
|
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
|
||||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||||
|
@ -26,11 +26,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
private readonly IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository;
|
private readonly IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository;
|
||||||
private readonly IGeneralCalculateService _generalCalculateService;
|
private readonly IGeneralCalculateService _generalCalculateService;
|
||||||
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
|
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
|
||||||
|
|
||||||
public IRECIST1Point1CalculateService(
|
public RECIST1Point1CalculateService(
|
||||||
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
||||||
IRepository<VisitTask> visitTaskRepository,
|
IRepository<VisitTask> visitTaskRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
||||||
|
@ -39,7 +39,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||||
IRepository<OrganInfo> organInfoRepository,
|
IRepository<OrganInfo> organInfoRepository,
|
||||||
IRepository<SubjectVisit> subjectVisitRepository,
|
IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IRepository<TumorAssessment_IRECIST1Point1> tumorAssessmentRepository,
|
IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository,
|
||||||
IGeneralCalculateService generalCalculateService,
|
IGeneralCalculateService generalCalculateService,
|
||||||
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository
|
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue