Merge branch 'Uat_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Uat_IRC_Net8
continuous-integration/drone/push Build is passing Details

Uat_IRC_Net8
hang 2025-12-05 09:45:03 +08:00
commit 04954a4b25
9 changed files with 888 additions and 502 deletions

View File

@ -1028,8 +1028,6 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
//但是加字段 IsFrontTaskNeedSignButNotSign 那么签名临床数据的时候要对该subject 该标准的有效的任务 这个字段需要在签名的时候维护 采取这种方式 统计数字灵活
//.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode!) && t.IsAnalysisCreate))
.WhereIf(critrion.CriterionType == CriterionType.OCT, t => t.ReadingCategory == ReadingCategory.Visit ? t.SourceSubjectVisit.NoneDicomStudyList.SelectMany(t => t.TaskNoneDicomFileList).Any() : true)
.WhereIf(critrion.CriterionType == CriterionType.IVUS, t => t.ReadingCategory == ReadingCategory.Visit ? t.SourceSubjectVisit.TaskStudyList.Any() : true)
;
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
@ -1173,7 +1171,9 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect)
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
.WhereIf(!string.IsNullOrEmpty(subjectCode), t => (t.Subject.Code.Contains(subjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(subjectCode!) && t.IsAnalysisCreate));
.WhereIf(!string.IsNullOrEmpty(subjectCode), t => (t.Subject.Code.Contains(subjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(subjectCode!) && t.IsAnalysisCreate))
.WhereIf(critrion.CriterionType == CriterionType.OCT, t => t.ReadingCategory == ReadingCategory.Visit ? t.SourceSubjectVisit.NoneDicomStudyList.SelectMany(t => t.ImageLabelNoneDicomFileList).Any() : true)
.WhereIf(critrion.CriterionType == CriterionType.IVUS, t => t.ReadingCategory == ReadingCategory.Visit ? t.SourceSubjectVisit.TaskStudyList.Any() : true);
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });

View File

@ -185,16 +185,16 @@ public class OctExportDto : IVUS_OCTBaseDto
public string LAMAX { get; set; }
/// <summary>巨噬细胞浸润</summary>
public string MACRI { get; set; }
public string PLAMACRI { get; set; }
/// <summary>巨噬细胞浸润角度</summary>
public string MIARC { get; set; }
public string PLAMIARC { get; set; }
/// <summary>微通道</summary>
public string MC { get; set; }
public string PLAMC { get; set; }
/// <summary>胆固醇结晶</summary>
public string CCS { get; set; }
public string PLACCS { get; set; }
}
@ -390,9 +390,17 @@ public class IVUS_OCTExportService(IRepository<ReadingQuestionCriterionTrial> _r
{
var ivus = _mapper.Map<IvusExportDto>(task);
//靶段
ivus.TARGETV = task.QuestionAnswerList.Where(t => t.QuestionName == "靶段").FirstOrDefault()?.QuestionValue ?? string.Empty;
//靶段
ivus.TARGETV = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegment).FirstOrDefault()?.QuestionValue ?? string.Empty;
var marks = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegmentRemarks).FirstOrDefault()?.QuestionValue ?? string.Empty;
if (marks.IsNotNullOrEmpty())
{
ivus.TARGETV = ivus.TARGETV + "_" + marks;
}
//斑块编号
ivus.PLAQUE = lesion.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.PlaqueNumber).FirstOrDefault()?.QuestionValue ?? string.Empty;
@ -407,10 +415,10 @@ public class IVUS_OCTExportService(IRepository<ReadingQuestionCriterionTrial> _r
//回撤中的图像帧数
ivus.PFC = task.QuestionAnswerList.Where(t => t.QuestionName == "回撤中的图像帧数").FirstOrDefault()?.QuestionValue ?? string.Empty;
ivus.PFC = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.PullbackFrameCount).FirstOrDefault()?.QuestionValue ?? string.Empty;
//分析图像帧数
ivus.FC = task.QuestionAnswerList.Where(t => t.QuestionName == "分析图像帧数").FirstOrDefault()?.QuestionValue ?? string.Empty;
ivus.FC = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.AnalysisFrameCount).FirstOrDefault()?.QuestionValue ?? string.Empty;
var findStatLession = task.LesionList.FirstOrDefault(t => t.LessionType == LesionType.PatchDataStatistics && t.LessionAnswerList.Any(t => t.QuestionMark == QuestionMark.PlaqueNumber && t.QuestionValue == ivus.PLAQUE));
var findPAVLession = task.LesionList.FirstOrDefault(t => t.LessionType == LesionType.PAV && t.LessionAnswerList.Any(t => t.QuestionMark == QuestionMark.PlaqueNumber && t.QuestionValue == ivus.PLAQUE));
@ -451,98 +459,162 @@ public class IVUS_OCTExportService(IRepository<ReadingQuestionCriterionTrial> _r
{
pNoIndex++;
var findFct1= fctLesion?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.FirstFCT).FirstOrDefault();
if (findFct1 != null)
foreach (var lessionAnswer in fctLesion?.LessionAnswerList.Where(t => t.QuestionMark != QuestionMark.PlaqueNumber).OrderBy(t=>t.ShowOrder))
{
var oct = CreatOCT(task, pNo);
var mark = string.Empty;
switch (lessionAnswer.QuestionMark)
{
case QuestionMark.FirstFCT:
mark = "FCTMV1";
break;
case QuestionMark.SecondFCT:
mark = "FCTMV2";
break;
case QuestionMark.ThirdFCT:
mark = "FCTMV3";
break;
case QuestionMark.AvgFCT:
mark = "AVGFCT";
break;
case QuestionMark.MacrophageInfiltration:
mark = "MACRI";
break;
case QuestionMark.MacrophageExtensionAngle:
mark = "MIARC";
break;
case QuestionMark.Microchannels:
mark = "MC";
break;
case QuestionMark.CholesterolCrystallization:
mark = "CCS";
break;
case QuestionMark.LumenArea:
mark = "LUMEN";
break;
// 测量标识
}
oct.TestID = $"{(task.ArmEnum == Arm.DoubleReadingArm1 ? "R1" : "R2")}_{pNo}_L_{pNoIndex}";
if (mark.IsNotNullOrEmpty())
{
var oct = CreatOCT(task, pNo);
// 测量参数名称
// 测量标识 阅片人_斑块号_表格_行号
oct.TESTCD = "FCTMV1";
oct.TestID = $"{(task.ArmEnum == Arm.DoubleReadingArm1 ? "R1" : "R2")}_{pNo}_L_{pNoIndex}";
// 测量参数值
oct.ORRES = findFct1?.QuestionValue??string.Empty;
// 测量参数名称
// 测量值单位
oct.ORRESU = translateDataList["ValueUnit"].Where(t => t.Code.ToLower() == ((int?)findFct1.Unit)?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
oct.TESTCD = mark;
octList.Add(oct);
// 测量参数值
oct.ORRES = lessionAnswer?.QuestionValue ?? string.Empty;
// 测量值单位
oct.ORRESU = translateDataList["ValueUnit"].Where(t => t.Code.ToLower() == ((int?)lessionAnswer.Unit)?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
octList.Add(oct);
}
}
var findFct2 = fctLesion?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.SecondFCT).FirstOrDefault();
if (findFct2 != null)
{
var oct = CreatOCT(task, pNo);
// 测量标识
oct.TestID = $"{(task.ArmEnum == Arm.DoubleReadingArm1 ? "R1" : "R2")}_{pNo}_L_{pNoIndex}";
// 测量参数名称
oct.TESTCD = "FCTMV2";
// 测量参数值
oct.ORRES = findFct2?.QuestionValue ?? string.Empty;
// 测量值单位
oct.ORRESU = translateDataList["ValueUnit"].Where(t => t.Code.ToLower() == ((int?)findFct2.Unit)?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
octList.Add(oct);
}
var findFct3 = fctLesion?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.ThirdFCT).FirstOrDefault();
if (findFct3 != null)
{
var oct = CreatOCT(task, pNo);
// 测量标识
oct.TestID = $"{(task.ArmEnum == Arm.DoubleReadingArm1 ? "R1" : "R2")}_{pNo}_L_{pNoIndex}";
// 测量参数名称
oct.TESTCD = "FCTMV3";
// 测量参数值
oct.ORRES = findFct3?.QuestionValue ?? string.Empty;
// 测量值单位
oct.ORRESU = translateDataList["ValueUnit"].Where(t => t.Code.ToLower() == ((int?)findFct3.Unit)?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
octList.Add(oct);
}
#region 废弃
var avgFct = fctLesion?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.AvgFCT).FirstOrDefault();
//var findFct1 = fctLesion?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.FirstFCT).FirstOrDefault();
if (avgFct != null)
{
var oct = CreatOCT(task, pNo);
//if (findFct1 != null)
//{
// var oct = CreatOCT(task, pNo);
// 测量标识
// // 测量标识
oct.TestID = $"{(task.ArmEnum == Arm.DoubleReadingArm1 ? "R1" : "R2")}_{pNo}_L_{pNoIndex}";
// oct.TestID = $"{(task.ArmEnum == Arm.DoubleReadingArm1 ? "R1" : "R2")}_{pNo}_L_{pNoIndex}";
// 测量参数名称
// // 测量参数名称
oct.TESTCD = "AVGFCT";
// oct.TESTCD = "FCTMV1";
// 测量参数值
oct.ORRES = avgFct?.QuestionValue ?? string.Empty;
// // 测量参数值
// oct.ORRES = findFct1?.QuestionValue ?? string.Empty;
// 测量值单位
oct.ORRESU = translateDataList["ValueUnit"].Where(t => t.Code.ToLower() == ((int?)avgFct.Unit)?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
// // 测量值单位
// oct.ORRESU = translateDataList["ValueUnit"].Where(t => t.Code.ToLower() == ((int?)findFct1.Unit)?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
octList.Add(oct);
}
// octList.Add(oct);
//}
//var findFct2 = fctLesion?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.SecondFCT).FirstOrDefault();
//if (findFct2 != null)
//{
// var oct = CreatOCT(task, pNo);
// // 测量标识
// oct.TestID = $"{(task.ArmEnum == Arm.DoubleReadingArm1 ? "R1" : "R2")}_{pNo}_L_{pNoIndex}";
// // 测量参数名称
// oct.TESTCD = "FCTMV2";
// // 测量参数值
// oct.ORRES = findFct2?.QuestionValue ?? string.Empty;
// // 测量值单位
// oct.ORRESU = translateDataList["ValueUnit"].Where(t => t.Code.ToLower() == ((int?)findFct2.Unit)?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
// octList.Add(oct);
//}
//var findFct3 = fctLesion?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.ThirdFCT).FirstOrDefault();
//if (findFct3 != null)
//{
// var oct = CreatOCT(task, pNo);
// // 测量标识
// oct.TestID = $"{(task.ArmEnum == Arm.DoubleReadingArm1 ? "R1" : "R2")}_{pNo}_L_{pNoIndex}";
// // 测量参数名称
// oct.TESTCD = "FCTMV3";
// // 测量参数值
// oct.ORRES = findFct3?.QuestionValue ?? string.Empty;
// // 测量值单位
// oct.ORRESU = translateDataList["ValueUnit"].Where(t => t.Code.ToLower() == ((int?)findFct3.Unit)?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
// octList.Add(oct);
//}
//var avgFct = fctLesion?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.AvgFCT).FirstOrDefault();
//if (avgFct != null)
//{
// var oct = CreatOCT(task, pNo);
// // 测量标识
// oct.TestID = $"{(task.ArmEnum == Arm.DoubleReadingArm1 ? "R1" : "R2")}_{pNo}_L_{pNoIndex}";
// // 测量参数名称
// oct.TESTCD = "AVGFCT";
// // 测量参数值
// oct.ORRES = avgFct?.QuestionValue ?? string.Empty;
// // 测量值单位
// oct.ORRESU = translateDataList["ValueUnit"].Where(t => t.Code.ToLower() == ((int?)avgFct.Unit)?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
// octList.Add(oct);
//}
#endregion
}
@ -632,7 +704,16 @@ public class IVUS_OCTExportService(IRepository<ReadingQuestionCriterionTrial> _r
//靶段
oct.TARGETV = task.QuestionAnswerList.Where(t => t.QuestionName == "靶段").FirstOrDefault()?.QuestionValue ?? string.Empty;
//靶段
oct.TARGETV = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegment).FirstOrDefault()?.QuestionValue ?? string.Empty;
var marks = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegmentRemarks).FirstOrDefault()?.QuestionValue ?? string.Empty;
if (marks.IsNotNullOrEmpty())
{
oct.TARGETV = oct.TARGETV + "_" + marks;
}
//斑块编号
oct.PLAQUE = pNo;
@ -651,13 +732,13 @@ public class IVUS_OCTExportService(IRepository<ReadingQuestionCriterionTrial> _r
// 脂质角度最大值
oct.LAMAX = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.MaxAvgLipidAngle).FirstOrDefault()?.QuestionValue ?? string.Empty;
// 巨噬细胞浸润
oct.MACRI = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.MacrophageInfiltration).FirstOrDefault()?.QuestionValue ?? string.Empty;
oct.PLAMACRI = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.MacrophageInfiltration).FirstOrDefault()?.QuestionValue ?? string.Empty;
// 巨噬细胞浸润角度
oct.MIARC = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.MacrophageExtensionAngle).FirstOrDefault()?.QuestionValue ?? string.Empty;
oct.PLAMIARC = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.MacrophageExtensionAngle).FirstOrDefault()?.QuestionValue ?? string.Empty;
// 微通道
oct.MC = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.Microchannels).FirstOrDefault()?.QuestionValue ?? string.Empty;
oct.PLAMC = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.Microchannels).FirstOrDefault()?.QuestionValue ?? string.Empty;
// 胆固醇结晶
oct.CCS = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.CholesterolCrystallization).FirstOrDefault()?.QuestionValue ?? string.Empty;
oct.PLACCS = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.CholesterolCrystallization).FirstOrDefault()?.QuestionValue ?? string.Empty;
return oct;
}

View File

@ -961,7 +961,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
Path = t.Path
}).ToList(),
ReadingFileCount = u.FileCount,
ReadingFileCount = u.NoneDicomFileList.Where(t => t.IsReading).Count(),
}).ToList();
@ -1013,7 +1013,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
ImageDate = ns.ImageDate,
BodyPart = ns.BodyPart,
BodyPartForEditOther = ns.BodyPartForEditOther,
FileCount = ns.FileCount,
Modality = ns.Modality,
StudyCode = ns.StudyCode,
@ -1027,7 +1027,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
Path = t.Path
}).ToList(),
ReadingFileCount = ns.FileCount,
FileCount = (inQuery.IsImageSegmentLabel == false ? ns.ImageLabelNoneDicomFileList : ns.NoneDicomFileList).Count(),
ReadingFileCount = (inQuery.IsImageSegmentLabel == false ? ns.ImageLabelNoneDicomFileList : ns.NoneDicomFileList).Where(t => t.IsReading).Count(),
};

View File

@ -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

View File

@ -526,6 +526,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();
@ -542,6 +547,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)
{
@ -629,6 +641,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)))
@ -983,6 +1064,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,
});
}
@ -1087,6 +1172,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()
{
@ -1113,7 +1252,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,

View File

@ -502,7 +502,24 @@ namespace IRaCIS.Core.Application.Services
var studyList = new List<VisitStudyDTO>();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).Select(t => new { t.TrialReadingCriterionId, t.TrialReadingCriterion.CriterionType, t.TrialReadingCriterion.IsImageFilter, t.TrialReadingCriterion.CriterionModalitys, t.ReadingTaskState, TaskStudyCount = t.TaskStudyList.Count }).FirstNotNullAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).Select(t => new
{
t.TrialReadingCriterionId,
t.TrialReadingCriterion.CriterionType,
t.TrialReadingCriterion.IsImageFilter,
t.TrialReadingCriterion.CriterionModalitys,
t.ReadingTaskState,
//是否有了后处理的dicom检查
IsHaveTaskStudy = t.TaskStudyList.Any(),
//是否有了后处理的NoneDicom检查
IsHaveTaskNoneDicomStudyFile = t.SourceSubjectVisit.NoneDicomStudyList.SelectMany(c => c.TaskNoneDicomFileList.Where(t => t.VisitTaskId == indto.VisitTaskId)).Any(),
//是否有了标注的dicom检查
IsMarkDicomStudy = t.SourceSubjectVisit.TaskStudyList.Any(),
//是否有了标注的NoneDicom检查
IsMarkNoneDicomStudy = t.SourceSubjectVisit.NoneDicomStudyList.SelectMany(c => c.ImageLabelNoneDicomFileList).Any()
}).FirstNotNullAsync();
@ -516,8 +533,22 @@ namespace IRaCIS.Core.Application.Services
.WhereIf(taskInfo.IsImageFilter == true, t => ("|" + taskInfo.CriterionModalitys + "|").Contains("|" + t.ModalityForEdit + "|"))
.WhereIf(isManualGenerate, t => t.SubjectCriteriaEvaluationVisitStudyFilterList.Any(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsConfirmed && t.IsReading))
//影像后处理 上传了新的影像 还要原始dsa
.WhereIf(taskInfo.TaskStudyCount > 0 && (taskInfo.CriterionType == CriterionType.OCT || taskInfo.CriterionType == CriterionType.IVUS), t => t.ModalityForEdit == "XA" /*|| t.ModalityForEdit == "OCT"*/)
.WhereIf(taskInfo.TaskStudyCount > 0 && (taskInfo.CriterionType != CriterionType.OCT && taskInfo.CriterionType != CriterionType.IVUS), t => false)
.WhereIf(taskInfo.IsHaveTaskStudy
&& (taskInfo.CriterionType == CriterionType.OCT || taskInfo.CriterionType == CriterionType.IVUS),
t => t.ModalityForEdit == "XA")
.WhereIf(taskInfo.IsHaveTaskStudy == false && taskInfo.IsMarkDicomStudy && taskInfo.CriterionType == CriterionType.IVUS,
t => t.ModalityForEdit == "XA" )
.WhereIf(taskInfo.IsHaveTaskStudy == false && taskInfo.IsMarkDicomStudy && taskInfo.CriterionType == CriterionType.OCT,
t => t.ModalityForEdit == "XA" || t.ModalityForEdit == "OCT")
.WhereIf(taskInfo.IsHaveTaskStudy == false && taskInfo.IsMarkDicomStudy == false
&& (taskInfo.CriterionType == CriterionType.OCT || taskInfo.CriterionType == CriterionType.IVUS),
t => t.ModalityForEdit == "XA" || t.ModalityForEdit == "OCT" || t.ModalityForEdit == "IVUS")
//其他 不应该看原始影像
.WhereIf(taskInfo.IsHaveTaskStudy && (taskInfo.CriterionType != CriterionType.OCT && taskInfo.CriterionType != CriterionType.IVUS), t => false)
.Select(k => new VisitStudyDTO()
{
InstanceCount = k.InstanceCount,
@ -580,10 +611,12 @@ namespace IRaCIS.Core.Application.Services
}
//影像后处理 上传了新的影像
if (taskInfo.TaskStudyCount > 0)
if (taskInfo.IsHaveTaskStudy || taskInfo.IsMarkDicomStudy || taskInfo.IsMarkNoneDicomStudy)
{
var taskStudyList = await _taskStudyRepository.Where(t => t.TrialId == indto.TrialId && t.VisitTaskId == indto.VisitTaskId)
var taskStudyList = await _taskStudyRepository.Where(t => t.TrialId == indto.TrialId)
.WhereIf(taskInfo.IsHaveTaskStudy, t => t.VisitTaskId == indto.VisitTaskId)
.WhereIf(taskInfo.IsHaveTaskStudy == false && (taskInfo.IsMarkDicomStudy || taskInfo.IsMarkNoneDicomStudy), t => t.SubjectVisitId == indto.SujectVisitId)
.WhereIf(taskInfo.IsImageFilter == true, t => ("|" + taskInfo.CriterionModalitys + "|").Contains("|" + t.ModalityForEdit + "|"))
.ProjectTo<VisitStudyDTO>(_mapper.ConfigurationProvider).ToListAsync();
@ -742,8 +775,9 @@ namespace IRaCIS.Core.Application.Services
#region 非Dicom 检查查询
var noDicomList = await _noneDicomStudyRepository.Where(x => x.TrialId == indto.TrialId && x.SubjectVisitId == indto.SujectVisitId && x.NoneDicomFileList.Any(t => !t.FileType.Contains(StaticData.FileType.Zip)))
.Where(t => t.IsReading)
.WhereIf(taskInfo.IsImageFilter == true, t => taskInfo.CriterionModalitys.Contains(t.Modality)).ToListAsync();
.Where(t => t.IsReading)
.WhereIf(taskInfo.IsImageFilter, t => ("|" + taskInfo.CriterionModalitys + "|").Contains("|" + t.Modality + "|"))
.ToListAsync();
List<VisitStudyDTO> noDicomStudyList = noDicomList.Select(x => new VisitStudyDTO()
@ -761,15 +795,17 @@ namespace IRaCIS.Core.Application.Services
}).ToList();
var isExistTaskNoneDicomFile = _noneDicomStudyFileRepository.Any(t => t.VisitTaskId == indto.VisitTaskId);
//var isExistTaskNoneDicomFile = _noneDicomStudyFileRepository.Any(t => t.VisitTaskId == indto.VisitTaskId);
foreach (var item in noDicomStudyList)
{
var nodicom = noDicomList.Where(x => x.Id == item.StudyId).First();
var instanceCount = await _noneDicomStudyFileRepository.Where(t => t.IsReading)
.WhereIf(isExistTaskNoneDicomFile, x => x.OriginNoneDicomStudyId == item.StudyId)
.WhereIf(isExistTaskNoneDicomFile == false, x => x.NoneDicomStudyId == item.StudyId).CountAsync();
.WhereIf(taskInfo.IsHaveTaskNoneDicomStudyFile == false && taskInfo.IsMarkNoneDicomStudy == true, x => x.ImageLabelNoneDicomStudyId == item.StudyId)
.WhereIf(taskInfo.IsHaveTaskNoneDicomStudyFile && taskInfo.IsMarkNoneDicomStudy, x => x.OriginNoneDicomStudyId == item.StudyId)
.WhereIf(taskInfo.IsHaveTaskNoneDicomStudyFile == false && taskInfo.IsMarkNoneDicomStudy == false, x => x.NoneDicomStudyId == item.StudyId)
.CountAsync();
if (instanceCount == 0)
{
@ -790,8 +826,10 @@ namespace IRaCIS.Core.Application.Services
SubjectVisitId=nodicom.SubjectVisitId,
SubjectId=nodicom.SubjectId,
SeriesNumber=1,
NoneDicomFileFirstFile=await _noneDicomStudyFileRepository.WhereIf(isExistTaskNoneDicomFile,x=>x.OriginNoneDicomStudyId== item.StudyId)
.WhereIf(isExistTaskNoneDicomFile==false, x=>x.NoneDicomStudyId == item.StudyId)
NoneDicomFileFirstFile=await _noneDicomStudyFileRepository
.WhereIf(taskInfo.IsHaveTaskNoneDicomStudyFile == false && taskInfo.IsMarkNoneDicomStudy == true, x => x.ImageLabelNoneDicomStudyId == item.StudyId)
.WhereIf(taskInfo.IsHaveTaskNoneDicomStudyFile && taskInfo.IsMarkNoneDicomStudy, x => x.OriginNoneDicomStudyId == item.StudyId)
.WhereIf(taskInfo.IsHaveTaskNoneDicomStudyFile == false && taskInfo.IsMarkNoneDicomStudy == false, x => x.NoneDicomStudyId == item.StudyId)
.Where(x=> !x.FileType.Contains(StaticData.FileType.Zip)).Select(x=>x.Path).FirstOrDefaultAsync(),
}

File diff suppressed because it is too large Load Diff

View File

@ -262,7 +262,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as ReadingImportFile;
var visitTaskInfo = await _dbContext.VisitTask.Where(x => x.Id == entity.VisitTaskId).Include(x=>x.DoctorUser).FirstOrDefaultAsync();
var visitTaskInfo = await _dbContext.VisitTask.Where(x => x.Id == entity.VisitTaskId).Include(x => x.DoctorUser).FirstOrDefaultAsync();
await InsertInspection<ReadingImportFile>(entity, type, x => new InspectionConvertDTO()
{
@ -2533,20 +2533,35 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var extraIdentification = string.Empty;
Arm armEnum = Arm.SingleReadingArm;
Guid? subjectVisitId = null;
Arm? armEnum = Arm.SingleReadingArm;
if (entity.VisitTaskId != null)
{
extraIdentification = "/VisitTask";
armEnum = await _dbContext.VisitTask.Where(x => x.Id == entity.VisitTaskId).Select(x => x.ArmEnum).FirstOrDefaultAsync();
var obj = await _dbContext.VisitTask.Where(x => x.Id == entity.VisitTaskId).Select(x => new { x.ArmEnum, x.SourceSubjectVisitId }).FirstOrDefaultAsync();
armEnum = obj?.ArmEnum;
subjectVisitId = obj.SourceSubjectVisitId;
}
else if (entity.ImageLabelNoneDicomStudyId != null)
{
//默认R0
extraIdentification = "/VisitTask";
//var noneDicomStudy = await _dbContext.NoneDicomStudy.FindAsync(entity.NoneDicomStudyId);
subjectVisitId = await _dbContext.NoneDicomStudy.Where(x => x.Id == entity.ImageLabelNoneDicomStudyId).Select(t => t.SubjectVisitId).FirstOrDefaultAsync();
}
else
{
subjectVisitId = (await _dbContext.NoneDicomStudy.FindAsync(entity.NoneDicomStudyId))?.SubjectVisitId;
}
await InsertInspection<NoneDicomStudyFile>(item.Entity as NoneDicomStudyFile, type, x => new InspectionConvertDTO()
{
//SubjectVisitId = noneDicomStudy.SubjectVisitId,
SubjectVisitId = subjectVisitId,
//SubjectId = noneDicomStudy.SubjectId,
ObjectRelationParentId = x.VisitTaskId,
VisitTaskId= x.VisitTaskId,
ObjectRelationParentId = subjectVisitId,
ObjectRelationParentId2 = x.NoneDicomStudyId,
ObjectRelationParentId3 = x.OriginNoneDicomStudyId,
ExtraIndentification = extraIdentification
@ -3696,7 +3711,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
string questionName = string.Empty;
string questionAnswer = string.Empty;
if (thisQuestinonAnswer != null&& question!=null)
if (thisQuestinonAnswer != null && question != null)
{
questionName = _userInfo.IsEn_Us ? question.QuestionEnName : question.QuestionName;
questionAnswer = Translationunit(question.Type, question.Unit, question.CustomUnit, unitDataList, thisQuestinonAnswer.Answer);
@ -3857,7 +3872,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
entity.OrderMark = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == entity.QuestionId).Select(x => x.OrderMark).FirstOrDefaultAsync();
entity.RowMark = entity.OrderMark+ entity.RowIndex.GetLesionMark();
entity.RowMark = entity.OrderMark + entity.RowIndex.GetLesionMark();
string extraIdentification = string.Empty;
@ -3867,7 +3882,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
extraIdentification = "/Nontumorous";
}
if (readingQuestion.ReadingQuestionCriterionTrial.CriterionType == CriterionType.SelfDefine)
{
extraIdentification = "/SelfDefine";
@ -4121,7 +4136,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
#endregion

View File

@ -76,11 +76,12 @@ namespace IRaCIS.Core.Infrastructure.Extention
foreach (PropertyInfo property in properties)
{
if (typeof(IEnumerable).IsAssignableFrom(property.PropertyType)
&& property.PropertyType != typeof(string))
{
continue;
}
//质控导出需要集合
// if (typeof(IEnumerable).IsAssignableFrom(property.PropertyType)
//&& property.PropertyType != typeof(string))
// {
// continue;
// }
string propertyName = property.Name;
object propertyValue = property.GetValue(obj);