using IRaCIS.Core.Domain.Share;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IRaCIS.Core.Application.Service.Reading.Dto
{
    #region 阅片问题


    public class ReadingReportDto
    {
        public Guid Id
        {
            get
            {
                return Guid.NewGuid();
            }
        }

        /// <summary>
        /// 限制编辑
        /// </summary>
        public LimitEdit LimitEdit { get; set; } = LimitEdit.None;

        /// <summary>
		/// 最大答案长度
		/// </summary>
		public int? MaxAnswerLength { get; set; }

        /// <summary>
		/// 文件类型
		/// </summary>
		public string FileType { get; set; } = string.Empty;
        public Guid QuestionId { get; set; }

        public Guid TableQuestionId { get; set; }

        public Guid? GroupId { get; set; }

        public int ShowOrder { get; set; }


        /// <summary>
        /// 是否显示在Dicom阅片中
        /// </summary>
        public bool IsShowInDicom { get; set; } = false;

        public decimal RowIndex { get; set; }

        /// <summary>
		/// 问题类型
		/// </summary>
		public TableQuestionType? QuestionGenre { get; set; }

        /// <summary>
        /// 问题类型
        /// </summary>
        public TableQuestionType? TableQuestionType { get; set; }

        /// <summary>
        /// 字典code
        /// </summary>
        public string DictionaryCode { get; set; }

        /// <summary>
		/// 问题类型
		/// </summary>
		public QuestionType? QuestionType { get; set; }

        /// <summary>
        /// 数据来源
        /// </summary>
        public DataSources DataSource { get; set; } = DataSources.ManualEntry;


        /// <summary>
		/// 病灶类型
		/// </summary>
		public LesionType? LesionType { get; set; }

        public string GroupName { get; set; }

        public string QuestionName { get; set; }

        public string QuestionEnName { get; set; }

        public bool IsCanEditPosition { get; set; } = false;

        public string BlindName { get; set; }

        public Guid? RowId { get; set; }

        public string SplitOrMergeLesionName { get; set; }

        public SplitOrMergeType? SplitOrMergeType { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 问题标识
        /// </summary>
        public QuestionMark? QuestionMark { get; set; }



        /// <summary>
        /// 类型值
        /// </summary>
        public string? TypeValue { get; set; }

        /// <summary>
        /// 序号标记
        /// </summary>
        public string? OrderMark { get; set; }

        /// <summary>
        /// 数值类型
        /// </summary>
        public ValueOfType? ValueType { get; set; }

        /// <summary>
		/// 自定义单位
		/// </summary>
		public string? CustomUnit { get; set; }

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

        public decimal FristAddTaskNum { get; set; }

        public ReportLayType ReportLayType { get; set; } = ReportLayType.Group;

        public string? ReportMark { get; set; }

        /// <summary>
        /// 显示图表类型
        /// </summary>
        public ShowChartType ShowChartTypeEnum { get; set; } = ShowChartType.NotShow;

        /// <summary>
        /// 选项类型
        /// </summary>
        public OptionType OptionTypeEnum { get; set; } = OptionType.Defalut;

        /// <summary>
        /// 高亮问题的答案
        /// </summary>
        public string HighlightAnswer { get; set; } = "[]";

        public List<string> HighlightAnswerList { get; set; } = new List<string>();


        /// <summary>
        /// 问题英文分组
        /// </summary>
        public string GroupEnName { get; set; } = string.Empty;

        public List<TaskQuestionAnswer> Answer { get; set; } = new List<TaskQuestionAnswer>();

        public List<ReadingReportDto> Childrens { get; set; } = new List<ReadingReportDto>();
    }


    public class TaskQuestionAnswer
    {
        public string TaskName { get; set; }

        public Guid VisitTaskId { get; set; }

        public string Answer { get; set; }

        public bool IsHighlight { get; set; } = false;

        public bool IsGlobalChange { get; set; } = false;

        /// <summary>
		/// 全局阅片修改的答案
		/// </summary>
		public string GlobalChangeAnswer { get; set; } = string.Empty;

        public List<CrterionDictionaryGroup> CrterionDictionaryGroup { get; set; }


    }


    public class GetReadingReportEvaluationOutDto
    {
        public Guid? VisitTaskId { get; set; }

        public object ReportCalculateResult { get; set; }

        public GetReportVerifyOutDto CalculateResult { get; set; }
        public ReadingTaskState ReadingTaskState { get; set; }

        public List<VisitTaskInfo> VisitTaskList { get; set; } =new  List<VisitTaskInfo> { };

        public List<ReadingReportDto> TaskQuestions { get; set; } =new List<ReadingReportDto> { };

        public List<LesionDto> LesionCountList { get; set; } = new List<LesionDto>();

    }

    public class Globalanswer
    {
        public Guid TaskId { get; set; }

        public string Answer { get; set; }

        public decimal VisitTaskNum { get; set; }

        public Guid? QuestionId { get; set; }
    }

    public class LesionDto
    {
        public LesionType? LesionType { get; set; }

        public int Count { get; set; }
    }


    public class VisitTaskGroupAnswerDto
    {
        public Guid VisitTaskId { get; set; }

        public List<VisitTaskGroupInfo> Questions { get; set; }

    }

    public class VisitTaskGroupInfo
    {
        public Guid QuestionId { get; set; }

        public string QuestionName { get; set; }

        public string GroupName { get; set; }

        public int ShowOrder { get; set; }



        public List<VisitTaskQuestionInfo> QuestionList = new List<VisitTaskQuestionInfo>();
    }


    public class VisitTaskQuestionInfo
    {
        public Guid QuestionId { get; set; }


        public string QuestionName { get; set; }

        public string GroupName { get; set; }

        public int ShowOrder { get; set; }

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

        public List<VistTaskTableQuestionRowInfo> TableRowQuestionList = new List<VistTaskTableQuestionRowInfo>();
    }


    public class VistTaskTableQuestionRowInfo
    {
        public decimal RowIndex { get; set; }

        /// <summary>
        /// 序号标记
        /// </summary>
        public string OrderMark { get; set; } = string.Empty;


        public List<VistTaskTableQuestionInfo> TableQuestionList = new List<VistTaskTableQuestionInfo>();
    }


    public class VistTaskTableQuestionInfo
    {
        public Guid QuestionId { get; set; }

        public Guid TableQuestionId { get; set; }

        public string QuestionName { get; set; }



        public int ShowOrder { get; set; }

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



    public class VisitTaskInfo
    {
        public Guid VisitTaskId { get; set; }

        public string BlindName { get; set; }

        public bool IsHaveAdditionalQuestion { get; set; }

        public bool IsBaseLine { get; set; }

        public DateTime? LatestScanDate { get; set; }

        public TaskState TaskState { get; set; }
        public string TaskName { get; set; }

        public decimal VisitTaskNum { get; set; }

        public bool IsCurrentTask { get; set; }

        public Guid? BeforeConvertedTaskId { get; set; }

        public bool IsConvertedTask { get; set; }

        public List<CrterionDictionaryGroup> CrterionDictionaryGroup { get; set; }
    }


    public class GetCanMergeLesionOutDto
    {
        public Guid RowId { get; set; }

        public string? OrderMarkName { get; set; }

        public Guid? OrganInfoId { get; set; }

        public decimal RowIndex { get; set; }

        public string Part { get; set; }
    }


    public class GetCanMergeLesionInDto
    {
        public Guid RowId { get; set; }
    }

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

        /// <summary>
        /// 问题标识
        /// </summary>
        public QuestionMark? QuestionMark { get; set; }

        /// <summary>
        /// 问题Id
        /// </summary>

        public Guid QuestionId { get; set; }

        /// <summary>
        /// 表格问题Id
        /// </summary>
        public Guid TableQuestionId { get; set; }

        /// <summary>
        /// 任务Id
        /// </summary>
        public Guid VisitTaskId { get; set; }

        /// <summary>
        /// 项目Id
        /// </summary>
        public Guid TrialId { get; set; }

        /// <summary>
        /// 行号
        /// </summary>
        public decimal RowIndex { get; set; }

        /// <summary>
        /// 答案
        /// </summary>
        public string Answer { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public Guid CreateUserId { get; set; }


        /// <summary>
        /// RowId
        /// </summary>
        public Guid RowId { get; set; }


        public Guid UpdateUserId { get; set; }
        public DateTime UpdateTime { get; set; }

        public bool IsDeleted { get; set; }

        public DateTime? DeletedTime { get; set; }

        public Guid? DeleteUserId { get; set; }
    }
    public class MergeLesionInDto
    {
        public Guid VisitTaskId { get; set; }

        public Guid QuestionId { get; set; }


        /// <summary>
        /// 融合的主病灶
        /// </summary>
        public Guid MergeMainRowId { get; set; }

        /// <summary>
        /// 融合的病灶
        /// </summary>
		public List<Guid> MergeRowIdList { get; set; }


    }

    public class SplitLesionInDto
    {
        public Guid VisitTaskId { get; set; }

        public Guid QuestionId { get; set; }

        public Guid RowId { get; set; }
    }

    public class AdditionalQuestionAnswer
    {
        public Guid QuestionId { get; set; }

        public string Answer { get; set; }
    }

    public class SubmitTaskAdditionalQuestionInDto
    {
        public Guid VisitTaskId { get; set; }

        public List<AdditionalQuestionAnswer> AnswerList { get; set; } = new List<AdditionalQuestionAnswer>();
    }

    public class GetMarkListInDto
    {
        /// <summary>
        /// 任务Id
        /// </summary>
        public Guid VisitTaskId { get; set; }
    }

    public class MarkListInfo
    {
        public string MeasureData { get; set; } = string.Empty;

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

        public Guid? InstanceId { get; set; }

        public Guid? SeriesId { get; set; }
        public Guid? StudyId { get; set; }

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

        public string StudyInstanceUid { get; set; }
        public string SopInstanceUid { get; set; }

        public int NumberOfFrames { get; set; }

    }

    public class NoneDicomMarkInfo
    {

        public Guid? StudyId { get; set; }

        public Guid? NoneDicomFileId { get; set; }

        public string Path { get; set; }
        public string PicturePath { get; set; } = string.Empty;
        public string MeasureData { get; set; } = string.Empty;

        public string MarkTool { get; set; }

        public string MarkName { get; set; }

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


        /// <summary>
        /// 标记的唯一标识符
        /// </summary>
        public Guid? MarkId { get; set; }
    }

    public class GetCustomTagInDto
    {
        /// <summary>
        /// 任务Id
        /// </summary>
        public Guid VisitTaskId { get; set; }
    }

    public class GetPreviousOtherPicturePathOutDto
    {
        public Guid VisitTaskId { get; set; }

        public string? PicturePath { get; set; }

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

    }
    public class GetReportsChartDataOutDto
    {
        public List<string> VisitTaskNameList { get; set; }

        public List<DateTime?> LatestScanDateList { get; set; }

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


        /// <summary>
        /// 数值类型
        /// </summary>
        public ValueOfType? ValueType { get; set; }

        /// <summary>
		/// 自定义单位
		/// </summary>
		public string? CustomUnit { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public string? Type { get; set; }

        public List<ReportChartData> ChartDataList { get; set; }


    }

    public class ReportChartData
    {
        public string Name { get; set; }
        public List<string> Value { get; set; }
    }

    public class GetReportsChartTypeDataInDto
    {
        public ReportChartType ReportChartTypeEnum { get; set; }

        public CriterionType CriterionType { get; set; }
        public GetReadingReportEvaluationOutDto Data { get; set; }
    }

    public class GetReportsChartSummaryInDto
    {
        public Guid SubjectId { get; set; }

        public Guid TrialCriterionId { get; set; }
    }

    public class GetReportsChartSummaryOutDto
    {
        public EvaluationColumn Evaluation { get; set; }

        public List<ChartItem> TargetCharts { get; set; } = new List<ChartItem>();

        public List<ChartItem> QuestionCharts { get; set; } = new List<ChartItem>();
    }


    public class EvaluationColumn
    {
        public List<List<EvaluationValue>> Evaluation { get; set; }
        public string DictionaryCode { get; set; }
    }


    public class EvaluationValue
    {
        public string Value { get; set; }

        public string DictionaryCode { get; set; }

        public bool IsHighlight { get; set; } = false;

        public Guid? VisitTaskId { get; set; }
    }

    public class ChartItem
    {
        public Arm Arm { get; set; }
        public ReportChartType? ChartType { get; set; }
        public string GroupName { get; set; }
        public ValueUnit? Unit { get; set; }

        /// <summary>
        /// 数值类型
        /// </summary>
        public ValueOfType? ValueType { get; set; }

        /// <summary>
		/// 自定义单位
		/// </summary>
		public string? CustomUnit { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public string? Type { get; set; }
        public List<string> VisitTaskNameList { get; set; } = new List<string>();
        public List<DateTime?> LatestScanDateList { get; set; } = new List<DateTime?>();
        public List<ReportChartData> ChartDataList { get; set; } = new List<ReportChartData>();
    }

    public class GetReportsChartDataInDto
    {
        public Guid VisitTaskId { get; set; }

        public Guid TrialId { get; set; }

        public Guid? QuestionId { get; set; }

        public Guid? TableQuestionId { get; set; }

        public decimal? RowIndex { get; set; }

        public ReportChartType? ReportChartTypeEnum { get; set; }
    }
    public class SetReadKeyFileInDto
    {
        public Guid TrialCriterionId { get; set; }
    }
    public class ViewStudyPartInDto
    {
        public Guid VisitTaskId { get; set; }
    }

    public class DeleteSingleTableQuestionMarkInDto
    {
        [NotDefault]
        public Guid Id { get; set; }
    }

    public class DeleteTableQuestionMarkInDto
    {
        [NotDefault]
        public Guid RowId { get; set; }
    }

    /// <summary>
    /// 保存表格问题标记
    /// </summary>
    public class SaveTableQuestionMarkInDto
    {
        public string Answer { get; set; }

        public Guid VisitTaskId { get; set; }

        public Guid QuestionId { get; set; }

        public Guid? InstanceId { get; set; }

        public Guid? SeriesId { get; set; }
        public Guid? StudyId { get; set; }

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

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

        public int? NumberOfFrames { get; set; }

        public string MeasureData { get; set; } = string.Empty;
        public Guid? FristAddTaskId { get; set; }

        public QuestionType? QuestionType { get; set; }
        public string OrderMarkName { get; set; } = string.Empty;

        public Guid? OtherInstanceId { get; set; }

        public Guid? OtherSeriesId { get; set; }

        public Guid? OtherStudyId { get; set; }

        public Guid? RowId { get; set; }
        [NotDefault]
        public Guid TableQuestionId { get; set; }
        [NotDefault]
        public decimal RowIndex { get; set; }

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

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

        public int? OtherNumberOfFrames { get; set; }

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

        /// <summary>
        /// 标记的唯一标识符
        /// </summary>
        public Guid? MarkId { get; set; }
    }


    public class TableQuestionMark: SaveTableQuestionMarkInDto
    {
        public Guid? Id { get; set; }

        public new Guid? TableQuestionId { get; set; }
        
        public new decimal? RowIndex { get; set; }
    }



    public class GetPreviousOtherPicturePathInDto
    {
        public Guid? RowId { get; set; }

        public Guid? VisitTaskId { get; set; }

        /// <summary>
        /// 问题类型
        /// </summary>
        public QuestionType? QuestionType { get; set; }
    }

    public class GetReadingCalculationDataInDto
    {
        /// <summary>
        /// 任务Id
        /// </summary>
        public Guid VisitTaskId { get; set; }
    }

    public class ReadingCustomTagDto
    {
        public Guid? Id { get; set; }

        /// <summary>
        /// 任务Id
        /// </summary>
        public Guid VisitTaskId { get; set; }

        /// <summary>
        /// StudyId
        /// </summary>
        public Guid? StudyId { get; set; }

        /// <summary>
        /// SeriesId
        /// </summary>
        public Guid? SeriesId { get; set; }

        /// <summary>
        /// InstanceId
        /// </summary>
        public Guid? InstanceId { get; set; }

        /// <summary>
        /// MeasureData
        /// </summary>
        public string? MeasureData { get; set; }

        /// <summary>
        /// CreateTime
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// CreateUserId
        /// </summary>
        public Guid CreateUserId { get; set; }

        public int? NumberOfFrames { get; set; }

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

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

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

        public Guid? MarkId { get; set; }

    }

    public class GetManualListInDto
    {
        public Guid TrialId { get; set; }
    }


    public class GetManualListOutDto
    {

        public Guid Id { get; set; }

        /// <summary>
        /// Name
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// Path
        /// </summary>
        public string Path { get; set; } = string.Empty;
    }


    public class GetTaskAdditionalQuestionInDto
    {
        //public Guid TrialReadingCriterionId { get; set; }
        public Guid VisitTaskId { get; set; }
    }

    public class ChangeCalculationAnswerInDto
    {
        public Guid VisitTaskId { get; set; }

        public List<ChangeQuestion> QuestionAnswer { get; set; } = new List<ChangeQuestion>();

        public List<ChangeTableQuestion> TableQuestionAnswer { get; set; } = new List<ChangeTableQuestion>();
    }

    public class ChangeTableQuestion
    {
        public Guid? RowId { get; set; }

        public Guid QuestionId { get; set; }

        public Guid TableQuestionId { get; set; }

        public string Answer { get; set; }
    }

    public class ChangeQuestion
    {
        public Guid QuestionId { get; set; }

        public string Answer { get; set; }
    }



    public class ReadClinicalDataInDto
    {
        [NotDefault]
        public Guid VisitTaskId { get; set; }
    }

    public class GetReadingToolInDto
    {
        public Guid VisitTaskId { get; set; }

    }

    public class GetReadingToolOutDto
    {
        public ReadingTool? ReadingTool { get; set; }

        public Guid TrialReadingCriterionId { get; set; }

        public CriterionType CriterionType { get; set; }

    }

    public class MarkAuditInfo
    {
        public string Param { get; set; }

        public bool IsGeneralMark { get; set; }
    }
    public class ChangeDicomReadingQuestionAnswerInDto
    {
        public Guid VisitTaskId { get; set; }

        public ComputationTrigger ComputationTrigger { get; set; }

        public bool UpdateMark { get; set; } = false;

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

        public List<ChangeDicomReadingQuestionAnswerDto> Answers { get; set; }


        public List<QuestionMarkInfo> QuestionMarkInfoList { get; set; } = new List<QuestionMarkInfo>();
    }


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

        public string Answer { get; set; } = string.Empty;
    }
    public class DicomReadingQuestionAnswer : ReadingQuestionTrial
    {
        public string Answer { get; set; }

        public string LastTaskAnswer { get; set; }

        public bool IsFirstChangeTask { get; set; } = false;
        public List<CrterionDictionaryGroup> CrterionDictionaryGroup { get; set; }

        public List<DicomReadingQuestionAnswer> Childrens = new List<DicomReadingQuestionAnswer>();
    }

    public class DeleteReadingRowAnswerInDto
    {
        public Guid VisitTaskId { get; set; }

        public Guid QuestionId { get; set; } = default(Guid);

        public Guid RowId { get; set; }

        public bool IsNeedSort { get; set; } = true;
    }

    public class GetDicomReadingQuestionAnswerInDto
    {
        public Guid VisitTaskId { get; set; }

        public Guid TrialId { get; set; }

        /// <summary>
        /// 分组分类
        /// </summary>
        public List<GroupClassify>? GroupClassifyList { get; set; }

        /// <summary>
        /// 问题分类
        /// </summary>
        public QuestionClassify? QuestionClassify { get; set; }
    }

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


        /// <summary>
        /// CreateTime
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 第一层的Question
        /// </summary>
        public Guid QuestionId { get; set; }

        /// <summary>
		/// 器官Id
		/// </summary>
		public Guid? OrganInfoId { get; set; }

        /// <summary>
        /// VisitTaskId
        /// </summary>
        public Guid VisitTaskId { get; set; }

        /// <summary>
        /// 标记工具
        /// </summary>
        public string? MarkTool { get; set; }

        /// <summary>
        /// TrialId
        /// </summary>
        public Guid TrialId { get; set; }

        /// <summary>
		/// 首次添加任务ID
		/// </summary>
		public Guid FristAddTaskId { get; set; }

        /// <summary>
        /// 窗宽WW
        /// </summary>
        public decimal? WW { get; set; }

        /// <summary>
        /// 窗位WL
        /// </summary>
        public decimal? WL { get; set; }


        /// <summary>
        /// InstanceId
        /// </summary>
        public Guid? InstanceId { get; set; }

        /// <summary>
        /// SeriesId
        /// </summary>
        public Guid? SeriesId { get; set; }


        /// <summary>
        /// StudyId
        /// </summary>
        public Guid? StudyId { get; set; }

        public bool IsCanEditPosition { get; set; } = false;


        /// <summary>
        /// 是Dicom阅片
        /// </summary>
        public bool IsDicomReading { get; set; } = true;

        /// <summary>
        /// RowIndex
        /// </summary>
        public decimal RowIndex { get; set; }

        /// <summary>
        /// MeasureData
        /// </summary>
        public string? MeasureData { get; set; }

        /// <summary>
        /// 是否是当前任务添加
        /// </summary>
        public bool IsCurrentTaskAdd { get; set; } = false;


        /// <summary>
        /// SplitRowId
        /// </summary>
        public Guid? SplitRowId { get; set; }


        /// <summary>
        /// MergeRowId
        /// </summary>
        public Guid? MergeRowId { get; set; }

        public string? BlindName { get; set; }

        public string? OrderMark { get; set; }

        /// <summary>
        /// 截图地址
        /// </summary>
        public string? PicturePath { get; set; }

        public SplitOrMergeType? SplitOrMergeType { get; set; }

        /// <summary>
        /// CreateUserId
        /// </summary>
        public Guid CreateUserId { get; set; }



        public int? NumberOfFrames { get; set; }

        public Guid UpdateUserId { get; set; }
        //string UpdateUserName { get; set; }
        public DateTime UpdateTime { get; set; }




        public bool IsDeleted { get; set; }

        public DateTime? DeletedTime { get; set; }

        public Guid? DeleteUserId { get; set; }


        /// <summary>
		/// 来自于哪个标记
		/// </summary>
		public string? FromMark { get; set; }

        public string? ReportMark { get; set; }

        public string? RowMark { get; set; }

    }

    public class CopyTableAnswerRowInfo : ReadingTableAnswerRowInfoBase
    {

        public Guid? IdentityRowId { get; set; }

        public Guid OriginalId { get; set; }

        public LesionType? LesionType { get; set; }
    }
    public class CopyTableAnswerDto
    {
        public decimal RowIndex { get; set; }

        /// <summary>
        /// 问题标识
        /// </summary>
        public QuestionMark? QuestionMark { get; set; }

        public bool IsCopy { get; set; }


        /// <summary>
        /// 问题Id
        /// </summary>

        public Guid QuestionId { get; set; }


        public Guid RowId { get; set; }

        /// <summary>
        /// 表格问题Id
        /// </summary>
        public Guid TableQuestionId { get; set; }

        /// <summary>
        /// 项目Id
        /// </summary>
        public Guid TrialId { get; set; }

        public string Answer { get; set; }
    }
    public class GetReadingReportEvaluationInDto
    {
        public Guid VisitTaskId { get; set; }

        public Guid TrialId { get; set; }

        public bool IsCalculate { get; set; } = true;
    }

    public class GetReadingQuestionAndAnswerOutDto : GetReadingTableQuestionOutDto
    {

        public List<QuestionMarkInfo> QuestionMarkInfoList { get; set; }

        public bool IsBaseLineTask { get; set; }

        public decimal TaskNum { get; set; }

        /// <summary>
        /// 任务盲态名称 和访视盲态一样
        /// </summary>
        public string BlindName { get; set; }

        public ReadingTaskState ReadingTaskState { get; set; }


    }

    public class GetCustomTableQuestionAnswerInDto
    {
        [NotDefault]
        public Guid VisitTaskId { get; set; }

        /// <summary>
        /// 问题分类
        /// </summary>
        public QuestionClassify? QuestionClassify { get; set; }

        public bool IsDicomReading { get; set; } = true;
    }

    public class GetReadingTableQuestionOutDto
    {
        public List<TrialReadQuestionData> SinglePage { get; set; }

        public List<TrialReadQuestionData> MultiPage { get; set; }

        public List<TrialReadQuestionData> PublicPage { get; set; }
    }


    public class TrialReadQuestionData : ReadingQuestionTrial
    {

        public List<CrterionDictionaryGroup> CrterionDictionaryGroup { get; set; }

        public CriterionType CriterionType { get; set; }

        public bool IsPage { get; set; } = false;

        public string Answer { get; set; }

        /// <summary>
        /// 分页名称
        /// </summary>
        public string PageName { get; set; }

        /// <summary>
        /// 是否公共分页
        /// </summary>
        public bool? IsPublicPage { get; set; } = false;

        public int? PageShowOrder { get; set; }

        public bool IsPreinstall { get {
               return this.TableQuestions.Questions.Any(x => x.IsPreinstall);
            } }



        public List<TrialReadQuestionData> Childrens { get; set; }

        public TrialReadTableQuestion TableQuestions { get; set; }


    }

    /// <summary>
    /// 病灶Index
    /// </summary>
    public class lesionsIndexDto
    {


        public Guid QuestionId { get; set; }

        public List<decimal> Rowindexs { get; set; }
    }

    public class TableAnsweRowInfo : ReadingTableAnswerRowInfo
    {
        public string SplitName { get; set; }

        public string MergeName { get; set; }

        public decimal FristAddTaskNum { get; set; }

        /// <summary>
        /// 病灶类型
        /// </summary>
        public LesionType? LesionType { get; set; }
    }

    public class GetReadingTableQuestionOrAnswerInDto
    {
        public Guid TrialReadingCriterionId { get; set; }
        public Guid? TaskId { get; set; }
        public List<ReadingTableQuestionAnswerInfo> TableAnswers { get; set; } = new List<ReadingTableQuestionAnswerInfo>();

        public List<TableAnsweRowInfo> TableAnsweRowInfos { get; set; } = new List<TableAnsweRowInfo>();

        public List<OrganInfo> OrganInfos { get; set; } = new List<OrganInfo>();

        /// <summary>
        /// 问题分类
        /// </summary>
        public QuestionClassify? QuestionClassify { get; set; }
        public bool IsGetallQuestion { get; set; } = false;

        /// <summary>
        /// 是否获取预览
        /// </summary>
        public bool IsGetPreview { get; set; } = false;
    }
    public class ReadingTableQuestionAnswerInfo : ReadingTableQuestionAnswer
    {
        public int ShowOrder { get; set; }

        /// <summary>
        /// 问题标识
        /// </summary>
        public QuestionMark? QuestionMark { get; set; }
    }

    public class TrialReadTableQuestion
    {
        public List<TableQuestionTrial> Questions { get; set; }

        public List<Dictionary<string, string>> Answers { get; set; }
    }


    public class TableQuestionTrial : ReadingTableQuestionTrial
    {
        public List<GetTrialReadingQuestionOutDto> RelationQuestions { get; set; } = new List<GetTrialReadingQuestionOutDto>();
    }


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

        public Guid? TableQuestionId { get; set; }

        /// <summary>
        /// 序号标记
        /// </summary>
        public string? OrderMark { get; set; }


        public string? OrderMarkName { get; set; }


        public string? FromMark { get; set; }

        /// <summary>
		/// 病灶类型
		/// </summary>
		public LesionType? LesionType { get; set; }


        /// <summary>
        /// 截图地址
        /// </summary>
        public string PicturePath { get; set; } = string.Empty;

        public int? NumberOfFrames { get; set; }
        public Guid RowId { get; set; }

        /// <summary>
        /// QuestionId
        /// </summary>
		public Guid QuestionId { get; set; }

        /// <summary>
        /// VisitTaskId
        /// </summary>
        public Guid VisitTaskId { get; set; }

        /// <summary>
        /// TrialId
        /// </summary>
        public Guid TrialId { get; set; }


        /// <summary>
        /// InstanceId
        /// </summary>
        public Guid? InstanceId { get; set; }

        /// <summary>
        /// SeriesId
        /// </summary>
        public Guid? SeriesId { get; set; }


        /// <summary>
        /// StudyId
        /// </summary>
        public Guid? StudyId { get; set; }

        public bool IsCanEditPosition { get; set; }

        /// <summary>
        /// RowIndex
        /// </summary>
        public string? RowIndex { get; set; }

        /// <summary>
        /// RowIndex
        /// </summary>
        public decimal RowIndexNum { get; set; }


        /// <summary>
        /// 是Dicom阅片
        /// </summary>
        public bool IsDicomReading { get; set; } = true;

        public string? BlindName { get; set; }


        /// <summary>
        /// 首次添加任务ID
        /// </summary>
        public Guid FristAddTaskId { get; set; }

        /// <summary>
        /// 窗宽WW
        /// </summary>
        public decimal? WW { get; set; }

        /// <summary>
        /// 窗位WL
        /// </summary>
        public decimal? WL { get; set; }

        /// <summary>
        /// MeasureData
        /// </summary>
        public string? MeasureData { get; set; }


        public string? OtherMeasureData { get; set; }
        public int ShowOrder { get; set; }


        public bool IsFirstChangeTask { get; set; } = false;


        /// <summary>
        /// InstanceId
        /// </summary>
        public Guid? OtherInstanceId { get; set; }

        /// <summary>
        /// SeriesId
        /// </summary>
        public Guid? OtherSeriesId { get; set; }


        /// <summary>
        /// StudyId
        /// </summary>
        public Guid? OtherStudyId { get; set; }

        public string? OtherMarkTool { get; set; }

        public string? OtherPicturePath { get; set; }

        public int? OtherNumberOfFrames { get; set; }


        public SplitOrMergeType? SplitOrMergeType { get; set; }

    }

    public class GetTableAnswerRowInfoInDto
    {
        public Guid VisitTaskId { get; set; }

        public Guid? QuestionId { get; set; }
    }


    public class QuestionMarkInfo
    {
        public Guid? Id { get; set; }

        /// <summary>
        /// 问题Id
        /// </summary>
        public Guid? QuestionId { get; set; }

        /// <summary>
        /// InstanceId
        /// </summary>
        public Guid? InstanceId { get; set; }

        /// <summary>
        /// SeriesId
        /// </summary>
        public Guid? SeriesId { get; set; }

        /// <summary>
        /// StudyId
        /// </summary>
        public Guid? StudyId { get; set; }

        /// <summary>
        /// MarkTool
        /// </summary>
        public string? MarkTool { get; set; }

        /// <summary>
        /// PicturePath
        /// </summary>
        public string? PicturePath { get; set; }

        public string? Path { get; set; }

        /// <summary>
        /// NumberOfFrames
        /// </summary>
        public int? NumberOfFrames { get; set; }

        /// <summary>
        /// MeasureData
        /// </summary>
        public string? MeasureData { get; set; }


        public Guid? FristAddTaskId { get; set; }

        public QuestionType? QuestionType { get; set; }

        public string? OrderMarkName { get; set; }


        /// <summary>
        /// InstanceId
        /// </summary>
        public Guid? OtherInstanceId { get; set; }

        /// <summary>
        /// SeriesId
        /// </summary>
        public Guid? OtherSeriesId { get; set; }

        /// <summary>
        /// StudyId
        /// </summary>
        public Guid? OtherStudyId { get; set; }

        public string? OtherMarkTool { get; set; }

        public string? OtherPicturePath { get; set; }

        public int? OtherNumberOfFrames { get; set; }
        public string? OtherMeasureData { get; set; }

        /// <summary>
        /// 表格问题标记
        /// </summary>
        public Guid? RowId { get; set; }

        public Guid? TableQuestionId { get; set; }


        /// <summary>
        /// 标记的唯一标识符
        /// </summary>
        public Guid? MarkId { get; set; }
    }
    public class GetReadingQuestionAndAnswerInDto
    {

        public Guid TrialId { get; set; }

        public Guid VisitTaskId { get; set; }

        /// <summary>
        /// 问题分类
        /// </summary>
        public QuestionClassify? QuestionClassify { get; set; }
    }

    public class GetFilterTableQuestionInDto
    {
        public Guid TrialId { get; set; }

        public Guid VisitTaskId { get; set; }

        public Guid QuestionId { get; set; }

        /// <summary>
        /// 问题分类
        /// </summary>
        public QuestionClassify? QuestionClassify { get; set; }
    }

    #endregion
    public class GetHistoryGlobalInfoOutDto
    {
        public Guid VisitTaskId { get; set; }

        public string TaskName { get; set; }

        public ReadingTaskState ReadingTaskState { get; set; }

        public decimal VisitTaskNum { get; set; }
    }

    public class GetHistoryGlobalInfoInDto
    {
        public Guid VisitTaskId { get; set; }
    }


    public class SubmitOncologyReadingInfoInDto
    {
        public Guid OncologyTaskId { get; set; }
    }

    public class SubmitGlobalReadingInfoInDto
    {
        public Guid GlobalTaskId { get; set; }
    }

    public class SetOncologyQuestion
    {
        public Guid VisitTaskId { get; set; }

        /// <summary>
        /// 评估结果
        /// </summary>
        public string EvaluationResult { get; set; } = string.Empty;

        /// <summary>
        /// 评估原因
        /// </summary>
        public string EvaluationReason { get; set; } = string.Empty;
    }

    public class SetOncologyReadingInfoInDto
    {
        public Guid OncologyTaskId { get; set; }

        public Guid RelatedTaskId { get; set; }

        public List<SetOncologyQuestion> OncologyQuestionList { get; set; }
    }

    public class BatchSubmitGlobalReadingInfo
    {
        public Guid GlobalTaskId { get; set; }

        public Guid SubjectId { get; set; }

        public Guid TrialId { get; set; }

        public List<SubmitGlobalReading> VisitTaskAnswerList { get; set; }

    }


    public class SubmitGlobalReading
    {
        public Guid VisitTaskId { get; set; }

        public List<GlobalAnswer> AnswerList { get; set; }
    }

    public class GlobalAnswer
    {
        public Guid? QuestionId { get; set; }



        public GlobalAnswerType GlobalAnswerType { get; set; }

        public string Answer { get; set; }
    }

    public class SaveGlobalReadingInfoInDto
    {
        public Guid GlobalTaskId { get; set; }

        public Guid SubjectId { get; set; }

        public Guid TrialId { get; set; }

        public List<SaveGlobalReadingQuestion> QuestionList { get; set; }

    }


    public class SaveGlobalReadingQuestion
    {
        public Guid? QuestionId { get; set; }

        public Guid VisitTaskId { get; set; }

        public GlobalAnswerType GlobalAnswerType { get; set; }

        public string Answer { get; set; }
    }


    public class OncologyQuestion
    {
        public Guid QuestionId { get; set; }

        public string QuestionName { get; set; }

        public string Answer { get; set; }

        /// <summary>
        /// 数值类型
        /// </summary>
        public ValueOfType? ValueType { get; set; }


        /// <summary>
        /// 自定义单位
        /// </summary>
        public string? CustomUnit { get; set; }

        public ValueUnit? Unit { get; set; }


        /// <summary>
        /// 问题类型
        /// </summary>
        public TableQuestionType? QuestionGenre { get; set; }


        /// <summary>
        /// 字典code
        /// </summary>
        public string DictionaryCode { get; set; }

    }

    public class OncologyVisitTaskInfo
    {
        public Guid VisitTaskId { get; set; }

        public string VisitName { get; set; }

        public bool IsBaseLine { get; set; }

        public decimal VisitNum { get; set; }

        public bool IsHaveChange { get; set; }

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

        /// <summary>
        /// 评估结果
        /// </summary>
        public string EvaluationResult { get; set; } = string.Empty;

        /// <summary>
        /// 评估原因
        /// </summary>
        public string EvaluationReason { get; set; } = string.Empty;


        public List<OncologyQuestion> QuestionList { get; set; } = new List<OncologyQuestion>();

    }

    public class GetOncologyReadingInfoOutDto
    {
        public Guid OncologyTaskId { get; set; }

        ///// <summary>
        ///// 评估结果
        ///// </summary>
        //public string TrialEvaluationResult { get; set; } = string.Empty;

        /// <summary>
        /// 评估原因
        /// </summary>
        public string TrialEvaluationReason { get; set; } = string.Empty;


        /// <summary>
        /// 是否显示详情
        /// </summary>
        public bool IsShowDetail { get; set; }

        //任务阅片状态
        public ReadingTaskState ReadingTaskState { get; set; }

        public Guid GlobalOrVisitTaskId { get; set; }

        /// <summary>
        /// 任务类型
        /// </summary>
        public ReadingCategory ReadingCategory { get; set; }


        public Guid RelatedTaskId { get; set; }


        public Guid SubjectId { get; set; }

        public List<CriterionDictionaryInfo> AssessTypeList { get; set; }

        public List<OncologyVisitTaskInfo> OncologyVisits { get; set; } = new List<OncologyVisitTaskInfo>();
    }

    public class GetRelatedVisitTaskOutDto
    {

        /// <summary>
        /// 是否存在未处理的反馈
        /// </summary>
        public bool IsExistUnprocessedFeedback { get; set; }
        public Guid VisitTaskId { get; set; }
        public string TaskName { get; set; }

        public bool IsBaseLineTask { get; set; }

        public string TaskBlindName { get; set; }

        public string SubjectCode { get; set; }

        public bool IsExistsClinicalData { get; set; }

        public ReadingTaskState ReadingTaskState { get; set; }

        public decimal VisitTaskNum { get; set; }

        public Guid? VisitId { get; set; }

        public bool IsCurrentTask { get; set; }

        /// <summary>
        /// 是否是转变的任务(转为IRECIST)
        /// </summary>
        public bool IsConvertedTask { get; set; } = false;

        /// <summary>
        /// 是否是第一次转化的任务
        /// </summary>
        public bool IsFirstChangeTask { get; set; } = false;

        /// <summary>
        /// 融合的PTSeriesId
        /// </summary>
        public Guid? PTSeriesId { get; set; }

        /// <summary>
        /// 融合的CTSeriesId
        /// </summary>
        public Guid? CTSeriesId { get; set; }

        /// <summary>
        /// StudyId
        /// </summary>
        public Guid? OtherStudyId { get; set; }
    }

    public class GetVisitReadingQuestionOutDto
    {
        public Guid QuestionId { get; set; }

        public Guid QuestionName { get; set; }

        //public 
    }

    public class GetVisitReadingQuestionInDto
    {
        public Guid TrialId { get; set; }

        public Guid VisitTaskId { get; set; }
    }

    public class GetRelatedVisitTaskInDto
    {
        [NotDefault]
        public Guid VisitTaskId { get; set; }
    }

    public class GetOncologyReadingInfoInDto
    {
        public Guid VisitTaskId { get; set; }
    }

    public class GetGlobalReadingInfoInDto
    {
        public Guid VisitTaskId { get; set; }

        /// <summary>
        /// 当新答案为空的时候 是否是有原数据
        /// </summary>
        public bool UsingOriginalData { get; set; } = false;
    }

    public class GetGlobalReadingInfoOutDto
    {
        public Guid GlobalTaskId { get; set; }

        public Guid? OtherGlobalTaskId { get; set; }

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

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

        public Guid? JudgeTaskId { get; set; }

        public string? JudgeTaskName { get; set; }

        public ReadingTaskState ReadingTaskState { get; set; }

        public string GlobalUpdateType { get; set; }

        public List<CriterionDictionaryInfo> AssessTypeList { get; set; }

        public List<GlobalVisitInfo> TaskList { get; set; }
    }

    public class GlobalVisitInfo
    {
        public string VisitName { get; set; }

        public string BlindName { get; set; }

        public Guid VisitId { get; set; }

        public Guid VisitTaskId { get; set; }

        public decimal VisitNum { get; set; }

        public bool IsBaseLine { get; set; }

        public Arm ArmEnum { get; set; }


        /// <summary>
        /// 是否是转变的任务(转为IRECIST)
        /// </summary>
        public bool IsConvertedTask { get; set; } = false;

        public bool IsFirstChangeTask { get; set; } = false;

        public string AgreeOrNotAnswer
        {
            get
            {

                return this.AgreeOrNot.Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
            }
        }

        public List<CrterionDictionaryGroup> CrterionDictionaryGroup { get; set; }
        public List<GlobalQuestionInfo> BeforeQuestionList { get; set; }

        public List<GlobalQuestionInfo> AgreeOrNot { get; set; }

        public List<GlobalQuestionInfo> AfterQuestionList { get; set; }

        public List<LesionDto> LesionCountList { get; set; } = new List<LesionDto>();
    }

    public class GetGlobalQuestionType
    {
        public GlobalAnswerType GlobalAnswerType { get; set; }

        public string QuestionName { get; set; }
    }
    public class GlobalQuestionInfo
    {
        public Guid? QuestionId { get; set; }

        /// <summary>
        /// 裁判百分比或绝对值的相差值
        /// </summary>
        public decimal? JudgeDifferenceValue { get; set; }

        /// <summary>
        /// 裁判百分比或绝对值的相差值匹配规则
        /// </summary>
        public JudgeDifferenceType JudgeDifferenceType { get; set; }

        public bool IsHaveChange { get; set; } = false;

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

        public string QuestionName { get; set; }

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

        public string Answer { get; set; }

        public bool IsGlobalAnswer { get; set; } = false;

        /// <summary>
		/// 问题类型
		/// </summary>
		public QuestionType? QuestionType { get; set; }


        /// <summary>
        /// 限制编辑
        /// </summary>
        public LimitEdit LimitEdit { get; set; } = LimitEdit.None;

        /// <summary>
		/// 最大答案长度
		/// </summary>
		public int? MaxAnswerLength { get; set; }

        /// <summary>
		/// 文件类型
		/// </summary>
		public string FileType { get; set; } = string.Empty;

        public ValueUnit? Unit { get; set; }

        /// <summary>
		/// 字典code
		/// </summary>
		public string DictionaryCode { get; set; } = string.Empty;

        /// <summary>
		/// 全局阅片显示类型
		/// </summary>
		public GlobalReadingShowType GlobalReadingShowType { get; set; } = GlobalReadingShowType.NotShow;



        /// <summary>
        /// 问题类型
        /// </summary>
        public TableQuestionType? QuestionGenre { get; set; }




        /// <summary>
        /// 答案分组
        /// </summary>
        public string AnswerGroup { get; set; } = string.Empty;

        /// <summary>
        /// 答案组合
        /// </summary>
        public string AnswerCombination { get; set; } = string.Empty;

        /// <summary>
        /// 裁判类型
        /// </summary>
        public JudgeTypeEnum JudgeType { get; set; }

        public int ShowOrder { get; set; }

        /// <summary>
        /// 类型值
        /// </summary>
        public string TypeValue { get; set; }

        /// <summary>
		/// 数值类型
		/// </summary>
		public ValueOfType? ValueType { get; set; }


        /// <summary>
        /// 自定义单位
        /// </summary>
        public string? CustomUnit { get; set; }


        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; }


        public GlobalAnswerType GlobalAnswerType { get; set; }

        /// <summary>
        /// 是否是裁判问题
        /// </summary>
        public bool IsJudgeQuestion { get; set; } = true;

        public List<CrterionDictionaryGroup> CrterionDictionaryGroup { get; set; }
    }

    public class GetReadingImgOutDto
    {
        public string Path { get; set; }

        public string FileName { get; set; }
    }

    public class SubjectTask
    {
        public Guid SubjectId { get; set; }

        public int UnReadTaskCount { get; set; }

        public int Index { get; set; }
    }


    public class ResetReadingTaskOutDto
    {

    }

    public class SetSkipReadingCacheInDto
    {
        public Guid VisitTaskId { get; set; }
    }

    public class ResetReadingTaskInDto
    {
        public Guid VisitTaskId { get; set; }
    }
    public class GetNextTaskInDto
    {

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

        public Guid TrialId { get; set; }

        public Guid? SubjectId { get; set; }

        public Guid? TrialReadingCriterionId { get; set; }

        public Guid? VisitTaskId { get; set; }
    }

    public class GetReadingTaskDto
    {
        public Guid VisitTaskId { get; set; }
        public Guid VisistId { get; set; }

        public Arm ArmEnum { get; set; }

        public bool IsExistsClinicalData { get; set; }

        public bool IsNeedReadClinicalData { get; set; }

        public bool IsReadClinicalData { get; set; }

        /// <summary>
        /// 修约小数点
        /// </summary>
        public int? DigitPlaces { get; set; } = 2;

        /// <summary>
        /// 是否查看检查部位
        /// </summary>
        public bool IsViewStudyPart { get; set; } = false;


        /// <summary>
        /// 标准类型
        /// </summary>
        public CriterionType CriterionType { get; set; }

        /// <summary>
        ///  eCRF报告是否显示在图像页面
        /// </summary>
        public bool IseCRFShowInDicomReading { get; set; } = false;

        public bool IsExistsNoDicomFile { get; set; } = false;

        public string TaskBlindName { get; set; }

        public Guid SubjectId { get; set; }

        public string SubjectCode { get; set; } = String.Empty;

        public bool ExistsManual { get; set; }

        public bool IsBaseLine { get; set; }

        /// <summary>
        /// 阅片版本
        /// </summary>
        public ReadingVersion ReadingVersionEnum { get; set; }

        public List<string> ReadingToolList { get; set; } = new List<string>();

        public ReadingCategory ReadingCategory { get; set; }

        public decimal VisitNum { get; set; }

        public bool IsReadingShowSubjectInfo { get; set; } = false;

        public bool IsReadingShowPreviousResults { get; set; } = false;

        /// <summary>
		/// 任务展示访视 读片任务显示是否顺序
		/// </summary>
		public ReadingOrder IsReadingTaskViewInOrder { get; set; }

        public Guid TrialReadingCriterionId { get; set; }

        public bool IsFirstChangeTask { get; set; } = false;

        public ReadingTaskState ReadingTaskState { get; set; }

        /// <summary>
        /// 是否显示检查名称
        /// </summary>
        public bool IsShowStudyName { get; set; }

        /// <summary>
        /// 是否存在未处理的反馈
        /// </summary>
        public bool IsExistUnprocessedFeedback { get; set; }

        /// <summary>
        /// 是否是转变的任务(转为IRECIST)
        /// </summary>
        public bool IsConvertedTask { get; set; } = false;

        public bool IsReadKeyFile { get; set; } = false;

        public bool IsHaveKeyFile { get; set; } = false;

        /// <summary>
        /// 定圆工具默认半径
        /// </summary>
        public decimal? CircleRadius { get; set; }

        /// <summary>
        /// 默认SegmentName
        /// </summary>
        public DefaultSegmentNameDto DefaultSegmentName { get; set; }

        /// <summary>
        /// 仲裁模式
        /// </summary>
        public JudgeMode JudgeModeEnum { get; set; } = JudgeMode.SelectOne;

        /// <summary>
        /// 裁判规则
        /// </summary>
        public JudgeRule JudgeRuleEnum { get; set; } = JudgeRule.Consistent;

        /// <summary>
        /// 仲裁对象
        /// </summary>
        public ArbitrationRule ArbitrationRule { get; set; } = ArbitrationRule.Reading;

    }

    public class GetReadingImgInDto
    {

        public Guid? SubjectId { get; set; }

        [NotDefault]
        public Guid TrialId { get; set; }

        public Guid? VisistTaskId { get; set; }
    }

    public class GetConfirmCriterionInDto
    {
        [NotDefault]
        public Guid TrialId { get; set; }


        public Guid? VisitTaskId { get; set; }
    }



    /// <summary>
    /// 返回对象
    /// </summary>
    public class GetTrialConfirmCriterionListOutDto
    {
        public Guid ReadingQuestionCriterionTrialId { get; set; }

        /// <summary>
        /// 标准
        /// </summary>
        public string ReadingQuestionCriterionTrialName { get; set; }
    }


    public class SetTrialCriterionJudgeQuestionAnswerGroupInDto
    {
        [NotDefault]
        public Guid ReadingQuestionTrialId { get; set; }



        public List<string> AnswerGroup { get; set; }

        /// <summary>
        /// 裁判百分比或绝对值的相差值
        /// </summary>
        public decimal? JudgeDifferenceValue { get; set; }

        /// <summary>
        /// 裁判百分比或绝对值的相差值匹配规则
        /// </summary>
        public JudgeDifferenceType JudgeDifferenceType { get; set; }


        public List<AnswerCombinationDto> AnswerCombination { get; set; }



        public JudgeTypeEnum JudgeType { get; set; }
    }

    public class GetTrialCriterionJudgeQuestionListOutDto
    {
        public Guid ReadingQuestionTrialId { get; set; }

        public int ShowOrder { get; set; }

        /// <summary>
        /// 裁判百分比或绝对值的相差值
        /// </summary>
        public decimal? JudgeDifferenceValue { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; } = string.Empty;

        /// <summary>
        /// 裁判百分比或绝对值的相差值匹配规则
        /// </summary>
        public JudgeDifferenceType JudgeDifferenceType { get; set; }

        public string QuestionName { get; set; }


        public string PageName { get; set; }


        public string TypeValue { get; set; }

        /// <summary>
        /// 问题类型
        /// </summary>
        public TableQuestionType? QuestionGenre { get; set; }

        /// <summary>
		/// 字典code
		/// </summary>
		public string DictionaryCode { get; set; } = string.Empty;

        /// <summary>
        /// 裁判类别
        /// </summary>
        public JudgeTypeEnum JudgeType { get; set; }

        /// <summary>
        /// 答案分组
        /// </summary>
        public List<string> AnswerGroup { get; set; }


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

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

        /// <summary>
        /// 答案组合
        /// </summary>
        public List<AnswerCombinationDto> AnswerCombination { get; set; }


    }

    public class GetTrialCriterionJudgeQuestionListInDto
    {
        [NotDefault]
        public Guid TrialId { get; set; }

        [NotDefault]
        public Guid TrialReadingCriterionId { get; set; }
    }

    public class VisitTaskArm
    {
        public Arm ArmEnum { get; set; }


        public Guid VisitTaskId { get; set; }
    }

    public class GetJudgeReadingInfoOutDto
    {
        public Guid? JudgeResultTaskId { get; set; }

        public List<JudgeReadingInfoDto> VisitInfoList { get; set; }

        public List<VisitTaskArm> VisitTaskArmList { get; set; }


        public ReadingTaskState ReadingTaskState { get; set; }

        /// <summary>
        /// 裁判结果的备注
        /// </summary>
        public string JudgeResultRemark { get; set; }

        public List<string> JudgeResultImagePathList { get; set; } = new List<string>();

        //public string JudgeResultImagePath { get; set; } = string.Empty;
    }

    public class GetReadingPastResultListOutDto
    {
        public Guid VisitTaskId { get; set; }

        public Guid? ReadModuleVisitId { get; set; }
        public string TaskName { get; set; }

        public string VisitBlindName { get; set; }

        public string TaskBlindName { get; set; }

        public string VisitName { get; set; }

        public decimal VisitTaskNum { get; set; }


        public Arm? JudgeResultArm { get; set; }
    }

    public class GetJudgeReadingPastResultListInDto
    {
        [NotDefault]
        public Guid VisitTaskId { get; set; }
    }

    public class GetReadingPastResultListInDto
    {
        [NotDefault]
        public Guid VisitTaskId { get; set; }
    }

    public class SaveJudgeVisitTaskResult
    {
        public Guid VisitTaskId { get; set; }

        public Guid JudgeResultTaskId { get; set; }

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

        //public string JudgeResultImagePath { get; set; } = string.Empty;

        public List<string> JudgeResultImagePathList { get; set; } = new List<string>();
    }

    public class GetReadingSubjectInfoOutDto
    {
        public Guid VisitTaskId { get; set; }

        public Guid SubjectId { get; set; }

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

        public ReadingCategory ReadingCategory { get; set; }

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

        public bool IsReadingShowPreviousResults { get; set; } = false;

        public bool IsReadingShowSubjectInfo { get; set; } = false;
    }

    public class GetReadingSubjectInfoInDto
    {
        public Guid VisitTaskId { get; set; }
    }
    public class GetJudgeReadingInfo
    {
        public Guid VisitTaskId { get; set; }
    }

    public class GetSingleVisitJudgeAnswerInDto
    {
        [NotDefault]
        public Guid VisitTaskId { get; set; }
    }

    public class GetSingleVisitJudgeAnswerOutDto
    {
        public Guid R1VisitTaskId { get; set; }
        public Guid R2VisitTaskId { get; set; }
        public List<SingleVisitJudgeAnswerItemDto> QuestionList { get; set; } = new List<SingleVisitJudgeAnswerItemDto>();
    }

    public class SingleVisitJudgeAnswerItemDto
    {
        public Guid ReadingQuestionId { get; set; }
        public string QuestionName { get; set; } = string.Empty;
        public string Type { get; set; } = string.Empty;
        public string TypeValue { get; set; } = string.Empty;
        public int ShowOrder { get; set; }
        public string R1Answer { get; set; } = string.Empty;
        public string R2Answer { get; set; } = string.Empty;
        public TableQuestionType? QuestionGenre { get; set; }
        public string DictionaryCode { get; set; } = string.Empty;
        public ValueUnit? Unit { get; set; }
        public string? CustomUnit { get; set; }
        public ValueOfType? ValueType { get; set; }
        public JudgeReadingQuestionType QuestionType { get; set; } = JudgeReadingQuestionType.Question;
    }

    public class GetJudgeFormInDto
    {
        [NotDefault]
        public Guid VisitTaskId { get; set; }
    }

    public class GetJudgeFormOutDto
    {
        public string JudgeResultRemark { get; set; } = string.Empty;
        public List<string> JudgeResultImagePathList { get; set; } = new List<string>();
        public List<JudgeFormQuestionDto> QuestionList { get; set; } = new List<JudgeFormQuestionDto>();
    }

    public class JudgeFormQuestionDto
    {
        public Guid ReadingQuestionId { get; set; }
        public string QuestionName { get; set; } = string.Empty;
        public string Type { get; set; } = string.Empty;

        public ShowQuestion ShowQuestion { get; set; }
        public string TypeValue { get; set; } = string.Empty;
        public int ShowOrder { get; set; }
        public string Answer { get; set; } = string.Empty;
        public TableQuestionType? QuestionGenre { get; set; }
        public string DictionaryCode { get; set; } = string.Empty;
        public ValueUnit? Unit { get; set; }
        public string? CustomUnit { get; set; }
        public ValueOfType? ValueType { get; set; }
        public JudgeReadingQuestionType QuestionType { get; set; } = JudgeReadingQuestionType.Question;
    }

    public class SetJudgeFormInDto
    {
        [NotDefault]
        public Guid VisitTaskId { get; set; }

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

        public List<string> JudgeResultImagePathList { get; set; } = new List<string>();

        public List<JudgeFormAnswerDto> QuestionList { get; set; } = new List<JudgeFormAnswerDto>();
    }

    public class JudgeFormAnswerDto
    {
        public Guid ReadingQuestionId { get; set; }
        public string Answer { get; set; } = string.Empty;
    }

    public class JudgeReadingInfoDto
    {
        public string VisitName { get; set; }

        public Guid VisitId { get; set; }



        public List<JudgeReadingQuestion> VisitTaskInfoList { get; set; }


    }


    public class JudgeReadingQuestion
    {
        public Arm ArmEnum { get; set; }


        public Guid GlobalVisitTaskId { get; set; }

        public Guid VisitTaskId { get; set; }

        public List<JudgeQuestion> JudgeQuestionList { get; set; }
    }

    public class GlobalVisitJudgeQuestion : JudgeQuestion
    {
        public Guid VisitTaskId { get; set; }

        /// <summary>
		/// 排序
		/// </summary>
		public int ShowOrder { get; set; }
    }

    public class JudgeQuestion
    {
        public Guid QuestionId { get; set; }


        public string QuestionName { get; set; }




        /// <summary>
        /// 问题类型
        /// </summary>
        public TableQuestionType? QuestionGenre { get; set; }

        /// <summary>
        /// 字典code
        /// </summary>
        public string DictionaryCode { get; set; } = string.Empty;

        public dynamic Answer { get; set; }

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

        public ValueUnit? Unit { get; set; }


        /// <summary>
        /// 自定义单位
        /// </summary>
        public string? CustomUnit { get; set; }

        /// <summary>
        /// 数值类型
        /// </summary>
        public ValueOfType? ValueType { get; set; }

        public JudgeReadingQuestionType QuestionType { get; set; } = JudgeReadingQuestionType.Question;

    }

    public class GetSystemReadingQuestionInDto
    {
        [NotDefault]
        public Guid Id { get; set; }


    }

    public class VerifyVisitTaskDto
    {
        public QuestionType QuestionType { get; set; }

        public Func<ReadingCalculateDto, Task<string>> Fun { get; set; }
    }

    public class GetReportVerifyOutDto
    {
        /// <summary>
        /// 是否存在疾病
        /// </summary>
        public string? IsExistDisease { get; set; }

        /// <summary>
        /// 整体肿瘤评估
        /// </summary>
        public string? TumorEvaluate { get; set; }
    }

    public class GetReportVerifyInDto
    {
        public Guid VisitTaskId { get; set; }

        public bool IsConvertTask { get; set; }

        public Guid? BeforeConvertedTaskId { get; set; }
    }



    public class VerifyVisitTaskQuestionsInDto
    {
        /// <summary>
        /// 任务Id
        /// </summary>
        public Guid VisitTaskId { get; set; }
    }

    public class TableQuestionData
    {
        public Guid TableQuestionId { get; set; }

        public int Count { get; set; }

    }

    public class SubmitTableQuestionOutDto
    {
        public Guid RowId { get; set; }
    }
    public class SubmitTableQuestionInDto
    {
        public Guid QuestionId { get; set; }

        public ComputationTrigger ComputationTrigger { get; set; } = ComputationTrigger.CTSave;

        public Guid? OrganInfoId { get; set; }

        public int? NumberOfFrames { get; set; }

        public string? FromMark { get; set; }

        public string? ReportMark { get; set; }

        /// <summary>
        /// 标记工具
        /// </summary>
        public string? MarkTool { get; set; }

        public decimal RowIndex { get; set; }

        /// <summary>
        /// 截图地址
        /// </summary>
        public string? PicturePath { get; set; }

        /// <summary>
        /// 任务Id
        /// </summary>
        public Guid VisitTaskId { get; set; }

        /// <summary>
        /// 项目Id
        /// </summary>
        public Guid TrialId { get; set; }

        public string? MeasureData { get; set; }

        public string? OtherMeasureData { get; set; }

        public Guid? SeriesId { get; set; }

        public Guid? InstanceId { get; set; }

        public Guid? StudyId { get; set; }

        public Guid? RowId { get; set; }

        public Guid? Id
        {
            get
            {
                return this.RowId;
            }
        }

        public bool? IsCanEditPosition { get; set; }

        public decimal? WW { get; set; }

        public decimal? WL { get; set; }

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

        public bool IsDicomReading { get; set; } = true;

        /// <summary>
        /// InstanceId
        /// </summary>
        public Guid? OtherInstanceId { get; set; }

        /// <summary>
        /// SeriesId
        /// </summary>
        public Guid? OtherSeriesId { get; set; }


        /// <summary>
        /// StudyId
        /// </summary>
        public Guid? OtherStudyId { get; set; }

        public string? OtherMarkTool { get; set; }

        public string? OtherPicturePath { get; set; }

        public int? OtherNumberOfFrames { get; set; }

        /// <summary>
        /// 融合的PTSeriesId
        /// </summary>
        public Guid? PTSeriesId { get; set; }

        /// <summary>
        /// 融合的CTSeriesId
        /// </summary>
        public Guid? CTSeriesId { get; set; }

        public DateTime? UpdateTime { get; set; }

        public List<SubmitTableQuestionInfo> AnswerList { get; set; }

    }

    public class SubmitTableQuestionInfo
    {
        public Guid TableQuestionId { get; set; }

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

    public class GetTrialReadingQuestionInDto
    {
        [NotDefault]
        public Guid ReadingQuestionCriterionTrialId { get; set; }

        public Guid? VisitTaskId { get; set; }


        public FormType? FormType { get; set; }
    }

    public class SubmitDicomVisitTaskInDto
    {
        public Guid VisitTaskId { get; set; }
    }

    public class GetNoneDicomMarkListOutDto
    {
        public List<AddNoneDicomMarkInDto> NoneDicomMarkList { get; set; }
    }


    public class GetNoneDicomMarkListInDtoDto
    {
        public Guid VisitTaskId { get; set; }
    }

    public class ChangePlottingScaleChangeAnswerInDto
    {
        /// <summary>
        /// 标记id
        /// </summary>
        public Guid NoneDicomFileId { get; set; }

        /// <summary>
        /// 是否移除比例关系
        /// </summary>
        public bool IsRemovePlottingScale { get; set; } = false;


        public Guid VisitTaskId { get; set; }

        public string Path { get; set; }

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

        public List<PlottingAnswerInfo> AnswerList { get; set; }
    }

    public class PlottingAnswerInfo
    {
        public Guid? QuestionId { get; set; }
        public Guid? RowId { get; set; }

        public Guid? TableQuestionId { get; set; }

        public string Answer { get; set; }
    }


    public class GetNoneDicomMarkAndBindingInDto
    {
        public Guid VisitTaskId { get; set; }
    }

    public class GetNoneDicomMarkAndBindingOutDto
    {
        public List<AddNoneDicomMarkInDto> NoneDicomMarkList { get; set; }
        public List<BindingData> BindingList { get; set; }
    }

    public class BindingData:BindingInfo
    {
        public Guid NoneDicomMarkId { get; set; }

        public Guid? MarkId { get; set; }

        public Guid VisitTaskId { get; set; }
    }

    public class AddNoneDicomMarkInDto 
    {
        public Guid? Id { get; set; }

        public Guid VisitTaskId { get; set; }

        public Guid? StudyId { get; set; }

        public string MarkTool { get; set; }


        public string OrderMarkName { get; set; }

        ///// <summary>
        ///// 比例
        ///// </summary>
        //public decimal? Proportion { get; set; }

        public Guid? MarkId { get; set; }
        public Guid? NoneDicomFileId { get; set; }

        public string Path { get; set; }

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

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

    }

    public class DeleteBindingInDto
    {
        public Guid BindingIdId { get; set; }
      
    }

    public class AddNoneDicomMarkAndBinding
    {
        public Guid VisitTaskId { get; set; }
        public Guid? StudyId { get; set; }

        public string MarkTool { get; set; }

        public string OrderMarkName { get; set; }

        public Guid? MarkId { get; set; }
        public Guid? NoneDicomFileId { get; set; }

        public string Path { get; set; }

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

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

        public Guid QuestionId { get; set; }
        public Guid? RowId { get; set; }

        public Guid? TableQuestionId { get; set; }

        public string Answer { get; set; }
    }

    public class BindingInfo
    {
        public Guid? QuestionId { get; set; }
        public Guid? RowId { get; set; }

        public Guid? TableQuestionId { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public class SubmitVisitTaskQuestionsInDto
    {
        [NotDefault]
        public Guid TrialId { get; set; }
        [NotDefault]
        public Guid VisitTaskId { get; set; }
        [NotDefault]
        public Guid ReadingQuestionCriterionTrialId { get; set; }

        public List<QuestionAnswer> AnswerList { get; set; } = new List<QuestionAnswer>();


    }

    public class SaveJudgeTaskDto
    {
        public List<Guid> VisitTaskIds { get; set; }
    }

    public class QuestionAnswer
    {
        public Guid ReadingQuestionTrialId { get; set; }

        public string Answer { get; set; }
    }


    //public class GetTrialReadingQuestionDto
    //{
    //    public Guid Id { get; set; }

    //    public string GroupName { get; set; }

    //    List<GetTrialReadingQuestionOutDto> Questions { get; set; }
    //}

    public class GroupTaskAnswerDto
    {
        public Guid QuestionId { get; set; }

        /// <summary>
        /// 裁判百分比或绝对值的相差值
        /// </summary>
        public decimal? JudgeDifferenceValue { get; set; }

        /// <summary>
        /// 裁判百分比或绝对值的相差值匹配规则
        /// </summary>
        public JudgeDifferenceType JudgeDifferenceType { get; set; }
        public string AnswerGroup { get; set; }


        public string AnswerCombination { get; set; }

        public JudgeTypeEnum JudgeType { get; set; }

        public List<string> TaskAnswerList { get; set; }
    }

    public class TaskGroupAnswer
    {
        public string Answer { get; set; }
    }

    public class AnswerGroup
    {
        public Guid GroupId { get; set; }

        public string GroupValue { get; set; }
    }


 

    public class TaskAnswerDto
    {
        public Guid VisitTaskId { get; set; }

        public Guid QuestionId { get; set; }

        public decimal VisitTaskNum { get; set; }
        public string Answer { get; set; }

        public string AnswerGroup { get; set; }

        public string AnswerCombination { get; set; }

        public JudgeTypeEnum JudgeType { get; set; }

        /// <summary>
        /// 裁判百分比或绝对值的相差值
        /// </summary>
        public decimal? JudgeDifferenceValue { get; set; }

        /// <summary>
        /// 裁判百分比或绝对值的相差值匹配规则
        /// </summary>
        public JudgeDifferenceType JudgeDifferenceType { get; set; }
    }


    public class GetSystemReadingQuestionPageDto
    {
        public List<GetSystemReadingQuestionOutDto> SinglePage { get; set; }

        public List<GetSystemReadingQuestionOutDto> MultiPage { get; set; }

        public List<GetSystemReadingQuestionOutDto> PublicPage { get; set; }
    }

    public class GetTrialReadingQuestionPageDto
    {
        public List<GetTrialReadingQuestionOutDto> SinglePage { get; set; }

        public List<GetTrialReadingQuestionOutDto> MultiPage { get; set; }

        public List<GetTrialReadingQuestionOutDto> PublicPage { get; set; }
    }

    public class TableQuestionDataInfo
    {
        /// <summary>
        /// 
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 问题ID
        /// </summary>
		public Guid ReadingQuestionId { get; set; }

        /// <summary>
        /// 字典code
        /// </summary>
        public string DictionaryCode { get; set; } = string.Empty;


        /// <summary>
		/// 问题类型
		/// </summary>
		public TableQuestionType? QuestionGenre { get; set; }

        /// <summary>
        /// Type
        /// </summary>
        public string Type { get; set; }

        public ValueUnit? Unit { get; set; }

        /// <summary>
        /// ParentId
        /// </summary>
        public Guid? ParentId { get; set; }

        /// <summary>
        ///父问题触发值
        /// </summary>
        public string ParentTriggerValue { get; set; }

        /// <summary>
        /// 问题名称
        /// </summary>
        public string QuestionName { get; set; }

        /// <summary>
        /// IsRequired
        /// </summary>
        public IsRequired IsRequired { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        public int ShowOrder { get; set; }

        /// <summary>
        /// 值
        /// </summary>
        public string TypeValue { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnable { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 创建用户
        /// </summary>
        public Guid CreateUserId { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 显示父问题
        /// </summary>
        public Guid? RelevanceId { get; set; }

        /// <summary>
        /// 显示父问题的值
        /// </summary>
        public string RelevanceValue { get; set; }

        /// <summary>
        /// 是否显示
        /// </summary>
        public ShowQuestion ShowQuestion { get; set; }

        /// <summary>
        /// 最大问题数
        /// </summary>
        public int? MaxRowCount { get; set; }

        /// <summary>
        /// 数据表名称
        /// </summary>
        public string DataTableName { get; set; }

        /// <summary>
        /// 数据列
        /// </summary>
        public string DataTableColumn { get; set; }


        /// <summary>
        /// 关联父问题
        /// </summary>
        public Guid? DependParentId { get; set; }

        /// <summary>
        /// 是否关联
        /// </summary>
        public IsDepend IsDepend { get; set; }

        /// <summary>
        /// 表格问题类型
        /// </summary>
        public TableQuestionType? TableQuestionType { get; set; }


        /// <summary>
        /// 问题标识
        /// </summary>
        public QuestionMark? QuestionMark { get; set; }



        [Comment("复制病灶的时候 是否复制这个问题")]
        public bool IsCopy { get; set; } = false;

        [Comment("分类问题表格Id")]
        public Guid? ClassifyTableQuestionId { get; set; }

        [Comment("分类算法")]
        public string ClassifyAlgorithms { get; set; } = string.Empty;
    }


    public class GetSystemReadingQuestionOutDto
    {

        public Guid Id { get; set; }

        /// <summary>
        /// 分组ID
        /// </summary>
        public Guid? GroupId { get; set; }

        /// <summary>
        /// 系统标准Id
        /// </summary>
        public Guid ReadingQuestionCriterionSystemId { get; set; }

        public ValueUnit? Unit { get; set; }

        /// <summary>
		/// 问题类型
		/// </summary>
		public TableQuestionType? QuestionGenre { get; set; }

        /// <summary>
        /// 字典code
        /// </summary>
        public string DictionaryCode { get; set; }

        /// <summary>
        /// 默认值
        /// </summary>
        public string DefaultValue { get; set; } = string.Empty;


        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 父问题触发
        /// </summary>
        public string ParentTriggerValue { get; set; }

        /// <summary>
        /// 问题名称
        /// </summary>
        public string QuestionName { get; set; }

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

        /// <summary>
        /// 排序
        /// </summary>
        public int ShowOrder { get; set; }

        /// <summary>
        /// 父问题ID
        /// </summary>
        public Guid? ParentId { get; set; }

        /// <summary>
        /// 数据列
        /// </summary>
        public string DataTableColumn { get; set; } = string.Empty;

        /// <summary>
        /// 类型值
        /// </summary>
        public string TypeValue { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnable { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 是否是裁判问题
        /// </summary>
        public bool IsJudgeQuestion { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

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

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

        /// <summary>
        /// 分组
        /// </summary>
        public string GroupName { get; set; }

        /// <summary>
        /// 图片数量
        /// </summary>
        public int ImageCount { get; set; } = 1;

        /// <summary>
        /// 是否显示
        /// </summary>
        public ShowQuestion ShowQuestion { get; set; }

        /// <summary>
        /// 最大问题数
        /// </summary>
        public int? MaxQuestionCount { get; set; }

        /// <summary>
        /// 病灶类型
        /// </summary>
        public LesionType? LesionType { get; set; }

        /// <summary>
        /// 问题类型
        /// </summary>
        public QuestionType? QuestionType { get; set; }

        /// <summary>
        /// 是否显示在Dicom阅片中
        /// </summary>
        public bool IsShowInDicom { get; set; }




        /// <summary>
        /// 序号标记
        /// </summary>
        public string OrderMark { get; set; } = string.Empty;


        /// <summary>
        /// 关联父问题
        /// </summary>
        public Guid? DependParentId { get; set; }

        /// <summary>
        /// 是否关联
        /// </summary>
        public IsDepend? IsDepend { get; set; }

        /// <summary>
        /// 表格问题类型
        /// </summary>
        public TableQuestionType? TableQuestionType { get; set; }


        /// <summary>
        /// 问题标识
        /// </summary>
        public QuestionMark? QuestionMark { get; set; }

        public List<GetSystemReadingQuestionOutDto> RelationQuestions { get; set; }



        //public List<TableQuestionDataInfo> TableQuestions { get; set; }

        public List<GetSystemReadingQuestionOutDto> Childrens { get; set; }

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

                    return new List<string>();
                }
            }

        }

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

                    return new List<string>();
                }
            }

        }

        [Comment("导出结果")]
        public string ExportResultStr { get; set; } = "[]";

        [Comment("分类算法")]
        public string ClassifyAlgorithms { get; set; } = string.Empty;

        [Comment("分类问题Id")]
        public Guid? ClassifyQuestionId { get; set; }

        [NotMapped]
        public List<ExportResult> ExportResult
        {
            get
            {
                try
                {
                    var result = JsonConvert.DeserializeObject<List<ExportResult>>(this.ExportResultStr);
                    return result == null ? new List<ExportResult>() : result;
                }
                catch (Exception)
                {

                    return new List<ExportResult>();
                }

            }
        }



        [Comment("复制病灶的时候 是否复制这个问题")]
        public bool IsCopy { get; set; } = false;

        [Comment("分类问题表格Id")]
        public Guid? ClassifyTableQuestionId { get; set; }

    }

    public class GetTrialReadingQuestionOutDto
    {



        /// <summary>
        /// 字典code
        /// </summary>
        public string DictionaryCode { get; set; }


        /// <summary>
		/// 问题类型
		/// </summary>
		public TableQuestionType? QuestionGenre { get; set; }

        /// <summary>
        /// 项目标准Id
        /// </summary>
        public Guid ReadingQuestionCriterionTrialId { get; set; }

        /// <summary>
        /// 项目Id
        /// </summary>
        public Guid TrialId { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 父问题触发
        /// </summary>
        public string ParentTriggerValue { get; set; }

        public string GroupName { get; set; }

        /// <summary>
        /// 问题名称
        /// </summary>
        public string QuestionName { get; set; }

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

        /// <summary>
        /// 排序
        /// </summary>
        public int ShowOrder { get; set; }


        public int? PageShowOrder { get; set; }

        /// <summary>
        /// 父问题ID
        /// </summary>
        public Guid? ParentId { get; set; }


        /// <summary>
        /// 类型值
        /// </summary>
        public string TypeValue { get; set; }

        /// <summary>
        /// 答案
        /// </summary>
        public string Answer { get; set; }

        /// <summary>
        /// 分页名称
        /// </summary>
		public string? PageName { get; set; }


        public bool? IsPublicPage { get; set; }

        public bool IsPage { get; set; } = false;

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

        /// <summary>
		/// 标准分页Id
		/// </summary>
		public Guid? ReadingCriterionPageId { get; set; }

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

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

        /// <summary>
		/// 图片数量
		/// </summary>
		public int ImageCount { get; set; }


        /// <summary>
        /// 是否显示
        /// </summary>
        public ShowQuestion ShowQuestion { get; set; }

        /// <summary>
        /// 最大问题数
        /// </summary>
        public int? MaxQuestionCount { get; set; }

        /// <summary>
        /// 病灶类型
        /// </summary>
        public LesionType? LesionType { get; set; }

        /// <summary>
        /// 问题类型
        /// </summary>
        public QuestionType? QuestionType { get; set; }

        /// <summary>
        /// 是否显示在Dicom阅片中
        /// </summary>
        public bool IsShowInDicom { get; set; } = false;

        //public List<TableQuestionDataInfo> TableQuestions { get; set; }


        public List<GetTrialReadingQuestionOutDto> RelationQuestions { get; set; }


        public List<GetTrialReadingQuestionOutDto> Childrens { get; set; }


        public Guid Id { get; set; }


        public Guid? GroupId { get; set; }


        /// <summary>
        /// 数据列
        /// </summary>
        public string DataTableColumn { get; set; } = string.Empty;



        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnable { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 是否是裁判问题
        /// </summary>
        public bool IsJudgeQuestion { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }


        /// <summary>
        /// 序号标记
        /// </summary>
        public string OrderMark { get; set; } = string.Empty;


        /// <summary>
        /// 关联父问题
        /// </summary>
        public Guid? DependParentId { get; set; }

        /// <summary>
        /// 是否关联
        /// </summary>
        public IsDepend? IsDepend { get; set; }

        /// <summary>
        /// 表格问题类型
        /// </summary>
        public TableQuestionType? TableQuestionType { get; set; }


        /// <summary>
        /// 问题标识
        /// </summary>
        public QuestionMark? QuestionMark { get; set; }




        /// <summary>
        /// 数值类型
        /// </summary>
        public ValueOfType? ValueType { get; set; }

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





        [Comment("复制病灶的时候 是否复制这个问题")]
        public bool IsCopy { get; set; } = false;

        [Comment("分类问题表格Id")]
        public Guid? ClassifyTableQuestionId { get; set; }

        [Comment("分类算法")]
        public string ClassifyAlgorithms { get; set; } = string.Empty;


    }

    ///// <summary>
    ///// 表格问题
    ///// </summary>
    //public class GetTrialReadingTableQuestion
    //{
    //    public List<> class TrialReadingTableQuestion
    //}


    //public class TrialReadingTableQuestion
    //{

    //}
}
