+20
-23
@@ -681,6 +681,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
var readingNameOrTaskBlindName = string.Empty;
|
||||
var subjectCode = string.Empty;
|
||||
inDto.IsGetTaskClinicalData = true;
|
||||
if (inDto.ReadingId == null)
|
||||
{
|
||||
var visitTask = await _visitTaskRepository.AsQueryable().Include(x => x.Subject)
|
||||
@@ -701,23 +702,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var readingIds = result.Select(x => x.ReadingId).ToList();
|
||||
|
||||
var previousHistoryList = await _previousHistoryRepository.Where(x => readingIds.Contains(x.SubjectVisitId)).ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousOtherList = await _previousOtherRepository.Where(x => readingIds.Contains(x.SubjectVisitId)).ProjectTo<PreviousOtherView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousSurgeryList = await _previousSurgeryRepository.Where(x => readingIds.Contains(x.SubjectVisitId)).ProjectTo<PreviousSurgeryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
foreach (var item in result)
|
||||
{
|
||||
item.ClinicalTableData = new ClinicalDataTable()
|
||||
{
|
||||
PreviousHistoryList = previousHistoryList.Where(x => x.ClinicalDataTrialSetId == item.ClinicalDataTrialSetId).ToList(),
|
||||
PreviousOtherList = previousOtherList.Where(x => x.ClinicalDataTrialSetId == item.ClinicalDataTrialSetId).ToList(),
|
||||
PreviousSurgeryList = previousSurgeryList.Where(x => x.ClinicalDataTrialSetId == item.ClinicalDataTrialSetId).ToList(),
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Dictionary<ClinicalLevel, int> keys = new Dictionary<ClinicalLevel, int>() {
|
||||
{ClinicalLevel.SubjectVisit,0 },
|
||||
{ClinicalLevel.ImageRead,2 },
|
||||
@@ -809,6 +793,19 @@ namespace IRaCIS.Core.Application.Service
|
||||
isSelfAnalysis = true;
|
||||
}
|
||||
}
|
||||
|
||||
//下面改用readingIdList筛选 不然
|
||||
List<Guid> readingIdList = new List<Guid>() {};
|
||||
if (inDto.IsGetTaskClinicalData)
|
||||
{
|
||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == inDto.ReadingId.Value).FirstOrDefaultAsync();
|
||||
if (subjectVisit != null && !subjectVisit.IsBaseLine)
|
||||
{
|
||||
var baseId = await _subjectVisitRepository.Where(x => x.SubjectId == subjectVisit.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
readingIdList.Add(baseId);
|
||||
}
|
||||
}
|
||||
|
||||
// 一致性分析
|
||||
if (isSelfAnalysis)
|
||||
{
|
||||
@@ -817,7 +814,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.WhereIf(inDto.ReadingClinicalDataId != null, x => x.Id == inDto.ReadingClinicalDataId)
|
||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
||||
.WhereIf(inDto.SelectIsSign, x => x.IsSign == true)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId||(readingIdList.Contains(x.ReadingId)&&x.ClinicalDataTrialSet.ClinicalDataLevel== ClinicalLevel.Subject))
|
||||
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||
{
|
||||
@@ -858,7 +855,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.WhereIf(inDto.ReadingClinicalDataId != null, x => x.Id == inDto.ReadingClinicalDataId)
|
||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
||||
.WhereIf(inDto.SelectIsSign, x => x.IsSign == true)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId || (readingIdList.Contains(x.ReadingId) && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject))
|
||||
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||
.Where(x => x.ClinicalDataTrialSet.ClinicalUploadType != ClinicalUploadType.PDF || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Study)
|
||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||
@@ -901,7 +898,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.WhereIf(inDto.ReadingClinicalDataId != null, x => x.Id == inDto.ReadingClinicalDataId)
|
||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
||||
.WhereIf(inDto.SelectIsSign, x => x.IsSign == true)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId || (readingIdList.Contains(x.ReadingId) && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject))
|
||||
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||
{
|
||||
@@ -1061,9 +1058,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
}
|
||||
|
||||
var previousHistoryList = await _previousHistoryRepository.Where(x => x.SubjectVisitId == inDto.ReadingId).ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousOtherList = await _previousOtherRepository.Where(x => x.SubjectVisitId == inDto.ReadingId).ProjectTo<PreviousOtherView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousSurgeryList = await _previousSurgeryRepository.Where(x => x.SubjectVisitId == inDto.ReadingId).ProjectTo<PreviousSurgeryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousHistoryList = await _previousHistoryRepository.Where(x => x.SubjectVisitId == inDto.ReadingId || (readingIdList.Contains(x.SubjectVisitId) && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject)).ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousOtherList = await _previousOtherRepository.Where(x => x.SubjectVisitId == inDto.ReadingId || (readingIdList.Contains(x.SubjectVisitId) && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject)).ProjectTo<PreviousOtherView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousSurgeryList = await _previousSurgeryRepository.Where(x => x.SubjectVisitId == inDto.ReadingId || (readingIdList.Contains(x.SubjectVisitId) && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject)).ProjectTo<PreviousSurgeryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
foreach (var item in result)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user