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

This commit is contained in:
he
2025-11-07 11:47:59 +08:00
18 changed files with 2092 additions and 25 deletions
@@ -490,6 +490,8 @@ namespace IRaCIS.Core.Application.ViewModel
public int? RandomOrder { get; set; }
public bool? IsRandomOrderList { get; set; }
public CriterionType? CriterionType { get; set; }
}
@@ -2597,13 +2597,19 @@ namespace IRaCIS.Core.Application.Service.Common
list.Add(new ExportDocumentDes() { Code = StaticData.Export.ReadingLession_Export, ExportCatogory = ExportResult.DetailedTableOfLesions });
}
if (criterion.CriterionType == CriterionType.RECIST1Point1)
{
list.Add(new ExportDocumentDes() { Code = StaticData.Export.TumorCDISC_Export, ExportCatogory = ExportResult.TumorCDISC_Export });
}
if (criterion.CriterionType == CriterionType.OCT)
{
list.Add(new ExportDocumentDes() { Code = StaticData.Export.OCT_ReadingLession_Export, ExportCatogory = ExportResult.OCT_ReadingLession_Export });
}
//else if (criterion.CriterionType == CriterionType.SelfDefine)
if (criterion.CriterionGroup != CriterionGroup.Tumor)
{
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CDISC_Reading_Export, ExportCatogory = ExportResult.CDISC });
list.Add(new ExportDocumentDes() { Code = StaticData.Export.CDISC_Reading_Export, ExportCatogory = ExportResult.NoneTumorCDISC });
}
switch (criterion.ArbitrationRule)
@@ -2784,7 +2790,7 @@ namespace IRaCIS.Core.Application.Service.Common
}
// 非肿瘤标准 包括自定义,以及系统非肿瘤 会配置到表格层级 问题名称是 表格名称_表格子问题名
else if (
criterion.CriterionGroup == CriterionGroup.Nontumorous && inQuery.ReadingExportType != ExportResult.CDISC
criterion.CriterionGroup == CriterionGroup.Nontumorous && inQuery.ReadingExportType != ExportResult.NoneTumorCDISC
)
{
@@ -2801,7 +2807,7 @@ namespace IRaCIS.Core.Application.Service.Common
}
// CDISC 导出 只管到 外层问题层级 和阅片结果表是保持一致
else if (inQuery.ReadingExportType == ExportResult.CDISC)
else if (inQuery.ReadingExportType == ExportResult.NoneTumorCDISC)
{
if (criterion.CriterionGroup == CriterionGroup.Tumor)
@@ -2869,7 +2875,7 @@ namespace IRaCIS.Core.Application.Service.Common
#endregion
if (inQuery.ReadingExportType != ExportResult.CDISC)
if (inQuery.ReadingExportType != ExportResult.NoneTumorCDISC)
{
//最终EXCEL 列
var configCoumNameList = new List<DynamicColumnConfig.ColumItem>();
@@ -3025,7 +3031,7 @@ namespace IRaCIS.Core.Application.Service.Common
#endregion
#region list taskList list
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB
|| criterion.CriterionType == CriterionType.IRECIST1Point1 || criterion.CriterionType == CriterionType.mRECISTHCC)
{
//针对1.1 整体肿瘤评估 有的两列要合并一列
@@ -3475,7 +3481,7 @@ namespace IRaCIS.Core.Application.Service.Common
string fileName = "";
if (inQuery.ReadingExportType == ExportResult.CDISC)
if (inQuery.ReadingExportType == ExportResult.NoneTumorCDISC)
{
(memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(export_Template, exportInfo, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CommonEvaluationExport), criterion.CriterionType, dynamicColumnConfig);
@@ -0,0 +1,485 @@
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Helper;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IRaCIS.Core.Application.Service.Common;
public class TumorCommonQustionInfo
{
//问题标识,肿瘤评估用于区分是什么问题
public QuestionType? QuestionType { get; set; }
public Guid QuestionId { get; set; }
public string QuestionName { get; set; }
public string QuestionValue { get; set; }
public string TranslateDicName { get; set; }
public ValueUnit? Unit { get; set; }
}
public class TumorLessionInfo
{
public Guid Id { get; set; }
//病灶编号
public string LessionCode { get; set; }
public LesionType? LessionType { get; set; }
public Guid? SplitRowId { get; set; }
public string? DicomModality { get; set; }
public string? NoneDicomModality { get; set; }
//病灶答案
public List<TumorLessionAnswerInfo> LessionAnswerList { get; set; }
}
public class TumorLessionAnswerInfo
{
public QuestionMark? QuestionMark { get; set; }
//病灶Id
public Guid RowId { get; set; }
//如果是4 就取CustomUnit 否则就是字典翻译
[Comment("单位")]
public ValueUnit? Unit { get; set; }
public int ShowOrder { get; set; }
public Guid TableQuesionId { get; set; }
public string QuestionName { get; set; }
public string QuestionValue { get; set; }
public string TranslateDicName { get; set; }
}
public class TumorGlobalQuestionAnserInfo
{
[Comment("原任务ID")]
public Guid TaskId { get; set; }
[Comment("问题答案")]
public string Answer { get; set; } = string.Empty;
}
public class TumorExportBaseModel : TU_TR_RSBaseModel
{
public List<TumorLessionInfo> LesionList { get; set; } = new List<TumorLessionInfo>();
public List<TumorCommonQustionInfo> QuestionAnswerList { get; set; }
public List<TumorGlobalQuestionAnserInfo> GlobalResultList { get; set; }
#region
public DateTime? JudgeSignTime { get; set; }
public Guid? SourceSubjectVisitId { get; set; }
public List<decimal> SubjectCriterionReadingPeriodVisitNumList { get; set; }
public decimal VisitTaskNum { get; set; }
public ReadingTaskState ReadingTaskState { get; set; }
public ReadingCategory ReadingCategory { get; set; }
//裁判结果选择的访视或者全局任务Id
public Arm? JudgeArmEnum { get; set; }
//在当前访视触发裁判,或者在截止日期小于等于当前访视的阅片期触发裁判
[DictionaryTranslateAttribute("YesOrNoAudit")]
public bool? IsTrigerJudge { get; set; }
//(如果是访视点裁判,则仅在所选阅片人对应访视 显示;如果是阅片期裁判,则在所选阅片人 阅片期内的所有访视 显示此原因)
public string JudgeNote { get; set; } = string.Empty;
public string VisitNote { get; set; }
#endregion
}
public class TU_TR_RSBaseModel
{
/// <summary>
/// 方案编号 STUDYID
/// </summary>
public string ResearchProgramNo { get; set; }
/// <summary>
/// 域 DOMAIN TU TR RS
/// </summary>
public string Domain { get; set; }
/// <summary>
/// 取值类型 TUSPID TRSPID RSSPID
/// </summary>
public string ValueType { get; set; }
/// <summary>
/// 受试者编号 USUBJID 实际展示TrialSiteSubjectCode
/// </summary>
public string SubjectCode { get; set; }
/// <summary>
/// 供应商 TUNAM (Extensive Imaging)
/// </summary>
public string Vendor { get; set; } = "Extensive Imaging";
/// <summary>
/// 阅片人 TUEVAL TREVAL RSEVAL
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 阅片人标识 TUEVALID TREVALID RSEVALID
/// </summary>
public Arm ArmEnum { get; set; }
/// <summary>
/// 访视编号 VISITNUM
/// </summary>
public decimal? VisitNum { get; set; }
/// <summary>
/// 访视名称 VISIT
/// </summary>
public string? VisitName { get; set; }
/// <summary>
/// 拍片日期 TUDTC TRDTC RSDTC
/// </summary>
public DateTime? LatestScanDate { get; set; }
/// <summary>
/// eCRF标识 TUREFID TRREFID RSREFID
/// </summary>
public Guid VisitTaskId { get; set; }
#region
/// <summary>
/// RSCAT 阅片标准
/// </summary>
public string CriterionName { get; set; }
/// <summary>
/// RSACPTFL 裁定标记 TUACPTFL
/// </summary>
//裁判选择标记
//根据裁判的任务结果 设置访视任务的这个字段 该字段表示 裁判认同该任务的结果
public bool? IsJudgeSelect { get; set; }
#endregion
#region
public string IsJudgeSelectStr => IsJudgeSelect == true ? "Y" : "";
public string ArmEnumStr { get; set; }
public string LatestScanDateStr => LatestScanDate != null ? LatestScanDate?.ToString("yyyy-MM-dd")! : "";
public string TrialSiteSubjectCode => ResearchProgramNo + SubjectCode;
#endregion
}
public class TU_Export : TU_TR_RSBaseModel
{
///// <summary>
///// 取值类型 TUSPID
///// </summary>
//public string TUValueType { get; set; }
/// <summary>
/// 序号 TUSEQ (同一个访视,所有阅片人选择病灶给个顺序号)
/// </summary>
public int No { get; set; }
/// <summary>
/// 链接ID TULNKID (阅片人角色_病灶编号)不同访视可以重复
/// </summary>
public string ARM_TumorNo { get; set; }
/// <summary>
/// 肿瘤识别简称 TUTESTCD
/// </summary>
public string TumorIdentificationSimple { get; set; }
/// <summary>
/// 肿瘤识别全称 TUTEST
/// </summary>
public string TumorIdentificationFullName { get; set; }
/// <summary>
/// 肿瘤鉴定结果 TUORRES
/// </summary>
public string TumorIdentificationResult { get; set; }
/// <summary>
/// 肿瘤识别结果类型 TUSTRESC
/// </summary>
public string TumorIdentificationResultType { get; set; }
/// <summary>
/// 部位 TULOC (对应病灶表的部位,需要国际化)
/// </summary>
public string BodyPart { get; set; }
/// <summary>
/// 鉴定方法 TUMETHOD (Modality?)
/// </summary>
public string IdentificationMethod { get; set; }
///// <summary>
///// 裁定标记 TUACPTFL
///// </summary>
//public bool? IsJudgeSelect { get; set; }
/// <summary>
/// 部位描述 LOCTEXT
/// </summary>
public string BodyPartDes { get; set; }
}
public class TR_Export : TU_TR_RSBaseModel
{
///// <summary>
///// 取值类型 TRSPID
///// </summary>
//public string TRValueType { get; set; }
/// <summary>
/// 每个subject 按照顺序编号 TRSEQ
/// </summary>
public int TRSEQ { get; set; }
/// <summary>
///TRGRPID 组ID 对应TU表肿瘤鉴定结果 TumorIdentificationResult
/// </summary>
public string TRGRPID { get; set; }
/// <summary>
/// TRLNKID 链接ID 对应TU表的链接ID TumorNo(阅片人角色_病灶编号)
/// </summary>
public string ARM_TumorNo { get; set; }
/// <summary>
///TRLNKGRP 链接组 ARM-任务名(访视名) 对应RS的链接组
/// </summary>
public string ARM_VisitName { get; set; }
/// <summary>
/// 肿瘤评估简称 TRTESTCD
/// </summary>
public string TumorAssessmentSimpleName { get; set; }
/// <summary>
/// 肿瘤评估全称 TRTEST
/// </summary>
public string TumorAssessmentFullName { get; set; }
/// <summary>
/// 原始测量 TRORRES
/// </summary>
public string OriginalMeasurements { get; set; }
/// <summary>
/// 原始单位 TRORRESU
/// </summary>
public string OriginalUnit { get; set; }
/// <summary>
/// 标准结果(字符) TRSTRESC
/// </summary>
public string StandardResult_Character => OriginalMeasurements;
/// <summary>
/// 标准结果(数值) TRORRESU
/// </summary>
public string StandardResult_Numeric => double.TryParse(OriginalMeasurements, out _) ? OriginalMeasurements : "";
/// <summary>
/// 标准单位 TRSTRESU
/// </summary>
public string StandardUnit => OriginalUnit;
/// <summary>
/// 完成状态 TRSTAT
/// </summary>
public string CompletionStatus { get; set; }
/// <summary>
/// 完成状态 TRMETHOD
/// </summary>
public string IdentificationMethod { get; set; }
/// <summary>
/// 无法测量原因 TRREASND
/// </summary>
public string NotMeasuredReason { get; set; }
}
public class RS_Export : TU_TR_RSBaseModel
{
/// <summary>
/// RSSEQ 按照subject 的数据顺序编号
/// </summary>
public int RSSEQ { get; set; }
/// <summary>
/// RSLNKGRP 链接组 ARM_任务名(访视名)
/// </summary>
public string ARM_VisitName { get; set; }
/// <summary>
/// RSTESTCD 疗效评估简称
/// </summary>
public string EfficacyEvaluationSimpleName { get; set; }
/// <summary>
/// RSTEST 疗效评估全称
/// </summary>
public string EfficacyEvaluationName { get; set; }
/// <summary>
/// RSORRES 响应评估原始结果
/// </summary>
public string RespondEfficacyAssessment { get; set; }
/// <summary>
/// RSSTRESC 标准疗效评估
/// </summary>
public string StandardEfficacyAssessment => RespondEfficacyAssessment;
/// <summary>
/// RSSTAT 完成状态
/// </summary>
public string CompletionStatus { get; set; }
/// <summary>
/// RSREASND 无法评估原因
/// </summary>
public string NotAssessmentReason { get; set; }
///// <summary>
///// 裁定标记 RSACPTFL
///// </summary>
//public bool? IsJudgeSelect { get; set; }
/// <summary>
/// REASASM 评估原因
/// </summary>
public string AssessmentReason { get; set; }
/// <summary>
/// REASOVR 重新评估原因
/// </summary>
public string ReAssessmentReason { get; set; }
/// <summary>
/// REASUPD 更新评估原因
/// </summary>
public string UpdateAssessmentReason { get; set; }
[JsonIgnore]
public bool? IsOveralResponse { get; set; }
}
public class CO_Export : TU_TR_RSBaseModel
{
/// <summary>
/// 关联域 RS:(访视点备注) 空:裁判选择原因
/// </summary>
public string RDOMAIN { get; set; }
/// <summary>
/// COSEQ 序号
/// </summary>
public int COSEQ { get; set; }
/// <summary>
/// IDVAR 标识变量 RSSEQ 空:裁判选择原因
/// </summary>
public string IdentificationVariable { get; set; }
/// <summary>
/// 标识 IDVARVAL RSSEQ具体的值 空:裁判选择原因
/// </summary>
public string Identification { get; set; }
/// <summary>
/// COREF 备注引用
/// </summary>
public string RemarksQuote { get; set; }
/// <summary>
/// 备注 COVAL
/// </summary>
public string Remarks { get; set; }
/// <summary>
/// 裁决日期 CODTC
/// </summary>
public string CODTC { get; set; }
}
File diff suppressed because it is too large Load Diff
@@ -989,7 +989,7 @@ namespace IRaCIS.Core.Application.Service
};
await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.SiteSurvey_CheckUser, messageToSend, emailConfigFunc);
await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.SiteSurvey_UpdateUser, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
@@ -2,6 +2,7 @@
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.Service.Common;
using IRaCIS.Core.Application.ViewModel;
namespace IRaCIS.Core.Application.Service
@@ -115,6 +116,10 @@ namespace IRaCIS.Core.Application.Service
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode));
CreateMap<TumorExportBaseModel , TU_Export>();
CreateMap<TumorExportBaseModel, TR_Export>();
CreateMap<TumorExportBaseModel, RS_Export>();
CreateMap<TumorExportBaseModel, CO_Export>();
}
}
@@ -861,7 +861,7 @@ namespace IRaCIS.Core.Application.Service
if (isRemember)
{
await _fusionCache.SetAsync(CacheKeys.UserMFAVerifyPass(identityUserId), _userInfo.BrowserFingerprint, TimeSpan.FromDays(_serviceVerifyConfigConfig.UserMFAVerifyDays));
await _fusionCache.SetAsync(CacheKeys.UserMFAVerifyPass(identityUserId, _userInfo.BrowserFingerprint), _userInfo.BrowserFingerprint, TimeSpan.FromMinutes(_serviceVerifyConfigConfig.UserMFAVerifyMinutes));
}
@@ -1107,9 +1107,9 @@ namespace IRaCIS.Core.Application.Service
var userAgreementList = await _userAgreementRepository.Where(t => t.IsCurrentVersion).OrderByDescending(t => t.CreateTime).ToListAsync();
var userAgreement= userAgreementList.FirstOrDefault(t => t.UserAgreementTypeEnum == UserAgreementType.UserAgreement);
var userAgreement = userAgreementList.FirstOrDefault(t => t.UserAgreementTypeEnum == UserAgreementType.UserAgreement);
if (userAgreement!=null&& loginUser.UserAgreementId!= userAgreement.Id)
if (userAgreement != null && loginUser.UserAgreementId != userAgreement.Id)
{
await _identityUserRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.IdentityUserId, x => new IdentityUser()
{
@@ -1119,13 +1119,13 @@ namespace IRaCIS.Core.Application.Service
var obj = new
{
UserAgreementTypeEnum = UserAgreementType.UserAgreement,
FileVersion=userAgreement.FileVersion,
UserAgreementId=userAgreement.Id,
IsEn_Us= _userInfo.IsEn_Us,
FileVersion = userAgreement.FileVersion,
UserAgreementId = userAgreement.Id,
IsEn_Us = _userInfo.IsEn_Us,
};
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, ActionUserName = loginUser.UserName, OptType = UserOptType.AcceptUserAgreement, JsonObj= obj.ToJsonStr() }, true);
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, ActionUserName = loginUser.UserName, OptType = UserOptType.AcceptUserAgreement, JsonObj = obj.ToJsonStr() }, true);
}
@@ -1176,7 +1176,7 @@ namespace IRaCIS.Core.Application.Service
if (_verifyConfig.CurrentValue.OpenLoginMFA)
{
if ((await _fusionCache.GetOrDefaultAsync(CacheKeys.UserMFAVerifyPass(identityUserId), "")) == _userInfo.BrowserFingerprint)
if ((await _fusionCache.GetOrDefaultAsync(CacheKeys.UserMFAVerifyPass(identityUserId, _userInfo.BrowserFingerprint), "")) == _userInfo.BrowserFingerprint)
{
userLoginReturnModel.IsMFA = false;
}
@@ -1196,9 +1196,10 @@ namespace IRaCIS.Core.Application.Service
//修改密码 || 90天修改密码再mfa 之前
if (userLoginReturnModel.BasicInfo.IsFirstAdd || userLoginReturnModel.BasicInfo.NeedChangePassWord)
{
//移动到上面去了
//userLoginReturnModel.JWTStr = _tokenService.GetToken(userLoginReturnModel.BasicInfo);
}
else
else if (userLoginReturnModel.IsMFA == true)
{
//正常登录才发送邮件
await SendMFAEmail(new SendMfaCommand() { IdentityUserId = identityUserId, MFAType = UserMFAType.Login });
@@ -68,8 +68,8 @@ namespace IRaCIS.Core.Application.Service
throw new BusinessValidationFailedException(_localizer["ReadingQuestion_CDISCCodeRepeat"]);
}
if(inDto.QuestionList.Any(x=>x.ExportResult.Contains(ExportResult.CDISC)&&x.CDISCCode.IsNullOrEmpty())
|| inDto.TableQuestionList.Any(x => x.ExportResult.Contains(ExportResult.CDISC) && x.CDISCCode.IsNullOrEmpty())
if(inDto.QuestionList.Any(x=>x.ExportResult.Contains(ExportResult.NoneTumorCDISC)&&x.CDISCCode.IsNullOrEmpty())
|| inDto.TableQuestionList.Any(x => x.ExportResult.Contains(ExportResult.NoneTumorCDISC) && x.CDISCCode.IsNullOrEmpty())
)
{
throw new BusinessValidationFailedException(_localizer["ReadingQuestion_CDISCCodeCannotEmpty"]);