稽查修改

Uat_Study
hang 2022-08-18 14:08:13 +08:00
parent fe3316f7a8
commit 81a0a7d02d
10 changed files with 137 additions and 44 deletions

View File

@ -3110,13 +3110,6 @@
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.OrganInfoService.SetOrganIsEnable(IRaCIS.Core.Application.ViewModel.SetOrganIsEnableInDto)">
<summary>
设置项目器官是否生效
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="T:IRaCIS.Core.Application.Service.ReadingMedicalReviewService">
<summary>
阅片医学审核
@ -3660,6 +3653,16 @@
是否关联
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.GetTrialOrganListOutDto.NidusType">
<summary>
病灶类型
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.GetTrialOrganListOutDto.NidusTypeCN">
<summary>
病灶类型
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.GetTrialOrganListOutDto.Remark">
<summary>
备注

View File

@ -494,6 +494,10 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
/// </summary>
public Guid? BatchId { get; set; }
public DateTime? RelationDeadlineTime { get; set; }
public Guid? ObjectRelationParentId { get; set; }
}

View File

@ -136,7 +136,8 @@ namespace IRaCIS.Core.Application.Service.Inspection
};
query = query.WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId)
.WhereIf(dto.BatchId != null, x => x.BatchId == dto.BatchId)
//.WhereIf(dto.BatchId != null, x => x.BatchId == dto.BatchId)
.WhereIf(dto.ObjectRelationParentId != null && dto.BatchId!=null && dto.RelationDeadlineTime!=null, x => (x.ObjectRelationParentId == dto.ObjectRelationParentId && x.CreateTime<= dto.RelationDeadlineTime) ||x.BatchId==dto.BatchId )
.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
//.WhereIf(dto.VisitPlanInfo != null&& dto.VisitPlanInfo!=(decimal) 1.11, x => x.VisitNum == dto.VisitPlanInfo)
//.WhereIf(dto.VisitPlanInfo != (decimal)1.11,x=>x.InPlan!=null&& x.InPlan==false)

View File

@ -382,6 +382,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public bool? IsComplete { get; set; }
//临床数据状态
public ReadingClinicalDataStatus ReadingClinicalDataState { get; set; }
/// <summary>
/// 文件数量
/// </summary>

View File

@ -96,6 +96,8 @@ namespace IRaCIS.Application.Services
ClinicalDataLevel = clinicalDataTrialSet.ClinicalDataLevel,
ReadingId = indto.ReadingId
}).ToList();
entity.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveUploaded;
await _readingClinicalDataRepository.AddAsync(entity, true);
var success = await _readingClinicalDataRepository.SaveChangesAsync();
return ResponseOutput.Ok(entity.Id);
@ -118,6 +120,7 @@ namespace IRaCIS.Application.Services
ReadingId = indto.ReadingId,
ReadingClinicalDataId = entity.Id,
}).ToList();
entity.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveUploaded;
await _readingClinicalDataPDFRepository.AddRangeAsync(addFileList);
var success = await _readingClinicalDataRepository.SaveChangesAsync();
return ResponseOutput.Ok(entity.Id);
@ -229,6 +232,7 @@ namespace IRaCIS.Application.Services
{
await _readingClinicalDataRepository.DeleteFromQueryAsync(x => x.Id == id, true);
await _readingClinicalDataPDFRepository.DeleteFromQueryAsync(x => x.ReadingClinicalDataId == id, true);
return ResponseOutput.Result(true);
}
@ -295,7 +299,8 @@ namespace IRaCIS.Application.Services
{
await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.ReadingClinicalDataId, x => new ReadingClinicalData()
{
IsSign = true
IsSign = true,
ReadingClinicalDataState=ReadingClinicalDataStatus.HaveSigned
});
var result = await _readingClinicalDataRepository.SaveChangesAsync();
@ -448,10 +453,11 @@ namespace IRaCIS.Application.Services
[HttpPut]
public async Task<IResponseOutput> PMClinicalDataConfirm(PMClinicalDataConfirmCommand command)
{
await _readingClinicalDataRepository.BatchUpdateNoTrackingAsync(t => t.Id == command.Id, u => new ReadingClinicalData()
await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(t => t.Id == command.Id, u => new ReadingClinicalData()
{
IsBlind=command.IsBlind,
IsComplete=command.IsComplete
IsComplete=command.IsComplete,
ReadingClinicalDataState=ReadingClinicalDataStatus.HaveChecked
});
await _readingClinicalDataRepository.SaveChangesAsync();
@ -480,6 +486,9 @@ namespace IRaCIS.Application.Services
IsCRCUpload = x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC,
IsBlind=x.IsBlind,
IsComplete=x.IsComplete,
ReadingClinicalDataState=x.ReadingClinicalDataState,
FileList = x.ReadingClinicalDataPDFList.Select(y => new GetFileDto()
{
Id = y.Id,

View File

@ -351,4 +351,17 @@ namespace IRaCIS.Core.Domain.Share
/// </summary>
ReadCompleted = 5,
}
public enum ReadingClinicalDataStatus
{
WaitUpload=0,
HaveUploaded=1,
HaveChecked=2,
HaveSigned=3
}
}

View File

@ -64,6 +64,10 @@ namespace IRaCIS.Core.Domain.Models
/// </summary>
public Guid CreateUserId { get; set; }
//临床数据状态
public ReadingClinicalDataStatus ReadingClinicalDataState { get; set; }
[ForeignKey("ClinicalDataTrialSetId")]
public ClinicalDataTrialSet ClinicalDataTrialSet { get; set; }

View File

@ -137,6 +137,9 @@ namespace IRaCIS.Core.Domain.Models
/// 批次Id
/// </summary>
public Guid BatchId { get; set; }
public Guid? ObjectRelationParentId { get; set; }
}

View File

@ -847,7 +847,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
//阅片期
//阅片期计划
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingPeriodSet)))
{
var entity = item.Entity as ReadingPeriodSet;
@ -858,7 +858,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
if (entity.ReadingScope == ReadingScopeEnum.Site)
{
var siteIds = entity.ReadingPeriodSites.Select(t => t.SiteId).ToList();
var nameList = _dbContext.TrialSite.Where(c => c.TrialId == entity.TrialId && siteIds.Contains(c.SiteId) ).Select(t => t.TrialSiteCode).ToList();
var nameList = _dbContext.TrialSite.Where(c => c.TrialId == entity.TrialId && siteIds.Contains(c.SiteId)).Select(t => t.TrialSiteCode).ToList();
siteCodes = String.Join(',', nameList);
}
@ -874,48 +874,88 @@ namespace IRaCIS.Core.Infra.EFCore.Common
});
}
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingPeriodPlan)))
{
var entity = item.Entity as ReadingPeriodPlan;
#region 阅片期临时数据不记录
//foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingPeriodPlan)))
//{
// var entity = item.Entity as ReadingPeriodPlan;
if (entity.ReadingPeriodSet == null)
{
entity.ReadingPeriodSet = _dbContext.ReadingPeriodSet.Find(entity.ReadingPeriodSetId);
}
// if (entity.ReadingPeriodSet == null)
// {
// entity.ReadingPeriodSet = _dbContext.ReadingPeriodSet.Find(entity.ReadingPeriodSetId);
// }
await InsertInspection<ReadingPeriodPlan>(item.Entity as ReadingPeriodPlan, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
SubjectVisitId = x.SubjectVisitId,
}, new
{
entity.ReadingPeriodSet.ReadingPeriodName,
entity.ReadingPeriodSet.EffectOfTime,
entity.ReadingPeriodSet.ExpirationDate
});
}
// await InsertInspection<ReadingPeriodPlan>(item.Entity as ReadingPeriodPlan, type, x => new InspectionConvertDTO()
// {
// GeneralId = x.Id,
// SubjectVisitId = x.SubjectVisitId,
// }, new
// {
// entity.ReadingPeriodSet.ReadingPeriodName,
// entity.ReadingPeriodSet.EffectOfTime,
// entity.ReadingPeriodSet.ExpirationDate
// });
//}
#endregion
//阅片期
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadModule)))
{
var entity = item.Entity as ReadModule;
//if (entity.ReadingPeriodSet == null && entity.ReadingPeriodSetId !=null)
//{
// entity.ReadingPeriodSet = _dbContext.ReadingPeriodSet.Find(entity.ReadingPeriodSetId);
//}
var visitName = _dbContext.SubjectVisit.Where(t => t.Id == entity.SubjectVisitId).Select(t => t.VisitName).FirstOrDefault();
await InsertInspection<ReadModule>(item.Entity as ReadModule, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
SubjectVisitId = x.SubjectVisitId,
IsDistinctionInterface = false,
}, new
{
VisitName = visitName,
});
}
//阅片期临床数据
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingClinicalData)))
{
var entity = item.Entity as ReadingClinicalData;
if (entity.ClinicalDataTrialSet == null && entity.ClinicalDataTrialSetId != Guid.Empty)
{
entity.ClinicalDataTrialSet = await _dbContext.ClinicalDataTrialSet.FindAsync(entity.ClinicalDataTrialSetId);
}
await InsertInspection<ReadingClinicalData>(item.Entity as ReadingClinicalData, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
SubjectVisitId = x.IsVisit ? x.ReadingId : null,
}, new
{
entity.ClinicalDataTrialSet.ClinicalUploadType,
entity.ClinicalDataTrialSet.ClinicalDataSetName,
entity.ClinicalDataTrialSet.ClinicalDataLevel,
});
}
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingClinicalDataPDF)))
{
var entity = item.Entity as ReadingClinicalDataPDF;
await InsertInspection<ReadingClinicalDataPDF>(item.Entity as ReadingClinicalDataPDF, type, x => new InspectionConvertDTO()
{
GeneralId = x.Id,
SubjectId = x.SubjectId,
IsDistinctionInterface=false,
ObjectRelationParentId=entity.ReadingClinicalDataId
}, new
{
IsCRCUpload = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator
});
}
#endregion
}
@ -942,12 +982,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
inspection.Identification = await GetInspectionRecordIdentificationAsync(entityObj, type);
inspection.Identification = await GetInspectionRecordIdentificationAsync(entityObj, type, inspection.IsDistinctionInterface);
//将实体对象属性 映射到稽查实体
MapEntityPropertyToAuditEntity(entityObj, inspection);
var generalData = await GetInspectionGeneralDataAsync( inspection);
var generalData = await GetInspectionGeneralDataAsync(inspection);
//不可少 因为稽查实体可能某些Id没有
MapEntityPropertyToAuditEntity(generalData, inspection);
@ -1027,7 +1067,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
/// </summary>
/// <param name="inspection"></param>
/// <returns></returns>
public async Task<InspectionGeneralData> GetInspectionGeneralDataAsync( InspectionConvertDTO inspection)
public async Task<InspectionGeneralData> GetInspectionGeneralDataAsync(InspectionConvertDTO inspection)
{
InspectionGeneralData generalData = new InspectionGeneralData()
@ -1054,8 +1094,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//添加访视的时候,会带信息过来
if (string.IsNullOrEmpty(generalData.SubjectVisitName))
{
var info = (await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x =>
new { x.VisitName, x.SubjectId, x.SiteId, SubjectCode = x.Subject.Code, TrialSiteCode = x.TrialSite.TrialSiteCode ,x.TrialId,x.Trial.ExperimentName,x.Trial.ResearchProgramNo}).FirstOrDefaultAsync()).IfNullThrowException();
var info = (await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x =>
new { x.VisitName, x.SubjectId, x.SiteId, SubjectCode = x.Subject.Code, TrialSiteCode = x.TrialSite.TrialSiteCode, x.TrialId, x.Trial.ExperimentName, x.Trial.ResearchProgramNo }).FirstOrDefaultAsync()).IfNullThrowException();
generalData.SubjectVisitName = info.VisitName;
@ -1143,7 +1183,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
/// 获取稽查记录的标识符 部分业务会进行特殊处理
/// </summary>
/// <returns></returns>
public async Task<string> GetInspectionRecordIdentificationAsync<T>(T entityObj, string type)
public async Task<string> GetInspectionRecordIdentificationAsync<T>(T entityObj, string type, bool IsDistinctionInterface = true)
{
var entityTypeName = entityObj.GetType().Name;
@ -1215,7 +1255,15 @@ namespace IRaCIS.Core.Infra.EFCore.Common
#endregion
return $"{_userInfo.RequestUrl}/{entityTypeName}/{type}";
if (IsDistinctionInterface)
{
return $"{_userInfo.RequestUrl}/{entityTypeName}/{type}";
}
else
{
return $"{entityTypeName}/{type}";
}
}

View File

@ -132,6 +132,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
public string BlindName { get; set; } = string.Empty;
//标识操作 是否区分接口
public bool IsDistinctionInterface=true;
}
/// <summary>