
//--------------------------------------------------------------------
//     此代码由T4模板自动生成  byzhouhang 20210918
//	   生成时间 2022-06-10 11:59:27 
//     对此文件的更改可能会导致不正确的行为，并且如果重新生成代码，这些更改将会丢失。
using System;
using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;

namespace IRaCIS.Core.Domain.Models
{
	 ///<summary>
	 ///SubjectUser
	 ///</summary>
	 [Table("SubjectUser")]	
	 public class SubjectUser : Entity, IAuditUpdate, IAuditAdd
	 {
		[JsonIgnore]
		public Trial Trial { get; set; }
		public Guid TrialId { get; set; }


		public Guid TrialReadingCriterionId { get; set; }
		

		/// <summary>
		/// CreateUserId
		/// </summary>
		[Required]
		public Guid CreateUserId { get; set; }
	
		/// <summary>
        /// CreateTime
        /// </summary>
		[Required]
		public DateTime CreateTime { get; set; }
	
		/// <summary>
        /// UpdateTime
        /// </summary>
		[Required]
		public DateTime UpdateTime { get; set; }
	
		/// <summary>
        /// UpdateUserId
        /// </summary>
		[Required]
		public Guid UpdateUserId { get; set; }


		public DateTime? AssignTime { get; set; }

		/// <summary>
		/// SubjectId
		/// </summary>
		[Required]
		public Guid SubjectId { get; set; }

		public Subject Subject { get; set; }


		public Guid DoctorUserId { get; set; }

		[JsonIgnore]
		public User DoctorUser { get; set; }

		public Arm ArmEnum { get; set; }

		public bool IsConfirmed { get; set; } = true;

		//该属性有值 说明该医生被替换了 分配的时候 要过滤掉
		public Guid? OrignalSubjectUserId { get; set; }

		[JsonIgnore]
		//Parent
		[ForeignKey("OrignalSubjectUserId")]
		public SubjectUser OrignalSubjectUser { get; set; }

        //ChildList
        [JsonIgnore]
		public List<SubjectUser> EarlierSubjectUserList { get; set; }

        //public List<VisitTask> SubjectArmVisitTaskList { get; set; }


    }

}	 
