diff --git a/IRaCIS.Core.API/Controllers/StudyController.cs b/IRaCIS.Core.API/Controllers/StudyController.cs index 150939df1..4c58095b1 100644 --- a/IRaCIS.Core.API/Controllers/StudyController.cs +++ b/IRaCIS.Core.API/Controllers/StudyController.cs @@ -214,10 +214,28 @@ namespace IRaCIS.Api.Controllers DataInspectionAddDTO data = JsonConvert.DeserializeObject(archiveStudyCommand.AuditInfo); data.GeneralId = archivedStudyIds[0]; - + data.CreateTime = DateTime.Now; await _inspectionService.AddInspectionRecordAsync(data); + + List datas = new List(); + datas.Add(new DataInspection() + { + + SiteId = savedInfo.SiteId, + SubjectId = savedInfo.SubjectId, + TrialId = savedInfo.TrialId, + SubjectVisitId = savedInfo.SubjectVisitId, + Identification = "Edit|Visit|Status|Visit-Image Upload|Add Image", + JsonDetail = JsonConvert.SerializeObject(new + { + SubmitState = "待提交", + }) + }); + + await _inspectionService.AddListInspectionRecordAsync(datas); + return ResponseOutput.Ok(archiveResult); } diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs index 4b9b8e29c..d4509caaf 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -108,7 +108,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO ////需要单独处理 //public string IP { get; set; } - //public Guid? SignId { get; set; } + public DateTime? CreateTime { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index f6312dcb1..84fa40745 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -276,6 +276,10 @@ namespace IRaCIS.Core.Application.Service.Inspection /// public async Task AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId=null) { + if (addDto == new DataInspectionAddDTO()) + { + return ResponseOutput.Ok(); + } await SetEnum(addDto); var add = _mapper.Map(addDto); Guid? parentId = null; @@ -369,6 +373,10 @@ namespace IRaCIS.Core.Application.Service.Inspection var JsonData = JsonConvert.DeserializeObject>(Data.JsonDetail); foreach (var item in Data.EnumList) { + if (!JsonData.ContainsKey(item.Key)) + { + continue; + } var value = JsonData[item.Key]; if (value.GetType() == typeof(JArray)) { diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index dc8713038..b2d6c57ac 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -47,7 +47,7 @@ namespace IRaCIS.Core.Application.Contracts [NotDefault] public Guid TrialId { get; set; } - public Guid? SignId { get; set; } + //public Guid? SignId { get; set; } public Guid[] SubjectVisitIds { get; set; }=new Guid[0]; } diff --git a/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs b/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs index 54fc3fabd..fac5e94c6 100644 --- a/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs +++ b/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs @@ -155,6 +155,26 @@ namespace IRaCIS.Core.Application.Contracts await _repository.UpdateFromQueryAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.ToSubmit, u => new SubjectVisit() { VisitExecuted = 0, SubmitState = SubmitStateEnum.None }); } + + var subvisit = await _repository.GetQueryable().FirstOrDefaultAsync(x => x.Id == subjectVisitId); + + List datas = new List(); + datas.Add(new DataInspection() + { + + SiteId = subvisit.SiteId, + SubjectId = subvisit.SubjectId, + TrialId = subvisit.TrialId, + SubjectVisitId = subvisit.Id, + Identification = "Edit|Visit|Status|Visit-Image Upload|Add Image", + JsonDetail = JsonConvert.SerializeObject(new + { + SubmitState = "待提交", + }) + }); + + await _inspectionService.AddListInspectionRecordAsync(datas); + return ResponseOutput.Ok(); } @@ -189,6 +209,25 @@ namespace IRaCIS.Core.Application.Contracts var data = JsonConvert.DeserializeObject(fileDto.AuditInfo); data.GeneralId = fileDto.noneDicomStudyId; await _inspectionService.AddInspectionRecordAsync(data); + + var subvisit =await _repository.GetQueryable().FirstOrDefaultAsync(x => x.Id == fileDto.subjectVisitId); + + List datas = new List(); + datas.Add(new DataInspection() + { + + SiteId = subvisit.SiteId, + SubjectId = subvisit.SubjectId, + TrialId = subvisit.TrialId, + SubjectVisitId = subvisit.Id, + Identification = "Edit|Visit|Status|Visit-Image Upload|Add Image", + JsonDetail = JsonConvert.SerializeObject(new + { + SubmitState = "待提交", + }) + }); + + await _inspectionService.AddListInspectionRecordAsync(datas); } return result; diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index 3e5ce20b1..7160d0cda 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -966,6 +966,7 @@ namespace IRaCIS.Core.Application.Image.QA TrialId = x.TrialId, SubjectVisitId=x.SubjectVisitId, GeneralId=x.Id, + Identification= "Delete|DICOM Study|Data|Visit-Image Upload", JsonDetail = JsonConvert.SerializeObject(new { studyUid=x.StudyCode, @@ -980,6 +981,11 @@ namespace IRaCIS.Core.Application.Image.QA }); + + + + + #region will calls error wried //ids.ToList().ForEach(async id => //{ @@ -1046,6 +1052,23 @@ namespace IRaCIS.Core.Application.Image.QA LatestScanDate = maxArray.Max() }); + + var subvisit = await _repository.GetQueryable().FirstOrDefaultAsync(x => x.Id == subjectVisitId); + + + datas.Add(new DataInspection() + { + + SiteId = subvisit.SiteId, + SubjectId = subvisit.SubjectId, + TrialId = subvisit.TrialId, + SubjectVisitId = subvisit.Id, + Identification = "Edit|Visit|Status|Visit-Image Upload|Add Image", + JsonDetail = JsonConvert.SerializeObject(new + { + SubmitState = "待提交", + }) + }); await _sinspectionService.AddListInspectionRecordAsync(datas); return ResponseOutput.Ok(); } @@ -1222,7 +1245,7 @@ namespace IRaCIS.Core.Application.Image.QA //已确认临床数据完整性 dbSubjectVisit.IsConfirmedClinicalData = true; - var signSuccess = await _repository.UpdateFromQueryAsync(t => t.Id == cRCRequestToQCCommand.SignId, u => new TrialSign() { IsCompleted = true }); + //var signSuccess = await _repository.UpdateFromQueryAsync(t => t.Id == cRCRequestToQCCommand.SignId, u => new TrialSign() { IsCompleted = true }); ////现在修改为 提交时 设置签名信息 @@ -1291,8 +1314,46 @@ namespace IRaCIS.Core.Application.Image.QA var success = await _repository.SaveChangesAsync(); + List datas = new List(); + dbSubjectVisitList.ForEach(x => + { + datas.Add(new DataInspection() + { + + SiteId = x.SiteId, + SubjectId = x.SubjectId, + TrialId = x.TrialId, + SubjectVisitId = x.Id, + Identification= "Edit|Visit|Status|Visit-Image Upload", + JsonDetail = JsonConvert.SerializeObject(new + { + SubmitState = "已提交", + + + }) + }); + }); + + dbSubjectVisitList.ForEach(x => + { + datas.Add(new DataInspection() + { + + SiteId = x.SiteId, + SubjectId = x.SubjectId, + TrialId = x.TrialId, + SubjectVisitId = x.Id, + Identification = "Edit|Visit|Status|Visit-Image Upload-1", + JsonDetail = JsonConvert.SerializeObject(new + { + SubmitState = "已提交", + }) + }); + }); + + await _sinspectionService.AddListInspectionRecordAsync(datas); return ResponseOutput.Result(success);