修改orr 统计
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
hang 2026-01-05 16:26:10 +08:00
parent fcd0dd9b08
commit 7523f646fe
1 changed files with 16 additions and 4 deletions

View File

@ -4,6 +4,7 @@ using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infra.EFCore.Common; using IRaCIS.Core.Infra.EFCore.Common;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using NPOI.SS.Formula.Functions;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -297,7 +298,13 @@ public class TrialStatService(
// cr +pr /总人数 // cr +pr /总人数
var crAddPr = translateList.Where(t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR").Sum(t => t.SubjectCount); var crAddPr = translateList
.WhereIf(criterion.CriterionType != CriterionType.Lugano2014 && criterion.CriterionType != CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR")
.WhereIf(criterion.CriterionType == CriterionType.Lugano2014, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR"
|| t.OverallTumorEvaluation == "PMR/PR" || t.OverallTumorEvaluation == "CMR/CR")
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR"
|| t.OverallTumorEvaluation == "iPR" || t.OverallTumorEvaluation == "iCR")
.Sum(t => t.SubjectCount);
var orrPercent = totalSubjectCount > 0 var orrPercent = totalSubjectCount > 0
? ((decimal)crAddPr / totalSubjectCount * 100).ToString("0.00") + "%" ? ((decimal)crAddPr / totalSubjectCount * 100).ToString("0.00") + "%"
@ -318,9 +325,14 @@ public class TrialStatService(
{ {
var total = g.Count(); var total = g.Count();
var crPr = g.Count(x => var crPr = g
x.OverallTumorEvaluation == "CR" || .WhereIf(criterion.CriterionType != CriterionType.Lugano2014 && criterion.CriterionType != CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR")
x.OverallTumorEvaluation == "PR"); .WhereIf(criterion.CriterionType == CriterionType.Lugano2014, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR"
|| t.OverallTumorEvaluation == "PMR/PR" || t.OverallTumorEvaluation == "CMR/CR")
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR"
|| t.OverallTumorEvaluation == "iPR" || t.OverallTumorEvaluation == "iCR")
.Count();
return new TrialSiteOrrStat return new TrialSiteOrrStat
{ {