using IRaCIS.Core.Domain.Share;
using System.Linq;

namespace IRaCIS.Core.Domain.Models;

[Comment("系统 - 临床数据配置")]
[Table("ClinicalDataSystemSet")]
public class ClinicalDataSystemSet : BaseAddAuditEntity
{
    #region 导航属性

    [NotMapped]
    public List<int> CriterionEnumList => CriterionEnumListStr.Split('|', StringSplitOptions.RemoveEmptyEntries).Where(t => !string.IsNullOrEmpty(t) && int.TryParse(t.Trim(), out var s)).Select(t => int.Parse(t.Trim())).ToList();

    #endregion

    public ClinicalLevel ClinicalDataLevel { get; set; }

   
    public string ClinicalDataSetEnName { get; set; } = null!;
    [Comment("枚举(字典里面取的)")]
    public int ClinicalDataSetEnum { get; set; }

    public string ClinicalDataSetName { get; set; } = null!;
    [Comment("上传方式")]
    public ClinicalUploadType ClinicalUploadType { get; set; }

    [StringLength(1000)]
    public string CriterionEnumListStr { get; set; } = null!;

   
    public string FileName { get; set; } = null!;

    [Comment("是否应用")]
    public bool IsApply { get; set; }

    public bool IsEnable { get; set; }

    [StringLength(1000)]
    public string Path { get; set; } = null!;

    public UploadRole UploadRole { get; set; }
}
