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

namespace IRaCIS.Core.Domain.Models
{
	 ///<summary>
	 ///阅片医学审核对话
	 ///</summary>
	 [Table("ReadingMedicalReviewDialog")]	
	 public class ReadingMedicalReviewDialog : Entity, IAuditAdd
	 {
		/// <summary>
        /// 医学审核Id
        /// </summary>
		public Guid TaskMedicalReviewId { get; set; }
	
		/// <summary>
        /// 任务Id
        /// </summary>
		public Guid VisitTaskId { get; set; }
	
		/// <summary>
        /// 对话内容
        /// </summary>
		public string Content { get; set; } = string.Empty;

		/// <summary>
		/// 用户角色
		/// </summary>
		public string UserTypeShortName { get; set; }

		/// <summary>
		/// 医学审核对话关闭原因
		/// </summary>
		public MedicalDialogClose? MedicalDialogCloseEnum { get; set; }

		/// <summary>
		/// 用户角色枚举
		/// </summary>
		public int UserTypeEnumInt { get; set; }
	
		/// <summary>
        /// 创建人
        /// </summary>
		public Guid CreateUserId { get; set; }
	
		/// <summary>
        /// 创建时间
        /// </summary>
		public DateTime CreateTime { get; set; }

		/// <summary>
		/// 阅片人是否认同
		/// </summary>
		public MedicalReviewDoctorUserIdea DoctorUserIdeaEnum { get; set; } = MedicalReviewDoctorUserIdea.defalut;

		/// <summary>
		/// 是否有问题
		/// </summary>
		public bool IsHaveQuestion { get; set; } = false;

		/// <summary>
		/// 质询问题
		/// </summary>
		public string Questioning { get; set; } = string.Empty;

		/// <summary>
		/// 审核建议
		/// </summary>
		public AuditAdvice AuditAdviceEnum { get; set; } = AuditAdvice.None;

		/// <summary>
		/// 不同意重阅原因
		/// </summary>
		public string DisagreeReason { get; set; } = string.Empty;


		/// <summary>
		/// 是否申请重阅
		/// </summary>
		public bool? IsApplyHeavyReading { get; set; }

		[JsonIgnore]
		[ForeignKey("CreateUserId")]
		public User CreateUser { get; set; }


		/// <summary>
		/// 图片路径
		/// </summary>
		public string ImagePath { get; set; } = string.Empty;

		/// <summary>
		/// 文件名称
		/// </summary>
		public string FileName { get; set; } = string.Empty;

		[JsonIgnore]
		[ForeignKey("TaskMedicalReviewId")]
		public TaskMedicalReview TaskMedicalReview { get; set; }


		/// <summary>
		/// 文件
		/// </summary>
		[NotMapped]
		public List<ImageInfo> FileList
		{
			get
			{


				try
				{
					var result = JsonConvert.DeserializeObject<List<ImageInfo>>(this.ImagePath);
					return result == null ? new List<ImageInfo>() : result;
				}
				catch (Exception)
				{

					return new List<ImageInfo>();
				}

			}
		}


	}

	  
}	 
