using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Hosting;
using MiniExcelLibs.Attributes;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
namespace IRaCIS.Application.Contracts
{
public class UserTrialDTO : UserTrialCommand
{
[JsonIgnore]
public string State => IsDeleted ? "退出" : "加入";
[DictionaryTranslateAttribute("IsUserExitTrial")]
public bool IsDeleted { get; set; }
[ExcelFormat("yyyy-MM-dd HH:mm:ss")]
public DateTime? DeletedTime { get; set; }
public Guid? TrialSiteId { get; set; }
public string Phone { get; set; } = String.Empty;
public DateTime UpdateTime { get; set; }
[ExcelFormat("yyyy-MM-dd HH:mm:ss")]
public DateTime CreateTime { get; set; }
public string UserType { get; set; } = String.Empty;
public string UserRealName { get; set; } = String.Empty;
public string OrganizationName { get; set; } = String.Empty;
public string UserName { get; set; } = String.Empty;
public string EMail { get; set; } = string.Empty;
}
public class TrialUserSelct : UserTrialCommand
{
public string Phone { get; set; } = String.Empty;
public string Email { get; set; } = string.Empty;
public string RealName { get; set; } = String.Empty;
public string UserName { get; set; } = String.Empty;
}
public class TrialUserBasicInfo
{
public Guid UserTypeId { get; set; }
public string UserName { get; set; }
public string FullName { get; set; }
public Guid UserId { get; set; }
}
public class TrialMaintenanceDTO : UserTrialCommand
{
//[JsonIgnore]
//public int No { get; set; }
//For MiniExcel ExcelFormat
public string State => IsDeleted ? "退出" : "加入";
//[ValueMapping(text: "退出", true)]
//[ValueMapping(text: "加入", false)]
[DictionaryTranslateAttribute("IsUserExitTrial")]
public bool IsDeleted { get; set; }
//[ExporterHeader(Format = "yyyy-mm-DD hh:mm:ss")]
[ExcelFormat("yyyy-MM-dd hh:mm:ss")]
public DateTime? DeletedTime { get; set; }
//[ExporterHeader(Format = "yyyy-mm-DD")]
[ExcelFormat("yyyy-MM-dd")]
public DateTime? RemoveTime { get; set; }
//[ExporterHeader(Format = "yyyy-mm-DD")]
[ExcelFormat("yyyy-MM-dd")]
public DateTime? JoinTime { get; set; }
//[ExporterHeader(Format = "yyyy-mm-DD hh:mm:ss")]
[ExcelFormat("yyyy-MM-dd HH:mm:ss")]
public DateTime CreateTime { get; set; }
public string Phone { get; set; } = String.Empty;
public string EMail { get; set; } = string.Empty;
public DateTime UpdateTime { get; set; } = DateTime.Now;
public Guid UserTypeId { get; set; }
public string UserType { get; set; } = String.Empty;
public UserTypeEnum UserTypeEnum { get; set; }
public string OrganizationName { get; set; } = String.Empty;
public string UserRealName { get; set; } = String.Empty;
public string UserName { get; set; } = String.Empty;
}
public class TrialCRCUploadImageList_Export : ExcelExportInfo
{
}
///
/// 导出文件
///
public class ExportTemplateAsyncDto
{
///
/// 模板Code
///
public string TemplateCode { get; set; }
///
/// 导出的文件名
///
public string ExportFileName { get; set; }
///
/// 数据
///
public object Data { get; set; }
}
public class ExportTemplateServiceDto : ExportTemplateAsyncDto
{
public IRepository commonDocumentRepository { get; set; }
public IWebHostEnvironment hostEnvironment { get; set; }
public bool IsEnglish { get; set; }
}
public class VisitJudgeExportInfo: ExcelExportInfo
{
public int VisitCount { get; set; }
public int JudgeVisitCount { get; set; }
public string JudgeRatioStr => VisitCount == 0 ? $"NA" : $"{Math.Round((decimal)JudgeVisitCount * 100 / VisitCount, 2)}%";
}
public class ReadingPeriodJudgeExportInfo : ExcelExportInfo
{
public int SubjectCount { get; set; }
public int judgeSubjectCount { get; set; }
public string SubjectJudgeRatioStr => SubjectCount == 0 ? $"NA" : $"{Math.Round((decimal)judgeSubjectCount * 100 / SubjectCount, 2)}%";
public int ReadingPeriodCount { get; set; }
public int judgeReadingPeriodCount { get; set; }
public string ReadingPeriodJudgeRatioStr => ReadingPeriodCount == 0 ? $"NA" : $"{Math.Round((decimal)judgeReadingPeriodCount * 100 / ReadingPeriodCount, 2)}%";
public List DoctorPeriodStatList { get; set; }
public List DoctorSubjectStatList { get; set; }
}
public class ExcelExportInfo : TrialSelectDTO
{
public string CurrentTime { get; set; }
public object List { get; set; }
}
public class TrialUserExportDTO : ExcelExportInfo
{
public List TrialUserList { get; set; } = new List();
}
public class TrialSiteUserExportDto : ExcelExportInfo
{
public List TrialSiteUserList { get; set; } = new List();
}
public class SiteUserExportDTO : UserTrialDTO
{
public string TrialSiteCode { get; set; } = String.Empty;
public string TrialSiteAliasName { get; set; } = String.Empty;
}
public class TrialSiteUserSummaryExportDto : ExcelExportInfo
{
public List TrialSiteUserList { get; set; } = new List();
}
public class TrialSiteUserSummaryDto : TrialSiteUserSurveyView
{
public string TrialSiteCode { get; set; } = String.Empty;
public string TrialSiteAliasName { get; set; } = String.Empty;
public string UserRealName => LastName + " / " + FirstName;
//public string IsGenerateAccountStr => IsGenerateAccount ? "是" : "否";
//public string StateStr => State.GetDescription();
}
public class SiteCRCCommand : UserTrialCommand
{
public Guid TrialSiteId { get; set; }
public Guid UserTypeId { get; set; }
public string UserType { get; set; } = String.Empty;
public string UserRealName { get; set; } = String.Empty;
public UserTypeEnum UserTypeEnum { get; set; }
public string OrganizationName { get; set; } = String.Empty;
public string UserName { get; set; } = String.Empty;
}
public class UserTrialCommand
{
public Guid? Id { get; set; }
public Guid UserId { get; set; }
public Guid TrialId { get; set; }
}
public class SiteStatDTO : SiteStatSimpleDTO
{
//public int? VisitCount { get; set; }
//public int? SubjectCount { get; set; }
}
public class SiteStatSimpleDTO
{
public Guid Id { get; set; }
public Guid TrialSiteId { get; set; }
public int? UserCount { get; set; }
public string TrialSiteCode { get; set; } = String.Empty;
public string TrialSiteName { get; set; } = String.Empty;
public string TrialSiteAliasName { get; set; } = String.Empty;
public bool IsDeleted { get; set; }
public DateTime? DeletedTime { get; set; }
public DateTime? EnabledTime { get; set; }
public DateTime UpdateTime { get; set; }
public DateTime CreateTime { get; set; }
//public string Site { get; set; } = String.Empty;
//public string SiteCode { get; set; } = String.Empty;
//public string Hospital { get; set; } = String.Empty;
//public string City { get; set; } = String.Empty;
//public string Country { get; set; } = String.Empty;
//public string DirectorName { get; set; } = String.Empty;
//public string DirectorPhone { get; set; } = String.Empty;
//public string ContactName { get; set; } = String.Empty;
//public string ContactPhone { get; set; } = String.Empty;
//public string Address { get; set; } = String.Empty;
public List CallingAEList { get; set; }
public List UserNameList { get; set; } = new List();
public int? VisitCount { get; set; }
public int? SubjectCount { get; set; }
}
public class TrialMaintenanceExportQuery
{
public Guid TrialId { get; set; } = Guid.Empty;
public string UserRealName { get; set; } = string.Empty;
public Guid? UserTypeId { get; set; }
public string UserName { get; set; } = string.Empty;
public string OrganizationName { get; set; } = String.Empty;
public bool? IsDeleted { get; set; }
}
public class TrialMaintenanceQuery : PageInput
{
public Guid TrialId { get; set; } = Guid.Empty;
public string UserRealName { get; set; } = string.Empty;
public Guid? UserTypeId { get; set; }
public string UserName { get; set; } = string.Empty;
public string OrganizationName { get; set; } = String.Empty;
public bool? IsDeleted { get; set; }
}
public class SiteCRCQuery : TrialMaintenanceQuery
{
[NotDefault]
public Guid TrialSiteId { get; set; }
}
public class TrialUserQuery : PageInput
{
public Guid TrialId { get; set; }
public string UserName { get; set; } = string.Empty;
public string UserRealName { get; set; } = string.Empty;
public string OrganizationName { get; set; } = String.Empty;
public UserTypeEnum? UserTypeEnum { get; set; }
public string? EMail { get; set; }
}
public class TrialUserScreeningDTO : TrialUserAddCommand
{
public int? Sex { get; set; } // 1-男 2-女
public string Phone { get; set; } = string.Empty;
public string EMail { get; set; } = string.Empty;
public string DepartmentName { get; set; } = String.Empty;
public string PositionName { get; set; } = String.Empty;
public string UserName { get; set; } = String.Empty;
public bool IsSelect { get; set; }
public Guid UserTypeId { get; set; }
public string UserType { get; set; } = string.Empty;
public UserTypeEnum UserTypeEnum { get; set; }
public string OrganizationName { get; set; } = string.Empty;
public string UserRealName { get; set; } = string.Empty;
}
public class TrialUserAddCommand
{
public Guid UserId { get; set; }
public Guid TrialId { get; set; }
}
public class UpdateTrialUserCommand
{
[NotDefault]
public Guid Id { get; set; }
public Guid TrialId { get; set; }
public bool IsDeleted { get; set; }
public DateTime? RemoveTime { get; set; }
public DateTime? JoinTime { get; set; }
}
}