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

namespace IRaCIS.Core.Domain.Models
{
	 ///<summary>
	 /// 系统临床表格问题
	 ///</summary>
	 [Table("SystemClinicalTableQuestion")]	
	 public class SystemClinicalTableQuestion : Entity, IAuditAdd
	 {
		/// <summary>
        /// 系统临床数据Id
        /// </summary>
		public Guid SystemClinicalId { get; set; }

		/// <summary>
		/// 问题名称
		/// </summary>
		public string QuestionName { get; set; } = string.Empty;
	
		/// <summary>
        /// 问题英文名称
        /// </summary>
		public string QuestionEnName { get; set; } = string.Empty;

        /// <summary>
        /// 临床问题类型(分组，单选。)
        /// </summary>
        public string ClinicalTableQuestionType { get; set; }
	
		/// <summary>
        /// 问题标识
        /// </summary>
		public ClinicalTableQuestionMark? ClinicalTableQuestionMarkEnum { get; set; }
	
		/// <summary>
        /// 最大长度
        /// </summary>
		public int? MaxAnswerLength { get; set; }
	
		/// <summary>
        /// 临床数据选项类型(无，自定义)
        /// </summary>
		public ClinicalOptionType ClinicalOptionTypeEnum { get; set; }
	
		/// <summary>
        /// 自定义选项
        /// </summary>
		public string TypeValue { get; set; }

		/// <summary>
		/// 字典Code
		/// </summary>
		public string DictionaryCode { get; set; } = string.Empty;
	
		/// <summary>
        /// 排序
        /// </summary>
		public int ShowOrder { get; set; }

		/// <summary>
		/// 是否必填
		/// </summary>
		public IsRequired IsRequired { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		public DateTime CreateTime { get; set; }
	
		/// <summary>
        /// 创建人
        /// </summary>
		public Guid CreateUserId { get; set; }
	
		/// <summary>
        /// 外层问题Id
        /// </summary>
		public Guid QuestionId { get; set; }

        /// <summary>
        /// 小数点位数
        /// </summary>
        public int? DigitPlaces { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; } = string.Empty;

        /// <summary>
        /// 关联ID
        /// </summary>
        public Guid? RelevanceId { get; set; }

        /// <summary>
        /// 关联Value
        /// </summary>
        public string RelevanceValue { get; set; } = string.Empty;

        [NotMapped]
        public List<string> RelevanceValueList
        {
            get
            {
                try
                {
                    return this.RelevanceValue.Split(',').ToList();
                }
                catch (Exception)
                {

                    return new List<string>();
                }
            }

        }

    }


}	 
