using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Domain.Share;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IRaCIS.Core.Application.Service.Reading.Dto
{

    public class AddOrUpdateReadingClinicalDataDto
    {

		public Guid? Id { get; set; }

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

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

		/// <summary>
		/// 阅片ID
		/// </summary>
		public Guid ReadingId { get; set; }

		/// <summary>
		/// 临床数据类型Id
		/// </summary>
		public Guid ClinicalDataTrialSetId { get; set; }

		/// <summary>
		/// 是否是访视
		/// </summary>
		public bool IsVisit { get; set; }


		///// <summary>
		///// 是否盲化
		///// </summary>
		//public bool IsBlind { get; set; }

		///// <summary>
		///// 是否完整
		///// </summary>
		//public bool IsComplete { get; set; }

		/// <summary>
		/// 要删除的对象
		/// </summary>

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


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

	public class GetCRCClinicalDataOutDto
	{

		public Guid Id { get; set; }

		/// <summary>
		/// 名称
		/// </summary>
		public Guid ClinicalDataTrialSetId { get; set; }

		/// <summary>
		/// 名称
		/// </summary>
		public string ClinicalDataSetName { get; set; }


		/// <summary>
		/// 上传方式
		/// </summary>
		public ClinicalUploadType ClinicalUploadType { get; set; }


		/// <summary>
		/// 上传角色
		/// </summary>
		public UploadRole UploadRole { get; set; }

		/// <summary>
		/// 模板文件名称
		/// </summary>
		public string FileName { get; set; }

		/// <summary>
		/// 文件路径
		/// </summary>
		public string Path { get; set; }

		//public List<GetReadingClinicalDataListOutDto> ReadingClinicalDataList { get; set; }

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

		public ClinicalDataTable ClinicalTableData { get; set; }
	}


	public class ClinicalDataTable
	{
		public List<PreviousHistoryView> PreviousHistoryList { get; set; }

		public List<PreviousOtherView> PreviousOtherList { get; set; }

		public List<PreviousSurgeryView> PreviousSurgeryList{ get; set; }

		
	}



	public class GetCRCClinicalDataInDto
	{
		[NotDefault]
        public Guid SubjectVisitId { get; set; }

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

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

	/// <summary>
	/// 是否盲化
	/// </summary>
	public class SetReadingClinicalDataIsBlind
	{
		public Guid Id { get; set; }

		public bool IsBlind { get; set; }
	}

	public class FileDto
	{
		/// <summary>
		/// 文件名称
		/// </summary>
        public string FileName { get; set; }

		/// <summary>
		/// 路径
		/// </summary>
		public string Path { get; set; }
	}

	/// <summary>
	/// 获取访视列表
	/// </summary>
	public class GetReadingClinicalDataListIndto :PageInput
	{
		[Required(ErrorMessage = "SubjectId为null")]
		public Guid SubjectId { get; set; }

		[Required(ErrorMessage = "ReadingId为null")]
		public Guid ReadingId { get; set; }

		public UploadRole? UploadRole { get; set; }
		
		public Guid TrialId { get; set; }

		/// <summary>
		/// 是否是访视
		/// </summary>
		public bool IsVisit { get; set; }

		/// <summary>
		/// 是否是基线
		/// </summary>
		public bool IsBaseLine { get; set; }
	}

	public class GetReadingClinicalDataPDFListIndto:PageInput
	{
		public Guid ReadingClinicalDataId { get; set; }
	}

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

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

		/// <summary>
		/// 对象ID
		/// </summary>
		public Guid ReadingId { get; set; }

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

		/// <summary>
		/// 阅片临床数据ID
		/// </summary>
		public Guid ReadingClinicalDataId { get; set; }

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

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

		/// <summary>
		/// 是否为访视
		/// </summary>
		public bool IsVisit { get; set; }


	}

	public class AddOrUpdateReadingClinicalDataPDFDto
	{

		public Guid? Id { get; set; }

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

		/// <summary>
		/// 对象ID
		/// </summary>
		public Guid ReadingId { get; set; }

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

		/// <summary>
		/// 阅片临床数据ID
		/// </summary>
		public Guid ReadingClinicalDataId { get; set; }

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

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

		/// <summary>
		/// 是否为访视
		/// </summary>
		public bool IsVisit { get; set; }

		/// <summary>
		/// 临床级别
		/// </summary>
		public ClinicalLevel ClinicalDataLevel { get; set; }
	}



	public class GetReadingClinicalDataListOutDto
	{

		public Guid Id { get; set; }


		/// <summary>
		/// 项目配置临床类型Name
		/// </summary>
		public string ClinicalDataSetName { get; set; }

		/// <summary>
		/// 下拉ID
		/// </summary>
		public Guid ClinicalDataTrialSetId { get; set; }

		/// <summary>
		/// 临床级别
		/// </summary>
		public ClinicalLevel ClinicalDataLevel { get; set; }

		/// <summary>
		/// 上传角色
		/// </summary>
		public UploadRole UploadRole { get; set; }

		public Guid SubjectId { get; set; }

		/// <summary>
		/// 上传方式
		/// </summary>
		public ClinicalUploadType ClinicalUploadType { get; set; }

		/// <summary>
		/// 临床级别名称
		/// </summary>
		public string ClinicalDataLevelName { get; set; }

		/// <summary>
		/// 上传方式名称
		/// </summary>
		public string ClinicalUploadTypeName { get; set; }

		/// <summary>
		/// 是否为CRC上传
		/// </summary>
		public bool IsCRCUpload { get; set; }


		/// <summary>
		/// 是否签名
		/// </summary>
		public bool  IsSign { get; set; }

		/// <summary>
		/// 文件数量
		/// </summary>
		public int FileCount
		{ 
			get 
			{
				return this.FileList.Count();
			} 
		} 

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


		public ClinicalDataTable ClinicalTableData { get; set; }
	}


	public class GetFileDto
	{

		/// <summary>
		/// Id
		/// </summary>

		public Guid Id { get; set; }

		/// <summary>
		/// Path
		/// </summary>

		public string Path { get; set; }

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

		/// <summary>
		/// 上传时间
		/// </summary>
		public DateTime CreateTime { get; set; }
	}


	public class GetTrialClinicalDataSelectIndto
	{
		/// <summary>
		/// 项目ID
		/// </summary>
		[NotDefault]
		public Guid TrialId { get; set; }

		/// <summary>
		/// 阅片期临床数据ID
		/// </summary>
		public Guid? ReadingClinicalDataId { get; set; }

		/// <summary>
		/// 对象ID
		/// </summary>
		public Guid? ReadingId { get; set; }

		public Guid? SubjectId { get; set; }

		/// <summary>
		/// 是否是访视
		/// </summary>
		public bool IsVisit { get; set; }

		/// <summary>
		/// 是否是基线
		/// </summary>
		public bool IsBaseLine { get; set; }


		/// <summary>
		/// 上传角色
		/// </summary>
		public UploadRole? UploadRole { get; set; }
	}

	public class GetTrialClinicalDataSelectOutDto
	{

		public Guid Id { get; set; }

		/// <summary>
		/// 名称
		/// </summary>
		public string ClinicalDataSetName { get; set; }

		/// <summary>
		/// 临床级别
		/// </summary>
		public ClinicalLevel ClinicalDataLevel { get; set; }


		/// <summary>
		/// 上传方式
		/// </summary>
		public ClinicalUploadType ClinicalUploadType { get; set; }

		/// <summary>
		/// 临床级别名称
		/// </summary>
		public string ClinicalDataLevelName { get; set; }

		/// <summary>
		/// 上传方式名称
		/// </summary>
		public string ClinicalUploadTypeName { get; set; }


		/// <summary>
		/// 模板文件名称
		/// </summary>
		public string FileName { get; set; }

		/// <summary>
		/// 文件路径
		/// </summary>
		public string Path { get; set; }


	}

}
