项目bodypart 以及bug
parent
9875d9622d
commit
8bcac405e5
|
@ -48,7 +48,7 @@ namespace IRaCIS.Core.Application.AutoMapper
|
|||
|
||||
CreateMap<TrialSiteSurvey, TrialSiteSurveyView>()
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => isEn_Us ? s.Site.SiteName : s.Site.SiteNameCN))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName ))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode));
|
||||
|
||||
CreateMap<TrialSiteSurvey, TrialSiteSurveySelectView>();
|
||||
|
|
|
@ -1084,4 +1084,31 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
//public string TrialSiteSurveyEquipmentType { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class AddOrUpdateTrialBodyPartCommand
|
||||
{
|
||||
public string Code { get; set; }
|
||||
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
|
||||
public string NameCN { get; set; }
|
||||
|
||||
|
||||
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
||||
public class TrialBodyPartView
|
||||
{
|
||||
public string Code { get; set; }
|
||||
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ using static IRaCIS.Core.Domain.Share.StaticData;
|
|||
using IRaCIS.Core.Application.Service;
|
||||
using DocumentFormat.OpenXml.Office.CustomUI;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Application.Contracts;
|
||||
|
||||
namespace IRaCIS.Core.Application
|
||||
{
|
||||
|
@ -178,7 +179,7 @@ namespace IRaCIS.Core.Application
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<GetTrialReadingInfoOutDto> > GetCriterionReadingInfo(GetTrialReadingInfoInDto inDto)
|
||||
public async Task<IResponseOutput<GetTrialReadingInfoOutDto>> GetCriterionReadingInfo(GetTrialReadingInfoInDto inDto)
|
||||
{
|
||||
|
||||
GetTrialReadingInfoOutDto trialInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).ProjectTo<GetTrialReadingInfoOutDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
|
@ -191,36 +192,36 @@ namespace IRaCIS.Core.Application
|
|||
trialInfo.TrialCriterionAdditionalAssessmentTypeList = await _trialCriterionAdditionalAssessmentTypeRepository.Where(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId).ToListAsync();
|
||||
|
||||
|
||||
return ResponseOutput.Ok(trialInfo) ;
|
||||
return ResponseOutput.Ok(trialInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置并同步标准
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> ResetAndAsyncCriterion(ResetAndAsyncCriterionInDto inDto)
|
||||
{
|
||||
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial
|
||||
{
|
||||
SynchronizeOriginalTime = null,
|
||||
SynchronizeTime = DateTime.Now.AddYears(-20),
|
||||
IsSigned = false,
|
||||
ReadingInfoSignTime = null,
|
||||
/// <summary>
|
||||
/// 重置并同步标准
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> ResetAndAsyncCriterion(ResetAndAsyncCriterionInDto inDto)
|
||||
{
|
||||
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial
|
||||
{
|
||||
SynchronizeOriginalTime = null,
|
||||
SynchronizeTime = DateTime.Now.AddYears(-20),
|
||||
IsSigned = false,
|
||||
ReadingInfoSignTime = null,
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
await AsyncTrialCriterionDictionary(new AsyncTrialCriterionDictionaryInDto() { TrialReadingCriterionId = inDto.TrialReadingCriterionId });
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
await AsyncTrialCriterionDictionary(new AsyncTrialCriterionDictionaryInDto() { TrialReadingCriterionId = inDto.TrialReadingCriterionId });
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 同步项目标准所有信息
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
/// <summary>
|
||||
/// 同步项目标准所有信息
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AsyncTrialCriterionDictionary(AsyncTrialCriterionDictionaryInDto inDto)
|
||||
{
|
||||
|
||||
|
@ -322,7 +323,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
IsOncologyReading = systemCriterion.IsOncologyReading,
|
||||
IsSystemSetOncology = systemCriterion.IsOncologyReading,
|
||||
IseCRFShowInDicomReading = systemCriterion.IseCRFShowInDicomReading,
|
||||
IseCRFShowInDicomReading = systemCriterion.IseCRFShowInDicomReading,
|
||||
});
|
||||
|
||||
|
||||
|
@ -601,9 +602,9 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
|
||||
{
|
||||
ImageDownloadEnum=inDto.ImageDownloadEnum,
|
||||
ImageUploadEnum=inDto.ImageUploadEnum,
|
||||
CriterionModalitys=inDto.CriterionModalitys,
|
||||
ImageDownloadEnum = inDto.ImageDownloadEnum,
|
||||
ImageUploadEnum = inDto.ImageUploadEnum,
|
||||
CriterionModalitys = inDto.CriterionModalitys,
|
||||
ReadingTool = inDto.ReadingTool,
|
||||
IsReadingPeriod = inDto.IsReadingPeriod,
|
||||
//DigitPlaces=inDto.DigitPlaces,
|
||||
|
@ -621,7 +622,7 @@ namespace IRaCIS.Core.Application
|
|||
IsGlobalReading = inDto.IsGlobalReading,
|
||||
IsArbitrationReading = inDto.IsArbitrationReading,
|
||||
IsOncologyReading = inDto.IsOncologyReading,
|
||||
IsUrgent= inDto.IsUrgent,
|
||||
IsUrgent = inDto.IsUrgent,
|
||||
IsAdditionalAssessment = inDto.IsAdditionalAssessment,
|
||||
IsAutoCreate = inDto.IsAutoCreate
|
||||
|
||||
|
@ -960,32 +961,32 @@ namespace IRaCIS.Core.Application
|
|||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
[HttpPost]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt", "AfterStopCannNotOpt" })]
|
||||
public async Task ConfigTrialProcessInfoVerification(ConfigTrialProcessInfoVerificationInDto trialConfig)
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt", "AfterStopCannNotOpt" })]
|
||||
public async Task ConfigTrialProcessInfoVerification(ConfigTrialProcessInfoVerificationInDto trialConfig)
|
||||
{
|
||||
if (!await _trialRepository.Where(t => t.Id == trialConfig.TrialId).IgnoreQueryFilters().AnyAsync(t => t.TrialStatusStr == StaticData.TrialState.TrialInitializing))
|
||||
{
|
||||
//---该项目当前状态不是初始化,不允许进行该操作。
|
||||
throw new BusinessValidationFailedException(_localizer["TrialConfig_ProjectNotInitialized"]);
|
||||
}
|
||||
var clinicalDataTrialSetDataList = await _clinicalDataTrialSetRepository.Where(x => trialConfig.ClinicalDataTrialSetIds.Contains(x.Id)).Include(x => x.TrialClinicalDataSetCriteriaList).ToListAsync();
|
||||
foreach (var item in clinicalDataTrialSetDataList)
|
||||
{
|
||||
var clinicalids = item.TrialClinicalDataSetCriteriaList.Select(x => x.TrialReadingCriterionId).ToList();
|
||||
if (clinicalids.Intersect(trialConfig.TrialCriterionIds).ToList().Count() == 0)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["TrialConfig_NoCriteriaClinicalData"]);
|
||||
}
|
||||
if (!await _trialRepository.Where(t => t.Id == trialConfig.TrialId).IgnoreQueryFilters().AnyAsync(t => t.TrialStatusStr == StaticData.TrialState.TrialInitializing))
|
||||
{
|
||||
//---该项目当前状态不是初始化,不允许进行该操作。
|
||||
throw new BusinessValidationFailedException(_localizer["TrialConfig_ProjectNotInitialized"]);
|
||||
}
|
||||
var clinicalDataTrialSetDataList = await _clinicalDataTrialSetRepository.Where(x => trialConfig.ClinicalDataTrialSetIds.Contains(x.Id)).Include(x => x.TrialClinicalDataSetCriteriaList).ToListAsync();
|
||||
foreach (var item in clinicalDataTrialSetDataList)
|
||||
{
|
||||
var clinicalids = item.TrialClinicalDataSetCriteriaList.Select(x => x.TrialReadingCriterionId).ToList();
|
||||
if (clinicalids.Intersect(trialConfig.TrialCriterionIds).ToList().Count() == 0)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["TrialConfig_NoCriteriaClinicalData"]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置流程
|
||||
/// </summary>
|
||||
/// <param name="trialConfig"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
/// <summary>
|
||||
/// 配置流程
|
||||
/// </summary>
|
||||
/// <param name="trialConfig"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt", "AfterStopCannNotOpt" })]
|
||||
public async Task<IResponseOutput> ConfigTrialProcessInfo(TrialProcessConfig trialConfig)
|
||||
|
@ -996,7 +997,7 @@ namespace IRaCIS.Core.Application
|
|||
return ResponseOutput.NotOk(_localizer["TrialConfig_ProjectNotInitialized"]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var trialInfo = await _trialRepository.Where(t => t.Id == trialConfig.TrialId, true).Include(t => t.TrialDicList.Where(u => u.KeyName == StaticData.Criterion)).FirstOrDefaultAsync();
|
||||
if (trialInfo == null) return Null404NotFound(trialInfo);
|
||||
|
@ -1005,7 +1006,7 @@ namespace IRaCIS.Core.Application
|
|||
_mapper.Map(trialConfig, trialInfo);
|
||||
|
||||
//不管是否修改,一定要记录稽查
|
||||
trialInfo.UpdateTime=DateTime.Now;
|
||||
trialInfo.UpdateTime = DateTime.Now;
|
||||
|
||||
//// 修改临床数据
|
||||
|
||||
|
@ -1014,7 +1015,7 @@ namespace IRaCIS.Core.Application
|
|||
foreach (var item in clinicalDataTrialSetList)
|
||||
{
|
||||
|
||||
if(trialConfig.ClinicalDataTrialSetIds.Contains(item.Id))
|
||||
if (trialConfig.ClinicalDataTrialSetIds.Contains(item.Id))
|
||||
{
|
||||
item.IsConfirm = true;
|
||||
}
|
||||
|
@ -1307,5 +1308,29 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
|
||||
public async Task<IResponseOutput<List<TrialBodyPartView>>> GetTrialBodyPartList(Guid trialId)
|
||||
{
|
||||
var list = await _trialRepository.Where(t => t.Id == trialId).SelectMany(t => t.TrialBodyPartList).Select(t=>new TrialBodyPartView() { Code=t.Code,Name=_userInfo.IsEn_Us?t.Name:t.NameCN}).ToListAsync();
|
||||
|
||||
return ResponseOutput.Ok(list);
|
||||
}
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialBodyPart(AddOrUpdateTrialBodyPartCommand incommand)
|
||||
{
|
||||
|
||||
var exp = new EntityVerifyExp<TrialBodyPart>()
|
||||
{
|
||||
VerifyExp = t => (t.Name.Equals(incommand.Name) || t.NameCN.Equals(incommand.NameCN)),
|
||||
|
||||
VerifyMsg = _localizer["TrialBodyPart_DupName"]
|
||||
};
|
||||
|
||||
var cro = await _repository.InsertOrUpdateAsync<TrialBodyPart, AddOrUpdateTrialBodyPartCommand>(incommand, true, exp);
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok(cro.Id.ToString());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,8 +43,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<VisitTask, ReReadingApprovalToBeDoneDto>();
|
||||
|
||||
|
||||
|
||||
CreateMap<AddOrUpdateTrialBodyPartCommand, TrialBodyPart>();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
using BeetleX;
|
||||
using BeetleX.BNR;
|
||||
using Castle.DynamicProxy.Generators.Emitters.SimpleAST;
|
||||
using IP2Region.Net.XDB;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
|
@ -102,7 +104,7 @@ namespace IRaCIS.Application.Services
|
|||
FullFilePath = sysDoc.Path
|
||||
};
|
||||
|
||||
var list=systemDocQuery.OrderBy(t=>t.ConfirmUserId).ThenBy(t=>t.ConfirmTime).ToList();
|
||||
var list = systemDocQuery.OrderBy(t => t.ConfirmUserId).ThenBy(t => t.ConfirmTime).ToList();
|
||||
|
||||
//var aa= _dicRepository._dbContext.Subject.Where(t => t.Id == Guid.Empty).ExecuteUpdate("FirstName","ddd");
|
||||
|
||||
|
@ -271,7 +273,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var c = MD5Helper.Md5("123456");
|
||||
|
||||
|
||||
|
||||
|
||||
return new { env.EnvironmentName, EMailConfig = _systemEmailConfig.CurrentValue, BasicConfig = _basicConfig.CurrentValue };
|
||||
|
||||
|
@ -354,6 +356,28 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
|
||||
public async Task<IResponseOutput> ModifyTrialBodyPart()
|
||||
{
|
||||
|
||||
var searchList = await _dicRepository.Where(t => t.Parent.Code == "BodyPart" && t.ParentId != null && t.IsEnable).ProjectTo<BasicDicSelect>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var needAddBodyPartList = searchList.Select(t => new TrialBodyPart() { Code = t.Code, Name = t.Value, NameCN = t.ValueCN });
|
||||
|
||||
var trialIds = _repository.Where<Trial>(t => !t.TrialBodyPartList.Any()).Select(t => t.Id).ToList();
|
||||
|
||||
foreach (var trialId in trialIds)
|
||||
{
|
||||
var tempList = needAddBodyPartList.Clone();
|
||||
|
||||
tempList.ForEach(t => t.TrialId = trialId);
|
||||
|
||||
await _repository.AddRangeAsync(tempList);
|
||||
}
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
#region 历史维护
|
||||
/// <summary>
|
||||
/// 维护临床数据 --一定要在同步表前同步数据才行
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[ForeignKey("JudgeVisitTaskId")]
|
||||
public VisitTask JudgeVisitTask { get; set; }
|
||||
|
||||
//public SubjectUser SujectArm { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public Subject Subject { get; set; }
|
||||
|
|
|
@ -35,8 +35,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public TrialSite TrialSite { get; set; }
|
||||
[JsonIgnore]
|
||||
public Trial Trial { get; set; }
|
||||
[JsonIgnore]
|
||||
public Site Site { get; set; }
|
||||
|
||||
|
||||
public DateTime? DeletedTime { get; set; }
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@ namespace IRaCIS.Core.Domain.Models
|
|||
TrialDicList = new List<TrialDictionary>();
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public List<TrialBodyPart> TrialBodyPartList { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public List<TaskMedicalReview> TaskMedicalReviewList { get; set; }
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ using System;
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Collections.Generic;
|
||||
namespace IRaCIS.Core.Domain.Models
|
||||
{
|
||||
///<summary>
|
||||
|
@ -30,6 +31,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Guid? Auditor { get; set; }
|
||||
|
||||
|
||||
//public SubjectVisitStateEnum VisitState { get; set; }
|
||||
|
||||
//核查状态
|
||||
public CheckStateEnum CheckState { get; set; }
|
||||
|
@ -218,12 +217,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Subject Subject { get; set; }
|
||||
|
||||
|
||||
//// 一个访视可以被多个参与者 查看
|
||||
//public List<TrialUser> TrialUsers { get; set; }
|
||||
|
||||
////一个访视 对应该Site下的多个CRC管理 必须加这个 不然生成的sql 会报 TrialSiteUserId 不存在该列名
|
||||
|
||||
//public List<TrialSiteUser> TrialSiteUserList { get; set; }
|
||||
[JsonIgnore]
|
||||
public List<PreviousHistory> PreviousHistoryList { get; set; }
|
||||
[JsonIgnore]
|
||||
|
|
|
@ -300,8 +300,6 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
#region Institution
|
||||
|
||||
|
||||
|
||||
public virtual DbSet<Site> ResearchCenter { get; set; }
|
||||
public virtual DbSet<Hospital> Hospitals { get; set; }
|
||||
public virtual DbSet<CRO> CROCompany { get; set; }
|
||||
public virtual DbSet<Sponsor> Sponsor { get; set; }
|
||||
|
|
Loading…
Reference in New Issue