using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Collections.Generic;

namespace PTMedicalInsurance.Entity.BaseLine.ElectronicSettlementCertificate
{
    class ReUploadEcSettlCertIn:EntityBase
    {
        /// <summary>
        /// 定点医疗机构编号
        /// </summary>
        [Column(Name = "FixmedinsCode", Storage = null, DbType = "VarChar(30)")]
        [StringLength(30)]
        [DisplayName("定点医疗机构编号")]
        public string FixmedinsCode { get; set; }

        /// <summary>
        /// 定点医疗机构名称
        /// </summary>
        [Column(Name = "FixmedinsName", Storage = null, DbType = "VarChar(255)")]
        [StringLength(255)]
        [DisplayName("定点医疗机构名称")]
        public string FixmedinsName { get; set; }

        /// <summary>
        /// 业务区间
        /// 备注：电子结算凭证开具时间区间如20220520-20220525
        /// </summary>
        [Column(Name = "BizStsb", Storage = null, DbType = "VarChar(30)")]
        [StringLength(30)]
        [DisplayName("业务区间")]
        public string BizStsb { get; set; }

        /// <summary>
        /// 上传批次号
        /// 备注：上传日期年月日加5位顺序号如2022052500001
        /// </summary>
        [Column(Name = "UpldBchno", Storage = null, DbType = "VarChar(50)")]
        [StringLength(50)]
        [DisplayName("上传批次号")]
        public string UpldBchno { get; set; }

        /// <summary>
        /// 结算凭证关联关系列表
        /// 备注：数量与版式文件压缩包内版式文件数量相同
        /// </summary>
        [DisplayName("结算凭证关联关系列表")]
        public List<ReUploadDetlDTO> ReUploadDetlDTOList { get; set; }

        /// <summary>
        /// 上传模式
        /// 备注：1结构化数据xml文件从版式文件解析、2结构化数据xml文件分离上传（不传默认为1）
        /// </summary>
        [Column(Name = "UpldMode", Storage = null, DbType = "VarChar(3)")]
        [StringLength(3)]
        [DisplayName("上传模式")]
        public string UpldMode { get; set; }

        /// <summary>
        /// 文件压缩包
        /// 备注：zip压缩包，包含电子结算凭证版式文件和结构化数据文件
        /// </summary>
        [Column(Name = "FtfileCompac", Storage = null, DbType = "VarChar(MAX)")]
        [StringLength(int.MaxValue)]
        [DisplayName("文件压缩包")]
        public string FtfileCompac { get; set; }

        /// <summary>
        /// 电子结算凭证数量
        /// </summary>
        [Column(Name = "ElecSetlCertCnt", Storage = null, DbType = "Int")]
        [Range(0, int.MaxValue)]
        [DisplayName("电子结算凭证数量")]
        public int ElecSetlCertCnt { get; set; }

        /// <summary>
        /// 文件名称
        /// </summary>
        [Column(Name = "Filename", Storage = null, DbType = "VarChar(200)")]
        [StringLength(200)]
        [DisplayName("文件名称")]
        public string Filename { get; set; }
    }

    class ReUploadDetlDTO
    {
        /// <summary>
        /// 电子结算凭证代码
        /// 备注：电子结算凭证类型为1财政电子票据、2税务电子发票必填；
        /// 电子结算凭证类型为3税务数电票非必填。
        /// </summary>
        [Column(Name = "ElecSetlCertCode", Storage = null, DbType = "VarChar(50)")]
        [StringLength(50)]
        [DisplayName("电子结算凭证代码")]
        public string ElecSetlCertCode { get; set; }

        /// <summary>
        /// 电子结算凭证号码
        /// </summary>
        [Column(Name = "ElecSetlCertNo", Storage = null, DbType = "VarChar(50)")]
        [StringLength(50)]
        [DisplayName("电子结算凭证号码")]
        public string ElecSetlCertNo { get; set; }

        /// <summary>
        /// 电子结算凭证校验码
        /// 备注：电子结算凭证类型为1财政电子票据、2税务电子发票必填；
        /// 电子结算凭证类型为3税务数电票非必填。
        /// </summary>
        [Column(Name = "ElecSetlCertChkcode", Storage = null, DbType = "VarChar(20)")]
        [StringLength(20)]
        [DisplayName("电子结算凭证校验码")]
        public string ElecSetlCertChkcode { get; set; }

        /// <summary>
        /// 电子结算凭证类型
        /// 备注：1财政电子票据、2税务电子发票、3税务数电票
        /// </summary>
        [Column(Name = "ElecSetlCertType", Storage = null, DbType = "VarChar(20)")]
        [StringLength(20)]
        [DisplayName("电子结算凭证类型")]
        public string ElecSetlCertType { get; set; }

        /// <summary>
        /// 凭证结算类型
        /// 备注：1实时结算、2全自费
        /// </summary>
        [Column(Name = "CertSetlType", Storage = null, DbType = "VarChar(3)")]
        [StringLength(3)]
        [DisplayName("凭证结算类型")]
        public string CertSetlType { get; set; }

        /// <summary>
        /// 就诊类型
        /// 备注：1门诊、2住院
        /// </summary>
        [Column(Name = "MdtrtType", Storage = null, DbType = "VarChar(3)")]
        [StringLength(3)]
        [DisplayName("就诊类型")]
        public string MdtrtType { get; set; }

        /// <summary>
        /// 开票日期
        /// </summary>
        [Column(Name = "BillDate", Storage = null, DbType = "Date")]
        [DisplayName("开票日期")]
        public DateTime BillDate { get; set; }

        /// <summary>
        /// 医疗费总额
        /// </summary>
        [Column(Name = "MedfeeSumamt", Storage = null, DbType = "Decimal(16,2)")]
        [DisplayName("医疗费总额")]
        public decimal MedfeeSumamt { get; set; }

        /// <summary>
        /// 参保地医保区划
        /// 备注：实时结算必填
        /// </summary>
        [Column(Name = "InsuplcAdmdvs", Storage = null, DbType = "VarChar(6)")]
        [StringLength(6)]
        [DisplayName("参保地医保区划")]
        public string InsuplcAdmdvs { get; set; }

        /// <summary>
        /// 业务流水号
        /// 备注：实时结算填药机构结算ID medinsSetlId，全自费填医疗机构就诊ID fixmedinsMdtrtId
        /// </summary>
        [Column(Name = "BizSn", Storage = null, DbType = "VarChar(50)")]
        [StringLength(50)]
        [DisplayName("业务流水号")]
        public string BizSn { get; set; }

        /// <summary>
        /// 结算ID
        /// 备注：实时结算时必填
        /// </summary>
        [Column(Name = "SetlId", Storage = null, DbType = "VarChar(30)")]
        [StringLength(30)]
        [DisplayName("结算ID")]
        public string SetlId { get; set; }

        /// <summary>
        /// 结算时间
        /// 备注：实时结算时必填
        /// </summary>
        [Column(Name = "SetlTime", Storage = null, DbType = "DateTime")]
        [DisplayName("结算时间")]
        public DateTime? SetlTime { get; set; }

        /// <summary>
        /// 人员编号
        /// 备注：实时结算时必填
        /// </summary>
        [Column(Name = "PsnNo", Storage = null, DbType = "VarChar(30)")]
        [StringLength(30)]
        [DisplayName("人员编号")]
        public string PsnNo { get; set; }

        /// <summary>
        /// 人员姓名
        /// </summary>
        [Column(Name = "PsnName", Storage = null, DbType = "VarChar(50)")]
        [StringLength(50)]
        [DisplayName("人员姓名")]
        public string PsnName { get; set; }

        /// <summary>
        /// 证件号码
        /// 备注：身份证号码
        /// </summary>
        [Column(Name = "Certno", Storage = null, DbType = "VarChar(50)")]
        [StringLength(50)]
        [DisplayName("证件号码")]
        public string Certno { get; set; }

        /// <summary>
        /// 险种类型
        /// 备注：实时结算时必填
        /// </summary>
        [Column(Name = "Insutype", Storage = null, DbType = "VarChar(6)")]
        [StringLength(6)]
        [DisplayName("险种类型")]
        public string Insutype { get; set; }

        /// <summary>
        /// 符合范围金额
        /// 备注：实时结算时必填
        /// </summary>
        [Column(Name = "InscpAmt", Storage = null, DbType = "Decimal(16,2)")]
        [DisplayName("符合范围金额")]
        public decimal? InscpAmt { get; set; }

        /// <summary>
        /// 统筹基金支出
        /// 备注：实时结算时必填
        /// </summary>
        [Column(Name = "HifpPay", Storage = null, DbType = "Decimal(16,2)")]
        [DisplayName("统筹基金支出")]
        public decimal? HifpPay { get; set; }

        /// <summary>
        /// 主要诊断代码
        /// </summary>
        [Column(Name = "MaindiagCode", Storage = null, DbType = "VarChar(30)")]
        [StringLength(30)]
        [DisplayName("主要诊断代码")]
        public string MaindiagCode { get; set; }

        /// <summary>
        /// 主要诊断名称
        /// </summary>
        [Column(Name = "MaindiagName", Storage = null, DbType = "VarChar(255)")]
        [StringLength(255)]
        [DisplayName("主要诊断名称")]
        public string MaindiagName { get; set; }

        /// <summary>
        /// 次要诊断代码
        /// </summary>
        [Column(Name = "ScddiagCode", Storage = null, DbType = "VarChar(30)")]
        [StringLength(30)]
        [DisplayName("次要诊断代码")]
        public string ScddiagCode { get; set; }

        /// <summary>
        /// 次要诊断名称
        /// </summary>
        [Column(Name = "ScddiagName", Storage = null, DbType = "VarChar(255)")]
        [StringLength(255)]
        [DisplayName("次要诊断名称")]
        public string ScddiagName { get; set; }

        /// <summary>
        /// 就医地医保区划
        /// </summary>
        [Column(Name = "MdtrtareaAdmdvs", Storage = null, DbType = "VarChar(6)")]
        [StringLength(6)]
        [DisplayName("就医地医保区划")]
        public string MdtrtareaAdmdvs { get; set; }

        /// <summary>
        /// 原电子结算凭证代码
        /// 备注：电子结算凭证类型为1财政电子票据、2税务电子发票必填；电子结算凭证类型为3税务数电票非必填。
        /// </summary>
        [Column(Name = "InitElecSetlCertCode", Storage = null, DbType = "VarChar(50)")]
        [StringLength(50)]
        [DisplayName("原电子结算凭证代码")]
        public string InitElecSetlCertCode { get; set; }

        /// <summary>
        /// 原电子结算凭证号码
        /// </summary>
        [Column(Name = "InitElecSetlCertNo", Storage = null, DbType = "VarChar(50)")]
        [StringLength(50)]
        [DisplayName("原电子结算凭证号码")]
        public string InitElecSetlCertNo { get; set; }

        /// <summary>
        /// 原上传方式
        /// </summary>
        [Column(Name = "InitUpldWay", Storage = null, DbType = "VarChar(3)")]
        [StringLength(3)]
        [DisplayName("原上传方式")]
        public string InitUpldWay { get; set; }

        /// <summary>
        /// 原因
        /// </summary>
        [Column(Name = "Rea", Storage = null, DbType = "VarChar(200)")]
        [StringLength(200)]
        [DisplayName("原因")]
        public string Rea { get; set; }

        /// <summary>
        /// 凭证代码号码错误标志
        /// 备注：0否（原凭证代码号码与重传凭证代码号码一致）、1是（原凭证代码号码与重传凭证代码号码不一致）
        /// </summary>
        [Column(Name = "CertCodeNoErrFlag", Storage = null, DbType = "VarChar(3)")]
        [StringLength(3)]
        [DisplayName("凭证代码号码错误标志")]
        public string CertCodeNoErrFlag { get; set; }

        /// <summary>
        /// 扩展字段
        /// 备注：extFld为json字符串,序列化成字符串后长度不能超过4000
        /// </summary>
        [Column(Name = "ExtFld", Storage = null, DbType = "VarChar(4000)")]
        [StringLength(4000)]
        [DisplayName("扩展字段")]
        public string ExtFld { get; set; }
    }

    class ReUploadEcSettlCertOut : EntityBase
    {
    }
}
