diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 0f1938755..fc880f9fb 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1028,8 +1028,6 @@ public class VisitTaskService(IRepository _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 _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 }); diff --git a/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs b/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs index 8796c4f77..5e824492a 100644 --- a/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs @@ -185,16 +185,16 @@ public class OctExportDto : IVUS_OCTBaseDto public string LAMAX { get; set; } /// 巨噬细胞浸润 - public string MACRI { get; set; } + public string PLAMACRI { get; set; } /// 巨噬细胞浸润角度 - public string MIARC { get; set; } + public string PLAMIARC { get; set; } /// 微通道 - public string MC { get; set; } + public string PLAMC { get; set; } /// 胆固醇结晶 - public string CCS { get; set; } + public string PLACCS { get; set; } } @@ -390,9 +390,17 @@ public class IVUS_OCTExportService(IRepository _r { var ivus = _mapper.Map(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 _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 _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 _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 _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; } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index bcfc1079a..88be734c7 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -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(), }; diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs index f77ddf11c..3fc391e4c 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs @@ -264,6 +264,35 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public int ThirdData { get; set; } + /// + /// 巨噬细胞浸润测量 + /// + public string MacrophageInfiltrationMeasurement { get; set; } + + + /// + /// 巨噬细胞浸润角度测量 + /// + public string MacrophageInfiltrationAngle { get; set; } + + /// + /// 微通道测量 + /// + public string MicrochannelMeasurement { get; set; } + + /// + /// 胆固醇结晶测量 + /// + public string CholesterolCrystalMeasurement { get; set; } + + /// + /// 官腔面积测量 + /// + 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 /// 值 /// public decimal Data { get; set; } + + /// + /// 巨噬细胞浸润测量 + /// + public string MacrophageInfiltrationMeasurement { get; set; } + + + /// + /// 巨噬细胞浸润角度测量 + /// + public decimal MacrophageInfiltrationAngle { get; set; } + + /// + /// 微通道测量 + /// + public string MicrochannelMeasurement { get; set; } + + /// + /// 胆固醇结晶测量 + /// + public string CholesterolCrystalMeasurement { get; set; } } public class FileToDataTableDto diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs index e58015c3c..38d229112 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs @@ -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 isPresent = new Dictionary() + { + { "有","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, diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 204f06c51..f2663d7ec 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -502,7 +502,24 @@ namespace IRaCIS.Core.Application.Services var studyList = new List(); - 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(_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 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(), } diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 1534a9b85..3f67b2ca0 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -61,24 +61,24 @@ namespace IRaCIS.Core.Domain.Share /// 裁判匹配类型 /// public enum JudgeDifferenceType - { - /// - /// > - /// - Greater = 0, + { + /// + /// > + /// + Greater = 0, - /// - /// ≥ - /// - AboveOrEqual = 1, + /// + /// ≥ + /// + AboveOrEqual = 1, - } + } - /// - /// GetClinicalType - /// - public enum GetClinicalType + /// + /// GetClinicalType + /// + public enum GetClinicalType { /// @@ -130,11 +130,11 @@ namespace IRaCIS.Core.Domain.Share /// public enum GroupClassify { - /// - /// 质量问题 - /// - QualityProblem = 1, - + /// + /// 质量问题 + /// + QualityProblem = 1, + } /// @@ -142,7 +142,7 @@ namespace IRaCIS.Core.Domain.Share /// public enum ClinicalTableQuestionMark { - Test=1, + Test = 1, } /// @@ -182,12 +182,12 @@ namespace IRaCIS.Core.Domain.Share /// public enum ClinicalCalculateMark { - None = -1, + None = -1, - /// - /// + - /// - Add = 1, + /// + /// + + /// + Add = 1, /// /// - @@ -325,23 +325,23 @@ namespace IRaCIS.Core.Domain.Share /// 语言类型 /// public enum LanguageType - { + { - /// - /// 中文 - /// - Chinese = 0, + /// + /// 中文 + /// + Chinese = 0, - /// - /// 英文 - /// - English = 1 - } + /// + /// 英文 + /// + English = 1 + } - /// - /// 标准字典分类 - /// - public enum CrterionDictionaryGroup + /// + /// 标准字典分类 + /// + public enum CrterionDictionaryGroup { /// @@ -525,7 +525,7 @@ namespace IRaCIS.Core.Domain.Share //阅片期一致率 ReadingPeriodJudgeRatio_Export = 18, - TumorCDISC_Export=20, + TumorCDISC_Export = 20, IVUS_CDISC_Export = 21, @@ -587,67 +587,67 @@ namespace IRaCIS.Core.Domain.Share Min = 9 } - /// - /// 数值单位 - /// - public enum ValueUnit - { - /// - /// 无 - /// - none = 0, + /// + /// 数值单位 + /// + public enum ValueUnit + { + /// + /// 无 + /// + none = 0, - /// - /// mm - /// - mm = 1, + /// + /// mm + /// + mm = 1, - /// - /// cm - /// - cm = 2, + /// + /// cm + /// + cm = 2, - /// - /// 个 - /// - individual = 3, + /// + /// 个 + /// + individual = 3, - /// - /// 自定义 - /// - Custom = 4, + /// + /// 自定义 + /// + Custom = 4, - /// - /// mm2 - /// - mm2 = 5, + /// + /// mm2 + /// + mm2 = 5, - /// - /// mm3 - /// - mm3 = 6, + /// + /// mm3 + /// + mm3 = 6, - /// - /// SUV - /// - SUV = 7, + /// + /// SUV + /// + SUV = 7, - /// - /// HU - /// - HU = 8, + /// + /// HU + /// + HU = 8, - /// - /// % - /// - percentage = 9, - } + /// + /// % + /// + percentage = 9, + } - /// - /// 数值类型 - /// - public enum ValueOfType + /// + /// 数值类型 + /// + public enum ValueOfType { /// @@ -674,7 +674,7 @@ namespace IRaCIS.Core.Domain.Share /// /// 分组 /// - Group=0, + Group = 0, /// /// 问题 @@ -757,7 +757,7 @@ namespace IRaCIS.Core.Domain.Share /// RECIST1Point1 = 1, - + /// /// Lugano 2014 @@ -884,46 +884,46 @@ namespace IRaCIS.Core.Domain.Share } - /// - /// 病灶分裂或合并 - /// - public enum SplitOrMergeType - { - /// - /// 分裂 - /// - Split = 0, + /// + /// 病灶分裂或合并 + /// + public enum SplitOrMergeType + { + /// + /// 分裂 + /// + Split = 0, - /// - /// 融合 - /// - Merge = 1, + /// + /// 融合 + /// + Merge = 1, - /// - /// 分裂主病灶 - /// - SplitMain = 2, + /// + /// 分裂主病灶 + /// + SplitMain = 2, /// /// 融合过 再之前任务融合了 /// - Merged=3, + Merged = 3, - /// - /// 融合主病灶 - /// - MergeMain = 4, + /// + /// 融合主病灶 + /// + MergeMain = 4, - /// - /// 融合过的主病灶 - /// - MergeMained = 5, - } + /// + /// 融合过的主病灶 + /// + MergeMained = 5, + } - /// - /// 是否存在或者NA - /// - public enum ExistOrNA + /// + /// 是否存在或者NA + /// + public enum ExistOrNA { /// /// NA @@ -940,7 +940,7 @@ namespace IRaCIS.Core.Domain.Share /// Exist = 1, - + } /// @@ -964,7 +964,7 @@ namespace IRaCIS.Core.Domain.Share /// Yes = 1, - + } /// @@ -1038,17 +1038,17 @@ namespace IRaCIS.Core.Domain.Share /// /// 存在 /// - Exist=1, + Exist = 1, /// /// 疑似 /// - Equivocal=2, - + Equivocal = 2, + /// /// 消失 /// - Loss =3, + Loss = 3, /// /// 无法评估 @@ -1283,48 +1283,48 @@ namespace IRaCIS.Core.Domain.Share /// public enum FDGPETOverallAssessment { - /// - /// NA - /// - NA=-1, - - /// - /// CMR - /// - CMR=1, - - /// - /// PMR - /// - PMR=2, - - /// - /// NMR - /// - NMR=3, - - /// - /// PMD - /// - PMD=4, - - /// - /// NE - /// - NE=5, - - /// - /// ND - /// - ND=6, - - } + /// + /// NA + /// + NA = -1, + + /// + /// CMR + /// + CMR = 1, + + /// + /// PMR + /// + PMR = 2, + + /// + /// NMR + /// + NMR = 3, + + /// + /// PMD + /// + PMD = 4, + + /// + /// NE + /// + NE = 5, + + /// + /// ND + /// + ND = 6, + + } -/// -/// 与基线相比摄取值变化 -/// -public enum SUVChangeVSBaseline + /// + /// 与基线相比摄取值变化 + /// + public enum SUVChangeVSBaseline { /// /// 增大 @@ -1346,7 +1346,7 @@ public enum SUVChangeVSBaseline /// NotEvaluable = 4, - NA=5, + NA = 5, } /// @@ -1558,10 +1558,10 @@ public enum SUVChangeVSBaseline iUPD = 7, iCPD = 8, - /// - /// PR/SD - /// - PRSD = 9, + /// + /// PR/SD + /// + PRSD = 9, } @@ -1605,17 +1605,17 @@ public enum SUVChangeVSBaseline /// ND = 5, - iCR=6, + iCR = 6, - iPR=7, + iPR = 7, - iSD=8, + iSD = 8, - iUPD=9, + iUPD = 9, + + iCPD = 10, - iCPD=10, - } @@ -1753,29 +1753,29 @@ public enum SUVChangeVSBaseline } - /// - /// 转化显示类型 - /// - public enum ConvertShowType - { + /// + /// 转化显示类型 + /// + public enum ConvertShowType + { - /// - /// 全都显示 - /// - All = 0, + /// + /// 全都显示 + /// + All = 0, - /// - /// 转化前显示 - /// - BeforeShow = 1, + /// + /// 转化前显示 + /// + BeforeShow = 1, - /// - /// 转化后显示 - /// - AfterShow = 2 - } + /// + /// 转化后显示 + /// + AfterShow = 2 + } - public enum ReadingSetType + public enum ReadingSetType { /// /// 影像阅片 @@ -1828,7 +1828,7 @@ public enum SUVChangeVSBaseline /// /// 不显示 /// - NotShow =3, + NotShow = 3, } @@ -1887,12 +1887,12 @@ public enum SUVChangeVSBaseline [Display(Name = "PDF")] PDF = 1, - /// - /// 结构化录入 - /// - Structuring = 2, + /// + /// 结构化录入 + /// + Structuring = 2, - } + } /// /// 数据类型 @@ -1940,7 +1940,7 @@ public enum SUVChangeVSBaseline /// /// 基线病灶 /// - BaselineLesions=4, + BaselineLesions = 4, /// /// 新靶病灶 @@ -1980,7 +1980,7 @@ public enum SUVChangeVSBaseline /// /// 脂质角度 /// - LipidAngle =111, + LipidAngle = 111, /// /// FCT @@ -2051,8 +2051,8 @@ public enum SUVChangeVSBaseline /// /// 检查 /// - Study=4, - } + Study = 4, + } /// /// 全局答案类型 @@ -2089,22 +2089,22 @@ public enum SUVChangeVSBaseline /// /// 存在 /// - Exist=1, + Exist = 1, /// /// 消失 /// - Loss=2, + Loss = 2, /// /// 无法评估 /// - NotEvaluable=3, + NotEvaluable = 3, /// /// 太小 /// - TooSmall=4, + TooSmall = 4, } /// @@ -2204,7 +2204,7 @@ public enum SUVChangeVSBaseline /// /// 病灶数量 /// - LesionNumber =11, + LesionNumber = 11, /// /// PPD @@ -2326,11 +2326,11 @@ public enum SUVChangeVSBaseline /// 匹配动脉段最小FCT /// MiniMumFCT = 1017, - - /// - /// 平均最小FCT - /// - AvgMinFCT=1018, + + /// + /// 平均最小FCT + /// + AvgMinFCT = 1018, /// /// 脂质角度平均值 @@ -2348,27 +2348,52 @@ public enum SUVChangeVSBaseline Undetermined = 1021, /// - /// 巨噬细胞浸润 + /// 巨噬细胞浸润汇总 /// MacrophageInfiltration = 1022, /// - /// 巨噬细胞延伸角度 + /// 巨噬细胞延伸角度汇总 /// MacrophageExtensionAngle = 1023, /// - /// 微通道 + /// 微通道汇总 /// Microchannels = 1024, /// - /// 胆固醇结晶 + /// 胆固醇结晶汇总 /// CholesterolCrystallization = 1025, + /// + /// 巨噬细胞浸润测量 + /// + MacrophageInfiltrationMeasurement = 1026, + + /// + /// 巨噬细胞浸润角度测量 + /// + MacrophageInfiltrationAngle = 1027, + + /// + /// 微通道测量 + /// + MicrochannelMeasurement = 1028, + + /// + /// 胆固醇结晶测量 + /// + CholesterolCrystalMeasurement = 1029, + + /// + /// 官腔面积测量 + /// + LumenAreaMeasurement = 1030, + + - /// /// 第一次测量 @@ -2401,6 +2426,22 @@ public enum SUVChangeVSBaseline liverSegmentation = 1106, } + /// + /// 有(1)、无(0) + /// + public enum IsPresent + { + /// + /// 无 + /// + NonExistence = 0, + + /// + /// 有 + /// + Existence = 1, + + } /// /// 脂肪肝分级 @@ -2415,22 +2456,22 @@ public enum SUVChangeVSBaseline /// /// 0级 /// - Level0=1, + Level0 = 1, /// /// 1级 /// - Level1=2, + Level1 = 2, /// /// 2级 /// - Level2=3, + Level2 = 3, /// /// 3级 /// - Level3=4, + Level3 = 4, } @@ -2439,44 +2480,44 @@ public enum SUVChangeVSBaseline /// 影像质量问题 /// public enum ImageQualityIssues - { - /// - /// 解剖不完整 - /// - IncompleteAnatomy = 1, + { + /// + /// 解剖不完整 + /// + IncompleteAnatomy = 1, - /// - /// 扫描断层丢失 - /// - MissingScanSlice=2, + /// + /// 扫描断层丢失 + /// + MissingScanSlice = 2, - /// - /// 存在运动伪影 - /// - MotionArtifactsPresent = 3, + /// + /// 存在运动伪影 + /// + MotionArtifactsPresent = 3, - /// - /// 关键解剖部位缺失 - /// - KeyAnatomyOutOfFieldOfView = 4, + /// + /// 关键解剖部位缺失 + /// + KeyAnatomyOutOfFieldOfView = 4, - /// - /// 其它(需要备注) - /// - OtherIssuesCommentsRequired=5, + /// + /// 其它(需要备注) + /// + OtherIssuesCommentsRequired = 5, - /// - /// PET-CT影像无法融合 - /// - PETCTFailureFuse = 6, + /// + /// PET-CT影像无法融合 + /// + PETCTFailureFuse = 6, - } + } - /// - /// 问题类型 这里序号关系着计算顺序 请勿修改 - /// - public enum QuestionType + /// + /// 问题类型 这里序号关系着计算顺序 请勿修改 + /// + public enum QuestionType { /// /// 靶病灶径线之和(SOD) @@ -2581,7 +2622,7 @@ public enum SUVChangeVSBaseline /// /// 疗效评估分组 /// - TherapeuticEffectEvaluationGroup=20, + TherapeuticEffectEvaluationGroup = 20, /// /// 访视点肿瘤评估 @@ -2696,12 +2737,12 @@ public enum SUVChangeVSBaseline /// /// 是否脑转移 /// - IsBrainMetastasis =43, + IsBrainMetastasis = 43, /// /// 影像质量评估 /// - ImageQualityAssessment=44, + ImageQualityAssessment = 44, /// /// Forrest出血部位 @@ -2718,10 +2759,10 @@ public enum SUVChangeVSBaseline /// LiverState = 47, - /// - /// 脾脏垂直径 - /// - SpleenLength = 48, + /// + /// 脾脏垂直径 + /// + SpleenLength = 48, /// /// 脾脏状态 @@ -2768,30 +2809,30 @@ public enum SUVChangeVSBaseline /// EvidenceFocalFDG = 57, - /// - /// 修改脾脏状态备注 - /// - SplenicStatusRemarks = 58, + /// + /// 修改脾脏状态备注 + /// + SplenicStatusRemarks = 58, - /// - /// 修改PET 5PS评分备注 - /// - PSScoreRemarks = 59, + /// + /// 修改PET 5PS评分备注 + /// + PSScoreRemarks = 59, - /// - /// 脾尖位置 - /// - SplenicTopPosition = 60, + /// + /// 脾尖位置 + /// + SplenicTopPosition = 60, - /// - /// 脾底位置 - /// - SplenicBottomPosition = 61, + /// + /// 脾底位置 + /// + SplenicBottomPosition = 61, - /// - /// 影像质量问题 - /// - ImageQualityProblem = 67, + /// + /// 影像质量问题 + /// + ImageQualityProblem = 67, /// /// 斑块1-PAV @@ -2823,6 +2864,26 @@ public enum SUVChangeVSBaseline /// Plaque3MinFCT = 1008, + /// + /// 靶段 + /// + TargetSegment = 1009, + + /// + /// 回撤中的图像帧数 + /// + PullbackFrameCount = 1010, + + /// + /// 分析图像帧数 + /// + AnalysisFrameCount = 1011, + + /// + /// 靶段 备注 + /// + TargetSegmentRemarks = 1012, + /// /// 脂肪分数总平均值 /// @@ -2836,10 +2897,10 @@ public enum SUVChangeVSBaseline -/// -/// PET 5PS 评分 -/// -public enum PET5PSScore + /// + /// PET 5PS 评分 + /// + public enum PET5PSScore { /// /// 5分 @@ -2878,85 +2939,85 @@ public enum PET5PSScore } - /// - /// 计算触发 // 用的是SaveQuestionType 这个字典 - /// - public enum ComputationTrigger //SaveQuestionType - { - /// - /// 分裂病灶 - /// - SplitLesions = -6, + /// + /// 计算触发 // 用的是SaveQuestionType 这个字典 + /// + public enum ComputationTrigger //SaveQuestionType + { + /// + /// 分裂病灶 + /// + SplitLesions = -6, - /// - /// 融合病灶 - /// - MergeLesion = -5, + /// + /// 融合病灶 + /// + MergeLesion = -5, - /// - /// 删除病灶 - /// - RemoveLesion = -4, + /// + /// 删除病灶 + /// + RemoveLesion = -4, - /// - /// 融合保存病灶 - /// - MergeSave = -3, + /// + /// 融合保存病灶 + /// + MergeSave = -3, - /// - /// CT保存病灶 - /// - CTSave = -2, + /// + /// CT保存病灶 + /// + CTSave = -2, - /// - /// 初始计算 - /// - InitialCalculation = -1, + /// + /// 初始计算 + /// + InitialCalculation = -1, - /// - /// 保存影像质量 - /// - ImageQuality = 0, + /// + /// 保存影像质量 + /// + ImageQuality = 0, - /// - /// 保存PDG-PET - /// - PDGPET = 1, + /// + /// 保存PDG-PET + /// + PDGPET = 1, - /// - /// 测量肝脏血池 - /// - LiverBloodPool = 2, + /// + /// 测量肝脏血池 + /// + LiverBloodPool = 2, - /// - /// 测量纵膈血池 - /// - MediastinalPool = 3, + /// + /// 测量纵膈血池 + /// + MediastinalPool = 3, - /// - /// 标注脾尖位置 - /// - SplenicApexPosition = 4, + /// + /// 标注脾尖位置 + /// + SplenicApexPosition = 4, - /// - /// 标注脾底位置 - /// - PositionSpleenFloor = 5, + /// + /// 标注脾底位置 + /// + PositionSpleenFloor = 5, - /// - /// 保存肝脏状态 - /// - LiverStatus = 6, + /// + /// 保存肝脏状态 + /// + LiverStatus = 6, - /// - /// 保存脾脏评估 - /// - SplenicEvaluation = 7, + /// + /// 保存脾脏评估 + /// + SplenicEvaluation = 7, /// /// 测量值 /// - MeasuredValue =8, + MeasuredValue = 8, /// /// 斑块数据统计 @@ -2976,7 +3037,7 @@ public enum PET5PSScore /// /// 保存eCRF /// - SaveEICRFQuestions=12, + SaveEICRFQuestions = 12, } /// @@ -3069,39 +3130,39 @@ public enum PET5PSScore /// AnswerCombination = 3, - /// - /// 相差绝对值 - /// - DifferenceAbsoluteValue = 4, + /// + /// 相差绝对值 + /// + DifferenceAbsoluteValue = 4, - /// - /// 相差百分比 - /// - PercentageDifference = 5, + /// + /// 相差百分比 + /// + PercentageDifference = 5, - } + } - /// - /// 显示限制 - /// - public enum LimitShow - { - /// - /// 全都显示 - /// - AllShow = 0, + /// + /// 显示限制 + /// + public enum LimitShow + { + /// + /// 全都显示 + /// + AllShow = 0, - /// - /// 基线显示 - /// - BaseLineShow = 1, + /// + /// 基线显示 + /// + BaseLineShow = 1, - /// - /// 随访显示 - /// - FollowShow = 2, + /// + /// 随访显示 + /// + FollowShow = 2, /// @@ -3112,10 +3173,10 @@ public enum PET5PSScore } - /// - /// 限制编辑 - /// - public enum LimitEdit + /// + /// 限制编辑 + /// + public enum LimitEdit { /// @@ -3238,7 +3299,7 @@ public enum PET5PSScore /// ReadCompleted = 5, - + } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 7c31e3e0e..c6a9e41d5 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -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(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(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 - + diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs index a73efa88c..18f5d77e2 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs @@ -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);