阅片期稽查记录

Uat_Study
hang 2022-08-17 17:27:19 +08:00
parent 0af910f3ec
commit 681c0fd02e
7 changed files with 168 additions and 193 deletions

View File

@ -3110,6 +3110,13 @@
<param name="inDto"></param>
<returns></returns>
</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">
<summary>
阅片医学审核
@ -6931,13 +6938,6 @@
生成的阅片模块(在大列表上展示的) 阅片期
</summary>
</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)">
<summary>
获取读片模块
@ -7215,7 +7215,7 @@
</member>
<member name="M:IRaCIS.Application.Services.EnrollService.EnrollBackOrOut(System.Guid,System.Guid,System.Int32,System.Nullable{System.DateTime})">
<summary>
optType 0表示回退,回退之后,列表没这条数据了, 1表示出组需要填写出组时间
optType 0表示入组,列表没这条数据了, 1表示出组需要填写出组时间 废弃
</summary>
<param name="trialId"></param>
<param name="doctorId"></param>

View File

@ -1,15 +1,7 @@
using IRaCIS.Application.Interfaces;
using IRaCIS.Core.Infra.EFCore;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Domain.Share;
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 MassTransit;
using Panda.DynamicWebApi.Attributes;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Infra.EFCore.Common;
using System.Linq.Dynamic.Core;
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>
@ -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>
@ -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>

View File

@ -446,6 +446,7 @@ namespace IRaCIS.Application.Services
{
TaskState = TaskState.Adbandon
});
await _readModuleRepository.DeleteFromQueryAsync(x => x.ReadingPeriodSetId == indto.Id);
}
@ -469,8 +470,10 @@ namespace IRaCIS.Application.Services
[HttpDelete("{readingPeriodSetId:guid}")]
public async Task<IResponseOutput> DeleteReadingPeriodSet(Guid readingPeriodSetId)
{
var success = await _repository.BatchDeleteAsync<ReadingPeriodSet>(t => t.Id == readingPeriodSetId);
return ResponseOutput.Result(success);
await _readingPeriodSetRepository.DeleteFromQueryAsync(t => t.Id == readingPeriodSetId,true);
await _readingPeriodPlanRepository.DeleteFromQueryAsync(t => t.ReadingPeriodSetId == readingPeriodSetId, true);
return ResponseOutput.Ok();
}
}
}

View File

@ -433,8 +433,10 @@ namespace IRaCIS.Application.Services
}
/// <summary>
/// optType 0表示回退回退之后列表没这条数据了 1表示出组需要填写出组时间
/// optType 0表示入组,列表没这条数据了, 1表示出组需要填写出组时间 废弃
/// </summary>
/// <param name="trialId"></param>
/// <param name="doctorId"></param>
@ -444,6 +446,7 @@ namespace IRaCIS.Application.Services
[HttpPost("{trialId:guid}/{doctorId:guid}/{optType:int}")]
[TypeFilter(typeof(TrialResourceFilter))]
[Authorize(Policy = IRaCISPolicy.PM_APM_SPM_CPM)]
[Obsolete]
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);

View File

@ -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='Associate Professor',RankOtherCN='副教授' where RankId='3a6e3335-cea4-4803-a136-d6301883a937'
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')

View File

@ -847,15 +847,75 @@ 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)))
{
var entity = item.Entity as ReadingPeriodSet;
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)
//{
// await InsertInspection<EnrollDetail>(item.Entity as EnrollDetail, type, x => new DataInspection()
// {
// GeneralId = x.Id,
// });
// 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
}
@ -889,6 +949,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var generalData = await GetInspectionGeneralDataAsync( inspection);
//不可少 因为稽查实体可能某些Id没有
MapEntityPropertyToAuditEntity(generalData, inspection);
#region 处理标识
@ -972,7 +1034,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
SiteCode = inspection.SiteCode,
SiteId = inspection.SiteId,
SiteName = inspection.SiteName,
//SiteName = inspection.SiteName,
SubjectCode = inspection.SubjectCode,
SubjectId = inspection.SubjectId,
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 项目名称
@ -1002,53 +1132,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
#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;
}
@ -1218,7 +1302,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//CreateUserName = add.CreateUserName,
SiteCode = add.SiteCode,
SiteId = add.SiteId,
SiteName = add.SiteName,
//SiteName = add.SiteName,
SubjectCode = add.SubjectCode,
SubjectId = add.SubjectId,
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();
// 添加Site 哪里会带信息过来
if (string.IsNullOrEmpty(generalData.SiteName))
{
generalData.SiteName = (await _dbContext.Site.Where(x => x.Id == generalData.SiteId).Select(x => x.SiteName).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();
}
//}
}

View File

@ -175,10 +175,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
/// </summary>
public string ResearchProgramNo { get; set; }
/// <summary>
/// 中心名称
/// </summary>
public string SiteName { get; set; }
/// <summary>
/// 受试者名称