修改一版
parent
e5443a5016
commit
227dec2c94
|
@ -164,7 +164,7 @@ namespace IRaCIS.Application.Services
|
|||
SubjectVisitId = subjectVisit.Id,
|
||||
Identification = "Edit|Visit|Status|Visit-Image Upload",
|
||||
JsonDetail= JsonConvert.SerializeObject(new {
|
||||
SubmitState= "已提交",
|
||||
SubmitState= subjectVisit.SubmitState,
|
||||
|
||||
})
|
||||
|
||||
|
|
|
@ -143,9 +143,13 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public bool IsHaveClinicalData { get; set; }
|
||||
|
||||
public string MedicalNo { get; set; }
|
||||
|
||||
public int? Age { get; set; }
|
||||
public string Sex { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -130,19 +130,20 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
var subvisit = await _repository.GetQueryable<SubjectVisit>().FirstOrDefaultAsync(x => x.Id == subjectVisitId);
|
||||
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
// 修改访视状态
|
||||
//List<DataInspection> datas = new List<DataInspection>();
|
||||
//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 = subvisit.ToJcJson()
|
||||
});
|
||||
// SiteId = subvisit.SiteId,
|
||||
// SubjectId = subvisit.SubjectId,
|
||||
// TrialId = subvisit.TrialId,
|
||||
// SubjectVisitId = subvisit.Id,
|
||||
// Identification = "Edit|Visit|Status|Visit-Image Upload|Add Image",
|
||||
// JsonDetail = subvisit.ToJcJson()
|
||||
//});
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
//await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
@ -193,6 +194,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
JsonDetail = subvisit.ToJcJson()
|
||||
});
|
||||
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
}
|
||||
|
||||
|
|
|
@ -127,11 +127,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
// .ForMember(d => d.SubejctIsEnrollmentConfirm, u => u.MapFrom(t => t.Subject.IsEnrollmentConfirm))
|
||||
// .ForMember(d => d.SubejctFistGiveMedicineTime, u => u.MapFrom(t => t.Subject.FistGiveMedicineTime))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum))
|
||||
.ForMember(d => d.SubjectId, u => u.MapFrom(t => t.Subject.Id))
|
||||
.ForMember(d => d.Sex, u=> u.MapFrom(s => s.Subject.Sex))
|
||||
.ForMember(d => d.Age, u => u.MapFrom(t => t.Subject.Age))
|
||||
.ForMember(d => d.IsHaveClinicalData, u => u.MapFrom(t=> t.IsBaseLine? t.PreviousHistoryList.Any() || t.PreviousOtherList.Any() || t.PreviousPDFList.Any() || t.PreviousSurgeryList.Any() :false))
|
||||
.ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum))
|
||||
.ForMember(d => d.SubjectId, u => u.MapFrom(t => t.Subject.Id))
|
||||
.ForMember(d => d.MedicalNo, u => u.MapFrom(s => s.Subject.MedicalNo))
|
||||
.ForMember(d => d.Sex, u=> u.MapFrom(s => s.Subject.Sex))
|
||||
.ForMember(d => d.Age, u => u.MapFrom(t => t.Subject.Age))
|
||||
.ForMember(d => d.IsHaveClinicalData, u => u.MapFrom(t=> t.IsBaseLine? t.PreviousHistoryList.Any() || t.PreviousOtherList.Any() || t.PreviousPDFList.Any() || t.PreviousSurgeryList.Any() :false))
|
||||
|
||||
//.ForMember(d => d.VisitName, u => u.MapFrom(t =>t.InPlan? t.VisitStage.VisitName : t.VisitName))
|
||||
//.ForMember(d => d.VisitNum, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitNum : t.VisitNum))
|
||||
|
|
|
@ -16,11 +16,10 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
public async Task AfterSave(ITriggerContext<NoneDicomStudy> context, CancellationToken cancellationToken)
|
||||
{
|
||||
var subjectVisitId = context.Entity.SubjectVisitId;
|
||||
|
||||
|
||||
if (context.ChangeType == ChangeType.Added || context.ChangeType == ChangeType.Modified)
|
||||
{
|
||||
await UpdateSubjectVisitImageDateAsync(context.Entity.SubjectVisitId);
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateAsync(t => t.Id == subjectVisitId, u => new SubjectVisit()
|
||||
{
|
||||
VisitExecuted = VisitExecutedEnum.Executed
|
||||
|
@ -42,7 +41,6 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
if (context.ChangeType == ChangeType.Added )
|
||||
{
|
||||
await UpdateSubjectVisitImageDateAsync(subjectVisitId);
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateAsync(t => t.Id == subjectVisitId, u => new SubjectVisit()
|
||||
{
|
||||
VisitExecuted = VisitExecutedEnum.Executed
|
||||
|
@ -52,7 +50,6 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
if (context.ChangeType == ChangeType.Deleted)
|
||||
{
|
||||
await UpdateSubjectVisitImageDateAsync(subjectVisitId);
|
||||
|
||||
await UpdateSubjectVisitSubmitStateAsync(subjectVisitId);
|
||||
}
|
||||
|
||||
|
@ -61,12 +58,13 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
public async Task UpdateSubjectVisitSubmitStateAsync(Guid subjectVisitId)
|
||||
{
|
||||
|
||||
|
||||
//一个访视下面有多个检查,所以需要检测 没有的时候才清空 非dicom 是检查文件 不是表记录
|
||||
if (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.StudyList).CountAsync() == 0 &&
|
||||
await _subjectVisitRepository.Where(t => t.Id == subjectVisitId)
|
||||
.SelectMany(t => t.NoneDicomStudyList).SelectMany(u => u.NoneDicomFileList).CountAsync() == 0)
|
||||
{
|
||||
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.ToSubmit,
|
||||
u => new SubjectVisit() { VisitExecuted = 0, SVENDTC = null, SVSTDTC = null, SubmitState = SubmitStateEnum.None });
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue