//--------------------------------------------------------------------
//     此代码由T4模板自动生成  byzhouhang 20210918
//	   生成时间 2022-08-22 09:36:37 
//     对此文件的更改可能会导致不正确的行为，并且如果重新生成代码，这些更改将会丢失。
//--------------------------------------------------------------------
using System;
using IRaCIS.Core.Domain.Share;
using System.Collections.Generic;
namespace IRaCIS.Core.Application.Service.Reading.Dto
{

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

          
        public bool IsChangeOtherTask { get; set; }
    }

    public class TargetLesionCalculateDto
    {
        /// <summary>
        /// 最低SOD
        /// </summary>
        public decimal LowSod { get; set; }

        /// <summary>
        /// 当前SOD
        /// </summary>
        public decimal PresentSod { get; set; }

        /// <summary>
        /// 是否存在靶病灶 (当前检查批次 至少一个靶病灶的状态为存在)
        /// </summary>
        public bool ExistsTargetLesion { get; set; }

        /// <summary>
        /// 非淋巴结靶病灶长径之和  decimal
        /// </summary>
        public decimal SumOfDiameter { get; set; }

        /// <summary>
        /// SOD变化百分比
        /// </summary>
        public decimal SODPercent { get; set; }

        /// <summary>
        /// 所有淋巴结靶病灶的短径小于10mm
        /// </summary>
        public bool DiameterLessThan10 { get; set; }

        /// <summary>
        /// SOD 百分比与基线期SOD相比减小≥30%
        /// </summary>
        public bool SODPercentBigger30 { get; set; }

        /// <summary>
        /// SOD 百分比 与基线期SOD相比减小＜30%
        /// </summary>
        public bool SODPercentLess30 { get; set; }

        /// <summary>
        ///  SOD 百分比 整体检查批次期间SOD最低点SOD相比增加＜20%
        /// </summary>
        public bool LowSODPercentLess20 { get; set; }

        /// <summary>
        /// SOD 百分比  比整体检查批次期间最低点SOD增加≥20%
        /// </summary>
        public bool LowSODPercentBigger20 { get; set; }

        /// <summary>
        /// SOD 变化值 比整体检查批次期间最低点SOD绝对增加值＜5 mm
        /// </summary>
        public bool LowSODChangeLess5 { get; set; }

        /// <summary>
        /// 比整体检查批次期间最低点SOD绝对增加值≥5 mm
        /// </summary>
        public bool LowSODChangeBigger5 { get; set; }

        /// <summary>
        /// 被评估为NE的单个靶病灶   是否存在状态为不可评估的靶病灶
        /// </summary>
        public bool ExixtsNETargetLesion { get; set; }

        /// <summary>
        /// 上次检查批次点整体肿瘤评估
        /// </summary>
        public string LastTargetLesionEvaluate { get; set; }

        /// <summary>
        /// 当前检查批次点非淋巴结病灶至少一个非淋巴结靶病灶的长径>0
        /// </summary>
        public bool CurrentMajoreBigger0 { get; set; }

        /// <summary>
        /// 至少一个淋巴结靶病灶短径≥10 mm
        /// </summary>
        public bool CurrenShortBigger10 { get; set; }

        /// <summary>
        /// 淋巴结非靶病灶状态全部为消失
        /// </summary>
        public bool NonTargetStateIsLoss { get; set; }

        /// <summary>
        /// 该淋巴结靶病灶短径绝对增加值≥5 mm
        /// </summary>
        public bool IsAddFive { get; set; }

        /// <summary>
        /// 靶病灶短径增加值有5mm的Index
        /// </summary>
        public List<decimal> AddFiveIndexs { get; set; }

        /// <summary>
        /// 短径有10mm的Index
        /// </summary>
        public List<decimal> ShortBigger10Indexs { get; set; }
    }

    /// <summary>
    /// 阅片计算Dto
    /// </summary>
    public class ReadingCalculateDto
    {
        public Guid SubjectId { get; set; }

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

        public bool IsAnalysisCreate { get; set; }

        public bool? IsSelfAnalysis { get; set; }

        public bool IsBaseLine { get; set; }

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

        public string VisitName { get; set; }

        public string BlindName { get; set; }

        public decimal VisitTaskNum { get; set; }

        public Guid VisitTaskId { get; set; }

        public Guid BaseLineTaskId { get; set; }

        public Guid CriterionId { get; set; }

        public Guid TrialId { get; set; }

        public Guid? DoctorUserId { get; set; }

        public Guid SubjectVisitId { get; set; }

        public Arm ArmEnum { get; set; } 

        /// <summary>
        /// 是否修改其他任务
        /// </summary>
        public bool IsChangeOtherTask { get; set; } = false;

        /// <summary>
        /// 是否只改其他任务
        /// </summary>
        public bool IsOnlyChangeAllTask { get; set; } = false;

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

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


    }



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

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

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

        public ValueOfType? ValueType { get; set; }

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

        public QuestionType? QuestionType { get; set; }

        public List<TableRowInfo> TableRowInfoList = new List<TableRowInfo>();

    }


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

        public decimal FristAddTaskNum { get; set; }


        public string MeasureData { get; set; }

        public List<TableQuestionInfo> TableQuestionList { get; set; } = new List<TableQuestionInfo>();
    }

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

        public Guid AnswerId { get; set; }

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

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

        public Guid QuestionId { get; set; }

        public decimal RowIndex { get; set; }

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

        public QuestionType? QuestionType { get; set; }

    }



    public class VisitTaskAnswerInfo
    {
        public Guid VisitTaskId { get; set; }
        public Guid QuestionId { get; set; }

        public string VisitName { get; set; }

        public string BlindName { get; set; }

        public decimal SOD { get; set; }

        public decimal VisitTaskNum { get; set; }

        public decimal NewLesionsCount { get; set; }
    }

    public class ChangeAllTaskDto
    {
        public ReadingCalculateDto calculateDto { get; set; }

        public bool IsAnalysisCreate { get; set; }

        public Guid QuestionId { get; set; }
    }

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

        public Func<ReadingCalculateDto, Task<decimal>> GetDecimalFun { get; set; }

        public Func<ReadingCalculateDto, Task<int>> GetIntFun { get; set; }

        public Func<ReadingCalculateDto, Task<decimal?>> GetDecimalNullFun { get; set; }

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

        public Func<ChangeAllTaskDto,Task> ChangeAllTaskFun { get; set; }
    }
}


