using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;

namespace IRaCIS.Core.Infra.EFCore.Common
{
    public static class InspectionCacheKeys
    {
        public static string FrontAuditConfig(string identification) => $"FrontAuditConfig:{identification}";

        public static string ReadingQuestionCriterionTrial(Guid? trialReadingCriterionId) => $"ReadingQuestionCriterionTrial:{trialReadingCriterionId}";

        public static string SubjectVisit(Guid? subjectVisitId) => $"SubjectVisit:{subjectVisitId}";

        public static string SubjecSiteInfo(Guid? subjectId) => $"Subject:{subjectId}";

        public static string VisitTask(Guid? visitTaskId) => $"VisitTask:{visitTaskId}";
    }


    public class SetInspectionEnumDataDto
    {
        public Guid Id { get; set; }

        public string Identification { get; set; }

        public string JsonStr { get; set; }

        public Guid? ObjectRelationParentId { get; set; }

        public Guid? ObjectRelationParentId2 { get; set; }

        public Guid? ObjectRelationParentId3 { get; set; }
        /// <summary>
        /// 批次Id
        /// </summary>
        public Guid BatchId { get; set; }

        public DateTime CreateTime { get; set; }
    }



    /// <summary>
    /// 稽查数据
    /// </summary>
    public class InspectionJsonDetail
    {
        public string EntityName { get; set; }
        public object Data { get; set; }

        public object CommonData { get; set; }
    }


    public class UnitData
    {
        /// <summary>
        /// 单位
        /// </summary>
        public ValueUnit? Unit { get; set; }

        public string UnitName { get; set; }
    }


    public class VisitTaskAuditingDto
    {
        public string UserRealName { get; set; }

        public string SubjectCode { get; set; }

        public string R1 { get; set; }

        public string R2 { get; set; }

        public string CutOffVisitName { get; set; }

        public string SelectResult { get; set; }

        public bool? IsReadingReset { get; set; }
    }

    public class OtherInspection
    {
       
    }
    public class InspectionConvertDTO : DataInspection
    {
        /// <summary>
        /// 项目名称
        /// </summary>
        public string TrialName { get; set; }

        /// <summary>
        /// 中心Code
        /// </summary>
        public string SiteCode { get; set; }

        /// <summary>
        /// 项目编码
        /// </summary>
        public string ResearchProgramNo { get; set; }

        /// <summary>
        /// 中心名称
        /// </summary>
        public string SiteName { get; set; }

        /// <summary>
        /// 受试者名称
        /// </summary>
        public string SubjectCode { get; set; }

        /// <summary>
        /// 访视名称
        /// </summary>
        public string SubjectVisitName { get; set; }

        /// <summary>
        /// 盲态访视名
        /// </summary>
        public string BlindName { get; set; } = string.Empty;


        /// <summary>
        /// 标识操作  是否区分接口
        /// </summary>
        public bool IsDistinctionInterface = true;

        /// <summary>
        /// 自定义标识 为是 不拼接Type  可以通过  AuditIdentification 加 
        /// </summary>
        public bool IsSelfDefine = false;

        /// <summary>
        /// 额外标识
        /// </summary>
        public string ExtraIndentification = string.Empty;

        /// <summary>
        /// 自定义后缀
        /// </summary>
        public string AuditIdentification { get; set; } = string.Empty;

        /// <summary>
        /// 自定义前缀
        /// </summary>
        public string CustomPrefix { get; set; } = string.Empty;

        /// <summary>
        /// 自定义标识 如果当前字段部有值 则Indentification  就是当前字段
        /// </summary>
        public string SelfDefineIdentification { get; set; }=string.Empty;


    }

    /// <summary>
    /// 稽查外层数据
    /// </summary>
    public class InspectionGeneralData
    {
        /// <summary>
		/// 项目iD
		/// </summary>
        public Guid? TrialId { get; set; }

        public Guid? TrialSiteId { get; set; }

        /// <summary>
        /// 受试者
        /// </summary>
        public Guid? SubjectId { get; set; }

        /// <summary>
        /// 访视
        /// </summary>
        public Guid? SubjectVisitId { get; set; }

        public Guid? TrialReadingCriterionId { get; set; }


        /// <summary>
        /// 项目名称
        /// </summary>
        public string TrialName { get; set; }

        /// <summary>
        /// 中心Code
        /// </summary>
        public string SiteCode { get; set; }

        /// <summary>
        /// 项目编码
        /// </summary>
        public string ResearchProgramNo { get; set; }


        /// <summary>
        /// 受试者名称
        /// </summary>
        public string SubjectCode { get; set; }

        /// <summary>
        /// 访视名称
        /// </summary>
        public string SubjectVisitName { get; set; }

    }

    public class SetInspectionEnum
    {
        public string Identification { get; set; }

        public string Json { get; set; }
    }


    public class TableList
    {
        public string Name { get; set; }

        public string Remake { get; set; }
    }
}
