OCT 修改1
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
ae624730aa
commit
31158fed0e
|
|
@ -244,11 +244,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public class OCTFCTUploadData
|
public class OCTFCTUploadData
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 斑块编号
|
|
||||||
/// </summary>
|
|
||||||
public int PlaqueNum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 第一次
|
/// 第一次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -290,7 +285,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? LumenAreaMeasurement { get; set; }
|
public decimal? LumenAreaMeasurement { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 脂质角度
|
||||||
|
/// </summary>
|
||||||
|
public decimal? LipidAngle { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public decimal Avg { get {
|
public decimal Avg { get {
|
||||||
|
|
|
||||||
|
|
@ -338,15 +338,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
measuredValueList.Add(new OCTFCTUploadData()
|
measuredValueList.Add(new OCTFCTUploadData()
|
||||||
{
|
{
|
||||||
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
//PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
||||||
FirstData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
FirstData = getdecimalData(dataTable.Rows[i]["A"].ToString()),
|
||||||
SecondData = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
SecondData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||||
ThirdData = getdecimalData(dataTable.Rows[i]["D"].ToString()),
|
ThirdData = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
||||||
MacrophageInfiltrationMeasurement = dataTable.Rows[i]["E"].ToString() ?? string.Empty,
|
MacrophageInfiltrationMeasurement = dataTable.Rows[i]["D"].ToString() ?? string.Empty,
|
||||||
MacrophageInfiltrationAngle = getdecimalEmptyData(dataTable.Rows[i]["F"].ToString() ?? string.Empty),
|
MacrophageInfiltrationAngle = getdecimalEmptyData(dataTable.Rows[i]["E"].ToString() ?? string.Empty),
|
||||||
MicrochannelMeasurement =dataTable.Rows[i]["G"].ToString() ?? string.Empty,
|
MicrochannelMeasurement =dataTable.Rows[i]["F"].ToString() ?? string.Empty,
|
||||||
CholesterolCrystalMeasurement = dataTable.Rows[i]["H"].ToString() ?? string.Empty,
|
CholesterolCrystalMeasurement = dataTable.Rows[i]["G"].ToString() ?? string.Empty,
|
||||||
LumenAreaMeasurement = getdecimalEmptyData(dataTable.Rows[i]["I"].ToString() ?? string.Empty),
|
LumenAreaMeasurement = getdecimalEmptyData(dataTable.Rows[i]["H"].ToString() ?? string.Empty),
|
||||||
|
LipidAngle = getdecimalEmptyData(dataTable.Rows[i]["I"].ToString() ?? string.Empty),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|
@ -356,7 +357,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -366,12 +367,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<int> nums = new List<int>() { 1, 2, 3 };
|
|
||||||
if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
Dictionary<string, string> isPresent = new Dictionary<string, string>()
|
Dictionary<string, string> isPresent = new Dictionary<string, string>()
|
||||||
{
|
{
|
||||||
{ "有","1"},
|
{ "有","1"},
|
||||||
|
|
@ -442,16 +437,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
});
|
});
|
||||||
|
|
||||||
// 编号
|
// 编号
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
//tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
//{
|
||||||
Answer = item.PlaqueNum.ToString(),
|
// Answer = item.PlaqueNum.ToString(),
|
||||||
QuestionId = questionInfo.Id,
|
// QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
// TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
// VisitTaskId = taskinfo.Id,
|
||||||
RowId = newRowId,
|
// RowId = newRowId,
|
||||||
RowIndex = maxnum,
|
// RowIndex = maxnum,
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
||||||
});
|
//});
|
||||||
|
|
||||||
var avg = item.Avg.ToString();
|
var avg = item.Avg.ToString();
|
||||||
|
|
||||||
|
|
@ -570,6 +565,18 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LumenAreaMeasurement).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LumenAreaMeasurement).Select(x => x.Id).FirstOrDefault(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 脂质角度
|
||||||
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
|
{
|
||||||
|
Answer = item.LipidAngle.ToString(),
|
||||||
|
QuestionId = questionInfo.Id,
|
||||||
|
TrialId = taskinfo.TrialId,
|
||||||
|
VisitTaskId = taskinfo.Id,
|
||||||
|
RowId = newRowId,
|
||||||
|
RowIndex = maxnum,
|
||||||
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(),
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
@ -636,173 +643,176 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task UploadOCTLipidAngleTemplate()
|
public async Task UploadOCTLipidAngleTemplate()
|
||||||
{
|
{
|
||||||
var request = httpContext.HttpContext!.Request;
|
#region 这个导入没有了 代码全部注释
|
||||||
var file = request.Form.Files[0];
|
//var request = httpContext.HttpContext!.Request;
|
||||||
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
//var file = request.Form.Files[0];
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
//Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
||||||
var uploadInfo = await _generalCalculateService.GetDataTableFromUpload(file, "OCTLipidAngle", taskinfo.TrialId);
|
//var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
List<string> sheetNames = new List<string>()
|
//var uploadInfo = await _generalCalculateService.GetDataTableFromUpload(file, "OCTLipidAngle", taskinfo.TrialId);
|
||||||
{
|
//List<string> sheetNames = new List<string>()
|
||||||
"脂质角度","LipidAngle"
|
//{
|
||||||
};
|
// "脂质角度","LipidAngle"
|
||||||
|
//};
|
||||||
|
|
||||||
if (sheetNames.Intersect(uploadInfo.SheetNames).Count() == 0)
|
//if (sheetNames.Intersect(uploadInfo.SheetNames).Count() == 0)
|
||||||
{
|
//{
|
||||||
throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]);
|
// throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]);
|
||||||
}
|
//}
|
||||||
var dataTable = uploadInfo.DataTable;
|
//var dataTable = uploadInfo.DataTable;
|
||||||
|
|
||||||
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,
|
||||||
};
|
//};
|
||||||
|
|
||||||
if (values.SubjectID != dataTable.Rows[0]["B"].ToString() || values.TaskBlindName != dataTable.Rows[1]["B"].ToString())
|
//if (values.SubjectID != dataTable.Rows[0]["B"].ToString() || values.TaskBlindName != dataTable.Rows[1]["B"].ToString())
|
||||||
{
|
//{
|
||||||
throw new BusinessValidationFailedException(_localizer["IVUS_UploadVisitTaskError"]);
|
// throw new BusinessValidationFailedException(_localizer["IVUS_UploadVisitTaskError"]);
|
||||||
}
|
//}
|
||||||
|
|
||||||
var digitPlaces = taskinfo.TrialReadingCriterion.DigitPlaces ?? 0;
|
//var digitPlaces = taskinfo.TrialReadingCriterion.DigitPlaces ?? 0;
|
||||||
decimal getdecimalData(string value)
|
//decimal getdecimalData(string value)
|
||||||
{
|
//{
|
||||||
return decimal.Parse(decimal.Round(decimal.Parse(value ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString()));
|
// return decimal.Parse(decimal.Round(decimal.Parse(value ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString()));
|
||||||
}
|
//}
|
||||||
;
|
//;
|
||||||
|
|
||||||
List<OCTFCTUploadData> measuredValueList = new List<OCTFCTUploadData>();
|
//List<OCTFCTUploadData> measuredValueList = new List<OCTFCTUploadData>();
|
||||||
var errorRow = new List<int> { };
|
//var errorRow = new List<int> { };
|
||||||
|
|
||||||
for (int i = 3; i < dataTable.Rows.Count; i++)
|
//for (int i = 3; i < dataTable.Rows.Count; i++)
|
||||||
{
|
//{
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
measuredValueList.Add(new OCTFCTUploadData()
|
// measuredValueList.Add(new OCTFCTUploadData()
|
||||||
{
|
// {
|
||||||
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
// PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
||||||
FirstData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
// FirstData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||||
|
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
catch (Exception)
|
// catch (Exception)
|
||||||
{
|
// {
|
||||||
|
|
||||||
errorRow.Add(i+1);
|
// errorRow.Add(i + 1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
//measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||||
|
|
||||||
if (errorRow.Count() > 0)
|
//if (errorRow.Count() > 0)
|
||||||
{
|
//{
|
||||||
var errorRows = string.Join(',', errorRow.Select(i => i.ToString()));
|
// var errorRows = string.Join(',', errorRow.Select(i => i.ToString()));
|
||||||
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
// throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
List<int> nums = new List<int>() { 1, 2, 3 };
|
//List<int> nums = new List<int>() { 1, 2, 3 };
|
||||||
if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
//if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
||||||
{
|
//{
|
||||||
throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
// throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in measuredValueList)
|
//foreach (var item in measuredValueList)
|
||||||
{
|
//{
|
||||||
if (item.FirstData > 360)
|
// if (item.FirstData > 360)
|
||||||
{
|
// {
|
||||||
throw new BusinessValidationFailedException(_localizer["IVUS_LipidAngleLess360"]);
|
// throw new BusinessValidationFailedException(_localizer["IVUS_LipidAngleLess360"]);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.LipidAngle).FirstNotNullAsync();
|
//var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.LipidAngle).FirstNotNullAsync();
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
//var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
||||||
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
//List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
||||||
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
//List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
||||||
var maxnum = 0;
|
//var maxnum = 0;
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in measuredValueList)
|
//foreach (var item in measuredValueList)
|
||||||
{
|
//{
|
||||||
maxnum = maxnum + 1;
|
// maxnum = maxnum + 1;
|
||||||
var newRowId = NewId.NextGuid();
|
// var newRowId = NewId.NextGuid();
|
||||||
// 斑块数据统计
|
// // 斑块数据统计
|
||||||
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
// tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
||||||
{
|
// {
|
||||||
Id = newRowId,
|
// Id = newRowId,
|
||||||
QuestionId = questionInfo.Id,
|
// QuestionId = questionInfo.Id,
|
||||||
VisitTaskId = taskinfo.Id,
|
// VisitTaskId = taskinfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
// TrialId = taskinfo.TrialId,
|
||||||
RowIndex = maxnum,
|
// RowIndex = maxnum,
|
||||||
IsCurrentTaskAdd = true,
|
// IsCurrentTaskAdd = true,
|
||||||
BlindName = taskinfo.TaskBlindName,
|
// BlindName = taskinfo.TaskBlindName,
|
||||||
OrderMark = questionInfo.OrderMark,
|
// OrderMark = questionInfo.OrderMark,
|
||||||
FristAddTaskId = taskinfo.Id,
|
// FristAddTaskId = taskinfo.Id,
|
||||||
RowMark = questionInfo.OrderMark + decimal.Parse(maxnum.ToString()).GetLesionMark()
|
// RowMark = questionInfo.OrderMark + decimal.Parse(maxnum.ToString()).GetLesionMark()
|
||||||
});
|
// });
|
||||||
|
|
||||||
// 编号
|
// // 编号
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
// tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
// {
|
||||||
Answer = item.PlaqueNum.ToString(),
|
// Answer = item.PlaqueNum.ToString(),
|
||||||
QuestionId = questionInfo.Id,
|
// QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
// TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
// VisitTaskId = taskinfo.Id,
|
||||||
RowId = newRowId,
|
// RowId = newRowId,
|
||||||
RowIndex = maxnum,
|
// RowIndex = maxnum,
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
||||||
});
|
// });
|
||||||
|
|
||||||
var avg = item.Avg.ToString();
|
// var avg = item.Avg.ToString();
|
||||||
|
|
||||||
|
|
||||||
if (taskinfo.TrialReadingCriterion.DigitPlaces != -1)
|
// if (taskinfo.TrialReadingCriterion.DigitPlaces != -1)
|
||||||
{
|
// {
|
||||||
avg = decimal.Round(decimal.Parse(avg ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
// avg = decimal.Round(decimal.Parse(avg ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 脂质角度
|
// // 脂质角度
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
// tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
// {
|
||||||
Answer = item.FirstData.ToString(),
|
// Answer = item.FirstData.ToString(),
|
||||||
QuestionId = questionInfo.Id,
|
// QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
// TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
// VisitTaskId = taskinfo.Id,
|
||||||
RowId = newRowId,
|
// RowId = newRowId,
|
||||||
RowIndex = maxnum,
|
// RowIndex = maxnum,
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(),
|
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(),
|
||||||
});
|
// });
|
||||||
|
|
||||||
// 添加其他问题答案
|
// // 添加其他问题答案
|
||||||
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
// foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
||||||
{
|
// {
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
// tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
{
|
// {
|
||||||
Answer = string.Empty,
|
// Answer = string.Empty,
|
||||||
QuestionId = questionInfo.Id,
|
// QuestionId = questionInfo.Id,
|
||||||
TrialId = taskinfo.TrialId,
|
// TrialId = taskinfo.TrialId,
|
||||||
VisitTaskId = taskinfo.Id,
|
// VisitTaskId = taskinfo.Id,
|
||||||
RowId = newRowId,
|
// RowId = newRowId,
|
||||||
RowIndex = maxnum,
|
// RowIndex = maxnum,
|
||||||
TableQuestionId = otherQuestion.Id,
|
// TableQuestionId = otherQuestion.Id,
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
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();
|
||||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(tableAnsweRowInfos);
|
//await _readingTableAnswerRowInfoRepository.AddRangeAsync(tableAnsweRowInfos);
|
||||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
//await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
//await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
||||||
await this.CalculateTask(new CalculateTaskInDto()
|
//await this.CalculateTask(new CalculateTaskInDto()
|
||||||
{
|
//{
|
||||||
|
|
||||||
|
// VisitTaskId = taskinfo.Id,
|
||||||
|
//});
|
||||||
|
#endregion
|
||||||
|
|
||||||
VisitTaskId = taskinfo.Id,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -814,7 +824,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task ReadingCalculate(ReadingCalculateDto inDto, List<QuestionType>? calculateType = null)
|
public async Task ReadingCalculate(ReadingCalculateDto inDto, List<QuestionType>? calculateType = null)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
||||||
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
||||||
|
|
||||||
|
|
@ -824,23 +834,33 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
ComputationTrigger.SaveEICRFQuestions,
|
ComputationTrigger.SaveEICRFQuestions,
|
||||||
|
|
||||||
};
|
};
|
||||||
if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
//if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
||||||
{
|
//{
|
||||||
// 计算斑块统计数据
|
// // 计算斑块统计数据
|
||||||
await this.CalculatePatchDataStatistics(inDto);
|
// await this.CalculatePatchDataStatistics(inDto);
|
||||||
inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
// inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
||||||
}
|
//}
|
||||||
|
|
||||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||||
{
|
{
|
||||||
// 斑块1-匹配动脉段最小FCT
|
//// 斑块1-匹配动脉段最小FCT
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.Plaque1MinFCT,GetDecimalNullFun=GetPlaque1MinFCT},
|
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque1MinFCT,GetDecimalNullFun=GetPlaque1MinFCT},
|
||||||
|
|
||||||
// 斑块2-匹配动脉段最小FCT
|
// // 斑块2-匹配动脉段最小FCT
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.Plaque2MinFCT,GetDecimalNullFun=GetPlaque2MinFCT},
|
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque2MinFCT,GetDecimalNullFun=GetPlaque2MinFCT},
|
||||||
|
|
||||||
// 斑块3-匹配动脉段最小FCT
|
// // 斑块3-匹配动脉段最小FCT
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.Plaque3MinFCT,GetDecimalNullFun=GetPlaque3MinFCT},
|
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque3MinFCT,GetDecimalNullFun=GetPlaque3MinFCT},
|
||||||
|
|
||||||
|
|
||||||
|
// 匹配动脉段最小FCT
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.MatchingTheMinimumFCT,GetDecimalNullFun=GetMinFCT},
|
||||||
|
|
||||||
|
// 平均最小FCT
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.AvgMinFCT,GetDecimalNullFun=GetAvgFCT},
|
||||||
|
|
||||||
|
// 脂质角度平均值
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.AvgLipidAngle,GetDecimalNullFun=GetAvgLipidAngle},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1220,6 +1240,41 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
.Where(x => x.QuestionMark == QuestionMark.MiniMumFCT).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturnNull();
|
.Where(x => x.QuestionMark == QuestionMark.MiniMumFCT).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturnNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 匹配动脉段最小FCT (平均值的最小值)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<decimal?> GetMinFCT(ReadingCalculateDto inDto)
|
||||||
|
{
|
||||||
|
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FCT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||||
|
.Where(x => x.QuestionMark == QuestionMark.AvgFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).MinOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 平均最小FCT (平均值的平均值)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<decimal?> GetAvgFCT(ReadingCalculateDto inDto)
|
||||||
|
{
|
||||||
|
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FCT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||||
|
.Where(x => x.QuestionMark == QuestionMark.AvgFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).Average();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 脂质角度平均值
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<decimal?> GetAvgLipidAngle(ReadingCalculateDto inDto)
|
||||||
|
{
|
||||||
|
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FCT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||||
|
.Where(x => x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Answer.IsNullOrEmptyReturn0()).Average();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 验证访视提交
|
/// 验证访视提交
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -2970,6 +2970,41 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TargetSegmentRemarks = 1012,
|
TargetSegmentRemarks = 1012,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ROI起始回撤距离
|
||||||
|
/// </summary>
|
||||||
|
ROIStart = 1013,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ROI终止回撤距离
|
||||||
|
/// </summary>
|
||||||
|
ROIEnd = 1014,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ROI段落总长度
|
||||||
|
/// </summary>
|
||||||
|
ROIAllLength = 1015,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 匹配动脉段最小FCT
|
||||||
|
/// </summary>
|
||||||
|
MatchingTheMinimumFCT = 1022,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 平均最小FCT
|
||||||
|
/// </summary>
|
||||||
|
AvgMinFCT = 1023,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 脂质角度平均值
|
||||||
|
/// </summary>
|
||||||
|
AvgLipidAngle = 1024,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 脂质角度最大值
|
||||||
|
/// </summary>
|
||||||
|
MaxLipidAngle = 1025,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 脂肪分数总平均值
|
/// 脂肪分数总平均值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue