using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace IRaCIS.Core.Domain.Models
{
    [Table("TU")]
    public class TU : Entity
    {
        //病灶类型 1-非淋巴结靶病灶，2-淋巴结靶病灶，3-非靶病灶，，4-疑似新病灶，5-明确新病灶
        public int LesionType { get; set; }
        public string STUDYID { get; set; }
        public string DOMAIN { get; set; } = "TU";
        public string USUBJID { get; set; }
        public int TUSEQ { get; set; }
        public string TUGRPID { get; set; } = string.Empty;
        public string TUREFID { get; set; } = string.Empty;//内部或外部的肿瘤/病灶标识。 例如：医学影像 ID 
        public string TUSPID { get; set; } = string.Empty;
        public string TULNKID { get; set; } = string.Empty;
        public string TUTESTCD { get; set; } = string.Empty;
        public string TUTEST { get; set; } = string.Empty;

        //肿瘤标识的结果。 肿瘤标识的结果是对标识肿瘤的分类。 
        //例如，当 TUTESTCD=TUMIDENT (肿瘤/病灶标识)时， 
        //TUORRES的值可能是 TARGET, NON-TARGET, NEW或者 BENIGN ABNORMALITY
        public string TUORRES { get; set; } = string.Empty;
        public string TUSTRESC { get; set; } = string.Empty;
        public string TUNAM { get; set; } = string.Empty;
        public string TULOC { get; set; } = string.Empty;
        public string TULAT { get; set; } = string.Empty;
        public string TUDIR { get; set; } = string.Empty;
        public string TUPORTOT { get; set; } = string.Empty;
        public string TUMETHOD { get; set; } = string.Empty;
        public string TUEVAL { get; set; } = string.Empty;
        public string TUEVALID { get; set; } = string.Empty;
        public string TUACPTFL { get; set; } = string.Empty;
        public decimal VISITNUM { get; set; } = 0;
        public string VISIT { get; set; } = string.Empty;
        public int VISITDY { get; set; }
        public string EPOCH { get; set; } = string.Empty;
        public string TUDTC { get; set; } = string.Empty;
        public int TUDY { get; set; } = 0;
        public string LocDescription { get; set; } = string.Empty;

        public string TpCode { get; set; } = string.Empty;
    }

    [Table("TR")]
    public class TR : Entity
    {
        public string STUDYID { get; set; } = string.Empty;
        public string DOMAIN { get; set; } = "TR";
        public string USUBJID { get; set; } = string.Empty;
        public int TRSEQ { get; set; }
        public string TRGRPID { get; set; } = string.Empty;
        public string TRREFID { get; set; } = string.Empty;
        public string TRSPID { get; set; } = string.Empty;
        public string TRLNKID { get; set; } = string.Empty;
        public string TRLNKGRP { get; set; } = string.Empty;
        public string TRTESTCD { get; set; } = string.Empty;
        public string TRTEST { get; set; } = string.Empty;
        public string TRORRES { get; set; } = string.Empty;
        public double TRORRES_Double
        {
            get {
                double temp = 0;
                double.TryParse(TRORRES, out temp);
                return temp;
            }
        }
        public string TRORRESU { get; set; } = string.Empty;
        public string TRSTRESC { get; set; } = string.Empty;
        public double TRSTRESN { get; set; } = 0;
        public string TRSTRESU { get; set; } = string.Empty;
        public string TRSTAT { get; set; } = string.Empty;
        public string TRREASND { get; set; } = string.Empty;
        public string TRNAM { get; set; } = string.Empty;
        public string TRMETHOD { get; set; } = string.Empty;
        public string TREVAL { get; set; } = string.Empty;
        public string TREVALID { get; set; } = string.Empty;
        public string TRACPTFL { get; set; } = string.Empty;
        public decimal VISITNUM { get; set; } = 0;
        public string VISIT { get; set; } = string.Empty;
        public int VISITDY { get; set; } = 0;
        public string EPOCH { get; set; } = string.Empty;
        public string TRDTC { get; set; } = string.Empty;
        public int TRDY { get; set; } = 0;
        public string Note { get; set; } // 备注
        public bool CoveredLesion { get; set; } = true;//本次扫描是否覆盖该病灶
        public string TpCode { get; set; } = string.Empty;
    }

    [Table("RS")]
    public class RS : Entity
    {
        public string STUDYID { get; set; } = string.Empty;
        public string DOMAIN { get; set; } = "RS";
        public string USUBJID { get; set; } = string.Empty;
        public int RSSEQ { get; set; }
        public string RSGRPID { get; set; } = string.Empty;
        public string RSREFID { get; set; } = string.Empty;
        public string RSSPID { get; set; } = string.Empty;
        public string RSLNKID { get; set; } = string.Empty;
        public string RSLNKGRP { get; set; } = string.Empty;
        public string RSTESTCD { get; set; } = string.Empty;
        public string RSTEST { get; set; } = string.Empty;
        public string RSCAT { get; set; } = string.Empty;
        public string RSORRES { get; set; } = string.Empty;
        public string RSSTRESC { get; set; } = string.Empty;
        public string RSSTAT { get; set; } = string.Empty;
        public string RSREASND { get; set; } = string.Empty;
        public string RSNAM { get; set; } = string.Empty;

        public string RSEVAL { get; set; } = string.Empty;
        public string RSEVALID { get; set; } = string.Empty;
        public string RSACPTFL { get; set; } = string.Empty;
        public decimal VISITNUM { get; set; } = 0;
        public string VISIT { get; set; } = string.Empty;
        public int VISITDY { get; set; } = 0;
        public string EPOCH { get; set; } = string.Empty;
        public string RSDTC { get; set; } = string.Empty;
        public int RSDY { get; set; } = 0;
        public string TpCode { get; set; } = string.Empty;
        public Guid StudyGuid { get; set; } = Guid.Empty;
        public Guid TrialGuid { get; set; } = Guid.Empty;
        public Guid SubjectGuid { get; set; } = Guid.Empty;
        public string Note { get; set; } = string.Empty;

    }
}
