

using System;
using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IRaCIS.Core.Domain.Models
{
	///<summary>
	///读片模块
	///</summary>
	[Table("ReadModule")]
	public class ReadModule : Entity, IAuditAdd
	{

		/// <summary>
		/// 受试者ID
		/// </summary>
		public Guid SubjectId { 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>
		///// 上一次访视(截止访视)
		///// </summary>
		//public Guid? LastVisitIdSetId { get; set; }

	    // /// <summary>
		///// 裁判对应原阅片模块的Id
		///// </summary> 
		//public Guid? ReadModuleId { get; set; }

		/// <summary>
		/// 项目ID
		/// </summary>
		public Guid TrialId { 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; }


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


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

		public ReadingStatusEnum ReadingStatus { get; set; }
	}



}
