Uat_Study
parent
5ef195cc3b
commit
a578113b94
|
@ -108,48 +108,13 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
// 更新受试者
|
||||
subject.FirstGiveMedicineTime = svCommand.SubjectFirstGiveMedicineTime;
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
SubjectId = subject.Id,
|
||||
SiteId = subject.SiteId,
|
||||
TrialId = subject.TrialId,
|
||||
IsSign = false,
|
||||
Identification = "Edit|Subject|Info|Subject",
|
||||
CreateTime = DateTime.Now.AddSeconds(1),
|
||||
JsonDetail = subject.ToJcJson(),
|
||||
});
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
||||
|
||||
|
||||
if (svCommand.Id == null)
|
||||
{
|
||||
List<DataInspection> dataInspection=new List<DataInspection>();
|
||||
|
||||
dataInspection.Add(new DataInspection()
|
||||
{
|
||||
TrialId = svCommand.TrialId,
|
||||
SiteId = svCommand.SiteId,
|
||||
SubjectId = svCommand.SubjectId,
|
||||
SubjectVisitId = svCommand.Id,
|
||||
SubjectVisitName = svCommand.VisitName,
|
||||
IsSign = false,
|
||||
CreateTime = DateTime.Now.AddSeconds(1),
|
||||
Identification = "Init|Visit|Status|Visit-Image Upload",
|
||||
JsonDetail = svCommand.ToJcJson()
|
||||
});
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(dataInspection);
|
||||
}
|
||||
|
||||
|
||||
return ResponseOutput.Ok(dbBeforeEntity.Id.ToString());
|
||||
|
||||
|
||||
|
|
|
@ -348,102 +348,7 @@ namespace IRaCIS.Application.Services
|
|||
var addvisitStages = await _visitStageRepository.Where(x => !x.IsHaveFirstConfirmed && x.TrialId == trialId).ToListAsync();
|
||||
|
||||
|
||||
addvisitStages.ForEach(x =>
|
||||
{
|
||||
subjectsids.ForEach(y =>
|
||||
{
|
||||
|
||||
|
||||
|
||||
Guid dataindtid = NewId.NextGuid();
|
||||
Guid guid = NewId.NextGuid();
|
||||
|
||||
SubjectVisit subjectVisit = new SubjectVisit()
|
||||
{
|
||||
SiteId = y.SiteId,
|
||||
SubjectId = y.Id,
|
||||
Id = guid,
|
||||
VisitName = x.VisitName,
|
||||
|
||||
BlindName = x.BlindName,
|
||||
IsBaseLine = x.IsBaseLine,
|
||||
IsUrgent = false,
|
||||
};
|
||||
|
||||
subjectVisits.Add(subjectVisit);
|
||||
|
||||
//
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
Id = dataindtid,
|
||||
BlindName = x.BlindName,
|
||||
IsSign = false,
|
||||
SiteId = y.SiteId,
|
||||
SubjectId = y.Id,
|
||||
SubjectVisitId = guid,
|
||||
CreateTime = createtime.AddMilliseconds(200),
|
||||
SubjectVisitName = x.VisitName,
|
||||
TrialId = x.TrialId,
|
||||
Identification = "Add|Visit|Info|Visit-Image Upload",
|
||||
JsonDetail = JsonConvert.SerializeObject(new
|
||||
{
|
||||
IsBaseLine = x.IsBaseLine,
|
||||
VisitName = x.VisitName,
|
||||
VisitNum = x.VisitNum,
|
||||
VisitDay = x.VisitDay,
|
||||
VisitExecuted = subjectVisit.VisitExecuted,
|
||||
BlindName = x.BlindName,
|
||||
VisitWindowLeft = x.VisitWindowLeft,
|
||||
VisitWindowRight = x.VisitWindowRight,
|
||||
IsEnrollment = y.IsEnrollment,
|
||||
IsUrgent = false,
|
||||
IsFinalVisit = subjectVisit.IsFinalVisit,
|
||||
IsLostVisit = subjectVisit.IsLostVisit,
|
||||
|
||||
PDState = false,
|
||||
}),
|
||||
});
|
||||
|
||||
// 初始化受试者
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
SiteId = y.SiteId,
|
||||
SubjectId = y.Id,
|
||||
SubjectVisitId = guid,
|
||||
SubjectCode = y.Code,
|
||||
BlindName = x.BlindName,
|
||||
//ParentId = dataindtid,
|
||||
SubjectVisitName = x.VisitName,
|
||||
IsSign = false,
|
||||
TrialId = x.TrialId,
|
||||
CreateTime = createtime.AddMilliseconds(500),
|
||||
Identification = "Init|Visit|Status|Visit-Image Upload",
|
||||
JsonDetail = JsonConvert.SerializeObject(new
|
||||
{
|
||||
BlindName = x.BlindName,
|
||||
VisitName = x.VisitName,
|
||||
SubmitState = subjectVisit.SubmitState,
|
||||
AuditState = subjectVisit.AuditState,
|
||||
IsBaseLine = x.IsBaseLine,
|
||||
IsEnrollment = y.IsEnrollment,
|
||||
IsUrgent = y.IsUrgent,
|
||||
VisitNum = x.VisitNum,
|
||||
VisitDay = x.VisitDay,
|
||||
VisitExecuted = subjectVisit.VisitExecuted,
|
||||
VisitWindowLeft = x.VisitWindowLeft,
|
||||
VisitWindowRight = x.VisitWindowRight,
|
||||
IsFinalVisit = subjectVisit.IsFinalVisit,
|
||||
IsLostVisit = subjectVisit.IsLostVisit,
|
||||
PDState = false,
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
|
||||
//await _subjectVisitRepository.AddRangeAsync()
|
||||
await _repository.AddRangeAsync(subjectVisits);
|
||||
|
||||
|
|
Loading…
Reference in New Issue