修改稽查

Uat_Study
hang 2022-08-26 14:28:05 +08:00
parent f8ad6e2944
commit 507c38e719
4 changed files with 74 additions and 58 deletions

View File

@ -99,7 +99,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
//OptType = data.OptType, //OptType = data.OptType,
IP = data.IP, IP = data.IP,
Reason = data.Reason, Reason = data.Reason,
IsSign = data.IsSign, IsSign = leftfrontAuditConfig.IsHaveSign,
SignId = data.SignId, SignId = data.SignId,
ParentId = data.ParentId, ParentId = data.ParentId,
ChildrenTypeId = data.ChildrenTypeId, ChildrenTypeId = data.ChildrenTypeId,

View File

@ -480,4 +480,17 @@ namespace IRaCIS.Core.Domain.Share
HaveSigned=3 HaveSigned=3
} }
public enum ClinicalFileType
{
//既往手术
PreviousSurgery=1,
//既往放疗历史
PreviousHistory=2,
//其他
PreviousOther=3
}
} }

View File

@ -72,11 +72,13 @@ namespace IRaCIS.Core.Domain.Models
/// </summary> /// </summary>
public string Path { get; set; } public string Path { get; set; }
[JsonIgnore]
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public List<ReadingClinicalData> ReadingClinicalDataList { get; set; } public List<ReadingClinicalData> ReadingClinicalDataList { get; set; }
[JsonIgnore]
[ForeignKey("TrialId")] [ForeignKey("TrialId")]
public Trial Trial { get; set; } public Trial Trial { get; set; }

View File

@ -101,7 +101,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
#region 区分 #region 区分
// 系统文件签署 // 系统文件签署 父层级未记录稽查(系统文档初始数据)
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemDocConfirmedUser))) foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemDocConfirmedUser)))
{ {
var entity = item.Entity as SystemDocConfirmedUser; var entity = item.Entity as SystemDocConfirmedUser;
@ -110,7 +110,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{ {
GeneralId = x.Id, GeneralId = x.Id,
ObjectRelationParentId=x.SystemDocumentId ObjectRelationParentId = x.SystemDocumentId
}, new }, new
{ {
@ -197,54 +197,28 @@ 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 InspectionConvertDTO()
{
ObjectRelationParentId=x.SubjectVisitId
});
}
// 序列
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomSeries)))
{
var entity = item.Entity as DicomSeries;
var dicomStudy = entity.DicomStudy.Clone();
if (dicomStudy == null)
{
dicomStudy = await _dbContext.DicomStudys.AsNoTracking().FirstOrDefaultAsync(x => x.Id == entity.StudyId);
}
await InsertInspection<DicomSeries>(item.Entity as DicomSeries, type, x => new InspectionConvertDTO()
{
ObjectRelationParentId = x.StudyId
}, new
{
StudyCode = dicomStudy?.StudyCode,
Modalities = dicomStudy?.Modalities,
});
}
// 既往手术史 // 既往手术史
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(PreviousSurgery))) foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(PreviousSurgery)))
{ {
var entity = item.Entity as PreviousSurgery; var entity = item.Entity as PreviousSurgery;
var subjectvisit = await _dbContext.SubjectVisit.Where(x => x.Id == entity.SubjectVisitId).FirstOrDefaultAsync();
subjectvisit = subjectvisit ?? new SubjectVisit(); //var subjectvisit = await _dbContext.SubjectVisit.Where(x => x.Id == entity.SubjectVisitId).FirstOrDefaultAsync();
//subjectvisit = subjectvisit ?? new SubjectVisit();
await InsertInspection<PreviousSurgery>(entity, type, x => new InspectionConvertDTO() await InsertInspection<PreviousSurgery>(entity, type, x => new InspectionConvertDTO()
{ {
SiteId = subjectvisit.SiteId,
SubjectVisitName = subjectvisit.VisitName,
TrialId = subjectvisit.TrialId,
SubjectId = subjectvisit.SubjectId,
ObjectRelationParentId=x.SubjectVisitId, SubjectVisitId = x.SubjectVisitId,
ObjectRelationParentId = x.SubjectVisitId,
}, new }, new
{ {
Type = "既往手术史" Type = ClinicalFileType.PreviousSurgery
}); });
} }
@ -264,7 +238,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
ObjectRelationParentId = x.SubjectVisitId, ObjectRelationParentId = x.SubjectVisitId,
}, new }, new
{ {
Type = "既往放疗史" Type = ClinicalFileType.PreviousHistory
}); });
} }
@ -284,10 +258,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common
ObjectRelationParentId = x.SubjectVisitId, ObjectRelationParentId = x.SubjectVisitId,
}, new }, new
{ {
Type = "其他治疗史" Type = ClinicalFileType.PreviousOther
}); });
} }
//质疑 //质疑
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(QCChallenge))) foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(QCChallenge)))
{ {
@ -309,7 +286,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
SubjectVisitName = subjectvisit.VisitName, SubjectVisitName = subjectvisit.VisitName,
BlindName = subjectvisit.BlindName, BlindName = subjectvisit.BlindName,
ObjectRelationParentId=x.SubjectVisitId ObjectRelationParentId = x.SubjectVisitId
}, new }, new
{ {
ChallengeCode = entity.ChallengeCode, ChallengeCode = entity.ChallengeCode,
@ -319,9 +296,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}); });
} }
// 一致性核查文件 // 一致性核查文件
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ConsistencyCheckFile))) foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ConsistencyCheckFile)))
{ {
@ -329,7 +303,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{ {
CreateTime = x.CreateTime, CreateTime = x.CreateTime,
ObjectRelationParentId=x.TrialId ObjectRelationParentId = x.TrialId
}); });
} }
@ -549,7 +523,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
} }
// 签名模板 // 签名模板
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemBasicData))) foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemBasicData)))
{ {
@ -723,28 +696,45 @@ namespace IRaCIS.Core.Infra.EFCore.Common
SubjectVisitId = x.Id, SubjectVisitId = x.Id,
SiteId = x.SiteId, SiteId = x.SiteId,
Reason = reason, Reason = reason,
},
//兼容之前的配置名
new { SubjectVisitName = entity.VisitName }
);
}
// Dicom
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomStudy)))
{
await InsertInspection<DicomStudy>(item.Entity as DicomStudy, type, x => new InspectionConvertDTO()
{
ObjectRelationParentId = x.SubjectVisitId
}); });
} }
// 序列
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomSeries)))
{
var entity = item.Entity as DicomSeries;
await InsertInspection<DicomSeries>(item.Entity as DicomSeries, type, x => new InspectionConvertDTO()
{
ObjectRelationParentId = x.StudyId
}
);
}
// 非Dicom // 非Dicom
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudy))) foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudy)))
{ {
var entity = item.Entity as NoneDicomStudy; var entity = item.Entity as NoneDicomStudy;
await InsertInspection<NoneDicomStudy>(item.Entity as NoneDicomStudy, type, x => new InspectionConvertDTO() await InsertInspection<NoneDicomStudy>(item.Entity as NoneDicomStudy, type, x => new InspectionConvertDTO()
{ {
ObjectRelationParentId = x.SubjectVisitId, ObjectRelationParentId = x.SubjectVisitId,
}); });
//var fileCount = await _dbContext.NoneDicomStudyFile.Where(x => x.NoneDicomStudyId == entity.Id).CountAsync();
//await InsertInspection<NoneDicomStudy>(item.Entity as NoneDicomStudy, type, null, new
//{
// FileCount = fileCount,
//});
} }
@ -820,6 +810,17 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//阅片期临床数据 父层级未记录稽查(项目临床数据设置) //阅片期临床数据 父层级未记录稽查(项目临床数据设置)
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ClinicalDataTrialSet)))
{
var entity = item.Entity as ClinicalDataTrialSet;
await InsertInspection<ClinicalDataTrialSet>(entity, type, x => new InspectionConvertDTO()
{
ObjectRelationParentId = entity.TrialId,
});
}
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingClinicalData))) foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingClinicalData)))
{ {
var entity = item.Entity as ReadingClinicalData; var entity = item.Entity as ReadingClinicalData;
@ -1197,8 +1198,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
generalData.SubjectVisitId = info?.SourceSubjectVisitId != null ? info?.SourceSubjectVisitId : (info?.ReadModuleSubjectVisitId != null ? info?.ReadModuleSubjectVisitId : null); generalData.SubjectVisitId = info?.SourceSubjectVisitId != null ? info?.SourceSubjectVisitId : (info?.ReadModuleSubjectVisitId != null ? info?.ReadModuleSubjectVisitId : null);
//以后移除 //以后移除
generalData.SiteCode = info?.TrialSiteCode?? generalData.SiteCode; generalData.SiteCode = info?.TrialSiteCode ?? generalData.SiteCode;
generalData.SubjectCode = info?.SubjectCode ??generalData.SubjectCode; generalData.SubjectCode = info?.SubjectCode ?? generalData.SubjectCode;
} }
} }
@ -1219,7 +1220,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//以后移除 //以后移除
generalData.SiteCode = info?.TrialSiteCode ?? generalData.SiteCode; generalData.SiteCode = info?.TrialSiteCode ?? generalData.SiteCode;
generalData.SubjectCode = info?.SubjectCode?? generalData.SubjectCode; generalData.SubjectCode = info?.SubjectCode ?? generalData.SubjectCode;
} }
@ -1237,7 +1238,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//以后移除 //以后移除
generalData.SiteCode = info?.TrialSiteCode ?? generalData.SiteCode; generalData.SiteCode = info?.TrialSiteCode ?? generalData.SiteCode;
generalData.SubjectCode = info?.SubjectCode?? generalData.SubjectCode; generalData.SubjectCode = info?.SubjectCode ?? generalData.SubjectCode;
} }