Compare commits
No commits in common. "77b9b14cb67828a6eaad39f8097afe60b9a170b8" and "848581452a99616e57816d6351cf346c0fca0eca" have entirely different histories.
77b9b14cb6
...
848581452a
|
|
@ -21,7 +21,6 @@ public class TrialStatService(
|
||||||
IRepository<SystemDocument> _systemDocumentRepository,
|
IRepository<SystemDocument> _systemDocumentRepository,
|
||||||
IRepository<SystemNotice> _systemNoticeRepository,
|
IRepository<SystemNotice> _systemNoticeRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<Dictionary> _dictionaryRepository,
|
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
||||||
{
|
{
|
||||||
|
|
@ -145,7 +144,6 @@ public class TrialStatService(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var query = _visitTaskRepository.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
var query = _visitTaskRepository.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.Where(t => t.TrialId == inQuery.TrialId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
.Where(t => t.TrialId == inQuery.TrialId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
||||||
|
|
||||||
|
|
@ -181,8 +179,6 @@ public class TrialStatService(
|
||||||
|
|
||||||
var list = await query.ToListAsync();
|
var list = await query.ToListAsync();
|
||||||
|
|
||||||
var dicName = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).SelectMany(t => t.ReadingQuestionTrialList.Where(t => t.QuestionType == questionType))
|
|
||||||
.Select(t => t.DictionaryCode).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
|
|
||||||
if (criterion.IsArbitrationReading)
|
if (criterion.IsArbitrationReading)
|
||||||
|
|
@ -201,9 +197,8 @@ public class TrialStatService(
|
||||||
list = DealJudgeMark(criterion.ArbitrationRule, criterion.IsGlobalReading, list);
|
list = DealJudgeMark(criterion.ArbitrationRule, criterion.IsGlobalReading, list);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//判断subject的逻辑需要确认,这么多次访视任务,有的符合,有的不符合,准则是什么?
|
//判断subject的逻辑需要确认,这么多次访视任务,有的符合,有的不符合,准则是什么?
|
||||||
var resultList = list.GroupBy(t => t.OverallTumorEvaluation).Select(g => new EfficacyEvaluationStatViewModel()
|
return list.GroupBy(t => t.OverallTumorEvaluation).Select(g => new EfficacyEvaluationStatViewModel()
|
||||||
{
|
{
|
||||||
DictionaryCode = g.FirstOrDefault()?.DictionaryCode,
|
DictionaryCode = g.FirstOrDefault()?.DictionaryCode,
|
||||||
OverallTumorEvaluation = g.Key,
|
OverallTumorEvaluation = g.Key,
|
||||||
|
|
@ -211,26 +206,6 @@ public class TrialStatService(
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
|
||||||
// 先把 resultList 转成内存字典
|
|
||||||
var resultDict = resultList.ToDictionary(r => r.OverallTumorEvaluation, r => r.SubjectCount);
|
|
||||||
|
|
||||||
// 查询字典表,先把数据拉出来到内存,再合并
|
|
||||||
var dicList = _dictionaryRepository
|
|
||||||
.Where(t => t.Parent.Code == dicName)
|
|
||||||
.Select(t => new
|
|
||||||
{
|
|
||||||
t.Code
|
|
||||||
})
|
|
||||||
.ToList()
|
|
||||||
.Select(t => new EfficacyEvaluationStatViewModel
|
|
||||||
{
|
|
||||||
DictionaryCode = dicName,
|
|
||||||
OverallTumorEvaluation = t.Code,
|
|
||||||
SubjectCount = resultDict.ContainsKey(t.Code) ? resultDict[t.Code] : 0
|
|
||||||
})
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
return dicList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue