

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>
	///读片模块
	///</summary>
	[Table("ReadModule")]
	public class ReadModule : Entity, IAuditAdd, IAuditUpdate, ISoftDelete
	{

        [JsonIgnore]
		public ReadingQuestionCriterionTrial TrialReadingCriterion { get; set; }


		[JsonIgnore]
		public List<VisitTask> ModuleTaskList { get; set; }

		/// <summary>
		/// 受试者ID
		/// </summary>
		public Guid SubjectId { get; set; }

		public Guid TrialReadingCriterionId { get; set; }

		/// <summary>
		/// 模块类型
		/// </summary>
		public ModuleTypeEnum ModuleType { get; set; }

		/// <summary>
		/// 模块名称
		/// </summary>
		public string ModuleName { get; set; }

		/// <summary>
		/// 是否加急
		/// </summary>
		public bool? IsUrgent { get; set; }

		/// <summary>
		/// 访视ID
		/// </summary>
		public Guid SubjectVisitId { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		public DateTime CreateTime { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		public Guid CreateUserId { get; set; }

		/// <summary>
		/// 阅片计划ID
		/// </summary>
		public Guid? ReadingPeriodSetId { get; set; }



		/// <summary>
		/// 项目ID
		/// </summary>
		public Guid TrialId { get; set; }

		public Guid UpdateUserId { get; set; }
		
		public DateTime UpdateTime { get; set; }


		public bool IsCRCConfirm { get; set; } = false;

		public bool IsPMConfirm { get; set; } = false;

		public bool IsNotNeedPMConfirm { get; set; } = false;

        /// <summary>
        /// CRC是否正在申请撤回
        /// </summary>
        public bool IsCRCApplicationRevoke { get; set; } = false;
        public bool IsDeleted { get; set; }

		public DateTime? DeletedTime { get; set; }

		public Guid? DeleteUserId { get; set; }

		/// <summary>
		/// 临床数据是否完整
		/// </summary>
        public bool? IsClinicalDataComplete { get; set; }

		/// <summary>
		/// 临床数据是否盲化
		/// </summary>
        public bool? IsClinicalDataBlind { get; set; }

        ///// <summary>
        ///// 
        ///// </summary>
        //public decimal VisitNum { get; set; }

        //      [JsonIgnore]
        ///// <summary>
        ///// 对应
        ///// </summary>
        //[ForeignKey("ReadModuleId")]
        //public ReadModule ReadModuleModel { get; set; }

        [JsonIgnore]
		/// <summary>
		/// 受试者
		/// </summary>
		[ForeignKey("SubjectId")]

		public Subject Subject { get; set; }

		[JsonIgnore]
		/// <summary>
		/// 阅片期配置
		/// </summary>
		[ForeignKey("ReadingPeriodSetId")] 
		public ReadingPeriodSet ReadingPeriodSet { get; set; }

		[JsonIgnore]
		/// <summary>
		/// 访视
		/// </summary>
		[ForeignKey("SubjectVisitId")]
		public SubjectVisit SubjectVisit { get; set; }

        [JsonIgnore]
        [ForeignKey("TrialId")]
        public Trial Trial { get; set; }


        /// <summary>
        /// 阅片配置的类型
        /// </summary>
        public ReadingSetType ReadingSetType { get; set; }



		public ReadingStatusEnum ReadingStatus { get; set; } = ReadingStatusEnum.TaskAllocate;
	}



}
