合并
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-04 10:37:37 +08:00
17 changed files with 519 additions and 152 deletions
@@ -16,6 +16,7 @@ namespace IRaCIS.Core.Application;
[ApiExplorerSettings(GroupName = "Trial")]
public class TrialStatService(
IRepository<Trial> _trialRepository,
IRepository<ReadingTrialCriterionDictionary> _readingTrialCriterionDictionaryRepository,
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
IRepository<SubjectVisit> _subjectVisitRepository,
IRepository<TrialDocument> _trialDocumentRepository,
@@ -90,7 +91,7 @@ public class TrialStatService(
CheckQuestion_ClosedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
.Where(t => t.CheckChallengeState == CheckChanllengeTypeEnum.Closed).Count(),
CheckQuestion_IngCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
.Where(t => t.CheckChallengeState != CheckChanllengeTypeEnum.Closed).Count(),
.Where(t => t.CheckChallengeState == CheckChanllengeTypeEnum.CRCWaitPMReply || t.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count(),
MedicalReviewQuestion_ClosedCount = t.TaskMedicalReviewList.Where(t => inQuery.TrialSiteId != null ? t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId : true)
@@ -119,7 +120,7 @@ public class TrialStatService(
var trialReadingCriterionId = inQuery.TrialReadingCriterionId;
//每次查询必须是单标准的
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionGroup, t.IsGlobalReading, t.IsArbitrationReading, t.IsOncologyReading, t.CriterionName, t.ArbitrationRule, t.TrialId }).FirstNotNullAsync();
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).Select(t => new { t.Id, t.CriterionType, t.CriterionGroup, t.IsGlobalReading, t.IsArbitrationReading, t.IsOncologyReading, t.CriterionName, t.ArbitrationRule, t.TrialId }).FirstNotNullAsync();
if (criterion.CriterionGroup == CriterionGroup.Nontumorous)
@@ -240,15 +241,18 @@ public class TrialStatService(
// 先把 resultList 转成内存字典
var resultDict = resultList.ToDictionary(r => r.OverallTumorEvaluation, r => r.SubjectCodeList);
// 查询字典表,先把数据拉出来到内存,再合并
var translateList = _dictionaryRepository
.Where(t => t.Parent.Code == dicName)
var translateList = _readingTrialCriterionDictionaryRepository
.Where(t => t.ParentCode == dicName && t.CriterionId == criterion.Id)
.Select(t => new
{
t.Code,
t.Value,
t.Dictionary.Code,
t.Dictionary.Value,
})
.ToList()
.Where(t => t.Code != "-1")
.Select(t => new EfficacyEvaluationStatViewModel
{
DictionaryCode = dicName,
@@ -268,7 +272,7 @@ public class TrialStatService(
var pdInfo = translateList
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "ICPD")
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "PD")
.WhereIf(criterion.CriterionType == CriterionType.RECIST1Point1, t => t.OverallTumorEvaluation == "PD")
.FirstOrDefault();
var firstPdList = new List<FirstPdInfo>();