Uat_Study
parent
a678e0f8e1
commit
46e2add410
|
@ -181,55 +181,55 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
public async Task<dynamic> Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput? response=null)
|
||||
{
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
|
||||
//if (response!=null&&response.IsSuccess == false)
|
||||
//{
|
||||
// return response;
|
||||
//}
|
||||
//Guid? signId = null;
|
||||
//MapData(OptCommand, AuditInfo);
|
||||
//if (AuditInfo.IsSign)
|
||||
//{
|
||||
// // 验证用户签名信息
|
||||
// var verifyResult = await VerifySignatureAsync(SignInfo);
|
||||
// signId = await AddSignRecordAsync(SignInfo);
|
||||
// if (verifyResult.IsSuccess == false)
|
||||
// {
|
||||
// return verifyResult;
|
||||
// }
|
||||
// //await AddSignRecordAsync(SignInfo);
|
||||
//}
|
||||
if (response != null && response.IsSuccess == false)
|
||||
{
|
||||
return response;
|
||||
}
|
||||
Guid? signId = null;
|
||||
MapData(OptCommand, AuditInfo);
|
||||
if (AuditInfo.IsSign)
|
||||
{
|
||||
// 验证用户签名信息
|
||||
var verifyResult = await VerifySignatureAsync(SignInfo);
|
||||
signId = await AddSignRecordAsync(SignInfo);
|
||||
if (verifyResult.IsSuccess == false)
|
||||
{
|
||||
return verifyResult;
|
||||
}
|
||||
//await AddSignRecordAsync(SignInfo);
|
||||
}
|
||||
|
||||
//IResponseOutput bResult;
|
||||
IResponseOutput bResult;
|
||||
|
||||
//if (response != null)
|
||||
//{
|
||||
// bResult = response;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// bResult = await fun(OptCommand);
|
||||
//}
|
||||
if (response != null)
|
||||
{
|
||||
bResult = response;
|
||||
}
|
||||
else
|
||||
{
|
||||
bResult = await fun(OptCommand);
|
||||
}
|
||||
|
||||
//// 用户 签名某个文档
|
||||
//if (bResult.IsSuccess == false)
|
||||
//{
|
||||
// return bResult;
|
||||
//}
|
||||
// 用户 签名某个文档
|
||||
if (bResult.IsSuccess == false)
|
||||
{
|
||||
return bResult;
|
||||
}
|
||||
|
||||
//if (AuditInfo.IsSign)
|
||||
//{
|
||||
// var signSuccess = await _repository.BatchUpdateAsync<TrialSign>(t => t.Id == signId, u => new TrialSign() { IsCompleted = true });
|
||||
//}
|
||||
if (AuditInfo.IsSign)
|
||||
{
|
||||
var signSuccess = await _repository.BatchUpdateAsync<TrialSign>(t => t.Id == signId, u => new TrialSign() { IsCompleted = true });
|
||||
}
|
||||
|
||||
//// 判断是否需要前面
|
||||
//if (AuditInfo.NeedSava)
|
||||
//{
|
||||
// await AddInspectionRecordAsync(AuditInfo, signId);
|
||||
//}
|
||||
|
||||
//return bResult;
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,6 +32,6 @@ namespace IRaCIS.Core.Application.Service.Inspection.Interface
|
|||
/// </summary>
|
||||
/// <param name="datas"></param>
|
||||
/// <returns></returns>
|
||||
Task AddListInspectionRecordAsync(List<DataInspection> datas);
|
||||
//Task AddListInspectionRecordAsync(List<DataInspection> datas);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -965,38 +965,13 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
}
|
||||
var waitDeleteStudyList = await _dicomStudyRepository.Where(x => ids.Contains(x.Id)).ToListAsync();
|
||||
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
||||
|
||||
waitDeleteStudyList.ForEach(x =>
|
||||
{
|
||||
|
||||
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
|
||||
SiteId = x.SiteId,
|
||||
SubjectId = x.SubjectId,
|
||||
TrialId = x.TrialId,
|
||||
SubjectVisitId = x.SubjectVisitId,
|
||||
GeneralId = x.Id,
|
||||
CreateTime = DateTime.Now,
|
||||
Identification = "Delete|DICOM Study|Data|Visit-Image Upload",
|
||||
JsonDetail = JsonConvert.SerializeObject(new
|
||||
{
|
||||
studyUid = x.StudyCode,
|
||||
modality = x.Modalities,
|
||||
bodyPart = x.BodyPartForEdit,
|
||||
seriesNum = x.SeriesCount,
|
||||
fileNum = x.InstanceCount,
|
||||
studyTime = x.StudyTime?.ToString("yyyy-MM-dd")
|
||||
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
var createtime = DateTime.Now.AddMilliseconds(200);
|
||||
|
||||
foreach (var study in waitDeleteStudyList)
|
||||
{
|
||||
|
||||
|
@ -1022,30 +997,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
}).ToListAsync();
|
||||
|
||||
DicomSeriess.ForEach(x =>
|
||||
{
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
|
||||
SiteId = x.SiteId,
|
||||
SubjectId = x.SubjectId,
|
||||
TrialId = x.TrialId,
|
||||
GeneralId = x.Id,
|
||||
SubjectVisitId = x.SubjectVisitId,
|
||||
CreateTime = createtime,
|
||||
Identification = "Delete|DICOM Series|Data|Visit-Image Upload",
|
||||
JsonDetail = JsonConvert.SerializeObject(new
|
||||
{
|
||||
StudyCode = x.StudyCode,
|
||||
Modalities = x.Modalities,
|
||||
SeriesNumber = x.SeriesNumber,
|
||||
InstanceCount = x.InstanceCount,
|
||||
SeriesTime = x.SeriesTime,
|
||||
IsReading = x.IsReading,
|
||||
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
var success3 = await _repository.BatchDeleteAsync<DicomSeries>(t => t.StudyId == id);
|
||||
var success4 = await _repository.BatchDeleteAsync<StudyMonitor>(t => t.StudyId == id);
|
||||
|
@ -1071,7 +1023,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
var subvisit = await _repository.GetQueryable<SubjectVisit>().FirstOrDefaultAsync(x => x.Id == subjectVisitId);
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
@ -1416,41 +1367,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
//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 = x.ToJcJson(),
|
||||
});
|
||||
});
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
return ResponseOutput.Result(success);
|
||||
|
||||
|
||||
|
@ -1618,54 +1534,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
var instanceIdList = await _repository.Where<DicomInstance>(t => t.DicomSerie.IsDeleted && t.SubjectVisitId == subjectVisitId)
|
||||
.Select(t => new { InstanceId = t.Id, t.SeriesId, t.StudyId, t.SubjectId, t.SiteId }).ToListAsync();
|
||||
|
||||
// 删除序列
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
var DicomSeriesdata = await _repository.GetQueryable<DicomSeries>().Where(x => x.SubjectVisitId == subjectVisitId && x.IsDeleted).Select(x => new
|
||||
{
|
||||
StudyCode = x.DicomStudy.StudyCode,
|
||||
Modalities = x.DicomStudy.Modalities,
|
||||
SeriesNumber = x.SeriesNumber,
|
||||
InstanceCount = x.InstanceCount,
|
||||
SeriesTime = x.SeriesTime,
|
||||
TrialId = x.TrialId,
|
||||
SiteId = x.SiteId,
|
||||
x.SubjectId,
|
||||
x.SubjectVisitId,
|
||||
x.IsDeleted,
|
||||
x.IsReading,
|
||||
x.Id,
|
||||
|
||||
}).ToListAsync();
|
||||
DateTime time = DateTime.Now.AddMilliseconds(500);
|
||||
DicomSeriesdata.ForEach(x =>
|
||||
{
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
TrialId = x.TrialId,
|
||||
SiteId = x.SiteId,
|
||||
SubjectId = x.SubjectId,
|
||||
SubjectVisitId = x.SubjectVisitId,
|
||||
GeneralId = x.Id,
|
||||
CreateTime = time,
|
||||
Identification = "Delete|DICOM Series|Data|Visit-Image Quanlity Control",
|
||||
JsonDetail = JsonConvert.SerializeObject(new
|
||||
{
|
||||
StudyCode = x.StudyCode,
|
||||
Modalities = x.Modalities,
|
||||
SeriesNumber = x.SeriesNumber,
|
||||
InstanceCount = x.InstanceCount,
|
||||
SeriesTime = x.SeriesTime,
|
||||
IsReading = x.IsReading,
|
||||
IsDeleted = x.IsDeleted,
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
|
||||
instanceIdList.ForEach(t =>
|
||||
{
|
||||
var path = _dicomFileStoreHelper.GetInstanceFilePath(new DicomStudy() { Id = t.StudyId, SubjectId = t.SubjectId, TrialId = trialId, SiteId = t.SiteId, SubjectVisitId = subjectVisitId }, t.SeriesId, t.InstanceId.ToString());
|
||||
|
@ -1981,29 +1850,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
if (command.SubjectFirstGiveMedicineTime != null)
|
||||
{
|
||||
|
||||
await _subjectRepository.UpdatePartialFromQueryAsync(command.SubjectId, u => new Subject() { FirstGiveMedicineTime = command.SubjectFirstGiveMedicineTime, });
|
||||
|
||||
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
||||
if (dbSubjectVisit.IsBaseLine)
|
||||
{
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
|
||||
SubjectId = command.SubjectId,
|
||||
SiteId = dbSubjectVisit.SiteId,
|
||||
TrialId = dbSubjectVisit.TrialId,
|
||||
IsSign = false,
|
||||
Identification = "Edit|Subject|Info|Subject",
|
||||
CreateTime = DateTime.Now.AddSeconds(1),
|
||||
JsonDetail = command.ToJcJson()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
}
|
||||
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
|
|
|
@ -118,31 +118,14 @@ namespace IRaCIS.Application.Services
|
|||
return ResponseOutput.NotOk("This subject has executed a visit with uploading study images,and couldn't be deleted.");
|
||||
}
|
||||
|
||||
var isSuccess = await _subjectRepository.BatchDeleteNoTrackingAsync(u => u.Id == id);
|
||||
var isSuccess = await _subjectRepository.DeleteFromQueryAsync(u => u.Id == id);
|
||||
await _subjectVisitRepository.DeleteFromQueryAsync(u => u.SubjectId == id);
|
||||
|
||||
|
||||
var subvisit = await _subjectVisitRepository.Where(x => x.SubjectId == id).ToListAsync();
|
||||
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
||||
foreach (var item in subvisit)
|
||||
{
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
SiteId = item.SiteId,
|
||||
SubjectId = item.SubjectId,
|
||||
TrialId = item.TrialId,
|
||||
SubjectVisitId = item.Id,
|
||||
Identification = "Delete|Visit|Data|Visit-Image Upload",
|
||||
JsonDetail = JsonConvert.SerializeObject(item)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
return ResponseOutput.Result(isSuccess);
|
||||
|
||||
return ResponseOutput.Result(true);
|
||||
}
|
||||
|
||||
/// <summary> 分页获取受试者列表[New] </summary>
|
||||
|
|
Loading…
Reference in New Issue