Test.EIImageViewer
parent
da620303af
commit
943c44892a
|
@ -232,10 +232,10 @@ namespace IRaCIS.Core.API.Controllers
|
|||
/// </summary>
|
||||
[HttpPost, Route("Inspection/QCOperation/SetCheckPass")]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> SetCheckPass(DataInspectionDto<IDDto> opt)
|
||||
public async Task<IResponseOutput> SetCheckPass(DataInspectionDto<SetCheckPassDt> opt)
|
||||
{
|
||||
var fun = _qCOperationService.SetCheckPass;
|
||||
return await _inspectionService.Enforcement(opt.OptCommand.Id, opt.AuditInfo, opt.SignInfo, fun);
|
||||
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
<param name="opt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.SetCheckPass(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Contracts.IDDto})">
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.SetCheckPass(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Inspection.DTO.SetCheckPassDt})">
|
||||
<summary>
|
||||
手动设置一致性核查通过
|
||||
</summary>
|
||||
|
|
|
@ -1426,7 +1426,7 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.SetCheckPass(System.Guid)">
|
||||
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.SetCheckPass(IRaCIS.Core.Application.Service.Inspection.DTO.SetCheckPassDt)">
|
||||
<summary>
|
||||
手动设置一致性核查通过
|
||||
</summary>
|
||||
|
|
|
@ -169,7 +169,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
DicomInstance dicomInstance = CreateDicomInstance(dataset, dicomStudy, dicomSeries);
|
||||
|
||||
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
||||
|
||||
var createtime=DateTime.Now;
|
||||
|
@ -198,10 +197,12 @@ namespace IRaCIS.Core.Application.Services
|
|||
await _studyRepository.AddAsync(dicomStudy);
|
||||
}
|
||||
|
||||
if (isSeriesNeedAdd) {
|
||||
if (isSeriesNeedAdd)
|
||||
{
|
||||
// 添加序列
|
||||
|
||||
dicomSeries.Id = NewId.NextGuid();
|
||||
await _seriesRepository.AddAsync(dicomSeries);
|
||||
#region 稽查
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
|
||||
|
@ -222,8 +223,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
|
||||
|
@ -245,13 +244,12 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
})
|
||||
});
|
||||
|
||||
await _seriesRepository.AddAsync(dicomSeries);
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
|
||||
await _instanceRepository.AddAsync(dicomInstance);
|
||||
|
||||
|
||||
|
|
|
@ -235,6 +235,13 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
|
||||
}
|
||||
|
||||
public class SetCheckPassDt
|
||||
{
|
||||
public string ManualPassReason { get; set; } = string.Empty;
|
||||
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class ObtainOrCancelQCTaskDto
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts.DTO;
|
||||
using IRaCIS.Core.Application.Service.Inspection.DTO;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
@ -13,7 +14,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
Task<IResponseOutput> CheckBack(Guid subjectVisitId);
|
||||
Task<IResponseOutput> SetNeedReupload(Guid trialId, Guid qcChallengeId);
|
||||
Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState);
|
||||
Task<IResponseOutput> SetCheckPass(Guid subjectVisitId);
|
||||
Task<IResponseOutput> SetCheckPass(SetCheckPassDt data);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ using Newtonsoft.Json;
|
|||
using Magicodes.ExporterAndImporter.Csv;
|
||||
using IRaCIS.Core.Application.Service.Inspection.Interface;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using IRaCIS.Core.Application.Service.Inspection.DTO;
|
||||
|
||||
namespace IRaCIS.Core.Application.Image.QA
|
||||
{
|
||||
|
@ -414,14 +415,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{signId:guid}/{subjectVisitId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
public async Task<IResponseOutput> SetCheckPass(Guid subjectVisitId)
|
||||
public async Task<IResponseOutput> SetCheckPass(SetCheckPassDt data)
|
||||
{
|
||||
if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.ProjectManager)
|
||||
{
|
||||
ResponseOutput.NotOk("只允许PM 手动设置一致性核查通过");
|
||||
}
|
||||
|
||||
var sv = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId);
|
||||
var sv = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == data.Id);
|
||||
|
||||
if (sv == null) return Null404NotFound(sv);
|
||||
|
||||
|
@ -438,7 +439,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
sv.CheckState = CheckStateEnum.CVPassed;
|
||||
|
||||
sv.ForwardState = ForwardStateEnum.ToForward;
|
||||
|
||||
sv.ManualPassReason = data.ManualPassReason;
|
||||
sv.CheckPassedTime = DateTime.Now;
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
@ -1671,6 +1672,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).Select(x => new {
|
||||
StudyCode = x.DicomStudy.StudyCode,
|
||||
|
@ -1714,6 +1716,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
instanceIdList.ForEach(t =>
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ using IRaCIS.Core.Domain.Share;
|
|||
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using MediatR;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace IRaCIS.Core.Application.MediatR.Handlers
|
||||
|
@ -92,8 +93,11 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
|||
var svGroup = dbList.GroupBy(t => new { t.SubjectVisitId, t.SiteCode, t.SubjectCode, t.VisitName })
|
||||
.Select(g => new { g.Key.SubjectCode, g.Key.VisitName, g.Key.SiteCode, g.Key.SubjectVisitId, StudyList = g.ToList() }).ToList();
|
||||
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
var createtime = DateTime.Now;
|
||||
foreach (var sv in svGroup)
|
||||
{
|
||||
|
||||
//找到etc 当前visit site 和subject 一致的检查列表
|
||||
var etcVisitStudyList = etcList.Where(t => t.SubjectCode == sv.SubjectCode && t.SiteCode == sv.SiteCode && t.VisitName == sv.VisitName).ToList();
|
||||
var dbVisitStudyList = dbCheckList.Where(t => t.SubjectCode == sv.SubjectCode && t.SiteCode == sv.SiteCode && t.VisitName == sv.VisitName).ToList();
|
||||
|
@ -122,12 +126,61 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
|||
dbSV.CheckState = CheckStateEnum.CVPassed;
|
||||
dbSV.CheckPassedTime = DateTime.Now;
|
||||
dbSV.CheckResult = "核对EDC数据,完全一致";
|
||||
dbSV.ManualPassReason = "自动核查通过";
|
||||
dbSV.CheckChallengeDialogList.Add(new CheckChallengeDialog() { SubjectVisitId = sv.SubjectVisitId, TalkContent = dbSV.CheckResult, UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt });
|
||||
}
|
||||
else
|
||||
{
|
||||
dbSV.CheckResult = "根据导入的一致性核查数据,请确认本访视以下不一致检查项信息:" + String.Join(" | ", dbExceptExcel.Select(t => $"EDC 缺少:{t.StudyDate} {t.Modality} ")) + " | "
|
||||
+ String.Join(" | ", excelExceptDB.Select(t => $"IRC 缺少:{t.StudyDate} {t.Modality}"));
|
||||
//新增一致性核查质疑记录
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
|
||||
SiteId = dbSV.SiteId,
|
||||
SubjectId = dbSV.SubjectId,
|
||||
TrialId = dbSV.TrialId,
|
||||
SubjectVisitId = dbSV.Id,
|
||||
CreateTime = createtime.AddMilliseconds(200),
|
||||
Identification = "Add|Consistency Check Query|Data|Visit-Consistency Check",
|
||||
JsonDetail = JsonConvert.SerializeObject(new
|
||||
{
|
||||
SubmitState = "已提交",
|
||||
AuditState = "通过",
|
||||
CheckState = dbSV.CheckState == CheckStateEnum.CVIng ? "核查中" : "未核查",
|
||||
CheckResult= dbSV.CheckResult,
|
||||
TalkContent= dbSV.CheckResult,
|
||||
RequestBackState=dbSV.RequestBackState==RequestBackStateEnum.PM_AgressBack?"已回退":"未回退",
|
||||
CheckChallengeState = dbSV.CheckChallengeState == CheckChanllengeTypeEnum.Closed?"已关闭":"已回复",
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
|
||||
SiteId = dbSV.SiteId,
|
||||
SubjectId = dbSV.SubjectId,
|
||||
TrialId = dbSV.TrialId,
|
||||
SubjectVisitId = dbSV.Id,
|
||||
CreateTime = createtime.AddMilliseconds(500),
|
||||
Identification = "Edit|Consistency Check Query|Data|Visit-Consistency Check|Send",
|
||||
JsonDetail = JsonConvert.SerializeObject(new
|
||||
{
|
||||
SubmitState = "已提交",
|
||||
AuditState = "通过",
|
||||
CheckState = dbSV.CheckState == CheckStateEnum.CVIng ? "核查中" : "未核查",
|
||||
CheckResult = dbSV.CheckResult,
|
||||
TalkContent = dbSV.CheckResult,
|
||||
RequestBackState = dbSV.RequestBackState == RequestBackStateEnum.PM_AgressBack ? "已回退" : "未回退",
|
||||
CheckChallengeState = dbSV.CheckChallengeState == CheckChanllengeTypeEnum.Closed ? "已关闭" : "已回复",
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
dbSV.CheckState = CheckStateEnum.CVIng;
|
||||
dbSV.CheckChallengeState = CheckChanllengeTypeEnum.PMWaitCRCReply;
|
||||
|
||||
|
@ -137,6 +190,27 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
|||
|
||||
}
|
||||
dbSV.CheckTime = DateTime.Now;
|
||||
|
||||
// 在线一致性核查
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
|
||||
SiteId = dbSV.SiteId,
|
||||
SubjectId = dbSV.SubjectId,
|
||||
TrialId = dbSV.TrialId,
|
||||
SubjectVisitId = dbSV.Id,
|
||||
CreateTime= createtime,
|
||||
Reason= dbSV.ManualPassReason,
|
||||
Identification = "Add|Visit|Status|Visit-Consistency Check",
|
||||
JsonDetail = JsonConvert.SerializeObject(new
|
||||
{
|
||||
SubmitState = "已提交",
|
||||
AuditState= "通过",
|
||||
CheckState = dbSV.CheckState== CheckStateEnum.CVIng? "核查中": "核查通过",
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
|
|
@ -72,6 +72,11 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public DateTime? SubmitTime { get; set; }
|
||||
public DateTime? CheckTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 通过原因
|
||||
/// </summary>
|
||||
public string ManualPassReason { get; set; }
|
||||
|
||||
public bool IsUrgent { get; set; }
|
||||
|
||||
public bool IsTake { get; set; }
|
||||
|
|
Loading…
Reference in New Issue