阅片期稽查记录
parent
0af910f3ec
commit
681c0fd02e
|
@ -3110,6 +3110,13 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.OrganInfoService.SetOrganIsEnable(IRaCIS.Core.Application.ViewModel.SetOrganIsEnableInDto)">
|
||||||
|
<summary>
|
||||||
|
设置项目器官是否生效
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.Service.ReadingMedicalReviewService">
|
<member name="T:IRaCIS.Core.Application.Service.ReadingMedicalReviewService">
|
||||||
<summary>
|
<summary>
|
||||||
阅片医学审核
|
阅片医学审核
|
||||||
|
@ -6931,13 +6938,6 @@
|
||||||
生成的阅片模块(在大列表上展示的) 阅片期
|
生成的阅片模块(在大列表上展示的) 阅片期
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadModuleService.GetReadPlanList(IRaCIS.Core.Application.Service.Reading.Dto.GetReadModuleDto)">
|
|
||||||
<summary>
|
|
||||||
获取读片计划列表 byZhouhang
|
|
||||||
</summary>
|
|
||||||
<param name="dto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Application.Services.ReadModuleService.GetReadModuleList(IRaCIS.Core.Application.Service.Reading.Dto.GetReadModuleDto)">
|
<member name="M:IRaCIS.Application.Services.ReadModuleService.GetReadModuleList(IRaCIS.Core.Application.Service.Reading.Dto.GetReadModuleDto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取读片模块
|
获取读片模块
|
||||||
|
@ -7215,7 +7215,7 @@
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.EnrollService.EnrollBackOrOut(System.Guid,System.Guid,System.Int32,System.Nullable{System.DateTime})">
|
<member name="M:IRaCIS.Application.Services.EnrollService.EnrollBackOrOut(System.Guid,System.Guid,System.Int32,System.Nullable{System.DateTime})">
|
||||||
<summary>
|
<summary>
|
||||||
optType 0表示回退,回退之后,列表没这条数据了, 1表示出组,需要填写出组时间
|
optType 0表示入组,列表没这条数据了, 1表示出组,需要填写出组时间 废弃
|
||||||
</summary>
|
</summary>
|
||||||
<param name="trialId"></param>
|
<param name="trialId"></param>
|
||||||
<param name="doctorId"></param>
|
<param name="doctorId"></param>
|
||||||
|
|
|
@ -1,15 +1,7 @@
|
||||||
using IRaCIS.Application.Interfaces;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
using IRaCIS.Core.Application.Filter;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using IRaCIS.Core.Application.Service.WorkLoad.DTO;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using IRaCIS.Core.Application.Auth;
|
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using Panda.DynamicWebApi.Attributes;
|
|
||||||
using IRaCIS.Core.Application.Contracts;
|
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using System.Linq.Dynamic.Core;
|
using System.Linq.Dynamic.Core;
|
||||||
using IRaCIS.Core.Application.Service;
|
using IRaCIS.Core.Application.Service;
|
||||||
|
@ -71,89 +63,6 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取读片计划列表 byZhouhang
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<(PageOutput<ReadPlanView>, object)> GetReadPlanList(GetReadModuleDto dto)
|
|
||||||
{
|
|
||||||
var subjectQuery = _subjectRepository
|
|
||||||
.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
|
|
||||||
.WhereIf(dto.SubjectId != null, x => x.Id == dto.SubjectId)
|
|
||||||
.WhereIf(dto.TrialSiteCode != null, x => x.TrialSite.TrialSiteCode == dto.TrialSiteCode)
|
|
||||||
.WhereIf(dto.SubjectCode != null, x => x.Code == dto.SubjectCode)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.Select(x => new ReadPlanView
|
|
||||||
{
|
|
||||||
TrialSiteCode = x.TrialSite.TrialSiteCode,
|
|
||||||
SiteCode = x.TrialSite.TrialSiteCode,
|
|
||||||
SiteId = x.SiteId,
|
|
||||||
SubjectCode = x.Code,
|
|
||||||
SubjectId = x.Id,
|
|
||||||
|
|
||||||
//Data = x.SubjectVisitList.OrderByDescending(y => y.VisitNum).Select(y => new GetReadModuleOutDto()
|
|
||||||
//{
|
|
||||||
// Id = y.Id, //id
|
|
||||||
// Name = y.VisitName,
|
|
||||||
// ModuleType = y.InPlan ? ModuleTypeEnum.InPlanSubjectVisit : ModuleTypeEnum.OutPlanSubjectVisit, // 模块类型
|
|
||||||
// IsUrgent = x.IsUrgent, // 是否加急
|
|
||||||
// SubjectVisitId = y.Id, // 访视ID
|
|
||||||
// SubjectVisitName = y.VisitName, // 访视名称
|
|
||||||
// Status = ReadingCommon.GetVisitSubmitStateEnum(y), // 状态
|
|
||||||
// CreateTime = y.CreateTime, // 创建时间
|
|
||||||
// SubjectCode = y.Subject.Code, // 受试者code
|
|
||||||
// TrialSiteCode = x.TrialSite.TrialSiteCode, // 中心Code
|
|
||||||
// VisitNum = y.VisitNum,
|
|
||||||
|
|
||||||
// IsFinalVisit = y.IsFinalVisit, // 是否为末次评估
|
|
||||||
// OutPlanPreviousVisitId = y.OutPlanPreviousVisitId, // 上一访视
|
|
||||||
// OutPlanPreviousVisitName = y.OutPlanPreviousVisit.VisitName, // 上一访视名称
|
|
||||||
// SiteId = x.Site.Id, // 中心ID
|
|
||||||
// IsVisit = true, // 是否为访视
|
|
||||||
// PDState = y.PDState, // PD 进展
|
|
||||||
// IsEnrollmentConfirm = y.IsEnrollmentConfirm, // 入组
|
|
||||||
// SubjectId = x.Id,
|
|
||||||
//}).ToList(),
|
|
||||||
|
|
||||||
//ReadModuleData = x.ReadModuleList.Select(
|
|
||||||
// z => new GetReadModuleOutDto()
|
|
||||||
// {
|
|
||||||
// CreateTime = z.CreateTime,
|
|
||||||
// Id = z.Id,
|
|
||||||
// Name = z.ModuleName,
|
|
||||||
// SubjectId = x.Id,
|
|
||||||
// ModuleType = z.ModuleType,
|
|
||||||
// Status = ReadingCommon.GetVisitSubmitStateEnum(z.SubjectVisit),
|
|
||||||
// SubjectCode = x.Code,
|
|
||||||
// TrialSiteCode = x.TrialSite.TrialSiteCode,
|
|
||||||
// SubjectVisitId = z.SubjectVisitId,
|
|
||||||
// SubjectVisitName = z.SubjectVisit.VisitName, // 截止访视名称
|
|
||||||
// CutOffVisitId = z.SubjectVisitId, // 截止访视
|
|
||||||
// CutOffVisitName = z.SubjectVisit.VisitName, // 截止访视名称
|
|
||||||
// ReadModuleId = z.ReadModuleId,
|
|
||||||
// ReadModuleName = z.ReadModuleModel.ModuleName,
|
|
||||||
// IsUrgent = z.IsUrgent
|
|
||||||
// }).ToList(),
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
var pageList = await subjectQuery.ToPagedListAsync(dto.PageIndex, dto.PageSize, dto.SortField == null || dto.SortField == string.Empty ? "SiteCode" : dto.SortField,
|
|
||||||
dto.Asc);
|
|
||||||
|
|
||||||
return (pageList, new
|
|
||||||
{
|
|
||||||
MaxLength = pageList.CurrentPageData.ToList().Count()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取读片模块
|
/// 获取读片模块
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -215,17 +124,6 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 访视阅片完成添加阅片期模块
|
|
||||||
///// </summary>
|
|
||||||
///// <returns></returns>
|
|
||||||
//public async Task<IResponseOutput> VisitFinishReadingAddReadModule(VisitFinishReadingAddReadModuleInDto inDto)
|
|
||||||
//{
|
|
||||||
// var subjectVisit = await _subjectRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == inDto.SubjectVisitId);
|
|
||||||
// List<ReadingPeriodSet> readingPeriodSets= _readingPeriodSetRepository.Where(x=>x.TrialId==inDto.TrialId&&x.IsTakeEffect=&&(x.ReadingScope==ReadingScopeEnum.All||(x.ReadingScope==ReadingScopeEnum.Site&&x.ReadingPeriodSites.Select(y=>y.SiteId).Contains(subjectVisit.SiteId))))
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取单条详情信息
|
/// 获取单条详情信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -445,18 +343,6 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 新增或者修改
|
|
||||||
///// </summary>
|
|
||||||
///// <param name="addOrEditReadModule"></param>
|
|
||||||
///// <returns></returns>
|
|
||||||
//[HttpPost]
|
|
||||||
//public async Task<IResponseOutput> AddOrUpdateReadModuleService(ReadModuleAddOrEdit addOrEditReadModule)
|
|
||||||
//{
|
|
||||||
// var entity = await _repository.InsertOrUpdateAsync<ReadModule, ReadModuleAddOrEdit>(addOrEditReadModule, true);
|
|
||||||
// return ResponseOutput.Ok(entity.Id.ToString());
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -446,6 +446,7 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
TaskState = TaskState.Adbandon
|
TaskState = TaskState.Adbandon
|
||||||
});
|
});
|
||||||
|
|
||||||
await _readModuleRepository.DeleteFromQueryAsync(x => x.ReadingPeriodSetId == indto.Id);
|
await _readModuleRepository.DeleteFromQueryAsync(x => x.ReadingPeriodSetId == indto.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,8 +470,10 @@ namespace IRaCIS.Application.Services
|
||||||
[HttpDelete("{readingPeriodSetId:guid}")]
|
[HttpDelete("{readingPeriodSetId:guid}")]
|
||||||
public async Task<IResponseOutput> DeleteReadingPeriodSet(Guid readingPeriodSetId)
|
public async Task<IResponseOutput> DeleteReadingPeriodSet(Guid readingPeriodSetId)
|
||||||
{
|
{
|
||||||
var success = await _repository.BatchDeleteAsync<ReadingPeriodSet>(t => t.Id == readingPeriodSetId);
|
await _readingPeriodSetRepository.DeleteFromQueryAsync(t => t.Id == readingPeriodSetId,true);
|
||||||
return ResponseOutput.Result(success);
|
await _readingPeriodPlanRepository.DeleteFromQueryAsync(t => t.ReadingPeriodSetId == readingPeriodSetId, true);
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,8 +433,10 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// optType 0表示回退,回退之后,列表没这条数据了, 1表示出组,需要填写出组时间
|
/// optType 0表示入组,列表没这条数据了, 1表示出组,需要填写出组时间 废弃
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="trialId"></param>
|
/// <param name="trialId"></param>
|
||||||
/// <param name="doctorId"></param>
|
/// <param name="doctorId"></param>
|
||||||
|
@ -444,6 +446,7 @@ namespace IRaCIS.Application.Services
|
||||||
[HttpPost("{trialId:guid}/{doctorId:guid}/{optType:int}")]
|
[HttpPost("{trialId:guid}/{doctorId:guid}/{optType:int}")]
|
||||||
[TypeFilter(typeof(TrialResourceFilter))]
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
[Authorize(Policy = IRaCISPolicy.PM_APM_SPM_CPM)]
|
[Authorize(Policy = IRaCISPolicy.PM_APM_SPM_CPM)]
|
||||||
|
[Obsolete]
|
||||||
public async Task<IResponseOutput> EnrollBackOrOut(Guid trialId, Guid doctorId, int optType, DateTime? outEnrollTime)
|
public async Task<IResponseOutput> EnrollBackOrOut(Guid trialId, Guid doctorId, int optType, DateTime? outEnrollTime)
|
||||||
{
|
{
|
||||||
var intoGroupItem = await _enrollRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.DoctorId == doctorId);
|
var intoGroupItem = await _enrollRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.DoctorId == doctorId);
|
||||||
|
|
|
@ -20,3 +20,6 @@ update Doctor set Physician='Deputy Chief Physician',PhysicianCN='
|
||||||
update Doctor set RankOther='Professor',RankOtherCN='教授' where RankId='dcbf4d1a-8373-4539-a0ae-1ba76d57bb48'
|
update Doctor set RankOther='Professor',RankOtherCN='教授' where RankId='dcbf4d1a-8373-4539-a0ae-1ba76d57bb48'
|
||||||
update Doctor set RankOther='Associate Professor',RankOtherCN='副教授' where RankId='3a6e3335-cea4-4803-a136-d6301883a937'
|
update Doctor set RankOther='Associate Professor',RankOtherCN='副教授' where RankId='3a6e3335-cea4-4803-a136-d6301883a937'
|
||||||
update Doctor set Physician='Staff',PhysicianCN='医师' where RankId='82411c2e-9832-4c6f-a859-e3b6e796760d'
|
update Doctor set Physician='Staff',PhysicianCN='医师' where RankId='82411c2e-9832-4c6f-a859-e3b6e796760d'
|
||||||
|
|
||||||
|
|
||||||
|
update DataInspection set JsonDetail= replace(cast(JsonDetail as varchar(max)),'Insepection','CommonData')
|
||||||
|
|
|
@ -847,14 +847,74 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//// 医生详情
|
//阅片期
|
||||||
//foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(EnrollDetail)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingPeriodSet)))
|
||||||
//{
|
{
|
||||||
// await InsertInspection<EnrollDetail>(item.Entity as EnrollDetail, type, x => new DataInspection()
|
var entity = item.Entity as ReadingPeriodSet;
|
||||||
// {
|
|
||||||
// GeneralId = x.Id,
|
var visitName = _dbContext.VisitPlans.Where(t => t.Id == entity.VisitStageId).Select(t => t.VisitName).FirstOrDefault();
|
||||||
// });
|
|
||||||
//}
|
var siteCodes = string.Empty;
|
||||||
|
if (entity.ReadingScope == ReadingScopeEnum.Site)
|
||||||
|
{
|
||||||
|
var siteIds = entity.ReadingPeriodSites.Select(t => t.SiteId).ToList();
|
||||||
|
var nameList = _dbContext.TrialSite.Where(c => c.TrialId == entity.TrialId && siteIds.Contains(c.SiteId) ).Select(t => t.TrialSiteCode).ToList();
|
||||||
|
|
||||||
|
siteCodes = String.Join(',', nameList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
await InsertInspection<ReadingPeriodSet>(item.Entity as ReadingPeriodSet, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
GeneralId = x.Id,
|
||||||
|
}, new
|
||||||
|
{
|
||||||
|
VisitName = visitName,
|
||||||
|
SiteCodes = siteCodes
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingPeriodPlan)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as ReadingPeriodPlan;
|
||||||
|
|
||||||
|
if (entity.ReadingPeriodSet == null)
|
||||||
|
{
|
||||||
|
entity.ReadingPeriodSet = _dbContext.ReadingPeriodSet.Find(entity.ReadingPeriodSetId);
|
||||||
|
}
|
||||||
|
|
||||||
|
await InsertInspection<ReadingPeriodPlan>(item.Entity as ReadingPeriodPlan, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
GeneralId = x.Id,
|
||||||
|
SubjectVisitId = x.SubjectVisitId,
|
||||||
|
}, new
|
||||||
|
{
|
||||||
|
entity.ReadingPeriodSet.ReadingPeriodName,
|
||||||
|
entity.ReadingPeriodSet.EffectOfTime,
|
||||||
|
entity.ReadingPeriodSet.ExpirationDate
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadModule)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as ReadModule;
|
||||||
|
|
||||||
|
//if (entity.ReadingPeriodSet == null && entity.ReadingPeriodSetId !=null)
|
||||||
|
//{
|
||||||
|
// entity.ReadingPeriodSet = _dbContext.ReadingPeriodSet.Find(entity.ReadingPeriodSetId);
|
||||||
|
//}
|
||||||
|
|
||||||
|
var visitName = _dbContext.SubjectVisit.Where(t => t.Id == entity.SubjectVisitId).Select(t => t.VisitName).FirstOrDefault();
|
||||||
|
await InsertInspection<ReadModule>(item.Entity as ReadModule, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
GeneralId = x.Id,
|
||||||
|
SubjectVisitId = x.SubjectVisitId,
|
||||||
|
}, new
|
||||||
|
{
|
||||||
|
|
||||||
|
VisitName = visitName,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -887,8 +947,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
//将实体对象属性 映射到稽查实体
|
//将实体对象属性 映射到稽查实体
|
||||||
MapEntityPropertyToAuditEntity(entityObj, inspection);
|
MapEntityPropertyToAuditEntity(entityObj, inspection);
|
||||||
|
|
||||||
var generalData = await GetInspectionGeneralDataAsync(inspection);
|
var generalData = await GetInspectionGeneralDataAsync( inspection);
|
||||||
|
|
||||||
|
//不可少 因为稽查实体可能某些Id没有
|
||||||
|
MapEntityPropertyToAuditEntity(generalData, inspection);
|
||||||
|
|
||||||
#region 处理标识
|
#region 处理标识
|
||||||
|
|
||||||
|
@ -965,14 +1027,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inspection"></param>
|
/// <param name="inspection"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<InspectionGeneralData> GetInspectionGeneralDataAsync(InspectionConvertDTO inspection)
|
public async Task<InspectionGeneralData> GetInspectionGeneralDataAsync( InspectionConvertDTO inspection)
|
||||||
{
|
{
|
||||||
|
|
||||||
InspectionGeneralData generalData = new InspectionGeneralData()
|
InspectionGeneralData generalData = new InspectionGeneralData()
|
||||||
{
|
{
|
||||||
SiteCode = inspection.SiteCode,
|
SiteCode = inspection.SiteCode,
|
||||||
SiteId = inspection.SiteId,
|
SiteId = inspection.SiteId,
|
||||||
SiteName = inspection.SiteName,
|
//SiteName = inspection.SiteName,
|
||||||
SubjectCode = inspection.SubjectCode,
|
SubjectCode = inspection.SubjectCode,
|
||||||
SubjectId = inspection.SubjectId,
|
SubjectId = inspection.SubjectId,
|
||||||
SubjectVisitId = inspection.SubjectVisitId,
|
SubjectVisitId = inspection.SubjectVisitId,
|
||||||
|
@ -983,6 +1045,74 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 访视 阅片期那里关联了访视
|
||||||
|
|
||||||
|
if (generalData.SubjectVisitId != null)
|
||||||
|
{
|
||||||
|
//添加访视的时候,会带信息过来
|
||||||
|
if (string.IsNullOrEmpty(generalData.SubjectVisitName))
|
||||||
|
{
|
||||||
|
var info = (await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x =>
|
||||||
|
new { x.VisitName, x.SubjectId, x.SiteId, SubjectCode = x.Subject.Code, TrialSiteCode = x.TrialSite.TrialSiteCode ,x.TrialId,x.Trial.ExperimentName,x.Trial.ResearchProgramNo}).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
generalData.SubjectVisitName = info.VisitName;
|
||||||
|
|
||||||
|
generalData.TrialId = info.TrialId;
|
||||||
|
generalData.TrialName = info.ExperimentName;
|
||||||
|
generalData.ResearchProgramNo = info.ResearchProgramNo;
|
||||||
|
generalData.SiteId = info.SiteId;
|
||||||
|
generalData.SubjectCode = info.SubjectCode;
|
||||||
|
generalData.SubjectId = info.SubjectId;
|
||||||
|
generalData.SiteCode = info.TrialSiteCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 受试者
|
||||||
|
|
||||||
|
if (generalData.SubjectId != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
// 添加Subject 哪里会带信息过来
|
||||||
|
if (string.IsNullOrEmpty(generalData.SubjectCode))
|
||||||
|
{
|
||||||
|
var info = (await _dbContext.Subject.Where(x => x.Id == generalData.SubjectId).Select(x => new { SubjectId = x.Id, SubjectCode = x.Code, x.SiteId, TrialSiteCode = x.TrialSite.TrialSiteCode, x.TrialId, x.Trial.ExperimentName, x.Trial.ResearchProgramNo }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
|
generalData.TrialId = info.TrialId;
|
||||||
|
generalData.TrialName = info.ExperimentName;
|
||||||
|
generalData.ResearchProgramNo = info.ResearchProgramNo;
|
||||||
|
generalData.SiteId = info.SiteId;
|
||||||
|
generalData.SubjectCode = info.SubjectCode;
|
||||||
|
generalData.SubjectId = info.SubjectId;
|
||||||
|
generalData.SiteCode = info.TrialSiteCode;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 中心Code
|
||||||
|
|
||||||
|
if (generalData.TrialId != null && generalData.SiteId != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
generalData.SiteCode = (await _dbContext.TrialSite.IgnoreQueryFilters().Where(x => x.TrialId == generalData.TrialId && x.SiteId == generalData.SiteId).Select(t => t.TrialSiteCode).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 项目名称
|
#region 项目名称
|
||||||
|
|
||||||
|
|
||||||
|
@ -1002,53 +1132,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 测试中心名称
|
|
||||||
|
|
||||||
if (generalData.TrialId != null && generalData.SiteId != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
generalData.SiteCode = (await _dbContext.TrialSite.IgnoreQueryFilters().Where(x => x.TrialId == generalData.TrialId && x.SiteId == generalData.SiteId).Select(t => t.TrialSiteCode).FirstOrDefaultAsync()).IfNullThrowException();
|
|
||||||
|
|
||||||
|
|
||||||
// 添加Site 哪里会带信息过来
|
|
||||||
if (string.IsNullOrEmpty(generalData.SiteName))
|
|
||||||
{
|
|
||||||
generalData.SiteName = (await _dbContext.Site.Where(x => x.Id == generalData.SiteId).Select(x => x.SiteName).FirstOrDefaultAsync()).IfNullThrowException();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 受试者
|
|
||||||
|
|
||||||
if (generalData.SubjectId != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
// 添加Subject 哪里会带信息过来
|
|
||||||
if (string.IsNullOrEmpty(generalData.SubjectCode))
|
|
||||||
{
|
|
||||||
generalData.SubjectCode = (await _dbContext.Subject.Where(x => x.Id == generalData.SubjectId).Select(x => x.Code).FirstOrDefaultAsync()).IfNullThrowException();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 访视
|
|
||||||
|
|
||||||
if (generalData.SubjectVisitId != null)
|
|
||||||
{
|
|
||||||
//添加访视的时候,会带信息过来
|
|
||||||
if (string.IsNullOrEmpty(generalData.SubjectVisitName))
|
|
||||||
{
|
|
||||||
generalData.SubjectVisitName = (await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x => x.VisitName).FirstOrDefaultAsync()).IfNullThrowException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
return generalData;
|
return generalData;
|
||||||
}
|
}
|
||||||
|
@ -1218,7 +1302,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
//CreateUserName = add.CreateUserName,
|
//CreateUserName = add.CreateUserName,
|
||||||
SiteCode = add.SiteCode,
|
SiteCode = add.SiteCode,
|
||||||
SiteId = add.SiteId,
|
SiteId = add.SiteId,
|
||||||
SiteName = add.SiteName,
|
//SiteName = add.SiteName,
|
||||||
SubjectCode = add.SubjectCode,
|
SubjectCode = add.SubjectCode,
|
||||||
SubjectId = add.SubjectId,
|
SubjectId = add.SubjectId,
|
||||||
SubjectVisitId = add.SubjectVisitId,
|
SubjectVisitId = add.SubjectVisitId,
|
||||||
|
@ -1302,12 +1386,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
generalData.SiteCode = (await _dbContext.TrialSite.IgnoreQueryFilters().Where(x => x.TrialId == generalData.TrialId && x.SiteId == generalData.SiteId).Select(t => t.TrialSiteCode).FirstOrDefaultAsync()).IfNullThrowException();
|
generalData.SiteCode = (await _dbContext.TrialSite.IgnoreQueryFilters().Where(x => x.TrialId == generalData.TrialId && x.SiteId == generalData.SiteId).Select(t => t.TrialSiteCode).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
// 添加Site 哪里会带信息过来
|
//// 添加Site 哪里会带信息过来
|
||||||
if (string.IsNullOrEmpty(generalData.SiteName))
|
//if (string.IsNullOrEmpty(generalData.SiteName))
|
||||||
{
|
//{
|
||||||
generalData.SiteName = (await _dbContext.Site.Where(x => x.Id == generalData.SiteId).Select(x => x.SiteName).FirstOrDefaultAsync()).IfNullThrowException();
|
// generalData.SiteName = (await _dbContext.Site.Where(x => x.Id == generalData.SiteId).Select(x => x.SiteName).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -175,10 +175,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ResearchProgramNo { get; set; }
|
public string ResearchProgramNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 中心名称
|
|
||||||
/// </summary>
|
|
||||||
public string SiteName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 受试者名称
|
/// 受试者名称
|
||||||
|
|
Loading…
Reference in New Issue