修改稽查

Uat_Study
hang 2022-08-15 17:52:51 +08:00
parent 8187a0bc2a
commit 6c0317d93d
6 changed files with 223 additions and 122 deletions

View File

@ -536,6 +536,36 @@
父标识
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionOutDto.TrialName">
<summary>
项目名称
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionOutDto.SiteCode">
<summary>
中心Code
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionOutDto.ResearchProgramNo">
<summary>
项目编码
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionOutDto.SiteName">
<summary>
中心名称
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionOutDto.SubjectCode">
<summary>
受试者名称
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionOutDto.SubjectVisitName">
<summary>
访视名称
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionDto.TrialId">
<summary>
项目iD
@ -2335,6 +2365,11 @@
表格问题类型
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionSystemView.DependParentId">
<summary>
依赖父问题
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionSystemQuery.TableQuestionType">
<summary>
表格问题类型
@ -2348,6 +2383,11 @@
表格问题类型
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingTableQuestionSystemAddOrEdit.DependParentId">
<summary>
依赖父问题
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingCriterionPageQuery.PageName">
<summary> PageName</summary>
</member>
@ -3562,6 +3602,16 @@
类型枚举
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.OrganInfoView.IsDepend">
<summary>
是否关联
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.GetTrialSelectOrganListInDto.OrganType">
<summary>
类型枚举
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.GetTrialOrganListInDto.OrganType">
<summary>
类型枚举
@ -3580,8 +3630,10 @@
<member name="T:IRaCIS.Core.Application.ViewModel.OrganInfoQuery">
<summary>OrganInfoQuery 列表查询参数模型</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.OrganInfoQuery.TypeName">
<summary> 类型名称</summary>
<member name="P:IRaCIS.Core.Application.ViewModel.OrganInfoQuery.OrganType">
<summary>
类型枚举
</summary>
</member>
<member name="T:IRaCIS.Core.Application.ViewModel.OrganInfoAddOrEdit">
<summary> OrganInfoAddOrEdit 列表查询参数模型</summary>
@ -3596,6 +3648,11 @@
备注
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.OrganInfoAddOrEdit.IsDepend">
<summary>
是否关联
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.ReadingMedicineSystemQuestionView.Type">
<summary>
类型

View File

@ -347,7 +347,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
public string ExperimentName { get; set; } = string.Empty;
public string BlindName { get; set; }
public string FirstName { get; set; } = string.Empty;
@ -371,7 +371,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
public bool? InPlan { get; set; }
public string OptTypeName { get; set; } = string.Empty;
public string OptType { get; set; } = string.Empty;
public Guid? FrontAuditConfigId { get; set; }
@ -381,6 +381,36 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
/// </summary>
public string ParentIdentification { get; set; }
/// <summary>
/// 项目名称
/// </summary>
public string TrialName { get; set; }
/// <summary>
/// 中心Code
/// </summary>
public string SiteCode { get; set; }
/// <summary>
/// 项目编码
/// </summary>
public string ResearchProgramNo { get; set; }
/// <summary>
/// 中心名称
/// </summary>
public string SiteName { get; set; }
/// <summary>
/// 受试者名称
/// </summary>
public string SubjectCode { get; set; }
/// <summary>
/// 访视名称
/// </summary>
public string SubjectVisitName { get; set; }
}

View File

@ -88,7 +88,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
{
CreateTime = data.CreateTime,
CreateUserId = data.CreateUserId,
ModuleType = leftmoduleTypec.Id,
ModuleTypeId = leftmoduleTypec.Id,
BlindName = leftsubjectVisit.BlindName,
TrialId = data.TrialId,
SiteId = data.SiteId,
@ -100,7 +100,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
IsSign = data.IsSign,
SignId = data.SignId,
ParentId = data.ParentId,
ChildrenType = data.ChildrenType,
ChildrenTypeId = data.ChildrenTypeId,
//JsonDetail = data.JsonDetail,
//SiteName = data.SiteName,
//ExperimentName = data.TrialName,
@ -120,19 +120,19 @@ namespace IRaCIS.Core.Application.Service.Inspection
TrialName= leftrial.ExperimentName,
SiteCode= lefttrialSite.TrialSiteCode,
ResearchProgramNo= leftrial.ResearchProgramNo,
ObjectType=data.ObjectType,
ObjectTypeId=data.ObjectTypeId,
Description=leftfrontAuditConfig.Description,
ModuleTypeName= leftmoduleTypec.ValueCN,
SignText= lefttrialSign.SignText,
Identification= leftfrontAuditConfig.Identification,
FrontAuditConfigId= leftfrontAuditConfig.Id,
ParentIdentification = leftparent.Identification,
OptType = leftOptType.Id,
OptTypeId = leftOptType.Id,
VisitNum=leftsubjectVisit.VisitNum,
InPlan= leftsubjectVisit.InPlan,
//IsFrontAdd=data.IsFrontAdd,
BatchId =data.BatchId,
OptTypeName = leftOptType.Value,
OptType = leftOptType.Value,
};
query = query.WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId)
@ -142,7 +142,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
//.WhereIf(dto.VisitPlanInfo != (decimal)1.11,x=>x.InPlan!=null&& x.InPlan==false)
.WhereIf(dto.StartTime != null, x => x.CreateTime >= dto.StartTime)
.WhereIf(dto.EndTime != null, x => x.CreateTime <= dto.EndTime)
.WhereIf(dto.ModuleType!=null, x => x.ModuleType == dto.ModuleType)
.WhereIf(dto.ModuleType!=null, x => x.ModuleTypeId == dto.ModuleType)
.WhereIf(!dto.Description.IsNullOrEmpty(), x => x.Description == dto.Description)
.WhereIf(!dto.OpByUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(dto.OpByUserName))
//.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))

View File

@ -27,11 +27,6 @@ namespace IRaCIS.Core.Domain.Models
/// <summary>
/// 盲态访视名
/// </summary>
public string BlindName { get; set; } = string.Empty;
/// <summary>
/// 项目iD
/// </summary>
@ -85,21 +80,21 @@ namespace IRaCIS.Core.Domain.Models
/// <summary>
/// 子类
/// </summary>
public Guid? ChildrenType { get; set; }
public Guid? ChildrenTypeId { get; set; }
/// <summary>
/// 对象类型
/// </summary>
public Guid? ObjectType { get; set; }
public Guid? ObjectTypeId { get; set; }
/// <summary>
/// 操作类型
/// </summary>
public Guid? OptType { get; set; }
public Guid? OptTypeId { get; set; }
/// <summary>
/// 功能模块
/// </summary>
public Guid? ModuleType { get; set; }
public Guid? ModuleTypeId { get; set; }
/// <summary>
@ -113,23 +108,6 @@ namespace IRaCIS.Core.Domain.Models
/// </summary>
public string CreateUserName { get; set; }
/// <summary>
/// 项目名称
/// </summary>
public string TrialName { get; set; }
/// <summary>
/// 中心名称
/// </summary>
public string SiteName { get; set; }
/// <summary>
/// 受试者名称
/// </summary>
public string SubjectCode { get; set; }
/// <summary>
/// 访视名称
/// </summary>
public string SubjectVisitName { get; set; }
/// <summary>
/// 角色名称
@ -138,18 +116,6 @@ namespace IRaCIS.Core.Domain.Models
/// <summary>
/// 中心Code
/// </summary>
public string SiteCode { get; set; }
/// <summary>
/// 项目编码
/// </summary>
public string ResearchProgramNo { get; set; }
/// <summary>
/// 标识
/// </summary>
@ -167,7 +133,6 @@ namespace IRaCIS.Core.Domain.Models
/// <summary>
/// 批次Id
/// </summary>

View File

@ -106,7 +106,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var userTypeIds = userTypes.Select(x => x.NeedConfirmUserTypeId).ToList();
var userTypeNameList = await _dbContext.UserType.Where(x => userTypeIds.Contains(x.Id)).Select(x => x.UserTypeShortName).ToListAsync();
var userTypeName = string.Join(",", userTypeNameList);
await InsertInspection<SystemDocument>(entity, type, x => new DataInspection()
await InsertInspection<SystemDocument>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id
}, new
@ -118,7 +118,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// 签名模板
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemBasicData)))
{
await InsertInspection<SystemBasicData>(item.Entity as SystemBasicData, type, x => new DataInspection()
await InsertInspection<SystemBasicData>(item.Entity as SystemBasicData, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
});
@ -144,7 +144,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
trialDics = await this._dbContext.Dictionary.Where(x => dictionaryIds.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync();
await InsertInspection<Trial>(item.Entity as Trial, type, x => new DataInspection()
await InsertInspection<Trial>(item.Entity as Trial, type, x => new InspectionConvertDTO()
{
TrialId = x.Id,
@ -168,7 +168,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
visitPlanStatus = false;
}
await InsertInspection<VisitStage>(item.Entity as VisitStage, type, x => new DataInspection()
await InsertInspection<VisitStage>(item.Entity as VisitStage, type, x => new InspectionConvertDTO()
{
VisitStageId = x.Id,
GeneralId = x.Id,
@ -192,7 +192,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var userTypeIds = userTypes.Select(x => x.NeedConfirmUserTypeId).ToList();
var usertypeNames = await _dbContext.UserType.Where(x => userTypeIds.Contains(x.Id)).Select(x => x.UserTypeShortName).ToListAsync();
var usertypeName = string.Join(",", usertypeNames);
await InsertInspection<TrialDocument>(entity, type, x => new DataInspection()
await InsertInspection<TrialDocument>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id
}, new
@ -208,7 +208,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
var entity = item.Entity as SystemDocConfirmedUser;
var systemDocument = await _dbContext.SystemDocument.Where(x => x.Id == entity.SystemDocumentId).FirstOrDefaultAsync();
await InsertInspection<SystemDocConfirmedUser>(entity, type, x => new DataInspection()
await InsertInspection<SystemDocConfirmedUser>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
}, new
@ -228,7 +228,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var trialDocument = await _dbContext.TrialDocument.Where(x => x.Id == entity.TrialDocumentId).FirstOrDefaultAsync();
var trialid = trialDocument.TrialId;
await InsertInspection<TrialDocUserTypeConfirmedUser>(entity as TrialDocUserTypeConfirmedUser, type, x => new DataInspection()
await InsertInspection<TrialDocUserTypeConfirmedUser>(entity as TrialDocUserTypeConfirmedUser, type, x => new InspectionConvertDTO()
{
TrialId = trialid,
GeneralId = x.Id,
@ -241,23 +241,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
});
}
// 医生
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(Enroll)))
{
await InsertInspection<Enroll>(item.Entity as Enroll, type, x => new DataInspection()
{
GeneralId = x.Id,
});
}
// 医生详情
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(EnrollDetail)))
{
await InsertInspection<EnrollDetail>(item.Entity as EnrollDetail, type, x => new DataInspection()
{
GeneralId = x.Id,
});
}
// 项目中心
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSite)))
@ -267,7 +250,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
entity.Site = await _dbContext.Site.Where(x => x.Id == entity.SiteId).FirstOrDefaultAsync();
}
await InsertInspection<TrialSite>(entity, type, x => new DataInspection()
await InsertInspection<TrialSite>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
@ -287,7 +270,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as TrialUser;
var user = await _dbContext.Users.Include(x => x.UserTypeRole).FirstOrDefaultAsync(x => x.Id == entity.UserId);
await InsertInspection<TrialUser>(entity, type, x => new DataInspection
await InsertInspection<TrialUser>(entity, type, x => new InspectionConvertDTO
{
TrialId = x.TrialId,
}, new
@ -334,7 +317,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
UserType userType = new UserType();
userType = await _dbContext.UserType.Where(x => x.Id == user.UserTypeId).FirstOrDefaultAsync();
await InsertInspection<TrialSiteUser>(item.Entity as TrialSiteUser, type, x => new DataInspection()
await InsertInspection<TrialSiteUser>(item.Entity as TrialSiteUser, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
}, new
@ -374,7 +357,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
entity.ReviewerUser = await _dbContext.User.Where(x => x.Id == entity.ReviewerUserId).FirstOrDefaultAsync();
}
await InsertInspection<TrialSiteSurvey>(item.Entity as TrialSiteSurvey, type, x => new DataInspection()
await InsertInspection<TrialSiteSurvey>(item.Entity as TrialSiteSurvey, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
@ -396,7 +379,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
var entity = item.Entity as TrialQCQuestion;
var paretName = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync();
await InsertInspection<TrialQCQuestion>(entity, type, x => new DataInspection()
await InsertInspection<TrialQCQuestion>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
}, new
@ -419,7 +402,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as Subject;
var finalSubjectVisitName = await _dbContext.SubjectVisit.AsNoTracking().Where(x => x.Id == entity.FinalSubjectVisitId && entity.FinalSubjectVisitId != null).Select(x => x.VisitName).FirstOrDefaultAsync();
await InsertInspection<Subject>(entity, type, x => new DataInspection()
await InsertInspection<Subject>(entity, type, x => new InspectionConvertDTO()
{
SubjectId = x.Id,
SubjectCode = x.Code,
@ -432,7 +415,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// 检查
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomStudy)))
{
await InsertInspection<DicomStudy>(item.Entity as DicomStudy, type, x => new DataInspection()
await InsertInspection<DicomStudy>(item.Entity as DicomStudy, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
});
@ -447,7 +430,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
dicomStudy = await _dbContext.DicomStudys.AsNoTracking().FirstOrDefaultAsync(x => x.Id == entity.StudyId);
}
await InsertInspection<DicomSeries>(item.Entity as DicomSeries, type, x => new DataInspection()
await InsertInspection<DicomSeries>(item.Entity as DicomSeries, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
}, new
@ -465,7 +448,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var fileCount = await _dbContext.NoneDicomStudyFile.Where(x => x.NoneDicomStudyId == entity.Id).CountAsync();
await InsertInspection<NoneDicomStudy>(item.Entity as NoneDicomStudy, type, x => new DataInspection()
await InsertInspection<NoneDicomStudy>(item.Entity as NoneDicomStudy, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
}, new
@ -492,7 +475,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
filecount = filecount + count;
}
await InsertInspection<NoneDicomStudy>(noneDicomStudy, type, x => new DataInspection()
await InsertInspection<NoneDicomStudy>(noneDicomStudy, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
}, new
@ -519,7 +502,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
reason = entity.TalkContent.Substring(entity.TalkContent.LastIndexOf(':') + 1);
break;
}
await InsertInspection<CheckChallengeDialog>(entity, type, x => new DataInspection()
await InsertInspection<CheckChallengeDialog>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = entity.SubjectVisitId,
TrialId = subjectvisit.TrialId,
@ -551,7 +534,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var subjectCode = entity.Subject?.Code;
await InsertInspection<SubjectVisit>(item.Entity as SubjectVisit, type, x => new DataInspection()
await InsertInspection<SubjectVisit>(item.Entity as SubjectVisit, type, x => new InspectionConvertDTO()
{
SubjectCode = subjectCode,
SubjectId = x.SubjectId,
@ -568,7 +551,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as PreviousSurgery;
var subjectvisit = await _dbContext.SubjectVisit.Where(x => x.Id == entity.SubjectVisitId).FirstOrDefaultAsync();
subjectvisit = subjectvisit ?? new SubjectVisit();
await InsertInspection<PreviousSurgery>(entity, type, x => new DataInspection()
await InsertInspection<PreviousSurgery>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
SiteId = subjectvisit.SiteId,
@ -588,7 +571,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as PreviousHistory;
var subjectvisit = await _dbContext.SubjectVisit.Where(x => x.Id == entity.SubjectVisitId).FirstOrDefaultAsync();
subjectvisit = subjectvisit ?? new SubjectVisit();
await InsertInspection<PreviousHistory>(entity, type, x => new DataInspection()
await InsertInspection<PreviousHistory>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
SiteId = subjectvisit.SiteId,
@ -607,7 +590,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as PreviousOther;
var subjectvisit = await _dbContext.SubjectVisit.Where(x => x.Id == entity.SubjectVisitId).FirstOrDefaultAsync();
subjectvisit = subjectvisit ?? new SubjectVisit();
await InsertInspection<PreviousOther>(entity, type, x => new DataInspection()
await InsertInspection<PreviousOther>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
SiteId = subjectvisit.SiteId,
@ -632,7 +615,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
content = entity.Content;
}
await InsertInspection<QCChallenge>(entity, type, x => new DataInspection()
await InsertInspection<QCChallenge>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
TrialId = x.TrialId,
@ -666,7 +649,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var qCChallenge = await _dbContext.QCChallenge.Where(x => x.Id == entity.QCChallengeId).FirstOrDefaultAsync();
subjectvisit = subjectvisit ?? new SubjectVisit();
qCChallenge = qCChallenge ?? new QCChallenge();
await InsertInspection<QCChallengeDialog>(entity, type, x => new DataInspection()
await InsertInspection<QCChallengeDialog>(entity, type, x => new InspectionConvertDTO()
{
GeneralId = qCChallenge.Id,
TrialId = subjectvisit.TrialId,
@ -692,7 +675,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//Qc 问题
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(QCQuestion)))
{
await InsertInspection<QCQuestion>(item.Entity as QCQuestion, type, x => new DataInspection()
await InsertInspection<QCQuestion>(item.Entity as QCQuestion, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
});
@ -703,7 +686,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// 一致性核查文件
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ConsistencyCheckFile)))
{
await InsertInspection<ConsistencyCheckFile>(item.Entity as ConsistencyCheckFile, type, x => new DataInspection()
await InsertInspection<ConsistencyCheckFile>(item.Entity as ConsistencyCheckFile, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
CreateTime = x.CreateTime,
@ -719,7 +702,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
subjectVisit = subjectVisit ?? new SubjectVisit();
if (type == "Add")
{
await AddInspectionRecordAsync(new DataInspection()
await AddInspectionRecordAsync(new InspectionConvertDTO()
{
SiteId = subjectVisit.SiteId,
Identification = $"{_userInfo.RequestUrl}/{firstEntity.GetType().Name}/{type}",
@ -740,7 +723,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var createUserId = entitylist.Select(x => x.CreateUserId).FirstOrDefault();
var noUpdateData = _dbContext.TrialQCQuestionAnswer.Where(x => x.CreateUserId == createUserId && x.SubjectVisitId == subjectVisit.Id && !questionIds.Contains(x.Id)).ToList();
entitylist.AddRange(noUpdateData);
await AddInspectionRecordAsync(new DataInspection()
await AddInspectionRecordAsync(new InspectionConvertDTO()
{
Identification = $"{_userInfo.RequestUrl}/{firstEntity.GetType().Name}/{type}",
SiteId = subjectVisit.SiteId,
@ -790,6 +773,35 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//}
#endregion
//阅片人入组
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(Enroll)))
{
var entity = item.Entity as Enroll;
var doctor = await _dbContext.Doctor.FirstOrDefaultAsync(x => x.Id == entity.DoctorId);
await InsertInspection<Enroll>(item.Entity as Enroll, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
}, new
{
Name = doctor.FullName,
ChineseName = doctor.ChineseName,
Email=doctor.EMail,
}) ;
}
//// 医生详情
//foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(EnrollDetail)))
//{
// await InsertInspection<EnrollDetail>(item.Entity as EnrollDetail, type, x => new DataInspection()
// {
// GeneralId = x.Id,
// });
//}
#endregion
}
@ -803,10 +815,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common
/// <param name="expression">表达式</param>
/// <param name="otherItem">其他对象</param>
/// <returns></returns>
public async Task InsertInspection<T>(T data, string type, Expression<Func<T, DataInspection>> expression = null, object otherItem = null, object originaldata = null) where T : class
public async Task InsertInspection<T>(T data, string type, Expression<Func<T, InspectionConvertDTO>> expression = null, object otherItem = null, object originaldata = null) where T : class
{
object entityobj = data;
DataInspection inspection = new DataInspection();
InspectionConvertDTO inspection = new InspectionConvertDTO();
if (expression != null)
{
var f = expression.Compile();
@ -959,7 +971,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
/// <param name="data">数据</param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
public async Task AddInspectionRecordAsync(DataInspection add, object data, object otherItem = null)
public async Task AddInspectionRecordAsync(InspectionConvertDTO add, object data, object otherItem = null)
{
//MapData(data, add);
@ -967,7 +979,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
InspectionGeneralData generalData = new InspectionGeneralData()
{
CreateUserName = add.CreateUserName,
//CreateUserName = add.CreateUserName,
SiteCode = add.SiteCode,
SiteId = add.SiteId,
SiteName = add.SiteName,
@ -976,7 +988,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
SubjectVisitId = add.SubjectVisitId,
SubjectVisitName = add.SubjectVisitName,
ResearchProgramNo = add.ResearchProgramNo,
RoleName = add.RoleName,
//RoleName = add.RoleName,
TrialId = add.TrialId,
TrialName = add.TrialName
};
@ -985,10 +997,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common
#region 处理标识
var from = await _dbContext.FrontAuditConfig.FirstOrDefaultAsync(x => x.Identification == add.Identification);
add.ObjectType = from?.ObjectTypeId;
add.OptType = from?.OptTypeId;
add.ChildrenType = from?.ChildrenTypeId;
add.ModuleType = from?.ModuleTypeId;
add.ObjectTypeId = from?.ObjectTypeId;
add.OptTypeId = from?.OptTypeId;
add.ChildrenTypeId = from?.ChildrenTypeId;
add.ModuleTypeId = from?.ModuleTypeId;
#endregion
if (add.ParentId == null)
@ -1130,11 +1142,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
#endregion
generalData.CreateUserName = _userInfo.RealName;
generalData.RoleName = _userInfo.UserTypeShortName;
}
}

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using IRaCIS.Core.Domain.Models;
namespace IRaCIS.Core.Infra.EFCore.Common.Dto
{
@ -21,7 +21,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
}
public class SetInspectionEnumDataDto
{
{
public Guid Id { get; set; }
public string Identification { get; set; }
@ -87,10 +87,51 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
/// 稽查数据
/// </summary>
public class InspectionJsonDetail
{
public dynamic Data { get; set; }
{
public dynamic Data { get; set; }
public InspectionGeneralData Inspection { get; set; }
}
public class InspectionConvertDTO : DataInspection
{
/// <summary>
/// 项目名称
/// </summary>
public string TrialName { get; set; }
/// <summary>
/// 中心Code
/// </summary>
public string SiteCode { get; set; }
/// <summary>
/// 项目编码
/// </summary>
public string ResearchProgramNo { get; set; }
/// <summary>
/// 中心名称
/// </summary>
public string SiteName { get; set; }
/// <summary>
/// 受试者名称
/// </summary>
public string SubjectCode { get; set; }
/// <summary>
/// 访视名称
/// </summary>
public string SubjectVisitName { get; set; }
/// <summary>
/// 盲态访视名
/// </summary>
public string BlindName { get; set; } = string.Empty;
public InspectionGeneralData Inspection { get; set; }
}
/// <summary>
@ -151,16 +192,17 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
/// <summary>
/// 创建人名称
/// </summary>
public string CreateUserName { get; set; }
// /// <summary>
///// 创建人名称
///// </summary>
//public string CreateUserName { get; set; }
// /// <summary>
// /// 角色名称
// /// </summary>
// public string RoleName { get; set; }
/// <summary>
/// 角色名称
/// </summary>
public string RoleName { get; set; }
}