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 passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1073,6 +1073,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
[Comment("SPM 参与重阅审批")]
|
||||
public bool IsSPMJoinReReadingApproval { get; set; }
|
||||
|
||||
public bool IsExternalViewTrialChart { get; set; }
|
||||
}
|
||||
|
||||
public class TrialConfigDTO : BasicTrialConfig
|
||||
@@ -1089,6 +1091,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
[Comment("SPM 参与重阅审批")]
|
||||
public bool IsSPMJoinReReadingApproval { get; set; }
|
||||
|
||||
public bool IsExternalViewTrialChart { get; set; }
|
||||
|
||||
public List<string> ImageFormatList { get; set; }
|
||||
|
||||
public List<Guid> TrialCriterionIds { get; set; } = new List<Guid>();
|
||||
|
||||
@@ -114,6 +114,18 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public double? MonthsDiff
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DaysDiff.HasValue)
|
||||
{
|
||||
return Math.Round(DaysDiff.Value / 30.44, 2, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class EfficacyEvaluationStatViewModel
|
||||
@@ -125,7 +137,23 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public int SubjectCount => SubjectCodeList.Count();
|
||||
|
||||
public List<string> SubjectCodeList { get; set; }
|
||||
public List<EfficacyEvaluationSubjectInfo> SubjectCodeList { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class EfficacyEvaluationSubjectInfo
|
||||
{
|
||||
public string TrialSiteCode { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; }
|
||||
}
|
||||
|
||||
public class TrialSiteOrrStat
|
||||
{
|
||||
public string TrialSiteCode { get; set; }
|
||||
public int SiteSubjectCount { get; set; }
|
||||
public int SiteCrPrSubjectCount { get; set; }
|
||||
public string OrrPercent { get; set; }
|
||||
}
|
||||
|
||||
public class EfficacyEvaluationExport
|
||||
@@ -140,6 +168,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public string TrialSiteCode { get; set; }
|
||||
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
||||
public decimal VisitTaskNum { get; set; }
|
||||
|
||||
@@ -281,6 +281,8 @@ namespace IRaCIS.Application.Contracts
|
||||
|
||||
public bool IsIQCAutoNextTask { get; set; }
|
||||
|
||||
|
||||
public bool IsExternalViewTrialChart { get; set; }
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
@@ -1546,14 +1546,14 @@ namespace IRaCIS.Core.Application
|
||||
[AllowAnonymous]
|
||||
public async Task<TrialConfigInfo> GetTrialExtralConfig(Guid trialId)
|
||||
{
|
||||
var extralObj = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.TrialExtraConfigJsonStr, t.TrialObjectNameList, t.CollectImagesEnum, t.IsIQCAutoNextTask }).FirstOrDefault();
|
||||
var extralObj = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.TrialExtraConfigJsonStr,t.IsExternalViewTrialChart, t.TrialObjectNameList, t.CollectImagesEnum, t.IsIQCAutoNextTask }).FirstOrDefault();
|
||||
|
||||
var extralConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(extralObj?.TrialExtraConfigJsonStr) ?? new TrialExtraConfig();
|
||||
|
||||
var trialConfig = _mapper.Map<TrialConfigInfo>(extralConfig);
|
||||
|
||||
trialConfig.TrialObjectNameList = extralObj.TrialObjectNameList;
|
||||
|
||||
trialConfig.IsExternalViewTrialChart = extralObj.IsExternalViewTrialChart;
|
||||
trialConfig.CollectImagesEnum = extralObj.CollectImagesEnum;
|
||||
trialConfig.IsIQCAutoNextTask = extralObj.IsIQCAutoNextTask;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -149,7 +150,7 @@ public class TrialStatService(
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
|
||||
questionType = QuestionType.SiteVisitForTumorEvaluation;
|
||||
}
|
||||
|
||||
|
||||
@@ -162,6 +163,7 @@ public class TrialStatService(
|
||||
{
|
||||
Id = t.Id,
|
||||
SubjectId = t.SubjectId,
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
SubjectCode = t.Subject.Code,
|
||||
VisitTaskNum = t.VisitTaskNum,
|
||||
TaskName = t.TaskName,
|
||||
@@ -236,7 +238,7 @@ public class TrialStatService(
|
||||
DictionaryCode = g.FirstOrDefault()?.DictionaryCode,
|
||||
OverallTumorEvaluation = g.Key,
|
||||
Code = g.Key,
|
||||
SubjectCodeList = g.Select(t => t.SubjectCode).Distinct().ToList()
|
||||
SubjectCodeList = g.Select(t => new EfficacyEvaluationSubjectInfo { SubjectCode = t.SubjectCode, TrialSiteCode = t.TrialSiteCode }).Distinct().ToList()
|
||||
}).ToList();
|
||||
|
||||
|
||||
@@ -254,27 +256,22 @@ public class TrialStatService(
|
||||
t.Dictionary.Value,
|
||||
})
|
||||
.ToList()
|
||||
.Where(t => t.Code != "-1")
|
||||
.WhereIf(criterion.CriterionType != CriterionType.PCWG3, t => t.Code != "-1")
|
||||
.WhereIf(criterion.CriterionType == CriterionType.PCWG3, t => t.Code != "5")
|
||||
.Select(t => new EfficacyEvaluationStatViewModel
|
||||
{
|
||||
DictionaryCode = dicName,
|
||||
Code = t.Code, //方便找到首次PD的日期
|
||||
OverallTumorEvaluation = t.Value,//翻译后的值
|
||||
SubjectCodeList = resultDict.ContainsKey(t.Code) ? resultDict[t.Code] : new List<string>()
|
||||
SubjectCodeList = resultDict.ContainsKey(t.Code) ? resultDict[t.Code] : new List<EfficacyEvaluationSubjectInfo>()
|
||||
})
|
||||
.ToList();
|
||||
|
||||
// (cr +pr) /总人数
|
||||
|
||||
var crAddPr = translateList.Where(t => t.OverallTumorEvaluation == "PR" || t.OverallTumorEvaluation == "CR").Sum(t => t.SubjectCount);
|
||||
|
||||
var orrPercent = totalSubjectCount > 0
|
||||
? ((decimal)crAddPr / totalSubjectCount * 100).ToString("0.00") + "%"
|
||||
: "0.00%";
|
||||
|
||||
var pdInfo = translateList
|
||||
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "ICPD")
|
||||
.WhereIf(criterion.CriterionType == CriterionType.RECIST1Point1, t => t.OverallTumorEvaluation == "PD")
|
||||
.WhereIf(criterion.CriterionType == CriterionType.IRECIST1Point1, t => t.OverallTumorEvaluation == "iCPD")
|
||||
.WhereIf(criterion.CriterionType == CriterionType.Lugano2014, t => t.OverallTumorEvaluation == "PMD/PD")
|
||||
.WhereIf(criterion.CriterionType != CriterionType.IRECIST1Point1 && criterion.CriterionType != CriterionType.Lugano2014, t => t.OverallTumorEvaluation == "PD")
|
||||
.FirstOrDefault();
|
||||
|
||||
var firstPdList = new List<FirstPdInfo>();
|
||||
@@ -299,8 +296,58 @@ public class TrialStatService(
|
||||
|
||||
}
|
||||
|
||||
// (cr +pr) /总人数
|
||||
|
||||
return ResponseOutput.Ok(translateList, new { PDList = firstPdList, ORR = orrPercent });
|
||||
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
|
||||
? ((decimal)crAddPr / totalSubjectCount * 100).ToString("0.00") + "%"
|
||||
: "0.00%";
|
||||
|
||||
|
||||
var centerOrrList = translateList
|
||||
// 先把 Subject 拆平
|
||||
.SelectMany(t => t.SubjectCodeList.Select(s => new
|
||||
{
|
||||
s.TrialSiteCode,
|
||||
s.SubjectCode,
|
||||
t.OverallTumorEvaluation
|
||||
}))
|
||||
// 按中心分组
|
||||
.GroupBy(x => x.TrialSiteCode)
|
||||
.Select(g =>
|
||||
{
|
||||
var total = g.Count();
|
||||
|
||||
var crPr = g
|
||||
.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")
|
||||
.Count();
|
||||
|
||||
|
||||
return new TrialSiteOrrStat
|
||||
{
|
||||
TrialSiteCode = g.Key,
|
||||
SiteSubjectCount = total,
|
||||
SiteCrPrSubjectCount = crPr,
|
||||
OrrPercent = total > 0
|
||||
? ((decimal)crPr / total * 100).ToString("0.00") + "%"
|
||||
: "0.00%"
|
||||
};
|
||||
})
|
||||
.ToList();
|
||||
|
||||
|
||||
return ResponseOutput.Ok(translateList, new { PDList = firstPdList, ORR = orrPercent, SiteORRList = centerOrrList });
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -289,9 +289,9 @@ namespace IRaCIS.Application.Contracts
|
||||
public List<TrialCriterionReadingCategory> CriterionReadingCategoryList { get; set; }
|
||||
|
||||
//任务阅片状态
|
||||
public List<DoctorUserTask> ReadingTaskStateList { get; set; }
|
||||
public List<DoctorUserTask> ReadingTaskStateList { get; set; } = new List<DoctorUserTask>();
|
||||
|
||||
public List<CriterionFile> CriterionFileList { get; set; }
|
||||
public List<CriterionFile> CriterionFileList { get; set; } = new List<CriterionFile>();
|
||||
|
||||
|
||||
public List<CriterionReadingCategory> CriterionCategoryList =>
|
||||
|
||||
Reference in New Issue
Block a user