导入修改
parent
fdcb81306d
commit
a6a409c750
|
|
@ -588,7 +588,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
List<IVUSMeasuredValue> measuredValueList = new List<IVUSMeasuredValue>();
|
||||
var errorRow = new List<int> { };
|
||||
|
||||
for (int i = 3; i < dataTable.Rows.Count; i++)
|
||||
for (int i = 8; i < dataTable.Rows.Count; i++)
|
||||
{
|
||||
IVUSMeasuredValue iVUSMeasuredValue = new IVUSMeasuredValue() { };
|
||||
try
|
||||
|
|
@ -750,7 +750,100 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
}
|
||||
}
|
||||
|
||||
#region 构造外层问题答案
|
||||
List<ReadingTaskQuestionAnswer> questionAnswers = new List<ReadingTaskQuestionAnswer>();
|
||||
|
||||
var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).ToListAsync();
|
||||
var targetSegmentAnswer = dataTable.Rows[2]["B"].ToString();
|
||||
|
||||
if (targetSegmentAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var targetSegmentValues = targetSegmentAnswer.Replace(",", ",").Split(",").ToList();
|
||||
var targetSegmentdic = await _dictionaryRepository.Where(x => x.Parent.Code == "TargetSegment").ToListAsync();
|
||||
targetSegmentAnswer = JsonConvert.SerializeObject(targetSegmentdic.Where(x => targetSegmentValues.Contains(x.Value)).Select(x => x.Code).ToList());
|
||||
}
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer= targetSegmentAnswer??string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.TargetSegment).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId= taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = dataTable.Rows[3]["B"].ToString()??string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.TargetSegmentRemarks).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId = taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = dataTable.Rows[4]["B"].ToString() ?? string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.ROIAllLength).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId = taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = dataTable.Rows[5]["B"].ToString() ?? string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.PullbackFrameCount).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId = taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
|
||||
var plaqueTypeAnswer = dataTable.Rows[6]["B"].ToString();
|
||||
|
||||
if (plaqueTypeAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var plaqueTypeAnswerValues = plaqueTypeAnswer.Replace(",", ",").Split(",").ToList();
|
||||
var plaqueTypeAnswerdic = await _dictionaryRepository.Where(x => x.Parent.Code == "PlaqueType").ToListAsync();
|
||||
plaqueTypeAnswer = JsonConvert.SerializeObject(plaqueTypeAnswerdic
|
||||
.Where(x => plaqueTypeAnswerValues.Any(val => x.Value.Contains(val)))
|
||||
.Select(x => x.Code)
|
||||
.ToList());
|
||||
}
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = plaqueTypeAnswer ?? string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.PlaqueType).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId = taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = dataTable.Rows[7]["B"].ToString() ?? string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.AdjustReason).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId = taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
var questionids = questionAnswers.Select(x => x.ReadingQuestionTrialId).ToList();
|
||||
await _readingTaskQuestionAnswerRepository.DeleteFromQueryAsync(x => x.VisitTaskId == taskinfo.Id && questionids.Contains(x.ReadingQuestionTrialId));
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
await _readingTaskQuestionAnswerRepository.AddRangeAsync(questionAnswers);
|
||||
await _readingTaskQuestionAnswerRepository.SaveChangesAsync();
|
||||
#endregion
|
||||
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
|
|
|||
|
|
@ -329,8 +329,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
TargetSegmentRemarks = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.TargetSegmentRemarks).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
ROIAllLength = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.ROIAllLength).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
//PullbackFrameCount = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.PullbackFrameCount).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
AdjustReason = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
PlaqueType = plaqueTypeAnswer,
|
||||
AdjustReason = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -723,6 +724,91 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
#region 构造外层问题答案
|
||||
List<ReadingTaskQuestionAnswer> questionAnswers = new List<ReadingTaskQuestionAnswer>();
|
||||
|
||||
var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).ToListAsync();
|
||||
var targetSegmentAnswer = dataTable.Rows[2]["B"].ToString();
|
||||
|
||||
if (targetSegmentAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var targetSegmentValues = targetSegmentAnswer.Replace(",", ",").Split(",").ToList();
|
||||
var targetSegmentdic = await _dictionaryRepository.Where(x => x.Parent.Code == "TargetSegment").ToListAsync();
|
||||
targetSegmentAnswer = JsonConvert.SerializeObject(targetSegmentdic.Where(x => targetSegmentValues.Contains(x.Value)).Select(x => x.Code).ToList());
|
||||
}
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = targetSegmentAnswer ?? string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.TargetSegment).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId = taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = dataTable.Rows[3]["B"].ToString() ?? string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.TargetSegmentRemarks).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId = taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = dataTable.Rows[4]["B"].ToString() ?? string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.ROIAllLength).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId = taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
|
||||
var plaqueTypeAnswer = dataTable.Rows[5]["B"].ToString();
|
||||
|
||||
if (plaqueTypeAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var plaqueTypeAnswerValues = plaqueTypeAnswer.Replace(",", ",").Split(",").ToList();
|
||||
var plaqueTypeAnswerdic = await _dictionaryRepository.Where(x => x.Parent.Code == "PlaqueType").ToListAsync();
|
||||
plaqueTypeAnswer = JsonConvert.SerializeObject(plaqueTypeAnswerdic
|
||||
.Where(x => plaqueTypeAnswerValues.Any(val => x.Value.Contains(val)))
|
||||
.Select(x => x.Code)
|
||||
.ToList());
|
||||
}
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = plaqueTypeAnswer ?? string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.PlaqueType).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId = taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
questionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = dataTable.Rows[6]["B"].ToString() ?? string.Empty,
|
||||
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||
ReadingQuestionTrialId = readingQuestionList.Where(x => x.QuestionType == QuestionType.AdjustReason).Select(x => x.Id).FirstOrDefault(),
|
||||
TrialId = taskinfo.TrialId,
|
||||
SubjectId = taskinfo.SubjectId,
|
||||
VisitTaskId = taskinfo.Id,
|
||||
});
|
||||
|
||||
var questionids = questionAnswers.Select(x => x.ReadingQuestionTrialId).ToList();
|
||||
await _readingTaskQuestionAnswerRepository.DeleteFromQueryAsync(x => x.VisitTaskId == taskinfo.Id && questionids.Contains(x.ReadingQuestionTrialId));
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
await _readingTaskQuestionAnswerRepository.AddRangeAsync(questionAnswers);
|
||||
await _readingTaskQuestionAnswerRepository.SaveChangesAsync();
|
||||
#endregion
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
|
|
|||
Loading…
Reference in New Issue