Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
commit
3ee6f0ceaa
|
|
@ -13,6 +13,7 @@ namespace IRaCIS.Core.Application.Helper
|
|||
|
||||
public class StudyDIRInfo
|
||||
{
|
||||
public Guid SubjectId { get; set; }
|
||||
public bool IsTaskStudy { get; set; }
|
||||
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -459,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
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -668,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1944,6 +1944,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
var isExportReading = inCommand.IsExportReading == true;
|
||||
|
||||
var dirDic = new Dictionary<string, string>();
|
||||
|
||||
if (inCommand.IsKeyImage)
|
||||
{
|
||||
var downloadInfoList = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)
|
||||
|
|
@ -2192,6 +2194,72 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
else
|
||||
{
|
||||
|
||||
#region 在下载前先处理DIR文件
|
||||
|
||||
//有传输语法值的导出 才生成DIR
|
||||
if (_subjectVisitRepository.Where(t => inCommand.SubjectVisitIdList.Contains(t.Id)).SelectMany(t => t.StudyList.SelectMany(t => t.InstanceList.Where(t => isExportReading ? (t.IsReading && t.DicomSerie.IsReading) : true))).All(c => c.TransferSytaxUID != string.Empty))
|
||||
{
|
||||
var dirInfolist = _subjectVisitRepository.Where(t => inCommand.SubjectVisitIdList.Contains(t.Id)).SelectMany(t => t.StudyList)
|
||||
.SelectMany(t => t.InstanceList.Where(t => isExportReading ? (t.IsReading && t.DicomSerie.IsReading) : true))
|
||||
.Select(t => new StudyDIRInfo()
|
||||
{
|
||||
SubjectId = t.SubjectId,
|
||||
SubjectVisitId = t.SubjectVisitId,
|
||||
|
||||
DicomStudyId = t.DicomStudy.Id,
|
||||
|
||||
PatientId = t.DicomStudy.PatientId,
|
||||
PatientName = t.DicomStudy.PatientName,
|
||||
PatientBirthDate = t.DicomStudy.PatientBirthDate,
|
||||
PatientSex = t.DicomStudy.PatientSex,
|
||||
|
||||
StudyInstanceUid = t.StudyInstanceUid,
|
||||
StudyId = t.DicomStudy.StudyId,
|
||||
DicomStudyDate = t.DicomStudy.DicomStudyDate,
|
||||
DicomStudyTime = t.DicomStudy.DicomStudyTime,
|
||||
AccessionNumber = t.DicomStudy.AccessionNumber,
|
||||
|
||||
StudyDescription = t.DicomStudy.Description,
|
||||
|
||||
SeriesInstanceUid = t.DicomSerie.SeriesInstanceUid,
|
||||
Modality = t.DicomSerie.Modality,
|
||||
DicomSeriesDate = t.DicomSerie.DicomSeriesDate,
|
||||
DicomSeriesTime = t.DicomSerie.DicomSeriesTime,
|
||||
SeriesNumber = t.DicomSerie.SeriesNumber,
|
||||
SeriesDescription = t.DicomSerie.Description,
|
||||
|
||||
InstanceId = t.Id,
|
||||
SopInstanceUid = t.SopInstanceUid,
|
||||
SOPClassUID = t.SOPClassUID,
|
||||
InstanceNumber = t.InstanceNumber,
|
||||
MediaStorageSOPClassUID = t.MediaStorageSOPClassUID,
|
||||
MediaStorageSOPInstanceUID = t.MediaStorageSOPInstanceUID,
|
||||
TransferSytaxUID = t.TransferSytaxUID,
|
||||
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
foreach (var item in dirInfolist.GroupBy(t => new { t.StudyInstanceUid, t.DicomStudyId }))
|
||||
{
|
||||
var visitId = item.First().SubjectVisitId;
|
||||
|
||||
var subjectId = item.First().SubjectId;
|
||||
|
||||
|
||||
var ossFolder = $"{inCommand.TrialId}/Image/{subjectId}/{visitId}/{item.Key.StudyInstanceUid}";
|
||||
|
||||
var isSucess = await SafeBussinessHelper.RunAsync(async () => await DicomDIRHelper.GenerateStudyDIRAndUploadAsync(item.ToList(), dirDic, ossFolder, _oSSService));
|
||||
|
||||
if (isSucess)
|
||||
{
|
||||
await _dicomStudyRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Key.DicomStudyId, u => new DicomStudy() { StudyDIRPath = $"/{ossFolder}/DICOMDIR" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var downloadInfo = _trialRepository.Where(t => t.Id == inCommand.TrialId).Select(t => new
|
||||
{
|
||||
t.ResearchProgramNo,
|
||||
|
|
@ -2206,14 +2274,19 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
u.PatientId,
|
||||
u.StudyTime,
|
||||
u.StudyCode,
|
||||
StudyDIRPath = u.StudyDIRPath,
|
||||
|
||||
SeriesList = u.SeriesList.Where(t => isExportReading ? t.IsReading : true).Select(z => new
|
||||
{
|
||||
z.Modality,
|
||||
|
||||
InstancePathList = z.DicomInstanceList.Where(t => isExportReading ? t.IsReading : true).Select(k => new
|
||||
InstanceList = z.DicomInstanceList.Where(t => isExportReading ? t.IsReading : true).Select(k => new DownloadDicomInstanceDto()
|
||||
{
|
||||
k.Path
|
||||
IsEncapsulated = k.IsEncapsulated,
|
||||
InstanceId = k.Id,
|
||||
FileName = string.Empty,
|
||||
Path = k.Path,
|
||||
FileSize = k.FileSize
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -2237,6 +2310,18 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
}).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
foreach (var item in downloadInfo.VisitList.SelectMany(t => t.StudyList.SelectMany(t => t.SeriesList).SelectMany(t => t.InstanceList)))
|
||||
{
|
||||
var key = item.InstanceId.ToString();
|
||||
if (dirDic.ContainsKey(key))
|
||||
{
|
||||
item.FileName = dirDic[key];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ResponseOutput.Ok(downloadInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue