稽查修改代码
parent
56331ea150
commit
63eeb88066
|
@ -836,6 +836,16 @@
|
|||
阅片临床数据ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.ReadingClinicalDataSignIndto.IsBlind">
|
||||
<summary>
|
||||
是否盲化
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.ReadingClinicalDataSignIndto.IsComplete">
|
||||
<summary>
|
||||
是否完整
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto`1">
|
||||
<summary>
|
||||
稽查泛型Dto
|
||||
|
|
|
@ -19,6 +19,7 @@ using IRaCIS.Core.Domain.Share.Reading;
|
|||
using System.Runtime.InteropServices;
|
||||
using DocumentFormat.OpenXml.Bibliography;
|
||||
using System.Linq.Expressions;
|
||||
using MathNet.Numerics.Statistics.Mcmc;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
@ -495,12 +496,21 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnitOfWork]
|
||||
public async Task BatchGenerateTask(BatchGenerateTaskCommand batchGenerateTaskCommand)
|
||||
public async Task<IResponseOutput> BatchGenerateTask(BatchGenerateTaskCommand batchGenerateTaskCommand)
|
||||
{
|
||||
|
||||
await _subjectCriteriaEvaluationVisitFilterRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == batchGenerateTaskCommand.SubjectId
|
||||
var trakingList= await _subjectCriteriaEvaluationVisitFilterRepository.Where(t => t.SubjectId == batchGenerateTaskCommand.SubjectId
|
||||
&& t.TrialReadingCriterionId == batchGenerateTaskCommand.TrialReadingCriterionId
|
||||
&& batchGenerateTaskCommand.SubjectVisitIdList.Contains(t.SubjectVisitId), u => new SubjectCriteriaEvaluationVisitFilter { IsGeneratedTask = true });
|
||||
&& batchGenerateTaskCommand.SubjectVisitIdList.Contains(t.SubjectVisitId),true).ToListAsync();
|
||||
|
||||
foreach (var item in trakingList)
|
||||
{
|
||||
item.IsGeneratedTask = true;
|
||||
}
|
||||
|
||||
//await _subjectCriteriaEvaluationVisitFilterRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == batchGenerateTaskCommand.SubjectId
|
||||
//&& t.TrialReadingCriterionId == batchGenerateTaskCommand.TrialReadingCriterionId
|
||||
//&& batchGenerateTaskCommand.SubjectVisitIdList.Contains(t.SubjectVisitId), u => new SubjectCriteriaEvaluationVisitFilter { IsGeneratedTask = true });
|
||||
|
||||
//自动生成任务
|
||||
|
||||
|
@ -513,6 +523,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
var generateVisitIdList = idList.Except(haveGenerateVisitIdList);
|
||||
|
||||
await _IVisitTaskHelpeService.BaseCritrionGenerateVisitTask(batchGenerateTaskCommand.TrialId, batchGenerateTaskCommand.TrialReadingCriterionId, true, generateVisitIdList.Select(t => (Guid)t).ToList());
|
||||
|
||||
await _subjectCriteriaEvaluationVisitFilterRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
@ -573,10 +587,35 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> BatchAddSubjectCriteriaEvaluationVisitStudyFilter(List<SubjectCriteriaEvaluationVisitStudyFilterAddOrEdit> batchList)
|
||||
{
|
||||
var ids = batchList.Select(t => t.Id).ToList();
|
||||
await _subjectCriteriaEvaluationVisitStudyFilterRepository.BatchDeleteNoTrackingAsync(t => ids.Contains(t.Id));
|
||||
|
||||
var ids = batchList.Where(t => t.Id != null).Select(t => t.Id).ToList();
|
||||
#region 稽查修改前
|
||||
|
||||
//await _subjectCriteriaEvaluationVisitStudyFilterRepository.BatchDeleteNoTrackingAsync(t => ids.Contains(t.Id));
|
||||
|
||||
//await _subjectCriteriaEvaluationVisitStudyFilterRepository.AddRangeAsync(_mapper.Map<List<SubjectCriteriaEvaluationVisitStudyFilter>>(batchList));
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 查询再更新
|
||||
if (ids.Count > 0)
|
||||
{
|
||||
var list = await _subjectCriteriaEvaluationVisitStudyFilterRepository.Where(t => ids.Contains(t.Id), true).ToListAsync();
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.IsReading = batchList.FirstOrDefault(t => t.Id == item.Id)?.IsReading ?? item.IsReading;
|
||||
item.IsConfirmed = batchList.FirstOrDefault(t => t.Id == item.Id)?.IsConfirmed ?? item.IsConfirmed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await _subjectCriteriaEvaluationVisitStudyFilterRepository.AddRangeAsync(_mapper.Map<List<SubjectCriteriaEvaluationVisitStudyFilter>>(batchList));
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
var first = batchList.First();
|
||||
|
|
|
@ -163,9 +163,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
{
|
||||
//TrialDicList = string.Join(",", trialDics)
|
||||
|
||||
CriterionNames = string.Join(",", criterionNameList.Union(memoryCriterionNameList).Distinct()) ,
|
||||
CriterionNames = string.Join(",", criterionNameList.Union(memoryCriterionNameList).Distinct()),
|
||||
|
||||
ClinicalDataSetNames = string.Join(",", clinicalDataSetNameList.Union(memoryClinicalDataSetNameList).Distinct().OrderBy(t=>t)) ,
|
||||
ClinicalDataSetNames = string.Join(",", clinicalDataSetNameList.Union(memoryClinicalDataSetNameList).Distinct().OrderBy(t => t)),
|
||||
|
||||
|
||||
}); ;
|
||||
|
@ -946,6 +946,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 热键 模板 个性化配置
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 附加评估
|
||||
|
@ -980,9 +987,59 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
var entity = item.Entity as SubjectCriteriaEvaluationVisitFilter;
|
||||
|
||||
|
||||
if (type == AuditOpt.Add)
|
||||
{
|
||||
if (entity.IsGeneratedTask)
|
||||
{
|
||||
extraIdentification = "/AutoGenerate";
|
||||
}
|
||||
else
|
||||
{
|
||||
extraIdentification = "/Add";
|
||||
}
|
||||
}
|
||||
|
||||
if (type == AuditOpt.Update)
|
||||
{
|
||||
|
||||
//手动生成任务
|
||||
|
||||
if (entity.IsGeneratedTask)
|
||||
{
|
||||
//Update
|
||||
extraIdentification = "/ManualGenerate";
|
||||
}
|
||||
|
||||
|
||||
//回退接口
|
||||
else if (_userInfo.RequestUrl == "SubjectCriteriaEvaluation/confirmBackCriteriaVisitTask")
|
||||
{
|
||||
extraIdentification = "/Back";
|
||||
}
|
||||
else
|
||||
{
|
||||
//筛选影像保存接口
|
||||
//if (_userInfo.RequestUrl == "SubjectCriteriaEvaluation/batchAddSubjectCriteriaEvaluationVisitStudyFilter")
|
||||
//{
|
||||
extraIdentification = "/Update";
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
await InsertInspection<SubjectCriteriaEvaluationVisitFilter>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface = false,
|
||||
IsSelfDefine=true,
|
||||
ExtraIndentification=extraIdentification,
|
||||
ObjectRelationParentId = x.SubjectVisitId,
|
||||
ObjectRelationParentId2 = x.TrialReadingCriterionId,
|
||||
|
||||
|
@ -998,11 +1055,25 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
var entity = item.Entity as SubjectCriteriaEvaluationVisitStudyFilter;
|
||||
|
||||
if (entity.IsConfirmed == true)
|
||||
{
|
||||
extraIdentification = "/Confirm";
|
||||
}
|
||||
else
|
||||
{
|
||||
extraIdentification = "/Save";
|
||||
}
|
||||
|
||||
await InsertInspection<SubjectCriteriaEvaluationVisitStudyFilter>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface = false,
|
||||
ObjectRelationParentId = x.SeriesId,
|
||||
ObjectRelationParentId2 = x.StudyId,
|
||||
IsSelfDefine = true,
|
||||
|
||||
ExtraIndentification = extraIdentification,
|
||||
|
||||
ObjectRelationParentId = x.StudyId,
|
||||
ObjectRelationParentId2 = x.SeriesId,//序列有的稽查没有记录,所以StudyId放前面
|
||||
|
||||
ObjectRelationParentId3 = x.TrialReadingCriterionId,
|
||||
|
||||
TrialReadingCriterionId = x.TrialReadingCriterionId,
|
||||
|
@ -1363,7 +1434,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
Reason = reason,
|
||||
|
||||
ExtraIndentification=extraIdentification,
|
||||
ExtraIndentification = extraIdentification,
|
||||
ObjectRelationParentId = entity.SubjectVisitId,
|
||||
}
|
||||
|
||||
|
@ -1579,7 +1650,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
await InsertInspection<SystemBasicData>(item.Entity as SystemBasicData, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface = false,
|
||||
ExtraIndentification=extraIdentification
|
||||
ExtraIndentification = extraIdentification
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1779,8 +1850,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
await InsertInspection<SubjectVisit>(item.Entity as SubjectVisit, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface= isDistinctionInterface,
|
||||
Reason= reason,
|
||||
IsDistinctionInterface = isDistinctionInterface,
|
||||
Reason = reason,
|
||||
|
||||
//Subject的信息 找离的最近的Subject稽查信息
|
||||
ObjectRelationParentId = x.SubjectId,
|
||||
|
@ -2870,7 +2941,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
var generalId = (inspection.GeneralId != null && inspection.GeneralId != Guid.Empty) ? inspection.GeneralId : entityObj.Id;
|
||||
inspection.GeneralId = generalId;
|
||||
|
||||
inspection.Identification = await GetInspectionRecordIdentificationAsync(entityObj, type, inspection.IsDistinctionInterface,inspection.IsSelfDefine) + inspection.ExtraIndentification;
|
||||
inspection.Identification = await GetInspectionRecordIdentificationAsync(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine) + inspection.ExtraIndentification;
|
||||
|
||||
//将实体对象属性 映射到稽查实体
|
||||
MapEntityPropertyToAuditEntity(entityObj, inspection);
|
||||
|
@ -3079,7 +3150,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
/// 获取稽查记录的标识符 部分业务会进行特殊处理
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetInspectionRecordIdentificationAsync<T>( T entityObj, string type, bool IsDistinctionInterface = true,bool isSelfDefine = false)
|
||||
public async Task<string> GetInspectionRecordIdentificationAsync<T>(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false)
|
||||
{
|
||||
var entityTypeName = entityObj.GetType().Name;
|
||||
|
||||
|
|
Loading…
Reference in New Issue