
//--------------------------------------------------------------------
//     此代码由T4模板自动生成  byzhouhang 20210918
//	   生成时间 2022-07-01 15:32:56 
//     对此文件的更改可能会导致不正确的行为，并且如果重新生成代码，这些更改将会丢失。
using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
using EntityFrameworkCore.Projectables;
using System.Linq;

namespace IRaCIS.Core.Domain.Models
{
	///<summary>
	///TaskConsistentRule
	///</summary>
	[Table("TaskConsistentRule")]
	public class TaskConsistentRule : Entity, IAuditUpdate, IAuditAdd
	{


		public Trial Trial { get; set; }

		public Guid CreateUserId { get; set; }	

		public DateTime CreateTime { get; set; }
	
		public DateTime UpdateTime { get; set; }
	
		public Guid UpdateUserId { get; set; }
	
		public Guid TrialId { get; set; }
	
	
		public int PlanSubjectCount { get; set; }
	
		public int PlanVisitCount { get; set; }
	
		public int IntervalWeeks { get; set; }


		public bool IsHaveReadingPeriod { get; set; }
	
	
		public bool IsGenerateGlobalTask { get; set; }
		

		public int BlindSubjectNumberOfPlaces { get; set; } 

		public string BlindTrialSiteCode { get; set; } = string.Empty;


		public bool IsSelfAnalysis { get; set; }

		//public Guid? CompareDoctorUserId { get; set; }
		//public User AnalysisDoctorUser { get; set; }
		//public Guid AnalysisDoctorUserId { get; set; }
		//public List<VisitTask> DoctorVisitTaskList { get; set; }

		public bool IsEnable { get; set; }

		public string Note { get; set; }


		public Guid TrialReadingCriterionId { get; set; }

		[JsonIgnore]
		[ForeignKey("TrialReadingCriterionId")]
		public ReadingQuestionCriterionTrial TrialReadingCriterion { get; set; }


		//[Projectable]
		//public List<VisitTask> DoctorConsistentTaskList => DoctorVisitTaskList.Where(t => t.IsAnalysisCreate && t.TaskConsistentRuleId ==  Id).ToList();
	}

}	 
