Compare commits
No commits in common. "efe2e7f063d7529c9d72351bd0678824052d535a" and "ff395f1d56d238501cba6662fad051ad15b6417c" have entirely different histories.
efe2e7f063
...
ff395f1d56
|
|
@ -250,37 +250,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public string TaskBlindName { get; set; }
|
public string TaskBlindName { get; set; }
|
||||||
|
|
||||||
public string SubjectID { get; set; }
|
public string SubjectID { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 靶段
|
|
||||||
/// </summary>
|
|
||||||
public string TargetSegment { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 靶段备注
|
|
||||||
/// </summary>
|
|
||||||
public string TargetSegmentRemarks { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI段落总长度
|
|
||||||
/// </summary>
|
|
||||||
public string ROIAllLength { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 回撤中的图像帧数
|
|
||||||
/// </summary>
|
|
||||||
public string PullbackFrameCount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 斑块类型
|
|
||||||
/// </summary>
|
|
||||||
public string PlaqueType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 访视点备注(如有)
|
|
||||||
/// </summary>
|
|
||||||
public string AdjustReason { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OCTFCTUploadData
|
public class OCTFCTUploadData
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using DocumentFormat.OpenXml.Spreadsheet;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
|
@ -8,7 +6,6 @@ using MassTransit;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
|
@ -21,8 +18,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
|
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
|
||||||
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
|
||||||
IRepository<OrganInfo> _organInfoRepository,
|
IRepository<OrganInfo> _organInfoRepository,
|
||||||
ISubjectVisitService iSubjectVisitService,
|
|
||||||
IRepository<Dictionary> _dictionaryRepository,
|
|
||||||
IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository,
|
IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository,
|
IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository,
|
||||||
|
|
@ -419,64 +414,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x=>x.Subject).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x=>x.Subject).FirstNotNullAsync();
|
||||||
|
|
||||||
//靶段
|
|
||||||
var targetSegmentdic = await _dictionaryRepository.Where(x => x.Parent.Code == "TargetSegment").ToListAsync();
|
|
||||||
|
|
||||||
//斑块类型
|
|
||||||
var plaqueTypedic = await _dictionaryRepository.Where(x => x.Parent.Code == "PlaqueType").ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var awswerList=await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).Include(x=>x.ReadingQuestionTrial).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var targetSegmentAnswer = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.TargetSegment).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
|
||||||
if (targetSegmentAnswer.IsNotNullOrEmpty())
|
|
||||||
{
|
|
||||||
var data= JsonConvert.DeserializeObject<List<string>>(targetSegmentAnswer);
|
|
||||||
targetSegmentAnswer = string.Join(",", targetSegmentdic
|
|
||||||
.Where(x => data.Contains(x.Code))
|
|
||||||
.Select(x => x.ValueCN));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var targetSegmentData = await iSubjectVisitService.GetReadingVisitStudyList(new Contracts.GetReadingVisitStudyListIndto()
|
|
||||||
{
|
|
||||||
SujectVisitId = taskinfo.SourceSubjectVisitId ?? default(Guid),
|
|
||||||
TrialId = taskinfo.TrialId,
|
|
||||||
VisitTaskId = inDto.VisitTaskId
|
|
||||||
});
|
|
||||||
targetSegmentAnswer = string.Join(",", targetSegmentData
|
|
||||||
.Where(x =>x.BodyPartForEdit.IsNotNullOrEmpty())
|
|
||||||
.Select(x => x.BodyPartForEdit));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var plaqueTypeAnswer = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.PlaqueType).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
|
||||||
if (plaqueTypeAnswer.IsNotNullOrEmpty())
|
|
||||||
{
|
|
||||||
var data = JsonConvert.DeserializeObject<List<string>>(plaqueTypeAnswer);
|
|
||||||
plaqueTypeAnswer = string.Join(",", plaqueTypedic
|
|
||||||
.Where(x => data.Contains(x.Code))
|
|
||||||
.Select(x => x.ValueCN));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var values = new TemplateData()
|
var values = new TemplateData()
|
||||||
{
|
{
|
||||||
SubjectID = (taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode),
|
SubjectID = (taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode),
|
||||||
TaskBlindName = taskinfo.TaskBlindName,
|
TaskBlindName = taskinfo.TaskBlindName,
|
||||||
TargetSegment= targetSegmentAnswer,
|
|
||||||
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,
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
||||||
{
|
{
|
||||||
|
|
@ -588,7 +529,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
List<IVUSMeasuredValue> measuredValueList = new List<IVUSMeasuredValue>();
|
List<IVUSMeasuredValue> measuredValueList = new List<IVUSMeasuredValue>();
|
||||||
var errorRow = new List<int> { };
|
var errorRow = new List<int> { };
|
||||||
|
|
||||||
for (int i = 9; i < dataTable.Rows.Count; i++)
|
for (int i = 3; i < dataTable.Rows.Count; i++)
|
||||||
{
|
{
|
||||||
IVUSMeasuredValue iVUSMeasuredValue = new IVUSMeasuredValue() { };
|
IVUSMeasuredValue iVUSMeasuredValue = new IVUSMeasuredValue() { };
|
||||||
try
|
try
|
||||||
|
|
@ -750,100 +691,7 @@ 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.ValueCN)).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.ValueCN.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 _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.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
||||||
using DocumentFormat.OpenXml.Office.SpreadSheetML.Y2023.MsForms;
|
using DocumentFormat.OpenXml.Office.SpreadSheetML.Y2023.MsForms;
|
||||||
using DocumentFormat.OpenXml.Office2010.Excel;
|
using DocumentFormat.OpenXml.Office2010.Excel;
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
|
@ -13,7 +12,6 @@ using MassTransit;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
|
@ -26,8 +24,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
|
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
|
||||||
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
|
||||||
IRepository<OrganInfo> _organInfoRepository,
|
IRepository<OrganInfo> _organInfoRepository,
|
||||||
ISubjectVisitService iSubjectVisitService,
|
|
||||||
IRepository<Dictionary> _dictionaryRepository,
|
|
||||||
IHttpContextAccessor httpContext,
|
IHttpContextAccessor httpContext,
|
||||||
IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository,
|
IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
|
|
@ -275,66 +271,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
public async Task<FileResult> GetOCTFCTTemplate(GetExportTemplateInDto inDto)
|
public async Task<FileResult> GetOCTFCTTemplate(GetExportTemplateInDto inDto)
|
||||||
{
|
{
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).FirstNotNullAsync();
|
||||||
|
|
||||||
//靶段
|
|
||||||
var targetSegmentdic = await _dictionaryRepository.Where(x => x.Parent.Code == "TargetSegment").ToListAsync();
|
|
||||||
|
|
||||||
//斑块类型
|
|
||||||
var plaqueTypedic = await _dictionaryRepository.Where(x => x.Parent.Code == "PlaqueType").ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var awswerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).Include(x => x.ReadingQuestionTrial).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var targetSegmentAnswer = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.TargetSegment).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
|
||||||
if (targetSegmentAnswer.IsNotNullOrEmpty())
|
|
||||||
{
|
|
||||||
var data = JsonConvert.DeserializeObject<List<string>>(targetSegmentAnswer);
|
|
||||||
targetSegmentAnswer = string.Join(",", targetSegmentdic
|
|
||||||
.Where(x => data.Contains(x.Code))
|
|
||||||
.Select(x => x.ValueCN));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var targetSegmentData = await iSubjectVisitService.GetReadingVisitStudyList(new Contracts.GetReadingVisitStudyListIndto()
|
|
||||||
{
|
|
||||||
SujectVisitId = taskinfo.SourceSubjectVisitId ?? default(Guid),
|
|
||||||
TrialId = taskinfo.TrialId,
|
|
||||||
VisitTaskId = inDto.VisitTaskId
|
|
||||||
});
|
|
||||||
targetSegmentAnswer = string.Join(",", targetSegmentData
|
|
||||||
.Where(x => x.BodyPartForEdit.IsNotNullOrEmpty())
|
|
||||||
.Select(x => x.BodyPartForEdit));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var plaqueTypeAnswer = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.PlaqueType).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
|
||||||
if (plaqueTypeAnswer.IsNotNullOrEmpty())
|
|
||||||
{
|
|
||||||
var data = JsonConvert.DeserializeObject<List<string>>(plaqueTypeAnswer);
|
|
||||||
plaqueTypeAnswer = string.Join(",", plaqueTypedic
|
|
||||||
.Where(x => data.Contains(x.Code))
|
|
||||||
.Select(x => x.ValueCN));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var values = new TemplateData()
|
var values = new TemplateData()
|
||||||
{
|
{
|
||||||
SubjectID = (taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode),
|
SubjectID = (taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode),
|
||||||
TaskBlindName = taskinfo.TaskBlindName,
|
TaskBlindName = taskinfo.TaskBlindName,
|
||||||
TargetSegment = targetSegmentAnswer,
|
|
||||||
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,
|
|
||||||
PlaqueType = plaqueTypeAnswer,
|
|
||||||
AdjustReason = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
||||||
{
|
{
|
||||||
|
|
@ -416,12 +356,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 8; i < dataTable.Rows.Count; i++)
|
for (int i = 3; i < dataTable.Rows.Count; i++)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// 手动抛出异常进入catch
|
// 手动抛出异常进入catch
|
||||||
if (!yesOrNo.ContainsKey(dataTable.Rows[i]["K"].ToString())|| !yesOrNo.ContainsKey(dataTable.Rows[i]["L"].ToString()))
|
if (!yesOrNo.ContainsKey(dataTable.Rows[i]["K"].ToString())|| !yesOrNo.ContainsKey(dataTable.Rows[i]["L"].ToString()))
|
||||||
{
|
{
|
||||||
|
|
@ -725,91 +664,6 @@ 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.ValueCN)).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.ValueCN.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 _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.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
|
||||||
|
|
@ -3060,11 +3060,6 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ROIAllLength = 1015,
|
ROIAllLength = 1015,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 斑块类型
|
|
||||||
/// </summary>
|
|
||||||
PlaqueType=1018,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// PAV(冠状动脉粥样硬化体积百分比)
|
/// PAV(冠状动脉粥样硬化体积百分比)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue