OCT导入修改1
parent
7e39692cc4
commit
6fcb670a89
|
|
@ -264,6 +264,35 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
/// </summary>
|
||||
public int ThirdData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巨噬细胞浸润测量
|
||||
/// </summary>
|
||||
public string MacrophageInfiltrationMeasurement { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 巨噬细胞浸润角度测量
|
||||
/// </summary>
|
||||
public string MacrophageInfiltrationAngle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微通道测量
|
||||
/// </summary>
|
||||
public string MicrochannelMeasurement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 胆固醇结晶测量
|
||||
/// </summary>
|
||||
public string CholesterolCrystalMeasurement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 官腔面积测量
|
||||
/// </summary>
|
||||
public string LumenAreaMeasurement { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public decimal Avg { get {
|
||||
|
||||
return ( FirstData*1m + SecondData * 1m + ThirdData * 1m) / 3;
|
||||
|
|
@ -282,6 +311,27 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
/// 值
|
||||
/// </summary>
|
||||
public decimal Data { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巨噬细胞浸润测量
|
||||
/// </summary>
|
||||
public string MacrophageInfiltrationMeasurement { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 巨噬细胞浸润角度测量
|
||||
/// </summary>
|
||||
public decimal MacrophageInfiltrationAngle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微通道测量
|
||||
/// </summary>
|
||||
public string MicrochannelMeasurement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 胆固醇结晶测量
|
||||
/// </summary>
|
||||
public string CholesterolCrystalMeasurement { get; set; }
|
||||
}
|
||||
|
||||
public class FileToDataTableDto
|
||||
|
|
|
|||
|
|
@ -326,6 +326,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
FirstData = int.Parse(dataTable.Rows[i]["B"].ToString()),
|
||||
SecondData = int.Parse(dataTable.Rows[i]["C"].ToString()),
|
||||
ThirdData = int.Parse(dataTable.Rows[i]["D"].ToString()),
|
||||
MacrophageInfiltrationMeasurement= dataTable.Rows[i]["E"].ToString()??string.Empty,
|
||||
MacrophageInfiltrationAngle = dataTable.Rows[i]["F"].ToString() ?? string.Empty,
|
||||
MicrochannelMeasurement = dataTable.Rows[i]["G"].ToString() ?? string.Empty,
|
||||
CholesterolCrystalMeasurement = dataTable.Rows[i]["H"].ToString() ?? string.Empty,
|
||||
LumenAreaMeasurement = dataTable.Rows[i]["I"].ToString() ?? string.Empty,
|
||||
});
|
||||
}
|
||||
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||
|
|
@ -342,6 +347,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
var maxnum = 0;
|
||||
|
||||
Dictionary<string, string> isPresent = new Dictionary<string, string>()
|
||||
{
|
||||
{ "有","1"},
|
||||
{ "无","0"},
|
||||
{ "Existence","1"},
|
||||
{ "Non-existence","0"},
|
||||
};
|
||||
|
||||
foreach (var item in measuredValueList)
|
||||
{
|
||||
|
|
@ -429,6 +441,75 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.AvgFCT).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
try
|
||||
{
|
||||
// 新加的5个问题
|
||||
// 巨噬细胞浸润测量
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = isPresent[item.MacrophageInfiltrationMeasurement.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.MacrophageInfiltrationMeasurement).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
// 巨噬细胞浸润角度测量
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = item.MacrophageInfiltrationAngle.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.MacrophageInfiltrationAngle).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
// 微通道测量
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = isPresent[item.MicrochannelMeasurement.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.MicrochannelMeasurement).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
// 胆固醇结晶测量
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = isPresent[item.CholesterolCrystalMeasurement.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.CholesterolCrystalMeasurement).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
// 官腔面积测量
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = item.LumenAreaMeasurement.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.LumenAreaMeasurement).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]);
|
||||
}
|
||||
|
||||
|
||||
// 添加其他问题答案
|
||||
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
||||
|
|
@ -783,6 +864,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
{
|
||||
PlaqueNum = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => int.Parse(x.Answer)).FirstOrDefault(),
|
||||
Data = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.AvgFCT).Select(x => decimal.Parse(x.Answer)).FirstOrDefault(),
|
||||
MacrophageInfiltrationMeasurement = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MacrophageInfiltrationMeasurement).Select(x => x.Answer).FirstOrDefault()??string.Empty,
|
||||
MacrophageInfiltrationAngle = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MacrophageInfiltrationAngle).Select(x => x.Answer.IsNullOrEmptyReturn0()).FirstOrDefault(),
|
||||
MicrochannelMeasurement = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MicrochannelMeasurement).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
CholesterolCrystalMeasurement = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.CholesterolCrystalMeasurement).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -887,6 +972,60 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
TableQuestionId = patchDataTableQuestion.Where(x => x.QuestionMark == QuestionMark.AvgMinFCT).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
// 巨噬细胞浸润测量
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = oCTFCTInfos.Any(x => x.PlaqueNum == item&&x.MacrophageInfiltrationMeasurement.EqEnum(IsPresent.Existence))? IsPresent.Existence.GetEnumInt(): IsPresent.NonExistence.GetEnumInt(),
|
||||
Id = NewId.NextGuid(),
|
||||
QuestionId = patchDataStatisticsInfo.Id,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = patchDataTableQuestion.Where(x => x.QuestionMark == QuestionMark.MacrophageInfiltration).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
// 巨噬细胞浸润角度测量
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = oCTFCTInfos.Where(x => x.PlaqueNum == item).Count() == 0 ? string.Empty : oCTFCTInfos.Where(x => x.PlaqueNum == item).Max(x=>x.MacrophageInfiltrationAngle).ToString(),
|
||||
Id = NewId.NextGuid(),
|
||||
QuestionId = patchDataStatisticsInfo.Id,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = patchDataTableQuestion.Where(x => x.QuestionMark == QuestionMark.MacrophageExtensionAngle).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
// 微通道
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = oCTFCTInfos.Any(x => x.PlaqueNum == item && x.MicrochannelMeasurement.EqEnum(IsPresent.Existence)) ? IsPresent.Existence.GetEnumInt() : IsPresent.NonExistence.GetEnumInt(),
|
||||
Id = NewId.NextGuid(),
|
||||
QuestionId = patchDataStatisticsInfo.Id,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = patchDataTableQuestion.Where(x => x.QuestionMark == QuestionMark.Microchannels).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
// 胆固醇结晶测量
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = oCTFCTInfos.Any(x => x.PlaqueNum == item && x.CholesterolCrystalMeasurement.EqEnum(IsPresent.Existence)) ? IsPresent.Existence.GetEnumInt() : IsPresent.NonExistence.GetEnumInt(),
|
||||
Id = NewId.NextGuid(),
|
||||
QuestionId = patchDataStatisticsInfo.Id,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = patchDataTableQuestion.Where(x => x.QuestionMark == QuestionMark.CholesterolCrystallization).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 脂质角度平均值
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
|
|
@ -913,7 +1052,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
TableQuestionId = patchDataTableQuestion.Where(x => x.QuestionMark == QuestionMark.MaxAvgLipidAngle).Select(x => x.Id).FirstOrDefault(),
|
||||
});
|
||||
|
||||
// 待定指标
|
||||
// 斑块类型
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = string.Empty,
|
||||
|
|
|
|||
|
|
@ -2392,25 +2392,50 @@ namespace IRaCIS.Core.Domain.Share
|
|||
Undetermined = 1021,
|
||||
|
||||
/// <summary>
|
||||
/// 巨噬细胞浸润
|
||||
/// 巨噬细胞浸润汇总
|
||||
/// </summary>
|
||||
MacrophageInfiltration = 1022,
|
||||
|
||||
/// <summary>
|
||||
/// 巨噬细胞延伸角度
|
||||
/// 巨噬细胞延伸角度汇总
|
||||
/// </summary>
|
||||
MacrophageExtensionAngle = 1023,
|
||||
|
||||
/// <summary>
|
||||
/// 微通道
|
||||
/// 微通道汇总
|
||||
/// </summary>
|
||||
Microchannels = 1024,
|
||||
|
||||
/// <summary>
|
||||
/// 胆固醇结晶
|
||||
/// 胆固醇结晶汇总
|
||||
/// </summary>
|
||||
CholesterolCrystallization = 1025,
|
||||
|
||||
/// <summary>
|
||||
/// 巨噬细胞浸润测量
|
||||
/// </summary>
|
||||
MacrophageInfiltrationMeasurement = 1026,
|
||||
|
||||
/// <summary>
|
||||
/// 巨噬细胞浸润角度测量
|
||||
/// </summary>
|
||||
MacrophageInfiltrationAngle = 1027,
|
||||
|
||||
/// <summary>
|
||||
/// 微通道测量
|
||||
/// </summary>
|
||||
MicrochannelMeasurement = 1028,
|
||||
|
||||
/// <summary>
|
||||
/// 胆固醇结晶测量
|
||||
/// </summary>
|
||||
CholesterolCrystalMeasurement = 1029,
|
||||
|
||||
/// <summary>
|
||||
/// 官腔面积测量
|
||||
/// </summary>
|
||||
LumenAreaMeasurement = 1030,
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -2445,6 +2470,22 @@ namespace IRaCIS.Core.Domain.Share
|
|||
liverSegmentation = 1106,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 有(1)、无(0)
|
||||
/// </summary>
|
||||
public enum IsPresent
|
||||
{
|
||||
/// <summary>
|
||||
/// 无
|
||||
/// </summary>
|
||||
NonExistence = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 有
|
||||
/// </summary>
|
||||
Existence = 1,
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 脂肪肝分级
|
||||
|
|
|
|||
Loading…
Reference in New Issue