using IRaCIS.Core.Domain.Share; using System.Linq; using ZstdSharp.Unsafe; namespace IRaCIS.Core.Domain.Models; [Comment("项目 - 项目基本信息与配置")] [Table("Trial")] public partial class Trial : BaseFullDeleteAuditEntity { #region 导航属性 [JsonIgnore] [ForeignKey("SponsorId")] public Sponsor Sponsor { get; set; } [JsonIgnore] [ForeignKey("CROId")] public CRO CRO { get; set; } [JsonIgnore] public List TrialBodyPartList { get; set; } [JsonIgnore] public List TaskMedicalReviewList { get; set; } [JsonIgnore] public List TaskConsistentRuleList { get; set; } [JsonIgnore] public List SubjectDoctorUserList { get; set; } = new List(); [JsonIgnore] public List VisitTaskList { get; set; } = new List() { }; [JsonIgnore] public List VisitTaskReReadingList { get; set; } [JsonIgnore] public List TrialSiteSurveyList { get; set; } = new List(); [JsonIgnore] public List TrialDocumentList { get; set; } [JsonIgnore] public List EnrollList { get; set; } = new List(); [JsonIgnore] public List WorkloadList { get; set; } = new List(); [JsonIgnore] public List TrialUserRoleList { get; set; } = new List(); [JsonIgnore] public List TrialIdentityUserList { get; set; } [JsonIgnore] public List TrialReadingCriterionList { get; set; } = new List(); [JsonIgnore] public List SubjectList { get; set; } = new List(); [JsonIgnore] public List SubjectVisitList { get; set; } = new List(); [JsonIgnore] public List NoneDicomStudyList { get; set; } [JsonIgnore] public List StudyList { get; set; } = new List(); [JsonIgnore] public List TrialSiteList { get; set; } = new List(); [JsonIgnore] public List TrialSiteUserList { get; set; } = new List(); [JsonIgnore] public List ReadModuleList { get; set; } = new List(); [JsonIgnore] public List UserFeedBackList { get; set; } = new List(); [JsonIgnore] [ForeignKey("IndicationTypeId")] public Dictionary IndicationType { get; set; } [JsonIgnore] [ForeignKey("PhaseId")] public Dictionary Phase { get; set; } [JsonIgnore] [ForeignKey("ReviewModeId")] public Dictionary ReviewMode { get; set; } [JsonIgnore] public List ClinicalDataTrialSetList { get; set; } = new List { }; [JsonIgnore] public List ClinicalTrialProjectDetails { get; set; } = new List { }; [JsonIgnore] public List TrialDicList { get; set; } = new List(); [JsonIgnore] public List ReadingClinicalDataList { get; set; } [JsonIgnore] public List TrialStateChangeList { get; set; } = new List(); #endregion public Guid IndicationTypeId { get; set; } = Guid.Empty; public Guid? PhaseId { get; set; } = Guid.Empty; public string TrialCode { get; set; } = string.Empty; public int Code { get; set; } public string Indication { get; set; } = string.Empty; [Comment("入组那一块的状态")] public int TrialEnrollStatus { get; set; } [Comment("启动状态")] public string TrialStatusStr { get; set; } = StaticData.TrialState.TrialInitializing; public Guid? CROId { get; set; } = Guid.Empty; public Guid? SponsorId { get; set; } = Guid.Empty; public Guid? ReviewModeId { get; set; } = Guid.Empty; public string ProjectCycle { get; set; } = string.Empty; public int ExpectedPatients { get; set; } public decimal TimePointsPerPatient { get; set; } public int GRRReviewers { get; set; } public int TotalReviewers { get; set; } public string ReviewProtocol { get; set; } = string.Empty; public string MessageFromClient { get; set; } = string.Empty; public string Note { get; set; } = string.Empty; public string ReviewProtocolName { get; set; } = string.Empty; public string MessageFromClientName { get; set; } = string.Empty; public int Expedited { get; set; } public string DeclarationTypes { get; set; } = string.Empty; [NotMapped] public List DeclarationTypeEnumList => DeclarationTypes.Split('|', StringSplitOptions.RemoveEmptyEntries) .Select(s => Enum.Parse(typeof(DeclarationType), s)).Cast().ToList(); [NotMapped] public List AttendedReviewerTypeEnumList => AttendedReviewerTypes.Split('|', StringSplitOptions.RemoveEmptyEntries) .Select(s => Enum.Parse(typeof(AttendedReviewerType), s)).Cast().ToList(); public string AttendedReviewerTypes { get; set; } = string.Empty; [StringLength(1000)] public string TrialExtraConfigJsonStr { get; set; } = string.Empty; public bool VisitPlanConfirmed { get; set; } [Comment("受试者编号具体规则")] public string SubjectCodeRule { get; set; } = I18n.T("Trial_number"); [Comment("是否 提醒受试者编号规则")] public bool IsNoticeSubjectCodeRule { get; set; } = true; [Comment("是否 有基准时间(首次给药时间)")] public bool IsHaveFirstGiveMedicineDate { get; set; } = true; [Comment("是否有 受试者年龄")] public bool IsHaveSubjectAge { get; set; } = false; [Comment("是否有 入组性确认")] public bool IsEnrollementQualificationConfirm { get; set; } = false; [Comment("出组后计划外访视名称")] public string OutEnrollmentVisitName { get; set; } = "EOT"; [Comment("是否 验证拍片日期")] public bool IsVerifyVisitImageDate { get; set; } = true; [Comment("临床信息传输 1:系统录入 2:系统录入+PDF 0:无")] public int ClinicalInformationTransmissionEnum { get; set; } = 1; [Comment("是否审核 临床信息")] public bool IsCRAAuditClinicalInformation { get; set; } = false; [Comment("QC流程 0 不审,1 单审,2双审")] public TrialQCProcess QCProcessEnum { get; set; } = TrialQCProcess.DoubleAudit; [Comment("影像一致性核查")] public bool IsImageConsistencyVerification { get; set; } = true; [Comment("影像导出")] public bool IsImageExport { get; set; } = false; public bool IsSubjectSecondCodeView { get; set; } [Comment("阅片方式")] public int ReadingMode { get; set; } = 1; public int ChangeDefalutDays { get; set; } = 7; [Comment("跨项目复制")] public bool IsImageReplicationAcrossTrial { get; set; } = false; [MaxLength] public string BodyPartTypes { get; set; } = "鼻咽部|脑部|颈部|胸部|上/下腹部|盆腔|全身|其他"; public string Modalitys { get; set; } = "CT|MRI"; [NotMapped] public List ModalityList => Modalitys.Split('|', StringSplitOptions.RemoveEmptyEntries).Where(t => !string.IsNullOrEmpty(t)).ToList(); public string PreliminaryAuditReuploadText { get; set; } = string.Empty; public string ReviewAuditReuploadText { get; set; } = string.Empty; [Comment("PD 进展是否显示 配置访视 是否显示 PD进展 (从而可以设置状态)")] public bool IsPDProgressView { get; set; } [Comment("研究方案号")] public string ResearchProgramNo { get; set; } = string.Empty; [Comment("实验名称")] public string ExperimentName { get; set; } = string.Empty; [Comment("主研单位")] public string MainResearchUnit { get; set; } = string.Empty; [Comment("负责人PI")] public string HeadPI { get; set; } = string.Empty; public bool IsUrgent { get; set; } [Comment("项目类型 1 正式项目、0 非正式项目 2是培训项目")] public TrialType TrialType { get; set; } public int PlanSiteCount { get; set; } public int PlanVisitCount { get; set; } public DateTime? TrialFinishedTime { get; set; } public bool IsSubjectSexView { get; set; } = false; [Comment("配置Suject Edit页面 是否显示 加急")] public bool IsSubjectExpeditedView { get; set; } = false; public bool IsTrialStart { get; set; } = false; [Comment("QC 问题流程")] public UserRole QCQuestionConfirmedUser { get; set; } public Guid? QCQuestionConfirmedUserId { get; set; } public DateTime? QCQuestionConfirmedTime { get; set; } [Comment("项目完成时间")] public DateTime? TrialFinishTime { get; set; } public int? DigitPlaces { get; set; } = 1; public bool IsTrialProcessConfirmed { get; set; } public bool IsTrialBasicLogicConfirmed { get; set; } public bool IsTrialUrgentConfirmed { get; set; } public bool IsQCQuestionConfirmed { get; set; } [Comment("同步临床数据时间")] public DateTime? SyncClinicalDataTime { get; set; } public string BlindBaseLineName { get; set; } = "Baseline"; public string BlindFollowUpPrefix { get; set; } = "Follow-up"; public int IndicationEnum { get; set; } = -1; public string VitrualSiteCode { get; set; } = string.Empty; #region 检查相关新加字段 /// /// 是否显示检查名称 /// public bool IsShowStudyName { get; set; } = false; /// /// 检查名称列表 /// public List StudyNameList { get; set; } = new List(); /// /// 图像格式 /// [StringLength(2000)] public List ImageFormatList { get; set; } = new List() {"jpg","jpeg","png","bmp","pdf","zip" }; #endregion #region 邮件配置 [Comment("发件箱账号")] public string EmailFromEmail { get; set; } = string.Empty; [Comment("发件人")] public string EmailFromName { get; set; } = string.Empty; [Comment("密码/授权码")] public string EmailAuthorizationCode { get; set; } = string.Empty; [Comment("SMTP服务器")] public string EmailSMTPServerAddress { get; set; } = string.Empty; [Comment("SMTP端口")] public int EmailSMTPServerPort { get; set; } [Comment("是否配置过邮箱")] public bool IsConfigureEmail { get; set; } = false; #endregion public bool IsPACSConnect { get; set; } public bool IsTrialPACSConfirmed { get; set; } [Comment("项目术语配置Json字符串")] [StringLength(2000)] public List TrialObjectNameList { get; set; } [Comment("SPM 参与中心调研")] public bool IsSPMJoinSiteSurvey { get; set; } [Comment("SPM 参与阅片人筛选")] public bool IsSPMJoinReviewerSelect { get; set; } [Comment("SPM 参与重阅审批")] public bool IsSPMJoinReReadingApproval { get; set; } [Comment("阅片任务产生之前 采集影像")] public CollectImagesType CollectImagesEnum { get; set; } } public enum CollectImagesType { None = 0, Dicom = 1, NoneDicom = 2 } /// /// 检查名称 /// [ComplexType] public class StudyName { /// /// 是否选中 /// public bool IsChoose { get; set; } /// /// 名称 /// public string Name { get; set; } /// /// 英文名称 /// public string EnName { get; set; } } [ComplexType] public class TrialObjectNameConfig { public string Name { get; set; } public string TrialName { get; set; } public bool IsDefault { get; set; } }