177 lines
5.2 KiB
C#
177 lines
5.2 KiB
C#
using IRaCIS.Core.Domain.Share;
|
|
using MediatR;
|
|
using MiniExcelLibs.Attributes;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
|
|
namespace IRaCIS.Core.Application.MediatR.CommandAndQueries
|
|
{
|
|
public class ConsistencyVerificationRequest : IRequest<string>
|
|
{
|
|
public List<CheckViewModel> ETCList { get; set; } = new List<CheckViewModel>();
|
|
|
|
public Guid TrialId { get; set; }
|
|
}
|
|
|
|
public class CheckDBModel : CheckViewModel
|
|
{
|
|
|
|
public Guid SubjectVisitId { get; set; }
|
|
|
|
public Guid StudyId { get; set; }
|
|
}
|
|
|
|
|
|
|
|
//public class ImportResultFilteTest : IImportResultFilter
|
|
//{
|
|
|
|
|
|
// public ImportResult<T> Filter<T>(ImportResult<T> importResult) where T : class, new()
|
|
// {
|
|
// if (typeof(T).IsAssignableFrom(typeof(CheckViewModel)))
|
|
// {
|
|
// var data = (List<CheckViewModel>)importResult.Data;
|
|
|
|
// var dt = DateTime.Now ;
|
|
|
|
// foreach (var item in data)
|
|
// {
|
|
|
|
// var index= data.IndexOf(item);
|
|
// if ( DateTime.TryParse(item.StudyDate, out dt) == false)
|
|
// {
|
|
|
|
// importResult.RowErrors.Add(new DataRowErrorInfo() { RowIndex = index, FieldErrors = new Dictionary<string, string> { { StaticData.International("ConsistencyVerification_Tech") , StaticData.International("ConsistencyVerification_Time") } } });
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// return importResult;
|
|
// }
|
|
//}
|
|
|
|
|
|
public class ParamInfoDto
|
|
{
|
|
public string Modality { get; set; }
|
|
|
|
public string StudyDate { get; set; }
|
|
|
|
//public int ErrorType { get; set; }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
//[ExcelImporter(/*ImportResultFilter = typeof(ImportResultFilteTest),*/ IsLabelingError = true)]
|
|
|
|
public class CheckViewModel
|
|
{
|
|
//[Required(ErrorMessage = "中心编号不能为空")]
|
|
//[ImporterHeader(Name = "Site ID", AutoTrim = true)]
|
|
[ExcelColumnName("Site ID")]
|
|
public string SiteCode { get; set; } = string.Empty;
|
|
|
|
|
|
//[Required(ErrorMessage = "受试者筛选号不能为空")]
|
|
//[ImporterHeader(Name = "Subject ID", AutoTrim = true)]
|
|
[ExcelColumnName("Subject ID")]
|
|
public string SubjectCode { get; set; } = string.Empty;
|
|
|
|
//[Required(ErrorMessage = "访视名称不能为空")]
|
|
//[ImporterHeader(Name = "Visit Name", AutoTrim = true)]
|
|
[ExcelColumnName("Visit Name")]
|
|
public string VisitName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
//[Required(ErrorMessage = "检查日期不能为空")]
|
|
[CanConvertToTime(ErrorMessage = "Does not conform to Study Date format")]
|
|
|
|
//[ImporterHeader(Name = "Study Date", AutoTrim = true)]
|
|
[ExcelColumnName("Study Date")]
|
|
public string StudyDate { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
//[Required(ErrorMessage = "Modality不能为空")]
|
|
//[ImporterHeader(Name = "Modality", AutoTrim = true)]
|
|
[ExcelColumnName("Modality")]
|
|
public string Modality { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object? obj)
|
|
{
|
|
if (obj == null) return false;
|
|
|
|
var checkModel = obj as CheckViewModel;
|
|
|
|
if (checkModel is not null)
|
|
{
|
|
return SiteCode == checkModel.SiteCode && SubjectCode == checkModel.SubjectCode && VisitName == checkModel.VisitName && StudyDate == checkModel.StudyDate && Modality == checkModel.Modality;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
public override int GetHashCode()
|
|
{
|
|
return (SiteCode + SubjectCode + VisitName + StudyDate + Modality).GetHashCode();
|
|
}
|
|
}
|
|
|
|
public class VisitPlanInfluenceSubjectVisitDTO
|
|
{
|
|
[ExcelColumn(Ignore = true)]
|
|
public Guid StudyId { get; set; }
|
|
|
|
[ExcelColumn(Ignore = true)]
|
|
public Guid TrialId { get; set; }
|
|
|
|
[ExcelColumn(Ignore = true)]
|
|
public Guid SubjectVisitId { get; set; }
|
|
|
|
[ExcelColumnName("中心编号")]
|
|
public string TrialSiteCode { get; set; } = string.Empty;
|
|
|
|
[ExcelColumnName("受试者")]
|
|
public string SubjectCode { get; set; } = string.Empty;
|
|
|
|
[ExcelColumnName("访视名称")]
|
|
public string VisitName { get; set; } = string.Empty;
|
|
|
|
[ExcelColumn(Name = "检查时间", Format = "yyyy-MM-dd HH:mm:ss")]
|
|
public DateTime StudyTime { get; set; }
|
|
|
|
[ExcelColumnName("检查技术")]
|
|
public string Modality { get; set; } = string.Empty;
|
|
|
|
[ExcelColumn(Ignore = true)]
|
|
public bool IsDicomStudy { get; set; }
|
|
|
|
|
|
[ExcelColumnName("影像类型")]
|
|
public string ImageType => IsDicomStudy ? "Dicom" : "非Dicom";
|
|
|
|
[ExcelColumnName("历史窗口")]
|
|
public string HistoryWindow { get; set; } = string.Empty;
|
|
|
|
|
|
[ExcelColumnName("之前超窗调整后没超窗")]
|
|
|
|
public bool IsOverWindowNowNotOverWindow { get; set; }
|
|
|
|
[ExcelColumnName("目前窗口")]
|
|
public string NowWindow { get; set; } = string.Empty;
|
|
|
|
[ExcelColumn(Ignore =true)]
|
|
public DateTime CreateTime { get; set; }
|
|
}
|
|
|
|
}
|